'Create an object and upload data using the given function.'

def _put_object(self, container, object_name, method='PUT', query_args=None, extra=None, file_path=None, stream=None, verify_hash=False):

    headers = {}
    extra = (extra or {})
    content_type = extra.get('content_type', None)
    meta_data = extra.get('meta_data', None)
    acl = extra.get('acl', None)
    if meta_data:
        for (key, value) in list(meta_data.items()):
            key = (self.http_vendor_prefix + ('meta-%s' % key))
            headers[key] = value
    if acl:
        if (acl not in ['public-read', 'private', 'public-read-write']):
            raise AttributeError(('invalid    acl    value:    %s' % acl))
        headers[(self.http_vendor_prefix + 'object-acl')] = acl
    request_path = self._get_object_path(container, object_name)
    if query_args:
        request_path = '?'.join((request_path, query_args))
    result_dict = self._upload_object(object_name=object_name, content_type=content_type, request_path=request_path, request_method=method, headers=headers, file_path=file_path, stream=stream)
    response = result_dict['response']
    bytes_transferred = result_dict['bytes_transferred']
    headers = response.headers
    server_hash = headers['etag'].replace('"', '')
    if (verify_hash and (result_dict['data_hash'] != server_hash)):
        raise ObjectHashMismatchError(value='MD5    hash    {0}    checksum    does    not    match    {1}'.format(server_hash, result_dict['data_hash']), object_name=object_name, driver=self)
    elif (response.status == httplib.OK):
        obj = Object(name=object_name, size=bytes_transferred, hash=server_hash, extra={'acl': acl}, meta_data=meta_data, container=container, driver=self)
        return obj
    else:
        raise LibcloudError(('Unexpected    status    code,    status_code=%s' % response.status), driver=self)
