get the semester of a node
960392
def get_semester_title(self, node: BaseNode):
        
        log.debug("Getting Semester Title for %s" % node.course.id)
        return self._get_semester_from_id(node.course.semester)
616035
function nodeClass (name, res) {
    var patt = name;
    if (res) {
      patt += res.type === "array"
        ? "(" + res.pattern.substring(1, res.pattern.length - 1) + ")"
        : res.pattern;
    }
    return node("class", patt, name, res ? [res] : undefined);
  }
124184
def get_node_parent_class(node):
    """"""

    while node.parent:  # pragma no branch
        if isinstance(node, ClassDef):
            return node

        node = node.parent
814259
def _in_class(self, node):
        """"""
        # Move left one indentation level and check if that callable is a class
        indent = self._get_indent(node)
        for indent_dict in reversed(self._indent_stack):  # pragma: no branch
            if (indent_dict["level"] < indent) or (indent_dict["type"] == "module"):
                return indent_dict["type"] == "class"
824537
def semester_feature(catalog, soup):
    
    raw = soup.coursedb['semesternumber']
    catalog.year = int(raw[:4])

    month_mapping = {1: 'Spring', 5: 'Summer', 9: 'Fall'}
    catalog.month = int(raw[4:])
    catalog.semester = month_mapping[catalog.month]

    catalog.name = soup.coursedb['semesterdesc']

    logger.info('Catalog type: %s' % catalog.name)
406213
def get_nodes(self, request):
        
        nodes = []
        archives = []
        attributes = {'hidden': HIDE_ENTRY_MENU}
        for entry in Entry.published.all():
            year = entry.creation_date.strftime('%Y')
            month = entry.creation_date.strftime('%m')
            month_text = format(entry.creation_date, 'b').capitalize()
            day = entry.creation_date.strftime('%d')

            key_archive_year = 'year-%s' % year
            key_archive_month = 'month-%s-%s' % (year, month)
            key_archive_day = 'day-%s-%s-%s' % (year, month, day)

            if key_archive_year not in archives:
                nodes.append(NavigationNode(
                    year, reverse('zinnia:entry_archive_year', args=[year]),
                    key_archive_year, attr=attributes))
                archives.append(key_archive_year)

            if key_archive_month not in archives:
                nodes.append(NavigationNode(
                    month_text,
                    reverse('zinnia:entry_archive_month', args=[year, month]),
                    key_archive_month, key_archive_year,
                    attr=attributes))
                archives.append(key_archive_month)

            if key_archive_day not in archives:
                nodes.append(NavigationNode(
                    day, reverse('zinnia:entry_archive_day',
                                 args=[year, month, day]),
                    key_archive_day, key_archive_month,
                    attr=attributes))
                archives.append(key_archive_day)

            nodes.append(NavigationNode(entry.title, entry.get_absolute_url(),
                                        entry.pk, key_archive_day))
        return nodes
511081
function getNodePath(node) {
    var nodePaths = [];
    var nodeParent = node;
    while (nodeParent) {
        switch (nodeParent.nodeType) {
            case NodeType.ELEM:
                nodePaths.unshift(nodeParent.tagName);
                break;

            case NodeType.IF:
                nodePaths.unshift('if');
                break;

            case NodeType.FOR:
                nodePaths.unshift('for[' + nodeParent.anode.directives['for'].raw + ']'); // eslint-disable-line dot-notation
                break;

            case NodeType.SLOT:
                nodePaths.unshift('slot[' + (nodeParent.name || 'default') + ']');
                break;

            case NodeType.TPL:
                nodePaths.unshift('template');
                break;

            case NodeType.CMPT:
                nodePaths.unshift('component[' + (nodeParent.subTag || 'root') + ']');
                break;

            case NodeType.TEXT:
                nodePaths.unshift('text');
                break;
        }

        nodeParent = nodeParent.parent;
    }

    return nodePaths;
}
1289039
function getUri() {
  const startPos = pos;
  const type = NodeType.UriType;
  const token = tokens[startPos];
  const line = token.ln;
  const column = token.col;
  let content = [];
  let end;

  const uriType = tokens[startPos].uriType;

  // Skip `url` and `(`.
  pos += 2;

  if (uriType === 1) content = content.concat(getUri1());
  else if (uriType === 2) content = content.concat(getUri2());
  else end = getLastPosition(content, line, column, 4);

  if (!end) end = getLastPosition(content, line, column, 1);

  // Skip `)`.
  pos++;

  return newNode(type, content, line, column, end);
}
594245
def get_node_description(self, node: BaseEntity) -> Optional[str]:
        """"""
        return self._get_node_attr(node, DESCRIPTION)
