File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
in
PYL-R1714151 normalize_rd = relativedelta(minute=0, second=0, microsecond=0)
152 rd = relativedelta(hours=+1)
153 elif (
154 granularity == USAGE_CALC_GRANULARITY.DAILY155 or granularity == METRIC_GRANULARITY.DAY
156 ):
157 normalize_rd = relativedelta(hour=0, minute=0, second=0, microsecond=0)
125 self.redirect_url = ""
126
127 def working(self) -> bool:
128 return self.secret_key != "" and self.secret_key != None129
130 def customer_connected(self, customer) -> bool:
131 pp_ids = customer.integrations
135
136 def organization_connected(self, organization) -> bool:
137 if self.self_hosted:
138 return self.secret_key != "" and self.secret_key != None139 else:
140 return (
141 organization.payment_provider_ids.get(PAYMENT_PROVIDERS.STRIPE, "")
158 kind = None
159 granularity = None
160 if (
161 self.granularity == METRIC_GRANULARITY.SECOND 162 or proration == METRIC_GRANULARITY.SECOND
163 ):
164 kind = "second"
164 kind = "second"
165 granularity = METRIC_GRANULARITY.SECOND
166 elif (
167 self.granularity == METRIC_GRANULARITY.MINUTE 168 or proration == METRIC_GRANULARITY.MINUTE
169 ):
170 kind = "minute"
To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained in
it instead of checking for equality against each of the values.
This is faster, less verbose, and more readable.
if x == 1 or x == 2 or x == 3:
do_something()
if x in (1, 2, 3):
do_something()