Build of dictionary of fields extracted from
        the given path
778992
def path_context(self, path):
        """"""
        prefix = os.path.commonprefix([path, self._path])
        relative_path = path[len(prefix) :]
        relative_path = relative_path.strip(os.sep)
        attrs = self.CONTEXT_ATTRS
        for i, elt in enumerate(relative_path.split(os.sep)):
            yield attrs[i], elt
        yield 'path', path
866677
def get_client_kwargs(self, path):
        
        container, obj = self.split_locator(path)
        kwargs = dict(container=container)
        if obj:
            kwargs['obj'] = obj
        return kwargs
1195409
def get_output_jsonpath_field(self, sub_output=None):
        """"""
        if sub_output is not None:
            if self.output_fields is None or\
                (isinstance(self.output_fields, dict) and not sub_output in self.output_fields.itervalues()) or\
                    (isinstance(self.output_fields, list) and not sub_output in self.output_fields):
                raise ValueError(
                    "Cannot generate output jsonpath because this ExtractorProcessor will not output {}".format(sub_output))
            output_jsonpath_field = sub_output
        else:
            output_jsonpath_field = self.output_field
        return output_jsonpath_field
107288
function extractNormalizedKeys(path) {
    const props = path.node.properties;
    const keys = [];
    let allLiteral = true;

    for (const prop of props) {
      if (t.isIdentifier(prop.key) && !prop.computed) {
        // since a key {a: 3} is equivalent to {"a": 3}, use the latter
        keys.push(t.stringLiteral(prop.key.name));
      } else if (t.isTemplateLiteral(prop.key)) {
        keys.push(t.cloneNode(prop.key));
      } else if (t.isLiteral(prop.key)) {
        keys.push(t.stringLiteral(String(prop.key.value)));
      } else {
        keys.push(t.cloneNode(prop.key));
        allLiteral = false;
      }
    }

    return { keys, allLiteral };
  }
1110073
protected String toField(Path<?> path) {
        PathMetadata md = path.getMetadata();
        if (md.getPathType() == PathType.COLLECTION_ANY) {
            return toField(md.getParent());
        } else {
            String rv = md.getName();
            if (md.getParent() != null) {
                Path<?> parent = md.getParent();
                if (parent.getMetadata().getPathType() != PathType.VARIABLE) {
                    rv = toField(parent) + "." + rv;
                }
            }
            return rv;
        }
    }
1216627
def extract_common_fields(self, data):
        """"""
        return dict(
            dc=data.get('dc'),
            role=data.get('role'),
            account_name=data.get('accountname'),
            user_id=data.get('user_id'),
            login=data.get('login'),
            login_url=data.get('login_url'),
            api_endpoint=data.get('api_endpoint'),
        )
538407
def _dict_from_path(path, val, delimiter=DEFAULT_TARGET_DELIM):
    '''
    
    '''
    nested_dict = _infinitedict()
    keys = path.rsplit(delimiter)
    lastplace = reduce(operator.getitem, keys[:-1], nested_dict)
    lastplace[keys[-1]] = val

    return nested_dict
188677
def reconstruct_dict(dot_paths, values):
    
    '''  '''
    
    output_dict = {}
    
    for i in range(len(dot_paths)):
        if i + 1 <= len(values):
            path_segments = segment_path(dot_paths[i])
            current_nest = output_dict
            for j in range(len(path_segments)):
                key_name = path_segments[j]
                try:
                    key_name = int(key_name)
                except:
                    pass
                if j + 1 == len(path_segments):
                    if isinstance(key_name, int):
                        current_nest.append(values[i])
                    else:
                        current_nest[key_name] = values[i]
                else:
                    next_key = path_segments[j+1]
                    try:
                        next_key = int(next_key)
                    except:
                        pass
                    if isinstance(next_key, int):
                        if not key_name in current_nest.keys():
                            current_nest[key_name] = []
                        current_nest = current_nest[key_name]
                    else:
                        if isinstance(key_name, int):
                            current_nest.append({})
                            current_nest = current_nest[len(current_nest) - 1]
                        else:
                            if not key_name in current_nest.keys():
                                current_nest[key_name] = {}
                            current_nest = current_nest[key_name]
    
    return output_dict
