Serializes the result of an operation as a SOAP Envelope.

 @param op_options [Hash] The operation options.
 @param r [Hash,Object] The operation result.
noinspection RubyArgCount
325117
def serialize_soap_result(op_options, r)
      xb = Builder::XmlMarkup.new
      xb.instruct!

      xb.Envelope :xmlns => soap_env_ns, 'xmlns:xsi' => namespaces['xsi'] do |xenv|
        xenv.Body do |xbody|
          xbody.tag! "#{op_options[:public_name]}Response", :xmlns => namespaces['tns'] do |xresp|
            if r.nil?
              xresp.tag! "#{op_options[:public_name]}Result", 'xsi:nil' => 'true'
            else
              ret = op_options[:returns] rescue nil
              case ret
                when NilClass, Class
                  xresp.tag! "#{op_options[:public_name]}Result", r
                when Hash
                  xresp.tag! "#{op_options[:public_name]}Result" do |xres|
                    ret.each do |k, v|
                      extract_and_serialize_value(xres, r, k, v)
                    end
                  end
                else
                  raise "Unsupported return type: #{ret.inspect}"
              end
            end
          end
        end
      end
    end
1187435
def handle_o_r_s_r(tokens, options)
      outer_span = get_anchor([tokens[3]], options)
      handle_orr(tokens[0..1], outer_span, options)
    end
1076470
def _create_comparison_method(cls, op):
        
        def wrapper(self, other):
            if isinstance(other, ABCSeries):
                # the arrays defer to Series for comparison ops but the indexes
                #  don't, so we have to unwrap here.
                other = other._values

            result = op(self._data, maybe_unwrap_index(other))
            return result

        wrapper.__doc__ = op.__doc__
        wrapper.__name__ = '__{}__'.format(op.__name__)
        return wrapper
1310664
protected String resource_to_string(nitro_service service, options option)
	{
		String onerror = service.get_onerror();
		return service.get_payload_formatter().resource_to_string(this, option, onerror);
	}
342973
def from_xdr_object(cls, op_xdr_object):
        
        if not op_xdr_object.sourceAccount:
            source = None
        else:
            source = encode_check(
                'account', op_xdr_object.sourceAccount[0].ed25519).decode()

        bump_to = op_xdr_object.body.bumpSequenceOp.bumpTo
        return cls(source=source, bump_to=bump_to)
364890
def dispatch_to_extension_op(op, left, right):
    

    # The op calls will raise TypeError if the op is not defined
    # on the ExtensionArray

    # unbox Series and Index to arrays
    if isinstance(left, (ABCSeries, ABCIndexClass)):
        new_left = left._values
    else:
        new_left = left

    if isinstance(right, (ABCSeries, ABCIndexClass)):
        new_right = right._values
    else:
        new_right = right

    res_values = op(new_left, new_right)
    res_name = get_op_result_name(left, right)

    if op.__name__ in ['divmod', 'rdivmod']:
        return _construct_divmod_result(
            left, res_values, left.index, res_name)

    return _construct_result(left, res_values, left.index, res_name)
980470
def print_operations
      ops = @operations.reverse.map do |op|
        attr_s = " #{op.attribute}" if op.attribute
        "#{op.type.to_s.capitalize_first} #{op.subject.qp}#{attr_s}"
      end
      ops.qp
    end
1064698
def wrap(data)
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"><env:Body>".tap do |soap_envelope|
        unless data.blank?
          soap_envelope << (data.is_a?(Hash) ? Gyoku.xml(data) : data)
        end
        soap_envelope << "</env:Body></env:Envelope>"
      end
    end
596950
def operate(operator, other)
      if other.is_a?(Numeric)
        new(value.send(operator, other), unit)
      elsif other.respond_to?(:composition)
        if compatible_with?(other)
          converted = other.convert_to(unit)
          new(value.send(operator, converted.value),
              unit.send(operator, converted.unit))
        else
          new(value.send(operator, other.value),
              unit.send(operator, other.unit))
        end
      end
    end
1130470
def _convert_soap_method_args(*args):
    
    soap_args = []
    for arg_n, arg in enumerate(args):
        soap_args.append(('arg' + str(arg_n), arg))
    return soap_args
1067381
def jsonify_r(obj):  # pragma: no cover, not for unit tests...
    # pylint: disable=too-many-branches
    
    res = {}
    cls = obj.__class__
    if not hasattr(cls, 'properties'):
        try:
            json.dumps(obj)
            return obj
        except TypeError:
            return None
    properties = list(cls.properties.keys())
    if hasattr(cls, 'running_properties'):
        properties += list(cls.running_properties.keys())
    for prop in properties:
        if not hasattr(obj, prop):
            continue
        val = getattr(obj, prop)
        # Maybe the property is not jsonable
        try:
            if isinstance(val, set):
                val = list(val)
            if isinstance(val, list):
                val = sorted(val)
            json.dumps(val)
            res[prop] = val
        except TypeError:
            if isinstance(val, list):
                lst = []
                for subval in val:
                    o_type = getattr(subval.__class__, 'my_type', '')
                    if o_type == 'CommandCall':
                        try:
                            lst.append(subval.call)
                        except AttributeError:  # pragma: no cover, should not happen...
                            pass
                        continue
                    if o_type and hasattr(subval, o_type + '_name'):
                        lst.append(getattr(subval, o_type + '_name'))
                    else:
                        pass
                res[prop] = lst
            else:
                o_type = getattr(val.__class__, 'my_type', '')
                if o_type == 'CommandCall':
                    try:
                        res[prop] = val.call
                    except AttributeError:  # pragma: no cover, should not happen...
                        pass
                    continue
                if o_type and hasattr(val, o_type + '_name'):
                    res[prop] = getattr(val, o_type + '_name')
    return res
