code: def copy_with(clazz, ignore_fields: list = None):
      """Copies clazz, temporarily sets values to None to avoid copying.
      not thread safe
      """
      from copy import deepcopy
  
      if not isinstance(clazz, Base):
          raise ValueError(
              "Only objects inheriting from Base class should be"
              "copied with copy_with."
          )
  
      fields = {}
      for field in ignore_fields:
          if (
              hasattr(clazz, field)
              and getattr(clazz, field) is not None
          ):
              fields[field] = getattr(clazz, field)
              clazz._set(field, None)
  
      new_clazz = deepcopy(clazz)
  
      for field in fields:
          clazz._set(field, fields[field])
  
      return new_clazz
  
imports: import numpy
  from tick.base import Base
label_desc: Use image node_id 3 for calling a global function with example usage: copy_with(clazz, ignore_fields) and returns: new_clazz