Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def sync(d, source, long_journal_name, max_workers):
if source == "crossref":
source = crossref.Crossref(long_journal_name)
else:
assert source == "dblp", "Illegal source."
source = dblp.Dblp()
print()
num_success = 0
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
responses = {
executor.submit(source.find_unique, entry): (bib_id, tools.decode(entry))
for bib_id, entry in d.items()
}
for future in tqdm(
concurrent.futures.as_completed(responses), total=len(responses)
):
bib_id, entry = responses[future]
def main(argv=None):
parser = _get_parser()
args = parser.parse_args(argv)
source = crossref.Crossref()
entry = source.get_by_doi(args.doi)
bibtex_key = "key"
string = tools.pybtex_to_bibtex_string(entry, bibtex_key)
args.outfile.write(string)
return