Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
has_expr = True
else:
results = ["--file", "--expression"]
results.extend(["errors", "results", "running", "all"])
if len(data) == 0:
data = ['']
elif event.line[-1] == ' ':
data.append('')
if not has_file:
results.extend(name for name, u in self.user_ns.items()
if isinstance(u, JobFolder)
and name[0] != '_'
and name not in data)
if not has_expr:
results.extend(jobfolder_file_completer(data))
return list(results)
def completer(self, event, data):
""" Completer for scattered launcher. """
from .. import jobfolder_file_completer
if data[-1] == "--kwargs":
return [u for u in self.user_ns if u[0] != '_' and isinstance(self.user_ns[u], dict)]
elif data[-1] == "--nbprocs":
return ['']
elif data[-1] == "--ppn":
return ['']
result = ['--force', '--kwargs', '--help', '--nbprocs', '--ppn']
result.extend(jobfolder_file_completer([event.symbol]))
result = list(set(result) - set(data))
return result
elif data[-1] == "--queue":
return queues
elif data[-1] == "--account":
return accounts
elif data[-1] == "--feature":
return features
result = ['--force', '--walltime', '--nbprocs', '--help']
if len(queues) > 0:
result.append("--queue")
if len(accounts) > 0:
result.append("--account")
if len(features) > 0:
result.append("--feature")
if debug_queue is not None:
result.append("--debug")
result.extend(jobfolder_file_completer([info.symbol]))
result = list(set(result) - set(data))
return result