code: def coerce(from_, to, **to_kwargs):
      """
      A preprocessing decorator that coerces inputs of a given type by passing
      them to a callable.
  
      Parameters
      ----------
      from : type or tuple or types
          Inputs types on which to call ``to``.
      to : function
          Coercion function to call on inputs.
      **to_kwargs
          Additional keywords to forward to every call to ``to``.
  
      Examples
      --------
      >>> @preprocess(x=coerce(float, int), y=coerce(float, int))
      ... def floordiff(x, y):
      ...     return x - y
      ...
      >>> floordiff(3.2, 2.5)
      1
  
      >>> @preprocess(x=coerce(str, int, base=2), y=coerce(str, int, base=2))
      ... def add_binary_strings(x, y):
      ...     return bin(x + y)[2:]
      ...
      >>> add_binary_strings('101', '001')
      '110'
      """
  
      def preprocessor(func, argname, arg):
          if isinstance(arg, from_):
              return to(arg, **to_kwargs)
          return arg
  
      return preprocessor
  
imports: from datetime import tzinfo
  from functools import partial
  from operator import attrgetter
  from numpy import dtype
  import pandas
  from pytz import timezone
  from six import iteritems, string_types, PY3
  from toolz import valmap, complement, compose
  import toolz.curried.operator
  from zipline.utils.compat import wraps
  from zipline.utils.functional import getattrs
  from zipline.utils.preprocess import call, preprocess
label_desc: Use image node_id 17 for calling a global function with example usage: coerce(from_, to) and returns: preprocessor, arg, to