637254
def get_info(node_cfg):
        """"""

        node_cfg = node_cfg if isinstance(node_cfg, dict) else {"name": node_cfg}

        return node_cfg.get("name"), node_cfg.get("fields", {})
530633
def _get_labels(node, apiserver_url):
    ''''''
    # Prepare URL
    url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
    # Make request
    ret = http.query(url)
    # Check requests status
    if 'body' in ret:
        ret = salt.utils.json.loads(ret.get('body'))
    elif ret.get('status', 0) == 404:
        return "Node {0} doesn't exist".format(node)
    else:
        return ret
    # Get and return labels
    return ret.get('metadata', {}).get('labels', {})
936589
def node_version():
    """"""
    version = check_output(('node', '--version'))
    return tuple(int(x) for x in version.strip()[1:].split(b'.'))
746762
def getnodes(self, name):
        "'"
        for node in self.nodes:
            if striptag(node.tag) == name:
                yield node
214070
def get_roots(self):
        
        return [node for node, in_degree in dict(self.in_degree()).items() if in_degree == 0]
71178
function getNodeLength(node) {
	switch (node.nodeType) {
		case Node.PROCESSING_INSTRUCTION_NODE:
		case Node.DOCUMENT_TYPE_NODE:
			return 0;

		case Node.TEXT_NODE:
		case Node.COMMENT_NODE:
			return node.length;

		default:
			return node.childNodes.length;
	}
}
1247400
function () {
        var data = this.data;
        var nodes = this._nodes;

        for (var i = 0, len = nodes.length; i < len; i++) {
            nodes[i].dataIndex = -1;
        }

        for (var i = 0, len = data.count(); i < len; i++) {
            nodes[data.getRawIndex(i)].dataIndex = i;
        }
    }
404874
function getTermsForCollectingAddition(node) {
  let terms = {};

  for(let i = 0; i < node.args.length; i++) {
    const child = node.args[i];

    if (Node.PolynomialTerm.isPolynomialTerm(child)) {
      const termName = getTermName(child, '+');
      terms = Util.appendToArrayInObject(terms, termName, child);
    }
    else if (Node.Type.isIntegerFraction(child)) {
      terms = Util.appendToArrayInObject(terms, CONSTANT_FRACTION, child);
    }
    else if (Node.Type.isConstant(child)) {
      terms = Util.appendToArrayInObject(terms, CONSTANT, child);
    }
    else if (Node.Type.isOperator(node) ||
             Node.Type.isFunction(node) ||
             Node.Type.isParenthesis(node) ||
             Node.Type.isUnaryMinus(node)) {
      terms = Util.appendToArrayInObject(terms, OTHER, child);
    }
    else {
      // Note that we shouldn't get any symbol nodes in the switch statement
      // since they would have been handled by isPolynomialTerm
      throw Error('Unsupported node type: ' + child.type);
    }
  }
  // If there's exactly one constant and one fraction, we collect them
  // to add them together.
  // e.g. 2 + 1/3 + 5 would collect the constants (2+5) + 1/3
  // but 2 + 1/3 + x would collect (2 + 1/3) + x so we can add them together
  if (terms[CONSTANT] && terms[CONSTANT].length === 1 &&
     terms[CONSTANT_FRACTION] && terms[CONSTANT_FRACTION].length === 1) {
    const fraction = terms[CONSTANT_FRACTION][0];
    terms = Util.appendToArrayInObject(terms, CONSTANT, fraction);
    delete terms[CONSTANT_FRACTION];
  }

  return terms;
}