(lines: List[str])
Returns a string representing the sort key of a block.

    The sort key is the first YAML key we encounter, ignoring comments, and
    stripping leading quotes.

    >>> print(test)
    # some comment
    'foo': true
    >>> first_key(test)
    'foo'
Returns a string representing the sort key of a block.
Returns a string representing the sort key of a block .
def first_key(lines: List[str]) -> str:
    """Returns a string representing the sort key of a block.

    The sort key is the first YAML key we encounter, ignoring comments, and
    stripping leading quotes.

    >>> print(test)
    # some comment
    'foo': true
    >>> first_key(test)
    'foo'
    """
    for line in lines:
        if line.startswith('#'):
            continue
        if any(line.startswith(quote) for quote in QUOTES):
            return line[1:]
        return line
    else:
        return ''
def first_key ( lines : List [ str ] ) -> str : for line in lines : if line . startswith ( '#' ) : continue if any ( line . startswith ( quote ) for quote in QUOTES ) : return line [ 1 : ] return line else : return ''