code: def q12(lineitem, orders):
      date1 = md.Timestamp("1994-01-01")
      date2 = md.Timestamp("1995-01-01")
      sel = (
          (lineitem.L_RECEIPTDATE < date2)
          & (lineitem.L_COMMITDATE < date2)
          & (lineitem.L_SHIPDATE < date2)
          & (lineitem.L_SHIPDATE < lineitem.L_COMMITDATE)
          & (lineitem.L_COMMITDATE < lineitem.L_RECEIPTDATE)
          & (lineitem.L_RECEIPTDATE >= date1)
          & (
              (lineitem.L_SHIPMODE == "MAIL")
              | (lineitem.L_SHIPMODE == "SHIP")
          )
      )
      flineitem = lineitem[sel]
      jn = flineitem.merge(
          orders, left_on="L_ORDERKEY", right_on="O_ORDERKEY"
      )
  
      def g1(x):
          return ((x == "1-URGENT") | (x == "2-HIGH")).sum()
  
      def g2(x):
          return ((x != "1-URGENT") & (x != "2-HIGH")).sum()
  
      total = jn.groupby("L_SHIPMODE", as_index=False)[
          "O_ORDERPRIORITY"
      ].agg((g1, g2))
      total = (
          total.reset_index()
      )  # reset index to keep consistency with pandas
      # skip sort when groupby does sort already
      # total = total.sort_values("L_SHIPMODE")
      print(total.execute())
  
imports: import argparse
  import functools
  import time
  from typing import Callable, List, Optional, Set, Union
  import mars
  import mars.dataframe
label_desc: Use image node_id 21 for calling a global function with example usage: q12(lineitem, orders) and returns: unknown, unknown