def make_full_schema(data, schema):
 flattened_schema = flatten_schema(schema)
 key_combinations = get_all_key_combinations(data, flattened_schema)
 full_schema = {}
 for combination in key_combinations:
  sub_schema = schema
  for key in combination[::2]:
   sub_schema = sub_schema[key]
  for (key, value) in sub_schema.iteritems():
   if isinstance(value, list):
    full_schema[(combination + (key,))] = value
 return full_schema

def make_full_schema ( data , schema ) : flattened_schema = flatten_schema ( schema ) key_combinations = get_all_key_combinations ( data , flattened_schema ) full_schema = { } for combination in key_combinations : sub_schema = schema for key in combination [ : : 2 ] : sub_schema = sub_schema [ key ] for ( key , value ) in sub_schema . iteritems ( ) : if isinstance ( value , list ) : full_schema [ ( combination + ( key , ) ) ] = value return full_schema
make schema by getting all valid combinations and making sure that all keys are available .