Showing the changes to python (2 of 2 files). Show all
Unified · Split
| @@ -8,7 +8,7 @@ def get_file_bpm(path, params = None): · 7 unmodified lines | ||
| 8 | 8 | path: path to the file |
| 9 | 9 | param: dictionary of parameters |
| 10 | 10 | """ |
| 11 | − if params == None: | |
| 11 | + if params is None: | |
| 12 | 12 | params = {} |
| 13 | 13 | try: |
| 14 | 14 | win_s = params['win_s'] |
| @@ -14,10 +14,10 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | if timestamps[0] != 0: |
| 16 | 16 | timestamps = [0] + timestamps |
| 17 | − if timestamps_end != None: | |
| 17 | + if timestamps_end is not None: | |
| 18 | 18 | timestamps_end = [timestamps[1] - 1] + timestamps_end |
| 19 | 19 | |
| 20 | − if timestamps_end != None: | |
| 20 | + if timestamps_end is not None: | |
| 21 | 21 | if len(timestamps_end) != len(timestamps): |
| 22 | 22 | raise ValueError("len(timestamps_end) != len(timestamps)") |
| 23 | 23 | else: |
| @@ -27,7 +27,7 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 3 unmodified lines | ||
| 27 | 27 | #print regions |
| 28 | 28 | |
| 29 | 29 | source_base_name, _ = os.path.splitext(os.path.basename(source_file)) |
| 30 | − if output_dir != None: | |
| 30 | + if output_dir is not None: | |
| 31 | 31 | if not os.path.isdir(output_dir): |
| 32 | 32 | os.makedirs(output_dir) |
| 33 | 33 | source_base_name = os.path.join(output_dir, source_base_name) |