code: def derive_new_schema_manager(
      self,
      with_sample_id=True,
      with_match_id=True,
      with_label=True,
      with_weight=True,
      columns: Union[str, list] = None,
  ):
      derived_schema_manager = SchemaManager()
      derived_schema = Schema()
  
      indexes = []
  
      derived_schema.anonymous_summary = self._schema.anonymous_summary
      if with_sample_id:
          derived_schema.sample_id_name = self._schema.sample_id_name
  
      if with_match_id:
          derived_schema.match_id_name = self._schema.match_id_name
  
      if with_label:
          derived_schema.label_name = self._schema.label_name
          derived_schema.anonymous_label_name = (
              self._schema.anonymous_label_name
          )
  
      if with_weight:
          derived_schema.weight_name = self._schema.weight_name
          derived_schema.anonymous_weight_name = (
              self._schema.anonymous_weight_name
          )
  
      if columns:
          if isinstance(columns, str):
              columns = [columns]
  
          derived_columns = []
          derived_anonymous_columns = []
  
          anonymous_mappings = dict(
              zip(self._schema.columns, self._schema.anonymous_columns)
          )
          for column in columns:
              anonymous_column = anonymous_mappings[column]
              derived_columns.append(column)
              derived_anonymous_columns.append(anonymous_column)
  
          derived_schema.columns = pd.Index(derived_columns)
          derived_schema.anonymous_columns = pd.Index(
              derived_anonymous_columns
          )
  
      derived_schema_manager.schema = derived_schema
      derived_schema_manager.init_name_mapping()
  
      for name in derived_schema_manager.get_all_keys():
          indexes.append(
              (
                  self.get_field_offset(name),
                  derived_schema_manager.get_field_offset(name),
              )
          )
          derived_schema_manager._type_mapping[
              name
          ] = self.get_field_types(name)
  
      return derived_schema_manager, sorted(indexes)
  
imports: import copy
  from typing import List, Union
  import pandas
  from .utils import AnonymousGenerator
label_desc: Use image node_id 22 for calling the SchemaManager obj's underlying member method code with example usage: obj.derive_new_schema_manager(with_sample_id, with_match_id, with_label, with_weight, columns) and returns: derived_schema_manager,  sorted