(self,tile_group_id,tile_title)
create and save the transform file
create and save the transform file
create and save the transform file
def _updateTransformedFile(self,tile_group_id,tile_title):
    """create and save the transform file"""
    num = random.choice([0,1])
    while num >= 0: 
      algorithm = random.choice(['sepia','brightness','noise','lighten',
                                  'posterize','edge','none'])
      if algorithm == 'lighten':
        param1 = random.choice([-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.1,0.2,
                                 0.3,0.4,0.5,0.6])
        param2 = 0
      elif algorithm == 'posterize':
        param1 = random.choice([4,5,6,7,8,9,10,11,12,13,14,15,16,17,
                                18,19,20,21])
        param2 = 0
      elif algorithm == 'brightness':
        param1 = random.choice([-80,-60,-40,-20,20,40,60,80])
        param2 = random.choice([-0.3,-0.2,-0.1,0,0.1,0.5,0.9])
      else:
        param1 = 0
        param2 = 0
      my_text = '%s %s %s %s %s %s \n' %(tile_group_id, tile_title, 
                                    algorithm, param1, param2, num)
      self.my_file.write(my_text)
      num = num - 1
def _updateTransformedFile ( self , tile_group_id , tile_title ) : num = random . choice ( [ 0 , 1 ] ) while num >= 0 : algorithm = random . choice ( [ 'sepia' , 'brightness' , 'noise' , 'lighten' , 'posterize' , 'edge' , 'none' ] ) if algorithm == 'lighten' : param1 = random . choice ( [ - 0.6 , - 0.5 , - 0.4 , - 0.3 , - 0.2 , - 0.1 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 ] ) param2 = 0 elif algorithm == 'posterize' : param1 = random . choice ( [ 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ] ) param2 = 0 elif algorithm == 'brightness' : param1 = random . choice ( [ - 80 , - 60 , - 40 , - 20 , 20 , 40 , 60 , 80 ] ) param2 = random . choice ( [ - 0.3 , - 0.2 , - 0.1 , 0 , 0.1 , 0.5 , 0.9 ] ) else : param1 = 0 param2 = 0 my_text = '%s %s %s %s %s %s \n' % ( tile_group_id , tile_title , algorithm , param1 , param2 , num ) self . my_file . write ( my_text ) num = num - 1