def copy_object(self, region, from_container, stored_object,
                    to_container=None, new_object_name=None):
        try:
            region_name = region.name
        except AttributeError:
            region_name = region
        try:
            from_container_name = from_container.name
        except AttributeError:
            from_container_name = from_container
        try:
            stored_object_name = stored_object.name
            headers = stored_object.meta
        except AttributeError:
            stored_object_name = stored_object
            headers = {}
        if to_container:
            try:
                to_container_name = to_container.name
            except AttributeError:
                to_container_name = to_container
        else:
            to_container_name = from_container_name
        if not new_object_name:
            new_object_name = stored_object_name
        original_location = '/%s/%s'%(from_container_name, stored_object_name)
        headers['X-Copy-From'] = original_location
        headers['content-length'] = 0
        self._swift_call(region_name,
                         'put_object',
                         to_container_name,
                         new_object_name,
                         None,
                         headers=headers)
Test translation of datatable filter/sorting for fields in
dataset/ETHPy150Open runabove/python-runabove/runabove/storage.py/ContainerManager.copy_object--crossover with--dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3resource.py/ResourceFilteredComponentTests.testDataTableFilterWithFilteredComponent