code: def tuple_with_attrs(name, fields: list[str], extra_fields: set[str]):
      # Build a tuple-like class with some extra attributes and a custom
      # pickling scheme with __getnewargs_ex__
      args = ", ".join(fields)
      kwargs = ", ".join(sorted(extra_fields))
      code = f"""
  def __new__(cls, {args}, *, {kwargs}):
      return tuple.__new__(cls, ({args}, ))
  
  def __init__(self, {args}, *, {kwargs}):
      for key, val in zip({sorted(extra_fields)}, [{kwargs}]):
          self.__dict__[key] = val
  
  def __eq__(self, other):
      return (
          type(other) is type(self)
          and tuple.__eq__(self, other)
          and all(getattr(self, k) == getattr(other, k) for k in self._fields)
      )
  
  def __ne__(self, other):
      return not (self == other)
  
  def __getnewargs_ex__(self):
      return tuple(self), self.__dict__
  """
      namespace = {
          "__builtins__": {
              "AttributeError": AttributeError,
              "tuple": tuple,
              "zip": zip,
              "super": super,
              "frozenset": frozenset,
              "type": type,
              "all": all,
              "getattr": getattr,
          }
      }
      exec(code, namespace)
      return type(
          name,
          (tuple,),
          {
              "_fields": frozenset(extra_fields),
              "__eq__": namespace["__eq__"],
              "__getnewargs_ex__": namespace["__getnewargs_ex__"],
              "__init__": namespace["__init__"],
              "__ne__": namespace["__ne__"],
              "__new__": namespace["__new__"],
          },
      )
  
imports: import inspect
  from functools import partial
  from io import StringIO
  import numpy
  import pytest
  from cudf.pandas.fast_slow_proxy import _fast_arg, _FunctionProxy, _slow_arg, _transform_arg, _Unusable, make_final_proxy_type, make_intermediate_proxy_type
label_desc: Use image node_id 22 for calling a global function with example usage: tuple_with_attrs(name, fields, extra_fields) and returns: type