Returns the relevant nodes for the spec's frequency
505060
def nodes(self, tree):
        
        # Run the match against the tree
        if self.frequency == 'per_session':
            nodes = []
            for subject in tree.subjects:
                for sess in subject.sessions:
                    nodes.append(sess)
        elif self.frequency == 'per_subject':
            nodes = tree.subjects
        elif self.frequency == 'per_visit':
            nodes = tree.visits
        elif self.frequency == 'per_study':
            nodes = [tree]
        else:
            assert False, "Unrecognised frequency '{}'".format(
                self.frequency)
        return nodes
1257147
def get_nodes_by_qualified_name(self, graph, qualified_name_selector):
        
        qualified_name = qualified_name_selector.split(".")
        package_names = get_package_names(graph)
        for node, real_node in self.parsed_nodes(graph):
            if _node_is_match(qualified_name, package_names, real_node.fqn):
                yield node
437331
function getSpecifierIdentifiers(specifiers = [], withPath = false) {
  const collection = [];
  function loop(path, index) {
    const node = path.node
    const item = !withPath ? node.local.name : { path, name: node.local.name }
    switch (node.type) {
      case 'ImportDefaultSpecifier':
      case 'ImportSpecifier':
      case 'ImportNamespaceSpecifier':
        collection.push(item);
        break;
    }
  }
  specifiers.forEach(loop);

  return collection;
}
32826
def list_nodes():
    '''
    

    '''
    session = _get_session()
    vms = session.xenapi.VM.get_all_records()
    ret = {}
    for vm in vms:
        record = session.xenapi.VM.get_record(vm)
        if not record['is_a_template'] and not record['is_control_domain']:
            try:
                base_template_name = record['other_config']['base_template_name']
            except Exception:
                base_template_name = None
                log.debug(
                    'VM %s, doesnt have base_template_name attribute',
                    record['name_label']
                )
            ret[record['name_label']] = {'id': record['uuid'],
                                         'image': base_template_name,
                                         'name': record['name_label'],
                                         'size': record['memory_dynamic_max'],
                                         'state': record['power_state'],
                                         'private_ips': get_vm_ip(record['name_label'], session),
                                         'public_ips': None}
    return ret
202990
def get_term_freq(self, go_id):
        '''
            
        '''
        num_ns = float(self.get_total_count(self.go2obj[go_id].namespace))
        return float(self.get_count(go_id))/num_ns if num_ns != 0 else 0
694568
def lm_ffinal(freqs, damping_times, modes):
    

    f_max = {}
    for lmn in modes:
        l, m, nmodes = int(lmn[0]), int(lmn[1]), int(lmn[2])
        for n in range(nmodes):
            f_max['%d%d%d' %(l,m,n)] = qnm_freq_decay(freqs['%d%d%d' %(l,m,n)],
                                      damping_times['%d%d%d' %(l,m,n)], 1./1000)

    f_final = max(f_max.values())
    if f_final > max_freq:
        f_final = max_freq

    return f_final
1074637
def get_freq_tuples(my_list, print_total_threshold):
    
    d = {}
    for token in my_list:
        d.setdefault(token, 0)
        d[token] += 1
    return sorted(d.items(), key=operator.itemgetter(1), reverse=True)[:print_total_threshold]
231463
def nodes(self):
        """"""
        getnode = self._nodes.__getitem__
        return [getnode(nid) for nid in self._nodeids]
1330650
def ref_frequency(self, context):
        
        ref_freq = np.empty(context.shape, context.dtype)
        ref_freq[:] = 1.415e9

        return ref_freq
84966
def _nodes_to_values(self):
        
        def is_none(slice):
            return slice[0] == -1 and slice[1] == -1

        def get(slice):
            return self.string[slice[0]:slice[1]]

        return [(varname, get(slice), slice) for varname, slice in self._nodes_to_regs() if not is_none(slice)]
1291184
def find_Note(data, freq, bits):
    """"""
    data = find_frequencies(data, freq, bits)
    return sorted(find_notes(data), key=operator.itemgetter(1))[-1][0]
941699
def nodes(self) -> iter:
        """"""
        yield from (elem for elem, subs in self.inclusions.items() if subs == ())
1278859
def mine_sub_trees(self, threshold):
        
        patterns = {}
        mining_order = sorted(self.frequent.keys(),
                              key=lambda x: self.frequent[x])

        # Get items in tree in reverse order of occurrences.
        for item in mining_order:
            suffixes = []
            conditional_tree_input = []
            node = self.headers[item]

            # Follow node links to get a list of
            # all occurrences of a certain item.
            while node is not None:
                suffixes.append(node)
                node = node.link

            # For each occurrence of the item, 
            # trace the path back to the root node.
            for suffix in suffixes:
                frequency = suffix.count
                path = []
                parent = suffix.parent

                while parent.parent is not None:
                    path.append(parent.value)
                    parent = parent.parent

                for i in range(frequency):
                    conditional_tree_input.append(path)

            # Now we have the input for a subtree,
            # so construct it and grab the patterns.
            subtree = FPTree(conditional_tree_input, threshold,
                             item, self.frequent[item])
            subtree_patterns = subtree.mine_patterns(threshold)

            # Insert subtree patterns into main patterns dictionary.
            for pattern in subtree_patterns.keys():
                if pattern in patterns:
                    patterns[pattern] += subtree_patterns[pattern]
                else:
                    patterns[pattern] = subtree_patterns[pattern]

        return patterns
704898
def to_abivars(self):
        """"""
        return {
                # Spectral function
                "nomegasf": self.nomegasf,
                "domegasf": self.domegasf,
                "spmeth"  : self.spmeth,
                 # Frequency mesh for the polarizability
                "nfreqre"  : self.nfreqre,
                "freqremax": self.freqremax,
                "nfreqim"  : self.nfreqim,
                "freqremin": self.freqremin,
                }
195352
def nodes(xmrs):
    """"""
    nodes = []
    _props = xmrs.properties
    varsplit = sort_vid_split
    for p in xmrs.eps():
        sortinfo = None
        iv = p.intrinsic_variable
        if iv is not None:
            sort, _ = varsplit(iv)
            sortinfo = _props(iv)
            sortinfo[CVARSORT] = sort
        nodes.append(
            Node(p.nodeid, p.pred, sortinfo, p.lnk, p.surface, p.base, p.carg)
        )
    return nodes
445579
def Q(self):
        
        return np.array(list(self.center_frequencies)) \
               / np.array(list(self.bandwidths))
1037820
def nodes(self):
        
        if not hasattr(self, '_nodes'):
            base_url = "{}/{}".format(NodeBalancerConfig.api_endpoint, NodeBalancerNode.derived_url_path)
            result = self._client._get_objects(base_url, NodeBalancerNode, model=self, parent_id=(self.id, self.nodebalancer_id))

            self._set('_nodes', result)

        return self._nodes