code: def q17(lineitem, part):
      left = lineitem.loc[
          :, ["L_PARTKEY", "L_QUANTITY", "L_EXTENDEDPRICE"]
      ]
      right = part[
          (
              (part["P_BRAND"] == "Brand#23")
              & (part["P_CONTAINER"] == "MED BOX")
          )
      ]
      right = right.loc[:, ["P_PARTKEY"]]
      line_part_merge = left.merge(
          right, left_on="L_PARTKEY", right_on="P_PARTKEY", how="inner"
      )
      line_part_merge = line_part_merge.loc[
          :, ["L_QUANTITY", "L_EXTENDEDPRICE", "P_PARTKEY"]
      ]
      lineitem_filtered = lineitem.loc[:, ["L_PARTKEY", "L_QUANTITY"]]
      lineitem_avg = lineitem_filtered.groupby(
          ["L_PARTKEY"], as_index=False, sort=False
      ).agg(avg=md.NamedAgg(column="L_QUANTITY", aggfunc="mean"))
      lineitem_avg["avg"] = 0.2 * lineitem_avg["avg"]
      lineitem_avg = lineitem_avg.loc[:, ["L_PARTKEY", "avg"]]
      total = line_part_merge.merge(
          lineitem_avg,
          left_on="P_PARTKEY",
          right_on="L_PARTKEY",
          how="inner",
      )
      total = total[total["L_QUANTITY"] < total["avg"]]
      total = md.DataFrame(
          {"avg_yearly": [total["L_EXTENDEDPRICE"].sum() / 7.0]}
      )
      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 26 for calling a global function with example usage: q17(lineitem, part) without return types