Determine the names of an extended chord.
192724
def determine_extended_chord5(chord, shorthand=False, no_inversions=False,
        no_polychords=False):
    """"""
    if len(chord) != 5:
        # warning raise exeption: not an extended chord
        return False

    def inversion_exhauster(chord, shorthand, tries, result, polychords):
        """Recursive helper function."""
        def add_result(short):
            result.append((short, tries, chord[0]))

        triads = determine_triad(chord[:3], True, True)
        sevenths = determine_seventh(chord[:4], True, True, True)

        # Determine polychords
        if tries == 1 and not no_polychords:
            polychords += determine_polychords(chord, shorthand)

        intval4 = intervals.determine(chord[0], chord[4])
        for seventh in sevenths:
            seventh = seventh[len(chord[0]):]
            if seventh == 'M7':
                if intval4 == 'major second':
                    add_result('M9')
            elif seventh == 'm7':
                if intval4 == 'major second':
                    add_result('m9')
                elif intval4 == 'perfect fourth':
                    add_result('m11')
            elif seventh == '7':
                if intval4 == 'major second':
                    add_result('9')
                elif intval4 == 'minor second':
                    add_result('7b9')
                elif intval4 == 'augmented second':
                    add_result('7#9')
                elif intval4 == 'minor third':
                    add_result('7b12')
                elif intval4 == 'augmented fourth':
                    add_result('7#11')
                elif intval4 == 'major sixth':
                    add_result('13')
            elif seventh == 'M6':
                if intval4 == 'major second':
                    add_result('6/9')
                elif intval4 == 'minor seventh':
                    add_result('6/7')
        if tries != 5 and not no_inversions:
            return inversion_exhauster([chord[-1]] + chord[:-1], shorthand,
                    tries + 1, result, polychords)
        else:
            res = []
            for r in result:
                if shorthand:
                    res.append(r[2] + r[0])
                else:
                    res.append(r[2] + chord_shorthand_meaning[r[0]]
                                + int_desc(r[1]))
            return res + polychords

    return inversion_exhauster(chord, shorthand, 1, [], [])
299793
def get_curve_name(self, ecdh=False):
        """"""
        if ecdh:
            return formats.get_ecdh_curve_name(self.curve_name)
        else:
            return self.curve_name
1111092
private List<String> rdName()
	{
		List<String> names = new Vector<String>();
		names.add(rdIdentifier());

		if (ch == '`')
		{
			if (startOfName(rdCh()))
			{
				names.add(rdIdentifier());
			}
		}

		if (names.size() == 2)
		{
			// We have the strange mk_Mod`name case...

			String first = names.get(0);

			if (first.startsWith("mk_") || first.startsWith("is_"))
			{
				List<String> one = new Vector<String>();
				one.add(first + "`" + names.get(1));
				names = one;
			}
		}

		return names;
	}
141440
private void parseLastConsonant() {
		if (!validViSyll)
			return;
		if (iCurPos > strSyllable.length())
			strLastConsonant = ZERO;
		String strCon = strSyllable.substring(iCurPos, strSyllable.length());

		if (strCon.length() > 3) {
			validViSyll = false;
			return;
		}

		Iterator iter = alLastConsonants.iterator();
		while (iter.hasNext()) {
			String tempLastCon = (String) iter.next();
			if (strCon.equals(tempLastCon)) {
				strLastConsonant = tempLastCon;
				iCurPos += strLastConsonant.length();
				return;
			}
		}
		strLastConsonant = ZERO;
		if (iCurPos >= strSyllable.length())
			validViSyll = true;
		else validViSyll = false;
		
		return;
	}
1016479
def _get_help_names(self):
        """"""
        # Determine the additional help topics, if any.
        help_names = {}
        token2cmdname = self._get_canonical_map()
        for attrname, attr in self._gen_names_and_attrs():
            if not attrname.startswith("help_"): continue
            help_name = attrname[5:]
            if help_name not in token2cmdname:
                help_names[help_name] = attr
        return help_names
1081570
def eleventh(note):
    
    return [note, intervals.perfect_fifth(note), intervals.minor_seventh(note),
            intervals.perfect_fourth(note)]
