Extract operation and optional type parameters
195774
private List<String> splitOperation(String pOperation) {
        List<String> ret = new ArrayList<String>();
        Pattern p = Pattern.compile("^(.*)\\((.*)\\)$");
        Matcher m = p.matcher(pOperation);
        if (m.matches()) {
            ret.add(m.group(1));
            if (m.group(2).length() > 0) {
                // No escaping required since the parts a Java types which does not
                // allow for commas
                String[] args = m.group(2).split("\\s*,\\s*");
                ret.addAll(Arrays.asList(args));
            } else {
                // It's "()" which means a no-arg method
                ret.add(null);
            }
        } else {
            ret.add(pOperation);
        }
        return ret;
    }
1247864
private Pair<String, String> extractParam(String part) {
        int eqInx = part.indexOf('=');
        String paramName;
        String paramValue;
        if (eqInx < 0) {
            paramName = part;
            paramValue = null;
        } else {
            paramName = part.substring(0, eqInx);
            paramValue = part.substring(eqInx + 1);
        }
        return Pair.create(paramName, paramValue);
    }
646959
function extract (/* pattern, ...args */) {
    var args = slice.call(arguments, 1);
    var context = this === exports ? null : this;
    var patternFn = getOrCompile(arguments[0]);
    return patternFn.call(context, args, runtime) || null;
  }
208008
def get_type(obj, **kwargs):
    """"""
    t = type(obj)

    s = extract_type(str(t))

    return 'Type: {}'.format(s)
1295402
def extract_type(s):
    """"""
    r = re.compile(r"<class '(.*)'>", re.MULTILINE | re.IGNORECASE)
    try:
        m = r.match(str(s)).group(1)
    except (IndexError, AttributeError) as e:
        m = None

    return m
1157654
function _parseParams(params, defaults) {
  const options = {};
  const attrs = {};

  Utils.each(params, (value, key) => {
    const coerced = Utils.coerceType(value);

    if (Utils.has(defaults.options, key)) {
      options[key] = coerced;
    } else if (Utils.has(defaults.attrs, key)) {
      attrs[key] = coerced;
    }
  });

  return [options, attrs];
}
570463
def optional_parameters
      definition_lambda.parameters.select { |key,_value| key == :key }.map { |_key,value| value }
    end
1157673
function _parse(type, obj, options)
{
    if (!obj) return _checkResult(type, lib.newError("empty " + type), obj, options);
    try {
        obj = _parseResult(type, obj, options);
    } catch(err) {
        obj = _checkResult(type, err, obj, options);
    }
    return obj;
}
1184822
private static Class<?> extractGeneric(Type type) {
        if (type instanceof ParameterizedType) {
            Type[] genericTypes = ((ParameterizedType) type).getActualTypeArguments();
            if (genericTypes.length > 0 && genericTypes[0] instanceof Class) {
                return (Class<?>) genericTypes[0];
            }
        }
        return Object.class;
    }
