(command.CommandList
  children: [
    (command.Simple
      blame_tok: <set>
      more_env: []
      words: [{<set>} {<-o>} {<nounset>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <set>
      more_env: []
      words: [{<set>} {<-o>} {<pipefail>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <set>
      more_env: []
      words: [{<set>} {<-o>} {<errexit>}]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <change-kind>
      name: change-kind
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'kind='> ($ Id.VSub_Number 1)}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'kind2='> 
                  (BracedVarSub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Number 2>
                    var_name: 2
                    suffix_op: 
                      (suffix_op.Unary
                        op: <Id.VTest_ColonHyphen _>
                        arg_word: {($ Id.VSub_DollarName kind)}
                      )
                    right: <Id.Right_DollarBrace '}'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-r>}
                {<-i>}
                {
                  (DQ <'s/'> (${ Id.VSub_Name kind) <'_([A-Z]+)/Id.'> (${ Id.VSub_Name kind2) <_> 
                    (word_part.EscapedLiteral
                      token: <Id.Lit_EscapedChar '\\\\'>
                      ch: '\\'
                    ) <L> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'> ch:'\\') <'1/g'>
                  )
                }
                {<Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-r>}
                {<-i>}
                {
                  (DQ <'s/'> (${ Id.VSub_Name kind) <'_([a-zA-Z]+)/'> (${ Id.VSub_Name kind2) <_> 
                    (word_part.EscapedLiteral
                      token: <Id.Lit_EscapedChar '\\\\'>
                      ch: '\\'
                    ) <u> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'> ch:'\\') <'1/g'>
                  )
                }
                {<Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <k2>
      name: k2
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'kind='> ($ Id.VSub_Number 1)}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'lower='> 
                  (BracedVarSub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Name kind>
                    var_name: kind
                    suffix_op: (suffix_op.Unary op:<Id.VOp1_DComma ',,'> arg_word:{})
                    right: <Id.Right_DollarBrace '}'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'title='> 
                  (BracedVarSub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Name lower>
                    var_name: lower
                    suffix_op: (suffix_op.Unary op:<Id.VOp1_Caret '^'> arg_word:{})
                    right: <Id.Right_DollarBrace '}'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'replace='> 
                  (BracedVarSub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Number 2>
                    var_name: 2
                    suffix_op: 
                      (suffix_op.Unary
                        op: <Id.VTest_ColonHyphen _>
                        arg_word: {($ Id.VSub_DollarName title)}
                      )
                    right: <Id.Right_DollarBrace '}'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-r>}
                {<-i>}
                {(DQ <'s/Id.'> (${ Id.VSub_Name kind) <'_/Id.'> (${ Id.VSub_Name replace) <'_/g'>)}
                {<Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-r>}
                {<-i>}
                {
                  (DQ <'s/TokenKind.'> (${ Id.VSub_Name kind) <'/TokenKind.'> (${ Id.VSub_Name replace) 
                    <'/g'>
                  )
                }
                {<Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <replace>
      name: replace
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'file='> ($ Id.VSub_Number 1)}]
              redirects: []
              do_fork: T
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (command.Simple
                          blame_tok: <read>
                          more_env: []
                          words: [{<read>} {<pat>} {<replace>}]
                          redirects: []
                          do_fork: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.Simple
                      blame_tok: <sed>
                      more_env: []
                      words: [
                        {<sed>}
                        {<-r>}
                        {<-i>}
                        {(DQ <'s/'> (${ Id.VSub_Name pat) <'/'> (${ Id.VSub_Name replace) <'/g'>)}
                        {<Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: [
                (Redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: {($ Id.VSub_DollarName file)}
                )
              ]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <replace2>
      name: replace2
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-r>}
                {<-i>}
                {(DQ <'s/^from core import runtime/from osh.meta import runtime/g'>)}
                {<Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <trailing-ws>
      name: trailing-ws
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [{<sed>} {<-r>} {<-i>} {(SQ <'s/[ ]+$//g'>)} {(DQ ($ Id.VSub_At '@'))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <Id.Left_DoubleQuote '"'>
      more_env: []
      words: [{(DQ ($ Id.VSub_At '@'))}]
      redirects: []
      do_fork: T
    )
  ]
)