parameters: (call_dir: str)
return_statement: return ModuleCall(**kwargs)
docstring: Loads and returns a trace serialized with ModuleCall.serialize.
docstring_summary: Loads and returns a trace serialized with ModuleCall.serialize.
docstring_tokens: Loads and returns a trace serialized with ModuleCall . serialize .
function: def load(call_dir: str) -> "ModuleCall":
      """Loads and returns a trace serialized with ModuleCall.serialize."""
      with open(os.path.join(call_dir, "metadata.pkl"), "rb") as f:
        kwargs = pickle.load(f)
  
      for result_type in ["input", "output"]:
        key = f"{result_type}s"  # inputs or outputs
        kwargs[key] = []
  
        files = glob.glob(os.path.join(call_dir, f"{result_type}_*.pkl"))
        for filename in sorted(files):
          with open(filename, "rb") as f:
            kwargs[key].append(pickle.load(f))
  
        # Convert to tuple to match python's return type for multiple results.
        kwargs[key] = tuple(kwargs[key])
  
      return ModuleCall(**kwargs)
function_tokens: def load ( call_dir : str ) -> "ModuleCall" : with open ( os . path . join ( call_dir , "metadata.pkl" ) , "rb" ) as f : kwargs = pickle . load ( f ) for result_type in [ "input" , "output" ] : key = f"{result_type}s" # inputs or outputs kwargs [ key ] = [ ] files = glob . glob ( os . path . join ( call_dir , f"{result_type}_*.pkl" ) ) for filename in sorted ( files ) : with open ( filename , "rb" ) as f : kwargs [ key ] . append ( pickle . load ( f ) ) # Convert to tuple to match python's return type for multiple results. kwargs [ key ] = tuple ( kwargs [ key ] ) return ModuleCall ( * * kwargs )