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

def put_cors(Bucket,
           CORSRules,
           region=None, key=None, keyid=None, profile=None):
    '''
    Given a valid config, update the CORS rules for a bucket.

    Returns {updated: true} if CORS was updated and returns
    {updated: False} if CORS was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_cors my_bucket '[{\\
              "AllowedHeaders":[],\\
              "AllowedMethods":["GET"],\\
              "AllowedOrigins":["*"],\\
              "ExposeHeaders":[],\\
              "MaxAgeSeconds":123,\\
        }]'

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        if CORSRules is not None and isinstance(CORSRules, six.string_types):
            CORSRules = salt.utils.json.loads(CORSRules)
        conn.put_bucket_cors(Bucket=Bucket, CORSConfiguration={'CORSRules': CORSRules})
        return {'updated': True, 'name': Bucket}
    except ClientError as e:
        return {'updated': False, 'error': __utils__['boto3.get_error'](e)}