Skip to content

Commit

Permalink
Auto-format python code
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalEgn authored and github-actions[bot] committed Sep 16, 2024
1 parent 5291648 commit a78e9d3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/remove-classifier-keywords/script.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
from inspire_utils.record import get_value
from inspirehep.curation.search_check_do import SearchCheckDo


class RemoveClassifierKeywords(SearchCheckDo):
query = "keywords.source:classifier"

@staticmethod
def check(record, logger, state):
if any(keyword.get("source", "") == "classifier" for keyword in get_value(record, "keywords", [])):
return True
if any(
keyword.get("source", "") == "classifier"
for keyword in get_value(record, "keywords", [])
):
return True
else:
return False
return False

@staticmethod
def do(record, logger, state):
for keyword in record.get("keywords", []):
Expand All @@ -19,4 +23,5 @@ def do(record, logger, state):
if not record["keywords"]:
record.pop("keywords")


RemoveClassifierKeywords()

0 comments on commit a78e9d3

Please sign in to comment.