272556
def accumulate_nested_doc(nested_path, expr=IDENTITY):
    
    name = literal_field(nested_path)
    def output(doc):
        acc = []
        for h in doc.inner_hits[name].hits.hits:
            i = h._nested.offset
            obj = Data()
            for f, v in h.fields.items():
                local_path = untype_path(relative_field(f, nested_path))
                obj[local_path] = unwraplist(v)
            # EXTEND THE LIST TO THE LENGTH WE REQUIRE
            for _ in range(len(acc), i+1):
                acc.append(None)
            acc[i] = expr(obj)
        return acc
    return output
982617
static List<MethodParameter> extract(String path) {

		List<MethodParameter> output = new ArrayList<>();

		List<String> items = split(path);

		if (items.size() > 0) {

			int pathIndex = 0;
			int index = 0;
			for (String item : items) {

				MethodParameter param = getParamFromPath(item, index, pathIndex); // set negative index until confirmed that needed

				if (param != null) {
					output.add(param);
					index++;
				}

				pathIndex++;
			}
		}

		return output;
	}
145705
def _get_attributes(self, path):
        
        path_grp = self.handle[path]
        path_attr = path_grp.attrs
        return dict(path_attr)
582979
def _get_path(dict_, path):
    '''
    
    '''
    cur = dict_
    for part in path.split('/'):
        cur = cur[part]
    return cur
194384
def parse_json(path):
    # type: (str) -> List[FunctionInfo]
    
    with open(path) as f:
        data = json.load(f)  # type: List[RawEntry]
    result = []

    def assert_type(value, typ):
        # type: (object, type) -> None
        assert isinstance(value, typ), '%s: Unexpected type %r' % (path, type(value).__name__)

    def assert_dict_item(dictionary, key, typ):
        # type: (Mapping[Any, Any], str, type) -> None
        assert key in dictionary, '%s: Missing dictionary key %r' % (path, key)
        value = dictionary[key]
        assert isinstance(value, typ), '%s: Unexpected type %r for key %r' % (
            path, type(value).__name__, key)

    assert_type(data, list)
    for item in data:
        assert_type(item, dict)
        assert_dict_item(item, 'path', Text)
        assert_dict_item(item, 'line', int)
        assert_dict_item(item, 'func_name', Text)
        assert_dict_item(item, 'type_comments', list)
        for comment in item['type_comments']:
            assert_type(comment, Text)
        assert_type(item['samples'], int)
        info = FunctionInfo(encode(item['path']),
                            item['line'],
                            encode(item['func_name']),
                            [encode(comment) for comment in item['type_comments']],
                            item['samples'])
        result.append(info)
    return result
94548
def read_cfg(path) -> dict:
    
    ret = None
    full_path = __build_path(path)
    if os.path.isfile(full_path):
        with open(full_path, 'r') as myfile:
            ret = json.loads(myfile.read())
    return ret
857180
def iter_fields(self):
        
        def generator(path, values):
            for name,value in sorted(values.items()):
                if isinstance(value, ValueTree):
                    for inner in generator(path + name, value._values):
                        yield inner
                else:
                    yield (path, name, value)
        return generator(Path([]), self._values)
316709
def getFields(self):
        
        d = {}
        for i in self._attrsList:
            key = i
            value = getattr(self,  i)
            d[key] = value
        return d
628686
def extract_attributes(cls, fields, resource):
        
        data = OrderedDict()
        for field_name, field in six.iteritems(fields):
            # ID is always provided in the root of JSON API so remove it from attributes
            if field_name == 'id':
                continue
            # don't output a key for write only fields
            if fields[field_name].write_only:
                continue
            # Skip fields with relations
            if isinstance(
                    field, (relations.RelatedField, relations.ManyRelatedField, BaseSerializer)
            ):
                continue

            # Skip read_only attribute fields when `resource` is an empty
            # serializer. Prevents the "Raw Data" form of the browsable API
            # from rendering `"foo": null` for read only fields
            try:
                resource[field_name]
            except KeyError:
                if fields[field_name].read_only:
                    continue

            data.update({
                field_name: resource.get(field_name)
            })

        return utils._format_object(data)