Get data for an anchor from a list of components.
172756
def _get_anchor_data(anchor_data, glyphSet, components, anchor_name):
    """"""

    anchors = []
    for component in components:
        for anchor in glyphSet[component.baseGlyph].anchors:
            if anchor.name == anchor_name:
                anchors.append((anchor, component))
                break
    if len(anchors) > 1:
        for i, (anchor, component) in enumerate(anchors):
            t = Transform(*component.transformation)
            name = '%s_%d' % (anchor.name, i + 1)
            anchor_data[name] = t.transformPoint((anchor.x, anchor.y))
    elif anchors:
        anchor, component = anchors[0]
        t = Transform(*component.transformation)
        anchor_data[anchor.name] = t.transformPoint((anchor.x, anchor.y))
796559
function getComponent(tn) {
        var cid = tn.toLowerCase()
        var compDef
        components.some(function (comp) {
            if (comp.hasOwnProperty(cid)) {
                compDef = comp[cid]
                return true
            }
        })
        return compDef
    }
210271
def get_items(self, url, container, container_object, local_object):
        

        headers, container_uri = self._return_base_data(
            url=url,
            container=container,
            container_object=container_object
        )

        return self._getter(
            uri=container_uri,
            headers=headers,
            local_object=local_object
        )
1006959
def _get_data(self, id_list, format='MLDataset'):
        """"""

        format = format.lower()

        features = list()  # returning a dict would be better if AutoMKL() can handle it
        for modality, data in self._modalities.items():
            if format in ('ndarray', 'data_matrix'):
                # turning dict of arrays into a data matrix
                # this is arguably worse, as labels are difficult to pass
                subset = np.array(itemgetter(*id_list)(data))
            elif format in ('mldataset', 'pyradigm'):
                # getting container with fake data
                subset = self._dataset.get_subset(id_list)
                # injecting actual features
                subset.data = { id_: data[id_] for id_ in id_list }
            else:
                raise ValueError('Invalid output format - choose only one of '
                                 'MLDataset or data_matrix')

            features.append(subset)

        return features
813558
function getItemsFromList(list, itemsToGet) {
    var result = [];

    _.each(list, function (item) {
        for (var i = 0; i < itemsToGet.length; i++) {
            if (item.indexOf(itemsToGet[i]) === 0) {
                result.push(item);
            }
        }
    });

    return result;
}
1330386
def get(self, id=None, **kwargs):
        
        if id is not None:
            return self._get('components/%s' % id, data=kwargs)
        elif 'params' in kwargs:
            data = dict(kwargs)
            params = data.pop('params')
            return self._get('components', data=data, params=params)
        else:
            return self._get('components', data=kwargs)
975635
function getDataFromTree(rootElement, rootContext, fetchRoot, mergeProps, isTopLevel){

  //console.log(`Now searching element (${rootElement.type.name || rootElement.type.displayName}):`, rootElement);

  // Get array of queries (fetchData promises) from tree
  // This will traverse down recursively looking for fetchData() methods
  let queries = getQueriesFromTree(rootElement, rootContext, fetchRoot, mergeProps);

  // No queries found. We're done!
  if (!queries.length) {
    return Promise.resolve();
  }

  // We've traversed down as far as possible in thecurrent tree branch ...
  // Wait on each query that we found, re-rendering the subtree when it's done.
  const mappedQueries = queries.map(({ query, element, context }) =>  {
    return query.then((newProps) => {
      const displayName = element.type.displayName;

      if (!displayName){
        // TODO: Use Promise.reject and catch()
        throw new Error('[React Component Data] When resolving component data recursively each component must have a displayName set.');
      }

      // Add to finalData array that will be returned
      finalData[displayName] = newProps;
      // Traverse children
      // Component will use newProps returned by the query so we can find any children it might have as a result
      return getDataFromTree(element, context, false, newProps);
    })
  });

  return Promise.all(mappedQueries).then((values) => {
    // Only return final data at top level
    // Not inside recursive getDataFromTree calls
    if (isTopLevel){
      return finalData;
    }
  });
}
771843
def iter_for_anchor(self, anchor):
        """"""
        return (subtotal for subtotal in self._subtotals if subtotal.anchor == anchor)
148244
def get_data (self):
        """"""
        data = u"".join(self.buf)
        self.buf = []
        return data
703364
def links(self):
        """"""
        ret = []
        linkheader = self.getheader('link')
        if not linkheader:
            return ret
        for i in linkheader.split(','):
            try:
                url, params = i.split(';', 1)
            except ValueError:
                url, params = i, ''
            link = {}
            link['url'] = url.strip('''<> '"''')
            for param in params.split(';'):
                try:
                    k, v = param.split('=')
                except ValueError:
                    break
                link[k.strip(''' '"''')] = v.strip(''' '"''')
            ret.append(link)
        return ret
994419
def get_anchor(self):
        """"""
        temp = np.empty([self.n_nodes, 2])
        temp[:, 0] = np.arange(self.n_nodes, dtype=int)
        temp[:, 1] = np.sum(abs(self.tau_matrix), 1)
        anchor = int(temp[0, 0])
        return anchor
1267773
def get_component(self, component_type):
        '''
        
        '''
        matching_components = list(filter(lambda component:
                                          isinstance(component,
                                                     component_type),
                                          self._components))
        if matching_components:
            return matching_components[0]
        else:
            return None
352698
def getLinkInterfaces(self, node1, node2):
        '''
        
        '''
        linkdata = self.getLink(node1,node2)
        return linkdata[node1],linkdata[node1]
426079
def _parse_prop(search, proplist):
    """"""
    props = [i for i in proplist if all(item in i['urn'].items() for item in search.items())]
    if len(props) > 0:
        return props[0]['value'][list(props[0]['value'].keys())[0]]
373873
def get_text(nodelist):
    """"""
    value = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            value.append(node.data)
    return ''.join(value)
68022
def getElementsBy(self, cond: Callable[[Element], bool]) -> NodeList:
        """"""
        return getElementsBy(self, cond)
150620
def _get_array(data, position, obj_end, opts, element_name):
    """"""
    size = _UNPACK_INT(data[position:position + 4])[0]
    end = position + size - 1
    if data[end:end + 1] != b"\x00":
        raise InvalidBSON("bad eoo")

    position += 4
    end -= 1
    result = []

    # Avoid doing global and attibute lookups in the loop.
    append = result.append
    index = data.index
    getter = _ELEMENT_GETTER

    while position < end:
        element_type = data[position:position + 1]
        # Just skip the keys.
        position = index(b'\x00', position) + 1
        try:
            value, position = getter[element_type](
                data, position, obj_end, opts, element_name)
        except KeyError:
            _raise_unknown_type(element_type, element_name)
        append(value)

    if position != end + 1:
        raise InvalidBSON('bad array length')
    return result, position + 1