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
Get residual after fit.
def get_residual(self) -> np.ndarray: return self._calculate_residual(self.coefficients)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def residuals(self):\r\n return self.__residuals", "def residuals(self) -> npt.NDArray[np.float64]:\n return self.data - self.theory", "def residuals_(self):\n return self._residuals", "def _residuals(self):\n if self.model_fit is None:\n self._uvts_cls_logger.error(\"N...
[ "0.74578893", "0.7413885", "0.740772", "0.7328536", "0.7270871", "0.711375", "0.71051645", "0.7091559", "0.7005274", "0.69731915", "0.69583935", "0.69441044", "0.68942314", "0.6860036", "0.68399817", "0.6828115", "0.68206584", "0.68188107", "0.6794833", "0.6759753", "0.672911...
0.77138394
0
Build a path from a dir file_name and ext and optionally description
def buildPath(dir, file_name, ext, description = None): path = os.path.join(dir, file_name) base, _ = os.path.splitext(path) if not description == None: base = base + '.' + description return base + ext
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_file_path(dir_name, file_name, ext):\n return os.path.join(dir_name, os.path.extsep.join((file_name, ext)))", "def appendDescription(dir, file_name, description):\n\tpath = os.path.join(dir, file_name)\n\tbase, ext = os.path.splitext(path)\n\treturn base + '.' + description + ext", "def construct_...
[ "0.75661904", "0.6550482", "0.60422546", "0.6027538", "0.59308547", "0.59081006", "0.5825218", "0.582117", "0.58164984", "0.57852477", "0.57776", "0.57530975", "0.5721652", "0.56592196", "0.5570957", "0.5562757", "0.55584544", "0.55302304", "0.55194324", "0.5516335", "0.55006...
0.8475875
0
Yield successive nsized chunks from l.
def make_chunks(l, chunk_length): for i in range(0, len(l), chunk_length): yield l[i:i + chunk_length]
{ "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(self, l, n):\n for i in range(0, len(l), 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 get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.0
-1
Convert a tuple to a list. Leave as is if it's not a tuple.
def _maybe_tuple_to_list(item: Any) -> Any: if isinstance(item, tuple): return list(item) return item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tuple_to_list(tup):\n return [element for element in tup]", "def to_list(ls):\r\n if isinstance(ls, (list, tuple)):\r\n return list(ls)\r\n else:\r\n return [ls]", "def _as_list(arr):\n if not isinstance(arr, (list, tuple)):\n return [arr]\n return arr", "def t...
[ "0.88657916", "0.74411047", "0.73352075", "0.7089461", "0.7007401", "0.6874846", "0.683141", "0.6754467", "0.66321504", "0.6620295", "0.6619706", "0.6607471", "0.65294397", "0.6527143", "0.6508084", "0.6490082", "0.64760363", "0.6465576", "0.6416606", "0.6405145", "0.63494104...
0.79983497
1
Return zerobased index of the first item whose value is equal to x. Raises a ValueError if there is no such item. We need a custom implementation instead of the builtin list .index() to be compatible with NumPy array and Pandas Series.
def index_(iterable: Iterable[_Value], x: _Value) -> int: for i, value in enumerate(iterable): if x == value: return i elif isinstance(value, float) and isinstance(x, float): if abs(x - value) < FLOAT_EQUALITY_EPSILON: return i raise ValueError("{} is not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _findIndex(self, x):\n if x< self[0][0] or x> self[-1][0]:\n return None\n\n idx = bisect.bisect_left(self.xproxy, x)\n if self[idx][0] == x:\n return idx\n else:\n return idx-1", "def index(a, x):\n i = bisect_left(a, x)\n if i != len(a) and a[i] == x:\n return i\n ...
[ "0.77265817", "0.7092654", "0.6193072", "0.6073469", "0.6072941", "0.6062401", "0.6062401", "0.60307384", "0.594494", "0.59344256", "0.5901641", "0.58801067", "0.58784056", "0.58769006", "0.58601695", "0.582463", "0.5793476", "0.57663995", "0.57654977", "0.56765395", "0.56638...
0.61554664
3
Returns total memory in GB
def total_ram(self): return sum([self.size_to_gb(slot["Size"]) for slot in self.get("Memory Device")])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_total_memory_size(self):\n return self.drt_manager.get_total_memory_size()", "def get_total_mem(self):\n return self.total_mem", "def memory():\n sin = psutil.virtual_memory()\n return round((sin.total / sin.used) / 100, 3)", "def get_total_memory():\n try:\n with open(LINUX...
[ "0.84649324", "0.8397152", "0.8345516", "0.83223814", "0.82900107", "0.82668227", "0.81492585", "0.8091062", "0.8055313", "0.79761887", "0.7950719", "0.79432964", "0.79042363", "0.7859515", "0.77456784", "0.7738933", "0.7714113", "0.76543", "0.7609636", "0.7586917", "0.758601...
0.7876892
13
Initializes the linear model
def __init__(self, W): self.W = W
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n # Initializing the Model with the class\n super(Model, self).__init__()\n # torch.nn.Linear applies a Linear transformation. The first parameter is the size of each input sample. The second is the size of the output sample\n self.linear = torch.nn.Linear(1, 1)", ...
[ "0.71657103", "0.6864546", "0.6807935", "0.6661502", "0.6641412", "0.65331113", "0.64934075", "0.6484655", "0.63668144", "0.63351643", "0.63128805", "0.6293662", "0.6293662", "0.6238403", "0.6235309", "0.6228824", "0.6206644", "0.62059164", "0.61926335", "0.61832464", "0.6172...
0.0
-1
Preprocessor a single variable to csv
def preprocess_var(bd, var): filepath_sv = f"team67-ptp/data/{var}.csv" filepath = bd data = feather.read_dataframe(filepath) df = data.copy() df2 = df[var] df2 = df2.to_frame() if df2[var].dtype is "category": df2[var] = df2[var].astype("category").cat.codes filename = filep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _CsvFunc(self, obj=None, verbose=False, use_pager=None, to_file=None):\n if obj is not None:\n self._printed_variables.append(obj)\n lines = describe.GenerateLines(obj, verbose=verbose, recursive=False,\n format_name='csv')\n _WriteToStream(lines, use_pager=use_p...
[ "0.66699797", "0.65230983", "0.64495826", "0.6366187", "0.631597", "0.6235153", "0.62237316", "0.6220428", "0.61555123", "0.6071468", "0.60417193", "0.59741926", "0.5956384", "0.5955706", "0.590863", "0.5900902", "0.58964217", "0.5878538", "0.58744174", "0.5873965", "0.586477...
0.0
-1
Preprocessor a two variables to csv
def preprocess_mul(bd, var1, var2): filepath_mv = f"team67-ptp/data/{var1}_{var2}.csv" filepath = bd data = feather.read_dataframe(filepath) df = data.copy() df2 = df[[var1, var2]] if df2[var1].dtype is "category" and df2[var2].dtype is "category": df2[var1] = df2[var1].astype("category"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _export_csv(x, y, export_to):\r\n\r\n with open(export_to, 'w', newline='') as e:\r\n writer = csv.writer(e, delimiter=',')\r\n for i in range (0, len(x)):\r\n writer.writerow([x[i], y[i]])", "def to_csv_line(*args):\r\n return ','.join([str(valu...
[ "0.6688574", "0.644066", "0.6125455", "0.6098131", "0.5979492", "0.59498924", "0.589342", "0.58812857", "0.5872026", "0.582138", "0.5802474", "0.58013624", "0.57924706", "0.5773843", "0.5757969", "0.5730896", "0.5730896", "0.5730896", "0.5730896", "0.5730896", "0.5730896", ...
0.0
-1
The geolocation where the resource lives
def location(self) -> str: return pulumi.get(self, "location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\n\t\treturn self.location", "def get_location(self):\n return self.location", "def get_location(self):\n return self.location", "def get_location(self):\r\n return self.__location", "def get_location(self):\r\n return None", "def getLocation(self):\n ...
[ "0.816298", "0.7999453", "0.79540074", "0.7945644", "0.78364915", "0.77626437", "0.7730134", "0.7681095", "0.7624169", "0.76093256", "0.76093256", "0.75724584", "0.75544393", "0.7547195", "0.75165695", "0.74507827", "0.74267685", "0.7406362", "0.7359666", "0.73106575", "0.729...
0.7419033
22
Start time of order item
def start_time(self) -> str: return pulumi.get(self, "start_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self) -> float:\r\n ...", "def start_time(self):\n pass", "def start_time(self):\n return self._meta['start_time']", "def start_time(self) -> datetime:\n return self.root_hartree.start_time", "def start_time(self):\n return self._start_time", "def start_t...
[ "0.7455318", "0.73541754", "0.70947945", "0.7025021", "0.70100766", "0.70100766", "0.70100766", "0.70100766", "0.70100766", "0.70100766", "0.70100766", "0.70100766", "0.70033187", "0.6953084", "0.6943664", "0.69388765", "0.68745273", "0.68032306", "0.676392", "0.67465395", "0...
0.68001205
19
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.7919458", "0.7919458", "0.7867074", "0.7867074", "0.7867074", "0.7867074", "0.7867074", "0.7708862", "0.75531036", "0.72828835", "0.7059542", "0.69798553", "0.692112", "0.6870239", "0.6729993", "0.6705262", "0.66550124", "0.6646575", "0.65508044", "0.65431625", "0.65431625...
0.6639953
38
Create the sppasPathSettings dictionary.
def __init__(self): super(sppasPathSettings, self).__init__() sppas_dir = os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(__file__)))) self.__dict__ = dict( sppas=sppas_dir, cli=os.path.join(sppas_dir, "bin"), etc=os.path.join(sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_paths_section():\n section = _SectionData(\"Paths\")\n section.props.append((\"ProjectPath\", _property_utils.get_by_type(bpy.types.GlobalSCSProps.scs_project_path)))\n section.props.append((\"\", \"\"))\n section.props.append((\"ShaderPresetsFilePath\", _property_utils.get_by_...
[ "0.60087246", "0.5748405", "0.5670348", "0.56041735", "0.5581902", "0.5575019", "0.5517154", "0.543762", "0.5408098", "0.5370869", "0.53569716", "0.5356201", "0.5351576", "0.52927434", "0.52879727", "0.5272143", "0.5251382", "0.5238654", "0.52089846", "0.51812327", "0.5175009...
0.7366091
0
Create the sppasSeparatorSettings dictionary.
def __init__(self): super(sppasSeparatorSettings, self).__init__() self.__dict__ = dict( phonemes="-", # X-SAMPA standard syllables=".", # X-SAMPA standard variants="|" # used for all alternative tags )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_config(s):\n x = re.split(r\";\", s)\n d = {k: v for (k, v) in [i.split(\"=\") for i in x]}\n return d", "def __init__(self):\n super(sppasSymbolSettings, self).__init__()\n\n self.__dict__ = dict(\n unk=\"<UNK>\",\n phone=sppasSymbolSettings.__phone_symbols...
[ "0.5260643", "0.525356", "0.5215848", "0.516991", "0.50845647", "0.50162953", "0.50140077", "0.49808216", "0.49723732", "0.49135372", "0.48305875", "0.47998127", "0.47948772", "0.4775136", "0.46659538", "0.46494308", "0.46151328", "0.459098", "0.45890176", "0.45849705", "0.45...
0.7076453
0
Ensures InvalidTwine exceptions are raised when instantiating twines with a missing `name` field in a credential.
def test_fails_on_no_name(self): invalid_credentials_no_name_twine = """ { "credentials": [ { "purpose": "credentials without a name should be invalid" } ] } """ with self.ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fails_on_name_whitespace(self):\n invalid_credentials_space_in_name_twine = \"\"\"\n {\n \"credentials\": [\n {\n \"name\": \"MY NAME SHOULD NOT HAVE WHITESPACE\",\n \"purpose\": \"Token for accessing a 3rd p...
[ "0.74130327", "0.738747", "0.71815866", "0.68032056", "0.6659559", "0.55014026", "0.54120857", "0.5409691", "0.53112495", "0.52741003", "0.5249553", "0.52142566", "0.5201539", "0.5198638", "0.5184421", "0.5165544", "0.5151099", "0.5134139", "0.51095825", "0.5082709", "0.50345...
0.804954
0
Ensures InvalidTwine exceptions are raised when instantiating twines with invalid `credentials` entries (given as a dict, not an array).
def test_fails_on_dict(self): invalid_credentials_dict_not_array_twine = """ { "credentials": { "name": "MY_API_SECRET_KEY", "purpose": "Token for accessing a 3rd party API service" } } """ with self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_missing_credentials(self):\n twine = Twine(source=self.VALID_CREDENTIALS_TWINE)\n with self.assertRaises(exceptions.CredentialNotFound):\n twine.validate_credentials()", "def test_fails_on_no_name(self):\n invalid_credentials_no_name_twine = \"\"\"\n {\n ...
[ "0.697575", "0.6677831", "0.6417075", "0.6336212", "0.6142843", "0.5521954", "0.5465488", "0.5218336", "0.510923", "0.5068735", "0.50598174", "0.50413364", "0.49665698", "0.4901049", "0.489881", "0.48986685", "0.48686793", "0.48420176", "0.483212", "0.482264", "0.4800654", ...
0.816796
0
Radiance representation of the recipe.
def toRadString(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def radii(self) -> Quantity:\n return self._radii", "def radiant_score(self):\n return self._get(\"radiant_score\")", "def inner_rad(self) -> Quantity:\n return self._inner_rad", "def proper_radii(self) -> Quantity:\n if self._proper_radii is not None:\n to_return = sel...
[ "0.6743697", "0.6425949", "0.6093746", "0.5999865", "0.5891541", "0.58715683", "0.5772545", "0.5771941", "0.57067144", "0.5654926", "0.561677", "0.5590352", "0.5554511", "0.55051005", "0.54902536", "0.548594", "0.54581785", "0.54527444", "0.5393657", "0.5353767", "0.5340199",...
0.5339628
21
Get the filename of the GameDay PitchFx file associated with a given Retrosheet game_id.
def _gameday_pitch_filename(game_id, data_root): year = game_id[3:7] filename = os.path.join(data_root, "gameday", "pitches", year, game_id + ".xml") return filename if os.path.exists(filename) else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _retrosheet_filename(game_id, data_root):\n # game id is TTTYYYYMMDDN.\n team = game_id[:3]\n year = game_id[3:7]\n file_pattern = year + team + \".EV*\"\n file_path = os.path.join(data_root, \"retrosheet\", year, file_pattern)\n file_matches = glob.glob(file_path)\n return file_matches[0]...
[ "0.81765527", "0.7027017", "0.6883412", "0.6669271", "0.66651946", "0.64135945", "0.64090705", "0.63942695", "0.6356634", "0.63335884", "0.63259274", "0.6317817", "0.63174456", "0.63015467", "0.63015467", "0.63015467", "0.6288798", "0.6259826", "0.62433845", "0.620116", "0.61...
0.78359383
1
Initialize layer 4 object with n4 neurons, L stimuli, k neurons with initial activation (unless given_weight_matrix provided), and weightMatrix. If given_weight_matrix is provided (not None), it must either be in the form of a string containing n4L values separated by commas, or in the form of a numpy array of the corr...
def __init__(self, n4, L, k, randomize=False, non_k=-1, given_weight_matrix = None): self.n4 = n4 self.L = L self.k = k self.weightMatrix = numpy.full((self.n4, self.L), non_k, dtype=numpy.int16) # initializing from the start if given_weight_matrix == None: if randomize == "True": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self, load_weights=None):\n if load_weights:\n # TODO\n pass\n else:\n # x: lower layer nodes n\n # y: current layer nodes n\n x = self.weights_shape[1]\n y = self.weights_shape[0]\n self.weights = np.random.randn(y, x) / np.sqrt(x) # pylint: disable=no-mem...
[ "0.6231484", "0.6089778", "0.6056054", "0.5963621", "0.5886334", "0.5820676", "0.5771657", "0.5767608", "0.5750672", "0.57492733", "0.57492733", "0.57492733", "0.57218105", "0.57083887", "0.5692032", "0.56874746", "0.5682025", "0.5658114", "0.5629865", "0.56158614", "0.561077...
0.7725477
0
Initializes a layer 2/3 object with n23 neurons connected to n4 neurons from layer 4. If initialized from scratch, creates (n23, n4) inputWeightMatrix with weights chosen by Gaussian distribution with mean provided and stdv = 1/sqrt(n4), and (n23, n23) recurrentWeightMatrix with weights chosen by Gaussian with stdv = 1...
def __init__(self, n23, n4, mean, stdp_eta, given_weight_matrices = None): self.n23 = n23 self.n4 = n4 self.eta = stdp_eta # initialize from scratch if given_weight_matrices == None: # create input weight matrix with weights chosen by Gaussian distribution stdv = 1/math.sqrt(n4) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, n4, L, k, randomize=False, non_k=-1, given_weight_matrix = None):\n\n self.n4 = n4\n self.L = L\n self.k = k\n self.weightMatrix = numpy.full((self.n4, self.L), non_k, dtype=numpy.int16)\n\n # initializing from the start\n if given_weight_matrix == None: \n if randomize ==...
[ "0.6748135", "0.6196504", "0.60606045", "0.6022062", "0.5988512", "0.59108657", "0.5899774", "0.5732108", "0.57222277", "0.5711475", "0.5679732", "0.567782", "0.56572145", "0.5647979", "0.5580845", "0.55331516", "0.55207545", "0.54946977", "0.54929435", "0.5477036", "0.544032...
0.6818799
0
Get the Vagrant version.
def version(): with settings(hide('running', 'warnings'), warn_only=True): res = local('vagrant --version', capture=True) if res.failed: return None line = res.splitlines()[-1] version = re.match(r'Vagrant (?:v(?:ersion )?)?(.*)', line).group(1) return tuple(_to_int(part) for part in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vagrant_check_version(self):\n # note: we do not raise any AnsibleCliError from this function because\n # AnsibleCliError are used to trigger stuffs when they are catched. In\n # this case, we do not want trigger anything if something fails.\n try:\n output = exec_shell([...
[ "0.74387556", "0.70418996", "0.67030704", "0.65834874", "0.6550676", "0.65437007", "0.65120745", "0.6484319", "0.6448412", "0.639148", "0.6359417", "0.63544106", "0.6324436", "0.6311355", "0.62821597", "0.62745804", "0.6264706", "0.62633675", "0.624769", "0.624769", "0.624769...
0.8651006
0
Advance the iterator nsteps ahead. If n is None, consume entirely.
def consume(iterator, n=None): # Use functions that consume iterators at C speed. if n is None: # feed the entire iterator into a zero-length deque deque(iterator, maxlen=0) else: # advance to the empty slice starting at position n next(islice(iterator, n, n), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def advance(self, n):\n return _elas.SwigPyIterator_advance(self, n)", "def consume(iterator, n=None, next=next, islice=islice, deque=deque):\n if n is not None:\n next(islice(iterator, n, n), None)\n else:\n exhaust(iterator)", "def skip(self, n=None):\n while n > 0:\n ...
[ "0.7457023", "0.73608387", "0.7142163", "0.6923986", "0.68661726", "0.6794742", "0.6785703", "0.6707913", "0.6626116", "0.6579671", "0.6542429", "0.6475875", "0.6422248", "0.6421884", "0.63522977", "0.6308284", "0.63066524", "0.62462044", "0.622208", "0.62049186", "0.6199926"...
0.6947305
3
Create the filter axes. They are ordered as (C, D, H, W, K).
def _filter_axes(self, channel_axes, spatial_axes): f_axes = ng.make_axes() f_axes += ng.make_axis(length=self.nout, name="K") f_axes += channel_axes for key, ax in zip(self.spatial_keys, spatial_axes): f_axes += ng.make_axis(length=self.filter_spatial_shape[key], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_axes(self, channel_axis, spatial_axes):\n f_axes = ng.make_axis(length=self.nout, name=\"K\")\n for key, ax in zip(\"DHW\", spatial_axes):\n f_axes += ng.make_axis(length=self.filter_shape[key],\n name=ax.name)\n f_axes += channel_axis\n...
[ "0.74516636", "0.6499571", "0.62619257", "0.62412906", "0.6160327", "0.6132655", "0.5812254", "0.5753394", "0.55952036", "0.55551445", "0.55383164", "0.55284905", "0.5506311", "0.54356974", "0.53720635", "0.5354197", "0.5346949", "0.5231423", "0.5220264", "0.5207294", "0.5195...
0.7154249
1
Slice output to desired shape given by deconv_out_shape
def _slice_output(self, output, spatial_axes, **kwargs): if self.deconv_out_shape is None: return output if isinstance(spatial_axes, dict): spatial_axes = tuple(spatial_axes.get(name, name) for name in ("D", "H", "W")) elif isinstance(sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice_output_shape(input_shape):\n shape_1 = input_shape[0]\n shape_2 = 80\n shape_3 = input_shape[2]\n return (shape_1, shape_2, shape_3)", "def _squeeze_output(out):\r\n out = out.squeeze()\r\n if out.ndim == 0:\r\n out = out[()]\r\n return out", "def output_reshape(ct):\n ...
[ "0.70831054", "0.6761576", "0.66313136", "0.6393305", "0.6357284", "0.629436", "0.62509036", "0.62246907", "0.621388", "0.6152387", "0.61450714", "0.61170775", "0.6114104", "0.6026817", "0.60165524", "0.60165524", "0.60165524", "0.59306437", "0.5909184", "0.5898397", "0.58895...
0.7285818
0
Given a list of cells, initialize the states of the individual cells together by doing the equivalent of sum([c.initialize_states(kwargs) for c in cells], []), but using itertools instead because it's much faster
def _cells_initialize_states(cells, batch_axis, **kwargs): return list(itertools.chain( *[c.initialize_states(batch_axis, **kwargs) for c in cells]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_cells(self):\n for loc in np.ndindex(*self.shape): # TODO: see if nested for loop is faster than this\n c = Cell(loc, self)\n self.cells.append(c)", "def create_iterables(self):\n iterables = [[0, 1], [0, 1], [0, 1],\n [0, 1], [0, 1], [0, 1],...
[ "0.6383152", "0.63666826", "0.6025529", "0.59512055", "0.5893001", "0.57383454", "0.5733948", "0.57162946", "0.5703301", "0.56930435", "0.56870705", "0.5666645", "0.56311667", "0.55474085", "0.55270493", "0.55179924", "0.54676026", "0.54474306", "0.54134625", "0.5404968", "0....
0.86237913
0
A Generator that yields the input files.
def generate_files(self): import re for year, url in self.metadata.build.sources.items(): zf = self.filesystem.download(url) for fn in self.filesystem.unzip_dir(zf, re.compile(r'.*all.*', re.IGNORECASE)): yield year, fn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadFilesGenerator(self):\n\n for file in self._file_names:\n file_list = []\n\n # TODO see further into yielding one line at a time\n with open(file, 'r', encoding='mbcs') as sped:\n file_list = sped.read().splitlines()\n\n if not self.isSigned...
[ "0.7647093", "0.7619199", "0.74694633", "0.68229747", "0.6600983", "0.6566071", "0.65438145", "0.64989114", "0.64447236", "0.64042693", "0.6375097", "0.63551563", "0.63421535", "0.6332473", "0.6322704", "0.6293759", "0.6275279", "0.6261799", "0.6226985", "0.6209705", "0.61905...
0.6458097
8
Returns a 4tuple extent in degrees decimal longitude and latitude the extent of a rectangle in (size[0], size[1]) pixels that is filled by the city. This is useful in generating locator map bounds because the extent of the city doesn't typically match the aspect ratio of the image.
def get_citywide_bounds_for_size(city_slug, size=LOCATOR_SIZE): extent = city_extent_in_map_srs(city_slug) resolution = extent_resolution(extent, size, settings.MAP_UNITS) new_extent = calculate_bounds(center(extent), resolution, size) # Convert back to lng/lat return transform_extent(new_extent, 43...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_extent(self):\n geot = self.geotransform()\n return (geot[0], geot[3] + self.YSize() * geot[5],\n geot[0] + self.XSize() * geot[1], geot[3])", "def extent(self):\n rx0 = gxapi.float_ref()\n ry0 = gxapi.float_ref()\n rz0 = gxapi.float_ref()\n rx1 = ...
[ "0.692489", "0.67301667", "0.65538526", "0.64773893", "0.64675874", "0.6291051", "0.6289066", "0.6278614", "0.6212788", "0.6068877", "0.60651547", "0.6020855", "0.60067767", "0.5988577", "0.587283", "0.5872608", "0.5866909", "0.5825974", "0.5807576", "0.5795221", "0.5779645",...
0.61975217
9
Initialize network weights with Xavier Initialization
def xavier_init(fan_in, fan_out, constant=1): low = -constant*np.sqrt(6/(fan_in + fan_out)) high = constant*np.sqrt(6.0/(fan_in + fan_out)) return tf.random_uniform((fan_in, fan_out), minval=low, maxval=high, dtype=tf.float32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_weights(self):\n nn.init.xavier_normal_(self.out.weight)", "def init_weight(self):\r\n xavier_init(self.output_proj, distribution='uniform', bias=0.)", "def initialize_weights_xavier(self):\n\t\tself.weights = [np.random.uniform(-1/sqrt(size1), 1/sqrt(size1)) for size1, size2 in zip(sel...
[ "0.7906633", "0.76458895", "0.7607291", "0.7531838", "0.7395831", "0.7360669", "0.73032063", "0.7275394", "0.72530705", "0.7239903", "0.72297645", "0.7155332", "0.7154639", "0.71084917", "0.7016128", "0.6954637", "0.6950315", "0.6893707", "0.6888579", "0.68864745", "0.6879443...
0.0
-1
Get the cosine similarity matrix from the embedding as a Pandas DataFrame.
def get_cosine_similarity_df(word2vec: Word2Vec) -> pd.DataFrame: sim = get_cosine_similarity(word2vec) return pd.DataFrame(sim, index=word2vec.wv.index2word, columns=word2vec.wv.index2word)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_similarity(df):\n count = CountVectorizer()\n count_matrix = count.fit_transform(df[\"bag_of_words\"])\n cosine_sim = cosine_similarity(count_matrix, count_matrix)\n return cosine_sim", "def _calculate_similarities(self) -> pd.DataFrame:\n\n df_encoded_articles = self._db_connection.ge...
[ "0.7234511", "0.6991583", "0.6946937", "0.68768257", "0.65643364", "0.6388998", "0.6264799", "0.61277986", "0.612138", "0.6115123", "0.6112033", "0.60728824", "0.60516924", "0.5977526", "0.5932496", "0.59059745", "0.5899762", "0.582879", "0.58085597", "0.5782091", "0.56256443...
0.76576155
0
Return the sum of the first n numbers of sequence S
def linear_sum(S, n): if n == 0: return 0 else: return linear_sum(S, n - 1) + S[n - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_sum(S, n):\n if n == 0:\n return 0\n else:\n return linear_sum(S, n-1) + S[n-1]", "def sum_of_nth( n ):\n if n > 0:\n return sum( range(n + 1) )\n else:\n return 0", "def sum_series(n, first=0, second=1):\n if n == 1:\n return first\n elif n == 2:...
[ "0.76841", "0.7444881", "0.72330695", "0.72233206", "0.71733654", "0.7087734", "0.7078644", "0.70632255", "0.7057611", "0.7053824", "0.70530355", "0.70193213", "0.6922918", "0.68946594", "0.6832259", "0.6748849", "0.67027134", "0.6694901", "0.6611888", "0.6601319", "0.6569598...
0.766399
1
Add a vertex, set its weight to 1 return False if the vertex does not exist
def _remove_single_vertex(self, x): if x not in self.vertices: return False del self.vertices[x] for vert in self.edges[x].keys(): del self.edges[vert][x] del self.edges[x]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n if self.contains(vertex):\n return None\n if self.is_weighted():\n self._graph[vertex] = dict()\n else:\n self._graph[vertex] = set()\n return True", "def add_neighbor(self, vertex, weight=0):\n if vertex not in s...
[ "0.8470212", "0.7929285", "0.77122796", "0.74551594", "0.73594785", "0.73594785", "0.7349027", "0.7322142", "0.7292113", "0.7288922", "0.7284876", "0.72217226", "0.71602976", "0.71517193", "0.70906955", "0.7073161", "0.7039367", "0.7012753", "0.7003801", "0.69833803", "0.6981...
0.0
-1
Add a vertex, set its weight to 1 return False if the vertex does not exist
def remove_vertex(self, x): if isinstance(x, list): return [self._add_single_vertex(v) for v in x] return self._remove_single_vertex(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n if self.contains(vertex):\n return None\n if self.is_weighted():\n self._graph[vertex] = dict()\n else:\n self._graph[vertex] = set()\n return True", "def add_neighbor(self, vertex, weight=0):\n if vertex not in s...
[ "0.8470212", "0.7929285", "0.77122796", "0.74551594", "0.73594785", "0.73594785", "0.7349027", "0.7322142", "0.7292113", "0.7288922", "0.7284876", "0.72217226", "0.71602976", "0.71517193", "0.70906955", "0.7073161", "0.7039367", "0.7012753", "0.7003801", "0.69833803", "0.6981...
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.76052207", "0.74484503", "0.74047023", "0.7281549", "0.7209793", "0.7166467", "0.71581", "0.7145881", "0.7145881", "0.7145881", "0.7145881", "0.7145881", "0.7145881", "0.7132385", "0.71016103", "0.70670533", "0.70652425", "0.7063426", "0.7063426", "0.7063426", "0.7063426",...
0.7097688
21
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.7489052", "0.7288358", "0.7159325", "0.715323", "0.7065856", "0.6984727", "0.6964892", "0.69536865", "0.6912471", "0.68334424", "0.68176156", "0.68093187", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.67855513", "0.67575085", "0.67575085...
0.675501
34
Focuses the "prev" cell. Moves the cursor to the proper position.
def focus_prev_cell(self, prev): x, y = self._cell_input.cursor_coordinates() y_new = prev._cell_input.rows() - 1 prev._cell_input.set_cursor_coordinates(x, y_new) prev.set_focus()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def focus_prev(self):\n self.focus_item(forward=False)", "def _prev(self, _):\n self.notebook.SetSelection(self.idx-1)", "def focus_next_cell(self, next):\n x, y = self._cell_input.cursor_coordinates()\n y_new = 0\n next._cell_input.set_cursor_coordinates(x, y_new)\n n...
[ "0.7651945", "0.74857336", "0.6641398", "0.65821093", "0.64603764", "0.64561605", "0.6435459", "0.6334366", "0.6332495", "0.63032544", "0.6289549", "0.6205924", "0.6180435", "0.6161628", "0.6105949", "0.61046416", "0.6073891", "0.60474837", "0.5960907", "0.5882112", "0.586161...
0.85488623
0
Return now() in Apache Common Log Format (no timezone).
def time(self): now = datetime.datetime.now() month = rfc822._monthnames[now.month - 1].capitalize() return ('[%02d/%s/%04d:%02d:%02d:%02d]' % (now.day, month, now.year, now.hour, now.minute, now.second))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def now():\n now = datetime.datetime.now()\n return \"%04d-%02d-%02d %02d:%02d:%02d.%03d\" % ( now.year, now.month,now.day,\n now.hour,now.minute,now.second,int(now.microsecond/1e3))", "def timestamp_now():\n return datetime.now().strftime(\"%A, %B %d, %Y, %I:%M %p\")", "def now(self):...
[ "0.7856626", "0.7855255", "0.77789456", "0.7706137", "0.7693792", "0.7643583", "0.7637152", "0.76358235", "0.7572497", "0.7528446", "0.748852", "0.7474767", "0.7472154", "0.7391723", "0.73707664", "0.734145", "0.7291855", "0.7291855", "0.7284689", "0.7257214", "0.7248414", ...
0.0
-1
Add edge to graph
def add_edge( self, src, dst, key=None, attr_dict=None, **attrs ): attr_dict = {} if attr_dict is None else attr_dict attr_dict.update( attrs ) self.node.setdefault( src, {} ) self.node.setdefault( dst, {} ) self.edge.setdefault( src, {} ) self.edge.setdefault( dst, {} ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n if(self.has_edge(edge) == 0):\n self.__graph_dict[edge[0]].append(edge[1])", "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_...
[ "0.84528124", "0.8388235", "0.8271909", "0.8251631", "0.823839", "0.81696016", "0.81525034", "0.8130112", "0.81174165", "0.8095377", "0.80940336", "0.80918396", "0.80908763", "0.80584824", "0.80436015", "0.8036798", "0.802385", "0.8018984", "0.7985269", "0.79833496", "0.79631...
0.0
-1
Return list of graph nodes
def nodes( self, data=False): return self.node.items() if data else self.node.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node_list(self):\n return [[node] for node in self.graph.nodes]", "def nodes(self):\n return list(self.__graph.keys())", "def get_nodes(self):\n\n return list(self.graph.nodes)", "def nodes(self):\n return self.graph.nodes", "def nodes(self):\n\n return list(set(s...
[ "0.8437833", "0.83060014", "0.82377315", "0.8134697", "0.8128133", "0.8120979", "0.80396575", "0.8033584", "0.799627", "0.79893357", "0.7959951", "0.7935788", "0.78893393", "0.7829998", "0.77475286", "0.7680455", "0.76766956", "0.7651423", "0.7640231", "0.7640231", "0.762889"...
0.67484826
81
H_t(x) returns the summation of the responses of the first t weak classifiers.
def h_t(self, x, t): ret = 0 strong_classifier = self.classifiers[0:t+1] for wc in strong_classifier: ret += wc.classify(x) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_step(self, x, h):\n concatHX = torch.cat((x, h), 1)\n ft = self.sigmoid(self.linearF(concatHX))\n it = self.sigmoid(self.linearI(concatHX))\n newCt = ft*self.ct.clone() + it*self.tanh(self.linearC(concatHX))\n #self.ct = ft*self.ct.clone() + it*self.tanh(self.linearC(conc...
[ "0.68166625", "0.67978925", "0.6778078", "0.6264831", "0.61125785", "0.60929614", "0.60755724", "0.6063902", "0.600523", "0.59320676", "0.5920946", "0.5919724", "0.58609223", "0.58361953", "0.5825794", "0.58144814", "0.579117", "0.57640105", "0.57490045", "0.5742261", "0.5742...
0.74814725
0
H_t(x) returns the summation of the responses of the first t weak classifiers.
def h_t(self, x, t): ret = 0 strong_classifier = self.classifiers[0:t+1] for wc in strong_classifier: ret += wc.classify(x) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_step(self, x, h):\n concatHX = torch.cat((x, h), 1)\n ft = self.sigmoid(self.linearF(concatHX))\n it = self.sigmoid(self.linearI(concatHX))\n newCt = ft*self.ct.clone() + it*self.tanh(self.linearC(concatHX))\n #self.ct = ft*self.ct.clone() + it*self.tanh(self.linearC(conc...
[ "0.6817799", "0.67995626", "0.67790145", "0.62669414", "0.61134875", "0.60938984", "0.6076991", "0.6066603", "0.600625", "0.5934693", "0.59222114", "0.5919796", "0.58628464", "0.58377874", "0.58264107", "0.58153915", "0.579338", "0.5765072", "0.5750654", "0.5745055", "0.57428...
0.74806714
1
Return whether this is a getting action.
def is_get(self): return self.action in ["list", "retrieve"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __bool__(self):\n return bool(self._actions)", "def match_action(self, action):\n\n return hasattr(self, self._action_handler_name(action))", "def is_action(self) -> bool:\n return self.is_action_str(self.content)", "def action_required(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.66465306", "0.6514637", "0.63705033", "0.61986583", "0.61492366", "0.611826", "0.6019523", "0.6010379", "0.6007403", "0.60029685", "0.5971159", "0.5971159", "0.5971159", "0.5971159", "0.59573185", "0.58928037", "0.58693737", "0.58690596", "0.58690596", "0.58690596", "0.583...
0.85034436
0
Return whether this is an updatting action.
def is_update(self): return self.action in ["update", "partial_update"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_update_active(self):\n return self._update_action", "def isConfirmedDataUp(self):\n return self.mhdr.mtype == CO_DATA_UP", "def isUnconfirmedDataUp(self):\n return self.mhdr.mtype == UN_DATA_UP", "def isUp ( self ) :\n return not self.isDown()", "def __bool__(self):...
[ "0.65594274", "0.6467985", "0.63728833", "0.63440377", "0.61977506", "0.61768883", "0.6129319", "0.6117427", "0.6098021", "0.6055959", "0.60226405", "0.60025406", "0.5969736", "0.5941043", "0.5921024", "0.5878445", "0.58667946", "0.58482164", "0.58346134", "0.58339983", "0.57...
0.6551283
1
Filter queryset to users based on permissions.
def get_queryset(self, *args, **kwargs): qs = super().get_queryset(*args, **kwargs) user = self.request.user if not user.is_authenticated: return qs.none() if self.is_get and not user.has_perm("users.view_user"): return qs.filter(pk=user.pk) if self.is_upd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_queryset(self, request, queryset, view):\n if view.action == \"retrieve\" and request.method == \"GET\":\n return queryset.model.objects.all()\n\n filtered_queryset = super().filter_queryset(request, queryset, view)\n org_users = set(\n [group.team.organization...
[ "0.7223497", "0.70795846", "0.7036792", "0.6972066", "0.6936853", "0.6928938", "0.6916886", "0.6859023", "0.6803199", "0.67962486", "0.6774986", "0.6733345", "0.6714067", "0.6703698", "0.66519463", "0.66389406", "0.65361154", "0.65361154", "0.6525295", "0.65201217", "0.651718...
0.72607553
0
Gets the counter_type of this CounterPointer.
def counter_type(self) -> str: return self._counter_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_perfcount_type(self):\n return self._perfcount_type", "def get_type(self):\n return self._TYPE", "def getType(self):\n return self._type", "def get_type(self):\n return self._type", "def get_type(self):\n return self._type", "def type(self) -> MetricType...
[ "0.68725675", "0.6516205", "0.64693546", "0.6462432", "0.6462432", "0.64550483", "0.6409898", "0.6399005", "0.6373705", "0.636375", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", "0.6335509", ...
0.78557086
0
Sets the counter_type of this CounterPointer.
def counter_type(self, counter_type: str): allowed_values = ["character", "byte", "page"] # noqa: E501 if counter_type not in allowed_values: raise ValueError( "Invalid value for `counter_type` ({0}), must be one of {1}" .format(counter_type, allowed_values) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetType(self, ct_type):\r\n\r\n self._type = ct_type", "def set_type(self, type):\n self._type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def __init__(self, counter_type: str=None, counter: int=None): # noqa: E5...
[ "0.6586995", "0.64445937", "0.6394954", "0.6394954", "0.6363235", "0.62764454", "0.62764454", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", "0.62655395", ...
0.77912813
0
Context manager that sets the MAPPINGS_USE_NESTED setting with the given value, default True
def mappings_use_nested(value=True): old_setting = Settings.MAPPINGS_USE_NESTED try: Settings.MAPPINGS_USE_NESTED = value yield finally: Settings.MAPPINGS_USE_NESTED = old_setting
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isNest(self):\n\t\tif self.nestInfo == None:\n\t\t\treturn False\n\t\telse:\n\t\t\treturn True", "def test_documentation_popxl_nested_session_contexts(self):\n filename = \"nested_session_contexts.py\"\n self.run_python(filename, file_dir=working_dir, working_dir=working_dir)", "def default_n...
[ "0.51234853", "0.5110324", "0.51092035", "0.5021755", "0.49843925", "0.49771792", "0.4961515", "0.46479183", "0.46340314", "0.45778015", "0.4566229", "0.45511296", "0.4512281", "0.4510831", "0.44475397", "0.4445361", "0.44344524", "0.4433714", "0.43684018", "0.43653566", "0.4...
0.65204585
0
Tests that mapping a type with an object field with nested enabled correctly maps with nested.
def test_type_mapping_nested_with_disabled_parameter(registry): with mappings_use_nested(True): mapping = type_mapping(registry[TYPES], 'TestingNestedEnabled') assert mapping assert 'properties' in mapping assert mapping['properties']['object_options'].get('type', 'object') != 'neste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_mapping_nested(registry):\n with mappings_use_nested(True):\n mapping = type_mapping(registry[TYPES], 'TestingLinkTargetElasticSearch')\n assert mapping\n assert 'properties' in mapping\n # if type is defined on this field, it should beg object, NOT nested since it is n...
[ "0.8126932", "0.72236913", "0.7048768", "0.6998724", "0.6372483", "0.61942005", "0.61895186", "0.5984007", "0.59549826", "0.5913331", "0.5892807", "0.58536166", "0.5798939", "0.5778446", "0.57278585", "0.5703927", "0.5660505", "0.5648864", "0.5636653", "0.5601702", "0.5564571...
0.74837184
1
shape_dim=3, pad=list[1, 0, 1, 2], mode='constant', len(pad)=4, data_format=NCHW
def test_Pad3D2(): input_shape = (1, 1, 2, 3) pad = [1, 0, 1, 2] mode = "constant" res = [[[[0, 0, 0, 0], [0, 1, 2, 3], [0, 4, 5, 6], [0, 0, 0, 0], [0, 0, 0, 0]]]] data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1 obj.run(res=res, padding=pad, mode=mode, data_format="NCHW", data=da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D4():\n input_shape = (1, 2, 3)\n # pad = np.array([1, 2]).astype('int32')\n pad = [1, 2]\n mode = \"constant\"\n res = [[[0, 1, 2, 3, 0, 0], [0, 4, 5, 6, 0, 0]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.base(res=res, padding=pad, mode=mode, data_for...
[ "0.7654336", "0.7490466", "0.7420664", "0.73465514", "0.7226742", "0.7193922", "0.7180573", "0.70921624", "0.7064055", "0.70186174", "0.6976535", "0.6949792", "0.6924529", "0.6919691", "0.691756", "0.68563455", "0.68510145", "0.68434584", "0.68385047", "0.67980576", "0.678737...
0.7469832
2
shape_dim=3, pad=list[1, 0, 1, 2, 1, 0], mode='constant', len(pad)=5, data_format=NCDHW
def test_Pad3D3(): input_shape = (1, 1, 2, 3, 2) pad = [1, 0, 1, 2, 1, 0] mode = "constant" res = [ [ [ [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 1, 2], [0, 3, 4], [0, 5, 6], [0, 0, 0], [0, 0, 0]], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pad1():\n x = np.array([[[[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]]]])\n pad = [0, 0, 0, 0, 0, 0, 1, 1, 0, 0]\n mode = \"constant\"\n value = 0\n res = np.array([[[[[0.0, 0.0, 0.0], [1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [0.0, 0.0, 0.0]]]]])\n # data_format = \"NCDHW\"\n obj.run(res=res, x=x, pa...
[ "0.75662845", "0.7540344", "0.742286", "0.72925967", "0.7280196", "0.7252859", "0.71682745", "0.7100577", "0.70494133", "0.69772756", "0.69688433", "0.69683766", "0.69555044", "0.69063205", "0.6903578", "0.6878904", "0.68419415", "0.6807799", "0.6799152", "0.6793156", "0.6786...
0.67872256
20
shape_dim=3, pad=tensor[1, 2], mode='constant', len(pad)=2, data_format=NCL
def test_Pad3D4(): input_shape = (1, 2, 3) # pad = np.array([1, 2]).astype('int32') pad = [1, 2] mode = "constant" res = [[[0, 1, 2, 3, 0, 0], [0, 4, 5, 6, 0, 0]]] data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1 obj.base(res=res, padding=pad, mode=mode, data_format="NCL", dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D1():\n input_shape = (1, 2, 3)\n pad = [1, 2]\n mode = \"constant\"\n res = [[[0, 1, 2, 3, 0, 0], [0, 4, 5, 6, 0, 0]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.base(res=res, padding=pad, mode=mode, data_format=\"NCL\", data=data)", "def test_Pad3D16(...
[ "0.7340136", "0.7218572", "0.7137639", "0.7123048", "0.70074975", "0.6894596", "0.6894202", "0.68156576", "0.67800885", "0.6777805", "0.67192423", "0.6674043", "0.6633804", "0.6597761", "0.6552479", "0.6533389", "0.65330267", "0.64464813", "0.64454484", "0.64092356", "0.64089...
0.7512845
0
shape_dim=3, pad=tensor[1, 0, 1, 2], mode='constant', len(pad)=4, data_format=NCHW
def test_Pad3D5(): input_shape = (1, 1, 2, 3) # pad = np.array([1, 0, 1, 2]).astype('int32') pad = [1, 0, 1, 2] mode = "constant" res = [[[[0, 0, 0, 0], [0, 1, 2, 3], [0, 4, 5, 6], [0, 0, 0, 0], [0, 0, 0, 0]]]] data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1 obj.run(res=res, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D4():\n input_shape = (1, 2, 3)\n # pad = np.array([1, 2]).astype('int32')\n pad = [1, 2]\n mode = \"constant\"\n res = [[[0, 1, 2, 3, 0, 0], [0, 4, 5, 6, 0, 0]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.base(res=res, padding=pad, mode=mode, data_for...
[ "0.7555017", "0.7396482", "0.7254787", "0.721744", "0.71152276", "0.7049675", "0.7046378", "0.70024747", "0.700044", "0.6937854", "0.6908162", "0.68594635", "0.6833953", "0.6811814", "0.67920035", "0.6791336", "0.67853403", "0.6761495", "0.6758956", "0.6755592", "0.6754462", ...
0.7529686
1
shape_dim=3, pad=tensor[1, 0, 1, 2, 1, 0], mode='constant', len(pad)=5, data_format=NCDHW
def test_Pad3D6(): input_shape = (1, 1, 2, 3, 2) # pad = np.array([1, 0, 1, 2, 1, 0]).astype('int32') pad = [1, 0, 1, 2, 1, 0] mode = "constant" res = [ [ [ [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 1, 2], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D4():\n input_shape = (1, 2, 3)\n # pad = np.array([1, 2]).astype('int32')\n pad = [1, 2]\n mode = \"constant\"\n res = [[[0, 1, 2, 3, 0, 0], [0, 4, 5, 6, 0, 0]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.base(res=res, padding=pad, mode=mode, data_for...
[ "0.7662372", "0.750984", "0.7389826", "0.737796", "0.73491687", "0.7303239", "0.7161299", "0.71528107", "0.7130042", "0.71092445", "0.7099003", "0.70533913", "0.70101255", "0.70073736", "0.6976656", "0.6956613", "0.69105595", "0.69081724", "0.6896971", "0.68620324", "0.680875...
0.7378659
3
shape_dim=3, pad=tensor[1, 1, 1, 0], mode='reflect', len(pad)=2, data_format='NHWC'
def test_Pad3D13(): input_shape = (1, 2, 3, 1) pad = [1, 1, 1, 0] mode = "reflect" res = [[[[5], [4], [5], [6], [5]], [[2], [1], [2], [3], [2]], [[5], [4], [5], [6], [5]]]] data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1 obj.run(res=res, padding=pad, mode=mode, data_format="NHWC"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D10():\n input_shape = (1, 2, 3, 1)\n pad = [1, 1, 1, 0]\n mode = \"reflect\"\n res = [[[[5], [4], [5], [6], [5]], [[2], [1], [2], [3], [2]], [[5], [4], [5], [6], [5]]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data_...
[ "0.743592", "0.7412066", "0.7233009", "0.72233677", "0.71813476", "0.71769875", "0.71484405", "0.70754975", "0.70616287", "0.69861776", "0.69375956", "0.68913984", "0.68714756", "0.68257403", "0.67965996", "0.6769647", "0.67384905", "0.66786844", "0.66665286", "0.66623294", "...
0.75172204
0
shape_dim=5, pad=tensor[1, 1, 1, 0, 1, 0], mode='reflect', len(pad)=6, data_format='NCDHW'
def test_Pad3D14(): input_shape = (1, 1, 2, 2, 3) pad = [1, 1, 1, 0, 1, 0] mode = "reflect" res = [ [ [ [[11, 10, 11, 12, 11], [8, 7, 8, 9, 8], [11, 10, 11, 12, 11]], [[5, 4, 5, 6, 5], [2, 1, 2, 3, 2], [5, 4, 5, 6, 5]], [[11, 10, 11, 12...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D13():\n input_shape = (1, 2, 3, 1)\n pad = [1, 1, 1, 0]\n mode = \"reflect\"\n res = [[[[5], [4], [5], [6], [5]], [[2], [1], [2], [3], [2]], [[5], [4], [5], [6], [5]]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data_...
[ "0.74159276", "0.73505074", "0.7347053", "0.7296633", "0.7197961", "0.7161879", "0.7104169", "0.70967996", "0.70805526", "0.7051875", "0.6988852", "0.6967054", "0.6927947", "0.692254", "0.686987", "0.685738", "0.68168557", "0.6730891", "0.6720436", "0.6663409", "0.66591287", ...
0.72554225
4
shape_dim=5, pad=tensor[1, 1, 1, 0, 1, 0], mode='reflect', len(pad)=6, data_format='NDHWC'
def test_Pad3D15(): input_shape = (1, 2, 2, 2, 2) pad = [1, 1, 1, 0, 1, 0] mode = "reflect" res = [ [ [ [[15, 16], [13, 14], [15, 16], [13, 14]], [[11, 12], [9, 10], [11, 12], [9, 10]], [[15, 16], [13, 14], [15, 16], [13, 14]], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D13():\n input_shape = (1, 2, 3, 1)\n pad = [1, 1, 1, 0]\n mode = \"reflect\"\n res = [[[[5], [4], [5], [6], [5]], [[2], [1], [2], [3], [2]], [[5], [4], [5], [6], [5]]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data_...
[ "0.73033994", "0.7292438", "0.72568077", "0.7231375", "0.71220654", "0.7111816", "0.7053352", "0.70446354", "0.704453", "0.7032692", "0.6972225", "0.6951354", "0.69173455", "0.68622845", "0.6850194", "0.6779541", "0.67537934", "0.6668287", "0.66656756", "0.66129583", "0.66111...
0.696679
11
shape_dim=2, pad=list[1, 2], mode='replicate', len(pad)=2, data_format=NLC
def test_Pad3D19(): input_shape = (1, 2, 3) pad = [1, 2] mode = "replicate" res = [[[1, 2, 3], [1, 2, 3], [4, 5, 6], [4, 5, 6], [4, 5, 6]]] data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1 obj.run(res=res, padding=pad, mode=mode, data_format="NLC", data=data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D17():\n input_shape = (1, 2, 3)\n pad = [2, 1]\n mode = \"replicate\"\n res = [[[1, 1, 1, 2, 3, 3], [4, 4, 4, 5, 6, 6]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data=data, data_format=\"NCL\")", "def test_Pad3D21...
[ "0.77679384", "0.7764022", "0.77187085", "0.77154005", "0.70600796", "0.70272607", "0.70131814", "0.7012119", "0.69885784", "0.6947094", "0.69383657", "0.68388224", "0.66823745", "0.66219604", "0.64789426", "0.641125", "0.63886523", "0.63435936", "0.6326833", "0.62947047", "0...
0.78964156
0
shape_dim=3, pad=tensor[2, 1, 2, 1], mode='replicate', len(pad)=4, data_format=NCHW
def test_Pad3D22(): input_shape = (1, 2, 3, 4) # pad = np.array([2, 1, 2, 1]).astype('int32') pad = [2, 1, 2, 1] mode = "replicate" res = [ [ [ [1, 1, 1, 2, 3, 4, 4], [1, 1, 1, 2, 3, 4, 4], [1, 1, 1, 2, 3, 4, 4], [5,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D17():\n input_shape = (1, 2, 3)\n pad = [2, 1]\n mode = \"replicate\"\n res = [[[1, 1, 1, 2, 3, 3], [4, 4, 4, 5, 6, 6]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data=data, data_format=\"NCL\")", "def test_Pad3D21...
[ "0.7838047", "0.7807314", "0.7745948", "0.7727099", "0.7641656", "0.7349716", "0.7344733", "0.7277681", "0.7253258", "0.70974064", "0.70271283", "0.6997595", "0.6897639", "0.6827711", "0.67481184", "0.65439326", "0.6499213", "0.6462596", "0.6458212", "0.64375573", "0.6431722"...
0.74254006
5
shape_dim=3, pad=tensor[1, 2], mode='replicate', len(pad)=2, data_format=NLC
def test_Pad3D23(): input_shape = (1, 2, 3) # pad = np.array([1, 2]).astype('int32') pad = [1, 2] mode = "replicate" res = [[[1, 2, 3], [1, 2, 3], [4, 5, 6], [4, 5, 6], [4, 5, 6]]] data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1 obj.run(res=res, padding=pad, mode=mode, data_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D19():\n input_shape = (1, 2, 3)\n pad = [1, 2]\n mode = \"replicate\"\n res = [[[1, 2, 3], [1, 2, 3], [4, 5, 6], [4, 5, 6], [4, 5, 6]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data_format=\"NLC\", data=data)", "d...
[ "0.7821739", "0.78045696", "0.7774954", "0.76483345", "0.709158", "0.706124", "0.70458424", "0.6989657", "0.684847", "0.6810506", "0.6750841", "0.6719081", "0.6686029", "0.65552455", "0.64773965", "0.6456842", "0.64316356", "0.64259875", "0.63736147", "0.63414156", "0.6321948...
0.76746774
3
shape_dim=4, pad=tensor[2, 1, 2, 1], mode='replicate', len(pad)=4, data_format=NHWC
def test_Pad3D24(): input_shape = (1, 2, 3, 4) # pad = np.array([2, 1, 2, 1]).astype('int32') pad = [2, 1, 2, 1] mode = "replicate" res = [ [ [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [9, 10, 11, 12]], [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D17():\n input_shape = (1, 2, 3)\n pad = [2, 1]\n mode = \"replicate\"\n res = [[[1, 1, 1, 2, 3, 3], [4, 4, 4, 5, 6, 6]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data=data, data_format=\"NCL\")", "def test_Pad3D16...
[ "0.7814447", "0.7772543", "0.77265626", "0.7673276", "0.75570244", "0.74638146", "0.7358322", "0.73174787", "0.7295695", "0.72662014", "0.7123849", "0.702162", "0.69825655", "0.68721795", "0.68291444", "0.6772816", "0.6762772", "0.66881835", "0.66605955", "0.6541827", "0.6494...
0.72300696
10
shape_dim=5, pad=tensor[1, 1, 2, 3, 2], mode='replicate', len(pad)=6, data_format=NCDHW
def test_Pad3D25(): input_shape = (1, 1, 2, 3, 2) # pad = np.array([1, 0, 1, 0, 0, 1]).astype('int32') pad = [1, 0, 1, 0, 0, 1] mode = "replicate" res = [ [ [ [[1, 1, 2], [1, 1, 2], [3, 3, 4], [5, 5, 6]], [[7, 7, 8], [7, 7, 8], [9, 9, 10], [11, 11,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D17():\n input_shape = (1, 2, 3)\n pad = [2, 1]\n mode = \"replicate\"\n res = [[[1, 1, 1, 2, 3, 3], [4, 4, 4, 5, 6, 6]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data=data, data_format=\"NCL\")", "def test_Pad3D16...
[ "0.79083383", "0.7817455", "0.7796222", "0.77364194", "0.76230836", "0.7471142", "0.7300671", "0.7276346", "0.7252095", "0.7150862", "0.71423286", "0.7089405", "0.6997185", "0.69364095", "0.68881863", "0.6853526", "0.6759822", "0.67597955", "0.6710979", "0.6656928", "0.658895...
0.7463494
6
shape_dim=5, pad=tensor[1, 0, 1, 0, 0, 1], mode='replicate', len(pad)=4, data_format=NDHWC
def test_Pad3D26(): input_shape = (1, 1, 2, 3, 2) # pad = np.array([1, 0, 1, 0, 0, 1]).astype('int32') pad = [1, 0, 1, 0, 0, 1] mode = "replicate" res = [ [ [[[1, 2], [1, 2], [3, 4], [5, 6]], [[1, 2], [1, 2], [3, 4], [5, 6]], [[7, 8], [7, 8], [9, 10], [11, 12]]], [[[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Pad3D17():\n input_shape = (1, 2, 3)\n pad = [2, 1]\n mode = \"replicate\"\n res = [[[1, 1, 1, 2, 3, 3], [4, 4, 4, 5, 6, 6]]]\n data = np.arange(np.prod(input_shape)).reshape(input_shape) + 1\n obj.run(res=res, padding=pad, mode=mode, data=data, data_format=\"NCL\")", "def test_Pad3D21...
[ "0.7741714", "0.7647913", "0.76475126", "0.7538164", "0.7389204", "0.73157555", "0.71767527", "0.70764136", "0.70763034", "0.70462316", "0.69528043", "0.6950745", "0.69362324", "0.68402594", "0.68290484", "0.6715223", "0.6685063", "0.6645689", "0.6570642", "0.65662354", "0.64...
0.73376703
5
Given an antigenic determinant Ag this function returns the binding value of the best possible binder.
def best_B(Ag): top = 0 for i in range(len(Ag)): etop = np.min(cf.TD20[int(Ag[i]) - 1]) top += etop return top
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_max_estimated_bandit(self)->Bandit:\n # print(\"mus - \", self.mu)\n # print(\"actions - \", np.argmax(self.mu))\n unique, counts = np.unique(self.mu, return_counts=True)\n lens = counts[np.argmax(unique)] \n if lens>1: # if two actions have same argmax\n # the...
[ "0.5351571", "0.5221184", "0.5145252", "0.51331145", "0.51322126", "0.50288653", "0.4994431", "0.4979145", "0.49413687", "0.4915336", "0.49099168", "0.4899014", "0.48592553", "0.4840802", "0.48334342", "0.48179087", "0.48163962", "0.48156092", "0.47926754", "0.479017", "0.478...
0.50658464
5
Given an antigenic determinant Ag this function returns the binding value of the best possible binder.
def worst_B(Ag): bottom = 0 for i in range(len(Ag)): etop = np.max(cf.TD20[int(Ag[i]) - 1]) bottom += etop return bottom
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_max_estimated_bandit(self)->Bandit:\n # print(\"mus - \", self.mu)\n # print(\"actions - \", np.argmax(self.mu))\n unique, counts = np.unique(self.mu, return_counts=True)\n lens = counts[np.argmax(unique)] \n if lens>1: # if two actions have same argmax\n # the...
[ "0.5349641", "0.52214587", "0.5147141", "0.5132312", "0.5130625", "0.50629574", "0.50290614", "0.49926332", "0.49767253", "0.49414885", "0.49130544", "0.4908112", "0.48994082", "0.48584002", "0.48386294", "0.48315725", "0.48167044", "0.481581", "0.4813242", "0.478801", "0.478...
0.47908765
19
Given the current antigen density and the lists of free cells, the function tries to activate a corresponding number of cells and applies an activation probability corresponding to its affinity to every one of them. The lists of remaining free cells as well as an event of germination to be added to the event_list are r...
def try_activation(Agden, free_naives, free_memory, tnow, RNs): activated = [] fail_naive = [] fail_memory = [] # randomize free cell lists random.shuffle(free_naives) random.shuffle(free_memory) # get number of cells to activate from naive list act_n = np.random.binomial(len(free_naives...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_activation(self):\r\n\r\n x=0\r\n edges=self.in_edges\r\n for edge in edges:\r\n x+= edge.source.activation*edge.weight\r\n self.activation=1/(1+exp(-x))", "def _update_activation_state(self):\n activation_count = 0\n for task_id in self.task_dict:...
[ "0.5888912", "0.5608717", "0.5381771", "0.5291022", "0.5285021", "0.52689457", "0.5249405", "0.52287054", "0.51110786", "0.5111017", "0.510888", "0.5092028", "0.5085741", "0.5020816", "0.5018179", "0.4999845", "0.4999845", "0.49943686", "0.49876347", "0.49850073", "0.49526134...
0.6911425
0
Returns BoundBoxArray of default boxes
def get_default_boxes(out_shapes, box_ratios): default_boxes = [] n_outs = len(out_shapes) scales = (box_scale(n_out + 1, n_outs) for n_out in range(n_outs)) layer_params = zip(out_shapes, scales, box_ratios) for out_shape, scale, layer_box_ratios in layer_params: height, width = height_an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_boxes(self):\r\n\r\n boxes = [(\" \", self.worldbox.tl, self.worldbox.br)]\r\n# boxes = []\r\n boxes += [(\".\", b.tl, b.br) for b in self.wallboxes]\r\n boxes += [(\"x\", b.tl, b.br) for b in self.targetboxes]\r\n agentscale = 100\r\n boxes += [(\"a\", (self.i_sta...
[ "0.6688832", "0.65859437", "0.6556119", "0.6538074", "0.6434962", "0.6420856", "0.6287684", "0.62804985", "0.62618226", "0.6227584", "0.62249935", "0.61945534", "0.61637175", "0.6134957", "0.60598016", "0.60597944", "0.6055284", "0.5994084", "0.5981978", "0.59624654", "0.5955...
0.7455453
0
Initialises a new ordered linked list object, with a given list of elements lst.
def __init__(self, lst=[]): self.__length = 0 # current length of the linked list self.__head = None # pointer to the first node in the list for e in lst: # initialize the list, self.add(e) # by adding elements one by one
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, lst=[]):\r\n self.__length = 0 # current length of the linked list\r\n self.__head = None # pointer to the first node in the list\r\n self.__last = None # pointer to the last node in the list\r\n lst.reverse() # reverse to ensure elements will appear in same order...
[ "0.7740163", "0.7060453", "0.6915438", "0.682955", "0.6793986", "0.6741357", "0.6705007", "0.66472715", "0.655822", "0.64578074", "0.64578074", "0.64578074", "0.64578074", "0.64578074", "0.6447554", "0.643696", "0.6430444", "0.6427214", "0.642692", "0.6379833", "0.6360155", ...
0.76552415
1
Accessor method which returns the first node of this ordered linked list, that is, the node which contains the smallest value.
def first(self): return self.__head
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_min(self):\n return min(self.nodes, key=int)", "def peek_min(self):\n if self.root:\n return self.root.min().value\n raise ValueError(\"cannot perform peek_min on an empty tree\")", "def get_min(self):\n if not self:\n return None\n return self....
[ "0.81764996", "0.79182667", "0.7882691", "0.7851913", "0.78107876", "0.78022695", "0.7747756", "0.77266836", "0.7677133", "0.7659275", "0.7654437", "0.7644344", "0.7615409", "0.7575615", "0.7573385", "0.7500086", "0.7494216", "0.74640614", "0.74186826", "0.73874044", "0.73755...
0.68364245
61
Adds a new Node with given value to the front of this ordered linked list. This is an auxiliary method that is only supposed to be called if we know that the value is smaller than all the values already contained in the ordered linked list, so that the overall order is maintained.
def __add_first(self, value): node = self.Node(value, self.__head) if self.__head == None: # when this is the first element being added, self.__last = node # set the last pointer to this new node self.__head = node self.__length += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_front(self, value):\n new_node = self.Node(value)\n\n # Edge Case : List is empty\n if self._size == 0:\n self._tail = new_node\n self._head = new_node\n self._size += 1\n return\n\n new_node.next = self._head\n self._head.prev...
[ "0.78091425", "0.77272195", "0.7611038", "0.75780684", "0.75718963", "0.7459533", "0.74196374", "0.7407554", "0.7384229", "0.736899", "0.7315367", "0.7315367", "0.72517544", "0.7245648", "0.7213726", "0.7151177", "0.70638275", "0.701959", "0.69822204", "0.69464016", "0.687856...
0.69770986
19
Initialises a new Node object.
def __init__(self, cargo=None, next=None): self.__cargo = cargo self.__next = next
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.root = self.Node(None)", "def __init__(self):\n self.root = Node(None)", "def __init__(self):\n self.root = Node('')", "def __init__(self):\n self.root = Node(\"\")", "def __init__(self):\n self.root = Node(\"\")", "def __init__(self):\n ...
[ "0.77921003", "0.7778332", "0.77297866", "0.76963526", "0.76963526", "0.7634854", "0.7623182", "0.75772095", "0.75772095", "0.75772095", "0.74432504", "0.7215875", "0.71912783", "0.71554184", "0.71518826", "0.71281755", "0.7120187", "0.71156466", "0.71049297", "0.7079656", "0...
0.0
-1
Returns the value of the cargo contained in this node.
def value(self): return self.__cargo
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self):\r\n return self.__cargo", "def value(self):\n return self.node_value", "def value(self):\n return self.get_attribute(\"value\", str(self.children))", "def getValue(self):\n return _libsbml.ASTNode_getValue(self)", "def getValue(self):\n \n retu...
[ "0.8142979", "0.73237133", "0.7138349", "0.69184244", "0.6778445", "0.6735514", "0.6679945", "0.6646512", "0.6615436", "0.6615436", "0.6615436", "0.66109717", "0.66104925", "0.6604634", "0.6604634", "0.6604634", "0.6604634", "0.6604634", "0.6604634", "0.6604634", "0.6604634",...
0.8199494
0
Sets the next node to which this node links to a new node.
def set_next(self, node): self.__next = node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_next(self, node):\r\n self.__next = node", "def setNext(self, nextNode):\n self.__next = nextNode", "def setNext(self, next_node):\n self.__nextListNode = next_node", "def set_next(self, new_next):\n self.next = new_next", "def set_next(node, value):\n node['next'...
[ "0.8509538", "0.8496066", "0.82056004", "0.8112863", "0.7974405", "0.7625557", "0.7229691", "0.7090621", "0.70846665", "0.6991292", "0.6870906", "0.68653274", "0.6865088", "0.67446786", "0.67255944", "0.6717994", "0.6687373", "0.6640869", "0.6640869", "0.6627806", "0.6559243"...
0.8494053
2
Gets the display_name of this PaymentConnectorFeature.
def display_name(self): return self._display_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_display_name(self):\n\n return self._display_name", "def get_display_name(self):\n return self.display_name", "def display_name(self):\n answer = self._call('display_name')\n return answer.display_name", "def get_real_name(self):\n return self.get_display_name()", ...
[ "0.7561912", "0.751094", "0.72627157", "0.72461915", "0.7222194", "0.72179765", "0.71875894", "0.7175215", "0.7112131", "0.71024853", "0.70437974", "0.7041181", "0.7002803", "0.7002803", "0.7002803", "0.7002803", "0.7002803", "0.6986836", "0.6973597", "0.6973597", "0.6973597"...
0.7203008
10
Sets the display_name of this PaymentConnectorFeature.
def display_name(self, display_name): self._display_name = display_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_display_name(self, display_name):\n self._call('set_display_name', display_name=display_name)", "def display_name(self, display_name: str):\n\n self._display_name = display_name", "def display_name(self, display_name):\n self._display_name = display_name", "def display_name(self,...
[ "0.77927107", "0.75692034", "0.7472612", "0.7472612", "0.7472612", "0.7472612", "0.7472612", "0.7472612", "0.7175375", "0.67323333", "0.66408306", "0.65522176", "0.633011", "0.6320054", "0.62863845", "0.598195", "0.5700215", "0.5592656", "0.5562823", "0.5526473", "0.5505136",...
0.75479156
4
Gets the id of this PaymentConnectorFeature. A unique identifier for the object.
def id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getId(self):\n\n return self.__id", "def get_id(self):\n return self.__id", "def get_id(self):\n return self.__id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n ...
[ "0.73423165", "0.7236381", "0.7236381", "0.7226039", "0.7226039", "0.7226039", "0.7226039", "0.7226039", "0.7226039", "0.7158059", "0.71346587", "0.7133006", "0.7133006", "0.7133006", "0.7133006", "0.7133006", "0.7133006", "0.7133006", "0.7133006", "0.7133006", "0.7133006", ...
0.7068682
66
Sets the id of this PaymentConnectorFeature. A unique identifier for the object.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id_):\n\n self.id_ = id_", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self...
[ "0.74490535", "0.72968864", "0.7231496", "0.7154009", "0.7154009", "0.7154009", "0.7154009", "0.7154009", "0.71410877", "0.7047629", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", "0.7040756", ...
0.70190847
62
Test that a user cannot login with empty username field
def test_login_with_empty_username(self): reply = self.admin_register() user = dict( username='', password='Andela8' ) resp = self.client.post( '/api/v1/login', content_type='application/json', data=json.dumps(user) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_login_empty_username(self):\n self.client.post('api/v2/auth/signup', json=self.user,\n headers={'Content-Type': 'application/json'})\n\n res_other = self.client.post('/api/v2/auth/login', json={\n 'username': None, 'password': 'mikemike...
[ "0.8078761", "0.8062163", "0.7974315", "0.79485184", "0.7934821", "0.7914307", "0.79056597", "0.78887635", "0.7870847", "0.7864279", "0.78444946", "0.7687297", "0.76516205", "0.7645689", "0.7599193", "0.7580075", "0.7564029", "0.75490427", "0.75483316", "0.746798", "0.7466088...
0.75446635
19
Test that a user cannot login with wrong username field
def test_login_with_wrong_username(self): reply = self.admin_register() user = dict( username='codjoe', password='Andela8' ) resp = self.client.post( '/api/v1/login', content_type='application/json', data=json.dumps(user) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_auth_user_fail_bad_username(self):\n\n self.assertFalse(User.authenticate(\"invalid\", \"allison\"))", "def test_incorrect_username(db_session):\n assert (login(\"unknown\", \"unknown\") == \"login.failed\")", "def test_login_wrong_credentials(self):\n\t\tdata = {'username' : 'nonexistentuse...
[ "0.83991957", "0.83037066", "0.80475605", "0.8039845", "0.8024497", "0.79718864", "0.7938867", "0.7934477", "0.7886918", "0.7872755", "0.7827663", "0.7770981", "0.7758777", "0.7727451", "0.7698669", "0.7668497", "0.76654756", "0.76428443", "0.76231664", "0.7587218", "0.755864...
0.74700737
22
Test that a user cannot login with wrong password field
def test_login_with_wrong_password(self): reply = self.admin_register() user = dict( username='jonnie', password='Andyandy8' ) resp = self.client.post( '/api/v1/login', content_type='application/json', data=json.dumps(user) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_password(self):\n pass", "def test_invalid_password(self):\n self.signup('Bo', 'Theo', 'Bo_theo5@example.com', 'Bo1995', 'Bo1995')\n rv = self.login('Bo_theo5@example.com', 'Bo1905')\n self.assertIn(b'Invalid password! Please try again', rv.data)", "def test_wrong_l...
[ "0.8471716", "0.83261424", "0.825722", "0.82194096", "0.819648", "0.812804", "0.8068882", "0.80686486", "0.80633616", "0.8062904", "0.8058058", "0.79975355", "0.7966156", "0.79575944", "0.7954828", "0.7944132", "0.789939", "0.78980815", "0.7897409", "0.7885264", "0.7877711", ...
0.7516858
45
Test admin cannot create a store attendant with invalid name
def test_admin_cannot_create_user_with_invalid_name(self): resp = self.admin_register() reply = self.admin_login() token = reply['token'] user = dict( name='Summer Love3', username='love', password='Andela8', role='attendant' ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_creation_when_service_attributes_name_has_invalid_characters(self):\n self.data = {\n \"service_name\": \"Live at the yard\",\n \"service_price\": \"5000\",\n \"service_description\": \"See Kendrick perform live at the yard\",\n \"service_category\": \"Mu...
[ "0.63696283", "0.63281405", "0.62547994", "0.6233293", "0.6166029", "0.61309755", "0.60944617", "0.6080471", "0.60634327", "0.5998286", "0.5996367", "0.59794825", "0.5979313", "0.59451264", "0.59078234", "0.5898085", "0.5879234", "0.5875313", "0.58493066", "0.5824537", "0.582...
0.0
-1
Test admin cannot update a store attendant with invalid name
def test_admin_cannot_update_user_with_invalid_name(self): resp = self.admin_create_user() reply = self.admin_login() token = reply['token'] user = dict( name='Summer Lover3', username='lover', password='Andela8', role='attendant' )...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_on_unique_field_raises(test_store):\n\n with pytest.raises(NotImplementedError):\n test_store.update(fields={\"name\": \"Andy\"})", "def test_handle_removals_add_if_named_in_attribute(self):\n self.assertFalse(False)", "def test_cannot_change_metername_to_existing_(self):\n ...
[ "0.6271996", "0.6178259", "0.6169266", "0.61599195", "0.6130663", "0.6074603", "0.6024411", "0.5943704", "0.5942971", "0.5843498", "0.58002824", "0.57940793", "0.5784665", "0.5782922", "0.57820934", "0.57724595", "0.57670957", "0.57650936", "0.57545877", "0.5748327", "0.57469...
0.56740123
28
Test admin cannot update a store attendant with invalid username
def test_admin_cannot_update_user_with_invalid_username(self): resp = self.admin_create_user() reply = self.admin_login() token = reply['token'] user = dict( name='Summer Love', username='love summer', password='Andela8', role='attendant' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_admin_cannot_update_user_with_invalid_name(self):\n resp = self.admin_create_user()\n reply = self.admin_login()\n token = reply['token']\n user = dict(\n name='Summer Lover3',\n username='lover',\n password='Andela8',\n role='attenda...
[ "0.6882498", "0.6805685", "0.67120755", "0.6652845", "0.6626257", "0.66236037", "0.66232955", "0.6510223", "0.6469667", "0.64549625", "0.6385028", "0.63423777", "0.6299679", "0.6264924", "0.6254841", "0.62495565", "0.6238614", "0.6227551", "0.62265486", "0.6219083", "0.620443...
0.6969854
0
Test admin cannot delete a store attendant\ with blacklisted token
def test_cannot_delete_user_with_blacklisted_token(self): resp = self.admin_create_user() reply = self.admin_login() token = reply['token'] resp = self.client.delete( '/api/v1/logout', headers={'Authorization': 'Bearer {}'.format(token)} ) reply =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_deletehardwares_item(self):\n pass", "def test_delete_device_token(self):\n pass", "def test_security_on_delete(self):\n # test the delete product url\n product = Product.objects.all()[0]\n url = '/product/xml/%s/' % product.item_number\n response = self.clien...
[ "0.68972754", "0.6841065", "0.68207014", "0.6764334", "0.67166734", "0.67044437", "0.65594095", "0.6529816", "0.651435", "0.65126157", "0.6501518", "0.6485752", "0.6480303", "0.6476205", "0.64554155", "0.64506876", "0.6440984", "0.6435584", "0.6421455", "0.64211965", "0.64038...
0.64773715
13
Gets the error_details of this WorkRequest.
def error_details(self): return self._error_details
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_details(self) -> Sequence['outputs.JobErrorDetailsResponse']:\n return pulumi.get(self, \"error_details\")", "def error_details(self) -> Sequence['outputs.JobErrorDetailsResponse']:\n return pulumi.get(self, \"error_details\")", "def error_details(self) -> Sequence['outputs.JobErrorDeta...
[ "0.7687312", "0.7687312", "0.7687312", "0.7687312", "0.75932133", "0.71988595", "0.7126288", "0.70466316", "0.67343795", "0.672883", "0.6612877", "0.659201", "0.65748554", "0.6505508", "0.6468211", "0.6435177", "0.64291966", "0.63854223", "0.6382505", "0.6382505", "0.6382505"...
0.8006274
0
Sets the error_details of this WorkRequest.
def error_details(self, error_details): self._error_details = error_details
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_detail(self, error_detail):\n\n self._error_detail = error_detail", "def set_error(self, error):\n self._set_sub_text('error', text=str(error))\n return self", "def set_error_details(code, desc):\n MDC.put('errorCode', code)\n MDC.put('errorDescription', desc)", "def erro...
[ "0.7288278", "0.62475634", "0.6221895", "0.6116249", "0.6079993", "0.6001644", "0.6001644", "0.6001644", "0.5962383", "0.5880566", "0.5878469", "0.58783144", "0.57903564", "0.5766922", "0.5754919", "0.574586", "0.57366425", "0.5700703", "0.5700703", "0.5700703", "0.5700703", ...
0.81081605
0
Sets the id of this WorkRequest. The `OCID`__ of the work request.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_id(self, request_id):\n\n self._request_id = request_id", "def request_id(self, request_id):\n\n self._request_id = request_id", "def request_id(self, request_id):\n\n self._request_id = request_id", "def setRequestId(self, reqid) :\n self.request_id = reqid", "def s...
[ "0.6883612", "0.6883612", "0.6883612", "0.6793425", "0.66272616", "0.6523487", "0.6373973", "0.6324151", "0.63112193", "0.6303391", "0.62456447", "0.61715215", "0.6157101", "0.6152113", "0.61331797", "0.61331797", "0.61331797", "0.61331797", "0.61331797", "0.61074173", "0.609...
0.6070127
24
Gets the lifecycle_state of this WorkRequest.
def lifecycle_state(self): return self._lifecycle_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lifecycle_state(self) -> str:\n return self._lifecycle_state", "def workflow_state(self):\n return self.getattr('workflow_state')", "def get_workflow_state(self):\n state = self._gdb_interface.get_workflow_state()\n return state", "def get_workflow_state(self):\n return...
[ "0.7557288", "0.677958", "0.6393474", "0.63386273", "0.6293644", "0.6160611", "0.6160611", "0.610906", "0.610906", "0.610906", "0.610906", "0.610906", "0.6079117", "0.6025869", "0.6025869", "0.6025869", "0.6025869", "0.6025869", "0.6025869", "0.6025869", "0.6025869", "0.602...
0.80511534
3
Gets the load_balancer_id of this WorkRequest. The `OCID`__ of the load balancer with which the work request is associated.
def load_balancer_id(self): return self._load_balancer_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> ...
[ "0.7890315", "0.7890315", "0.7890315", "0.78116715", "0.7780647", "0.7739434", "0.7739434", "0.656374", "0.6504513", "0.6472288", "0.63884926", "0.63022023", "0.6237915", "0.60421634", "0.58649844", "0.55915666", "0.55746996", "0.5552787", "0.5515452", "0.5499319", "0.5448212...
0.79292524
0
Sets the load_balancer_id of this WorkRequest. The `OCID`__ of the load balancer with which the work request is associated.
def load_balancer_id(self, load_balancer_id): self._load_balancer_id = load_balancer_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, request, loadbalancer_id):\n kwargs = {'loadbalancer_id': loadbalancer_id}\n update_loadbalancer(request, **kwargs)", "def load_balancer_id(self):\n return self._load_balancer_id", "def load_balancer_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"load_balan...
[ "0.66619974", "0.65204686", "0.6427702", "0.6352528", "0.6352528", "0.6352528", "0.6221372", "0.6221372", "0.6017137", "0.59453", "0.5768332", "0.57498705", "0.57174456", "0.5444608", "0.5366137", "0.5321263", "0.5312888", "0.5203628", "0.51420414", "0.51369774", "0.5123431",...
0.8018049
0
Gets the message of this WorkRequest. A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure.
def message(self): return self._message
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message(self):\n \n return(self.__message)", "def message(self):\n \n return(self.__message)", "def message(self):\n \n return(self.__message)", "def message(self):\n \n return(self.__message)", "def message(self):\n \n return(self._...
[ "0.6603588", "0.6603588", "0.6603588", "0.6603588", "0.6603588", "0.6603588", "0.6533593", "0.65062934", "0.65062934", "0.64120793", "0.6386086", "0.6386086", "0.6386086", "0.63620573", "0.6335121", "0.6335121", "0.6256306", "0.6256306", "0.623964", "0.623964", "0.623964", ...
0.64230376
11
Gets the type of this WorkRequest. The type of action the work request represents.
def type(self): return self._type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"action_type\")", "def action_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"action_type\")", "def action_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"action_type\")", "def req...
[ "0.73761845", "0.7193799", "0.70277214", "0.66800797", "0.6592663", "0.6583373", "0.6582203", "0.6582203", "0.655946", "0.655946", "0.6533805", "0.64887404", "0.64813894", "0.64813894", "0.64813894", "0.64813894", "0.64813894", "0.64813894", "0.64813894", "0.64813894", "0.648...
0.64490545
41
Sets the type of this WorkRequest. The type of action the work request represents.
def type(self, type): self._type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self._type = type", "def type(self, type):\n allowed_values = [\"WORKSPACE\", \"PLAN\", \"FLOW\", \"ACTION\", \"CONNECTION\", \"RESOURCE\", \"ENGINE\", \"CLU...
[ "0.6972563", "0.6972563", "0.69316924", "0.6892753", "0.67680657", "0.6761081", "0.6699801", "0.6636279", "0.6636279", "0.6636279", "0.66086084", "0.6567526", "0.6567526", "0.6567526", "0.6567526", "0.6567526", "0.6567526", "0.6567526", "0.6567526", "0.6567526", "0.6567526", ...
0.6582126
11
Get column index in source dataframe
def get_source_column(self, column): return self._source.columns.get_loc(self._dataframe.columns[column])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_index(self, column_label):\n return self.column_labels.index(column_label)", "def column_indexer(data):\n idCol = {label: index for index, label in enumerate(data.columns)}\n return idCol", "def get_index(df, string):\n return df.columns.to_list().index(string)", "def get_index(sel...
[ "0.7068904", "0.6954265", "0.69237924", "0.6868694", "0.6811877", "0.67842937", "0.6667752", "0.6572164", "0.6550169", "0.6531503", "0.64432275", "0.6383303", "0.6330165", "0.63016015", "0.62979275", "0.62838864", "0.6270896", "0.6269126", "0.62105143", "0.6160488", "0.615986...
0.64693534
10
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary mtype = dictionary.get("type") filename = dictionary.get("filename") payload = dictionary.get("payload") # Return an obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407", ...
0.79231393
7
Return a string representation of this variant. The reason that 1 is added to the variant position is to offset the nucleotide shared by the reference and alternate alleles. This position is still 0based (as opposed to VCF's 1based coordinate system) but does not include the shared nucleotide.
def __str__(self): pos = self._pos + 1 if len(self._refr) > len(self._alt): dellength = len(self._refr) - len(self._alt) return '{:s}:{:d}:{:d}D'.format(self._seqid, pos, dellength) else: insertion = self._alt[1:] return '{:s}:{:d}:I->{:s}'.format(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\r\n information = self.get_dna_fragment()\r\n\r\n return \"protein indices = \" + str(self._indices) + \": \\n\" + \\\r\n \"t~ strand = \" + str(information[0][0]) + \"\\n\" + \\\r\n \" \" + str(information[0][1]) + \"\\n\" + \\\r\n ...
[ "0.6963634", "0.68525696", "0.6752896", "0.6676959", "0.6674017", "0.6673842", "0.6673129", "0.66580343", "0.6591888", "0.6558183", "0.6554908", "0.6554137", "0.6539907", "0.6523456", "0.64738643", "0.6416141", "0.64127916", "0.63763535", "0.63673836", "0.6347917", "0.6336049...
0.6542516
12
Return a Network class instance with three devices in the network.
def network_with_devices(): new_names = Names() new_devices = Devices(new_names) new_network = Network(new_names, new_devices) [SW1_ID, SW2_ID, OR1_ID] = new_names.lookup(["Sw1", "Sw2", "Or1"]) # Add devices new_devices.make_device(SW1_ID, new_devices.SWITCH, 0) new_devices.make_device(SW2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_network():\n new_names = Names()\n new_devices = Devices(new_names)\n return Network(new_names, new_devices)", "def get_network(self):\n\n # Find which nodes are input and which are output. We may want to store\n # this info somewhere else (like in the genome)\n\n inputs = [...
[ "0.62895656", "0.5824083", "0.5780455", "0.5759089", "0.5730831", "0.5706215", "0.57014054", "0.5680786", "0.56487197", "0.56329834", "0.55932325", "0.5591472", "0.55858415", "0.55215573", "0.5447525", "0.5435627", "0.5412156", "0.5403432", "0.5399039", "0.537979", "0.5357020...
0.7487247
0
Splits camel cased sentence into words
def split_stem(sentence): sentence = re.sub('([a-z])([A-Z])', u'\\1 \\2', sentence) return sentence.split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_split(self, sentence):\n return re.split(self.word_split_pattern, sentence)", "def camelCaseSplit(text):\n matches = re.finditer('.+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)', text)\n return [m.group(0) for m in matches]", "def split_into_words(sentences):\n return list(sente...
[ "0.74363184", "0.73811966", "0.7280664", "0.72653717", "0.71818453", "0.71818453", "0.71492934", "0.7115417", "0.69877803", "0.69576484", "0.69048864", "0.68395156", "0.683791", "0.68267936", "0.680151", "0.6744926", "0.67245764", "0.67170674", "0.66982347", "0.66821474", "0....
0.7338641
2
Compare two ContentItem objects with each other in a weak way we only take the filename and path into consideration and ignore constraints (as the proper __eq__ method would do).
def _content_item_comparison_weak(item_a, item_b): if item_a is None or item_b is None: log.debug("Item is None") return False return item_a.get_xml() == item_b.get_xml()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self.doc_type == other.doc_type and \\\n self.src == other.src and \\\n self.name == other.name", "def __eq__(self, other):\n contentsmatchfail = False\n equal = False\n for i in self.contents:\n if i in other.contents...
[ "0.66765034", "0.6653508", "0.6383707", "0.6308725", "0.6296383", "0.6288879", "0.6228396", "0.62265986", "0.6225754", "0.62123716", "0.6193374", "0.6163143", "0.61564714", "0.6117004", "0.60719264", "0.60421354", "0.60350317", "0.6013134", "0.6004329", "0.5997933", "0.599631...
0.71401227
0
map on the list of tensors unpacked from `elems` on dimension 0. The simplest version of `map_fn` repeatedly applies the callable `fn` to a sequence of elements from first to last. The elements are made of the tensors unpacked from `elems`. `dtype` is the data type of the return value of `fn`. Users must provide `dtype...
def map_fn(fn, elems, dtype=None, parallel_iterations=None, back_prop=True, swap_memory=False, infer_shape=True, name=None): if not callable(fn): raise TypeError("fn must be callable.") if isinstance(elems, sparse_tensor.SparseTensor): raise TypeError( "To perform a map on the values of ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map(self, fn, *iterables, **kwargs):\n fn = self._prepare_fn(fn)\n return self._self.map(fn, *iterables, **kwargs)", "def array_map(fn, arrs, n):\n # we shouldn't need a special case for n == 0, but NumPy complains about indexing into a zero-dimensional\n # array a using a[(Ellipsis,)].\n...
[ "0.58948135", "0.57702446", "0.56236166", "0.54255617", "0.542432", "0.54126114", "0.541121", "0.53815204", "0.5381166", "0.53656024", "0.5327522", "0.5287739", "0.5266946", "0.5264301", "0.52466375", "0.5220995", "0.5209663", "0.5201138", "0.5159362", "0.5151307", "0.5148298...
0.7334713
0
Looked all elelemns in list except for searching for
def delete(self, name): global items items = _Helper.all_item_except_searching_for(name) return {"message": f"Item {name} deleted successfully"}, 204
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_matching_list(self):\n\n pre_result = comp(self.regex)\n\n return list(\n filter(lambda element: not pre_result.search(element), self.data)\n )", "def find_all_items(items: WebElements, value_list: List[str]=PARAMS_LEAGUES) -> WebElements:\n items_list =...
[ "0.65521616", "0.6507834", "0.6163646", "0.6030631", "0.60255146", "0.597149", "0.5951183", "0.59278035", "0.59115636", "0.5896662", "0.5874248", "0.5820662", "0.5788583", "0.5755495", "0.57515734", "0.5717421", "0.5714397", "0.5708168", "0.56975746", "0.5676657", "0.56546396...
0.0
-1
Send a request and return a response. If argument ``cache_key`` is not ``None``, session will check its cache before sending the request. For now, we don't support setting ``cache_key`` in ``request``. ``sticky_key`` is similar to ``cache_key`` except that it refers to an unbounded cache (thus the name "sticky"). If ar...
async def __call__(self, request, **kwargs): cache_key = kwargs.pop('cache_key', None) sticky_key = kwargs.pop('sticky_key', None) cache_revalidate = kwargs.pop('cache_revalidate', None) if cache_key is not None and sticky_key is not None: raise AssertionError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, request, **kw):\r\n if request.method == 'GET':\r\n cached_response = self.controller.cached_request(request)\r\n if cached_response:\r\n return self.build_response(request, cached_response, from_cache=True)\r\n\r\n # check for etags and add hea...
[ "0.56710464", "0.5380218", "0.5277406", "0.51162297", "0.49647447", "0.49608576", "0.49380323", "0.4910418", "0.48294824", "0.4757973", "0.46899825", "0.46096906", "0.45851278", "0.45390433", "0.4521895", "0.45152617", "0.450051", "0.44955355", "0.44897163", "0.44563928", "0....
0.60925895
0