<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid_policy_type(policy):
 """ 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. """

    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