input: def read_data_from_json(filename):
      """ Reads data from a JSON file and handles errors.
      >>> read_data_from_json('nonexistentfile.json')
      'The file specified does not exist.'
      >>> read_data_from_json('invalid_json_file.json')
      'The file specified is not in a valid JSON format.'
      >>> read_data_from_json('valid_json_file.json') == {'key': 'value'}
      True
      """
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          return "The file specified does not exist."
      except json.decoder.JSONDecodeError:
          return "The file specified is not in a valid JSON format."
output:     except FileNotFoundError:
          return "The file specified does not exist."
      except json.decoder.JSONDecodeError:
          return "The file specified is not in a valid JSON format."