<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def create_policy(policyName, policyDocument,
            region=None, key=None, keyid=None, profile=None):
    '''
    Given a valid config, create a policy.

    Returns {created: true} if the policy was created and returns
    {created: False} if the policy was not created.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iot.create_policy my_policy \\
              '{"Version":"2015-12-12",\\
              "Statement":[{"Effect":"Allow",\\
                            "Action":["iot:Publish"],\\
                            "Resource":["arn:::::topic/foo/bar"]}]}'

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        if not isinstance(policyDocument, string_types):
            policyDocument = salt.utils.json.dumps(policyDocument)
        policy = conn.create_policy(policyName=policyName,
                                    policyDocument=policyDocument)
        if policy:
            log.info('The newly created policy version is %s', policy['policyVersionId'])

            return {'created': True, 'versionId': policy['policyVersionId']}
        else:
            log.warning('Policy was not created')
            return {'created': False}
    except ClientError as e:
        return {'created': False, 'error': __utils__['boto3.get_error'](e)}