code: def _ipopo_setup_field_callback(cls, context):
      # type: (type, FactoryContext) -> None
      
      assert inspect.isclass(cls)
      assert isinstance(context, FactoryContext)
  
      if context.field_callbacks is not None:
          callbacks = context.field_callbacks.copy()
      else:
          callbacks = {}
  
      functions = inspect.getmembers(cls, inspect.isroutine)
      for name, func in functions:
          if not hasattr(func, constants.IPOPO_METHOD_FIELD_CALLBACKS):
              # No attribute, get the next member
              continue
  
          method_callbacks = getattr(func, constants.IPOPO_METHOD_FIELD_CALLBACKS)
          if not isinstance(method_callbacks, list):
              # Invalid content
              _logger.warning(
                  "Invalid attribute %s in %s",
                  constants.IPOPO_METHOD_FIELD_CALLBACKS,
                  name,
              )
              continue
  
          # Keeping it allows inheritance : by removing it, only the first
          # child will see the attribute -> Don't remove it
  
          # Store the call backs
          for kind, field, if_valid in method_callbacks:
              fields_cbs = callbacks.setdefault(field, {})
  
              if kind in fields_cbs and not is_from_parent(
                  cls, fields_cbs[kind][0].__name__
              ):
                  _logger.warning(
                      "Redefining the callback %s in '%s'. "
                      "Previous callback : '%s' (%s). "
                      "New callback : %s",
                      kind,
                      name,
                      fields_cbs[kind][0].__name__,
                      fields_cbs[kind][0],
                      func,
                  )
  
              fields_cbs[kind] = (func, if_valid)
  
      # Update the factory context
      context.field_callbacks.clear()
      context.field_callbacks.update(callbacks)
docs: Sets up the class _field_callback dictionary
  
      :param cls: The class to handle
      :param context: The factory class context