code: def worker(
      gen: np.random.Generator,
      statistic: str,
      trend: UnitRootTrend,
      idx: int,
      full_path: str,
  ) -> None:
      print(
          f"Starting Index: {BLUE}{idx}{RESET}, Statistic: {RED}{statistic}{RESET},"
          f"Trend: {GREEN}{trend}{RESET}"
      )
      remaining = EX_SIZE
      ncols = len(SAMPLE_SIZES) * MAX_STOCHASTIC_TRENDS * 4
      block_size = int(MAX_MEMORY / (ncols * 8))
      columns = DF_Z_COLUMNS if statistic == "z" else DF_P_COLUMNS
      results = pd.DataFrame(
          index=pd.RangeIndex(EX_SIZE), columns=columns, dtype="double"
      )
      gen, results, remaining = load_partial(
          gen, results, remaining, full_path
      )
      start = dt.datetime.now()
      last_print_remaining = remaining
      while remaining > 0:
          nsim = min(remaining, block_size)
          res_block = block(gen, statistic, nsim, trend)
          loc = EX_SIZE - remaining
          results.iloc[loc : loc + nsim] = res_block
          remaining -= block_size
          remaining = max(0, remaining)
          elapsed = dt.datetime.now() - start
          time_per_iter = elapsed.total_seconds() / (
              EX_SIZE - remaining
          )
          remaining_time = int(time_per_iter * remaining)
          rem = str(dt.timedelta(seconds=remaining_time))
          if last_print_remaining - remaining >= DISP_ITERATIONS:
              print(f"Index: {idx} {RED}Saving{RESET}")
              save_partial(gen, results, remaining, full_path)
              print(
                  f"Index: {idx}, Statistic: {statistic}, Trend: {trend}, "
                  f"Remaining: {GREEN}{remaining}{RESET}, "
                  f"Est. time remaining: {RED}{rem}{RESET}"
              )
              last_print_remaining = remaining
      results = results.quantile(QUANTILES)
      results.to_hdf(full_path, "results")
      if os.path.exists(temp_file_name(full_path)):
          try:
              os.unlink(temp_file_name(full_path))
          except OSError:
              pass
  
imports: import argparse
  import datetime
  import gzip
  import os
  import pickle
  from random import shuffle
  import sys
  from typing import IO, Optional, cast
  import colorama
  from joblib import Parallel, delayed
  import numpy
  from numpy.linalg import inv, lstsq, solve
  import pandas
  from phillips_ouliaris import QUANTILES, ROOT, SAMPLE_SIZES, TRENDS
  import psutil
  from arch.typing import Float64Array, Literal, UnitRootTrend
  from arch.utility.timeseries import add_trend
label_desc: Use image node_id 11 for calling a global function with example usage: worker(gen, statistic, trend, idx, full_path) without return types