Extract the first pair (dskey, exptype) found in export
345147
def get_outkey(dskey, export_types):
    
    for exptype in export_types:
        if (dskey, exptype) in export:
            return (dskey, exptype)
613953
function parseExportSpecifier() {
        var exported, local, node = new Node(), def;
        if (matchKeyword('default')) {
            // export {default} from 'something';
            def = new Node();
            lex();
            local = def.finishIdentifier('default');
        } else {
            local = parseVariableIdentifier();
        }
        if (matchContextualKeyword('as')) {
            lex();
            exported = parseNonComputedProperty();
        }
        return node.finishExportSpecifier(local, exported);
    }
921265
private static void getResPathKeys(String path, int num, String[] keys, int start) {
        if (num == 0) {
            return;
        }
        if (num == 1) {
            keys[start] = path;
            return;
        }
        int i = 0;
        for (;;) {
            int j = path.indexOf(RES_PATH_SEP_CHAR, i);
            assert j >= i;
            keys[start++] = path.substring(i, j);
            if (num == 2) {
                assert path.indexOf(RES_PATH_SEP_CHAR, j + 1) < 0;
                keys[start] = path.substring(j + 1);
                break;
            } else {
                i = j + 1;
                --num;
            }
        }
    }
974515
function findExports( ast ) {
    try {
        const
            publics = {},
            privates = {},
            body = ast.program.body[ 0 ].expression.arguments[ 1 ].body.body;

        body.forEach( function ( item ) {
            if ( parseExports( item, publics ) ) return;
            if ( parseModuleExports( item, publics ) ) return;
            parseFunctionDeclaration( item, privates );
        } );

        const output = [];
        Object.keys( publics ).forEach( function ( exportName ) {
            const
                exportValue = publics[ exportName ],
                target = privates[ exportValue.target ];
            if ( target ) {
                exportValue.comments = exportValue.comments || target.comments;
                exportValue.type = target.type;
                exportValue.params = target.params;
            }
            output.push( {
                id: exportName,
                type: exportValue.type,
                params: exportValue.params,
                comments: exportValue.comments
            } );
        } );

        return output;
    } catch ( ex ) {
        throw new Error( `${ex}\n...in module-analyser/findExports()` );
    }
}
937230
def compute_exports(exports):
    """"""

    loc, glob = get_calling_namespaces()

    retval = {}
    try:
        for export in exports:
            if SCons.Util.is_Dict(export):
                retval.update(export)
            else:
                try:
                    retval[export] = loc[export]
                except KeyError:
                    retval[export] = glob[export]
    except KeyError as x:
        raise SCons.Errors.UserError("Export of non-existent variable '%s'"%x)

    return retval
642872
function (items, options) {

            debug('Extracting keys...');

            let pairs = items.map(item => {

                if (typeof item === typeof '') {

                    // split items on equality character (default is: '=')
                    const parts = item.split(options.equality);

                    if (typeof parts[0] === typeof '' && parts[0].length > 0) {

                        if (parts.length === 1) {

                            debug('No value provided. Using boolean as existence');

                            parts.push('true'); // set existence to true
                        }

                        const output = {
                            key: parts[0],
                            value: options.decodeURIComponent(parts[1])
                        };

                        debug('Key/Value pair: %o', output);

                        return output;

                    } else {

                        debug('Key cannot be empty');
                    }

                } else {

                    debug('item must be a valid string');
                }

                return undefined;
            });

            debug('Removing null and undefined values...');

            // remove undefined/null/empty string keys
            pairs = _.without(pairs, null, undefined);

            debug('Pairs: %o', pairs);

            return pairs;
        }
