File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
351 key=lambda x: x[1],
352 reverse=True,
353 )[:top_n]
354 metric_dict["top_n_customers"] = list(x[0] for x in top_n_customers) 355 metric_dict["top_n_customers_usage"] = list(
356 x[1] for x in top_n_customers
357 )
352 reverse=True,
353 )[:top_n]
354 metric_dict["top_n_customers"] = list(x[0] for x in top_n_customers)
355 metric_dict["top_n_customers_usage"] = list( 356 x[1] for x in top_n_customers
357 )
358 else:
64 ## check idempotency
65 now = now_utc()
66 now_minus_45_days = now - relativedelta(days=7)
67 idem_ids = list(x.idempotency_id for x in event_obj_list) 68 repeat_idem = Event.objects.filter(
69 organization_id=organization,
70 idempotency_id__in=idem_ids,
It is unnecessary to use list
, set
, dict
around a generator expression to get an object of that type since there are comprehensions for these types.
squares = list(x**2 for x in range(1, 10))
large_numbers = set(n for n in numbers if n > 1000)
tree_counts = dict((tree, counts[tree]) for tree in trees)
squares = [x**2 for x in range(1, 10)]
large_numbers = {n for n in numbers if n > 1000}
tree_counts = {tree: counts[tree] for tree in trees}