Instruction
stringlengths
362
7.83k
output_code
stringlengths
1
945
Continue the code snippet: <|code_start|> self.fast = TssJsStarterThread(self.project) self.fast.start() self._wait_for_finish_and_notify_user() def kill(self): """ Trigger killing of adapter, tss.js and queue. """ Debug('tss+', "Killing tss.js process and adapter thread (f...
MESSAGE.show('Typescript project intialized for file : %s' % self.project.tsconfigfile, True, with_panel=False)
Predict the next line after this snippet: <|code_start|> Keeps two tss.js Processes and adapters for each project root. Process SLOW is for slow commands like tss>errors which can last more than 5s easily. Process FAST is for fast reacting commands eg. for autocompletion or type. """ def...
Debug('notify', 'starting tsserver ' + self.project.tsconfigfile)
Continue the code snippet: <|code_start|> """ commands_to_remove = [] for possible_duplicate in self.middleware_queue: # from old to new if possible_duplicate.id == command.id: commands_to_remove.append(possible_duplicate) if len(commands_to_remove) > 0: ...
self.stdin.write(encode(async_command.command))
Given the following code snippet before the placeholder: <|code_start|> "I have tried this path: %s" % node_path, "Please install nodejs and/or set node_path in the project or plugin settings to the actual executable.", "If you are on windows and just have inst...
tss_path = get_tss_path()
Using the snippet: <|code_start|> self.error = "\n".join(["Could not find nodejs.", "I have tried this path: %s" % node_path, "Please install nodejs and/or set node_path in the project or plugin settings to the actual executable.", "If you are on wi...
node_path = default_node_path(self.project.get_setting('node_path'))
Here is a snippet: <|code_start|> return (i, dir) # ----------------------------------------- THREAD: (tss.js and adapter starter) ------------------------ # class TssJsStarterThread(Thread): """ After starting, this class provides the methods and fields * send_async_command(...) ...
kwargs = get_kwargs(stderr=False)
Given the code snippet: <|code_start|> def start_tss_processes(self): """ Start tss.js (2 times). Displays message to user while starting and calls project.on_services_started() afterwards """ Debug('notify', 'starting tsserver ' + self.project.tsconfigfile) se...
set_plugin_temporarily_disabled()
Predict the next line for this snippet: <|code_start|> return False return line_text.endswith(".") or partial_completion() def get_col_after_last_dot(line_text): return line_text.rfind(".") + 1 class Completion(object): completion_chars = ['.']#['.',':'] completion_list = [] interface = ...
Debug('error', 'Completion request failed: %s' % tss_result_json)
Given the following code snippet before the placeholder: <|code_start|> return Debug('autocomplete', " -> command to sublime to now show autocomplete box with prepared list" ) # this will trigger Listener.on_query_completions # but on_query_compl...
kindModifiers = get_prefix(entry['kindModifiers'])
Based on the snippet: <|code_start|> for entry in entries: if self.interface and entry['kind'] != 'primitive type' and entry['kind'] != 'interface' : continue key = self._get_list_key(entry) value = self._get_list_value(entry) self.completion_list.append((key,value...
is_member = is_member_completion( get_content_of_line_at(view, cursor_pos) )
Based on the snippet: <|code_start|> previous_file = filename text.append("\n%i >" % e['start']['line']) text.append(re.sub(r'^.*?:\s*', '', e['text'].replace('\r',''))) line += 1 a = (e['start']['line']-1, e['start']['character']-1) b = (e['end']['line']-1, e['end']...
key = fn2k(file_name)
Predict the next line after this snippet: <|code_start|> #{'lineText': ' let total = 0;', # 'file': '/home/daniel/.config/sublime-text-3/Packages/ArcticTypescript/tests/TDDTesting/main.ts', # 'min': {'character': 13, # 'line': 43}, # 'lim': {'character': 18, # 'line': 43}, # 'ref': {'textSpan': ...
Debug('refactor', self.refs_by_file)
Based on the snippet: <|code_start|> class Refactor(): def __init__(self, edit, project, refs, old_name, new_name): Thread.__init__(self) self.project = project self.refs = {r['ref'] for r in refs} self.old_name = old_name self.new_name = new_name self.edit_token = ...
file_ = fn2k(ref['file'])
Based on the snippet: <|code_start|># coding=utf8 # delete code taken from sublime origami : https://github.com/SublimeText/Origami XMIN, YMIN, XMAX, YMAX = list(range(4)) class Layout(object): # CONSTRUCTEUR def __init__(self): super(Layout, self).__init__() # UPDATE @max_calls(name='Layo...
Debug('layout', 'UPDATE: group: %i' % group)
Using the snippet: <|code_start|># coding=utf8 # delete code taken from sublime origami : https://github.com/SublimeText/Origami XMIN, YMIN, XMAX, YMAX = list(range(4)) class Layout(object): # CONSTRUCTEUR def __init__(self): super(Layout, self).__init__() # UPDATE <|code_end|> , determine the...
@max_calls(name='Layout.update')
Here is a snippet: <|code_start|># coding=utf8 class TsconfigEventListener(sublime_plugin.EventListener): """ Listen to file events -> Activate TsconfigLinter. check_tsconfig immediately returns if file is no tsconfig.json """ def on_activated_async(self, view): <|code_end|> . Write the next line u...
check_tsconfig(view)
Predict the next line after this snippet: <|code_start|> """ Listen to file events -> Activate TsconfigLinter. check_tsconfig immediately returns if file is no tsconfig.json """ def on_activated_async(self, view): check_tsconfig(view) def on_load_async(self, view): check_tsconfig(v...
show_lint_in_status(view)
Continue the code snippet: <|code_start|># coding=utf8 class TsconfigEventListener(sublime_plugin.EventListener): """ Listen to file events -> Activate TsconfigLinter. check_tsconfig immediately returns if file is no tsconfig.json """ def on_activated_async(self, view): check_tsconfig(view)...
linting_succeeded = expand_filesglob(linter)
Based on the snippet: <|code_start|># coding=utf8 class TsconfigEventListener(sublime_plugin.EventListener): """ Listen to file events -> Activate TsconfigLinter. check_tsconfig immediately returns if file is no tsconfig.json """ def on_activated_async(self, view): check_tsconfig(view) ...
@catch_CancelCommand
Using the snippet: <|code_start|># coding=utf8 class TsconfigEventListener(sublime_plugin.EventListener): """ Listen to file events -> Activate TsconfigLinter. check_tsconfig immediately returns if file is no tsconfig.json """ def on_activated_async(self, view): check_tsconfig(view) d...
project = opened_project_by_tsconfig(linter.file_name)
Given snippet: <|code_start|># coding=utf8 DEFAULT_DEBOUNCE_DELAY = 0.2 # Will also be used for AsyncCommand debounce # DEBOUNCE CALL def debounce(fn, delay=DEFAULT_DEBOUNCE_DELAY, uid=None, *args): uid = uid if uid else fn <|code_end|> , continue by predicting the next line. Consider current file imports: ...
if uid in debounced_timers:
Given the following code snippet before the placeholder: <|code_start|># coding=utf8 # ----------------------------------- ERROR HIGHTLIGHTER -------------------------------------- # class ErrorsHighlighter(object): # Constants underline = sublime.DRAW_SQUIGGLY_UNDERLINE | sublime.DRAW_NO_FILL | sublime.D...
@max_calls(name='Errors.highlight')
Continue the code snippet: <|code_start|># coding=utf8 # ----------------------------------- ERROR HIGHTLIGHTER -------------------------------------- # class ErrorsHighlighter(object): # Constants underline = sublime.DRAW_SQUIGGLY_UNDERLINE | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_...
self.error_icon = ".."+os.path.join(package_path.split('Packages')[1], 'icons', 'bright-illegal')
Predict the next line after this snippet: <|code_start|> def __init__(self, project): self.project = project self._icon_paths() def _icon_paths(self): """ defines paths for icons """ if os.name == 'nt': self.error_icon = ".."+os.path.join(package_path.split('Packag...
self.errors[fn2k(view.file_name())] = error_texts
Here is a snippet: <|code_start|>class ErrorsHighlighter(object): # Constants underline = sublime.DRAW_SQUIGGLY_UNDERLINE | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_EMPTY_AS_OVERWRITE def __init__(self, project): self.project = project self._icon_paths() def _ic...
if is_ts(view):
Using the snippet: <|code_start|> return self def set_callback_kwargs(self, **callback_kwargs): """ Set additional arguments the callbacks will be called with. """ self.callback_kwargs = callback_kwargs return self def set_result_callback(self, result_callback=None): """...
Debug('command', "CMD queued @FAST: %s" % self.id)
Using the snippet: <|code_start|> self.command = command self.project = project self.id = "%s-rnd%s" % (command[:6][:-1], uuid.uuid4().hex[0:5]) self.result_callback = None self.replaced_callback = None self.executing_callback = None self.callback_kwargs = {} ...
def activate_debounce(self, delay=DEFAULT_DEBOUNCE_DELAY):
Predict the next line for this snippet: <|code_start|># coding=utf8 # ------------------------------------- PROJECT WIZZARD ----------------------------------------- # class ProjectWizzard(object): def __init__(self, view, finished_callback): self.finished_callback = finished_callback self.wi...
Debug('project+', 'Disable ArcticTypescript while in WizzardMode')
Given the code snippet: <|code_start|> max_lines = 0 for m in self.messages: max_lines = max(max_lines, len(m)) for m in self.messages: while len(m) < max_lines: m.append('') def on_select(i): #self.window.run_command("hide_overlay") ...
self.actions.append(lambda: [self.window.open_file(package_path + '/examples/basic_browser_project/tsconfig.json'), self._cleanup()])
Next line prediction: <|code_start|># coding=utf8 # ------------------------------------- PROJECT WIZZARD ----------------------------------------- # class ProjectWizzard(object): def __init__(self, view, finished_callback): self.finished_callback = finished_callback self.window = view.window...
set_plugin_temporarily_disabled() # Disable global until wizzard is cancled or finished
Using the snippet: <|code_start|> def _finish(self): """ make and write tsconfig.json. Call finished_callback """ Debug('project+', 'Wizzard finished: Create and write tsconfig.json') content = { "compilerOptions" : {}, "files" : {}} if self.module is None: content['compi...
set_plugin_temporarily_enabled()
Using the snippet: <|code_start|># coding=utf8 # ------------------------------------- PROJECT WIZZARD ----------------------------------------- # class ProjectWizzard(object): def __init__(self, view, finished_callback): self.finished_callback = finished_callback self.window = view.window() ...
assert is_plugin_temporarily_disabled()
Here is a snippet: <|code_start|> and uses them. If no such view can be found, it creates one and layoutes it to group 1 """ if self.get_view() is None: ## add next to existing t3s views ## or create layout if not created yet self.t3sviews.get_window_and_g...
Debug('focus', 'bring_to_top: focus view %i' % self._view_reference.id())
Using the snippet: <|code_start|># coding=utf8 class Base(object): """ This object represents a special view to display ArcticTypescript information like the error list or the outline structure """ def __init__(self, name, t3sviews): self.name = name self.t3sviews = t3svie...
@max_calls()
Predict the next line after this snippet: <|code_start|># --------------------------------------- ERRORS -------------------------------------- # class Errors(object): def __init__(self, project): self.project = project self.lasterrors = [] self.message = "" # contains exception message if ...
Debug('error', 'Internal ArcticTypescript error during show_errors: %s (Exception Message: %s)' % (errors, e))
Predict the next line after this snippet: <|code_start|># coding=utf8 # --------------------------------------- ERRORS -------------------------------------- # class Errors(object): def __init__(self, project): self.project = project self.lasterrors = [] self.message = "" # contains exc...
@max_calls()
Given the code snippet: <|code_start|> self.line_to_file = line_to_file self.line_to_pos = line_to_pos self.text = ''.join(text) def _flatten_errortext(self, text_or_dict): text = [] if isinstance(text_or_dict, str): text.append(text_or_dict.replace('\r','')) ...
if fn2k(e['file']) == fn2k(view.file_name()):
Given the code snippet: <|code_start|> def kwargs_to_namedtuple(func): def wrapper(**kwargs): controls = namedtuple('Controls', list(kwargs.keys()))(**kwargs) return func(controls) return wrapper def namedtuple_to_kwargs(func): def wrapper(controls): return func(**(controls._todict...
private.data = GrowableArray(cols=5, length=1000)
Next line prediction: <|code_start|># Copyright 2008 - 2019 Brian R. D'Urso # # This file is part of Python Instrument Control System, also known as Pythics. # # Pythics is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Fou...
if not _TRY_PYSIDE:
Predict the next line after this snippet: <|code_start|> # # private data shared among functions # class Private(object): pass private = Private() # # functions # def initialize(log_text_box, data_chart, **kwargs): # setup the logger and log display box # examples of how to use: # private.logger.d...
private.data = GrowableArray(cols=2, length=1000)
Continue the code snippet: <|code_start|> pluck = w_pluck.value monitor = w_monitor.value N_tfft = w_N_tfft.value N_tfft_display = w_N_tfft_display.value drag = w_drag.value messages.write('\n=== WAVES ===============================\n') # spatial domain data and initial condition N_pluck...
data_yt = CircularArray(length=N_tfft, cols=2)
Based on the snippet: <|code_start|># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Stre...
for i in TSI.layout:
Given the following code snippet before the placeholder: <|code_start|># Copyright 2013 - 2016, James Humphry # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License,...
layout = [TextField("Station code", 3),
Using the snippet: <|code_start|># it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without e...
IntegerField("Minimum Interchange Time", 2),
Given the code snippet: <|code_start|># the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PAR...
VarTextField("Comments", 100)]
Based on the snippet: <|code_start|># Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # '''Generate SQL that will create a suitable schema for storing data from ATOC .ALF additional fixed link files. This is done dynamically to ensure it keeps in sync with the definitions in nrcif.py...
for i in ALF.layout:
Given the code snippet: <|code_start|># You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # '''Generate SQL that will create a suitable schema for storing...
DDL.write(layouts['BS'].generate_sql_ddl()+",\n")
Here is a snippet: <|code_start|># Copyright 2013 - 2016, James Humphry # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later vers...
layouts = mca_layouts.copy()
Given the code snippet: <|code_start|> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distribu...
layouts["HD"] = reduced_hd
Given the following code snippet before the placeholder: <|code_start|># This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later versio...
layouts["BX"] = corrected_bx
Predict the next line for this snippet: <|code_start|># You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # '''Generate SQL that will create a suitable sc...
tablename = layouts[i].name.lower().replace(" ", "_")
Using the snippet: <|code_start|> def download_workflow(): utils.download_workflow() def update_postrun_json_init(input_json, output_json): utils.update_postrun_json_init(input_json, output_json) def update_postrun_json_upload_output(input_json, execution_metadata_file, md5file, output_json, language, endpo...
version='%(prog)s ' + __version__)
Using the snippet: <|code_start|> "MaxAttempts": 10000, "BackoffRate": 1.0 }, { "ErrorEquals": ["EC2InstanceLimitWaitException"], "IntervalSeconds": 600, "MaxAttempts": 1008, # 1 wk "BackoffRate": 1.0 }, lambda_error...
region_name=AWS_REGION,
Given the following code snippet before the placeholder: <|code_start|> "BackoffRate": 1.0 }, { "ErrorEquals": ["EC2InstanceLimitWaitException"], "IntervalSeconds": 600, "MaxAttempts": 1008, # 1 wk "BackoffRate": 1.0 }, lambda_e...
aws_acc=AWS_ACCOUNT_NUMBER,
Predict the next line for this snippet: <|code_start|> ] sfn_check_task_retry_conditions = [ { "ErrorEquals": ["EC2StartingException"], "IntervalSeconds": 300, "MaxAttempts": 25, "BackoffRate": 1.0 }, { "ErrorEquals": ["StillRun...
return create_tibanna_suffix(self.dev_suffix, self.usergroup)
Predict the next line after this snippet: <|code_start|> config = { 'function_name': 'check_task_awsem', 'function_module': 'service', 'function_handler': 'handler', 'handler': 'service.handler', 'region': AWS_REGION, 'runtime': 'python3.6', 'role': 'tibanna_lambda_init_role', 'descripti...
return check_task(event)
Given snippet: <|code_start|> config = { 'function_name': 'check_task_awsem', 'function_module': 'service', 'function_handler': 'handler', 'handler': 'service.handler', <|code_end|> , continue by predicting the next line. Consider current file imports: from tibanna.check_task import check_task from tib...
'region': AWS_REGION,
Based on the snippet: <|code_start|> class StepFunctionCostUpdater(object): sfn_type = SFN_TYPE def __init__(self, dev_suffix=None, <|code_end|> , predict the immediate next line with the help of imports: from .vars import ( AWS_REGION, AWS_ACCOUNT_NUMBER, SFN_TYPE, UPDATE_CO...
region_name=AWS_REGION,
Given snippet: <|code_start|> class StepFunctionCostUpdater(object): sfn_type = SFN_TYPE def __init__(self, dev_suffix=None, region_name=AWS_REGION, <|code_end|> , continue by predicting the next line. Consider current file imports: from .vars import ( AWS_REGION, AW...
aws_acc=AWS_ACCOUNT_NUMBER,
Here is a snippet: <|code_start|> return "arn:aws:lambda:" + self.region_name + ":" + self.aws_acc + ":function:" @property def sfn_name(self): return 'tibanna_' + self.sfn_type + self.lambda_suffix + '_costupdater' @property def iam(self): return IAM(self.usergroup) @prope...
"Resource": self.lambda_arn_prefix + UPDATE_COST_LAMBDA_NAME + self.lambda_suffix,
Given the code snippet: <|code_start|> class StepFunctionCostUpdater(object): sfn_type = SFN_TYPE def __init__(self, dev_suffix=None, region_name=AWS_REGION, aws_acc=AWS_ACCOUNT_NUMBER, usergroup=None): self.dev_suffix = dev_suffix ...
return create_tibanna_suffix(self.dev_suffix, self.usergroup)
Given snippet: <|code_start|> def test_upload(): randomstr = 'test-' + create_jobid() os.mkdir(randomstr) filepath = os.path.join(os.path.abspath(randomstr), randomstr) with open(filepath, 'w') as f: f.write('haha') <|code_end|> , continue by predicting the next line. Consider current file impo...
upload(filepath, 'tibanna-output', 'uploadtest')
Based on the snippet: <|code_start|> @pytest.fixture() def check_task_input(): return {"config": {"log_bucket": "tibanna-output"}, "jobid": "test_job", "push_error_to_end": True } @pytest.fixture() def s3(check_task_input): bucket_name = check_task_input['config']['log_buc...
service.handler(check_task_input_modified, '')
Here is a snippet: <|code_start|> @pytest.fixture() def check_task_input(): return {"config": {"log_bucket": "tibanna-output"}, "jobid": "test_job", "push_error_to_end": True } @pytest.fixture() def s3(check_task_input): bucket_name = check_task_input['config']['log_bucket...
with pytest.raises(EC2StartingException) as excinfo:
Using the snippet: <|code_start|> jobid = 'notmyjobid' check_task_input_modified = check_task_input check_task_input_modified['jobid'] = jobid check_task_input_modified['config']['start_time'] = datetime.strftime(datetime.now(tzutc()) - timedelta(minutes=13), ...
with pytest.raises(StillRunningException) as excinfo:
Based on the snippet: <|code_start|> assert 'aborted' in str(excinfo.value) # cleanup s3.delete_objects(Delete={'Objects': [{'Key': job_started}]}) s3.delete_objects(Delete={'Objects': [{'Key': job_aborted}]}) @pytest.mark.webtest def test_check_task_awsem_throws_exception_if_not_done(check_task_input)...
with pytest.raises(MetricRetrievalException) as excinfo:
Given the following code snippet before the placeholder: <|code_start|>def s3(check_task_input): bucket_name = check_task_input['config']['log_bucket'] return boto3.resource('s3').Bucket(bucket_name) @pytest.mark.webtest def test_check_task_awsem_fails_if_no_job_started(check_task_input, s3): # ensure the...
with pytest.raises(EC2IdleException) as excinfo:
Here is a snippet: <|code_start|> job_started = "%s.job_started" % jobid s3.delete_objects(Delete={'Objects': [{'Key': job_started}]}) with pytest.raises(EC2StartingException) as excinfo: service.handler(check_task_input_modified, '') assert 'Failed to find jobid' in str(excinfo.value) @pytest....
with pytest.raises(JobAbortedException) as excinfo:
Here is a snippet: <|code_start|> @pytest.fixture() def check_task_input(): return {"config": {"log_bucket": "tibanna-output"}, "jobid": "test_job", "push_error_to_end": True } @pytest.fixture() def s3(check_task_input): bucket_name = check_task_input['config']['log_bucket...
AWSEM_TIME_STAMP_FORMAT)
Predict the next line for this snippet: <|code_start|> top_contents = """ Timestamp: 2020-12-18-18:55:37 top - 18:55:37 up 4 days, 3:18, 2 users, load average: 2.00, 2.00, 2.30 Tasks: 344 total, 1 running, 343 sleeping, 0 stopped, 0 zombie %Cpu(s): 6.6 us, 0.1 sy, 0.0 ni, 93.2 id, 0.0 wa, 0.0 hi, 0.0 si...
top1 = top.Top('')
Here is a snippet: <|code_start|> config = { 'function_name': 'run_task_awsem', 'function_module': 'service', 'function_handler': 'handler', 'handler': 'service.handler', 'region': AWS_REGION, 'runtime': 'python3.6', 'role': 'tibanna_lambda_init_role', 'description': 'launch an ec2 inst...
return run_task(event)
Predict the next line after this snippet: <|code_start|> config = { 'function_name': 'run_task_awsem', 'function_module': 'service', 'function_handler': 'handler', 'handler': 'service.handler', <|code_end|> using the current file's imports: from tibanna.run_task import run_task from tibanna.vars impo...
'region': AWS_REGION,
Predict the next line for this snippet: <|code_start|> def test_general_awsem_error_msg(): eh = AWSEMErrorHandler() res = eh.general_awsem_error_msg('somejobid') assert res == 'Job encountered an error check log using tibanna log --job-id=somejobid [--sfn=stepfunction]' def test_general_awsem_check_log_m...
with pytest.raises(AWSEMJobErrorException) as exec_info:
Next line prediction: <|code_start|> def test_combine_two(): x = combine_two('a', 'b') assert x == 'a/b' x = combine_two(['a1', 'a2'], ['b1', 'b2']) assert x == ['a1/b1', 'a2/b2'] x = combine_two([['a1', 'a2'], ['b1', 'b2']], [['c1', 'c2'], ['d1', 'd2']]) assert x == [['a1/c1', 'a2/c2'], ['b1/d1...
x = run_on_nested_arrays2(1, 2, sum0)
Predict the next line after this snippet: <|code_start|> "end_time": "20190531-04:24:55-UTC", "filesystem": "/dev/nvme1n1", "instance_id": "i-08d1c54ed1f74ab36", "status": "0", "total_input_size": "2.2G", "total_output_size": "4.2G", "total_tmp_size": "7.4G", ...
r = awsem.AwsemPostRunJson(**postrun_json)
Given the code snippet: <|code_start|> assert hasattr(r, 'class_') assert hasattr(r, 'dir_') assert hasattr(r, 'path') assert hasattr(r, 'profile') assert hasattr(r, 'unzip') # default '' if omitted assert r.class_ == 'File' assert r.dir_ == 'somebucket' assert r.path == 'somefilepath' ...
with pytest.raises(MalFormattedRunJsonException) as ex:
Next line prediction: <|code_start|> config = { 'function_name': 'update_cost_awsem', 'function_module': 'service', 'function_handler': 'handler', 'handler': 'service.handler', 'region': AWS_REGION, 'runtime': 'python3.6', 'role': 'tibanna_lambda_init_role', 'description': 'update costs...
return update_cost(event)
Predict the next line for this snippet: <|code_start|> config = { 'function_name': 'update_cost_awsem', 'function_module': 'service', 'function_handler': 'handler', 'handler': 'service.handler', <|code_end|> with the help of current file imports: from tibanna.update_cost import update_cost from tiban...
'region': AWS_REGION,
Based on the snippet: <|code_start|> entry = ccpnProject.currentNmrEntryStore.findFirstEntry() strucGen = entry.findFirstStructureGeneration() refStructure = strucGen.structureEnsemble.sortedModels()[0] if outType == "mol2": mol2Format = Mol2Format.Mol2For...
molecule = ACTopol(
Given the following code snippet before the placeholder: <|code_start|> ) if not molecule.acExe: molecule.printError("no 'antechamber' executable... aborting!") hint1 = "HINT1: is 'AMBERHOME' environment variable set?" hint2 = (...
msg = elapsedTime(execTime)
Given snippet: <|code_start|> else: resTempFile = os.path.join(dirTemp, "%s.pdb" % resName) entry = ccpnProject.currentNmrEntryStore.findFirstEntry() strucGen = entry.findFirstStructureGeneration() refStructure = strucGen.structureEnsemble.sortedModels()[0...
print(header)
Using the snippet: <|code_start|> r = "<[<Atom id=3, name=C1, c3>, <Atom id=4, name=H, hc>, <Atom id=5, name=H, hc>, <Atom id=6, name=H, hc>], ang=0.00>" def test_atom(): atom = Atom("C1", "c3", 3, 5, 12.0, 0.5, (1.0, 0.9, 0.5)) assert str(atom) == "<Atom id=3, name=C1, c3>" def test_bond(): a1 = Atom("...
angle = Angle([a1, a2, a3], 46.3, 1.91637234)
Given snippet: <|code_start|> r = "<[<Atom id=3, name=C1, c3>, <Atom id=4, name=H, hc>, <Atom id=5, name=H, hc>, <Atom id=6, name=H, hc>], ang=0.00>" def test_atom(): atom = Atom("C1", "c3", 3, 5, 12.0, 0.5, (1.0, 0.9, 0.5)) assert str(atom) == "<Atom id=3, name=C1, c3>" def test_bond(): a1 = Atom("C1",...
bond = Bond([a1, a2], 330.0, 1.0969)
Given the code snippet: <|code_start|> file_types = ( ("file_name"), ("em_mdp"), ("AC_frcmod"), ("AC_inpcrd"), ("AC_lib"), ("AC_prmtop"), ("mol2"), ("CHARMM_inp"), ("CHARMM_prm"), ("CHARMM_rtf"), ("CNS_inp"), ("CNS_par"), ("CNS_top"), ("GMX_OPLS_itp"), ("GMX_...
jj = json.loads(acpype_api(inputFile="benzene.pdb", debug=True))
Here is a snippet: <|code_start|>""" Script to get energies from AMBER and GROMACS for a given system and compare them """ def error(v1, v2): """percentage relative error""" if v1 == v2: return 0 return abs(v1 - v2) / max(abs(v1), abs(v2)) * 100 ff = 4.1840 vv = ["ANGLE", "BOND", "DIHED", "EP...
x.split("=") for x in re.sub(r"\s+=\s+", "=", _getoutput(cmd_amb)).strip().replace("1-4 ", "1-4_").split()
Given the code snippet: <|code_start|> def dotproduct(aa, bb): """scalar product""" return sum((a * b) for a, b in zip(aa, bb)) def cross_product(a, b): """cross product""" c = [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]] return c def length(v): """distan...
angle = math.acos(dotproduct(n1, n2) / (length(n1) * length(n2))) * 180 / Pi
Next line prediction: <|code_start|> help="print nothing (not allowed with arg -d)", ) parser.add_argument( "-o", "--outtop", choices=["all"] + outTopols, action="store", default="all", dest="outtop", help="output topologies: all (default), gmx, cns...
default=MAXTIME,
Next line prediction: <|code_start|> "--keyword", action="store", dest="keyword", help="mopac or sqm keyword, inside quotes", ) parser.add_argument( "-f", "--force", action="store_true", dest="force", help="force topologies recalculation ane...
choices=["all"] + outTopols,
Predict the next line for this snippet: <|code_start|> allTotal = len(ccpCodes) * 2 jobsOK = [] # list of Mols that have at least a PDB or IDEAL clean: [[both],[pdb,ideal]] totalTxt = "" for group in groupResults: header, subHead, dummy, lista = group if "Mols clean" == subHead: jobsOK = lista subT...
out = _getoutput(cmd)
Given the following code snippet before the placeholder: <|code_start|>class Bond: """ attributes: pair of Atoms, spring constant (kcal/mol), dist. eq. (Ang) """ def __init__(self, atoms, kBond, rEq): self.atoms = atoms self.kBond = kBond self.rEq = rEq def __str__(self): ...
return f"<{self.atoms}, ang={self.thetaEq * 180 / Pi:.2f}>"
Predict the next line for this snippet: <|code_start|> def test_no_ac(janitor, capsys): binaries = {"ac_bin": "no_ac", "obabel_bin": "obabel"} msg = f"ERROR: no '{binaries['ac_bin']}' executable... aborting!" inp = "AAA.mol2" with pytest.raises(SystemExit) as e_info: <|code_end|> with the help of cur...
cli.init_main(argv=["-di", inp, "-c", "gas"], binaries=binaries)
Next line prediction: <|code_start|> def test_no_ac(janitor, capsys): binaries = {"ac_bin": "no_ac", "obabel_bin": "obabel"} msg = f"ERROR: no '{binaries['ac_bin']}' executable... aborting!" inp = "AAA.mol2" with pytest.raises(SystemExit) as e_info: cli.init_main(argv=["-di", inp, "-c", "gas"]...
_getoutput(f"rm -vfr {temp_base}* .*{temp_base}*")
Given the following code snippet before the placeholder: <|code_start|> ----------------------------------------- |-----win1------|-----win2-----|--------- ----------------------------------------- To improve efficiency, there are several method to be adopted: 1) The section that have matched, we don't search it...
hanning = hann(DEF_FFT_SIZE, sym=0)
Here is a snippet: <|code_start|> ZCR_FALG = False SIGNAL_START_FLAG = False EXPECT_ZCR = int(DEF_FFT_SIZE/framerate*base_frq*2) #data length data_len = len(wdata) num = int(data_len/DEF_FFT_SIZE) frames_num = t*framerate/DEF_FFT_SIZE print frames_num if frames_num>num: frames_num = num #frequency domai...
hanning = hann(DEF_FFT_SIZE, sym=0)
Given snippet: <|code_start|> start = Q.pop() # explore a cycle from start node node = start # current node on cycle while next_[node] < len(graph[node]): # visit all allowable arcs neighbor = graph[node][next_[node]] # traverse an arc ...
write_graph(filename, graph, arc_label=weight, directed=directed)
Using the snippet: <|code_start|># jill-jênn vie et christoph dürr - 2020 # coding=utf8 # pylint: disable=missing-docstring class TestNextPermutation(unittest.TestCase): def test_solve_word_addition(self): self.assertEqual(solve_word_addition(["A", "B", "C"]), 32) self.assertEqual(solve_word_add...
self.assertEqual(next_permutation(L), True)
Continue the code snippet: <|code_start|>""" def _alternate(u, bigraph, visitU, visitV, matchV): """extend alternating tree from free vertex u. visitU, visitV marks all vertices covered by the tree. """ visitU[u] = True for v in bigraph[u]: if not visitV[v]: visitV[v] = Tru...
matchV = max_bipartite_matching(bigraph)
Here is a snippet: <|code_start|># snip{ # pylint: disable=too-many-arguments def _augment(graph, capacity, flow, val, u, target, visit): """Find an augmenting path from u to target with value at most val""" visit[u] = True if u == target: return val for v in graph[u]: cuv = capacity[u][...
add_reverse_arcs(graph, capacity)
Given snippet: <|code_start|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- """\ Decompose DAG into a minimum number of chains jill-jenn vie et christoph durr - 2015-2018 """ # snip{ def dilworth(graph): """Decompose a DAG into a minimum number of chains by Dilworth :param graph: directed graph in listlist ...
match = max_bipartite_matching(graph) # maximum matching
Using the snippet: <|code_start|># -*- coding: utf-8 -*- """\ Largest area rectangle in a binary matrix plus grand rectangle monochromatique jill-jenn vie et christoph durr - 2014-2018 """ # snip{ def rectangles_from_grid(P, black=1): """Largest area rectangle in a binary matrix :param P: matrix :param ...
(area, left, height, right) = rectangles_from_histogram(t)