Determine whether tkn is a valid python identifier

    :param tkn:
    :return:

def is_valid_python(tkn: str) -> bool:
    """Determine whether tkn is a valid python identifier

    :param tkn:
    :return:
    """
    try:
        root = ast.parse(tkn)
    except SyntaxError:
        return False
    return len(root.body) == 1 and isinstance(root.body[0], ast.Expr) and isinstance(root.body[0].value, ast.Name)