Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions quark/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def remove_dup_list(element):
return list(set(element))


def contains(subset_to_check, target_list):
def contains(subset_to_check: list[str], target_list: list[str]):
"""
Check the sequence pattern within two list.
-----------------------------------------------------------------
Expand All @@ -27,12 +27,11 @@ def contains(subset_to_check, target_list):
then it will return False.
"""

target_copy = copy.copy(target_list)

# Delete elements that do not exist in the subset_to_check list
for item in target_copy:
if item not in subset_to_check:
target_copy.remove(item)
target_copy = [
item
for item in target_list
if item in subset_to_check
]

for i in range(len(target_copy) - len(subset_to_check) + 1):
for j in range(len(subset_to_check)):
Expand Down
Loading