79522
function __getType(data, options) {
	let type = typeof data;
	if (data === null) {
		type = DATA_TYPE.NULL;
	}
	else if (type === 'boolean') {
		type = (data) ? DATA_TYPE.TRUE : DATA_TYPE.FALSE;
	}
	else if ( type === "number" ) {
		type = DATA_TYPE.FLOAT64;
	}
	else if ( data instanceof Int8 ) {
		type = DATA_TYPE.INT8;
	}
	else if ( data instanceof UInt8 ) {
		type = DATA_TYPE.UINT8;
	}
	else if ( data instanceof Int16 ) {
		type = DATA_TYPE.INT16;
	}
	else if ( data instanceof UInt16 ) {
		type = DATA_TYPE.UINT16;
	}
	else if ( data instanceof Int32 ) {
		type = DATA_TYPE.INT32;
	}
	else if ( data instanceof UInt32 ) {
		type = DATA_TYPE.UINT32;
	}
	else if ( data instanceof Int64 ) {
		type = DATA_TYPE.INT64;
	}
	else if ( data instanceof UInt64 ) {
		type = DATA_TYPE.UINT64;
	}
	else if ( data instanceof Int256 ) {
		type = DATA_TYPE.INT256;
	}
	else if ( data instanceof UInt256 ) {
		type = DATA_TYPE.UINT256;
	}
	else if ( data instanceof Int512 ) {
		type = DATA_TYPE.INT512;
	}
	else if ( data instanceof UInt512 ) {
		type = DATA_TYPE.UINT512;
	}
	else if ( data instanceof Int128 ) {
		type = DATA_TYPE.INT128;
	}
	else if ( data instanceof UInt128 ) {
		type = DATA_TYPE.UINT128;
	}
	else if ( data instanceof IntVar ) {
		type = DATA_TYPE.INTVAR;
	}
	else if ( data instanceof UIntVar ) {
		type = DATA_TYPE.UINTVAR;
	}
	else if (type === 'string') {
		type = DATA_TYPE.STRING;
	}
	else if (Array.isArray(data)) {
		type = (options.streaming_array === true) ? DATA_TYPE.ARRAY_START : DATA_TYPE.ARRAY;
	}
	else if (data instanceof Date) {
		type = DATA_TYPE.DATE;
	}
	else if (data instanceof ObjectId) {
		type = DATA_TYPE.OBJECTID;
	}
	else if (data instanceof Binary) {
		type = DATA_TYPE.BINARY;
	}
	else if ( data instanceof ArrayBuffer) {
		type = DATA_TYPE.ARRAY_BUFFER;
	}
	else if ( data instanceof DataView) {
		type = DATA_TYPE.DATA_VIEW;
	}
	// NOTE: This line must be prior to Uint8Array since NodeJS Buffer is defined to be inheritance of Uint8Array
	else if ( HAS_NODE_BUFFER && data instanceof Buffer ) {
		type = DATA_TYPE.SPECIAL_BUFFER;
	}
	else if ( data instanceof Uint8Array) {
		type = DATA_TYPE.UINT8_ARRAY;
	}
	else if ( data instanceof Int8Array) {
		type = DATA_TYPE.INT8_ARRAY;
	}
	else if ( data instanceof Uint16Array) {
		type = DATA_TYPE.UINT16_ARRAY;
	}
	else if ( data instanceof Int16Array) {
		type = DATA_TYPE.INT16_ARRAY;
	}
	else if ( data instanceof Uint32Array) {
		type = DATA_TYPE.UINT32_ARRAY;
	}
	else if ( data instanceof Int32Array) {
		type = DATA_TYPE.INT32_ARRAY;
	}
	else if ( data instanceof Float32Array) {
		type = DATA_TYPE.FLOAT32_ARRAY;
	}
	else if ( data instanceof Float64Array) {
		type = DATA_TYPE.FLOAT64_ARRAY;
	}
	else if (type === 'object') {
		type = (options.streaming_object === true) ? DATA_TYPE.OBJECT_START : DATA_TYPE.OBJECT;
	}
	return type;
}
728629
function extractOps(data) {
  const ops = {};

  _.forIn(data, (attribute, key) => {
    if (isOp(attribute)) {
      ops[key] = attribute;
      delete data[key];
    }
  });

  return ops;
}
1173063
def parse_operation_type(lexer: Lexer) -> OperationType:
    """"""
    operation_token = expect_token(lexer, TokenKind.NAME)
    try:
        return OperationType(operation_token.value)
    except ValueError:
        raise unexpected(lexer, operation_token)
978042
function (qs, options) {

            debug('Extracting items...');

            qs = qs + '';

            debug('Separator: %s', options.separator);

            // split query string parameters on separator (default is: '&')
            const items = qs.split(options.separator, Number.MAX_SAFE_INTEGER);
            debug('Items: %o', items);

            return items;
        }
658524
def from_parameter(cls: Type[XHXParameterType], parameter: str) -> Optional[XHXParameterType]:
        
        xhx = XHXParameter.re_xhx.match(parameter)
        if xhx:
            return cls(int(xhx.group(1)))

        return None
317828
function extractChanged(operation) {
        var i, len, op, elem, changed = [];
        if (operation.ops.length > 0) {
            for (i = 0, len = operation.ops.length; i < len; i++) {
                op = operation.ops[i];
                if (op._elem && op._elem._id) {
                    elem = get(op._elem._id);
                    if (elem && !_.contains(changed, elem)) {
                        changed.push(elem);
                    }
                }
                if (op.arg && op.arg._id) {
                    elem = get(op.arg._id);
                    if (elem && !_.contains(changed, elem)) {
                        changed.push(elem);
                    }
                }
            }
        }
        return changed;
    }
274535
function (operation, parameter) {
  // TODO the reference to operation.api is not available
  if (operation.api && operation.api.parameterMacro) {
    return operation.api.parameterMacro(operation, parameter);
  } else {
    return parameter.defaultValue;
  }
}
1230962
def extract(self, params):
        
        structure = Structure(fields=dict([(p.name, p)
                                           for p in self._parameters]))
        try:
            tree = structure.coerce(self._convert_flat_to_nest(params))
            rest = {}
        except UnknownParametersError, error:
            tree = error.result
            rest = self._convert_nest_to_flat(error.unknown)
        return Arguments(tree), rest