// Code generated; DO NOT EDIT.

use num_derive::FromPrimitive;

#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub(crate) enum Python {
    End = 0,
    Identifier = 1,
    SEMI = 2,
    Import = 3,
    DOT = 4,
    From = 5,
    Future = 6,
    LPAREN = 7,
    RPAREN = 8,
    COMMA = 9,
    As = 10,
    STAR = 11,
    Print = 12,
    GTGT = 13,
    Assert = 14,
    COLONEQ = 15,
    Return = 16,
    Del = 17,
    Raise = 18,
    Pass = 19,
    Break = 20,
    Continue = 21,
    If = 22,
    COLON = 23,
    Elif = 24,
    Else = 25,
    Match = 26,
    Case = 27,
    Async = 28,
    For = 29,
    In = 30,
    While = 31,
    Try = 32,
    Except = 33,
    STAR2 = 34,
    Finally = 35,
    With = 36,
    Def = 37,
    DASHGT = 38,
    STARSTAR = 39,
    Global = 40,
    Nonlocal = 41,
    Exec = 42,
    Type2 = 43,
    EQ = 44,
    Class = 45,
    LBRACK = 46,
    RBRACK = 47,
    AT = 48,
    DASH = 49,
    UNDERSCORE = 50,
    PIPE = 51,
    LBRACE = 52,
    RBRACE = 53,
    PLUS = 54,
    Not = 55,
    And = 56,
    Or = 57,
    SLASH = 58,
    PERCENT = 59,
    SLASHSLASH = 60,
    AMP = 61,
    CARET = 62,
    LTLT = 63,
    TILDE = 64,
    Is = 65,
    LT = 66,
    LTEQ = 67,
    EQEQ = 68,
    BANGEQ = 69,
    GTEQ = 70,
    GT = 71,
    LTGT = 72,
    Lambda3 = 73,
    PLUSEQ = 74,
    DASHEQ = 75,
    STAREQ = 76,
    SLASHEQ = 77,
    ATEQ = 78,
    SLASHSLASHEQ = 79,
    PERCENTEQ = 80,
    STARSTAREQ = 81,
    GTGTEQ = 82,
    LTLTEQ = 83,
    AMPEQ = 84,
    CARETEQ = 85,
    PIPEEQ = 86,
    Yield2 = 87,
    Ellipsis = 88,
    EscapeSequence = 89,
    BSLASH = 90,
    FormatSpecifierToken1 = 91,
    TypeConversion = 92,
    Integer = 93,
    Float = 94,
    Await2 = 95,
    True = 96,
    False = 97,
    None = 98,
    Comment = 99,
    LineContinuation = 100,
    Newline = 101,
    Indent = 102,
    Dedent = 103,
    StringStart = 104,
    StringContent2 = 105,
    EscapeInterpolation = 106,
    StringEnd = 107,
    Module = 108,
    Statement = 109,
    SimpleStatements = 110,
    ImportStatement = 111,
    ImportPrefix = 112,
    RelativeImport = 113,
    FutureImportStatement = 114,
    ImportFromStatement = 115,
    ImportList = 116,
    AliasedImport = 117,
    WildcardImport = 118,
    PrintStatement = 119,
    Chevron = 120,
    AssertStatement = 121,
    ExpressionStatement = 122,
    NamedExpression = 123,
    NamedExpressionLhs = 124,
    ReturnStatement = 125,
    DeleteStatement = 126,
    RaiseStatement = 127,
    PassStatement = 128,
    BreakStatement = 129,
    ContinueStatement = 130,
    IfStatement = 131,
    ElifClause = 132,
    ElseClause = 133,
    MatchStatement = 134,
    Block = 135,
    CaseClause = 136,
    ForStatement = 137,
    WhileStatement = 138,
    TryStatement = 139,
    ExceptClause = 140,
    FinallyClause = 141,
    WithStatement = 142,
    WithClause = 143,
    WithItem = 144,
    FunctionDefinition = 145,
    Parameters = 146,
    LambdaParameters = 147,
    ListSplat = 148,
    DictionarySplat = 149,
    GlobalStatement = 150,
    NonlocalStatement = 151,
    ExecStatement = 152,
    TypeAliasStatement = 153,
    ClassDefinition = 154,
    TypeParameter = 155,
    ParenthesizedListSplat = 156,
    ArgumentList = 157,
    DecoratedDefinition = 158,
    Decorator = 159,
    Block2 = 160,
    ExpressionList = 161,
    DottedName = 162,
    CasePattern = 163,
    SimplePattern = 164,
    AsPattern = 165,
    UnionPattern = 166,
    ListPattern = 167,
    TuplePattern = 168,
    DictPattern = 169,
    KeyValuePattern = 170,
    KeywordPattern = 171,
    SplatPattern = 172,
    ClassPattern = 173,
    ComplexPattern = 174,
    Parameters2 = 175,
    Patterns = 176,
    Parameter = 177,
    Pattern = 178,
    TuplePattern2 = 179,
    ListPattern2 = 180,
    DefaultParameter = 181,
    TypedDefaultParameter = 182,
    ListSplatPattern = 183,
    DictionarySplatPattern = 184,
    AsPattern2 = 185,
    ExpressionWithinForInClause = 186,
    Expression = 187,
    PrimaryExpression = 188,
    NotOperator = 189,
    BooleanOperator = 190,
    BinaryOperator = 191,
    UnaryOperator = 192,
    Notin = 193,
    Isnot = 194,
    ComparisonOperator = 195,
    Lambda = 196,
    Lambda2 = 197,
    Assignment = 198,
    AugmentedAssignment = 199,
    PatternList = 200,
    RightHandSide = 201,
    Yield = 202,
    Attribute = 203,
    Subscript = 204,
    Slice = 205,
    Call = 206,
    TypedParameter = 207,
    Type = 208,
    SplatType = 209,
    GenericType = 210,
    UnionType = 211,
    ConstrainedType = 212,
    MemberType = 213,
    KeywordArgument = 214,
    List = 215,
    Set = 216,
    Tuple = 217,
    Dictionary = 218,
    Pair = 219,
    ListComprehension = 220,
    DictionaryComprehension = 221,
    SetComprehension = 222,
    GeneratorExpression = 223,
    ComprehensionClauses = 224,
    ParenthesizedExpression = 225,
    CollectionElements = 226,
    ForInClause = 227,
    IfClause = 228,
    ConditionalExpression = 229,
    ConcatenatedString = 230,
    String = 231,
    StringContent = 232,
    Interpolation = 233,
    FExpression = 234,
    NotEscapeSequence = 235,
    FormatSpecifier = 236,
    Await = 237,
    PositionalSeparator = 238,
    KeywordSeparator = 239,
    ModuleRepeat1 = 240,
    SimpleStatementsRepeat1 = 241,
    ImportPrefixRepeat1 = 242,
    ImportListRepeat1 = 243,
    PrintStatementRepeat1 = 244,
    AssertStatementRepeat1 = 245,
    IfStatementRepeat1 = 246,
    MatchStatementRepeat1 = 247,
    MatchBlockRepeat1 = 248,
    CaseClauseRepeat1 = 249,
    TryStatementRepeat1 = 250,
    ExceptClauseRepeat1 = 251,
    WithClauseRepeat1 = 252,
    GlobalStatementRepeat1 = 253,
    TypeParameterRepeat1 = 254,
    ArgumentListRepeat1 = 255,
    DecoratedDefinitionRepeat1 = 256,
    DottedNameRepeat1 = 257,
    UnionPatternRepeat1 = 258,
    DictPatternRepeat1 = 259,
    ParametersRepeat1 = 260,
    PatternsRepeat1 = 261,
    ComparisonOperatorRepeat1 = 262,
    SubscriptRepeat1 = 263,
    DictionaryRepeat1 = 264,
    ComprehensionClausesRepeat1 = 265,
    CollectionElementsRepeat1 = 266,
    ForInClauseRepeat1 = 267,
    ConcatenatedStringRepeat1 = 268,
    StringRepeat1 = 269,
    StringContentRepeat1 = 270,
    FormatSpecifierRepeat1 = 271,
    AsPatternTarget = 272,
    FormatExpression = 273,
    Error = 274,
}

