original_docstring: Check all node exists in yang_handler.
      Args:
          xml_dict: An OrderedDict. Recording the xml's structure.
          yang_parser: The yang_handler.
          xmlns_info: The xmlns_info.Saving all nodes's xmlns information.
      Returns:
          A bool.
      
docstring: Check all node exists in yang_handler.
docstring_tokens: Check all node exists in yang_handler .
code: def check_all_node_exists(xml_dict, yang_parser, xmlns_info):
      """Check all node exists in yang_handler.
      Args:
          xml_dict: An OrderedDict. Recording the xml's structure.
          yang_parser: The yang_handler.
          xmlns_info: The xmlns_info.Saving all nodes's xmlns information.
      Returns:
          A bool.
      """
  
      def gen_xpaths(xpaths,xml_dict):
          if xml_dict is None:
              return  xpaths;
          if xpaths is None or len(xpaths) ==0 :
              last_xpath = ""
          else:
              last_xpath = xpaths[-1]
          for key,val in xml_dict.items():
              xpath = last_xpath + "/" +  key
              xpaths.append(xpath)
              if not isinstance(val, list):
                  nodes = [val]
              else:
                  nodes = val
              for node in nodes:
                  gen_xpaths(xpaths,node)
  
      # check_all_node_exists() begin.
      xpaths=[]
      gen_xpaths(xpaths,list(xml_dict.values())[0])
  
      for xpath in xpaths:
          xpath_info = get_xpaths_infos(xpath,yang_parser,xmlns_info)
          if not xpath_info:
              logging.warning("xpath %s not exist in yang files", xpath)
              return False
      return True
code_tokens: def check_all_node_exists ( xml_dict , yang_parser , xmlns_info ) : def gen_xpaths ( xpaths , xml_dict ) : if xml_dict is None : return xpaths ; if xpaths is None or len ( xpaths ) == 0 : last_xpath = "" else : last_xpath = xpaths [ - 1 ] for key , val in xml_dict . items ( ) : xpath = last_xpath + "/" + key xpaths . append ( xpath ) if not isinstance ( val , list ) : nodes = [ val ] else : nodes = val for node in nodes : gen_xpaths ( xpaths , node ) xpaths = [ ] gen_xpaths ( xpaths , list ( xml_dict . values ( ) ) [ 0 ] ) for xpath in xpaths : xpath_info = get_xpaths_infos ( xpath , yang_parser , xmlns_info ) if not xpath_info : logging . warning ( "xpath %s not exist in yang files" , xpath ) return False return True
short_docstring: Check all node exists in yang_handler.
short_docstring_tokens: Check all node exists in yang_handler .
comment: """Check all node exists in yang_handler.
      Args:
          xml_dict: An OrderedDict. Recording the xml's structure.
          yang_parser: The yang_handler.
          xmlns_info: The xmlns_info.Saving all nodes's xmlns information.
      Returns:
          A bool.
      """$SEP$# check_all_node_exists() begin.