def _parse_belongs_to(key, belongs_to, inventory):
 for item in belongs_to:
  if (key not in inventory[item]['children']):
   appended = du.append_if(array=inventory[item]['children'], item=key)
   if appended:
    logger.debug('Added %s to %s', key, item)

def _parse_belongs_to ( key , belongs_to , inventory ) : for item in belongs_to : if ( key not in inventory [ item ] [ 'children' ] ) : appended = du . append_if ( array = inventory [ item ] [ 'children' ] , item = key ) if appended : logger . debug ( 'Added %s to %s' , key , item )
parse all items in a belongs_to list .