prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
s2 = m.group(1) # but replace with all zero s2 = re.sub(r'\d', '0', s2) # now replace last characters l = len(m.group(2)) s2 = s2[:len(s2)-l] + m.group(2) # convert to a float serr = mp.mpf(s2) scenter = mp.mpf(m.group(1)) s = "{:<25} {:<25} {:<25}".format(mp.nstr(scenter, 18...
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
slow = mp.mpf(m.group(1)) shigh = mp.mpf(m.group(2)) smid = (shigh + slow)/mp.mpf("2.0") s = "{:<25} {:<25} {:<25}".format(mp.nstr(smid, 18), mp.nstr(slow, 18), mp.nstr(shigh, 18))
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
s = "{:<25} {:<25} {:<25}".format(0, 0, 0)
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
curatom = "{:<5} {:<5}".format(matomre.group(1), matomre.group(2)) print("{} {:<6} {:<25}".format(curatom, matomre.group(4), NumberStr(matomre.group(5))))
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
print("{} {:<6} {:<25}".format(curatom, misore.group(1), NumberStr(misore.group(2))))
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
curatom = "{:<5} {:<5}".format(matommass.group(1), matommass.group(2)) print("{} {:<25}".format(curatom, NumberStr(matommass.group(4))))
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
print(line) # comment lines, etc
<|file_name|>format_CIAAW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*...
NumberStr
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
def run_test(self, input_code): """Run the actual test
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
"""Metaclass for our test cases The goal is to provide every TestCase class with methods like test_a(), test_b(), etc..., in other words, one method per potential Cangjie input code. Well, not quite, because that would be 12356630 methods (the number of strings composed of 1 to 5 lowercase asc...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
super(MetaTest, cls).__init__(name, bases, dct) def gen_codes(): """Generate the 702 possible input codes""" # First, the 1-character codes for c in string.ascii_lowercase: yield c # Next, the 2-characters-with-wildcard codes ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
"""Generate the 702 possible input codes""" # First, the 1-character codes for c in string.ascii_lowercase: yield c # Next, the 2-characters-with-wildcard codes for t in itertools.product(string.ascii_lowercase, repeat=2): yiel...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
def func(cls): return cls.run_test(code) return func
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
return cls.run_test(code)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
"""Base test class, grouping the common stuff for all our unit tests""" def __init__(self, name): super().__init__(name) self.cli_cmd = ["/usr/bin/libcangjie_cli"] + self.cli_options self.language = (cangjie.filters.BIG5 | cangjie.filters.HKSCS | cangjie.filter...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
super().__init__(name) self.cli_cmd = ["/usr/bin/libcangjie_cli"] + self.cli_options self.language = (cangjie.filters.BIG5 | cangjie.filters.HKSCS | cangjie.filters.PUNCTUATION | cangjie.filters.CHINESE | cangjie.filter...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
self.cj = cangjie.Cangjie(self.version, self.language)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
del self.cj
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
"""Run a command, deal with errors, and return its stdout""" proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate() try: cangjie.errors.handle_error_code(proc.returncode, ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
"""Run the actual test This compares the output of the libcangjie_cli tool with the output from pycangjie. The idea is that if pycangjie produces the same results as a C++ tool compiled against libcangjie, then pycangjie properly wraps libcangjie. We do not try to veri...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
__init__
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
gen_codes
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
tester
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
func
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
__init__
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
setUp
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
tearDown
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
run_command
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors # # This file is part of pycangjie, the Python bindings to libcangjie. # # pycangjie is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # ...
run_test
<|file_name|>suspend.py<|end_file_name|><|fim▁begin|>from verbs.baseforms import forms class SuspendForm(forms.VerbForm): name = "Suspend" slug = "suspend" <|fim▁hole|><|fim▁end|>
duration_min_time = forms.IntegerField()
<|file_name|>suspend.py<|end_file_name|><|fim▁begin|>from verbs.baseforms import forms class SuspendForm(forms.VerbForm): <|fim_middle|> <|fim▁end|>
name = "Suspend" slug = "suspend" duration_min_time = forms.IntegerField()
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
:type resource_id: str
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
""" Abstract base operator for Google Compute Engine operators to inherit from. """ @apply_defaults def __init__(self, project_id, zone, resource_id, gcp_conn_id='google_cloud_default', api_version='v1', ...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
self.project_id = project_id self.zone = zone self.full_location = 'projects/{}/zones/{}'.format(self.project_id, self.zone) self.resource_id = resource_id self.gcp_conn_id = gcp_conn_id self.api_version = api_ver...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
if not self.project_id: raise AirflowException("The required parameter 'project_id' is missing") if not self.zone: raise AirflowException("The required parameter 'zone' is missing") if not self.resource_id: raise AirflowException("The required parameter 'resou...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
pass
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
""" Start an instance in Google Compute Engine. :param project_id: Google Cloud Platform project where the Compute Engine instance exists. :type project_id: str :param zone: Google Cloud Platform zone where the instance exists. :type zone: str :param resource_id: Name of the Compute...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
super(GceInstanceStartOperator, self).__init__( project_id=project_id, zone=zone, resource_id=resource_id, gcp_conn_id=gcp_conn_id, api_version=api_version, *args, **kwargs)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
return self._hook.start_instance(self.project_id, self.zone, self.resource_id)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
""" Stop an instance in Google Compute Engine. :param project_id: Google Cloud Platform project where the Compute Engine instance exists. :type project_id: str :param zone: Google Cloud Platform zone where the instance exists. :type zone: str :param resource_id: Name of the Compute ...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
super(GceInstanceStopOperator, self).__init__( project_id=project_id, zone=zone, resource_id=resource_id, gcp_conn_id=gcp_conn_id, api_version=api_version, *args, **kwargs)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
return self._hook.stop_instance(self.project_id, self.zone, self.resource_id)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
""" Changes the machine type for a stopped instance to the machine type specified in the request. :param project_id: Google Cloud Platform project where the Compute Engine instance exists. :type project_id: str :param zone: Google Cloud Platform zone where the instance exists. :type...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
self.body = body self._field_validator = None if validate_body: self._field_validator = GcpBodyFieldValidator( SET_MACHINE_TYPE_VALIDATION_SPECIFICATION, api_version=api_version) super(GceSetMachineTypeOperator, self).__init__( project_id=project_i...
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
if self._field_validator: self._field_validator.validate(self.body)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
self._validate_all_body_fields() return self._hook.set_machine_type(self.project_id, self.zone, self.resource_id, self.body)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
raise AirflowException("The required parameter 'project_id' is missing")
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
raise AirflowException("The required parameter 'zone' is missing")
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
raise AirflowException("The required parameter 'resource_id' is missing")
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
self._field_validator = GcpBodyFieldValidator( SET_MACHINE_TYPE_VALIDATION_SPECIFICATION, api_version=api_version)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
self._field_validator.validate(self.body)
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
__init__
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
_validate_inputs
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
execute
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
__init__
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
execute
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
__init__
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
execute
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
__init__
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
_validate_all_body_fields
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licens...
execute
<|file_name|>specialist_pool.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
<|file_name|>specialist_pool.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
r"""SpecialistPool represents customers' own workforce to work on their data labeling jobs. It includes a group of specialist managers and workers. Managers are responsible for managing the workers in this pool as well as customers' data labeling jobs associated with this pool. Customers create spec...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Util classes ------------ Classes which represent data types useful for the package pySpatialTools. """ ## Spatial elements collectors from spatialelements import SpatialElementsCollection, Locations<|fim▁hole|> ## Membership relations from Membership import M...
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
""" Save model using Pickle binary format.
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
""" Score a decision tree model. :param string model_name: title for the model used on the output filename :param dataframe model: model reference :param dataframe X: examples :param dataframe y: targets :param dataframe y_actual: target results :param string output_folder: location of ...
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
""" Plot decision tree, y (training) vs y (test/actual). :param string model_name: title for the model used on the output filename :param dataframe y_actual: target results :param dataframe y_test: test targets :param string output_folder: location of the output / results """ # initial...
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
""" Save model using Pickle binary format. :param dataframe model: model reference :param string model_name: title for the model used on the output filename :param string folder: location of model output """ print("Saving model...") model_file = folder + '/models/' + model_name + '.pkl'...
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
""" Retrieve model using Pickle binary format. :param string pickle_model: location of Pickle model :return: Pickle model for re-use :rtype: object """ return pickle.loads(pickle_model)
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
score_dt
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
plot_dt
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
save_dt_model
<|file_name|>DT_Utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Priscilla Boyd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
load_dt_model
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
def setUp(self): create_driver() create_vehicle() create_delivery_notfication() create_test_contact_and_address() def test_delivery_trip(self): contact = get_contact_and_address("_Test Customer") if not frappe.db.exists("Delivery Trip", "TOUR-00000"): delivery_trip = frappe.new_doc("Delivery Trip") ...
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
create_driver() create_vehicle() create_delivery_notfication() create_test_contact_and_address()
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
contact = get_contact_and_address("_Test Customer") if not frappe.db.exists("Delivery Trip", "TOUR-00000"): delivery_trip = frappe.new_doc("Delivery Trip") delivery_trip.company = erpnext.get_default_company() delivery_trip.date = add_days(nowdate(), 5) delivery_trip.driver = "DRIVER-00001" delivery...
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
if not frappe.db.exists("Driver", "Newton Scmander"): driver = frappe.new_doc("Driver") driver.full_name = "Newton Scmander" driver.cell_number = "98343424242" driver.license_number = "B809" driver.insert()
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
if not frappe.db.exists("Standard Reply", "Delivery Notification"): frappe.get_doc({ 'doctype': 'Standard Reply', 'name': 'Delivery Notification', 'response': 'Test Delivery Trip', 'subject': 'Test Subject', 'owner': frappe.session.user }).insert()
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
if not frappe.db.exists("Vehicle", "JB 007"): vehicle = frappe.get_doc({ "doctype": "Vehicle", "license_plate": "JB 007", "make": "Maruti", "model": "PCM", "last_odometer": 5000, "acquisition_date": frappe.utils.nowdate(), "location": "Mumbai", "chassis_no": "1234ABCD", "uom": "Litre", ...
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
delivery_trip = frappe.new_doc("Delivery Trip") delivery_trip.company = erpnext.get_default_company() delivery_trip.date = add_days(nowdate(), 5) delivery_trip.driver = "DRIVER-00001" delivery_trip.vehicle = "JB 007" delivery_trip.append("delivery_stops", { "customer": "_Test Customer", "addre...
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
driver = frappe.new_doc("Driver") driver.full_name = "Newton Scmander" driver.cell_number = "98343424242" driver.license_number = "B809" driver.insert()
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
frappe.get_doc({ 'doctype': 'Standard Reply', 'name': 'Delivery Notification', 'response': 'Test Delivery Trip', 'subject': 'Test Subject', 'owner': frappe.session.user }).insert()
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
vehicle = frappe.get_doc({ "doctype": "Vehicle", "license_plate": "JB 007", "make": "Maruti", "model": "PCM", "last_odometer": 5000, "acquisition_date": frappe.utils.nowdate(), "location": "Mumbai", "chassis_no": "1234ABCD", "uom": "Litre", "vehicle_value": frappe.utils.flt(500000) }) ...
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
setUp
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
test_delivery_trip
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
create_driver
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
create_delivery_notfication
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import erpnext import unittest from frappe.utils import nowdate, add_days from erpnext.tes...
create_vehicle
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse class Software(models.Model): name = models.CharField(max_length=200) def __unicode__(self): return self.name<|fim▁hole|> def get_absolute_url(self): return reverse(...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse class Software(models.Model): <|fim_middle|> <|fim▁end|>
name = models.CharField(max_length=200) def __unicode__(self): return self.name def get_absolute_url(self): return reverse('software_edit', kwargs={'pk': self.pk})
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse class Software(models.Model): name = models.CharField(max_length=200) def __unicode__(self): <|fim_middle|> def get_absolute_url(self): return reverse('software_e...
return self.name
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse class Software(models.Model): name = models.CharField(max_length=200) def __unicode__(self): return self.name def get_absolute_url(self): <|fim_middle|> <|fim▁en...
return reverse('software_edit', kwargs={'pk': self.pk})
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse class Software(models.Model): name = models.CharField(max_length=200) def <|fim_middle|>(self): return self.name def get_absolute_url(self): return reverse('softwa...
__unicode__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse class Software(models.Model): name = models.CharField(max_length=200) def __unicode__(self): return self.name def <|fim_middle|>(self): return reverse('software_ed...
get_absolute_url
<|file_name|>Setup.py<|end_file_name|><|fim▁begin|>__author__ = 'Autio'<|fim▁hole|>import py2exe setup(windows=['ShitCrimson.py'])<|fim▁end|>
from distutils.core import setup
<|file_name|>WMSOverlayServer.py<|end_file_name|><|fim▁begin|>from kvmap.code.projections import * from urllib2 import urlopen from httplib import HTTPConnection from threading import Thread from kivy.logger import Logger from kivy.loader import Loader from os.path import join, dirname import time, os import hashlib t...
self.isPGoogle = False
<|file_name|>WMSOverlayServer.py<|end_file_name|><|fim▁begin|>from kvmap.code.projections import * from urllib2 import urlopen from httplib import HTTPConnection from threading import Thread from kivy.logger import Logger from kivy.loader import Loader from os.path import join, dirname import time, os import hashlib t...
cache = {} available_maptype = dict(roadmap='Roadmap') # default type = "wms" '''Generic WMS server''' def __init__(self, progress_callback=None): self.progress_callback = progress_callback def setProgressCallback(self, progress_callback): self.progress_callback = prog...
<|file_name|>WMSOverlayServer.py<|end_file_name|><|fim▁begin|>from kvmap.code.projections import * from urllib2 import urlopen from httplib import HTTPConnection from threading import Thread from kivy.logger import Logger from kivy.loader import Loader from os.path import join, dirname import time, os import hashlib t...
self.progress_callback = progress_callback
<|file_name|>WMSOverlayServer.py<|end_file_name|><|fim▁begin|>from kvmap.code.projections import * from urllib2 import urlopen from httplib import HTTPConnection from threading import Thread from kivy.logger import Logger from kivy.loader import Loader from os.path import join, dirname import time, os import hashlib t...
self.progress_callback = progress_callback