parameters: (path, file_data)
return_statement: return schemas
docstring: Parses |file_data| using a method determined by checking the
    extension of the file at the given |path|. Then, trims 'nodoc' and handles
    inlineable types from the parsed schema data.
docstring_summary: Parses |file_data| using a method determined by checking the
    extension of the file at the given |path|. Then, trims 'nodoc' and handles
    inlineable types from the parsed schema data.
docstring_tokens: Parses |file_data| using a method determined by checking the extension of the file at the given |path| . Then trims nodoc and handles inlineable types from the parsed schema data .
function: def ProcessSchema(path, file_data):
    '''Parses |file_data| using a method determined by checking the
    extension of the file at the given |path|. Then, trims 'nodoc' and handles
    inlineable types from the parsed schema data.
    '''
    def trim_and_inline(schema, is_idl=False):
      '''Modifies an API schema in place by removing nodes that shouldn't be
      documented and inlining schema types that are only referenced once.
      '''
      if RemoveNoDocs(schema):
        # A return of True signifies that the entire schema should not be
        # documented. Otherwise, only nodes that request 'nodoc' are removed.
        return None
      if is_idl:
        DetectInlineableTypes(schema)
      InlineDocs(schema)
      return schema
  
    if path.endswith('.idl'):
      idl = idl_schema.IDLSchema(idl_parser.IDLParser().ParseData(file_data))
      # Wrap the result in a list so that it behaves like JSON API data.
      return [trim_and_inline(idl.process()[0], is_idl=True)]
  
    try:
      schemas = json_parse.Parse(file_data)
    except:
      raise ValueError('Cannot parse "%s" as JSON:\n%s' %
                       (path, traceback.format_exc()))
    for schema in schemas:
      # Schemas could consist of one API schema (data for a specific API file)
      # or multiple (data from extension_api.json).
      trim_and_inline(schema)
    return schemas
function_tokens: def ProcessSchema ( path , file_data ) : def trim_and_inline ( schema , is_idl = False ) : '''Modifies an API schema in place by removing nodes that shouldn't be
      documented and inlining schema types that are only referenced once.
      ''' if RemoveNoDocs ( schema ) : # A return of True signifies that the entire schema should not be # documented. Otherwise, only nodes that request 'nodoc' are removed. return None if is_idl : DetectInlineableTypes ( schema ) InlineDocs ( schema ) return schema if path . endswith ( '.idl' ) : idl = idl_schema . IDLSchema ( idl_parser . IDLParser ( ) . ParseData ( file_data ) ) # Wrap the result in a list so that it behaves like JSON API data. return [ trim_and_inline ( idl . process ( ) [ 0 ] , is_idl = True ) ] try : schemas = json_parse . Parse ( file_data ) except : raise ValueError ( 'Cannot parse "%s" as JSON:\n%s' % ( path , traceback . format_exc ( ) ) ) for schema in schemas : # Schemas could consist of one API schema (data for a specific API file) # or multiple (data from extension_api.json). trim_and_inline ( schema ) return schemas