query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1bdc0b737b9b955f8ec29a4a1e1d7312
Parses the different request parameters of an endpoint found within the swagger JSON file and returns them as a list.
[ { "docid": "7f3e47b93cce6ba54973e0076cd87a14", "score": "0.6717176", "text": "def parse_rest_endpoint_request_params(request_properties, definitions):\n\n request_params = request_properties.get('parameters')\n if not request_params:\n return []\n\n if len(request_params) == 1 and reques...
[ { "docid": "2fca9c8192490e9927b2216ad2475ad6", "score": "0.64737785", "text": "def get_endpoint_data(app: APPApi, endpoint: Endpoints) -> list:\n if Methods.LIST not in endpoint.methods:\n raise AttributeError(\n f\"Method {Methods.LIST.name} is not available for endpoint {endpoint....
04307c3d78636f5b992d2fafd977bc3b
Initialize Rsa object by a private key or creating a new one by its key_size or importing an existing one from a key_file
[ { "docid": "608644edfac881b3e462a562b80e35bd", "score": "0.75208986", "text": "def __init__(self, private_key=None, key_size=0, key_file=None):\n\n if private_key is not None:\n self.import_private_key(private_key)\n if key_file is not None:\n self.import_from_file(ke...
[ { "docid": "089fa36a69d444de8083206742d89de6", "score": "0.6528461", "text": "def get_new_key(self, key_size):\n\n random_generator = Random.new().read\n self.private_key = RSA.generate(key_size, random_generator)", "title": "" }, { "docid": "386e3ab9f9215187b10239e4bae7c46e", ...
0a05f823b84bf6261bbfade0e2a6796e
Test remove specific row from a table
[ { "docid": "e0ffdfb25317c3a1153dc3019132a6c3", "score": "0.7255831", "text": "def test_remove_row(self, server):\n server.remove.when.called_with(\"posts\", 3).should.throw(RowNotFound, \"Row with id '3' in table 'posts' not found\")\n\n server.get_table(\"posts\").should.be.equal({\"posts...
[ { "docid": "113816543ec31ca162f867ac3265f983", "score": "0.73844546", "text": "def removeRow(self,row):\n if row < len(self)-1:\n self._table[row:-1,:] = self._table[row+1:,:]\n self._meta[\"length\"] -= 1\n if self._meta[\"index\"] >= row:\n self._meta[\"index\"]-=1\n self.notify(...
e6db919f61f5b8ef17b4050c15accaf4
This function will open the file and then it will insert the data (lines from that file) into the list.
[ { "docid": "cb08ac96f4b9e12cda594ddc3969eaa5", "score": "0.6923297", "text": "def read_filename(self, file_name):\n self.text_lines = task2.ListADT(40)\n # This is to open the file\n f = open(file_name,\"r\")\n # This will read the files\n f1 = f.readlines()\n #...
[ { "docid": "3c95d3b5dea17035faedcbfbbc569474", "score": "0.68577355", "text": "def load(self, f):\n\t\tfor line in f:\n\t\t\tself.add(*line.split(\"\\t\"))", "title": "" }, { "docid": "fa8944139268786722a6e5d4698b415e", "score": "0.67339957", "text": "def add_items_from_file(self, fi...
0aab8c9ac9d58d754dc30b188ada4bb7
Calculates the cardinality (number of Paretooptimal estimates) for each action in the given position, and returns the int representing an action with maximum cardinality. Ties are broken randomly among max cardinality actions. (EvaluationMechanism.C)
[ { "docid": "8aebfd68c50567768847726a5ece7e52", "score": "0.7154346", "text": "def cardinality_evaluation(self, state: object) -> int:\n\n # List of all Qs\n all_q = list()\n\n # Getting action_space\n action_space = self.environment.action_space\n\n # for each a in act...
[ { "docid": "9d26eb5ff38fbeaef57b16492ac16419", "score": "0.63622975", "text": "def find_max_action(self):\n\n\t\tbest_actions = []\n\t\taction_values = []\n\n\t\tfor action in self.actionset:\n\t\t\taction_values.append(action.value)\n\n\t\tfor action in self.actionset:\n\t\t\tif (action.value == max(ac...
b63f69ba794c8f8efa5bf79f991d9384
Add a context item for a target. Only adds context if either vocab is not fixed, or if limitingVocab contains the relevant word.
[ { "docid": "2c6bb3dd5fe288a12c35e264a05b7aae", "score": "0.8017833", "text": "def add_context(self, target, contextItem, count=1):\n\n # if the ctx item has already been observed for this target, increment it\n if contextItem in self.contextCount[target]:\n self.contextCount[tar...
[ { "docid": "2b81fbfd5b119bbd4ed3a5845cedf3d0", "score": "0.59948903", "text": "def add(self, context: torch.Tensor, action: int, reward: int):\n self.db[\"contexts\"].append(context)\n self.db[\"actions\"].append(action)\n self.db[\"rewards\"].append(reward)\n self.db_size +=...
c531f1b72956807270a86ae30196fb2a
Test utilization calculation is fair between suballocs.
[ { "docid": "cd61dc75978e742a4885d01f1f7e7533", "score": "0.7152675", "text": "def test_sub_alloc_reservation(self):\n alloc = scheduler.Allocation()\n\n sub_alloc_poor = scheduler.Allocation()\n alloc.add_sub_alloc('poor', sub_alloc_poor)\n sub_alloc_poor.add(scheduler.Applic...
[ { "docid": "b8df5ab8b22ac757ee9498654ee2c12f", "score": "0.74618477", "text": "def test_sub_allocs(self):\n alloc = scheduler.Allocation([3, 3])\n self.assertEqual(3, alloc.total_reserved()[0])\n\n queue = list(alloc.utilization_queue([20., 20.]))\n\n sub_alloc_a = scheduler....
ed2ea21b0090aefc46271db70220ca75
Clones a workshop unit from the corresponding template. Each cloned workshop unit will be placed into a group with the following naming scheme Units.
[ { "docid": "776574e7e8969078d9f0b9ec3d5c6b45", "score": "0.7478491", "text": "def clone_unit(self, workshop, session_id):\n group_list = list(self.vbox.machine_groups)\n template = \"/\" + workshop + \"-Template\"\n l.info(\"Cloning template: %s\", template)\n\n if template n...
[ { "docid": "6230a6a42b855bc89b6d9d158d33d0b6", "score": "0.64617246", "text": "def Clone(self, standard=0):\n clone = UnitItem(self.unitSystem)\n clone.id = 0 # dummy until added to list\n clone.typeID = self.typeID\n clone.name = '%s-clone' % self.name\n clone.sca...
445b26ed5c153918c12ea421277bb979
Predicts data inputs. data should be the remaining part of dataset without the label column.
[ { "docid": "921c67cc27b57f143fc1329675a765e7", "score": "0.7459156", "text": "def predict(self, data) -> Iterable:\n raise NotImplementedError", "title": "" } ]
[ { "docid": "50fea84c43bcfcf8806b1e5928b963fd", "score": "0.8207221", "text": "def predict(self, data):\n pass", "title": "" }, { "docid": "ee204aa532cbed03d2f369b7858014b7", "score": "0.81683457", "text": "def predict(self, data):\n raise NotImplementedError", "titl...
cebb7140719d5ef055620b77831b3884
Calculates the global transformation matrix for rotating the local panel coordinates with thetaLocal around cmGlobal of each body. Usage
[ { "docid": "d63d818f7d1411fa5c9a8c26653e152a", "score": "0.63766783", "text": "def __updateRotMat(self):\n\n # The global rotational matrix\n self.__rotMat = [_numpy.array([[_numpy.cos(geometryData['thetaLocal']), -_numpy.sin(geometryData['thetaLocal'])],\n ...
[ { "docid": "6d33b8d779a76ac2364815be4a563711", "score": "0.67033803", "text": "def _convert_local_to_global(position, local_coords):\n local_x = normalize(local_coords[0])\n global_x = (1, 0, 0)\n # Find angle between x-axes and rotation axis perpendicular to both x-axes\n angle = np.arccos(...
e7bc52a4486763d1221f66c79aef62ef
Test that the cache is cleared for each owner removing
[ { "docid": "e32227af3cf5185723559b577ceba8c7", "score": "0.78745973", "text": "def test_removing_clears_cache(self):\n group = self.create_group()\n user1 = self.create_user()\n user2 = self.create_user()\n\n # Because the cache is cleared when we add the user to the group us...
[ { "docid": "8e724f2b9ed121392d066df28145c545", "score": "0.7653182", "text": "def test_adding_clears_cache(self, mock):\n group = self.create_group()\n user1 = self.create_user()\n user2 = self.create_user()\n\n group.owners.add(user1)\n group.owners.add(user2)\n\n ...
8d026cbd0a27b13599b6abc6de286584
Overwrite sensor frame id to return fake frame ID for NAC representing a mounting point with a 180 degree rotation. ID was taken from ISIS's IAK kernel for Cassini. This is because NAC requires an extra rotation not in NAIF's Cassini kernels. Wac does not require an extra rotation so we simply return original sensor fr...
[ { "docid": "a206870ceb2aa4b3944c9785bc9688b4", "score": "0.66167575", "text": "def sensor_frame_id(self):\n if self.instrument_id == \"CASSINI_ISS_NAC\":\n return 14082360\n elif self.instrument_id == \"CASSINI_ISS_WAC\":\n return 14082361", "title": "" } ]
[ { "docid": "d052c3135a9fd5ed52f16d7bf40b4172", "score": "0.67812043", "text": "def _original_naif_sensor_frame_id(self):\n return self.ikid", "title": "" }, { "docid": "d052c3135a9fd5ed52f16d7bf40b4172", "score": "0.67812043", "text": "def _original_naif_sensor_frame_id(self):...
d60463d062e7ad6a3a0dabcc927400d0
Waits for an element to be present, visible and enabled such that you can click it.
[ { "docid": "1f59004ac5149b59e59cf958fa803b64", "score": "0.60819745", "text": "def wait_for_clickable_by_xpath(self, xpath):\n print \"Executing wait_for_clickable_by_xpath('{0}')\".format(xpath)\n\n try:\n WebDriverWait(self.driver, self.timeout_to_locate_element_in_seconds).un...
[ { "docid": "71acfed97aab7add24a1a64e99d6e75b", "score": "0.7337957", "text": "def wait_until_visible(self,\n element: typing.Union[model.AnyConcretePageElement, str],\n timeout=None, ) -> None:\n if isinstance(element, str):\n element...
a7f7ecb3cdcd13b01703aeba174442d2
The integration runtime reference.
[ { "docid": "7908c1f7098349a33eca5896c442ac49", "score": "0.0", "text": "def connect_via(self) -> Optional[pulumi.Input['IntegrationRuntimeReferenceArgs']]:\n return pulumi.get(self, \"connect_via\")", "title": "" } ]
[ { "docid": "0ddf151c5c093edd0ba08adffc9c832d", "score": "0.6418033", "text": "def get_legate_runtime() -> Runtime:\n return runtime", "title": "" }, { "docid": "203d6fdad3c2c2263b7d8868d7e8212c", "score": "0.5748983", "text": "def _get_reference(self):\n pass", "title":...
8393a93f5012ff474df530bd5136ba62
Get download requests Create a list of DownloadRequests for all Sentinel2 acquisitions within request's time interval and acceptable cloud coverage.
[ { "docid": "7e34b1ec14e21d060531fcf4ea96d81e", "score": "0.57102734", "text": "def get_request(self, request):\n return [DownloadRequest(url=self.get_url(request=request, geometry=geometry),\n filename=self.get_filename(request, geometry),\n ...
[ { "docid": "7542edfefbd9405c164624932397269a", "score": "0.64738226", "text": "def create_request(self):\n fis_service = FisService(config=self.config)\n self.download_list = fis_service.get_request(self)", "title": "" }, { "docid": "1d51d4f408534a42d85ffed5b12f8cc0", "scor...
f775a8a4bd8be8c19d5b660aafa9531c
Reads EAM parameters from a LAMMPS file and returns relevant spline fits. This function reads singleelement EAM potential fit parameters from a file
[ { "docid": "acafef618142324256b4f1670b062c57", "score": "0.7398796", "text": "def load_lammps_eam_parameters(f):\n raw_text = f.read().split('\\n')\n if 'setfl' not in raw_text[0]:\n raise ValueError('File format is incorrect, expected LAMMPS setfl format.')\n temp_params = raw_text[4].split()\n ...
[ { "docid": "06ce7f29990872f4a8ba8e039b3a7550", "score": "0.599541", "text": "def read_params(run_name, exact=False):\n if \".tersoff\" in run_name:\n run_name = run_name.split(\".tersoff\")[0]\n if not exact:\n filename = \"input_%s.tersoff\" % run_name\n else:\n filename =...
25fb8eeebc3c0b032b2830a046459ba9
Finds all config.yml files in subdirectories
[ { "docid": "4162f13f6c6261322069fed68b31198e", "score": "0.8162081", "text": "def _find_config_files(self):\n config_file_list = []\n for directory in os.listdir('src'):\n for config_file in glob.iglob('src/' + directory + '**/*.yml', recursive=True):\n config_fil...
[ { "docid": "7ba99741fc5a53e8fa448fa86ad5d30f", "score": "0.70910406", "text": "def list_configs():\n _, _, filenames = next(os.walk(CONF_DIR))\n return filenames", "title": "" }, { "docid": "10a24ca7dd85bc19783e5e195c4ebc3a", "score": "0.7014341", "text": "def _read_configurati...
deeaddcd63975a789275f8768301cd9c
Use pretrained TRPO and reusume experiment.
[ { "docid": "c05eaadc0b61d87bbd74bbb890780f3d", "score": "0.57973146", "text": "def pre_trained_trpo_cartpole(\n ctxt=None,\n snapshot_dir='data/local/experiment/trpo_gym_tf_cartpole',\n seed=1):\n set_seed(seed)\n with TFTrainer(snapshot_config=ctxt) as trainer:\n train...
[ { "docid": "365083a3d920b15814c94222f0d58ad2", "score": "0.70100135", "text": "def auto_trpo_benchmarks():\r\n iterate_experiments(trpo_garage_pytorch, MuJoCo1M_ENV_SET)\r\n iterate_experiments(trpo_garage_tf, MuJoCo1M_ENV_SET)", "title": "" }, { "docid": "853c0fff618b416a2026d49d0fdf1...
020bcbea04fd71797b7ad19c80fe5c8b
r""" The gradings of the generators of the polynomial ring.
[ { "docid": "e9c44b520e88585ad7bbba19c423ba7a", "score": "0.0", "text": "def gens(self) :\n return tuple(self.__ngens*[self.__index])", "title": "" } ]
[ { "docid": "e0fbaa8d113ffb05037096609bd6d674", "score": "0.6354953", "text": "def grad_recipe(self):\n x = self.data[0]\n c = 0.5 / np.sin(x)\n return ([[c, 0.0, 2 * x], [-c, 0.0, 0.0]],)", "title": "" }, { "docid": "1f9bff64bd11ca6757776bf3ad32da68", "score": "0.628...
53e405bd4cb35f5c754ead041c2f11e7
Test case for submissions_list
[ { "docid": "1f21d1d64d50968d027c40ba1b2bbe85", "score": "0.90333706", "text": "def test_submissions_list(self):\n pass", "title": "" } ]
[ { "docid": "2e57b88f0ef9f8840641f835daa80685", "score": "0.8283224", "text": "def test_lists_submissions(self):\r\n course_id = None # Change me!!\r\n date = None # Change me!!\r\n grader_id = None # Change me!!\r\n assignment_id = None # Change me!!\r\n\r\n r = se...
b193acdd42f66aed0dc6c5daef0dd653
Return pretrained word vectors.
[ { "docid": "053d19975554f116caf46d717a1dc662", "score": "0.0", "text": "def create_vocab_embeddings(vocab2index):\n # embedding_dim = 300\n # word_embedding_lookup = embeddings.GloveEmbedding('common_crawl_840', d_emb=embedding_dim, show_progress=True)\n word_embedding_lookup, embedding_dim = word_em...
[ { "docid": "fc1d07dac3a52689b5dd04a5483a761e", "score": "0.77720606", "text": "def __read_pretrained_word_vecs(self):\n num = 0\n word2idx_glove = {'<unk>': num} # initial unk\n with open(self.file_path, 'r', encoding='utf-8') as file:\n file = file.readlines()\n ...
5980e48718ab996f4a94b725c413d6a6
Adds tests to _tests via list extension
[ { "docid": "21203eb69531b17a94292d1a0fee2cff", "score": "0.7253698", "text": "def add_tests(self, tests):\n\t\tif not isinstance(tests, list):\n\t\t\traise(TypeError(f'add_tests expects list'))\n\t\telif len(tests) == 0:\n\t\t\traise(ValueError(f'0 tests passed, expects a minimum of 1'))\n\t\telif not a...
[ { "docid": "742e912e336b2acdd4458b69d7aefc1a", "score": "0.7248542", "text": "def _build_tests_list_helper(self, suite):\n tests = list(iterate_tests(suite))\n return tests", "title": "" }, { "docid": "d52a46a0849d1a8afd20c60ab6fed1c6", "score": "0.72028774", "text": "d...
f1851900537bbba86ee1d4f6443488ef
Logs the useranswer into CSV File
[ { "docid": "08d0021c1e7a0804ba8d2e5fe99453d9", "score": "0.6550432", "text": "def log_answer(self, answer: dict):\n folder_path = self.result_path.parents[0]\n if not os.path.exists(folder_path):\n os.mkdir(folder_path)\n\n resultexist = os.path.exists(self.result_path)\n...
[ { "docid": "a86b683c1051603dd44e484630768b02", "score": "0.62461", "text": "def save_file_as_csv(self):\r\n timestamp = datetime.datetime.now().strftime(\"%Y%m%d\")\r\n filepointer = asksaveasfile(defaultextension=\".csv\", initialfile=\"output_%s.csv\" % (timestamp),\r\n ...
e673c1606d22d1b23e316e5036365108
SearchCh(TStr self, char const & Ch, int const & BChN=0) > int
[ { "docid": "5e064a161caf456ca6a361d9538b06e6", "score": "0.8020564", "text": "def SearchCh(self, *args):\n return _snap.TStr_SearchCh(self, *args)", "title": "" } ]
[ { "docid": "aef2247c84f5825c7a121040502c63d1", "score": "0.72751737", "text": "def SearchCh(self, *args):\n return _snap.TChA_SearchCh(self, *args)", "title": "" }, { "docid": "3903c5e7bf6d655744e84ad534c43482", "score": "0.6394132", "text": "def GetCh(self, *args):\n r...
d0525c28892b5fa620141c44ca68dd3f
Return y value float Get Value from Chart , Value of x x_limit limit of x axis
[ { "docid": "e45b82c6e9db6b5c8fc85f928446a457", "score": "0.62933195", "text": "def get_y(x, ser=None):\n df = pd.read_csv(data[ser])\n xvalues = list(df['x'].values)\n yvalues = list(df['y'].values)\n x_limit = xvalues[-1]\n xmin = xvalues[0]\n y_limit = yvalues[-1]\n ymin = yvalues...
[ { "docid": "af4726fcf373e970fb90b87522f4801e", "score": "0.6479902", "text": "def __call__(self):\n vmin, vmax = self.axis.get_view_interval()\n return self.tick_values(vmin, vmax)", "title": "" }, { "docid": "5324865d1132bec759fd55a820e97d3e", "score": "0.62105405", "t...
7f7cdba96793c49aa3b3065d0984c5d4
Reader for SSEC DMV binary files using "pure Python". This function is currently capable of reading RNC, RFC, RLC, and CXS files, but not SUM files. The function returns an xarray Dataset that contains various data variables and metadata for those variables.
[ { "docid": "8cbcbe59537efe74447138f682a0c937", "score": "0.5972535", "text": "def readDMV(filename):\n import numpy as np\n import pandas as pd\n import xarray as xr\n from collections import OrderedDict\n from ohwhio import getDMVformat\n\n def readTOC(sizeTOC):\n dependentVari...
[ { "docid": "5abf62bf338b1451b3b3dc451e09f339", "score": "0.6292946", "text": "def read(cls, file_str, drop_variables_str=None, decode_cf=True, decode_times=True, engine_str=None):\n ds = xr.open_dataset(file_str, drop_variables=drop_variables_str, decode_cf=decode_cf, decode_times=decode_times, e...
26409943bae31857aaaa9854506b8c66
Converts the input JSON data into list of Object/BucketAccessControls.
[ { "docid": "474672c7fbda5caf930210225a610c64", "score": "0.56806", "text": "def JsonToMessage(cls, json_data, message_type):\n try:\n deserialized_acl = json.loads(json_data)\n\n acl = []\n for acl_entry in deserialized_acl:\n acl.append(encoding.DictToMessage(acl_entry, message...
[ { "docid": "dce820e8956476dbf2e702d4a71f6cca", "score": "0.5801024", "text": "def getAccessControlList(resource):\n users = _getResourceUsers(resource)\n jsonarr = []\n resource_text=None\n reeource_url=None\n resource_rec = Resource.query.filter(Resource.name==resource).first()\n if r...
c574954914086f79c6870ff1c737846c
Set black_white to true if vessels are darker than the background and to false if vessels are brighter than the background.
[ { "docid": "7f2e26591b466d1ac5c41e9f522d05a2", "score": "0.59593964", "text": "def filter_out_background(voxel_data, black_white, eigen2, eigen3):\n if black_white:\n voxel_data[eigen2 < 0] = 0\n voxel_data[eigen3 < 0] = 0\n else:\n voxel_data[eigen2 > 0] = 0\n voxel_da...
[ { "docid": "98e0db3707a31c52183f59b7f8b1ae57", "score": "0.68847424", "text": "def set_white(self):\n value = self.sensor.reflection()\n if value > self.white:\n self.white = value", "title": "" }, { "docid": "39d952d2cf002342f37ffc0e6449c85f", "score": "0.664935...
704338d432a3a5db746ae4a599d1f944
Test the group_kwargs decorator
[ { "docid": "8e5c638eb711f21e3ab23d90b40f79d6", "score": "0.71135956", "text": "def testDecorator(self):\n\n selftop = self\n\n class C1(object):\n\n @group_kwargs(prefixes=['slave_'], assign=True)\n def __init__(self, **kwargs):\n selftop.failUnless(has...
[ { "docid": "c6b5308c0715c069070cc8701b4e218c", "score": "0.657985", "text": "def keyingGroup(*args, **kwargs):\n pass", "title": "" }, { "docid": "ab9190b3a955bd685b5c20b8fc82d10f", "score": "0.6334385", "text": "def setgroups(*args, **kwargs): # real signature unknown\n p...
3980c501ae555356c2379ee7ca6b01e7
Devices that are owned by the user. Readonly. Nullable. Supports $expand and $filter (/$count eq 0, /$count ne 0, /$count eq 1, /$count ne 1).
[ { "docid": "0b2d98ccef8133f0ede417492496e571", "score": "0.7089999", "text": "def owned_devices(self):\n return self.properties.get('ownedDevices',\n DirectoryObjectCollection(self.context,\n ResourcePat...
[ { "docid": "b5606b192cfe7a3a34bdbd518d4d22eb", "score": "0.55271053", "text": "def device_owner(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"device_owner\")", "title": "" }, { "docid": "b5606b192cfe7a3a34bdbd518d4d22eb", "score": "0.55271053", "text": "def...
b0db6ef783b093b98fd570d24b24e72d
Loads the map file from the specified location. Returns a numpy array
[ { "docid": "ebef75f3abde74c41f76e323b81f76ef", "score": "0.7459294", "text": "def load_map(file_location):\n\n def rgb2gray(rgb):\n gray = np.dot(rgb[..., :3], [0.2989, 0.587, 0.114])\n gray[gray < 0.1] = 0.\n gray[gray > 0.1] = 1.\n return gray\n\n img = mpimg.imread(f...
[ { "docid": "7720f4628c0af7f17f8ce9d32a206bdc", "score": "0.67278665", "text": "def load_map(cls, filename):\n return None", "title": "" }, { "docid": "c34e8e1175840b4628fcbf28009ac314", "score": "0.66093856", "text": "def readMap(fileName, fileFormat,logger):\n \n #Open fi...
b4ea335edd14eef3e844af60bd22c232
Converts input data (1 txt file) to SearchStruct
[ { "docid": "057b6c219b666894d8f4494e475cae94", "score": "0.55288476", "text": "def to_SearchStruct(art_dir, max_count=1000) -> SearchStruct:\n start = perf_counter()\n articles = files_to_articles(art_dir, max_count)\n print(f\"{max_count} articles processed\")\n end1 = perf_counter()\n S...
[ { "docid": "10f77ef9c1bc4d6bac546cfb0422bf5e", "score": "0.5858171", "text": "def _read_data(cls,input_file):\n rf = open(input_file,'r')\n lines = [];words = [];labels = []\n for line in rf:\n word = line.strip().split(' ')[0]\n label = line.strip().split(' ')...
73fd191c91c9040e9e507cf649c072af
initialize a UDPv6 connector
[ { "docid": "d9ce8707f99676403d30945a245111cf", "score": "0.6049554", "text": "def __init__(self, name = None):\n try:\n self.file = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)\n except:\n raise\n\n if (address != None and port != None):\n try:\n ...
[ { "docid": "b9aef9a3031c8c2c4ae717c16d33e69c", "score": "0.62338203", "text": "def connect(self):\n self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)", "title": "" }, { "docid": "fdbfb040ad4ae87b1003806c62d2d996", "score": "0.6182419", "text": "def __init__(self, ...
9f36c55a713d140d44b91d416c9f5249
Return the path to the map directory associated with the given ``tag`` file.
[ { "docid": "a830857fdc18d7c2ffd2a8d322fffeaa", "score": "0.8115694", "text": "def tagfile_to_map_dir(tagfile: Path) -> Path:\n if not tagfile.exists():\n raise exceptions.TagNotFound(f'The tag {tagfile.stem} was not found')\n uid = uuid.UUID(tagfile.read_text())\n return map_dir_path(uid...
[ { "docid": "0b9fa97568a2c08edf9a5e56c69a2704", "score": "0.86819744", "text": "def tag_to_map_dir(tag: str) -> Path:\n return tagfile_to_map_dir(tags.tag_file_path(tag))", "title": "" }, { "docid": "355d8406d853f3743d2a2845982bf21a", "score": "0.7170766", "text": "def pathname(sel...
33adde44787b437f1851077575ac55c6
Given electoral college rows and state edges, returns the outcome of the Electoral College, as a map from "Dem" or "Rep" to a number of electoral votes won. If a state has an edge of exactly 0.0, its votes are evenly divided between both parties.
[ { "docid": "68bffec74ecb34ac97f1b2e1d7447b8b", "score": "0.852372", "text": "def electoral_college_outcome(ec_rows, state_edges):\n ec_votes = {} # maps from state to number of electoral votes\n for row in ec_rows:\n ec_votes[row[\"State\"]] = float(row[\"Electors\"])\n\n o...
[ { "docid": "1a4f01102b4d02792ccaaddeea254fee", "score": "0.69664186", "text": "def state_edges(election_result_rows):\n #TODO: Implement this function\n state_edges = {}#create a dictionary \n for row in election_result_rows: #implement each row in election_result_rows\n state_name = row...
a0b4083514f10b8a7b23591bf09c6412
Sets the group1 of this DesignComparison.
[ { "docid": "72a73ff8b7ae11ea4fddd5a666b60aae", "score": "0.8002115", "text": "def group1(self, group1: str):\n if group1 is None:\n raise ValueError(\"Invalid value for `group1`, must not be `None`\") # noqa: E501\n\n self._group1 = group1", "title": "" } ]
[ { "docid": "b85afa594d235ab1c97b3e978011362c", "score": "0.6944517", "text": "def group1(self) -> str:\n return self._group1", "title": "" }, { "docid": "c9095bbe0a140abdc41f54d19cab9bb3", "score": "0.65480804", "text": "def set_group(self, group_no):\n self.__group = g...
5df63f13bdd0a54f3e8d1615db2a5eda
Internal utility method; retrieve the base JSON object for this element of the response data.
[ { "docid": "da22c4fa28a6b84e05319c34e8f0366a", "score": "0.5827524", "text": "def getBase(self):\n return self.base", "title": "" } ]
[ { "docid": "25cd3f881482d7710d497f48f761ccf1", "score": "0.6537689", "text": "def json(self):\n return self.json_data", "title": "" }, { "docid": "53d99cb95e8b517d419e6b4ba6b3abc3", "score": "0.6452126", "text": "def json(self):\n return self.json_data", "title"...
a60067009e4c5c0fbdc3267233c3fb87
Convert shot gather to phase velocty vs. frequency panel
[ { "docid": "a15028dcecb6d9a9ec0706db194537a6", "score": "0.55621666", "text": "def d_to_fv(d,dt,side,f_abs=0):\n # Create phase velocity vs. frequency spectrum\n fv,v,freq = phase_vel_spectrum(d,DX,dt,FMAX,VMIN,VMAX,side=1,f_abs=f_abs)\n # The rest of the function is about editing the fv panel\...
[ { "docid": "8fd1810fe69ea42801b322080701a919", "score": "0.58816457", "text": "def phase_vocoder(spect, rate, phi_advance):\n\n time_steps = torch.arange(0, spect.size(\n 3), rate, device=spect.device) # (new_bins,)\n\n alphas = (time_steps % 1) # (new_bins,)\n\n phase_0 = angle(spect[...
e3826ddac93602023a18a0e222aa7d70
get current session id
[ { "docid": "e5101736f0919e593f750b92bd8874e6", "score": "0.6773285", "text": "def session(self):\n return self.current_status[\"$SESSION\"]", "title": "" } ]
[ { "docid": "8773b20ac4d63fd6515df513127f4821", "score": "0.8484392", "text": "def session_id(self) -> str:\n return pulumi.get(self, \"session_id\")", "title": "" }, { "docid": "7a4ca68d98358859f196bf53c0b98fe6", "score": "0.8388298", "text": "def session_id(self):\n .....
2dc80f694836a6f5591d0cb816072a54
Select a question based on what will narrow the animal list the most.
[ { "docid": "8aefa086385f7e3a096b1ca35767f03b", "score": "0.64690036", "text": "def get_question(questions, animals):\n true_counts = [len(animals) * -1 for i in animals[random.choice(animals.keys())]]\n false_counts = [len(animals) for i in animals[random.choice(animals.keys())]]\n for name, an...
[ { "docid": "07f4e19a8aa570777d8afab10e929945", "score": "0.5841787", "text": "def _select_theory(self, theories):\r\n if theories:\r\n values = tuple(theories.values())\r\n best = max(values)\r\n confidence = float(best) / sum(values)\r\n if confidence ...
1647bd3633e1b487174da7c52b81a25a
Get 'n' top ranked candidates according to maximin sampling to add to current samples x
[ { "docid": "1cbd3b684f76d980fb22fd6c40497bbd", "score": "0.0", "text": "def select_points(self, x, n):\n x = da.from_array(x, chunks='auto')\n c = []\n for idx in range(0, n):\n c_new = self.select_point(x)\n x = da.vstack((x, c_new))\n c.append(c_ne...
[ { "docid": "cdd381228f5ca71e8cd33213a18329b3", "score": "0.6600673", "text": "def top_n(distributions, n=5):\n if not n:\n n = len(distributions)\n return sorted(distributions, key=lambda y: y[1], reverse=True)[:n]", "title": "" }, { "docid": "9ffaeacd0b71c2e442896dd2b536cc43", ...
4f62f5ab655ac62180b2332ab40492b7
This function will fetch the User role by id and return the dictionary as response
[ { "docid": "9f8f6d751154be55075f511f5fafd3b1", "score": "0.71706206", "text": "def get_user_role_id(self, role_id):\n try:\n url = KEY_CLOAK_API_URI + KEY_CLOAK_USER_ROLES_ENDPOINT\n url += '/' + role_id\n headers = {'Content-Type': 'application/json',\n ...
[ { "docid": "ce738c1c5f7a3f6281bba2dc8f5aa14c", "score": "0.7288991", "text": "def get(self, id):\n role = Role.query.filter_by(id=id).first()\n if role is None:\n return { 'message': 'Role does not exist'}, 404\n\n return role_schema.dump(role)", "title": "" }, { ...
9f52165a8cf9b36369a2e30886ef75aa
How many elements were retrieved from the iterator.
[ { "docid": "942d2f5c624334adb89e2511e1577412", "score": "0.72104114", "text": "def retrieved_elements(self) -> int:", "title": "" } ]
[ { "docid": "5f9155403c07aa051433d9fcfc223f2d", "score": "0.8210471", "text": "def num_entries(self):\n assert self.iterator is not None, 'iterator is not set'\n return self.iterator.num_entries()", "title": "" }, { "docid": "d2b5f7cbdc8e791084fba76463cf2a05", "score": "0.77...
3808ec16ed340183ec2f098067ec552d
Return a list of links from html
[ { "docid": "271ee6dad8597fb43d92a7cf8838fbc1", "score": "0.7916816", "text": "def get_links(html):\n # a regular expression to extract all links from the webpage/通过正则表达式取出href=所有网络连接地址,re.IGNORECASE-忽略大小写\n webpage_regex = re.compile('<a[^>]+href=[\"\\'](.*?)[\"\\']', re.IGNORECASE)\n # list of...
[ { "docid": "9c58f98f6cc9899d5f5304afe74a8798", "score": "0.8474521", "text": "def get_links(html):\n #print(\"Getting links from: \", html)\n webpage_regex = re.compile('<a[^>]+href=[\"\\'](.*?)[\"\\']', re.IGNORECASE)\n links = webpage_regex.findall(html)\n print(\"Got links are: \", links)...
b8cfc188a3866e276c5b31380962f0eb
Update state of the current player
[ { "docid": "c6310cd2d75b2ca7827fd1f4adb54525", "score": "0.6370497", "text": "def update_state(self, board):\n\n me = board.current_player\n\n # fail the game or not\n alive = [is_alive(board.step, me)]\n\n # the status of opponents\n terminals = [\n is_aliv...
[ { "docid": "a0a56d382f4cdaf364117fa5d4eb9c3d", "score": "0.7834334", "text": "def update(self):\n self.current_player = self.players[self.turn_number%len(self.players)]", "title": "" }, { "docid": "1a4b6732d1dfaea3d541ca86ce904080", "score": "0.73502195", "text": "def update_c...
bc043ba7491b4eb2c5c542502bf37aa4
Displays a list of cities in their states in a website
[ { "docid": "6fa3ce413e0657d1a383c0e7c041e1d1", "score": "0.59353393", "text": "def list_state():\n state_list = storage.all(State).values()\n return render_template('7-states_list.html', state_list=state_list)", "title": "" } ]
[ { "docid": "f3948016f555b0629e7a5e86ea7536c4", "score": "0.8651738", "text": "def display_cities():\n states = storage.all(\"State\").values()\n return render_template('8-cities_by_states.html', states=states)", "title": "" }, { "docid": "5f4bc67fcf99e85011fe951511b490e2", "score":...
5e19045594f6cfd897219518e8ddd7e1
Calculate the location of a given word.
[ { "docid": "7fef96c7c08e997a46dae825f9933a5d", "score": "0.617547", "text": "def calculate_word_index(\n current_line_tabified_text: str,\n source_text_word: str,\n find_word_count: int,\n source_text_spaces: Optional[str],\n ) -> int:\n POGGER.debug(\"source_text_w...
[ { "docid": "9571c5b9cec0c7d2fe93a056f207ecf2", "score": "0.73364264", "text": "def find_word(self, word):\n coordinates = self.__add_coordinates([], word, self.find_word_horizontal)\n coordinates = self.__add_coordinates(coordinates, word, self.find_word_vertical)\n coordinates = se...
05d2d951f991764175e2c83171880cf0
Getting count articles of users.
[ { "docid": "f0461f0cbfbb9da622ed2c25aeb6a05c", "score": "0.66980654", "text": "def objects_with_count_articles(self, queryset=None):\n\n return self.annotate(count_articles=models.Count('articles', distinct=True))", "title": "" } ]
[ { "docid": "ab25738f524b3c8db2bdc4936b6cb0ea", "score": "0.7179851", "text": "def get_users_count():\n count = mongo.db.users.find().count()\n return count", "title": "" }, { "docid": "aca28459712ca605d5ddffd8743caa5d", "score": "0.7110084", "text": "def get_users_count():\n ...
8e34bb7ab5b42efa1bc8f5e4ac2195c8
Set the raw payload of this recipe
[ { "docid": "dcd9f2ce8915cf710735243367a68071", "score": "0.61381423", "text": "def set_json_payload(self, payload):\n self.data['payload'] = json.dumps(payload)", "title": "" } ]
[ { "docid": "c0023d54ed246cfe2d9d111c5e10a0ed", "score": "0.7026609", "text": "def payload(self, payload: bytes):\n self._payload = payload\n return", "title": "" }, { "docid": "e4caea2967ebfad1f8a6300c478406a7", "score": "0.69749093", "text": "def set_payload(self, payl...
512646c750b13176a046c87998c7290e
Empty input will return None
[ { "docid": "f6d3eede99db0e2f1e7fc282bab3178c", "score": "0.0", "text": "def test_ngrams_from_empty(self):\n no_ngrams = sujmarkov.get_ngrams([])\n for x in no_ngrams:\n self.fail(\"We should not have any ngrams\")", "title": "" } ]
[ { "docid": "b6cfdba532b8b2f26045b26940b4c8b2", "score": "0.69700664", "text": "def optionalInput(self):\n raise NotImplementedError(\"This function is not written yet. Please put in an issue on the github page.\")", "title": "" }, { "docid": "2eb006acd0bef8bd341bc39e47eb28ee", "sc...
efe0ffe0f5a2def9d4781cc7e10c82a5
Perform Kfold cross validation on an automatically generated tree at temperature T after finding an appropriate node for kinetics estimation it will move up the tree iters times.
[ { "docid": "6b8f2a8f498bb4d829b1d7496c48c9d3", "score": "0.5725403", "text": "def cross_validate(self, folds=5, template_rxn_map=None, test_rxn_inds=None, T=1000.0, iters=0, random_state=1):\n\n if template_rxn_map is None:\n template_rxn_map = self.get_reaction_matches(remove_degenera...
[ { "docid": "7a53e699035fb6408ddf09c72ce046b0", "score": "0.6641648", "text": "def CrossValidation(data, labels, test, start, finish, optimizer=None,\r\n layers=7, nodes=4):\r\n filefmt = 'weights.Epoch-{epoch:03d};Loss-{val_loss:.6f}.hdf5'\r\n #listOfErrors = list()\r\n kf = ...
ab586ca229703afa22fcb260a888b7f0
Set up the Tesla sensor platform.
[ { "docid": "ae4db8111c384fea15bf56955cd5d40c", "score": "0.5802595", "text": "async def async_setup_platform(hass, config, add_entities, discovery_info=None):\n\n # We only want this platform to be set up via discovery.\n if discovery_info is None:\n return\n\n controller = hass.data[DOM...
[ { "docid": "986be4df08781a7181605e690d4a32c3", "score": "0.6661704", "text": "def setup(self):\n print('Initializing...')\n self.init_sensors()\n self.left_vel = 3\n self.right_vel = 3\n self.write_motors()", "title": "" }, { "docid": "b8d98366fe6f33aeab17e...
de01bf8b7ae61e8260755da403dd1e02
Write a frame via the handle.
[ { "docid": "9b6613eea6bb27d27b611b4869206242", "score": "0.5374797", "text": "def write_frame(self, frame: Frame) -> int:\n\n result = bytearray()\n length = len(frame.data or [])\n\n # Check length of message.\n if length > self.max_length:\n raise ValueError(\n ...
[ { "docid": "419e0561d146a2f2eb520537811fd521", "score": "0.7532052", "text": "def write(self, frame):\n assert hasattr(self, 'writer')\n self.writer.write(frame)", "title": "" }, { "docid": "770a5c777fcc204030e6f5572c5db899", "score": "0.71338356", "text": "def write(se...
814a369b5ee8bd3a28feaccefca97922
Collects the remote environment static assets.
[ { "docid": "9d4ada4c4cebd60bbccf9cc996675f71", "score": "0.6859368", "text": "def collectstatic():\n print yellow('Collecting static assets.')\n dj_heroku('collectstatic --noinput '\n '--ignore=*.scss --ignore=admin --ignore=tiny_mce',\n env.app, env.slug)", "title": ...
[ { "docid": "cfe6e206be014f6fc4acd4cf9a6e83eb", "score": "0.72331625", "text": "def collectstatic():\n public_dir = os.path.join(os.getcwd(), 'public')\n\n if os.path.isdir(public_dir):\n print('directory exists')\n else:\n os.mkdir(public_dir)\n\n local_static = os.path.join(os...
bf81bb4328293bb0f4448d427846f942
Parses a typedef statement
[ { "docid": "f25bed49215e7f2fdc99b7bb9fe1fd66", "score": "0.73862123", "text": "def parse_typedef(typedef):\n typedef_name = typedef.spelling\n underlying_typename = typedef.underlying_typedef_type.spelling\n\n if '(anonymous struct' in underlying_typename or underlying_typename.star...
[ { "docid": "78abf412ddfeb92c11d6c97f07383de8", "score": "0.73537874", "text": "def typedef_handle(self, tokens):\n if len(tokens) == 1: # return typedef\n if self.target.startswith(\"3\"):\n return \" -> \" + self.wrap_typedef(tokens[0]) + \":\"\n else:\n ...
3049e74141282bb91364f0d82a65523e
Load csv format data Assuming no header
[ { "docid": "b8fcab84bf19bbf8c611abf49b085c05", "score": "0.0", "text": "def load_csv(path: Path, delimiter: str = ','):\n return pd.read_csv(str(path), header=None, delimiter=delimiter, dtype=np.float_).dropna(axis=1).astype('int8')", "title": "" } ]
[ { "docid": "961f13da9b871f70e7c2b0f1f05aaf3a", "score": "0.7722899", "text": "def load_csv():\n\tpath = ''\n\tdata = []\n\tif len(sys.argv)<2:\n\t\tpath = input('Please enter path of raw data:')\n\telse:\n\t\tpath = sys.argv[-1]\n\tif path == '':\n\t\traise Exception(\"Empty input \")\n\tlogger.info(pat...
dd7c99571c0384fe02f0b694bf5ce4a0
counter_opponent_win() > None Check if the opponent is about to win, and if so, counter that move which they will make.
[ { "docid": "198700be1e9ab4fe868c811d06007227", "score": "0.8313787", "text": "def counter_opponent_win(self):\n\n # get essential values\n board = self.get_game_space()\n affinity = self.get_opponent().get_affinity()\n \n # pick the right check for the game we are play...
[ { "docid": "bc21249d7575e9f67e65aa0f57da9ccf", "score": "0.681446", "text": "def counter_opponent_adv(self):\n\n # get essential values\n board = self.get_game_space()\n affinity = self.get_affinity()\n opaffinity = self.get_opponent().get_affinity()\n\n # pick the rig...
3da2794ba262075984f8f0a06938a76e
INCORRECT DO NOT USE todo maybe repurpose
[ { "docid": "345df7e04397ee47c92e84b6e6acaeee", "score": "0.0", "text": "def __init__(self, *args, **kwargs):\n Formulation.__init__(self, *args, **kwargs)", "title": "" } ]
[ { "docid": "8b16d489ebb537b1411490eee4770a91", "score": "0.66647446", "text": "def helper(self):", "title": "" }, { "docid": "0bcfc9f4e8ba5d6d08a5a57f2e4506ab", "score": "0.64894384", "text": "def malicious():", "title": "" }, { "docid": "f2b8dbc0734266e239bff49f54de121a"...
3a1bfeb16f00458bf9d1d64b9ceb9fe1
Test composed_query_string() method using all parameters.
[ { "docid": "1b179e83f032a4f58ef5f5c51333221f", "score": "0.65375584", "text": "def test_composed_string_all(self):\n table = self.fake.word()\n field = self.fake.word()\n operation = self.fake.word()\n parameter = self.fake.word()\n filt = QueryFilter(table, field, ope...
[ { "docid": "c3a038cb14e2e593ef242a40b7499e24", "score": "0.6757804", "text": "def test_run_url_encoded_query(self):\n pass", "title": "" }, { "docid": "abfcb5c2b9e0ec4e2795773cc9a66b9a", "score": "0.6543141", "text": "def test_query_parsing(self):\n params = QueryParams...
c23927ae476b2ef599450aa5587b04db
Given the training set and the indices of the labeled examples, return the indices of the unlabeled examples.
[ { "docid": "0a582999b8153109974e7c30b393dd94", "score": "0.79658794", "text": "def get_unlabeled_idx(X_train, labeled_idx):\n return np.arange(X_train.shape[0])[np.logical_not(np.in1d(np.arange(X_train.shape[0]), labeled_idx))]", "title": "" } ]
[ { "docid": "e99c296c16753106b5c2a77452b3b6c2", "score": "0.62091047", "text": "def find_wrong_indices(self) -> None:\n self.wrong_idx = [\n index\n for index, elem in enumerate(self.max_preds)\n if elem != self.labels[index]\n ]", "title": "" }, { ...
1de210ee273934ff29a850c04b83dbd5
Add painting of the error flag to the paint event.
[ { "docid": "735577ff37b1b3b4cc825e215bf583b3", "score": "0.78163135", "text": "def paintEvent(self, event):\n super().paintEvent(event)\n if self.errorFlag:\n painter = QPainter(self)\n path = QPainterPath(QPointF(0, 0))\n path.lineTo(0, 10)\n pa...
[ { "docid": "f932088550171254c1bd49a4ec2963d0", "score": "0.6624911", "text": "def setErrorFlag(self):\n self.lineEdit().errorFlag = True\n self.update()", "title": "" }, { "docid": "f1debdc35ed31e6d7d42eba09b04f670", "score": "0.6377457", "text": "def setErrorFlag(self)...
7cf20c45b1193d6cc4de3423bbc9922c
main function that initializes the data structures and functions necessary to communicate with GDAX, handle orders, and log messages.
[ { "docid": "474a333352db7956a0bec24c60e14cd1", "score": "0.7030655", "text": "def main():\n\n\t# Load account information\n\tapi_key, api_secret_key, api_passphrase = load_api_keys()\n\n\t# General setup\n\tlogger = Log()\n\tob_updated_cond = threading.Condition()\n\n\t# Setup trading objects\n\taccount...
[ { "docid": "7c0dd0af72a23fb19e0e30f462533437", "score": "0.6468741", "text": "def main():\n initialise_servos()\n initialise_motor_controllers()\n initialise_ultrasonics()", "title": "" }, { "docid": "228e0d19dc0a089ee6e9827da5e6ed56", "score": "0.6319809", "text": "def main...
a1f043844ca7b091598d0af5c47293eb
create a dictionary > {antenna_id > (lat,lon)}
[ { "docid": "f1d3370755a9a27d097f01733c087005", "score": "0.7094621", "text": "def antenna_loc_todict():\n\n r = {}\n f = open(\"data/location_withgps.txt\",\"rb\")\n for line in f:\n a = line.split(\"\\t\")\n r[a[0]] = (a[3],a[4])\n dill.dump(r,open(os.path.join(output_path_fi...
[ { "docid": "f3fa4e9f4f25b615df1207c15852e457", "score": "0.5810438", "text": "def _prepare_distances_dict(self, unknown_area):\n\n new_d = self.joined_datasets.copy()\n new_d = new_d.append(unknown_area, ignore_index=True)\n\n try:\n new_d['px'] = new_d['geometry'].apply(...
d8da593e72b39cdc9787ff794e07c9a7
Generator to handle geoingeo queries without the user having to worry about wrangling the counties.
[ { "docid": "12a1a61664e13d5944e16bc9922ad1df", "score": "0.0", "text": "def genstate_to_tract(stfips, cxn, *columns):\n counties = cxn.query([\"NAME\"], geo_unit=\"county\", geo_filter={\"state\": stfips})\n counties = counties.county.tolist()\n for county in tqdm(counties):\n tract = cx...
[ { "docid": "44a7f12de11e3a7f9fcaa4d891900d1e", "score": "0.5714338", "text": "def geo_coverage():", "title": "" }, { "docid": "10fb8fe1b8eaa61cd1179efc86d243a1", "score": "0.5556623", "text": "def main(countries=[], geotagged=False):\n\n all_locations = utils.craigslist_regions()\...
aaca0b030b7545120b39cf7b2d783a13
Cuts current tile to clipboard
[ { "docid": "6e3218f1311d8d4c5ec2fde4710776dd", "score": "0.7260197", "text": "def tile_cut(self):\n self.tile_copy()\n self._tile_set.modified=True\n self._tile_set[self.current_tile_num].frombytes(b\"\\0\" * BYTES_PER_TILE)\n self._ui.update_tile(self._tlayer, self._tile_set...
[ { "docid": "44e67c533a04fa90b3b73c84157c6573", "score": "0.79440224", "text": "def tile_copy(self):\n self._ui.clipboard_set( self._tile_set[self.current_tile_num] )", "title": "" }, { "docid": "c994d70862c4aadc8d46555c225ea124", "score": "0.74110913", "text": "def tile_paste(...
31aa651ea068d8b0ab4252f4bd2e205b
Returns the density of the bivariate normal distribution at point (x,y).
[ { "docid": "df30f05f9923c0eb8af9b361ad72e1c3", "score": "0.5889413", "text": "def pdf_gauss_2d(x, y):\n return pdf_gauss_1d(x)*pdf_gauss_1d(y)", "title": "" } ]
[ { "docid": "f6c81f88f244aa9007f7a230f50c06d0", "score": "0.7614624", "text": "def density(self, y, x):\n\n if type(y) == np.ndarray:\n y = y.reshape((len(y), 1))\n elif type(y) == list:\n y = np.array(y)\n y = y.reshape((len(y), 1))\n else:\n ...
8524aeccfd9867a7f73e27f830e71232
Make endpoint watcher function.
[ { "docid": "3355a693b07436a87ec1de3ef6db04cf", "score": "0.61150706", "text": "def make_endpoint_watcher(zkclient, state, proid):\n proid_instances = z.join_zookeeper_path(z.ENDPOINTS, proid)\n\n @exc.exit_on_unhandled\n @zkclient.ChildrenWatch(proid_instances)\n def _watch_instances(childre...
[ { "docid": "3d7d9a0b104dce10ef5f9d019c687228", "score": "0.6148808", "text": "def watch(self):\n uvicorn.run(\n \"pet_store.entrypoints.api:app\",\n port=8000,\n host=\"0.0.0.0\", #nosec\n log_level=\"debug\",\n reload=True,\n )", ...
801a8436e823c26cff706e034f86c849
Gets a bytes array, which corresponds to the xml string in utf8 encoding, identified as using the namespace given by `urn` (if given).
[ { "docid": "ec847d2fde482ddd6c9e4724b3227335", "score": "0.5629308", "text": "def to_xml_bytes(self, urn=None, tag=None, check_validity=False, strict=DEFAULT_STRICT):\n if tag is None:\n tag = self.__class__.__name__\n the_etree = ElementTree.ElementTree()\n node = self.t...
[ { "docid": "141224eafe0c00a9605645a4075c4182", "score": "0.5546509", "text": "def toutf8(ustr):\n if isinstance(ustr, str):\n return ustr\n return ustr.encode(\"UTF-8\")", "title": "" }, { "docid": "21ed2e3a0f5d4be4ea6b2fb00212502e", "score": "0.5204712", "text": "def st...
e9d2b7d30b9fe089d8447f09e407e195
Check if spectra is good to use. If fits file was not downloaded properly spectra will be all nans too many bad pixels, or too little coverage on common grip will also be removed
[ { "docid": "9d3ec3aab58fd85a8b8e9b673b59b4e3", "score": "0.73258793", "text": "def check_spectra(spec):\n\n nof_pixels = len(spec)\n nof_good_pixels = numpy.sum(numpy.isnan(spec))\n\n is_good = float(nof_good_pixels)/float(nof_pixels) > 0.75\n\n return is_good", "title": "" } ]
[ { "docid": "8d7270edfbadfb2f062cc9bf4a43e3c5", "score": "0.6475039", "text": "def test_scan_loading_badchans(self):\n fname = \"srt_data_roach_polar.fits0\"\n with pytest.warns(UserWarning) as record:\n Scan(os.path.join(self.datadir, \"spectrum\", fname))\n assert np.any...
376b58c25717b050758be0d64eaa2eb2
Remove the job from our list
[ { "docid": "a75a17ca49bddd56e38136f9b675e206", "score": "0.73029447", "text": "def remove_job(self, job_uuid: uuid.UUID):\n #logging.info('Removing job %s'%str(job_uuid))\n del self.active_jobs[job_uuid]", "title": "" } ]
[ { "docid": "2af9d7c2cc3de22b7f745e4c3fc8eaeb", "score": "0.8540207", "text": "def remove_job(self, job_id):", "title": "" }, { "docid": "906851a4b61b8f9b49ea728f2408e8d3", "score": "0.82992834", "text": "def remove_job(self, job):\r\n raise NotImplementedError", "title": "...
c111c0c52a7284f5cf748bfcd13b6ffc
Sets the input files
[ { "docid": "8670a3b37e541f0e0344ab8b4f36666e", "score": "0.84427613", "text": "def set_input_files(self,path, input_files):\n self.path = path\n self.input_files = input_files\n self.setFiles = True", "title": "" } ]
[ { "docid": "bacaa22b6baf2b11fd0fff66e7cf5a15", "score": "0.7570599", "text": "def setInputFiles(ekppath=None, nafpath=None):\n\treturn InputFiles(ekppath=ekppath, nafpath=nafpath)", "title": "" }, { "docid": "aaab3fe02e3a31d189dfc300a4d07aba", "score": "0.75171465", "text": "def SetF...
69fb0bf1875df0c52a4c17ee2057f45e
Func applies to the list consisting of all elements of d, and return a list.
[ { "docid": "5eecaa8e589fc0c932187ad51f244c81", "score": "0.50239545", "text": "def apply_function_to_dict(func, d):\n from itertools import chain\n result = func(list(chain(*d.values())))\n csum = np.cumsum(map(len, d.values()))\n new_d = {k: result[(0 if i == 0 else csum[i-1]):csum[i]] for ...
[ { "docid": "285b5e74e38092d4ec48121d9b3016ae", "score": "0.64130175", "text": "def apply_func_to_list(func):\n return lambda l,*args: [func(x,*args) for x in l]", "title": "" }, { "docid": "fe91e1c4d9ce48383724c42391102536", "score": "0.63807935", "text": "def do_list_elems(func):...
ec13e714ad6f0f7d2ae0bb539c8ae730
Check if new unit successes to create if form is valid.
[ { "docid": "838eb328099637e1749bdda100618682", "score": "0.6981745", "text": "def test_new_unit_post_success(self):\n\n response = self.client.post(\n reverse('reports:new_unit'),\n {u'name': u'sztuki'},\n follow=True\n )\n\n self.assertRedirects(res...
[ { "docid": "b158a666ce01f55cd671b2063193f078", "score": "0.6659576", "text": "def test_new_unit_post_fail(self):\n\n response = self.client.post(\n reverse('reports:new_unit'),\n {u'name': u''},\n follow=True\n )\n\n self.assertEqual(response.status_...
fcac08a3fde20e7c1b9f5eec5b4927ac
Checking if a molecular system is composed of specific elements. The function returns True or False depending on whether or not the system is entirely composed of the elements required.
[ { "docid": "9367000d4507d11fa32011a52b5c36ee", "score": "0.7346343", "text": "def is_composed_of(molecular_system, selection='all', syntax='MolSysMT', **kwargs):\n\n\n\n\n from . import get\n\n if len(kwargs):\n\n # molecules in kwargs\n set_molecules = {'n_ions', 'n_waters', 'n_smal...
[ { "docid": "23d46596c5f225108ac9b32c09840b3f", "score": "0.6892202", "text": "def _is_from_chemical_system(chemical_system, struct):\n chemsys = list(set([sp.symbol for sp in struct.composition]))\n if len(chemsys) != len(chemical_system):\n return False\n for el in chems...
4587b5b7cebb46bcd8322ff8e9547ce3
Looks up entry in dictionary and populates entry's data
[ { "docid": "66e2be696faed2b12c692dbac7a009d7", "score": "0.0", "text": "def lookup(e):\n # Connect to DB\n # Get entry\n # Parse into variables\n # Check if furigana exists, or look it up if needed. Either way, compare\n if not self.furigana:\n pass", "title": "" } ]
[ { "docid": "85416a4098704d90ca8311daf1beeb32", "score": "0.6158545", "text": "def retrieveValue(dictionary, key, entry):\n\tpass", "title": "" }, { "docid": "465d96032b3f7cbdfd2e16f76f175212", "score": "0.60910887", "text": "def _update_entry_info(self, entry : dict):\n if self....
db19dd2a4ce0943483f31dd9bad55ec3
Helper function to log a debug message with a descriptive heading.
[ { "docid": "2c606d1199d941de20d57d71dd6a8322", "score": "0.0", "text": "def log_debug(self, line):\n logging.debug(\"Scanner #%s - %s\" % (self.device_idx,line))", "title": "" } ]
[ { "docid": "f2318cb180866a2990408274f1c09413", "score": "0.6975975", "text": "def debugPrint(message, debug):\n if debug:\n print(message)", "title": "" }, { "docid": "aa5d1d36d75272e5f95b19ec31dfe6e3", "score": "0.696345", "text": "def debug(message):\n if options.verbose > 2...
adf6f74945f1d4f925421391e327d1ed
Limpia los datos de la sesion no agregados por la aplicacion
[ { "docid": "760f01f72f6963af7a6e298cfd109280", "score": "0.0", "text": "def clear_session(session):\n for key in list(session.keys()):\n if key not in ['_auth_user_id', '_auth_user_backend', '_auth_user_hash']:\n del session[key]", "title": "" } ]
[ { "docid": "ae898e68bc78666232f5c3b131cb1831", "score": "0.5502195", "text": "def novoAutomato(self):\n self._infoAutomatoAtual[\"EstadoInicial\"] = None\n self._infoAutomatoAtual[\"EstadosFinais\"] = set([])\n self._infoAutomatoAtual[\"Alfabeto\"] = set([])\n self._infoAutom...
b2e20e834c0b1bdc1c7eec70f0d5ef3c
This function uses the created my_max function and compares it to pythons max function. It creates a list of random variables and uses both functions.
[ { "docid": "a44048cd3e2ccfbbf6aba8cea79bc4f6", "score": "0.7396767", "text": "def test_max():\n random_vals = []\n\n # generating 50 random values and appending them to a list\n for i in range(50):\n random_vals.append(random.randrange(0, 1000, 1))\n\n # using both max functions to fi...
[ { "docid": "39e9da22cbeb6af7dcd2479aebb8025a", "score": "0.67297995", "text": "def test_max_vals(self):\n self.report('Testing for Maximum value. ')\n for test_fn_name in self.synthetic_functions:\n caller = get_syn_function_caller_from_name(test_fn_name)\n self.report('Testing %s with m...
3e47af91f1595aed11a246fcddf82f72
Validate a plugin directory is valid
[ { "docid": "8498a80008398200bfe4ac03ccbcad22", "score": "0.0", "text": "def _validate(config_module: ModuleType, path: Path) -> None:\n ConfigLoader._entry_point(config_module, path)\n ConfigLoader._instances(config_module)\n ConfigLoader._args(config_module)\n ConfigLoader._...
[ { "docid": "8cc68037e5571eb79ecfb4d34738a791", "score": "0.6602469", "text": "async def validate_and_import_directory(self, **kwargs) -> str:", "title": "" }, { "docid": "c1f03f4d1fa2e7a0349e0ef3c5ad2174", "score": "0.6583628", "text": "def validate_directories(featured_mod):\n # ...
79712250d44c213089530bca861aafb9
gets the ctf status
[ { "docid": "bb44b9fc5ea77399c1c12dc12d822160", "score": "0.0", "text": "def is_active(self):\n\t\treturn self.__is_active", "title": "" } ]
[ { "docid": "59cd33011a252a8832a814fc751eaa2e", "score": "0.71683383", "text": "def get_status(self):", "title": "" }, { "docid": "59cd33011a252a8832a814fc751eaa2e", "score": "0.71683383", "text": "def get_status(self):", "title": "" }, { "docid": "c925bfd95758d8502e8ba4ed...
e32eee693062135dbbed18c72536161f
Returns Modular Multiplication of a and b
[ { "docid": "b5b434c8d118439fec5371fcef14190e", "score": "0.8792906", "text": "def mod_mul(a, b):\n return (a % MOD*b % MOD) % MOD", "title": "" } ]
[ { "docid": "d7fff146e0e365c46ad35eb8ba20405d", "score": "0.8231514", "text": "def mod_mul(a, b, n):\n x = 0\n y = a\n while b > 0:\n if (b & 1) != 0:\n # odd number\n x = (x + y) % n\n y = (y + y) % n\n b = b / 2\n ...
c0eef44b6e327688044e5a4469ca8db7
Gets the descendant bin ``Id`` query terms.
[ { "docid": "a8c894c30b6990b7165b13f238f150f7", "score": "0.8539272", "text": "def get_descendant_bin_id_terms(self):\n return # osid.search.terms.IdTerm", "title": "" } ]
[ { "docid": "324e7100bb46e6702f52c2db2b502450", "score": "0.7650223", "text": "def get_ancestor_bin_id_terms(self):\n return # osid.search.terms.IdTerm", "title": "" }, { "docid": "df255db9024986f93117154bbc607910", "score": "0.74250394", "text": "def get_bin_id_terms(self):\n...
cdfe2130854a137c1d6753d10488d77b
Abstract Function Implementation Task Reads the input dataset and stores it in self.sentences as a list of tokens.
[ { "docid": "da4b2f6df8ade16e947826f6375f0122", "score": "0.0", "text": "def read_Dataset(self, name=\"text8\", path=\"data/text8\"):\n\t\tprint(\"Reading dataset ....\")\n\t\tif name == \"text8\":\n\t\t\tself.sentences = Text8Corpus(path)\n\t\telif name == \"OneBilCorpus\":\n\t\t\tself.sentences = OneBi...
[ { "docid": "588216166c5e9382d18abc8829484081", "score": "0.6711342", "text": "def tokenize_sentences(self):\n data = []\n labels = []\n\n for sentence in self.sentences:\n data_tmp, label_tmp = self.get_data_from_sentence(sentence)\n\n if data_tmp != None and l...
12ae536e1be853f36fd4bbaf1591d538
Activate or deactivate the auto pop feature.
[ { "docid": "3e636a39b7a2583660972c17883921ef", "score": "0.76103395", "text": "def toggle_auto_pop(self):\n self.__auto_pop = not self.__auto_pop", "title": "" } ]
[ { "docid": "14e749386ee2783666321d92f9bc8f6d", "score": "0.6201403", "text": "def activate(self):\n self.is_activated = True", "title": "" }, { "docid": "14e749386ee2783666321d92f9bc8f6d", "score": "0.6201403", "text": "def activate(self):\n self.is_activated = True", ...
f3e40a2aca9f7f2de33ba0c5cf4d77a1
test standard bindit mapping bind referenced dir, no other manual binds.
[ { "docid": "56b3dc3796c0b29a77d78999e62a3ce7", "score": "0.69535625", "text": "def test_bind():\n with tempfile.TemporaryDirectory(prefix=TEMPFILE_PREFIX) as sourcedir:\n sourcedir_resolved = pathlib.Path(sourcedir).resolve()\n sourcefile = pathlib.Path(\n tempfile.mkstemp(di...
[ { "docid": "685b1d1fbedb236e7d0adef4cef659fa", "score": "0.6799697", "text": "def test_manual_bind_mount():\n manual_bind_runner(bindit.docker.mount_bind_args)", "title": "" }, { "docid": "45be098ba0da542a8d83bf55eafcb293", "score": "0.67655706", "text": "def test_bind_folder():\n...
097d889d8c010a3f964bb2318d6fdc7d
Returns xTr,yTr,xTe,yTe xTr, xTe are in the form nxd yTr, yTe are in the form nx1
[ { "docid": "cd1a66d6dcdf54f7e6246d0554f449d8", "score": "0.0", "text": "def loaddata(filename):\n data = loadmat(filename)\n xTr = data[\"xTr\"] # load in Training data\n yTr = np.round(data[\"yTr\"]) # load in Training labels\n xTe = data[\"xTe\"] # load in Testing data\n yTe = np.round(...
[ { "docid": "c368212fe8899d1fda158fbf08a31d89", "score": "0.60926294", "text": "def teax():", "title": "" }, { "docid": "04917ac1922191ebcdd6f268d82c706f", "score": "0.5846229", "text": "def get_x_tuple(self):\n tup = (self.n_x,)\n if self.has_y:\n tup += (sel...
4f938c74238954c3edbb785491861f2e
test_get_cinderclient_unknown_module check that we could not retrieve a Session client to work with cinder if there is no modules defined
[ { "docid": "ab92b3bde7e9989429107596424a5dc4", "score": "0.8516438", "text": "def test_get_cinderclient_unknown_module(self):\n try:\n osclients = OpenStackClients(modules=\"\")\n osclients.get_cinderclient()\n except Exception as ex:\n self.assertRaises(ex...
[ { "docid": "f7327525d1d6f0075e2207867225b3e4", "score": "0.74871695", "text": "def test_implement_client_with_unknown_module(self):\n\n try:\n OpenStackClients(modules=\"fakeOpenstackModule\")\n except Exception as ex:\n self.assertRaises(ex)", "title": "" }, ...
b2ac1bae8c15b61f857fd75e574ad723
Monta a resposta com os bytes do arquivo
[ { "docid": "9dcf6692d41eb6d24114a8c8facca69e", "score": "0.0", "text": "def read_file(file):\n\n\t\text = file.split('.')[1]\n\t\tcontent_type = 'text/html'\n\t\tif ext == 'jpg' or ext == 'jpeg':\n\t\t\tcontent_type = 'image/jpeg'\n\t\telif ext == 'ico':\n\t\t\tcontent_type = 'image/x-icon'\n\t\treturn ...
[ { "docid": "4785d1e6c36afd80214ff7cc0687736b", "score": "0.6302854", "text": "def make_res_file(data):\r\n res_bytes = bytearray()\r\n magic_num = int.to_bytes(0x497E, 2, \"big\")\r\n mode_type = int.to_bytes(2, 1, \"big\")\r\n res_bytes.extend(magic_num)\r\n res_bytes.extend(mode_type)\r...
be3d4e90ce876ad3c24fd666a0ec6399
Takes file_id string. Initializes temp files. Returns tuple of vars. Called by grab_latest_file()
[ { "docid": "5553c248c1e9126d396d91c0abc1ea0c", "score": "0.68019724", "text": "def _setup_grab_files( self, file_id ):\n ( temp_stdout_filepath, temp_stderr_filepath ) = ( self._make_temp_filepath(u'stdout_vcs'), self._make_temp_filepath(u'stderr_vcs') )\n f_stdout = open( temp_stdout_file...
[ { "docid": "3d6872523ef015b79e75b7b6e6599e0d", "score": "0.60206676", "text": "def initialize_tmpfile(data, directory=None):", "title": "" }, { "docid": "d2e9181334398851a16b4029dd7632b8", "score": "0.5896506", "text": "def _prepare_temp_file(self):\n if not self._details.__co...
834422ee3835d1f972850906bdfdc885
Save frame data as an HDF5 file.
[ { "docid": "1b00b556c8358c176a6a9ae32ecffd8a", "score": "0.74281675", "text": "def save_h5(self, filename, max_load=1):\n self.save_hdf5(filename, max_load=max_load)", "title": "" } ]
[ { "docid": "2240ae2fa11185698b2a1d51bc73e042", "score": "0.77490896", "text": "def save_H5(self, avg=False):\n if not os.path.isfile(self.get_H5_path()):\n self.df.to_hdf(self.get_H5_path(), key=\"df\", mode=\"w\")\n if avg:\n self.df_avg.to_hdf(self.get_H5_avg_path()...
49158efcf16c9ac85c88c1f9d2ba429c
Get names of attributes (without protected or private sign) and theirs values.
[ { "docid": "a72c105d48731a8c6de6203d97053c34", "score": "0.6518105", "text": "def get_attributes(self):\n\n attributes_info = basic_backend.get_attributes(self)\n return attributes_info", "title": "" } ]
[ { "docid": "4fa03f4879e3a499790c4f0f0ae91d6a", "score": "0.7723248", "text": "def get_attribute_names():\n\n _round = Round()\n return _round.get_attributes().keys()", "title": "" }, { "docid": "84e9ad410474b850e8ecf40557e65ca6", "score": "0.7629509", "text": "def get_a...
d141728462746520515df7079f0b42f9
Return a list of documented arguments with arguments metadata for specific method.
[ { "docid": "c613af79aedd77a70e66d5666c23d4d0", "score": "0.6292819", "text": "def get_arguments_documentation(method_ref, as_params_collection=False, spilt_or=False, ignore_non_args=False):\n\n PARAM_ANNOTATION = '@param'\n IVAR_ANNOTATION = '@ivar'\n params_list = []\n ivars...
[ { "docid": "7cb01420f7c7a316d7caf8d70c0e9a07", "score": "0.7419464", "text": "def get_documented_arguments(method_ref, as_params_collection=False, spilt_or=False):\n return MethodHelper.get_arguments_documentation(method_ref, as_params_collection, spilt_or, ignore_non_args=True)", "title": ""...
5e214a171ac431e3c9503bf27268fa04
limit_labmda Cheesy as fuck hook to pass limit to a list newer_than Stream items greater than this BACKSTORY You probably want to deliver all unacknowledged but you might not want the entire history of everything they've already seen.
[ { "docid": "8a477347b9b0440842084615bfcf4918", "score": "0.0", "text": "def user_stream(user, limit=None, newer_than=None):\n conn = get_cache_client()\n return get_stream(\n user.pk, conn,\n limit=limit, newer_than=newer_than, renderer=compile_stream)", "title": "" } ]
[ { "docid": "ddf21283e58c1f92eb4c910709521cc2", "score": "0.6336143", "text": "def get_latest_spam(self, limit: int) -> list:", "title": "" }, { "docid": "d193da18897c79e4b6729ddc3832bcc3", "score": "0.6221573", "text": "def on_limit(self, track):\r\n return", "title": "" ...
f6e3df0a207abdfe02e591d71511ee1a
Get function that returns distances between examples in learned space.
[ { "docid": "81e5a0405eb8930cf0ef7fefed8254f7", "score": "0.66239303", "text": "def get_dist_func(data : Array[np.float64], target : Array[np.float64], n : np.int) -> Callable[[Callable[[np.float64, np.float64], np.float64], np.int, np.int], np.float64]:\n\n # Get transformed data.\n data_trans : A...
[ { "docid": "5b90c6db1c4c7a51d2b69c6d61c11091", "score": "0.7252572", "text": "def get_distances():", "title": "" }, { "docid": "784bc0b08043ecf1f5b80dbff811c330", "score": "0.6990197", "text": "def dist(self) -> Distance:", "title": "" }, { "docid": "8269db68ee68dc5cddccb...
a9bfebd5f0f713c108a4f8f2102afde3
Get path to write and attach corresponding file extension.
[ { "docid": "bf1f77f0ec7a3a829b392792fd70b7e0", "score": "0.71833307", "text": "def _get_write_path(self, file_extension: str):\n if file_extension[0] != \".\":\n file_extension += \".\"\n return os.path.join(self._result_dir, self._filename) + file_extension", "title": "" ...
[ { "docid": "ec57b0d5838d03e7f48a93fb1846bc4c", "score": "0.6766839", "text": "def append_file_extension(path: str, ext: Optional[str]) -> str:\n\n if ext is not None:\n return '%s.%s' % (path, ext)\n return path", "title": "" }, { "docid": "fae1c0631c9baf21a2c2eaa6294f514c", ...
8c1c0015e095064e7a47460cfae784b1
Decrement the integer value of a key by the given number
[ { "docid": "f508a6af265ff36873fd63de38632270", "score": "0.74317914", "text": "def decrby(self, key:NativeType, increment:int) -> int:\n return self._query(b'decrby', self.encode_from_native(key), self._encode_int(increment))", "title": "" } ]
[ { "docid": "16da0a9d2e42a401a0be02abacf3724c", "score": "0.82384324", "text": "def decrement_int_value(self, key):\n return self._redis.decr(name=key)", "title": "" }, { "docid": "f1cd9fbc3a0a8519344f377e45eb3e85", "score": "0.7788498", "text": "def dec(self, key):\r\n ...
1d8935b2d9ad8819e0c4381d50f0d81e
Initializes hidden layers, based on defined number of layers.
[ { "docid": "cc63545b27bc51814908aea07aabddd9", "score": "0.7333883", "text": "def _initialize_hidden_layers(self, neural_network):\n \n number_of_layers = randint(self.init_minimum_layers, self.layers)\n neurons_per_layer = [randint(1, self.init_maximum_neurons_per_layer) for i in r...
[ { "docid": "4fa5825f794dd872fe20c41cb694ed3f", "score": "0.7226314", "text": "def init_hidden(self):\n return torch.zeros(self.num_layers, self.batch_size, self.hidden_size)", "title": "" }, { "docid": "68b498dd3486faea72dc3a9779706daf", "score": "0.7152341", "text": "def init...
41f1216a5d7b8ef4758b1bc9d568f4f2
Mix species of different families. All possible combinations are extracted.
[ { "docid": "04d8761f1f3aa61edccb2ca7ddeca5a0", "score": "0.72845006", "text": "def mix_species(self, species, optional=False):\n family_numbers = np.unique([s.family_number for s in species])\n if len(family_numbers) == 0:\n return []\n families = [ [s for s in species if...
[ { "docid": "f4baea9f29fddc8c0948f2b7ca1e9cfc", "score": "0.59810746", "text": "def expand_mix(self, mix):\n new_dict = mix[0].species()\n for i in range(1, len(mix)):\n new_dict = self.merge_dicts_mz(new_dict, mix[i].species())\n return new_dict", "title": "" }, {...
1212537f420017b9738fde435fa396fa
r"""Return a list of sequences to run to perform gate set tomography according to the given spec, with standard poweroftwo sequence lengths up to (approximately)
[ { "docid": "f64510c4db40c41c7c3c5ba2f27316cf", "score": "0.57117736", "text": "def generate_std_gst_sequences(spec: GSTSpec,\n max_len_exponent: int) -> List[GateSequence]:\n return generate_gst_sequences(spec, (2**i for i in range(max_len_exponent + 1)))", "title": ...
[ { "docid": "2a8461217b4174229a6b47de662dc87f", "score": "0.62755734", "text": "def generate_gst_sequences(spec: GSTSpec,\n target_lens: Sequence[int]) -> List[GateSequence]:\n # Collect sequences in set for deduplication.\n seqs = set()\n for target_len in target_lens:...
2376dd75aefe8d1ed378c729882d320a
Create a list of windows to be slid over / searched on, for a given image Takes an image, start and stop positions in both x and y, window size (x and y dimensions), and overlap fraction (for both x and y)
[ { "docid": "0bcaaf2bb4003482140a814aa8362ab7", "score": "0.7977463", "text": "def slide_window(img, x_start_stop=[None, None], y_start_stop=[None, None],\n xy_window=(64, 64), xy_overlap=(0.5, 0.5)):\n # If x and/or y start/stop positions not defined, set to image size\n if x_start...
[ { "docid": "cf9ffb3c2b3f1cbe7a7e2ac9920c7980", "score": "0.8306893", "text": "def generate_windows_list(img,\n x_start_stop,\n y_start_stop,\n xy_window,\n xy_overlap):\n if x_start_stop[0] is None:\n ...