code: def to_type_code(value):
          
          if value == None:
              return TypeCode.Unknown
  
          if not isinstance(value, type):
              value = type(value)
  
          if value is list:
              return TypeCode.Array
          elif value is tuple:
              return TypeCode.Array
          elif value is set:
              return TypeCode.Array
          elif value is bool:
              return TypeCode.Boolean
          elif value is int:
              return TypeCode.Integer
          # elif value is long:
          #     return TypeCode.Long
          elif value is float:
              return TypeCode.Float
          elif value is str:
              return TypeCode.String
          # elif value is unicode:
          #     return TypeCode.String
          elif value is datetime:
              return TypeCode.DateTime
          elif value is dict:
              return TypeCode.Map
              
          return TypeCode.Object
docs: Gets TypeCode for specific value.
  
          :param value: value whose TypeCode is to be resolved.
  
          :return: the TypeCode that corresponds to the passed object's type.