1192268
def RenderPayload(self, result, value):
    """"""
    if "args_rdf_name" in result:
      result["payload_type"] = result["args_rdf_name"]
      del result["args_rdf_name"]

    if "args" in result:
      result["payload"] = self._PassThrough(value.payload)
      del result["args"]

    return result
1324548
function soap_transport_http($url, $curl_options = NULL, $use_curl = false){
		parent::nusoap_base();
		$this->debug("ctor url=$url use_curl=$use_curl curl_options:");
		$this->appendDebug($this->varDump($curl_options));
		$this->setURL($url);
		if (is_array($curl_options)) {
			$this->ch_options = $curl_options;
		}
		$this->use_curl = $use_curl;
		preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
		$this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
	}
717008
public function initSoapClient($_wsdlOptions)
    {
        $wsdlOptions = array();
        $defaultWsdlOptions = self::getDefaultWsdlOptions();
        foreach($defaultWsdlOptions as $optioName=>$optionValue)
        {
            if(array_key_exists($optioName,$_wsdlOptions) && !is_null($_wsdlOptions[$optioName])) {
                $wsdlOptions[str_replace('wsdl_', '', $optioName)] = $_wsdlOptions[$optioName];
            } elseif(!empty($optionValue)) {
                $wsdlOptions[str_replace('wsdl_', '', $optioName)] = $optionValue;
            }
        }

        if(array_key_exists(str_replace('wsdl_','',self::WSDL_URL),$wsdlOptions))
        {
            $wsdlUrl = $wsdlOptions[str_replace('wsdl_','',self::WSDL_URL)];
            unset($wsdlOptions[str_replace('wsdl_','',self::WSDL_URL)]);
            $soapClientClassName = self::getSoapClientClassName();

            $connection_timeout = 0;
            $retries = 1;
            $read_timeout = null;
            if(isset($_wsdlOptions['connection_options']) && is_array($_wsdlOptions['connection_options'])) {
                extract($_wsdlOptions['connection_options']);
                unset($_wsdlOptions['connection_options']);
            }

            @ini_set("soap.wsdl_cache_enabled", 0);
            if($soapClientClassName == '\Omniship\Rapido\Helper\SoapClient') {
                $soapClient = new $soapClientClassName($wsdlUrl,$wsdlOptions, $connection_timeout, $retries, $read_timeout);
            } else {
                $soapClient = new $soapClientClassName($wsdlUrl,$wsdlOptions);
            }

            self::setSoapClient($soapClient);
        }
    }
7065
def _ops_to_requests(self, ops):
        
        request_ops = []
        for op in ops:
            if isinstance(op, transactions.Put):
                request = self._build_put_request(op.key, op.value,
                                                  op.lease, op.prev_kv)
                request_op = etcdrpc.RequestOp(request_put=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Get):
                request = self._build_get_range_request(op.key, op.range_end)
                request_op = etcdrpc.RequestOp(request_range=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Delete):
                request = self._build_delete_request(op.key, op.range_end,
                                                     op.prev_kv)
                request_op = etcdrpc.RequestOp(request_delete_range=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Txn):
                compare = [c.build_message() for c in op.compare]
                success_ops = self._ops_to_requests(op.success)
                failure_ops = self._ops_to_requests(op.failure)
                request = etcdrpc.TxnRequest(compare=compare,
                                             success=success_ops,
                                             failure=failure_ops)
                request_op = etcdrpc.RequestOp(request_txn=request)
                request_ops.append(request_op)

            else:
                raise Exception(
                    'Unknown request class {}'.format(op.__class__))
        return request_ops
251142
def dump_soap_response(service_url, response_xml)
      return unless @soap_dump
      response_xml.gsub(/<email[^>]*>.+<\/email>/, "<email>**censured**</email>")
      str = ""
      str << "<!-- response -->\n" unless @soap_dump_dir
      str << xml_to_s(response_xml) << "\n"
      str << "<!-- end -->" unless @soap_dump_dir
      dump(service_url, "res", str)
    end
433310
def _get_opstr(op, cls):
    
    # numexpr is available for non-sparse classes
    subtyp = getattr(cls, '_subtyp', '')
    use_numexpr = 'sparse' not in subtyp

    if not use_numexpr:
        # if we're not using numexpr, then don't pass a str_rep
        return None

    return {operator.add: '+',
            radd: '+',
            operator.mul: '*',
            rmul: '*',
            operator.sub: '-',
            rsub: '-',
            operator.truediv: '/',
            rtruediv: '/',
            operator.floordiv: '//',
            rfloordiv: '//',
            operator.mod: None,  # TODO: Why None for mod but '%' for rmod?
            rmod: '%',
            operator.pow: '**',
            rpow: '**',
            operator.eq: '==',
            operator.ne: '!=',
            operator.le: '<=',
            operator.lt: '<',
            operator.ge: '>=',
            operator.gt: '>',
            operator.and_: '&',
            rand_: '&',
            operator.or_: '|',
            ror_: '|',
            operator.xor: '^',
            rxor: '^',
            divmod: None,
            rdivmod: None}[op]