def get_connection(path=None, fail_silently=False, **kwargs):
path = path or getattr(settings, '<STR_LIT>', '<STR_LIT>')<EOL>try:<EOL><INDENT>mod_name, klass_name = path.rsplit('<STR_LIT:.>', <NUM_LIT:1>)<EOL>mod = import_module(mod_name)<EOL><DEDENT>except AttributeError as e:<EOL><INDENT>raise ImproperlyConfigured(u'<STR_LIT>' % (mod_name, e))<EOL><DEDENT>try:<EOL><INDENT>klass = getattr(mod, klass_name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise ImproperlyConfigured('<STR_LIT>' % (mod_name, klass_name))<EOL><DEDENT>return klass(fail_silently=fail_silently, **kwargs)<EOL>
Load an sms backend and return an instance of it.

:param string path: backend python path. Default: sendsms.backends.console.SmsBackend
:param bool fail_silently: Flag to not throw exceptions on error. Default: False
:returns: backend class instance.
:rtype: :py:class:`~sendsms.backends.base.BaseSmsBackend` subclass