parameters: (self, filename)
return_statement: return data
docstring: Parse a saved flow graph file.
          Ensure that the file exists, and passes the dtd check.
  
          Args:
              filename: the flow graph file
  
          Returns:
              nested data
          @throws exception if the validation fails
docstring_summary: Parse a saved flow graph file.
          Ensure that the file exists, and passes the dtd check.
docstring_tokens: Parse a saved flow graph file . Ensure that the file exists and passes the dtd check .
function: def parse_flow_graph(self, filename):
          """
          Parse a saved flow graph file.
          Ensure that the file exists, and passes the dtd check.
  
          Args:
              filename: the flow graph file
  
          Returns:
              nested data
          @throws exception if the validation fails
          """
          filename = filename or self.config.default_flow_graph
          is_xml = False
          with open(filename, encoding='utf-8') as fp:
              is_xml = '<flow_graph>' in fp.read(100)
              fp.seek(0)
              # todo: try
              if not is_xml:
                  data = yaml.safe_load(fp)
                  validator = schema_checker.Validator(
                      schema_checker.FLOW_GRAPH_SCHEME)
                  validator.run(data)
  
          if is_xml:
              Messages.send('>>> Converting from XML\n')
              from ..converter.flow_graph import from_xml
              data = from_xml(filename)
  
          return data
function_tokens: def parse_flow_graph ( self , filename ) : filename = filename or self . config . default_flow_graph is_xml = False with open ( filename , encoding = 'utf-8' ) as fp : is_xml = '<flow_graph>' in fp . read ( 100 ) fp . seek ( 0 ) # todo: try if not is_xml : data = yaml . safe_load ( fp ) validator = schema_checker . Validator ( schema_checker . FLOW_GRAPH_SCHEME ) validator . run ( data ) if is_xml : Messages . send ( '>>> Converting from XML\n' ) from . . converter . flow_graph import from_xml data = from_xml ( filename ) return data