original_docstring: Whether the leaf-node is primary-key
      Args:
          xpath: The leaf-node's xpath.(without prefix).
          yang_parser: The yang_handler.
          xmlns_info:  The xmlns_info.Saving all nodes's xmlns information.
      Returns:
          A bool.
      
docstring: Whether the leaf-node is primary-key
docstring_tokens: Whether the leaf - node is primary - key
code: def is_key_leaf(xpath, yang_parser, xmlns_info):
      """Whether the leaf-node is primary-key
      Args:
          xpath: The leaf-node's xpath.(without prefix).
          yang_parser: The yang_handler.
          xmlns_info:  The xmlns_info.Saving all nodes's xmlns information.
      Returns:
          A bool.
      """
      global LIST_KEY_SET
      if xpath in LIST_KEY_SET:
          return True
  
      feature = xpath.split("/")[1]
      if not yang_parser.ctx.modules:
          return False
  
      # get module's root and augment_flag.
      feature_info_list = get_feature_info(xpath, yang_parser, xmlns_info)
      feature_info = feature_info_list[0]
      augment_flag = feature_info_list[1]
  
      if not feature_info:
          logging.error("module %s is not provided in yang directory", feature)
          return False
  
      if augment_flag:
          # get xpath's root when augment.
          leaf = get_xpaths_node_of_augment(xpath, feature_info)
      else:
          # get xpath's root.
          leaf = get_xpaths_node(xpath, feature_info)
  
      if not leaf:
          logging.warning("xpath %s has no correspond leaf find in yang files", xpath)
          return False
  
      if leaf.keyword == "list":
          key_stmt = leaf.search_one("key")
          if key_stmt:
              for name in key_stmt.arg.split():
                  if name.strip():
                      LIST_KEY_SET.add(str(xpath) + "/" + str(name))
  
      return False
code_tokens: def is_key_leaf ( xpath , yang_parser , xmlns_info ) : global LIST_KEY_SET if xpath in LIST_KEY_SET : return True feature = xpath . split ( "/" ) [ 1 ] if not yang_parser . ctx . modules : return False feature_info_list = get_feature_info ( xpath , yang_parser , xmlns_info ) feature_info = feature_info_list [ 0 ] augment_flag = feature_info_list [ 1 ] if not feature_info : logging . error ( "module %s is not provided in yang directory" , feature ) return False if augment_flag : leaf = get_xpaths_node_of_augment ( xpath , feature_info ) else : leaf = get_xpaths_node ( xpath , feature_info ) if not leaf : logging . warning ( "xpath %s has no correspond leaf find in yang files" , xpath ) return False if leaf . keyword == "list" : key_stmt = leaf . search_one ( "key" ) if key_stmt : for name in key_stmt . arg . split ( ) : if name . strip ( ) : LIST_KEY_SET . add ( str ( xpath ) + "/" + str ( name ) ) return False
short_docstring: Whether the leaf-node is primary-key
short_docstring_tokens: Whether the leaf - node is primary - key
comment: """Whether the leaf-node is primary-key
      Args:
          xpath: The leaf-node's xpath.(without prefix).
          yang_parser: The yang_handler.
          xmlns_info:  The xmlns_info.Saving all nodes's xmlns information.
      Returns:
          A bool.
      """$SEP$# get module's root and augment_flag.$SEP$# get xpath's root when augment.$SEP$# get xpath's root.