input: from typing import Any
  
  def read_data_from_json(filename: str) -> Any:
      """ Reads data from a given JSON file and handles errors if the file does not exist
      or if the file is not in a valid JSON format.
      >>> read_data_from_json('nonexistent_file.json')
      The file specified does not exist.
      >>> read_data_from_json('invalid_format.json')
      The file specified is not in a valid JSON format.
      >>> read_data_from_json('valid_file.json')
      {'example_key': 'example_value'}
      """
output:     import json
      import os
  
      if not os.path.exists(filename):
          return "The file specified does not exist."
      
      try:
          with open(filename, 'r') as file:
              data = json.load(file)
              return data
      except json.JSONDecodeError:
          return "The file specified is not in a valid JSON format."