Read all inner elements with their text, and return a mapping with the element's name as key and inner text as value.
512665
public AsyncWork<Map<String,String>, Exception> readInnerElementsText() {
		AsyncWork<Map<String,String>, Exception> result = new AsyncWork<>();
		Map<String, String> texts = new HashMap<>();
		readInnerElementsText(event.context.getFirst(), texts, result);
		return result;
	}
1063975
def read_map(fname):
    
    lst = []
    with open(fname, "r") as f:
        for line in f:
            lst.append(line)
    return lst
215038
def get_element_by_path(tree, path_and_name, namespace):
    # type: (_Element, str, str) -> typing.Union[_Element, None]
    """"""
    global xml_element_cache
    namespace_map = {'A': namespace[1:-1]}
    base_path, element_name = path_and_name.rsplit('/', 1)
    if base_path in xml_element_cache:
        base_element = xml_element_cache[base_path]
    else:
        base_xpath = ar_path_to_x_path(base_path)
        elems = tree.xpath(base_xpath, namespaces=namespace_map)
        base_element = elems[0] if elems else None
        xml_element_cache[base_path] = base_element

    element_found = None
    if base_element is not None:
        element_found = base_element.xpath(
            ".//A:SHORT-NAME[text()='{name}']/..".format(name=element_name),
            namespaces=namespace_map)[0]
    return element_found
1346339
protected Map<String, Object> readSimpleObject() {
		log.debug("readSimpleObject");
		Map<String, Object> result = new ObjectMap<>();
		readKeyValues(result);
		storeReference(result);
		return result;
	}
361639
@Override
	public Map<String, Object> readKeyValues() {
		Map<String, Object> result = new HashMap<String, Object>();
		readKeyValues(result);
		return result;
	}
1274055
def keys(self):
        
        keys = ['text']
        keys.extend([n for (n, t, r) in self.c_attributes.values()])
        keys.extend([v[0] for v in self.c_children.values()])
        return keys
263281
def get_scan_nr(element, attribname):
    """"""
    info = element.attrib[attribname]
    infomap = {y[0]: y[1] for y in [x.split('=') for x in info.split()]}
    return infomap['scan']
224545
def get_element(parent_to_parse, element_path=None):
    

    if parent_to_parse is None:
        return None

    elif isinstance(parent_to_parse, ElementTree):
        parent_to_parse = parent_to_parse.getroot()

    elif hasattr(parent_to_parse, 'read'):
        parent_to_parse = string_to_element(parent_to_parse.read())

    elif isinstance(parent_to_parse, STRING_TYPES):
        parent_to_parse = string_to_element(parent_to_parse)

    elif isinstance(parent_to_parse, dict):
        parent_to_parse = dict_to_element(parent_to_parse)

    if parent_to_parse is None:
        return None
    elif not isinstance(parent_to_parse, ElementType):
        element_type = type(parent_to_parse).__name__
        raise TypeError('Invalid element type: {0}'.format(element_type))

    return parent_to_parse.find(element_path) if element_path else parent_to_parse
174503
def get_inner_data(dictionary):
    

    out = {}

    for key in dictionary.keys():
        inner_keys = dictionary[key].keys()
        for inner_key in inner_keys:
            new_key = key + " " + inner_key  # concatenate
            out[new_key] = dictionary[key][inner_key]

    return out
900037
def hmset(self, name, mapping):
        
        with self.pipe as pipe:
            m_encode = self.memberparse.encode
            mapping = {m_encode(k): self._value_encode(k, v)
                       for k, v in mapping.items()}
            return pipe.hmset(self.redis_key(name), mapping)
978349
def _elementtree_to_dict(self, element):
        
        node = {}
        text = getattr(element, 'text')
        if text is not None:
            text = text.strip()
            if len(text) != 0:
                node['text'] = text
        node.update(element.items())  # element's attributes
        child_nodes = {}
        for child in element:  # element's children
            child_nodes.setdefault(child.tag, []).append(
                self._elementtree_to_dict(child))
        # convert all single-element lists into non-lists
        for key, value in child_nodes.items():
            if len(value) == 1:
                child_nodes[key] = value[0]
        node.update(child_nodes.items())
        return node
1187538
def _lookup_element(lst, key):
    '''
    
    '''
    if not lst:
        return {}
    for ele in lst:
        if not ele or not isinstance(ele, dict):
            continue
        if ele.keys()[0] == key:
            return ele.values()[0]
    return {}
572947
def _element_to_dict(data, position, obj_end, opts):
    """"""
    element_type = data[position:position + 1]
    position += 1
    element_name, position = _get_c_string(data, position, opts)
    try:
        value, position = _ELEMENT_GETTER[element_type](data, position,
                                                        obj_end, opts,
                                                        element_name)
    except KeyError:
        _raise_unknown_type(element_type, element_name)
    return element_name, value, position
23494
def _parse_text(self, el, refs=None, specials=None,  element_cls=Paragraph):
        """"""
        if specials is None:
            specials = {}
        if refs is None:
            refs = {}
        elements = self._parse_element_r(el, specials=specials, refs=refs, element_cls=element_cls)
        # This occurs if the input element is self-closing... (some table td in NLM XML)
        if not elements:
            return [element_cls('')]
        element = elements[0]
        for next_element in elements[1:]:
            element += element_cls(' ') + next_element
        return [element]
1137871
public List<String> getMappings(String elementName) {

        List<String> result = m_elementMappings.get(elementName);
        if (result == null) {
            result = Collections.emptyList();
        }
        return result;
    }
565403
def _find_element_text(element, match, default=None):
    
    child = element.find(match)
    try:
        return child.text
    except AttributeError:
        if default is not None:
            return default
        else:
            raise MissingElementError(element, match)
501724
function getText (element, callback) {
  const iterator = new NodeIterator(element)
  let next
  while ((next = iterator.getNext())) {
    if (next.nodeType === nodeType.textNode && next.data !== '') {
      callback(next.data)
    } else if (next.nodeType === nodeType.elementNode && next.nodeName === 'BR') {
      callback(' ') // eslint-disable-line standard/no-callback-literal
    }
  }
}