code: def load_json(filename: str) -> Union[List, Dict]:
      
      try:
          with open(filename, encoding='utf-8') as fdesc:
              return json.loads(fdesc.read())
      except FileNotFoundError:
          # This is not a fatal error
          _LOGGER.debug('JSON file not found: %s', filename)
      except ValueError as error:
          _LOGGER.exception('Could not parse JSON content: %s', filename)
          raise PytradfriError(error)
      except OSError as error:
          _LOGGER.exception('JSON file reading failed: %s', filename)
          raise PytradfriError(error)
      return {}
docs: Load JSON data from a file and return as dict or list.
  
      Defaults to returning empty dict if file is not found.