def oo_flatten(data):
 if (not isinstance(data, list)):
  raise errors.AnsibleFilterError('|failed expects to flatten a List')
 return [item for sublist in data for item in sublist]

def oo_flatten ( data ) : if ( not isinstance ( data , list ) ) : raise errors . AnsibleFilterError ( '|failed expects to flatten a List' ) return [ item for sublist in data for item in sublist ]
this filter plugin will flatten a list of lists .