code: def import_settings(dotted_path):
      
      if "." in dotted_path:
          module, name = dotted_path.rsplit(".", 1)
      else:
          raise click.UsageError(
              "invalid path to settings instance: {}".format(dotted_path)
          )
      try:
          module = importlib.import_module(module)
      except ImportError as e:
          raise click.UsageError(e)
      try:
          return getattr(module, name)
      except AttributeError as e:
          raise click.UsageError(e)
docs: Import settings instance from python dotted path.
  
      Last item in dotted path must be settings instace.
  
      Example: import_settings('path.to.settings')