API:
            get_degree(self)
        Description:
            Returns degrees of nodes in dictionary format.
        Return:
            Returns a dictionary of node degrees. Keys are node names, values
            are corresponding degrees.
181666
def get_out_degrees(self):
        '''
        
        '''
        degree = {}
        if self.attr['type'] is not DIRECTED_GRAPH:
            print('This function only works for directed graphs')
            return
        for n in self.get_node_list():
            degree[n] = len(self.get_out_neighbors(n))
        return degree
71585
def get_degree(self, poly=None):
        ''''''
        if not poly:
            return self.degree
            #return len(self.coefficients) - 1
        elif poly and hasattr("coefficients", poly):
            return len(poly.coefficients) - 1
        else:
            while poly and poly[-1] == 0:
                poly.pop()   # normalize
            return len(poly)-1
1077937
def compute_node_positions(self):
        
        xs = []
        ys = []
        self.locs = dict()

        for node in self.nodes:
            x = self.graph.node[node][self.node_lon]
            y = self.graph.node[node][self.node_lat]
            xs.append(x)
            ys.append(y)
            self.locs[node] = (x, y)

        self.node_coords = {"x": xs, "y": ys}
983218
def academic_degree(self) -> str:
        
        degrees = self._data['academic_degree']
        return self.random.choice(degrees)
1242570
def get_nodes_positions(self):
        
        nodes = self.get_nodes()
        output = {}
        for node in nodes:
            output[node[0]] = (float(node[1][consts.Consts.x]), float(node[1][consts.Consts.y]))
        return output
108995
def get_orientation_degrees(self):
        

        orientation = self.get_orientation_radians()
        for key, val in orientation.items():
            deg = math.degrees(val)  # Result is -180 to +180
            orientation[key] = deg + 360 if deg < 0 else deg
        return orientation
446851
def node_to_dict(node):
    
    dic = dict(tag=striptag(node.tag))
    if node.attrib:
        dic['attrib'] = node.attrib
    if node.text is not None:
        dic['text'] = node.text
    if node.nodes:
        dic['nodes'] = [node_to_dict(n) for n in node]
    return dic
933057
def get_pair(self, pair):
        
        i, j = pair
        return (self._nodes[i.name()], self._nodes[j.name()])
178979
def ncdegree(polynomial):
    
    degree = 0
    if is_number_type(polynomial):
        return degree
    polynomial = polynomial.expand()
    for monomial in polynomial.as_coefficients_dict():
        subdegree = 0
        for variable in monomial.as_coeff_mul()[1]:
            if isinstance(variable, Pow):
                subdegree += variable.exp
            elif not isinstance(variable, Number) and variable != I:
                subdegree += 1
        if subdegree > degree:
            degree = subdegree
    return degree
58888
def viewkeys(self):
		
		if hasattr(self._nodes, 'viewkeys'):
			return self._nodes.viewkeys()
		else:
			return self._nodes.keys()
1247140
def _scale_degrees():
    '''
    degrees = ['1', '2', '3',  '4',  '5',  '6', '7',
               '8', '9', '10', '11', '12', '13']
    semitones = [0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 21]
    return dict([(d, s) for d, s in zip(degrees, semitones)])
1272151
def get_coordination_of_site(self, n):
        
        number_of_self_loops = sum([1 for n, v in self.graph.edges(n) if n == v])
        return self.graph.degree(n) - number_of_self_loops
1194379
def get_cfn_parameters(self):
        
        variables = self.get_variables()
        output = {}
        for key, value in variables.items():
            if hasattr(value, "to_parameter_value"):
                output[key] = value.to_parameter_value()
        return output
894708
def AsDict(self):
    
    sources = []
    for source in self.sources:
      source_definition = {
          'type': source.type_indicator,
          'attributes': source.AsDict()
      }
      if source.supported_os:
        source_definition['supported_os'] = source.supported_os
      if source.conditions:
        source_definition['conditions'] = source.conditions
      sources.append(source_definition)

    artifact_definition = {
        'name': self.name,
        'doc': self.description,
        'sources': sources,
    }
    if self.labels:
      artifact_definition['labels'] = self.labels
    if self.supported_os:
      artifact_definition['supported_os'] = self.supported_os
    if self.provides:
      artifact_definition['provides'] = self.provides
    if self.conditions:
      artifact_definition['conditions'] = self.conditions
    if self.urls:
      artifact_definition['urls'] = self.urls
    return artifact_definition
912014
def get(self):
        
        return {k:v for k,v in list(self.options.items()) if k in self._allowed_axes}
111506
def get_nodes(self):
        

        return [node for node in foundations.walkers.nodes_walker(self.model().root_node)]
665782
def get_nodes(self):
        
        return self.fold_up(lambda n, fl, fg: [n] + fl + fg, lambda leaf: [leaf])