def get_seed_ratio(provider):
 if (provider == 'rutracker.org'):
  seed_ratio = headphones.CONFIG.RUTRACKER_RATIO
 elif (provider == 'Kick Ass Torrents'):
  seed_ratio = headphones.CONFIG.KAT_RATIO
 elif (provider == 'What.cd'):
  seed_ratio = headphones.CONFIG.WHATCD_RATIO
 elif (provider == 'PassTheHeadphones.Me'):
  seed_ratio = headphones.CONFIG.PTH_RATIO
 elif (provider == 'The Pirate Bay'):
  seed_ratio = headphones.CONFIG.PIRATEBAY_RATIO
 elif (provider == 'Old Pirate Bay'):
  seed_ratio = headphones.CONFIG.OLDPIRATEBAY_RATIO
 elif (provider == 'Waffles.ch'):
  seed_ratio = headphones.CONFIG.WAFFLES_RATIO
 elif (provider == 'Mininova'):
  seed_ratio = headphones.CONFIG.MININOVA_RATIO
 elif (provider == 'Strike'):
  seed_ratio = headphones.CONFIG.STRIKE_RATIO
 else:
  seed_ratio = None
 if (seed_ratio is not None):
  try:
   seed_ratio = float(seed_ratio)
  except ValueError:
   logger.warn(('Could not get seed ratio for %s' % provider))
 return seed_ratio

def get_seed_ratio ( provider ) : if ( provider == 'rutracker.org' ) : seed_ratio = headphones . CONFIG . RUTRACKER_RATIO elif ( provider == 'Kick Ass Torrents' ) : seed_ratio = headphones . CONFIG . KAT_RATIO elif ( provider == 'What.cd' ) : seed_ratio = headphones . CONFIG . WHATCD_RATIO elif ( provider == 'PassTheHeadphones.Me' ) : seed_ratio = headphones . CONFIG . PTH_RATIO elif ( provider == 'The Pirate Bay' ) : seed_ratio = headphones . CONFIG . PIRATEBAY_RATIO elif ( provider == 'Old Pirate Bay' ) : seed_ratio = headphones . CONFIG . OLDPIRATEBAY_RATIO elif ( provider == 'Waffles.ch' ) : seed_ratio = headphones . CONFIG . WAFFLES_RATIO elif ( provider == 'Mininova' ) : seed_ratio = headphones . CONFIG . MININOVA_RATIO elif ( provider == 'Strike' ) : seed_ratio = headphones . CONFIG . STRIKE_RATIO else : seed_ratio = None if ( seed_ratio is not None ) : try : seed_ratio = float ( seed_ratio ) except ValueError : logger . warn ( ( 'Could not get seed ratio for %s' % provider ) ) return seed_ratio
return the seed ratio for the specified provider .