query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
625027057adfb81e74205b67f5098fb6
Initialises an bootstrap regression object.
[ { "docid": "15bf4fe75cae3b8a7bb5d8e482c58e9f", "score": "0.6192862", "text": "def __init__(self, X_data, y_data, reg):\n\n assert X_data.shape[0] == len(y_data), (\"x and y data not of equal\"\n \" lengths\")\n\n assert hasattr(reg, \"fit\"), ...
[ { "docid": "ee09708f26f2200f9859604ff3d61d46", "score": "0.67858565", "text": "def initialize(self):\n self.logreg = linear_model.LogisticRegression(C=1e5)", "title": "" }, { "docid": "f589575f2419ec69db992f331c348cab", "score": "0.64760876", "text": "def __test_bootstrap_fit(...
329cc8ceae202def4653bbdb4e20f1e9
Toplevel ``on_close`` logic that provides cleanup logic for realtime communication sessions.
[ { "docid": "c495918fcefa2583801aa3d0e3203d5d", "score": "0.0", "text": "def on_close(self, handler, socket): # pragma: no cover\n\n if not socket.state is socket.State.ERROR:\n socket.set_state(socket.State.CLOSED)\n handler.on_close(socket.state is not socket.State.ERROR)\n return self",...
[ { "docid": "a4cd00493476fdb45cd6d87da097eb94", "score": "0.7646872", "text": "def on_close(self, *args):", "title": "" }, { "docid": "14fa41a093a45f741fdc1c28af7d6ed6", "score": "0.73240906", "text": "def on_close(_):\n logging.info('Websocket connection closed.')", "title...
c55d4eeccc5a2094e0571823aa305396
Test aall for gt Array code i. General test odd length array without SIMD.
[ { "docid": "3f2746b88d212b25fc12f6bb1dabfa96", "score": "0.0", "text": "def test_aall_basic_gt_b3(self):\n\t\t# One test value near the end of the array is equal to the test value.\n\t\ttestval = 842150449\n\t\tarrayval = 1052688062\n\t\ttestdata = array.array('i', [arrayval] * self.arraylength)\n\t\tte...
[ { "docid": "2f27d5e3b57c09c8c86baa613f177d15", "score": "0.69521815", "text": "def test_aall_basic_gt_b2(self):\n\t\t# All data values are equal to the test value.\n\t\ttestval = 1633771875\n\t\tarrayval = testval\n\t\ttestdata = array.array('I', [arrayval] * self.arraylength)\n\n\t\t# Verify test compa...
66319ebc81fc61a9b8194f91f5fbe55b
Port format from javascript to python version of Overcooked
[ { "docid": "9327d0b064b33d66aafa8ae053ee0aa1", "score": "0.0", "text": "def json_joint_action_to_python_action(json_joint_action):\n if type(json_joint_action) is str:\n json_joint_action = eval(json_joint_action)\n return tuple(json_action_to_python_action(a) for a in json_joint_action)", ...
[ { "docid": "d1fce47ddabd33bf2fffe6e3e7c29fe9", "score": "0.5453539", "text": "def washJSONinput(jsontext):\n #jsontext = re.sub('\\n', '', jsontext)\n jsontext = re.sub(r\"(?<!\\\\)(\\n\\r|\\n|\\r)\", \" \", jsontext)\n jsontext = re.sub(',\\s*]', ']', jsontext)\n jsontext = re.sub(',\\s*}',...
0a9782ee81bb26fb84e039a1ecbdf41a
Get the identifying parameters.
[ { "docid": "e543393755b1051c6b633dcab2fa8d74", "score": "0.6742015", "text": "def _identifying_params(self) -> Mapping[str, Any]:\n return {\n \"model_id\": self.model_id,\n \"model_kwargs\": self.model_kwargs,\n }", "title": "" } ]
[ { "docid": "d0eb583f6810b34496922a0da6388052", "score": "0.723974", "text": "def getParams(self):\n pass", "title": "" }, { "docid": "73464deb87e88bdec05ef72afc5f7f3b", "score": "0.7190109", "text": "def get_params(self):\n raise NotImplementedError", "title": "" ...
a85ff5c8323343bb03dfbcf523a3880f
Actual Sending of the sms
[ { "docid": "68efa6b52c41765c3886efd016195294", "score": "0.7036426", "text": "def send_message(self, sms_gateway_id, from_number, to_number, sms_content, my_model_name='', my_record_id=0, media=None, queued_sms_message=None, media_filename=False):\n sms_account = self.env['sms.account'].browse(sm...
[ { "docid": "99a9ead6ee65b8d6a10b557b8b247a88", "score": "0.7578458", "text": "def _send(self, message):\r\n charset='UTF-8'\r\n params = {\r\n 'action' : 'sendsms',\r\n 'user' : self.get_username(),\r\n 'password' : self.get_password(),\r\n 'from' : mess...
4af6ee9402e059ed8fad043e8af712a8
Safely JSONencode an object. To protect against XSS attacks, HTML special characters (, &) and unicode newlines are replaced by escaped unicode characters. Django does not escape these characters by default. Output of this method is not marked as HTML safe. If you use it inside an HTML
[ { "docid": "9e7a27980d8bc0da5b37ef78e5665b10", "score": "0.7651096", "text": "def safe_json(data):\n unsafe_chars = {\n \"&\": \"\\\\u0026\",\n \"<\": \"\\\\u003c\",\n \">\": \"\\\\u003e\",\n \"\\u2028\": \"\\\\u2028\",\n \"\\u2029\": \"\\\\u2029\",\n }\n json...
[ { "docid": "d1642861764950e40025644edb7a72f9", "score": "0.75244474", "text": "def json_encode(obj):\r\n return to_unicode(_json_encode(obj))", "title": "" }, { "docid": "9e1e4e8590df6c0ca5534c6946317323", "score": "0.71535826", "text": "def _safe_str(obj):\n try:\n retu...
504cd070164a98c21131c2e0fc61571e
Exclude certain well types from aggregate or individual metrics.
[ { "docid": "f528baa413011893daa3efb05e640201", "score": "0.0", "text": "def build_exclude_query(query, exclusions, joined_entities):\n if EXCLUDE_LOW_EVENTS in exclusions:\n if WellMetric not in joined_entities:\n query = query.join(WellMetric).filter(WellMetric.accepted_event_count...
[ { "docid": "47d34d37d13fe7831c767a526b208400", "score": "0.59837747", "text": "def remove_measurements(self):\n def ismeasurement(gate):\n return isinstance(gate, qiskit.circuit.measure.Measure)\n self.data = [data for data in self.data if not ismeasurement(data[0])]\n re...
bd8e878260d0ab711a53aff554de6151
Selects a piece when it is clicked.
[ { "docid": "2075c1dd5a97e285e31d5632515370a7", "score": "0.61129594", "text": "def handleMouseRelease(self, event):\n \n # if the piece is already selected when it is clicked, it deselects it\n # and changes its border color back\n if self._selected:\n self.changeC...
[ { "docid": "219190222d15d19ce3881bf63f04aa43", "score": "0.7438641", "text": "def click(self, event) -> None:\n colsize = rowsize = 64\n\n # The canvas is 512 by 512.\n # But our board is 8 by 8\n # This converts our clicked position to what it is on the board.\n # (in...
6ecb231ff5096ce78fbd6defbb166c28
r"""__bool__(DoubleVector self) > bool
[ { "docid": "4692d5c6054462722656174c599970a4", "score": "0.8644724", "text": "def __bool__(self) -> \"bool\":\n return _model.DoubleVector___bool__(self)", "title": "" } ]
[ { "docid": "1df04d9ce4808370831cdb9d7edd5e08", "score": "0.8609209", "text": "def __bool__(self) -> \"bool\":\n return _model.DoubleVectorVector___bool__(self)", "title": "" }, { "docid": "1df04d9ce4808370831cdb9d7edd5e08", "score": "0.8609209", "text": "def __bool__(self) -> ...
2293d781810fba97ee398b65fb1842c4
Constructs a ResNet18 model.
[ { "docid": "3bb9cb5b6202c6c99c26eae0170eee3a", "score": "0.0", "text": "def se_resnet18(num_classes):\n model = ResNet(SEBasicBlock, [2, 2, 2, 2], num_classes=num_classes)\n model.avgpool = nn.AdaptiveAvgPool2d(1)\n return model", "title": "" } ]
[ { "docid": "2c8d7eb1332a08e0aab78e517cc4e588", "score": "0.7498665", "text": "def resnet18(pretrained=True, **kwargs):\n model = ResNet(BasicBlock, [2, 2, 2, 2], **kwargs)\n # model.class_classifier: (512, cls)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(\n mod...
c180c31a7a2b1a63b65435bd5ca34831
makes a colon delimited list from List
[ { "docid": "fa75ac79feca99b06e944e975eadf784", "score": "0.7750035", "text": "def makelist(List):\n clist=\"\"\n for element in List:\n clist=clist+element+\":\"\n return clist[:-1]", "title": "" } ]
[ { "docid": "11d1cb31209e79b9f40e262fba2d7268", "score": "0.651048", "text": "def splitingFunction(splitList):\n newlist = []\n for item in splitList:\n split = item.split(':')[0]\n newlist.append(split)\n return newlist", "title": "" }, { "docid": "8669db494fbd1b91d743...
988e2a7752f8000ebc216e3b5fe90fff
This is the creator. It can be passed the the min/max X and Y values for the plane, and a transformation function (f). There are default values if the parameters are not passed to the creator. The creator then generates a 2D plane filled with the X & Y complex number coordinates of the specified plane transformed by th...
[ { "docid": "ad9e077f02647ddb17277f388d0ccd4c", "score": "0.64841443", "text": "def __init__(self, newXmin=-5., newXmax=5., newXlen=1001, newYmin=-5., newYmax=5., newYlen=1001, f=lambda x: x, maxLoop=100):\n self.xmin = newXmin\n self.xmax = newXmax\n self.ymin = newYmin\n sel...
[ { "docid": "5e86faa6a75ba40509e0990332270853", "score": "0.6098736", "text": "def make_plane():\n\n source = vtk.vtkPlaneSource()\n source.SetOrigin(-10.0, -10.0, 0.0)\n source.SetPoint2(-10.0, 10.0, 0.0)\n source.SetPoint1(10.0, -10.0, 0.0)\n source.SetXResolution(20)\n source.SetYRes...
0432d19c960ac28feb72115c29bf9549
This generator outputs unique lines from a file line by line.
[ { "docid": "8af6f1e81a26b94d3e539cfb7442eae7", "score": "0.7510291", "text": "def read_file_line_by_line(file_name):\n with open(file_name) as f:\n unique_strings = []\n while True:\n line = f.readline()\n if line not in unique_strings:\n unique_stri...
[ { "docid": "8d23355987653c742f5f54eaca177c26", "score": "0.6710934", "text": "def gen_lines(files):\n for file in files:\n with open(file, 'r') as fin:\n for line in fin.readlines():\n yield line", "title": "" }, { "docid": "7ace98676562ef4bdfae958f481201d...
217c6404ce15f75ab8975641f863146e
Discretization of scattering energies.
[ { "docid": "0d2a37ec01b25e7aa9ff57dfa9c9c6a7", "score": "0.53659004", "text": "def discrete_energies(E, dE, N=1024, WE=8.):\n # Discrete energies that contains the \"elastic\" points:\n # nu0=nu2 and nu0=nu3.\n NdE = np.ceil(N / 2 / (dE / 2 + WE) * dE / 2)\n Lq = N / 2 / NdE * dE / 2 if np.a...
[ { "docid": "336d994e96b34208653edd65317db622", "score": "0.5948378", "text": "def _spatial_dispersal(self, iteration: int, n_iterations: int) -> None:\n\n coef = ((n_iterations - iteration) ** self.e) / (\n (n_iterations + c.EPSILON) ** self.e\n )\n\n self.sigma = coef * ...
4f6e8955cbc1ecda2a3c874da38e334e
Convert the dict of probabilities into a single numpy array. Used to pass the probabilities to the C numpy extension.
[ { "docid": "7357f9b100e6c8991a9109526506d64c", "score": "0.63100165", "text": "def _prob_dict_to_np(self, nframes, naive_bayes=False):\n\n # Get a list of classes for results\n clses = self._classnames\n k = clses[0]\n\n # Allocate and fill each array\n sprobs = np.zer...
[ { "docid": "00e96822a67220e93768623e53908805", "score": "0.68825066", "text": "def dict_to_array(dicti):\n vals = [i for i in dicti.keys()]\n counts = [i for _, i in dicti.items()]\n return np.repeat(vals, counts)", "title": "" }, { "docid": "00e96822a67220e93768623e53908805", "...
67185509529d539e7c34a5b449ea8449
Stores the given value via the specified ``overlay`` and ``key``.
[ { "docid": "e3998d155d60a5f22ecf7f83b4401d29", "score": "0.80998534", "text": "def setData(self, overlay, key, value):\n ovlDict = self.__overlayData.get(overlay, None)\n\n if ovlDict is not None:\n ovlDict[key] = value\n else:\n self.__overlayData[overlay] = {...
[ { "docid": "b6bf62ad11dfb2ed2bf62b7d4870f25d", "score": "0.60467625", "text": "def put(key, value):", "title": "" }, { "docid": "65cad391471ae0eb47c07344470a771c", "score": "0.59677273", "text": "def put(self, key, value):", "title": "" }, { "docid": "e578787b9ae54aa9ef9e...
a406a3ccb0968cd4c5d2af4f392707c4
Get the first element returned by parse_baseline.
[ { "docid": "576c1609710a86c974ee0caefe1fb4c0", "score": "0.7085118", "text": "def get_baseline_0(row: element.Tag) -> Optional[str]:\n try:\n return parse_baseline(row)[0].strip()\n except Exception as e:\n logger.debug(\"Function get_baseline_0 for row %s : %s\", row, e)\n re...
[ { "docid": "710e2239fe3c5649e4a0b2809f187014", "score": "0.7128509", "text": "def get_baseline_1(row: element.Tag) -> Optional[str]:\n try:\n return parse_baseline(row)[1].strip()\n except Exception as e:\n logger.debug(\"Function get_baseline_1 for row %s : %s\", row, e)\n re...
958dc260041318e94a7d2992e82f4966
Either pass name or enum itself, e.g `"local"` or `ChannelPicker.local`, or a list of one or more of those, e.g. `["national", "local"]`. If `remove_variants` is True, only keep the canonical form (the last) where there are multiple entries with the same title. Exclude the children's channel "CBeebies" (does not parse ...
[ { "docid": "66f31fb67bbbdca81de26329cd0c585a", "score": "0.4037361", "text": "def keys_by_category(cls, category, remove_variants=False, remove_cbeebies=True):\n keys = []\n if isinstance(category, list):\n for c in category:\n keys.extend(cls.keys_by_category(c, ...
[ { "docid": "7e995dec9689c3c0d5f15c1a0d2c4a80", "score": "0.49973446", "text": "def filter_releases_by_channel(releases: List[dict], channel: str):\n if channel not in [\"stable\", \"beta\", \"alpha\"]:\n raise ValueError(\"Channel must be one of 'stable', 'beta', 'alpha'\")\n\n if channel =...
855be140d8423db09b16cf922a2d0314
Try to get event from event queue
[ { "docid": "66dff9d1e0011204d646601720f70914", "score": "0.72469306", "text": "def getEvent(self):\n try:\n ev = self.eventq.get(False)\n except:\n return None\n return ev", "title": "" } ]
[ { "docid": "f433116c31a9524023c0c3aef5ba3e43", "score": "0.7179411", "text": "def pick_event(self):\n logger.debug(\"checking event queue\")\n event = snap7.snap7types.SrvEvent()\n ready = ctypes.c_int32()\n code = self.library.Srv_PickEvent(self.pointer, ctypes.byref(event),...
b0cdacba661f704d7960a2fbf39e3eab
Override reset_target_position from hectorquad_env to also delete trees
[ { "docid": "7e8ba560a58f499be4c3538e731e91bf", "score": "0.60241246", "text": "def reset_target_position(self):\n self.goal = self._sample_goal()\n target_cmd = \"gz model -m \" + self.target_name + \" -x {} -y {} -z {}\".format(*self.goal)\n subprocess.call(target_cmd,shell=True)\n...
[ { "docid": "dafeb299af4a0d6607b9c620b7636deb", "score": "0.58593154", "text": "def untarget_location():\n global __GRAPH__\n __GRAPH__ = None", "title": "" }, { "docid": "19a9661811e6e471c109de440e7e6888", "score": "0.58495784", "text": "def destroy_tree(self, tree):\n p...
d2d4c69573a6987380877809bb98ee11
Numeric value confirming this is the zone's DNSKEY
[ { "docid": "3e58e1dc66f48d867c5c3c91c0f42095", "score": "0.0", "text": "def flags(self):\n self._pull()\n return self._flags", "title": "" } ]
[ { "docid": "9233a0eda3bf8db5065f4038cc0725eb", "score": "0.5917154", "text": "def keytag(dnskey):\n if dnskey.algorithm == 1:\n a = ord(dnskey.key[-3]) << 8\n b = ord(dnskey.key[-2])\n return a + b\n else:\n header = struct.pack(\"!HBB\", dnskey.flags, dnskey.protocol,\...
dde64f202a48bd01e8833eb1d28427af
Creates or updates a remediation at resource group scope.
[ { "docid": "b11475b6785c9d970d4dfdbbabb455e9", "score": "0.7138369", "text": "def create_or_update_at_resource_group(\n self,\n resource_group_name, # type: str\n remediation_name, # type: str\n parameters, # type: \"_models.Remediation\"\n **kwargs # type: Any\n ...
[ { "docid": "af2222181999b70c89a1243fa3ad1d4d", "score": "0.6849127", "text": "def create_or_update_at_management_group(\n self,\n management_group_id, # type: str\n remediation_name, # type: str\n parameters, # type: \"_models.Remediation\"\n **kwargs # type: Any\n...
3c04d8af50b3919f9e97e929008fb5ff
Returns the noise covariance for the motion model. Assumes a diagonal structure for now.
[ { "docid": "b2de8502e03abc6778161866151c328b", "score": "0.55802447", "text": "def get_motion_covar(self, dt):\n return self.motion_covar", "title": "" } ]
[ { "docid": "52217a99a1ba06b728716177e5ef9ae1", "score": "0.72257763", "text": "def getNoiseCov2D(self):\n noise_cov_mat = np.array([\n [self.forward_velocity_noise_std ** 2., 0., 0.],\n [0., self.forward_velocity_noise_std ** 2., 0.],\n [0., 0., self.yaw_rate_nois...
5b24a3d925dee9eea90f6bb8e80ea452
Create an empty file with the specified path.
[ { "docid": "e6b3a69da0e27387cd0b89ed40baa79d", "score": "0.6326646", "text": "def create_file(self, path: str, filename: str):\n self._change_dir(path)\n self.ftp.storbinary(f'STOR {filename}', BytesIO())", "title": "" } ]
[ { "docid": "0105c4a95500b0b8ebc9f23dc501ec83", "score": "0.8275744", "text": "def make_empty_file(file_path: str):\r\n open(file_path, 'a').close()", "title": "" }, { "docid": "3f6c989939edb8c91e3aca2899ded9e8", "score": "0.7651341", "text": "def create_file(path):\n with open(...
5c16a482f7a757991ddf0cdaf4bb15a4
Sets the specified host's ability to accept new instances.
[ { "docid": "6b19995ff5d8a1e937b499be3b6fa6b8", "score": "0.57665277", "text": "def set_host_enabled(self, host, enabled):\n raise NotImplementedError()", "title": "" } ]
[ { "docid": "4beedd366207c71c155936dc1228c681", "score": "0.5856326", "text": "def addBan(self, hostmask, expiration=0):\r\n assert not conf.supybot.protocols.irc.strictRfc() or \\\r\n ircutils.isUserHostmask(hostmask), 'got %s' % hostmask\r\n self.bans[hostmask] = int(expira...
429f77e50426e92b6376973ec62b2161
Returns true if both objects are not equal
[ { "docid": "6b6c9d0a192510f895b0a5b6b6744b9a", "score": "0.0", "text": "def __ne__(self, other):\n if not isinstance(other, ConfigurationList):\n return True\n\n return self.to_dict() != other.to_dict()", "title": "" } ]
[ { "docid": "c15c693dce4313646a829d4ac4001f79", "score": "0.84119445", "text": "def __ne__(self, other: object) -> bool:\n return not self == other", "title": "" }, { "docid": "08a3a7ddcafaa068642f3c6cdfde6129", "score": "0.8392633", "text": "def __ne__(self, other: object) -> ...
d459f0d3f8b05ab0775fd17971c9d7c6
Test creating a policy with the default values
[ { "docid": "b7da8e756309a176023a1cd47ca2de83", "score": "0.71639955", "text": "def test_defaults(self):\n p = RequestPolicy.from_dict({})\n self.assertTrue(p.validate_signatures)", "title": "" } ]
[ { "docid": "16990dc1123a821d58bc52b849f9d3dd", "score": "0.71139294", "text": "def test_create_alert_policy(self):\n pass", "title": "" }, { "docid": "53e5896b50d3184c74a003708c5aafec", "score": "0.68160045", "text": "def test_execute_policy(self):\n pass", "title":...
ea53c144dfd2ef432f2ae9576ba9d3b4
Run testing command. Raises Exception If there are any failed tests.
[ { "docid": "9d3392e632071b2ee08ddeb10b5d9578", "score": "0.7361913", "text": "def _run_tests() -> None:\r\n logger.info('testing command started.')\r\n stdout: str = _run_command(\r\n command=(\r\n 'pytest --cov=./apysc tests/ -v -s --workers auto '\r\n '--cov-report t...
[ { "docid": "d92ce6264f9f77f50e3bc91a4cb02d68", "score": "0.78962797", "text": "def run_tests(self):\n # import here, cause outside the eggs aren't loaded\n import tox\n errcode = tox.cmdline(self.test_args)\n sys.exit(errcode)", "title": "" }, { "docid": "d92ce626...
023824f8b4f2c854626422b86deda60a
The name of an already existing project
[ { "docid": "9ba58577ef24966af47b261a7f6d5f52", "score": "0.738892", "text": "def project_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"project_name\")", "title": "" } ]
[ { "docid": "9830d1238f46a7354a4b7bb521948ce9", "score": "0.81454676", "text": "def project_name(self) -> str:\n ...", "title": "" }, { "docid": "0cbb6fa22a254b64ffb7d9c2d600262d", "score": "0.8130705", "text": "def project_name() -> str:\n return PROJECT_NAME", "title":...
023be0204b65a30b3822649b328a09be
r"""Writes a checkpoint to the file system.
[ { "docid": "3e4f7a53e6fef623357078b309a28868", "score": "0.67102903", "text": "def __call__(\n self,\n checkpoint: Union[Checkpoint, Summary],\n ) -> Union[Checkpoint, Summary]:\n return self.write(checkpoint)", "title": "" } ]
[ { "docid": "cfa0f7d273333324ccf8a8aed844a768", "score": "0.7748798", "text": "def write_checkpoint(self):\n\n print('checkpointing at',self.tm_minutes,'minutes')\n success=write_fits(self.checkpoint_file, self.data)", "title": "" }, { "docid": "00f05d164a5452b257b48bd4fe59e01e"...
4ac2e54590f993f25d4c93be27d37de1
An object to perform Mean Pooling that ignores PADtoken representations
[ { "docid": "fce1104ec07a2850aa4a0b1b96958266", "score": "0.6255539", "text": "def __init__(self):\n super(MeanMaskedPooling, self).__init__()", "title": "" } ]
[ { "docid": "ddf59ab9f023d2a3c12019cd0472996b", "score": "0.5281446", "text": "def __init__(\n self,\n pools: list[LiquidityPair],\n token_in: Token,\n token_out: Token,\n ):\n self.pools: LiquidityPair\n\n tokens = [token_in]\n for pair in pools:\n ...
c85978c1d384804b672ed6f512e49e4a
Creates a CROD card
[ { "docid": "4d20a4bfeacf4d99e100688379ffb27a", "score": "0.0", "text": "def __init__(self, eid, pid, nids, comment=''):\n RodElement.__init__(self)\n if comment:\n self.comment = comment\n self.eid = eid\n self.pid = pid\n self.nodes = self.prepare_node_ids(...
[ { "docid": "befd41ff71f86542ff2345867d5668d9", "score": "0.74394673", "text": "def create_card(self, data: dict) -> Any:\n\n return self._post('/create/card', data)", "title": "" }, { "docid": "8cb4c0b4b6afd4be477ea060678d534c", "score": "0.74331784", "text": "def test_create_...
33d0e9c7beacc6d5cd3bf11770cd25e4
Loads all data from file as a list of lines
[ { "docid": "6e588041fdd09e5400429f132a83d461", "score": "0.7420914", "text": "def loadLines(callingFile):\n\n filePath = File.getRealPath(callingFile) + \"/data.txt\"\n\n with open(filePath, 'r') as file:\n data = file.readlines()\n\n return data", "title": "" } ]
[ { "docid": "a1ad9c21c9802b1e0e18c648191b0541", "score": "0.780131", "text": "def load_lines(filename):\n try:\n in_handler = open(filename)\n lines = [l.strip() for l in in_handler.readlines()]\n in_handler.close()\n return lines \n except Exception, e:\n sys.exi...
3463fa2a7195aa259691ae9fe130ef14
Decorates a function with args so it can be used within an arg_scope.
[ { "docid": "0c53418651a9027814b4fb43bc4eca4c", "score": "0.7400191", "text": "def add_arg_scope(func):\n @functools.wraps(func)\n def func_with_args(*args, **kwargs):\n current_scope = _current_arg_scope()\n current_args = kwargs\n key_func = _key_op(func)\n if key_func in current_scope:\n...
[ { "docid": "2ff98bbb53e97fe0c10e1aae00c485aa", "score": "0.77008224", "text": "def _decorator(func):\n add_arg(func, *args, **kwargs)\n return func", "title": "" }, { "docid": "8ca7fcfaf5b9f97666178435f80a7e76", "score": "0.73563796", "text": "def expanded_args(func):\n...
984de8f76634970f9ee3ff2bd069c0de
returns dates to buy on
[ { "docid": "5d944fced81ddaaed27b318bf33a2d15", "score": "0.0", "text": "def buy_orders(self):\n \traise NotImplementedError", "title": "" } ]
[ { "docid": "3de819151e518daf959dce419ae9ac67", "score": "0.65969247", "text": "def daily():", "title": "" }, { "docid": "962b7089a27f4c95efe8c39661c98eb8", "score": "0.64363086", "text": "def get_buy_day(self):\n # Write your code here\n profit = 0\n buy_day = 0\...
3f1bd3557a40150f6f3867fe96f4f28d
display all the assignments as per subjects
[ { "docid": "18ffe5b655118cc61e341ba7eda2744a", "score": "0.5649913", "text": "def single(sub_id):\n db = con()\n \n assignments = db.execute(\"SELECT * FROM assignments WHERE subject_id =?\",(sub_id,)).fetchall()\n subject = db.execute(\"SELECT * FROM subjects WHERE subject_id =?\",(sub_id,))...
[ { "docid": "a8c318c38ea786352f82bfc466e06831", "score": "0.7014018", "text": "def printSubjects(subjects):\n totalVal, totalWork = 0,0\n if len(subjects) == 0:\n return 'Empty SubjectList'\n res = 'Course\\tValue\\tWork\\n======\\t====\\t=====\\n'\n subNames = subjects.keys()\n sub...
14dc3b3ec7b206da8a0aac6584868cdb
Marks the list of barcodes as ready in the databse and sends email
[ { "docid": "7e79f1f9bffed340ce4ad21cb22ac6c3", "score": "0.7422296", "text": "def mark_results_ready(self, barcodes, debug=False):\n debug = {}\n ready_sql = \"\"\"UPDATE ag.ag_kit_barcodes\n SET results_ready = 'Y'\n WHERE barcode IN %s\n ...
[ { "docid": "68b6afc64486c9532780ec1bc33d5e9d", "score": "0.64812684", "text": "def mark_barcodes_sent_to_qiita(self, barcodes):\n if barcodes:\n sql = \"\"\"UPDATE project_qiita_buffer\n SET pushed_to_qiita = 'Y'\n WHERE barcode IN %s\"\"\"\n ...
882625070fb2d7b72cc9a9a1c266da2d
Display prints information about what just happened to stdout.
[ { "docid": "5a2075a745cfad3dfe8fc7d1e44e7ac6", "score": "0.0", "text": "def Display(self, unused_args, result):\n printer = util.PrettyPrinter(0)\n printer.Print('Result of the restore-backup operation:')\n printer.PrintOperation(result)", "title": "" } ]
[ { "docid": "de71a50deacff66ac51efe1d380bfad3", "score": "0.7455874", "text": "def display():\n\n # Check the pipe setup.\n check_pipe_setup(sequence=True, j=True)\n\n # Call the write method with sys.stdout as the file.\n write(file=sys.stdout)", "title": "" }, { "docid": "1c3ced...
7b4e00c839b2b884cd8f2d137e5deb74
Maps each S. cervisiae ORF to ortholog ORFs in 8 closely related yeast species
[ { "docid": "06afd725cd38a46eb969ad288ccea146", "score": "0.48885584", "text": "def blast_closely_related_species(ortho_species_dir,scer_DB_dir,outDir,summaryFile,scer_closely_related): \n\t\n\tprint (\"----------- Find orthologues in closely related species -----------\")\n\t\n\tif not os.path.exists(ou...
[ { "docid": "5a11091e3c63cbba32f7d82ce5c6a064", "score": "0.6164072", "text": "def ortho_final_coord(ortho_dict):#rna_ortho_dict,\n\tfinal_coord_dict = dict()\n\tfor k, v in ortho_dict.iteritems():\n\t\tupstream = v[0]\n\t\tdownstream = v[1]\n\t\tuscafs = set()\n\t\tdscafs = set()\n\t\tfor gene in upstre...
098f625be7728afddfd2b2c1387e0124
Test the system removes files. First create a temporary empty file in the temporary path then remove it.
[ { "docid": "6627f05b2bc7c4b188734c79718fa220", "score": "0.7850327", "text": "def test_remove(self):\n test_file = os.path.join(self._system.get_temporary_path(), \"nusoft.test\")\n with open(test_file, 'a'):\n os.utime(test_file, None)\n self.assertTrue(os.path.exists(te...
[ { "docid": "2d968d9edc44d54ee6dad643d82abd51", "score": "0.81269306", "text": "def test_removed(self):\n path = None\n with TemporaryDirectory() as tmp:\n path = tmp\n self.assertTrue(os.path.isdir(tmp))\n tmpfile = os.path.join(tmp, \"a_temp_file\")\n ...
92ae2600eb34202e158228d1cda285c0
Send an IObjectCopiedEvent for object. `original` is the object the copy was created from.
[ { "docid": "0d5bd68503e07959a932e521c8752d40", "score": "0.6960044", "text": "def copied(object, original):", "title": "" } ]
[ { "docid": "d97ab3e40ca5419cf0fc9f77c17777cc", "score": "0.56083983", "text": "def copy_view(self, request, object_id, extra_context=None):\n opts = self.model._meta\n app_label = opts.app_label\n\n if not self.draft_copy_allowed:\n return HttpResponseBadRequest(\"Draft c...
b4aed3b4a87ea4aef402346694d0ff72
Plot the distribution of each variable in the joint probability space using matplotlib.
[ { "docid": "1fa41e1ea2a607c9d83a6b231e539917", "score": "0.6270921", "text": "def Plot(self):\n inf = 10**30\n plotDict = {}\n minX = inf\n maxX = -inf\n numPts = 200\n pdfs = []\n for v in self.fieldList:\n d = self.distr(v)\n minva...
[ { "docid": "e51c6607e2bead15b80003b660fb3059", "score": "0.7280935", "text": "def plot(self):\r\n\t\t#should be as simple as calling the hist method of the particle list then the plot method of \r\n\t\t#the distributions datamember\r", "title": "" }, { "docid": "f15678733146d91a320fcd41ae9f2...
8aeb8a3700f1ce37cf4f91212577812e
setter for the maximum attribute
[ { "docid": "f4d8de4754d871aa86f66900eb55dae8", "score": "0.8005382", "text": "def maximum(self, maximum):\n self._maximum = maximum", "title": "" } ]
[ { "docid": "4a092107baaf3de27d2f66d9ed3abd1d", "score": "0.8707602", "text": "def setMaximum(self, maxValue):\n self.attrs[\"Maximum\"] = maxValue", "title": "" }, { "docid": "baa8ac2a2dcea71742c037e43c142c63", "score": "0.84917045", "text": "def set_max(self, max):\n i...
135b9aa187dcc0e58bf633f36c64c2ca
Gets the url of this DashboardMetadata.
[ { "docid": "3cab8eb5451712f7c55e14a0a0cea1ab", "score": "0.7339102", "text": "def url(self):\n return self._url", "title": "" } ]
[ { "docid": "2fbe73001cbd34a95b62e79f502d7012", "score": "0.7927961", "text": "def dashboard_url(self) -> str:\n return self._dashboard_url", "title": "" }, { "docid": "c703c957fbe09cf7c45ebb07023d3e91", "score": "0.7727256", "text": "def url(self):\n return self.data[\"...
8a55eab1ea93d2f7b415a1a505232965
Add the processor to the available processors that __next__ returns.
[ { "docid": "747bf753849a90c40ac9e19dc462340f", "score": "0.7581475", "text": "def add_processor(self, processor):\n raise NotImplementedError()", "title": "" } ]
[ { "docid": "fb6f43761ac94070a64eefdf1c7b95a1", "score": "0.76851845", "text": "def __next__(self):\n for processor in self._processors:\n\n processor()", "title": "" }, { "docid": "d91c4595fb0c24cff850e46a1bf542dc", "score": "0.7611795", "text": "def add_processor(s...
a5b7cd94ad797db3374c86c3d84dd89e
Loads the dbt manifest.
[ { "docid": "218f3c12ef21f4e5270383042bd1e288", "score": "0.6806921", "text": "def dbt_manifest(self):\n # Identity function used for macro hooks\n def identity(x):\n return x\n\n # Set dbt not to run tracking. We don't load\n # a dull project and so some tracking r...
[ { "docid": "f7d9e68a6289002b2b30bb5e1dce5a7e", "score": "0.6945915", "text": "def read_manifest(self): # -> None:\n ...", "title": "" }, { "docid": "99a973b3f287f2f28ff302065825d6f6", "score": "0.66541666", "text": "def load_manifest(path: Path):\n with open(path, \"rt...
2c4f9f20da031ff4db9ea3dc8043a8b7
Perform forward pass of encoder. Returns mean with shape [batch_size, 784].
[ { "docid": "528fe2d56683e6b95bdf138bf0067021", "score": "0.57269955", "text": "def forward(self, input):\n hidden = self.z_hidden_vector(input)\n self.transformed_input = self.relu(hidden) \n self.transformed_input = self.hidden_linear_mean(self.transformed_input)\n\n mean = ...
[ { "docid": "a65da797b7c1b5d048f0d5f35949b5c1", "score": "0.67233974", "text": "def forward(self, input):\n mean = self.decoder(input)\n\n return mean", "title": "" }, { "docid": "b5e10e0285e3058556788eb624c3f824", "score": "0.6601578", "text": "def forward(self, inputs)...
0e08c2053cefb4745ed8ee41b1a1530f
Gets the content of a resource
[ { "docid": "8dccfbc4eec6b6eb13db2655e677441e", "score": "0.0", "text": "def load_resource(resource_path):\n resource_content = pkg_resources.resource_string(__name__, resource_path)\n return unicode(resource_content)", "title": "" } ]
[ { "docid": "4734bb5b047d6b7b31a78cee1d6808e6", "score": "0.8737112", "text": "def _get_content(self, resource):", "title": "" }, { "docid": "0f26c74e63b2210f70c0d0c161313c0e", "score": "0.80320984", "text": "def get_resource(self):\n try:\n print('fetching:', self.p...
4a9881689bc78af4cfb52834600bea05
Gets a set of slides (.PDL1.mrxs) and divides each one of them into patches. The final patches are stored in a folder with the same name as the slide.
[ { "docid": "64780dffa2afde7f412f5be70ad82c01", "score": "0.6368157", "text": "def patch_division(slides, outpath, level, tile_size=224, tissue_ratio=0.50, jobs=1):\n\n # Creates directory outpath if doesn't exist yet\n try:\n os.mkdir(outpath)\n print(\"Directory\", outpath, \"create...
[ { "docid": "119b53bb19bd42ac90c7ad21c6d8612e", "score": "0.60560036", "text": "def get_patches(slidepath, outpath, level=10, tissue_ratio=0.25, size=256):\n\n # Opens the slide with OpenSlide\n slide = OpenSlide(slidepath)\n\n # Gets deepzoom tile division\n slide_dz = deepzoom.DeepZoomGener...
a04d0abb2c5939e86faec2939ceb53d6
Turn off the WLED nightlight switch.
[ { "docid": "5c9433e7d86174c8309e7d0bba78df87", "score": "0.8082955", "text": "async def async_turn_off(self, **kwargs: Any) -> None:\n await self.coordinator.wled.nightlight(on=False)", "title": "" } ]
[ { "docid": "dc32254499822b5c7b3c605da071785c", "score": "0.7715766", "text": "def switch_off(self):\n self.SwitchOff()", "title": "" }, { "docid": "dc32254499822b5c7b3c605da071785c", "score": "0.7715766", "text": "def switch_off(self):\n self.SwitchOff()", "title": ...
e6b1fb77624f011eedc523ee9a96c89f
Inline query handler for the bot. Returns the appropriate shows as a result.
[ { "docid": "4389659bef73bc81b8f1323de6e6796e", "score": "0.7259084", "text": "def inline_query_handler(update, context):\n query_text = update.inline_query.query\n query_id = update.inline_query.id\n\n if not query_text:\n query_text = \"all\"\n\n logging.info(\"Query %s\", query_text...
[ { "docid": "828ae1b9f8c8e39f5f7957021b31a780", "score": "0.7084049", "text": "async def on_inline_query(self, msg):\n\n async def compute_answer():\n \"\"\"\n Function generating the answer for the handler.\n :return: Lyrics as articles\n \"\"\"\n ...
e5d0c52e17e4e5e5e0f1ed744b6195bc
Compute the probability of the different services contained in the data using the given classifier.
[ { "docid": "31822774ceb7b6860b32167010e772e7", "score": "0.7801408", "text": "def services(self, data, classifier):\n values = self.__generate_values(data, classifier)\n max_value = 0\n # Search max index in probabilities (number of categories)\n for val in values:\n ...
[ { "docid": "c13a61aa62c3aa58c2f8926ba1620388", "score": "0.6992532", "text": "def probability(self, data, classifier):\n values = self.__generate_values(data, classifier)\n max_value = 0\n # Search max index in probabilities (number of categories)\n for val in values:\n ...
42f2bfcea28db02ee805f37e98d23681
String que representa al objeto Libro
[ { "docid": "b7ae2c10f2a195a56f527606368b4323", "score": "0.0", "text": "def __str__(self):\n\t\treturn self.titulo", "title": "" } ]
[ { "docid": "ee0aec15a332c3d07dd070f692de3b44", "score": "0.7063576", "text": "def __str__(self):\n\t\treturn '%s (%s)' % (self.id, self.libro.titulo)\n\t\t# return '{0} ({1})'.format(self.id,self.libro.titulo) \n\t\t# return f'{self.id} ({self.libro.titulo})'", "title": "" }, { "docid": "804...
7a6c02e370059d1e75397d934e382c1b
Compatability wrapper for advancing an iterator.
[ { "docid": "b1c96ea935867c12aba7d0143c07edb3", "score": "0.6273643", "text": "def next(iter):\r\n return iter.next()", "title": "" } ]
[ { "docid": "4054233d5049ece5e6898be151e34502", "score": "0.73166263", "text": "def __add__(self, other: Iterator[T]):\n try:\n return self.chain(other)\n except Exception:\n pass\n return NotImplemented", "title": "" }, { "docid": "2edfa18bd364406c3...
b8904ef7b4372200ba43f32d2075f657
Evalutes the the top curve of a circle using xcoordinate
[ { "docid": "7bba9db2092483da7011fc322b984abe", "score": "0.6089204", "text": "def circle(xpos) : \r\n \r\n yPos = np.array(np.sqrt(1 - xpos**2))\r\n \r\n return yPos", "title": "" } ]
[ { "docid": "b097246dc5c0474d62f8675c80afe6c9", "score": "0.59327", "text": "def _x(self, curve):\n return self._c(curve)[:, 0]", "title": "" }, { "docid": "d9671ef8ff6e3f4984a09931e59f9a1b", "score": "0.5818806", "text": "def least_squares_ellipse(\r\n x,y):\r\n \r\n...
e8beb57de21a98204f851d42285263eb
Delete a push rule. Args specify the row to be deleted and can be any of the columns in the push_rule table, but below are the standard ones
[ { "docid": "ed5a6eee00e3991a616774f9628d1ffd", "score": "0.7285327", "text": "def delete_push_rule(self, user_name, rule_id):\n yield self._simple_delete_one(\n PushRuleTable.table_name,\n {'user_name': user_name, 'rule_id': rule_id},\n desc=\"delete_push_rule\",\...
[ { "docid": "d6f4919bf5fa7ac48d2a7c4d6719df1c", "score": "0.74705184", "text": "def deletePgPushRule(self, pgPushRuleUri):\r\n return self.proto.dbpool.runInteraction(self._deletePgPushRule, pgPushRuleUri)", "title": "" }, { "docid": "c237d86d544a2804f4bb3bd3e16bb690", "score": "0.71...
7e0ac660f95bc7e4dacced0fbe04d5bf
Detects the ball using color thresholding
[ { "docid": "b32ec2d27abc563b3e381ef5a3c38254", "score": "0.70945865", "text": "def detect_ball(self):\n\n #read webcam image\n ret, img_in = self.capture.read()\n\n #convert to HSV colorspace\n img_hsv = cv2.cvtColor(img_in, cv2.COLOR_BGR2HSV)\n\n #color thresholding\n...
[ { "docid": "d9a6b39ff0cc5578f9266d595f94fbd6", "score": "0.71530026", "text": "def detect_color(image):\n # Resize the frame, blur it, and convert it to the HSV color space\n frame = imutils.resize(image, width=FRAME_SIZE)\n\n blurred = cv2.GaussianBlur(frame, (11, 11), 0)\n hsv = cv2.cvtCol...
b3e43d797607acdf8b5629062592b977
Construct a new Colorscale object
[ { "docid": "f8dd8b3727da32f08a1779c47d6a6a6b", "score": "0.7413053", "text": "def __init__(\n self,\n arg=None,\n diverging=None,\n sequential=None,\n sequentialminus=None,\n **kwargs\n ):\n super(Colorscale, self).__init__('colorscale')\n\n # V...
[ { "docid": "d2823f7261d8f63a796bdd0389487e34", "score": "0.63869935", "text": "def __init__(self, z_scale=1., y_scale=1., x_scale=1.):\n \n self.z_scale = z_scale\n self.y_scale = y_scale\n self.x_scale = x_scale", "title": "" }, { "docid": "56efac36e43d5f479cb583...
a096da259efff9e160ccbea446040e40
Private function to get the absolute path to the downloaded file.
[ { "docid": "515b8459a0fbd85ad7dab27c0aa5f909", "score": "0.0", "text": "def _get_data(path, scraper_name, project_id):\n cwd = os.path.abspath(os.path.dirname(__file__))\n return os.path.join(cwd, 'pdf', scraper_name, project_id, path)", "title": "" } ]
[ { "docid": "83ad940bd914fa9b3f8790f35f6843a2", "score": "0.81307155", "text": "def download_path(self):\n download_path = self.TMP_DIR.joinpath(self.DOWNLOAD_NAME).resolve()\n return download_path", "title": "" }, { "docid": "a4a1c4e8c019224e8a5dcad9c716aeae", "score": "0.7...
bc6a04eba5b3f41ca429d548419f5b6c
Changes the text of the label to the summary of this scenario.
[ { "docid": "acbf0f299549d2a525eb8b693beb5897", "score": "0.888844", "text": "def summary_scenario(self, label):\n label.setText(self.summary)", "title": "" } ]
[ { "docid": "eddd18e56ca8206d5c49cb5e6baf457a", "score": "0.6996269", "text": "def _update_label(label, new_text):\n label.setText(\"Score: {}\".format(new_text))", "title": "" }, { "docid": "17aacdff760629a5ac94ef60b2a5cf2b", "score": "0.658206", "text": "def summary(self, sum...
b4b1a94bf941996732d66220a294dc7a
Sets the email of this Consultation.
[ { "docid": "edf73bdd43acf1b4fa8bf69a59e0f338", "score": "0.77411693", "text": "def email(self, email):\n\n self._email = email", "title": "" } ]
[ { "docid": "3edda176cb95d00051c3d2ccb6af96ba", "score": "0.782061", "text": "def email(self, email):\n self._email = email", "title": "" }, { "docid": "3edda176cb95d00051c3d2ccb6af96ba", "score": "0.782061", "text": "def email(self, email):\n self._email = email", "...
2222136541f6285ea02f40b676a113e6
Returns the model properties as a dict
[ { "docid": "12d68e7daf0075b9d7336e08d677b525", "score": "0.0", "text": "def to_dict(self):\n result = {}\n\n for attr, _ in six.iteritems(self.swagger_types):\n value = getattr(self, attr)\n if isinstance(value, list):\n result[attr] = list(map(\n ...
[ { "docid": "d5fac65c7140c97c1960355ec6927973", "score": "0.7789736", "text": "def get_properties(self):\n return {}", "title": "" }, { "docid": "d5fac65c7140c97c1960355ec6927973", "score": "0.7789736", "text": "def get_properties(self):\n return {}", "title": "" }...
e2fd56eff8036e5cd205722f5a691e1f
pillar['master']['file_roots'] is overwritten by the master in order to use the fileclient interface to read the pillar files. We should restore the actual file_roots when we send the pillar back to the minion.
[ { "docid": "1bd53991876d9a27761e854c675850d0", "score": "0.6599424", "text": "def test_issue_5449_report_actual_file_roots_in_pillar(\n salt_call_cli, pillar_tree, base_env_state_tree_root_dir\n):\n ret = salt_call_cli.run(\"pillar.data\")\n assert ret.returncode == 0\n assert ret.data\n ...
[ { "docid": "ad44959dc2368d29845f68104be29acc", "score": "0.5513161", "text": "def changeRoot(self, root):\n self.path_holder.root = root\n for s in self.subfiles:\n s.path_holder.root = root", "title": "" }, { "docid": "fd02d487b6e859a684615b8454404306", "score":...
fe8646ab98b360f3a828c884c49582f2
Creates a new instance of data page and assigns its values.
[ { "docid": "18e8b588f7434cdc93fc9c7d71063882", "score": "0.5780925", "text": "def __init__(self, data: List[Any], token: str = None, total: int = None):\n # The total amount of items in a request.\n self.total: int = total\n # The starting point for the next search.\n self.to...
[ { "docid": "eb6cc19f2a08202ef11920f75b300e40", "score": "0.6493468", "text": "def data(self):\n if self.options[\"type\"].value == MAP_TYPE:\n pages = self.create_map_page()\n else:\n pages = self.create_island_posters()\n return pages", "title": "" }, ...
3d4382612aa7770d02e39bdc03b6f970
Subtract Array or scalar from Array and return an Array.
[ { "docid": "59464f622b7797b7b2a44aebf4a383d3", "score": "0.5544128", "text": "def __rsub__(self,other):\n return self._data.__rsub__(other)", "title": "" } ]
[ { "docid": "544f638cf0221de411c0dd23bb37b663", "score": "0.67351913", "text": "async def np_subtract(self, a, b):\n stype = type(b) if isinstance(b, self.SecureArray) else type(a)\n a_shape = getattr(a, 'shape', (1,))\n b_shape = getattr(b, 'shape', (1,))\n shape = np.broadca...
34735739c4aec822adaeec95f1a32577
Test resend stored flows.
[ { "docid": "85345835261afa6f632b05828456798e", "score": "0.71355134", "text": "def test_resend_stored_flows(self, mock_install_flows):\n dpid = \"00:00:00:00:00:00:00:01\"\n switch = get_switch_mock(dpid, 0x04)\n mock_event = MagicMock()\n flow = {\"command\": \"add\", \"flow...
[ { "docid": "78c89020740b93fa4642991d3e31423f", "score": "0.58568835", "text": "def test_store_changed_flows(self, mock_save_flow, _):\n dpid = \"00:00:00:00:00:00:00:01\"\n switch = get_switch_mock(dpid, 0x04)\n switch.id = dpid\n flow = {\n \"priority\": 17,\n ...
b809052736a786be5ebbddb33b1bc9ce
Creates a Path object representing the full path of an output feature class in the KML/KMZ format.
[ { "docid": "0a4454bcc59bea43f01939fe42e7cff8", "score": "0.6005049", "text": "def _feature_class_default_name(self, desc, output_workspace, **kwargs):\n return output_workspace.joinpath(desc.name + \".kmz\")", "title": "" } ]
[ { "docid": "0f5b0e3516d0e736cb18463ee0e55493", "score": "0.6318198", "text": "def export_kml():\n folder = 'cad'\n name = get_dataset_filename()\n \n # Create a cad folder in the temp directory if it does not exist\n working_folder = catalog_publish_folder + name + \"//\" + temp_folder + ...
d15c16502af6ce62d6e0a6aa48a02c38
First implentation of the two precedent algorithm
[ { "docid": "b1f85f94a850720f0d292914e99787b4", "score": "0.0", "text": "def master_algorithme(set_point, heta):\n #find the perfect hash table\n hash_table = epsilon_variation_algo(set_point, len(set_point))\n \n #define the minimal number of rectangle\n min_nb_rectangle = sqrt(len(set_po...
[ { "docid": "a8dcf31285714d06d3927c1343a0f07a", "score": "0.70782053", "text": "def algorithm(self):", "title": "" }, { "docid": "75f9f33adb7fc5ee9bca5067ef34a714", "score": "0.58826745", "text": "def next_trick(self):", "title": "" }, { "docid": "f5cd32a98def5a9aeaf4aa06e...
8ffc57df12cae62a251b68661b73e7b5
Construct an object from a parsed response.
[ { "docid": "0e9dde3a2dac743da0d5c1f024147fc1", "score": "0.0", "text": "def from_json(cls, attributes):\n return cls(**{to_snake_case(k): v for k, v in attributes.items()})", "title": "" } ]
[ { "docid": "38fb22532f23588d56b0cb3828560113", "score": "0.71406657", "text": "def __init__(self, res):\n self.fromResponseObj(res)", "title": "" }, { "docid": "38fb22532f23588d56b0cb3828560113", "score": "0.71406657", "text": "def __init__(self, res):\n self.fromRespon...
20c21940fc9dd704dacf8ea88aa5ee69
Check the type of address (v4, v6, mac) and split out the address, prefix, and port. Values are None if they don't exist.
[ { "docid": "0ab101390fc832573508d0eda37e7ee3", "score": "0.692085", "text": "def _split_addr(addr_str: str) -> Tuple:\n address = possible_addr = prefix = port = possible_port = None\n\n try:\n address, prefix = addr_str.rsplit('/', maxsplit=1)\n except Exception:\n address = addr...
[ { "docid": "4f797d46fe6ac632ffd5a9a1ab83eeeb", "score": "0.64934886", "text": "def parse_address(address):\n ipv6 = 0\n for i in range(12):\n if address[i] != 0:\n ipv6 = 1\n break\n if ipv6 == 1:\n return socket.inet_ntop(\n ...
e7f79e2f79009c5fe91885bf8e3476a1
Get the route location and customer location of a customer.
[ { "docid": "826d0525eebbe19e2e0d8df2fd11fe00", "score": "0.5834146", "text": "def cust_loc(self, sol, cust):\n cust_ind = [] # [route_loc, cust_loc]\n for i, rt in enumerate(sol):\n if cust in rt:\n cust_ind.append(i)\n cust_ind.append(rt.index(cus...
[ { "docid": "a5ec4d134d11f24bc1d5418d50483a79", "score": "0.6389137", "text": "def GetLocation():\n\t\tif not clc.LOCATION: Account.GetAccounts()\n\t\treturn(clc.LOCATION)", "title": "" }, { "docid": "08bd0dd35f42aa342ea747da89233e48", "score": "0.62559897", "text": "def customer_inf...
e1765654b9adf837458da050bd051eaf
Wrapper Function for telnet interface. This uses underlying python telnet libraries Read until one from a list of a regular expressions matches.
[ { "docid": "4489f58e627d6910de71e6b7564d008d", "score": "0.0", "text": "def loc_expect(self, output: any) -> object:\n print(\"Telnet expect with {}\".format(output))\n (i, obj, res) = self.telnet_con.expect([output.encode('ascii')], 5)\n print(\"i inside is {} \".format(i))\n ...
[ { "docid": "1e83f6c81f96a3a34cfe616ec39ddc25", "score": "0.639549", "text": "def _telnet_read(self):\n return self.tn.read_until(\"\\n\", self.timeout).rstrip('\\n') # Telnet reply, with termination chars removed", "title": "" }, { "docid": "4d5010c53f8ddd74b9249bb012d1d113", "sc...
0216413026baa5891f5309f4e1972205
Formats event values using the helper.
[ { "docid": "43c9d59e8073cde2d1018052190f9cf9", "score": "0.62962395", "text": "def FormatEventValues(self, output_mediator, event_values):\n if not self._winevt_resources_helper:\n self._winevt_resources_helper = output_mediator.GetWinevtResourcesHelper()\n\n message_string = None\n provid...
[ { "docid": "d1973e8892563aa058b554c01322cbf0", "score": "0.61856985", "text": "def format_events(self, event):\n date = dateparser.parse(event['start']).strftime('%m/%d')\n title = event['title']\n venue = event['venue']\n id = event['id']\n\n formatted = u\"\"\"\n ...
a49cad5154db3f4173ed1f408c04a4ca
Convert XML derived dict to tf.Example proto. Notice that this function normalizes the bounding box coordinates provided by the raw data.
[ { "docid": "f89a97e7a31b3db1b5ae28192b332a36", "score": "0.0", "text": "def selective_search(data,\n dataset_directory,\n label_map_dict,\n ignore_difficult_instances=False,\n image_subdirectory='JPEGImages'):\n img_path = ...
[ { "docid": "5cedbb9d92ce614e221c52c0c553315a", "score": "0.69029593", "text": "def parse_example_proto(example_serialized):\n # Dense features in Example proto.\n feature_map = {\n \"image/encoded\": tf.io.FixedLenFeature([], dtype=tf.string, default_value=\"\"),\n \"image/class/labe...
e034371cf2f71c0b059b61452b9388f5
stops the running process
[ { "docid": "d7d36dd564e8ddaceec19438abbc6509", "score": "0.73107016", "text": "def stop(self):\n self.network.deregister(self.pid)\n self.reader_task.cancel()\n self.writer_task.cancel()\n self.subproc.terminate()", "title": "" } ]
[ { "docid": "f8d24493529d9cb44476dfeb0b9f4e86", "score": "0.8454015", "text": "def stop(self):\n # Terminate the process\n self.proc.terminate() # sends a SIGTERM", "title": "" }, { "docid": "e97a3af72b6deb2246430e5a2e9ea23f", "score": "0.8393155", "text": "def stop_pro...
c075a0b9bee4f53b1a1973941890ba65
since gateways don't always start at the same time, some secods don't have corresponding rssi and hence have NaN instead. Currenty machine learning lagorithms don't know how to handle NaN. As a temp fix, we're removing all records that have NaN in them.
[ { "docid": "f517c54d00537dd43ad203abd3dec444", "score": "0.71056527", "text": "def remove_nan(self):\n\t\tdense_data = copy.deepcopy(self.data_frame)\n\t\ttimestamps_to_remove = []\n\t\tfor index, row in self.data_frame.iterrows():\n\t\t\tfor gateway in self.gateway_list:\n\n\t\t\t\tif np.isnan(row[gate...
[ { "docid": "8361c7d6bb8408ccdc93d98e06906cb5", "score": "0.63010675", "text": "def _removerawnans(self):\n for band in self.data[self.root]:\n for i, f in enumerate(self.data[self.root][band]['frequency']):\n if math.isnan(f):\n for param in self.data[...
014a5481438d0e9b71966a48d4d8bbf6
Generate a NL or LP file from Pyomo, and then do subsequent conversions.
[ { "docid": "b50fba180d6eee76d9713189ba7dcb27", "score": "0.56642395", "text": "def apply(self, *args, **kwds):\n\n import pyomo.scripting.convert\n\n capabilities = kwds.pop(\"capabilities\", None)\n\n # all non-consumed keywords are assumed to be options\n # that should be p...
[ { "docid": "67db92a1a3821a68008dc249af915482", "score": "0.5871873", "text": "def create_model(self):\r\n\r\n self.try_load_model()\r\n\r\n self.set_correct_problem_instance_name()\r\n\r\n self.add_objective_and_budget_constraints()\r\n self.add_starting_ending_nodes_constrai...
129bf3d37fc164404295d1647290238f
Set an instance variable to test that this method gets called
[ { "docid": "abe8787ed3fa3d0a67f544bcbdd156df", "score": "0.0", "text": "def __parent_setup_2(self):\r\n self.parent_setup_exists += 1", "title": "" } ]
[ { "docid": "de81fdce13d62ec47641ea1a8c6ee8c7", "score": "0.73396957", "text": "def before_tester_run(self) -> None:", "title": "" }, { "docid": "f3b2d6e10065ff6b983c1edd3630c152", "score": "0.7324083", "text": "def classSetUp(self):\r\n assert self.something == True\r\n ...
dde81fd75e8dab25708f015fee2011b9
If the same item appears in the list, sums the quantities and create a unique Food object.
[ { "docid": "fc122672b927400040c2b8b6fa8b33a7", "score": "0.5547891", "text": "def eraseDubloons(foodList):\n resList = []\n foodNames = [f.codsougr_name for f in foodList]\n uniqueFoodNames = list(set(foodNames))\n for name in uniqueFoodNames:\n duplicates = [f for f in foodList if f...
[ { "docid": "4f021ae31218d83063fc7b7fe95882c6", "score": "0.6519353", "text": "def __add_muilt(self,food_name,quantity):\n\t\tif (not food_name in self.items):\n\t\t\tself.items[food_name] =0\n\t\tself.items[food_name] = self.items[food_name] + quantity", "title": "" }, { "docid": "232d5321f1...
17ff9d02a0b166bd8a9c253d3fe795a0
Update details of an Experiment. Update details of an Experiment with specific Experiment Id.
[ { "docid": "10d33500639a40dacacd744c0f51f89c", "score": "0.64625514", "text": "async def update(\n self,\n subscription_id: str,\n resource_group_name: str,\n workspace_name: str,\n experiment_id: str,\n body: Optional[\"_models.ModifyExperiment\"] = None,\n ...
[ { "docid": "a90932de5b0dd8cc3450221c5e50b85a", "score": "0.7416664", "text": "def update_experiment(request, pk):\n\n required_data = request.data.get(\"requiredData\")\n tests_config = request.data.get(\"testsConfig\")\n expiration = request.data.get(\"expiration\")\n allow_multiple_answers...
97251e022090c1c096acfb522379fe37
Check to see if the tolerance has been met. Returns False if tolerance is met.
[ { "docid": "18dae62af5d8fcb325b8c556954aefee", "score": "0.0", "text": "def check_tol(g, tol, log_scale_param):\n s = np.exp(log_scale_param)\n for tolerance, gradient in zip(tol, g):\n if abs(gradient) > tolerance / s:\n return True\n return False", "title": "" } ]
[ { "docid": "ce055bab6287f8377db1128076fa364f", "score": "0.8071129", "text": "def _tolerance_check(self, tolerance, value):\n if tolerance != None and np.linalg.norm(value) < tolerance:\n print(\"Variable update tolerance was reached. Terminating Search.\")\n return True\n ...
3267fcb6ce40a8d0595e6979dd8f0ae1
Return filenames that have a spcified set of extensions.
[ { "docid": "841a54f260628de898d042118a6d2804", "score": "0.671288", "text": "def filenameMatchesAListOfExtensions(filename, extensionList=None):\n if extensionList is not None:\n for currExt in extensionList:\n if filename.lower().endswith(currExt.lower()):\n return T...
[ { "docid": "980d3d0380131c6070595da9574d0e44", "score": "0.7548063", "text": "def get_files(dirname, extensions=['.png', '.tif', '.jpg']):\n dir_path = Path(dirname)\n\n files = dir_path.glob('**/*')\n\n files = [path.resolve() for path in files]\n\n match = [f for f in files if f.suffix in ...
dfc4c0b6369e884b99877afc55bfd359
Build a Cypher query based on given parameters.
[ { "docid": "d75bc1828ce83ede1c9f954653f24192", "score": "0.5487266", "text": "def _build_dependencies_query(\n cls, team_id, topic, label, node, filter_on_config=False, impacted=False\n ):\n where = \"\"\n order = \"(n)<-[r]-(m)\" if impacted else \"(n)-[r]->(m)\"\n query ...
[ { "docid": "72ebf75d0424beb0d9398dd9dcc5f821", "score": "0.7439297", "text": "def build_query(self, params):\n pass", "title": "" }, { "docid": "a95e410d68282d18b99170eb9c871fae", "score": "0.70802385", "text": "def _build_query(self, params, boolean='AND'):\n query = [...
152c3edbb3aa0b05d956c5dcb6acb205
Initialize the Decomposable OperatorValued Kernel.
[ { "docid": "f09118c547cd865e208584e4cfd55bdd", "score": "0.0", "text": "def __init__(self, X, gamma):\n super(RBFDivFreeKernelMap, self).__init__(gamma)\n self.n = X.shape[0]\n self.d = X.shape[1]\n self.p = X.shape[1]\n self.X = X\n self.Gs_train = None", "...
[ { "docid": "31c1f825722e935a9f2040878ee62b3c", "score": "0.6014059", "text": "def init_op(self):\n return self._init_op", "title": "" }, { "docid": "933dc4e128744f5c26c4a36acf306da6", "score": "0.59667915", "text": "def __init__(self,kernel_fn,*args,order=2,**kwargs):\n sup...
b385b0580c451d27151a0b7f7ebf8293
Return a restricted zscore.
[ { "docid": "d9b8dbd9271cb251514b6863c4b30b2c", "score": "0.70605326", "text": "def zscoreOtherRestricted(measure, power, median, variationCoefficient, computeFinalZScore):\n zscoreNorm = zscore(measure, power, median, variationCoefficient)\n if math.fabs(zscoreNorm) > 3 and computeFinalZScore:\n if...
[ { "docid": "9ef0a40399c631949df3b99157924f0d", "score": "0.72016364", "text": "def get_zscore(self, zscore_value):\n\n s = self.get_score(self.prov_types['zscore'], zscore_value)\n return s", "title": "" }, { "docid": "953a1114c01dd842fe0a8694202b17b3", "score": "0.7117339"...
bdeff234398c45a1b8d7776f2ff0c2a2
Class method, which allows the user to populate the Database
[ { "docid": "5e4f589475625e693b789b714ddcc790", "score": "0.0", "text": "def populate(self):\n data = api_research_off()\n for product in data['products']:\n product_name = self.get_product_name(product)\n nutriscore = self.get_nutriscore(product)\n if nutri...
[ { "docid": "11c5c10dcb7519f823633e95d691706e", "score": "0.7409577", "text": "def _populateTables(cls):\n for method in dir(Populate):\n if not method.startswith('__'):\n populateTable = getattr(Populate, method)\n print 'Inserting data for %s ...' % metho...
28ecbd2ee477b01b0414a979344fe7a1
Function that Cleans the text and handles the superscript and subscript tags in the text
[ { "docid": "bada213dfa474c405bf524914fe10ab8", "score": "0.815164", "text": "def cleaning(text):\n \n ind = 0\n text = text.replace(\":\",\"\")\n n = len(text)\n\n \"\"\"Replacing sup tag with supercript\"\"\"\n while (ind < len(text)):\n if(text[ind]==\"<\" and ind < n-4 and text[ind+1:ind+4...
[ { "docid": "bcff0b3207f4a1f287474fa3ebeea447", "score": "0.70005953", "text": "def clean_text(text):\n # Replace newlines by space. We want only one doc vector.\n text = text.replace('\\n', ' ').lower()\n # Remove URLs\n #text = re.sub(r\"http\\S+\", \"\", text)\n # Expand contractions: y...
ffb57bc6ba104f32dc98f65948a63fa8
Returns best solution and energy after all runs
[ { "docid": "4e583b5900abb5f15a91f16db7969b24", "score": "0.0", "text": "def mws(model):\n \n def max_score_local(x_val, k = 0):\n \"\"\"\n Generates best neighbor upon mutating in one random direction\n Input: x_val to be mutated\n Output: neighbor with best score along...
[ { "docid": "dc23f9d302e3c5b94328c54bbe84fee4", "score": "0.7375325", "text": "def solution(self):\n return self.Mbest", "title": "" }, { "docid": "a7a458447c66af157f126dfa185c1878", "score": "0.6866638", "text": "def optimize(self):\n\n # Initiate particles\n sel...
a232b5ed960453ab1d2673894b52333d
submit a dos calculation and interpolate result if returns complete
[ { "docid": "5e0224e23e34529b3523d980d025abb2", "score": "0.0", "text": "def get_dos(self):\n\n label = 'KKR DOS calc.'\n dosdict = self.ctx.dos_params_dict\n description = 'dos calc: emin= {}, emax= {}, nepts= {}, tempr={}, kmesh={}'.format(dosdict['emin'], dosdict['emax'], dosdict[...
[ { "docid": "215366153e758085c8bc79a022ff8b6c", "score": "0.6252689", "text": "def calculate(self):\n item_number = self.fields.curselection()\n polynomial = self.json_data[\"functions\"][int(item_number[0])]\n result_floating = None\n result_interval = None\n if self.j...
3510ac42e4ef7ae99ff81d34dfc62eaa
Get List of field names when a container name is given. Container names if repeated in the snapshot metadata, will always contain the same internal metadata, so the parent of the container doesn't matter. container_field_name The container of whose List of field names are required List of field names
[ { "docid": "19a19c2a810e3f9fd8aa2036cfc9c0ba", "score": "0.8049855", "text": "def data_field_container_field_name_list_get(self, container_field_name):\n def dfs_helper(dict_to_find_in, container_field_name, ret_list):\n if dict_to_find_in is None:\n return\n ...
[ { "docid": "30c975d7087e5406555f5a29ddfc5d2f", "score": "0.61451197", "text": "def _get_list(container, name):\n\n try:\n return container[name]\n except KeyError:\n return []", "title": "" }, { "docid": "f10c4c60092e3146611d5e905294f06d", "score": "0....
3d86c1af870937aabf2ff3595bf01c6e
Return package metadata information.
[ { "docid": "5c54becc64e16a019dde1941f01c5892", "score": "0.0", "text": "def get_classifiers():\n return [\n 'Private :: Do Not Upload',\n 'Development Status :: 4 - Beta',\n 'Operating System :: POSIX :: Linux',\n 'Programming Language :: Python',\n 'Programming Lan...
[ { "docid": "ba35cfa5e926725340a889cc98973d81", "score": "0.8002718", "text": "def get_package_metadata(self, id=None, name=None, version=None, architecture=None):\n url = self._package_url(id, name, version, architecture)\n return self._get_request(url)", "title": "" }, { "doci...
4370a2db89aa376572fa763677d8f568
Add the hooks to the bot.
[ { "docid": "f6a523a74b100be16e1871ae1e1ba3f3", "score": "0.579434", "text": "def setup(bot: commands.Bot):\n bot.before_invoke(before_invoke)\n bot.after_invoke(after_invoke)", "title": "" } ]
[ { "docid": "42d07c0d20fbaab7a3ce210e4325d89b", "score": "0.7362344", "text": "def hook_events(self):\n for cmd in self.commands:\n self.core.add_command(cmd, self)\n for event in self.hooks:\n self.core.add_callback(event, self)\n for cmd in self.rawhooks:\n ...
0678ed29cb4ed04785fd661416546558
Check is a path is a broken symlink.
[ { "docid": "202729acc69cd2b9313649493f56ef9f", "score": "0.870235", "text": "def is_symlink_broken(path):\n if os.path.islink(path):\n return not os.path.exists(os.readlink(path))\n else:\n raise TypeError('path={!r} is not a symbolic link'.format(path))", "title": "" } ]
[ { "docid": "71564a56fc163c8e7d254c575b623e30", "score": "0.7800918", "text": "def checklink(path):\n # mktemp is not racy because symlink creation will fail if the\n # file already exists\n name = tempfile.mktemp(dir=path)\n try:\n os.symlink(\".\", name)\n os.unlink(name)\n ...
54c87c218016afc006e423f7687dcaee
Returns a boolean indicating whether this type is an 'interface' type that is implemented in Gecko. At the moment, this returns true for all interface types that are not types from the TypedArray spec.
[ { "docid": "50186e06c1db50f28ee3b3f7d75a25e9", "score": "0.700691", "text": "def isGeckoInterface(self):\n return self.isInterface() and not self.isSpiderMonkeyInterface()", "title": "" } ]
[ { "docid": "3fd0af121674f7ce21b6fec67acc48c9", "score": "0.75389546", "text": "def isSpiderMonkeyInterface(self):\n return self.isInterface() and (self.isArrayBuffer() or \\\n self.isArrayBufferView() or \\\n self.isTyped...
260a4b8f6a111255d751b34ee4804b99
Return an annual probability given a return period $$AEP = 1 \exp{1/ARI}$$
[ { "docid": "76ed3955f395457f23e1a92d5ee923b0", "score": "0.78453267", "text": "def probability(ari):\n aep = 1.0 - np.exp(-1.0/ari)\n return aep", "title": "" } ]
[ { "docid": "a969b34f946ea4cab04180a858e705ce", "score": "0.66628295", "text": "def probability(e, en, t):\n if t == 0:\n return 0\n else:\n return exp((e-en)/t)", "title": "" }, { "docid": "6d171e23a9d819ff00ddad221521a2ea", "score": "0.64231294", "text": "def ann...
a2553f674f9dde5c403aedc77dda2d72
Gets the metadata for the copyright.
[ { "docid": "add6e0375766c1ae82f03796afa040ba", "score": "0.8633044", "text": "def get_copyright_metadata(self):\n pass", "title": "" } ]
[ { "docid": "24f84680cf596560ecdac39cce9e64bc", "score": "0.8069426", "text": "def get_copyright_registration_metadata(self):\n pass", "title": "" }, { "docid": "9b439f8061f824cb732d55672fc3eaff", "score": "0.7513539", "text": "def copyright():\n # pull and print the meta-da...
f5f36a0534f4ea94adb8aad46271138a
Can this RecurringCost be enacted
[ { "docid": "757ffa3fd3a6bd9841075b459360f26d", "score": "0.49190748", "text": "def is_enactable(self, as_of):\n return \\\n not self.disabled and \\\n not self.archived and \\\n not self._is_finished(as_of) and \\\n self._is_ready(as_of) and \\\n ...
[ { "docid": "4c04ec54a498200fddebe61bfad145c7", "score": "0.6974328", "text": "def enact(self, billing_cycle, disable_if_done=True):\n as_of = billing_cycle.date_range.lower\n if not self.is_enactable(as_of):\n raise CannotEnactUnenactableRecurringCostError(\n \"Re...
ff858a38afa1ebd09c9cc6d02fb8e698
r""" Computes the reduced density matrix representation of the state. May be numerical or symbolic.
[ { "docid": "5571e02f616db6f7dcabfb10903524cd", "score": "0.6066919", "text": "def reduced_dm(self, modes, **kwargs):\n if modes == list(range(self.num_modes)):\n # reduced state is full state\n return self.dm(**kwargs)\n\n if isinstance(modes, int):\n modes...
[ { "docid": "364f54a74c07f748ea0080ffc36d9b1d", "score": "0.6417854", "text": "def subsystem_reduced_density_matrix(self, bit_labels):\n bit_labels_inds = [i-1 for i in bit_labels]\n other_labels_inds = list(set(range(self.system_size)) - set(bit_labels_inds))\n state_reshape = np.re...
8c117fa933aa0261b2f095be44a1acc1
Datatype of data in the Column.
[ { "docid": "05b88be13604b1f61d82f087e7106449", "score": "0.0", "text": "def type(self) -> str:\n return pulumi.get(self, \"type\")", "title": "" } ]
[ { "docid": "5b8088fbe0ac252d28bc703bdde1e7c3", "score": "0.8037336", "text": "def datatype(self):\n return self._datatype", "title": "" }, { "docid": "48de7eb74ceee9fe56fd65453b09294b", "score": "0.7955723", "text": "def dtype(self):\n return self._datatype", "title...