---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/valid/statement/type.py
---
## AST

```
Module(
    ModModule {
        range: 0..1661,
        body: [
            TypeAlias(
                StmtTypeAlias {
                    range: 0..12,
                    name: Name(
                        ExprName {
                            range: 5..6,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 9..12,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 13..31,
                    name: Name(
                        ExprName {
                            range: 18..19,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: BinOp(
                        ExprBinOp {
                            range: 22..31,
                            left: Name(
                                ExprName {
                                    range: 22..25,
                                    id: "int",
                                    ctx: Load,
                                },
                            ),
                            op: BitOr,
                            right: Name(
                                ExprName {
                                    range: 28..31,
                                    id: "str",
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 32..60,
                    name: Name(
                        ExprName {
                            range: 37..38,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: BinOp(
                        ExprBinOp {
                            range: 41..60,
                            left: Name(
                                ExprName {
                                    range: 41..44,
                                    id: "int",
                                    ctx: Load,
                                },
                            ),
                            op: BitOr,
                            right: StringLiteral(
                                ExprStringLiteral {
                                    range: 47..60,
                                    value: StringLiteralValue {
                                        inner: Single(
                                            StringLiteral {
                                                range: 47..60,
                                                value: "ForwardRefY",
                                                flags: StringLiteralFlags {
                                                    quote_style: Double,
                                                    prefix: Empty,
                                                    triple_quoted: false,
                                                },
                                            },
                                        ),
                                    },
                                },
                            ),
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 61..87,
                    name: Name(
                        ExprName {
                            range: 66..67,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 67..70,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 68..69,
                                        name: Identifier {
                                            id: "T",
                                            range: 68..69,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: BinOp(
                        ExprBinOp {
                            range: 73..87,
                            left: Name(
                                ExprName {
                                    range: 73..74,
                                    id: "T",
                                    ctx: Load,
                                },
                            ),
                            op: BitOr,
                            right: Subscript(
                                ExprSubscript {
                                    range: 77..87,
                                    value: Name(
                                        ExprName {
                                            range: 77..81,
                                            id: "list",
                                            ctx: Load,
                                        },
                                    ),
                                    slice: Subscript(
                                        ExprSubscript {
                                            range: 82..86,
                                            value: Name(
                                                ExprName {
                                                    range: 82..83,
                                                    id: "X",
                                                    ctx: Load,
                                                },
                                            ),
                                            slice: Name(
                                                ExprName {
                                                    range: 84..85,
                                                    id: "T",
                                                    ctx: Load,
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 101..116,
                    name: Name(
                        ExprName {
                            range: 106..107,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 107..110,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 108..109,
                                        name: Identifier {
                                            id: "T",
                                            range: 108..109,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Name(
                        ExprName {
                            range: 113..116,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 117..145,
                    name: Name(
                        ExprName {
                            range: 122..123,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 123..126,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 124..125,
                                        name: Identifier {
                                            id: "T",
                                            range: 124..125,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: BinOp(
                        ExprBinOp {
                            range: 129..145,
                            left: Subscript(
                                ExprSubscript {
                                    range: 129..136,
                                    value: Name(
                                        ExprName {
                                            range: 129..133,
                                            id: "list",
                                            ctx: Load,
                                        },
                                    ),
                                    slice: Name(
                                        ExprName {
                                            range: 134..135,
                                            id: "T",
                                            ctx: Load,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                            op: BitOr,
                            right: Subscript(
                                ExprSubscript {
                                    range: 139..145,
                                    value: Name(
                                        ExprName {
                                            range: 139..142,
                                            id: "set",
                                            ctx: Load,
                                        },
                                    ),
                                    slice: Name(
                                        ExprName {
                                            range: 143..144,
                                            id: "T",
                                            ctx: Load,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 146..178,
                    name: Name(
                        ExprName {
                            range: 151..152,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 152..165,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 153..154,
                                        name: Identifier {
                                            id: "T",
                                            range: 153..154,
                                        },
                                        bound: None,
                                    },
                                ),
                                TypeVarTuple(
                                    TypeParamTypeVarTuple {
                                        range: 156..159,
                                        name: Identifier {
                                            id: "Ts",
                                            range: 157..159,
                                        },
                                    },
                                ),
                                ParamSpec(
                                    TypeParamParamSpec {
                                        range: 161..164,
                                        name: Identifier {
                                            id: "P",
                                            range: 163..164,
                                        },
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Tuple(
                        ExprTuple {
                            range: 168..178,
                            elts: [
                                Name(
                                    ExprName {
                                        range: 169..170,
                                        id: "T",
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 172..174,
                                        id: "Ts",
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 176..177,
                                        id: "P",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: true,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 179..216,
                    name: Name(
                        ExprName {
                            range: 184..185,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 185..203,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 186..192,
                                        name: Identifier {
                                            id: "T",
                                            range: 186..187,
                                        },
                                        bound: Some(
                                            Name(
                                                ExprName {
                                                    range: 189..192,
                                                    id: "int",
                                                    ctx: Load,
                                                },
                                            ),
                                        ),
                                    },
                                ),
                                TypeVarTuple(
                                    TypeParamTypeVarTuple {
                                        range: 194..197,
                                        name: Identifier {
                                            id: "Ts",
                                            range: 195..197,
                                        },
                                    },
                                ),
                                ParamSpec(
                                    TypeParamParamSpec {
                                        range: 199..202,
                                        name: Identifier {
                                            id: "P",
                                            range: 201..202,
                                        },
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Tuple(
                        ExprTuple {
                            range: 206..216,
                            elts: [
                                Name(
                                    ExprName {
                                        range: 207..208,
                                        id: "T",
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 210..212,
                                        id: "Ts",
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 214..215,
                                        id: "P",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: true,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 217..261,
                    name: Name(
                        ExprName {
                            range: 222..223,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 223..248,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 224..237,
                                        name: Identifier {
                                            id: "T",
                                            range: 224..225,
                                        },
                                        bound: Some(
                                            Tuple(
                                                ExprTuple {
                                                    range: 227..237,
                                                    elts: [
                                                        Name(
                                                            ExprName {
                                                                range: 228..231,
                                                                id: "int",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                        Name(
                                                            ExprName {
                                                                range: 233..236,
                                                                id: "str",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    ],
                                                    ctx: Load,
                                                    parenthesized: true,
                                                },
                                            ),
                                        ),
                                    },
                                ),
                                TypeVarTuple(
                                    TypeParamTypeVarTuple {
                                        range: 239..242,
                                        name: Identifier {
                                            id: "Ts",
                                            range: 240..242,
                                        },
                                    },
                                ),
                                ParamSpec(
                                    TypeParamParamSpec {
                                        range: 244..247,
                                        name: Identifier {
                                            id: "P",
                                            range: 246..247,
                                        },
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Tuple(
                        ExprTuple {
                            range: 251..261,
                            elts: [
                                Name(
                                    ExprName {
                                        range: 252..253,
                                        id: "T",
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 255..257,
                                        id: "Ts",
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 259..260,
                                        id: "P",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: true,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 292..307,
                    name: Name(
                        ExprName {
                            range: 297..301,
                            id: "type",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 304..307,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 308..324,
                    name: Name(
                        ExprName {
                            range: 313..318,
                            id: "match",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 321..324,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 325..340,
                    name: Name(
                        ExprName {
                            range: 330..334,
                            id: "case",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 337..340,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 366..381,
                    name: Name(
                        ExprName {
                            range: 371..374,
                            id: "foo",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 377..381,
                            id: "type",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 382..398,
                    name: Name(
                        ExprName {
                            range: 387..390,
                            id: "foo",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 393..398,
                            id: "match",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 399..414,
                    name: Name(
                        ExprName {
                            range: 404..407,
                            id: "foo",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 410..414,
                            id: "case",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 438..453,
                    name: Name(
                        ExprName {
                            range: 446..447,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 450..453,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 454..469,
                    name: Name(
                        ExprName {
                            range: 459..460,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 466..469,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 470..485,
                    name: Name(
                        ExprName {
                            range: 475..476,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 482..485,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 486..506,
                    name: Name(
                        ExprName {
                            range: 491..492,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 501..504,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 507..526,
                    name: Name(
                        ExprName {
                            range: 518..519,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 519..522,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 520..521,
                                        name: Identifier {
                                            id: "T",
                                            range: 520..521,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Name(
                        ExprName {
                            range: 525..526,
                            id: "T",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 527..547,
                    name: Name(
                        ExprName {
                            range: 532..533,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 540..543,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 541..542,
                                        name: Identifier {
                                            id: "T",
                                            range: 541..542,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Name(
                        ExprName {
                            range: 546..547,
                            id: "T",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 548..567,
                    name: Name(
                        ExprName {
                            range: 553..554,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 554..557,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 555..556,
                                        name: Identifier {
                                            id: "T",
                                            range: 555..556,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Name(
                        ExprName {
                            range: 566..567,
                            id: "T",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 589..601,
                    name: Name(
                        ExprName {
                            range: 594..595,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 598..601,
                            id: "int",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 603..615,
                    name: Name(
                        ExprName {
                            range: 608..609,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 612..615,
                            id: "str",
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 617..630,
                    name: Name(
                        ExprName {
                            range: 622..623,
                            id: "X",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Name(
                        ExprName {
                            range: 626..630,
                            id: "type",
                            ctx: Load,
                        },
                    ),
                },
            ),
            ClassDef(
                StmtClassDef {
                    range: 631..652,
                    decorator_list: [],
                    name: Identifier {
                        id: "X",
                        range: 637..638,
                    },
                    type_params: None,
                    arguments: None,
                    body: [
                        TypeAlias(
                            StmtTypeAlias {
                                range: 640..652,
                                name: Name(
                                    ExprName {
                                        range: 645..646,
                                        id: "X",
                                        ctx: Store,
                                    },
                                ),
                                type_params: None,
                                value: Name(
                                    ExprName {
                                        range: 649..652,
                                        id: "int",
                                        ctx: Load,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 654..686,
                    name: Name(
                        ExprName {
                            range: 659..664,
                            id: "Point",
                            ctx: Store,
                        },
                    ),
                    type_params: None,
                    value: Subscript(
                        ExprSubscript {
                            range: 667..686,
                            value: Name(
                                ExprName {
                                    range: 667..672,
                                    id: "tuple",
                                    ctx: Load,
                                },
                            ),
                            slice: Tuple(
                                ExprTuple {
                                    range: 673..685,
                                    elts: [
                                        Name(
                                            ExprName {
                                                range: 673..678,
                                                id: "float",
                                                ctx: Load,
                                            },
                                        ),
                                        Name(
                                            ExprName {
                                                range: 680..685,
                                                id: "float",
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 687..714,
                    name: Name(
                        ExprName {
                            range: 692..697,
                            id: "Point",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 697..700,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 698..699,
                                        name: Identifier {
                                            id: "T",
                                            range: 698..699,
                                        },
                                        bound: None,
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Subscript(
                        ExprSubscript {
                            range: 703..714,
                            value: Name(
                                ExprName {
                                    range: 703..708,
                                    id: "tuple",
                                    ctx: Load,
                                },
                            ),
                            slice: Tuple(
                                ExprTuple {
                                    range: 709..713,
                                    elts: [
                                        Name(
                                            ExprName {
                                                range: 709..710,
                                                id: "T",
                                                ctx: Load,
                                            },
                                        ),
                                        Name(
                                            ExprName {
                                                range: 712..713,
                                                id: "T",
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 715..751,
                    name: Name(
                        ExprName {
                            range: 720..727,
                            id: "IntFunc",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 727..732,
                            type_params: [
                                ParamSpec(
                                    TypeParamParamSpec {
                                        range: 728..731,
                                        name: Identifier {
                                            id: "P",
                                            range: 730..731,
                                        },
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Subscript(
                        ExprSubscript {
                            range: 735..751,
                            value: Name(
                                ExprName {
                                    range: 735..743,
                                    id: "Callable",
                                    ctx: Load,
                                },
                            ),
                            slice: Tuple(
                                ExprTuple {
                                    range: 744..750,
                                    elts: [
                                        Name(
                                            ExprName {
                                                range: 744..745,
                                                id: "P",
                                                ctx: Load,
                                            },
                                        ),
                                        Name(
                                            ExprName {
                                                range: 747..750,
                                                id: "int",
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 765..805,
                    name: Name(
                        ExprName {
                            range: 770..782,
                            id: "LabeledTuple",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 782..787,
                            type_params: [
                                TypeVarTuple(
                                    TypeParamTypeVarTuple {
                                        range: 783..786,
                                        name: Identifier {
                                            id: "Ts",
                                            range: 784..786,
                                        },
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Subscript(
                        ExprSubscript {
                            range: 790..805,
                            value: Name(
                                ExprName {
                                    range: 790..795,
                                    id: "tuple",
                                    ctx: Load,
                                },
                            ),
                            slice: Tuple(
                                ExprTuple {
                                    range: 796..804,
                                    elts: [
                                        Name(
                                            ExprName {
                                                range: 796..799,
                                                id: "str",
                                                ctx: Load,
                                            },
                                        ),
                                        Starred(
                                            ExprStarred {
                                                range: 801..804,
                                                value: Name(
                                                    ExprName {
                                                        range: 802..804,
                                                        id: "Ts",
                                                        ctx: Load,
                                                    },
                                                ),
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 822..870,
                    name: Name(
                        ExprName {
                            range: 827..843,
                            id: "HashableSequence",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 843..856,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 844..855,
                                        name: Identifier {
                                            id: "T",
                                            range: 844..845,
                                        },
                                        bound: Some(
                                            Name(
                                                ExprName {
                                                    range: 847..855,
                                                    id: "Hashable",
                                                    ctx: Load,
                                                },
                                            ),
                                        ),
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Subscript(
                        ExprSubscript {
                            range: 859..870,
                            value: Name(
                                ExprName {
                                    range: 859..867,
                                    id: "Sequence",
                                    ctx: Load,
                                },
                            ),
                            slice: Name(
                                ExprName {
                                    range: 868..869,
                                    id: "T",
                                    ctx: Load,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            TypeAlias(
                StmtTypeAlias {
                    range: 893..943,
                    name: Name(
                        ExprName {
                            range: 898..914,
                            id: "IntOrStrSequence",
                            ctx: Store,
                        },
                    ),
                    type_params: Some(
                        TypeParams {
                            range: 914..929,
                            type_params: [
                                TypeVar(
                                    TypeParamTypeVar {
                                        range: 915..928,
                                        name: Identifier {
                                            id: "T",
                                            range: 915..916,
                                        },
                                        bound: Some(
                                            Tuple(
                                                ExprTuple {
                                                    range: 918..928,
                                                    elts: [
                                                        Name(
                                                            ExprName {
                                                                range: 919..922,
                                                                id: "int",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                        Name(
                                                            ExprName {
                                                                range: 924..927,
                                                                id: "str",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    ],
                                                    ctx: Load,
                                                    parenthesized: true,
                                                },
                                            ),
                                        ),
                                    },
                                ),
                            ],
                        },
                    ),
                    value: Subscript(
                        ExprSubscript {
                            range: 932..943,
                            value: Name(
                                ExprName {
                                    range: 932..940,
                                    id: "Sequence",
                                    ctx: Load,
                                },
                            ),
                            slice: Name(
                                ExprName {
                                    range: 941..942,
                                    id: "T",
                                    ctx: Load,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 997..1011,
                    value: Tuple(
                        ExprTuple {
                            range: 997..1011,
                            elts: [
                                BinOp(
                                    ExprBinOp {
                                        range: 997..1008,
                                        left: BinOp(
                                            ExprBinOp {
                                                range: 997..1004,
                                                left: Name(
                                                    ExprName {
                                                        range: 997..1001,
                                                        id: "type",
                                                        ctx: Load,
                                                    },
                                                ),
                                                op: Mult,
                                                right: Name(
                                                    ExprName {
                                                        range: 1003..1004,
                                                        id: "a",
                                                        ctx: Load,
                                                    },
                                                ),
                                            },
                                        ),
                                        op: Add,
                                        right: Name(
                                            ExprName {
                                                range: 1007..1008,
                                                id: "b",
                                                ctx: Load,
                                            },
                                        ),
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 1010..1011,
                                        id: "c",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: false,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1036..1052,
                    value: Tuple(
                        ExprTuple {
                            range: 1036..1052,
                            elts: [
                                BinOp(
                                    ExprBinOp {
                                        range: 1036..1049,
                                        left: Name(
                                            ExprName {
                                                range: 1036..1040,
                                                id: "type",
                                                ctx: Load,
                                            },
                                        ),
                                        op: Mult,
                                        right: BinOp(
                                            ExprBinOp {
                                                range: 1043..1048,
                                                left: Name(
                                                    ExprName {
                                                        range: 1043..1044,
                                                        id: "a",
                                                        ctx: Load,
                                                    },
                                                ),
                                                op: Add,
                                                right: Name(
                                                    ExprName {
                                                        range: 1047..1048,
                                                        id: "b",
                                                        ctx: Load,
                                                    },
                                                ),
                                            },
                                        ),
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 1051..1052,
                                        id: "c",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: false,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1077..1093,
                    value: Call(
                        ExprCall {
                            range: 1077..1093,
                            func: Name(
                                ExprName {
                                    range: 1077..1081,
                                    id: "type",
                                    ctx: Load,
                                },
                            ),
                            arguments: Arguments {
                                range: 1082..1093,
                                args: [
                                    Starred(
                                        ExprStarred {
                                            range: 1083..1089,
                                            value: BinOp(
                                                ExprBinOp {
                                                    range: 1084..1089,
                                                    left: Name(
                                                        ExprName {
                                                            range: 1084..1085,
                                                            id: "a",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                    op: Add,
                                                    right: Name(
                                                        ExprName {
                                                            range: 1088..1089,
                                                            id: "b",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                    Name(
                                        ExprName {
                                            range: 1091..1092,
                                            id: "c",
                                            ctx: Load,
                                        },
                                    ),
                                ],
                                keywords: [],
                            },
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1119..1134,
                    value: BinOp(
                        ExprBinOp {
                            range: 1119..1134,
                            left: BinOp(
                                ExprBinOp {
                                    range: 1119..1130,
                                    left: Name(
                                        ExprName {
                                            range: 1119..1123,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    op: Sub,
                                    right: BinOp(
                                        ExprBinOp {
                                            range: 1125..1130,
                                            left: Name(
                                                ExprName {
                                                    range: 1125..1126,
                                                    id: "a",
                                                    ctx: Load,
                                                },
                                            ),
                                            op: Mult,
                                            right: Name(
                                                ExprName {
                                                    range: 1129..1130,
                                                    id: "b",
                                                    ctx: Load,
                                                },
                                            ),
                                        },
                                    ),
                                },
                            ),
                            op: Add,
                            right: Name(
                                ExprName {
                                    range: 1133..1134,
                                    id: "c",
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1160..1177,
                    value: BinOp(
                        ExprBinOp {
                            range: 1160..1177,
                            left: BinOp(
                                ExprBinOp {
                                    range: 1160..1173,
                                    left: Name(
                                        ExprName {
                                            range: 1160..1164,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    op: Sub,
                                    right: BinOp(
                                        ExprBinOp {
                                            range: 1167..1172,
                                            left: Name(
                                                ExprName {
                                                    range: 1167..1168,
                                                    id: "a",
                                                    ctx: Load,
                                                },
                                            ),
                                            op: Mult,
                                            right: Name(
                                                ExprName {
                                                    range: 1171..1172,
                                                    id: "b",
                                                    ctx: Load,
                                                },
                                            ),
                                        },
                                    ),
                                },
                            ),
                            op: Add,
                            right: Name(
                                ExprName {
                                    range: 1176..1177,
                                    id: "c",
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1203..1220,
                    value: BinOp(
                        ExprBinOp {
                            range: 1203..1220,
                            left: BinOp(
                                ExprBinOp {
                                    range: 1203..1216,
                                    left: Call(
                                        ExprCall {
                                            range: 1203..1212,
                                            func: Name(
                                                ExprName {
                                                    range: 1203..1207,
                                                    id: "type",
                                                    ctx: Load,
                                                },
                                            ),
                                            arguments: Arguments {
                                                range: 1208..1212,
                                                args: [
                                                    UnaryOp(
                                                        ExprUnaryOp {
                                                            range: 1209..1211,
                                                            op: USub,
                                                            operand: Name(
                                                                ExprName {
                                                                    range: 1210..1211,
                                                                    id: "a",
                                                                    ctx: Load,
                                                                },
                                                            ),
                                                        },
                                                    ),
                                                ],
                                                keywords: [],
                                            },
                                        },
                                    ),
                                    op: Mult,
                                    right: Name(
                                        ExprName {
                                            range: 1215..1216,
                                            id: "b",
                                            ctx: Load,
                                        },
                                    ),
                                },
                            ),
                            op: Add,
                            right: Name(
                                ExprName {
                                    range: 1219..1220,
                                    id: "c",
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1247..1256,
                    value: Attribute(
                        ExprAttribute {
                            range: 1247..1256,
                            value: Call(
                                ExprCall {
                                    range: 1247..1254,
                                    func: Name(
                                        ExprName {
                                            range: 1247..1251,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    arguments: Arguments {
                                        range: 1252..1254,
                                        args: [],
                                        keywords: [],
                                    },
                                },
                            ),
                            attr: Identifier {
                                id: "a",
                                range: 1255..1256,
                            },
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1272..1283,
                    value: Attribute(
                        ExprAttribute {
                            range: 1272..1283,
                            value: Call(
                                ExprCall {
                                    range: 1272..1281,
                                    func: Name(
                                        ExprName {
                                            range: 1272..1276,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    arguments: Arguments {
                                        range: 1277..1281,
                                        args: [
                                            Tuple(
                                                ExprTuple {
                                                    range: 1278..1280,
                                                    elts: [],
                                                    ctx: Load,
                                                    parenthesized: true,
                                                },
                                            ),
                                        ],
                                        keywords: [],
                                    },
                                },
                            ),
                            attr: Identifier {
                                id: "a",
                                range: 1282..1283,
                            },
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1301..1313,
                    value: Attribute(
                        ExprAttribute {
                            range: 1301..1313,
                            value: Call(
                                ExprCall {
                                    range: 1301..1311,
                                    func: Name(
                                        ExprName {
                                            range: 1301..1305,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    arguments: Arguments {
                                        range: 1306..1311,
                                        args: [
                                            Tuple(
                                                ExprTuple {
                                                    range: 1307..1309,
                                                    elts: [],
                                                    ctx: Load,
                                                    parenthesized: true,
                                                },
                                            ),
                                        ],
                                        keywords: [],
                                    },
                                },
                            ),
                            attr: Identifier {
                                id: "a",
                                range: 1312..1313,
                            },
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1331..1341,
                    value: Attribute(
                        ExprAttribute {
                            range: 1331..1341,
                            value: Subscript(
                                ExprSubscript {
                                    range: 1331..1339,
                                    value: Name(
                                        ExprName {
                                            range: 1331..1335,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    slice: Name(
                                        ExprName {
                                            range: 1337..1338,
                                            id: "a",
                                            ctx: Load,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                            attr: Identifier {
                                id: "b",
                                range: 1340..1341,
                            },
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1358..1369,
                    value: Attribute(
                        ExprAttribute {
                            range: 1358..1369,
                            value: Subscript(
                                ExprSubscript {
                                    range: 1358..1367,
                                    value: Name(
                                        ExprName {
                                            range: 1358..1362,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    slice: Tuple(
                                        ExprTuple {
                                            range: 1364..1366,
                                            elts: [
                                                Name(
                                                    ExprName {
                                                        range: 1364..1365,
                                                        id: "a",
                                                        ctx: Load,
                                                    },
                                                ),
                                            ],
                                            ctx: Load,
                                            parenthesized: false,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                            attr: Identifier {
                                id: "b",
                                range: 1368..1369,
                            },
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1408..1421,
                    value: Attribute(
                        ExprAttribute {
                            range: 1408..1421,
                            value: Subscript(
                                ExprSubscript {
                                    range: 1408..1419,
                                    value: Name(
                                        ExprName {
                                            range: 1408..1412,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    slice: Tuple(
                                        ExprTuple {
                                            range: 1414..1418,
                                            elts: [
                                                Name(
                                                    ExprName {
                                                        range: 1415..1416,
                                                        id: "a",
                                                        ctx: Load,
                                                    },
                                                ),
                                            ],
                                            ctx: Load,
                                            parenthesized: true,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                            attr: Identifier {
                                id: "b",
                                range: 1420..1421,
                            },
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1441..1457,
                    value: Subscript(
                        ExprSubscript {
                            range: 1441..1457,
                            value: Call(
                                ExprCall {
                                    range: 1441..1447,
                                    func: Name(
                                        ExprName {
                                            range: 1441..1445,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                    arguments: Arguments {
                                        range: 1445..1447,
                                        args: [],
                                        keywords: [],
                                    },
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    range: 1448..1456,
                                    lower: Some(
                                        Name(
                                            ExprName {
                                                range: 1448..1449,
                                                id: "a",
                                                ctx: Load,
                                            },
                                        ),
                                    ),
                                    upper: Some(
                                        Name(
                                            ExprName {
                                                range: 1455..1456,
                                                id: "b",
                                                ctx: Load,
                                            },
                                        ),
                                    ),
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            If(
                StmtIf {
                    range: 1476..1494,
                    test: Named(
                        ExprNamed {
                            range: 1479..1488,
                            target: Name(
                                ExprName {
                                    range: 1479..1483,
                                    id: "type",
                                    ctx: Store,
                                },
                            ),
                            value: NumberLiteral(
                                ExprNumberLiteral {
                                    range: 1487..1488,
                                    value: Int(
                                        1,
                                    ),
                                },
                            ),
                        },
                    ),
                    body: [
                        Pass(
                            StmtPass {
                                range: 1490..1494,
                            },
                        ),
                    ],
                    elif_else_clauses: [],
                },
            ),
            Assign(
                StmtAssign {
                    range: 1495..1530,
                    targets: [
                        Name(
                            ExprName {
                                range: 1495..1499,
                                id: "type",
                                ctx: Store,
                            },
                        ),
                    ],
                    value: Lambda(
                        ExprLambda {
                            range: 1502..1530,
                            parameters: Some(
                                Parameters {
                                    range: 1509..1514,
                                    posonlyargs: [],
                                    args: [
                                        ParameterWithDefault {
                                            range: 1509..1514,
                                            parameter: Parameter {
                                                range: 1509..1514,
                                                name: Identifier {
                                                    id: "query",
                                                    range: 1509..1514,
                                                },
                                                annotation: None,
                                            },
                                            default: None,
                                        },
                                    ],
                                    vararg: None,
                                    kwonlyargs: [],
                                    kwarg: None,
                                },
                            ),
                            body: Compare(
                                ExprCompare {
                                    range: 1516..1530,
                                    left: Name(
                                        ExprName {
                                            range: 1516..1521,
                                            id: "query",
                                            ctx: Load,
                                        },
                                    ),
                                    ops: [
                                        Eq,
                                    ],
                                    comparators: [
                                        Name(
                                            ExprName {
                                                range: 1525..1530,
                                                id: "event",
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                },
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1531..1546,
                    value: Call(
                        ExprCall {
                            range: 1531..1546,
                            func: Name(
                                ExprName {
                                    range: 1531..1536,
                                    id: "print",
                                    ctx: Load,
                                },
                            ),
                            arguments: Arguments {
                                range: 1536..1546,
                                args: [
                                    Call(
                                        ExprCall {
                                            range: 1537..1545,
                                            func: Name(
                                                ExprName {
                                                    range: 1537..1541,
                                                    id: "type",
                                                    ctx: Load,
                                                },
                                            ),
                                            arguments: Arguments {
                                                range: 1541..1545,
                                                args: [
                                                    NumberLiteral(
                                                        ExprNumberLiteral {
                                                            range: 1542..1544,
                                                            value: Int(
                                                                12,
                                                            ),
                                                        },
                                                    ),
                                                ],
                                                keywords: [],
                                            },
                                        },
                                    ),
                                ],
                                keywords: [],
                            },
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1547..1557,
                    value: Call(
                        ExprCall {
                            range: 1547..1557,
                            func: Name(
                                ExprName {
                                    range: 1547..1551,
                                    id: "type",
                                    ctx: Load,
                                },
                            ),
                            arguments: Arguments {
                                range: 1551..1557,
                                args: [
                                    Name(
                                        ExprName {
                                            range: 1552..1556,
                                            id: "type",
                                            ctx: Load,
                                        },
                                    ),
                                ],
                                keywords: [],
                            },
                        },
                    ),
                },
            ),
            Assign(
                StmtAssign {
                    range: 1558..1576,
                    targets: [
                        Name(
                            ExprName {
                                range: 1558..1559,
                                id: "a",
                                ctx: Store,
                            },
                        ),
                    ],
                    value: Compare(
                        ExprCompare {
                            range: 1565..1574,
                            left: Name(
                                ExprName {
                                    range: 1565..1569,
                                    id: "type",
                                    ctx: Load,
                                },
                            ),
                            ops: [
                                In,
                            ],
                            comparators: [
                                Name(
                                    ExprName {
                                        range: 1573..1574,
                                        id: "C",
                                        ctx: Load,
                                    },
                                ),
                            ],
                        },
                    ),
                },
            ),
            Assign(
                StmtAssign {
                    range: 1577..1593,
                    targets: [
                        Name(
                            ExprName {
                                range: 1577..1578,
                                id: "a",
                                ctx: Store,
                            },
                        ),
                    ],
                    value: Call(
                        ExprCall {
                            range: 1584..1591,
                            func: Name(
                                ExprName {
                                    range: 1584..1588,
                                    id: "type",
                                    ctx: Load,
                                },
                            ),
                            arguments: Arguments {
                                range: 1588..1591,
                                args: [
                                    Name(
                                        ExprName {
                                            range: 1589..1590,
                                            id: "b",
                                            ctx: Load,
                                        },
                                    ),
                                ],
                                keywords: [],
                            },
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1594..1611,
                    value: Call(
                        ExprCall {
                            range: 1594..1611,
                            func: Name(
                                ExprName {
                                    range: 1594..1598,
                                    id: "type",
                                    ctx: Load,
                                },
                            ),
                            arguments: Arguments {
                                range: 1599..1611,
                                args: [],
                                keywords: [
                                    Keyword {
                                        range: 1602..1609,
                                        arg: Some(
                                            Identifier {
                                                id: "X",
                                                range: 1602..1603,
                                            },
                                        ),
                                        value: Name(
                                            ExprName {
                                                range: 1606..1609,
                                                id: "int",
                                                ctx: Load,
                                            },
                                        ),
                                    },
                                ],
                            },
                        },
                    ),
                },
            ),
            Assign(
                StmtAssign {
                    range: 1612..1620,
                    targets: [
                        Name(
                            ExprName {
                                range: 1612..1616,
                                id: "type",
                                ctx: Store,
                            },
                        ),
                    ],
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            range: 1619..1620,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            Assign(
                StmtAssign {
                    range: 1621..1633,
                    targets: [
                        Name(
                            ExprName {
                                range: 1621..1625,
                                id: "type",
                                ctx: Store,
                            },
                        ),
                        Name(
                            ExprName {
                                range: 1628..1629,
                                id: "x",
                                ctx: Store,
                            },
                        ),
                    ],
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            range: 1632..1633,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            Assign(
                StmtAssign {
                    range: 1634..1646,
                    targets: [
                        Name(
                            ExprName {
                                range: 1634..1635,
                                id: "x",
                                ctx: Store,
                            },
                        ),
                        Name(
                            ExprName {
                                range: 1638..1642,
                                id: "type",
                                ctx: Store,
                            },
                        ),
                    ],
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            range: 1645..1646,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 1647..1661,
                    value: Lambda(
                        ExprLambda {
                            range: 1647..1661,
                            parameters: Some(
                                Parameters {
                                    range: 1654..1655,
                                    posonlyargs: [],
                                    args: [
                                        ParameterWithDefault {
                                            range: 1654..1655,
                                            parameter: Parameter {
                                                range: 1654..1655,
                                                name: Identifier {
                                                    id: "x",
                                                    range: 1654..1655,
                                                },
                                                annotation: None,
                                            },
                                            default: None,
                                        },
                                    ],
                                    vararg: None,
                                    kwonlyargs: [],
                                    kwarg: None,
                                },
                            ),
                            body: Name(
                                ExprName {
                                    range: 1657..1661,
                                    id: "type",
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
        ],
    },
)
```
