def get_rand_pairs(db, N):
    """ Get a (generator) list (length N) of random pairs (x,y) of patents."""
    sampler = PatentSampler(db, 'traits')
    rand_pats = sampler.sample(N*2)
    rand_pairs = ((rand_pats[2*i], rand_pats[2*i+1]) for i in range(N))
    return rand_pairs
 def testPatnsWorks(self):
     sampler = PatentSampler(self.db, 'patns')
     sampler.sample(1)
 def testTraitsWorks(self):
     sampler = PatentSampler(self.db, 'pat_text')
     sampler.sample(1)
 def testTraitsWorks(self):
     sampler = PatentSampler(self.db, 'just_cites')
     sampler.sample(1)
 def testCiteNetWorks(self):
     sampler = PatentSampler(self.db, 'cite_net')
     sampler.sample(1)