<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_s3_uri(uri):
 """Parses a S3 Uri into a dictionary of the Bucket, Key, and VersionId :return: a BodyS3Location dict or None if not an S3 Uri :rtype: dict """

    if not isinstance(uri, string_types):
        return None

    url = urlparse(uri)
    query = parse_qs(url.query)

    if url.scheme == 's3' and url.netloc and url.path:
        s3_pointer = {
            'Bucket': url.netloc,
            'Key': url.path.lstrip('/')
        }
        if 'versionId' in query and len(query['versionId']) == 1:
            s3_pointer['Version'] = query['versionId'][0]
        return s3_pointer
    else:
        return None