query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Check for invalid characters and proper length in password
def password(password): if ("\\" in password or " " in password or len(password) < 6 or len(password) > 254): raise InvalidCredential("Invalid Password")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_password(password: str) -> bool: \n return len(password) >= 6", "def validate_user_password(password):\n return len(password) >= 8", "def is_valid_password(password):\n\n \"\"\"This section determines if the length is valid\"\"\"\n\n if len(password) < (MIN_LENGTH) or len(password)...
[ "0.82811815", "0.81370306", "0.8076285", "0.8058226", "0.7990559", "0.7959337", "0.7916228", "0.7854974", "0.7845289", "0.7842471", "0.77506274", "0.7737778", "0.77024853", "0.7674097", "0.76074904", "0.7597536", "0.758426", "0.7553404", "0.7549493", "0.75401014", "0.7514775"...
0.6953189
62
Return the total seconds of audio.
def totalSeconds(self): return self.leadout.getFrames()//75 - self.cdtoc[0].getFrames()//75
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def audio_recording_duration_seconds(self):\n return self._audio_recording_duration_seconds", "def get_duration(self):\n return self.audio.get_duration()", "def duration(self):\n return engine_sound.get_sound_duration(self.sample)", "def elapsedTime(self):\n result = self.tk.call(...
[ "0.76109505", "0.73784447", "0.7334376", "0.7215662", "0.7174286", "0.7147745", "0.7140403", "0.7034153", "0.70069975", "0.6890398", "0.68684715", "0.6835028", "0.6832641", "0.68248886", "0.68187284", "0.6750107", "0.6750107", "0.6729595", "0.6695837", "0.66493124", "0.664409...
0.7320238
3
Return the length of data in the main model.
def nmaindata(self): return self._nmaindata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return self.ds.length(self.portion)", "def __len__( self ) :\n\n return len( self.data )", "def __len__(self):\n return self.dataset_size", "def __len__(self):\n return self.dataset_size", "def __len__(self) -> int:\n return len(self.data)", "def __...
[ "0.78206563", "0.76598394", "0.76403403", "0.76403403", "0.76183563", "0.754866", "0.75460374", "0.75416875", "0.7537138", "0.75301003", "0.7515478", "0.74893934", "0.74670535", "0.7452514", "0.7422746", "0.7422746", "0.7422746", "0.7382976", "0.7380368", "0.73699963", "0.736...
0.0
-1
Return the length of data in the constraint model.
def nauxdata(self): return len(self._auxdata)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(self.constraints)", "def __len__(self):\n return self.ds.length(self.portion)", "def __len__(self) -> int:\n return len(self.data)", "def __len__(self):\n return self.dataset_size", "def __len__(self):\n return self.dataset_size", "def le...
[ "0.7903844", "0.7760061", "0.7510402", "0.74962604", "0.74962604", "0.7487184", "0.7430402", "0.74164015", "0.741091", "0.7410364", "0.7395971", "0.73951787", "0.73951787", "0.73951787", "0.7367853", "0.73588216", "0.73532414", "0.7341778", "0.7340938", "0.73383445", "0.73326...
0.0
-1
Set the model parameter of interest to be model parameter ``name``. If ``name`` is ``None``, this will unset the parameter of interest.
def set_poi(self, name): if name is None: self._poi_name = None self._poi_index = None return if name not in self.parameters: raise exceptions.InvalidModel( f"The parameter of interest '{name:s}' cannot be fit as it is not declared in the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setName(self, name):\n self.name = name\n return", "def setName(cls, name):\n assertName(name, ParameterNameError)\n safename = str(name).translate(str.maketrans(\"\", \"\", ' \\t\\n\\r'))\n cls._name = safename", "def setName(self, name):\n self.name = name", "d...
[ "0.685537", "0.68476164", "0.6832856", "0.6832856", "0.6832856", "0.6832856", "0.6832856", "0.6831408", "0.6808032", "0.6808032", "0.6767986", "0.67623824", "0.6755635", "0.6723564", "0.6718996", "0.667749", "0.66122407", "0.66122407", "0.66122407", "0.66122407", "0.66122407"...
0.0
-1
Compute the expected value of the main model.
def expected_actualdata(self, pars): tensorlib, _ = get_backend() pars = tensorlib.astensor(pars) return self.make_pdf(pars)[0].expected_data()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mf_expected_notp(self):\n return 1.0 - self.mf_expected_p()", "def expected(self):\n return self.expected_vector(self.neurons)", "def compute_expected(self):\n\n # compute the poisson rate\n self.mu = np.dot(self.samples['post_sample_means']['location_factors'],\n ...
[ "0.6578821", "0.656181", "0.6527909", "0.636008", "0.6326331", "0.63057375", "0.6304799", "0.6300237", "0.6287825", "0.61481506", "0.60830927", "0.599469", "0.59916705", "0.59493786", "0.5933155", "0.5930289", "0.5928751", "0.590829", "0.58989435", "0.5897858", "0.5891434", ...
0.56441134
69
Compute the expected value of the main model
def expected_data(self, pars, include_auxdata=True): tensorlib, _ = get_backend() pars = tensorlib.astensor(pars) if not include_auxdata: return self.make_pdf(pars)[0].expected_data() return self.make_pdf(pars).expected_data()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expected(self):\n return self.expected_vector(self.neurons)", "def compute_expected(self):\n\n # compute the poisson rate\n self.mu = np.dot(self.samples['post_sample_means']['location_factors'],\n self.samples['post_sample_means']['cell_type_factors'].T)", "def cal...
[ "0.68881595", "0.6693603", "0.66773134", "0.66746676", "0.65785617", "0.6418995", "0.6388143", "0.6322651", "0.6314334", "0.62863445", "0.6273119", "0.6218654", "0.6217201", "0.6183772", "0.616811", "0.61599743", "0.6158514", "0.6158191", "0.6158191", "0.6158191", "0.6158191"...
0.0
-1
return response vector matrix as a dataframe
def rvm(self,varimax_only=True): df = pd.DataFrame(self.Rpca) df.index = self.index df.columns = self.ps if varimax_only==True: df2 = df.iloc[:,:self.AcceptNum] print("return response vector matrix") else: df2 = df print("r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dataframe(self) -> pd.DataFrame:\n df = pd.DataFrame(data=self.to_numpy())\n df[\"fs\"] = self.dec_fs\n df[\"factors\"] = self.dec_factors\n df[\"increments\"] = self.dec_increments\n df.index.name = \"decimation level\"\n return df", "def _response_dataframe(self...
[ "0.67562395", "0.6596255", "0.6579344", "0.6487051", "0.6385547", "0.63435733", "0.63385767", "0.63379616", "0.63275164", "0.63255036", "0.6261652", "0.62420005", "0.6229191", "0.6206724", "0.6203454", "0.61962146", "0.61906105", "0.61793286", "0.6164296", "0.6140855", "0.612...
0.6304895
10
return vector contribution as a dataframe
def contribution(self): df = pd.DataFrame(self.Cpca) df.index = self.ps df.columns = ["contribution"] df2 = df.T print("return contribution") return df2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vector(self, head, tail):\n return pd.DataFrame(head.values-tail.values, columns=['x', 'y', 'z']).set_index(self.data.index)", "def to_dataframe(self) -> pd.DataFrame:\n df = pd.DataFrame(data=self.to_numpy())\n df[\"fs\"] = self.dec_fs\n df[\"factors\"] = self.dec_factors\n ...
[ "0.68988985", "0.6415047", "0.63231933", "0.6304823", "0.58918864", "0.58254534", "0.58233005", "0.5787733", "0.57833993", "0.57822865", "0.57812834", "0.5776783", "0.5752758", "0.5744668", "0.57159454", "0.5691104", "0.5671887", "0.5670419", "0.56416935", "0.5633638", "0.562...
0.6821204
1
Checks that get_equity_of_date returns hisorical equity of specific date
def test_get_equity_of_date(self): account = AccountFactory() equity = account.equity() assert account.get_equity_of_date() == None assert account.get_equity_of_date(datetime.now()) == equity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_equity(self):\n position = PositionFactory()\n account = position.account\n base_nb_historical_equities = len(account.historical_equities)\n\n position_value = position.market_value()\n equity = account.equity()\n new_nb_historical_equities = len(account.historica...
[ "0.63632417", "0.61829424", "0.6023952", "0.5847529", "0.5840771", "0.5786554", "0.5752985", "0.567908", "0.5624372", "0.55352443", "0.5500859", "0.5484604", "0.5453636", "0.53990257", "0.5381429", "0.53567654", "0.5354296", "0.533701", "0.5311268", "0.5302855", "0.52982", ...
0.7941731
0
Get string represent of path.
def __str__(self): return str(self._path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self) -> str:\n if len(self.parts) == 1:\n return ''\n return '/'.join([x.value for x in self.parts[1:]]) + ('/' if self.is_dir else '')", "def _path_to_string(path):\n\n return \"/\".join(str(item) for item in path)", "def path(self):\n # easy enough\n re...
[ "0.8085048", "0.79282093", "0.7853739", "0.7792207", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", "0.7651436", ...
0.7549555
26
Insert unique number to suffix to prevent duplicate.
def unique(self, **kwargs): count = 0 while True: stem = '%s-%s' % (self._path.stem, count) if count > 0 else self._path.stem new_path = copy(self._path) new_path.with_stem(stem) if new_path.is_dir() or new_path.is_file(): count += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _append_to_name(name):\n\n suffix = '__'\n appended = suffix in name and name.split(suffix)[-1].isdigit()\n if not appended:\n return name + suffix + '1'\n\n parts = name.split(suffix)\n stem = suffix.join(parts[:-1])\n return stem + suffix + str(int(parts[-1]) + 1)", "def uniqueName...
[ "0.7054775", "0.7045639", "0.6738466", "0.6701711", "0.6546327", "0.6543493", "0.65355444", "0.6506822", "0.6478212", "0.63653374", "0.63585854", "0.63311213", "0.63278383", "0.62441844", "0.6164811", "0.61599386", "0.61441857", "0.61219597", "0.6081573", "0.6050058", "0.6042...
0.0
-1
Insert datetime to suffix to prevent duplicate.
def datetime(self, formats: str = '-%Y-%m-%d-%H-%M-%S', **kwargs): stem = '%s-%s' % (self._path.stem, datetime.now().strftime(formats)) self._path = self._path.with_stem(stem) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_suffix(*, seconds: bool = False) -> str:\n return utc_now().strftime(\"%Y%m%d-%H%M\" + (\"%S\" if seconds else \"\"))", "def suffix(self, tupledate):\n try:\n return '_'.join(map(str, tupledate))\n except:\n # try taking a float unixtime\n return '_'...
[ "0.64732605", "0.6288036", "0.6263336", "0.62210804", "0.606996", "0.57747227", "0.5633879", "0.55849165", "0.5465534", "0.5424495", "0.5424358", "0.5292752", "0.52660227", "0.5217716", "0.5201275", "0.51981205", "0.518892", "0.5169593", "0.5165895", "0.5162394", "0.51544464"...
0.0
-1
Inserts a node into the heap.
def insert(self, node): # The first element, whatever it is, gets put in the root node # position. if len(self.heap) < 2: if self.kind == "max": self.heap.append(-node) else: self.heap.append(node) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, node):\n self.heap.append(node)\n # check bottom up\n self._heap_top(len(self.heap)-1)\n # debug\n # self.__check_ri()", "def insert(self,item):\n if self.isFull():\n raise Exception(\"the heap is full!\")\n self.heap.append(item)\n ...
[ "0.8639393", "0.7733768", "0.7476655", "0.74512357", "0.73046756", "0.71442413", "0.71209294", "0.7107339", "0.70579976", "0.70518273", "0.70458233", "0.70083356", "0.6961863", "0.69614017", "0.69603616", "0.6959597", "0.6953737", "0.69276017", "0.6891946", "0.68901914", "0.6...
0.7995758
1
Get the index of the given node's parent given the index of the child node.
def get_parent_index(self, child_index): # The root of the tree is at index position 1 # and can have no parent if child_index == 1: return False return child_index // 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parent_index(self, index: int) -> int:\n parentindex = (index-1) // 2\n if parentindex >= 0:\n return parentindex\n return None", "def get_parent(self, child_index):\n return self.get_parents(np.asarray([child_index]))[0]", "def parent_index(child_index: int) -> int:\...
[ "0.8360914", "0.8214129", "0.82106066", "0.8191101", "0.80360156", "0.787257", "0.780497", "0.77781", "0.7773573", "0.7730031", "0.77280116", "0.7727848", "0.7660507", "0.76339406", "0.7546005", "0.7425317", "0.73415303", "0.73315525", "0.730083", "0.7265585", "0.7254579", ...
0.7802555
7
Converts the camera's polar position to cartesian and store the result in self.cameraPosition
def polarCameraToCartesian(self): x = self.cameraPolar[0]*np.sin(self.cameraPolar[1]*np.pi/180)*np.sin(self.cameraPolar[2]*np.pi/180) y = self.cameraPolar[0]*np.cos(self.cameraPolar[2]*np.pi/180) z = self.cameraPolar[0]*np.cos(self.cameraPolar[1]*np.pi/180)*np.sin(self.cameraPolar[2]*np.pi/180) self.cameraPosit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polar2cart(polar_coords,origin=(10,10)):\n r = polar_coords[0]\n theta = polar_coords[1]\n xindex = r*np.cos(theta) + origin[0]\n yindex = r*np.sin(theta) + origin[1]\n return xindex,yindex", "def cartesian_to_polar(x,y,r):\n \n lat= np.arccos((x**2+y**2)**.5/r)\n if x>0 and y>0:\n ...
[ "0.68505764", "0.68485194", "0.66847855", "0.66775936", "0.66058636", "0.65114534", "0.65114534", "0.6461051", "0.64378536", "0.64378536", "0.64281785", "0.64273477", "0.64273477", "0.641906", "0.6390713", "0.6390713", "0.6370746", "0.6323759", "0.62686557", "0.6259063", "0.6...
0.87106335
0
string representation for tree
def __str__(self): return str(self.root.val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self) -> str:\r\n values = []\r\n self._str_helper(self.root, values)\r\n return \"TREE in order { \" + \", \".join(values) + \" }\"", "def to_tree_str(self) -> str:\n return self._pqueue.to_tree_str()", "def __str__(self):\n return treestring(self)", "def __str...
[ "0.8361266", "0.81895405", "0.8181509", "0.81302404", "0.8059034", "0.8052445", "0.80488646", "0.79222804", "0.7917055", "0.79042304", "0.7831519", "0.7820285", "0.7792403", "0.77708435", "0.7770404", "0.7770404", "0.7759843", "0.7744746", "0.77343714", "0.7725969", "0.772083...
0.7319606
63
Test that service invokes renault_api with correct data.
async def test_service_set_ac_cancel( hass: HomeAssistant, config_entry: ConfigEntry ) -> None: await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() data = { ATTR_VEHICLE: get_device_id(hass), } with patch( "renault_api.renault_vehicle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_book(self):\n resp = self.app.get('/api/book', headers={'Authorization': 'Bearer DUMMY_TEST_TOCKEN_GINTO'})\n reply_from_server = json.loads(resp.data)\n print (reply_from_server)\n self.assertEqual(reply_from_server['status'], main.ReturnCodes.ERROR_INVALID_PARAM)\n ...
[ "0.64899945", "0.6472537", "0.6442965", "0.6421131", "0.64122623", "0.63460237", "0.63327986", "0.6329774", "0.6308766", "0.6291311", "0.62510055", "0.62462914", "0.6238191", "0.62211984", "0.6216545", "0.6216545", "0.6216545", "0.61854666", "0.6184419", "0.6183006", "0.61753...
0.0
-1
Test that service invokes renault_api with correct data.
async def test_service_set_ac_start_simple( hass: HomeAssistant, config_entry: ConfigEntry ) -> None: await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() temperature = 13.5 data = { ATTR_VEHICLE: get_device_id(hass), ATTR_TEMPERATURE: temp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_book(self):\n resp = self.app.get('/api/book', headers={'Authorization': 'Bearer DUMMY_TEST_TOCKEN_GINTO'})\n reply_from_server = json.loads(resp.data)\n print (reply_from_server)\n self.assertEqual(reply_from_server['status'], main.ReturnCodes.ERROR_INVALID_PARAM)\n ...
[ "0.6490156", "0.6473294", "0.64433306", "0.64206386", "0.6411804", "0.6346321", "0.63323236", "0.63293403", "0.63076735", "0.6291644", "0.62507504", "0.6246916", "0.6238423", "0.6221492", "0.62160516", "0.62160516", "0.62160516", "0.61857146", "0.6184941", "0.6182072", "0.617...
0.0
-1
Test that service invokes renault_api with correct data.
async def test_service_set_ac_start_with_date( hass: HomeAssistant, config_entry: ConfigEntry ) -> None: await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() temperature = 13.5 when = datetime(2025, 8, 23, 17, 12, 45) data = { ATTR_VEHICLE: get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_book(self):\n resp = self.app.get('/api/book', headers={'Authorization': 'Bearer DUMMY_TEST_TOCKEN_GINTO'})\n reply_from_server = json.loads(resp.data)\n print (reply_from_server)\n self.assertEqual(reply_from_server['status'], main.ReturnCodes.ERROR_INVALID_PARAM)\n ...
[ "0.6490156", "0.6473294", "0.64433306", "0.64206386", "0.6411804", "0.6346321", "0.63323236", "0.63293403", "0.63076735", "0.6291644", "0.62507504", "0.6246916", "0.6238423", "0.6221492", "0.62160516", "0.62160516", "0.62160516", "0.61857146", "0.6184941", "0.6182072", "0.617...
0.0
-1
Test that service invokes renault_api with correct data.
async def test_service_set_charge_schedule( hass: HomeAssistant, config_entry: ConfigEntry ) -> None: await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() schedules = {"id": 2} data = { ATTR_VEHICLE: get_device_id(hass), ATTR_SCHEDULES: sch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_book(self):\n resp = self.app.get('/api/book', headers={'Authorization': 'Bearer DUMMY_TEST_TOCKEN_GINTO'})\n reply_from_server = json.loads(resp.data)\n print (reply_from_server)\n self.assertEqual(reply_from_server['status'], main.ReturnCodes.ERROR_INVALID_PARAM)\n ...
[ "0.6490156", "0.6473294", "0.64433306", "0.64206386", "0.6411804", "0.6346321", "0.63323236", "0.63293403", "0.63076735", "0.6291644", "0.62507504", "0.6246916", "0.6238423", "0.6221492", "0.62160516", "0.62160516", "0.62160516", "0.61857146", "0.6184941", "0.6182072", "0.617...
0.0
-1
Test that service invokes renault_api with correct data.
async def test_service_set_charge_schedule_multi( hass: HomeAssistant, config_entry: ConfigEntry ) -> None: await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() schedules = [ { "id": 2, "activated": True, "monday": {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_book(self):\n resp = self.app.get('/api/book', headers={'Authorization': 'Bearer DUMMY_TEST_TOCKEN_GINTO'})\n reply_from_server = json.loads(resp.data)\n print (reply_from_server)\n self.assertEqual(reply_from_server['status'], main.ReturnCodes.ERROR_INVALID_PARAM)\n ...
[ "0.64899945", "0.6472537", "0.6442965", "0.6421131", "0.64122623", "0.63460237", "0.63327986", "0.6329774", "0.6308766", "0.6291311", "0.62510055", "0.62462914", "0.6238191", "0.62211984", "0.6216545", "0.6216545", "0.6216545", "0.61854666", "0.6184419", "0.6183006", "0.61753...
0.0
-1
Name of the backend.
def name(self) -> str: return 'SPSDK'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backend(self) -> str:\n return self.__class__.BACKEND_NAME", "def backend(self) -> str:\n return self._backend", "def get_backend_name(self):\n if self.backend==2:\n return \"MySQL InnoDB\"\n elif self.backend==3:\n return \"PostgreSQL\"\n elif self....
[ "0.88468254", "0.813174", "0.788706", "0.7855888", "0.7819557", "0.7632862", "0.7458075", "0.7446217", "0.7446217", "0.72215027", "0.72215027", "0.72215027", "0.72215027", "0.7214138", "0.7151442", "0.7083253", "0.69762695", "0.6715459", "0.66775495", "0.66761005", "0.6667624...
0.0
-1
Return a random byte string with specified length.
def random_bytes(self, length: int) -> bytes: return Random.get_random_bytes(length)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_rand_bytes(self, len):\n #r = ''.join([chr(random.randint(0, 255)) for _x in range(len)])\n r = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(len))\n\n return str(r)", "def get_random_bytes(length):\n if length <= 0:\n raise ValueError('Random bytestring ...
[ "0.8560487", "0.83491457", "0.83175564", "0.822484", "0.82002056", "0.8133035", "0.8104766", "0.80977553", "0.80754304", "0.80675256", "0.8064542", "0.80221164", "0.800063", "0.7963029", "0.795563", "0.7910241", "0.7865225", "0.78651977", "0.7846835", "0.78065735", "0.7724024...
0.79246694
15
Encrypt plain data with AES in CBC mode.
def aes_cbc_encrypt(self, key: bytes, plain_data: bytes, iv: bytes = None) -> bytes: if len(key) not in AES.key_size: raise SPSDKError(f"The key must be a valid AES key length: {', '.join([str(k) for k in AES.key_size])}") init_vector = iv or bytes(AES.block_size) if len(init_vector)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt_aes_cbc(data, key, iv):\r\n # Sets the initial IV. During the encryption (in the for\r\n # loop), prev will be reset to previous ciphertext block.\r\n prev = iv\r\n ciphertext = b''\r\n\r\n # Divides the plaintext into block size-sized chunks\r\n plaintext_blocks = [data[i:i+block_siz...
[ "0.7860377", "0.7750111", "0.7510807", "0.750003", "0.7468882", "0.7319651", "0.73132765", "0.7159233", "0.712739", "0.7126006", "0.7034987", "0.7023833", "0.70151645", "0.7006222", "0.6998751", "0.69889444", "0.6969016", "0.69099677", "0.68872356", "0.6855551", "0.68263537",...
0.8067698
0
Encrypt plain data with AES in CTR mode.
def aes_ctr_encrypt(self, key: bytes, plain_data: bytes, nonce: bytes) -> bytes: if len(key) not in (16, 24, 32): raise ValueError("The key must be a valid AES key length") if len(nonce) != 16: raise ValueError("The nonce length is not valid") assert len(plain_data) <= le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt(aes_key, aes_iv, plaintext):\n\n assert type(plaintext) is bytes\n\n backend = default_backend()\n\n try:\n # AES-256 in CTR mode\n cipher = Cipher(algorithms.AES(aes_key), modes.CTR(aes_iv), backend=backend)\n encryptor = cipher.encryptor()\n\n return encryptor.upd...
[ "0.74533576", "0.72764903", "0.6949536", "0.6934287", "0.6853131", "0.6843473", "0.6833848", "0.6831494", "0.679373", "0.6758429", "0.6727396", "0.6691508", "0.66808826", "0.6667502", "0.6642606", "0.6641562", "0.6587818", "0.6579402", "0.6479852", "0.64570564", "0.64507455",...
0.7874775
0
approximate_normal approximate the normal for the input vectors
def approximate_normal(vectors: np.array) -> np.array: return approximate_basis(vectors)[:, -1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normal(m, i):\n a = [m[0][i + 1] - m[0][i],\n\t m[1][i + 1] - m[1][i],\n\t m[2][i + 1] - m[2][i]]\n b = [m[0][i + 2] - m[0][i],\n\t m[1][i + 2] - m[1][i],\n\t m[2][i + 2] - m[2][i]]\n n = [(a[1] * b[2]) - (a[2] * b[1]),\n\t (a[2] * b[0]) - (a[0] * b[2]),\n\t (a[0] * b[1]) - (a[1] * b[0])];\n return...
[ "0.7083236", "0.7076263", "0.7053547", "0.6878834", "0.67569476", "0.6722836", "0.6577727", "0.6564648", "0.6483709", "0.6470656", "0.6455165", "0.64544433", "0.64511025", "0.6425856", "0.6399188", "0.6385895", "0.63738334", "0.62993157", "0.6286522", "0.6263212", "0.6257904"...
0.80241716
0
Removes soft break lines of the message body.
def __clean_decoded_text(self, text): new_text = "" i = 0 n = len(text) while i < n: if (text[i] == '\r' and (i + 1 < n) and text[i + 1] == '\n'): i += 2 if (i < n and text[i].isalpha() and new_text[-1].isalpha()): new_text ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_line_breaks(self, text):\n text = re.sub(r'(\\r*)', r'', text)\n text = re.sub(r'(\\n*)', r'', text)\n return text", "def adjust_body_string(self):\n form_body_string = self.form.body\n form_body_lines = form_body_string.split(\"\\n\")\n for i in range(len(form...
[ "0.6649042", "0.64520603", "0.6136428", "0.600547", "0.5995959", "0.59360397", "0.59111005", "0.5884211", "0.576394", "0.57552963", "0.5746659", "0.5721125", "0.56806517", "0.5667308", "0.56642175", "0.5660181", "0.56042165", "0.55984485", "0.5574279", "0.55647343", "0.555812...
0.0
-1
Returns the config specified, potentially specified at any point along graph composition including the root.
def get_associated_config(self, resolved_run_config: ResolvedRunConfig): if self.solid_handle: op_config = resolved_run_config.solids.get(str(self.solid_handle)) return op_config.inputs.get(self.input_name) if op_config else None else: input_config = resolved_run_conf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self):\n return self.full_config", "def get_config(self):\n return self.config.config", "def get_config(self):\n return self.context.get_config()", "def get_config():\n\n if _ctx is None:\n return ucx_api.get_current_options()\n else:\n return _get_ctx(...
[ "0.7095671", "0.6689232", "0.66678077", "0.65884495", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", "0.6541965", ...
0.0
-1
Returns ``True`` if the MMAL encoder exists and is enabled.
def active(self): try: return bool(self.output_port.enabled) except AttributeError: # output_port can be None; avoid a (demonstrated) race condition # by catching AttributeError return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_setup(self) -> bool:\n return self._is_setup()", "def is_setup(self) -> bool:\n return self._is_setup()", "def is_setup(self) -> bool:\n return self._is_setup()", "def is_enabled() -> bool:\n try:\n _get_refjit()\n return True\n except ImportError:\n return False", "d...
[ "0.5759352", "0.5759352", "0.5759352", "0.57309175", "0.5688676", "0.5672593", "0.5654483", "0.5638001", "0.5630191", "0.56272054", "0.56186205", "0.5617695", "0.5591498", "0.5567302", "0.5533416", "0.54876304", "0.54876304", "0.54876304", "0.54876304", "0.54876304", "0.54876...
0.0
-1
returns the executable name of Wapiti. This supposes that wapiti is installed on your computer.
def command_name(): return __command_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def executable(self) -> str:\n return pulumi.get(self, \"executable\")", "def executable(self) -> str:\n return pulumi.get(self, \"executable\")", "def executable(self) -> str:\n return pulumi.get(self, \"executable\")", "def getApplication():\n\n return os.path.splitext(os.path.split...
[ "0.72293895", "0.72285914", "0.72285914", "0.7044211", "0.69595754", "0.66607827", "0.6564182", "0.65404254", "0.6456622", "0.64240694", "0.6367717", "0.6222771", "0.6133181", "0.6115323", "0.6093259", "0.60175055", "0.60026133", "0.5960582", "0.59570676", "0.59207183", "0.59...
0.0
-1
Randomize the amount of padding. Can be called after adding files but before encoding.
def random_padding(self, p=0.05): assert self.stage <= Stage.FINALIZE self.padding = util.random_padding(self.total_size, p)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ab_pad(string, block_size=16, random_generator=random_util.sort_of_random_bytes):\n bytes_to_pad = block_size - (len(string) % block_size)\n padding = random_generator(bytes_to_pad)\n return padding + string", "def calculate_padding(self):\n pass", "def random_pad(data: bytes) -> bytes:\n ...
[ "0.65904015", "0.6576646", "0.6432643", "0.6432643", "0.63238245", "0.62329644", "0.6226893", "0.6216854", "0.6164119", "0.6098283", "0.60157984", "0.59934044", "0.59789807", "0.59655344", "0.59272015", "0.5918852", "0.5907238", "0.5880504", "0.58212614", "0.5816138", "0.5795...
0.7649443
0
Returns the dict as a model
def from_dict(cls, dikt) -> 'Dig': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Gets the license_id of this Dig.
def license_id(self) -> int: return self._license_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def license_key(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"license_key\")", "def license(self):\n return self._license", "def license(self) -> Optional[str]:\n return pulumi.get(self, \"license\")", "def license_key(self) -> Optional[pulumi.Input[str]]:\n return pulu...
[ "0.7209086", "0.69474596", "0.69312537", "0.68914413", "0.6870513", "0.6842331", "0.6822394", "0.6479198", "0.6415988", "0.6360305", "0.63465804", "0.6303549", "0.62866366", "0.62505907", "0.6227747", "0.62171984", "0.61687934", "0.597589", "0.59718156", "0.5920214", "0.59069...
0.86048543
0
Sets the license_id of this Dig.
def license_id(self, license_id: int): if license_id is None: raise ValueError("Invalid value for `license_id`, must not be `None`") # noqa: E501 self._license_id = license_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def license_id(self, license_id):\n\n self._license_id = license_id", "def license_serial(self, license_serial):\n\n self._license_serial = license_serial", "def license_id(self, license_id):\n if self.local_vars_configuration.client_side_validation and license_id is None: # noqa: E501\n ...
[ "0.8658341", "0.7452665", "0.72436416", "0.7187709", "0.7187709", "0.7187709", "0.7032874", "0.682735", "0.6605161", "0.6576137", "0.6246934", "0.59207785", "0.57125044", "0.5644403", "0.5638129", "0.56237346", "0.5548839", "0.5546891", "0.5507583", "0.5479342", "0.5455996", ...
0.71339357
6
Gets the pos_x of this Dig.
def pos_x(self) -> int: return self._pos_x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos_x(self):\n return self._pos_x", "def posx(self) -> int:\n\n return self.pos[0]", "def get_x(self):\n return self.__x_position", "def getXPosition(self):\n return self._x", "def x(self):\n return self.__pos[0]", "def GetXPosition(self):\n\n return self.Rea...
[ "0.8938082", "0.8605113", "0.8507821", "0.8339769", "0.7839312", "0.77794224", "0.7763664", "0.7660601", "0.7660601", "0.76279724", "0.7445971", "0.74374217", "0.7421677", "0.74201226", "0.7368365", "0.7368365", "0.7368208", "0.7252366", "0.7223469", "0.71651566", "0.7102781"...
0.88482624
1
Sets the pos_x of this Dig.
def pos_x(self, pos_x: int): if pos_x is None: raise ValueError("Invalid value for `pos_x`, must not be `None`") # noqa: E501 self._pos_x = pos_x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_xpos(self, pos):\n self.position[0] = pos", "def setX(self, val):\n if not isinstance(val, (int, float)):\n raise TypeError('x-coordinate must be a number')\n self._x = val", "def posx(self, value: int) -> None:\n\n if not isinstance(value, int):\n rais...
[ "0.76399565", "0.7198315", "0.71898156", "0.7129021", "0.7108541", "0.710576", "0.7104435", "0.70748276", "0.70748276", "0.7033181", "0.7004251", "0.7004251", "0.6965125", "0.6909858", "0.68861634", "0.6767727", "0.676028", "0.67462593", "0.67462593", "0.6721527", "0.6704058"...
0.75760025
1
Gets the pos_y of this Dig.
def pos_y(self) -> int: return self._pos_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos_y(self):\n return self._pos_y", "def posy(self) -> int:\n\n return self.pos[1]", "def get_y(self):\n return self.__y_position", "def getYPosition(self):\n return self._y", "def y(self):\n return self.__pos[1]", "def get_y(self):\n return self.y_coord", ...
[ "0.8785118", "0.86726874", "0.83033866", "0.82439077", "0.8125011", "0.8004228", "0.7973805", "0.7930907", "0.788719", "0.788595", "0.787873", "0.77768576", "0.7757417", "0.77178293", "0.7286326", "0.7275459", "0.7227912", "0.72243184", "0.7150758", "0.7150755", "0.7137314", ...
0.87330514
1
Sets the pos_y of this Dig.
def pos_y(self, pos_y: int): if pos_y is None: raise ValueError("Invalid value for `pos_y`, must not be `None`") # noqa: E501 self._pos_y = pos_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_ypos(self, pos):\n self.position[1] = pos", "def setY(self, y):\n self.y = y", "def setY(self, y):\n self.y = y", "def TDIYPOS(self, y_pos):\n y_pos = int(y_pos)", "def sety(self, value):\n self.y = value", "def sety(self, value):\n self.y = value", "de...
[ "0.8376666", "0.75962377", "0.75962377", "0.7575328", "0.7556476", "0.7556476", "0.7556476", "0.7554836", "0.7335382", "0.7302112", "0.7293665", "0.72060686", "0.71482754", "0.70179963", "0.701513", "0.7008512", "0.69905066", "0.6803372", "0.6723217", "0.6723217", "0.6700635"...
0.8229442
1
Dump an object to JSON, prettyprinted.
def dump_json(obj, path): with open(path, 'wt') as stream: json.dump(obj, stream, indent=4) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_serialized_object(obj):\n print(json.dumps(obj, indent=2, separators=(',', ': ')))", "def dump_json(obj):\n return format_html(json.dumps(obj))", "def dumps(obj, indent=True):\r\n mobj = obj._get_mapper('carbon').map_object(obj)\r\n writer = get_writer_for_class(mobj.__class__.__name__)\r\...
[ "0.77657425", "0.7536605", "0.752688", "0.7448624", "0.73137367", "0.7253674", "0.72316474", "0.71460176", "0.7135602", "0.7102005", "0.7030211", "0.6992372", "0.6991359", "0.69793797", "0.6938224", "0.69230634", "0.6919106", "0.68715614", "0.68695766", "0.6868665", "0.686700...
0.6783792
23
Check for allowed content type. Throws exception if not allowed.
def _check_content_type(content_type): if content_type in ALLOWED_CONTENT_TYPES or 'text/html' in content_type: return raise ContentTypeNotAllowed(content_type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_content_type(content_type):\r\n if request.headers['Content-Type'] == content_type:\r\n return\r\n app.logger.error('Invalid Content-Type: %s', request.headers['Content-Type'])\r\n abort(status.HTTP_415_UNSUPPORTED_MEDIA_TYPE, 'Content-Type must be {}'.format(content_type))", "def check...
[ "0.7378384", "0.72708684", "0.71938086", "0.70151955", "0.6953444", "0.68281496", "0.6546478", "0.6538121", "0.652032", "0.6507546", "0.6443211", "0.6262435", "0.6260448", "0.6259679", "0.6174994", "0.614563", "0.6110058", "0.6102669", "0.6094276", "0.6081919", "0.60810375", ...
0.7944195
0
Find the circumcentre (i.e. vertex position) of each triangle in the triangulation.
def circumcenter_periodic(xt,Lx,Ly): # disp = (xt[:,0] + xt[:,1] + xt[:,2])/3 - np.array((Lx,Ly/2)) # ri,rj,rk = mod3(xt-np.expand_dims(disp,1),Lx,Ly).transpose(1,2,0) ri,rj,rk = xt.transpose(1,0,2) rk0 = rk.copy() ri,rj = per(ri-rk,Lx,Ly),per(rj-rk,Lx,Ly) rk *=0 ax, ay = ri.T bx, by =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def triangle_circumcenter(self, a, b, c):\r\n\r\n p_a = Vector2(a.x, a.y)\r\n p_b = Vector2(b.x, b.y) - p_a\r\n p_c = Vector2(c.x, c.y) - p_a\r\n\r\n p_b2 = p_b.magnitude_squared()\r\n p_c2 = p_c.magnitude_squared()\r\n\r\n d = 2 * (p_b.x * p_c.y - p_b.y * p_c.x)\r\n\r\n ...
[ "0.69823146", "0.69823146", "0.69823146", "0.6628016", "0.6526109", "0.65178776", "0.65163535", "0.6348199", "0.6285821", "0.59836406", "0.5978561", "0.59735405", "0.597247", "0.5928082", "0.59005415", "0.5870571", "0.58673817", "0.5852525", "0.58331704", "0.58127743", "0.580...
0.0
-1
Return the viewport for the camera. Return list
def viewport(self): return self.__viewport
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_viewport_camera(self):\n cur_desktop = hou.ui.curDesktop()\n desktop = cur_desktop.name()\n panetab = cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer).name()\n persp = (\n cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer)\n .curViewport()\n ...
[ "0.73051775", "0.6759642", "0.65725046", "0.64543223", "0.63064855", "0.62989855", "0.6264199", "0.62022144", "0.61001754", "0.6046098", "0.6002126", "0.59680605", "0.59113663", "0.5873441", "0.58307475", "0.58223855", "0.58204234", "0.5814589", "0.58104", "0.57843035", "0.57...
0.73693424
0
Return the x position for the camera. Return int
def x(self): return self.__pos[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def x(self):\n return self._pose.position.x", "def get_x(self):\n return self.__x_position", "def getXPosition(self):\n return self._x", "def pos_x(self) -> int:\n return self._pos_x", "def pos_x(self):\n return self._pos_x", "def posx(self) -> int:\n\n return se...
[ "0.78949815", "0.7725159", "0.75568223", "0.75054306", "0.733925", "0.7317298", "0.72722155", "0.72269046", "0.72207665", "0.7032403", "0.7006584", "0.69126934", "0.68309623", "0.6791361", "0.6760285", "0.66262484", "0.657184", "0.65717894", "0.65717894", "0.6560541", "0.6530...
0.67863166
14
Return the y position for the camera. Return int
def y(self): return self.__pos[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n return self._pose.position.y", "def get_y(self):\n return self.__y_position", "def GetYPosition(self):\n\n return self.ReadRegister(self.ETECH_REG_Y)", "def getYPosition(self):\n return self._y", "def posy(self) -> int:\n\n return self.pos[1]", "def pos_y...
[ "0.8090301", "0.78442276", "0.77145827", "0.76732415", "0.75881124", "0.7534891", "0.74303126", "0.7389337", "0.7367647", "0.73583955", "0.7329777", "0.72066563", "0.7157968", "0.7096831", "0.70731616", "0.70389414", "0.6939623", "0.6857757", "0.68519604", "0.68133307", "0.67...
0.74421054
6
The semicolon in the given path is URLencoded UNEXPECTEDLY.
def testWebobRequestSemicolon(self): import webob request = webob.Request.blank("/a/b/c;d") self.assertEqual(request.url, "http://localhost/a/b/c%3Bd")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _quote_path(self, path):\n parts = urlparse(path)\n path = self._unquote(parts.path, ignore='/%')\n # quote do not work with unicode strings in Python 2.7\n # if six.PY2:\n # path = quote(path.encode('utf-8'), safe='/%')\n # else:\n # path = quote(path, ...
[ "0.66811824", "0.65099347", "0.6208531", "0.62074536", "0.61978793", "0.615323", "0.61065507", "0.6078874", "0.60527116", "0.5980029", "0.59786457", "0.5955443", "0.5938673", "0.58998483", "0.5874463", "0.5873926", "0.58712083", "0.5830445", "0.5830445", "0.5813539", "0.57929...
0.6619249
1
Retrieve the node class for a given node type.
def get_node_class(node_type): global _NODE_MAP return _NODE_MAP[node_type]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node_type(node_class):\n global _NODE_MAP\n node_type_map = {_NODE_MAP[x]: x for x in _NODE_MAP}\n return node_type_map.get(node_class)", "def _returnNodeClass(self, nodeInstance):\r\n if nodeInstance.getName() == u'hierarchy':\r\n nodeClass = HierarchyNode(nodeInstance, self._...
[ "0.7763323", "0.7433478", "0.68930846", "0.67156625", "0.6687233", "0.66344875", "0.656335", "0.6422554", "0.63958716", "0.63374597", "0.6307141", "0.6223181", "0.61529696", "0.6148246", "0.6148246", "0.61469275", "0.6110622", "0.60587895", "0.60542756", "0.6000782", "0.60007...
0.89581
0
Retrieve the node type given a node class.
def get_node_type(node_class): global _NODE_MAP node_type_map = {_NODE_MAP[x]: x for x in _NODE_MAP} return node_type_map.get(node_class)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node_class(node_type):\n global _NODE_MAP\n return _NODE_MAP[node_type]", "def node_type(self):\n return self._node_type", "def _get_node_type(self, node_dict: Dict):\n if \"node_type\" not in node_dict:\n return None\n return node_dict[\"node_type\"]", "def node...
[ "0.79779077", "0.72230524", "0.70598304", "0.6904874", "0.6836091", "0.6821165", "0.68103087", "0.64594734", "0.64340305", "0.6416307", "0.63376534", "0.63112134", "0.6304911", "0.6304911", "0.61946416", "0.6158485", "0.6089681", "0.6070083", "0.6029828", "0.6020592", "0.5909...
0.8913617
0
Helper method to generate a name for a calico veth, given the endpoint ID This takes a prefix, and then truncates the EP ID.
def generate_cali_interface_name(prefix, ep_id): if len(prefix) > 4: raise ValueError('Prefix must be 4 characters or less.') return prefix + ep_id[:11]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_endpoint_name(cls, name, endpoint_prefix=None):\r\n if endpoint_prefix is None:\r\n endpoint_prefix = 'api_{0}'.format(\r\n cls.__name__.replace('Resource', '').lower()\r\n )\r\n\r\n endpoint_prefix = endpoint_prefix.rstrip('_')\r\n return '_'.joi...
[ "0.7207001", "0.67532635", "0.6733687", "0.6418522", "0.6351382", "0.61513066", "0.6146949", "0.61367774", "0.5975359", "0.59578925", "0.59506637", "0.59192926", "0.5902405", "0.5870306", "0.58698624", "0.584007", "0.5837778", "0.5808578", "0.5796953", "0.57944524", "0.579340...
0.8352568
0
Checks whether a list of ports are within range of 0 and 65535. The port list must include a number or a number range. A valid number range must be two numbers delimited by a colon with the second number higher than the first. Both numbers must be within range. If a number range is invalid, the function will return Fal...
def validate_ports(port_list): in_range = True for port in port_list: if ":" in str(port): ports = port.split(":") in_range = (len(ports) == 2) and (int(ports[0]) < int(ports[1])) \ and validate_ports(ports) else: try: in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowsPort (self, port):\n return ((self.portmin <= port) and (port <= self.portmax))", "def validate_port(port):\n try:\n port_int = int(port)\n if port_int <= 0 or port_int > 65535:\n return False\n else:\n return True\n\n except ValueError:\n retu...
[ "0.7208431", "0.6776132", "0.66785526", "0.6553348", "0.6548912", "0.6492986", "0.6450739", "0.6419227", "0.6396346", "0.63296443", "0.6316876", "0.62838906", "0.6267962", "0.6233044", "0.61531293", "0.61354584", "0.61265683", "0.6078464", "0.6055992", "0.60559434", "0.604909...
0.88175
0
Validate that characters in string are supported by Felix. Felix supports letters az, numbers 09, and symbols _.
def validate_characters(input_string): # List of valid characters that Felix permits valid_chars = '[a-zA-Z0-9_\.\-]' # Check for invalid characters if not re.match("^%s+$" % valid_chars, input_string): return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_special_chars():\n assert validate_if(\"éáíúópao!!dsipas\") == False", "def test_character_start():\n assert validate_if(\"!éáíúópaodsipas\") == False", "def test_with_characters_inside(self):\n self.assertRaises(ValidationError, self.field.clean, \"abcdef-12145\")", "def is_string_ok(s...
[ "0.70891297", "0.7002421", "0.69058603", "0.68875104", "0.6850304", "0.6819489", "0.6813201", "0.6793743", "0.6707495", "0.6630453", "0.6563179", "0.6559839", "0.6552703", "0.65319943", "0.6516784", "0.6514789", "0.6508364", "0.65054095", "0.6496821", "0.64738303", "0.6449176...
0.8333526
0
Create a datetime object from string of date and time.
def get_date_time_object_from_string(date_time): return datetime.datetime.strptime( date_time.split('T')[0] + ' ' + date_time.split('T')[1].split('Z')[0], '%Y-%m-%d %H:%M:%S')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_py_datetime(str_date, str_time):\n t = convert_12_to_24(str_time)\n d = str_date.split(\"/\")\n return datetime(int(d[2]), int(d[1]), int(d[0]), t.hour, t.minute)", "def parse_datetime(s: str) -> datetime:\n DATETIME_FORMAT = r\"%d/%m/%Y %H:%M\"\n\n return datetime.strptime(s, DATET...
[ "0.7821113", "0.7667136", "0.7531884", "0.75124073", "0.7506423", "0.74705356", "0.7468926", "0.7403258", "0.7392739", "0.7379095", "0.73770523", "0.7321006", "0.7321006", "0.7301614", "0.7295793", "0.7264678", "0.7235976", "0.72305477", "0.72220886", "0.7214844", "0.7207738"...
0.7869114
0
Returns a list of all reaction ids in the model.
def getReactions(self): tmpSet = set(self.getColumnIDs()) return list(tmpSet.difference(set(self.getTransporters())))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIds(self):\n ids = []\n for m in self.models:\n ids.append(m.getId())\n return ids", "def getReactionsFromModel(self, idx):\n return [r.getId() for r in self.models[idx].getListOfReactions()]", "def get_ids(self):\n return self.ids", "def get_all_ids(self)...
[ "0.7346648", "0.7253697", "0.691476", "0.6769329", "0.6713895", "0.64611095", "0.64611095", "0.64611095", "0.64611095", "0.64611095", "0.64611095", "0.6421668", "0.64189184", "0.6382753", "0.63214624", "0.631252", "0.63007057", "0.6211067", "0.6162193", "0.6124802", "0.606114...
0.631747
15
Apply data augmentation For a multiCPU dataloader, please use a unique index to generate the random seed (random_state), otherwise different workers may generate the same pseudorandom number for augmentation and sampling.
def __call__(self, data, random_state): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def augment_dataset(self, num_augments=1):\n all_aug_meta = []\n all_aug_data = []\n\n for idx in tqdm.tqdm(range(len(self.meta_data))):\n # Keep the real training data\n object_meta = self.meta_data.iloc[idx]\n object_data = self.flux_data[self.flux_data['obje...
[ "0.63656664", "0.6323302", "0.6117038", "0.60623366", "0.6050741", "0.5976003", "0.59339035", "0.59223974", "0.58519167", "0.5844434", "0.5745296", "0.57123846", "0.55986506", "0.5585808", "0.55852085", "0.55486304", "0.54765147", "0.54755396", "0.546738", "0.5456037", "0.545...
0.49522647
85
Sets the banking_pin of this RequestSepaDirectDebitParams.
def banking_pin(self, banking_pin): self._banking_pin = banking_pin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bank_credit(self, bank_credit):\n\n self._bank_credit = bank_credit", "def setPin(self, pinNumber, state):\r\n # I can't see how to do this without reading and writing the data\r\n if state:\r\n self.port.setData(self.port.PPRDATA() | (2**(pinNumber-2)))\r\n else:\r\n ...
[ "0.52739435", "0.5227924", "0.52152246", "0.5174477", "0.5129766", "0.50491184", "0.50269663", "0.5005191", "0.4966587", "0.49624065", "0.4948915", "0.4892447", "0.48454046", "0.48388615", "0.4826505", "0.4761101", "0.4727523", "0.4727523", "0.4696841", "0.46913356", "0.46634...
0.8026763
0
Sets the two_step_procedure_id of this RequestSepaDirectDebitParams.
def two_step_procedure_id(self, two_step_procedure_id): self._two_step_procedure_id = two_step_procedure_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def secondary_id(self, secondary_id):\n\n self._secondary_id = secondary_id", "def secondary_id(self, secondary_id):\n\n self._secondary_id = secondary_id", "def secondary_id(self, secondary_id):\n\n self._secondary_id = secondary_id", "def secondary_id(self, secondary_id):\n\n se...
[ "0.5161902", "0.5161902", "0.5161902", "0.5161902", "0.45845106", "0.45365453", "0.43873084", "0.43136346", "0.42738822", "0.42641076", "0.42616037", "0.42068163", "0.4203841", "0.41564575", "0.4140485", "0.4121648", "0.41118634", "0.41070285", "0.41058022", "0.41033718", "0....
0.78118956
0
Sets the execution_date of this RequestSepaDirectDebitParams.
def execution_date(self, execution_date): if execution_date is None: raise ValueError("Invalid value for `execution_date`, must not be `None`") # noqa: E501 self._execution_date = execution_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etadate(self, etadate):\n\n self._etadate = etadate", "def execution_date(self):\n return self._execution_date", "def dissemination_date(self, dissemination_date):\n\n self._dissemination_date = dissemination_date", "def completion_date(self, completion_date):\n\n self._comple...
[ "0.55172473", "0.5511937", "0.5491257", "0.5471004", "0.54673254", "0.5459314", "0.5458949", "0.5431379", "0.5431379", "0.5431379", "0.5418044", "0.5414125", "0.53800094", "0.53696644", "0.53675365", "0.53675365", "0.53675365", "0.53675365", "0.53675365", "0.53675365", "0.536...
0.72171664
0
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410411", "0.8391477", "0.8172175", "0.81410587", "0.80920255", "0.8088807", "0.80676955" ]
0.0
-1
check if every thing in Alist equal to Blist
def CHECKDEBUG(dmm_io, check_io, depth=0): if depth == 0 and type(dmm_io) == dict: return CHECKDEBUG([dmm_io], [check_io], depth=0) assert(type(dmm_io) == list) assert(type(check_io) == list) CHECKEQ(len(dmm_io), len(check_io)) # logging.info(' '*(depth+1) + '>'*depth) for cid, (icur, i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def same_lists(xlist: list, ylist: list) -> bool:\n\n return len(xlist) == len(ylist) and all(x in ylist for x in xlist)", "def equivalent(list1, list2):\n if len(list1) != len(list2):\n return False\n set1 = set(list1)\n for item in list2:\n if item not in set1:\n return Fal...
[ "0.79300934", "0.7631573", "0.74049497", "0.73453575", "0.71806145", "0.71778816", "0.71758956", "0.7137214", "0.7093621", "0.70014787", "0.697875", "0.69778365", "0.6962815", "0.69554114", "0.6857531", "0.6855498", "0.68517", "0.6849618", "0.6828507", "0.67957187", "0.679333...
0.0
-1
Make hyperparameter combinations human readable
def prettify_config_output( self, config_name: str, config_value, return_dict: bool = False ): if config_name == "disabled" and config_value is False: if return_dict: return {"disabled": False} else: return "disabled = False" else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n param = self.structarr[\"parameters\"]\n return \"\\t\".join([\"%g\" % p for p in param[:3, :].reshape(-1)])", "def hyperparams_str(self):\n s = 'Hyperparameters'\n if self.hyperparams:\n for k, v in self.hyperparams.items():\n s += '\\n-...
[ "0.6364177", "0.63415366", "0.6232755", "0.6123737", "0.61018205", "0.60740125", "0.6064961", "0.601841", "0.6015738", "0.59935933", "0.5982059", "0.59726185", "0.5969455", "0.5967979", "0.5966005", "0.59614676", "0.5952493", "0.5951365", "0.59506184", "0.59481716", "0.592537...
0.0
-1
Determine the language the current user has set their OS to.
def get_language() -> str: if os.name == 'posix': # BSD, Darwin, and Linux make it easy. lang = os.environ['LANG'].split('.')[0] elif os.name == 'nt': windll = ctypes.windll.kernel32 lang = locale.windows_locale[windll.GetUserDefaultUILanguage()] else: raise RuntimeEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system_lang():\n loclang, _ = locale.getdefaultlocale()\n for lang in languages():\n if loclang.startswith(lang):\n return lang\n return \"en\"", "def get_system_lang(self):\n from locale import getdefaultlocale\n\n sys_language = getdefaultlocale()[0]\n if not...
[ "0.7843647", "0.77848005", "0.77435136", "0.7667534", "0.7584297", "0.7482829", "0.7475013", "0.7300416", "0.724406", "0.7220483", "0.7166634", "0.7166634", "0.7153651", "0.7132678", "0.7086508", "0.70849514", "0.70843714", "0.7084251", "0.7077256", "0.7072166", "0.70646846",...
0.81559354
0
Return True if the given number n is a power of two.
def is_power_of_two(n: int) -> bool: return (n != 0) and ((n & (n - 1)) == 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPowerOf2(n):\n return ((n & (n - 1)) == 0) and n != 0", "def is_power_of_2(N): \n return (N & (N - 1) == 0) and N != 0", "def is_power2(n):\n # Method for other numbers \n if n == 0:\n return True\n\n # If there is only one occurence of '1' in the binary representation\n # of ...
[ "0.8778613", "0.8541807", "0.8530887", "0.8097054", "0.80908453", "0.7927806", "0.7886793", "0.77752084", "0.77506894", "0.76486546", "0.76406336", "0.703875", "0.70174336", "0.69958246", "0.69096595", "0.6846045", "0.67897004", "0.67788666", "0.6739757", "0.67309326", "0.672...
0.8946384
0
Rotate a (log)file. The parameter rotation specifies the number of copies that will be retained. When rotating, file_name.rotation1 is renamed to file_name.rotation for all values of rotation down to 1. The initial file (with no .rotation suffix) gains a suffix. If compress_level > 0, the initial file is also compresse...
def rotate_file(file_name: str, file_dir: Path, rotation: int, compress_level: int = 9, fn_logger: logging.Logger = logging.getLogger(__name__)): fn_logger.debug('rotate_log(%s, %s, %d)', file_name, file_dir, rotation) if rotation == 0: fn_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate(self):\n if not (os.access(self.directory, os.W_OK) and os.access(self.path, os.W_OK)):\n return\n\n logs = self.listLogs()\n if (self.maxRotatedFiles is not None) and (len(logs)>=self.maxRotatedFiles):\n for i in range(len(logs)-self.maxRotatedFiles):\n ...
[ "0.6156814", "0.61359394", "0.61257416", "0.59511584", "0.59052914", "0.5853175", "0.5792572", "0.5757541", "0.5698676", "0.56845206", "0.5663832", "0.56330794", "0.56222934", "0.5576855", "0.5568701", "0.55553085", "0.54221714", "0.53968644", "0.5391732", "0.5375608", "0.537...
0.77842754
0
Encrypts a key and saves it in the keystore
def key(self, key): with open(self.file_, 'wb') as file_: file_.write(GPG.encrypt(key, self.recipient).data) if isinstance(self.repo, git.Repo): # pylint: disable=no-member self.repo.index.add([os.path.abspath(self.file_)]) self.repo.index.commit("Updated...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_key():\n key = Fernet.generate_key()\n with open(\"/datavolume1/key.key\", \"wb\") as key_file:\n key_file.write(key)", "def write_key():\n key = Fernet.generate_key()\n with open(\"key.key\", \"wb\") as key_file:\n key_file.write(key)", "def write_key():\n key = Fernet.g...
[ "0.6926225", "0.6908462", "0.6908462", "0.6623703", "0.6459436", "0.6431461", "0.6429557", "0.63420343", "0.6237472", "0.6215789", "0.616779", "0.61284506", "0.60891455", "0.60676277", "0.60105515", "0.60078406", "0.593437", "0.5866412", "0.5862578", "0.5858426", "0.5841676",...
0.5915227
17
From a .txt file, outputs lines as string in list.
def line_tokenizer(self, text): line_output = [] with open(text, mode='r+', encoding='utf8') as file: lines = file.readlines() assert isinstance(text, str), 'Incoming argument must be a string.' for line in lines: # Strip out damage characters if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_textlist(filepath):\n return [line.strip(\"\\n\") for line in open(filepath)]", "def read_lines(self, filename):\n list=[]\n first=True\n for l in codecs.open(filename, 'r', 'utf-8').readlines():\n l1=l.strip()\n if(l1.startswith(\"*TEXT\")):\n ...
[ "0.76921517", "0.7441936", "0.73518836", "0.7339376", "0.7281344", "0.7195549", "0.7128727", "0.7115447", "0.710916", "0.7108299", "0.7105163", "0.70274574", "0.7009001", "0.69994307", "0.6961504", "0.69287217", "0.6926747", "0.69127697", "0.6908435", "0.6896613", "0.68954456...
0.0
-1
Operates on a single line of text, returns all words in the line as a tuple in a list.
def word_tokenizer(line): beginning_underscore = "_[^_]+(?!_)$" # only match a string if it has a beginning underscore anywhere ending_underscore = "^(?<!_)[^_]+_" # only match a string if it has an ending underscore anywhere two_underscores = "_[^_]+_" # only match a str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getWordLst(line):\n assert type(line)==type(\"\"),\"input must be a string\"\n return line.strip().split(\" \")", "def get_words_from_line_list(L):\n\n word_list = []\n for line in L:\n words_in_line = get_words_from_string(line)\n word_list = word_list + words_in_line\n prin...
[ "0.77583015", "0.6809879", "0.6434688", "0.6431607", "0.64303344", "0.64213985", "0.6300929", "0.6297456", "0.6209275", "0.6183623", "0.6161242", "0.6157589", "0.6133383", "0.6107737", "0.6105873", "0.60904866", "0.6076403", "0.607077", "0.6050417", "0.60473764", "0.6030749",...
0.5550791
66
Takes tuple (word, language) and splits the word up into individual sign tuples (sign, language) in a list.
def sign_tokenizer(word): word_signs = [] sign = '' language = word[1] determinative = False for char in word[0]: if determinative is True: if char == '}': determinative = False if len(sign) > 0: # pylint: disab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pair(self, lang):\n return (self.en_word.word, self.es_word.word) if lang == 'en' else (self.es_word.word, self.en_word.word)", "def word_to_tuples(self, word, normpunc=False, ligaturize=False):\n try:\n return self.epi.word_to_tuples(word, normpunc)\n except AttributeErro...
[ "0.6222308", "0.6038935", "0.59603864", "0.5883755", "0.57807034", "0.57728374", "0.5684679", "0.5622204", "0.562001", "0.561336", "0.559256", "0.55561244", "0.55300885", "0.55108315", "0.54518527", "0.54481864", "0.54093474", "0.5387273", "0.53739405", "0.5365113", "0.535327...
0.75458676
0
Rotates a point around another centerPoint. Angle is in degrees. Rotation is counterclockwise
def rotatePoint(centerPoint,point,angle): angle = math.radians(angle) temp_point = point[0]-centerPoint[0] , point[1]-centerPoint[1] temp_point = ( temp_point[0]*math.cos(angle)-temp_point[1]*math.sin(angle) , temp_point[0]*math.sin(angle)+temp_point[1]*math.cos(angle)) temp_point = temp_point[0]+center...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate(p, center, angle):\n\n angle_radians = angle * (math.pi / 180.0)\n rotated_x = math.cos(angle_radians) * (p.x - center.x)\\\n - math.sin(angle_radians) * (p.y - center.y)\\\n + center.x\n rotated_y = math.sin(angle_radians) * (p.x - center.x)\\\n + m...
[ "0.7370028", "0.7302925", "0.725206", "0.7135883", "0.7064692", "0.7054618", "0.70533735", "0.7024247", "0.6814242", "0.67815346", "0.672783", "0.6621439", "0.65972567", "0.6506325", "0.6493637", "0.6388243", "0.63881177", "0.63721734", "0.63643724", "0.6354297", "0.63513786"...
0.7105346
4
Calculate an estimate of the slope using the slopes method.
def dy_dx(self, x=None, y=None): if x == None: x = self['x'] if y == None: y = self['y'] self['yp'] = slopes(x, y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_slopes(self, x, y):\n pass", "def slope_function(x, slope):\n\n return slope", "def slope(self):\n return self._regression_result.params[1]", "def slope(self):\n if not self.is_eigenform(): raise TypeError(\"slope only defined for eigenfunctions\")\n return se...
[ "0.7727777", "0.7459414", "0.72727275", "0.7205183", "0.71672887", "0.71589786", "0.7120961", "0.7102155", "0.7096479", "0.7068091", "0.7019178", "0.6970923", "0.6970801", "0.6935164", "0.6898758", "0.6897267", "0.68505687", "0.6802199", "0.6737989", "0.67276657", "0.67019707...
0.5561403
97
Returns the chromosome with the specified id.
def get_chromosome(self, id): for chrom in self.chromosomes: if chrom.id == id: return chrom raise ValueError("Chromosome not found")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chromosome(self):\n return self.identifier.split(':')[0]", "def get_by_id(self, id):\n\n pass", "def getResidue(self,id):\n\n\t\tfor residue in self.residue:\n\t\t\tif residue.id == id:\n\t\t\t\treturn residue\n\n\t\treturn None", "def __get_ply_from_id(self, id):\n for ply in self.p...
[ "0.6008521", "0.59745663", "0.57344514", "0.56733876", "0.5657845", "0.56253976", "0.55575746", "0.55339336", "0.55328304", "0.5516635", "0.54990876", "0.54979765", "0.54941183", "0.5478899", "0.5478353", "0.54517317", "0.54492474", "0.54288566", "0.5408164", "0.5391218", "0....
0.90710443
0
The lengthweighted mean recombination rate across all chromosomes.
def mean_recombination_rate(self): mean_recombination_rate = 0 for chrom in self.chromosomes: normalized_weight = chrom.length / self.length cont = chrom.recombination_rate * normalized_weight mean_recombination_rate += cont return mean_recombination_rate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_mutation_rate(self):\n mean_mutation_rate = 0\n for chrom in self.chromosomes:\n normalized_weight = chrom.length / self.length\n cont = chrom.mutation_rate * normalized_weight\n mean_mutation_rate += cont\n return mean_mutation_rate", "def overall_l...
[ "0.7403033", "0.60637105", "0.60100025", "0.59788024", "0.5974249", "0.5930751", "0.5898657", "0.5836668", "0.57497555", "0.57446223", "0.57442796", "0.5730386", "0.57214767", "0.5711431", "0.5698179", "0.56685627", "0.56630087", "0.56454927", "0.564024", "0.5639389", "0.5622...
0.87010914
0
The state of the cluster provisioning
def provisioning_state(self) -> str: return pulumi.get(self, "provisioning_state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provisioning_state(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_state(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_state(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"...
[ "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.78789055", "0.733458", "0.733458", "0.72169656", "0.71764773", "0.7167266", "...
0.782504
31
The ID of the ExpressRoute
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def express_route_id(self) -> str:\n return pulumi.get(self, \"express_route_id\")", "def GetID(self):\n return self.Route_ID", "def get_id(self):\n return self.station_id", "def id(self):\n return self.__get_string(15, 31)", "def get_id(self):\n return 3", "def get...
[ "0.7620269", "0.7042088", "0.6804199", "0.67492217", "0.6748961", "0.66949964", "0.6620335", "0.6616923", "0.6571687" ]
0.6557841
78
The base distinguished name for users
def base_user_dn(self) -> Optional[str]: return pulumi.get(self, "base_user_dn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ldap_base_dn(self):\n return self._ldap_base_dn", "def user_domain_name(self):\n raise NotImplementedError()", "def _getUsername(self):\n for (l, d) in getAccountNames(self.store):\n return l + u'@' + d", "def user_bind_base_dn(self):\n return self._user_bind_base_d...
[ "0.73138475", "0.72236127", "0.699979", "0.67843795", "0.67703396", "0.6761935", "0.67129254", "0.6711895", "0.6665327", "0.6556206", "0.65556914", "0.64780724", "0.64712256", "0.64712256", "0.6458817", "0.6458817", "0.64522076", "0.6439518", "0.6428856", "0.64220953", "0.642...
0.77047724
0
The password of the Active Directory user with a minimum of readonly access to Base DN for users and groups.
def password(self) -> Optional[str]: return pulumi.get(self, "password")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password(self):\n return self.get_raw('password')", "def password(self) -> str:\n return pulumi.get(self, \"password\")", "def password(self) -> str:\n return pulumi.get(self, \"password\")", "def password(self) -> str:\n return pulumi.get(self, \"password\")", "def password...
[ "0.7287523", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72846305", "0.72508997", "0.7240247", "0.7211455", "0.7211455", "0.7211455", "0.7211455", "0...
0.69312894
52
The name of the SKU.
def name(self) -> str: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku(self) -> str:\n return pulumi.get(self, \"sku\")", "def vm_sku_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vm_sku_name\")", "def sku(self) -> Optional[str]:\n return pulumi.get(self, \"...
[ "0.91924775", "0.83933556", "0.7890737", "0.78665197", "0.7756838", "0.7675144", "0.7579999", "0.7579999", "0.7579999", "0.74520385", "0.74520385", "0.7156567", "0.7105505", "0.7103443", "0.70915323", "0.7089756", "0.70617473", "0.70617473", "0.7021797", "0.70013434", "0.6855...
0.0
-1
Create a MainWindow for the application.
def __init__(self, app, tree, settings, config): super(MainWindow, self).__init__() self.resize(1000, 800) self.app = app self._app = app.app self._app.setStyle("QMacStyle") self.settings = settings self.config = config self.copied_node = None se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_main_window(self):\n\n self._main_window = self.build_window(\"win_main\", self._name)", "def main():\n py_app = QApplication([])\n view = MainWindow()\n view.show()\n sys.exit(py_app.exec_())", "def runApp():\r\n app = QApplication(sys.argv)\r\n mainWindow = MainWindow()...
[ "0.76234204", "0.75424397", "0.74580044", "0.74493253", "0.730294", "0.72913975", "0.72821933", "0.7276175", "0.7174904", "0.71575123", "0.71516746", "0.7118518", "0.7099094", "0.7077899", "0.7077899", "0.7077899", "0.7077899", "0.70206076", "0.7017134", "0.6993973", "0.69117...
0.60232234
81
Add recent files menu item for recently opened files
def init_recent_menu(self): recent_files = self.settings.options('recent') self.recent_menu = self.file_menu.addMenu("Open Recent") self.recent_menu.hovered.connect(self.hover_recent_menu) self.recent_file_actions = {} for i, recent_file in enumerate(recent_files): ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_recent(self, fname):\n if fname in self.recent: # avoid duplicates\n self.recent.remove(fname)\n self.recent.insert(0, fname)\n while len(self.recent) > MAX_RECENT: # prune list\n self.recent.pop()\n write_settings(recent=self.recent)\n if not sel...
[ "0.7328705", "0.7093739", "0.68740743", "0.6595294", "0.65703523", "0.65456706", "0.6508971", "0.6275517", "0.61953944", "0.6185053", "0.6155179", "0.6146022", "0.6127896", "0.6045633", "0.60370916", "0.5948637", "0.5942257", "0.5849592", "0.5831788", "0.5805397", "0.57717025...
0.78160083
0
Returns string with information about self.
def __str__(self): s = self.id + self.direction + str(self.vehicle_size) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return self.get_info()", "def __str__ (self):\n return self.__class__.__name__ + \" ({0}): \".format(hex(id(self))) + pformat(self.__dict__, width=320, compact=True)", "def __repr__(self) -> str:\n\n return self.debug()", "def __repr__(self):\n return str(self...
[ "0.8125823", "0.80809766", "0.77630186", "0.7728999", "0.7723018", "0.76849896", "0.76849896", "0.76849896", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.76676565", "0.7645025", "0.7643773", "...
0.0
-1
Consolidate the config with priority from high to low provided init value > OS environ > default.
def get_combined_config(name, val, default=None): if val is not None: return val env = load_dash_env_vars().get(f"DASH_{name.upper()}") if env is None: return default return env.lower() == "true" if env.lower() in {"true", "false"} else env
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_config(self):\n self._user_agent_adding_config = botocore.config.Config(user_agent_extra=USER_AGENT_SUFFIX)\n\n if self.config.region_names:\n self.add_regional_clients_from_list(self.config.region_names)\n self.default_region = self.config.region_names[0]\n ...
[ "0.6217793", "0.6201411", "0.61311233", "0.60676444", "0.59243155", "0.57766247", "0.56324536", "0.5583787", "0.5582821", "0.55577344", "0.55577344", "0.55481994", "0.5508732", "0.5508106", "0.54933167", "0.54901844", "0.5478681", "0.54698366", "0.5460877", "0.5437835", "0.54...
0.52165264
54
Returns the distance between the two nodes.
def distance_callback(from_index, to_index): # Convert from routing variable Index to distance matrix NodeIndex. from_node = self.manager.IndexToNode(from_index) to_node = self.manager.IndexToNode(to_index) return self.data['distance_matrix'][from_node][to_node]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self, a, b):\n\n return networkx.dijkstra_path_length(self._graph, a.post_nid, b.post_nid, 'distance')", "def distance(self, node_1, node_2):\n x1 = self.map.intersections[node_1][0]\n y1 = self.map.intersections[node_1][1]\n x2 = self.map.intersections[node_2][0]\n y2 = self.map....
[ "0.7957768", "0.7897917", "0.76897275", "0.75233924", "0.7468873", "0.744677", "0.74436927", "0.7345916", "0.731705", "0.72876763", "0.725943", "0.72068477", "0.7183589", "0.71654856", "0.7158075", "0.71464366", "0.7119415", "0.7114615", "0.71112925", "0.7109694", "0.70851284...
0.0
-1
Calculate edit distance from a to b
def distances(a, b): # TODO elements = [] # creating an empty list containting empty lists equal to number of rows for i in range(len(a)+1): elements.append([]) ################################################################# #initializing the [0][0] element as default elements[0]....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self):\n return self.ab - self.bb", "def distance(a, b):\n\treturn (a[0]-b[0])**2 + (a[1]-b[1])**2", "def distance(a, b):\n\n return math.sqrt(\n (a.x - b.x) ** 2\n + (a.y - b.y) ** 2\n + (a.z - b.z) ** 2\n )", "def get_distance(a, b):\n\n ...
[ "0.72706205", "0.715193", "0.7144588", "0.7077351", "0.7034326", "0.70023495", "0.69804263", "0.6971327", "0.6953357", "0.69283074", "0.6891151", "0.68828017", "0.6880333", "0.6841962", "0.6796535", "0.67566186", "0.6752806", "0.6703842", "0.6685186", "0.6677405", "0.66717684...
0.63354725
60
Gets `resetval` input of Stepper.
def resetval(self): index = self._ordered_input_names.index('resetval') return self._inputs[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n index = self._ordered_input_names.index('reset')\n return self._inputs[index]", "def getInputStep(self):\n return getattr(self.data.input, \"inputStep\", None)", "def get_input_value(self):\n self.__logger.info(\"Get input value start.\")\n input_value = se...
[ "0.6354594", "0.58754915", "0.58502334", "0.57539725", "0.56998223", "0.5576707", "0.55633426", "0.55633426", "0.55633426", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.5539056", "0.553905...
0.81382966
0
Apply thresholding to generate binary image
def thresholding(im, threshold): im[im < threshold] = 0 im[im >= threshold] = 1 return im
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_thresholding(img, threshold):\n return cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY)", "def binarization(input_path, output_path, threshold):\n img = cv2.imread(input_path, 0)\n img = cv2.medianBlur(img, 5)\n\n ret, th1 = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY)\n #...
[ "0.7772746", "0.7696731", "0.74792325", "0.7371096", "0.73578364", "0.735281", "0.72697777", "0.72270155", "0.72184414", "0.7197434", "0.70962775", "0.70900613", "0.7082269", "0.7068857", "0.7041603", "0.7014942", "0.7009555", "0.7000426", "0.6948617", "0.69386584", "0.691832...
0.7318202
6
Update the weights of the model given the agent's experience using SARSA(0)
def update_weights(self, discount_factor, learning_rate, observation, action, reward, done, next_observation, next_action ): ## Compute TD error q_value = self.get_q_value_from_observation_and_action( observation, action ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self):\n self.train()", "def SARSA_Learning():\n global weights\n for ep in range(num_episodes):\n e = np.zeros((num_ind, num_actions))\n state = env.reset()\n norm_state = normalize_state(state)\n features = phi(norm_state)\n action = learning_p...
[ "0.69753176", "0.6730777", "0.65054715", "0.64997435", "0.6440683", "0.64243513", "0.6423467", "0.6423467", "0.6423467", "0.6420335", "0.64171815", "0.6355773", "0.63526213", "0.6345359", "0.63247067", "0.63030356", "0.628141", "0.6267907", "0.6264904", "0.6217006", "0.621624...
0.0
-1
Return the path for a given executable.
def which(self, program): def is_exe(file_path): """ Checks whether a file is executable. """ return os.path.isfile(file_path) and os.access(file_path, os.X_OK) fpath, _ = os.path.split(program) if fpath: if is_exe(program): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_executable_path(executable):\n\n # Initialize variables\n call_string = 'which ' + executable\n my_env = os.environ.copy()\n\n # Get the execution path\n # subprocess.call(call_string, shell=True, env=my_env)\n proc = subprocess.Popen(call_string, shell=True, env=my_env,\n ...
[ "0.8016758", "0.8010644", "0.781494", "0.777439", "0.7624048", "0.7610613", "0.7476053", "0.74429196", "0.7323558", "0.7283875", "0.72256726", "0.72090834", "0.7151007", "0.7150436", "0.7150436", "0.71053755", "0.70891315", "0.7034562", "0.7034562", "0.70345205", "0.70250094"...
0.7240533
10
Attempts to guess the string format based on default symbols set and return the corresponding bytes as an integer. When unable to recognize the format ValueError is raised. >>> human2bytes('0 B') 0 >>> human2bytes('1 K') 1024 >>> human2bytes('1 M') 1048576 >>> human2bytes('1 Gi') 1073741824 >>> human2bytes('1 tera') 10...
def human2bytes(s): init = s num = "" while s and s[0:1].isdigit() or s[0:1] == '.': num += s[0] s = s[1:] num = float(num) letter = s.strip() for name, sset in SYMBOLS.items(): if letter in sset: break else: if letter == 'k': # treat '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def human2bytes(s):\n symbols = ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')\n s = s.replace(' ', '')\n offset = 0\n num = ''\n letter = 'B'\n for i, c in enumerate(s):\n if c == '.':\n offset = i\n elif not c.isdigit():\n letter = c.upper()\n break...
[ "0.7386483", "0.7240502", "0.7063859", "0.64130473", "0.62773895", "0.62596804", "0.6240823", "0.61954165", "0.61719877", "0.61395574", "0.6101812", "0.6036034", "0.5977467", "0.58595115", "0.5830068", "0.57693344", "0.5710026", "0.56847274", "0.56742847", "0.56742847", "0.56...
0.729841
1
Given a 2D array, return a mask of the same shape, with trailing zero entries as False, others as True
def np_mask_column_trail_zero(a, shrink=None): assert len(a.shape) == 2 mask = np.full(a.shape, True) for col in range(a.shape[1]): # we want the last run for each column runs = pred_runs(a[:, col], a[:, col] == 0) if runs.shape[0] < 1: continue run = runs[-1, :] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask(self, data):\n result = np.zeros(data.shape)\n result[:, self.zero_mask] = data[:, self.zero_mask]\n return result", "def apply_mask(arr, mask):\n return np.array([[x for (x, m) in zip(arr, mask) if m[0] == 1]])", "def get_boundary_mask():\n mask = np.ones([NUM_PIX_X, NUM_PI...
[ "0.66187316", "0.661036", "0.64889365", "0.6479725", "0.6335471", "0.632367", "0.6311604", "0.6299543", "0.62896717", "0.6282078", "0.6281609", "0.6266237", "0.6232156", "0.6225155", "0.6218619", "0.6215648", "0.6168765", "0.6168627", "0.61356896", "0.61252433", "0.61250645",...
0.5651212
67
Instantiates a new PhoneAuthenticationMethodItemRequestBuilder and sets the default values.
def __init__(self,request_adapter: RequestAdapter, path_parameters: Optional[Union[Dict[str, Any], str]] = None) -> None: super().__init__(request_adapter, "{+baseurl}/users/{user%2Did}/authentication/phoneMethods/{phoneAuthenticationMethod%2Did}{?%24select,%24expand}", path_parameters)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phone_methods(self) -> PhoneMethodsRequestBuilder:\n from .phone_methods.phone_methods_request_builder import PhoneMethodsRequestBuilder\n\n return PhoneMethodsRequestBuilder(self.request_adapter, self.path_parameters)", "def microsoft_authenticator_methods(self) -> MicrosoftAuthenticatorMethod...
[ "0.66337126", "0.6039325", "0.5683695", "0.550868", "0.54113597", "0.52309775", "0.5106114", "0.5014809", "0.48539707", "0.47793418", "0.47093982", "0.46773338", "0.46609956", "0.46609956", "0.46609956", "0.46609956", "0.4635208", "0.46344945", "0.46095023", "0.45930147", "0....
0.61375636
1
Retrieve a single phoneAuthenticationMethod object for a user. This method is available only for standard Azure AD and B2B users, but not B2C users.
async def get(self,request_configuration: Optional[PhoneAuthenticationMethodItemRequestBuilderGetRequestConfiguration] = None) -> Optional[PhoneAuthenticationMethod]: request_info = self.to_get_request_information( request_configuration ) from ......models.o_data_errors.o_data_error ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_phones(self, user):\n result = self.lastuser.call_resource(\n 'phone',\n all=1,\n _token=user.lastuser_token,\n _token_type=user.lastuser_token_type,\n )\n\n if result.get('status') == 'ok':\n return result['result']['all']\n ...
[ "0.52808857", "0.50971204", "0.5071309", "0.5071309", "0.5071309", "0.50628567", "0.5049149", "0.5034768", "0.50337803", "0.50334144", "0.49476078", "0.49347198", "0.49198964", "0.48957056", "0.4884618", "0.487275", "0.487275", "0.48555315", "0.48202956", "0.48201406", "0.482...
0.5060425
6
Update a user's phone number associated with a phone authentication method object. You can't change a phone's type. To change a phone's type, add a new number of the desired type and then delete the object with the original type. If a user is enabled by policy to use SMS to sign in and the mobile number is changed, the...
async def patch(self,body: Optional[PhoneAuthenticationMethod] = None, request_configuration: Optional[PhoneAuthenticationMethodItemRequestBuilderPatchRequestConfiguration] = None) -> Optional[PhoneAuthenticationMethod]: if not body: raise TypeError("body cannot be null.") request_info = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateNumber(self, phoneNumber):\n self.mobile = phoneNumber", "def set_userPhone(self, phone):\n\t\ttry:\n\t\t\tself.user_phone = int(phone)\n\t\texcept ValueError:\n\t\t\tprint(\"El telefono debe de estar conformado por numeros enteros\")", "async def change_phone_number(\n self,\n ...
[ "0.67411983", "0.64915144", "0.6407751", "0.62286156", "0.6078339", "0.60736954", "0.60634845", "0.583566", "0.583566", "0.583566", "0.583566", "0.583566", "0.58113956", "0.5742864", "0.57131416", "0.57121474", "0.56435907", "0.562157", "0.5550592", "0.55049556", "0.55049556"...
0.56491876
16
Retrieve a single phoneAuthenticationMethod object for a user. This method is available only for standard Azure AD and B2B users, but not B2C users.
def to_get_request_information(self,request_configuration: Optional[PhoneAuthenticationMethodItemRequestBuilderGetRequestConfiguration] = None) -> RequestInformation: request_info = RequestInformation() request_info.url_template = self.url_template request_info.path_parameters = self.path_parame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_phones(self, user):\n result = self.lastuser.call_resource(\n 'phone',\n all=1,\n _token=user.lastuser_token,\n _token_type=user.lastuser_token_type,\n )\n\n if result.get('status') == 'ok':\n return result['result']['all']\n ...
[ "0.5278748", "0.5102464", "0.5077578", "0.5077578", "0.5077578", "0.5067827", "0.5062593", "0.5054016", "0.5041437", "0.50386065", "0.5034631", "0.49513662", "0.4937562", "0.49161544", "0.48998594", "0.48859677", "0.48795885", "0.48795885", "0.48494983", "0.48208812", "0.4820...
0.0
-1
Update a user's phone number associated with a phone authentication method object. You can't change a phone's type. To change a phone's type, add a new number of the desired type and then delete the object with the original type. If a user is enabled by policy to use SMS to sign in and the mobile number is changed, the...
def to_patch_request_information(self,body: Optional[PhoneAuthenticationMethod] = None, request_configuration: Optional[PhoneAuthenticationMethodItemRequestBuilderPatchRequestConfiguration] = None) -> RequestInformation: if not body: raise TypeError("body cannot be null.") request_info = Req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateNumber(self, phoneNumber):\n self.mobile = phoneNumber", "def set_userPhone(self, phone):\n\t\ttry:\n\t\t\tself.user_phone = int(phone)\n\t\texcept ValueError:\n\t\t\tprint(\"El telefono debe de estar conformado por numeros enteros\")", "async def change_phone_number(\n self,\n ...
[ "0.67409956", "0.6491362", "0.64073634", "0.6227563", "0.6077819", "0.6073669", "0.60619545", "0.58346194", "0.58346194", "0.58346194", "0.58346194", "0.58346194", "0.581047", "0.5741039", "0.57129127", "0.5711956", "0.5647625", "0.5642963", "0.5621154", "0.55491585", "0.5504...
0.0
-1
Retrieve, update or delete a post by id/pk.
def post_detail(request, id): # locate the post try: post = Post.objects.get(id=id) except Post.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) if request.method == 'GET': serializer = PostSerializer(post,context={'request': request}) return Response(seri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, id: Id) -> Post:\n pass", "def post(self, post_id):\n post = Post.by_id(post_id)\n\n edited_subject = self.request.get(\"subject\")\n edited_content = self.request.get(\"content\")\n\n save_clicked = self.request.get(\"save\")\n delete_clicked = self.reques...
[ "0.71896595", "0.69389474", "0.677847", "0.67776996", "0.67236954", "0.6681433", "0.6671959", "0.6668431", "0.65896213", "0.6585112", "0.6582929", "0.65398806", "0.65102834", "0.6462351", "0.63236004", "0.6284057", "0.62804794", "0.62747324", "0.62696254", "0.6247698", "0.623...
0.6809167
2
Return an iterator over all items which have been moved to trash as (uuid, data) tuples in sorted order.
def get_trash_items(sort_by: Sorting = Sorting.date_moved_to_trash) -> _t: if sort_by == Sorting.date: yield from sorted(_get_trash_items_raw().items(), key=lambda app: app[0]['from']) elif sort_by == Sorting.date_reversed: yield from sorted(_get_trash_items_raw().items...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_trash_items_raw() -> typing.Iterator[typing.Tuple[str, dict]]:\n for uuid, appointment in core.api.get_var('appointments').items():\n if appointment['in_trash']:\n yield uuid, appointment", "def aborted_items(self):\n for key in self.todo_keys(allow_aborted):\n yie...
[ "0.70327747", "0.59799296", "0.5825805", "0.5608207", "0.54603446", "0.5409963", "0.5313138", "0.5305131", "0.52114445", "0.5200883", "0.5189689", "0.5092148", "0.5079116", "0.5077398", "0.5055107", "0.5048824", "0.50163317", "0.5000563", "0.4997422", "0.4977502", "0.4964795"...
0.6626784
1
generated source for method setWeight
def setWeight(self, weight): self.weight = weight
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setWeight(self, newWeight):\r\n\t\tself.weight = newWeight", "def setWeight(self, idx, value): # real signature unknown; restored from __doc__\n pass", "def setweight(self, weight):\n self.weight = weight", "def set_weight(self, weight):\n self.weight = weight", "def weight(self, w...
[ "0.8473072", "0.82760406", "0.8258763", "0.8240633", "0.81893635", "0.81303066", "0.8096506", "0.80490917", "0.80083215", "0.80044866", "0.80044866", "0.80044866", "0.7991825", "0.79454434", "0.7908368", "0.7832933", "0.7749881", "0.7738403", "0.770473", "0.76273435", "0.7550...
0.8244594
3
generated source for method getChildren
def getChildren(self): return self.children
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children(self):\n pass", "def getChildren(self):\n\t\treturn self.children", "def getChildren(self):\n\t\treturn self._children", "def children(self):\n raise NotImplementedError('abstract') # pragma: no cover", "def getChildren(self):\n\t\traise Exception(\"Abstract method IDataFlow.get...
[ "0.80021447", "0.79691684", "0.78422695", "0.78247434", "0.7775469", "0.7520278", "0.74931026", "0.73561704", "0.7341555", "0.7319615", "0.73179215", "0.7308159", "0.7248559", "0.7248559", "0.7177168", "0.7125816", "0.7123951", "0.7044628", "0.7036943", "0.7022468", "0.699916...
0.7800733
4
Convert the numeric representation to the character representation.
def get_symbol(num): symbol = ' ' if num == 1: symbol = 'X' elif num == -1: symbol = 'O' return symbol
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _num_to_string(self, number, pad_to_length=None):\n output = \"\"\n while number:\n number, digit = divmod(number, self._alpha_len)\n output += self._alphabet[digit]\n if pad_to_length:\n remainder = max(pad_to_length - len(output), 0)\n output =...
[ "0.64922446", "0.6373102", "0.6332678", "0.6283459", "0.6185093", "0.6180942", "0.61742765", "0.6152413", "0.60921615", "0.5977558", "0.59447706", "0.5935136", "0.5891663", "0.5888373", "0.58226186", "0.5812523", "0.58046365", "0.5800594", "0.57982475", "0.5788949", "0.577855...
0.0
-1
Returns a dict that can apply a Caesar cipher to a letter. The cipher is defined by the shift value. Ignores nonletter characters like punctuation, numbers and spaces.
def buildCoder(shift): answer = {} lowerCase, upperCase = [], [] for letter in string.ascii_lowercase: lowerCase.append(letter) for letter in string.ascii_uppercase: upperCase.append(letter) shiftLowerCase = lowerCase[shift:]+lowerCase[:shift] shiftUpperCase = upperCase[shift:]+u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caesar(character, shift, direction):\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n if direction == \"decode\":\n alphabet = alphabet[::-1]\n pos = alphabet.index(character)\n # Cycles the alphabet infinitely until it reaches the character denoted by the shift value\n # Returns the last va...
[ "0.74771523", "0.7378588", "0.73599476", "0.7340618", "0.7270147", "0.72691125", "0.7262652", "0.7104059", "0.7086194", "0.6918927", "0.684163", "0.6800147", "0.6749417", "0.66396946", "0.65054774", "0.64939356", "0.64857376", "0.6481715", "0.64630586", "0.64403296", "0.64371...
0.66743565
13