def copy_object(self, region, from_container, stored_object,
                    to_container=None, new_object_name=None):
        """Server copy an object from a container to another one.

        Containers must be in the same region. Both containers may be
        the same. Meta-data is read and copied from the original object.

        :param region: Region where the containers are
        :param from_container: Container where the original object is
        :param stored_object: Object to copy
        :param to_container: Container where the object will be copied
            to. If None copy into the same container.
        :param new_object_name: Name of the new object. If None new name
            is taken from the original name.
        """
        try:
            region_name = region.name
        except __HOLE__:
            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)
dataset/ETHPy150Open runabove/python-runabove/runabove/storage.py/ContainerManager.copy_object