176187
function(ob,keysToCopy,copyNullEtc) {
	var k = '',
		r = {};
	for (k in ob) {
		if (
			ob.hasOwnProperty(k) &&
			(
				(keysToCopy === undefined) ||
				(keysToCopy.indexOf(k) > -1)
			)
		) {
			if (copyNullEtc || ((ob[k] !== null) && (ob[k] !== undefined))) {
				r[k] = ob[k];
			}
		}
	}
	return r;
}
317881
def extract_fields(d, fields, delimiter='|'):
    
    rd = {}
    for f in fields:
        v = d.get(f, None)
        if isinstance(v, (str, unicode)):
            v = v.encode('utf8')
        elif isinstance(v, list):
            v = delimiter.join(v)
        rd[f] = v
    return rd
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
55200
def extract(self, name):
        """"""
        if type(name) == type(''):
            ndx = self.toc.find(name)
            if ndx == -1:
                return None
        else:
            ndx = name
        (dpos, dlen, ulen, flag, typcd, nm) = self.toc.get(ndx)
        self.lib.seek(self.pkgstart+dpos)
        rslt = self.lib.read(dlen)
        if flag == 2:
            global AES
            import AES
            key = rslt[:32]
            # Note: keep this in sync with bootloader's code
            rslt = AES.new(key, AES.MODE_CFB, "\0"*AES.block_size).decrypt(rslt[32:])
        if flag == 1 or flag == 2:
            rslt = zlib.decompress(rslt)
        if typcd == 'M':
            return (1, rslt)
        return (0, rslt)
23028
def export_to_dict(session,
                   recursive,
                   back_references,
                   include_defaults):
    """"""
    logging.info('Starting export')
    dbs = session.query(Database)
    databases = [database.export_to_dict(recursive=recursive,
                 include_parent_ref=back_references,
                 include_defaults=include_defaults) for database in dbs]
    logging.info('Exported %d %s', len(databases), DATABASES_KEY)
    cls = session.query(DruidCluster)
    clusters = [cluster.export_to_dict(recursive=recursive,
                include_parent_ref=back_references,
                include_defaults=include_defaults) for cluster in cls]
    logging.info('Exported %d %s', len(clusters), DRUID_CLUSTERS_KEY)
    data = dict()
    if databases:
        data[DATABASES_KEY] = databases
    if clusters:
        data[DRUID_CLUSTERS_KEY] = clusters
    return data
1063085
def get_section_key_line(self, data, key, opt_extension=''):
        
        start = 0
        init = 0
        while start != -1:
            start = self.get_next_section_start_line(data[init:])
            init += start
            if start != -1:
                if data[init].strip().lower() == self.opt[key] + opt_extension:
                    break
                init += 1
        if start != -1:
            start = init
        return start
1048179
def export_input_zip(ekey, dstore):
    
    dest = dstore.export_path('input.zip')
    nbytes = dstore.get_attr('input/zip', 'nbytes')
    zbytes = dstore['input/zip'].value
    # when reading input_zip some terminating null bytes are truncated (for
    # unknown reasons) therefore they must be restored
    zbytes += b'\x00' * (nbytes - len(zbytes))
    open(dest, 'wb').write(zbytes)
    return [dest]
353988
def extract_pair(line)
      key, value = line.split("=", 2)
      [key.tr("-", "_").to_sym, value.gsub(/[\n\r]+/, "")]
    end
1046490
def _parse(self, fp):
        
        for line in fp:
            # '   #export foo=some var  ' -> ['#export', 'foo=some var  ']
            bits = shlex_split(line, comments=True)
            if (not bits) or bits[0].startswith('#'):
                continue

            if bits[0] == u'export':
                bits.pop(0)

            key, sep, value = str_partition(u' '.join(bits), u'=')
            if key and sep:
                yield key, value
446345
def _get_dsnames(cls, data, ignore_keys=['attrs', 'plotter', 'ds'],
                     concat_dim=False):
        """"""
        def filter_ignores(item):
            return item[0] not in ignore_keys and isinstance(item[1], dict)
        if 'fname' in data:
            return {tuple(
                [data['fname'], data['store']] +
                ([data.get('concat_dim')] if concat_dim else []))}
        return set(chain(*map(partial(cls._get_dsnames, concat_dim=concat_dim,
                                      ignore_keys=ignore_keys),
                              dict(filter(filter_ignores,
                                          six.iteritems(data))).values())))
1274959
def extract_(dstore, dspath):
    
    obj = dstore[dspath]
    if isinstance(obj, Dataset):
        return ArrayWrapper(obj.value, obj.attrs)
    elif isinstance(obj, Group):
        return ArrayWrapper(numpy.array(list(obj)), obj.attrs)
    else:
        return obj