code: def is_valid_policy_type(policy):
      
      if _is_py3:
          string_type = str,
      elif _is_py2:
          string_type = basestring
  
      if not isinstance(policy, string_type):
          raise TypeError('policy can only be of type str')
  
      is_non_empty_string(policy)
  
      return True
docs: Validate if policy is type str
  
      :param policy: S3 style Bucket policy.
      :return: True if policy parameter is of a valid type, 'string'.
      Raise :exc:`TypeError` otherwise.