Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
files_set = set(in_files) | set(out_files)
nb_files = 0
for arg_nb, arg in enumerate(run['argv']):
p = Path(run['workingdir'], arg).resolve()
if p in files_set:
nb_files += 1
if p not in runs_with_file:
runs_with_file[p] = run_nb, arg_nb
elif runs_with_file[p] is not None:
runs_with_file[p] = None
nb_file_args.append(nb_files)
file_names = {}
make_unique = UniqueNames()
for fi in flatten(2, (inputs, outputs)):
if fi in file_names:
continue
# If it appears in at least one of the command-lines
if fi in runs_with_file:
# If it only appears once in the command-lines
if runs_with_file[fi] is not None:
run_nb, arg_nb = runs_with_file[fi]
parts = []
# Run number, if there are more than one runs
if len(runs) > 1:
parts.append(run_nb)
# Argument number, if there are more than one file arguments
if nb_file_args[run_nb] > 1:
parts.append(arg_nb)
file_names[fi] = make_unique(
files_set = set(in_files) | set(out_files)
nb_files = 0
for arg_nb, arg in enumerate(run['argv']):
p = Path(run['workingdir'], arg).resolve()
if p in files_set:
nb_files += 1
if p not in runs_with_file:
runs_with_file[p] = run_nb, arg_nb
elif runs_with_file[p] is not None:
runs_with_file[p] = None
nb_file_args.append(nb_files)
file_names = {}
make_unique = UniqueNames()
for fi in flatten(2, (inputs, outputs)):
if fi in file_names:
continue
# If it appears in at least one of the command-lines
if fi in runs_with_file:
# If it only appears once in the command-lines
if runs_with_file[fi] is not None:
run_nb, arg_nb = runs_with_file[fi]
parts = []
# Run number, if there are more than one runs
if len(runs) > 1:
parts.append(run_nb)
# Argument number, if there are more than one file arguments
if nb_file_args[run_nb] > 1:
parts.append(arg_nb)
file_names[fi] = make_unique(