def _get_resource(self, resource_type, value, **attrs):
        if value is None:
            # Create a bare resource
            res = resource_type.new(**attrs)
        elif not isinstance(value, resource_type):
            # Create from an ID
            res = resource_type.new(id=value, **attrs)
        else:
            # An existing resource instance
            res = value
            res._update(**attrs)

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