code: def ensure_upper_case(func, argname, arg):
      if isinstance(arg, string_types):
          return arg.upper()
      else:
          raise TypeError(
              "{0}() expected argument '{1}' to"
              " be a string, but got {2} instead.".format(
                  func.__name__,
                  argname,
                  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 3 for calling a global function with example usage: ensure_upper_case(func, argname, arg) and returns: arg