def _get_resource(self, resource_type, value, path_args=None):
        if value is None:
            # Create a bare resource
            res = resource_type()
        elif not isinstance(value, resource_type):
            # Create from an ID
            args = {resource_type.id_attribute:
                    resource.Resource.get_id(value)}
            res = resource_type.existing(**args)
        else:
            # An existing resource instance
            res = value

        # Set any intermediate path arguments, but don't overwrite Nones.
        if path_args is not None:
            res.update_attrs(ignore_none=True, **path_args)

        return res
Get a resource object to work on
dataset/ETHPy150Open openstack/python-openstacksdk/openstack/proxy.py/BaseProxy._get_resource