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
Generate the transition matrix for constant acceleration motion.
def get_transition_matrix(dt): return np.array([[1., dt, dt * dt * 0.5], [0., 1., dt], [0., 0., 1.]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transition_matrix(self):\n # Transition matrix\n P_trans = np.zeros((self.n_states, self.n_states))\n\n # Fill\n for s_num in range(2, (2**self.depth)):\n P_trans[(s_num - 1), (s_num//2 - 1)] = 1.0\n\n return P_trans", "def acceleration(R,M,G):\r\n N = R.s...
[ "0.618494", "0.6060256", "0.6003247", "0.5915867", "0.5794847", "0.57776386", "0.5735356", "0.5724475", "0.5705626", "0.5680914", "0.5677929", "0.5656491", "0.55629784", "0.55590034", "0.55503047", "0.5535516", "0.55351293", "0.54985386", "0.54946375", "0.5466706", "0.5435146...
0.61626995
1
Given a list of tuples, creates a list of elements at tuple_index
def strip_tuple(tuple_list, tuple_index = 0): elem_list = [] for i in range(0, len(tuple_list)): elem_list.append(tuple_list[i][tuple_index]) return elem_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(l_: List[int], i: Tuple[int, ...]) -> Tuple[int, ...]:\n return tuple([l_[x] for x in i])", "def tup_list_maker(tup_list):\n final_list = []\n for item in tup_list:\n index = item[0]\n sentences = item[1]\n for sentence in sentences:\n pair = (index, sentence)\n...
[ "0.7396039", "0.71985745", "0.66250646", "0.6301813", "0.623196", "0.6097769", "0.60704243", "0.6067709", "0.5950401", "0.5911848", "0.5911848", "0.59016126", "0.5863979", "0.58418924", "0.5839637", "0.58294916", "0.5812114", "0.57926047", "0.57651526", "0.57437015", "0.57287...
0.74707246
0
Removes words not in vocab from a list of text
def remove_unused_words(text_list, vocab): vocabset = set(vocab) for i in range(0, len(text_list)): tokens = word_tokenize(text_list[i]) tokens = [word for word in tokens if word in vocabset] text_list[i] = u' '.join(tokens) return text_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filterWords(text):\n words = text.split()\n out = []\n for w in words:\n w = normalizeOrRemoveWord(w)\n if w != None:\n out.append(w)\n return out", "def remove_stopwords(text):\r\n text_split=text.split()\r\n text_split=[word for word in text_split if word not in s...
[ "0.7811427", "0.7438936", "0.7367034", "0.7361121", "0.73175627", "0.72903055", "0.72748053", "0.7216934", "0.71874875", "0.71865386", "0.71621287", "0.7134436", "0.7134436", "0.7134436", "0.7134436", "0.7120293", "0.70852035", "0.7063519", "0.7061294", "0.7055283", "0.705422...
0.8860432
0
Get the gdb.Value of this instance.
def val(self): return self.v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self):\n\n\t\treturn self.__value", "def _get_value(self):\n return self.__value", "def value(self):\n return self.__value", "def value(self):\n return self.__value", "def get_value(self):\n return self._val", "def value(self):\n return self._val", "def getv...
[ "0.7522085", "0.74723154", "0.74658036", "0.74658036", "0.74574035", "0.74487305", "0.744748", "0.7444862", "0.73689824", "0.73689824", "0.7348514", "0.73460364", "0.73460364", "0.73460364", "0.73377585", "0.7334504", "0.7334504", "0.7309008", "0.73064727", "0.72952837", "0.7...
0.0
-1
Return the size of this block in number of words or None if inaccessible Must only be called on a block.
def size_words(self): assert self.is_block() hd = self.hd() if hd is None: return None return hd >> 10
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n if hasattr(self, \"_size\"):\n return self._size\n else:\n return None", "def size_bytes(self):\n size_words = self.size_words()\n if size_words is None:\n return None\n return size_words * intnat.sizeof", "def size(self):\n if self.is_...
[ "0.7236927", "0.7113828", "0.69406515", "0.68915784", "0.68873465", "0.68434393", "0.68357956", "0.6819651", "0.6799264", "0.6765809", "0.66771823", "0.66427517", "0.6642424", "0.6638998", "0.66231835", "0.6621859", "0.66112727", "0.66084826", "0.66084826", "0.66002303", "0.6...
0.81372184
0
Return the size of this block in number of bytes or None if inaccessible Must only be called on a block.
def size_bytes(self): size_words = self.size_words() if size_words is None: return None return size_words * intnat.sizeof
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n if hasattr(self, \"_size\"):\n return self._size\n else:\n return None", "def block_size(self):\n\n return self._block_size", "def block_size(self, block_id): # -> int:\n ...", "def size(self):\n if self.is_free():\n return...
[ "0.76410836", "0.75008047", "0.7440677", "0.72940904", "0.7178997", "0.7113256", "0.7110575", "0.71073085", "0.707522", "0.707522", "0.7073017", "0.7046389", "0.70387554", "0.7036509", "0.7036509", "0.69985086", "0.69880164", "0.6987811", "0.6987811", "0.6987811", "0.69877887...
0.6894618
28
Returns number of rows in matrix.
def rows_count(self): return len(self.value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetNumRows(self):\n return _hypre.HypreParMatrix_GetNumRows(self)", "def number_of_rows(self):\n if self.number_of_columns():\n return self._number_of_rows\n else:\n return 0", "def getNumRows(self) -> int:\n ...", "def getNumRows(self):\n return s...
[ "0.7860573", "0.7800926", "0.76987195", "0.75743157", "0.7393414", "0.73834896", "0.73456204", "0.73456204", "0.73044634", "0.72872907", "0.7266232", "0.7229302", "0.7095123", "0.70786995", "0.7066804", "0.7039144", "0.70389116", "0.7017562", "0.69499236", "0.6940887", "0.694...
0.6931238
21
setter method to set Primary app information.
def _set_app_info_Primary(self): self._Primary_app_info = self._fetch_app_info(self._Primary)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_app_info_Primary(self):\n return self._Primary_app_info", "def set_application(self, app):\n \n self.app = app", "def setAppID(self, appid):\n\t\tself.config.APP_ID = appid", "def setAppInfo(self, name, version, devMode=False):\n self._appName = name\n self._appVer...
[ "0.71339583", "0.6761681", "0.6500643", "0.631118", "0.6279136", "0.61777556", "0.6128798", "0.6113929", "0.60483545", "0.60295093", "0.5975082", "0.5907148", "0.58813053", "0.58335024", "0.57529026", "0.57023954", "0.5648523", "0.56371737", "0.56328464", "0.5630172", "0.5626...
0.85377216
0
setter method to set Secondary app information. Optimized for parallel processing of http requests.
def _set_app_info_Secondary_parallel(self): results = Pool(4).map(self._fetch_app_info, self._Secondary, chunksize=5) for result in results: self._Secondary_app_info.append(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_app_info_Secondary(self):\n for items in self._Secondary:\n self._Secondary_app_info.append(self._fetch_app_info(items))", "def _set_app_info_Primary(self):\n self._Primary_app_info = self._fetch_app_info(self._Primary)", "def _get_app_info_Secondary(self):\n return sel...
[ "0.7565459", "0.69139713", "0.6822328", "0.5920879", "0.5757652", "0.56998426", "0.5594931", "0.55482805", "0.5532627", "0.54686", "0.5433381", "0.54153126", "0.53842765", "0.52612877", "0.52550715", "0.5240381", "0.5193133", "0.51709783", "0.51075137", "0.50858486", "0.50604...
0.73110217
1
Returns the SHA256 checksum of the file
def get_checksum(file_path: str) -> str: # Open the file in binary mode with open(file_path, "rb") as file: # Create a SHA-256 hash object hash_object = hashlib.sha256() # Iterate over the file in chunks for chunk in iter(lambda: file.read(4096), b""): # Feed the ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checksum(file):\n\n cksm = hashlib.sha256()\n f = open(file, 'rb')\n try:\n cksm.update(f.read())\n finally:\n f.close()\n return cksm.hexdigest()", "def sha256sum(filename):\n content = open(filename, 'rb').read()\n sha256_obj = hashlib.sha256(content)\n return sha256_o...
[ "0.85844195", "0.82592034", "0.81129557", "0.8059804", "0.8047945", "0.76147306", "0.75880265", "0.7587544", "0.7537573", "0.7537549", "0.75156575", "0.7477274", "0.7438245", "0.7412991", "0.74043524", "0.7349805", "0.7346285", "0.73381114", "0.7337639", "0.7300783", "0.72971...
0.8173537
2
Method that applies sliding windows on the warped image
def apply_sliding_windows(self, binary_warped, leftx_base, rightx_base): # Choose the number of sliding windows nwindows = 9 # Set height of windows window_height = np.int(binary_warped.shape[0] / nwindows) # Identify the x and y positions of all nonzero pixels in the image ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sliding_window_init(lane, binary_warped, draw=False):\n\n # Assuming you have created a warped binary image called \"binary_warped\"\n # Take a histogram of the bottom half of the image\n histogram1 = np.sum(binary_warped[binary_warped.shape[0] / 2:, :], axis=0)\n # Create an output image to draw o...
[ "0.7454927", "0.72610754", "0.69086176", "0.66590375", "0.6515836", "0.6483065", "0.646845", "0.64683", "0.6437823", "0.62817097", "0.62485456", "0.6231126", "0.6079931", "0.6067994", "0.6061101", "0.6029256", "0.6014455", "0.6007304", "0.60043436", "0.5952158", "0.5925815", ...
0.7603676
0
Given a name, set selected controls' gizmo to that name
def EditGizmoName(rig, gizmo_name): hierarchy_mod = rig.get_hierarchy_modifier() selection = hierarchy_mod.get_selection() rig_elements = control_rig_utils.get_elements_by_rig_type(rig, selection, unreal.RigControl) for rig_element in rig_elements: rig_element.set_edi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self, value):\n\t\tself.form.setObjectName(value)", "def setName(self, name):\n\t\tself.label.setText(name)", "def setName(self, name):\n self.name = name", "def setName(self, name):\n self.name = name", "def setName(self, name):\n self.name = name", "def setName(self, name)...
[ "0.6654931", "0.665077", "0.6233276", "0.6233276", "0.6233276", "0.6233276", "0.62133515", "0.6186329", "0.6176021", "0.61085457", "0.60985386", "0.6075114", "0.6064513", "0.602989", "0.60044324", "0.60044324", "0.59979653", "0.5991154", "0.5966577", "0.5958668", "0.5947932",...
0.72762823
0
Test plot_density works when variables are not strings.
def test_plot_density_nonstring_varnames(): rv1 = TestRandomVariable("a") rv2 = TestRandomVariable("b") rv3 = TestRandomVariable("c") model_ab = from_dict( { rv1: np.random.normal(size=200), rv2: np.random.normal(size=200), } ) model_bc = from_dict( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_plot_density_no_subset():\n model_ab = from_dict(\n {\n \"a\": np.random.normal(size=200),\n \"b\": np.random.normal(size=200),\n }\n )\n model_bc = from_dict(\n {\n \"b\": np.random.normal(size=200),\n \"c\": np.random.normal(size=...
[ "0.69290316", "0.663471", "0.66155285", "0.63439524", "0.62682664", "0.62335485", "0.6039654", "0.5965195", "0.5898533", "0.58599687", "0.58553404", "0.5821315", "0.57722414", "0.5763902", "0.575905", "0.57258254", "0.56899905", "0.5676665", "0.5647953", "0.5618307", "0.55477...
0.8159797
0
Evaluates if last value of cumulative density is 1
def test_kde_cumulative(limits): data = np.random.normal(0, 1, 1000) density = _kde(data, custom_lims=limits, cumulative=True)[1] np.testing.assert_almost_equal(round(density[-1], 3), 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cdf(self,x):\n sortedMapping = sorted(self.mapping.items(), key=operator.itemgetter(0))\n if x == sortedMapping[-1][0]:\n return 1.0\n if x in self.values:\n cumulative=0.0\n for element in sortedMapping:\n cumulative += element[1]\n if x == ( float(element[0]) if self.isF...
[ "0.62856805", "0.6079002", "0.59913665", "0.59863555", "0.5970395", "0.58552474", "0.5818268", "0.58071697", "0.5798292", "0.5723049", "0.5594832", "0.55591", "0.55459666", "0.55335134", "0.55319667", "0.55245006", "0.5519983", "0.5513253", "0.55125177", "0.5482281", "0.54407...
0.66426075
0
Test error when plot_ess receives an invalid kind.
def test_plot_ess_bad_kind(models): idata = models.model_1 with pytest.raises(ValueError, match="Invalid kind"): plot_ess(idata, kind="bad kind")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_plot_ess_bad_coords(models, dim):\n idata = models.model_1\n with pytest.raises(ValueError, match=\"invalid coordinates\"):\n plot_ess(idata, coords={dim: slice(3)})", "def test_plot_ess(models, kind, kwargs):\n idata = models.model_1\n ax = plot_ess(idata, kind=kind, **kwargs)\n a...
[ "0.7833609", "0.7782447", "0.7475454", "0.72946006", "0.7178626", "0.6892911", "0.65514714", "0.63718724", "0.63294166", "0.6299365", "0.62832236", "0.6173026", "0.61534375", "0.60804224", "0.60777086", "0.60461026", "0.60060775", "0.588038", "0.57945573", "0.5788866", "0.576...
0.86423033
0
Test error plot_dim gets no value for multidim data and wrong value in kind_... args.
def test_plot_lm_valueerror(multidim_models, val_err_kwargs): idata2 = multidim_models.model_1 with pytest.raises(ValueError): plot_lm(idata=idata2, y="y", **val_err_kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_ndim():\n with pytest.raises(ValueError):\n validate_ndim(0)\n with pytest.raises(ValueError):\n validate_ndim(-1)\n with pytest.raises(ValueError):\n validate_ndim(0.5)\n\n assert validate_ndim(1) == 1\n assert validate_ndim(2) == 2", "def check_dimension(di...
[ "0.6689988", "0.66741914", "0.6544386", "0.6440936", "0.63534725", "0.6331811", "0.6331061", "0.6313517", "0.6298531", "0.6282986", "0.6238181", "0.62243193", "0.6215172", "0.6210846", "0.61986494", "0.6186812", "0.61598176", "0.61365914", "0.61168915", "0.61040694", "0.60981...
0.56645674
60
Test error plot_dim gets no value for multidim data and wrong value in kind_... args.
def test_plot_ts_valueerror(multidim_models, val_err_kwargs): idata2 = multidim_models.model_1 with pytest.raises(ValueError): plot_ts(idata=idata2, y="y", **val_err_kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validate_ndim():\n with pytest.raises(ValueError):\n validate_ndim(0)\n with pytest.raises(ValueError):\n validate_ndim(-1)\n with pytest.raises(ValueError):\n validate_ndim(0.5)\n\n assert validate_ndim(1) == 1\n assert validate_ndim(2) == 2", "def check_dimension(di...
[ "0.66900426", "0.6675629", "0.65438455", "0.6441141", "0.63534844", "0.6331728", "0.63309777", "0.6314764", "0.6299868", "0.62818897", "0.6238728", "0.6224551", "0.6215577", "0.62103623", "0.6198755", "0.61887836", "0.61605936", "0.61369485", "0.6117895", "0.6104733", "0.6099...
0.593212
31
Add new configuration variable definition.
def add( self, key: ConfigKey, default_value: ConfigValue, show_default_value=False, description=None, ) -> ConfigurationBuilder: key = _normalize_config_key(key) self.__config_key_to_default_value[key] = default_value if description and show_default_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_variable(self, var):\n self.var_list.append(var)\n self.var_dict[var.name] = var", "def add_variable(self, variable):\n self.variables.append(variable)", "def add_variable(self, name):\n self.all_variables.add(name)", "def addVariable(self, varName, file, var, axesArgStrin...
[ "0.6693796", "0.6546091", "0.6544875", "0.63824147", "0.6350659", "0.62180173", "0.62174827", "0.61873645", "0.6118258", "0.6116585", "0.60919565", "0.6067429", "0.6007993", "0.59886014", "0.5977048", "0.5972245", "0.5938188", "0.59269404", "0.5858379", "0.5843421", "0.582802...
0.0
-1
Return the age structure for different school types.
def get_age_bracket(school_type): age_brackets = { 'primary':[6, 7, 8, 9], 'primary_dc':[6, 7, 8, 9], 'lower_secondary':[10, 11, 12, 13], 'lower_secondary_dc':[10, 11, 12, 13], 'upper_secondary':[14, 15, 16, 17], 'secondary':[10, 11, 12, 13, 14, 15, 16, 17], 'secondary_dc':[10, 11, 12, 13, 14, 15, 16, 17...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age_fields():\n under_18_fields = CensusFields.get_under_18_fields()\n\n age_18_to_29_fields = [ \n 'B01001_007E', # Male:!!18 and 19 years\n 'B01001_008E', # Male:!!20 years\n 'B01001_009E', # Male:!!21 years\n 'B010...
[ "0.6947901", "0.63122684", "0.61381173", "0.613025", "0.5967119", "0.59392357", "0.59392357", "0.59290606", "0.59173524", "0.59171253", "0.59039223", "0.58651125", "0.5846367", "0.5805509", "0.58025783", "0.5766379", "0.57584494", "0.5748183", "0.57187325", "0.57023543", "0.5...
0.69039196
1
Generate a presigned URL to share an S3 object
def create_presigned_url(self, restricted_s3_rolename, bucket_name, object_name, expiration=''): restricted_s3_client = self.__get_client( rolename=restricted_s3_rolename ) if expiration == '': expiration = 60 try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_presigned_url(bucket_name, object_name):\n\n logger = logging.getLogger(\"SimpleReplayLogger\")\n\n s3_client = boto3.client('s3')\n try:\n response = s3_client.generate_presigned_url('get_object',\n Params={'Bucket': bucket_name,\n ...
[ "0.7821295", "0.7820629", "0.77589", "0.76828915", "0.7660355", "0.76535964", "0.7650224", "0.7648415", "0.764802", "0.7609559", "0.7569693", "0.7362904", "0.7331427", "0.73090607", "0.71629936", "0.7114181", "0.709454", "0.7061014", "0.7051139", "0.70233595", "0.70090026", ...
0.7353944
12
Compute the differential of profiles.
def diff(self): return differential(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def differential(profiles):\n new_data = []\n new_desc = []\n\n for p in profiles:\n new_data += [p.data[:-1] - p.data[1:]]\n new_desc += [p.description.copy()]\n d = new_desc[-1]\n d['profiles'] = [{'operation': 'differential',\n 'profiles': [x, y]} fo...
[ "0.78323376", "0.5969634", "0.5788694", "0.57516634", "0.5525806", "0.54919153", "0.5480214", "0.5453093", "0.5439468", "0.5423237", "0.5410083", "0.5397133", "0.5393573", "0.53874516", "0.53673244", "0.53573513", "0.5344604", "0.5338619", "0.5328365", "0.5318306", "0.5306729...
0.49918902
61
Compute the alpha profiles of an image.
def alpha_profiles(image, attribute, adjacency=4, image_name=None, filtering_rule='direct'): atree = trees.AlphaTree(image, adjacency, image_name) return create_profiles(atree, attribute, 'altitude', filtering_rule, 'alpha profiles')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attribute_profiles(image, attribute, adjacency=4, image_name=None,\n filtering_rule='direct'):\n maxt = trees.MaxTree(image, adjacency, image_name)\n mint = trees.MinTree(image, adjacency, image_name)\n\n return create_profiles((mint, maxt), attribute, 'altitude',\n filtering_rule, '...
[ "0.6113937", "0.60609186", "0.5919377", "0.5722534", "0.56170744", "0.56049854", "0.559196", "0.5567959", "0.5530606", "0.5523508", "0.5410316", "0.53699046", "0.53392905", "0.5320169", "0.52881986", "0.5268456", "0.5241319", "0.5239362", "0.5232057", "0.52140814", "0.5190901...
0.78090036
0
Compute the differential of profiles.
def differential(profiles): new_data = [] new_desc = [] for p in profiles: new_data += [p.data[:-1] - p.data[1:]] new_desc += [p.description.copy()] d = new_desc[-1] d['profiles'] = [{'operation': 'differential', 'profiles': [x, y]} for x, y in zip(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def derivatives(self):\n self.rdot = self.v\n self.vdot[:,:] = 0.0\n self.udot[:] = 0.0\n\n t = time()\n for nl in self.nlists: \n nl.separations()\n #nl.apply_minimum_image()\n self.timing['pairsep time'] = (time() - t)\n\n t = time()\n ...
[ "0.5971203", "0.5788713", "0.5752266", "0.5526452", "0.54918736", "0.5480784", "0.5450976", "0.5440364", "0.54215497", "0.5411682", "0.539845", "0.5395386", "0.53880584", "0.5368205", "0.5356789", "0.5344068", "0.53392875", "0.53276837", "0.5316497", "0.5307681", "0.5250395",...
0.78331214
0
__repr__() returns the current stack in string format
def __repr__(self): return str(self._stack_items)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return str(self.stack)", "def __str__(self) -> str:\n res = '*** top of stack ***\\n'\n\n # iterate through the stack.\n # Note: we are using our __iter__ method here\n for element in self:\n res += str(element) + '\\n'\n res += '*** bott...
[ "0.90927464", "0.8334428", "0.82423747", "0.82423747", "0.82423747", "0.82423747", "0.80465066", "0.79723716", "0.79723716", "0.79159313", "0.7776064", "0.7623544", "0.757469", "0.757469", "0.74444824", "0.7337535", "0.70879245", "0.7063982", "0.7023257", "0.7016869", "0.7002...
0.8506239
1
Insert data at the head of the list
def insert_head(self, data): node = Node(data) if self.is_empty(): self.head = node else: node.next = self.head self.head.prev = node self.head = node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_start(self, data):\n\n if self.head is None:\n self.head = ListNode(data)\n else:\n temp = self.head\n self.head = ListNode(data)\n self.head.next = temp", "def prepend(self, data):\n self.head = SinglyLLNode(data=data , next=self.head)"...
[ "0.80973244", "0.7951913", "0.79245406", "0.7804196", "0.7775218", "0.76764506", "0.76438594", "0.7484366", "0.74839926", "0.74473745", "0.73532736", "0.73233616", "0.72975886", "0.7234521", "0.7208368", "0.7197257", "0.71282685", "0.70983005", "0.70690995", "0.7053719", "0.7...
0.78115785
3
Insert data at the end of the list
def insert_append(self, data): node = Node(data) if self.is_empty(): self.head = node else: cur = self.head while cur.next != None: cur = cur.next cur.next = node node.prev = cur
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_end(self, data):\n\n if self.head is None:\n self.head = ListNode(data)\n else:\n temp = self.head\n while temp.next is not None:\n temp = temp.next\n temp.next = ListNode(data)", "def add_last(self, data):\n node = self.N...
[ "0.7639751", "0.7259109", "0.7211149", "0.71401066", "0.6957028", "0.69322366", "0.6928811", "0.6851634", "0.6847062", "0.68295664", "0.67612195", "0.6693238", "0.6661346", "0.65453005", "0.6526995", "0.6468822", "0.6459189", "0.6449225", "0.643898", "0.6437609", "0.6435044",...
0.6909083
7
Set cells in obstacle grid to be empty Reset zombie and human lists to be empty
def clear(self): poc_grid.Grid.clear(self) self._zombie_list = [] self._human_list = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_obstacles(self):\n self.obstacles = np.array([])", "def clear(self):\n poc_grid.Grid.clear(self)\n self._zombie_list = []\n self._human_list = []\n # need proof it works", "def reset(self):\r\n # replace with your code\r\n self._cells = [[0 for dummy_c...
[ "0.7903046", "0.77405584", "0.77031183", "0.76965207", "0.76223475", "0.76102734", "0.7586986", "0.74917936", "0.7486784", "0.74409497", "0.7411356", "0.7393945", "0.7387012", "0.73719716", "0.73582643", "0.7325802", "0.72839963", "0.72313416", "0.72108424", "0.7210384", "0.7...
0.77138525
2
Add zombie to the zombie list
def add_zombie(self, row, col): self._zombie_list.append((row, col))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_zombie(self, entity):\n if entity not in self._entities['all']:\n self._entities['all'].append(entity)\n self._entities['zombies'].append(entity)\n self._entities[entity._team]['zombies'].append(entity)\n entity.set_id(self._entities[entity._team]['id'])\n self...
[ "0.8145755", "0.7627476", "0.7579104", "0.59433466", "0.5911907", "0.58728415", "0.58334374", "0.5747301", "0.5735042", "0.5729783", "0.5714266", "0.56813896", "0.56762284", "0.5671887", "0.5589427", "0.5577833", "0.5557215", "0.5556951", "0.553771", "0.55231005", "0.55041355...
0.7598467
2
Tests the fetchincidents command function. Configures requests_mock instance to generate the appropriate get_alert API response, loaded from a local JSON file. Checks the output of the command function with the expected output.
def test_fetch_incidents(requests_mock): from DarktraceMBs import Client, fetch_incidents # GIVEN an integration is configured and fetch incidents mock_response = util_load_json('test_data/fetch_breach.json') requests_mock.get('https://usw1-51965-01.cloud.darktrace.com/modelbreaches?minscore=0.0&startt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_main_fetch_incidents(mocker):\n from GSuiteSecurityAlertCenter import main, demisto\n with open('test_data/fetch_incidents_output.json') as file:\n fetch_incidents_output = json.load(file)\n mocker.patch.object(demisto, 'command', return_value='fetch-incidents')\n mocker.patch.object(de...
[ "0.7969131", "0.66031027", "0.6512007", "0.6510868", "0.62561655", "0.61963415", "0.6071392", "0.5977369", "0.5917392", "0.58950096", "0.5867629", "0.58483297", "0.5763375", "0.5760544", "0.573868", "0.5737973", "0.57163465", "0.57150024", "0.564792", "0.55759597", "0.5573936...
0.66382873
1
Tests the getcomponent command function. Configures requests_mock instance to generate the appropriate get_alert API response, loaded from a local JSON file. Checks the output of the command function with the expected output.
def test_get_model_component(requests_mock): from DarktraceMBs import Client, get_model_component_command # GIVEN an integration is configured and you would like to find similar devices mock_api_response = util_load_json('test_data/component.json') requests_mock.get('https://mock.darktrace.com/componen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_component_ON(self):\n self._ucr({\n 'repository/online/component/a': 'yes',\n 'repository/online/component/a/foo': 'bar',\n })\n c = self.u.get_component('a')\n self.assertEqual({'name': 'a', 'activated': True, 'foo': 'bar'}, c)", "as...
[ "0.6389419", "0.62974125", "0.62042284", "0.61056286", "0.6094909", "0.60339713", "0.5919009", "0.5902868", "0.5843941", "0.58265716", "0.580231", "0.5791784", "0.5760986", "0.5760415", "0.5758576", "0.5755841", "0.57416505", "0.56322825", "0.5626693", "0.56225264", "0.561066...
0.64785403
0
Tests darktraceacknowledgemodelbreach command function. Configures requests_mock instance to generate the appropriate get_alerts API response, loaded from a local JSON file. Checks the output of the command function with the expected output.
def test_acknowledge_model_breach(requests_mock): from DarktraceMBs import Client, acknowledge_model_breach_command # GIVEN an integration is configured and you would like to acknowledge a breach mock_api_response = util_load_json('test_data/ack_success.json') requests_mock.post('https://mock.darktrace...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unacknowledge(requests_mock):\n from DarktraceMBs import Client, unacknowledge_model_breach_command\n\n # GIVEN an integration is configured and you would like to unacknowledge a breach\n mock_api_response = util_load_json('test_data/ack_success.json')\n requests_mock.post('https://mock.darktr...
[ "0.734845", "0.66355246", "0.6195404", "0.601765", "0.5740142", "0.554984", "0.5549075", "0.5504253", "0.5480278", "0.54372495", "0.5404577", "0.53337276", "0.53322655", "0.5309999", "0.5288857", "0.5279653", "0.52666646", "0.5254193", "0.52487755", "0.5189913", "0.5160477", ...
0.7807596
0
H.get_num_records() > int Returns the amount of records that the HashTable contains.
def get_num_records(self): return self.__num_records
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return len(self.records)", "def __len__(self) -> int:\n return len(self._table)", "def rows_count(self):\n return len(self.value)", "def __len__(self) -> int:\n return len(self.table)", "def __len__(self):\n return len(self._record_list)", "def num_row...
[ "0.76367825", "0.73606455", "0.7235072", "0.7232446", "0.72048914", "0.7202633", "0.7187593", "0.71527404", "0.71225864", "0.70539516", "0.7024726", "0.7024726", "0.69932485", "0.6992165", "0.6989328", "0.6983211", "0.6963624", "0.6963624", "0.6961895", "0.6897513", "0.688978...
0.78406215
0
H.num_empty() > int Returns the number of empty buckets within the HashTable.
def num_empty(self): count = 0 for i in self.__buckets: if i.size() == 0: count += 1 return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length(self):\n # TODO: Count number of key-value entries in each of the buckets\n return self.size\n # for bucket in self.buckets():", "def NumberOfEmptySpots(self):\n\n return np.count_nonzero(self.state == EMPTY)", "def length(self):\n # Loop through all buckets\n ...
[ "0.7223129", "0.7170346", "0.6768599", "0.6661506", "0.6634134", "0.64890647", "0.6471", "0.6471", "0.6456601", "0.644988", "0.6432256", "0.6418883", "0.6418883", "0.6418883", "0.640796", "0.6400816", "0.6400816", "0.6395663", "0.6385325", "0.63835", "0.63756704", "0.637567...
0.873899
0
Generates features for each address tokens in a windowing fashion. If the token is the first in a string, features for the token and the next token will be generated. If the token is the last token, features for the token and the prior token will be generated. Otherwise, features for the token, the prior token and the ...
def get_current_and_neighbor_features(index, address_list): # Get index position of last token in list address_length = len(address_list) - 1 def get_features(index, pf = "0_"): address = address_list[index] features_dict = {pf + "first_element": True if index == 0 el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_pair_features(tokens, feats, k=3):\n# windows = []\n # Window creation\n #--------------------------------------------------------------\n# def window_creator(list,degree):\n# for ws in range(len(tokens) - degree + 1):\n# yield [list[ws+l] for l in range(degree)]\n\n# ...
[ "0.63075894", "0.6129654", "0.58821887", "0.5819111", "0.58079755", "0.57439685", "0.57193315", "0.57184815", "0.5661237", "0.56576747", "0.56494534", "0.56293696", "0.56210554", "0.54964185", "0.54526156", "0.5416938", "0.53245205", "0.5277088", "0.52682924", "0.52682924", "...
0.6109125
2
A view to return the index page
def index(): return render_template("index.html", page_title="Home")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\r\n return render_template('index.html')", "def index():\n return render_template('index.html')", "def index(self):\n\t\treturn render_template('index.html')", "def index():\n return render_template('index.html')", "def index():\n return render_template('ind...
[ "0.8632587", "0.8630172", "0.86053205", "0.86032397", "0.86032397", "0.85239464", "0.85069096", "0.8503719", "0.8490341", "0.8490341", "0.84486765", "0.8410816", "0.8402631", "0.84025425", "0.83900285", "0.8381489", "0.8377479", "0.83681357", "0.836477", "0.836477", "0.836477...
0.828708
72
A view to return the product's specifications, ratings and reviews.
def review_details(product_id): # Gets the product's specifications from the database product = mongo.db.products.find_one({"_id": ObjectId(product_id)}) # Sets the page title page_title = product["name"] + " Review" # Sets the current user if session.get('user'): current_user = "{} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_detail(request, product_id):\n \n product = get_object_or_404(Product, pk=product_id)\n review_form = ReviewForm()\n reviews = Review.objects.filter(product_id=product_id).order_by('-created_at')\n\n context = {\n 'product': product,\n 'review_form': review_form,\n 'r...
[ "0.6996843", "0.6798685", "0.6740884", "0.6487296", "0.63718075", "0.6234368", "0.62328255", "0.6209164", "0.6205172", "0.6085703", "0.60809016", "0.59941125", "0.59592026", "0.59408987", "0.5917631", "0.5904691", "0.58878875", "0.58796954", "0.5846282", "0.5839149", "0.58136...
0.65677625
3
A view to return the contact page and add the data inputted into the contact form to the database. Code for returning a success status is from
def contact(): if request.method == "POST": mongo.db.contact.insert_one(request.form.to_dict()) return jsonify(success=True) return render_template("contact.html", page_title="Contact Us")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_us(request):\n\n if request.method == \"POST\":\n if request.POST.get(\"fname\") and request.POST.get(\"emailadd\"):\n post = Contact()\n post.full_name = request.POST.get(\"fname\")\n post.email = request.POST.get(\"emailadd\")\n post.phone_number ...
[ "0.76525766", "0.7507139", "0.747341", "0.7392914", "0.7314133", "0.7299901", "0.729634", "0.7286512", "0.7274228", "0.7271557", "0.72696745", "0.71954966", "0.71805155", "0.71732044", "0.7143015", "0.71397936", "0.71160114", "0.7111663", "0.71041507", "0.7102055", "0.7082471...
0.7477757
2
A view to return all the products and sort and paginates them.
def product_management(): sort_by = request.args.get("sort") """ Sort method is from https://docs.mongodb.com/manual/reference/ method/cursor.sort/index.html """ if sort_by: products = list(mongo.db.products.find().sort(sort_items(sort_by))) else: products = list(mongo.db.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_products_view(request):\n products = Product.objects.all()\n paginator = Paginator(products, 6)\n page_number = request.GET.get('page', 1)\n page = paginator.page(page_number)\n\n \"\"\"render a products html page and within that page we will have access to products, so all_products\"\"\"\n\n if page...
[ "0.78415227", "0.7804236", "0.78009796", "0.77935904", "0.76946706", "0.7614589", "0.7388731", "0.7384821", "0.73108244", "0.72626334", "0.72320044", "0.7219788", "0.7207243", "0.7188563", "0.7100759", "0.70512015", "0.70275277", "0.70034856", "0.6975498", "0.6958376", "0.693...
0.75090516
6
A view to return the add review page, and add the data inputted to the database and update the product's ratings.
def add_review(product_id): if request.method == 'POST': """ Gets the next search perameter from the URL. Code is from https:// blog.tecladocode.com/handling-the-next-url-when-logging-in-with-flask/ """ next_url = request.form.get('next') """ Gets the product...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_review(request, product_id):\n product = get_object_or_404(Product, pk=product_id)\n\n if request.method == 'POST': \n review_form = ReviewForm(request.POST)\n if review_form.is_valid():\n review = review_form.save(commit=False)\n review.product = product\n ...
[ "0.7310235", "0.70862895", "0.7046601", "0.70265406", "0.6982685", "0.6872833", "0.6868899", "0.6792098", "0.6771987", "0.67061275", "0.66032046", "0.65896595", "0.65663975", "0.6541818", "0.6537487", "0.650807", "0.64675456", "0.63978475", "0.6390451", "0.6354175", "0.628525...
0.75078535
0
Returns the 404 page if the HTTP request returns a status of 404.
def page_not_found(e): return render_template("404.html", page_title=404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_not_found(e):\n return render_template(\"404.html\"), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def error_404(self):\n response = self.render_template('404.html')\n response.st...
[ "0.820297", "0.81907016", "0.81907016", "0.81696653", "0.81394196", "0.8139382", "0.8113683", "0.80791813", "0.8055772", "0.80483097", "0.8005534", "0.79955244", "0.7991982", "0.79918337", "0.796498", "0.79437083", "0.7919626", "0.7903246", "0.7903246", "0.7903246", "0.790324...
0.81470186
4
Get the date that results on incrementing given date an interval of time in time unit.
def __get_next_term_date(self, date, unit, interval): if unit == 'days': return date + timedelta(days=interval) elif unit == 'weeks': return date + timedelta(weeks=interval) elif unit == 'months': return date + relativedelta(months=interval) elif unit ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_date(date_time_input, interval):\n\n if interval=='day':\n return date_time_input+timedelta(days=1)\n\n elif interval=='week':\n return date_time_input+timedelta(days=7)\n\n elif interval=='month':\n \n a = date_time_input+timedelta(days=31)\n next_month = a.rep...
[ "0.6770886", "0.6253465", "0.6253465", "0.61104363", "0.59617144", "0.5867873", "0.5672376", "0.56212735", "0.5599127", "0.5596122", "0.5572379", "0.5560656", "0.5555038", "0.55524975", "0.5514257", "0.5491478", "0.5470475", "0.5466801", "0.53736734", "0.5371335", "0.5349574"...
0.7166535
0
Get next date starting from given date when an order is generated.
def _get_next_order_date(self, line, start_date): self.ensure_one() next_date = fields.Date.from_string(self.start_date) while next_date <= start_date: next_date = self.__get_next_term_date( next_date, line.ordering_unit, line.ordering_interval) return next_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_day(date):\n return date + datetime.timedelta(days=1)", "def next_day(date):\n return date + datetime.timedelta(days=1)", "def get_next_day(self):\n pass", "def next(self):\n return self.from_date(self.date_b)", "def next_release_date(date):\n df = get_release_dates()\n d...
[ "0.7211684", "0.7211684", "0.7066712", "0.69292116", "0.6731373", "0.659315", "0.650414", "0.64949405", "0.6204865", "0.6182197", "0.6177484", "0.6140003", "0.61308414", "0.6099851", "0.60817677", "0.6060687", "0.59800863", "0.59800863", "0.5957296", "0.5931711", "0.5901977",...
0.7877699
0
Get the shape of a tensor as a list, since that's more convenient for our tests.
def _get_shape(t): return [x.value for x in t.shape]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_shape(tensor):\n return tensor.get_shape().as_list()", "def get_shape(input_tensor):\n return input_tensor.get_shape().as_list()", "def get_shape_list(tensor):\n static_shape, dyn_shape = tensor.shape.as_list(), tf.shape(tensor)\n\n def shape_dim(ndx):\n return dyn_sh...
[ "0.89874387", "0.8656501", "0.85169256", "0.8019334", "0.7996765", "0.7996765", "0.7947956", "0.7947956", "0.7909824", "0.78684056", "0.78287655", "0.78047776", "0.7779929", "0.77600527", "0.775132", "0.77180386", "0.7624824", "0.75823075", "0.7566802", "0.752512", "0.7360046...
0.79598343
6
Returns the output_state tensor that the encoder produces.
def connect(self, inputs, seq_lengths): if len(inputs.shape) != 3: raise ValueError('inputs must be a rank 3 tensor, but rank is {}'.format(len(inputs.shape))) if len(seq_lengths.shape) != 1: raise ValueError('seq_lengths must be a rank 1 tensor, but rank is {}'.format(len(seq_le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Get_Output(self, hidden_state):\n output = tf.nn.relu(tf.matmul(hidden_state, self.Wo) + self.bo)\n\n return output", "def output(self, state):\n h, t = state\n\n return h", "def initial_state_fn():\n # Convert to tensor values here. If the initial state is returning\n ...
[ "0.6974027", "0.683681", "0.67434144", "0.6716117", "0.67057365", "0.66798997", "0.654553", "0.65094966", "0.65055996", "0.64833516", "0.64272326", "0.63886744", "0.6357259", "0.6310672", "0.6298062", "0.62845165", "0.6268219", "0.6266742", "0.62571096", "0.6247459", "0.62324...
0.0
-1
Converts a naive utc datetime to the given timezone.
def GetLocalTime(dt, tz): return dt.replace(tzinfo=pytz.utc).astimezone(tz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_timezone(dt: datetime, tz_info: tzinfo = UTC) -> datetime:\n if dt.tzinfo is None:\n raise ValueError(f\"{dt} is a naive datetime\")\n return dt.astimezone(tz_info)", "def to_utc(dt):\n if dt.tzinfo is None:\n return dt.replace(tzinfo=pytz.utc)\n else:\n return dt.ast...
[ "0.7590451", "0.74446446", "0.7297905", "0.7117434", "0.7117434", "0.7117434", "0.708207", "0.69588786", "0.69359374", "0.6924315", "0.69048846", "0.6879887", "0.68630034", "0.6835325", "0.6830528", "0.6818334", "0.679031", "0.6763398", "0.6715267", "0.6715267", "0.6710031", ...
0.6534879
29
Converts from a local time to UTC using timezone translation. The returned time does not have any timezone information. This allows comparison with times coming from the datastore (which do not have timezone either).
def GetUtcTime(dt, tz): #Enriches the given time with the given timezone. For example 5 pm is enriched #to 5 pm EST, taking into account DST. local_time = tz.localize(dt) #We convert to utc utc_time = local_time.astimezone(pytz.utc) #We remove the timezone information ( = naive time) return utc_time.repla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def localToUTC(t, local_tz):\n t_local = local_tz.localize(t, is_dst=None)\n t_utc = t_local.astimezone(pytz.utc)\n return t_utc", "def localize_time_utc(non_utc_time):\n return pytz.utc.localize(non_utc_time)", "def localize_time_utc(non_utc_time):\n return pytz.utc.localize(non_utc_time)", "...
[ "0.78669256", "0.75979966", "0.75979966", "0.75316834", "0.72608656", "0.7165947", "0.7165947", "0.7165947", "0.70222783", "0.6850223", "0.6767527", "0.6754307", "0.67309594", "0.65838164", "0.6573457", "0.65642244", "0.6556976", "0.6552658", "0.63775647", "0.63662755", "0.63...
0.62997323
24
Returns true if self[k]>=other[k] for all k and self[k]>other[k] for at least one k
def dominates(self,other): assert isinstance(other,Datapoint) gte=0 # count of self[k]>=other[k] gt=0 # count of self[k]>other[k] for k in range(len(self.vec)): if self.vec[k] >= other.vec[k]: gte+=1 if self.vec[k] > other.vec[k]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __le__ (self, other) :\n if not set(self.keys()) <= set(other.keys()):\n return False\n for value, times in dict.items(self):\n count = other.get(value, 0)\n if times > count:\n return False\n return True", "def all_gt(self, other):\n ...
[ "0.76571864", "0.7632618", "0.75925153", "0.7556515", "0.74576145", "0.73623514", "0.73582435", "0.73275805", "0.73271585", "0.73020875", "0.7285073", "0.72829115", "0.72829115", "0.7276297", "0.7272488", "0.72532785", "0.7247389", "0.7224967", "0.7206441", "0.7190874", "0.71...
0.71666664
21
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
def type(self) -> str: return pulumi.get(self, "type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")", "def ...
[ "0.7919597", "0.7919597", "0.78673583", "0.78673583", "0.78673583", "0.78673583", "0.78673583", "0.77080876", "0.7553674", "0.72835004", "0.7059125", "0.69798136", "0.6922035", "0.687112", "0.6729629", "0.6704585", "0.66538656", "0.6646474", "0.65501463", "0.6543157", "0.6543...
0.6639466
59
Returns the input placeholder for this model.
def inputs(self): return self.inputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def placeholder(self):\n return self._placeholder", "def placeholder(self) -> str | None:\n return self._underlying.placeholder", "def get_embedding_placeholder(self):\n return self.embedding_layer.get_embedding_placeholder()", "def input(self) -> pulumi.Input[str]:\n return pulum...
[ "0.7951934", "0.7688572", "0.7115625", "0.68849885", "0.68465316", "0.67219335", "0.657723", "0.6455216", "0.64099014", "0.6260939", "0.6260939", "0.6241361", "0.613735", "0.613735", "0.613735", "0.613735", "0.60598016", "0.5953689", "0.5953689", "0.5953689", "0.5953689", "...
0.0
-1
Returns the output tensor of this model.
def outputs(self): return self.outputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_output(self, **kwargs):\n with tf.variable_scope(self.layer_scope):\n return self.out", "def get_output_tensor(self, index):\n output_details = self.model.get_output_details()[index]\n tensor = np.squeeze(self.model.get_tensor(output_details['index']))\n return tens...
[ "0.804356", "0.7989696", "0.7676874", "0.75652486", "0.7461065", "0.7426907", "0.7180326", "0.71673185", "0.71582687", "0.7055384", "0.7033459", "0.7003713", "0.7000677", "0.6976225", "0.6976225", "0.6976225", "0.6951136", "0.69420564", "0.69420236", "0.69149715", "0.68973136...
0.63852906
68
Returns the default collector settings
def get_default_config(self): config = super(BindCollector, self).get_default_config() config.update({ 'host': 'localhost', 'port': 8080, 'path': 'bind', # Available stats: # - resolver (Per-view resolver and cache statistics) # - s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_config(self):\r\n config = super(CMDCollector, self).get_default_config()\r\n config.update({\r\n 'enabled': 'True',\r\n 'fs': ',',\r\n 'timeout': 300,\r\n })\r\n return config", "def getDefaultSettings():\n return {}", "def ge...
[ "0.70514023", "0.7008024", "0.69490683", "0.6713433", "0.65743333", "0.65309024", "0.6521635", "0.6515402", "0.6466526", "0.6447688", "0.641337", "0.6397818", "0.6380512", "0.63683224", "0.63517016", "0.6331759", "0.63120294", "0.62353724", "0.6231899", "0.62074906", "0.62016...
0.6357208
14
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73503816", "0.7174346", "0.7127727", "0.65599126", "0.6421691", "0.6405246", "0.63429385", "0.62904894", "0.6282127", "0.6252822", "0.62496114", "0.6233181", "0.6222054", "0.6222054", "0.62070256", "0.62070256", "0.62070256", "0.62070256", "0.62070256", "0.62070256", "0.62...
0.6248022
24
Gets a collection of `InputExample`s for the dev set.
def get_dev_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68112403", "0.6588688", "0.655683", "0.6552607", "0.64272827", "0.63816285", "0.6255956", "0.61930686", "0.61160946", "0.6094262", "0.6054992", "0.6051947", "0.5989807", "0.5927489", "0.5922901", "0.5920675", "0.59200704", "0.59155166", "0.59155166", "0.59155166", "0.59155...
0.5994604
25
the `minimum_pair()` method returns the key with the smallest key value.
def minimum_pair(self): if self.node == None: return None current_node = self.node while current_node.left.node != None: current_node = current_node.left.node return (current_node.key, current_node.vp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min(self):\n p = self._find_min()\n item = p.element()\n return (item._key, item._value)", "def min_key(self):\n return self.__keys[self.__pq[1]]", "def find_min(self):\n if self.is_empty():\n return None\n else:\n p = self.first()\n return (p....
[ "0.7729546", "0.7601165", "0.7571255", "0.74204826", "0.70108306", "0.6998421", "0.6998421", "0.69737405", "0.6963827", "0.6931632", "0.68233913", "0.6796629", "0.6789679", "0.67577285", "0.6697455", "0.66361374", "0.6608254", "0.65280783", "0.65143776", "0.64937127", "0.6492...
0.7379227
4
The `is_balanced()` method returns `True` if the `AVLTree` instance is balanced, otherwise it returns `False`
def is_balanced(self): if self.node is None: return True # Left subtree height lst = self.node.left.height # Right subtree height rst = self.node.right.height if (abs(lst - rst) <= 1) and self.node.left.is_balanced() is True and self.node.ri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_balanced(self):\n\n def _height(node):\n \"\"\"Calculate the height of a node\"\"\"\n\n if not node:\n return 0\n\n return 1 + max(_height(node.left), _height(node.right))\n\n def _is_balanced(node):\n \"\"\"Check if the subtree at a n...
[ "0.87200665", "0.8436678", "0.8128097", "0.8081375", "0.7991474", "0.79340243", "0.7668254", "0.7639478", "0.7490788", "0.7442843", "0.7398798", "0.73071927", "0.729866", "0.7256305", "0.71271926", "0.71162933", "0.71014297", "0.704977", "0.6969009", "0.6582418", "0.6549399",...
0.8388701
2
Plot the bin smeared degree distribution with loglog scales (log scale in each axes).
def loglog(self, **kwargs): return self.plot(plot=pylab.loglog, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PlotLogPHistogram(lag):\n (n,bins) = pylab.mlab.hist(P(lag), bins=100, normed=True)\n binCenters = bins + (bins[1]-bins[0])/2.\n pylab.plot(binCenters, scipy.log(n+1.e-4))", "def test_bilogplot(self):\n f0 = 1./8\n OSR = 64\n order = 8\n N = 8192\n H = ds.synthesizeNT...
[ "0.68565935", "0.65770024", "0.6438088", "0.64292216", "0.6366433", "0.634986", "0.6334117", "0.6293424", "0.6129427", "0.6070283", "0.60447586", "0.59822625", "0.59817094", "0.5981141", "0.59452957", "0.59248275", "0.5889351", "0.58837104", "0.5875252", "0.58603287", "0.5837...
0.6016857
11
Test suite name. If not set, constructed from child suite names.
def name(self): return self._name or ' & '.join(s.name for s in self.suites)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_suite_name(self) -> str:\n return pulumi.get(self, \"test_suite_name\")", "def test_suite_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"test_suite_name\")", "def resource_name(self):\n return \"suite\"", "def suite():\n return unittest.TestLoader().lo...
[ "0.7832841", "0.7614384", "0.69929385", "0.6588102", "0.6545503", "0.6432944", "0.64318955", "0.63373953", "0.63202083", "0.6183912", "0.61058325", "0.609044", "0.60772276", "0.6053787", "0.59699047", "0.59239507", "0.58970416", "0.5816226", "0.5809471", "0.5777142", "0.57742...
0.6596506
3
Select test cases and remove others from this suite. Parameters have the same semantics as ``suite``, ``test``, ``include``, and ``exclude`` command line options. All of them can be given as a list of strings, or when selecting only one, as a single string. Child suites that contain no tests after filtering are automat...
def filter(self, included_suites=None, included_tests=None, included_tags=None, excluded_tags=None): self.visit(Filter(included_suites, included_tests, included_tags, excluded_tags))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(ctx, include, exclude, glob, yes, suite_type, **kwargs):\n ctx.obj.update(**kwargs)\n ctx.obj.post_process()\n namespace = ctx.obj[\"namespace\"]\n config_inst = ctx.obj[\"config\"]\n echo.welcome()\n echo.echo(f\"testsuite namespace: {namespace}\", fg='red')\n echo.echo(\"loading t...
[ "0.67708784", "0.6173673", "0.5900376", "0.5871603", "0.56635", "0.56022185", "0.5554254", "0.5472078", "0.54648423", "0.5464024", "0.5458889", "0.5369332", "0.5340196", "0.5292976", "0.52650857", "0.5257708", "0.5242193", "0.5234591", "0.52331346", "0.52240175", "0.5188008",...
0.60355717
2
Get the pseudoCB atom for a GLY residue.
def _pcb_atom_from_gly(self, residue): if residue.get_resname() != "GLY": raise ValueError(f"Residue must be GLY, but is {residue.get_resname()}.") else: # Get pseudo-CB for GLY (vector centered at origin) pcb = self._hse_cb_complex._get_gly_cb_vector(residue) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pcb_atom_from_non_gly(self, residue):\n\n residue_id = residue.id[1]\n\n if residue.get_resname() == \"GLY\":\n raise ValueError(f\"Residue cannot be GLY.\")\n else:\n # Get residue before and after input residue\n residue_before = self._residue_from_resid...
[ "0.78325737", "0.7113613", "0.52236015", "0.52119106", "0.51150405", "0.49233982", "0.49223512", "0.49215364", "0.49132618", "0.4906875", "0.4906875", "0.4902496", "0.4895736", "0.48214865", "0.48156035", "0.4802414", "0.47920427", "0.47886795", "0.47800586", "0.47420365", "0...
0.7825419
1
Yields first the header, then each of the data rows.
def __iter__(self): yield from self.url.generator
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_data():\r\n for row in data:\r\n writer.writerow(row)\r\n csv_data = read_and_flush()\r\n yield csv_data", "def iter_dict(self):\n\n itr = iter(self)\n\n headers = next(itr)\n\n for row in itr:\n yield dict(zip(headers, row))...
[ "0.674211", "0.6493197", "0.64797705", "0.6459921", "0.6302429", "0.62948453", "0.6278754", "0.626452", "0.62478673", "0.6205198", "0.62003225", "0.614916", "0.60908943", "0.60888857", "0.608187", "0.6080925", "0.60569984", "0.6003971", "0.5990368", "0.5983982", "0.5980166", ...
0.0
-1
Return a Geopandas dataframe
def geoframe(self, *args, **kwargs): try: return self.url.geoframe(*args, **kwargs) except AttributeError: pass try: return self.url.geo_generator.geoframe(*args, **kwargs) except AttributeError: pass try: return self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gdf(self) -> gpd.GeoDataFrame:\n return self.just_geometry_gdf.join(self.df)", "def gdf(self) -> gpd.GeoDataFrame:\n path = str(get_path(\"geojson/FeatureCollection02.json\"))\n df = gpd.read_file(path)\n return df", "def df_from_postgis(engine, query, params, geocolumn, epsg):\...
[ "0.7928611", "0.76375765", "0.75570726", "0.7300769", "0.7275375", "0.72440225", "0.7181948", "0.6891536", "0.6874655", "0.6862073", "0.68611616", "0.6795534", "0.6595153", "0.6593963", "0.6541202", "0.65319544", "0.65306574", "0.6527803", "0.6518752", "0.6422458", "0.6418918...
0.0
-1
Return a list of the names of the columns of this file, or None if the header is not defined. This should only return headers if the headers are unambiguous, such as for database tables, or shapefiles. For other files, like CSV and Excel, the header row can not be determined without analysis or specification.
def headers(self): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def headers(self):\n return [column.header if column else '' for column in self.columns]", "def header(self):\n\n return [c.name for c in self.columns]", "def column_headers(self) -> Sequence[str]:\n return self._column_headers", "def _extract_headers(self):\n\n with open(self.fil...
[ "0.7304714", "0.72664815", "0.7196651", "0.7178035", "0.6863658", "0.682618", "0.6809821", "0.67719907", "0.6700195", "0.66852987", "0.6573285", "0.65245897", "0.65049636", "0.6484658", "0.6461692", "0.64229274", "0.6356698", "0.63564545", "0.63534355", "0.6347353", "0.630171...
0.5972506
59
Add a suffix to a word by applying the rules above
def add_suffix(word, suffix): suffix, sep, rest = suffix.partition(' ') expanded = _add_suffix(word, suffix) return expanded + sep + rest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _replace_suffix(self, word, suffix, replacement):\n assert word.endswith(suffix), \"Given word doesn't end with given suffix\"\n if suffix == \"\":\n return word + replacement\n else:\n return word[: -len(suffix)] + replacement", "def suffix_replace(original, old, n...
[ "0.7675966", "0.7037537", "0.67314637", "0.66851276", "0.65693575", "0.64829046", "0.6464637", "0.6428958", "0.6415108", "0.6364623", "0.6334503", "0.6291326", "0.6290363", "0.627092", "0.6219077", "0.61401904", "0.6103067", "0.61016595", "0.60212827", "0.600404", "0.6002085"...
0.7895602
0
Return an executable string representation. See also `abstractproperty.characteristic.Characteristic.vrepr`. >>> from cascada.bitvector.core import Constant >>> from cascada.bitvector.operation import RotateLeft >>> from cascada.differential.difference import XorDiff >>> from cascada.differential.chmodel import ChModel...
def vrepr(self, ignore_external_diffs=False): # ignore ignore_external_diffs=ignore_external_diffs (parent class might be abstract) return super().vrepr(ignore_external_diffs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n p = \" if {0!r}\".format(self.precondition) if self.precondition else \"\"\n i = \" ignore-exit-code\" if self.ignore_exit_code else \"\"\n return \"<Command {0!r}{1}{2}>\".format(self.command, p, i)", "def _repr_(self):\n s = \"Constellation of length {} and deg...
[ "0.5974431", "0.5862134", "0.5839019", "0.5835061", "0.58188087", "0.56715506", "0.5663981", "0.5643613", "0.56324846", "0.5631347", "0.562269", "0.56150746", "0.5612735", "0.55910075", "0.5574405", "0.55671483", "0.5550013", "0.55490816", "0.5522368", "0.55087125", "0.550697...
0.0
-1
Energy per atom in eV.
def energy(self): return self._energy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(self):\n self.E = - np.sum(self.phi) + 0.5 * self.mass * np.sqrt((self.v_x ** 2 + self.v_y **2))", "def get_energy(self):\n return self.momentum*self.momentum/(2*self.mass)", "def energy(self):\n sum_energy = 0.0\n for i in range(0,self.natoms-1):\n ...
[ "0.7791839", "0.764697", "0.7605757", "0.76004887", "0.7397893", "0.7394023", "0.7364044", "0.7360068", "0.73465294", "0.7333139", "0.73306125", "0.7283513", "0.7253059", "0.7193848", "0.7183225", "0.71806055", "0.71697944", "0.71661717", "0.71562505", "0.7147651", "0.7147651...
0.7263989
12
Energy per nominal composition. i.e. energy per Fe2O3, not Fe4O6.
def energy_pfu(self): return self._energy_pfu
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(self):\n nocc, gmo, e = self.nocc, self.gmo, self.e\n\n Ec = 0.0\n for i in range(nocc):\n for j in range(nocc):\n for a in range(nocc, len(e)):\n for b in range(nocc, len(e)):\n Ec += (1/4.0) * gmo[i, j, a, b]**2 /...
[ "0.6869447", "0.67069787", "0.65457", "0.6501448", "0.6309044", "0.62388927", "0.6220663", "0.6209862", "0.6209211", "0.62055206", "0.61640006", "0.6124102", "0.61111957", "0.6100091", "0.6052811", "0.60252595", "0.60144055", "0.60112363", "0.5994792", "0.59767425", "0.596925...
0.59507895
23
Free energy function for the phase, can be defined to be anything, by default it just returns the phase's ground state energy.
def free_energy(self, T=0, P=0, mus={}): # global environment return self.energy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy_func(self):\n i = self.inl[0].to_flow()\n o = self.outl[0].to_flow()\n\n T_m = (T_mix_ph(i, T0=self.inl[0].T.val_SI) +\n T_mix_ph(o, T0=self.outl[0].T.val_SI)) / 2\n\n return (i[0] * (o[2] - i[2]) -\n self.A.val * (\n self.E.val...
[ "0.6944371", "0.66248596", "0.6500616", "0.64081764", "0.64039", "0.6339403", "0.63247466", "0.631784", "0.6266299", "0.62558556", "0.62365687", "0.62362105", "0.61649996", "0.6164935", "0.60767055", "0.6059991", "0.6055625", "0.6029564", "0.6015029", "0.60130227", "0.6003067...
0.66728914
1
Return VMD path, or set it to be a user specified path.
def pathVMD(*path): if not path: path = SETTINGS.get('vmd', None) if isExecutable(path): return path else: LOGGER.warning('VMD path is not set by user, looking for it.') vmdbin = None vmddir = None if PLATFORM == 'Windows': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVaultPath():\n\n global args, vaultPathDefault\n\n if args.vault_location:\n return args.vault_location;\n return vaultPathDefault;", "def _get_default_path(self):\n return os.path.join(cfg.DATA_DIR, 'visual_genome')", "def user(path = None):\n if path:\n return \"%s/%s\" % ...
[ "0.6185525", "0.6183668", "0.602171", "0.5991403", "0.5987749", "0.5987749", "0.59397507", "0.5924948", "0.5924948", "0.5924948", "0.58959943", "0.58756447", "0.5859155", "0.5858627", "0.5853141", "0.57971597", "0.57225233", "0.5687602", "0.56858313", "0.5677004", "0.56755", ...
0.66509205
0
Return the table's base location.
def location(self) -> str: return self.metadata.location
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_path(self):\n return self._base_path", "def base_path(self):\n return self.setup.base_path", "def base_dir(self):\n pass", "def _find_base_path(self):\n paths = [path for path, content in self._templates]\n if len(paths) == 1:\n return os.path.dirname(pa...
[ "0.71434927", "0.6773911", "0.66603893", "0.6595187", "0.65902054", "0.65135294", "0.64973825", "0.6481984", "0.6242008", "0.6205075", "0.61820585", "0.60963696", "0.60941607", "0.6079768", "0.6079284", "0.6048777", "0.6023543", "0.60137385", "0.60132897", "0.59878504", "0.59...
0.54912513
89
Get the snapshot of this table with the given id, or None if there is no matching snapshot.
def snapshot_by_id(self, snapshot_id: int) -> Optional[Snapshot]: try: return next(snapshot for snapshot in self.metadata.snapshots if snapshot.snapshot_id == snapshot_id) except StopIteration: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_snapshot(self, name=None, snapshot_id=None):\n if snapshot_id:\n return self._search_snapshot(key=\"snapshot_id\", value=snapshot_id)\n elif name:\n return self._search_snapshot(key=\"name\", value=name)\n else:\n raise ValueError(\"name or snapshot_id ...
[ "0.6728106", "0.66567403", "0.63081104", "0.6192008", "0.61709046", "0.61355036", "0.60822225", "0.6057073", "0.60102755", "0.60102755", "0.60059345", "0.5994572", "0.5866124", "0.5808389", "0.5781905", "0.57515544", "0.57515544", "0.57132274", "0.5695179", "0.5675633", "0.56...
0.7416895
0
Returns the snapshot referenced by the given name or null if no such reference exists.
def snapshot_by_name(self, name: str) -> Optional[Snapshot]: if ref := self.metadata.refs.get(name): return self.snapshot_by_id(ref.snapshot_id) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_snapshot(self, name=None, snapshot_id=None):\n if snapshot_id:\n return self._search_snapshot(key=\"snapshot_id\", value=snapshot_id)\n elif name:\n return self._search_snapshot(key=\"name\", value=name)\n else:\n raise ValueError(\"name or snapshot_id ...
[ "0.71384203", "0.6541224", "0.61837673", "0.59874135", "0.5945258", "0.5880333", "0.572489", "0.5719872", "0.5705536", "0.5701584", "0.5701216", "0.5701216", "0.5701216", "0.5642771", "0.559996", "0.5592513", "0.5578367", "0.55641156", "0.5533302", "0.5523165", "0.55019104", ...
0.88717985
0
Get the configured database for the application.
def get_db(request: Request) -> MongoWrapper: return request.app.state.db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database():\n return conf().database", "def get_db():\n if 'db' not in g:\n g.db = sqlite3.connect(str(current_app.config['DATABASE']))\n return g.db", "def get_database() -> Database:\n db_config = DatabaseConfig(DB_NAME)\n return connect_to_db(db_config)", "def get_database(self):...
[ "0.8279952", "0.8232207", "0.81797385", "0.8104148", "0.80748487", "0.80348057", "0.7910047", "0.7910047", "0.7888064", "0.7853512", "0.78470194", "0.7833503", "0.7787318", "0.77841806", "0.77841806", "0.77841806", "0.777734", "0.77719086", "0.77703345", "0.77434975", "0.7734...
0.0
-1
Get the configured Evergreen API client for the application.
def get_evg(request: Request) -> EvergreenApi: return request.app.state.evg_api
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_client(self):\n return self.client", "def get_api_client():\n\n global _API_CLIENT_HANDLE\n\n if not _API_CLIENT_HANDLE:\n context = get_context()\n server_config = context.get_server_config()\n\n pc_ip = server_config.get(\"pc_ip\")\n pc_port = server_config.get(...
[ "0.72338265", "0.7084545", "0.7080453", "0.70781213", "0.6986058", "0.6958793", "0.6898422", "0.6895851", "0.68546987", "0.68531305", "0.6771598", "0.6764534", "0.66810524", "0.66122025", "0.66070276", "0.6546237", "0.6546237", "0.65431905", "0.65299857", "0.652525", "0.65190...
0.6230285
43
Representation of the object.
def __repr__(self): return '<Blog %r>' % self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n\n return repr(self.__dict__)", "def __repr__(self):\n return '{}({})'.format(self.__class__.__name__, self._data)", "def __repr__(self):\n return str(self.__dict__)", "def __repr__(self):\n...
[ "0.8051706", "0.76092845", "0.7586369", "0.7575239", "0.7575239", "0.7575239", "0.7575239", "0.7575239", "0.753468", "0.7520129", "0.74832237", "0.74775517", "0.7468671", "0.7449133", "0.7438713", "0.7428434", "0.7393738", "0.7393738", "0.7393738", "0.7393738", "0.7393738", ...
0.0
-1
Read a draft for a given draft identifier.
def get(self, draft_id, ): return self._invoke('get', { 'draft_id': draft_id, })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_draft(draft_uuid):\n assert isinstance(draft_uuid, UUID)\n try:\n data = api_request('get', api_url('drafts', str(draft_uuid)))\n except NotFound:\n raise DraftNotFound(f\"Draft does not exist: {draft_uuid}\") # lint-amnesty, pylint: disable=raise-missing-from\n return _draft_fro...
[ "0.71334946", "0.7106668", "0.6893901", "0.6858429", "0.67169464", "0.6079457", "0.5917698", "0.5902819", "0.58971643", "0.5699909", "0.5646731", "0.5594899", "0.5563923", "0.55534333", "0.5443155", "0.53060085", "0.5302073", "0.5263763", "0.5224883", "0.5196407", "0.51710665...
0.74504316
0
Get policy groups for which the given object is a member.
def list(self, intent_path, cursor=None, enforcement_point_path=None, include_mark_for_delete_objects=None, included_fields=None, page_size=None, sort_ascending=None, sort_by=None, ): return self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def member_groups(self, user):\n \n if not hasattr(user, '_group_member_groups'):\n # be sure to use \"slow\" version of is_member to prevent it recursing back\n user._group_member_groups = [self[group] for group in self.root.keys() \\\n if self[group].is_member(u...
[ "0.6712186", "0.66027933", "0.6532484", "0.6489148", "0.6430074", "0.6400321", "0.6313005", "0.6309331", "0.6238637", "0.6220998", "0.6218812", "0.62186027", "0.6196238", "0.61946505", "0.61899775", "0.61086595", "0.6106899", "0.6091789", "0.6089005", "0.60454386", "0.6031855...
0.0
-1
Create or Replace IPFIX collector profile. IPFIX data will be sent to IPFIX collector port. This API is deprecated. Please use the following
def update(self, ipfix_collector_profile_id, i_pfix_collector_profile, ): return self._invoke('update', { 'ipfix_collector_profile_id': ipfix_collector_profile_id, 'i_pfix_collector_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self,\n ipfix_l2_collector_profile_id,\n i_pfix_l2_collector_profile,\n ):\n return self._invoke('update',\n {\n 'ipfix_l2_collector_profile_id': ipfix_l2_collector_profile_id,\n ...
[ "0.6280857", "0.6263095", "0.62444043", "0.6185203", "0.6106531", "0.5374047", "0.534685", "0.52295494", "0.51949936", "0.5123925", "0.5100191", "0.50751823", "0.49924073", "0.4963927", "0.49531814", "0.49358168", "0.4919468", "0.4912515", "0.48735237", "0.486169", "0.4820950...
0.6451295
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(y_true, y_pred, normalize=False, title=None, cmap=plt.cm.Blues): if not title: if normalize: title = 'Normalized confusion matrix' else: title = 'Confusion matrix, without ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.791787...
0.0
-1
Returns a list of strings representing the client transports reported by Tor. If present, '' is stripped from this list and used to set allTransportsEnabled to True.
def getClientTransports(self): return self.transports
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transports(self) -> List[TransportPair]:\n with self._lock:\n return self._transport_list", "def get_all_transports(self) -> Set[Transport]:\n all_transports = chain(*[entry._asdict().values() for entry in self._registry.values()])\n return set([t for t in all_transports i...
[ "0.712782", "0.66592526", "0.64246905", "0.6248824", "0.6081631", "0.56326795", "0.5560989", "0.54645383", "0.5438026", "0.54183716", "0.5381783", "0.5377032", "0.5355221", "0.5341726", "0.53349257", "0.5328872", "0.53233576", "0.5270951", "0.52664226", "0.5254136", "0.524625...
0.7565371
0
Gets JWT from Authorization Bearer header.
async def jwt_header( Authorization: Optional[str] = Header(None), ) -> Optional[RawAuth]: if not Authorization: return None parts = Authorization.split() if parts[0].lower() != "bearer": log.debug("Authorization header Failed, lacked bearer") return None if len(parts) != 2:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_token():\n # get authorization header:\n auth = request.headers.get('Authorization', None)\n \n # authorization header should be included:\n if auth is None:\n raise JWTError(\n {\n 'code': 'authorization_header_missing',\n 'description': 'Auth...
[ "0.8098268", "0.7819679", "0.77351874", "0.7618525", "0.745378", "0.7449438", "0.74304515", "0.73866886", "0.737011", "0.7369783", "0.7359554", "0.7269795", "0.726971", "0.72247386", "0.7213299", "0.7156035", "0.7138256", "0.71268713", "0.7014163", "0.69180214", "0.6866301", ...
0.71949476
15
Returns if the word is in the trie.
def search(self, word: str) -> bool: temp=self.root for char in word: if(not temp.children[ord(char)-ord('a')]): return False temp=temp.children[ord(char)-ord('a')] if(temp and temp.endOfWord==True): return True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.7315964
44
Return the filtered queryset.
def queryset(self, request: 'HttpRequest', queryset: 'QuerySet') -> 'QuerySet': queryset = queryset.annotate(citation_count=Count('images')) if self.value() == 'Yes': return queryset.exclude(citation_count__lt=2) if self.value() == 'No': return queryset.filter(citation_co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(cls, *args, **kwargs) -> models.QuerySet:\n return cls.objects.filter(*args, **kwargs)", "def filter_queryset(self, queryset):\n for name, value in self.form.cleaned_data.items():\n queryset = self.filters[name].filter(queryset, value)\n # assert isinstance(queryset...
[ "0.82541996", "0.77692753", "0.76276934", "0.7491762", "0.747332", "0.74563324", "0.73531544", "0.72921604", "0.7262168", "0.72226024", "0.7213984", "0.72006303", "0.7199878", "0.71774954", "0.71499836", "0.71460783", "0.7126865", "0.7088617", "0.7076424", "0.70740736", "0.70...
0.0
-1
lists all nodes y such that there is an edge from x to y.
def neighbors(self, x): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEdges(self):\n # for node in graph,\n # return node -> node for j in graph[node]\n\n return [\"->\".join([str(n1), str(n2)]) for n1 in self.graph.keys() for n2 in self.graph[n1]]", "def get_neighbors(self, x, y):\n\n if not self.has_vertex(x, y): return []\n neighbors = ...
[ "0.6831945", "0.6728062", "0.67201513", "0.6682043", "0.6481574", "0.6455427", "0.64240295", "0.63534385", "0.63489926", "0.62939066", "0.62596333", "0.62440306", "0.62411803", "0.62000096", "0.6198326", "0.6195833", "0.6190949", "0.6182148", "0.61821055", "0.61772406", "0.61...
0.57424235
95
adds to G the edge from x to y, if it is not there.
def add(self, x, y): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addEdge(self,x,y):\n\t\tself._dict[x].append(y)", "def addEdge(self, x, y):\n self._dictOut[x].append(y)\n self._dictIn[y].append(x)", "def addEdge(self,x,y):\n\t\tself._dictOut[x].append(y)\n\t\tself._dictIn[y].append(x)", "def addEdge(self,x,y):\n\t\tself._matr[x][y] = True", "def add_e...
[ "0.73143643", "0.71680814", "0.7166831", "0.7079163", "0.7034768", "0.69205976", "0.6799837", "0.67896456", "0.6711004", "0.67103267", "0.6708085", "0.6688752", "0.66365993", "0.6618577", "0.6613575", "0.6602899", "0.65938747", "0.6590004", "0.65637285", "0.65307623", "0.6530...
0.0
-1
Get the instance at a particular position in the array.
def __getitem__(self, key): # Check in range if key >= len(self) or key < -len(self): raise IndexError("array index {} out of range".format(key)) return self._instances[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index: int) -> object:\n return self.get_at_index(index)", "def __getitem__(self, index):\n return self.array[index]", "def __getitem__(self, index):\n return self.position[index]", "def get_at_index(self, index: int) -> object:\n return self.data[index]", ...
[ "0.7598364", "0.7368396", "0.7114957", "0.70775855", "0.7029949", "0.7029949", "0.70209324", "0.6955979", "0.69485736", "0.6884676", "0.68825614", "0.68785065", "0.6864318", "0.6851897", "0.6845752", "0.67937446", "0.67937446", "0.67136717", "0.6701242", "0.667866", "0.666289...
0.7276671
2
Construct an Mask from a NumPy array, inferring the Mask type from the NumPy type.
def makeMaskFromArray(array): if array is None: return None cls = globals()["Mask%s" % suffixes[str(array.dtype.type)]] return cls(array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeMaskedImageFromArrays(image, mask=None, variance=None):\n cls = globals()[\"MaskedImage%s\" % suffixes[str(image.dtype.type)]]\n return cls(makeImageFromArray(image), makeMaskFromArray(mask), makeImageFromArray(variance))", "def from_masked(cls, arr: np.masked.masked_array) -> JaggedArray:\n ...
[ "0.67447156", "0.6568795", "0.624556", "0.6233468", "0.6212188", "0.6058958", "0.58654785", "0.5865469", "0.58482116", "0.5812203", "0.5806071", "0.5793056", "0.578901", "0.57065845", "0.5686544", "0.5684197", "0.5666296", "0.55600315", "0.55450773", "0.5532636", "0.55166495"...
0.8315445
0
Construct a MaskedImage from three NumPy arrays, inferring the MaskedImage types from the NumPy types.
def makeMaskedImageFromArrays(image, mask=None, variance=None): cls = globals()["MaskedImage%s" % suffixes[str(image.dtype.type)]] return cls(makeImageFromArray(image), makeMaskFromArray(mask), makeImageFromArray(variance))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeMaskFromArray(array):\n if array is None: return None\n cls = globals()[\"Mask%s\" % suffixes[str(array.dtype.type)]]\n return cls(array)", "def test_05_01_mask_of3D(self):\n x=cpi.Image()\n x.image = np.ones((10,10,3))\n self.assertTrue(x.mask.ndim==2)", "def build_attent...
[ "0.631743", "0.6120416", "0.608147", "0.5767086", "0.55958533", "0.5590052", "0.5558497", "0.5550857", "0.5544683", "0.5538846", "0.5521605", "0.55163825", "0.55131876", "0.54694504", "0.54634434", "0.5462286", "0.5451089", "0.5436756", "0.5428485", "0.5401462", "0.5390587", ...
0.71877515
0
Tests that a created asset can be searched successfully.
def test_ocean_assets_search(publisher_ocean_instance, metadata): identifier = str(uuid.uuid1()).replace("-", "") metadata_copy = metadata.copy() metadata_copy["main"]["name"] = identifier assert len(publisher_ocean_instance.assets.search(identifier)) == 0 publisher = get_publisher_wallet() ddo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_system_asset(self):\n pass", "def test_get_test_asset(self):\n pass", "def test_existing_content_asset(self):\n with self.app.test_client() as client:\n response = client.get('/contentassets/logo.png')\n\n self.assert200(response)", "def test_add_new_ass...
[ "0.7166536", "0.69838595", "0.6720534", "0.67015904", "0.6691636", "0.66336083", "0.64400375", "0.64242786", "0.637687", "0.63640994", "0.6333983", "0.6328735", "0.6314019", "0.6309437", "0.6276901", "0.62699676", "0.6259049", "0.62397945", "0.6234356", "0.6212454", "0.619392...
0.7048475
1
Tests the creation of an asset with a compute service.
def test_ocean_assets_compute(publisher_ocean_instance): publisher = get_publisher_wallet() metadata = get_computing_metadata() metadata["main"]["files"][0]["checksum"] = str(uuid.uuid4()) ddo = publisher_ocean_instance.assets.create(metadata, publisher) assert ddo _ddo = wait_for_ddo(publisher_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_system_asset(self):\n pass", "def test_ocean_assets_algorithm(publisher_ocean_instance):\n publisher = get_publisher_wallet()\n metadata = get_sample_algorithm_ddo()[\"service\"][0]\n metadata[\"attributes\"][\"main\"][\"files\"][0][\"checksum\"] = str(uuid.uuid4())\n ddo = pub...
[ "0.7019149", "0.6604208", "0.64766026", "0.6276011", "0.6267881", "0.6241495", "0.61691475", "0.6138178", "0.6071556", "0.59825534", "0.597324", "0.5945023", "0.59183145", "0.591827", "0.5916858", "0.58260405", "0.5799827", "0.5796195", "0.5789706", "0.5783488", "0.57760143",...
0.7146741
0
Returns the admin home page.
def admin(): return Response(render_template('admin.html'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def a_homepage():\n\n\treturn render_template('home/a_homepage.html', title=\"Homepage Admin\")", "def home_page(self) -> str:\n return self._home_page", "def getHomePage(self):\n return self.home_url", "def admin_index():\n return 'Super-seekrit admin page.'", "def adminhome(request):\n ...
[ "0.78734803", "0.7659556", "0.75315005", "0.7451086", "0.7412807", "0.7346816", "0.7338241", "0.72982556", "0.72261536", "0.72055113", "0.7202915", "0.70956147", "0.7041309", "0.7038285", "0.70189065", "0.701527", "0.69749445", "0.69623154", "0.69597584", "0.69527817", "0.693...
0.64697665
100
Return list of (start, end) pairs for given span string.
def parse_spans(span_string): spans = [] for span in span_string.split(';'): start, end = span.split(' ') spans.append((int(start), int(end))) return spans
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def span(self, raw):\n if raw.lower() in ('*', '-', 'all'):\n raw = ':'\n results = self.spanpattern.search(raw)\n if not results:\n raise IndexError\n if not results.group('separator'):\n return [self[self._to_index(results.group('start'))]]\n st...
[ "0.65587866", "0.6335815", "0.6208409", "0.6195596", "0.6180876", "0.617939", "0.61389357", "0.61281", "0.6089457", "0.6001805", "0.59663004", "0.59441835", "0.59048706", "0.5885633", "0.5882482", "0.5860551", "0.5824911", "0.58171797", "0.580005", "0.5749686", "0.567061", ...
0.78098005
1
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(r): r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" r.headers["Pragma"] = "no-cache" r.headers["Expires"] = "0" r.headers['Cache-Control'] = 'public, max-age=0' return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.82236683", "0.82228184", "0.82228184", "0.82228184", "0.82228184", "0.8196043", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696", "0.81635696",...
0.7069552
68
Loan amount normalizer Expects the `value` to be a string. When a cace insensitive 'k' is present the it will be replaced with '000'. When the 'k' is found the normalizer will also replace any '.' with an empty string. (e.g. 12k = 12000 or 12.5K = 125000). Lastly, all none numeric or '.' characters are replace with an ...
def normalize_loan_amount(value): normalized_value = value.lower() if 'k' in normalized_value: normalized_value = normalized_value.replace('k', '000') normalized_value = normalized_value.replace('.', '') normalized_value = normalized_value.replace('$', '') normalized_value = normalized_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(amount):\n # Return empty input immediately.\n if not amount:\n return amount\n\n if re.search(r'[\\. ][0-9]{3},[0-9]{1,2}$', amount):\n # Assume amount is in 1.123,12 or 1 123,12 format (Dutch).\n return amount.replace('.', '').replace(' ', '').repla...
[ "0.5884465", "0.58822936", "0.57795995", "0.5458946", "0.5362683", "0.5337306", "0.5259212", "0.5182432", "0.51258034", "0.5122256", "0.5116404", "0.5116293", "0.51028776", "0.5095553", "0.50903237", "0.50457853", "0.5045531", "0.5036066", "0.5026245", "0.5013777", "0.4943902...
0.8409493
0
Modify the headers to allow crossorigin requests.
def allow_cors(response): response.headers['Access-Control-Allow-Origin'] = '*' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(r):\n r.headers['Acess-Control-Allow-Origin'] = '*'\n r.headers[\"Cache-Control\"] = \"no-cache, no-store, must-revalidate\"\n r.headers[\"Pragma\"] = \"no-cache\"\n r.headers[\"Expires\"] = \"0\"\n r.headers['Cache-Control'] = 'public, max-age=0'\n return r", "def set_default_he...
[ "0.6929986", "0.68002605", "0.67662996", "0.6734523", "0.6706332", "0.6701927", "0.6607627", "0.66012585", "0.6499404", "0.63850874", "0.6363921", "0.6348941", "0.63155985", "0.63138694", "0.6280324", "0.6279109", "0.6252059", "0.6243887", "0.62400615", "0.62383354", "0.61690...
0.6177142
20
Sets property name to value within this object.
def set_property(self, name, value): self.properties[name] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def property_name(self, name: str) -> None:\n name = str(name)\n if len(name) > 100:\n name = name[:100]\n self.prop_name = name", "def SetProp(self, name, value):\n self._props[name] = value\n self._changed(name, value)", "def __set_name__(self, owner, name):\n ...
[ "0.79168975", "0.7598371", "0.72943556", "0.72283274", "0.71225065", "0.71225065", "0.70328784", "0.7030362", "0.7017714", "0.69955844", "0.696906", "0.696906", "0.69299436", "0.6912827", "0.6912827", "0.6912827", "0.6912827", "0.68866163", "0.68515533", "0.68403906", "0.6840...
0.80712193
0
Returns the string representation of this metadata object.
def __str__(self): return self.properties.__str__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return self._metadata.__str__()", "def __repr__(self):\n\n return self._metadata.__str__()", "def __repr__(self):\n return self._metadata.__str__()", "def __str__(self):\n if self._metadata is None:\n return \"None\"\n return self._metadata._...
[ "0.8787842", "0.87714094", "0.8768259", "0.82760817", "0.7783678", "0.77387977", "0.7612537", "0.75527215", "0.7523326", "0.7522495", "0.7499132", "0.74831504", "0.74831504", "0.74831504", "0.74831504", "0.74831504", "0.74831504", "0.74831504", "0.74831504", "0.74831504", "0....
0.0
-1
Recall metric. Only computes a batchwise average of recall. Computes the recall, a metric for multilabel classification of how many relevant items are selected.
def recall(y_true, y_pred): true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) possible_positives = K.sum(K.round(K.clip(y_true, 0, 1))) recall = true_positives / (possible_positives + K.epsilon()) return recall
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recall(y_true, y_pred, average, labels):\n\n y_true, y_pred = check_metric_args(y_true, y_pred, average, labels)\n\n result = None\n\n m = len(y_true)\n n = len(labels)\n\n confusion_matrix = get_confusion_matrix(y_true, y_pred, labels).T\n\n if average == \"micro\":\n numerator = np.t...
[ "0.7605524", "0.74488467", "0.7404089", "0.7280915", "0.72097343", "0.7165874", "0.7157609", "0.71317255", "0.71007556", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "0.70970625", "...
0.7145226
12
Precision metric. Only computes a batchwise average of precision. Computes the precision, a metric for multilabel classification of how many selected items are relevant.
def precision(y_true, y_pred): true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1))) precision = true_positives / (predicted_positives + K.epsilon()) return precision
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self):\n self.overall_precision = precision_score(\n self.y_true, self.y_pred, average = self.average_type).round(self.digits_count_fp)\n self.classes_precision = precision_score(\n self.y_true, self.y_pred, average = None).round(self.digits_count_fp)", "def comp...
[ "0.74900967", "0.7288859", "0.7159218", "0.7153579", "0.70662117", "0.69847554", "0.6965742", "0.6954851", "0.6912859", "0.68327844", "0.68182683", "0.68097574", "0.67860276", "0.67579675", "0.67579675", "0.67579675", "0.67579675", "0.67579675", "0.67579675", "0.67579675", "0...
0.68053275
16
Recall metric. Only computes a batchwise average of recall. Computes the recall, a metric for multilabel classification of how many relevant items are selected.
def recall(y_true, y_pred): true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) possible_positives = K.sum(K.round(K.clip(y_true, 0, 1))) recall = true_positives / (possible_positives + K.epsilon()) return recall
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recall(y_true, y_pred, average, labels):\n\n y_true, y_pred = check_metric_args(y_true, y_pred, average, labels)\n\n result = None\n\n m = len(y_true)\n n = len(labels)\n\n confusion_matrix = get_confusion_matrix(y_true, y_pred, labels).T\n\n if average == \"micro\":\n numerator = np.t...
[ "0.76044506", "0.74481285", "0.74049824", "0.7280345", "0.7208418", "0.71655464", "0.7157273", "0.7131389", "0.710048", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0.70967406", "0...
0.7144908
9
Precision metric. Only computes a batchwise average of precision. Computes the precision, a metric for multilabel classification of how many selected items are relevant.
def precision(y_true, y_pred): true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1))) precision = true_positives / (predicted_positives + K.epsilon()) return precision
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self):\n self.overall_precision = precision_score(\n self.y_true, self.y_pred, average = self.average_type).round(self.digits_count_fp)\n self.classes_precision = precision_score(\n self.y_true, self.y_pred, average = None).round(self.digits_count_fp)", "def comp...
[ "0.7490921", "0.72890615", "0.7158933", "0.7153277", "0.7066191", "0.698819", "0.696778", "0.69555235", "0.691368", "0.6834697", "0.6818974", "0.6810516", "0.6786765", "0.6758681", "0.6758681", "0.6758681", "0.6758681", "0.6758681", "0.6758681", "0.6758681", "0.6758681", "0...
0.68061554
17