def _build_parent_list(policy_definition, admx_policy_definitions, return_full_policy_names, adml_policy_resources):
 parent_list = []
 policy_namespace = policy_definition.nsmap.keys()[0]
 parent_category = policy_definition.xpath('{0}:parentCategory/@ref'.format(policy_namespace), namespaces=policy_definition.nsmap)
 if parent_category:
  parent_category = parent_category[0]
  nsmap_xpath = '/policyDefinitions/policyNamespaces/{0}:*'.format(policy_namespace)
  this_namespace_map = _buildElementNsmap(admx_policy_definitions.xpath(nsmap_xpath, namespaces=policy_definition.nsmap))
  this_namespace_map = dictupdate.update(this_namespace_map, policy_definition.nsmap)
  parent_list = _admx_policy_parent_walk(parent_list, policy_namespace, parent_category, this_namespace_map, admx_policy_definitions, return_full_policy_names, adml_policy_resources)
 return parent_list

def _build_parent_list ( policy_definition , admx_policy_definitions , return_full_policy_names , adml_policy_resources ) : parent_list = [ ] policy_namespace = policy_definition . nsmap . keys ( ) [ 0 ] parent_category = policy_definition . xpath ( '{0}:parentCategory/@ref' . format ( policy_namespace ) , namespaces = policy_definition . nsmap ) if parent_category : parent_category = parent_category [ 0 ] nsmap_xpath = '/policyDefinitions/policyNamespaces/{0}:*' . format ( policy_namespace ) this_namespace_map = _buildElementNsmap ( admx_policy_definitions . xpath ( nsmap_xpath , namespaces = policy_definition . nsmap ) ) this_namespace_map = dictupdate . update ( this_namespace_map , policy_definition . nsmap ) parent_list = _admx_policy_parent_walk ( parent_list , policy_namespace , parent_category , this_namespace_map , admx_policy_definitions , return_full_policy_names , adml_policy_resources ) return parent_list
helper function to build a list containing parent elements of the admx policy .