original_docstring: 
          eventualmente si potrebbe distinguere se si hanno solo due versioni
          
docstring: eventualmente si potrebbe distinguere se si hanno solo due versioni
docstring_tokens: eventualmente si potrebbe distinguere se si hanno solo due versioni
code: def compile_csv(n=10):
          """
          eventualmente si potrebbe distinguere se si hanno solo due versioni
          """
          outpath = get_dest_path("arch_cat")
          res = db(db.product_catalog.id>0).select(orderby=~db.product_catalog.id, limitby=(0, n,))
          puks = set(sum((row.pdata.keys() for row in res), []))
  
          data = res.last().pdata
          fieldnames = res.last().fieldnames
  
          out = {
              "all_product": os.path.join(outpath, "all_product.csv"),
              "updated_product": os.path.join(outpath, "updated_product.csv")
          }
  
  #         allfile = os.path.join(outpath, "all_product.csv")
  #         updfile = os.path.join(outpath, "updated_product.csv")
          with open(out["all_product"], "w") as allprd, \
              open(out["updated_product"], "w") as updprd:
  
              # Create and initialize output csv files
              allw = csv.DictWriter(allprd, fieldnames=fieldnames)
              updw = csv.DictWriter(updprd, fieldnames=fieldnames)
              allw.writeheader()
              updw.writeheader()
  
              for n,puk in enumerate(sorted(puks)):
                  if any((puk==i for i in data.iterkeys())):
  #                     import pdb; pdb.set_trace()
                      rowdict = {k.encode("utf8"): v.encode("utf8") for k,v in data[puk].iteritems()}
                      allw.writerow(rowdict)
                      if any(map(lambda c: not_equal(c[0], c[1]), ((res[n].pdata[puk], res[n+1].pdata[puk],) for n in range(len(res)-1)))):
                          updw.writerow(rowdict)
  
          return out
code_tokens: def compile_csv ( n = 10 ) : outpath = get_dest_path ( "arch_cat" ) res = db ( db . product_catalog . id > 0 ) . select ( orderby = ~ db . product_catalog . id , limitby = ( 0 , n , ) ) puks = set ( sum ( ( row . pdata . keys ( ) for row in res ) , [ ] ) ) data = res . last ( ) . pdata fieldnames = res . last ( ) . fieldnames out = { "all_product" : os . path . join ( outpath , "all_product.csv" ) , "updated_product" : os . path . join ( outpath , "updated_product.csv" ) } with open ( out [ "all_product" ] , "w" ) as allprd , open ( out [ "updated_product" ] , "w" ) as updprd : allw = csv . DictWriter ( allprd , fieldnames = fieldnames ) updw = csv . DictWriter ( updprd , fieldnames = fieldnames ) allw . writeheader ( ) updw . writeheader ( ) for n , puk in enumerate ( sorted ( puks ) ) : if any ( ( puk == i for i in data . iterkeys ( ) ) ) : rowdict = { k . encode ( "utf8" ) : v . encode ( "utf8" ) for k , v in data [ puk ] . iteritems ( ) } allw . writerow ( rowdict ) if any ( map ( lambda c : not_equal ( c [ 0 ] , c [ 1 ] ) , ( ( res [ n ] . pdata [ puk ] , res [ n + 1 ] . pdata [ puk ] , ) for n in range ( len ( res ) - 1 ) ) ) ) : updw . writerow ( rowdict ) return out
short_docstring: eventualmente si potrebbe distinguere se si hanno solo due versioni
short_docstring_tokens: eventualmente si potrebbe distinguere se si hanno solo due versioni
comment: """
          eventualmente si potrebbe distinguere se si hanno solo due versioni
          """$SEP$#         allfile = os.path.join(outpath, "all_product.csv")$SEP$#         updfile = os.path.join(outpath, "updated_product.csv")$SEP$# Create and initialize output csv files$SEP$#                     import pdb; pdb.set_trace()