code: def is_primitive(val):
      
      return isinstance(val,
                        (str, bool, float, complex, bytes, six.text_type)
                        + six.string_types + six.integer_types)
docs: Checks if the passed value is a primitive type.
  
      >>> is_primitive(1)
      True
  
      >>> is_primitive("abc")
      True
  
      >>> is_primitive(True)
      True
  
      >>> is_primitive({})
      False
  
      >>> is_primitive([])
      False
  
      >>> is_primitive(set([]))
  
      :param val: value to check
      :return: True if value is a primitive, else False