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
Copies value of other MPCTensor into this MPCTensor.
def copy_(self, other): assert isinstance(other, MPCTensor), "other must be MPCTensor" self._tensor.copy_(other._tensor) self.ptype = other.ptype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concatenate(\n self,\n other: TensorWrappedPhiTensorPointer,\n *args: List[Any],\n **kwargs: Dict[str, Any],\n ) -> MPCTensor:\n if not isinstance(other, TensorWrappedPhiTensorPointer):\n raise ValueError(\n f\"Concatenate works only for TensorWra...
[ "0.5957115", "0.59123105", "0.5891556", "0.58161926", "0.57936835", "0.57461005", "0.57452", "0.5669143", "0.56453496", "0.56026965", "0.5550587", "0.5543746", "0.5534818", "0.55332416", "0.5528913", "0.5523316", "0.55155593", "0.5429825", "0.538291", "0.5350621", "0.5349411"...
0.8018522
0
Return the `torch.device` of the underlying share
def device(self): return self.share.device
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device(self) -> torch.device:\n for param in self.parameters():\n return param.device\n return get_device(\"cpu\")", "def device():\n return torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')", "def device(self):\n return torch.cuda.current_device()", "def d...
[ "0.78723484", "0.7864349", "0.7861153", "0.7813246", "0.77801776", "0.7703193", "0.762871", "0.7331279", "0.7299924", "0.7298117", "0.72913045", "0.7237661", "0.7237661", "0.7237661", "0.7237661", "0.7237661", "0.72068906", "0.7194256", "0.7149791", "0.70744073", "0.70438606"...
0.76586616
6
Call `torch.Tensor.cpu` on the underlying share
def cpu(self): self.share = self.share.cpu() return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cpu(self, *args, **kwargs):\n self._tensor = self._tensor.cpu(*args, **kwargs)\n return self", "def cpu(self):\n self.reader.model.cpu()\n self.reader.device = torch.device(\"cpu\")\n return self", "def with_cpu(ops, model):\n ...", "def cpu(self) -> 'BatchEmbedder':...
[ "0.76786083", "0.7008894", "0.6632453", "0.6505153", "0.62869805", "0.599369", "0.5987537", "0.59495103", "0.58982354", "0.5884555", "0.5867171", "0.5794867", "0.5771184", "0.5684697", "0.56469554", "0.5627265", "0.5617357", "0.5617357", "0.56132585", "0.5609878", "0.5597312"...
0.69242954
2
Returns 1 for elements that are < 0 and 0 otherwise
def _ltz(self): shift = torch.iinfo(torch.long).bits - 1 precision = 0 if self.encoder.scale == 1 else None result = self._to_ptype(Ptype.binary) result.share >>= shift result = result._to_ptype(Ptype.arithmetic, precision=precision, bits=1) result.encoder._scale = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_gt_zero(x):\r\n s = x[0] + x[1]\r\n if s > 0.0:\r\n return 1.0\r\n return 0.0", "def onlyonepositive(a):\n nbr = 0\n for e in a:\n if e >= 0: \n nbr += 1\n if nbr>1: return False\n return nbr==1", "def check_zero(col):\n return np.sum(col == 0.0)...
[ "0.7404324", "0.7197258", "0.69972754", "0.6920221", "0.6890272", "0.68205565", "0.6811453", "0.6687126", "0.6681287", "0.6619779", "0.6592645", "0.656826", "0.65560913", "0.64507014", "0.6441335", "0.64341253", "0.6416983", "0.6416983", "0.63992506", "0.63659805", "0.631893"...
0.0
-1
Returns self == y
def eq(self, y): if comm.get().get_world_size() == 2: return (self - y)._eqz_2PC() return 1 - self.ne(y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self,y):\r\n\t\r\n\t\t# compare\r\n\t\tq = self.compare(y)\r\n\t\t\t\r\n\t\treturn q", "def __eq__(self,other):\n if self.x == other.x and self.y == other.y:\n return True\n else:\n return False\n pass", "def __eq__(self, other):\n x_eq = self.x == o...
[ "0.8355385", "0.77769613", "0.77367425", "0.77367425", "0.77257544", "0.76997656", "0.76812845", "0.7634397", "0.762615", "0.7546791", "0.75340766", "0.7519", "0.741281", "0.7358739", "0.7357912", "0.7351526", "0.7351526", "0.7307372", "0.7258089", "0.7246933", "0.7238714", ...
0.7106336
29
Returns self != y
def ne(self, y): if comm.get().get_world_size() == 2: return 1 - self.eq(y) difference = self - y difference.share = torch_stack([difference.share, -(difference.share)]) return difference._ltz().sum(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n return self.x != other.x or self.y != other.y", "def __ne__(self, y):\n if isinstance(y, Annotation):\n return ((self._name != y._name) or\n (self._value != y._value) or\n (self._start != y._start) or\n (...
[ "0.7969515", "0.79550064", "0.7879952", "0.75674444", "0.7565495", "0.7564373", "0.7504307", "0.7504307", "0.7492106", "0.7477315", "0.7477315", "0.7466425", "0.74612075", "0.7441007", "0.74299884", "0.74299884", "0.74299884", "0.74299884", "0.74299884", "0.74299884", "0.7429...
0.0
-1
Set xmin, xmax, ymin, ymax limits for the current axes, return None.
def xylim(xmin=None, xmax=None, ymin=None, ymax=None): plt.axis(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def py_apply_limits(self, plot):\n if any(x is not None for x in self.x_lim):\n if self.x_lim[0] is not None: # at least left?\n if self.x_lim[1] is not None: # left and right?\n plot.set_xlim(left=self.x_lim[0], right=self.x_lim[1])\n else:\n ...
[ "0.76024365", "0.7312595", "0.7309364", "0.71116495", "0.7063133", "0.70228314", "0.686462", "0.6837149", "0.6801906", "0.65906817", "0.6558059", "0.65214086", "0.64675707", "0.6457293", "0.6428343", "0.6325817", "0.62647146", "0.6247095", "0.6234377", "0.6225685", "0.6188348...
0.66815454
9
Split the lines at line boundaries and return in array
def __msgtolist(self) -> List[str]: return self.msg.splitlines()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def splitlines(self) -> List[String]:\n pass", "def _split_lines(self, lines, separator_marker):\n result = []\n current_group = []\n for line in lines:\n if re.match(rf'[^\\S\\n]*{separator_marker}\\w+(\\(.*\\))?:', line):\n if current_group:\n ...
[ "0.7218101", "0.67952824", "0.6602528", "0.65474486", "0.6518101", "0.63963073", "0.63492554", "0.6349183", "0.6347185", "0.6345261", "0.63269067", "0.6288498", "0.62693405", "0.62646383", "0.6263483", "0.6208731", "0.6208396", "0.6193057", "0.6184389", "0.6180772", "0.616446...
0.0
-1
Gets absolute url of Bookdetail template which is used to display information about book entries
def get_absolute_url(self): return reverse('book-detail', kwargs={'slug': self.slug})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('book-detail', args=[str(self.id)]) \n # Returns an URL that can be used to access a detail record for this model \n # (for this to work we will have to \n # -- Define a URL mapping that has the name 'book-detail' (name='book-detail')\n ...
[ "0.810921", "0.7891781", "0.78076833", "0.78076833", "0.78076833", "0.75761116", "0.7084116", "0.6965339", "0.6941134", "0.68117887", "0.6791385", "0.6704731", "0.66622996", "0.6646042", "0.6637434", "0.66242737", "0.6612218", "0.6611058", "0.65957165", "0.65932673", "0.65225...
0.7642694
5
Automatically creates a slug for each book entry saved
def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Book, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, *args, **kwargs):\n self.slug = slugify(self.name)\n super(Library, self).save(*args, **kwargs)", "def save(self, *args, **kwargs):\n if not self.slug:\n self.slug = self.generate_slug()\n super().save(*args, **kwargs)", "def save(self, *args, **kwargs):\n ...
[ "0.7505062", "0.7273466", "0.7273466", "0.7233949", "0.71366584", "0.7074197", "0.69359064", "0.6918211", "0.6870656", "0.6842604", "0.67412084", "0.67168504", "0.6687587", "0.66782063", "0.6674247", "0.6666809", "0.66545695", "0.66038054", "0.6599899", "0.6550993", "0.654756...
0.8270769
0
Gets the end time of the violation, converting it from an AppDynamics timestamp to standard
def end_time(self): return from_ts(self.end_time_ms)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_timestamp(self):\n return ms_from_dt(self.range().end())", "def timeEnd(self)->datetime:\n if self._scenario == LM_HardDate.Scenario.ValidSince:\n raise SdkError(\"timeEnd not defined for scenario 'ValidSince'\")\n\n return self._lic.params['timeEnd'].value", "def end_ti...
[ "0.7314572", "0.72998905", "0.72534895", "0.7002861", "0.69966066", "0.69106084", "0.67787886", "0.674159", "0.6727587", "0.6727587", "0.6727587", "0.6727587", "0.6727587", "0.6727587", "0.6688078", "0.66815054", "0.66242206", "0.66242206", "0.6604453", "0.6587329", "0.655604...
0.7369591
0
return the main page
def index(request): form = textForm() return render(request, 'index.html', {'form': form})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_page():\n return render_template(\"main_page.html\")", "def main_page():\n return render_template(\"index.html\")", "def initialPage():\n\treturn header() + footer()", "def main():\n page = get_page_arg()\n\n items = load_data(page)\n total_pages = get_total_pages()\n context = {\"...
[ "0.8133032", "0.79670745", "0.7684607", "0.76501375", "0.76168305", "0.75012046", "0.7324146", "0.7266503", "0.7237466", "0.7237466", "0.71995103", "0.71908", "0.7173991", "0.7139529", "0.70658386", "0.7047736", "0.70037806", "0.70013267", "0.6996821", "0.6982635", "0.6982635...
0.0
-1
Renders the AppTwp/index/html file.
def index(request): return render(request, 'AppTwo/index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n return render_template('index.html')", "def main():\n return render_template('index.html')", "def main_page():\n return render_template(\"index.html\")", "def index():\n return render_template(\"main.html\")", "def index(self):\n return render_template(\"{0}/index.html\".fo...
[ "0.79664296", "0.79664296", "0.7931701", "0.7902989", "0.78661793", "0.78656125", "0.78656125", "0.7864189", "0.7840471", "0.778667", "0.778667", "0.778667", "0.77807486", "0.77623326", "0.7761062", "0.7761062", "0.7733673", "0.7733673", "0.7719428", "0.77037275", "0.7696656"...
0.0
-1
Reassigns any previouslycalibrated plunger positions
def teardown_simulate(self): self.positions = self.calibrated_positions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_positions(self):\n self._initial_position = load_pose_from_npz(self._target_filename,\n self._actuator_name, str(self._target_number), 'initial')\n self._target_position = load_pose_from_npz(self._target_filename,\n self._actuator_name, str(self._target_numbe...
[ "0.65362966", "0.62123865", "0.61976653", "0.61879826", "0.61720854", "0.6123803", "0.6088379", "0.60843676", "0.6024271", "0.5974993", "0.5959433", "0.5941999", "0.59336644", "0.5910913", "0.5902308", "0.5868502", "0.5841637", "0.5829472", "0.5788584", "0.5781949", "0.577707...
0.6026156
8
Calculate axis position for a given liquid volume. Translates the passed liquid volume to absolute coordinates on the axis associated with this pipette. Calibration of the top and bottom positions are necessary for these calculations to work.
def _plunge_distance(self, volume): percent = self._volume_percentage(volume) top = self._get_plunger_position('top') bottom = self._get_plunger_position('bottom') travel = bottom - top if travel <= 0: self.robot.add_warning('Plunger calibrated incorrectly') r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_position(self):\n\n # Adjust position for x-axis\n r = self.rect.x % 30\n if r != 0:\n if r <= 16:\n x = self.rect.x - r\n else:\n x = self.rect.x + (30 - r)\n\n else:\n x = self.rect.x\n\n # Adjust positio...
[ "0.60968566", "0.5585847", "0.53853893", "0.5258289", "0.5227858", "0.51927245", "0.51925915", "0.518568", "0.517678", "0.5174256", "0.5174256", "0.51720023", "0.51596487", "0.5146248", "0.5140762", "0.5127996", "0.51265824", "0.5119669", "0.5118052", "0.5116514", "0.51095074...
0.0
-1
Checks whether there are any admins in the system.
def has_admins(cls, server, bucket=None): res = cls.find_on({'type': 'user', 'admin': True}, server, bucket) return True if res and len(res) > 0 else False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_admin():\n\tif not current_user.is_admin:\n\t\tabort(403)", "def check_admin() -> bool:\n return ctypes.windll.shell32.IsUserAnAdmin() == 1", "def is_admin(user):\n return get_organisations_as_admin(user).count() > 0", "def check_admin():\r\n if not current_user.is_admin:\r\n ab...
[ "0.7193409", "0.71624076", "0.7078613", "0.70312035", "0.7016864", "0.7008919", "0.7004457", "0.7004457", "0.69853336", "0.6913136", "0.6875009", "0.6840373", "0.6833715", "0.68257606", "0.6812188", "0.6808542", "0.6789574", "0.67666835", "0.6742645", "0.6685615", "0.6658654"...
0.72806084
0
DEPRECATED. Return a fullyqualified group string.
def group_path(cls, project, group): warnings.warn( "Resource name helper functions are deprecated.", PendingDeprecationWarning, stacklevel=1, ) return google.api_core.path_template.expand( "projects/{project}/groups/{group}", project=project, grou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return f\"{self._group.friendly_name} {GROUP_SUFFIX}\"", "def _group_name(cls, group=None):\n suffix = f\"{cls.__module__}.{cls.__qualname__}\"\n if group is not None:\n suffix += \"-\" + group\n\n # Wrap the suffix into SHA256 to guarantee that the length...
[ "0.70699936", "0.7020256", "0.6998976", "0.6988959", "0.69881046", "0.6947305", "0.69381833", "0.6885397", "0.68689024", "0.6835527", "0.6835527", "0.6835527", "0.6835527", "0.6826654", "0.67835253", "0.6781494", "0.6744048", "0.6618081", "0.6602624", "0.6578314", "0.651964",...
0.7601738
0
Deletes an existing group.
def delete_group( self, name, recursive=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): if metadata is None: metadata = [] metadata = list(metadata) # Wrap the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_group(self, group):\n raise NotImplementedError('delete_group')", "def deleteGroup(groupName):\r\n Group.deleteGroup(groupName)", "def delete_group(self, group_name):\r\n params = {'GroupName' : group_name}\r\n return self.get_response('DeleteGroup', params)", "def dele...
[ "0.8389858", "0.81484675", "0.81450933", "0.80678934", "0.80212957", "0.7936291", "0.790541", "0.78957784", "0.7881705", "0.7868058", "0.7758799", "0.7755237", "0.77335334", "0.7727106", "0.7718922", "0.7680723", "0.75818396", "0.7552129", "0.7481789", "0.7471755", "0.7456268...
0.6488568
78
Rotate vector or array of vectors v by quaternion q
def rotate(q, v): if v.ndim == 1: qv = np.append(v,0) else: qv = np.hstack([v,np.zeros((len(v),1))]) out = mult(q,qv) out = mult(out, inv(q)) return out[:,:3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qrot(q, v):\n assert q.shape[-1] == 4\n assert v.shape[-1] == 3\n assert q.shape[:-1] == v.shape[:-1]\n\n qvec = q[..., 1:]\n uv = torch.cross(qvec.double(), v.double(), dim=len(q.shape) - 1)\n uuv = torch.cross(qvec.double(), uv.double(), dim=len(q.shape) - 1)\n return v + 2 * (q[..., :1]...
[ "0.8211142", "0.8107487", "0.80703014", "0.8019986", "0.7971851", "0.7886877", "0.7498929", "0.7498929", "0.7480085", "0.74242103", "0.7313976", "0.727623", "0.7228369", "0.71947145", "0.7193396", "0.7175702", "0.7156257", "0.71528894", "0.71078646", "0.710679", "0.7095634", ...
0.78948236
5
Rotation quaternions of angles [rad] around axes [already normalized]
def rotation(axis, angle): axis = np.asarray(axis) try: angle = angle[:,None] except: pass return np.hstack([np.asarray(axis)*np.sin(angle/2.),np.cos(angle/2.)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _quaternions(self, R):\n # Simple Wikipedia version\n # en.wikipedia.org/wiki/Rotation_matrix#Quaternion\n # For other options see math.stackexchange.com/questions/2074316/calculating-rotation-axis-from-rotation-matrix\n diag = torch.diagonal(R, dim1=-2, dim2=-1)\n Rxx, Ryy, ...
[ "0.7443089", "0.718464", "0.7145859", "0.70289516", "0.7014841", "0.69884366", "0.69119483", "0.6792913", "0.67605776", "0.67419666", "0.6734204", "0.670451", "0.6687832", "0.668686", "0.6685743", "0.6684033", "0.6683721", "0.66454166", "0.6624854", "0.6624854", "0.65808576",...
0.6188898
84
return a list of clean sentences from text
def get_sentences_clean(text): sentences = getSentences(text.lower()) clean_sentences = [] for sent in sentences: tokens = get_clean_tokens(get_raw_tokens(sent)) sent_aux = " ".join(tokens) clean_sentences.append(sent_aux) return clean_sentences
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sentences(self) -> List[str]:\n\t\treturn [sentence for sentence in re.split('(?<=[.!?])', self.text)]", "def sentences(self, text):\n return re.findall(r'([A-Z][^\\.!?]*[\\.!?])', text)", "def split_into_sentences(text):\n sentences = re.findall('([^\\?\\.\\!]*[\\?\\.\\!]*)', text)\n trimmed_...
[ "0.8171714", "0.8103769", "0.79380536", "0.792278", "0.7902824", "0.7814643", "0.7775614", "0.76390696", "0.75479335", "0.75479335", "0.75411826", "0.75260305", "0.75232464", "0.7511802", "0.7502809", "0.7480757", "0.74264115", "0.74240464", "0.7417077", "0.74105436", "0.7405...
0.8474862
0
Looks through the object's methods, sorts them into lists by evaluating who can use them puts those lists into a dictionary and returns it.
def _sort_methods(self): # Collect all methods and properties of the object. # Add them to self.my_dir if they don't start with an _ my_dir = [item for item in self.__dir__() if item[0] != '_'] my_methods = [] methods_dict = {'for_mods': [], 'for_all': []...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def methods(self):\n\n def is_public_method(attr):\n return (callable(getattr(self.obj, attr))\n and not attr.startswith('_'))\n\n return dict((attr, getattr(self.obj, attr)) for attr in dir(self.obj)\n if is_public_method(attr))", "def __call__(self...
[ "0.67751575", "0.65400714", "0.64934874", "0.6475337", "0.6465416", "0.6363399", "0.6180599", "0.6082434", "0.598763", "0.5934848", "0.58907413", "0.5881439", "0.5872874", "0.58171076", "0.57510924", "0.57304996", "0.57251275", "0.57124346", "0.5708601", "0.56894195", "0.5689...
0.691913
0
Leaves the player queue once you've joined it. !leave
def leave(self, message, db_session): username = self.ts.get_user(message) user = db_session.query(db.User).filter(db.User.name == username).one_or_none() if not user: user = db.User(name=username) db_session.add(user) for tup in self.player_queue.queue: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _leave(self, *args):\n if not self.game:\n raise ServerException('not playing a game')\n self.game.leave(self)\n self.game = self.player = None", "def on_leave(self, event):\n self.pre_check(event)\n self.remove_player(event.guild.id)", "async def join(self, ct...
[ "0.71535385", "0.70976126", "0.6631153", "0.6605268", "0.65135294", "0.63280183", "0.6309718", "0.62379944", "0.615308", "0.6114058", "0.6110612", "0.60985976", "0.6096005", "0.60886276", "0.60777456", "0.60588413", "0.6046021", "0.602478", "0.6024599", "0.59792405", "0.59792...
0.72141457
0
Clear all total guesses so that users can guess again for the next game where they guess about the total number of deaths !clear_total_guesses
def clear_total_guesses(self, db_session): db_session.execute(sqlalchemy.update(db.User.__table__, values={db.User.__table__.c.total_guess: None})) self._add_to_chat_queue("Guesses for the total number of deaths have been cleared.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_guesses(self, db_session):\n db_session.execute(sqlalchemy.update(db.User.__table__, values={db.User.__table__.c.current_guess: None}))\n self._add_to_chat_queue(\"Guesses have been cleared.\")", "def reset(cls):\n GrandChallenge.objects.all().delete()\n GrandChallengeUser.o...
[ "0.6973815", "0.68983555", "0.6623404", "0.6589523", "0.64872", "0.6420884", "0.6393812", "0.6381121", "0.6342013", "0.63365746", "0.62913424", "0.62913424", "0.6249329", "0.61943454", "0.6189747", "0.61661035", "0.61059403", "0.6064802", "0.6063466", "0.6063466", "0.6058155"...
0.85725033
0
Get the tick locations and labels for an axis of a Lambert Conformal projection.
def _lambert_ticks(ax, ticks, tick_location, line_constructor, tick_extractor): outline_patch = sgeom.LineString(ax.outline_patch.get_path().vertices.tolist()) axis = find_side(outline_patch, tick_location) n_steps = 30 extent = ax.get_extent(ccrs.PlateCarree()) _ticks = [] for t in ticks:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_xticks_labels(self):\n xticks = np.arange(-1, self.space_between_glyphs * len(self.coevolving_positions) * 3)\n xticklabels = [' ']\n for p1, p2 in self.coevolving_positions:\n xticklabels += [str(p1), ' ', str(p2)] + [' '] * self.space_between_glyphs\n return xticks,...
[ "0.5807686", "0.564932", "0.56163335", "0.5554502", "0.5526231", "0.5491996", "0.5490149", "0.54812294", "0.5439771", "0.5405185", "0.54008514", "0.53917164", "0.5338033", "0.5293744", "0.52776796", "0.52257967", "0.52110523", "0.5169531", "0.5149888", "0.51446456", "0.513726...
0.6029323
0
Return the parameters object for this report. Returns the parameters object as returned by the Pentaho server.
def fetch_report_parameters(self): self.setup_report() proxy_url, proxy_argument = get_proxy_args(self.cr, self.uid, self.prpt_content) proxy = xmlrpclib.ServerProxy(proxy_url) return proxy.report.getParameterInfo(proxy_argument)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters(self) -> ReportParameters:\n return self.__parameters", "def get_parameters(self):\n return self.parameters", "def get_parameters(self):\n return self.parameters", "def get_parameters(self):\n return self.parameters", "def get_parameters(self):\n return sel...
[ "0.77263933", "0.681896", "0.681896", "0.681896", "0.681896", "0.681896", "0.6713004", "0.66776896", "0.6589483", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65521854", "0.65268683", "0.6521699", "0.647608...
0.7188549
1
Return the parameters object for this report. Returns the parameters object as returned by the Pentaho server.
def fetch_report_parameters(cr, uid, report_name, context=None): if not report_name.startswith(SERVICE_NAME_PREFIX): name = "%s%s" % (SERVICE_NAME_PREFIX, report_name) else: name = report_name return Report(name, cr, uid, [1], {}, context).fetch_report_parameters()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters(self) -> ReportParameters:\n return self.__parameters", "def fetch_report_parameters(self):\n self.setup_report()\n\n proxy_url, proxy_argument = get_proxy_args(self.cr, self.uid, self.prpt_content)\n proxy = xmlrpclib.ServerProxy(proxy_url)\n return proxy.report...
[ "0.77263933", "0.7188549", "0.681896", "0.681896", "0.681896", "0.681896", "0.681896", "0.6713004", "0.66776896", "0.6589483", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65665627", "0.65521854", "0.65268683", "0.652169...
0.0
-1
Return True if other Node's element equals self's element.
def __eq__(self, other): return self.element() == other.element()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node", "def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node", "def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node", ...
[ "0.8413799", "0.8413799", "0.8413799", "0.8413799", "0.8413799", "0.83862543", "0.8368171", "0.832801", "0.8283224", "0.80475944", "0.7885941", "0.77860296", "0.7782913", "0.7734547", "0.77329934", "0.7727953", "0.77114916", "0.7711271", "0.76945305", "0.7682458", "0.76586914...
0.80391645
10
Return True if other Node's element does not equal self's.
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node", "def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node", "def __eq__(self, other):\n return type(other) is type(self) and other._node is self._node", ...
[ "0.7725053", "0.7725053", "0.7725053", "0.7725053", "0.7725053", "0.7690333", "0.76850545", "0.76473826", "0.76266867", "0.7617476", "0.76156485", "0.76114285", "0.7611266", "0.7611266", "0.7611266", "0.7611266", "0.7611266", "0.7611266", "0.7611266", "0.7611266", "0.7611266"...
0.76184773
9
Return True if element is less than other's element.
def __lt__(self, other): return self.element() < other.element()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ge__(self, other):\n return self.element() >= other.element()", "def __le__(self, other):\n return self.element() <= other.element()", "def __gt__(self, other):\n return self.element() > other.element()", "def all_lt(self, other):\n return self.x < other.x and se...
[ "0.8024617", "0.8003602", "0.78261733", "0.7795923", "0.77135015", "0.7592394", "0.75798756", "0.75798756", "0.7562437", "0.75551355", "0.7541962", "0.7527728", "0.75038975", "0.7463702", "0.7448377", "0.7439187", "0.7430593", "0.7422078", "0.7403937", "0.7401057", "0.7380383...
0.81839824
0
Return True if element is greater than other's element.
def __gt__(self, other): return self.element() > other.element()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self,other):\r\n\t\tsorted_self = sorted(self.vector, reverse=True) #sort both lists in descending order\r\n\t\tsorted_other = sorted(other, reverse=True) \r\n\t\tcmpflag = False\r\n\t\tfor li1, li2 in zip(sorted_self, sorted_other):\r\n\t\t\tif(li1 > li2):\r\n\t\t\t\tcmpflag = True\r\n\t\treturn cmpfla...
[ "0.7964064", "0.79320407", "0.7878899", "0.7878899", "0.78593665", "0.7840189", "0.7780567", "0.776773", "0.7757882", "0.775392", "0.7746912", "0.7745028", "0.77449864", "0.7708037", "0.7699996", "0.76942587", "0.76841015", "0.7681382", "0.76601356", "0.7613889", "0.7583675",...
0.8549122
0
Return True if element is less than or equal to other's.
def __le__(self, other): return self.element() <= other.element()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ge__(self, other):\n return self.element() >= other.element()", "def __gt__(self, other):\n return self.element() > other.element()", "def __le__(self, other):\n return self < other or self == other", "def __lt__(self, other):\n return self.element() < other.elem...
[ "0.8351421", "0.800039", "0.79277325", "0.7871502", "0.785497", "0.78067344", "0.7774094", "0.7774094", "0.77644897", "0.7754958", "0.77338046", "0.7731862", "0.7715444", "0.7704111", "0.76937526", "0.7651931", "0.7651931", "0.76048255", "0.7602792", "0.7602792", "0.75987583"...
0.8416621
0
Return left child of node if it exists. Return None otherwise.
def left(self, node): self._validate_node(node) idx = node._index left_idx = 2*idx + 1 if left_idx >= self._N: return None # Exceeds length of array return self._array[left_idx]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left_child(self, position):\n child = 2 * position + 1\n if child > len(self.table) - 1:\n return None\n return child", "def get_leftmost_child(self):\n\t\tif self.left_child == None:\n\t\t\treturn self\n\t\telse:\n\t\t\treturn self.left_child.get_leftmost_child()", "def lef...
[ "0.808699", "0.8038495", "0.801325", "0.7928625", "0.76873493", "0.7651158", "0.76036173", "0.73748577", "0.7367233", "0.7302765", "0.72942215", "0.72353053", "0.71822673", "0.7147817", "0.7147817", "0.70573896", "0.7053031", "0.70519215", "0.7050873", "0.70425653", "0.703246...
0.7189897
12
Return number of positions in tree.
def __len__(self): return self._size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self):\n return self.__tree.node_count", "def get_position_count(self):\n return self.positions.count()", "def nbr_nodes(tree_depth):\n return 2**(tree_depth+1)-1", "def _children_count(self):\n cnt = 0\n if self.left:\n cnt += 1\n if self.right:...
[ "0.7311309", "0.7259029", "0.7161222", "0.71286905", "0.7128662", "0.7014561", "0.7005721", "0.6991028", "0.69773847", "0.69690406", "0.694078", "0.6931302", "0.6917188", "0.6879825", "0.6849558", "0.68316656", "0.682627", "0.6819583", "0.68027514", "0.68014914", "0.67784655"...
0.0
-1
Copy tree array to new array of specified capacity.
def _resize_array(self, capacity): old_array = self._array self._array = [None] * capacity for index in range(self._size): self._array[index] = old_array[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _resize_arr(self, new_capacity):\n if new_capacity < self._length:\n raise RuntimeError('New capacity is lower than length')\n\n # Copy values to array with new capacity\n longer_arr = self._create_array(new_capacity)\n for i in range(self._length):\n longer_ar...
[ "0.67558587", "0.6641773", "0.6609024", "0.6334513", "0.6289832", "0.62829846", "0.6279648", "0.60508704", "0.60067844", "0.59669733", "0.59605336", "0.59218454", "0.59106547", "0.5908146", "0.5864268", "0.57776356", "0.5705641", "0.5697923", "0.56923515", "0.5455391", "0.544...
0.6608653
3
Upheap bubble the position.
def _upheap(self, node): parent = self.parent(node) while parent is not None and node.element() < parent.element(): self._swap(node, parent) # Move node upward while key parent = self.parent(node) # smaller than parent's key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _up_heap(self, j):\n p = self._parent(j)\n if j > 0 and self._data[j] < self._data[p]:\n self._swap(j, p)\n self._up_heap(p)", "def up_heap(self, index):\r\n while index: # while not at the root\r\n parent = self._parent(index) # w...
[ "0.75991446", "0.7572979", "0.7519541", "0.74742997", "0.7278391", "0.72590894", "0.72498316", "0.72288555", "0.72288555", "0.70639366", "0.7046142", "0.70020884", "0.69780993", "0.69413257", "0.6899522", "0.6881982", "0.6860603", "0.6816217", "0.6781025", "0.6744842", "0.653...
0.7364411
4
Swap locations in the heap of two nodes.
def _swap(self, node1, node2): arr = self._array arr[node1._index], arr[node2._index] = arr[node2._index], \ arr[node1._index] # Swap indices stored in nodes as well node1._index, node2._index = node2._index, node1._index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def swap(self, pos1, pos2):\n self.Heap[pos1], self.Heap[pos2] = self.Heap[pos2], self.Heap[pos1]", "def __swap(self, index1, index2):\n self.heap[index1], self.heap[index2] = self.heap[index2], self.heap[index1]", "def _swap(heap, i, j):\n heap[i], heap[j] = heap[j], heap[i]", "def swap_val...
[ "0.7970733", "0.77053404", "0.75858873", "0.75606143", "0.72998774", "0.72998774", "0.7249587", "0.70544446", "0.69675833", "0.6887945", "0.6753295", "0.6635373", "0.65743136", "0.65662974", "0.64269596", "0.6373078", "0.6373078", "0.6348753", "0.6301764", "0.6277363", "0.626...
0.7214338
7
Update an existing node in the heap with a new element value. The updated key will be bubbled to its final position. Return updated node.
def update_node(self, node, element): self._validate_node(node) node._element = element parent = self.parent(node) if parent and node.element() < parent.element(): self._upheap(node) # New key is smaller than parent else: self._downheap(node) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, key, value):\n self.heap.append(None)\n hi = HeapItem(key,value)\n self.siftup(hi, len(self.heap)-1)\n return hi", "def _update(self, priority, key):\n i = self._index[key]\n item = self._heap[i]\n old_priority = item.priority\n item.priori...
[ "0.687972", "0.684042", "0.68128264", "0.673413", "0.67307645", "0.670841", "0.66796964", "0.66673195", "0.66673195", "0.6650444", "0.66139865", "0.65982413", "0.65653586", "0.65653586", "0.6538422", "0.6510841", "0.6507367", "0.6457095", "0.64557606", "0.6437724", "0.6432152...
0.8113124
0
Downheap bubble the node.
def _downheap(self, node): num_children = self.num_children(node) while num_children > 0: if num_children == 2: if self.right(node).element() < self.left(node).element(): child = self.right(node) # Pick child with minimal key else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heapify_down(self):\n index = 0\n while self.has_left_child(index):\n smaller_child_index = self.get_left_child_index(index)\n if self.has_right_child(index) and self.get_right_child(index) < self.get_left_child(index):\n smaller_child_index = self.get_right_c...
[ "0.74369377", "0.7127232", "0.7097678", "0.69181705", "0.6916423", "0.68338066", "0.6800552", "0.67999583", "0.66897213", "0.66681", "0.66306174", "0.66303205", "0.6563944", "0.65582234", "0.65239006", "0.6521464", "0.6511345", "0.65067637", "0.6489139", "0.6459733", "0.64360...
0.8023181
0
Initialize Item with keyvalue pair.
def __init__(self, key, value): self._key = key self._value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, key, value):\n self.key = key\n self.value = value", "def __init__(__self__, *,\n key: str,\n value: str):\n pulumi.set(__self__, \"key\", key)\n pulumi.set(__self__, \"value\", value)", "def __init__(__self__, *,\n ...
[ "0.7055104", "0.682503", "0.682503", "0.682503", "0.682503", "0.682503", "0.6820826", "0.6745925", "0.6745925", "0.6745925", "0.6745925", "0.6745925", "0.6745925", "0.6745925", "0.6745925", "0.6745925", "0.66596115", "0.6557919", "0.65500563", "0.6543919", "0.65412545", "0....
0.70862967
0
Return True if other Item's key equals self's key.
def __eq__(self, other): return self._key == other._key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not isinstance(other, Item):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, other) -> bool:\n # pylint: disable=protected-access\n return isinstance(other, type(self)) and self._key == other._key", "def __eq__(s...
[ "0.80516315", "0.80413955", "0.80024856", "0.79361", "0.79324937", "0.78244334", "0.76626325", "0.7578289", "0.75310516", "0.748774", "0.7432488", "0.7381379", "0.7380991", "0.73798466", "0.73591727", "0.733975", "0.7338971", "0.72278374", "0.722178", "0.7218663", "0.721549",...
0.8062853
0
Return True if other Item's key does not equal self's key.
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n return other != self._cmpkey()", "def __ne__(self, other):\n if isinstance(other, OrderedDict):\n # FIXME: efficiency?\n # Generate both item lists for each compare\n return not (self.items() == other.items())\n else:\n ...
[ "0.7733685", "0.77032363", "0.7471231", "0.7469402", "0.7439585", "0.7300738", "0.7285648", "0.72696286", "0.7157855", "0.7111721", "0.7110029", "0.709898", "0.7079523", "0.7020704", "0.7020704", "0.6993517", "0.6979607", "0.69775367", "0.69556147", "0.69432884", "0.6906024",...
0.0
-1
Return True if key is less than other's key.
def __lt__(self, other): return self._key < other._key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ge__(self, other):\n return self._key >= other._key", "def __le__(self, other):\n return other >= self._cmpkey()", "def __le__(self, other):\n return self._key <= other._key", "def __lt__(self, other):\n return other > self._cmpkey()", "def __gt__(self, other):\n ...
[ "0.81654936", "0.81564176", "0.8134809", "0.80445963", "0.79718405", "0.7968647", "0.7914419", "0.79134125", "0.7839291", "0.7736804", "0.77203697", "0.7474762", "0.7322886", "0.7292055", "0.72876024", "0.72244555", "0.71932226", "0.71932226", "0.7182567", "0.71781456", "0.71...
0.8169443
0
Return True if key is greater than other's key.
def __gt__(self, other): return self._key > other._key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, other):\n return other < self._cmpkey()", "def __ge__(self, other):\n return self._key >= other._key", "def __le__ (self, other) :\n if not set(self.keys()) <= set(other.keys()):\n return False\n for value, times in dict.items(self):\n coun...
[ "0.8429643", "0.806255", "0.7807303", "0.7722636", "0.7601952", "0.7597366", "0.75895697", "0.7554726", "0.7535876", "0.7525716", "0.75131214", "0.74333245", "0.74084115", "0.73998046", "0.7390648", "0.73594195", "0.73483074", "0.7345321", "0.73337686", "0.73337686", "0.73122...
0.8647701
0
Return True if key is less than or equal to other's key.
def __le__(self, other): return self._key <= other._key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ge__(self, other):\n return self._key >= other._key", "def __le__(self, other):\n return other >= self._cmpkey()", "def __ge__(self, other):\n return other <= self._cmpkey()", "def __gt__(self, other):\n return self._key > other._key", "def __lt__(self, other):\n ...
[ "0.8417813", "0.8366143", "0.8251347", "0.8099274", "0.80779403", "0.8043364", "0.7983038", "0.7978379", "0.79610735", "0.79588026", "0.7874057", "0.7266985", "0.7265123", "0.72646683", "0.7219123", "0.7200016", "0.7191033", "0.7191033", "0.7170319", "0.7168722", "0.7149141",...
0.8400175
1
Return True if key is greater than or equal to other's key.
def __ge__(self, other): return self._key >= other._key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, other):\n return self._key > other._key", "def __gt__(self, other):\n return other < self._cmpkey()", "def __ge__(self, other):\n return other <= self._cmpkey()", "def __le__ (self, other) :\n if not set(self.keys()) <= set(other.keys()):\n return F...
[ "0.8512413", "0.8286529", "0.8046726", "0.80023265", "0.7973661", "0.78725755", "0.782384", "0.7542615", "0.74351704", "0.74103206", "0.73880136", "0.73439384", "0.7304254", "0.73024136", "0.72722536", "0.72722536", "0.7237424", "0.72284615", "0.7219687", "0.720461", "0.71762...
0.82978046
1
Return True if queue is empty.
def is_empty(self): return self._size == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.__queue) > 0", "def empty(self) -> bool:\n if self.queue.empty():\n return True\n else:\n return False", "def is_empty(self):\n return len(self.queue) == 0", "def ...
[ "0.92902744", "0.92898697", "0.92881024", "0.9285932", "0.9285932", "0.92698807", "0.9177165", "0.9153167", "0.910526", "0.90945256", "0.90924037", "0.90256256", "0.90246147", "0.90246147", "0.89902157", "0.8974255", "0.89616644", "0.89509714", "0.89455473", "0.88137954", "0....
0.78168625
72
Create a "null" buffer with a zerosized device array.
def null(cls, dtype): mem = cuda.device_array(0, dtype=dtype) return cls(mem, size=0, capacity=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_zero_buffer(for_data, datatype):\n global zero_data_offset\n global bss_buffer\n global buffer_index\n\n RADIX_MAX = 5 # TODO: Make parameterized\n\n width = for_data.shape[2]\n channels = for_data.shape[0]\n pad = RADIX_MAX // 2 * (width + 1) * (channels) * dtype_size(datatype)\n ...
[ "0.69262326", "0.6867912", "0.68228996", "0.68216586", "0.67304856", "0.6651973", "0.6522816", "0.65073186", "0.6500222", "0.6484653", "0.6443295", "0.6436251", "0.6436251", "0.6408485", "0.6310123", "0.6285711", "0.62735313", "0.62698925", "0.6242998", "0.6222154", "0.621607...
0.7581282
0
initializing name and cuisine attributes
def __init__(self, name, host, port, user, password): self.name = name self.host = host self.port = port self.user = user self.password = password self.METRIC_PREFIX = 'varnish'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name, cuisine):\n self.name = name\n self.cuisine = cuisine", "def __init__(self, name, cuisine):\n self.name = name\n self.cuisine = cuisine", "def __init__(self, restaurant_name, cuisine_type):\n\t\tself.restaurant_name = restaurant_name.title()\n\t\tself.cuisin...
[ "0.8092173", "0.8092173", "0.6915219", "0.6902098", "0.6891427", "0.67662394", "0.6747072", "0.6747072", "0.6747072", "0.6688469", "0.6607703", "0.656271", "0.6560449", "0.65573186", "0.64670825", "0.64670825", "0.6456721", "0.6456721", "0.64522994", "0.64522994", "0.6442344"...
0.0
-1
Run the hourly simulation of battery charge decisions.
def simulate(ui_dict, model_df): result_df = model_df.copy() ### Add pricing columns to dataframe # Convert NYISO LBMP to $/kWh result_df["LBMP ($/kWh)"] = result_df["LBMP ($/MWHr)"].apply(lambda x: x/1000) # Add NYSEG time-dependent delivery charge column peak_hours = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulation(self, pvmod=True):\r\n self.th = 0 # Start threshold for the recharging of the battery\r\n self.soc0 = 0 # Initial state of charge of the battery in the first time step\r\n\r\n # Simulation of the battery system\r\n #start = time.process_time()\r\n self.soc, self...
[ "0.6489341", "0.5903071", "0.5873303", "0.57815355", "0.575424", "0.5714382", "0.57098556", "0.56825405", "0.56825405", "0.5653507", "0.5630664", "0.5564323", "0.5555983", "0.5523727", "0.54998416", "0.54912007", "0.54863286", "0.5403575", "0.5371027", "0.53639853", "0.535842...
0.6110422
1
Returns the integer > color mapping for the labels
def _read_color_labels(filename): line_parser = lambda line: (int(line.split(',')[0]), line.split(',')[-1]) with open(filename, 'r') as labels: label_map = dict([line_parser(line.strip()) for line in labels]) return label_map
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_label_color_mapping(idx):\n # https://gist.github.com/wllhf/a4533e0adebe57e3ed06d4b50c8419ae\n def bitget(byteval, ch):\n return (byteval & (1 << ch)) != 0\n r = g = b = 0\n for j in range(8):\n r = r | (bitget(idx, 0) << 7 - j)\n g = g | (bitget(idx, 1) << 7 - j)\n ...
[ "0.794058", "0.7914226", "0.76087224", "0.76087224", "0.76087224", "0.76087224", "0.75690264", "0.7479748", "0.7437477", "0.73719835", "0.73719835", "0.7179847", "0.7179847", "0.7179847", "0.7179847", "0.7178375", "0.7169291", "0.70842427", "0.70506436", "0.7006402", "0.68707...
0.687661
20
Draw an ellipse with a given position and covariance
def draw_ellipse(position, covariance, ax=None, num_contours=5, **kwargs): ax = ax or plt.gca() # Convert covariance to principal axes U, s, Vt = np.linalg.svd(covariance) angle = np.degrees(np.arctan2(U[1, 0], U[0, 0])) width, height = 2 * np.sqrt(s) # Draw the Ellipse for nsig in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_ellipse(position, covariance, ax=None, **kwargs):\r\n # Convert covariance to principal axes\r\n if covariance.shape == (2, 2):\r\n U, s, Vt = np.linalg.svd(covariance)\r\n angle = np.degrees(np.arctan2(U[1, 0], U[0, 0]))\r\n width, height = 2 * np.sqrt(s)\r\n else:\r\n ...
[ "0.8404311", "0.83876216", "0.83766216", "0.83388543", "0.78215134", "0.77806926", "0.77508736", "0.77414376", "0.7734961", "0.7726013", "0.7715272", "0.77121735", "0.75938255", "0.72564596", "0.7170114", "0.71596956", "0.7080239", "0.695739", "0.69208306", "0.691031", "0.691...
0.81186676
4
Returns the movement delay for this room.
def mv_delay(self): return self._TERRAINS[self.terrain]['delay']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def getDelayTimeRemaining(self):\n delay_time_remaining = await self.director.getItemVariableValue(\n self.item_id, \"DELAY_TIME_REMAINING\"\n )\n return delay_time_remaining", "def TxDelay(self):\n\t\treturn self._get_attribute('txDelay')", "def delay(self):\n retu...
[ "0.68204856", "0.67970526", "0.6774784", "0.6731215", "0.6680355", "0.657269", "0.65536904", "0.65170354", "0.64682245", "0.6464242", "0.6446715", "0.6422371", "0.6380757", "0.6379289", "0.6379289", "0.6359786", "0.63557595", "0.63266766", "0.6298291", "0.62802386", "0.627143...
0.74675506
0
Return the absolute path to the dataset.
def data_filename(self) -> str: # type: ignore[return-value] return os.path.abspath(self.name) # type: ignore
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataset_path(cls):\n basepath = os.path.dirname(__file__)\n filepath = os.path.abspath(\n os.path.join(basepath, \"..\", \"datasets\", get_env('DATA_FILENAME')))\n return filepath", "def dataset_path(dataset, work_dir=consts.WORK_DIR):\r\n return join_path(work_dir, consts....
[ "0.83715683", "0.81396556", "0.78592813", "0.7593043", "0.7560065", "0.751028", "0.7505199", "0.74881476", "0.7487452", "0.7474042", "0.74129236", "0.73950154", "0.7368112", "0.73349404", "0.7332586", "0.7104966", "0.7066671", "0.70059395", "0.69412196", "0.6939877", "0.69193...
0.73925257
12
Overwrite the embedded KV store on the server with a backedup snapshot.. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.post_restore_kv_with_http_info(body, async_req=True) >>> result = thread.get()
def post_restore_kv_with_http_info(self, body, **kwargs): # noqa: E501,D401,D403 # noqa: E501 local_var_params, path_params, query_params, header_params, body_params = \ self._post_restore_kv_prepare(body, **kwargs) # noqa: E501 return self.api_client.call_api( '/api/v2/resto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_restore_kv(self, body, **kwargs): # noqa: E501,D401,D403 # noqa: E501\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.post_restore_kv_with_http_info(body, **kwargs) # noqa: E501\n else:\n (data) = self.post_restore_kv_with...
[ "0.7335985", "0.70963377", "0.5516345", "0.5341667", "0.5036856", "0.4900003", "0.4843439", "0.4540105", "0.4512806", "0.44750497", "0.4466141", "0.44627556", "0.44478625", "0.4381768", "0.4347757", "0.4277109", "0.42550656", "0.42371413", "0.4227329", "0.4185138", "0.4118670...
0.8175264
0
Applies 3 x 3 image transformation matrix M to each point stored in object's point list object_list list of KFObjects M 3 x 3 transformation matrix for camera to world image space M2 None or 3 x 3 transformation matrix for camera to gps coordinate space
def transform_obj_list(object_list,M,M2 = None): for i, obj in enumerate(object_list): points = obj.all num_points = len(points) # add third row ones = np.ones([num_points,1]) points3d = np.concatenate((points,ones),1) points3d = points3d[:,[0,1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publish_object_transform(camera_info, objects, distance_from_camera=0.5):\n # type: (CameraInfo, list[ClassifiedObject], float, float, float) -> None\n\n camera = PinholeCameraModel()\n camera.fromCameraInfo(camera_info)\n\n for object in objects:\n obj_center_x = (object.bbox.x_min + object...
[ "0.668708", "0.62402946", "0.6105404", "0.6093861", "0.5968515", "0.59546334", "0.588823", "0.5840365", "0.5663836", "0.564299", "0.5631019", "0.5623012", "0.5619062", "0.5599877", "0.555875", "0.55019516", "0.5489053", "0.54801047", "0.5475011", "0.54424816", "0.54147506", ...
0.78503966
0
Get float value from string expression.
def get_value_from_string(text): if len(text.strip()) == 0: return None try: if '-' in text or '+' in text: tl = [ti for ti in text.split('-')] for i in range(1, len(tl)): tl[i] = '-' + tl[i] ntl = [] for ti in tl: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_float(self, s: str) -> float:\n f = re.findall(r'([0-9]*[.]*[0-9]+)', s)\n return float(f[0]) if len(f) > 0 else None", "def ffloat(string):\n try:\n return float(string.strip())\n except:\n return 0", "def __parse_float(str):\n return float(str.strip().replace(...
[ "0.78568727", "0.75130177", "0.72998756", "0.729925", "0.7295293", "0.71777457", "0.71720815", "0.71389496", "0.71316206", "0.709399", "0.7088332", "0.70439017", "0.69736034", "0.6946384", "0.6944144", "0.6919472", "0.6918727", "0.6864547", "0.6860677", "0.6778792", "0.671541...
0.6401957
43
Create data frame with table values.
def table_to_data_frame(table): nr = table.rowCount() nc = table.columnCount() if nr == 0: return None idx_labels = [] for i in range(nr): item = table.verticalHeaderItem(i) if item is not None: idx_labels.append(item.text().replace(' ', '')) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepareDataframeForTable(self, result):\n df = result\n if isinstance(df, pd.Series):\n df = pd.DataFrame({\"values\": df})\n\n if self._isIndexedDataframe(df):\n if df.size == 0:\n df[\"values\"] = np.nan\n elif len(df.columns) > 1:\n ...
[ "0.7425395", "0.71469873", "0.69905645", "0.69200295", "0.6913332", "0.6908125", "0.6904657", "0.680043", "0.67712927", "0.67420125", "0.6734206", "0.6699156", "0.6677545", "0.6670505", "0.66585416", "0.66249096", "0.66092473", "0.6595723", "0.6582216", "0.6567243", "0.656214...
0.6726432
11
Gets a collection of `InputExample`s for the train set.
def get_train_full_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73499966", "0.7173421", "0.7126833", "0.65602446", "0.64204013", "0.64052176", "0.63422555", "0.6290186", "0.6282746", "0.625262", "0.62499267", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0...
0.0
-1
if has_django_dashboard_access is True, then setting is_staff to True
def save(self, *args, **kwargs): # if self.has_django_dashboard_access is True: # self.is_staff = True super(User, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_staff(self):\r\n return self.is_admin", "def is_staff(self):\n return self.is_admin", "def is_staff(self):\n return self.is_admin", "def is_staff(self):\n\t\treturn self.is_admin", "def is_staff(request):\n\n if request:\n if hasattr(request, 'user') and request.user.is_...
[ "0.77534443", "0.7539827", "0.7539827", "0.7503667", "0.74213314", "0.7269491", "0.7226546", "0.709475", "0.7024363", "0.7019328", "0.6866878", "0.68610525", "0.67922425", "0.67922425", "0.67922425", "0.66177815", "0.66177815", "0.66177815", "0.66177815", "0.65754706", "0.657...
0.71982884
7
Filter Description based on description keyword.
def description(self, operator: Enum, description: list | str): if isinstance(description, list) and operator not in self.list_types: raise RuntimeError( 'Operator must be CONTAINS, NOT_CONTAINS, IN' 'or NOT_IN when filtering on a list of values.' ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_by_description(cls, description):\n api = BuslineAPI()\n try:\n objects = api.filter_by_description(description)\n except ApiException:\n objects = cls.objects.filter(description__startswith=description)\n\n return objects", "def _description_filter(se...
[ "0.72910744", "0.6737357", "0.6421571", "0.6058544", "0.5966701", "0.56998295", "0.56963193", "0.56778526", "0.56636345", "0.56406564", "0.55873966", "0.5537824", "0.55292904", "0.55285573", "0.5493067", "0.54706013", "0.5447359", "0.54468805", "0.54079825", "0.53593236", "0....
0.635064
3
Derive transform on X features to give to zero mean and unit std. Derive on train set. Save for use later Arguments
def get_X_scaler(self, X_train, out_tag='lstm_scaler', save=True): X_scaler = StandardScaler() X_scaler.fit(X_train.values) self.X_scaler = X_scaler if save: print('saving X scaler: models/{}_X_scaler.pkl'.format(out_tag)) dump(X_scaler, open('models/{}_X_scaler....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _transform(self, data):\r\n mean, variance = self._input_statistics.overall_feature_moments\r\n return (data - mean) / variance", "def _de_transform(self, data):\r\n mean, variance = self._input_statistics.overall_feature_moments\r\n return data * variance + mean", "def data_preprocessing_TA(X)...
[ "0.67911035", "0.67009", "0.66634125", "0.6661171", "0.6597222", "0.65919656", "0.6519188", "0.65089005", "0.6481209", "0.6439869", "0.64303774", "0.63982034", "0.6397455", "0.63641393", "0.6344761", "0.6330416", "0.6280891", "0.62754357", "0.6269793", "0.62592727", "0.624759...
0.56919026
85
Load X feature scaler, where the transform has been derived from training sample Arguments
def load_X_scaler(self, out_tag='lstm_scaler'): print ('loading X scaler: models/{}_X_scaler.pkl'.format(out_tag)) self.X_scaler = load(open('models/{}_X_scaler.pkl'.format(out_tag),'rb'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_X_scaler(self, X_train, out_tag='lstm_scaler', save=True):\n\n X_scaler = StandardScaler()\n X_scaler.fit(X_train.values)\n self.X_scaler = X_scaler\n if save:\n print('saving X scaler: models/{}_X_scaler.pkl'.format(out_tag))\n dump(X_scaler, open('models/...
[ "0.6941081", "0.6414479", "0.639505", "0.59881717", "0.59643614", "0.59520423", "0.592945", "0.5862024", "0.58103323", "0.5758785", "0.57578206", "0.5750817", "0.573342", "0.573103", "0.57225776", "0.5706696", "0.57058215", "0.56971645", "0.5693011", "0.569252", "0.56864583",...
0.7343405
0
Scale train and test X matrices to give zero mean and unit std. Annoying conversions between numpy pandas but necessary for keeping feature names Arguments
def X_scale_train_test(self, do_data=False): X_scaled_all_vars_train = self.X_scaler.transform(self.all_vars_X_train) #returns np array so need to re-cast into pandas to get colums/variables X_scaled_all_vars_train = pd.DataFrame(X_scaled_all_vars_train, columns=self.low_level_vars_flat+self.hi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def standard_scale(X_train, X_test):\n preprossor = StandardScaler().fit(X_train)\n X_train = preprossor.transform(X_train)\n X_test = preprossor.transform(X_test)\n return X_train, X_test", "def standardize_data(Xtrain,Xtest):\n \n ### Import modulates\n import numpy as np\n\n Xmean = np...
[ "0.70557165", "0.70506245", "0.7047985", "0.70215017", "0.6947464", "0.6875778", "0.68623215", "0.68403774", "0.67646724", "0.6762766", "0.67419076", "0.6676486", "0.6655613", "0.66118824", "0.6598338", "0.65240526", "0.6495299", "0.64564925", "0.6413685", "0.6409761", "0.640...
0.6718186
11
Returns average number of scans to lookup items given a list of items.
def collect_scans(table_type, items): table = get_table(table_type) lst = [] for key, value in items: table.insert(key, value) lst.append(key) scans = [] for key in lst: val, scan = table.lookup(key) scans.append(scan) ave_scan = sum(scans) / float(len(items)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mean(items):\n return sum(items) / len(items)", "def mean(items):\n\n return float(sum(items)) / len(items)", "def frequency(my_list, item):\n return float(my_list.count(item)) / float(len(my_list))", "def total(my_list, item):\n return my_list.count(item)", "def avg():\n\n # call sum m...
[ "0.66761893", "0.6663419", "0.6539744", "0.65202993", "0.64886934", "0.6416504", "0.6165653", "0.61229426", "0.6037956", "0.59914553", "0.58975905", "0.5889438", "0.5883979", "0.5854745", "0.5826917", "0.5810078", "0.57998323", "0.5799682", "0.5769667", "0.5731262", "0.572957...
0.68437517
0
Get url for user's detail view.
def get_absolute_url(self): return reverse("users:detail", kwargs={"username": self.username})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('users:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self) -> str:\n return reverse(\"accounts:user-detail\", args=[str(self.user.id)])", "def get_absolute_url(self):\n return reverse('accountInfo-detail', args=[str(self.uid)])", "d...
[ "0.7964141", "0.7836211", "0.75644255", "0.7461203", "0.74166024", "0.7404585", "0.737559", "0.7254493", "0.72481704", "0.71456504", "0.7126993", "0.7024409", "0.6971243", "0.69050795", "0.69050795", "0.6885919", "0.6885456", "0.68824846", "0.68649256", "0.6855424", "0.685542...
0.78644794
2
Reset the environment and return the first ``observation``, or the first \ ``(state, obs)`` tuple.
def reset(self, return_state: bool = None) -> [numpy.ndarray, tuple]: return_state = self.states_on_reset if return_state is None else return_state obs = ale_to_ram(self.gym_env.unwrapped.ale) if self.obs_ram else self.gym_env.reset() if not return_state: return obs else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_initial_observation(self):\n return self.__environment.reset()", "def reset(self):\n \n self.env.reset()\n obs, _, done, _ = self.env.step(1)\n if done: \n self.env.reset()\n obs, _, done, _ = self.env.step(2)\n if done: ...
[ "0.72281903", "0.67799366", "0.6771309", "0.66549224", "0.65987825", "0.65284365", "0.65229946", "0.64091206", "0.6389416", "0.6370824", "0.6337533", "0.6331988", "0.6321598", "0.6321598", "0.6321598", "0.6321598", "0.6321598", "0.6321598", "0.62911457", "0.6276724", "0.61564...
0.7203808
1
Compute the lagN autocorrelation. This method computes the Pearson correlation between the Series and its shifted self.
def series_autocorr(series, lag=1): op = DataFrameCorr(other=series.shift(lag), method="pearson") return op(series)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocorrelation(x, nlags = 0):\n return [x.corr(x.shift(lag)) for lag in range(nlags + 1)]", "def auto_correlation(x, lags):\n\tn = len(x)\n\tx = np.array(x)\n\tresult = []\n\tfor i in range(1, lags + 1):\n\t\ty = abs(np.correlate(x[i:] - x[i:].mean(), x[:n - i] - x[:n - i].mean())[0])\n\t\td = (x[i:].std...
[ "0.6910998", "0.65437675", "0.63009787", "0.6271007", "0.622759", "0.6215408", "0.6178521", "0.61560786", "0.61394626", "0.6043225", "0.5992306", "0.59159034", "0.58968407", "0.5847938", "0.583125", "0.5821622", "0.5812492", "0.58081275", "0.57958615", "0.5776822", "0.5757816...
0.7900815
0
Tests if there is whitespace in the group name
def test_add_whitespace(): with patch("salt.modules.mac_group.info", MagicMock(return_value={})): pytest.raises(SaltInvocationError, mac_group.add, "white space")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_or_group_name(name):\r\n s = str(name).strip()\r\n if ' ' in s or ':' in s:\r\n raise ValueError(\"Invalid name: \" + repr(name))\r\n return s", "def tag_is_spacegroup(text):\n\n spacegroup = re.compile(\n r\"<?[PABCIFHRpabcifhr] *[1-9][1-9]? *[1-9]?[1-9]? *[1-9]?[1-9]?>$\"\...
[ "0.73797494", "0.70375466", "0.68973505", "0.6803649", "0.66399276", "0.63550764", "0.6341878", "0.6242714", "0.6208212", "0.6197498", "0.61225533", "0.6087617", "0.6039123", "0.6038284", "0.60101795", "0.59978294", "0.59952", "0.5984011", "0.5861962", "0.5840638", "0.5825907...
0.56133026
36
Tests if there is whitespace in the group name
def test_delete_whitespace(): pytest.raises(SaltInvocationError, mac_group.delete, "white space")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_or_group_name(name):\r\n s = str(name).strip()\r\n if ' ' in s or ':' in s:\r\n raise ValueError(\"Invalid name: \" + repr(name))\r\n return s", "def tag_is_spacegroup(text):\n\n spacegroup = re.compile(\n r\"<?[PABCIFHRpabcifhr] *[1-9][1-9]? *[1-9]?[1-9]? *[1-9]?[1-9]?>$\"\...
[ "0.73797494", "0.70375466", "0.68973505", "0.6803649", "0.66399276", "0.63550764", "0.6341878", "0.6242714", "0.6208212", "0.6197498", "0.61225533", "0.6087617", "0.6039123", "0.6038284", "0.60101795", "0.59978294", "0.59952", "0.5984011", "0.5861962", "0.5840638", "0.5825907...
0.551226
59
Tests if there is whitespace in the group name
def test_info_whitespace(): pytest.raises(SaltInvocationError, mac_group.info, "white space")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_or_group_name(name):\r\n s = str(name).strip()\r\n if ' ' in s or ':' in s:\r\n raise ValueError(\"Invalid name: \" + repr(name))\r\n return s", "def tag_is_spacegroup(text):\n\n spacegroup = re.compile(\n r\"<?[PABCIFHRpabcifhr] *[1-9][1-9]? *[1-9]?[1-9]? *[1-9]?[1-9]?>$\"\...
[ "0.73797494", "0.70375466", "0.68973505", "0.6803649", "0.66399276", "0.63550764", "0.6341878", "0.6242714", "0.6208212", "0.6197498", "0.61225533", "0.6087617", "0.6039123", "0.6038284", "0.60101795", "0.59978294", "0.59952", "0.5984011", "0.5861962", "0.5840638", "0.5825907...
0.5640735
34
POST the status path with valid credentials. Assert an error is returned.
def test_post_authenticated(self): with self.assertRaises(HTTPError): self.client.post(STATUS_PATH)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_status(self):\n with self.app.app_context():\n u = user(email='joe@example.com', save=True)\n\n authenticate(self.client, u)\n\n rv = self.client.post('/statusize/', data={'message': 'foo'},\n follow_redirects=True)\n eq_(rv.status_code, ...
[ "0.75314116", "0.7203306", "0.7151903", "0.7024308", "0.6957342", "0.67299795", "0.6657416", "0.65938824", "0.6574322", "0.6482714", "0.6462071", "0.6388176", "0.6388176", "0.63433653", "0.6328875", "0.63217694", "0.62807304", "0.62737554", "0.6232892", "0.62079424", "0.61681...
0.7659825
0
Get the next state of the game by using the action index selected from the output of the Actor Network.
def get_next_state(self, player, current_state, action_index): action = self.get_action(player, action_index) new_state = self.game.get_next_state(current_state, action) return new_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_state(self, state, action):\n pass", "def next(self, state, turn, greedy_strategy):\n return self.agent_action", "def next_state(self, action):\n self.state = self.states[action][self.state]", "def handle_get_action(self, state):\n\n # This is an example player who picks ...
[ "0.7751284", "0.71914315", "0.7179713", "0.6841391", "0.6799023", "0.6784055", "0.6779638", "0.6779638", "0.6779638", "0.6716671", "0.6676671", "0.6652459", "0.66423607", "0.6640741", "0.6640741", "0.6632653", "0.66310745", "0.6629936", "0.6583855", "0.65820885", "0.65721214"...
0.7956233
0
Given a dict of hyperparameter settings, return a dict containing those settings augmented by the defaults for any keys missing from the dict.
def with_defaults(self, obj): self.check_valid_keys(obj) obj = dict(obj) for (key, value) in self.defaults.items(): if key not in obj: obj[key] = value return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _inject_defaults(settings, defaults):\n new_settings = {}\n\n if defaults is None:\n return settings\n elif settings is None or len(settings) == 0:\n new_settings = defaults\n else:\n for k, v in settings.items():\n if isinstance(v, dict) or v is None:\n ...
[ "0.7288529", "0.6454122", "0.641601", "0.6378744", "0.60568506", "0.6043778", "0.6020055", "0.59839463", "0.59810853", "0.5979678", "0.5961703", "0.5959229", "0.5920374", "0.5910076", "0.5908355", "0.58251", "0.57889336", "0.57824194", "0.57750744", "0.57231873", "0.5714104",...
0.5492778
36
Builds the feature vector based on the provided mapping of features onto their indices. Returns the vector as a two lists, one of feature coordinates, one of feature values.
def get_feature_coords_vals(self, feature_idxs): coords = list() vals = list() if hasattr(self, 'generic'): generics = self.generic else: generics = dict() for feature in self.features: key = generics.get(feature, feature) if key in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feature_vector(self, feature_idxs):\n feat_vec = np.zeros(len(feature_idxs))\n if hasattr(self, 'generic'):\n generics = self.generic\n else:\n generics = dict()\n for feature in self.features:\n key = generics.get(feature, feature)\n ...
[ "0.7573657", "0.69694406", "0.6699811", "0.6508978", "0.6490876", "0.64803576", "0.64803576", "0.64638156", "0.63797", "0.6327611", "0.6298357", "0.62144244", "0.62119675", "0.6188069", "0.6078282", "0.60645586", "0.60581696", "0.60581696", "0.600686", "0.59837955", "0.591411...
0.63192886
10
Syntax error may cause pylint to fail without an actual exception. Or the file may just be defined to be ignored in .pylintrc
def check_no_silent_crash(self, override=False): if self.results: score = self.results.linter.stats.get('global_note', False) if score is False: messages = self.results.linter.stats.get('by_msg', {}) if messages.get('syntax-error', False) and not override:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_lint_fail_malformed(self, style):\n with ExpectedException(LinterFailure):\n run_linter_throw(\"path/to/file\",\n \"{s} path/to/file_wrong\\n{m}{e}\\n\",\n style,\n whitelist=[\"headerblock/filename\"])",...
[ "0.72465736", "0.7131694", "0.70198286", "0.695122", "0.6898312", "0.67737734", "0.67496353", "0.67257667", "0.6709719", "0.6700785", "0.6658012", "0.6644381", "0.6454468", "0.64515823", "0.6443327", "0.63719213", "0.6366808", "0.63641095", "0.6354824", "0.635131", "0.6314541...
0.0
-1
Get the action as the first action of an iteratively improved planned trajectory. Optionally, use a terminal value function to help evaluate trajectories, or start with a specific prior trajectory.
def get_action(self, terminal=None, prior=None): self.extend_plan(self.H) # Log initial trajectory env_state = self.env.sim.get_state() if self.mujoco else None terminal = terminal if self.use_terminal else None init_states, _, init_rews, cum_rew, emp_rew = \ traj.eval_traj( copy.deepcopy(self.env), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_action(\n self, observations,\n deterministic: Optional[bool] = False, **kwargs\n ) -> int:\n goal_pos = kwargs.get('goal_pos', None)\n if goal_pos is None:\n return HabitatSimActions.STOP\n\n try:\n next_action = self._controller.next_action...
[ "0.60807097", "0.58826387", "0.58527213", "0.58527213", "0.58350646", "0.5780183", "0.5753979", "0.57323134", "0.5727808", "0.5694826", "0.56852484", "0.56808746", "0.56587166", "0.56585735", "0.5610201", "0.5609148", "0.5604881", "0.5587234", "0.5551988", "0.5540169", "0.553...
0.6492767
0
Get the current date/time formatted as ISO.
def now_iso(): return to_iso(now())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isoformat_now():\n return datetime_isoformat(datetime.datetime.utcnow())", "def nowISO():\n return dt2ISO(datetime.datetime.utcnow())", "def format_iso_now():\n return datetime.datetime.utcnow().isoformat()+'Z'", "def iso_date(self, t=None):\n if t is None:\n t = time.time()\n ...
[ "0.80959743", "0.80683243", "0.7776984", "0.7632576", "0.7605009", "0.73248756", "0.72893083", "0.72684604", "0.7174179", "0.7010627", "0.6960561", "0.6888008", "0.68537986", "0.6853366", "0.68525565", "0.6833974", "0.68002427", "0.6762628", "0.676194", "0.6748862", "0.670166...
0.79448366
2
Convert the `dt` datetime to iso format.
def to_iso(dt): return dt.strftime(ISO_FORMAT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isoformat(dt):\n return dt.isoformat().replace(\"+00:00\", \"Z\")", "def toisostring(dt):\n return dt.format(ISOFORMAT) + 'Z'", "def dt_to_str(dt):\n return dt.isoformat()", "def formatIsoDate(dt, tm):\n \n iso = ''\n if dt != '':\n match = re.search(r'^(\\d{2})/(\\d{2})/(\\d{4})...
[ "0.7599522", "0.74547565", "0.73888063", "0.7089074", "0.70277596", "0.6982388", "0.6969329", "0.69435245", "0.69217217", "0.68691194", "0.68533313", "0.6760809", "0.6699779", "0.65904963", "0.6585926", "0.6502557", "0.64444447", "0.6422992", "0.6422992", "0.6415807", "0.6397...
0.8174686
0
Convert a local datetime to utc.
def to_utc(dt): time_tuple = time.gmtime(time.mktime(dt.timetuple())) return datetime.datetime(*time_tuple[0:6])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_to_utc(local_dt: datetime) -> datetime:\n if local_dt is None:\n return None\n utc_dt = local_dt.astimezone(tz.UTC)\n return utc_dt", "def local_to_utc(local_dt):\n local_dt = local_dt.replace(tzinfo=tz.tzlocal())\n return local_dt.astimezone(tz.tzlocal())", "def localTo...
[ "0.84177625", "0.83750343", "0.78771913", "0.77554613", "0.77554613", "0.77554613", "0.75097513", "0.74893177", "0.7479256", "0.7444278", "0.74034506", "0.7399765", "0.73806447", "0.7368518", "0.73197764", "0.7233089", "0.71915555", "0.71915555", "0.71818703", "0.71338254", "...
0.7084462
21
calculate the floor area of the evaluated house
def get_floor_area(a_mr: float, a_or: float, a_a: float, r_env: float) -> np.ndarray: # make envelope.FloorArea class floor_area = envelope.FloorArea(a_mr, a_or, a_a, r_env) # floor area of the evaluated house, m2 (12 rooms) return envelope.get_hc_floor_areas(floor_area)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _area(bounds):\n return (bounds[0, 1] - bounds[0, 0]) * (bounds[1, 1] - bounds[1, 0])", "def unconditioned_building_area(self):\n if self._area_unconditioned is None:\n if self.simulation_dir.exists():\n with sqlite3.connect(self.sql_file) as conn:\n sql...
[ "0.7030988", "0.70073503", "0.69721425", "0.6909455", "0.68451226", "0.68024707", "0.6652616", "0.66403186", "0.66326", "0.6614317", "0.6607711", "0.65757567", "0.65621144", "0.6550021", "0.6550021", "0.651917", "0.65167475", "0.6509481", "0.65058726", "0.6471923", "0.6452957...
0.689161
4
calculate saturated vapor pressure
def get_f_p_sgas(theta: float) -> float: return 2.75857926950901 * 10 ** (-17) * theta ** 8 \ + 1.49382057911753 * 10 ** (-15) * theta ** 7 \ + 6.52001687267015 * 10 ** (-14) * theta ** 6 \ + 9.14153034999975 * 10 ** (-12) * theta ** 5 \ + 3.18314616500361 * 10 ** (-9) * theta ** 4 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vapour_pressure(self):\n return self.relative_humidity * self.solvent.equilibrium_vapour_pressure(self.temperature)", "def calc_VPD(t_celsius, rel_humidity):\n # according to Licor LI-6400 manual pg 14-10\n # and Buck AL (1981). New equations for computing vapor pressure and\n # enhancement f...
[ "0.7309289", "0.720164", "0.71435016", "0.714002", "0.69835323", "0.68511134", "0.6823274", "0.6811281", "0.678235", "0.67513174", "0.66661155", "0.66561633", "0.6604408", "0.66019267", "0.65967363", "0.65844893", "0.6549549", "0.6524028", "0.6450481", "0.64361644", "0.639265...
0.0
-1
Gets the string representation of the object.
def __str__(self): string = '' string += "Battery Voltage: " + "{0:.2f}".format(self.getBatteryVoltage()) + '\n' string += "Data Logging: " + str(self.getDataLoggingStatus()) + '\n' string += "Data Filename: " + self.getFilename() +'\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_string(self):\r\n return self.__str__()", "def __str__(self):\n return str(self.__dict__['_obj'])", "def get_str(self, obj):\n if self.pretty:\n return pprint.pformat(obj)\n else:\n return str(obj)", "def as_string(self):\n return self._...
[ "0.84136784", "0.81855345", "0.8169327", "0.8146845", "0.81194437", "0.80508393", "0.7991019", "0.7986542", "0.794946", "0.79486334", "0.7921123", "0.7916442", "0.7916442", "0.7865163", "0.7865163", "0.7865163", "0.7865163", "0.7865163", "0.7820341", "0.78180563", "0.7812709"...
0.0
-1
This function calculates the dv and the dq/dv for a dataframe.
def init_columns(cycle_df, datatype): (cycle_ind_col, data_point_col, volt_col, curr_col, dis_cap_col, char_cap_col, charge_or_discharge) = col_variables(datatype) assert type(cycle_df) == pd.DataFrame assert volt_col in cycle_df.columns assert dis_cap_col in cycle_df.columns assert char_cap_col in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dvdt(self, args: List[float]) -> float:\n v, h_nav, n_kvhh, h_kva, m_kvsi, s_ampar, _, s_nmdar, s_gabar, ca = args\n return ((-10.0*self.params.area \n * (self.leak.i(v)\n + self.nav.i(v, h=h_nav) \n + self.kvhh.i(v, n=n_kvhh)\n + self.k...
[ "0.6411145", "0.6359478", "0.61440444", "0.61301315", "0.61152756", "0.6114208", "0.606523", "0.6004516", "0.5953309", "0.58502036", "0.5837077", "0.5836804", "0.58347845", "0.5810342", "0.5765199", "0.5764771", "0.575005", "0.5742487", "0.5710893", "0.568568", "0.5636592", ...
0.0
-1
Yield successive nsized chunks from l.
def chunks(l, n): n = int(n) for i in xrange(0, len(l), n): yield l[i:i+n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(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
return correlation dataframe; show correlation map between symbols
def correlation_map(df, method='log', days=None): # default is all days if days is None: days = 0; df = df[-days:] if method == 'price': pass elif method == 'log': df = np.log(df.pct_change()+1) elif method == 'returns': df = df.pct_change() df = df.corr(me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_correlation(df):\n frame_correlation = df.corr()\n return frame_correlation", "def plot_corr_matrix(df):\n f = plt.figure(figsize=(19, 15))\n plt.matshow(df.corr().abs(), fignum=f.number)\n cb = plt.colorbar()\n cb.ax.tick_params(labelsize=14)\n plt.title('Correlation Matrix', fontsi...
[ "0.68623054", "0.6589292", "0.6575853", "0.6531088", "0.64767915", "0.64376307", "0.64236814", "0.6420273", "0.6381764", "0.6360824", "0.63362926", "0.6296155", "0.6293889", "0.62681144", "0.6255176", "0.623856", "0.62072957", "0.6138316", "0.6113529", "0.61014885", "0.609640...
0.63550884
10
Remove values with the lowest associated year (only keep the most recent available year's data)
def _02_merge_plant_project_outputs(records, **params): output_records = OrderedDict() for record in records: project_key = (record["Power Plant Name"], record["Project Name"]) if project_key not in output_records: output_records[project_key] = record base_field = f"{record[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reduce_dataset(X, year):\n\n drop_list = [i for i in range(config.DB_YEAR_MIN, config.DB_YEAR_MAX + 1)]\n drop_list.remove(year - 1)\n red_X = X.drop(drop_list, axis=0)\n return red_X", "def remove_old_songs(df, too_old=1970):\n drop_indices = df.index[df['year'] < too_old].tolist()\n df =...
[ "0.6108964", "0.60606605", "0.5801589", "0.56920505", "0.55552053", "0.5540396", "0.5534895", "0.55262494", "0.54875594", "0.5465366", "0.5448009", "0.5441284", "0.54136103", "0.5363418", "0.5355738", "0.535096", "0.5337274", "0.53338224", "0.52914", "0.5277288", "0.52587235"...
0.0
-1
Creates a sizex by sizey matrix filled with zeros.
def matrix_init(sizex, sizey): return [[0]*sizey for i in range(sizex)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_matrix(sizex, sizey):\n return [[0] * sizey for i in range(sizex)]", "def make_matrix(sizex, sizey):\n return [[0]*sizey for i in xrange(sizex)]", "def zeroes(height, width):\n g = [[0.0 for _ in range(width)] for __ in range(height)]\n return Matrix(g)", "def zeroMatrix(width, h...
[ "0.79192764", "0.7826062", "0.7141801", "0.71086985", "0.70619905", "0.7058825", "0.63757265", "0.6285351", "0.6129874", "0.6119288", "0.6119288", "0.6112796", "0.6047175", "0.59919316", "0.5989762", "0.5955519", "0.5932239", "0.5928885", "0.58918095", "0.5875584", "0.5867596...
0.8044378
0
Filter the hits from all answer choices(inplace) to the top_k hits based on the hit score
def filter_hits_across_choices(hits_per_choice: Dict[str, List[EsHit]], top_k: int): # collect ir scores ir_scores = [hit.score for hits in hits_per_choice.values() for hit in hits] # if more than top_k hits were found if len(ir_scores) > top_k: # find the score of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_k_result(self, score, k=1):\n self.candidates = []\n self.candidate_sub = []\n self.top_k = heapq.nlargest(n=k, iterable=score)\n\n # Iterate the Top k scores, print each score and standard term\n for top_i in self.top_k:\n max_index = score.index(top_i)\n\n ...
[ "0.6579949", "0.6166952", "0.6161339", "0.6113497", "0.61082417", "0.60796005", "0.604367", "0.60122275", "0.60122275", "0.60122275", "0.59864557", "0.5981896", "0.59803694", "0.5957586", "0.5936918", "0.5914675", "0.5903682", "0.58550185", "0.5841701", "0.5809818", "0.580981...
0.8150004
0
Validate an Wyoming URI. Currently accepts TCP URIs, can extended to accept UNIX sockets in the future.
def validate_uri(value: Any) -> str: uri_value = str(value) if urlparse(uri_value).scheme == "tcp": # pylint: disable-next=no-value-for-parameter return cast(str, vol.Schema(vol.Url())(uri_value)) raise vol.Invalid("invalid Wyoming Protocol URI")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_url(path: str):\n regex = re.compile(\n r\"^(?:http|ftp)s?://\" # http:// or https://\n r\"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}\\.?|[A-Z0-9-]{2,}\\.?)|\" # domain...\n r\"localhost|\" # localhost...\n r\"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3...
[ "0.68058646", "0.6784221", "0.67812866", "0.6775084", "0.6723773", "0.67020154", "0.66573083", "0.66374075", "0.66308266", "0.65491384", "0.6514141", "0.651162", "0.65042555", "0.64968026", "0.64796567", "0.6463085", "0.64551926", "0.6440194", "0.6401262", "0.6390181", "0.635...
0.7932031
0
Ensure 'client_id' claim meets provider requirements.
def validate_client_id(self, client_id, *args, **kwargs): raise NotImplementedError('Subclasses must implement this method.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_client_id(self, client_id):\n raise NotImplementedError(\n \"\"\"\n verify_client_id must be implemented by a child class\n \"\"\"\n )", "async def check_client(self, client_id: Identity) -> AuthResult:\n raise NotImplementedError", "def vali...
[ "0.67935526", "0.6635238", "0.6036439", "0.60362816", "0.60272145", "0.59563315", "0.58604336", "0.5828244", "0.5786889", "0.57390726", "0.573695", "0.5732234", "0.57051545", "0.5701726", "0.567984", "0.5679292", "0.5671594", "0.56525266", "0.5634701", "0.56136495", "0.560797...
0.6344839
2
Write JSON ``data`` to disk at ``filepath``, either all at once or streaming itembyitem.
def write_json( data: Any, filepath: types.PathLike, *, mode: str = "wt", encoding: Optional[str] = None, make_dirs: bool = False, lines: bool = False, ensure_ascii: bool = False, separators: tuple[str, str] = (",", ":"), sort_keys: bool = False, indent: Optional[int | str] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_json(data, filepath):\n with open(filepath, \"w\") as f:\n content = json.dumps(data, indent=3)\n f.write(content + '\\n')", "def write_json(filepath, data):\n\n with open(filepath, 'w', encoding='utf-8') as file_obj:\n json.dump(data, file_obj, ensure_ascii=False, indent=2)"...
[ "0.75843364", "0.74921596", "0.7462101", "0.7391784", "0.7163967", "0.7091216", "0.70277995", "0.70207614", "0.70049715", "0.692109", "0.6914349", "0.6888503", "0.68497974", "0.68183374", "0.6802704", "0.6747252", "0.67186725", "0.6677994", "0.6675432", "0.665071", "0.6629886...
0.7454221
3
Load and initialize existing pretrained model from torch checkpoint file
def load_model_from_checkpoint(file, device): if device == 'cuda': # Load all tensors onto GPU map_location = lambda storage, loc: storage.cuda() else: # Load all tensors onto CPU map_location = lambda storage, loc: storage # Assuming model was trained and checkpoi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_pretrained(model, fname, optimizer=None):\n if os.path.isfile(fname):\n print(\"=> loading checkpoint '{}'\".format(fname))\n checkpoint = torch.load(fname)\n model.load_state_dict(checkpoint['state_dict'])\n if optimizer is not None:\n optimizer.load_state_dict(c...
[ "0.813335", "0.80972826", "0.8029061", "0.8000466", "0.7900006", "0.7758616", "0.77397996", "0.7731262", "0.76662594", "0.7660075", "0.76016825", "0.7578371", "0.7576915", "0.75496703", "0.754349", "0.7498849", "0.74776846", "0.7469808", "0.74558717", "0.74460554", "0.7423573...
0.7386282
23
Returns the mapped label names of the classification index predictions as list. In case the index does not exist, classification index predicted is returned as label.
def get_class_label_names(class_idx_predictions, class_to_idx, class_to_label): # Flatten to 1D tensor and convert to ndarray class_idx_predictions = np.array(np.squeeze(class_idx_predictions)) # Switch key to value and value to key idx_to_class = {idx: cls for cls, idx in class_to_idx.items()} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self) -> np.ndarray:\n if self.i - 1 >= self.k:\n logging.error(\"No more training iterations!!\")\n return np.array([])\n _, test = self.indexes[self.i - 1]\n return self.labels.take(test, axis=-1)", "def get_predicted_token_labels(self, predictions, lab...
[ "0.7017974", "0.6891035", "0.6872016", "0.67788225", "0.6740503", "0.67042464", "0.67015207", "0.66773766", "0.6640818", "0.6640758", "0.6640758", "0.6640758", "0.6640758", "0.6640758", "0.66199774", "0.66136485", "0.6605475", "0.65880406", "0.65606815", "0.6546807", "0.65398...
0.8013975
0
Returns the images and labels loaded by torchvision.datasets.ImageFolder from data_dir directory
def get_torch_dataset_images_labels(data_dir): # Transforms for testing sets test_transforms = transforms.Compose([transforms.Resize(255), transforms.CenterCrop(224), transforms.ToTensor(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_images_and_labels(image_dir):\n\n print('Extracting images from: ', image_dir)\n\n image_paths = _load_image_paths(image_dir)\n images = _extract_images(image_paths)\n num_images = len(image_paths)\n labels = np.ones(num_images, dtype=np.int64)\n\n return images, labels", "def load_im...
[ "0.7681719", "0.74293363", "0.73609203", "0.72795737", "0.72581047", "0.7158936", "0.7046928", "0.69199014", "0.6905818", "0.6887617", "0.6876645", "0.6876471", "0.6875588", "0.68576676", "0.68571776", "0.6849307", "0.67792803", "0.6731031", "0.67108095", "0.6624637", "0.6595...
0.8251518
0
Gets the URI of the overpass instance to be used.
def get_overpass_uri() -> str: Config.__get() assert Config.__config is not None return Config.__config.get("wsgi", "overpass_uri", fallback="https://overpass-api.de").strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_uri(self):\n return self.url", "def get_uri(self):\n return self.__uri", "def instance_uri(self) -> 'URI':\n if self.type not in (URIType.INSTANCE, URIType.FRAME):\n raise ValueError(\n f'Cannot get an Instance URI from a {self.type!r} URI.')\n retu...
[ "0.7189086", "0.70563036", "0.6965754", "0.6879851", "0.6879337", "0.6806467", "0.6734687", "0.6734687", "0.6734687", "0.6734687", "0.6734687", "0.6734687", "0.67252", "0.67232066", "0.6699019", "0.66690063", "0.66530716", "0.66436774", "0.66295195", "0.6595632", "0.6591597",...
0.76763237
0
Remembers what should be the new value.
def __init__(self, key: str, value: str) -> None: self.key = key self.value = value self.old_value = "" if Config.has_value(key): self.old_value = Config.get_value(key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_new_value(self):\r\n if self.initial_value is None:\r\n return None\r\n\r\n return deepcopy(self.initial_value)", "def update_original_data(self):\n pass", "def setOriginal(self,neworiginal):\n\t\tself.original = neworiginal;", "def value(self, value):\n\t\toldvalue = ...
[ "0.6736098", "0.64352626", "0.64222825", "0.632522", "0.6298888", "0.628519", "0.62787354", "0.6236735", "0.62160885", "0.61285174", "0.60873526", "0.6059122", "0.60409826", "0.6038539", "0.6037371", "0.6026665", "0.6020483", "0.6009245", "0.5997362", "0.5996211", "0.59927386...
0.0
-1
Save a dictionnary into a file. Useful to save configuration
def save(self, path: Path, data: dict): self.info(data) os.makedirs(path.parent, exist_ok=True) # Force conversion of object (classes) to string # preventing json dumps error for k in data.keys(): if not isinstance(data[k], str): data[k] = str(data[k]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_config(config_path: str, data: dict):\n with open(config_path, 'w') as j:\n dump(data,j)", "def save_settings(dic):\n json.dump(dic, open(\"resources/files/settings.txt\", \"w\"))\n\n # LEGACY\n # with open(\"resources/files/settings.txt\", \"w\", newline=\"\\n\") as w:\n ...
[ "0.78977233", "0.7760636", "0.7665586", "0.7656436", "0.7623543", "0.7608954", "0.75680596", "0.75293875", "0.7524866", "0.74951637", "0.7490081", "0.74679124", "0.7441651", "0.74169946", "0.7415331", "0.737085", "0.7369235", "0.7329637", "0.7320078", "0.72898716", "0.7288981...
0.0
-1
Decide which bin size of the data.
def bin_the_data(neuron_spikes, first, last, bin_size): neuron_activity = [] timebins = range(first, int(last) + int(last) % bin_size, bin_size) for spike in neuron_spikes: activity = [] spike_time = spike[0] i = 0 for bin_size in timebins: k = 0 while...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bin_width(self):\n return self.bins[2] - self.bins[1]", "def computeBinWidth(self):\n self.binWidth = (self.data[-1] - self.data[0]) / self.numBins\n # Fill the frequencies array with zero\n for i in range(self.numBins):\n self.frequencies.append(0)", "def _getNormalB...
[ "0.69538665", "0.6753172", "0.6715331", "0.66878253", "0.64480793", "0.64267254", "0.63587433", "0.63224065", "0.6312987", "0.6280276", "0.6270644", "0.6200157", "0.6187167", "0.6185988", "0.61801946", "0.6164167", "0.6163831", "0.61535054", "0.6150117", "0.61422527", "0.6137...
0.0
-1
Lengths of elements in x
def lengths(x: Any) -> IntOrIter: if is_scalar(x): return Array([1], dtype=numpy.int_) return Array([length(elem) for elem in x], dtype=numpy.int_)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_len(x):\r\n \r\n length = math.sqrt(x[0]**2 + x[1]**2)\r\n return length", "def length(self):\n return len(self.x)", "def count(x):\n return sum(len(y) for y in x)", "def flattened_size(x):\n return numel_from_size(x.size()[1:])", "def length(xyz, along=False):\n xyz = np.a...
[ "0.78835934", "0.7564663", "0.7513346", "0.72787064", "0.70877725", "0.7057564", "0.7054807", "0.7048409", "0.7030963", "0.7016045", "0.70129097", "0.70077914", "0.690448", "0.6837444", "0.6836918", "0.683267", "0.67985857", "0.6790487", "0.67670965", "0.67564726", "0.6750359...
0.7588656
1