code: def _type(string, has_invisible=True):
      """The least generic type (type(None), int, float, str, unicode).
  
      >>> _type(None) is type(None)
      True
      >>> _type("foo") is type("")
      True
      >>> _type("1") is type(1)
      True
      >>> _type('\x1b[31m42\x1b[0m') is type(42)
      True
      >>> _type('\x1b[31m42\x1b[0m') is type(42)
      True
  
      """
  
      if has_invisible and (
          isinstance(string, _text_type)
          or isinstance(string, _binary_type)
      ):
          string = _strip_invisible(string)
  
      if string is None:
          return _none_type
      elif hasattr(
          string, "isoformat"
      ):  # datetime.datetime, date, and time
          return _text_type
      elif _isint(string):
          return int
      elif _isnumber(string):
          return float
      elif isinstance(string, _binary_type):
          return _binary_type
      else:
          return _text_type
  
imports: from __future__ import print_function
  from __future__ import unicode_literals
  from collections import namedtuple
  from platform import python_version_tuple
  import re
label_desc: Use image node_id 9 for calling a global function with example usage: _type(string, has_invisible) and returns: _none_type, _text_type, int, float, _binary_type, _text_type