code: def method_caller(method_name, *args, **kwargs):
      """
      Return a function that will call a named method on the
      target object with optional positional and keyword
      arguments.
  
      >>> lower = method_caller('lower')
      >>> lower('MyString')
      'mystring'
      """
  
      def call_method(target):
          func = getattr(target, method_name)
          return func(*args, **kwargs)
  
      return call_method
  
imports: import functools
  import time
  import inspect
  import collections
  import types
  import itertools
  import warnings
  import setuptools.extern.more_itertools
  from typing import Callable, TypeVar
label_desc: Use image node_id 2 for calling a global function with example usage: method_caller(method_name) and returns: call_method, func