def to_s3_uri(code_dict):
try:<EOL><INDENT>uri = "<STR_LIT>".format(bucket=code_dict["<STR_LIT>"], key=code_dict["<STR_LIT>"])<EOL>version = code_dict.get("<STR_LIT>", None)<EOL><DEDENT>except (TypeError, AttributeError):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if version:<EOL><INDENT>uri += "<STR_LIT>" + version<EOL><DEDENT>return uri<EOL>
Constructs a S3 URI string from given code dictionary

    :param dict code_dict: Dictionary containing Lambda function Code S3 location of the form
                          {S3Bucket, S3Key, S3ObjectVersion}
    :return: S3 URI of form s3://bucket/key?versionId=version
    :rtype string