impl From<Python> for &'static str {
    #[inline(always)]
    fn from(tok: Python) -> Self {
        match tok {
            Python::End => "end",
            Python::Identifier => "identifier",
            Python::SEMI => ";",
            Python::Import => "import",
            Python::DOT => ".",
            Python::From => "from",
            Python::Future => "__future__",
            Python::LPAREN => "(",
            Python::RPAREN => ")",
            Python::COMMA => ",",
            Python::As => "as",
            Python::STAR => "*",
            Python::Print => "print",
            Python::GTGT => ">>",
            Python::Assert => "assert",
            Python::COLONEQ => ":=",
            Python::Return => "return",
            Python::Del => "del",
            Python::Raise => "raise",
            Python::Pass => "pass",
            Python::Break => "break",
            Python::Continue => "continue",
            Python::If => "if",
            Python::COLON => ":",
            Python::Elif => "elif",
            Python::Else => "else",
            Python::Match => "match",
            Python::Case => "case",
            Python::Async => "async",
            Python::For => "for",
            Python::In => "in",
            Python::While => "while",
            Python::Try => "try",
            Python::Except => "except",
            Python::STAR2 => "*",
            Python::Finally => "finally",
            Python::With => "with",
            Python::Def => "def",
            Python::DASHGT => "->",
            Python::STARSTAR => "**",
            Python::Global => "global",
            Python::Nonlocal => "nonlocal",
            Python::Exec => "exec",
            Python::Type2 => "type",
            Python::EQ => "=",
            Python::Class => "class",
            Python::LBRACK => "[",
            Python::RBRACK => "]",
            Python::AT => "@",
            Python::DASH => "-",
            Python::UNDERSCORE => "_",
            Python::PIPE => "|",
            Python::LBRACE => "{",
            Python::RBRACE => "}",
            Python::PLUS => "+",
            Python::Not => "not",
            Python::And => "and",
            Python::Or => "or",
            Python::SLASH => "/",
            Python::PERCENT => "%",
            Python::SLASHSLASH => "//",
            Python::AMP => "&",
            Python::CARET => "^",
            Python::LTLT => "<<",
            Python::TILDE => "~",
            Python::Is => "is",
            Python::LT => "<",
            Python::LTEQ => "<=",
            Python::EQEQ => "==",
            Python::BANGEQ => "!=",
            Python::GTEQ => ">=",
            Python::GT => ">",
            Python::LTGT => "<>",
            Python::Lambda3 => "lambda",
            Python::PLUSEQ => "+=",
            Python::DASHEQ => "-=",
            Python::STAREQ => "*=",
            Python::SLASHEQ => "/=",
            Python::ATEQ => "@=",
            Python::SLASHSLASHEQ => "//=",
            Python::PERCENTEQ => "%=",
            Python::STARSTAREQ => "**=",
            Python::GTGTEQ => ">>=",
            Python::LTLTEQ => "<<=",
            Python::AMPEQ => "&=",
            Python::CARETEQ => "^=",
            Python::PIPEEQ => "|=",
            Python::Yield2 => "yield",
            Python::Ellipsis => "ellipsis",
            Python::EscapeSequence => "escape_sequence",
            Python::BSLASH => "\\",
            Python::FormatSpecifierToken1 => "format_specifier_token1",
            Python::TypeConversion => "type_conversion",
            Python::Integer => "integer",
            Python::Float => "float",
            Python::Await2 => "await",
            Python::True => "true",
            Python::False => "false",
            Python::None => "none",
            Python::Comment => "comment",
            Python::LineContinuation => "line_continuation",
            Python::Newline => "_newline",
            Python::Indent => "_indent",
            Python::Dedent => "_dedent",
            Python::StringStart => "string_start",
            Python::StringContent2 => "_string_content",
            Python::EscapeInterpolation => "escape_interpolation",
            Python::StringEnd => "string_end",
            Python::Module => "module",
            Python::Statement => "_statement",
            Python::SimpleStatements => "_simple_statements",
            Python::ImportStatement => "import_statement",
            Python::ImportPrefix => "import_prefix",
            Python::RelativeImport => "relative_import",
            Python::FutureImportStatement => "future_import_statement",
            Python::ImportFromStatement => "import_from_statement",
            Python::ImportList => "_import_list",
            Python::AliasedImport => "aliased_import",
            Python::WildcardImport => "wildcard_import",
            Python::PrintStatement => "print_statement",
            Python::Chevron => "chevron",
            Python::AssertStatement => "assert_statement",
            Python::ExpressionStatement => "expression_statement",
            Python::NamedExpression => "named_expression",
            Python::NamedExpressionLhs => "_named_expression_lhs",
            Python::ReturnStatement => "return_statement",
            Python::DeleteStatement => "delete_statement",
            Python::RaiseStatement => "raise_statement",
            Python::PassStatement => "pass_statement",
            Python::BreakStatement => "break_statement",
            Python::ContinueStatement => "continue_statement",
            Python::IfStatement => "if_statement",
            Python::ElifClause => "elif_clause",
            Python::ElseClause => "else_clause",
            Python::MatchStatement => "match_statement",
            Python::Block => "block",
            Python::CaseClause => "case_clause",
            Python::ForStatement => "for_statement",
            Python::WhileStatement => "while_statement",
            Python::TryStatement => "try_statement",
            Python::ExceptClause => "except_clause",
            Python::FinallyClause => "finally_clause",
            Python::WithStatement => "with_statement",
            Python::WithClause => "with_clause",
            Python::WithItem => "with_item",
            Python::FunctionDefinition => "function_definition",
            Python::Parameters => "parameters",
            Python::LambdaParameters => "lambda_parameters",
            Python::ListSplat => "list_splat",
            Python::DictionarySplat => "dictionary_splat",
            Python::GlobalStatement => "global_statement",
            Python::NonlocalStatement => "nonlocal_statement",
            Python::ExecStatement => "exec_statement",
            Python::TypeAliasStatement => "type_alias_statement",
            Python::ClassDefinition => "class_definition",
            Python::TypeParameter => "type_parameter",
            Python::ParenthesizedListSplat => "parenthesized_list_splat",
            Python::ArgumentList => "argument_list",
            Python::DecoratedDefinition => "decorated_definition",
            Python::Decorator => "decorator",
            Python::Block2 => "block",
            Python::ExpressionList => "expression_list",
            Python::DottedName => "dotted_name",
            Python::CasePattern => "case_pattern",
            Python::SimplePattern => "_simple_pattern",
            Python::AsPattern => "as_pattern",
            Python::UnionPattern => "union_pattern",
            Python::ListPattern => "list_pattern",
            Python::TuplePattern => "tuple_pattern",
            Python::DictPattern => "dict_pattern",
            Python::KeyValuePattern => "_key_value_pattern",
            Python::KeywordPattern => "keyword_pattern",
            Python::SplatPattern => "splat_pattern",
            Python::ClassPattern => "class_pattern",
            Python::ComplexPattern => "complex_pattern",
            Python::Parameters2 => "_parameters",
            Python::Patterns => "_patterns",
            Python::Parameter => "parameter",
            Python::Pattern => "pattern",
            Python::TuplePattern2 => "tuple_pattern",
            Python::ListPattern2 => "list_pattern",
            Python::DefaultParameter => "default_parameter",
            Python::TypedDefaultParameter => "typed_default_parameter",
            Python::ListSplatPattern => "list_splat_pattern",
            Python::DictionarySplatPattern => "dictionary_splat_pattern",
            Python::AsPattern2 => "as_pattern",
            Python::ExpressionWithinForInClause => "_expression_within_for_in_clause",
            Python::Expression => "expression",
            Python::PrimaryExpression => "primary_expression",
            Python::NotOperator => "not_operator",
            Python::BooleanOperator => "boolean_operator",
            Python::BinaryOperator => "binary_operator",
            Python::UnaryOperator => "unary_operator",
            Python::Notin => "not in",
            Python::Isnot => "is not",
            Python::ComparisonOperator => "comparison_operator",
            Python::Lambda => "lambda",
            Python::Lambda2 => "lambda",
            Python::Assignment => "assignment",
            Python::AugmentedAssignment => "augmented_assignment",
            Python::PatternList => "pattern_list",
            Python::RightHandSide => "_right_hand_side",
            Python::Yield => "yield",
            Python::Attribute => "attribute",
            Python::Subscript => "subscript",
            Python::Slice => "slice",
            Python::Call => "call",
            Python::TypedParameter => "typed_parameter",
            Python::Type => "type",
            Python::SplatType => "splat_type",
            Python::GenericType => "generic_type",
            Python::UnionType => "union_type",
            Python::ConstrainedType => "constrained_type",
            Python::MemberType => "member_type",
            Python::KeywordArgument => "keyword_argument",
            Python::List => "list",
            Python::Set => "set",
            Python::Tuple => "tuple",
            Python::Dictionary => "dictionary",
            Python::Pair => "pair",
            Python::ListComprehension => "list_comprehension",
            Python::DictionaryComprehension => "dictionary_comprehension",
            Python::SetComprehension => "set_comprehension",
            Python::GeneratorExpression => "generator_expression",
            Python::ComprehensionClauses => "_comprehension_clauses",
            Python::ParenthesizedExpression => "parenthesized_expression",
            Python::CollectionElements => "_collection_elements",
            Python::ForInClause => "for_in_clause",
            Python::IfClause => "if_clause",
            Python::ConditionalExpression => "conditional_expression",
            Python::ConcatenatedString => "concatenated_string",
            Python::String => "string",
            Python::StringContent => "string_content",
            Python::Interpolation => "interpolation",
            Python::FExpression => "_f_expression",
            Python::NotEscapeSequence => "_not_escape_sequence",
            Python::FormatSpecifier => "format_specifier",
            Python::Await => "await",
            Python::PositionalSeparator => "positional_separator",
            Python::KeywordSeparator => "keyword_separator",
            Python::ModuleRepeat1 => "module_repeat1",
            Python::SimpleStatementsRepeat1 => "_simple_statements_repeat1",
            Python::ImportPrefixRepeat1 => "import_prefix_repeat1",
            Python::ImportListRepeat1 => "_import_list_repeat1",
            Python::PrintStatementRepeat1 => "print_statement_repeat1",
            Python::AssertStatementRepeat1 => "assert_statement_repeat1",
            Python::IfStatementRepeat1 => "if_statement_repeat1",
            Python::MatchStatementRepeat1 => "match_statement_repeat1",
            Python::MatchBlockRepeat1 => "_match_block_repeat1",
            Python::CaseClauseRepeat1 => "case_clause_repeat1",
            Python::TryStatementRepeat1 => "try_statement_repeat1",
            Python::ExceptClauseRepeat1 => "except_clause_repeat1",
            Python::WithClauseRepeat1 => "with_clause_repeat1",
            Python::GlobalStatementRepeat1 => "global_statement_repeat1",
            Python::TypeParameterRepeat1 => "type_parameter_repeat1",
            Python::ArgumentListRepeat1 => "argument_list_repeat1",
            Python::DecoratedDefinitionRepeat1 => "decorated_definition_repeat1",
            Python::DottedNameRepeat1 => "dotted_name_repeat1",
            Python::UnionPatternRepeat1 => "union_pattern_repeat1",
            Python::DictPatternRepeat1 => "dict_pattern_repeat1",
            Python::ParametersRepeat1 => "_parameters_repeat1",
            Python::PatternsRepeat1 => "_patterns_repeat1",
            Python::ComparisonOperatorRepeat1 => "comparison_operator_repeat1",
            Python::SubscriptRepeat1 => "subscript_repeat1",
            Python::DictionaryRepeat1 => "dictionary_repeat1",
            Python::ComprehensionClausesRepeat1 => "_comprehension_clauses_repeat1",
            Python::CollectionElementsRepeat1 => "_collection_elements_repeat1",
            Python::ForInClauseRepeat1 => "for_in_clause_repeat1",
            Python::ConcatenatedStringRepeat1 => "concatenated_string_repeat1",
            Python::StringRepeat1 => "string_repeat1",
            Python::StringContentRepeat1 => "string_content_repeat1",
            Python::FormatSpecifierRepeat1 => "format_specifier_repeat1",
            Python::AsPatternTarget => "as_pattern_target",
            Python::FormatExpression => "format_expression",
            Python::Error => "ERROR",
        }
    }
}

impl From<u16> for Python {
    #[inline(always)]
    fn from(x: u16) -> Self {
        num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
    }
}

// Python == u16
impl PartialEq<u16> for Python {
    #[inline(always)]
    fn eq(&self, x: &u16) -> bool {
        *self == Into::<Self>::into(*x)
    }
}

// u16 == Python
impl PartialEq<Python> for u16 {
    #[inline(always)]
    fn eq(&self, x: &Python) -> bool {
        *x == *self
    }
}
