481 # then warn the user they may have chosen the wrong data type. 482 most_common = statistics.mode(dataset_files_extensions)[1:] 483 if ( 484 most_common != self.hparams.data_type 485 and self.hparams.data_type != "none" 486 ): 487 logger.warning(
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()