def as_chord(chord):
if isinstance(chord, Chord):<EOL><INDENT>return chord<EOL><DEDENT>elif isinstance(chord, str):<EOL><INDENT>return Chord(chord)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>
convert from str to Chord instance if input is str

    :type chord: str|pychord.Chord
    :param chord: Chord name or Chord instance
    :rtype: pychord.Chord
    :return: Chord instance