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
Retrieves a budget by it's name.
def get_budget_by_name(self, budget_name): return next((budget for budget in self.budgets if budget.name.lower() == budget_name.lower()), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_budget(self, category: BudgetCategory) -> Budget:\n return self.budgets.get(category, None)", "def budget_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"budget_name\")", "def budget_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"budget_name\")", "def ...
[ "0.706626", "0.64191616", "0.6303104", "0.62962496", "0.620454", "0.61935306", "0.6137747", "0.60905915", "0.6054097", "0.59843105", "0.5922025", "0.58307767", "0.58259296", "0.58087724", "0.57956046", "0.572861", "0.57033616", "0.56857437", "0.56660295", "0.5643141", "0.5619...
0.780844
0
Retrieves an account by name.
def get_account_by_name(self, name): return next((account for account in self.accounts if account.name.lower() == name.lower()), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_account(self, name):\n return self._accounts[name]", "def get_account_by_name(self, account_name):\n accounts = self.service_old.management().accounts().list().execute()\n\n account = None\n if accounts.get('items'):\n account = next(acnt for acnt in accounts.get('i...
[ "0.8830579", "0.83270174", "0.8000892", "0.74607736", "0.72932994", "0.726804", "0.72573507", "0.708148", "0.7037133", "0.70253366", "0.6971171", "0.69506", "0.68968415", "0.68394804", "0.6815473", "0.6803944", "0.6693384", "0.66860455", "0.6655099", "0.66455233", "0.6634644"...
0.7981468
3
Retrieves an account by id.
def get_account_by_id(self, id_): return next((account for account in self.accounts if account.id == id_), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, account_id):\n self.client.get_account(account_id)", "def account(self, account_id: str):\n return get_from_list(self.accounts, \"id\", account_id)", "def get_by_id(self, id):\n accts = [acct for acct in self.accounts if UUID(acct.uuid) == UUID(id)]\n assert len(accts)...
[ "0.85057026", "0.8046133", "0.80159926", "0.77092636", "0.7441431", "0.7214885", "0.71825635", "0.695807", "0.6862477", "0.6851463", "0.68424577", "0.6825068", "0.6781716", "0.67680484", "0.67679286", "0.67388105", "0.67003375", "0.66639", "0.6656039", "0.6594905", "0.6594905...
0.8205475
1
Perform checks on the input to verify if it is a 2D array.
def check_array_2D(X, coerce_to_numpy=True): X = check_is_numpy_or_pd(X) if X.ndim != 2: raise ValueError( "If passed as a np.array, X must be a 2-dimensional " "array, but found shape: {}".format(X.shape) ) if X.size == 0: raise ValueError( "Input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assert_2d(field):\n assert len(np.shape(field))==2, \"Variable fields must be a 2D array\"", "def _is_1d_varray(arr):\r\n return len(arr.shape) < 2 or arr.shape[1] == 1", "def check_dims(self, data):\n if np.ndim(data) != 2:\n raise ValueError('Input data must be a two dimensional numpy arra...
[ "0.71005905", "0.69650626", "0.6703832", "0.6625217", "0.65377355", "0.6529872", "0.649487", "0.6482053", "0.64297146", "0.6396857", "0.63929975", "0.6344132", "0.63248277", "0.6323379", "0.62511396", "0.6244798", "0.6239556", "0.6223183", "0.62096924", "0.6197312", "0.612994...
0.676687
2
Perform checks on the input to verify if it is a 1D array.
def check_array_1D(X): X = check_is_numpy(X) if X.ndim != 1: raise ValueError( "If passed as a np.array, X must be a 1-dimensional " "array, but found shape: {}".format(X.shape) ) if X.size == 0: raise ValueError( "Input is empty or have a dimensio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_1d_varray(arr):\r\n return len(arr.shape) < 2 or arr.shape[1] == 1", "def really1d(arr):\n if np.ndim(arr) != 1:\n return False\n # Empty list or array\n if len(arr) == 0:\n return True\n if np.any(np.vectorize(np.ndim)(arr)):\n return False\n return True", "def _...
[ "0.7698546", "0.7488992", "0.72062767", "0.71607864", "0.6909689", "0.6903243", "0.68705815", "0.6850124", "0.679779", "0.67955005", "0.679077", "0.6640027", "0.65919256", "0.655836", "0.65150076", "0.64964354", "0.6397969", "0.63680977", "0.6367404", "0.6340364", "0.6299828"...
0.77224666
0
Check if the input is a numpy array or a pandas DataFrame, else raise an error
def check_is_numpy_or_pd(X): if isinstance(X, list): return np.asarray(X) if isinstance(X, pd.DataFrame): return X if isinstance(X, np.ndarray): return X raise ValueError( "Expected an pandas DataFrame or numpy array or python list as input " "but got {}".for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_X(X):\n if not isinstance(X, pd.DataFrame):\n raise ValueError(\"X should be a dataframe.\")", "def _validate_X(X):\n return X if not isinstance(X, pd.DataFrame) else X.as_matrix()", "def check_type(df: pd.DataFrame, input_output=\"\") -> Tuple[bool, str]:\n\n error_st...
[ "0.71408993", "0.7072828", "0.69458216", "0.68126386", "0.6798002", "0.67935014", "0.6777558", "0.67514414", "0.67275465", "0.6705296", "0.65898836", "0.6583079", "0.65720433", "0.6562569", "0.65579855", "0.65548074", "0.65045965", "0.6502233", "0.64237076", "0.63909084", "0....
0.79942846
0
Creates (if needed) and returns the Client's requests Session.
def _session(self): if self.session is None: self.session = create_session(self.config, self.auth) return self.session
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_session():\n return requests.Session()", "def request_session(self):\n if not hasattr(self, \"_request_session\"):\n rqsid = self.shared_vars.pop(\"rqsid\", \"\")\n rqses = self.request_session_manager.pop_request_session(rqsid)\n\n if not rqses:\n ...
[ "0.76924175", "0.76241237", "0.7604195", "0.7571882", "0.73913896", "0.7379866", "0.7373015", "0.73705524", "0.73639715", "0.72817045", "0.7156619", "0.71295357", "0.7121416", "0.71112204", "0.7110887", "0.7092519", "0.70909566", "0.70793873", "0.70648867", "0.7033782", "0.69...
0.70735246
18
Retrieve a job's final json output. Harmony jobs' output is built as the job is processed and this method fetches the complete and final output.
def result_json(self, job_id: str, show_progress: bool = False) -> str: self.wait_for_processing(job_id, show_progress) response = self._session().get(self._status_url(job_id)) return response.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_output(self, job_id):\n\n url = self.base_url + \"/ml-service/phoenix-ml/output/findBy?jobId={0}\".format(job_id)\n headers = {\"ApiKey\": self.api_key}\n response = requests.get(url=url, headers=headers)\n return response.json()", "def completed_job_info(self, jobid=None, out...
[ "0.71807855", "0.690143", "0.68356824", "0.6665369", "0.6648154", "0.6619585", "0.6507131", "0.64307845", "0.6260368", "0.62071764", "0.6182991", "0.61760044", "0.60485405", "0.604751", "0.59525454", "0.59492403", "0.58878434", "0.5886178", "0.5851134", "0.5847965", "0.584644...
0.6154007
12
Return the image, label pair at index `idx` from `self.df_obs`
def __getitem__(self, idx): fpath_image = self.df_obs.loc[idx, 'fpath_image'] image = imageio.imread(fpath_image) if image.ndim == 2: image = np.expand_dims(image, -1) image = np.concatenate((image, image, image), axis=-1) n_channels = image.shape[-1] ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, idx):\n\n img = self.images[idx]\n label = self.labels[idx]\n\n return img, label", "def __getitem__(self, idx):\n img = self.images[idx]\n label = self.labels[idx].split(\" \")[-1]\n img = Image.open(img)\n img = img.convert('RGB')\n ...
[ "0.76747495", "0.7579456", "0.753019", "0.732403", "0.7305971", "0.72952896", "0.7277243", "0.71600974", "0.7156724", "0.7089107", "0.7054086", "0.704039", "0.6995185", "0.67779094", "0.6774318", "0.6745292", "0.6636264", "0.6594403", "0.65527", "0.6536372", "0.6517548", "0...
0.74330467
3
This function returns the examples in the raw (text) form.
def _generate_examples(self, source_file, target_file): with epath.Path(source_file).open() as f: source_sentences = f.read().split("\n") with epath.Path(target_file).open() as f: target_sentences = f.read().split("\n") assert len(target_sentences) == len( source_sentences ), "Sizes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_examples():\n # Get the tjson test cases from a url.\n examples = urlopen(TJSON_EXAMPLES_URL).read()\n\n # Strip comments from the lines.\n examples = re.sub(r\"^#.*\\n?\", \"\", examples.decode(), flags=re.MULTILINE)\n\n # Split a group of examples.\n delimiter = re.escape(EXAMPLES_DELIM...
[ "0.6475851", "0.64643687", "0.6314795", "0.6241491", "0.61601883", "0.5979994", "0.59604007", "0.59122866", "0.5801395", "0.57639563", "0.5722876", "0.57057697", "0.5699199", "0.56715703", "0.56442004", "0.56433356", "0.56305236", "0.56274277", "0.56175506", "0.5615394", "0.5...
0.0
-1
Creates a `NessieDemoIcebergSpark` instance for respectively using the given `NessieDemo` instance.
def __init__(self: "NessieDemoIcebergSpark", demo: NessieDemo) -> None: super().__init__(demo)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iceberg_spark_for_demo(demo: NessieDemo, nessie_ref: str = \"main\", catalog_name: str = \"nessie\") -> Tuple:\n global __NESSIE_ICEBERG_SPARK_DEMO__\n iceberg_dispose()\n\n demo_spark = NessieDemoIcebergSpark(demo)\n __NESSIE_ICEBERG_SPARK_DEMO__ = demo_spark\n spark, sc, jvm = demo_spark.get_o...
[ "0.78666717", "0.7046439", "0.5975695", "0.5418034", "0.5336136", "0.5267122", "0.5163858", "0.51562774", "0.501861", "0.5007134", "0.4962615", "0.48744845", "0.48500746", "0.4811485", "0.48107082", "0.47964728", "0.47869912", "0.47869912", "0.47869912", "0.47869912", "0.4773...
0.7504118
1
Retrieve a new `SparkSession` ready to use against the given Nessie reference.
def session_for_ref(self: "NessieDemoIcebergSpark", nessie_ref: str, catalog_name: str = "nessie") -> SparkSession: new_session = self._get_spark().newSession() new_session.conf.set("spark.sql.catalog.{}.ref".format(catalog_name), nessie_ref) # Required with Spark 3.1 self._get_jvm().Sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_sparksession():\n return SparkSession.builder.\\\n appName(\"Transforming the historical parking occupancy and blockface datasets\").\\\n getOrCreate()", "def getOrCreate(self) -> \"SparkSession\":\n return SparkSession(connectionString=self._options[\"spark.connect...
[ "0.76935613", "0.7513328", "0.74954414", "0.7109321", "0.6974677", "0.6918301", "0.6772764", "0.67663306", "0.67663306", "0.67663306", "0.67663306", "0.67663306", "0.67663306", "0.67663306", "0.67663306", "0.67663306", "0.67654485", "0.67136145", "0.6672373", "0.6672373", "0....
0.83516836
0
Get the size of the file in bytes.
def file_size(self, file_id: int): file_path = self._path_to_file(file_id) return os.path.getsize(file_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_size():\n return os.path.getsize(FILE_NAME)", "def get_file_size(self) -> int:\n return self.get_main_information()['FileSize']", "def get_file_size(self):\n try:\n return os.path.getsize(self.get_full_path())\n except Exception as e:\n raise SystemExit(f\...
[ "0.8713398", "0.86759555", "0.84889144", "0.8453805", "0.84355533", "0.84318584", "0.8421155", "0.8421155", "0.8421155", "0.839718", "0.83593726", "0.8343795", "0.83044547", "0.82076555", "0.8176371", "0.81734616", "0.8157777", "0.81293523", "0.81271386", "0.8096446", "0.8096...
0.8317091
12
Compute the padding necessary to ensure that convolving `X` with a 2D kernel of shape `kernel_shape` and stride `stride` produces outputs with dimension `out_dim`.
def calc_pad_dims_2D(X_shape, out_dim, kernel_shape, stride, dilation=0): if not isinstance(X_shape, tuple): raise ValueError("`X_shape` must be of type tuple") if not isinstance(out_dim, tuple): raise ValueError("`out_dim` must be of type tuple") if not isinstance(kernel_shape, tuple): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_pad_dims_2D(X_shape, out_dim, kernel_shape, stride, dilation=0):\n\tif not isinstance(X_shape, tuple):\n\t\traise ValueError(\"X_shape must be of type tuple\")\n\n\tif not isinstance(out_dim, tuple):\n\t\traise ValueError(\"out_dim must be of type tuple\")\n\n\tif not isinstance(kernel_shape, tuple):\n\t\...
[ "0.81986886", "0.7532539", "0.74973726", "0.7388001", "0.729293", "0.72401816", "0.723601", "0.7220916", "0.7214507", "0.7152324", "0.71220547", "0.7115546", "0.71074986", "0.70821416", "0.70644873", "0.7061221", "0.7060554", "0.6974441", "0.69609404", "0.6775567", "0.6756186...
0.82422155
0
Returns new trie node (initialized to NULLs)
def getNode(self,ch=None): return TrieNode.TrieNode(ch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_new_node(self):\n return TrieNode()", "def get_node():\n return TrieNode()", "def __init__(self):\n self.root = self.TrieNode(None)", "def __init__(self):\n self.root = self.TrieNode(0)", "def __init__(self):\n self.root = TrieNode(None)", "def __init__(self):\n ...
[ "0.81809986", "0.7551495", "0.7275593", "0.7268437", "0.7243274", "0.7243274", "0.71221846", "0.71181005", "0.7102078", "0.7102078", "0.70563614", "0.704127", "0.702135", "0.70054436", "0.70054436", "0.70054436", "0.70054436", "0.70054436", "0.70054436", "0.70054436", "0.7005...
0.68762463
37
If not present, inserts key into trie. If the key is prefix of trie node, just marks leaf node
def insert(self,key): current_node = self.root length = len(key) for level in range(length): index = self._charToIndex(key[level]) # if current character is not present if not current_node.children[index]: current_node.children[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, prefix: str):\n leaf = self.root\n for level in range(len(prefix)):\n letter = prefix[level]\n\n # if current character is not present\n if letter not in leaf.children:\n leaf.children[letter] = self.get_node()\n leaf = leaf....
[ "0.71453977", "0.7064039", "0.68622494", "0.67446196", "0.67431754", "0.6725342", "0.6699936", "0.669589", "0.66851294", "0.6589957", "0.6575593", "0.6560076", "0.6551769", "0.6535079", "0.65027606", "0.64681464", "0.64571095", "0.6438825", "0.64115334", "0.63948715", "0.6371...
0.7433289
0
Intersect two gensim word2vec models, m1 and m2. Only the shared vocabulary between them is kept. If 'words' is set (as list or set), then the vocabulary is intersected with this list as well. Indices are reorganized from 0..N in order of descending frequency (=sum of counts from both m1 and m2).
def intersection_align_gensim(m1,m2, words=None): # Get the vocab for each model vocab_m1 = set(m1.wv.vocab.keys()) vocab_m2 = set(m2.wv.vocab.keys()) # Find the common vocabulary common_vocab = vocab_m1&vocab_m2 if words: common_vocab&=set(words) # If no alignment necessary because vocab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shared_words_from_filenames(filename1, filename2):\r\n\r\n \"\"\"\r\n filename1 = tokenize(text1)\r\n filename2 = tokenize(text2)\r\n\r\n list3 = set(filename1) & set(filename2)\r\n\r\n return list3\r\n\r\n \"\"\"\r\n with open(filename1, encoding=\"utf8\") as f1, open(filename2, encoding=...
[ "0.6246066", "0.6141584", "0.61194766", "0.6065606", "0.6046039", "0.5986322", "0.59663814", "0.59586346", "0.58720237", "0.5860314", "0.5829514", "0.58064556", "0.57751614", "0.5772775", "0.5762234", "0.5758061", "0.5658297", "0.565061", "0.5599733", "0.55901426", "0.5572634...
0.8189434
0
Set the numeric values ready so they won't be calculated at each call.
def compile_palette(palette_list): global _COMPILED_PALETTE _COMPILED_PALETTE = {} for color in palette_list: r_sum = math.fabs(color[0] ** _MAGNITUDE) g_sum = math.fabs(color[1] ** _MAGNITUDE) b_sum = math.fabs(color[2] ** _MAGNITUDE) _COMPILED_PALETTE[color] = [r_sum, g_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setVals(self, num_iter=0, notify=0, block=0):\n self.num_iter = num_iter\n self.notify = notify\n self.block = block", "def _setVals(self, *args, **kwargs):\n pass", "def initRunningVals(self):\n self.r_Vm = [0.0]*self.mirror.dataPoints\n self.r_Va = [0.0]*self.mi...
[ "0.6365631", "0.632594", "0.61898035", "0.61163193", "0.60714287", "0.6035595", "0.6035595", "0.6035595", "0.6035595", "0.6035595", "0.6035595", "0.59274584", "0.5804162", "0.57950246", "0.57915634", "0.57725346", "0.5768607", "0.57199395", "0.57097894", "0.57049644", "0.5685...
0.0
-1
Return the leg length associated with coordinates.
def leg_length(self, *args): i, j = args return Partition(list(self)).leg_length(i-1, j-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_length(self):\n return math.sqrt(self.x**2 + self.y**2)", "def getLength(self):\n return self.geometry.length", "def Lengths(self):\n\n self.__do_essential_memebers_exist__()\n\n if self.element_type == \"line\":\n coords = self.points[self.elements[:,:2],:]\n ...
[ "0.7222639", "0.7089205", "0.70779127", "0.6912638", "0.69035447", "0.68838316", "0.68726116", "0.6866607", "0.68432814", "0.6822645", "0.6799953", "0.6777075", "0.6772758", "0.6734626", "0.6650385", "0.6633613", "0.66294783", "0.66228837", "0.6619804", "0.6573648", "0.657311...
0.73972917
0
Compare the dominance ordering on two partitions.
def compare_dominance(parta, partb): if list(parta) == list(partb): return '==' if parta.degree() != partb.degree(): return 'Non-comparable' else: out = _compare_tuples(tuple(parta), tuple(partb)) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_dominance(left, right):\n left_pair = left._partition_pair\n right_pair = right._partition_pair\n if list(left) == list(right):\n out = \"==\"\n elif left.sector() == right.sector():\n if all([x >= y for x, y in zip(left_pair, right_pair)]):\n ...
[ "0.7113481", "0.61792016", "0.6103742", "0.60673255", "0.5988337", "0.57884496", "0.5781072", "0.5717397", "0.5668712", "0.5632318", "0.5632074", "0.5627496", "0.5609088", "0.56011724", "0.5592674", "0.5575235", "0.5536712", "0.5522756", "0.5517537", "0.5507234", "0.5503065",...
0.7000569
1
If there is a change in the field, this method assures that if the field is type of TenantForeignKey and db_constraint does not exist, adds the foreign key constraint.
def _alter_field( self, model, old_field, new_field, old_type, new_type, old_db_params, new_db_params, strict=False, ): super()._alter_field( model, old_field, new_field, old_type, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_fk_sql(self, model, field, suffix):\n if isinstance(field, TenantForeignKey):\n try:\n # test if both models exists\n # This case happens when we are running from scratch migrations and one model was removed from code\n # In the previous mi...
[ "0.5806441", "0.57861465", "0.5465204", "0.542271", "0.5379888", "0.5236703", "0.51606286", "0.5093874", "0.5053542", "0.50442356", "0.5035095", "0.49990463", "0.49948144", "0.49032623", "0.4878623", "0.48716143", "0.48655212", "0.48591134", "0.48537186", "0.4823321", "0.4755...
0.6515081
0
Set this entity from a dictionary
def from_dict(self, dictionary: dict): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls: T, source: dict[str, Any], connection: Connection) -> T:\n return super(Entity, cls).from_dict(source=source, connection=connection)", "def load_from_dict(self, dict_):\n for key, value in six.iteritems(dict_):\n setattr(self, util.as_attr(key), value)\n self._c...
[ "0.73082095", "0.7287774", "0.69010705", "0.6888975", "0.68440866", "0.6806164", "0.67045105", "0.6625885", "0.6621233", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255", "0.6570255",...
0.67995626
6
Return data array as dask DataFrame and calculate temperature bins. Thins property will yield a dask.dataframe that contain the `self.data_array` data with the temperature bining and latitudinal grid areas per each row. The bining can be either daily, by default, or use a window set by `self.moving_window_size`. This p...
def data_array_dask_df(self): # Metadata for group by operation in dask.dd.groupby meta = pd.DataFrame({ 'time': pd.Series([], dtype='<M8[ns]'), 'lat': pd.Series([], dtype='float'), 'lon': pd.Series([], dtype='float'), 't2m': pd.Series([], dtype='float'),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _bucket_builder_ddf(self, ddf):\n\n bins_left = np.vectorize(lambda x: x.left)\n min_val = np.floor(ddf[self.temp_var].min())\n max_val = np.ceil(ddf[self.temp_var].max())\n offset_scale = max_val + 2\n\n buckets = np.arange(min_val,\n max_val + off...
[ "0.6105765", "0.58133256", "0.56154", "0.5490922", "0.5263622", "0.5171621", "0.511683", "0.508883", "0.5064058", "0.4987925", "0.49770904", "0.4965427", "0.49502873", "0.49261674", "0.4914605", "0.49137223", "0.48912856", "0.48788884", "0.48759356", "0.4872126", "0.48355904"...
0.7132676
0
Yield n number of striped chunks from l.
def chunks(l, n): for i in range(0, n): yield l[i::n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def chunks(self, l, n):\n yield l[:n-1]\n for i in range(n-1, len(l), n):\n yield ...
[ "0.8433824", "0.83154076", "0.824434", "0.82421774", "0.8219455", "0.82187474", "0.82034206", "0.8176609", "0.81680846", "0.8159051", "0.8158373", "0.8140583", "0.8138037", "0.8138037", "0.8126006", "0.81255215", "0.8124897", "0.8124897", "0.8124897", "0.81104285", "0.8110428...
0.83030415
2
Test to verify ``GET /v2.0//flavors/details`` returns consistent data on mutiple list calls
def test_get_flavor_list_with_details_is_consistent(self): get_flavor_list_response_body = self.get_server_flavor('/flavors/detail') get_flavor_list2_response_body = self.get_server_flavor('/flavors/detail') self.assertEqual(get_flavor_list_response_body, get_flavor_list2_response_body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_flavors_with_detail(self):\n response = self.flavors_client.list_flavors_with_detail()\n flavors = response.entity\n self.assertTrue(len(flavors) > 0)\n response = self.flavors_client.get_flavor_details(self.flavor_ref)\n flavor = response.entity\n self.asser...
[ "0.8270098", "0.7830099", "0.7594357", "0.73318124", "0.7186425", "0.7034954", "0.69893026", "0.6637412", "0.6546028", "0.65092885", "0.6347391", "0.6345013", "0.63160855", "0.6220414", "0.6207176", "0.61758065", "0.6172498", "0.6148137", "0.6130457", "0.61295813", "0.6110632...
0.8313561
0
Returns if the word is in the trie.
def search(self, word: str) -> bool: #start from the root node = self.root for char in word: if char in node.child: node = node.child.get(char) else: return False return node.isWord
{ "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.8386823", "0.81510955", "0.81230164", "0.7856358", "0.7830011", "0.77931386", "0.7792269", "0.7764405", "0.7752762", "0.7746937", "0.7710187", "0.7681166", "0.76761425", "0.76636624", "0.7649853", "0.7633719", "0.7627433", "0.7610955", "0.7568698", "0.7561647", "0.7559332"...
0.75764817
18
Calculates a normal that occurs on the given world point.
def normal_at(self, world_point: Point) -> Vector: # Convert the world point and normal to shape space local_point = self.world_to_object(world_point) # Calculate the normal in shape space local_normal = self.local_normal_at(local_point) # Convert the local normal vector back to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normal(self, point):\n point = self._center - np.array(point)\n # if abs(point.dot(point) - self._radius**2) > 1e-15:\n # raise RayTraceError(\n # 'Cannot compute normal. Point is too far from surface ({}).'.format(\n # (abs(point.dot(point) - self._radius**2))))\n return normal...
[ "0.74461645", "0.7301533", "0.7081921", "0.6956634", "0.6826198", "0.67930174", "0.6699974", "0.66936934", "0.6618894", "0.65768117", "0.6562253", "0.65425366", "0.6524042", "0.6434071", "0.6426089", "0.6412149", "0.63797605", "0.63491946", "0.6303255", "0.6284604", "0.623368...
0.8551858
0
Checks if the cellphone number format is followed (PH cellphone number format)
def _check_with_cp_no_format(self, field, value): if not self._is_valid_cp_format(value): self._error(field, "Invalid cellphone number format.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_phonenumber(number):\n\n phonenum = re.compile(r'^(\\d{3})-(\\d{3})-(\\d{4})$')\n if phonenum.match(number) is None:\n return False\n else:\n return True", "def check_as_htk_phone(phone):\n try:\n phone = str(phone)\n except UnicodeEncodeError:\n ...
[ "0.7052887", "0.6900616", "0.6753916", "0.6724298", "0.6689213", "0.6641046", "0.6425795", "0.6347832", "0.6340494", "0.6310554", "0.629106", "0.6277518", "0.62692577", "0.6226981", "0.62143904", "0.6192978", "0.6181709", "0.616418", "0.61340564", "0.61099076", "0.61007357", ...
0.6497339
6
adds a unique id as a column to the original csv file and return a new csv file
def add_unique_id(filename, newfilename,idname): with open(filename, "rb") as infile, open(newfilename, "wb") as outfile: reader = csv.reader(infile) writer = csv.writer(outfile, delimiter=',') writer.writerow([idname] + next(reader)) writer.writerows([i] + row for i, row in enu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_uid(filename, columns, outfilename):\n timer = time.time()\n print(f\"read file: {filename}\")\n df = pd.read_csv(filename)\n print(f\"timer - read file: {time.time() - timer}\")\n\n timer = time.time()\n print(f\"add uid to columns {columns}\")\n df['uid'] = df[columns].apply(uid, axi...
[ "0.6706085", "0.65950257", "0.65024155", "0.6336273", "0.62371033", "0.6219642", "0.6199829", "0.6147044", "0.6139055", "0.608688", "0.60177755", "0.59496105", "0.5949507", "0.59152555", "0.5910327", "0.5909538", "0.58658284", "0.5864545", "0.5861242", "0.5843343", "0.5826584...
0.8212342
0
Computes the Chamfer distance for the given two point sets.
def evaluate(point_set_a: type_alias.TensorLike, point_set_b: type_alias.TensorLike, name: str = "chamfer_distance_evaluate") -> tf.Tensor: with tf.name_scope(name): point_set_a = tf.convert_to_tensor(value=point_set_a) point_set_b = tf.convert_to_tensor(value=point_set_b) shape...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hyperboloidDist(point1, point2):\n return np.arccosh(-minkowskiDot(point1, point2))", "def compute_feature_distances(features1: np.ndarray, \r\n features2: np.ndarray) -> np.ndarray:\r\n #broadcasting trick\r\n a = features1[:, np.newaxis, :]\r\n b = features2[np.newa...
[ "0.67041564", "0.6690448", "0.66194475", "0.66113436", "0.66110134", "0.66077584", "0.6577685", "0.65673256", "0.6541298", "0.6540993", "0.6537351", "0.65239114", "0.64973307", "0.6476015", "0.6464559", "0.645655", "0.6442572", "0.64412594", "0.64304644", "0.6427276", "0.6424...
0.0
-1
Return a readonly object of the current cubic parameters. These parameters are intended to be used for debug/troubleshooting purposes. These object is a readonly snapshot and cannot be used to modify the behavior of the CUBIC calculations. New parameters may be added to this object in the future.
def get_params_snapshot(self): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cubic(cls, a):\r\n return cls.from_parameters(a, a, a, 90, 90, 90)", "def getParameters(self):\n\n current_params = {'taux': self.taux, 'mu': self.mu, 'G': self.G, 'alpha_0': self.alpha_0,\n 'delta': self.delta, 'p': self.p, 'I0': self.I0, 'kparam': self.kparam}\n\n ...
[ "0.6433062", "0.5811996", "0.5800347", "0.57966", "0.5780582", "0.57785934", "0.576293", "0.5752096", "0.5696679", "0.5689174", "0.5689174", "0.5685849", "0.5653319", "0.5574322", "0.5557703", "0.553191", "0.55106175", "0.5483999", "0.5473618", "0.54625386", "0.54334885", "...
0.0
-1
This function takes in a person's name, returns the person's initials (uppercase)
def get_initials(fullname): saved_name = fullname names_listed = saved_name.split() initials = '' for name in names_listed: initials += name[0].upper() return initials
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_initials(name, force_upper=True):\r\n if force_upper:\r\n return name[0:1].upper()\r\n return name[0:1]", "def initials(full_name):\r\n\r\n if full_name is not None and len(full_name) > 0:\r\n return ''.join([s[0] for s in full_name.split(' ')]).upper()\r\n else:\r\n retu...
[ "0.85246766", "0.84204197", "0.7988124", "0.7863779", "0.7846544", "0.7661179", "0.7313029", "0.72950846", "0.72880816", "0.7186876", "0.71575546", "0.71150285", "0.70367134", "0.7011519", "0.7001904", "0.69537735", "0.69357294", "0.693159", "0.6917566", "0.6882198", "0.68794...
0.77550954
5
Returns hexstring representation of current UNIX timestamp. If no timestamp is give, the current time is used.
def hex_timestamp(timestamp=None): if not timestamp: timestamp = unix_timestamp() return hex_value(timestamp, width=8)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __timestamp():\n today = time.time()\n return struct.pack(b'=L', int(today))", "def get_current_timestamp_str(self):\n return str(time.mktime(datetime.datetime.now().timetuple()))", "def __get_unix_now(self):\n ms_now = int(time.time() * 10 ** 5)\n return hex(ms_now)[2:]", "def...
[ "0.8117221", "0.76759094", "0.7576215", "0.7488471", "0.7411012", "0.7401723", "0.73744756", "0.72493863", "0.724354", "0.7204689", "0.71766853", "0.71554315", "0.71410435", "0.71080047", "0.7104206", "0.7081689", "0.7062623", "0.7062388", "0.7057909", "0.70528424", "0.70502"...
0.79782987
1
Test default product price == 10.
def test_default_product_price(self): prod = Product('Test Product') self.assertEqual(prod.price, 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_product_price(self):\r\n prod = Product('Test Product')\r\n self.assertEqual(prod.price, 10)", "def test_default_product_price(self):\n prod = product('Test Product')\n self.assertEqual(prod.price, 10)\n self.assertEqual(prod.weight, 20)", "def test_default_p...
[ "0.8686024", "0.8598475", "0.8564952", "0.7544509", "0.72902745", "0.72873276", "0.72873276", "0.72873276", "0.72873276", "0.72873276", "0.72873276", "0.71904963", "0.70281", "0.70005506", "0.69696474", "0.6928504", "0.69180405", "0.69154555", "0.69154555", "0.68813854", "0.6...
0.868516
7
Get logger with the specified name.
def get_logger(self, name): if not isinstance(name, six.string_types): name = "{}.{}".format(name.__class__.__module__, name.__class__.__name__) return self.logger_store.setdefault(name, Logger(name=name, threshold=Logger.LOG_LEVELS[s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logger(name):\n # type: (str) -> Logger\n return logging.getLogger(name)", "def get_logger(name):\n return logging.getLogger(name)", "def get_logger(name: str) -> logging.Logger:\n \n return logging.getLogger(name)", "def get_logger(name: str) -> logging.Logger:\n\n if name ...
[ "0.88141036", "0.87537223", "0.86959535", "0.8299673", "0.8161971", "0.81472385", "0.8085568", "0.79919595", "0.79589564", "0.7904583", "0.78923213", "0.7887824", "0.78692627", "0.7862782", "0.78515685", "0.7847677", "0.7836671", "0.78191763", "0.7804547", "0.7797446", "0.778...
0.8309426
3
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, MatchOriginData): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8456063", "0.83918154", "0.8144437", "0.8140196", "0.8132038", "0.8093834", "0.80918837", "0.80918837", "0.80918837", "0.80852824", "0.80852824", "0.807626", "0.807626", "0.80657643" ]
0.0
-1
GET for a directory with an existing index.html file
def test_existing_index_file(self): # Send the request request = webhttp.message.Request() request.method = "GET" request.uri = "/test/" request.set_header("Host", "localhost:{}".format(portnr)) request.set_header("Connection", "close") self.client_socket.send(str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self):\n single = os.path.join(\n os.path.dirname(os.path.abspath(__file__)),\n 'index.html')\n return serve_file(single)", "def get(self):\n\n return send_from_directory(\"\", \"index.html\")", "def index():\n path = os.path.abspath(os.path.join(os.path....
[ "0.7235336", "0.71264994", "0.70389146", "0.7010655", "0.70105517", "0.6980362", "0.6897175", "0.6873219", "0.6870453", "0.6684015", "0.6673348", "0.6672399", "0.6642104", "0.6602078", "0.65783787", "0.65744257", "0.65153927", "0.6489955", "0.64833975", "0.6475116", "0.646765...
0.0
-1
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k): self.queue = [0]*k self.headIndex = 0 self.count = 0 self.capacity = k
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.c...
[ "0.8515974", "0.84414554", "0.84083885", "0.836347", "0.83003247", "0.8066098", "0.8065758", "0.7867472", "0.7859428", "0.7747034", "0.7680982", "0.76676327", "0.76025206", "0.7503039", "0.7386881", "0.7196421", "0.7128313", "0.6977173", "0.691416", "0.69105595", "0.68898535"...
0.84718597
1
Get the front item from the queue.
def Front(self): if self.count == 0: return -1 return self.queue[self.headIndex]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.9038855", "0.89436394", "0.8464059", "0.84272945", "0.8357966", "0.8332022", "0.8332022", "0.8322763", "0.8322763", "0.8300125", "0.82786024", "0.821795", "0.8214888", "0.8210065", "0.82068515", "0.8168327", "0.81299424", "0.81290627", "0.80782723", "0.7994594", "0.7991425...
0.8214248
13
Get the last item from the queue.
def Rear(self): # empty queue if self.count == 0: return -1 return self.queue[(self.headIndex + self.count - 1) % self.capacity]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.6884677
93
Checks whether the circular queue is empty or not.
def isEmpty(self): return self.count == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84918785", "0.84607804", "0.8429387", "0.8429387", "0.83951026", "0.82831895", "0.8246613", "0.82329935", "0.8193397", "0.8184179", "0.81770307", "0.8163974", "0.81180215", "0.8102001", "0.80947953", "0.8042463", "0.79564434", "0.7913296", "0.7909012", "0.7909012", "0.7901...
0.0
-1
Checks whether the circular queue is full or not.
def isFull(self): return self.count == self.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.8474649", "0.82988197", "0.78824", "0.7835387", "0.7824154", "0.7823803", "0.7823803", "0.76284957", "0.7610079", "0.7609874", "0.7586084", "0.75775087", "0.7530568", "0.7525677", "0.74904674", "0.7479177", "0.74726564", "0.7450254", "0.74485844", "0.7435313", "0.7421137",...
0.71919906
37
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k): self.capacity = k self.head = None self.tail = None self.count = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.85158086", "0.8471613", "0.8441174", "0.8407862", "0.83635837", "0.8300639", "0.8066356", "0.806578", "0.7867966", "0.7860277", "0.7680682", "0.7668274", "0.7602642", "0.75033516", "0.73869616", "0.71954906", "0.7129148", "0.6975911", "0.69134945", "0.6910839", "0.6890201"...
0.77467805
10
Get the front item from the queue.
def Front(self): if self.count == 0: return -1 return self.head.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.9038855", "0.89436394", "0.8464059", "0.84272945", "0.8357966", "0.8332022", "0.8332022", "0.8322763", "0.8322763", "0.8300125", "0.82786024", "0.821795", "0.8214888", "0.8214248", "0.8210065", "0.82068515", "0.8168327", "0.81299424", "0.81290627", "0.80782723", "0.7994594...
0.0
-1
Get the last item from the queue.
def Rear(self): # empty queue if self.count == 0: return -1 return self.tail.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.7040789
67
Checks whether the circular queue is empty or not.
def isEmpty(self): return self.count == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84918785", "0.84607804", "0.8429387", "0.8429387", "0.83951026", "0.82831895", "0.8246613", "0.82329935", "0.8193397", "0.8184179", "0.81770307", "0.8163974", "0.81180215", "0.8102001", "0.80947953", "0.8042463", "0.79564434", "0.7913296", "0.7909012", "0.7909012", "0.7901...
0.0
-1
Checks whether the circular queue is full or not.
def isFull(self): return self.count == self.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.84751034", "0.8299797", "0.78827924", "0.78358734", "0.782498", "0.782426", "0.782426", "0.7629194", "0.76109856", "0.76109785", "0.75850576", "0.7578127", "0.7531097", "0.7526271", "0.7490314", "0.7479896", "0.747371", "0.74505204", "0.7448315", "0.7435628", "0.7421604", ...
0.71926147
38
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k: int): self.queue = [0]*k self.headIndex = 0 self.count = 0 self.capacity = k
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.85158086", "0.8471613", "0.8407862", "0.83635837", "0.8300639", "0.8066356", "0.806578", "0.7867966", "0.7860277", "0.77467805", "0.7680682", "0.7668274", "0.7602642", "0.75033516", "0.73869616", "0.71954906", "0.7129148", "0.6975911", "0.69134945", "0.6910839", "0.6890201...
0.8441174
2
Get the front item from the queue.
def Front(self) -> int: if self.count == 0: return -1 return self.queue[self.headIndex]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.90385115", "0.89434814", "0.846308", "0.8426328", "0.8357853", "0.83309764", "0.83309764", "0.83211964", "0.83211964", "0.82988536", "0.8279939", "0.8216258", "0.8213497", "0.8213348", "0.8209029", "0.8205413", "0.81683636", "0.812805", "0.81277895", "0.8076473", "0.799508...
0.76550514
37
Get the last item from the queue.
def Rear(self) -> int: # empty queue if self.count == 0: return -1 return self.queue[(self.headIndex + self.count - 1) % self.capacity]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.0
-1
Checks whether the circular queue is empty or not.
def isEmpty(self) -> bool: return self.count == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84921926", "0.846136", "0.84301", "0.84301", "0.8395741", "0.8283515", "0.8247131", "0.8233042", "0.81939346", "0.818437", "0.81774354", "0.8164895", "0.811857", "0.81024665", "0.8095394", "0.804304", "0.7957086", "0.7912862", "0.79094785", "0.79094785", "0.7901324", "0....
0.0
-1
Checks whether the circular queue is full or not.
def isFull(self) -> bool: return self.count == self.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.84751034", "0.8299797", "0.78827924", "0.78358734", "0.782498", "0.782426", "0.782426", "0.7629194", "0.76109856", "0.76109785", "0.75850576", "0.7578127", "0.7531097", "0.7526271", "0.7490314", "0.7479896", "0.747371", "0.74505204", "0.7448315", "0.7435628", "0.7421604", ...
0.7319979
27
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k: int): self.queue = [0]*k self.headIndex = 0 self.count = 0 self.capacity = k # the additional attribute to protect the access of our queue self.queueLock = Lock()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.8515974", "0.84718597", "0.84414554", "0.836347", "0.83003247", "0.8066098", "0.8065758", "0.7867472", "0.7859428", "0.7747034", "0.7680982", "0.76676327", "0.76025206", "0.7503039", "0.7386881", "0.7196421", "0.7128313", "0.6977173", "0.691416", "0.69105595", "0.68898535"...
0.84083885
3
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k: int): self.capacity = k self.head = None self.tail = None self.count = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.85158086", "0.8471613", "0.8441174", "0.8407862", "0.83635837", "0.8300639", "0.8066356", "0.806578", "0.7867966", "0.7860277", "0.77467805", "0.7668274", "0.7602642", "0.75033516", "0.73869616", "0.71954906", "0.7129148", "0.6975911", "0.69134945", "0.6910839", "0.6890201...
0.7680682
11
Get the front item from the queue.
def Front(self) -> int: if self.count == 0: return -1 return self.head.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.9038855", "0.89436394", "0.8464059", "0.84272945", "0.8357966", "0.8332022", "0.8332022", "0.8322763", "0.8322763", "0.8300125", "0.82786024", "0.821795", "0.8214888", "0.8214248", "0.8210065", "0.82068515", "0.8168327", "0.81299424", "0.81290627", "0.80782723", "0.7994594...
0.0
-1
Get the last item from the queue.
def Rear(self) -> int: # empty queue if self.count == 0: return -1 return self.tail.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.0
-1
Checks whether the circular queue is empty or not.
def isEmpty(self) -> bool: return self.count == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84918785", "0.84607804", "0.8429387", "0.8429387", "0.83951026", "0.82831895", "0.8246613", "0.82329935", "0.8193397", "0.8184179", "0.81770307", "0.8163974", "0.81180215", "0.8102001", "0.80947953", "0.8042463", "0.79564434", "0.7913296", "0.7909012", "0.7909012", "0.7901...
0.0
-1
Checks whether the circular queue is full or not.
def isFull(self) -> bool: return self.count == self.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.84751034", "0.8299797", "0.78827924", "0.78358734", "0.782498", "0.782426", "0.782426", "0.7629194", "0.76109856", "0.76109785", "0.75850576", "0.7578127", "0.7531097", "0.7526271", "0.7490314", "0.7479896", "0.747371", "0.74505204", "0.7448315", "0.7435628", "0.7421604", ...
0.7319979
26
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k): self.queue = [""] * k self.max_length = k self.start = -1 self.end = -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.85158086", "0.8471613", "0.8441174", "0.8407862", "0.83635837", "0.8300639", "0.8066356", "0.7867966", "0.7860277", "0.77467805", "0.7680682", "0.7668274", "0.7602642", "0.75033516", "0.73869616", "0.71954906", "0.7129148", "0.6975911", "0.69134945", "0.6910839", "0.689020...
0.806578
7
Get the front item from the queue.
def Front(self): return -1 if self.isEmpty() else self.queue[self.start]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.90385115", "0.89434814", "0.846308", "0.8426328", "0.8357853", "0.83309764", "0.83309764", "0.83211964", "0.83211964", "0.82988536", "0.8279939", "0.8216258", "0.8213497", "0.8213348", "0.8209029", "0.8205413", "0.81683636", "0.81277895", "0.8076473", "0.7995084", "0.79901...
0.812805
17
Get the last item from the queue.
def Rear(self): return -1 if self.isEmpty() else self.queue[self.end]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.7131449
58
Checks whether the circular queue is empty or not.
def isEmpty(self): return self.start == -1 and self.end == -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84921926", "0.846136", "0.84301", "0.84301", "0.8395741", "0.8283515", "0.8247131", "0.8233042", "0.81939346", "0.818437", "0.81774354", "0.8164895", "0.811857", "0.81024665", "0.8095394", "0.804304", "0.7957086", "0.7912862", "0.79094785", "0.79094785", "0.7901324", "0....
0.0
-1
Checks whether the circular queue is full or not.
def isFull(self): return (self.end + 1) % self.max_length == self.start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.84751034", "0.8299797", "0.78827924", "0.78358734", "0.782498", "0.782426", "0.782426", "0.7629194", "0.76109856", "0.76109785", "0.75850576", "0.7578127", "0.7531097", "0.7526271", "0.7490314", "0.7479896", "0.747371", "0.74505204", "0.7448315", "0.7435628", "0.7421604", ...
0.0
-1
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k): self.queue = [] self.size = k self.front = 0 self.rear = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.8515974", "0.84718597", "0.84414554", "0.84083885", "0.836347", "0.8066098", "0.8065758", "0.7867472", "0.7859428", "0.7747034", "0.7680982", "0.76676327", "0.76025206", "0.7503039", "0.7386881", "0.7196421", "0.7128313", "0.6977173", "0.691416", "0.69105595", "0.68898535"...
0.83003247
5
Get the front item from the queue.
def Front(self): if self.isEmpty(): return -1 else: return self.queue[self.front]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.90385115", "0.89434814", "0.846308", "0.8426328", "0.8357853", "0.83309764", "0.83309764", "0.83211964", "0.83211964", "0.82988536", "0.8279939", "0.8216258", "0.8213497", "0.8213348", "0.8205413", "0.81683636", "0.812805", "0.81277895", "0.8076473", "0.7995084", "0.799010...
0.8209029
14
Get the last item from the queue.
def Rear(self): if self.isEmpty(): return -1 else: return self.queue[self.rear - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.71529734
53
Checks whether the circular queue is empty or not.
def isEmpty(self): return self.front == self.rear
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84921926", "0.846136", "0.84301", "0.84301", "0.8395741", "0.8283515", "0.8247131", "0.8233042", "0.81939346", "0.818437", "0.81774354", "0.8164895", "0.811857", "0.81024665", "0.8095394", "0.804304", "0.7957086", "0.7912862", "0.79094785", "0.79094785", "0.7901324", "0....
0.7412234
90
Checks whether the circular queue is full or not.
def isFull(self): return self.rear - self.front == self.size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.8474649", "0.82988197", "0.78824", "0.7835387", "0.7824154", "0.7823803", "0.7823803", "0.76284957", "0.7610079", "0.7609874", "0.7586084", "0.75775087", "0.7530568", "0.7525677", "0.74904674", "0.7479177", "0.74726564", "0.7450254", "0.7435313", "0.7421137", "0.73919505",...
0.74485844
18
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k): self.queue = [] self.size = k self.rear = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = []\n self.size = k", "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count ...
[ "0.8515974", "0.84718597", "0.84414554", "0.84083885", "0.83003247", "0.8066098", "0.8065758", "0.7867472", "0.7859428", "0.7747034", "0.7680982", "0.76676327", "0.76025206", "0.7503039", "0.7386881", "0.7196421", "0.7128313", "0.6977173", "0.691416", "0.69105595", "0.6889853...
0.836347
4
Get the front item from the queue.
def Front(self): if self.isEmpty(): return -1 else: return self.queue[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.9038855", "0.89436394", "0.8464059", "0.84272945", "0.8357966", "0.8322763", "0.8322763", "0.8300125", "0.82786024", "0.821795", "0.8214888", "0.8214248", "0.8210065", "0.82068515", "0.8168327", "0.81299424", "0.81290627", "0.80782723", "0.7994594", "0.79914254", "0.795706...
0.8332022
5
Get the last item from the queue.
def Rear(self): if self.isEmpty(): return -1 else: return self.queue[self.rear - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.76055205", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.737336...
0.71529734
54
Checks whether the circular queue is empty or not.
def isEmpty(self): return 0 == self.rear
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84918785", "0.84607804", "0.8429387", "0.8429387", "0.83951026", "0.82831895", "0.8246613", "0.82329935", "0.8193397", "0.8184179", "0.81770307", "0.8163974", "0.81180215", "0.8102001", "0.80947953", "0.8042463", "0.79564434", "0.7913296", "0.7909012", "0.7909012", "0.7901...
0.0
-1
Checks whether the circular queue is full or not.
def isFull(self): return self.rear == self.size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\n return len(self.queue) == self.size", "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(s...
[ "0.8474649", "0.82988197", "0.78824", "0.7835387", "0.7824154", "0.7823803", "0.7823803", "0.76284957", "0.7610079", "0.7609874", "0.7586084", "0.75775087", "0.7530568", "0.7525677", "0.74904674", "0.7479177", "0.74726564", "0.7450254", "0.74485844", "0.7435313", "0.7421137",...
0.7180057
39
Initialize your data structure here. Set the size of the queue to be k.
def __init__(self, k): self.queue = [] self.size = k
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, k):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n self.queue = [0]*k\n self.headIndex = 0\n self.count = 0\n self.capacity = k", "def __init__(self, k: int):\n sel...
[ "0.8471613", "0.8441174", "0.8407862", "0.83635837", "0.8300639", "0.8066356", "0.806578", "0.7867966", "0.7860277", "0.77467805", "0.7680682", "0.7668274", "0.7602642", "0.75033516", "0.73869616", "0.71954906", "0.7129148", "0.6975911", "0.69134945", "0.6910839", "0.6890201"...
0.85158086
0
Get the front item from the queue.
def Front(self): if self.isEmpty(): return -1 else: return self.queue[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def front(self):\n return self.queue[0] if not self.empty() else None", "def Front(self):\r\n if (len(self.queue) >= 1):\r\n return self.queue[0]\r\n else:\r\n return -1", "def fr...
[ "0.9038855", "0.89436394", "0.8464059", "0.84272945", "0.8357966", "0.8322763", "0.8322763", "0.8300125", "0.82786024", "0.821795", "0.8214888", "0.8214248", "0.8210065", "0.82068515", "0.8168327", "0.81299424", "0.81290627", "0.80782723", "0.7994594", "0.79914254", "0.795706...
0.8332022
6
Get the last item from the queue.
def Rear(self): if self.isEmpty(): return -1 else: return self.queue[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(self):\n if self.is_empty():\n raise ValueError('Queue is empty!')\n return self.last_node().element().value()", "def last(self):\n return self.deque[-1]", "def last_item(self):\n return self.container[self.length-1]", "def Rear(self):\r\n if (len(self.q...
[ "0.82451856", "0.80613", "0.8023248", "0.77849776", "0.7629952", "0.7628782", "0.75932163", "0.7584632", "0.75637347", "0.7543559", "0.75429386", "0.7518005", "0.7494505", "0.746898", "0.7461607", "0.74455327", "0.73941535", "0.73889613", "0.73865324", "0.7373363", "0.7349888...
0.76055205
6
Checks whether the circular queue is empty or not.
def isEmpty(self): return 0 == len(self.queue)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.84918785", "0.84607804", "0.8429387", "0.8429387", "0.83951026", "0.8246613", "0.82329935", "0.8193397", "0.8184179", "0.81770307", "0.8163974", "0.81180215", "0.8102001", "0.80947953", "0.8042463", "0.79564434", "0.7913296", "0.7909012", "0.7909012", "0.79010254", "0.7897...
0.82831895
5
Checks whether the circular queue is full or not.
def isFull(self): return len(self.queue) == self.size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFull(self):\r\n if (len(self.queue) == self.maxlen):\r\n return True\r\n else:\r\n return False", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return self.qu...
[ "0.8299797", "0.78827924", "0.78358734", "0.782498", "0.782426", "0.782426", "0.7629194", "0.76109856", "0.76109785", "0.75850576", "0.7578127", "0.7531097", "0.7526271", "0.7490314", "0.7479896", "0.747371", "0.74505204", "0.7448315", "0.7435628", "0.7421604", "0.7392218", ...
0.84751034
0
Get ContactNoticeEnum from api messages.
def _GetContactNoticeEnum(domains_messages): return domains_messages.ConfigureContactSettingsRequest.ContactNoticesValueListEntryValuesEnum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetContactPrivacyEnum(domains_messages):\n return domains_messages.ContactSettings.PrivacyValueValuesEnum", "def api_issue(request):\n messages = request.GET.get('messages', 'false').lower() == 'true'\n values = _issue_as_dict(request.issue, messages, request)\n return values", "def api_issue(request)...
[ "0.6752551", "0.52335626", "0.52335626", "0.521562", "0.520374", "0.51513165", "0.5018183", "0.48284", "0.47611585", "0.4741907", "0.47088912", "0.46194834", "0.45675215", "0.45632452", "0.4559596", "0.45542246", "0.4524476", "0.45194757", "0.44948968", "0.44839627", "0.44754...
0.79956263
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='', cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title + "Confusion matrix") plt.colorbar() tick_marks = np.arange(len(classes))...
{ "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.8194366", "0.8095442", "0.8029135", "0.8019134", "0.7993755", "0.7991176", "0.79808146", "0.79755133", "0.79609716", "0.7956584", "0.79375756", "0.79346216", "0.79343396", "0.7931212", "0.7926087", "0.7924503", "0.7923946", "0.79228765", "0.79227114", "0.7921956", "0.79178...
0.7876922
37
Build and cache a dataframe from query results
def dataframe(self): if self._dataframe is None: try: import pandas as pd except ImportError: raise RuntimeError('To enable dataframe support, ' 'run \'pip install datadotworld[pandas]\'') self._dataframe = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_query(query):\n db.query(query)\n dbResult = db.store_result()\n dbFetched = dbResult.fetch_row(maxrows = 0, how = 2)\n df = pd.DataFrame.from_records(dbFetched)\n return df", "def do_query(self) -> pd.DataFrame:\n if self.resultSize > self.step:\n query: str = self.query...
[ "0.75055", "0.73289883", "0.7260965", "0.7219419", "0.717175", "0.7145276", "0.71114534", "0.71014774", "0.70736", "0.7020373", "0.6978312", "0.6975145", "0.69552976", "0.6938427", "0.69212353", "0.69134206", "0.6867651", "0.6854342", "0.67930543", "0.67796284", "0.6775143", ...
0.0
-1
Gets labels as cornerpoints (8 points in 3D space) Assumes that the copies of the originals are named e.g. mackerel.001, whiting.001 etc. Blender 2.83 does this automatically at least Returns boxes_list = [(class, box), (class, box), ...]
def extract_labels_cps(scene: "Scenemaker") -> List[Tuple[int, np.ndarray]]: objects = utils.select_collection(scene.target_collection) boxes_list = [] for obj in objects: objclass = obj.name.split(".")[0] cornermatrix = np.empty((8, 3)) for j, corner ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_labels_full(scene: \"Scenemaker\") -> List[Tuple[int, np.ndarray]]:\r\n objects = utils.select_collection(scene.target_collection)\r\n boxes_list = []\r\n\r\n for obj in objects:\r\n objclass = obj.name.split(\".\")[0]\r\n dim = obj.dimensions\r\n r...
[ "0.6809832", "0.66156995", "0.6436885", "0.6371332", "0.6304836", "0.6274672", "0.619588", "0.6189613", "0.61156124", "0.6065631", "0.59921324", "0.59508187", "0.5918962", "0.59108883", "0.5879028", "0.58305705", "0.5830434", "0.5751634", "0.57430255", "0.57291096", "0.570597...
0.7578062
0
Convert class labels from scalars to onehot vectors.
def _dense_to_one_hot(self, labels_dense, num_classes=10): num_labels = labels_dense.shape[0] index_offset = np.arange(num_labels) * num_classes labels_one_hot = np.zeros((num_labels, num_classes)) labels_one_hot.flat[index_offset + labels_dense.ravel()] = 1 return labels_one_hot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(labels, classes=None):\n return K.utils.to_categorical(labels, classes)", "def one_hot(labels, classes=None):\n\n one_hot_ = K.utils.to_categorical(labels, classes)\n return(one_hot_)", "def to_onehot(labels: torch.Tensor, num_classes: int) -> torch.Tensor:\n if len(labels.size()) == 1:...
[ "0.8250402", "0.807683", "0.80523187", "0.7977843", "0.7908335", "0.7900327", "0.7892233", "0.7869711", "0.7849721", "0.7849721", "0.7826951", "0.7826122", "0.77677035", "0.7765413", "0.77540547", "0.77540547", "0.77540547", "0.77489346", "0.7742955", "0.7737176", "0.77226317...
0.7478094
48
Generate anchor (reference) windows by enumerating aspect ratios X scales wrt a reference (0, 0, base_size 1, base_size 1) window.
def _generate_anchors(point, sizes, aspect_ratios, layout, beta, include_depth): distance = point[2] base_size = sizes[0] scales = sizes[1:] / base_size # beta = 8 scales = (beta/distance)*scales center = (point[0], point[1]) anchor = np.array([center[0] - base_size/2.0, center[1] - base_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_anchors(scales=(32,), aspect_ratios=(0.5, 1, 2), dtype=np.float32):\n scales = np.array(scales)\n aspect_ratios = np.array(aspect_ratios, dtype=dtype)\n h_ratios = np.sqrt(aspect_ratios)\n w_ratios = 1 / h_ratios\n\n ws = (w_ratios[:, None] * scales[None, :]).reshape(-1)\n hs = (h_ra...
[ "0.674699", "0.67246497", "0.6567522", "0.6496679", "0.6481266", "0.6481266", "0.6378313", "0.636886", "0.636552", "0.6184632", "0.61386836", "0.61331654", "0.6106534", "0.6017496", "0.5911568", "0.58159727", "0.5798179", "0.5796079", "0.57649875", "0.5740484", "0.57395923", ...
0.5973359
14
Instantiate some variables prior to calling the __enter__() method.
def __init__(self, host='192.168.45.45', username='admin', password='Admin123', autodeploy=True): logging.debug("In the FMC __init__() class method.") self.host = host self.username = username self.password = password self.autodeploy = autodeploy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __enter__(self):\n self.__within_context = True\n if not self.__initialized:\n self.__initialization__()\n return self", "def __enter__(self):\n self._logger.debug(\"__enter__()\")\n self.install(\"PRE\")", "def __enter__(self):\n self.initialize()\n ...
[ "0.71459186", "0.71210116", "0.70791554", "0.70147693", "0.68209755", "0.68209755", "0.67988455", "0.6741203", "0.6738641", "0.66676384", "0.66464", "0.6494947", "0.6384495", "0.6303259", "0.6281594", "0.6181052", "0.61705554", "0.616486", "0.6160946", "0.6152318", "0.6143899...
0.0
-1
Returns the area of the Rectangle object.
def area(self): return self.width * self.height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area(self):\n\n bbox = self.bbox\n area = Box.calculate_bbox_area(bbox, bbox_type=self.bbox_type)\n\n return area", "def area(self):\n area = self.__width * self.__height\n return area", "def area(self):\n area = self.__length * self.__width\n\n return area"...
[ "0.8224758", "0.815816", "0.7988173", "0.78995395", "0.78747696", "0.78747696", "0.78747696", "0.78314096", "0.7826703", "0.7820832", "0.7820832", "0.7799044", "0.7792251", "0.7792251", "0.7792251", "0.7792035", "0.77880317", "0.77880317", "0.77880317", "0.77880317", "0.77880...
0.76826286
30
Returns the dictionary representation of a Rectangle object.
def to_dictionary(self): ret_dict = OrderedDict() ret_dict["id"] = self.id ret_dict["width"] = self.width ret_dict["height"] = self.height ret_dict["x"] = self.x ret_dict["y"] = self.y return dict(ret_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangledict(self):\n return rectangledict(self.rectangles)", "def to_dictionary(self):\n rect = {\n \"x\": self.x,\n \"y\": self.y,\n \"id\": self.id,\n \"height\": self.height,\n \"width\": self.width\n }\n return(rect)", ...
[ "0.82359874", "0.8139956", "0.80738163", "0.7909286", "0.78587335", "0.7716369", "0.76925933", "0.71382874", "0.6998955", "0.6950656", "0.6861835", "0.67516065", "0.674933", "0.6684003", "0.6625112", "0.6625112", "0.66044647", "0.66042393", "0.6600509", "0.65932345", "0.65715...
0.6570964
21
Getter of the Rectangle's width value.
def width(self): return self.__width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getWidth(self):\n return self._width", "def get_width ( self ):\n return self.width", "def get_width(self):\n return self._width", "def get_width(self):\n return self._width", "def get_width(self):\n return self._width", "def get_width(self):\n return self._w...
[ "0.8233175", "0.82132363", "0.82016337", "0.82016337", "0.82016337", "0.82016337", "0.81843126", "0.81789076", "0.81789076", "0.81789076", "0.81697214", "0.81066436", "0.8093248", "0.8093248", "0.8087137", "0.8087137", "0.80587417", "0.80162007", "0.79713136", "0.7947834", "0...
0.78319687
40
Getter of the Rectangle's x value.
def x(self): return self.__x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x_position(self):\n return self.rect.x", "def getX(self):\n return _libsbml.BoundingBox_getX(self)", "def get_x(self):\n return self.posX", "def _get_x(self):\n return self.position.x", "def Getxcoord(self):\n return self.x_coord", "def get_x(self) -> int:\n ...
[ "0.83179927", "0.8063379", "0.7989825", "0.795449", "0.78923875", "0.7880331", "0.7839584", "0.7823092", "0.7795686", "0.77781326", "0.77545893", "0.7718183", "0.7650797", "0.7578626", "0.75706786", "0.75478595", "0.75065285", "0.749551", "0.74643195", "0.7438765", "0.7279109...
0.7097929
47
Getter of the Rectangle's y value.
def y(self): return self.__y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getY(self):\n return _libsbml.BoundingBox_getY(self)", "def getY(self):\n return self.__y", "def getY(self):\r\n\t\treturn self._y", "def getY(self):\n return self.y", "def getY(self):\n return self.y", "def _get_y(self):\n return self.position.y", "def GetY(self)...
[ "0.82528615", "0.82525015", "0.8163997", "0.81583303", "0.81583303", "0.8109312", "0.810847", "0.8088943", "0.8047962", "0.7996797", "0.7971566", "0.79197246", "0.78648555", "0.7858608", "0.7803153", "0.77946854", "0.7794031", "0.77800745", "0.7766345", "0.7759042", "0.775451...
0.7329039
47
Setter of the Rectangle's y value.
def y(self, number): self.validate_int("y", number) if number < 0: raise ValueError("y must be >= 0") self.__y = number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setY(self, y):\r\n\t\tself._y=y", "def setY(self, y):\n self.y = y\n pass", "def SetY(self, y):\r\n\r\n self._y = y", "def set_y(self, y):\n self._y = y", "def set_y(self, y: float):\n self.y = y", "def set_y(self, new_y):\r\n self.y = new_y", "def setY(sel...
[ "0.83687454", "0.8361568", "0.8339199", "0.8333172", "0.81836766", "0.8055658", "0.7952201", "0.7948843", "0.7874834", "0.78124815", "0.77986413", "0.7726136", "0.76541656", "0.7615408", "0.7615408", "0.75526625", "0.7445898", "0.73857665", "0.73857665", "0.73717856", "0.7308...
0.6762778
34
r"""Returns all workspaces belonging to a repo.
def List(self, request, global_params=None): config = self.GetMethodConfig('List') return self._RunMethod( config, request, global_params=global_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workspaces(self):\n return WorkspaceCollection(client=self)", "def list(self):\n return self.rpc.call(MsfRpcMethod.DbWorkspaces)['workspaces']", "def find_all(self, params={}, **options):\n return self.client.get_collection(\"/workspaces\", params, **options)", "def list_workspaces(c...
[ "0.70669395", "0.68496996", "0.657306", "0.6508706", "0.613411", "0.6058504", "0.6006513", "0.5855024", "0.57285273", "0.57278657", "0.56856924", "0.56500983", "0.5595036", "0.5497893", "0.54730886", "0.54632324", "0.54611075", "0.5459534", "0.54272574", "0.5402718", "0.53954...
0.0
-1
function return left son of root in binary tree
def left(t): return t(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_left(self):\n return BinaryNode.or_none(self.left)", "def get_left_node(self):\n\t\tif self.left_child == None:\n\t\t\t# if we are at the end of a branch\n\t\t\tlowest_right_parent = self.get_lowest_right_parent()\n\t\t\tif lowest_right_parent.parent == None:\n\t\t\t\t# if this was called from lef...
[ "0.7345953", "0.7260732", "0.7110122", "0.7103753", "0.69501144", "0.6934904", "0.6916423", "0.69109064", "0.6798808", "0.67089784", "0.66743076", "0.66373247", "0.66236436", "0.66223264", "0.659061", "0.6573866", "0.651677", "0.651677", "0.64390534", "0.6436019", "0.6415343"...
0.58956563
97
Sets the id of this TypesUserProject.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_user(self, id_user):\n\n self._id_user = id_user", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def set_id(self, id):\n self.data['id'] = id", "def set_project_id(self, project...
[ "0.6500529", "0.6352681", "0.6339276", "0.6319639", "0.6221762", "0.6206974", "0.5985643", "0.5937511", "0.5915891" ]
0.5891401
78
Sets the connected of this TypesUserProject.
def connected(self, connected): self._connected = connected
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_connected(self):\n self.connected = True", "def connected(self, connected):\n \n self._connected = connected", "def set_connected(self, bConnected):\n\t\tcall_sdk_function('PrlVmDev_SetConnected', self.handle, bConnected)", "def update_connected_users_slot(self):\n self.up...
[ "0.65114254", "0.63306546", "0.61642313", "0.58125794", "0.5230474", "0.5117098", "0.511702", "0.511702", "0.50815463", "0.50558823", "0.50558823", "0.50361633", "0.49616674", "0.49408835", "0.4928108", "0.48644245", "0.4848451", "0.48207507", "0.48207507", "0.4811522", "0.48...
0.61835384
2
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, TypesUserProject): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, TypesUserProject): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Add a vertex to the graph.
def add_vertex(self, vertex_id, dirs): self.vertices[vertex_id] = {i: "?" for i in dirs}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n raise NotImplementedError", "def add_vertex(self, vertex):\n if isinstance(vertex, Vertex):\n self.vertices.append(vertex)\n return\n raise TypeError('Is not vertex instance!')", "def add_vertex(self, vertex_name: n):\n new_verte...
[ "0.87033486", "0.8434105", "0.8422719", "0.8410191", "0.83653563", "0.8317094", "0.82547307", "0.8086536", "0.80824524", "0.80383134", "0.8035328", "0.78831893", "0.78724676", "0.7840278", "0.7840278", "0.7762692", "0.775697", "0.77169126", "0.7713996", "0.76683915", "0.76628...
0.65892863
72
Get all neighbors (edges) of a vertex.
def get_neighbors(self, vertex_id): return self.vertices[vertex_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbors_in(self, vertex):\n return list(self.neighbor_in_iterator(vertex))", "def neighbors_out(self, vertex):\n return list(self.neighbor_out_iterator(vertex))", "def get_neighbours(self, vertex):\n output = []\n \n if vertex in self.adjacency_list:\n for ne...
[ "0.8146008", "0.78266084", "0.78112674", "0.7634123", "0.76183206", "0.7559868", "0.7391218", "0.73596346", "0.73310196", "0.7279731", "0.71649474", "0.7128683", "0.7083494", "0.7077735", "0.7033856", "0.69887614", "0.69749075", "0.6923719", "0.68615776", "0.6847223", "0.6838...
0.729323
12