def add_backtrack_keys(products):
 for (p_k, p_v) in products.iteritems():
  p_v['key'] = p_k
  for (c_k, c_v) in p_v['categories'].iteritems():
   c_v['key'] = c_k

def add_backtrack_keys ( products ) : for ( p_k , p_v ) in products . iteritems ( ) : p_v [ 'key' ] = p_k for ( c_k , c_v ) in p_v [ 'categories' ] . iteritems ( ) : c_v [ 'key' ] = c_k
insert key keys so we can go from product or category back to key .