def _checkValueItemParent(policy_element, policy_name, policy_key, policy_valueName, xpath_object, policy_file_data, check_deleted=False, test_item=True):
 for element in xpath_object(policy_element):
  for value_item in element.getchildren():
   search_string = _processValueItem(value_item, policy_key, policy_valueName, policy_element, element, check_deleted=check_deleted)
   if (not test_item):
    return search_string
   if _regexSearchRegPolData(re.escape(search_string), policy_file_data):
    log.debug('found the search string in the pol file, {0} is configured'.format(policy_name))
    return True
 return False

def _checkValueItemParent ( policy_element , policy_name , policy_key , policy_valueName , xpath_object , policy_file_data , check_deleted = False , test_item = True ) : for element in xpath_object ( policy_element ) : for value_item in element . getchildren ( ) : search_string = _processValueItem ( value_item , policy_key , policy_valueName , policy_element , element , check_deleted = check_deleted ) if ( not test_item ) : return search_string if _regexSearchRegPolData ( re . escape ( search_string ) , policy_file_data ) : log . debug ( 'found the search string in the pol file, {0} is configured' . format ( policy_name ) ) return True return False
helper function to process the parent of a value item object if test_item is true .