def quote_id(name):
    regular_id = True
    if not name[0] in VALID_FIRST_CHARS or name in RESERVED_WORDS:
        regular_id = False
    else:
        for ltr in name[1:]:
            if ltr not in VALID_CHARS:
                regular_id = False
                break

    return regular_id and name or '"%s"' % name
Quotes an identifier if necessary.
dataset/ETHPy150Open perseas/Pyrseas/pyrseas/dbobject/__init__.py/quote_id