Handle the resource

@param  Resource | string $resource
@return Resource
429157
protected function handleResource($resource) {
		if ($resource instanceof Resource) {
			return $resource;
		}
		
		// Is not a local resource
		if (preg_match('~^[a-z]+:~', $resource)) {
			$slashPos = strrpos($resource, '/');
			
			$base = substr($resource, 0, $slashPos);
			$name = substr($resource, $slashPos + 1);
			
			$resource = new Resource($name, $base, $base, $this->metadataManager);
		} else {
			$resource = new Resource($resource, $this->basePath, $this->baseUrl, $this->metadataManager);
		}
		
		if ($this->hashAppend) {
			$resource->setHashAppend(true);
		}
		
		return $resource;
	}
22465
public static function create($resource)
    {
        $type = gettype($resource);

        if ($type == 'string') {
            $stream = fopen('php://temp', 'r+');

            if ($resource !== '') {
                fwrite($stream, $resource);
                fseek($stream, 0);
            }

            return new self($stream);
        }

        if ($type == 'resource') {
            return new self($resource);
        }

        if ($resource instanceof StreamableInterface) {
            return $resource;
        }

        throw new \InvalidArgumentException('Invalid resource type: ' . $type);
    }
153831
protected function createParsedResource($resource): ResourceInterface
    {
        \assert(
            $this->schemaContainer->hasSchema($resource),
            'No Schema found for resource `' . \get_class($resource) . '`.'
        );

        return $this->factory->createParsedResource(
            $this->position,
            $this->schemaContainer,
            $resource
        );
    }
418459
static function of($resource)
    {
        if (!is_resource($resource) && get_resource_type($resource) !== 'stream-context')
            throw new \InvalidArgumentException(sprintf(
                'Invalid Context Resource Passed, given: "%s".'
                , \Poirot\Std\flatten($resource)
            ));


        // ..
        $options = stream_context_get_params($resource);
        $context = new ContextStreamSocket($options); // Socket Context can be used as Base Context
        return $context;
    }
311052
public function load($resource)
    {
        if ($issue = $this->getIssue($resource)) {
            return $this->createFeature($issue);
        }

        return $this->createFeatures();
    }
1154288
public function apply($resource){
		@list(,$input,$output)=func_get_args();
		$input=(float)$input;
		$output=(float)$output;
		if(!imagegammacorrect($resource,$input,$output)){
			throw new Exception("Gamma correction failed");
		}
		return $resource;
	}
591939
protected function getServiceResponse($resource)
    {
        $response = $this->sendRequest('GET', $this->getServiceUrl($resource));
        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        return $decodedResponseBody;
    }
29879
public function verbose($resource)
    {
        $this->logger->pushHandler(new StreamHandler($resource, Logger::DEBUG));
        return $this;
    }
912376
public function create($resource)
    {
        $className = $this->getResourceClassName($resource->type);
        if (!class_exists($className)) {
            throw new Exception(
                'Unknown resource type "' . $resource->type . '".',
                Exception::UNKNOWN_RESOURCE_TYPE
            );
        }

        /** @var AbstractResource $object */
        $object = $this->objectManager->get($className);

        foreach ($resource as $property => $value) {
            if (!ObjectAccess::isPropertySettable($object, $property)) {
                continue;
            }
            ObjectAccess::setProperty($object, $property, $value);
        }

        $this->postProcessResources($object);

        return $object;
    }
863252
public function getResourceUrl($resource)
    {
        if (!$this->directory) {
            $this->directory = new ResourcesDirectory(
                $this->getHttpClient()->unsignedRequest('GET', $this->directoryUrl, null, true)
            );
        }

        return $this->directory->getResourceUrl($resource);
    }
285936
public function load($resource)
    {
        $jsonDecoder = new JsonDecoder();
        $jsonDecoder->setObjectDecoding(JsonDecoder::ASSOC_ARRAY);

        $config = $jsonDecoder->decode($this->repository->get($resource)->getBody());

        // Keep track of this file being loaded to prevent infinite recursion
        $this->loadedFiles[$resource] = true;

        $this->includeDesc($config);
        $this->mergeIncludes($config);

        return $config;
    }
1283478
public static function fileConfig($resource)
    {
        self::$config = new Config($resource, new ConfigLoader());
        self::$config->load();
        self::$config->configure();
    }
45519
public function resolve($resource, $type = null){
		$resolvingLoader = false;
		foreach($this->loaders as $loader){
			if($loader->supports($resource, $type)){
				$resolvingLoader = $loader;
			}
		}
		if(!$resolvingLoader){
			if(!$type){
				$type = (is_callable($resource))
					? 'closure'
					: pathinfo($resource, PATHINFO_EXTENSION)
				;
			}
			$resolvingLoader = $this->createLoaderForType($type);
		}

		return $resolvingLoader;
	}
923665
public function setResource($resource)
    {
        if(get_resource_type($resource) !== 'stream')
        {
            throw new \RuntimeException(sprintf(
                "Not a valid 'stream' resource; received a '%s' resource", get_resource_type($resource)
            ));
        }

        $this->_resource = $resource;

        return $this;
    }
414555
public function addResource(string ...$resource)
    {
        foreach ($resource as $_resource)
        {
            $this->resourceRegistry->save($_resource);
        }
    }
1305102
public function hash($resource)
    {
        rewind($resource);
        $context = hash_init($this->algo);
        hash_update_stream($context, $resource);
        fclose($resource);

        return hash_final($context);
    }
574653
public function resolve($resource)
    {
        foreach ($this->loaders() as $loader) {
            if ($loader->supports($resource)) {
                return $loader;
            }
        }

        throw new LoaderException('No matching loader found.');
    }