def get_class_for(purpose):
 mapping = get_class_mapping()
 class_ = mapping[purpose]
 if isinstance(class_, six.string_types):
  class_ = get_class_from_string(class_)
 return class_

def get_class_for ( purpose ) : mapping = get_class_mapping ( ) class_ = mapping [ purpose ] if isinstance ( class_ , six . string_types ) : class_ = get_class_from_string ( class_ ) return class_
usage: conversion_class = get_class_for .