code: def _split_symbol_mappings(df, exchanges):
      """Split out the symbol: sid mappings from the raw data.
  
      Parameters
      ----------
      df : pd.DataFrame
          The dataframe with multiple rows for each symbol: sid pair.
      exchanges : pd.DataFrame
          The exchanges table.
  
      Returns
      -------
      asset_info : pd.DataFrame
          The asset info with one row per asset.
      symbol_mappings : pd.DataFrame
          The dataframe of just symbol: sid mappings. The index will be
          the sid, then there will be three columns: symbol, start_date, and
          end_date.
      """
      mappings = df[list(mapping_columns)]
      with pd.option_context("mode.chained_assignment", None):
          mappings["sid"] = mappings.index
      mappings.reset_index(drop=True, inplace=True)
  
      # take the most recent sid->exchange mapping based on end date
      asset_exchange = (
          df[["exchange", "end_date"]]
          .sort_values("end_date")
          .groupby(level=0)["exchange"]
          .nth(-1)
      )
  
      _check_symbol_mappings(mappings, exchanges, asset_exchange)
      return (
          df.groupby(level=0).apply(_check_asset_group),
          mappings,
      )
  
imports: from collections import namedtuple
  import re
  import numpy
  import pandas
  import sqlalchemy
  from toolz import first
  from zipline.errors import AssetDBVersionError
  from zipline.assets.asset_db_schema import ASSET_DB_VERSION, asset_db_table_names, asset_router, equities, equity_symbol_mappings, equity_supplementary_mappings, futures_contracts, exchanges, futures_root_symbols, metadata, version_info
  from zipline.utils.compat import ExitStack
  from zipline.utils.preprocess import preprocess
  from zipline.utils.range import from_tuple, intersecting_ranges
  from zipline.utils.sqlite_utils import coerce_string_to_eng
label_desc: Use image node_id 9 for calling a global function with example usage: _split_symbol_mappings(df, exchanges) and returns: df,  mappings