def getDecoders(decoder_paths):
 import_base = os.path.commonprefix(decoder_paths).split(os.path.sep)[:(-1)]
 decoders = {}
 for path in decoder_paths:
  import_path = path.split(os.path.sep)[len(import_base):]
  for f in glob.iglob(('%s/*.py' % path)):
   name = os.path.splitext(os.path.basename(f))[0]
   if (name != '__init__'):
    decoders[name] = '.'.join((import_path + [name]))
 return decoders

def getDecoders ( decoder_paths ) : import_base = os . path . commonprefix ( decoder_paths ) . split ( os . path . sep ) [ : ( - 1 ) ] decoders = { } for path in decoder_paths : import_path = path . split ( os . path . sep ) [ len ( import_base ) : ] for f in glob . iglob ( ( '%s/*.py' % path ) ) : name = os . path . splitext ( os . path . basename ( f ) ) [ 0 ] if ( name != '__init__' ) : decoders [ name ] = '.' . join ( ( import_path + [ name ] ) ) return decoders
find all decoders and map decoder to import .