'Create a new object from a sequence of existing objects.
The content of the object representing this Key will be the
concatenation of the given object sequence. For more detail, visit
https://developers.google.com/storage/docs/composite-objects
:type components list of Keys
:param components List of gs.Keys representing the component objects
:type content_type (optional) string
:param content_type Content type for the new composite object.'

def compose(self, components, content_type=None, headers=None):

    compose_req = []
    for key in components:
        if (key.bucket.name != self.bucket.name):
            raise BotoClientError('GCS    does    not    support    inter-bucket    composing')
        generation_tag = ''
        if key.generation:
            generation_tag = ('<Generation>%s</Generation>' % str(key.generation))
        compose_req.append(('<Component><Name>%s</Name>%s</Component>' % (key.name, generation_tag)))
    compose_req_xml = ('<ComposeRequest>%s</ComposeRequest>' % ''.join(compose_req))
    headers = (headers or {})
    if content_type:
        headers['Content-Type'] = content_type
    resp = self.bucket.connection.make_request('PUT', get_utf8_value(self.bucket.name), get_utf8_value(self.name), headers=headers, query_args='compose', data=get_utf8_value(compose_req_xml))
    if ((resp.status < 200) or (resp.status > 299)):
        raise self.bucket.connection.provider.storage_response_error(resp.status, resp.reason, resp.read())
    return resp.getheader('x-goog-generation')
