code: def freeze(value):
      
      if isinstance(value, list):
          return FrozenList(*value)
      if isinstance(value, dict):
          return FrozenDict(**value)
      return value
docs: Cast value to its frozen counterpart.