code: def apply_sector_mappings_to_round_trips(
      round_trips, sector_mappings
  ):
      """
      Translates round trip symbols to sectors.
  
      Parameters
      ----------
      round_trips : pd.DataFrame
          DataFrame with one row per round trip trade.
          - See full explanation in round_trips.extract_round_trips
      sector_mappings : dict or pd.Series, optional
          Security identifier to sector mapping.
          Security ids as keys, sectors as values.
  
      Returns
      -------
      sector_round_trips : pd.DataFrame
          Round trips with symbol names replaced by sector names.
      """
  
      sector_round_trips = round_trips.copy()
      sector_round_trips.symbol = sector_round_trips.symbol.apply(
          lambda x: sector_mappings.get(x, "No Sector Mapping")
      )
      sector_round_trips = sector_round_trips.dropna(axis=0)
  
      return sector_round_trips
  
file_path: pyfolio/pyfolio/round_trips.py
imports: from __future__ import division
  from math import copysign
  import warnings
  from collections import deque, OrderedDict
  import pandas
  import numpy
  from .utils import print_table, format_asset
label_desc: Use image node_id 5 for calling a global function with example usage: apply_sector_mappings_to_round_trips(round_trips, sector_mappings) and returns: sector_round_trips