code: def _copy_context_into_mutable(context):
      
      def make_mutable(val):
          if isinstance(val, Mapping):
              return dict(val)
          else:
              return val
  
      if not isinstance(context, (str, Mapping)):
          try:
              return [make_mutable(val) for val in context]
          except TypeError:
              pass
      return make_mutable(context)
docs: Copy a properly formatted context into a mutable data structure.