query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5ee7897f9c3469042c9481cb0aaa95db
Create a Convolutional Layer
[ { "docid": "538739d29b1eff228e06813a471a4179", "score": "0.0", "text": "def conv2d(inputs, filters, kernel_size = 1, strides = 1, pad = 'VALID', name = None):\r\n\twith tf.name_scope(name):\r\n\t\tkernel = tf.Variable(tf.contrib.layers.xavier_initializer(uniform=False)([kernel_size,kernel_size, inputs.g...
[ { "docid": "b070c84c9fc1b5e2fad7e952f9059ce4", "score": "0.70827186", "text": "def new_convolutional_layer(input, num_input_channels, size_filter, num_filter, pooling=True, name=\"Conv_layer\"):\n with tf.name_scope(name):\n shape = [size_filter, size_filter, num_input_channels, num_filter] #...
718f6daa719d8feb086d37b9a2ee67ff
with this hook you can do something very generic to a response after all processing.
[ { "docid": "0bd3658fd421c84cde654d2b2673beeb", "score": "0.72350335", "text": "def finalize_response(self, response):\n return response", "title": "" } ]
[ { "docid": "5096446644aa74e0296f4e3833d8e85c", "score": "0.7852177", "text": "def process_response(self, request, response):\n pass", "title": "" }, { "docid": "4f1dd571ef4f5cfee7912e94b204d348", "score": "0.76349527", "text": "def _post_process(self, response: requests.Respon...
97acf9a4daf2ff4a1fa2ca4a7cafbccb
Function to receive json
[ { "docid": "5c6438353ee5cedec71e2dcd9d6ef8a1", "score": "0.5765529", "text": "def receiveJson(sock):\n buffer = sock.recv(4)\n if buffer:\n print('Data received')\n json_length = struct.unpack(\"!i\", buffer)[0]\n # Reference: https://stackoverflow.com/a/15964489/9798310\n ...
[ { "docid": "dfb868339faad755f062796bbcfa141b", "score": "0.78848916", "text": "def read_json():", "title": "" }, { "docid": "30707fc438c9e879ada201232f998f06", "score": "0.70540917", "text": "def json(self):", "title": "" }, { "docid": "a2b5a2de1b87e4397e2128a5226af038", ...
f928e10b71127be588db7080aadddf59
new request with added url prefix
[ { "docid": "500302353444e52592c399ad0c5b42b1", "score": "0.7734129", "text": "def add_prefix(self, prefix: str) -> 'Request':\n return replace(self, url=prefix + self.url)", "title": "" } ]
[ { "docid": "5a983c427ab4ff4da4b887f4601c21f8", "score": "0.6477151", "text": "def process_request(self, request):\n self.request = request\n site = get_current_site(request)\n if site.id > 1:\n prefix = \"_{0}\".format(site.id)\n self.request.urlconf = settings...
6e6569e4b674b3abb5a1fb9d542546fa
Recovers all the containers of an instance including metasploit msfrpcd.
[ { "docid": "2a532e88e44d753f7eda991a95711b40", "score": "0.6858903", "text": "def recover_containers(containers):\n port = None\n\n for container in containers: # start all the containers\n container.start()\n container.reload()\n\n for ports in container.ports.values():\n ...
[ { "docid": "4e5206faee73d635ed0330cac7c2af7c", "score": "0.6030402", "text": "def restart_vpp_in_all_containers(self):\n for container in self.containers:\n self.engine.container = self.containers[container]\n self.engine.restart_vpp()", "title": "" }, { "docid":...
c41d47381d7582440c496fa8c8c5fcdb
applies the given netmask to the networks, True if the results are the same
[ { "docid": "d17a9c442dee1d7a39c64f9b1bc71315", "score": "0.6128977", "text": "def in_subnet(network1, network2, netmask):\n subnet1 = apply_netmask(network1, netmask)\n subnet2 = apply_netmask(network2, netmask)\n return subnet1 == subnet2", "title": "" } ]
[ { "docid": "61e94f906aa1799ab53499bafb573297", "score": "0.61975306", "text": "def net_contains(net, cand):\n\treturn cand.network_address in net and cand.broadcast_address in net", "title": "" }, { "docid": "403ee80e33bce6a7f6c613285760624c", "score": "0.6157785", "text": "def apply...
3b7c40e01f7562f1c2c98b475a8995a0
Differentiate signals to get velocity and accelerations
[ { "docid": "d9604181fdba608edd1fd29a759bdbfe", "score": "0.5557643", "text": "def get_accel(self, isnumeric=False):\n self.isnumeric = isnumeric\n y = self.y\n ndof = self.ndof\n fs = self.fs\n\n yd = np.empty(y.shape)\n ydd = np.empty(y.shape)\n for i in...
[ { "docid": "8c76ae0beb9a41d26d305633e98782ae", "score": "0.6204682", "text": "def base_velocity(self):\n raise NotImplementedError('Not yet implemented!')", "title": "" }, { "docid": "621cf629c68f1d2bb317f5ec88170f2c", "score": "0.61361825", "text": "def velocity(self) -> np.ndarr...
49fd8840ef9368227d2b7e660821b272
+ Truncate/drop all tables and recreate them + Delete all packages in package_files
[ { "docid": "0533af5678f26a8b1eb78b03d099c715", "score": "0.0", "text": "def clear(server_path, force=False):\n # Confirm:\n ans = input(\"Are you sure you want to delete all packages? [yN]\")\n if ans.lower() in ('y', 'yes'):\n pass\n elif ans.lower() in('n', 'no'):\n logger.de...
[ { "docid": "7a68d64a77b898c481a9e4d0c0265a0d", "score": "0.7258292", "text": "def _clear_all_tables(self):\n self.session.close()\n self.meta_data.drop_all()\n self.meta_data.create_all()\n clear_mappers()", "title": "" }, { "docid": "53f3ca5be2e84c984f9ff654fafc1...
35fa76dfe12a7bcfcb841a04b983c9cf
Parse wifi values from terminal
[ { "docid": "45e8150210b1713afc39966fbe5879ba", "score": "0.6029007", "text": "def wifi_stats(stats_count=3):\n link_sum,level_sum, noise_sum = 0, 0, 0\n for i in range(stats_count):\n args = [\"grep\", \"-i\", \"wlp2s0\",\"/proc/net/wireless\"]\n try:\n link, level, noise ...
[ { "docid": "9fb87dbbad13db7c5198dc9f65e4ca76", "score": "0.6035363", "text": "def get_wifi_settings():\n sets = {'ssid': 'SSID', 'passwd': 'PASS'}\n\n if settings.PB_HOSTAPD_FILE is None:\n return sets\n\n with open(settings.PB_HOSTAPD_FILE, 'r') as f:\n for line in f:\n ...
c9ca1502783cde9e7254c22151a34af7
This method is the workhorse of the browser. It handles screen drawing and the keyboard.
[ { "docid": "adee66d3b690a632aad4bc601d68f8b2", "score": "0.0", "text": "def _dodisplay(self, scr):\n self.scr = scr\n curses.halfdelay(1)\n footery = 2\n\n keys = []\n for cmd in (\"quit\", \"help\"):\n key = self.keymap.findkey(cmd, None)\n if ke...
[ { "docid": "0d8778a822da0bea2b74406879196b37", "score": "0.73315173", "text": "def draw(self, screen):\n pass", "title": "" }, { "docid": "6984ab10ce449f006f1e8504d628c9cc", "score": "0.6826859", "text": "def draw(self):\n self.canvas_draw()\n self.screen.blit(se...
a712f0cb9d8eddbf41248121075a19fa
Attach a lot of summaries to a Tensor (for TensorBoard visualization).
[ { "docid": "f55821b85f4b9014bb03f97a13767b5a", "score": "0.5550347", "text": "def variable_summaries(var):\n with tf.name_scope('summaries'):\n mean = tf.reduce_mean(var)\n tf.summary.scalar('mean', mean)\n with tf.name_scope('stddev'):\n stddev = tf.sqrt(tf.reduce_mean(tf.square(var - me...
[ { "docid": "384e9aded997888d340ff722a51377a8", "score": "0.77373797", "text": "def add_summaries(self):\n # defines a namespace for the summaries\n with tf.name_scope('summaries'):\n # adds a plot for the loss\n tf.summary.scalar('loss', self.loss)\n #tf.summary.scalar('accuracy', s...
e12b204058941f7972fcc012f64c5c74
calibrate load z calibration data from file and return lookup table
[ { "docid": "b05059abdc9e9a381f41838516343bd6", "score": "0.5337697", "text": "def z_calibration(self, SaveAs=False):\n z = np.genfromtxt(calibration_data, names=True, skiprows=1)\n\n #fit = exp2d.Exp2D()\n p, best, err = fit().fit(np.array(z['mm']), np.array(z['value']), y0=0)\n fdata = fit(...
[ { "docid": "7374324898ccb78687f58e814c21b167", "score": "0.6299177", "text": "def load_calib_data(self, filename):\n\n if os.path.exists(filename):\n data = pickle_load(filename)\n\n for camera in stereo.cameras:\n camera.cam_mat = data['cameras'][camera.id]['...
69d4dc11c310fbf809daa1fe6ad75e3e
Compares two nested models by likelihood ratio test
[ { "docid": "f177e33e18cf8c07f6bdfec041c53fc1", "score": "0.6138221", "text": "def LikelihoodRatioTest(null_model, alt_model):\n\n chisq = -2.0 * null_model.loglikelihood() + 2.0 * alt_model.loglikelihood()\n df = null_model.df - alt_model.df # Null model has more DFs\n res = LikelihoodRatioTest...
[ { "docid": "bf8e7021a8b42eba46d0f452fe785a88", "score": "0.6811791", "text": "def mismatch(model1, model2):\n\n return 1.0 - np.abs(np.vdot(model1, model2) / np.vdot(model1, model1))", "title": "" }, { "docid": "783d78e07638ddc84b9c6d56582419be", "score": "0.6533749", "text": "def...
c80064b9608786be6f6d43da0b4d693c
Branching is not random. A branch should occur inside the method or to the beginning of another method. This method analyzes the branching address of a branch instruction and then provides a probability of the address being correct
[ { "docid": "1cd624279e6db30d049094eafcc8f170", "score": "0.7213883", "text": "def _compute_branch_address(self, inst, current_fn, lowest_addr, highest_addr):\n if inst.ignore or not inst.is_branch:\n return\n jmp_addr = inst.jumping_address\n\n if jmp_addr is None:\n ...
[ { "docid": "1307af128f0a5c78af4461deb19951e6", "score": "0.6226275", "text": "def perform_always_branch(self, data, addr):\n\t\treturn None", "title": "" }, { "docid": "8a73668c32d2ea65e4e433a87fa449c8", "score": "0.5962285", "text": "def determine_next_step(self, branch: int, x: dic...
b01a5967c443eb60787ab383abd1670a
Loads the given schema file
[ { "docid": "f636b948ad3143cd695eff59d138a523", "score": "0.72388625", "text": "def _load_json_schema(filename):\n\n relative_path = join('.', filename)\n absolute_path = join(dirname(__file__), relative_path)\n\n with open(absolute_path) as schema_file:\n return json.loads(schema_file.re...
[ { "docid": "6e4995ac5e247b12c5dfe531342cb979", "score": "0.77058876", "text": "def _load_schema_from_local_file(file_name):\n print \"Loading schema from file '{}'\".format(file_name)\n try:\n with open(file_name) as schema_file:\n schema = pickle.load(schema_file)\n r...
f3ac5f2be00b23cd61aace8c8e723530
linepair is the sequence of two lines; the first runs the function and assigns the output, and the second generates an array of indices where the output error exceeds a tolerance.
[ { "docid": "2cee509d40c4a062da1f7d729e373d6b", "score": "0.54965043", "text": "def __init__(self, linepair):\n\n self.linepair = linepair\n self.runline = linepair[0]\n self.testline = linepair[1]\n\n # parse the line that runs the function\n head, tail = self.runline....
[ { "docid": "8ce386777d1ed111f3cb2783d0814d00", "score": "0.61191684", "text": "def get_parallel_line_pairs(slope_bucket : Dict[int, List[List[tuple]]]) -> List[List[tuple]]:\n parallel_line_pairs = []\n for slope, lines in slope_bucket.items():\n print(f'Looping for slope : {slope}:\\n')\n ...
53995d40d676c5765cc0c649e11ab981
Returns the current values of all weights in the network in a dictionary with the same keys as self.weight_keys.
[ { "docid": "92a8aac52d5eb688bc26546c1edf7d65", "score": "0.7493311", "text": "def get_weights(self, sess):\n keys = sorted(self.weight_keys)\n weight_dict = {}\n for i, k in enumerate(keys):\n weight_dict[k] = sess.run(self.parameters[i])\n\n return weight_dict", ...
[ { "docid": "eca0e62d23f2146e66f80ec97663dc41", "score": "0.8380025", "text": "def get_weights(self):\n weights = {}\n for key in self.weights:\n weights[key] = self.weights[key].get_value()\n return weights", "title": "" }, { "docid": "0c397626a40b260f6ee205b7...
d767493699a07ddcd42621c67fd2e118
Given a positive integer n, generate the primes < n.
[ { "docid": "47565328f245af61b47771408283e044", "score": "0.0", "text": "def basicSieveSum(n):\n s = [1]*n\n for p in xrange(2, 1+int(math.sqrt(n-1))):\n if s[p]:\n a = p*p \n s[a::p] = [0] * -((a-n)//p)\n sm = 0\n for p in xrange(2, n): \n if s[p]:\n sm += p\n return sm", "...
[ { "docid": "bb38992d97c5b1bdca1c86ad4f61d2a4", "score": "0.8815054", "text": "def generate_primes(n):\n primes = []\n for i in range(2, n + 1):\n if is_prime(i):\n primes.append(i)\n return primes", "title": "" }, { "docid": "343d3818ff2bab1820a2586b19dd5c27", ...
4ac309522543ac6843994eb767a69abb
check Checkpoint a mailbox on the server.
[ { "docid": "54457b720b105c250612e134d92c4731", "score": "0.5425262", "text": "def check(self, argv):\n self._print_msg(self._client.check())", "title": "" } ]
[ { "docid": "805dfc8005657b800fd5e4eba32ddf6e", "score": "0.64372647", "text": "def _check_boxes(connection):\r\n response, mailboxes = connection.list()\r\n if response == 'OK':\r\n print \"Mailboxes:\"\r\n print mailboxes", "title": "" }, { "docid": "911a56fcf17678afb8a2ed...
03654944cbdd631faf9f136c19a7b4dd
Frequency of closed GOPs.
[ { "docid": "6d377044c365689374db148beed5adbe", "score": "0.0", "text": "def gop_closed_cadence(self) -> Optional[int]:\n return pulumi.get(self, \"gop_closed_cadence\")", "title": "" } ]
[ { "docid": "b3aecd515721ed0ded243ccad03b82f0", "score": "0.6738275", "text": "def freq() -> int:", "title": "" }, { "docid": "6a3de2c7938da78ca22fa42a0e9a0726", "score": "0.64109796", "text": "def freq():\n ...", "title": "" }, { "docid": "7a3ce4a44641c3eb046228992d0f6...
e71a262dc65258038ea4ad2436938f07
There may be only one possible choice for a particular unit
[ { "docid": "25b3f3d41f0543a51f51798fbfed6c97", "score": "0.63899994", "text": "def only_choice(grid):\n for unit in all_units:\n for d in '123456789':\n choices = [n for n in unit if d in grid[n]]\n if len(choices) == 1:\n grid = assign_value(grid, choices[...
[ { "docid": "1982c5e15c66bae15bf1b7fa7414a2dc", "score": "0.6371527", "text": "def only_choice(values):\n # unitlist = self.rowUnits() + self.colUnits() + self.squareUnits()\n\n fillUpUnits(rowUnits(), values)\n fillUpUnits(colUnits(), values)\n fillUpUnits(squareUnits(), values)\n return ...
6955cbd8ff7a599105390c16094f3506
Sets the reference of this Body25.
[ { "docid": "fbac8f63485bd82c00ccf9b0610ddedc", "score": "0.66401124", "text": "def reference(self, reference: str):\n\n self._reference = reference", "title": "" } ]
[ { "docid": "94e7ab98a43027ed7c456278e641c382", "score": "0.73035944", "text": "def setreference(self, ref):\n self._reference = ref", "title": "" }, { "docid": "cbdf1e730b08f4160e8b55c02f955762", "score": "0.6978299", "text": "def set_reference(self, reference):\n\n sel...
062e53385be12da3262258379b8d138a
Helper method to keep our tests DRY
[ { "docid": "c1fefd5f8cbadcc4e37eec35121f22ba", "score": "0.0", "text": "def given_a_series_of_prices(self, prices):\n timestamps = [datetime(2015, 5, 28), datetime(2015, 5, 29),\n datetime(2015, 5, 30)]\n for timestamp, price in zip(timestamps, prices):\n se...
[ { "docid": "f9c82fcce3672cf836716181212cb178", "score": "0.7571753", "text": "def _test(self):", "title": "" }, { "docid": "f9c82fcce3672cf836716181212cb178", "score": "0.7571753", "text": "def _test(self):", "title": "" }, { "docid": "f9c82fcce3672cf836716181212cb178", ...
b677ca61c75260738aaf0ddec5ce2b65
Normalizes string, converts to lowercase, removes nonalpha characters,
[ { "docid": "9f8e7ce7916a2afefdd81b4bb23bb675", "score": "0.0", "text": "def sanitize(value):\n import re\n re.sub('[^\\w\\-_\\. ]', '_', value)\n value = value.replace(\" \", \"_\")\n logger.debug(f'Saving file with sanitized name: {value}')\n return value", "title": "" } ]
[ { "docid": "21d05d24e2e0b083869daab4c2577f97", "score": "0.79351604", "text": "def normalizeText(s):\n s = s.lower()\n s = REMSPACE.sub(' ', s)\n s = ALPHAONLY.sub('', s)\n s = s.strip()\n return s", "title": "" }, { "docid": "8163d4336b7bb30bc7f5f8acab4d5c46", "score": "0...
06c6dd3d6b60a452da31149b7cd48f4c
Determine if version number needs to be updated
[ { "docid": "4fd3c5010c81efb4c2891cf13d5dbb7c", "score": "0.0", "text": "def main():\n local_version = get_version(\"../../vertical_multi_columns/__init__.py\")\n print(f\"{local_version=}\")\n\n resp = requests.get(sys.argv[1])\n pypi_version = resp.json()[\"info\"][\"version\"]\n print(f...
[ { "docid": "edd9ba140dee6b58f1594ab78eb66623", "score": "0.747243", "text": "def latestVersionValid():", "title": "" }, { "docid": "edd9ba140dee6b58f1594ab78eb66623", "score": "0.747243", "text": "def latestVersionValid():", "title": "" }, { "docid": "e08f90db58eb696c5e4e...
c09532df2a7eb5de34c61599cbdfff3a
The ARN of the bucket.
[ { "docid": "0833f505a89d3e8f24c57e43b09f9b4b", "score": "0.85899574", "text": "def bucket_arn(self) -> str:\n return jsii.get(self, \"bucketArn\")", "title": "" } ]
[ { "docid": "cd16b59e48c62bc36c6a993f3486202c", "score": "0.8556041", "text": "def bucket_arn(self) -> str:\n ...", "title": "" }, { "docid": "1f02024d39e89f53e5c0393567499f43", "score": "0.8067578", "text": "def bucket_arn(self) -> pulumi.Input[str]:\n return pulumi.get...
4382f219b527dab17a0eac5e599326ef
get the url link
[ { "docid": "921636792c7324ff28a8f31af78eba2f", "score": "0.0", "text": "async def message_url(self, message_id: str) -> UrlLinkPayload:", "title": "" } ]
[ { "docid": "411716a5d825a4ca3911c7c270c84f0c", "score": "0.8282871", "text": "def get_link (self):\n if self.relative_url != '':\n return self.relative_url\n else:\n return self.url", "title": "" }, { "docid": "97b221b6714784f61d6886850fdb85dc", "score...
fbe39aef838317b089316438cad11925
The only meaning of this function is to trigger HighlimePauseCommandListener
[ { "docid": "019a4a108508ad49cf7201fe72c86c88", "score": "0.72343063", "text": "def run():\n print('Highlime paused')", "title": "" } ]
[ { "docid": "898f0e506e7f8c034b4be4605b68abcc", "score": "0.6303478", "text": "def pause(self):\r\n self._command_queue.put('PAUSE')", "title": "" }, { "docid": "a2fbfa52839871c05016db68f6602804", "score": "0.6262444", "text": "def pause():\r\n command(\"M0\")", "title":...
c626eae38259a07289a7b7708d2c1ce7
Returns or sets the text of header.
[ { "docid": "b1592dbb51367a2b79d2e7c8a17593a7", "score": "0.0", "text": "def header_right(self):\n return self.impl.header_right", "title": "" } ]
[ { "docid": "ab438d89b8054bc9433af182d69b5617", "score": "0.77726483", "text": "def header_text(self):\n return object_attr_string_repr(self.header)", "title": "" }, { "docid": "85fdadd7ccdfdf866f181fae0ac29e0c", "score": "0.7516228", "text": "def setHeader(self, text):\n ...
cf24a9a72fbf65c07687a84538833017
Return a string representing the node in g2o format
[ { "docid": "223b7b608650d8a8dbb39bab7f4324fd", "score": "0.0", "text": "def to_g2o(self):\n line = \"VERTEX_SE3:QUAT {} \".format(self.id_)\n line += \" \".join([str(x) for x in self.t]) + \" \"\n line += \" \".join([str(x) for x in self.q])\n return line", "title": "" ...
[ { "docid": "10ff3df0af534ac4a0f9ac4acdbf8192", "score": "0.7376439", "text": "def __str__(self):\n string = '@nodes\\nlabel deg\\n'\n for i in self.V:\n string += '%3d %3d\\n'%(i,self.deg(i))\n\n string += '@edges\\n label\\n'\n ...
f2d1d503acd930c5ec07c4f30e77a603
Function to calculate the overall sentiment using NLTK's vader library.
[ { "docid": "798a0136783d5ddca3272bbee7431a00", "score": "0.67116237", "text": "def overall_sentiment(text):\r\n sid = SentimentIntensityAnalyzer()\r\n ss = sid.polarity_scores(text)\r\n for _ in sorted(ss):\r\n if ss[\"compound\"] >= 0.15:\r\n return \"positive\"\r\n el...
[ { "docid": "e3c5c0e86bce2b5b341ec4e089f8f077", "score": "0.72598004", "text": "def sentiment(text):\n words = pattern_split.split(text.lower())\n sentiments = map(lambda word: afinn.get(word, 0), words)\n if sentiments:\n # How should you weight the individual word sentiments? \n ...
d2ad09c8cbe6b76dcdcf2bf822e90025
!Calls self.communicate(), and returns the stdout from the pipeline (self.outbytes). The return value will be Null if the pipeline was redirected to a file or if the constructor's capture option was not True.
[ { "docid": "d8e40611db405a37b900f39eea4e4026", "score": "0.5637281", "text": "def to_string(self):\n self.communicate()\n o=self.out\n if not isinstance(o,str):\n o=str(o)\n return o", "title": "" } ]
[ { "docid": "79d9e8c61854efd57d11968a3ffd058b", "score": "0.6113572", "text": "def capture(*cmd):\n a = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n return a.communicate()", "title": "" }, { "docid": "aa2bd5a65384749897ba3080cd28c526", "score": "0.6037035"...
02034d9965d781f30c6f7918368b3e67
Creates tokens from raw text
[ { "docid": "47d8828dde4173cdc244ec460e9816af", "score": "0.59687525", "text": "def tokenize_text(self,text):\n tokenizer = RegexpTokenizer(r'\\w+')\n \n tokens = tokenizer.tokenize(text)\n extra_stops = [str(i) for i in range(2100)]\n extra_stops +=['zero','one','two',...
[ { "docid": "542013bc74bde82830f0473726cfb956", "score": "0.7338718", "text": "def tokenize(raw_text):\n\n return raw_text.split()", "title": "" }, { "docid": "2f9ff835a968bb12af51b8b89ca14dab", "score": "0.71471465", "text": "def tokenize(self, text):\n ...", "title": "...
329232d02e29ea3ed29d2ff519324fd5
Gets the locale used if `TurnContext.activity.locale` is not specified.
[ { "docid": "2521393f2c80cbbdbe0fddd527a97efd", "score": "0.0", "text": "def default_locale(self, value: str) -> None:\n self._default_locale = value", "title": "" } ]
[ { "docid": "0183bb62745d02306c278fdc5d75d2a0", "score": "0.7553464", "text": "def getCurrentLocale(self):\n\n permutation = self.getCurrentPermutation()\n if permutation:\n locale = permutation.get(\"locale\")\n if locale:\n return locale\n\n ret...
3acc3d2008079b219ac7f83ecb7e3210
Create the command line to be passed to RTC server. This function does not add the min_port and max_port param to the RTC command line
[ { "docid": "ac80715cd3570bd89c02d5a142a1b8f6", "score": "0.6836483", "text": "def get_rtc_cmdline_params(self, as_config_file, vs_config_file):\n as_lb, as_port, vs_lb, vs_port = self._get_audio_video_lb_address(\n as_config_file, vs_config_file)\n # Create the command line for ...
[ { "docid": "4849001e343d48655bbecfa022eafbab", "score": "0.7281892", "text": "def get_rtc_cmdline_params_port_range(self, as_config_file, vs_config_file):\n as_lb, as_port, vs_lb, vs_port = self._get_audio_video_lb_address(\n as_config_file, vs_config_file)\n # Create the comman...
92d841dcafd34df3242b964e23640f53
Log and email warning about any acquisition stars with observed positions outside the expected search box (plus a pad). For acquisition stars with tracked positions in the wrong search box, note the box (classic acquisition anomaly).
[ { "docid": "300ea322480477cd031f996f103b2e96", "score": "0.6799472", "text": "def warn_on_acq_anom(acqs, emails):\n # Find tracked objects in the acq stats table outside the intended search box plus padding\n\n # Note that dy/dz are observed yag/zag (t_guide) - predicted yag/zag (t_guide) using AO...
[ { "docid": "ce3f1e64473ba2120407263f5189104a", "score": "0.5493461", "text": "def test_pos_err_on_guide():\n stars = StarsTable.empty()\n stars.add_fake_star(id=100, yang=100, zang=-200, POS_ERR=2010, mag=8.0)\n stars.add_fake_star(id=101, yang=0, zang=500, mag=8.0, POS_ERR=1260) # Just over w...
e63245e828429092ba71c86e1d1ee3ad
Get histogram counts per each processed CCD frame as a 2D array. Use setHistBins to configure histogram bins. Bin edges and centers are available in self.hedges and self.hcenters. Return a 2D array of histogram counts per each frame.
[ { "docid": "4f01216566be8d30ec6cbf2945acbf80", "score": "0.6916845", "text": "def ahistogram(self):\n import functools\n from py15sacla.utils import eqbinhistogram\n self._ensureHistBinsExist()\n lo, hi, bins = self.chistbins\n fnc = functools.partial(eqbinhistogram, b...
[ { "docid": "4bcc28038117f26ba6811756bf804fdb", "score": "0.66184413", "text": "def ToHistogram(self):\n return np.array([bin[3] for bin in self.bins])", "title": "" }, { "docid": "9e7fd3f24c8b8f0b511422fe75da5fec", "score": "0.65742964", "text": "def histogram(self):\n ...
5ff642964c526823046501a5c2bba226
Should be implemented by the base class (if using renderable, ensure it comes last in resolution order)
[ { "docid": "41c2be246653e727bdbe448de1a403c8", "score": "0.0", "text": "def position_intersects(self, position: Position) -> bool:\n raise NotImplementedError", "title": "" } ]
[ { "docid": "0c7c45818ff2bc1931fe2e11d314069b", "score": "0.76715225", "text": "def __init__(self):\n super(RenderBase, self).__init__()\n return", "title": "" }, { "docid": "21569fd1241d3b25a8ac06aaa8d53153", "score": "0.7640047", "text": "def render(self):\n rai...
5db90035f9cdea3e72db69035db905b8
Updates the marker according to the given event. All submarkers will be updated before the compound marker itself is updated.
[ { "docid": "dc13326b3e9e55f908c4e8b1abd051bc", "score": "0.63127154", "text": "def track(self, event: Event) -> None:\n for marker in self.sub_markers:\n marker.track(event)\n super().track(event)", "title": "" } ]
[ { "docid": "308e72dad6a59f68311c1f154078fc03", "score": "0.6227557", "text": "def update(self, event, annotation):\n # Get artist-specific information about the pick event\n info = self.event_info(event)\n\n if self.props_override is not None:\n info = self.props_override...
c7872bd282a051e526f485e11f6379c8
Help to encode message. Called before message encoding.
[ { "docid": "9bf32b62df0636367e7201fcc181c3af", "score": "0.0", "text": "def before_encode(cls, func):\n\n @functools.wraps(func)\n def wrap(*args, **kwargs):\n return func(*args, **kwargs)\n\n return wrap", "title": "" } ]
[ { "docid": "c6241b38b2421d64e9fd4f34efabf7eb", "score": "0.6964077", "text": "def encode(self, *args, **kwargs):\r\n pass", "title": "" }, { "docid": "2e45b8167aacfe58cba85502f8a700ab", "score": "0.6803782", "text": "def encode(message):\n # Please print out which line of t...
7fe51914cbe9fe09b58be396ee2f3f9f
Check if a fault was detected.
[ { "docid": "e54a3686327db8d5b5e9171e62c207f5", "score": "0.694356", "text": "def DetectedFault(self):\n\n if self.FaultOnEarlyExit and (self.thread is None or not self.thread.is_alive()) and \\\n (self.handledFault is None or not self.handledFault.is_set()):\n ...
[ { "docid": "6e0f214cdbd2d2f656dcdcb35150cef2", "score": "0.72903425", "text": "def check_failure(self, fault_name):\n srch_str = '\\s{}'.format(fault_name)\n if re.findall(srch_str, self.fd_data):\n return False\n else:\n return True", "title": "" }, { ...
14ac21724398d659a2adc4e56824b6a6
Return a list of string containing all the current hostnames
[ { "docid": "25c7f310d6616a91bc15cbb5a1776bb5", "score": "0.80563426", "text": "def getListHostnames(self):\n\t\tlist = self.getSession().query(Node.name).all()\n\t\treturn [item for item, in list]", "title": "" } ]
[ { "docid": "fda32db0718449990a2b6180d66bc9bd", "score": "0.7972852", "text": "def hostnames(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"hostnames\")", "title": "" }, { "docid": "b041d5586a7c69cbc0634e494a0d123f", "score": "0.78123796", "text": "def getHo...
35c623f30178746f5f5e8f39c70f007d
Return the DataContainer from a table row instance.
[ { "docid": "2a9b0521fe06029a4ddea1f3ce11bf0d", "score": "0.5291903", "text": "def _retrieve(self, row):\n uid = uuid.UUID(hex=row['uid'], version=4)\n return Particle(\n uid=uid, coordinates=row['coordinates'], data=self._data[uid])", "title": "" } ]
[ { "docid": "01a807f81ace83f5eeb9eb05cdcb0fa3", "score": "0.62217975", "text": "def get_row(self, row):\n return self._db.get_row(self._name, row, column_map=self._colmap)", "title": "" }, { "docid": "afeecb2a704c4bdaeb7392b3d002009b", "score": "0.6117592", "text": "def row(sel...
13ba29af0c10bb044a0db3512e28328d
Convert string to int
[ { "docid": "28dd1eb62954e144c7b6c8cb573b83a1", "score": "0.76648444", "text": "def string_to_int(string):\n\n string = string.replace('.', '')\n string = string.split('(')[0].strip()\n return int(string)", "title": "" } ]
[ { "docid": "4b040796ab3ac4bb90c477eb99082b3b", "score": "0.835715", "text": "def _to_int(string):\r\n if isinstance(string, str):\r\n return ord(string[0])\r\n else:\r\n return string", "title": "" }, { "docid": "053ae9ba7134f6482eed54ec1895a44c", "sco...
0efdbe0ce685754dada5ce85c74f8460
Measure the agreement and KL divergence between the predictions produced by model trained on exact augmentation objectives vs models trained on approximate objectives.
[ { "docid": "470839c6e196ef515bb7b98ff504f674", "score": "0.67365485", "text": "def agreement_kl_difference(augmentations):\n model_variants = {'kernel': lambda model: [model, exact_to_og_model(model), exact_to_1st_order_model(model),\n exact_to_2nd_order_no_1s...
[ { "docid": "c322dbaec2b331c7a9ddb961765bb690", "score": "0.64305675", "text": "def compute_accuray(predictions, y):\n\treturn np.mean(np.equal(predictions.detach().numpy(), y.numpy()))", "title": "" }, { "docid": "ba7d945e9ae06d3e616a6c0fd6cc9414", "score": "0.63229054", "text": "def...
5bcc2d1e5631452b6d04a2d77bd3b135
This tests the functionality of raising TerminateSimulation exception in handle_result.
[ { "docid": "c5e35f86415dfcf81cf24b4452ab42fc", "score": "0.6437277", "text": "def test_terminate_simulation(self):\r\n class Extended_Problem(Implicit_Problem):\r\n def __init__(self):\r\n pass\r\n def handle_event(self,solver, event_info):\r\n ...
[ { "docid": "a5e7d92dcfa627fb50dc50d429c88849", "score": "0.70890814", "text": "def test_handle_stop_and_exit(self) -> None:\n self.aea._skills_exception_policy = ExceptionPolicyEnum.stop_and_exit\n self.handler.handle = self.raise_exception # type: ignore # cause error: Cannot assign to a...
33d5f69c80edac04532e759092ff0904
Get all axes offset voltages `offsets` is a list of offset voltags, whose length is equal to the number of active (connected) axes.
[ { "docid": "a9105f97237b4bd2c4c935723e01c677", "score": "0.6659708", "text": "def set_all_offsets(self, offsets):\n self._set_all_axes_data(self.set_offset,offsets)\n return self.get_all_offsets()", "title": "" } ]
[ { "docid": "1adc973b87fe44a565cce97d6ac19eb5", "score": "0.66350055", "text": "def get_all_offsets(self):\n return self._get_all_axes_data(self.get_offset)", "title": "" }, { "docid": "1adc973b87fe44a565cce97d6ac19eb5", "score": "0.66350055", "text": "def get_all_offsets(self)...
9567fd29f63203e11751913ca00a388a
Get work history for the last years
[ { "docid": "f7cf9bac763b508fcc011afe972f3c3d", "score": "0.7542441", "text": "def getHistoryYear(num = 0):\n\tresult=[]\n\tcurrentTime=datetime.datetime.now()\n\tlimit=datetime.datetime(currentTime.year-num, currentTime.month, currentTime.day)\n\tfor job in resume[\"work\"]:\n\t\tif \"endDate\" not in j...
[ { "docid": "6a57c759e75570e494a30824b6c5c3f0", "score": "0.6485748", "text": "def getHistory(num = None):\n\thistory=[]\n\tif num != None:\n\t\thistory=resume[\"work\"][:int(num)]\n\telse:\n\t\thistory=resume[\"work\"]\n\treturn jsonify(history)", "title": "" }, { "docid": "0be23c49742351038...
680bbb3f8eef67b3cf95a7ab8b726022
method returns data on a particular row from the database
[ { "docid": "6a7b364b630db5ea4e7a786272d9323e", "score": "0.0", "text": "def retrieve_one(cls, query_string):\n cls.cur.execute(query_string)\n return cls.cur.fetchone()", "title": "" } ]
[ { "docid": "a67f11b8cab53f3c4a2e0c3f3678feb8", "score": "0.73097724", "text": "def GetItem(self, row):", "title": "" }, { "docid": "a67f11b8cab53f3c4a2e0c3f3678feb8", "score": "0.73097724", "text": "def GetItem(self, row):", "title": "" }, { "docid": "f21e043b20c4889fc58c...
ca76e70edbf7c76a72017aa3721eb59e
Verify email reset token. Loads the user id and the requested email and simultaneously checks token age. If not too old, get user with id and set email.
[ { "docid": "5e6d7a14706f367fa7bd5d591c364ec5", "score": "0.67778265", "text": "def verify_token(token):\n ts = URLSafeTimedSerializer(flask.current_app.config[\"SECRET_KEY\"])\n\n try:\n user_id, email = ts.loads(token, salt='verify-email', max_age=900)\n except SignatureExpired:\n ...
[ { "docid": "1426832ab2106935047455b4d985ed59", "score": "0.7034363", "text": "def verify_reset_token(token):\r\n s = Serializer(app.config['SECRET_KEY'])\r\n try:\r\n user_id = s.loads(token)['user_id']\r\n except:\r\n return None\r\n return User.query.g...
63786851c7e7ae73d467536316bbf110
Renders the current game state to the screen.
[ { "docid": "b2fb00ada0d03815848d460f37515c6e", "score": "0.6745435", "text": "def draw_game_state(self, win):\n state = self.get_game_state()\n output = ''\n if state == 'UNFINISHED':\n turn = self.get_turn()\n if turn == 'b':\n player = 'Blue'\n...
[ { "docid": "22595c50b0cb7ee71aca591ea16d2c4d", "score": "0.77084374", "text": "def render(self):\n self.screen.fill(WHITE) # Fill background before drawing scene\n #-- Add rendering code here --#\n\n #-----------------------------#\n pg.display.flip() # Draw the screen onto...
904764c2259b3ba951b292527cd2236d
Returns an sdf object with center in the world frame of reference
[ { "docid": "a3e19fbe645b06d7e0165558833d8e2f", "score": "0.0", "text": "def transform_to_world(self):\n return self.transform(self.pose_, scale=self.scale_)", "title": "" } ]
[ { "docid": "4eca910060e666cb12d863fec6f2d3cc", "score": "0.6257024", "text": "def center_world(self):\n return self.transform_pt_grid_to_obj(self.center_)", "title": "" }, { "docid": "d705a42fbaf32da90b68f8f2ddea5cc9", "score": "0.5883293", "text": "def getReferencePoint(self)...
bdc24c088c12848d5b231d245b1f0744
finds all strings in files in folder needing translations
[ { "docid": "13a6c79eac27cc87bbd719f558c434b7", "score": "0.0", "text": "def find_matches(folder, name=\"T\", extensions=[\"py\", \"js\", \"html\"]):\n matches_found = set()\n re_string_t = (\n r\"(?<=[^\\w]%s\\()(?P<name>\"\n r\"[uU]?[rR]?(?:'''(?:[^']|'{1,2}(?!'))*''...
[ { "docid": "b74b547fe120d671ecae5ebbd8d893da", "score": "0.7044006", "text": "def read_languages_from_filenames(dir_to_search):\n pattern = re.compile(\"([a-z]{2}-[A-Z]{2}).txt\")\n for file in os.listdir(dir_to_search):\n find = pattern.findall(file)\n if len(find) == 1 and find[0] ...
88343d661da9053d368c91949b04f973
Encode the resolved_object_ids and post_publics fields from updates. ...and cap them at MAX_RESOLVED_OBJECT_IDS and MAX_POST_PUBLICS. Tries to keep the latest ones by assuming that ids are roughly monotonically increasing.
[ { "docid": "234fd8edec74def44765105566c158e5", "score": "0.55814445", "text": "def _pre_put_hook(self):\n self._save_cache('resolved_object_ids')\n self._save_cache('post_publics')", "title": "" } ]
[ { "docid": "4bf963b0be4c4c0c53a7b45bd19c7bd6", "score": "0.5439419", "text": "def fix_ids(self, objs, many, **kwargs):\n\n def _replace_id(obj):\n obj.unfreeze()\n obj.id = obj.id.replace(\"//plans/\", \"/\")\n obj.freeze()\n\n if many:\n for obj...
990a3fbb10a1f962868fc5cf396a5296
Translate Resource Format from gcloud values to configconnector values.
[ { "docid": "0dbf48ed7e0eef5fb333f99a5106a04f", "score": "0.5140977", "text": "def _NormalizeResourceFormat(resource_format):\n if resource_format == 'terraform':\n return 'hcl'\n return resource_format", "title": "" } ]
[ { "docid": "a5f9c7d808fa23ca55c7477f25ad0d10", "score": "0.5538266", "text": "def cr_to_config(cluster_resource: Dict[str, Any]) -> Dict[str, Any]:\n config = translate(cluster_resource[\"spec\"], dictionary=CONFIG_FIELDS)\n config[\"available_node_types\"] = get_node_types(cluster_resource)\n ...
aa2ee5f1f74bfde6f685a36a0bd012c2
This is a function that prints colored text to the terminal from bash evaluate statements. Usefull for debugging. This should monkeypatch the logging module.
[ { "docid": "6bd01b8d59927d5dbaae1f4bea3109f4", "score": "0.59094536", "text": "def tprint(self, msg, color, indent=0):\n\n if isinstance(color, TCOLOR):\n color = color.value\n else:\n if isinstance(color, str):\n color_map = {k.name: k.value for k in T...
[ { "docid": "225953f55941efe14144cfd23f423c83", "score": "0.7001603", "text": "def pp(text, value):\n print(text, color.highlight(str(value)), end='')", "title": "" }, { "docid": "66c955a449659697e657d941a867d827", "score": "0.6782162", "text": "def pl_red(cls, text):\n cls....
30aa2d13687dba10443f4215686391e6
Returns the next valid NMEA string which contains the pattern
[ { "docid": "48c59ba11064ea30a83fab334ec66bb8", "score": "0.6115745", "text": "def get_nmea_pkt(self, pattern):\n pattern_bytes = bytes(pattern, 'utf-8')\n while True:\n line = self.device_tx_rx.readline()\n # logging.debug(\"L80GPS:readline returned - \"+str(line))\n ...
[ { "docid": "f94f8c7a2891abe1746fe91e9b7ab2a9", "score": "0.577851", "text": "def AcceptPattern(self) -> str:", "title": "" }, { "docid": "c4cefcff5d25eb9a5bcb6e0328c023ca", "score": "0.57108873", "text": "def onePattern(pattern):", "title": "" }, { "docid": "005a64d102171...
79bf5f0140d5fc9c5aab83a7346697ae
Creates new task and adds it to self.tasks list.
[ { "docid": "58f29043119db2d1a970602d9f076cad", "score": "0.7127945", "text": "def add_task(self, name, deadline, description):\n self.tasks.append(Task(name, deadline, description))", "title": "" } ]
[ { "docid": "fff715377043acf3b789f9b33833fa82", "score": "0.78593135", "text": "def add_task(self, task):\n self.tasks.append(task)", "title": "" }, { "docid": "8cab1af511cd0fbcd1134dec97afbf29", "score": "0.78399205", "text": "def create_task(self, task):\n data = dict(...
8f480a818118d060dfba28738950ec74
Softens an image using one of several filters.
[ { "docid": "5d3cfea736e76f8320ee6dfb7e5d4a77", "score": "0.0", "text": "def __blur(src, type, radius):\n if(type is BlurType.Box_Blur):\n ksize = int(2 * round(radius) + 1)\n print(src)\n print(ksize)\n return cv2.blur(src, (ksize, ksize))\n elif...
[ { "docid": "87599eb62b460574ed33b965f0c6fdc1", "score": "0.6943461", "text": "def custom_filter(image):\n image = image.filter(ImageFilter.Kernel(\n size=(3, 3), kernel=(1, 0, 1, 0, 0, 0, 1, 0, 1)))\n return image", "title": "" }, { "docid": "da7ead8256ef484dbcd90737a1f125bd", ...
657f9833689eadd32ede8cb67f11aec8
Get the timestamp for user's site enrollment (utc aware)
[ { "docid": "7a30fdc32da68e4891f7ca477d3a5bdf", "score": "0.7706258", "text": "def get_user_site_enrollment_timestamp(user_uuid, site_uuid):\n user_site_metadata_response = baseline_service.get_user_site_metadata_by_user_sites(user_uuid, [site_uuid])\n if user_site_metadata_response['upsideCode'] !...
[ { "docid": "efdc97fdc119fbe9011a06d2c4f6c7bf", "score": "0.66244805", "text": "def get_timestamp():\n from datetime import datetime\n from time import mktime\n\n return str(mktime(datetime.utcnow().timetuple()))[:-2]", "title": "" }, { "docid": "78f0512e3b85471fedeac4dd7a1a02ad", ...
2668d5281c958faa32046850e7d7c55c
Creates a new association between place and amenity
[ { "docid": "8705a0904d83101d81d23cdca73d3e8e", "score": "0.71571684", "text": "def create_place_amenity(place_id, amenity_id):\n place = storage.get('Place', place_id)\n if place:\n amenity = storage.get('Amenity', amenity_id)\n if amenity:\n if amenity in place.amenities:...
[ { "docid": "6c177291a926dea00d249873ca4bcba6", "score": "0.73436147", "text": "def create_link_place_amenity(place_id, amenity_id):\n place = models.storage.get(Place, place_id)\n if not place:\n abort(404)\n amenity = models.storage.get(Amenity, amenity_id)\n if not amenity:\n ...
b045baebd3fdeb67f323f4540274d7b2
Call with lfile = Path of file with list of image file names bsz = Batch size you want this to generate csz = Output images will be size csz x csz niter = Resume at niterations isval = Running on train or val (random crops and shuffling for train)
[ { "docid": "aece2bf01fb86cd50abdd7e024ad11db", "score": "0.5739073", "text": "def __init__(self,lfile,bsz,csz,niter=0,isval=False):\n\n self.bsz = bsz\n self.csz = csz\n self.isrand = not isval\n\n # Setup fetch graph\n self.graph()\n\n # Load file list\n ...
[ { "docid": "c42d77f1f24bb0462c6d7dc01a486be2", "score": "0.67475164", "text": "def generateBatchesForOneEpoch(self):\n\n #printMessageVerb(self.FLAGverbose, '-->> generating batches ...')\n\n\n # Load the files if needed\n if (self.currentEpoch == 0) or ((self.currentEpoch > 0) and ...
3e91058010205107203c86ac299054e1
Remove small Poly series coefficients.
[ { "docid": "b3b43851ecc1c56368879bc4395bc2ab", "score": "0.0", "text": "def trimseq(seq):\n if len(seq) == 0 or seq[-1] != 0:\n return seq\n else:\n for i in range(len(seq) - 1, -1, -1):\n if seq[i] != 0:\n break\n return seq[:i+1]", "title": "" ...
[ { "docid": "8b9ee84b793ab334e701ba720865622b", "score": "0.6996968", "text": "def removepiston(self):\n\t\tZ = self.__coefficients__\n\t\tZ[0] = 0\n\t\treturn Z", "title": "" }, { "docid": "9e68ca731d7a246e64c0cc1333dab693", "score": "0.6676961", "text": "def removecoma(self):\n\t\tc...
efbb09e08a98276527ed32ce2c4be1f9
Set wifi Infrastrucure Parameters. Have to use models for loss, latency, bw..
[ { "docid": "bc2380ef1fb03f6cf8cb6a6d1049ad99", "score": "0.688999", "text": "def setInfraParameters(self, sta, ap, distance, wlan):\n if wlan != '':\n self.parameters(sta, ap, distance, wlan)\n else:\n for wlan in range(0, sta.nWlans):\n self.parameters...
[ { "docid": "382c49d23c62cfc09cc339a28e81a2f8", "score": "0.7367894", "text": "def set_wifi_parameters(self, *args, **kwargs):\n self._enable_warn()\n return", "title": "" }, { "docid": "603d08cbe987a95961a828e529e32973", "score": "0.65696967", "text": "def apply_wireles...
8580523f96004df044b4a84e4ff477c8
Should be called at the beginning of each training epoch to prepare the compression method to continue training the model in the `next_epoch`.
[ { "docid": "36ca0df77856774e73fc2d607a13f7e5", "score": "0.0", "text": "def epoch_step(self, next_epoch: Optional[int] = None) -> None:", "title": "" } ]
[ { "docid": "db01a079c55e78fc097df6ee0d63770f", "score": "0.68628335", "text": "def __call__(self, epoch):\n\n if not self.weights:\n self.initialize_weights()\n \n self.train(epoch)", "title": "" }, { "docid": "218f3fba5d19c7cb821fed89201ba63e", "score": "...
fff3bec00f214119f70bab2f9b98afd1
Contrast stretching by break point (number provided by Rick Kohrs)
[ { "docid": "936971accc3d801e92a7f02eea46286e", "score": "0.0", "text": "def breakpoint_stretch(C, breakpoint):\n lower = normalize(C, 0, 10) # Low end\n upper = normalize(C, 10, 255) # High end\n\n # Combine the two datasets\n # This works because if upper=1 and lower==.7, ...
[ { "docid": "ca537003831770effb6236db0cfa5019", "score": "0.63466364", "text": "def adj_contrast(src):\n clahe = cv2.createCLAHE(clipLimit=10.0, tileGridSize=(2, 2))\n return clahe.apply(src)", "title": "" }, { "docid": "b7df05c15d94e7d7f048f8f1c1ef6835", "score": "0.6288289", "...
80bb542c4b50552131d7e18b214540f7
Returns ``True`` if there were any warnings.
[ { "docid": "c1c4bffdf737a4995d54951d0a165374", "score": "0.8521827", "text": "def has_warnings(self):\n return len(self._warnings) > 0", "title": "" } ]
[ { "docid": "c28235583242444733b88c1d6dd7ca90", "score": "0.8699406", "text": "def has_warnings(self):\r\n if self.get_warnings():\r\n return True\r\n else:\r\n return False", "title": "" }, { "docid": "9b6d3ab68cfedf5e1c8745e5c6147a81", "score": "0.860...
5955f2344749e17e519010ce65509e09
Computes the closest distances for all the atoms
[ { "docid": "48e9f35731dbbe50f315b81df81e0041", "score": "0.6647483", "text": "def close_distances(self):\n if self._pairs is None or self._distances is None:\n\n if self.structure.is_periodic:\n pcm_log.debug('Computing distances from scratch...')\n pairs_...
[ { "docid": "34a6f16d64add96004fd651c569f8446", "score": "0.6619735", "text": "def get_dist(self,atom):\n d = self.r-self.r[:,atom].reshape(3,1) # subtract the location col from the matrix for each atom\n dist = np.sqrt((d*d).sum(axis=0))\n dist_copy = dist.copy()\n dist_copy[dist_co...
4638e155b95bdf2494f442218efe45ac
Gets the parameters for the grid search testing with bagging.
[ { "docid": "ccf7f78b93c8282a23d02b26fe7fdd86", "score": "0.78553545", "text": "def get_bagging_grid_parameters():\n return dict(\n n_estimators=[5, 25, 100],\n bootstrap_features=[False, True],\n bootstrap=[False, True])", "title": "" } ]
[ { "docid": "b89661190b87e1ffca562123b1d18608", "score": "0.71491104", "text": "def get_boosting_grid_parameters():\n return dict(\n n_estimators=[5, 25, 100],\n learning_rate=[0.5, 1, 2])", "title": "" }, { "docid": "3f8730fa6fbd992972292a7c161543f3", "score": "0.6752372...
a2a3b4e78852fea42966da891506ed81
Parses the ranking CSVs and writes them to the database.
[ { "docid": "f86987d541533bda041b2f677783d392", "score": "0.0", "text": "def fillrankingdb(path=os.path.join(SCRAPED_DATA_DIR, \"rankings\", \"bgg\")):\n django.core.management.call_command(\"fillrankingdb\", path)", "title": "" } ]
[ { "docid": "b0c5db9da7df4319b33a769deacddba5", "score": "0.63729155", "text": "def save_ranks(self):\n ranks_out = os.path.join(self.out_dir, \"ranks.tsv\")\n self.ranks.to_csv(ranks_out, sep=\"\\t\")", "title": "" }, { "docid": "bf5de976bf2b4566427a0d2912a11649", "score": ...
46c36c1019f8fb27aefa21a649fc8f63
Performs a scatter of data to the different available parallelizer processes.
[ { "docid": "3a86da7d6c1bf390c35945bfb4e57717", "score": "0.63945365", "text": "def scatter(self, data, **kwargs):\n\n if self.contract is not None:\n self.contract.handle_call(self, \"scatter\")\n if self.on_main:\n locs = list(self.comm.locations) # gotta be safe\n ...
[ { "docid": "6c8c17da0c38df782cee0143cc7a70a4", "score": "0.7503602", "text": "def scatter(self, data, **kwargs):\n raise NotImplementedError(\"Parallelizer is an abstract base class\")", "title": "" }, { "docid": "1dfb67fb390b7da012f3d07ed338dee0", "score": "0.6475183", "text"...
b863464a6d76e353b40be6333e3a7837
Returns a string of text in a filename format
[ { "docid": "0cfbf84790b3da0475cef545c5bfff4b", "score": "0.7140004", "text": "def FileNameFormatter(strText):\n import string\n\n # Strip text of punctuation\n for c in string.punctuation:\n strText = strText.replace(c, \"\")\n # Strip WhiteSpaces from FileName\n if \" \" in strTex...
[ { "docid": "9654ec3c00778fe5a356bffd25ba6a86", "score": "0.7665484", "text": "def get_file(self, text):\n\n\t\treturn text.strip().replace('_', '/')", "title": "" }, { "docid": "b3c3595ed9340ebfde71fc54b3d4e7f2", "score": "0.7471361", "text": "def filename():\n return ''", "ti...
7a67b4d613ccae500306736feb8cf311
Performs a batch normalization using a standard set of parameters.
[ { "docid": "d222ee00d2451852c5d10f9346db41f4", "score": "0.7165613", "text": "def batch_norm(inputs, training, data_format):\n # We set fused=True for a significant performance boost. See\n # https://www.tensorflow.org/performance/performance_guide#common_fused_ops\n return tf.layers.batch_normalizat...
[ { "docid": "583df9d602bfa25f63378da156b52475", "score": "0.7308336", "text": "def normalize_batch(x: torch.Tensor) -> torch.Tensor:\n f = Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])\n\n for b in range(x.shape[0]):\n f(x[b])\n\n return x", "title": "" }, { ...
184ed9fcd6e5ef4e35599ae0f89801a1
Split a list into a list containing multiple lists of size
[ { "docid": "0c68170fe1f6aa41880bd752a7ad06b8", "score": "0.0", "text": "def thread_group(total_items, size):\n per_thread = round(len(total_items) / int(size))\n groups = []\n group = []\n\n for item in total_items:\n group.append(item)\n if len(group) >= per_thread:\n ...
[ { "docid": "3ba0007ac8998de32b42301187625b06", "score": "0.7920258", "text": "def get_chunks(input_list, num_chunks):\n\n chunked = np.array_split(input_list, num_chunks)\n return [x.tolist() for x in chunked]", "title": "" }, { "docid": "88c3da6b0e968a4c0f0d53cd0f8dedf7", "score":...
acb254396889db07f767e23ddd7235d3
Get LED strip brightness
[ { "docid": "db77cea0e3afdc2fa5b26d136885a699", "score": "0.68747914", "text": "def getBrightness(self) -> int:\n return self._brightness", "title": "" } ]
[ { "docid": "6d2a1e1f20aa611fb3ae4a3d6f103186", "score": "0.7632183", "text": "def brightness(self) -> int:\n pass", "title": "" }, { "docid": "944a8dc948b504cffde835cb0abc5795", "score": "0.7624959", "text": "def brightness(self):\n return libratbag.ratbag_led_get_brigh...
47e732ddee436c9c5b80be0e25da1794
Parse the next inline element in subject, advancing subject position and adding the result to 'inlines'.
[ { "docid": "719ebba8497de2ee4cbbf01758c86eaa", "score": "0.69148296", "text": "def parse_inline(self, inlines):\n c = self.peek()\n# print 'C', repr(c)\n# print 'POS', self.pos\n# print 'SUB', repr(self.subject)\n# pprint([i.dump() for i in inlines])\n r = N...
[ { "docid": "3abf27bb73f04c924719f7f6a70c8946", "score": "0.57719964", "text": "def inlines(self):\n for inline in range(self.startInline, self.endInline+1, self.stepInline):\n yield inline", "title": "" }, { "docid": "6621a5f0a1ef41c160ed721707835a08", "score": "0.54631...
7d2ae14e0f07f38686ce1cc6442e1b10
Helper function to build Sprint name for JIRA.
[ { "docid": "592bbad6008c85f9b56ba95d57f94b38", "score": "0.72261506", "text": "def build_sprint(operational_year, operational_quarter, sprint_length, sprint_index):\n return 'Y%s-Q%s-L%s-S%s' % (\n operational_year, operational_quarter, sprint_length, sprint_index\n )", "title": "" } ...
[ { "docid": "9c995330fc18315b488d0d98da722891", "score": "0.6251241", "text": "def get_trial_name_capture1(user, trial,capture):\n return 'Suturing_%s%03d%s' % (user, trial,capture)", "title": "" }, { "docid": "b5560e31e7d53022dc1693d599b9e19c", "score": "0.6211164", "text": "def m...
4357cc9622aa6e03a139d2d3ea2b28be
Create a string to be written to a Colvars file.
[ { "docid": "2034dd75dedcb8a203a547e72c16281c", "score": "0.0", "text": "def _create(star, dna, lower, upper, k, steps, start, stop):\n group1_end = star\n group2_start = star+1\n group2_end = star+dna\n colvar = \"colvar {{\\n name dist\\n distance {{\\n group1 {{atomNumbersRange 1-{}}}...
[ { "docid": "84153e24371b21890b7573ad151587da", "score": "0.6302888", "text": "def make_namd_colvar_string(self):\n serial_group1 = [str(index+1) for index in self.group1]\n serial_group2 = [str(index+1) for index in self.group2]\n serial_group1_str = \" \".join(serial_group1)\n ...
0d28e8ef4d44c78a166c75c014e756ac
Exports a batch of telemetry data.
[ { "docid": "083b6055270d44fb835e141133c0d353", "score": "0.5884133", "text": "def export(\n self, metric_records: Sequence[MetricRecord]\n ) -> \"MetricsExportResult\":", "title": "" } ]
[ { "docid": "a94acecd27598216250fe5ba9c86dc4b", "score": "0.62449056", "text": "def export():\n for agent in Performance.agentList:\n agent.performance.__exportAgentPerformance__()", "title": "" }, { "docid": "fbac169c2b86f9fe4415042d706e091a", "score": "0.6139936", ...
dcd5cfeec1176c6ac0717df07bad0e9a
Sends the help message
[ { "docid": "6a6dad1f3b2ffea5792f1b3258f003ef", "score": "0.0", "text": "async def help(self, ctx):\n\n await ctx.send('Type `>run` and python script to run python')", "title": "" } ]
[ { "docid": "dc0ada3b234879429e494800a76a63e9", "score": "0.8490778", "text": "def do_help(self, *args):\n self.stdout.write(HELP_MESSAGE)", "title": "" }, { "docid": "d47fb2e6b3684f66a3ede28374e5bee6", "score": "0.81821424", "text": "def do_help(self):\n self.send_bot_m...
835c11f46f8cfb87636628b33f3e0e4b
Create leaderboard view for Round2
[ { "docid": "2fe3cc33225358d9525373963b157990", "score": "0.56610113", "text": "def rd2leaderboard(request):\n\n #Add views\n playing_players = Rd2SlotModel.objects.filter(player_name__isnull=False)\n\n #Add context\n context = {\n 'playing_players': playing_players,\n }\n\n ...
[ { "docid": "437d7c5565d4948aa3c19c5e239cc8fe", "score": "0.7503058", "text": "def leaderboard(self):\n click.echo(\"\\n----Leaderboard----\")\n players = OrderedDict(\n sorted(self.players.items(), key=lambda x: getitem(x[1], \"round\"))\n )\n columns = [\"Rank\", ...
ce428872890f3297fc66b259f0a143e2
Gets the bullets sprite group.
[ { "docid": "02462abbbe3a9e237407eea959f7c752", "score": "0.6066278", "text": "def get_bullets (self):\n\n return self.bullets", "title": "" } ]
[ { "docid": "15d234b9db0d0fc7dd1acbff40c75c5b", "score": "0.6432783", "text": "def sprites(self):\n return self._group.sprites()", "title": "" }, { "docid": "de6a149d4ec31f0f540233fe9e875647", "score": "0.6042333", "text": "def loadBullet(self):\n bullet = Projectile(sel...
9b1add6e10b15c71fe389d9b7764923e
Whether node to node encryption is enabled.
[ { "docid": "8b7f9b5071a1577ec845863ad1fdb178", "score": "0.57095563", "text": "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "title": "" } ]
[ { "docid": "3fbe407ec13d3ca2f66c52dec688511e", "score": "0.72343796", "text": "def encryption_at_host_enabled(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"encryption_at_host_enabled\")", "title": "" }, { "docid": "87e151fc000a0308a51f52aafeee4a4e", "score": ...
b2e408f4c573f516b292aaff446c06b2
r""" Return a Steiner Quadruple System on `n` points.
[ { "docid": "d1bc147bc816209e50c649bbb8517d26", "score": "0.7664719", "text": "def steiner_quadruple_system(n, check = False):\n n = int(n)\n if not ((n%6) in [2, 4]):\n raise ValueError(\"n mod 6 must be equal to 2 or 4\")\n elif n == 4:\n sqs = IncidenceStructure(4, [[0,1,2,3]], ...
[ { "docid": "cf3f839797ef63cebb2f18a384cec215", "score": "0.60831946", "text": "def chebpts(n):\r\n\r\n # Special case (no points)\r\n if n == 0:\r\n x = []\r\n w = [] \r\n v = []\r\n t = []\r\n # Special case (single point)\r\n elif n == 1:\r\n x = 0 \r\n ...
3a3a2e849b00f11158ef1aeb7e55f162
See the real Accessor for a description.
[ { "docid": "db55e38a64c281fd6e8ab26938b883f2", "score": "0.0", "text": "def fetch_points(self, metric_name, time_start, time_end, step,\n aggregator_func=None, _fake_query_results=None):\n if not _fake_query_results:\n points = self._metric_to_points[metric_name]\n ...
[ { "docid": "9b1f057f9b6b248713bf759651dc2c80", "score": "0.7138444", "text": "def get(self, ):\n\t\tpass", "title": "" }, { "docid": "4560c322427918f793eb8b1980ad174e", "score": "0.71203256", "text": "def _get(self):\n raise NotImplementedError", "title": "" }, { "...
633bb61656b4648540046f3aadfbf43e
main function for lcoal usage
[ { "docid": "a8ec5a21efbccc76636cc0ff1be8f8cc", "score": "0.58221775", "text": "def main():\r\n test()", "title": "" } ]
[ { "docid": "08aa0c5cc07c5efe590ba89320b45dbc", "score": "0.69941837", "text": "def main():", "title": "" }, { "docid": "08aa0c5cc07c5efe590ba89320b45dbc", "score": "0.69941837", "text": "def main():", "title": "" }, { "docid": "08aa0c5cc07c5efe590ba89320b45dbc", "scor...
f12dbbd813dce1dfccea81d087209d5a
Create a simple user that we link all the answers to.
[ { "docid": "f841e3174f163c6984457f84a2649161", "score": "0.0", "text": "def begin(request):\n request.session.flush() # \"Logout\" from any previous session\n\n if request.method == \"POST\":\n new_name = request.POST[\"name\"]\n new_motto = request.POST[\"motto\"]\n # Try th...
[ { "docid": "c40661dc617572feba289b687098d62c", "score": "0.7658639", "text": "def create_user(self, user_id: str, user_name: str) -> None:", "title": "" }, { "docid": "32f5b47e07cd7cd2b99bba64fa162310", "score": "0.7454858", "text": "def createUser():\n user_data = fb.get_initial_...
96e071f315bfe84fab392617e3d43f4e
Sets the signup_url of this GoogleEnterprise.
[ { "docid": "c6aaf918a064923c95e551ecbc6b8ad3", "score": "0.782311", "text": "def signup_url(self, signup_url):\n if signup_url is not None and len(signup_url) < 1:\n raise ValueError(\"Invalid value for `signup_url`, length must be greater than or equal to `1`\")\n\n self._signu...
[ { "docid": "78bdf485adf3c2eb3ffcc3a06ee8dbac", "score": "0.6903089", "text": "def signup_url(self):\n return self._signup_url", "title": "" }, { "docid": "c927cb649a708861b0d0105a9309bbd9", "score": "0.57198805", "text": "def ___set_url(self, url):\n self.__set_url(url)...
850b14adc74914000ecee267cb5a171e
Replaces 'pattern' in 'string' with 'sub' if 'pattern' starts 'string'.
[ { "docid": "ebf3a6bfd34aa2c3d8d9c5914ab345ea", "score": "0.77272403", "text": "def lreplace(pattern, sub, string):\n return re.sub('^%s' % pattern, sub, string)", "title": "" } ]
[ { "docid": "e224a45e914a1459828b24848b832fbe", "score": "0.65532935", "text": "def sub(self, pattern: str, repl: Union[str, callable], string: str, strict: bool = True, case_sensitive: bool = False) -> str:\n if case_sensitive:\n result = re.sub(pattern, repl, string)\n else:\n ...
6b82f7758ded5229235eb1ea75beaed1
Show specific post comment
[ { "docid": "e37729c20a16f0bc02a8c8d3290c90c5", "score": "0.59195065", "text": "def comment(post_id, comment_id):\n check_comment(post_id, comment_id, False)\n\n db = get_db()\n comment_sql = get_comment_of_post(db, post_id, comment_id)\n\n comment = dict(comment_sql)\n return jsonify(comm...
[ { "docid": "90b5fce23163cc1947185be27a583845", "score": "0.7372231", "text": "def post_detail(request, id):\n post = Post.objects.get(id=id)\n return render(request, 'comment/post_detail.html', {'post': post})", "title": "" }, { "docid": "c7bd1ff09b7932f489e77bb54fe2afb7", "score":...
d892852aa3e7a6ea40c368be4d467adc
Convert value to boolean.
[ { "docid": "62d72b52a5d57f1f68f69a09dd84d2d0", "score": "0.80972165", "text": "def toBool(self, val: Any) -> bool:\n if type(val) == bool:\n return val\n elif type(val) == int:\n return val != 0\n elif type(val) == str:\n v = val.lower()\n ...
[ { "docid": "5d4bd8517d78334032a46f042455bfcc", "score": "0.863882", "text": "def to_boolean(value: Any) -> bool:\n return BooleanConverter.to_boolean_with_default(value, False)", "title": "" }, { "docid": "fee659ff6685b59b558ebd84f3dfcd34", "score": "0.85566324", "text": "def ...
5f2376e139bf9216035dd5e8721f8c77
Get a 2d numpy array of obstacles in the form [[x, y], [x, y], ...]
[ { "docid": "74d1869550c2ceeb24977a200a7bdbae", "score": "0.7013155", "text": "def get_obstacles(self):\n return np.argwhere(self.obstacles == True) * self.config.grid_reso", "title": "" } ]
[ { "docid": "3e0ccacd4db9e4bc1fcb1726c1a0fa96", "score": "0.7382825", "text": "def obstacles(self):\n return list(self._obstacles)", "title": "" }, { "docid": "6586c95dc5ce60c31e82d33802373a2e", "score": "0.7301217", "text": "def get_obstacles_positions(obstacles: []) -> List[P...
d9b703dfa0713d148772683e9d85d349
Reduce the items in this list to identifiers that can be used to recreate them from scratch. This adds each item to the cache too.
[ { "docid": "b0417d0cd78b920baa1079318656fc4c", "score": "0.69286984", "text": "def _pack_items(self):\n identifiers = tuple(self.identify_items(self))\n cache_keys = self.make_cache_keys(identifiers)\n cache_items = dict(izip(cache_keys, self))\n self.cache.set_many(cache_ite...
[ { "docid": "04f3496398ff04367f08c593ebc8f7c4", "score": "0.71066976", "text": "def _unpack_items(self):\n\n # Prevent the unpack operation from occurring more than once.\n if hasattr(self, '_unpack'):\n delattr(self, '_unpack')\n else:\n return\n\n # The...
95246c749a7299f7107f201320e37e0a
Updates the World Object Grid
[ { "docid": "e215fbe7a36102b1ca32dcd123523225", "score": "0.7229946", "text": "def update_world_object(self, Object, x, y):\n self.WOG[x][y] = Object", "title": "" } ]
[ { "docid": "ccb16c16812bbd50b00fe75b0f0a58a2", "score": "0.6663007", "text": "def update(self, player, obj_list):\n for obj in obj_list:\n obj.update(obj_list)\n player.update(self.map.tile_boxes)", "title": "" }, { "docid": "4251b18b88419fdcb5c977011fe47ba1", "s...
fe15a1a597b13a43456fd8bdf2a252fd
rejects a nonnumeric input of "foo"
[ { "docid": "1232bc5326ddca1da44076edffbc92a9", "score": "0.0", "text": "def test_reject_foo():\n check50.run(\"python3 cash.py\").stdin(\"foo\").reject()", "title": "" } ]
[ { "docid": "eb8de4b095347f3422d0d8ab42c05c67", "score": "0.6866605", "text": "def check(param):\n try:\n param = float(param)\n\n except ValueError:\n print(\"Incorrect input \\\"%s\\\". Must be number.\" % param)", "title": "" }, { "docid": "a6ba2276e2f4248e8994b8cae14a2...
684d4bb24cc2591d34e2cb4b07a3c8d5
where should we go next tick?
[ { "docid": "50f191c660eb379fbac6e791db39402f", "score": "0.0", "text": "def nextStep(self):\n options = self.surroundingValues()\n\n a = [self.expandTile(tile, tile.explored) for tile in options]\n\n m = min(a)\n maxIndexes = [i for i, j in enumerate(a) if j == m]\n\n\tprint ...
[ { "docid": "47e4d0cbcb6e027f154a33d964fd0780", "score": "0.76231015", "text": "def tick(self):", "title": "" }, { "docid": "47e4d0cbcb6e027f154a33d964fd0780", "score": "0.76231015", "text": "def tick(self):", "title": "" }, { "docid": "c6895c04d064960b1ae0bf4a4da83d20", ...
ba9bf18738bbfb8d5804a416357f11d0
Read in a schema definition for our part of the config and hook it
[ { "docid": "4a9c2e5bea03e0bb0804ad72647ec2bf", "score": "0.0", "text": "def extend_schema(self, parent_schema):\n schema_path = os.path.join(self.dogen.pwd, \"schema\", \"cct_schema.yaml\")\n schema = {}\n with open(schema_path, 'r') as fh:\n schema = yaml.safe_load(fh)\n...
[ { "docid": "20a2e7a8484156b260fdb229de1e1660", "score": "0.7257588", "text": "def load_schema(self):\n raise NotImplementedError", "title": "" }, { "docid": "a12bfee9e3094a2afc066b5de193e7d9", "score": "0.72208834", "text": "def input_config_schema(self) -> IDefinitionConfigSc...
ba2f90b28966006b3764a6a8cadb2c84
Returns the importance of term in document id. If the term isn't in the document, then return 0.
[ { "docid": "40550b3d44025bcbb8fdf4c3d7ea859c", "score": "0.718705", "text": "def imp(term,id):\r\n if id in postings[term]:\r\n return postings[term][id]*inverse_document_frequency(term)\r\n else:\r\n return 0.0", "title": "" } ]
[ { "docid": "1ab6cc16ab1cfd758823ca6ce6adb0c8", "score": "0.73194516", "text": "def get_tfidf_scores(self, term, document):\n if term in self.tf[document]:\n return self.tf[document][term] * self.idf[term]\n else:\n return 0", "title": "" }, { "docid": "a53...
ae240ac6cc2863ef66089a55dc3eb4ed
This method is queue scheduler and executer \n
[ { "docid": "b9240612058aa55653c74834c388d516", "score": "0.0", "text": "def lcfs_alg(self, process_waiting):\n cpu_clock = 0\n local_finished_queue = []\n while len(process_waiting) is not 0:\n proc = process_waiting[-1]\n cpu_clock += 1\n\n if proc....
[ { "docid": "ee659d2f4dda0e351f0bd89aaa2c9951", "score": "0.6921316", "text": "def processQueue(self):", "title": "" }, { "docid": "09982e5cbe4c7df30fe4ae28f60d7e1f", "score": "0.6735559", "text": "def scheduler(self):\n j = self.updater.job_queue\n print('getting daily ...
7cf6d7a7b128f652585284b8eb15cfc0
Emits a 'cld' instruction.
[ { "docid": "e034cd2a187354cc37d2628c032dc82a", "score": "0.5156586", "text": "def cld(self) -> None:\n self.buf[self.pos] = 252\n self.pos += 1", "title": "" } ]
[ { "docid": "10f6e1d757e33098a497f06762b836a0", "score": "0.6387597", "text": "def cl(self, c):\n self.force_menu('oper')\n self.send('cl ' + str(c))\n return output(self.proc.before)", "title": "" }, { "docid": "93fe9d0119da5f74106fdbe79ae1cdc7", "score": "0.5471392"...