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
The name of the flow. The name must be unique in an Alibaba Cloud account.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flow_name(self):\n # This never changes (so no read locking needed).\n return self._flowdetail.name", "def flow_log_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"flow_log_name\")", "async def create_flow_from_name(self, flow_name: str) -> UUID:\n flow_da...
[ "0.8098582", "0.7135818", "0.66779625", "0.6615425", "0.6496065", "0.63506716", "0.6279238", "0.6212589", "0.6178735", "0.61754745", "0.6126986", "0.6105918", "0.60761833", "0.6051269", "0.6046129", "0.5932031", "0.59040743", "0.58971757", "0.5894412", "0.589253", "0.5882445"...
0.0
-1
The ARN of the specified RAM role that Serverless Workflow uses to assume the role when Serverless Workflow executes a flow.
def role_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "role_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> str:\n return pulumi.get(self, \"role_arn\")", "def execution_role_arn(self) -> pulumi....
[ "0.65420634", "0.6541184", "0.6356929", "0.6338323", "0.6338323", "0.6336413", "0.6314953", "0.6314953", "0.6296176", "0.62797946", "0.619897", "0.6191187", "0.6191187", "0.6138167", "0.6012838", "0.5938508", "0.5938508", "0.5938508", "0.5743808", "0.5673479", "0.55946565", ...
0.650819
2
Get an existing Flow resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, definition: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, flow_id: Optional[pulumi.Input[str]] = None, last_mod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n config_bundle: Optional[pulumi.Input[str]] = None,\n detect_md5hash: Optional[pulumi.Input[str]] = None,\n latest_revision_id: Optional[pulumi.Input[str]] =...
[ "0.61467177", "0.59977746", "0.5887954", "0.58686197", "0.5769306", "0.5760383", "0.5744379", "0.5731907", "0.5695245", "0.5681025", "0.566572", "0.5594203", "0.55792254", "0.55501205", "0.55404574", "0.5521873", "0.5518314", "0.55134875", "0.5513117", "0.5510912", "0.5496914...
0.68246835
0
The name of the flow. The name must be unique in an Alibaba Cloud account.
def name(self) -> pulumi.Output[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flow_name(self):\n # This never changes (so no read locking needed).\n return self._flowdetail.name", "def flow_log_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"flow_log_name\")", "async def create_flow_from_name(self, flow_name: str) -> UUID:\n flow_da...
[ "0.8100065", "0.71379757", "0.6680146", "0.661537", "0.6500419", "0.63507307", "0.62835735", "0.621761", "0.6182228", "0.61773825", "0.61278", "0.61080825", "0.60720503", "0.605248", "0.60510796", "0.592769", "0.5900022", "0.5894879", "0.5893847", "0.5891027", "0.5878628", ...
0.0
-1
The ARN of the specified RAM role that Serverless Workflow uses to assume the role when Serverless Workflow executes a flow.
def role_arn(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "role_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"role_arn\")", "def role_arn(sel...
[ "0.6540856", "0.6507507", "0.6507507", "0.6507507", "0.6507507", "0.6357072", "0.63378197", "0.63378197", "0.6335595", "0.63144666", "0.63144666", "0.6296718", "0.62795156", "0.6199739", "0.6190946", "0.6190946", "0.6137535", "0.6013427", "0.5938013", "0.5938013", "0.5938013"...
0.65417695
0
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(optimizer, epoch): lr = learning_rate * (0.1 ** (epoch // 15)) if lr >= 0.0001: lr = 0.0001 for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.79133433", "0.7907211", "0.7850508", "0.77755034", "0.7734465", "0.773158", "0.77232176", "0.7722336", "0.7719667", "0.7709295", "0.7693627", "0.76746327", "0.7665828", "0.7665828", "0.7665828", "0.7655531", "0.76423776", "0.76399475", "0.76379395", "0.76263064", "0.762507...
0.74738246
60
Draw a matrix of scatter plots.
def scatter_matrix( frame: DataFrame, alpha: float = 0.5, figsize: tuple[float, float] | None = None, ax: Axes | None = None, grid: bool = False, diagonal: str = "hist", marker: str = ".", density_kwds: Mapping[str, Any] | None = None, hist_kwds: Mapping[str, Any] | None = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatterplot_matrix():\r\n\r\n # load data\r\n iris_dataset = load_iris()\r\n data = iris_dataset\r\n setosa = data['data'][data['target'] == 0]\r\n versicolor = data['data'][data['target'] == 1]\r\n virginica = data['data'][data['target'] == 2]\r\n\r\n # set picture frame\r\n num = 4\r\...
[ "0.7632802", "0.7094814", "0.69083995", "0.66950476", "0.6512681", "0.6503899", "0.6478721", "0.64720625", "0.6403737", "0.63482517", "0.6196505", "0.61825347", "0.61799836", "0.614676", "0.61089444", "0.6034682", "0.60314435", "0.602379", "0.6016298", "0.59965426", "0.598982...
0.59412354
25
Lag plot for time series.
def lag_plot(series: Series, lag: int = 1, ax: Axes | None = None, **kwds) -> Axes: plot_backend = _get_plot_backend("matplotlib") return plot_backend.lag_plot(series=series, lag=lag, ax=ax, **kwds)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_lag_plot(series_name, lag = 1):\n plt.figure(figsize = (8,5))\n plt.title('Lag Plot of the Trade Value of Imports')\n plt.xlim(min(series_name), max(series_name))\n plt.ylim(min(series_name), max(series_name))\n lag_plot(series_name, lag = lag)\n plt.show()", "def plot_lag_plots(data...
[ "0.7554353", "0.6381466", "0.6196768", "0.5745878", "0.57405406", "0.57405406", "0.5705516", "0.5619891", "0.55574465", "0.55381304", "0.54294086", "0.5428416", "0.54275745", "0.53875905", "0.53862137", "0.5356363", "0.5351594", "0.53365064", "0.5318329", "0.5305291", "0.5292...
0.75921804
0
Create a new HTTPTLSConnection. For client authentication, use one of these argument
def __init__(self, host, port=None, strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None, username=None, password=None, certChain=None, privateKey=None, checker=None, settings=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _mk_http_connection(self) -> ClientSession:\n if self._ssl_context is not None:\n connector = TCPConnector(ssl=self._ssl_context)\n base_url = f'https://{self._netloc}/'\n else:\n connector = TCPConnector()\n base_url = f'http://{self._netloc}/'\n...
[ "0.6850444", "0.6834937", "0.6576818", "0.63885206", "0.6375875", "0.63229674", "0.6259735", "0.6212747", "0.62018746", "0.616409", "0.6156553", "0.6147293", "0.6068201", "0.6066661", "0.6036333", "0.60328496", "0.60305214", "0.6024671", "0.6018019", "0.60107994", "0.6007894"...
0.6953264
0
Get the name of this TLS version.
def getVersionName(self): if self.version == (3,0): return "SSL 3.0" elif self.version == (3,1): return "TLS 1.0" elif self.version == (3,2): return "TLS 1.1" else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_name(self) -> str:\n return pulumi.get(self, \"version_name\")", "def name(self):\n return _version._NAME # pylint: disable=protected-access", "def get_version_name(self):\n\t\tif self.have_metadata is False:\n\t\t\tself._get_metadata()\n\t\t\tself.have_metadata = True\n\n\t\ttry:\n\...
[ "0.7926065", "0.76917684", "0.74067014", "0.7239027", "0.694223", "0.67377144", "0.6716353", "0.6716353", "0.6700214", "0.66756445", "0.66634756", "0.6595793", "0.65939796", "0.65939796", "0.65939796", "0.65939796", "0.65939796", "0.65939796", "0.65939796", "0.65939796", "0.6...
0.80969906
0
Get the name of the cipher implementation used with this connection.
def getCipherImplementation(self): if not self._writeState.encContext: return None return self._writeState.encContext.implementation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCipherName(self):\r\n return CipherSuite.canonicalCipherName(self.cipherSuite)", "def getCipherName(self):\r\n if not self._writeState.encContext:\r\n return None\r\n return self._writeState.encContext.name", "def ssl_cipher(self) -> str:\n return pulumi.get(self, ...
[ "0.76559603", "0.7466432", "0.6878692", "0.66345334", "0.6439635", "0.6427892", "0.6328319", "0.6182311", "0.6103577", "0.6103577", "0.60825557", "0.6077022", "0.60077816", "0.59789926", "0.5919728", "0.5902841", "0.58775467", "0.5876545", "0.5876545", "0.5876545", "0.5876545...
0.74420303
2
Return the socket's own address (socket emulation).
def getsockname(self): return self.sock.getsockname()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_address(self):\n \n if self._addr == None:\n return self._socket.getpeername()\n return self._addr", "def local_address(self) -> T_SockAddr:\n from anyio._core._sockets import convert_ipv6_sockaddr\n return convert_ipv6_sockaddr(self.raw_socket.getsockname())...
[ "0.7759652", "0.75405616", "0.7500997", "0.7415361", "0.73486567", "0.7257618", "0.71555614", "0.7124486", "0.71074885", "0.7051072", "0.6976554", "0.69279504", "0.69074607", "0.6873155", "0.6864303", "0.68543005", "0.682299", "0.68145925", "0.67835015", "0.6780395", "0.67737...
0.65780437
32
Shutdown the underlying socket.
def shutdown(self, how): return self.sock.shutdown(how)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_socket(self):\n self.socket.shutdown(socket.SHUT_RDWR)", "def shutdown(self):\n self.sock.close()", "def shutdown(self):\n self.socket_thread.stop()", "def shutdown(self):\n self._send_command('shutdown')\n self.sock.close()\n self.disconnected = True", "d...
[ "0.81339985", "0.7954016", "0.7920796", "0.7766775", "0.76770145", "0.7673965", "0.76631063", "0.75524914", "0.7443758", "0.7422697", "0.73872596", "0.72678834", "0.72663873", "0.7198483", "0.71174705", "0.71149", "0.710153", "0.7054718", "0.70176625", "0.6976047", "0.6952311...
0.7355222
11
Return a string containing the key.
def write(self, password=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return p...
[ "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "0.8365997", "...
0.0
-1
Get the number of certificates in this chain.
def getNumCerts(self): return len(self.x509List)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self) -> int:\n size = len(self['tbs_cert_list']['revoked_certificates'])\n return size", "def count_chains(self):\n return len(self.chain_list)", "def numResidues(self):\n\n\t\tnres = 0\n\t\tfor chain in self.chain:\n\t\t\tnres += chain.numResidues()\n\n\t\treturn nres", "def c...
[ "0.7009832", "0.6706899", "0.6436793", "0.6413928", "0.64091814", "0.6407851", "0.6390912", "0.638814", "0.6376616", "0.63436776", "0.6319794", "0.62751573", "0.62637293", "0.62599695", "0.6254115", "0.6254115", "0.6254115", "0.6194693", "0.6167812", "0.61472887", "0.61384344...
0.79666656
0
Create the level2 BOSS enemy (smart bullets)
def create_boss(): if config.B == "": config.B = obstacle.Boss(common.R6, common.MIDS_R) else: try: check.check(config.B.x_pos, config.B.y_pos, "Boss") if randint(0, 5) == 1: config.B.shoot(config.M.x_pos) except config.MarioAbove: conf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __spawn_enemy(self):\n enemy = BasicEnemy(self.__pos[0], self.__pos[1],\n 30, 30, self.__enemy_targets, BASIC_ENEMY_IMAGE)\n self.__timer = Timer(self.__spawn_time, self.__spawn_enemy)\n EventListener.fire_events(WORLD_ADD_OBJECT, enemy)", "def create_enemy(rend...
[ "0.66980165", "0.6650183", "0.6605485", "0.6583598", "0.6558802", "0.647644", "0.6473566", "0.6391405", "0.6390596", "0.6336965", "0.6319591", "0.62907", "0.62625235", "0.6193745", "0.6157886", "0.6128412", "0.6126843", "0.603238", "0.59914124", "0.5971777", "0.59595853", "...
0.56400496
43
Negative of the shortest path distance from x to y. We exploit the smallworld property of the social network and apply expanded ring search to compute the shortest path distance from x to y efficiently.
def distance(graph, x, y, neighbor_dict): assert(snap.IsConnected(graph)) S, D = set([x]), set([y]) num_steps = 0 while len(S.intersection(D)) == 0: smaller_set = S if len(S) < len(D) else D new_nodes = set() for node in smaller_set: for neighbor in neighbor_dict[node...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dist(x, y):\n dx = x[0] - y[0]\n dy = x[1] - y[1]\n ans = dx**2 + dy**2\n ans = ans**(0.5)\n return ans", "def dist(x, y):\n dx = x[0] - y[0]\n dy = x[1] - y[1]\n ans = dx**2 + dy**2\n ans =...
[ "0.65123177", "0.65119684", "0.64018536", "0.63468206", "0.62222636", "0.61802346", "0.6165507", "0.6148556", "0.61319673", "0.6112834", "0.604815", "0.5996762", "0.5982471", "0.5979966", "0.5973196", "0.59626305", "0.59579194", "0.59579194", "0.59502864", "0.5938989", "0.593...
0.59646356
15
Get the timestamp of a block.
def timestamp(cls, block: Expr) -> Expr: return cls(BlockField.block_timestamp, block)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(self):\n return self.block.create_time", "def get_stamp(self):\n return self.timestamp", "def getTimestamp(self):\r\n\t\treturn self.pair.data['timestamp']", "def getTimestamp(self):\r\n\t\treturn self.data['timestamp']", "def timestamp(self):\n return self._timestamp", ...
[ "0.7406969", "0.7207374", "0.7155695", "0.7077625", "0.7012697", "0.7012697", "0.7012697", "0.7012697", "0.7012697", "0.7012697", "0.7012697", "0.69915336", "0.69550216", "0.6913949", "0.69103074", "0.68985236", "0.6842196", "0.680241", "0.67972016", "0.6777045", "0.67653", ...
0.807266
0
>>> patron = Patron(date_joined=datetime.datetime.now()) >>> patron.is_expired() False >>> patron = Patron(date_joined=datetime.datetime.now() datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1)) >>> patron.is_expired() True
def is_expired(self): expiration_date = datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS) return (self.date_joined + expiration_date <= datetime.datetime.now())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation_expired(self):\n return self.date_joined + timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS) < timezone.now()", "def is_expired(self):\n expiration_date = datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS)\n\n return (self.user.date_joined + expiration_date <= datetime.d...
[ "0.69919384", "0.6768022", "0.6746742", "0.67197365", "0.6666293", "0.66235864", "0.65516394", "0.651507", "0.64621085", "0.64423746", "0.64357686", "0.6358707", "0.6342834", "0.63334554", "0.6317059", "0.6215799", "0.61647063", "0.61488867", "0.6081687", "0.6039187", "0.6029...
0.71481943
0
Returns the variables used in the polynomial system.
def getVars(self): return self.__vars
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polynomial_variables(self):\n return self._polynomial_variables", "def get_variables(self) -> np.array:\n pass", "def get_variables(self):\n\t\treturn self.variables", "def variables(self):\n return [term.variable for term in self.terms]", "def variables_used (self) :\r\n\t\treturn [i[...
[ "0.8658112", "0.73176146", "0.72423136", "0.7205187", "0.7172086", "0.7141185", "0.71316177", "0.7082384", "0.699829", "0.69913006", "0.698765", "0.6954985", "0.6933052", "0.69301057", "0.69098586", "0.68842596", "0.68338484", "0.68154585", "0.6810749", "0.67769015", "0.67445...
0.636993
45
Redraws the GUI and selects the first element
def showGUI(self,**kwargs): self.baxter.menu.select(self.modes[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_first(self, frame2, lb, pad, event):\n if lb.size() == 0:\n return\n # self.lastinsert = pad.index(GUI.INSERT)\n frame2.focus()\n lb.select_set(self.cntlbcall)\n lb.see(self.cntlbcall)\n\n if self.cntlbcall != 0:\n lb.select_clear(self.cntl...
[ "0.63663656", "0.6231262", "0.6167951", "0.60333204", "0.60275155", "0.6011662", "0.598238", "0.598238", "0.5974353", "0.5963918", "0.5908105", "0.59031874", "0.59030247", "0.58895534", "0.5861371", "0.5861371", "0.585541", "0.58549523", "0.58008283", "0.57977223", "0.5793876...
0.0
-1
Returns True if the given vevent has some overlap with the given start and end datetimes.
def has_overlap(vevent, start, end): event_start = vevent.dtstart.value event_end = vevent.dtend.value assert not is_naive(start), 'start dt is naive' assert not is_naive(end), 'end dt is naive' assert not is_naive(event_start), 'event_start dt is naive' assert not is_naive(event_end), 'event_e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlap(t1start, t1end, t2start, t2end):\n\n return (t1start <= t2start <= t1end) or (t2start <= t1start <= t2end)", "def dates_intervals_are_overlapped(start_1, end_1, start_2, end_2):\n return end_1 >= start_2 and end_2 >= start_1", "def overlap(start1, end1, start2, end2):\n return not (end1 < ...
[ "0.73352504", "0.7268612", "0.7161323", "0.7013083", "0.6998358", "0.6992018", "0.69689727", "0.6942219", "0.6851224", "0.6840325", "0.6771528", "0.67401946", "0.6736302", "0.6669218", "0.6659572", "0.6582103", "0.6563542", "0.6557208", "0.6537529", "0.6507601", "0.6461299", ...
0.8953565
0
if dt is None, default to today.
def filter_list_by_day(vevent_seq, dt=None): dt = dt or datetime_now() if is_naive(dt): dt = make_aware(dt) start = datetime.datetime(dt.year, dt.month, dt.day, tzinfo=dt.tzinfo) end = start.replace(hour=23, minute=59, second=59) return (vevent for vevent in vevent_seq if has_overlap(vevent,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _today() -> datetime.date:\n return datetime.today().date()", "def get_today() -> datetime.date:\n return datetime.date.today()", "def get_today():\n return datetime.today()", "def get_today_date():\n return date.today()", "def today():\n return datetime.today()", "def formalDateToday(...
[ "0.71831757", "0.71790624", "0.7157554", "0.7062118", "0.7044347", "0.6987335", "0.6947952", "0.6940071", "0.6775235", "0.6730335", "0.6727219", "0.6708656", "0.6657537", "0.663685", "0.6627343", "0.65890807", "0.65724427", "0.6568634", "0.6430637", "0.6354221", "0.63142675",...
0.0
-1
This function creates the torch layers and initialize them with xavier
def init_layers_hpm(self): self.lin_layers_hpm.append(nn.Linear(8, self.noFeatures_hpm)) for _ in range(self.noLayers_hpm): self.lin_layers_hpm.append(nn.Linear(self.noFeatures_hpm, self.noFeatures_hpm)) self.lin_layers_hpm.append(nn.Linear(self.noFeatures_hpm, 2)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self) -> None:\n self.self_attn = MultiheadAttention(**self.self_attn_cfg)\n self.cross_attn = MultiheadAttention(**self.cross_attn_cfg)\n self.embed_dims = self.self_attn.embed_dims\n self.ffn = FFN(**self.ffn_cfg)\n norms_list = [\n build_norm_layer(...
[ "0.6642476", "0.65308994", "0.65087086", "0.6487073", "0.6440769", "0.6419816", "0.64024603", "0.63926256", "0.63651925", "0.6359809", "0.63499576", "0.630579", "0.6304811", "0.6298035", "0.62806535", "0.6274737", "0.62613934", "0.62458605", "0.62357026", "0.6222217", "0.6207...
0.0
-1
Load yaml files, expand sheet paths, handle implied sheets
def process_types_dir(search_dir: Path) -> None: discovered_sheets: dict = {} for type_path in search_dir.glob("*.*"): if type_path.suffix != ".yaml": type_key: str = type_path.stem discovered_sheets[type_key] = type_path ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_types(self, types_dir: Path, *, system_key: str, namespace_root: str = \"npc\") -> None:\n def process_types_dir(search_dir: Path) -> None:\n \"\"\"Load yaml files, expand sheet paths, handle implied sheets\n\n This internal helper method scans all the files in search_dir and ...
[ "0.6173981", "0.5809555", "0.5713919", "0.5698637", "0.5692844", "0.56898934", "0.56480736", "0.5596296", "0.55962557", "0.5579956", "0.5485794", "0.53606164", "0.5349578", "0.5334283", "0.5326996", "0.53183305", "0.53127784", "0.5294708", "0.5284989", "0.5284458", "0.5276784...
0.513062
33
Get a system object for the given system key Creates a System object using the definition from the given key. If the key does not have a definition, returns None.
def get_system(self, key: str) -> System: if key not in self.get("npc.systems"): logger.error(f"System '{key}' is not defined") return None return System(key, self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unit_system(key: str) -> UnitSystem:\n if key == _CONF_UNIT_SYSTEM_US_CUSTOMARY:\n return US_CUSTOMARY_SYSTEM\n if key == _CONF_UNIT_SYSTEM_METRIC:\n return METRIC_SYSTEM\n raise ValueError(f\"`{key}` is not a valid unit system key\")", "def find(key):\n return ItopapiProtot...
[ "0.6655925", "0.5816783", "0.5782495", "0.5711011", "0.56320685", "0.54713273", "0.53890646", "0.5377853", "0.53597015", "0.52539897", "0.52343905", "0.5231077", "0.5175568", "0.5134399", "0.5125192", "0.50195485", "0.49772644", "0.4964879", "0.49590507", "0.49144542", "0.488...
0.8242922
0
Works like `eq`, but checks a column value does NOT equal to a value.
def neq(cls, __and=True, __key=None, **kwargs): null_handler = lambda c: (f"{c} IS NOT NULL", []) return _queries("!=", __key, __and, kwargs.items(), null_handler)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_not(self, other: Any) -> ColumnOperators:\n return self.operate(is_not, other)", "def isNot(self, value):\n newq = self.copy()\n newq.setOp(Query.Op.IsNot)\n newq.setValue(value)\n return newq", "def __ne__(self, values):\n self = self.__eq__(values)\n re...
[ "0.7091873", "0.6960923", "0.6841301", "0.67689764", "0.6698606", "0.6638352", "0.66256446", "0.65977436", "0.6589736", "0.6571715", "0.65579796", "0.65313697", "0.65139925", "0.647015", "0.64653003", "0.64653003", "0.64653003", "0.64653003", "0.64391655", "0.64391655", "0.64...
0.0
-1
Works like `eq`, but checks a column value is one of list items using `IN` operator.
def in_(cls, __and=True, __key=None, **kwargs): return _queries("IN", __key, __and, [(k, vs) for k, vs in kwargs.items()])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample_using_a_list(\n self,\n column_name: str,\n value_list: list,\n ):\n return sa.column(column_name).in_(value_list)", "def _list(self, val, fld):\n if isinstance(val, (list, tuple)):\n if len(val) == 1:\n return fld == val[0]\n ...
[ "0.7084676", "0.69178337", "0.6864878", "0.6592657", "0.6559162", "0.64334726", "0.6316192", "0.6284205", "0.62085086", "0.6180624", "0.61562", "0.60635245", "0.5991598", "0.5989757", "0.5969422", "0.5958182", "0.59320325", "0.5864638", "0.5831125", "0.5803822", "0.58037597",...
0.5472265
34
Writes a PVMeterReport to a CSV file. The CSV file is named using the timestamp of the report.
def generate_report(report_item: PVMeterReportItem) -> None: # Generate filename date_string = report_item.timestamp.split("T")[0] filename = pathlib.Path("/results", f"{date_string}.csv") with open(filename, "a") as csvfile: # prepare CSV fields fieldnames = [ "timestamp", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_file(self):\n name = datetime.today().date()\n with open(f'{name}.csv', 'w', newline='') as file_create:\n fieldnames = ['date', 'value_in_pln']\n writer = csv.DictWriter(file_create, fieldnames=fieldnames)\n writer.writeheader()\n while datetime.t...
[ "0.6339773", "0.6316681", "0.61627203", "0.5998259", "0.59788954", "0.5929746", "0.5871269", "0.58422667", "0.5842232", "0.58375883", "0.5768369", "0.5765931", "0.5748804", "0.57439953", "0.57248306", "0.5689246", "0.5671947", "0.5661374", "0.5658581", "0.56122154", "0.559822...
0.6791999
0
Determine Serverless config file name.
def get_sls_config_file(path, stage, region): for name in gen_sls_config_files(stage, region): if os.path.isfile(os.path.join(path, name)): return name return "config-%s.json" % stage # fallback to generic json name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_file_name(self):\n argv = sys.argv\n config_type = \"dev\" # default configuration type\n if None != argv and len(argv) > 1 :\n config_type = argv[1]\n config_file = config_type + \".cfg\"\n logger.info(\"get_config_file_name() return : \" + config_file)...
[ "0.72659236", "0.7194783", "0.6951808", "0.6914893", "0.68098885", "0.68029743", "0.6801206", "0.6740329", "0.6726474", "0.6718891", "0.66243696", "0.6568594", "0.6564246", "0.6507737", "0.64303386", "0.6410679", "0.63609934", "0.6346263", "0.63338715", "0.6318404", "0.631142...
0.6559069
13
Queue worker always needs a queue.
def test_queue_worker_needs_a_queue(self): with pytest.raises(ValueError): MinimalQueueWorker(None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runQueueEnqueue(self):\n raise NotImplementedError", "def queueOn() -> None:\n\t\tLogging.enableQueue = Logging.queueSize > 0", "def _worker(self):\n while True:\n request = self.queue.get()\n self.worker(request)\n self.queue.task_done()", "def setup_queue(...
[ "0.7278178", "0.70632046", "0.67487836", "0.6740838", "0.6720609", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.6676101", "0.66736865", ...
0.7316133
0
Print and plot the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(classes)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.816587", "0.7955341", "0.7950839", "0.79455096", "0.7940542", "0.7918728", "0.79035467", "0.78979486", "0.7895601", "0.78907657", "0.7889559", "0.7889291", "0.7887709", "0.78846425", "0.7883517", "0.7876319", "0.78719187", "0.786987", "0.7864194", "0.786126", "0.78563774",...
0.0
-1
Displays the empty grid to add/remove walls if needeed You can also edit walls when the ants are working
def begin_draw(self): pygame.init() self.display = pygame.display.set_mode(self.disp_size) pygame.display.set_caption('Map Editing') font = pygame.font.SysFont("arial", 15) strings = ["Press ESC to Start Drawing Obstacles", "Click Left to Draw & Right to Erase"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_04():\n plot = {\"Walls\": [\"N\", \"S\", \"W\"], \"TARDIS\": False, \"Transmat\": False,\n \"Plot\": f'\\nEerie blue lights lit the cold corridors. To the NORTH, SOUTH, and WEST are solid metal walls.\\n'}\n return plot", "def grid_01():\n plot = {\"Walls\": [\"S\", \"W\", \"E\"], \...
[ "0.639976", "0.63657", "0.6182506", "0.61376375", "0.6095459", "0.5972917", "0.5963494", "0.5957542", "0.59346217", "0.5934094", "0.59316003", "0.592572", "0.59188735", "0.59078985", "0.5828266", "0.5822109", "0.5798862", "0.5762491", "0.57509893", "0.5743138", "0.57376915", ...
0.57025665
24
Calculate haversine distance based on coordinates p,q
def haversine(p,q): lng1, lat1 = p lng2, lat2 = q dlng = abs(lng2-lng1) dlat = abs(lat2-lat1) a = np.sin(0.5*dlng)**2 + np.cos(lng1)*np.cos(lng2)*np.sin(0.5*dlat)**2 c = 2 * np.arctan2(np.sqrt(a),np.sqrt(1-a)) return c*6371 # earth radius
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def haversine(p: np.ndarray, q: np.ndarray) -> float:\n d = q - p\n a = (math.sin(d[0] / 2.0) ** 2 + math.cos(p[0]) * math.cos(q[0]) * math.sin(d[1] / 2.0) ** 2)\n\n c = 2 * math.atan2(math.sqrt(a), math.sqrt(1.0 - a))\n return c", "def earth_haversine(p: np.ndarray, q: np.ndarray) -> float:\n ear...
[ "0.7775793", "0.77700186", "0.74964947", "0.7475149", "0.7248531", "0.7091504", "0.7064187", "0.69917274", "0.6956939", "0.68603015", "0.68597496", "0.6855843", "0.6854278", "0.6843162", "0.6841937", "0.682354", "0.6807128", "0.67887187", "0.67769873", "0.6769428", "0.6761421...
0.82636094
0
given a list of groups, output all combinations of picking one element from each group e.g. groups = [[1,2,3], [4,5], [6]], output [[1,4,6], [2,4,6], [3,4,6], [1,5,6], [2,5,6], [3,5,6]]
def allCombinations(groupList): queue = [groupList] result = [] while len(queue) > 0: current = queue.pop(0) if sum([len(group) for group in current]) == len(current): result.append([group[0] for group in current]) continue tmpList = [] for i, group in enumerate(current): if len(group) == 1: tm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grouper(groupset):\n\n return list(combinations(groupset, 2))", "def itergroups(groups, num=3):\n sortedgroups = sorted(groups, key=santamin)\n\n for c in sortedgroups:\n if num == 1:\n yield (c,)\n else:\n others = (\n t for t in sortedgroups\n ...
[ "0.7897111", "0.6321369", "0.6285078", "0.61166495", "0.60999864", "0.6024628", "0.59690535", "0.59381866", "0.5827599", "0.5825397", "0.5821363", "0.57815963", "0.5715693", "0.571543", "0.56768656", "0.56106424", "0.5593368", "0.55808634", "0.55752385", "0.5567021", "0.55468...
0.7122247
1
Get the current file name.
def getCurrentFileName(self): return os.path.basename(self.filePath)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_name(self):\n return str(self.get_file())", "def get_name(self):\n return self.file_name", "def get_file_name(self):\n return self.__file_name", "def get_file_name(self):\n return self.file_name", "def get_file_name(self):\n return self._fileName", "def get...
[ "0.8406656", "0.814089", "0.81398875", "0.81064373", "0.8088809", "0.8048407", "0.7991949", "0.79845554", "0.79845554", "0.79845554", "0.79845554", "0.79845554", "0.79813814", "0.79557765", "0.79138213", "0.7907894", "0.7811998", "0.7810537", "0.7797176", "0.7765043", "0.7646...
0.87200963
0
Get the absolute path of the current file path.
def getCurrentFilePath(self): return os.path.abspath(self.filePath)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abspath(self):\n if self.__abspath is None:\n self.__abspath = pbxpath.abspath(self)\n return self.__abspath", "def full_path(self):\n return os.path.abspath(self.path)", "def get_path():\n return path.abspath(path.dirname(path.dirname(__file__)))", "def get_full_path(s...
[ "0.765076", "0.76308316", "0.7538255", "0.7470339", "0.7344921", "0.7339244", "0.7311921", "0.7304363", "0.72982013", "0.7280575", "0.7242775", "0.7227705", "0.72150815", "0.72097427", "0.71977425", "0.71851784", "0.71776885", "0.7147296", "0.71029615", "0.70936203", "0.70308...
0.82042825
0
Get human readable file size.
def sizeof_fmt(size, suffix='B'): for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']: if abs(size) < 1024.0: return f'{size:3.1f} {unit}{suffix}' size /= 1024.0 return f'{size:3.1f} Y{suffix}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_size(file: Path) -> str:\n return (\n humanize.naturalsize(file.stat().st_size) if file.stat().st_size else \"unknown\"\n )", "def file_size():\n return os.path.getsize(FILE_NAME)", "def file_size(file_path):\n if os.path.isfile(file_path):\n file_info = os.stat(file_path...
[ "0.8141374", "0.7742803", "0.77379185", "0.77307975", "0.7678914", "0.76662236", "0.76577383", "0.76530725", "0.76248133", "0.76033276", "0.7546457", "0.7505311", "0.7442776", "0.74394625", "0.7399071", "0.7387684", "0.7368004", "0.73213285", "0.7321178", "0.7315039", "0.7315...
0.0
-1
Create a schedule with a learning rate that decreases following the values of the cosine function between 0 and `pi cycles` after a warmup period during which it increases linearly between 0 and 1.
def get_cosine_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, num_cycles=.5, last_epoch=-1): def lr_lambda(current_step): if current_step < num_warmup_steps: return float(current_step) / float(max(1, num_warmup_steps)) progress = float(current_step - num_warmup_ste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate_schedule(total_steps):\n learning_rate = learning_schedules.cosine_decay_with_warmup(global_step=tf.train.get_or_create_global_step(),\n learning_rate_base=0.04,\n tota...
[ "0.7110258", "0.6899497", "0.6645041", "0.66412514", "0.66396636", "0.65876544", "0.656348", "0.65522355", "0.65375656", "0.6533283", "0.64711654", "0.6444276", "0.6400903", "0.63530403", "0.6331092", "0.6331092", "0.6308138", "0.6225471", "0.6215995", "0.6215995", "0.6215995...
0.6749555
3
Get all network devices for this region.
def get(self, context, region_id, filters): devices_obj = dbapi.netdevices_get_by_region( context, region_id, filters) return jsonutils.to_primitive(devices_obj), 200, None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_all_units():\n all_devices = []\n if network is None:\n import netifaces\n\n gateway = netifaces.gateways().get(\"default\", {})\n subnet = gateway.get(netifaces.AF_INET, ())[0][:-1] + \"0/24\"\n else:\n subnet = network\n async ...
[ "0.70637935", "0.70637935", "0.70436645", "0.70395154", "0.6983511", "0.6799626", "0.67813176", "0.6545613", "0.65258086", "0.6512126", "0.64987904", "0.6498579", "0.64944524", "0.6494098", "0.6494098", "0.6494098", "0.6494098", "0.6372017", "0.63600343", "0.6333063", "0.6325...
0.6117905
32
Turn a column of a dataframe to a list
def column_to_list(column): column = column.tolist() column_string = "" for i in range(len(column)): current_row = column[i] try: column_string = column_string + current_row + " " except: pass column_list = column_string.split() return column_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_col_to_list(df, col='Question and Answer'):\n text = df[col].values.tolist()\n return text", "def dataframe_to_list(df: pandas.DataFrame) -> list:\n return json.loads(df.to_json(orient=\"records\"))", "def get_values(df):\n return df.columns.values.tolist()", "def as_list(df: pandas.D...
[ "0.7913185", "0.7860143", "0.75342023", "0.7515385", "0.72171956", "0.70776105", "0.6996278", "0.68677944", "0.682513", "0.6784916", "0.6738049", "0.66197", "0.6535956", "0.6498092", "0.64457047", "0.6424981", "0.6303053", "0.6254872", "0.6238206", "0.6238206", "0.6222104", ...
0.76806366
2
Remove stop words from a list
def remove_stop_words(dataset): for n in range(len(dataset)): try: # concatenate the title and keywords current_title = dataset.iloc[n]["Title of Post"] current_description = dataset.iloc[n]["Post Description"] token_title = word_tokenize(current_title) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stop_words(stop_list, tokens):\n return [t for t in tokens if len(t) > 2 and not t in stop_list]", "def remove_stopwords(words):\n new_words = []\n for word in words:\n if word not in stopword_list:\n new_words.append(word)\n return new_words", "def stopWord_removal(lis...
[ "0.86323434", "0.859134", "0.8583607", "0.8509769", "0.8430332", "0.83935827", "0.8340073", "0.82639337", "0.82298374", "0.8201932", "0.81800085", "0.81800085", "0.81800085", "0.81800085", "0.8174687", "0.8173034", "0.8165588", "0.81278485", "0.8122506", "0.8101775", "0.80927...
0.70677227
85
Tests if the user has one of the required_privileges to view the requested component.
def privilege_check(user, *required_privileges): for perm in required_privileges: if user.has_property(perm): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(self, user, action, *args):\n if user.is_anonymous or user.is_client:\n return False\n\n if user.is_administrator:\n return True\n\n if user.is_manager:\n return False\n\n # TODO check groups in request maybe ? dunno\n if user.is_advisor:...
[ "0.677943", "0.676476", "0.6701923", "0.6583988", "0.6502213", "0.6458945", "0.64465076", "0.64342135", "0.6399644", "0.63561565", "0.6345719", "0.6342242", "0.63280624", "0.63173866", "0.629907", "0.62907666", "0.62755305", "0.6272019", "0.6266269", "0.6259914", "0.6239875",...
0.6589128
3
Converts a string to camelCase.
def to_camelCase(in_str): if in_str.find(' ') > -1: words = in_str.split(' ') elif in_str.find('_') > -1: words = in_str.split('_') else: return in_str.lower() first_word = words[0].lower() other_words = ''.join(w.title() for w in words[1:]) return '%s%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snake_to_camel_case(string: str):\n return ''.join(string_component.title() for string_component in string.split('_'))", "def to_camel_case(string: str):\n return \"\".join(\n word.title() if idx > 0 else word for idx, word in enumerate(string.split(\"_\"))\n )", "def to_camelcase(s):\n...
[ "0.80392295", "0.8031913", "0.79394627", "0.7901044", "0.7833852", "0.78256905", "0.77288073", "0.7708457", "0.7674313", "0.7616286", "0.75567776", "0.7530756", "0.75295156", "0.74956876", "0.7494626", "0.7472603", "0.7465178", "0.7458354", "0.7424288", "0.73764414", "0.73708...
0.7677759
8
Gets the Collection Id of the image.
def get_collId(self): return self.metadata['collectionId']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection_id(self) -> str:\n return pulumi.get(self, \"collection_id\")", "def __get_image_id(self):\n return self.__get_multi_images_ids(1)", "def image_id(self):\n return self._image_id", "def collection_key(self):\n return '%s:collection' % self._model._name", "def image...
[ "0.8341236", "0.72648305", "0.7071441", "0.6999181", "0.66345394", "0.66345394", "0.65594953", "0.6440482", "0.64248866", "0.6415687", "0.64123917", "0.62969553", "0.62969553", "0.6283656", "0.6283656", "0.6266854", "0.6237935", "0.6112573", "0.6072695", "0.6019608", "0.59818...
0.79555047
1
Initializer for the OrderItem class.
def __init__(self, eod, image=None, item_id=None, order_id=None): self.eod = eod self.image = image self.metadata = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, order_id):\n self.order_items = []\n self.order_id = order_id", "def __init__(self, order_items: list):\n self.order_items = order_items\n self.destination = None", "def __init__(self, symbol, order_type, quantity, direction):\n self.type = 'ORDER'\n ...
[ "0.76594025", "0.7427641", "0.732067", "0.7254301", "0.7160641", "0.700218", "0.69533116", "0.6896037", "0.6828501", "0.6770729", "0.6741956", "0.6710476", "0.6707126", "0.66969275", "0.6675865", "0.6666613", "0.6634283", "0.66086656", "0.6602787", "0.65787166", "0.6560563", ...
0.61871004
37
Gets the Image related to the Order Item.
def get_image(self): return self.image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_imageByItemId(self, item_id):\n for item in self.order_items:\n if item.get_itemId() == item_id:\n return item.get_image()", "def get_image(self, record_id):\n for item in self.order_items:\n img = item.get_image()\n if img is None: return Non...
[ "0.80854374", "0.73633593", "0.7132757", "0.6805643", "0.6712752", "0.66810024", "0.65586793", "0.65447974", "0.6536117", "0.6526761", "0.64795303", "0.63217163", "0.62937945", "0.6279285", "0.61947167", "0.61695516", "0.61475", "0.60869825", "0.60743755", "0.6012644", "0.595...
0.65521765
9
Gets the Record Id of the Image contained in the OrderItem.
def get_recordId(self): return self.metadata['recordId']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image(self, record_id):\n for item in self.order_items:\n img = item.get_image()\n if img is None: return None\n if img.get_recordId() == record_id:\n return img", "def get_itemByImageId(self, record_id):\n for item in self.order_items:\n ...
[ "0.7548376", "0.7429157", "0.7235652", "0.7019394", "0.6867325", "0.68467665", "0.67605275", "0.67605275", "0.66752636", "0.6465909", "0.6443632", "0.6443632", "0.64379287", "0.64379287", "0.6380701", "0.6219178", "0.6152122", "0.61322004", "0.6080134", "0.6050484", "0.604176...
0.65461445
10
Gets the Order Item Id of the OrderItem.
def get_itemId(self): return self.metadata['itemId']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def order_item_id(self):\n return self._order_item_id", "def item_id(self):\n return self._item_id", "def GetId(self,item):\r\n id = self.item_itemId.get(item)\r\n if id: return id\r\n #--Else get a new item id.\r\n id = self.nextItemId\r\n self.nextItemId += 1\...
[ "0.87890446", "0.7759012", "0.73298526", "0.7221307", "0.7137265", "0.69507325", "0.6940846", "0.69297034", "0.6926659", "0.6901709", "0.687732", "0.67830044", "0.67114824", "0.6453359", "0.64288414", "0.6312031", "0.6220112", "0.61873883", "0.6170198", "0.6103751", "0.607865...
0.6841653
11
Gets the Order Id of the OrderItem.
def get_orderId(self): return self.metadata['orderId']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def order_item_id(self):\n return self._order_item_id", "def order_id(self) -> str:\n return pulumi.get(self, \"order_id\")", "def get_orderId(self):\n return self.order_id", "def getWorkflowIdByOrderItemId(self, session, order_item_id):\n code = self.getWorkflowByOrderItemId(sess...
[ "0.8806455", "0.78389424", "0.77038", "0.6982702", "0.6946828", "0.6941641", "0.68327236", "0.66065", "0.6557132", "0.64556277", "0.63304263", "0.63278496", "0.6311979", "0.63009757", "0.61975074", "0.61184084", "0.6103081", "0.607089", "0.60097975", "0.5931507", "0.5889583",...
0.70974106
3
Gets the number of Order Items for the order.
def count(self): return len(self.order_items)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_items(self):\n count = 0\n for o in self.order_lst:\n count += o.count()\n \n return count", "def count(self):\n return len(self.order_lst)", "def get_num_items(self):\r\n return self.num_items", "def get_order_count(self):\n resp = se...
[ "0.8346433", "0.79781455", "0.76167053", "0.753026", "0.73925185", "0.73681617", "0.7281924", "0.7260821", "0.7260821", "0.72342044", "0.7104526", "0.7045387", "0.70258796", "0.69970834", "0.6945575", "0.6915006", "0.69072825", "0.6829324", "0.68170524", "0.6736703", "0.67130...
0.8536371
0
Gets the Order Id of the order.
def get_orderId(self): return self.order_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def order_id(self) -> str:\n return pulumi.get(self, \"order_id\")", "def get_orderId(self):\n return self.metadata['orderId']", "def order_item_id(self):\n return self._order_item_id", "def get_order_guid(order_id):\n return linnapi.orders.get_order_guid_by_order_id(order_id)", "de...
[ "0.8710611", "0.7937176", "0.75049937", "0.7248133", "0.720956", "0.69093657", "0.68471295", "0.6718101", "0.6586725", "0.65214396", "0.6451534", "0.64397424", "0.6430433", "0.64009523", "0.6382825", "0.63303614", "0.63206", "0.62308764", "0.62051505", "0.62051505", "0.620515...
0.8556586
1
Gets a particular Order with a given Order Id.
def get_order(self, order_id): for o in self.order_lst: if o.get_orderId() == order_id: return o
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_order(self, order_id):\n request = OrdersGetRequest(order_id)\n response = self.client.execute(request)\n\n return response", "def get_order(self, orderid):\n return self.get_orders(orderid=orderid)", "def GetOrder(order_id): \n\t\"\"\"Method to get order\"\"\"\n\trequest ...
[ "0.8376587", "0.8183502", "0.8012559", "0.78738725", "0.78394556", "0.7638045", "0.74547035", "0.7320312", "0.7300171", "0.7257783", "0.72426236", "0.71875983", "0.7185175", "0.7064301", "0.70390755", "0.703618", "0.6993463", "0.697223", "0.6950605", "0.69504607", "0.6939309"...
0.81800294
2
takes a pile object as input and returns True/False if the pile can be placed on the pile
def is_valid_placement(self, other_pile): if other_pile.get_length() == 1: card = other_pile.get_bottommost_card() if self.get_length() == 0: return card.get_rank_value() == 1 else: return (self.get_topmost_card().get_suit() == card.get_suit() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def canTile(self):\n raise RuntimeError('Not implemented')\n \n return False", "def can_add_obstruction(obstruction: GriddedPerm, tiling: \"Tiling\") -> bool:\n return tiling.add_requirement(obstruction.patt, obstruction.pos).is_empty()", "def __contains__(self, item):\n try:...
[ "0.6202819", "0.6187063", "0.61520624", "0.60824275", "0.5946219", "0.59342146", "0.59274", "0.5873695", "0.5853587", "0.5803937", "0.5779417", "0.5776014", "0.5744567", "0.5727454", "0.57186925", "0.57150114", "0.56969875", "0.5693772", "0.5683235", "0.568186", "0.56593263",...
0.6485839
0
takes a pile object as input and returns True/False if it can be placed on this pile
def is_valid_placement(self, other_pile): card = other_pile.get_bottommost_card() if self.get_length() == 0: return card.get_rank_value() == 13 else: return (self.get_topmost_card().get_color() != card.get_color() and self.get_topmost_card().get_rank_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_placement(self, other_pile):\n if other_pile.get_length() == 1:\n card = other_pile.get_bottommost_card()\n if self.get_length() == 0:\n return card.get_rank_value() == 1\n else:\n return (self.get_topmost_card().get_suit() == card....
[ "0.6341556", "0.6230321", "0.62277555", "0.60474247", "0.60162956", "0.58754706", "0.58564156", "0.58322114", "0.58012825", "0.5791161", "0.5722445", "0.5721765", "0.57155216", "0.5714138", "0.569503", "0.56773084", "0.56750566", "0.56311923", "0.56178105", "0.5596447", "0.55...
0.5719372
12
Instantiates a new Randomizer test.
def __init__(self, test_name=""): unittest.TestCase.__init__(self, test_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, randomizer=MyRandomizer(), useAlternative=False):\n self._randomizer = randomizer\n self._number = self._randomizer.getNumber()\n self._useAlternative = useAlternative", "def __init__(self, user_ctor, seed=0):\n self._user_ctor = user_ctor\n self._seed = seed\n se...
[ "0.66976887", "0.63714814", "0.6344554", "0.628294", "0.62630504", "0.6215402", "0.6176607", "0.6060905", "0.6051847", "0.6041937", "0.5968584", "0.5921714", "0.5900688", "0.58927", "0.5885444", "0.58638424", "0.585527", "0.5823883", "0.5793972", "0.5788863", "0.5780561", "...
0.0
-1
Given a text embedding and mel_target, generate until we have enough. Note this is for reference only.
def batch_generate(self, text, mel_target): mel_in = torch.zeros(1,80,1).to(self.device) for i in range(mel_target.shape[2]): # forward pass y, ylogit, a = self.generate(text, mel_in) # create new mel_in mel_in = torch.cat((mel_in, y[:,:,-1].view(1,80,1)),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_beam(model, input_embedding, char2idx, idx2char, k=5, maxlen=30,\n start='START', use_head=True):\n with torch.no_grad():\n device = input_embedding.device\n softmax = nn.Softmax(dim=1)\n if use_head:\n input_embedding = input_embedding.view(1, -1)\n\n ...
[ "0.5941551", "0.57749313", "0.572244", "0.5606113", "0.5592264", "0.55832815", "0.5542636", "0.5512056", "0.5479165", "0.5469707", "0.5465859", "0.5463732", "0.54558533", "0.54458934", "0.54245216", "0.5412163", "0.54068685", "0.53842026", "0.53804755", "0.5337354", "0.527893...
0.7151947
0
r"""Quote string according to
def quoteString(s): if s is None: return None quoted = str(s).replace("\\", "\\\\").replace("'", "\\'") return "'{}'".format(quoted)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shQuote(text):\n\treturn \"'%s'\" % text.replace(\"'\", r\"'\\''\")", "def quot(string):\r\n return string.replace('\"', \"'\")", "def _quote(self, arg):\n arg = arg.replace('\\\\', '\\\\\\\\')\n arg = arg.replace('\"', '\\\\\"')\n return '\"%s\"' % arg", "def _quote(v):\n...
[ "0.80535495", "0.7900592", "0.78692704", "0.78209245", "0.7751507", "0.762904", "0.7605343", "0.7557973", "0.7550649", "0.7538957", "0.7525345", "0.7524699", "0.7501083", "0.746809", "0.744895", "0.74325407", "0.74325407", "0.7400226", "0.72602093", "0.7195997", "0.71789336",...
0.70544463
27
Using the special method __eq__ to compare a dotted dict with a normal dict
def test_comparing(self): for test in self.test_dict_data: self.assertEqual(dottedDict(test[0]), test[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return dict.__eq__(self, other)", "def dict_equal(d1: Dict, d2: Dict) -> bool:\n\n # iterate over the dict with more keys\n # di is the dictionary to iterate over\n # dj is the one to compare to\n if len(d2) > len(d1):\n di = d2\n dj = d1\n else:\n ...
[ "0.70567685", "0.7030499", "0.69945276", "0.69496226", "0.6893899", "0.68598694", "0.68520963", "0.67593527", "0.67554206", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", "0.67449075", ...
0.7175389
0
Test that user can't see dashboard page when logged out.
def test_dashboard_page(self): result = self.client.get("/dashboard", follow_redirects = True) self.assertNotIn(b"Family Ties - Dashboard", result.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dashboard_not_signed(self):\n views_url = ('/dashboard/',\n '/accounts/picture/')\n #create a get request\n for view in views_url:\n response = self.client.get(view)\n #the user was not logged in, the user should be redirected\n s...
[ "0.77127415", "0.7410981", "0.74059564", "0.74059564", "0.74059564", "0.74059564", "0.7377276", "0.72838855", "0.7191166", "0.7114832", "0.7099439", "0.7087196", "0.7080443", "0.7062934", "0.70530087", "0.70370275", "0.7027886", "0.7023831", "0.70222175", "0.70222175", "0.702...
0.77490085
0
Testing that the user object 'email' has been constructed properly
def test_email(self): self.assertEqual('maryc123@yahoo.com', self.user.email)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_user_by_emailuser_email_get(self):\n pass", "def test_email_attr(self):\n user = User()\n self.assertTrue(hasattr(user, \"email\"))\n self.assertEqual(user.email, \"\")", "def test_private_create_user_without_email(self):\n with pytest.raises(ValueError) as exinf...
[ "0.7803552", "0.77379304", "0.7714331", "0.7556535", "0.74997526", "0.74679047", "0.7436216", "0.7416348", "0.74111354", "0.7369994", "0.73494637", "0.7337338", "0.72906685", "0.7267479", "0.72565883", "0.72532207", "0.7245863", "0.7243337", "0.72333694", "0.72056276", "0.720...
0.8290128
0
Return ``True`` if the code is this function is being called from an IPython kernel.
def running_in_ipython() -> bool: try: from IPython import get_ipython return get_ipython() is not None except ImportError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ipython():\n return 'get_ipython' in globals()", "def _run_from_ipython():\n try:\n __IPYTHON__\n return True\n except NameError:\n return False", "def run_from_ipython():\n try:\n __IPYTHON__\n return True\n except NameError:\n return False", ...
[ "0.79321265", "0.7862566", "0.777043", "0.77517426", "0.7743101", "0.7703482", "0.76765686", "0.7490539", "0.7485736", "0.74706435", "0.7398897", "0.7368418", "0.7311856", "0.7287088", "0.71761143", "0.7102788", "0.70817024", "0.7075315", "0.69422483", "0.6597528", "0.6555550...
0.78931624
1
Initialize a _Node instance.
def __init__(self, elem, idx, parent=None, children=None): self._elem = elem self._index = idx self._parent = parent self._children = children if children is not None else []
{ "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 = self.Node()", "def __init__(self):\n self.root = Node('')", "def __init__(self):\n ...
[ "0.78850067", "0.7797428", "0.7776527", "0.7674465", "0.76540625", "0.7571528", "0.7571528", "0.75055903", "0.75055903", "0.75055903", "0.74776316", "0.74457496", "0.74301153", "0.73774654", "0.73232526", "0.72661924", "0.7256435", "0.72451985", "0.7206691", "0.7194062", "0.7...
0.0
-1
Return Position representing the root of the tree.
def root(self): return self._make_position(self._root)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root(self):\n return self._make_position(self._root)", "def root_index(self):\n if self.is_binary_tree:\n return 0\n return -1", "def root_node(self):\n return self.process_tree", "def get_root(self):\n return self._root", "def get_root(self):\n return s...
[ "0.8176423", "0.75669944", "0.7053235", "0.7034105", "0.7007992", "0.69898534", "0.69779855", "0.69779855", "0.6940688", "0.69380456", "0.682193", "0.6804064", "0.6804064", "0.6804064", "0.67927355", "0.676885", "0.6723106", "0.6690636", "0.66734755", "0.6660903", "0.6654477"...
0.81233585
5
Instantiate a fake HTTP Request, complete with a database session. This is a functionlevel fixture, so every new request will have a new database session.
def dummy_request(db_session): return testing.DummyRequest(dbsession=db_session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dummy_request(new_session):\n return testing.DummyRequest(dbsession=new_session)", "def dummy_request(new_session, method=\"GET\"):\n request = testing.DummyRequest()\n request.method = method\n request.dbsession = new_session\n return request", "def new_req_session_bad():\n saEngine = sq...
[ "0.73897773", "0.7043923", "0.7006996", "0.6651173", "0.6429848", "0.6423533", "0.63124603", "0.62354213", "0.61863494", "0.6134273", "0.6091861", "0.60249496", "0.6009063", "0.59958273", "0.5993505", "0.5985961", "0.598009", "0.5968758", "0.59425914", "0.59221756", "0.590924...
0.74959946
2
Test that the home view returns no objects in the expenses iterable.
def test_home_view_returns_empty_when_empty(dummy_request): from learning_journal.views.default import home_view result = home_view(dummy_request) assert len(result["entries"]) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index_view_with_no_games(self):\n response = self.client.get(reverse('infinite:index'))\n self.assertEqual(response.status_code, 200)\n self.assertContains(response, 'There are no games present.')\n self.assertQuerysetEqual(response.context['games'], [])", "def test_list_none...
[ "0.7065249", "0.6918311", "0.6895581", "0.6791274", "0.6755123", "0.6750124", "0.6738067", "0.6681425", "0.66096", "0.6573949", "0.656964", "0.6565591", "0.6495336", "0.6459751", "0.6459081", "0.64568466", "0.6430726", "0.64072657", "0.635334", "0.62979174", "0.62961143", "...
0.71341634
0
Test that the create_view method returns an empty dict on a get request.
def test_create_view_returns_empty_dict_on_get(dummy_request): from learning_journal.views.default import create_view result = create_view(dummy_request) assert result == {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_view_returns_empty(dummy_request):\n from learning_journal.views.default import new_entry\n assert new_entry(dummy_request) == {}", "def test_get_login_view_is_empty_dict(dummy_request):\n from learning_journal.views.default import login_view\n assert login_view(dummy_request) == {}",...
[ "0.7403495", "0.72789055", "0.7004455", "0.69699925", "0.6892958", "0.68705904", "0.68061334", "0.6796355", "0.67233723", "0.672114", "0.6715737", "0.6682679", "0.6610521", "0.6604622", "0.657207", "0.6552488", "0.6522793", "0.65139127", "0.6503516", "0.6472757", "0.64031726"...
0.8844149
0
Create an instance of webtests TestApp for testing routes. With the alchemy scaffold we need to add to our test application the setting for a database to be used for the models. We have to then set up the database by starting a database session. Finally we have to create all of the necessary tables that our app normall...
def testapp(): from webtest import TestApp from pyramid.config import Configurator def main(global_config, **settings): """ This function returns a Pyramid WSGI application.""" config = Configurator(settings=settings) config.include('pyramid_jinja2') config.include('.model...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n # create a temporary file to isolate the database for each test\n # create the app with common test config\n app = create_app({\"TESTING\": True, \"DATABASE_NAME\": \"AAPI_DB_Test\"})\n\n # create the database and load test data\n with app.app_context():\n init_db()\n\n yield ...
[ "0.7921316", "0.77649575", "0.77635676", "0.7674326", "0.7643252", "0.76162076", "0.7584429", "0.757256", "0.7570243", "0.75544906", "0.7538623", "0.7538623", "0.75385076", "0.75229317", "0.75209075", "0.74971277", "0.7478079", "0.74633783", "0.7461909", "0.74604017", "0.7456...
0.7216184
57
Test the update view redirects on a post request and changes title.
def test_update_view_post_redirects_changes_title(testapp): post_params = { 'title': 'Some Title.', 'body': 'Some Body.' } response = testapp.post('/journal/2/edit-entry', post_params, status=302) full_response = response.follow() assert response.text[0:3] == '302' assert full_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_partial_update_admin(self):\n url = reverse('post-detail', kwargs={'pk': self.post.id})\n title = 'Random New Title Patched'\n user_url = reverse('user-detail', kwargs={'pk': self.superuser.id})\n self.client.force_authenticate(user=self.superuser)\n response = self...
[ "0.7723399", "0.7444177", "0.7282646", "0.72503036", "0.71905655", "0.7089848", "0.7061609", "0.703184", "0.69167626", "0.6870537", "0.680971", "0.68068796", "0.6763964", "0.6755622", "0.6694032", "0.6663651", "0.65292186", "0.65274686", "0.6527144", "0.6524805", "0.6524466",...
0.84657437
0
Save today mean temperature to database and reset today table.
def calculate_today_last(region, db, local_forecast): # get all temps from today table today_historical_params = {'table': 'today', 'conditions': ['region_id'], 'condition_data': (region.id,), 'filters': ['hour_{}'.format(x) for x in range(0, 24, 3)]} # returns a list of tuples today_hist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_temperature_values(self):\n year = self._current_date.year\n month = self._current_date.month\n\n self.ensure_temperatures(dt.date(year, month, 15))\n self.set_temperature_arrays(dt.date(year, month, 15))", "def save_now(self):\r\n self.save()", "def save_now(self)...
[ "0.60187536", "0.5993358", "0.5993358", "0.56885904", "0.56885904", "0.56733537", "0.5628096", "0.55071306", "0.5345769", "0.53326154", "0.5319162", "0.5309182", "0.5303772", "0.5237228", "0.52265894", "0.52029026", "0.5197194", "0.5196578", "0.5189538", "0.5181746", "0.51609...
0.582651
3
Check if current month is spring (marchaugust).
def spring(date=None): # extract current month if not given if not date: date = datetime.datetime.now().month if date in [3, 4, 5, 6, 7, 8]: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isCurrentMonth(self):\n t = time()\n gmt = safegmtime(t + _tzoffset(self._tz, t))\n return gmt[0] == self._year and gmt[1] == self._month", "def is_startmonth(today):\n if isinstance(today, datetime):\n if today.day == 1:\n return True\n return False\n else...
[ "0.7236549", "0.6544689", "0.63760155", "0.61577076", "0.6055105", "0.603532", "0.5949159", "0.5937832", "0.5937832", "0.59302235", "0.59184843", "0.59134305", "0.59085244", "0.58865815", "0.58748585", "0.5817417", "0.581496", "0.57800984", "0.57604784", "0.57313764", "0.5731...
0.77690476
0
Check regions, that have last_date set to zero.
def check_last_dates(db): last_dates_params = {'table': 'regions', 'conditions': [], 'condition_data': (), 'filters': ['id', 'last_date']} last_dates = db.select(**last_dates_params) # select zero value last_dates zero_last_dates = [x for x in last_dates if x[1] == 0] # if there are zer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero(self) -> bool:\n return self._algorithm.is_last_zero(self._stat)", "def is_last_zero(self, meta: \"CardMeta\") -> bool:\n if len(meta.past_quality) < 1:\n return False\n return meta.past_quality[-1] == 0", "def make_is_bad_zero(Xy_subset, min_interval=48,summer_month_st...
[ "0.556572", "0.55298465", "0.55213886", "0.533535", "0.531173", "0.52079725", "0.51966786", "0.514397", "0.5142353", "0.51168656", "0.50809765", "0.50446415", "0.5017214", "0.49615896", "0.49445885", "0.4944367", "0.4918328", "0.49082747", "0.4901023", "0.4891084", "0.4885123...
0.6996689
0
Generate `Package` object for a `url` string
def get_response(url): resp = requests.get(url) if resp.status_code == 200: return resp.json() raise Exception(f"Failed to fetch: {url}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_package_url (package_name, package_version, lang):\n\n ruby_template = \"http://rubygems.org/downloads/{0}-{1}.gem\"\n python_template_tar = \"https://pypi.python.org/packages/source/{0}/{1}/{2}-{3}.tar.gz\"\n python_template_zip = \"https://pypi.python.org/packages/source/{0}/{1}/{2}-{3}.zip\"\n...
[ "0.6365717", "0.60857993", "0.60832125", "0.6081528", "0.60082346", "0.59590834", "0.5824557", "0.57134306", "0.5693194", "0.5676577", "0.55692726", "0.5564248", "0.5531907", "0.55270225", "0.5525655", "0.55057466", "0.5503707", "0.54816616", "0.54611915", "0.54479426", "0.54...
0.0
-1
Initialize Bessel basis layer.
def __init__(self, num_radial, cutoff, envelope_exponent=6) -> None: super(BesselBasisLayer, self).__init__() self.cutoff = cutoff self.envelope = Envelope(envelope_exponent) self.freq = torch.nn.Parameter(torch.Tensor(num_radial)) self.reset_parameters()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initbasissolve(self,basis_):\n _basis_minlength = self.getnumcon()\n if self.getnumcon() > 0 and basis_ is not None and len(basis_) != self.getnumcon():\n raise ValueError(\"Array argument basis is not long enough: Is %d, expected %d\" % (len(basis_),self.getnumcon()))\n if isinstance(basis_,nump...
[ "0.674475", "0.65515566", "0.5975523", "0.5974542", "0.5944401", "0.59138846", "0.58952105", "0.58952105", "0.58952105", "0.585648", "0.58523905", "0.5825225", "0.58150333", "0.58132696", "0.58031493", "0.57976377", "0.578624", "0.57804686", "0.5753966", "0.5695529", "0.56482...
0.66127914
1
Returns central account number for a given account from accounts config.
def fetch_account_central(account:str): for config in accounts: if account in config['streamers']: return config['central'] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self):\n return self.config.account_id", "def account(self, acct):\n aMgr = self.acctManager\n if len(aMgr.accounts) <= acct:\n raise Exception(\"requested unknown account number %i\" % acct)\n return aMgr.account(acct)", "def account_id(self) -> pulumi.Out...
[ "0.6999533", "0.695133", "0.66567826", "0.6569194", "0.65294087", "0.6383802", "0.6383657", "0.6380516", "0.6380516", "0.6380516", "0.6380516", "0.6380516", "0.6380516", "0.6380516", "0.6380516", "0.63515407", "0.63515407", "0.63515407", "0.63515407", "0.63515407", "0.6351540...
0.6600531
3
Strips `.git` from the given URL of a git repository.
def strip_dot_git(url: str) -> str: """Strip trailing .git""" return url[: -len(".git")] if url.endswith(".git") else url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trim_repo_url(url):\n return url.replace(\".git\", \"\")", "def normalize_url(url):\n if not url.startswith((\"git+\", \"hg+\")):\n return url\n return url[4:]", "def _strip_prefix(repository, commit, extra_strip_prefix):\n repository_split = repository.split(\"/\")\n\n if len(reposit...
[ "0.82751054", "0.6612633", "0.6415065", "0.64105713", "0.6285297", "0.6237822", "0.6158248", "0.6067515", "0.60550964", "0.5934063", "0.59173226", "0.5832029", "0.5669091", "0.56549984", "0.56549615", "0.5622156", "0.5611518", "0.56023824", "0.5559296", "0.5550014", "0.553892...
0.8182727
1
Set the value of the AWSAccessKeyId input for this Choreo. ((required, string) The Access Key ID provided by Amazon Web Services.)
def set_AWSAccessKeyId(self, value): super(ListOrdersInputSet, self)._set_input('AWSAccessKeyId', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_AWSAccessKeyId(self, value):\n super(DescribeEvaluationsInputSet, self)._set_input('AWSAccessKeyId', value)", "def set_AWSAccessKeyId(self, value):\n super(PutBucketWebsiteRedirectInputSet, self)._set_input('AWSAccessKeyId', value)", "def set_AWSSecretKeyId(self, value):\n super(Pu...
[ "0.72723484", "0.710617", "0.54324937", "0.47658166", "0.46092838", "0.45972604", "0.45739532", "0.4472829", "0.4248372", "0.4191702", "0.41222933", "0.41142592", "0.41121876", "0.41105497", "0.40660536", "0.39658597", "0.3951813", "0.39157018", "0.38724113", "0.38406", "0.38...
0.67074126
2
Set the value of the AWSMarketplaceId input for this Choreo. ((required, string) The Marketplace ID provided by Amazon Web Services.)
def set_AWSMarketplaceId(self, value): super(ListOrdersInputSet, self)._set_input('AWSMarketplaceId', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def marketplace_id(self, marketplace_id):\n\n self._marketplace_id = marketplace_id", "def put_place_by_id(place_id):\n place_obj = storage.get(\"Place\", place_id)\n if place_obj is None:\n abort(404)\n json_obj = request.get_json()\n if not request.json:\n return jsonify(\"Not ...
[ "0.72879887", "0.58116764", "0.5750025", "0.55713093", "0.547708", "0.53217125", "0.5183841", "0.5151255", "0.5129524", "0.4927995", "0.49077547", "0.48618492", "0.4845483", "0.47783786", "0.4730123", "0.47192258", "0.46833223", "0.46547133", "0.46401277", "0.45902717", "0.45...
0.7679715
0
Set the value of the AWSMerchantId input for this Choreo. ((required, string) The Merchant ID provided by Amazon Web Services.)
def set_AWSMerchantId(self, value): super(ListOrdersInputSet, self)._set_input('AWSMerchantId', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merchant_id(self, merchant_id):\n\n self._merchant_id = merchant_id", "def set_merchant_transaction_id(self, transaction_id):\n self.merchant_transaction_id = transaction_id", "def merchant_id(self, merchant_id):\n if merchant_id is None:\n raise ValueError(\"Invalid value f...
[ "0.6719796", "0.6547163", "0.62715065", "0.56438535", "0.5553008", "0.5232778", "0.5110247", "0.5004952", "0.4971088", "0.4896", "0.48900896", "0.48170877", "0.48170877", "0.47717518", "0.47717518", "0.47717518", "0.47222784", "0.46926683", "0.46465647", "0.46089354", "0.4608...
0.70061433
0
Set the value of the AWSSecretKeyId input for this Choreo. ((required, string) The Secret Key ID provided by Amazon Web Services.)
def set_AWSSecretKeyId(self, value): super(ListOrdersInputSet, self)._set_input('AWSSecretKeyId', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_AWSSecretKeyId(self, value):\n super(PutBucketWebsiteRedirectInputSet, self)._set_input('AWSSecretKeyId', value)", "def set_AWSSecretKeyId(self, value):\n super(DescribeEvaluationsInputSet, self)._set_input('AWSSecretKeyId', value)", "def vpc_id(self, vpc_id):\n self._vpc_id = vpc_...
[ "0.7063978", "0.70151764", "0.5468902", "0.5332704", "0.51895", "0.48366946", "0.48366946", "0.48366946", "0.48366946", "0.48366946", "0.48366946", "0.47255194", "0.46391213", "0.46391213", "0.46391213", "0.46391213", "0.46391213", "0.46391213", "0.46391213", "0.46391213", "0...
0.64663893
2
Set the value of the CreatedAfter input for this Choreo. ((optional, date) A date used for selecting orders created after (or at) a specified time, in ISO 8601 date format (i.e. 20120101). Defaults to today's date if not provided.)
def set_CreatedAfter(self, value): super(ListOrdersInputSet, self)._set_input('CreatedAfter', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_LastUpdatedAfter(self, value):\n super(ListOrdersInputSet, self)._set_input('LastUpdatedAfter', value)", "def auto_expire_after(self, auto_expire_after):\n\n self._auto_expire_after = auto_expire_after", "def created_after(self, date: datetime):\n return self.created_search(date, s...
[ "0.53310245", "0.499854", "0.49263355", "0.4918126", "0.48875487", "0.48875487", "0.48875487", "0.48875487", "0.48875487", "0.48875487", "0.482363", "0.4775686", "0.47677907", "0.47677907", "0.47677907", "0.47677907", "0.47677907", "0.47677907", "0.47677907", "0.47677907", "0...
0.6866181
0
Set the value of the MWSAuthToken input for this Choreo. ((optional, string) The Amazon MWS authorization token for the given seller and developer.)
def set_MWSAuthToken(self, value): super(ListOrdersInputSet, self)._set_input('MWSAuthToken', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_token(self, token):\n # type: (Token) -> None\n self.token = token\n self._token_header = \"Bearer \" + token[\"access_token\"]", "def set_maptoken(self, token):\n self._data['maptoken'] = token", "def set_access_token(self, token):\n\n self.__current_request_mock.hea...
[ "0.576967", "0.56646496", "0.54909223", "0.53241736", "0.499911", "0.49847585", "0.49391955", "0.48916435", "0.485251", "0.47882146", "0.47711712", "0.47595584", "0.47500035", "0.46695724", "0.4666555", "0.46046934", "0.46013397", "0.46013397", "0.45143178", "0.4475756", "0.4...
0.57973063
0
Set the value of the OrderStatus input for this Choreo. ((optional, string) One or more OrderStatus values separated by commas. This options selects only orders with a certain status (e.g. Pending, Unshipped, PartiallyShipped, Shipped, Canceled, Unfulfillable, etc).)
def set_OrderStatus(self, value): super(ListOrdersInputSet, self)._set_input('OrderStatus', value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_order_status(self, status, orderid=0, envtype=0):\n if int(status) not in TRADE_CN.REV_ORDER_STATUS:\n error_str = ERROR_STR_PREFIX + \"the type of status is wrong \"\n return RET_ERROR, error_str\n\n if not TRADE_CN.check_envtype_cn(envtype):\n error_str = ER...
[ "0.68667966", "0.59143144", "0.58812493", "0.5829258", "0.57479376", "0.5743604", "0.5699317", "0.56922853", "0.56759113", "0.56418455", "0.5613556", "0.5605197", "0.55898786", "0.55781007", "0.5570754", "0.55453914", "0.5509893", "0.5509893", "0.5509893", "0.5507921", "0.549...
0.6059685
1
Retrieve the value for the "Response" output from this Choreo execution. (Stores the response from Amazon.)
def get_Response(self): return self._output.get('Response', None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def response(self):\n return self._response", "def get_response_variable(self):\n\n return self._response_variable", "def get_response(self):\n result = self.get_response_impl()\n if self.log_dest is not None:\n is_error, response = result\n if is_error:\n ...
[ "0.6562457", "0.6433181", "0.6348591", "0.6296991", "0.6100417", "0.60615295", "0.5932142", "0.5932142", "0.5838001", "0.58311445", "0.57775015", "0.5776427", "0.5766878", "0.5676285", "0.5671042", "0.56706774", "0.56524163", "0.56200385", "0.555828", "0.5549343", "0.55422133...
0.78551126
11
Set the time frequency and prediction length parameters. This method must be called before being able to use `predict`, otherwise, default values of 'D' and `20` wil be used.
def set_prediction_parameters(self, freq, prediction_length): self.__freq = freq self.__prediction_length = prediction_length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_prediction_parameters(self, freq, prediction_length):\r\n self.freq = freq\r\n self.prediction_length = prediction_length", "def set_freq_params(self, freq):\n self.seq.add_param(self.mng_name, \"restFrequency\", str(freq), 1)", "def set_training_parameters(\n self,\n ...
[ "0.77073056", "0.603881", "0.5882509", "0.5843632", "0.5705226", "0.555827", "0.5515937", "0.54392076", "0.5419948", "0.5381452", "0.5332829", "0.5328178", "0.53256583", "0.5324762", "0.5317084", "0.53148115", "0.5274992", "0.52570456", "0.52333546", "0.5226578", "0.5214578",...
0.7637484
1
Return RDF graph from string in RDF format.
def from_string(data, format): # Using ConjunctiveGraph instead of Graph for nquads support. graph = rdflib.ConjunctiveGraph() graph.parse(data=data, format=format) return graph
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(self, s: str) -> Graph:\n tree = self.parse(s)\n return layout.interpret(tree, self.model)", "def from_string(representation):\r\n gramm = Grammar()\r\n\r\n for rule in representation.strip().split('\\n'):\r\n gramm._add_rule(rule)\r\n\r\n return gramm", ...
[ "0.6251406", "0.6150217", "0.5808122", "0.5771754", "0.57404643", "0.57347673", "0.5717157", "0.5675358", "0.56235784", "0.5577144", "0.5577132", "0.5570535", "0.55701023", "0.5566668", "0.5534513", "0.55311775", "0.5520769", "0.5444301", "0.5435471", "0.5430321", "0.5400082"...
0.76013386
0
Return JSONLD data from string in RDF format.
def to_jsonld(data, format): # pyld only supports parsing of nquads. Other formats are first # converted into nquads via rdflib.Graph. if format != 'nquads': graph = from_string(data, format) data = graph.serialize(format='nquads') # The above conversion introduces blank node identif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_jsonld(data, format):\n # As of this writing, 'application/nquads' is the only RDF format\n # (other than JSON-LD) supported by pyld. Convert via that.\n quads = jsonld.to_rdf(data, { 'format': 'application/nquads' })\n # Using ConjunctiveGraph instead of Graph for nquads support.\n graph =...
[ "0.70386475", "0.6830937", "0.6499018", "0.60162544", "0.5972186", "0.59118605", "0.5666557", "0.54337317", "0.54079944", "0.5407438", "0.53756696", "0.5372349", "0.53442997", "0.5324621", "0.5295188", "0.5291021", "0.52686954", "0.5262139", "0.5262139", "0.5262139", "0.51815...
0.66917145
2
Convert a column name to a Human Readable name. 1) Strip _id from the end 2) Convert _ to spaces 3) Convert CamelCase to Camel Case 4) Upcase first character of Each Word
def name2label(name): if name.endswith('_id'): name = name[:-3] return ' '.join([s.capitalize() for s in re.findall(r'([A-Z][a-z0-9]+|[a-z0-9]+|[A-Z0-9]+)', name)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namingConvention(columnName):\n words = columnName.lower().split(\"_\")\n\n def cap(word):\n if word.lower() == \"id\":\n return word.upper()\n else:\n return word.capitalize()\n\n return words[0] + \"\".join(map(cap, words[1:]))", "def...
[ "0.7947337", "0.76116705", "0.746672", "0.7297153", "0.7064601", "0.7010538", "0.6869773", "0.68463653", "0.68183714", "0.6796953", "0.67753136", "0.67194307", "0.6705654", "0.6704382", "0.66594183", "0.6654219", "0.66311765", "0.6627455", "0.66231257", "0.6612792", "0.659154...
0.6544164
27
Return a relative version of a path
def relpath(path, start=None): if start is None: start = os.curdir if not path: raise ValueError("no path specified") start_list = op.abspath(start).split(op.sep) path_list = op.abspath(path).split(op.sep) if start_list[0].lower() != path_list[0].lower():...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relative(self, path):\n return re.sub(self.path_regex, '', path).lstrip(os.sep)", "def relativize(path: str):\n return join('.', path)", "def relativePath(path):\n spath = pathSplit(path)\n return spath[-1]", "def get_relative_path(path: str):\n return os.path.relpath(path, get_project...
[ "0.7916205", "0.77834916", "0.77383643", "0.765349", "0.7530642", "0.7522436", "0.7415771", "0.7404095", "0.729165", "0.72837", "0.7279967", "0.723366", "0.7217335", "0.71864855", "0.7178365", "0.7105353", "0.7092798", "0.70900303", "0.70873284", "0.70858437", "0.70681816", ...
0.0
-1
Returns a flattened list of the pixel values in the given image
def image_to_list(image): return list(image.getdata())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def img_as_list(img: np.ndarray):\n rows = img.tolist()\n return flatten(rows)", "def get_pixel_list(img):\n orig_shape = img.shape # Remember the original shape of the img.\n # Store the img as a x by z array (z being the length of the colour space)\n # Essentially just a list of pixels.\n\n ...
[ "0.74113065", "0.72225505", "0.71249163", "0.6606414", "0.65086937", "0.63527626", "0.6273149", "0.62535197", "0.6250372", "0.6213591", "0.61786884", "0.6161101", "0.61584926", "0.6114489", "0.6076528", "0.60503703", "0.6006491", "0.59575236", "0.5925627", "0.5920589", "0.592...
0.7165411
2
Initializes a BankAccount object.
def __init__(self, account_number: str, bank_name: str, starting_balance: float): super().__init__(account_number) self.bank_name = bank_name self.starting_balance = starting_balance self.current_balance = starting_balance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, bank_name, account_num, balance):\n self._bank_name = bank_name\n self._account_num = account_num\n self._balance = balance", "def __init__(self, bank_account_no: str, bank_name: str,\n bank_balance: float, budget_manager: BudgetManager):\n self.bank...
[ "0.7464518", "0.7125881", "0.7048491", "0.6928638", "0.6702527", "0.6696143", "0.66097623", "0.6511847", "0.64748144", "0.6454926", "0.6446487", "0.6336224", "0.6143344", "0.6119951", "0.61141336", "0.6087811", "0.60279584", "0.60151327", "0.5985857", "0.59757334", "0.5965742...
0.70853716
2
turns lst into an comma separated list (with an and)
def human_list(lst, connector='and'): # we don't want to listify non iterables if not getattr(lst, '__iter__', False): return lst else: s = '' max_idx = len(lst) - 1 for i, item in enumerate(lst): if i == 0: t = '%s' elif i == max_idx a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listToStr(lst):\n return ','.join(lst)", "def format_list(my_list):\r\n\treturn \", \".join(my_list[::2]) + (\" and \" + my_list[-1])", "def sqllist(lst):\n if isinstance(lst, basestring): \n return lst\n else:\n return ', '.join(lst)", "def list_str(lis):\r\n as_str = \"\"\r\n ...
[ "0.726906", "0.7209211", "0.7127806", "0.69960785", "0.6922471", "0.68679875", "0.68348783", "0.67072034", "0.6532871", "0.649417", "0.64898336", "0.6469987", "0.64242995", "0.63352627", "0.63352144", "0.63254964", "0.6258312", "0.6204422", "0.616759", "0.61672246", "0.610879...
0.6957715
4
Count the leaf nodes (nodes without children) in a binary tree.
def bst_count_leaves(tree): leaves = 0 def _walk(node=None): nonlocal leaves if node is None: return if node.left is not None: _walk(node.left) if node.left is None and node.right is None: leaves += 1 if node.right is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaf_count(t: Tree) -> int:\n if t.children == []:\n return 1\n else:\n return sum([leaf_count(child) for child in t.children])", "def leaf_count(self) -> int:\n if self.children == []:\n return 1\n else:\n return sum([x.leaf_count() for x in self.child...
[ "0.8611108", "0.8577685", "0.8219669", "0.82086986", "0.8101236", "0.8007054", "0.7959547", "0.7828511", "0.7792144", "0.7649316", "0.759935", "0.74482566", "0.7375579", "0.72643894", "0.7254502", "0.7242194", "0.7211113", "0.71378016", "0.7077008", "0.7042455", "0.7039904", ...
0.8025071
5
This function propagates the visible units activation upwards to the hidden units Note that we return also the presigmoid activation of the layer. As it will turn out later, due to how Theano deals with optimizations, this symbolic variable will be needed to write down a more stable computational graph (see details in ...
def propup(self, vis): pre_sigmoid_activation = \ T.dot(vis, self.hidden_layer.W) + self.hidden_layer.b return [pre_sigmoid_activation, T.nnet.sigmoid(pre_sigmoid_activation)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_layer_activation(x):\n return x", "def forward_hidden_activation(self, X):\n return np.tanh(X)", "def propagate(self, clamps = ['input', 'transformation']):\n k = self.config.sigmoid_smoothing\n\n # First propagate forward from input to hidden layer\n h_input = self.x ...
[ "0.7030802", "0.6913472", "0.6762452", "0.6704351", "0.6700018", "0.6678635", "0.6612527", "0.658353", "0.6529057", "0.6527184", "0.6527184", "0.65248376", "0.65188223", "0.65141374", "0.65075374", "0.64993757", "0.64784855", "0.6477241", "0.64526045", "0.6397212", "0.6388405...
0.6348157
23
Retrieve the content of a semeval element, related comment included. That is to say an original question will return the textual content of the subject and the body whereas a related thread will return the textual content of the subject, the body and the comment. For consistency's sake, if the element is a comment, its...
def get_semeval_content_with_relcomments(element): if element.tag == 'OrgQuestion': return get_orgquestion_content(element) if element.tag == 'Thread': return ' '.join(chain( [get_relquestion_content(element.find('./RelQuestion'))], [get_relcomment_content(comment) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_semeval_content(element):\n if element.tag == 'OrgQuestion':\n return get_orgquestion_content(element)\n\n if element.tag == 'RelQuestion':\n return get_relquestion_content(element)\n\n if element.tag == 'Thread':\n return get_relquestion_content(element.find('./RelQuestion'))...
[ "0.85557586", "0.64067656", "0.6333302", "0.5952012", "0.5858457", "0.57282865", "0.5615626", "0.5573541", "0.54975265", "0.5465886", "0.5389816", "0.5381278", "0.537047", "0.5340623", "0.5325312", "0.52776366", "0.5276527", "0.52570295", "0.5255687", "0.5205689", "0.51989204...
0.8135843
1
Retrieve all the textual contents from the source file.
def get_all_text(self): result = list() for path in ['./OrgQuestion/OrgQSubject', './OrgQuestion/OrgQBody', './OrgQuestion/Thread/RelQuestion/RelQSubject', './OrgQuestion/Thread/RelQuestion/RelQBody', './OrgQuestion/Thr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contents(file):\n with open(file) as f:\n return f.read()", "def source_file_contents(source_dir, file_name):\n file_n_path = join(source_dir, file_name)\n with open(file_n_path, encoding='utf-8') as checked:\n return checked.read().rstrip()", "def file_read(self):\r\n with op...
[ "0.70003587", "0.694869", "0.6776172", "0.6767544", "0.6765933", "0.6701171", "0.6618421", "0.6612728", "0.66108614", "0.6607338", "0.66039366", "0.6586121", "0.6566214", "0.65456206", "0.6505693", "0.6485631", "0.64638436", "0.64569646", "0.6450626", "0.64445966", "0.6420914...
0.0
-1
Check is password hash matches actual password
def verify_password(saved_password, password): return check_password_hash(saved_password, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_password(self, password):\n return check_password_hash(self.password_hash, password)", "def verify_password(password, password_hash):\n\n password_entered = hash_password(password)\n return secrets.compare_digest(password_entered, password_hash)", "def verify_password(self, hash, password):...
[ "0.8260071", "0.81936216", "0.8160942", "0.8063793", "0.8010711", "0.79847986", "0.7961684", "0.7936859", "0.7936859", "0.7936753", "0.7880315", "0.78775156", "0.78746045", "0.784547", "0.784547", "0.784547", "0.784547", "0.78434813", "0.7838017", "0.7836477", "0.782339", "...
0.7841804
18
Checks if user is an admin
def admin(self): if self.is_admin: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_is_admin(user):\n return user in admins", "def is_admin(user):\n return user.is_authenticated and user.id == app.config.get('ADMIN')", "def is_admin(self, user):\n return user.name in self.admins", "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_ad...
[ "0.869197", "0.86895347", "0.86148757", "0.8535919", "0.8519844", "0.85183984", "0.8441354", "0.84074885", "0.8294952", "0.8294699", "0.82883656", "0.8284562", "0.82232165", "0.8207838", "0.8189341", "0.8189341", "0.81872666", "0.81783974", "0.81645346", "0.8138416", "0.81239...
0.7770666
40
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].view(-1).float().sum(0) res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.7642627", "0.7417984", "0.7417116", "0.72703016", "0.7245068", "0.7244174", "0.72359973", "0.7221287", "0.72093123", "0.70574844", "0.68535876", "0.6785699", "0.6785369", "0.6770165", "0.6727407", "0.67198336", "0.67198336", "0.67198336", "0.67198336", "0.67198336", "0.671...
0.0
-1
Determines if the student is allowed to submit to a project The motivation behind stopping student submissions is to prevent overloading the system, and (in theory) to instill a more thorough manual debugging process. There are three trivial cases when a user can
def may_submit(self, project): if self.user.is_superuser or project.course.instructor == self: return 'yes' if project.locked: return 'locked' last_submission = self.latest_submission(project) if not last_submission: return 'yes' if last_submis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ProjectIsRestricted(mr):\n return (mr.project and\n mr.project.access != project_pb2.ProjectAccess.ANYONE)", "def is_allowed_to_submit(request):\n return not settings.REQUIRE_LOGIN or request.user.is_authenticated()", "def test_project_administrator(project):\n if is_server_administrator():\...
[ "0.6543977", "0.64155585", "0.63898766", "0.6379843", "0.6355436", "0.63152146", "0.63093466", "0.6307389", "0.62786525", "0.6256665", "0.6170355", "0.61667645", "0.6143017", "0.61172736", "0.6092657", "0.6071305", "0.6064613", "0.6042243", "0.6004346", "0.59895617", "0.59537...
0.71871376
0