code: def clean_df(df, namespace, label_encoders):
      """Returns cleaned DF for nonconformist calibration"""
      # @TODO: reevaluate whether this can be streamlined
      enc = label_encoders
      ns = namespace
      target = ns.target
  
      if ns.is_classification:
          y = df.pop(target).values
          if enc and isinstance(enc.categories_[0][0], str):
              cats = enc.categories_[0].tolist()
              # the last element is "__mdb_unknown_cat"
              y = np.array(
                  [
                      cats.index(i) if i in cats else len(cats) - 1
                      for i in y
                  ]
              )
          y = y.clip(-pow(2, 63), pow(2, 63)).astype(int)
      elif ns.is_multi_ts:
          target_cols = [ns.target] + [
              f"{ns.target}_timestep_{i}"
              for i in range(1, ns.tss.horizon)
          ]
          y = np.transpose(
              np.array([df.pop(col) for col in target_cols])
          )
      else:
          y = df.pop(target).values
          y = y.astype(float)
  
      return df, y
  
file_path: lightwood/lightwood/analysis/nc/util.py
imports: from typing import Union, Optional
  import torch
  import numpy
  import pandas
  from torch.nn.functional import softmax
  from type_infer.dtype import dtype
label_desc: Use image node_id 2 for calling a global function with example usage: clean_df(df, namespace, label_encoders) and returns: df,  y