code: def bind_method(cls, name, func):
      """Bind a method to class, python 2 and python 3 compatible.
  
      Parameters
      ----------
  
      cls : type
          class to receive bound method
      name : basestring
          name of method on class instance
      func : function
          function to be bound as method
  
  
      Returns
      -------
      None
      """
      # only python 2 has bound/unbound method issue
      if not PY3:
          setattr(cls, name, types.MethodType(func, None, cls))
      else:
          setattr(cls, name, func)
  
imports: import re
  import functools
  import itertools
  from distutils.version import LooseVersion
  from itertools import product
  import sys
  import platform
  import types
  from unicodedata import east_asian_width
  import struct
  import inspect
  from collections import namedtuple
  import collections
  from pandas.compat.chainmap import DeepChainMap
  from collections import OrderedDict, Counter
  import dateutil
  from dateutil import parser
label_desc: Use image node_id 1 for calling a global function with example usage: bind_method(cls, name, func) without return types