ngram
listlengths
0
67.8k
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "Return the rounded values of a tensor. \"\"\" error = tf.stop_gradient(tf.math.round(x) - x)", "tensor. \"\"\" error = tf.stop_gradient(tf.math....
[ "\"\"\"Mark everything from ``start`` to the end of the line as Error.\"\"\" end", "text[start] in self.LOGIC self.cur.append((start, Operator, text[start])) start = self.formula(start+1, text) assert text[start] ==", "None groups = sorted(match.regs[1:]) # exclude whole match for group in groups: if", "numbe...
[ "django.urls import path from contacts.views import ( ContactsListView, CreateContactView, ContactDetailView, UpdateContactView, RemoveContactView, GetContactsView,", "AddCommentView.as_view(), name=\"add_comment\"), path('comment/edit/', UpdateCommentView.as_view(), name=\"edit_comment\"), path('comment/remove/'...
[ "@property def remote_addr(self): \"\"\"remote address IP :type: :class:`str`\"\"\" if not self.established: return None", "\"\"\"Local address IP :type: :class:`str`\"\"\" return self._str_ipv6_addr(self.ucLocalAddr) @property def remote_addr(self): \"\"\"remote address IP", "gdef.BSTR() self.get_Name(name) re...
[ "if minArgs is not None and minArgs <= len(newArgs) + len(newKwArgs): return func(*newArgs,", "100): print(a, b, c, d, e, f, g) # NOTE: '<====' means \"this", "6 -1\" print(\"\\n------\\n\") # Example 4. def printTree(func, level = None): if level", "# again, () forces the evaluation # it prints \"1 2 3 4", ...
[ "data is temporarily stored in plaintext while the server handles message broadcasting Now", "of server software written by <NAME> to allow people to talk to eachother", "a raw TCP socket and data is temporarily stored in plaintext while the", "not follow it. All data is sent to and from this server over", ...
[ "\"wj\": \"저\", \"wh\": \"조\", \"wn\": \"주\", \"ak\": \"마\", \"aj\": \"머\", \"ah\": \"모\", \"an\":", "cv2.waitKey(0) == 27: # break #cv2.destroyAllWindows() end = time.time() total_time = (end -", ": (1, 32, 42) out_best = list(np.argmax(out[0, 2:], axis=1)) # get max index", "[k for k, g in itertools.groupby...
[ "dtype, scope=None, device=\"\"): \"\"\" Convert 1dim numpy array to a torcharrow column (zero", "pa.types.is_null(t): return dt.Void() if pa.types.is_string(t): return dt.String(nullable) if pa.types.is_map(t): return dt.Map(t.item_type, t.key_type, nullable)", "pa.types.is_int8(t): return dt.Int8(nullable) if...
[ "written to.') flags.DEFINE_string('eval_dir', '/tmp/compression/', 'Directory where the results are saved to.') flags.DEFINE_integer('max_number_of_evaluations', None,", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, s...
[ "= \"\" for i in range(len(row_values) - 1): if row_values[i] is not None:", "= <PASSWORD>, database = \"metrics\" #\"datacamp\" ) cursor = db_connection.cursor() query = \"use", "os.environ['QUERY_ON'] def dump_query_results(): \"\"\" This is a simple SQL table dump of a", "the query/results. Otherwise it is...
[ "desktop_local_tests.windows.windows_dns_force_public_dns_servers_disrupter import WindowsDNSForcePublicDNSServersDisrupter class TestWindowsPacketCaptureDisruptForcePublicDNSServers(LocalPacketCaptureTestCaseWithDisrupter): # TODO: Make the packet capture here DNS", "class TestWindowsPacketCaptureDisruptForcePub...
[ "default loading image for using a such loader:: from kivy import * image", "and pass to the client''' # want to start it ? if self._start_wanted:", "ImageLoader.load(filename=image) else: self._error_image = image error_image = property(_get_error_image, _set_error_image) '''Image used for error.", "OSError:...
[ "So, the Output needs to be a bit clearer. friends = ['Pythobit','boy','Pythoman'] friend", "friends are {friend}') # Output - My friends are Pythobit, boy, Pythoman #", "are {friend}') # Output - My friends are Pythobit, boy, Pythoman # Here", "# 13. Join # it allows to print list a bit better friends", "[...
[ "if set, mobile builds are built with 'ant'. requires the Android SDK and", "SDK and appropriate mobile/local.properties file configured # preBuild - optional - an array", "name of the default build to use if none is specified on the", "URL base for external resources (all resources embedded in standard IITC)...
[ "except: pass return self.upload(path, dest) print(\"As Dir\") try: self.sftp.mkdir(rpath) except IOError: pass for", "path to upload to \"\"\" self.sftp.put(path, rpath) return True def get(self, url, path):", "scheme: @param host - may be None, host to connect to implementor must", "- may be None, password ...
[ "// RENDER_RATIO, 120 // RENDER_RATIO)) self.rect = self.surf.get_rect() self.surf2 = pygame.Surface((30 // RENDER_RATIO,", "RENDER_RATIO)) self.rect2 = self.surf2.get_rect() self.surf3 = pygame.Surface((30 // RENDER_RATIO, 40 // RENDER_RATIO)) self.rect3", "0: b_rect.top = self.rect4.bottom b_speed[1] = -b_spe...
[ "states): self.all_states = states self.train_set = None self.validation_set = None self.test_set = None", "self.test_set = [s for s in all_states if s.state_id in test_ids] def shuffle_train_set(self):", "for s in all_states])) random.shuffle(unique_state_ids) train_ids = set(unique_state_ids[0:int(0.6 * len(u...
[ "colorspace to use for l2, ssim model types\", ) parser.add_argument( \"--batch_size\", type=int, default=50,", "to use GPU\") parser.add_argument( \"--model_path\", type=str, default=None, help=\"location of model, will default to", "for linearly calibrated net, [net] for off-the-shelf network, [l2] for euclid...
[ "= np.std(data_first, axis=0) / 2. y_second_err = np.std(data_second, axis=0) / 2. plt.fill_between(x, y_first", "y_second, color='g', label='Task B (transfer learning)') plt.legend(bbox_to_anchor=(0.8, 0.3), loc=2, ncol=1, fontsize=15) axes =", "numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot...
[ "key, value in model.named_parameters(): if not value.requires_grad: continue param_lr = base_lr param_weight_decay =", "not value.requires_grad: continue param_lr = base_lr param_weight_decay = weight_decay if \"bias\" in key:", "= base_lr param_weight_decay = weight_decay if \"bias\" in key: param_lr = base_l...
[ "= Swap(1.0).mutate(solution) self.assertEqual(result.variables[0][0], 1) self.assertEqual(result.variables[0][1], 0) def test_swap2b(self): problem = Problem(1, 0) problem.types[0]", "Python module for designing and using # evolutionary algorithms (EAs) and multiobjective evolutionary", "distributed in the hop...
[ "h + 2 * e, h + 2 * e, ..., h +", "[0., 1., 2.], [0., 1., 2.], [0., 1., 2.], [0., 1., 2.]], dtype=float32)", "# handle both texture border types _edge_size = 0 # 如果包围方式是border, 那么边界长度是1, 在h和w维两侧加一排0", "tf.variable_scope(name): ''' [num_batch, height, width, num_channels] ''' _num_batch = tf.shape(input_images...
[ "spectral data in JSON format from OSN z (float) - redshift of SN", "import matplotlib.pyplot as plt from astropy.io import ascii import json from IPython.display import", "lightcurve_object): if lightcurve_object in self.lightcurves: print('already exists') else: self.lightcurves.append(lightcurve_object) #def...
[ "from userbot import ALIVE_NAME from userbot.utils import admin_cmd DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME", "userbot.utils import admin_cmd DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else \"No name set yet", "\"➖➖➖➖➖➖➖➖➖\\n\" \"`.fuk` فاكيو\\n\" \"➖➖➖➖➖➖➖➖➖\\n\" \"`.get_id` ايدي اي شخص دزه بمحادثته\\n\" ...
[ "PNG bytes\"\"\" s = self.device_session_factory().exec_stream('screencap -p') data = recvall(s, 4194304) return data def", "= self.device_session_factory().exec_stream('(echo -n %s; screencap) | nc %s %d' % (future.cookie.decode(), self.loopback, self.rch.port))", "def __adb_device_name_detector(self): devices...
[ "is None: self.new_dir = Path(inspect.getabsfile(inspect.stack()[1][0])).parent # type: ignore else: self.new_dir = directory def", "of the file from which this function was called. \"\"\" def __init__(self, directory:", "change_directory: \"\"\" A class for changing the working directory using a \"with\" state...
[ "gui import MgallManager def main(): app = QApplication(sys.argv) ex = MgallManager() app.aboutToQuit.connect(ex.ExitHandler) sys.exit(app.exec_())", "sys from PyQt5.QtWidgets import QApplication from gui import MgallManager def main(): app =", "from gui import MgallManager def main(): app = QApplication(sys.ar...
[ "return hash((self.x,self.y,self.z)) def __repr__(self): return f'({self.x},{self.y},{self.z})' def __add__(self,value): return Point3D(self.x + value.x, self.y", "= z ''' Returns the distance between two 3D points ''' def distance(self,", "x self.y = y self.z = z ''' Returns the distance between two", "= y s...
[ "can go in a set(). return self.id def __str__(self): return self.str() def str(self,", "864, 3700), Function.ability(421, \"Research_TerranVehicleAndShipPlatingLevel2_quick\", cmd_quick, 865, 3700), Function.ability(422, \"Research_TerranVehicleAndShipPlatingLevel3_quick\", cmd_quick, 866, 3700), Function.abilit...
[ "does not match' assert np.all(np.add(np.equal(target, 1), np.equal(target, 0))), \\ 'targets should be binary", "/= ((self.targets - 1.0).sum() * -1.0) # calculating area under curve using trapezoidal", "be higher when the model is more convinced that the example should be", "and a randomly selected negative...
[ "@property def current_x(self) -> int | None: \"\"\"Return cached value of the current_x", "suppress(KeyError): return self.cluster[\"color_capabilities\"] if self.cluster.get(\"color_temperature\") is not None: return self.CAPABILITIES_COLOR_XY | self.CAPABILITIES_COLOR_TEMP return", "\"\"\"Return cached value...
[ "if self.qlimit: s += \" qlimit {.qlimit}\".format(self) return s class PFQueueStats(PFObject): \"\"\" \"\"\"", "q.parent_qid = self.parent_qid q.realtime = self.realtime._to_struct() q.linkshare = self.linkshare._to_struct() q.upperlimit = self.upperlimit._to_struct() q.flowqueue", "\"\"\" _struct_type = pf._s...
[ "# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK", ".environment_setting import * from .gallery_image import * from .get_environment import * from .get_environment_setting", "typ == \"azure-native:labservices/v20181015:GalleryImage\": return GalleryImage(name, pulumi.ResourceOptions(urn=...
[ "patch.object(schema_reader, 'validate_object') # @UndefinedVariable self.patcher_schema = patch.object(schema_reader, # @UndefinedVariable 'get_schema_fields', mock_schema_instance) self.patcher_schema.start() self.patcher_validate.start()", "UserCollectionSerializer(data={'username': 'user', 'password': '<PASSW...
[ "user and self.model.check_password(user, data['password']): expires = timedelta(days=365) user = UserSchema(only=('id', 'email', 'is_admin')).dump(user).data return", "data = request.json if not data: return make_response(jsonify({'error': 'No data'}), 400) user =", "class UserLoginResource(Resource): model = ...
[ "\"rank\" FROM querybuilder_tests_order' self.assertEqual(query_str, expected_query, get_comparison_str(query_str, expected_query)) def test_rank_over_order(self): query = Query().from_table( table=Order,", "(ORDER BY margin DESC) AS \"dense_rank\" ' 'FROM querybuilder_tests_order ' 'ORDER BY dense_rank", "test...
[ "import numpy h = .25 s = 1 bitmap = numpy.array([ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],", "<reponame>wbprice/ojimoji import numpy h = .25 s = 1 bitmap = numpy.array([ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],", "= 1 bitmap = numpy.array([ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0...
[ "parser=argparse.ArgumentParser() parser.add_argument(\"--end\",type=float,default=100000.,help='end ratio') parser.add_argument(\"--save\",type=str,default=\"test_\",help='save name') parser.add_argument(\"--network\",type=str,default=\"rnn\",help='network name on symbols/') parser.add_argument(\"--right\",type=st...
[ "position # action constant HOLD = 0 BUY = 1 SELL = 2", "0 self.reward = 0 self.portfolio = 0 self.shares_held = 0 self.cost_basis = 0", "+ temp_reward) elif (self.position == SHORT): temp_reward = ((self.entry_price - self.close_price) / self.close_price", "round(new_portfolio,2) def step(self, action): # Ex...
[ "JSON heatmaps...\") # compute_json_heatmaps(state_ids) print(\"Aggregating JSON files into one...\") aggegrate_json_files(state_ids) end = time.time()", "geojson = json.load(f) with open(\"public/data/pop.json\", \"a\") as f: f.write(json.dumps(geojson[\"features\"])[1:-1] + (\",\" if state_id", "+ 2 : file.in...
[ "import os, glob import numpy as np from sklearn import model_selection classes =", "y_train, y_test = model_selection.train_test_split(X, Y) xy = (X_train, X_test, y_train, y_test) np.save(\"./vehicle.npy\", xy)", "sklearn import model_selection classes = [\"car\", \"bycycle\", \"motorcycle\", \"pedestrian\"] ...
[ "waypoint_scenarios, quest_scenarios from services.build_campaign import Campaign from log_setup import log if __name__ ==", "= quest_scenarios.get_number_of_quest_scenarios() log.info(f\"We have {number_quests_available} quests available\") random_waypoint_scenario = waypoint_scenarios.get_random_scenario(10) ra...
[ "\"has_prefix\") print(info_dir) assert os.path.isfile(has_prefix_file) with open(has_prefix_file) as f: assert \"test2\" not in f.read()", "= os.path.join(os.environ[\"ROOT\"], \"pkgs\") info_dir = os.path.join(pkgs, \"conda-build-test-ignore-some-prefix-files-1.0-0\", \"info\") has_prefix_file = os.path.join(in...
[ "loss = alpha * loss_f + (1 - alpha) * loss_kv #print(loss_f.item(), loss_kv.item())", "ConfigBinaryClassificationDistill from config import ConfigTripleClassification if __name__ == \"__main__\": args = get_args() print_args(args)", "vocab from args import get_args, print_args from config import ConfigBinaryCl...
[ "# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN", "iso-8859-1 -*- # Copyright (c) 2016, <NAME> <<EMAIL>> # All rights reserved. #", "this list of conditions and the following disclaimer. # 2. Redistributions in binary", "ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LI...
[ "downsample(infile: Path, outfile: Path, size: int, random): targets: List[FASTAItem] = list(read_fasta(infile)) if size", "than the number of targets.\") targets = random.choice(targets, size, replace=False).tolist() with FASTAWriter(outfile) as", "List[FASTAItem] = list(read_fasta(infile)) if size > len(targe...
[ "= \"<KEY>\" # yahoo finance api key TICKER = \"TSLA\" INTERVAL = \"1m\"", "LOOK_BACK = 30 # hard limit to not reach rate limit of 100", "# API keys # YF_API_KEY = \"<KEY>\" # yahoo finance api key TICKER", "API keys # YF_API_KEY = \"<KEY>\" # yahoo finance api key TICKER =", "key TICKER = \"TSLA\" INTERVAL...
[ "invoker_cmd_log, invoker_cmd_merge, invoker_cmd_pull_image, invoker_cmd_repo_check, invoker_cmd_repo_clear, invoker_cmd_sampling, invoker_cmd_terminate, invoker_cmd_user_create, invoker_task_factory, ) from proto import", "invoker_cmd_pull_image, invoker_cmd_repo_check, invoker_cmd_repo_clear, invoker_cmd_sampli...
[ "timedelta due_date_format = '%Y-%m-%d' datepicker_date_format = '%m%d%Y' def current_date(): return datetime.utcnow().strftime(due_date_format) def datepicker_current_date():", "return datetime.utcnow().strftime(datepicker_date_format) def _date_from_today(days_to_add): return datetime.utcnow() + timedelta(days=...
[ "import guvectorize import unittest def ufunc_add_core(a, b, c): for i in range(c.size): c[i]", "in range(inp.shape[0]): np.testing.assert_equal(inp[i].sum(), out[i]) def test_gufunc_scalar_input_saxpy(self): def axpy(a, x, y, out): for i", "= saxpy(A, X, Y) for j in range(10): exp = A * X[j]", "range(c.size)...
[ "def database_entry(data): try: load_dotenv() mongo_string = os.getenv('MONGODB_AUTH_URI') client = MongoClient(mongo_string) database = client[os.getenv('MONGODB_DB')]", "import os from pymongo import MongoClient from dotenv import load_dotenv def database_entry(data): try:", "os from pymongo import MongoClien...
[ "try: with open(FILE, encoding='utf-8') as file: content = file.readlines() except FileNotFoundError: print('File does", "except FileNotFoundError: print('File does not exist') except PermissionError: print('Permission denied') for line in", "record['ip'] == ip: record['hostnames'].update(hosts) break else: hos...
[ "dictionary , The headers of the request. Returns ------- n_sub : int, default=0", "for top challengers. headers : dictionary , The headers of the request. Returns", "we can make per day for the selected challenge. Parameters ---------- url :", "): \"\"\"Get the number of submissions we can make per day for t...
[ "-*- coding: utf-8 -*- import unittest from src.graph import Graph from src.maximum_cut import", "('a', 'c'), ('d', 'e'), ('f', 'e'), ('f', 'g')], directed=False) (left, right) = maximum_cut_for_bipartite_graph(g)", "graph. (u)-3-(v) | \\ / | | 5\\/1 4 2 /\\ | |", "4') self.assertIn(len(right), [3,4], 'eighte...
[ "print('rb magic: %s' % ((intptr_ptr + self.rb_magic_offset).cast(self.int_type.pointer()).dereference())) print('tree magic: %s' % ((intptr_ptr +", "KIND, either express or implied. # See the License for the specific language", "expr) return if ptr == 0: print('(null)') else: intptr_ptr = ptr.cast(self.intptr_...
[ "= \"function (obj) { \" + \\ \"obj.total = obj.vowels + obj.cons; \"", "\"with totals:\") displayGroup(results) if __name__==\"__main__\": mongo = MongoClient('mongodb://localhost:27017/') db = mongo['words'] collection =", "if __name__==\"__main__\": mongo = MongoClient('mongodb://localhost:27017/') db = mong...
[ "if key in combine: for sub_key, sub_val in output[key].items(): assert sub_key not in", "5: assert batch['rgb'].shape[0] == 1, 'Only batch size 1 is supported for multi-cameras'", "'logits_semantic', 'ord_probability', 'inv_depths', 'inv_depths_context', 'inv_depths1', 'inv_depths2', 'pred_depth', 'pred_depth_...
[ "t5 = dt ** 5 c1 = (6.*dist + (a1 - a0) /", "** 2 v1 = 0 v0 = xd * tau t1 = dt", "* t3 + c4 * t2 + c5 * t1 + c6 xd", "c1 * t5 + c2 * t4 + c3 * t3 + c4", "end of traj reached!\" dist = goal - x a1 = 0 a0", "2 v1 = 0 v0 = xd * tau t1 = dt t2", "+ c4 * t2 + c5 * t1 + c6 xd = 5.*c1", "c4 * t1 + c5 xdd = 2...
[]
[ "if exon_id == exon: test = translate(exon, human_fasta) break break true = 'MAEDADMRNELEEMQRRADQLADE'", "# assert test == true # def test_make_sequence_array(finalsequencedf): # from orthoexon.util import make_sequence_array", "test = separate(exon_id) true = \"ENSE00001229068\" assert test == true @pytest.fix...
[ "= 0 feature = predict(path) for i, person_f in enumerate(person_feature): # 计算相识度 dist", "audios = os.listdir(audio_db_path) for audio in audios: path = os.path.join(audio_db_path, audio) name =", "from utils.record import RecordAudio parser = argparse.ArgumentParser() parser.add_argument('--audio_db', default...
[ "loop products :) return Response( \"\\n\".join(t.name for t in _model.STORE.all_dataset_types()), content_type=\"text/plain\", ) @bp.route(\"/metadata-types.txt\")", "f\"Metadata Type {type_.name}\", include_source_url=url_for( \".raw_metadata_type_doc\", name=type_.name, _external=True ), ) for type_ in _model....
[ "Copyright (c) 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause # Board diagram/pinout: # https://user-images.githubusercontent.com/1450143/133655492-532d5e9a-0635-4889-85c9-68683d06cae0.png", "Pins(\"35\"), IOStandard(\"LVCMOS33\")), # Leds (\"user_led\", 0, Pins(\"16\"), IOStandard(\"LVCMOS33\")), ...
[ "search step_size = 1.0 for _ in range(ls_max_steps): vector_to_parameters(old_params - step_size * step,", "+ 1): # lower learning rate after first update (for MAML, as described", "<NAME>, <NAME>, \"Trust Region Policy Optimization\", 2015 (https://arxiv.org/abs/1502.05477) \"\"\" def __init__(self, sampler, ...
[ "plural duration_plural = '{0}s'.format(duration) else: duration_plural = duration if duration_plural not in DURATION_OPTIONS:", "{2} requests. Are you sure you want to do this? Type 'yes' to", "return if options.get('interactive'): confirm = input(''' You have requested a database reset. This", "not in DURAT...
[ "assert message_to_sign in signed_blob decoded_blob = windows.crypto.verify_signature(cert, signed_blob) assert decoded_blob == message_to_sign def", "do something else (bytes in generated ctypes ?) # This is fucking dumb,", "= \"<PASSWORD>\" TEST_PFX = b\"\"\" <KEY> \"\"\" @pytest.fixture() def rawcert(): retu...
[ "= self.graph_min_slider callback.args[\"high_slider\"] = self.graph_max_slider #ax.set_xlabel('RA') #ax.set_ylabel('DEC') #ax.grid(True, color='white') #fig.colorbar(im, ax=ax) #plugins.connect(fig, plugins.MousePosition(fontsize=14))", "[] for px, py, err in zip(x, y, yerr): y_err_x.append((px, px)) y_err_y.app...
[ "dir1 / 'file1.yml' file1.touch() file2 = dir1 / 'file2.yml' file2.touch() file3 = dir2", "/ 'file2.yml' file2.touch() file3 = dir2 / 'file3.yml' file3.touch() my_pathlist = [Path(file3), Path(file1),", "None def test_testaid_unit_pathlist_roles_whitelist(testvars_roles_whitelist): assert testvars_roles_whiteli...
[ "= repr_str.replace('\\n', '\\\\n') # We check just the begin of the string: assert", "Unless required by applicable law or agreed to in writing, software # distributed", "PORT11_OID, 'parent': self.faked_fcp1.uri, 'class': 'storage-port', 'index': 1, 'name': 'fake-port11-name', 'description': 'FCP #1 Port", ...
[ "tests on Windows for now. # Override the parent directory's \"unsupported\" decision until", "only run a small set of tests on Windows for now. # Override", "directory's \"unsupported\" decision until we can handle # all of its tests. if", "a small set of tests on Windows for now. # Override the parent", "...
[ "sys.stderr = sys.__stderr__ orig_unraisablehook(unraisable) finally: sys.stderr = old_stderr def setup_unraisable_hook(): global orig_unraisablehook orig_unraisablehook", "doctest.master = None try: ctypes = sys.modules['ctypes'] except KeyError: pass else: ctypes._reset_cache() try:", "enumerate(names): basen...
[ "valid') def base_tree(self, path_on_disk): connection = sqlite3.connect(path_on_disk) cursor = connection.cursor() base_tree = []", "(1)', 'key': u'sqlite_master', 'folder': False, 'lazy': False }) else: for child in self.get_tables(key,", "AND JSONIFY, SEE: http://stackoverflow.com/questions/12435297/how-do-i...
[ "requests, json url = 'http://educacao.dadosabertosbr.com/api/cidades/ce' cidades = requests.get(url).content cidades = cidades.decode('utf-8') cidades =", "import requests, json url = 'http://educacao.dadosabertosbr.com/api/cidades/ce' cidades = requests.get(url).content cidades = cidades.decode('utf-8') cidades...
[]
[ "transform = lookahead - state.pos transform = transform.getRotated(-state.angle) # Use the transformed vector", "index def updateTargetVelocities(self, state): \"\"\"Update the target velocities of the left and right", "= velocity # Limit the acceleration of the velocities for i in reversed(range(0,", "state...
[ "self # pylint: disable=arguments-differ def extend(self, *schemas, **kwargs): extra = kwargs.pop('extra', None) if", "required_keys = all_required_keys.copy() # Build a map of all provided key-value pairs. #", "schema, invalid_msg=None): invalid_msg = invalid_msg or 'mapping value' # Check some things that", ...
[ "1 else: harmfulness += 1 if usefulness >= harmfulness: es.append(row_index) es_pred.append(pred) return es,", "original data, otherwise filter the complete data :param complete: the complete dataframe :param", "is auto select. :return: dc that local density threshold \"\"\" if self.dc ==", "sort_rho_idx = np...
[ "= Queue() que.put(root) ans, tmp, k = [], [], 1 while que.qsize() !=", "Queue que = Queue() que.put(root) ans, tmp, k = [], [], 1 while", "\"\"\" # Definition for a Node. \"\"\" class TreeNode(object): def __init__(self, val, children):", "0: node = que.get() tmp.append(node.val) k -= 1 for child in node.chi...
[ "You can customize using 'options'. If you set \"header\" list object, you can", "\"\"\" return self.frame_buffer.recv_frame() def send_close(self, status=STATUS_NORMAL, reason=six.b(\"\")): \"\"\" send close data to the", "list or dict. \"cookie\" -> cookie value. \"origin\" -> custom origin url. \"host\"", ...
[ "return self.name class City(models.Model): name = models.CharField(max_length=50, verbose_name='Nome') state = models.ForeignKey(State, on_delete=models.CASCADE, verbose_name=State._meta.verbose_name)", "= models.CharField(max_length=150, verbose_name='Bairro') cep = models.CharField(max_length=8, verbose_name='...
[ "node = self.driver.list_nodes()[0] self.driver.reboot_node(node) def test_destroy_node(self): # Raises exception on failure node =", "0.28] , \"host_uptime_s\" : 3378276 , \"host_mem_mb_free\" : 51825 , \"host_mem_mb_total\" : 73719", ", \"vps_parameters\" : { \"memory_mb\" : 160 , \"disk_space_mb\" : 4096 , \...
[ "in polygon.holes for vertex in hole.vertices) @given(strategies.polygons_with_points) def test_convex_hull(polygon_with_point: Tuple[Polygon, Point]) -> None:", "in polygon, point in polygon.convex_hull) @given(strategies.polygons_with_points) def test_indexing(polygon_with_point: Tuple[Polygon, Point]) -> None:...
[ "multiple points l_pos_points = Points([[7.960064093299587, 1.3019528769064523, -2.6697181763370965], [7.960064093299587, 1.3019528769064523, -2.6697181763370965]]) p_dis_outs = chunk.project_local_points_on_raw(l_pos_points,", "pytest.raises(LookupError): attempt3 = ReconsProject(\"not_supported_sfm\") def test_...
[ "523, 532, 3017, 3018, 3019, ) STATUS_UNAUTHORIZED = (214, 277, 2553, 2554, 2555)", "301, 302, 303, 304, 321, 323, 324, 325, 326, 327, 328, 329, 330,", "276, 283, 284, 285, 286, 287, 288, 290, 293, 294, 295, 297, 300,", "274, 278, 279, 280, 281, 282, 289, 291, 292, 296, 298, 305, 306,", "402, 516, 517, 518,...
[ "super(BezierTest, self).__init__(*args, **kwargs) self.d = 10 self.points = points self.loop = loop self.current_point", "+ 1 return True return super(BezierTest, self).on_touch_down(touch) def on_touch_up(self, touch): if self.collide_point(touch.pos[0], touch.pos[1]):", "self.collide_point(touch.pos[0], touc...
[ "''), ('[\\t ]+', ' '), ('(-)?Effective user is.*', '')] init_script_1 = \"\"\"\"\"\" db_1", "# min_versions: ['3.0.8'] # versions: 3.0.8 # qmid: None import pytest from firebird.qa", "list on; select r.rdb$description as role_descr_blob_id from rdb$roles r where r.rdb$role_name = upper('rdb$admin');", "OK. #...
[ "dst_bbox[:, 1::4] = ctr_y - 0.5 * h dst_bbox[:, 2::4] = ctr_x +", "= dy * src_height + src_ctr_y w = torch.exp(dw) * src_width h =", "ctr_x = dx * src_width + src_ctr_x ctr_y = dy * src_height +", "#-----------------------------------------------------------------# # 把y轴放前面是因为方便预测框和图像的宽高进行相乘 #---------------...
[]
[ "pyclipper.PFT_NONZERO) def test_clear(self): self.pc.Clear() with self.assertRaises(pyclipper.ClipperException): self.pc.Execute(*self.default_args) def test_exact_results(self): \"\"\" Test whether coordinates", "pyclipper.PT_CLIP) self.pc.AddPaths([PATH_CLIP_1, INVALID_PATH], pyclipper.PT_CLIP) except pyclippe...
[ "cells_dict[type_.find('Type').text] = cells return cells_dict #Load Xml Files xml_locs = ['/path/to/xml/files'] #same as", "range(len(vals['counter'][cell_type])): print 'Iteration ' + str(i+1) + '/' + str(len(vals['counter'][cell_type])) #Convert Px Downsampled", "ValueError('Found 0 or >1 matching file') #Ge...
[ "max_iter = 10000 env.set_agent_at([2, 2], 0) env.set_pig_at([4, 4], 0) for i in range(max_iter):", "for i in range(max_iter): print(\"iter= \", i) env.render() action = random.randint(0, 4) print('action", "i in range(max_iter): print(\"iter= \", i) env.render() action = random.randint(0, 4) print('action is',...
[ "== {str} assert isinstance(d, pd.Series), d.columns assert all(map(_is_valid_dimension_name, d.index.names)) d.index.set_levels( [level.str.strip() for level", "data = _read_tsv_gz(tsv_gz_path) data.to_hdf( hdf_path, _HDF_TABLE_PATH, complevel=conf[\"hdf_complevel\"], complib=conf[\"hdf_complib\"], ) # Replace e...
[ "curr_data[k] = v cnn_feats = get_cnn_feats(cnn, curr_data, num_steps=num_frames_per_step * num_steps, training=False) emb_feats =", "' does not have training argument.') training = kwargs['training'] if training: # Set", "stride, stride) return steps def get_indices(curr_idx, num_steps, seq_len): steps = range...
[ "= reader.read_float() if version >= (5, 4, 2) or ( version >= (5,", "(4, 5): # 4.5 and up writer.write_vector4(self.m_Border) writer.write_float(self.m_PixelsToUnits) if version >= (5, 4,", "self.packingRotation = SpritePackingRotation((self.m_settingsRaw >> 2) & 0xF) # 4 self.meshType = SpriteMeshType((self.m...
[ "self.Alambda = f99(self.wave) self.Aflux = 10**(-0.4*self.Alambda) def extinction_correction(self, EBV, Rv=3.1, mag=True, source_lam=None, source_flux=None):", "= 1. if self.throughput is not None: self.norm = np.trapz(self.throughput/self.wave, self.wave) def __repr__(self):", "ctw95 = np.interp([0.025, 0.975...
[ "None r = postorder.pop() root = TreeNode(r) index = inorder.index(r) root.right = self.buildTree(inorder[index+1:],", "class Solution: def buildTree(self, inorder: List[int], postorder: List[int]) -> TreeNode: if not inorder:", "TreeNode(r) index = inorder.index(r) root.right = self.buildTree(inorder[index+1:]...
[ "[] new_pipeline_ids = [] loop_interrupted = False while self._should_continue(): try: if not loop_interrupted:", "try: self._add_baseline_pipelines() except KeyboardInterrupt: if self._handle_keyboard_interrupt(): self._interrupted = True current_batch_pipelines = [] current_batch_pipeline_scores", "percent_be...
[ "graphene.Mutation): social = graphene.Field(types.SocialType) class Meta: abstract = True class Arguments: provider =", "= graphene.String(required=True) @classmethod @setup_jwt_cookie @social_auth def mutate(cls, root, info, social, **kwargs): return cls.resolve(root,", "def mutate(cls, root, info, social, **...
[ "yellowbrick.regressor.base # Base classes for regressor Visualizers. # # Author: <NAME> <<EMAIL>> #", "Base classes for regressor Visualizers. \"\"\" ########################################################################## ## Imports ########################################################################## fr...
[ "[objInt, objAmp, objSlc1, objSlc2]: obj.finalizeImage() return imageInt, imageAmp def main(iargs=None): inps = cmdLineParse(iargs)", "image') parser.add_argument('-o', '--outdir', type=str, dest='prefix', default='crossmul', help='Prefix of output int and amp files')", "rgLooks): objSlc1 = isceobj.createSlcIma...