def dispatch_method(self, basename, arg, **options):
 method_name = ('%s_%s' % (basename, arg.__class__.__name__))
 if hasattr(self, method_name):
  f = getattr(self, method_name)
  result = f(arg, **options)
  if (result is not None):
   return result
 raise NotImplementedError(("%s.%s can't handle: %r" % (self.__class__.__name__, basename, arg)))

def dispatch_method ( self , basename , arg , ** options ) : method_name = ( '%s_%s' % ( basename , arg . __class__ . __name__ ) ) if hasattr ( self , method_name ) : f = getattr ( self , method_name ) result = f ( arg , ** options ) if ( result is not None ) : return result raise NotImplementedError ( ( "%s.%s can't handle: %r" % ( self . __class__ . __name__ , basename , arg ) ) )
dispatch a method to the proper handlers .