def _instantiate_backend_from_name(name, options):
 try:
  parts = name.split('.')
  module_name = '.'.join(parts[:(-1)])
  class_name = parts[(-1)]
 except IndexError:
  raise ValueError(('Invalid event track backend %s' % name))
 try:
  module = import_module(module_name)
  cls = getattr(module, class_name)
  if ((not inspect.isclass(cls)) or (not issubclass(cls, BaseBackend))):
   raise TypeError
 except (ValueError, AttributeError, TypeError, ImportError):
  raise ValueError(('Cannot find event track backend %s' % name))
 backend = cls(**options)
 return backend

def _instantiate_backend_from_name ( name , options ) : try : parts = name . split ( '.' ) module_name = '.' . join ( parts [ : ( - 1 ) ] ) class_name = parts [ ( - 1 ) ] except IndexError : raise ValueError ( ( 'Invalid event track backend %s' % name ) ) try : module = import_module ( module_name ) cls = getattr ( module , class_name ) if ( ( not inspect . isclass ( cls ) ) or ( not issubclass ( cls , BaseBackend ) ) ) : raise TypeError except ( ValueError , AttributeError , TypeError , ImportError ) : raise ValueError ( ( 'Cannot find event track backend %s' % name ) ) backend = cls ( ** options ) return backend
instantiate an event tracker backend from the full module path to the backend class .