original_string: public function setContext($context, array $options = array())
      {
          if (!isset($context)) {
              $context = stream_context_create((array) $context, $options);
          }
  
          if (!is_resource($context)) {
              throw new UnexpectedValueException('Stream context is not a valid resource');
          }
  
          $this->context = $context;
          return $this;
      }
code: public function setContext($context, array $options = array())
      {
          if (!isset($context)) {
              $context = stream_context_create((array) $context, $options);
          }
  
          if (!is_resource($context)) {
              throw new UnexpectedValueException('Stream context is not a valid resource');
          }
  
          $this->context = $context;
          return $this;
      }
code_tokens: public function setContext ( $ context , array $ options = array ( ) ) { if ( ! isset ( $ context ) ) { $ context = stream_context_create ( ( array ) $ context , $ options ) ; } if ( ! is_resource ( $ context ) ) { throw new UnexpectedValueException ( 'Stream context is not a valid resource' ) ; } $ this -> context = $ context ; return $ this ; }
docstring: Sets the context resource
  @param resource|array $context
  @param array $options
  @return $this
  @throws UnexpectedValueException
docstring_tokens: Sets the context resource