code: def ensure_dtype(func, argname, arg):
      """
      Argument preprocessor that converts the input into a numpy dtype.
  
      Examples
      --------
      >>> import numpy as np
      >>> from zipline.utils.preprocess import preprocess
      >>> @preprocess(dtype=ensure_dtype)
      ... def foo(dtype):
      ...     return dtype
      ...
      >>> foo(float)
      dtype('float64')
      """
      try:
          return dtype(arg)
      except TypeError:
          raise TypeError(
              "{func}() couldn't convert argument "
              "{argname}={arg!r} to a numpy dtype.".format(
                  func=_qualified_name(func),
                  argname=argname,
                  arg=arg,
              ),
          )
  
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 4 for calling a global function with example usage: ensure_dtype(func, argname, arg) and returns: dtype