ngram
listlengths
0
67.8k
[ "def remove_deployment_dir(namespace, dir_path): with open(os.path.join(dir_path, 'dep_order.txt')) as f: dep_order = f.readline() dep_lst =", "find by name and delete requested item for item in list_func(namespace).items: if item.metadata.name", "import ApiException import os import time import yaml from tests...
[ "I'll give you the option # Instead, you should put the trusted CA", "addresses? # By default, agents protect themselves from scanning their local network self.scan_local", "or 15 # seconds # Maximum value for exponential backoff of requests, 5", "or 'http://127.0.0.1:5000' # ignore warnings about SSL connect...
[ "lc = modify_error(lc, err_floor) name = lc.meta['SN'] if type(name) is float: name =", "def fit_lc_and_save(lc, model_name, save_dir, no_mc): name = lc.meta['SN'] model = sncosmo.Model(source=model_name, effects=[sncosmo.CCM89Dust()], effect_names=['mw'],", "else None save_path = os.path.join(save_dir, '{}.pkl...
[ "arr_val # assign scalar to array residuals['C2.y'] = num_val assert_rel_error(self, residuals['C2.y'], arr_val, 1e-10)", "= -1. inputs, outputs, residuals = model.get_nonlinear_vectors() self.assertEqual(inputs['G1.G2.C1.a'], -1.) inputs, outputs, residuals =", "5.) inputs, outputs, residuals = g1.get_nonlinea...
[ "index idx_{tbl}_user_id on {tbl}(user_id)\") def main(argv=None): if argv is None: argv = sys.argv[:1]", "db_tables(conn) for tbl in ['decisions', 'outcomes', 'predictions']: if tbl not in db_tbls: users.to_sql(tbl,", "tbl in ['decisions', 'outcomes', 'predictions']: if tbl not in db_tbls: users.to_sql(tbl, co...
[ "@api.route(\"/api/v1.0/index\") def view(req, resp): raise ValueError r = api.requests.get(api.url_for(view)) assert not r.ok assert", "r.ok def test_500_error(api): def catcher(req, exc): return PlainTextResponse(\"Suppressed error\", 500) api.app.add_exception_handler(ValueError, catcher) @api.route(\"/api/v1....
[ "import datasets from mmgp import losses from mmgp import util dpath = '/experiments/datasets/'", "= FLAGS.is_ard TOL = FLAGS.opt_tol VAR_STEPS = FLAGS.var_steps DIAG_POST = False SPARSE_PRIOR =", "for 25 sites for 15 minute forecast - N_train = 4200, N_test =", "= TOL, max_time=MAXTIME ) print(\"optimisation...
[ "self, sleep_mock): # Fixture sut = PositionHlCommander(self.cf_mock, default_height=0.4) # Test sut.take_off(velocity=0.6) # Assert", "- 1, inital_pos[2]) self.commander_mock.go_to.assert_called_with( final_pos[0], final_pos[1], final_pos[2], 0, duration) sleep_mock.assert_called_with(duration) def test_that_it_...
[ "node_2[0], weight=0) self.graph[node_1[0]][node_2[0]]['weight'] += similarity def candidate_weighting(self, window=10, pos=None, expanded_documents=None, normalized=False): \"\"\"Candidate ranking", "of the document. extractor.load_document(input='path/to/input.xml') # 3. select the the longest sequences of noun...
[ "<reponame>mmeidlinger/cdk-microservices-labs #!/usr/bin/env python3 from aws_cdk import core from fagate_serverless.fagate_serverless_stack import FagateServerlessStack app =", "#!/usr/bin/env python3 from aws_cdk import core from fagate_serverless.fagate_serverless_stack import FagateServerlessStack app = core....
[ "task.status in (\"FAILURE\", \"REVOKED\"): return self.terminate_job(job) return False def job_running(self, job): future =", "key): self.handle.backend.delete(key) def call_job_fn(self, key, job_fn, args): task = job_fn.delay(key, self._make_progress_key(key), args) return", "if self.cache_by is None: self.cl...
[ "Changes may cause incorrect behavior and will be lost if the code is", "botframework.tokenapi.operations.BotSignInOperations :ivar user_token: UserToken operations :vartype user_token: botframework.tokenapi.operations.UserTokenOperations :param credentials: Subscription credentials which", "Code generated by M...
[ "# content of test_sample.py def inc(x: int) -> int: return x + 1" ]
[ "order.save(update_fields=[\"user\"]) class Migration(migrations.Migration): dependencies = [ (\"order\", \"0080_invoice\"), ] operations = [ migrations.RunPython(match_orders_with_users),", "Django 3.0.4 on 2020-04-06 09:56 from django.db import migrations from saleor.order import OrderStatus", "from saleor.or...
[ "[{'0100': user_dict_pattern + \" is not a valid pattern name in the user", "governing permissions and limitations under the License. \"\"\" from brightics.common.utils import check_required_parameters from", "re def regex(table, **params): check_required_parameters(_regex, params, ['table']) return _regex(tabl...
[ "((W*np.cos(A))-((base_temp-avet)*((np.pi/2.0)-A)))/np.pi return dd # compute the degree-days for each day in the temperature", "will skip resample and interpolation, so `in_dataframe` must already be daily or hourly", "should be [-1:1]'.format(tmp)) tmp = -1 if tmp > 1: print('WARNING: (base_temp-avet)/W =", ...
[ "if kratos_utilities.CheckIfApplicationsAvailable(\"ExternalSolversApplication\"): has_external_solvers_application = True else: has_external_solvers_application = False # Import the tests", "selected tests plus all small tests nightlySuite = suites['nightly'] ### BEGIN SMALL SUITE", "very long tests that shoul...
[ "Column(String, nullable=False) email = Column(String, nullable=False, unique=True) password = Column(String, nullable=False) phone_number =", "default=0.0) image = Column(String) owner_id = Column(Integer, ForeignKey(\"users.id\")) creator = relationship(\"User\", back_populates=\"posts\") class", "full_name =...
[ "PyMongo from flask import request app=Flask(__name__) app.config['MONGO_DBNAME']='stud' app.config['MONGO_URI']='mongodb://localhost:27017/stud' mongo=PyMongo(app) \"\"\" @app.route('/add') def add():", "request app=Flask(__name__) app.config['MONGO_DBNAME']='stud' app.config['MONGO_URI']='mongodb://localhost:27...
[ ") @pytest.mark.django_db @pytest.fixture def resource_in_unit2(space_resource_type, test_unit2): return Resource.objects.create( type=space_resource_type, authentication=\"none\", name=\"resource in unit", "equipment_alias(equipment): equipment_alias = EquipmentAlias.objects.create(name='test equipment alias', l...
[ "foo[0].replace('INCLUDE', 'PRINT') metalist.append(foo[0] + \", pMetadata);\") with open('list.txt', 'w') as f: for item", "INCLUDE(CAM_INTF_META_HISTOGRAM') end = data.find('} metadata_data_t;') data = data[start:end] metadata = data.split(\"\\n\") metalist =", "= line.split(',') foo[0] = foo[0].replace('INCL...
[ "= 0 for i in range(48): t = 1 << i if (g(B,", "B): result = 0 for i in range(48): t = 1 << i", "// (2 * n) * n + max(A % (2 * n) -", "0) def f(A, B): result = 0 for i in range(48): t =", "max(A % (2 * n) - (n - 1), 0) def f(A, B):", "<reponame>c-yan/atcoder def g(A, n): if A == -1: return 0 return A //",...
[ "- %(message)s') ch.setFormatter(formatter) self.logger.addHandler(ch) ''' logger = MyLog(\"test\",\"log\\\\text.txt\") logger.logger.debug('debug message') logger.logger.info('info message') logger.logger.warning('warn", "TimedRotatingFileHandler class MyLog(): def __init__(self, name, filename): self.logger = l...
[ "\"http://django-sdmx.org/ws/\" register_converter(converters.ResourceConverter, 'res') register_converter(converters.AgencyConverter, 'age') register_converter(converters.ContextConverter, 'con') urlpatterns = [ path('wsreg/SubmitStructure/', views.SubmitStructureRequestView.as_view()), path('wsrest/schema/<con:co...
[ "the order of the other elements. def move_zeros(array): #your code here new_array =", "= 0 while len(array) > 0: item = array.pop(0) if item == 0", "of the zeros to the end, preserving the order of the other elements.", "preserving the order of the other elements. def move_zeros(array): #your code here new_a...
[ "child_tag_name='InstdAmt', child_attrs=[('Ccy', ctransfer.currency)], child_value=transaction.get_amount()) transaction_information['charge_bearer'] = construct_tag_data('ChrgBr', value='SLEV') if ctransfer.debtor.use_ultimate: transaction_information['ultimate_debtor'] = add_simple_child(data=construct_tag_data('...
[ "D.E: [3,1.5], D.SW: [0.5,2.5], D.S: [1.5,3], D.SE: [2.5,2.5], } selector_size = 100 window_size", "SW W NW') selector_map = { D.NW: [0.5,0.5], D.N: [1.5,0], D.NE: [2.5,0.5], D.W:", "= partial (say,'north') window.actions[D.NE] = partial (say,'neorthest') window.actions[D.W] = partial (say,'western') window.act...
[ "rides_taken = serializers.IntegerField() rides_offered = serializers.IntegerField() members_limit = serializers.IntegerField() class CreateCircleSerializer(serializers.Serializer): name =", "rides_offered = serializers.IntegerField() members_limit = serializers.IntegerField() class CreateCircleSerializer(seriali...
[]
[ "libs.attack import report_video_attack from multiprocessing import Process from colorama import Fore, Back, Style", "print() i = i + 1 def profile_attack(proxies): username = ask_question(\"Enter the username", "path from libs.logo import print_logo from libs.utils import print_success from libs.utils import p...
[ "hamiltonian.two_body_tensor) simulation_circuit = cirq.Circuit( simulate_trotter( qubits, half_way_hamiltonian, time=ansatz.adiabatic_evolution_time, n_steps=1, order=order, algorithm=trotter_algorithm) ) final_state", "KIND, either express or implied. # See the License for the specific language", "Unless requ...
[ "dialog box\"\"\" QMessageBox.critical(self, _(\"Array editor\"), message) self.setAttribute(Qt.WA_DeleteOnClose) self.reject() @Slot() def reject(self): \"\"\"Reimplement Qt", "row_min, row_max, col_min, col_max = get_idx_rect(cell_range) if col_min == 0 and col_max ==", "for details) \"\"\" NumPy Array Editor...
[ "None: pattern = self.default_pattern() name = alias + \"-\" + pattern resp =", "resp assert resp[name][\"aliases\"][alias][\"is_write_index\"] == True def assert_policy_not_created(self, policy): with pytest.raises(NotFoundError): self._client.transport.perform_request('GET', '/_ilm/policy/' +", "def delete_in...
[ "width of 0 means to make the line as small as possible while", "drawn, set **edge_color** to transparent; don't try to do this by setting **edge_width**", "the polygon. edge_style = LineStyle # The color of the face of the", "values as edge_color_, and its alpha value is the # alpha value of", "Private 'Ba...
[ "import timedelta basedir = os.path.abspath(os.path.dirname(__file__)) API_DATA_URL = \"https://invest-public-api.tinkoff.ru/rest/tinkoff.public.invest.api.contract.v1.InstrumentsService/\" API_LASTPRICES_URL = \"https://invest-public-api.tinkoff.ru/rest/\\ tinkoff.public.invest.api.contract.v1.MarketDataService/Ge...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "families from the alignments \"\"\" logger.debug(\"Compute gene families\") # Compute scores for each", "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", "family Copyright (c) 20...
[ "int(input('Enter second number: ')) q.put(num1) q.put(num2) def add_num(q): for i in range(0,3): num1", "[] results2 = [] def take_numbers(q): print('Enter the numbers:') for i in range(0,3):", "= [] def take_numbers(q): print('Enter the numbers:') for i in range(0,3): num1 =", "for i in range(0,3): num1 = i...
[ "链接:https://leetcode-cn.com/problems/unique-paths ''' class Solution: def uniquePaths(self, m: int, n: int) -> int: dp", "来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/unique-paths ''' class Solution: def uniquePaths(self, m: int, n: int) -> int:", "向右 -> 向右 -> 向下 2. 向右 -> 向下 -> 向右 3. 向下", "= 3 输出: 28 来...
[ "to use all available cores). \"\"\" url = \"https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/gdb9.tar.gz\" def __init__(self, amount=None, n_jobs=1,", "mol in tqdm(data, ncols=80) ) x_list, a_list, e_list = list(zip(*data)) # Load labels", "delayed from tensorflow.keras.utils import get_file from tqdm ...
[ "R + abs(int(x)) if y: G = G + abs(int(y)) if z: B", "axis acceleration, prints the values, and turns on # red, green and blue,", "related to the x, y and z values. while True: if cpx.switch: print(\"Slide", "y: G = G + abs(int(y)) if z: B = B + abs(int(z))", "G = 0 B = 0 x, y, z = cpx.acceleration print((x...
[ "= str(i) ax = fig.add_subplot(111, aspect='equal') ax.add_patch( patches.Rectangle( (current_case_data[i,2]-2.0, current_case_data[i,4]-0.9), # (x,y) 4.0,", "= [[-584,-805],[-445,-805]] y = [[-610,-618],[-610,-622]] for l in range(len(x)): ax.plot(x[l], y[l], color='k',linewidth=1) ax.set_xlim(-680,", "c='b', ...
[ "equityClass == EquityClass.ASSET: equityType = self.uns.request_enum(AssetType) elif equityClass == EquityClass.LIABILITY: equityType = self.uns.request_enum(LiabiltyType)", "as plot class EquityManager(): def __init__(self, user_notification_system: FinanceCliInteraction): self.uns = user_notification_system de...
[ "api_key), Detector()) # deploy the interceptor from SnapSearch.wsgi import InterceptorMiddleware application = InterceptorMiddleware(application,", "os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"hello_world.settings\") # django WSGI application from django.core.wsgi import get_wsgi_application application ...
[ "opts.split(','): optname, optval = opt.split('=') if optname == 'owner': try: uid = pwd.getpwnam(optval).pw_uid", "'r') as slfile: slist = slfile.read() entries = slist.split('\\n') for ent in entries:", "KIND, either express or implied. # See the License for the specific language", "deployinfo = deployinfo....
[ "and (control) input x, y, V, gamma, = state.ravel() a = control #", "V*np.cos(gamma) dydt = V*np.sin(gamma) dVdt = (T - D)/m - self.g*np.sin(gamma) dgammadt =", "= 135 - 14.53*t T = 33000 elif t < self.t2: m =", "self.t1: m = 135 - 14.53*t T = 33000 elif t < self.t2:", "113.205 - 3.331*t T = 7500 else: m =...
[ "= int(opts.training_density * len(full_data)) train_set, holdout_set = torch.utils.data.random_split(full_data, [len_train, len(full_data) - len_train] )", "label[i + j] = 1.0 data.append(inp) labels.append(label) data_tuples = [(data[i], labels[i]) for i", "get_dataloaders(opts) -> Tuple[Iterable[ Tuple[torch...
[ "b in enumerate(reversed(S), 1): if b > a: F = list(S) F[-i], F[-j]", "i, a in enumerate(reversed(S[:-1]), 2): if a < b: # we have the", "F = F[: -i + 1] + sorted(F[-i + 1 :]) return \"\".join(F)", "F[-i], F[-j] = F[-j], F[-i] F = F[: -i + 1] + sorted(F[-i", "a < b: # we have the pivot a for j, b in", "-i...
[ "-> int: \"\"\" Type function for argparse - int within some predefined bounds.", "\"\"\" try: s = int(arg) except ValueError: raise ArgumentTypeError(\"must be a int number\")", "cloud_address, cloud_status_ok = await c.cloud_sla_creation_activation() c.set_cloud_sla_address(cloud_address) statuses.append(clou...
[ "generated by Alembic - please adjust! ### op.create_table( \"topics\", sa.Column(\"content\", sa.Text(), nullable=False), sa.Column(\"last_synced_at\",", "14:20:10.044131 \"\"\" from alembic import op import sqlalchemy as sa import bot #", "Alembic - please adjust! ### op.create_table( \"topics\", sa.Column(\"...
[ "To simplify imports in test code _w_long = _bootstrap._w_long _r_long = _bootstrap._r_long #", "packages implicitly imported. You will most likely need to explicitly import all parent", "_bootstrap._gcd_import(name[level:], package, level) #need at least one import hook for importlib stuff to", "None is retu...
[ "given bytestring into an image object. Parameters ---------- bytestring: The bytestring to decode.", "height=256), foreground='#0f0', image=img) circle.x0, circle.y0 = 0.5, -0.25 img = image.fill(circle(width=512, height=256), foreground='blue',", "arlunio.image as image >>> img = image.new((8, 8), color='red'...
[ "supported, to check error message def test_yamlable_not_supported(): @yaml_info(yaml_tag_ns='yaml.tests') class Foo_Err(YamlAble): # __yaml_tag_suffix__ =", "classes (StringIO is one) StringIO.close(self) s = MemorizingStringIO() f.dump_yaml(s, default_flow_style=False) assert s.value ==", "= f.dumps_yaml(defa...
[ "session.) @return: the session attribute @rtype: L{Session} or L{None} \"\"\" if self.isSecure(): return", "Check if there is a session cookie, and if not, create it. By", "Failed\" b\"</title></head><body>\" b\"<b>Processing Failed</b></body></html>\" ) self.setResponseCode(http.INTERNAL_SERVER_ERROR) self.se...
[ "import create_bitcoinish_network network = create_bitcoinish_network( symbol=\"DOGE\", network_name=\"Dogecoin\", subnet_name=\"mainnet\", wif_prefix_hex=\"9e\", address_prefix_hex=\"1e\", pay_to_script_prefix_hex=\"16\", bip32_prv_prefix_hex=\"<KEY>\", bip32_pub_prefix_hex=\"<KEY>\")", "from pycoin.networks.bit...
[ "return hamming[n - 1] print(hamming(970)) # hamming(968) should be 41943040 # hamming(969) should", "3) new_hamming.add(i * 5) # merge new number into hamming set hamming =", "new_hamming = {1} for i in hamming: new_hamming.add(i * 2) new_hamming.add(i * 3)", "= hamming.union(new_hamming) hamming = sorted(li...
[ "MergerServicer from examples import configs logging.getLogger(\"kazoo\").setLevel(\"WARN\") def main(): config = configs.LocalDockerConfig() server =", "logging.getLogger(\"kazoo\").setLevel(\"WARN\") def main(): config = configs.LocalDockerConfig() server = factory.create_server(config) manager = factory.create...
[ "def stop(self): self.engine.kill_process() def print_stats(self, stats=None): if stats is None: stats = ['score',", "movetime=movetime) return best_move def search_with_ponder(self, game, board, btime, wtime, binc, winc, byo, ponder=False):", "def name(self): return self.engine.name def report_game_result(self...
[ "Weighted_point_2 from CGAL.CGAL_Alpha_shape_2 import Alpha_shape_2 from CGAL.CGAL_Alpha_shape_2 import Weighted_alpha_shape_2 from CGAL.CGAL_Alpha_shape_2 import Weighted_alpha_shape_2_Face_handle", "1)) lst_wp.append(Weighted_point_2(Point_2(44, 0), 1)) lst_wp.append(Weighted_point_2(Point_2(44, 5), 1)) lst_wp....
[ "18, 2018 @author: riteshagarwal ''' java = False rest = False cli =", "Jan 18, 2018 @author: riteshagarwal ''' java = False rest = False cli", "<reponame>pavithra-mahamani/TAF ''' Created on Jan 18, 2018 @author: riteshagarwal ''' java = False", "''' Created on Jan 18, 2018 @author: riteshagarwal ''' java = ...
[ "def setup(self): self.label_node = scene.LabelNode('A', position=(100,400), parent=self) self.start_flag = False def update(self): if", "class MyScene(scene.Scene): def setup(self): self.label_node = scene.LabelNode('A', position=(100,400), parent=self) self.start_flag = False def", "update(self): if self.star...
[ "from chat' def _callback(self, user, _bot, update, **kwargs): return self._call(user, _bot, update, **kwargs)", "mongo.chats.get_active_chat_by_telegram_id(user.id) if chat: mongo.chats.disable_chat(chat['_id']) return True _bot.send_message( user.id, 'You are not connected to", "True _bot.send_message( user.i...
[ "def __str__(self) -> str: return f'<STDOUT value={self.value} code={self.code} >' def _split_tokens(self) -> List[str]:", "and _quotes(char): in_quotes = char elif in_quotes and in_quotes == char: in_quotes =", "in self.value: if _whitespace(char) and not in_quotes and accumulator: ret.append(''.join(accumulat...
[ "isinstance(protected_object.protection_parent, db.m.Event): parent_type = _('Event') elif isinstance(protected_object.protection_parent, db.m.Category): parent_type = _('Category') else: parent_type", "super(IndicoProtectionField, self).__init__(*args, enum=ProtectionMode, **kwargs) def render_protection_message...
[ "False) c_attributes['SPProvidedID'] = ('sp_provided_id', 'string', False) def __init__(self, name_qualifier=None, sp_name_qualifier=None, format=None, sp_provided_id=None, text=None,", "# clear type #self.clear_type() self.set_text(text) # if we have added a text node", "c_cardinality = ConditionAbstractType_....
[ "info = env.step(action) print(\"episode: \", episode) print(\"timestep: \", t) print(\"obs: \", obs) print(\"action:\",", "import gym import rospy from openai_ros.openai_ros_common import StartOpenAI_ROS_Environment # initialise environment rospy.init_node('turtlebot2_maze_random', anonymous=True,", "import St...
[ "to i,j - top left square i = (i // 3) * 3", "= (i, j) tuple i = position[0] j = position[1] # checks row", "print(\"\") def main(): initialize() print(\"Is this the correct board? Press enter to continue", "range(3, 6): for j in range(9): if board[i][j] == 0: print(\" \", end=\"\")", "print(\"| \", end=\"\...
[ "a: A theano matrix b: A theano vector Returns the matrix-vector product of", "np.random.RandomState([1, 2, 3]) a_value = rng.randn(5).astype(a.dtype) b_value = rng.rand(5).astype(b.dtype) c_value = a_value *", "and b \"\"\" return a * b def matrix_vector_mul(a, b): \"\"\" a: A", "return T.matrix() def elemwi...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "from nova.api.openstack import api_version_request from nova.api.openstack.api_version_request \\ import MIN_WITHOUT_PROXY_API_SUPPORT_VERSION ...
[ "`TFEnvironment`. training_loops: an integer indicating how many training loops should be run. steps_per_loop:", "the given `agent`.\"\"\" buf = tf_uniform_replay_buffer.TFUniformReplayBuffer( data_spec=data_spec, batch_size=batch_size, max_length=steps_per_loop) return buf def set_expected_shape(experience,", ...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "default=180.0, deprecated_group=\"benchmark\", help=\"Timeout for Manila share deletion.\"), cfg.FloatOpt( \"manila_share_delete_poll_interval\...
[ "crud from .utils import insert, get_content def register_invoice(db: Session, url: str): content =", "insert, get_content def register_invoice(db: Session, url: str): content = get_content.get_invoice_info(url) grocery_store_id = insert.insert_grocery_store_info(", "= insert.insert_invoice_info( db, obj_in=con...
[]
[ "= True f.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip() f.briefDoc = self.docparser.parse_description(node.find('./briefdescription')) f.detailedDescription = self.__cleanDescription(node.find('./detaileddescription')) return f", "cclass.properties[propname].getter is not None: se...
[ "an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND,", "import sys from heronpy.streamlet.builder import Builder from heronpy.streamlet.runner import Runner from heronpy.streamlet.config import", "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "express or impl...
[ "= datetime.now(tz=tzutc()) self.assertTrue(utils.is_naive(now)) self.assertFalse(utils.is_naive(utcnow)) fixed = utils.guess_timezone(now) self.assertFalse(utils.is_naive(fixed)) shouldnt_be_edited = utils.guess_timezone(utcnow) self.assertEqual(utcnow, shouldnt_be_edited)", "utils.clean(item) def test_clean_fn(...
[ "tmp[1] + m1[2][r] * tmp[2] + m1[3][r] * tmp[3]) point += 1 def", "0], [1, -2, 1, 0], [1, -1, 0, 0] ] def generate_curve_coefs(p0, p1,", "else: curve = make_bezier() matrix_mult(curve, coefs) return coefs def make_translate(x, y, z): t", "comment def print_matrix(matrix): s = '' for r in range(len(matrix[0]))...
[ "import sleep sys.path.insert(0, '/home/may/Dropbox/Programming/spice/') import spice_api as spice def main(): creds = spice.load_auth_from_file('auth')", "= spice.get_blank(spice.get_medium('anime')) re_zero_data.episodes = 0 re_zero_data.status = spice.get_status('reading') re_zero_data.score = 8 re_zero_data.t...
[ "'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files", "SECURITY WARNING: don't run with debug turned on in production! DEBUG = int(os.environ.get('DEBUG',", "'EXCEPTION_HANDLER': 'apps.common.errors.custom_exception_handler', 'TEST_REQUEST_DEFAULT_FORMAT': 'json', } # ---------------------------...
[ "dir_path += '/cfg.ini' class Configuration(object): def __init__(self,debug=False): section = \"Flask-debug\" if debug else", "\"DEBUG\") self.csrf_enabled = cfg.getboolean(section,\"CSRF_ENABLED\") self.threads_per_page = cfg.getint(section,\"THREADS_PER_PAGE\") self.port = cfg.getint(section,\"PORT\") self.hos...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "= sa.Column(sa.String(36), sa.ForeignKey('networks.id', ondelete=\"CASCADE\"), nullable=False, primary_key=True) network = orm.relationship(mod...
[ "Role(name=\"administrator\"); userRole = Role(name=\"user\"); database.session.add(adminRole); database.session.add(userRole); database.session.commit(); admin = User( jmbg=\"0000000000000\", forename=\"admin\", surname=\"admin\",", "import Configuration; from flask_migrate import Migrate, init, migrate, upgrade...
[ "] model_process_num_list = { 'random_forest_classification': [139, 69, 111, 212, 210, 148, 28, 61,", "'').split(',') test_NEF = float(line[1]) return test_roc, test_precision, test_NEF if __name__ == '__main__': model_list", "807, 263, 694, 440, 47, 116, 792, 663, 32, 564, 950, 735, 84,", "test_roc = float(l...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "_msg_locator(self, level): return (by.By.CSS_SELECTOR, 'div.alert.%s' % level) def __init__(self, driver, conf, level=SUCCESS): self._default_s...
[ "'array_size': 10000, 'streaming': True, 'record_state':False, 'nstep_record':1, 'window_size':(1200,1000), 'invert_order_obs_var': True,'theme':'dark'} # Definition of the", "np.complex128, 'init_cond': 0., 'plot': False, 'dock':['plot1','plot2'], 'help':'field in the first cavity'}, 'B' :", "0.001, 'plot': Fa...
[ "np.arange(0.1,1,0.2): o2_lim_arr=np.append(o2_lim_arr,[[ulim_Tpro,ulim_Tneg]],axis=0) def solve_parm(u_lim_o2): #calls the solve_eq function with all default inputs other", "import * y0=np.array([y0_Tpos,y0_Tpro,y0_Tneg,y0_o2,y0_test]) p=np.array([p_o2,p_test]) mu=np.array([[mu_o2Tpos,mu_o2Tpro,mu_o2Tneg],[mu_te...
[ "- initial_time, anchor.group(1), anchor.group(2)]) # 获取数据序号、设备号、测量值 device = list(map(int, device)) measure.append(device) # 一个measure就是四个设备拿到的四份数据", "# Measures是三维数组是获取的所有测量数据 normalized_device_data = [] normalized_device_data_x = [] device_data = [] device_data_x =", "P[0] = 1.0 A = 1 H = 1 for k in range(1,...
[ ".analyzer import ProgpilotAnalyzer from .issues_data import issues_data analyzers = { 'phpanlyzer' : {", "issues_data analyzers = { 'phpanlyzer' : { 'name' : 'phpanalyzer', 'title' : 'phpanalyzer',", "<reponame>marcinguy/checkmate-ce<gh_stars>0 from .analyzer import ProgpilotAnalyzer from .issues_data import i...
[ "for section in depend_files: latex_text = latex_text + \"\\n\\\\input{\"+ section + \"}\" #prepend", "file_bbl = object_name + \".bbl\" if not os.path.isfile(file_bbl): return \"\" with open(file_bbl, 'r')", "return [] files = os.listdir(name) sections = [] for section in files: if", "remove_tmp(texname + \"...
[ "baud rate: %r' % self._baudrate) else: if custom_baud < 0: raise ValueError('Invalid baud", "2500000: 0o010014, 3000000: 0o010015, 3500000: 0o010016, 4000000: 0o010017 } elif plat == 'cygwin':", "becomes ready to read (or something fails) for fd, event in poll.poll(self._timeout*1000): if", "self.fd = None r...
[ "<reponame>electricimp/examples import datetime from database import Base from sqlalchemy import Column, String, Integer,", "\"\"\" return False def is_active(self): \"\"\" Callback for Flask-Login. Default to True -", "ID of a given user object. It is unicoded as per specification. Returns:", "first_name = C...
[ "model = Sequential() # 128 x 48 model.add(GaussianNoise(0.05, input_shape=input_shape)) model.add(Conv2D(32, (3, 3), activation='relu',", "training examples is below this, load more data batch_size = 16 categories =", "128 x 48 model.add(GaussianNoise(0.05, input_shape=input_shape)) model.add(Conv2D(32, (3, 3)...
[ "Uhrzeit, Stunde, Minute, Sekunde from Kronos_heureka_code.Zeit.Datum.Monat import Monate from Kronos_heureka_code.Zeit.Datum.Jahr import Jahr, Zeitrechnung", "Sekunde from Kronos_heureka_code.Zeit.Datum.Monat import Monate from Kronos_heureka_code.Zeit.Datum.Jahr import Jahr, Zeitrechnung from Kronos_heureka_cod...
[ "import logging def setup_logger(fname=None, silent=False): if fname is None: logging.basicConfig( level=logging.INFO if not", "format='%(name)-12s: %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M', filemode='w' ) else: logging.basicConfig( level=logging.INFO if not silent", "logging.CRITICAL, format='%(name...
[ "elif command == 'email': return_results(generic_reputation_command(args, 'email', 'EMAIL', malicious_tag_ids, suspicious_tag_ids, reliability, attributes_limit)) elif command", "'Orgc': 'OwnerOrganization', 'orgc_uuid': 'OwnerOrganization.UUID', 'orgc_id': 'OwnerOrganization.ID', 'orgc_name': 'OwnerOrganization....
[ "key=None): url = url or settings.REDMINE_BASE_URL key = key or settings.REDMINE_API_KEY super().__init__(url=url, key=key)", "__init__(self, url=None, key=None): url = url or settings.REDMINE_BASE_URL key = key or settings.REDMINE_API_KEY", "from redminelib import Redmine as DefaultRedmine from .validator impo...
[ "Let's turn it into a bool df['python_main'] = df['python_main'] == 'Yes' #%% Plot", "df['webdev_science_ratio_self'] \\ .replace(CONVERSION.keys(), CONVERSION.values()) others_numeric = df['webdev_science_ratio_others'] \\ .replace(CONVERSION.keys(), CONVERSION.values()) print(f'Self:\\t\\t{self_numeric.mean().r...
[ "p = len(gt_sorted) gts = gt_sorted.sum() intersection = gts - gt_sorted.float().cumsum(0) union =", "loss_mask = mask_losses.mean() losses[\"loss_mask\"] = loss_mask * self.mask_loss_alpha return losses else: if len(pred_instances)", "loss = 1. - (2 * intersection / union) return loss def lovasz_grad(gt_sorted...
[ "except local.LocalExecutionFailed: msg = (\"iscsiadm is not available on the local host. Please", "and '%s'\", src_host, dst_host) rr = remote_runner.RemoteRunner(src_host, src_user) ssh_opts = ('-o UserKnownHostsFile=/dev/null '", "KIND, either express or implied. # See the License for the specific language",...
[ "number: endpoint = 'stop' kwargs['stopid'] = number else: endpoint = 'stoplist' return self.get(endpoint,", "the data.\"\"\" if 'format' not in kwargs: kwargs['format'] = self.format url = \"http://ebongo.org/api/%s\"", "= 'routelist' return self.get(endpoint, **kwargs) def routes(self): \"\"\" Same as an empt...
[ "thread_num_mutex = threading.Lock() # Utility function def print_status() -> None: global thread_num thread_num_mutex.acquire(True)", "threading.Lock() # Utility function def print_status() -> None: global thread_num thread_num_mutex.acquire(True) thread_num +=", "Utility function def print_status() -> None: g...