def create_sentry(self) -> Optional[SentryConfig]:
    if ('NP_SENTRY_DSN' not in self._environ):
        return None
    return SentryConfig(dsn=URL(self._environ['NP_SENTRY_DSN']), cluster_name=self._environ['NP_SENTRY_CLUSTER_NAME'], app_name=self._environ.get('NP_SENTRY_APP_NAME', SentryConfig.app_name), sample_rate=float(self._environ.get('NP_SENTRY_SAMPLE_RATE', SentryConfig.sample_rate)))
def create_sentry(self) -> Optional[SentryConfig]:
    if ('NP_SENTRY_DSN' not in self._environ):
        return None
    return SentryConfig(dsn=URL(self._environ['NP_SENTRY_DSN']), cluster_name=self._environ['NP_SENTRY_CLUSTER_NAME'], app_name=self._environ.get('NP_SENTRY_APP_NAME', SentryConfig.app_name), sample_rate=float(self._environ.get('NP_SENTRY_SAMPLE_RATE', SentryConfig.sample_rate)))