7419eacac2dfa909b280881524e685d7ea4d7ec7,bin/add_attachments.py,,add_attachment,#Any#Any#Any#Any#,50
Before Change
input_file_path = path
detected = filetype.guess(input_file_path)
if detected is None or not detected.mime.endswith(detected.extension):
mime_type = "UNKNOWN" if detected is None else detected.mime
raise Exception(f"{anthology_id} file {path} has MIME type {mime_type}")
if paper_extension not in ALLOWED_TYPES:
raise Exception(f"-> Unknown file extension {paper_extension} for {path}")
// Update XML
After Change
if detected is not None:
file_extension = detected.mime.split("/")[-1]
if file_extension not in ALLOWED_TYPES:
print(
f"Could not determine file extension for {anthology_id} at {path}",
file=sys.stderr,
)
// Update XML
xml_file = os.path.join(
os.path.dirname(sys.argv[0]), "..", "data", "xml", f"{collection_id}.xml"
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: acl-org/acl-anthology
Commit Name: 7419eacac2dfa909b280881524e685d7ea4d7ec7
Time: 2020-04-24
Author: post@cs.jhu.edu
File Name: bin/add_attachments.py
Class Name:
Method Name: add_attachment
Project Name: GRAAL-Research/pytoune
Commit Name: 1404a9edb15c8d615488781cf73e7a971ade71f8
Time: 2020-05-09
Author: fredy_14@live.fr
File Name: poutyne/framework/metrics/epoch_metrics/__init__.py
Class Name:
Method Name: get_epoch_metric
Project Name: sassoftware/python-dlpy
Commit Name: ecb6ec9cad0ceb332c081021d719a426206c7469
Time: 2019-06-26
Author: Xiaozhuo.Cheng@sas.com
File Name: dlpy/tests/test_speech.py
Class Name: TestSpeechToTextInit
Method Name: setUp