850527
def extended_gcd(a, b):
    

    old_s, s = 1, 0
    old_t, t = 0, 1
    old_r, r = a, b
    
    while r != 0:
        quotient = old_r / r
        
        old_r, r = r, old_r - quotient * r
        old_s, s = s, old_s - quotient * s
        old_t, t = t, old_t - quotient * t
    
    return old_s, old_t, old_r
1101763
def names_from_exp(exp):
  ""
  def match(exp):
    return isinstance(exp, (sqparse2.NameX, sqparse2.AttrX))
  paths = treepath.sub_slots(exp, match, match=True, recurse_into_matches=False)
  return [exp[path] for path in paths]
971487
function determine(chord, shorthand, no_inversions, no_polychords) {
	if(shorthand == null) {
		shorthand = false;
	}
	if(no_inversions == null) {
		no_inversions = false;
	}
	if(no_polychords == null) {
		no_polychords = false;
	}
	if(chord == []) {
		return [];
	} else if(chord.length == 1) {
		return chord;
	} else if(chord.length == 2) {
		return [intervals.determine(chord[0], chord[1])];
	} else if(chord.length == 3) {
		return determine_triad(chord, shorthand, no_inversions, no_polychords);
	} else if(chord.length == 4) {
		return determine_seventh(chord, shorthand, no_inversions, no_polychords);
	} else if(chord.length == 5) {
		return determine_extended_chord5(chord, shorthand, no_inversions, no_polychords);
	} else if(chord.length == 6) {
		return determine_extended_chord6(chord, shorthand, no_inversions, no_polychords);
	} else if(chord.length == 7) {
		return determine_extended_chord7(chord, shorthand, no_inversions, no_polychords);
	} else {
		return determine_polychords(chord, shorthand);
	}
}
221828
def endnodes(self):
        """"""
        endnodes = devicetools.Nodes()
        for node in self.nodes:
            for element in node.exits:
                if ((element in self.elements) and
                        (node not in element.receivers)):
                    break
            else:
                endnodes += node
        return endnodes
1030338
def name(self):
        """"""
        parts = self._parts
        if len(parts) == (1 if (self._drv or self._root) else 0):
            return ''
        return parts[-1]
861498
def triad(note, key):
    
    return [note, intervals.third(note, key), intervals.fifth(note, key)]
1333675
public boolean hasChordNames() {
		MusicElement currentScoreEl;
		Iterator it = iterator();
		while (it.hasNext()) {
			currentScoreEl = (MusicElement) it.next();
			if (currentScoreEl instanceof NoteAbstract) {
				if (((NoteAbstract) currentScoreEl).getChordName() != null)
					return true;
			}
		}
		return false;
	}
1102373
def names(self):
        """"""
        if getattr(self, 'key', None) is None:
            result = []
        else:
            result = [self.key]
        if hasattr(self, 'aliases'):
            result.extend(self.aliases)
        return result
339087
function seventh(note, key) {
	var arr = triad(note, key);
	arr.push(intervals.seventh(note, key));
	return arr;
}
693970
def parse(chord):
    
    if len(chord) > 1 and chord[1] in ("b", "#"):
        root = chord[:2]
        rest = chord[2:]
    else:
        root = chord[:1]
        rest = chord[1:]
    check_note(root, chord)
    on_chord_idx = rest.find("/")
    if on_chord_idx >= 0:
        on = rest[on_chord_idx + 1:]
        rest = rest[:on_chord_idx]
        check_note(on, chord)
    else:
        on = None
    if rest in QUALITY_DICT:
        quality = Quality(rest)
    else:
        raise ValueError("Invalid chord {}: Unknown quality {}".format(chord, rest))
    # TODO: Implement parser for appended notes
    appended = []
    return root, quality, appended, on
962505
def note_to_chord(notes):
    
    if not notes:
        raise ValueError("Please specify notes which consist a chord.")
    root = notes[0]
    root_and_positions = []
    for rotated_notes in get_all_rotated_notes(notes):
        rotated_root = rotated_notes[0]
        root_and_positions.append([rotated_root, notes_to_positions(rotated_notes, rotated_notes[0])])
    chords = []
    for temp_root, positions in root_and_positions:
        quality = find_quality(positions)
        if quality is None:
            continue
        if temp_root == root:
            chord = "{}{}".format(root, quality)
        else:
            chord = "{}{}/{}".format(temp_root, quality, root)
        chords.append(Chord(chord))
    return chords