parameters: (filename)
docstring: Read a JSON file as UTF-8 into a dictionary, discarding @metadata.
  
    Args:
      filename: The filename, which must end ".json".
  
    Returns:
      The dictionary.
  
    Raises:
      InputError: The filename did not end with ".json" or an error occurred
          while opening or reading the file.
docstring_summary: Read a JSON file as UTF-8 into a dictionary, discarding @metadata.
docstring_tokens: Read a JSON file as UTF - 8 into a dictionary discarding @metadata .
function: def read_json_file(filename):
    """Read a JSON file as UTF-8 into a dictionary, discarding @metadata.
  
    Args:
      filename: The filename, which must end ".json".
  
    Returns:
      The dictionary.
  
    Raises:
      InputError: The filename did not end with ".json" or an error occurred
          while opening or reading the file.
    """
    if not filename.endswith('.json'):
      raise InputError(filename, 'filenames must end with ".json"')
    try:
      # Read in file.
      with codecs.open(filename, 'r', 'utf-8') as infile:
        defs = json.load(infile)
      if '@metadata' in defs:
        del defs['@metadata']
      return defs
    except ValueError, e:
      print('Error reading ' + filename)
      raise InputError(filename, str(e))
function_tokens: def read_json_file ( filename ) : if not filename . endswith ( '.json' ) : raise InputError ( filename , 'filenames must end with ".json"' ) try : # Read in file. with codecs . open ( filename , 'r' , 'utf-8' ) as infile : defs = json . load ( infile ) if '@metadata' in defs : del defs [ '@metadata' ] return defs except ValueError , e : print ( 'Error reading ' + filename ) raise InputError ( filename , str ( e ) )