#NEWLINE# def region_fetch_helper( self , number_of_repeats , strand = None , featuretype = None ) : #NEWLINE# #INDENT# '\n        Helper for fetching features from random region number_of_repeats\n        times.\n        ' #NEWLINE# fetched_at_least_one = False #NEWLINE# for dummy_repeat in range ( number_of_repeats ) : #NEWLINE# #INDENT# ( chromosome , size ) = random . choice ( self . chromosome_sizes . items ( ) ) #NEWLINE# start = random . randint ( 1 , size ) #NEWLINE# end = random . randint ( start , size ) #NEWLINE# for dummy_feature in self . db . region ( seqid = chromosome , start = start , end = end , strand = strand , featuretype = featuretype ) : #NEWLINE# #INDENT# fetched_at_least_one = True #NEWLINE# #UNINDENT# #UNINDENT# assert fetched_at_least_one , "Didn't fetch any features. Either unlucky or a bug"