code: def load_file(path: str):
      if path.endswith(".json"):
          with fsspec.open(path, "r") as f:
              return json.load(f)
      elif path.endswith(".pth"):
          with fsspec.open(path, "rb") as f:
              return torch.load(f, map_location="cpu")
      else:
          raise ValueError("Unsupported file type")
  
imports: import json
  import random
  from typing import Any, Dict, List, Tuple, Union
  import fsspec
  import numpy
  import torch
  from TTS.config import load_config
  from TTS.encoder.utils.generic_utils import setup_encoder_model
  from TTS.utils.audio import AudioProcessor
label_desc: Use image node_id 1 for calling a global function with example usage: load_file(path) and returns: json, torch