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
Calculate the day number, 1st Jan is 1. Ignore leap years.
def calculate_day_of_year(date): day_of_year = date.timetuple().tm_yday if (is_leap_year(date.year) and \ date > datetime.datetime(date.year, 2, 28)): day_of_year -= 1 return day_of_year
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DAY(date):\n return _make_datetime(date).day", "def day(self):\n return 0", "def day(self):\n return 0", "def day_of_year(self):\n return int(self.date.strftime('%j'))", "def day(self) -> int:\n return pulumi.get(self, \"day\")", "def GetDayNumber(self, StartDay, Today):\...
[ "0.7165861", "0.70815796", "0.70815796", "0.70412", "0.6991776", "0.69456375", "0.68625826", "0.67817473", "0.670107", "0.66856784", "0.6599875", "0.65989316", "0.65880466", "0.65842515", "0.6505653", "0.64983076", "0.6484909", "0.64691573", "0.64643526", "0.6451076", "0.6437...
0.65206635
14
a singleuse quaternion rotator
def qrotate(points, axis, theta): q = Quaternion.rotator(axis, theta) return q.rotate(points)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rotate_quaternion(self, q):\n self._normalise()\n return self * q * self.conjugate", "def quatActiveRot(q, v):\n\tv_q = np.zeros((4, 1))\n\tv_q[1:] = v\n\tv_qnew = quatLeftMat(q) @ quatRightMat(q).T @ v_q\n\treturn v_qnew[1:]", "def quatPassiveRot(q, v):\n\tv_q = np.zeros((4, 1))\n\tv_q[1:] ...
[ "0.7639494", "0.7264467", "0.70998365", "0.69796413", "0.6853931", "0.6843672", "0.6835839", "0.67905855", "0.67410374", "0.6736076", "0.6733818", "0.6636616", "0.6610766", "0.66100466", "0.6537885", "0.65358144", "0.6518087", "0.6509696", "0.6509696", "0.64940214", "0.649392...
0.6706742
11
Get the name of this handler, usually corresponding to the name of the function that this signal wraps.
def get_name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return signal_base_get_name(self.obj)", "def getName(self):\n return signal_base_get_name(self.obj)", "def getSignalName(sig):\n try:\n return sig._name\n except AttributeError:\n pass\n return sig.name", "def getSignalName(sig):\n try:\n retur...
[ "0.81185704", "0.78528315", "0.73314416", "0.73314416", "0.72753197", "0.71560013", "0.7075561", "0.70748943", "0.6944914", "0.68337566", "0.6716268", "0.66508", "0.6624037", "0.6569998", "0.65628123", "0.6543915", "0.6543915", "0.6517171", "0.6502212", "0.6488188", "0.648818...
0.0
-1
Clear all references to the given HasEvents instance. This is called from a HasEvents' dispose() method. This handler remains working, but wont receive events from that object anymore.
def _clear_hasevents_refs(self, ob): for connection in self._connections: for i in reversed(range(len(connection.objects))): if connection.objects[i][0] is ob: connection.objects.pop(i) # Do not clear pending events. This handler is assumed to con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n self.events={}", "def clear(self):\n self.events[get_ident()][0].clear()", "def _clear(self):\n self.events = []\n self.last_on = None\n self.last_off = None", "def clearEvents(self, eventKey = None):\n if not eventKey:\n for key in self.eve...
[ "0.76379305", "0.72395056", "0.7229944", "0.7159142", "0.69751143", "0.69564277", "0.6698898", "0.6662228", "0.663386", "0.6578825", "0.6564789", "0.6512442", "0.6445595", "0.63756007", "0.62869215", "0.62869215", "0.6271811", "0.6256923", "0.62408006", "0.6226876", "0.617455...
0.73403513
1
The Front Door Profiles frontend endpoints associated with this Front Door Firewall Policy.
def frontend_endpoint_ids(self) -> Sequence[str]: return pulumi.get(self, "frontend_endpoint_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoints(self):\n return self.settings[\"endpoints\"]", "def endpoints(self):\n return self[\"endpoints\"]", "def get_flask_endpoints(self):\n urls = self.endpoints.keys()\n return urls", "def get_view_endpoints(self):\n return []", "def endpoints(self) -> pulumi.Inp...
[ "0.64783627", "0.63537496", "0.62000847", "0.60699904", "0.5886627", "0.580789", "0.5715225", "0.5714318", "0.5632281", "0.5590575", "0.55760425", "0.5573608", "0.55564666", "0.55564666", "0.55030274", "0.5437731", "0.53542525", "0.53530115", "0.5272059", "0.5257869", "0.5254...
0.61706185
3
The redirect URL for the client.
def redirect_url(self) -> str: return pulumi.get(self, "redirect_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect_url(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"redirect_url\")", "def redirect_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"redirect_url\")", "def redirect_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"re...
[ "0.8412386", "0.8063244", "0.8063244", "0.8029036", "0.7882197", "0.7775076", "0.7738046", "0.7684737", "0.7681303", "0.7681303", "0.7628167", "0.7628167", "0.7628167", "0.7628167", "0.7628167", "0.7628167", "0.7628167", "0.7628167", "0.74543816", "0.740029", "0.7281274", "...
0.903135
0
The sku's pricing tier for this Front Door Firewall Policy.
def sku_name(self) -> str: return pulumi.get(self, "sku_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self) -> Optional[pulumi.Input[Union[str, 'CapacitySkuTier']]]:\n return pulumi.get(self, \"tier\")", "def pricing(self):\n if self._pricing is None:\n self._pricing = Pricing(self)\n return self._pricing", "def price_tier(self):\n return self._safe_value(VAR_PRI...
[ "0.71249723", "0.6966292", "0.695", "0.6904262", "0.6505448", "0.63352835", "0.62920904", "0.62920904", "0.62920904", "0.6257421", "0.6203984", "0.61593", "0.61544794", "0.61544794", "0.61327547", "0.60889906", "0.605648", "0.60537386", "0.6033827", "0.60039496", "0.60039496"...
0.5668218
45
Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. Example Usage ```python import pulumi import pulumi_azure as azure example = azure.cdn.get_frontdoor_firewall_policy(name="examplecdnfdwafpolicy", resource_group_name=azurerm_resource_group["example"]["name"]) ``...
def get_frontdoor_firewall_policy(name: Optional[str] = None, resource_group_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetFrontdoorFirewallPolicyResult: __args__ = dict() __args__['name'] = name __...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frontdoor_firewall_policy_output(name: Optional[pulumi.Input[str]] = None,\n resource_group_name: Optional[pulumi.Input[str]] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetFrontdoorFirewallPolicyRes...
[ "0.7090864", "0.62537014", "0.61692894", "0.5470405", "0.54286057", "0.54271567", "0.5336407", "0.5248733", "0.52121866", "0.5142187", "0.51096797", "0.50767833", "0.5024802", "0.5009356", "0.49880978", "0.4987996", "0.4977544", "0.4977544", "0.49452513", "0.49429888", "0.493...
0.76136816
0
Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. Example Usage ```python import pulumi import pulumi_azure as azure example = azure.cdn.get_frontdoor_firewall_policy(name="examplecdnfdwafpolicy", resource_group_name=azurerm_resource_group["example"]["name"]) ``...
def get_frontdoor_firewall_policy_output(name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetFrontdoorFirewallPolicyResult]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frontdoor_firewall_policy(name: Optional[str] = None,\n resource_group_name: Optional[str] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetFrontdoorFirewallPolicyResult:\n __args__ = dict()\n __args__['name'] = na...
[ "0.7612965", "0.625306", "0.6168631", "0.54723597", "0.54302305", "0.5425574", "0.53346676", "0.5247876", "0.5213535", "0.5141691", "0.5108653", "0.5078356", "0.5024989", "0.5006991", "0.49899903", "0.49851555", "0.4979432", "0.4979432", "0.49472716", "0.49449977", "0.4939004...
0.70901054
1
Calculate the percentage of storage space saved by the compression.
def __percentage_storage_saved(task): task_information = task.get_task_information() return int((1 - task_information.output_filesize / task_information.filesize) * 100)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_percent_used_capacity(self):\n return self._fs_percent_used_capacity", "def total_storage(self):\n return self._total_storage", "def percentage_used(self):\n return self.volume_used/self.total_volume * 100.0", "def gc(self) -> float:\n g = self.count(\"G\")\n c = sel...
[ "0.69459504", "0.68941945", "0.6815455", "0.6766913", "0.6716986", "0.6687428", "0.65552306", "0.6468966", "0.64600885", "0.645354", "0.6449997", "0.6345255", "0.6329812", "0.63245094", "0.63043755", "0.6277735", "0.6256957", "0.62494946", "0.62494946", "0.6245186", "0.618915...
0.72177947
0
Check whether the given string is properly UTF8 encoded (if ``is_bytes`` is ``True``), it is not empty, and it does not contain reserved characters.
def check_raw_string(self, string, is_bstring=True): self.log(u"Checking the given byte string") self.result = ValidatorResult() if self._are_safety_checks_disabled(u"check_raw_string"): return self.result if is_bstring: self._check_utf8_encoding(string) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_utf8_encoding(self, bstring):\n if not gf.is_bytes(bstring):\n self._failed(u\"The given string is not a sequence of bytes\")\n return\n if not gf.is_utf8_encoded(bstring):\n self._failed(u\"The given string is not encoded in UTF-8.\")", "def validUTF8(da...
[ "0.77874446", "0.71159905", "0.6720634", "0.6649285", "0.6631422", "0.6611489", "0.660741", "0.6595247", "0.640021", "0.63671786", "0.63324076", "0.6330182", "0.6308042", "0.62176204", "0.6173053", "0.61679035", "0.61269104", "0.61234254", "0.6107851", "0.610232", "0.606444",...
0.7512317
1
Check whether the given Unicode string contains reserved characters.
def _check_reserved_characters(self, ustring): forbidden = [c for c in gc.CONFIG_RESERVED_CHARACTERS if c in ustring] if len(forbidden) > 0: self._failed(u"The given string contains the reserved characters '%s'." % u" ".join(forbidden))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains_nonascii_characters(string):\n for c in string:\n if not ord(c) < 128:\n return True\n return False", "def _has_non_ascii_characters(data_string):\r\n try:\r\n data_string.encode('ascii')\r\n except UnicodeEncodeError:\r\n return True\r\n...
[ "0.76706105", "0.72828007", "0.6691792", "0.66605836", "0.659696", "0.6575641", "0.65571624", "0.65302", "0.6529448", "0.648332", "0.64749056", "0.6471129", "0.64668715", "0.64295185", "0.64205307", "0.6404539", "0.6363886", "0.63605005", "0.63475174", "0.6344674", "0.6331607...
0.78355294
0
Method to get the index of the grid point at the left endpoint of the gridpoint interval at which the current value u is. If u belongs to [u_I, u_{I+1}] it returns the index I.
def get_index(self, u): if u == self.grid[-1]: # check if u equals last knot # index = len(self.grid) - 2 # pick next to last index index = (self.grid < u).argmin() - 1 else: index = (self.grid > u).argmax() - 1 return index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_left_index(i):\n pos = i + 1\n left_pos = 2 * pos\n left_index = left_pos - 1\n return left_index", "def left(self):\n x, y = (self.loc[0] - 1, self.loc[1])\n\n if x < 0:\n return None # None\n\n return self.garden.cells[y][x]", "def get_pos_...
[ "0.70151263", "0.65481186", "0.62098414", "0.6174811", "0.6174811", "0.6023078", "0.5964019", "0.59333396", "0.5905197", "0.5893129", "0.5863076", "0.58225286", "0.58116716", "0.5804778", "0.5804434", "0.5803768", "0.5799482", "0.5767015", "0.5767015", "0.5759108", "0.5727749...
0.7521801
0
Return a relative version of a path
def relpath(path, start=osp.curdir): if not path: raise ValueError("no path specified") start_list = osp.abspath(start).split(osp.sep) path_list = osp.abspath(path).split(osp.sep) # Work out how much of the filepath is shared by start and path. i = len(osp.commonprefix([start_list, path_l...
{ "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.6745506
54
wrapper for tempfile.mkdtemp to register the removal of the directory
def _mkdtemp(*args, **kwargs): import tempfile dir_name = tempfile.mkdtemp(*args, **kwargs) import atexit, shutil ignore_errors = True atexit.register(shutil.rmtree, dir_name, ignore_errors) return dir_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tmp_dir():\n tmpdir = tempfile.mkdtemp()\n yield tmpdir\n shutil.rmtree(tmpdir)", "def temp_dir(**kwargs):\n temp_dir = tempfile.mkdtemp(**kwargs)\n try:\n yield temp_dir\n finally:\n # Cleanup\n # ermm... this is breaking something (maybe bootstrapping replicates?), so...
[ "0.8148997", "0.7932268", "0.79292506", "0.7916723", "0.79149324", "0.7908588", "0.78988445", "0.7890955", "0.7792068", "0.7738349", "0.7720451", "0.7714371", "0.7711295", "0.7697611", "0.7658209", "0.75654125", "0.7557517", "0.7534872", "0.74605787", "0.745928", "0.74278706"...
0.82998955
0
Make sure the active user's email account falls within the accepted domains.
def domain_chain(controller): if controller.route.prefix == 'cron': return True elif controller.route.prefix == 'api': if controller.request.GET.get('api_key') == settings.get('api', {}).get('api_key'): return True else: return False else: use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_domain_allowed(email):\n domains = local_config.AuthConfig().get('whitelisted_domains', default=[])\n for domain in domains:\n if utils.normalize_email(email).endswith('@%s' % domain.lower()):\n return True\n\n return False", "def clean_email(self):\r\n email_domain = self.cleaned_data[...
[ "0.6998813", "0.66619647", "0.65660703", "0.64231974", "0.639866", "0.6233129", "0.61997736", "0.6192945", "0.6161467", "0.60911155", "0.60284835", "0.6027171", "0.6017319", "0.59807706", "0.5937201", "0.5926092", "0.59157616", "0.5906064", "0.5900883", "0.5897976", "0.589797...
0.0
-1
Returns the dictionary of all dropoffs along this path.
def assign_dropoffs(G, path, home_idxs): locations_on_path = set(path) dropoffs = collections.defaultdict(list) # print(locations_on_path) for h in home_idxs: # print(f'DISTANCES FOR {h}', all_pairs_dists[h]) closest_loc_on_path = min(locations_on_path, key=lambda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dropouts(self):\n return self._dropouts", "def drop(self):\n return {\n 'probability': float(self._parser[self._key]['DropProbability']),\n 'correlation': float(self._parser[self._key]['DropCorrelation']),\n }", "def warping_paths(self):\n return self.paths...
[ "0.62393993", "0.58090156", "0.5585731", "0.5558328", "0.5550418", "0.55214936", "0.5438385", "0.543693", "0.5320389", "0.53079504", "0.5306655", "0.52681667", "0.52613133", "0.52416164", "0.5183443", "0.51499975", "0.51256967", "0.51256967", "0.5123984", "0.51164514", "0.511...
0.5993648
1
Constructor for QNetwork. Takes a name and a learning rate for the GradientDescentOptimizer
def __init__(self, name, learning_rate, beta = 0.00001): self.learningRate = learning_rate self.beta = beta self.name = name self.input_positions = None self.target_q = None self.actions = None # Internal tensors self.actions_onehot = None self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, shared_mem_name, learning_rate):\n self.name = literals.GRADIENT_DESCENT\n super(GradientDescent, self).__init__(learning_rate=learning_rate,\n shared_mem_name=shared_mem_name)", "def __init__(self, lr, eps=1e-6):\n LearningRate...
[ "0.69566303", "0.6388355", "0.6344891", "0.62853664", "0.62809956", "0.6270677", "0.62430286", "0.6168328", "0.60850835", "0.6077509", "0.6074164", "0.60722876", "0.60328937", "0.59537584", "0.5900654", "0.58795583", "0.5842593", "0.5822981", "0.5800537", "0.57972074", "0.578...
0.6200676
7
Adds a list of experience Tuples to the buffer. If this operation causes the buffer to be longer than its defined maximum, old entries will be evicted until the maximum length is achieved. Entries are added and evicated on a FIFO basis.
def add(self, experience: []): if len(self.buffer) + len(experience) >= self.buffer_size: self.buffer[0:1] = [] self.buffer.append(experience)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, experience):\n self.buffer.append(experience)", "def append(self, experience):\n self.buffer.append(experience)\n self.number += 1", "def append(self, experience: Experience) -> None:\n self.buffer.append(experience)", "def add_experience(self, state, action, reward,...
[ "0.69232976", "0.6710786", "0.6686104", "0.6173378", "0.58345145", "0.5832772", "0.5761424", "0.57077545", "0.5643297", "0.5641127", "0.5589755", "0.5559469", "0.5540289", "0.5498332", "0.54844165", "0.54581225", "0.5443029", "0.5441576", "0.5431746", "0.54086393", "0.5394558...
0.77164096
0
Returns a random sample of `size` entries from the Replay Buffer. If there are less than `size` entries in the buffer, all entries will be returned.
def sample(self, size) -> []: size = min(len(self.buffer), size) return random.sample(self.buffer, size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self, batch_size):\n return random.sample(self.buffer, batch_size)", "def sample(self, batch_size):\n buffer_size = len(self.buffer)\n print(\"**\",buffer_size)\n index = np.random.choice(np.arange(buffer_size), size=batch_size, replace=False)\n return [self.buffer[i...
[ "0.75066113", "0.73866767", "0.71962065", "0.7155693", "0.71321714", "0.7071391", "0.7058509", "0.7058509", "0.70188653", "0.70142585", "0.6982634", "0.6966209", "0.6926024", "0.6926024", "0.68427783", "0.6839269", "0.6839269", "0.6839269", "0.6839269", "0.6833295", "0.682097...
0.82649547
0
Constructor for the Neural Network player.
def __init__(self, name, reward_discount = 0.99, win_value = 10.0, draw_value = 0.0, loss_value = -10.0, learning_rate = 0.01, training = True, random_move_prob = 0.9999, random_move_decrease = 0.9997, batch_size=60, pre_training_games = 500, tau = 0.001): self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n #super(Net, self).__init__()\n nn.Module.__init__(self)\n # Build CNN\n module, shapes, optim = build_neuron_network(**kwargs)\n self._configuration = kwargs\n self.add_module('cnn', module)\n self.shapes = shapes\n # Loss and ...
[ "0.7185127", "0.70645523", "0.7017489", "0.6916112", "0.68454784", "0.6834941", "0.68040013", "0.67610806", "0.67014843", "0.66933644", "0.66872054", "0.66677964", "0.66631866", "0.66585475", "0.66036403", "0.6602481", "0.6600866", "0.6596508", "0.6574244", "0.65605694", "0.6...
0.0
-1
Get the message subject.
def subject(self): return self._subject
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSubject(self):\r\n return self.msg[\"Subject\"]", "def get_subject(self):\n return self._subject", "def subject(self):\n return self.properties.get(\"subject\", None)", "def subject(self):\n return self.get(\"subject\")", "def subject(self) -> pulumi.Output[str]:\n ...
[ "0.87958366", "0.8243678", "0.7794485", "0.7683363", "0.7628012", "0.7622067", "0.75537604", "0.754993", "0.754993", "0.7502737", "0.74993056", "0.74095523", "0.74095523", "0.7311583", "0.7244123", "0.7085008", "0.70493287", "0.6756596", "0.6738953", "0.66565025", "0.65767634...
0.7666792
4
Set the api template. (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate
def api_template(self, val: str): self._api_template = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_template(self):\n return self._api_template", "def fusion_api_update_default_connection_template(self, body, api=None, headers=None):\n return self.ct.update_default(body, api=api, headers=headers)", "def setTemplate(self, template):\n self.template = template", "def template...
[ "0.6662994", "0.60444635", "0.5725323", "0.55971044", "0.55377907", "0.5500709", "0.5500709", "0.54299915", "0.5399321", "0.5391709", "0.5346009", "0.52578694", "0.5236033", "0.5215283", "0.5167255", "0.514553", "0.51294905", "0.51178735", "0.5061729", "0.50522435", "0.503946...
0.7422746
0
Set the custom mailing id.
def mailing_id(self, val: str): self._mailing_id = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mailing_id(self):\n return self._mailing_id", "def _set_id(self, value):\n pass", "def _set_id(self):\n raise NotImplementedError()", "def mail_msg_id(self, mail_msg_id):\n\n self._mail_msg_id = mail_msg_id", "def set_id(self, id):\n self.data['id'] = id", "def set_...
[ "0.6672259", "0.6670833", "0.64420915", "0.64371336", "0.6383772", "0.6288654", "0.6251253", "0.62355417", "0.6226074", "0.6166108", "0.6157953", "0.6152245", "0.61416435", "0.6140545", "0.6119242", "0.6114923", "0.60705763", "0.60523057", "0.6043706", "0.6043195", "0.6022063...
0.81153774
0
Set the custom message id.
def message_id(self, val: str): self._message_id = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_id(self, value):\n pass", "def mail_msg_id(self, mail_msg_id):\n\n self._mail_msg_id = mail_msg_id", "def message_id(self) -> int:\n enforce(self.is_set(\"message_id\"), \"message_id is not set.\")\n return cast(int, self.get(\"message_id\"))", "def set_id(self, player_id...
[ "0.6652891", "0.65095216", "0.64912975", "0.64385223", "0.642824", "0.6372138", "0.6350578", "0.63105434", "0.62432986", "0.6198441", "0.6174965", "0.61737746", "0.61591554", "0.6154792", "0.6139558", "0.6114001", "0.6111982", "0.61041623", "0.6067534", "0.60631067", "0.60598...
0.7583452
0
Get the optional character set. Default is UTF8
def charset(self): return self._charset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charset(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"charset\")", "def charset(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"charset\")", "def get_charset(self, default: str) -> str:\n ...", "def charset(self) -> pulumi.Output[str]:\n r...
[ "0.77441263", "0.77441263", "0.7408126", "0.70491165", "0.70399636", "0.6782762", "0.6660976", "0.6580853", "0.6547428", "0.63791734", "0.63645613", "0.63420033", "0.6294992", "0.61799836", "0.61238104", "0.6104072", "0.6096272", "0.60728085", "0.6061523", "0.6061523", "0.605...
0.675956
6
Set the from email address.
def from_email_address(self, val: EmailAddress): self._from_email = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_from(self, address):\n if not self.validate_email_address(address):\n raise Exception(\"Invalid email address '%s'\" % address)\n self._from = address", "def from_email(self, from_email):\n\n self._from_email = from_email", "def from_email_address(self):\n return ...
[ "0.8189718", "0.8095979", "0.72664225", "0.7122504", "0.7044055", "0.6808276", "0.6764283", "0.6631078", "0.66134846", "0.66134846", "0.66134846", "0.65908056", "0.65908056", "0.65908056", "0.65908056", "0.65908056", "0.65908056", "0.65908056", "0.65908056", "0.65908056", "0....
0.81439984
1
Set the optional reply to email address.
def reply_to_email_address(self, val: EmailAddress): self._reply_to = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_reply_to(self, address):\n if not self.validate_email_address(address):\n raise Exception(\"Invalid email address '%s'\" % address)\n self._reply_to = address", "def reply_to_email_address(self):\n return self._reply_to", "def reply_to(self, reply_to):\n\n self._r...
[ "0.79824626", "0.70027816", "0.66317314", "0.64680386", "0.61762106", "0.6004161", "0.59848976", "0.5946071", "0.58993405", "0.58868045", "0.5868881", "0.58528596", "0.5826929", "0.58250886", "0.5807649", "0.5807649", "0.5807649", "0.5779886", "0.5769262", "0.5769262", "0.572...
0.80387884
0
Get the list of Attachments.
def attachments(self): return self._attachments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attachments(self):\r\n return Attachments(self)", "def attachments(self):\n return [Attachment(part) for part in self._parts]", "def attachments(self):\n return self.properties.get('attachments',\n AttachmentCollection(self.context, ResourcePath(\"atta...
[ "0.76446104", "0.7540203", "0.73473585", "0.7186895", "0.7007436", "0.6915932", "0.6864513", "0.66703516", "0.66400474", "0.65498006", "0.64973557", "0.64824325", "0.64088476", "0.6404176", "0.63589233", "0.6282651", "0.6229054", "0.6192592", "0.61836463", "0.6150093", "0.614...
0.7692602
0
Set the list of Attachments.
def attachments(self, val: list): self._attachments = [] if val is not None: for item in val: if isinstance(item, Attachment): self._attachments.append(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attachments(self, attachments):\n\n self._attachments = attachments", "def set_attachments(self):\n self.response['attachments'] = []", "def setAddAttachments(self,value):\n self.PDFreactorConfiguration.in1[\"addAttachments\"] = value", "def required_attachments(self, required_attach...
[ "0.747147", "0.6653716", "0.64569646", "0.60968226", "0.6090842", "0.59066826", "0.5869827", "0.5808794", "0.5677868", "0.5631155", "0.55918485", "0.55250466", "0.54849213", "0.5476313", "0.54760367", "0.5429081", "0.5425181", "0.5414356", "0.54096526", "0.5374689", "0.537468...
0.71192557
1
Plot cost in each epoch
def plot_cost(self, cost_tr_data: [[int]], cost_test_data: [[int]], title: str="Cost"): plot_title, img_title = self.prep_titles(title) test_legend = ['training data', 'test data'] # Data for plotting x- and y-axis x = np.arange(1, CFG.EPOCHS + 1) y = [cost_tr_data, cost_test_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_cost(self):\n steps = np.arange(len(self.cost_values))\n plt.plot(steps, self.cost_values, '-o')\n plt.xlabel(\"Steps\")\n plt.ylabel(\"Cost value\")\n plt.title(\"Cost value per step using Gradient Descent\")\n plt.show()", "def plot_cost(c_v, c_t, save_plots_p...
[ "0.8117564", "0.7458084", "0.72667325", "0.71979684", "0.7197085", "0.7169769", "0.69934446", "0.6890948", "0.68213254", "0.6770325", "0.6762473", "0.67331815", "0.67148995", "0.6670918", "0.665506", "0.6648477", "0.65563065", "0.6551774", "0.63715065", "0.6347481", "0.633015...
0.7508682
1
Get type attribute value. get_type()
def get_type(self, ): return self.attrs.get(self.AttributeNames.TYPE, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Type(self):\r\n\t\treturn self._get_attribute('type')", "def type(self):\n return self._getValue('type')", "def read_type(self):\n return self.node.get_attr(Type).read()", "def get_type(self):\n return self.type", "def get_type(self):\n return self.type", "def getType(self...
[ "0.8126766", "0.7935047", "0.7906977", "0.784773", "0.784773", "0.78176606", "0.7806531", "0.7764467", "0.77370524", "0.773338", "0.7728613", "0.7711207", "0.7711207", "0.7679487", "0.76217693", "0.76129675", "0.76129675", "0.76129675", "0.76129675", "0.76129675", "0.76129675...
0.84394145
0
Gets all containers from the DB.
def get_all_containers(self, instance_id): return self.database.get_docker_documents(amazon_resource_id=instance_id, type=self.type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all(self, **kwargs):\n context = pecan.request.context\n policy.enforce(context, \"container:get_all\",\n action=\"container:get_all\")\n return self._get_containers_collection(**kwargs)", "def list(self, all=False):\n return self.client.containers.list(a...
[ "0.7559246", "0.71815765", "0.70489746", "0.6642258", "0.6641111", "0.6583398", "0.65308756", "0.64325976", "0.6379066", "0.63767684", "0.6365799", "0.6347217", "0.63436943", "0.63233876", "0.6284048", "0.6280025", "0.62752664", "0.6261492", "0.62347484", "0.619836", "0.61933...
0.7336252
1
Attempt to reverse the result's detail view URL. This only works with views that are genericlike (has `.lookup_field`) and viewsetlike (has `.basename` / `.reverse_action()`).
def get_result_url(self, result, view): if not hasattr(view, 'reverse_action') or \ not hasattr(view, 'lookup_field'): return lookup_field = view.lookup_field lookup_url_kwarg = getattr(view, 'lookup_url_kwarg', None) or lookup_field try: kwargs = {lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('model-detail-view', args=[str(self.id)])", "def detail_url(reteta_id):\n return reverse('reteta:reteta-detail', args=[reteta_id])", "def get_absolute_url(self):\n return reverse('model-detail-view', args=[str(self.id)])", "def get_absolute_url(self):...
[ "0.70826936", "0.69538134", "0.6942537", "0.6942537", "0.67819774", "0.6754701", "0.67508787", "0.6718299", "0.6693713", "0.6685198", "0.6685198", "0.66718054", "0.66342396", "0.6579641", "0.6566297", "0.6545866", "0.6542309", "0.65369046", "0.6505684", "0.649259", "0.6491256...
0.81599313
0
Gets the name of this Node.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_name(self):\n return self._node_name", "def get_node_name(self):\n return util.join_names_underscore(self.name, str(self.as_pointer()))", "def get_node_name(self, node):\n return node.name", "def get_name(self):\n return self.tagnode", "def read_name(self):\n ret...
[ "0.8924537", "0.87370855", "0.8715205", "0.86860734", "0.85769725", "0.85769725", "0.85769725", "0.85769725", "0.8454736", "0.8270573", "0.81946146", "0.8114213", "0.8114213", "0.81024474", "0.80864733", "0.80716026", "0.8053517", "0.8034076", "0.80251956", "0.80251956", "0.8...
0.0
-1
Sets the name of this Node.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\r\n self.stream.set_node_name(self.node, name)", "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.name = name", ...
[ "0.8929312", "0.84462893", "0.8399642", "0.8399642", "0.8397417", "0.8397417", "0.8397417", "0.8397417", "0.8397417", "0.8368549", "0.83608305", "0.8358361", "0.83360684", "0.828848", "0.8283728", "0.82203424", "0.82033527", "0.8191996", "0.8191996", "0.80433863", "0.80218256...
0.0
-1
Sets the href of this Node.
def href(self, href): self._href = href
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_href(self, item_href):\n\n self._item_href = item_href", "def link(self, link):\n\n self._set_field(\"link\", link)", "def href(self) -> str:\n result = self.get_href()\n if result is None:\n raise ValueError(f\"{self} does not have an HREF set.\")\n retur...
[ "0.6406962", "0.6205855", "0.6169051", "0.61671203", "0.61671203", "0.61671203", "0.61671203", "0.61671203", "0.61671203", "0.61671203", "0.6015874", "0.6015874", "0.5980396", "0.5832566", "0.5763829", "0.5736948", "0.56926185", "0.56926185", "0.56926185", "0.56926185", "0.56...
0.8142347
2
Gets the state of this Node.
def state(self): return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n return self._node._state", "def GetState(self):\r\n \r\n return self.state", "def get_state(self):\n return self.state", "def get_state(self):\n return self.state", "def get_state(self):\n return self._state", "def get_state(self):\n ...
[ "0.9069719", "0.8141027", "0.81368804", "0.81368804", "0.8110539", "0.8110539", "0.8110539", "0.8110539", "0.8110539", "0.8101684", "0.8069171", "0.80388016", "0.80388016", "0.80388016", "0.7984181", "0.79841775", "0.79841775", "0.79162776", "0.79162776", "0.78820515", "0.788...
0.7846485
64
Gets the is_transitioning of this Node.
def is_transitioning(self): return self._is_transitioning
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_transitioning(self, is_transitioning):\n\n self._is_transitioning = is_transitioning", "def transitiontype(self):\n return self._transitiontype", "def check_transition(self, new_state):\n return new_state in self._Transitions[self.state]", "def isSetTransitionEffect(self):\n ...
[ "0.72884405", "0.6717598", "0.61478376", "0.6130159", "0.6108451", "0.6097739", "0.6046095", "0.5992292", "0.5795116", "0.5792501", "0.575507", "0.57404256", "0.5733512", "0.57104075", "0.57104075", "0.57104075", "0.56856024", "0.56856024", "0.56856024", "0.56856024", "0.5685...
0.8771467
0
Gets the is_container_running of this Node.
def is_container_running(self): return self._is_container_running
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_container_running(self, container_node):\n try:\n container_id = container_node.get_container_id()\n container = self.docker_client.containers.get(container_id)\n if container.attrs[\"State\"][\"Status\"].lower() == \"running\":\n return True\n ...
[ "0.77949655", "0.77005124", "0.7508151", "0.73126173", "0.7222585", "0.70723414", "0.70723414", "0.70668775", "0.69761956", "0.6974647", "0.6974647", "0.6974647", "0.69476086", "0.69476086", "0.69324094", "0.690078", "0.68718153", "0.6868778", "0.6836222", "0.6818537", "0.681...
0.87841785
0
Gets the os_version of this Node.
def os_version(self): return self._os_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def os_version(self):\n version_data = self._raw_version_data()\n if self._os_version is None:\n self._os_version = version_data[\"version\"]\n\n return self._os_version", "def os_version(self) -> Optional[pulumi.Input['WindowsNodeConfigOsVersion']]:\n return pulumi.get(sel...
[ "0.8586665", "0.85169375", "0.84953296", "0.8344121", "0.82741416", "0.80573004", "0.78043574", "0.7620195", "0.7490523", "0.74888057", "0.7407813", "0.738305", "0.73568004", "0.73265", "0.72674185", "0.72256273", "0.68455315", "0.6812163", "0.6782339", "0.6770927", "0.675503...
0.8591369
0
Gets the apprenda_platform_version of this Node.
def apprenda_platform_version(self): return self._apprenda_platform_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platform_version(self) -> Optional[str]:\n return pulumi.get(self, \"platform_version\")", "def app_version(self) -> str:\n return pulumi.get(self, \"app_version\")", "def get_version(self):\n data = self._get('app_version')\n return data['version']", "def get_application_vers...
[ "0.7624897", "0.7120776", "0.7112126", "0.6959596", "0.6797007", "0.6788494", "0.67689043", "0.6751149", "0.6743706", "0.6723888", "0.67210394", "0.6718781", "0.6687569", "0.6678065", "0.66720915", "0.66596425", "0.6633898", "0.6608752", "0.659458", "0.6592946", "0.65690905",...
0.8794314
0
Sets the apprenda_platform_version of this Node.
def apprenda_platform_version(self, apprenda_platform_version): self._apprenda_platform_version = apprenda_platform_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apprenda_platform_version(self):\n return self._apprenda_platform_version", "def set_os_version(self, nVmOsVersion):\n\t\tcall_sdk_function('PrlVmCfg_SetOsVersion', self.handle, nVmOsVersion)", "def os_version(self, os_version):\n\n self._os_version = os_version", "def node_version(self, no...
[ "0.68028694", "0.64219046", "0.6265506", "0.5991368", "0.5851755", "0.5782479", "0.57609147", "0.5737917", "0.5726128", "0.57029426", "0.568879", "0.56595826", "0.56129324", "0.5608915", "0.55911", "0.55767334", "0.55767334", "0.55660224", "0.55660224", "0.5556398", "0.555174...
0.86422294
0
Gets the is_ghost of this Node.
def is_ghost(self): return self._is_ghost
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ghost(self):\n\t\treturn False", "def is_ghost(self, is_ghost):\n\n self._is_ghost = is_ghost", "def CheckGhost(self,G):\n\t\tif(P.x==G.x and P.y==G.y):\n\t\t\treturn 1\n\t\treturn 0", "def has_ghosts(self):\n return not np.all(self.mesh.discretization.ghosts == 0)", "def is_empty(self...
[ "0.80438983", "0.7854471", "0.63636047", "0.6069336", "0.60395527", "0.5788656", "0.5691389", "0.5691389", "0.56884474", "0.5681462", "0.5651417", "0.5649751", "0.5644711", "0.5628411", "0.556193", "0.5531436", "0.5528508", "0.54778576", "0.5446731", "0.544112", "0.5426319", ...
0.8705848
0
Gets the total_memory of this Node.
def total_memory(self): return self._total_memory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_total_mem(self):\n return self.total_mem", "def total_actual_memory(self):\n return self._total_actual_memory", "def get_total_memory_size(self):\n return self.drt_manager.get_total_memory_size()", "def total_mem(self):\n return Memory(self.mem_per_proc * self.mpi_procs + self...
[ "0.86356884", "0.8503544", "0.8346467", "0.8117114", "0.8057852", "0.77880126", "0.7720075", "0.76789063", "0.7495995", "0.73670626", "0.7350652", "0.73487604", "0.7272637", "0.7192409", "0.71603715", "0.71246094", "0.71160185", "0.7092699", "0.70898604", "0.70898604", "0.708...
0.89459944
0
Sets the total_memory of this Node.
def total_memory(self, total_memory): self._total_memory = total_memory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_total_mem(self, mem):\n self.total_mem = mem\n return", "def total_actual_memory(self, total_actual_memory):\n\n self._total_actual_memory = total_actual_memory", "def memory_segments_total(self, memory_segments_total):\n\n self._memory_segments_total = memory_segments_total...
[ "0.81015724", "0.7958586", "0.74567014", "0.7045961", "0.68840253", "0.6819514", "0.676453", "0.67277366", "0.6599234", "0.65637493", "0.6454926", "0.6410797", "0.63786393", "0.63322", "0.63322", "0.63322", "0.63322", "0.63322", "0.63322", "0.63322", "0.63322", "0.6147756",...
0.8662186
0
Sets the total_actual_memory of this Node.
def total_actual_memory(self, total_actual_memory): self._total_actual_memory = total_actual_memory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_memory(self, total_memory):\n\n self._total_memory = total_memory", "def set_total_mem(self, mem):\n self.total_mem = mem\n return", "def memory_segments_total(self, memory_segments_total):\n\n self._memory_segments_total = memory_segments_total", "def total_actual_memor...
[ "0.81240374", "0.76406753", "0.7182623", "0.70782065", "0.6652417", "0.6578996", "0.63841105", "0.63798976", "0.6355014", "0.6329198", "0.6024", "0.59719443", "0.5888426", "0.5851946", "0.5847303", "0.5847303", "0.5847303", "0.5847303", "0.5847303", "0.5847303", "0.5847303", ...
0.8774423
0
Gets the allocated_memory of this Node.
def allocated_memory(self): return self._allocated_memory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def memory(self):\r\n return self._memory", "def total_memory(self):\n return self._total_memory", "def node_memory_allocatable(self) -> units.Quantity:\n stdout, _, _ = RunKubectlCommand(\n # TODO(pclay): Take a minimum of all nodes?\n [\n 'get', 'nodes', '-o',\n ...
[ "0.7598766", "0.755545", "0.7435321", "0.7366589", "0.7251123", "0.7228825", "0.7180236", "0.7132854", "0.71020526", "0.7096372", "0.7096372", "0.7077512", "0.70621413", "0.70514786", "0.70470226", "0.6997314", "0.6955947", "0.6842504", "0.68311095", "0.6824261", "0.68056095"...
0.8972999
0
Sets the allocated_memory of this Node.
def allocated_memory(self, allocated_memory): self._allocated_memory = allocated_memory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def memory(self, memory):\n\n self._memory = memory", "def allocated_storage(self, allocated_storage):\n\n self._allocated_storage = allocated_storage", "def resize_memory(self, new_size=None):\n\n self.container.capacity = new_size", "def allocated_cpu(self, allocated_cpu):\n\n s...
[ "0.6999189", "0.6935263", "0.66818416", "0.65801376", "0.6544621", "0.65345967", "0.6451198", "0.6424705", "0.6299909", "0.62497747", "0.6248784", "0.6243467", "0.6240875", "0.6167055", "0.6043504", "0.6002254", "0.58817315", "0.5840115", "0.5820366", "0.58132124", "0.5789527...
0.8589076
0
Gets the total_storage of this Node.
def total_storage(self): return self._total_storage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allocated_storage(self):\n return self._allocated_storage", "def fs_size_total(self):\n return self._fs_size_total", "def size(self):\n return self.storage.size(self.name)", "def total_memory(self):\n return self._total_memory", "def total_storage(self, total_storage):\n\n ...
[ "0.760908", "0.72402614", "0.7177922", "0.7169678", "0.71162343", "0.7071739", "0.6999291", "0.67959297", "0.67919344", "0.669117", "0.6654706", "0.66514033", "0.6590741", "0.65650743", "0.65428466", "0.6527805", "0.6510044", "0.6508611", "0.6469387", "0.64614224", "0.6443851...
0.9031042
0
Gets the allocated_storage of this Node.
def allocated_storage(self): return self._allocated_storage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allocated_memory(self):\n return self._allocated_memory", "def total_storage(self):\n return self._total_storage", "def get_storage(self):\n return self.storage", "def storage(self):\n return self._storage", "def memory(self):\r\n return self._memory", "def memory(s...
[ "0.7624699", "0.69192386", "0.6747804", "0.6600573", "0.65990466", "0.6392791", "0.6392791", "0.6375425", "0.6367235", "0.6365577", "0.6267874", "0.62631094", "0.61836183", "0.60720664", "0.6051815", "0.60422796", "0.59916764", "0.59845793", "0.5973145", "0.59519994", "0.5927...
0.9027084
0
Sets the architecture of this Node.
def architecture(self, architecture): self._architecture = architecture
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_architecture(self):\n self.arch = simple_mlp(num_inputs=self.p.model.num_inputs,\n num_outputs=self.p.model.num_outputs,\n params=self.p.model.arch)", "def architecture(self):\n return self._architecture", "def architecture(self...
[ "0.62784153", "0.6212464", "0.5846446", "0.5846446", "0.58121866", "0.5767161", "0.5743743", "0.572911", "0.5678931", "0.5348863", "0.5214392", "0.5119819", "0.50680965", "0.50470525", "0.5028919", "0.4864784", "0.48076966", "0.48014072", "0.4767911", "0.47466603", "0.4716553...
0.7368752
0
Gets the cloud_name of this Node.
def cloud_name(self): return self._cloud_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n _LOGGER.debug(self._shelly_cloud_device_name + ' >>> ' +\n self._shelly_cloud_entity_name + ' >>> name() >>> ' +\n self._shelly_cloud_device_name)\n return self._shelly_cloud_device_name", "def cloud_services_network_name(self) -> Optional...
[ "0.7470082", "0.7031606", "0.6952087", "0.6897663", "0.6793623", "0.6782311", "0.6782311", "0.67294", "0.67294", "0.6693514", "0.66888106", "0.66462475", "0.6609419", "0.6570565", "0.6516199", "0.64696336", "0.64552265", "0.6449941", "0.6449941", "0.6449941", "0.6449941", "...
0.862286
0
Sets the cloud_name of this Node.
def cloud_name(self, cloud_name): self._cloud_name = cloud_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cloud_name(self):\n return self._cloud_name", "def cloud(self, cloud):\n\n self._cloud = cloud", "def set_name(self, name):\r\n self.stream.set_node_name(self.node, name)", "def cluster_name(self, cluster_name):\n\n self._cluster_name = cluster_name", "def set_name(self, new...
[ "0.65846163", "0.654636", "0.6325651", "0.6169926", "0.61277497", "0.61089116", "0.60411876", "0.6037663", "0.6019488", "0.59992117", "0.59992117", "0.59939086", "0.59939086", "0.59884757", "0.59756947", "0.59756947", "0.59756947", "0.59756947", "0.59756947", "0.59505653", "0...
0.861019
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Node): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8089204", "0.8089204", "0.8055265", "0.7983358", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Turn all leds off
def all_off(): Leds.red_left.brightness = 0 Leds.red_right.brightness = 0 Leds.green_left.brightness = 0 Leds.green_right.brightness = 0 Leds.blue_left.brightness = 0 Leds.blue_right.brightness = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_all_off(self):\n for led_type in LED:\n self.led_off(led_type)\n logging.info('LED: ALL - Status: 0')", "def off(self):\n for light in self.all:\n GPIO.output(light, 0)", "def turn_off(self):\n print(\"Turning the lights off\")\n self.led.all_of...
[ "0.8831107", "0.87462044", "0.841425", "0.80455816", "0.7975225", "0.7752392", "0.77370876", "0.75709295", "0.7512136", "0.750031", "0.74862355", "0.7448339", "0.74388486", "0.74093044", "0.73901457", "0.7387843", "0.7387271", "0.73574376", "0.733058", "0.7317705", "0.7304191...
0.801001
4
convert an index to a numpy uint8 array
def serialize_index(index): writer = faiss.VectorIOWriter() faiss.write_index(index, writer) return faiss.vector_to_array(writer.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_nibble_array(arr: ndarray) -> ndarray:\n arr = arr.ravel()\n return (arr[::2] + (arr[1::2] << 4)).astype(\"uint8\")", "def to_uint8(image):\n\tnp.clip(image, 0, 255, out=image)\n\treturn image.astype(np.uint8)", "def PLCTYPE_ARR_USINT(n: int) -> Type[Array]:\n return c_uint8 * n", "def from_n...
[ "0.6644165", "0.6183559", "0.6031999", "0.6010897", "0.5963057", "0.59157175", "0.5907381", "0.5885117", "0.5855898", "0.5815019", "0.5809759", "0.5805169", "0.5782828", "0.5774073", "0.5765727", "0.574138", "0.5702923", "0.5695633", "0.5690121", "0.56387943", "0.5624383", ...
0.5761131
15
Test /model (GET request)
def test_model_get(self): response = self.client().get('/model') self.assertEqual(response.status_code, 200) loaded_model = Model.from_json(response.data.decode()) self.assertEqual(loaded_model, self.data_manipulation.get_latest_model()) # All versions are removed self.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_model_list():\n with app.test_client() as c:\n response = c.get('/REST/api/v1.0/model_list') \n assert response.status_code == 201", "def test_get_model(self) -> None:\n get_model()", "def test_home_get(self):\n\n response = self.client().get('/')\n self.asser...
[ "0.8084244", "0.7417703", "0.73261017", "0.7058019", "0.69896996", "0.6912382", "0.68487847", "0.6837376", "0.67572045", "0.67364687", "0.6727572", "0.67257696", "0.662476", "0.65741414", "0.65715295", "0.65163463", "0.64759177", "0.647164", "0.64702487", "0.6469417", "0.6469...
0.7158062
3
Test /model (POST request) Test case deletes random element, then posts it.
def test_model_post(self): new_model = dummy_data() element_key_to_delete = random.choice(list(new_model.elements.keys())) new_model.elements[element_key_to_delete].deleted = True test_json = new_model.to_json() result = self.client().post( '/model', jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_deleting_patient_posts(self):\n\n data = {\"post\": 1}\n result = self.client.post(\"/delete-post\", data=data)\n post = Post.query.get(1)\n\n self.assertEqual(result.status_code, 200)\n self.assertIsNone(post)", "def test_post(self):\n pass", "def test_remove...
[ "0.6591965", "0.646079", "0.646046", "0.6457295", "0.64323044", "0.6416264", "0.63436633", "0.6296878", "0.6290165", "0.6278127", "0.627576", "0.62565845", "0.6205553", "0.6158948", "0.6158948", "0.6143601", "0.6104944", "0.6093058", "0.6088667", "0.6084258", "0.606971", "0...
0.8204477
0
Test /models/ (GET request)
def test_model_by_version_get(self): # Firstly, find existing version - latest response = self.client().get('/model') latest_model = Model.from_json(response.data.decode()) latest_version = latest_model.version # Accesses latest model response = self.client().get('/mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_model_list():\n with app.test_client() as c:\n response = c.get('/REST/api/v1.0/model_list') \n assert response.status_code == 201", "def test_home_get(self):\n\n response = self.client().get('/')\n self.assertEqual(response.status_code, 200)\n loaded_model = Mo...
[ "0.8068767", "0.7279881", "0.72238547", "0.7190689", "0.71321595", "0.69871163", "0.6892013", "0.6888119", "0.68683887", "0.6851729", "0.6749125", "0.67328376", "0.67297727", "0.6723642", "0.67100686", "0.6642334", "0.65917444", "0.6578118", "0.6572842", "0.65522885", "0.6537...
0.6458862
28
Reshaping happens during the call to forward.
def reshape(self, bottom, top): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, input):\n batch_size = input.size(0)\n shape = (batch_size, *self.shape)\n out = input.reshape(shape)\n return out", "def _reshape(self):\n self._frame._setup(width=self._width,height=self._height,\n startx=self._x,starty=self._y)", ...
[ "0.7052694", "0.66112494", "0.6553348", "0.6553348", "0.6445214", "0.6263273", "0.6219224", "0.62077326", "0.6204762", "0.612587", "0.612587", "0.6098139", "0.6093421", "0.6090613", "0.60858375", "0.60803044", "0.6076111", "0.60631406", "0.60622656", "0.60548824", "0.60481465...
0.57463765
87
Sends a 401 response that enables basic auth
def authenticate(): return Response( 'Could not verify your access level for that URL.\n' 'You have to login with proper credentials', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.80936956", "0.809273", "0.795861", "0.78515965", "0.7842818", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "...
0.78245074
5
Returns CSV object for a given statistic.
def getCSV(self, statistic): if not statistic.final_json: return ['The statistic has not been collected'] statistic_type = self._getStatisticType(statistic) if statistic_type == 'per_field': return self._getCSVForPerField(statistic) elif statistic_type == 'overall': return self._getC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getCSVForOverall(self, statistic):\n\n rows = []\n\n final_stat = simplejson.loads(statistic.final_json)\n for name, result in final_stat.iteritems():\n rows.append([name, result])\n\n return rows", "def _getCSVForPerField(self, statistic):\n\n rows = []\n\n chart_json = simplejson.lo...
[ "0.68138343", "0.6719643", "0.6161655", "0.6129821", "0.59673136", "0.5842868", "0.57683116", "0.5627031", "0.5598593", "0.5541313", "0.5533992", "0.54981375", "0.54810643", "0.54772615", "0.54647684", "0.54227203", "0.54210126", "0.5414908", "0.5342787", "0.5338139", "0.5319...
0.8167913
0
Returns CSV object for a given statistic 'per field' statistic.
def _getCSVForPerField(self, statistic): rows = [] chart_json = simplejson.loads(statistic.chart_json) description = chart_json['description'] header = [] for item in description: header.append(item[-1].encode('utf-8')) rows.append(header) final_stat = simplejson.loads(statistic.fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCSV(self, statistic):\n\n if not statistic.final_json:\n return ['The statistic has not been collected']\n\n statistic_type = self._getStatisticType(statistic)\n if statistic_type == 'per_field':\n return self._getCSVForPerField(statistic)\n elif statistic_type == 'overall':\n ret...
[ "0.72822803", "0.61026293", "0.6092724", "0.5887272", "0.57894444", "0.56718", "0.5669877", "0.5668231", "0.5653095", "0.55502087", "0.5543842", "0.5517425", "0.54992944", "0.5458515", "0.54286575", "0.5415003", "0.54030037", "0.5367448", "0.5316214", "0.5312879", "0.52815413...
0.6976472
1
Function to capture the REPL input and return the output.
def py_repl_write(str): with Capturing() as output: interp.push(str) return "\n".join(output)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recvraw(self):\n\n if self.stdin is None:\n return _python_input_function()\n else:\n return self.stdin.readline().rstrip('\\n')", "def recieve(self):\n return self.__proc.stdout.readline().strip('\\n')", "def get_value(Runner, input_str):\n Runner.stdin.write(...
[ "0.6087012", "0.60855556", "0.6032843", "0.6029263", "0.598536", "0.5937974", "0.59231186", "0.5892529", "0.58411497", "0.57967764", "0.5783533", "0.5754346", "0.5747203", "0.5747203", "0.5747203", "0.5747203", "0.5747203", "0.5747203", "0.5747203", "0.573772", "0.57052547", ...
0.0
-1
Returns the value to which the specified key is mapped, or 1 if this map contains no mapping for the key
def get(self, key): hashv = self.hash(key) bucket=self.hashmap[hashv] for i,(k,v) in enumerate(bucket): if k==key: return v return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, key: int) -> int:\n if key not in self.map:\n return -1\n return self.map[key]", "def get(self, key: int) -> int:\n if key in self.hashmap.keys():return self.hashmap[key]\n else:return -1", "def get(self, key: int) -> int:\n sh = key % 37\n if ...
[ "0.80039245", "0.7909904", "0.76296777", "0.75651246", "0.75566775", "0.75302136", "0.7525819", "0.7493289", "0.73738945", "0.7294656", "0.729335", "0.72217286", "0.71815604", "0.7177131", "0.7163425", "0.6981002", "0.69281197", "0.6785112", "0.67566174", "0.6734945", "0.6611...
0.72171503
12
This helper function searches an array for a particular value returning the index where the value could be inserted into the array.
def __find_index(arr, val): if val is not None: return numpy.searchsorted(arr, val) else: return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findex(array, value):\n i = bisect.bisect_left(array, value)\n if i != len(array) and array[i] == value:\n #print(\"\\n\\n\\n FOUND!!! \\n\\n\\n\")\n return i\n \n return -1", "def index_equals_value_search1(arr):\n for key, value in enumerate(arr):\n if value == key:\n ...
[ "0.7718444", "0.7613492", "0.71289504", "0.7092788", "0.7049456", "0.7006887", "0.69724697", "0.6854522", "0.6794711", "0.67100006", "0.6695097", "0.6644335", "0.6605783", "0.65992427", "0.65678734", "0.6553234", "0.65228873", "0.64996326", "0.6498679", "0.6498517", "0.649851...
0.7956752
0
Returns True if n is prime.
def isprime(n): if n == 2: return True if n == 3: return True if n % 2 == 0: return False if n % 3 == 0: return False i = 5 w = 2 while i * i <= n: if n % i == 0: return False i += w w = 6 - w return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(n):\r\n\treturn is_prime(n)", "def isprime(n):\n\treturn is_prime(n)", "def if_prime(cls, n):\n\n if (n <= 1):\n return False\n if (n <= 3):\n return True\n\n if (n % 2 == 0 or n % 3 == 0):\n return False\n\n i = 5\n while(i * i <=...
[ "0.8514553", "0.85052115", "0.8478591", "0.8415317", "0.8408101", "0.84059155", "0.8389028", "0.8350958", "0.83173066", "0.83133805", "0.8305305", "0.83034956", "0.830075", "0.82713956", "0.8248401", "0.8248108", "0.8245176", "0.82376003", "0.82293326", "0.82223743", "0.82108...
0.78993803
59
Create a new WolfSheep model with the given parameters.
def __init__( self, width=20, height=20, initial_sheep=100, initial_wolves=50, sheep_reproduce=0.04, wolf_reproduce=0.05, wolf_gain_from_food=20, grass=False, grass_regrowth_time=30, sheep_gain_from_food=4, ): super().__...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_wine(title, winery, variety, country, description, designation, points, province, region_1, region_2):\n\n wine = Wine(title=title,\n winery=winery,\n variety=variety,\n country=country,\n description=description,\n designatio...
[ "0.61659145", "0.5963929", "0.56897795", "0.5556265", "0.5480515", "0.5478087", "0.5451578", "0.5299463", "0.52619165", "0.5261746", "0.52589226", "0.52587223", "0.52469856", "0.5216869", "0.519537", "0.5144201", "0.5139784", "0.5088557", "0.5088159", "0.50880337", "0.5038954...
0.55888206
3
Tokenize the language. Trans all vocab to index number.
def tokenize(lang): lang_tokenizer = tf.keras.preprocessing.text.Tokenizer(filters='') lang_tokenizer.fit_on_texts(lang) tensor = lang_tokenizer.texts_to_sequences(lang) # pad zero after sequences for the same length. tensor = tf.keras.preprocessing.sequence.pad_sequences(tensor, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tokens_to_index(self,tokens):\n wids = []\n for tk in tokens:\n if tk in self.wtoi.keys():\n wids.append(self.wtoi[tk])\n else:\n wids.append(1) # <UNK>\n for _ in range(self.sentence_max_length - len(wids)):\n wids.append(0)...
[ "0.63840157", "0.6366054", "0.6282904", "0.6167301", "0.613988", "0.60517967", "0.6030973", "0.6025635", "0.59824806", "0.59820074", "0.59690565", "0.5948161", "0.59478813", "0.59351397", "0.59195614", "0.5918635", "0.5914458", "0.5891738", "0.588104", "0.58722216", "0.586698...
0.6537286
0
Initialize hidden rnn state.
def initialize_hidden_state(self): return tf.zeros(shape=(self.batch_size, self.enc_units))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_hidden_state(self):\n initializer = tf.keras.initializers.Zeros()\n rnnten = initializer(shape=(self.batch, self.units))\n return rnnten", "def init_hidden(self):\n if isinstance(self.rnn, nn.GRU):\n return torch.zeros(self.num_directions * self.num_layers, 1...
[ "0.7760559", "0.7337841", "0.7337841", "0.73366845", "0.73366845", "0.7262224", "0.72052634", "0.70761555", "0.687801", "0.6784985", "0.6706769", "0.66434807", "0.66434807", "0.66305304", "0.6610233", "0.6610233", "0.6526962", "0.64894116", "0.64879435", "0.648451", "0.647228...
0.6644738
11
Sends a 401 response that enables basic auth
def authenticate(): return Response('Could not verify your access level for that URL.\n' 'You have to login with proper credentials', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'} )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.80936956", "0.809273", "0.795861", "0.78515965", "0.7842818", "0.78245074", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", "0.7810836", ...
0.7719394
37
Calculates the columnwise mean and standard deviation
def fit ( self, X ): if self.mean: self.df_means = X.mean ( axis = 0 ) # Get the colwise means if self.std: self.df_std = X.std ( axis = 0 ) # Get the colwise stds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stdev(headers, data):\n\tcolumn_matrix=data.get_data(headers)\n\tmean_values=column_matrix.std(0)\n\tstd_values=mean_values.tolist()\n\treturn std_values", "def standardize(X):\n X_std = X\n mean = X.mean(axis=0)\n std = X.std(axis=0)\n for col in range(np.shape(X)[1]):\n if std[col]:\n ...
[ "0.73179716", "0.70586985", "0.6962074", "0.69415504", "0.68434453", "0.6718562", "0.66302276", "0.6586547", "0.6564388", "0.6535526", "0.6444957", "0.6438091", "0.6431876", "0.6429554", "0.6421954", "0.6416917", "0.6407201", "0.6406688", "0.64022297", "0.63864005", "0.638199...
0.613363
55
Applies the columnwise mean and std transformations
def transform ( self, X ): if not self.mean and not self.std: return X if self.mean: df_xf = X - self.df_means # Subtract means if self.std: is_zero = np.isclose ( self.df_std, 0 ) # If non-zero variance, with warnings.catch_warnings(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def standardize(X):\n X_std = X\n mean = X.mean(axis=0)\n std = X.std(axis=0)\n for col in range(np.shape(X)[1]):\n if std[col]:\n X_std[:, col] = (X_std[:, col] - mean[col]) / std[col]\n # X_std = (X - X.mean(axis=0)) / X.std(axis=0)\n return X_std", "def standardize(x, mean=...
[ "0.71017635", "0.7056569", "0.6909326", "0.6762467", "0.67029417", "0.6623266", "0.65749717", "0.64988834", "0.6488042", "0.646864", "0.6462621", "0.64583516", "0.6452938", "0.6407167", "0.6407057", "0.6402926", "0.6375671", "0.63641137", "0.6346955", "0.6284558", "0.6261802"...
0.61272913
30
Determines whether a specified row (called 'row_index') should be included in the condensed set.
def get_inclusion ( self, X: np.ndarray, y: np.ndarray, row_index: int, subset_Z: List [ int ] ): # Fit the KNN on just the rows of Z. # Remember that k = 1. self.knn.fit ( X [ subset_Z ], y [ subset_Z ] ) # If the prediction is incorrect if self.knn.predict ( X [ row_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_row_proportion(self, index):\n\n return index in self._proportions[1]", "def filter_row(row: OrderedDict, sampling_features: set) -> bool:\n\n return row['feature_of_interest'] in sampling_features", "def __is_valid_row(self, row_number):\n return self.__is_valid((row_number, 0))", "...
[ "0.6475508", "0.6398094", "0.6024096", "0.58574605", "0.5806895", "0.57807183", "0.5760831", "0.5744995", "0.57370687", "0.5717892", "0.5654433", "0.5647129", "0.5612646", "0.5609017", "0.5587559", "0.55867267", "0.5574396", "0.55732554", "0.5556723", "0.5552116", "0.55251205...
0.59900916
3
close the listener such that no more connections can be open on this transport instance
def close(self, options=None): if self.server is None: return False self.server.close() _loop = asyncio.get_event_loop() _loop.run_until_complete(self.server.wait_closed()) _loop.close() self.server = None return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n log.info(\"Closing listener from %s on port %s.\",\n self.address, self.port)\n self._server.stop()\n self._server = None\n self._address = \"\"\n self._port = 0", "def close(self):\n if self._closed:\n return\n self.a...
[ "0.81708115", "0.7567656", "0.74933636", "0.7113798", "0.70668846", "0.70308506", "0.7029474", "0.7024885", "0.7024885", "0.7024885", "0.7024885", "0.7024885", "0.7024885", "0.69955695", "0.69569016", "0.6956194", "0.6936701", "0.69105476", "0.68568534", "0.6855057", "0.68550...
0.0
-1
Deletes old database, then creates, migrates, and seeds
def reset(): teardown_db() build()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recreate_db():\n drop_db()\n create_db()\n populate_db()", "def recreate_db():\n drop_db()\n create_db()", "def reset_db_danger():\n from flask.ext.migrate import init, migrate\n # Remove the migration folder if exist\n if os.path.exists('migrations'):\n shutil.rmtree('migrat...
[ "0.80248207", "0.79285175", "0.77515477", "0.7719583", "0.7583174", "0.75416774", "0.752951", "0.7526629", "0.75002486", "0.74958444", "0.7489303", "0.74660254", "0.7456146", "0.7425223", "0.74217874", "0.7398427", "0.7345221", "0.7336529", "0.7269257", "0.72278965", "0.72181...
0.0
-1
At the end of the web request, this makes sure to close the database connection. If you don't, the database could run out of memory!
def teardown_request(exception): try: g.conn.close() except Exception as e: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_request():\n db.close()", "def close(self):\r\n self.conn.close()\r\n gc.collect()", "def cleanup(_):\n self.db.close()", "def close(self): \n self.connection.close()", "def after_request(response):\n g.db.close()\n return response", "def after_reque...
[ "0.79487187", "0.7743723", "0.75628585", "0.7458552", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7452353", "0.7359539", "0.73334867", "0.73334867", "0.7331413", "0.73311794", "0.7329911"...
0.0
-1
Init test data from models in test database
def setup(self): print("INIT DATA") self.nutella = Product.objects.create(name="nutella", nutriscore="e")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.data = DatabaseIntermediary()", "def setUp(self):\n self.aoSamples = [ModelDataBase(),];", "def setUpTestData(cls):\n call_command('loaddata', 'db.json', verbosity=0)", "def setUp(self):\n self.test1 = BaseModel()\n self.test1json = self.test1.to_dic...
[ "0.77842754", "0.76694995", "0.7620229", "0.75481945", "0.7481808", "0.7397059", "0.73742867", "0.7369614", "0.72792643", "0.7248049", "0.7239784", "0.7233405", "0.7224051", "0.71922207", "0.7162973", "0.71396583", "0.7114308", "0.7113607", "0.7105705", "0.70995605", "0.70913...
0.0
-1
Return a new point which is equal to this point added to p
def __add__(self, p): return Point(self.x + p.x, self.y + p.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other):\n return Point(self.x+other.x, self.y+other.y)", "def __iadd__(self, point):\n self.points.append(point)\n return self", "def point_add(self, a, b):\n\n if a.at_inf and b.at_inf: return point.inf()\n if a.at_inf: return b.dup()\n if b.at_inf: ...
[ "0.71179134", "0.71062964", "0.708327", "0.69095445", "0.6891107", "0.6845033", "0.6807594", "0.6723019", "0.66673654", "0.6646096", "0.6646096", "0.66295016", "0.65793526", "0.6566359", "0.6566175", "0.656294", "0.6540724", "0.64442456", "0.6437117", "0.64365685", "0.6432838...
0.7758841
0
return a string representation of this point.
def __repr__(self): return '(%f, %f)' % (self.x, self.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n return f\"Point({self.x}, {self.y})\"", "def __str__(self):\n return \"Point at ({}, {})\".format(self.x, self.y)", "def __repr__(self):\n return \"Point({x}, {y})\".format(x=self.x, y=self.y)", "def __str__(self):\n return '<{}>'.format(self._coords)"...
[ "0.83752084", "0.8351927", "0.80786014", "0.8005343", "0.80002165", "0.7945336", "0.7896275", "0.78775525", "0.78754205", "0.78662777", "0.78595555", "0.7845858", "0.7829997", "0.7810284", "0.77577174", "0.7748605", "0.7702435", "0.76845855", "0.76820356", "0.7681365", "0.767...
0.0
-1
Function to convert a given string to uppercase
def uppercase(str): return str.upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uppercase(string):\n\n return str(string).upper()", "def convert_to_uppercase(text):\n return text.upper()", "def upper(string):\n new_string = '' # Empty string to append to\n for char in string: # Itterate over each character in user's string\n if char.isalpha() and not char.isupper():...
[ "0.8644794", "0.83924437", "0.82592", "0.8197075", "0.7990064", "0.7890949", "0.77890515", "0.7706576", "0.76463896", "0.76069313", "0.7512912", "0.7352454", "0.7314599", "0.7313527", "0.72703403", "0.7231536", "0.72310215", "0.7151268", "0.71087456", "0.7012091", "0.6993129"...
0.87026423
0
A "view" into a sequence, like a "lazy slice".
def SliceView(sequence, start=None, stop=None, step=1): start, stop, step = slice(start, stop, step).indices(len(sequence)) for i in range(start, stop, step): yield sequence[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slicer(seq, start=None, stop=None, step=None):\n return seq[start:stop:step]", "def construct_sequence_list(self):\n return list(self.iter_sequence())", "def _chunker(self, seq, size):\n return (seq.iloc[pos:pos + size] for pos in range(0, len(seq), size))", "def rslices(n, allow_empty=F...
[ "0.60947126", "0.58715415", "0.57327306", "0.57138765", "0.57138765", "0.5664124", "0.5622318", "0.5591828", "0.55817425", "0.55732924", "0.55537426", "0.55440396", "0.55367285", "0.5518729", "0.5516034", "0.5513617", "0.55022943", "0.5499853", "0.5473446", "0.5464608", "0.54...
0.73746663
0
Test the route returns 404 for an incorrect ID.
def test_grainbin_get_by_id_not_found(flaskclient, auth_headers): grainbin = GrainbinFactory().save() url = url_for("grainbin.GrainbinById", grainbin_id=grainbin.id + 1) response = flaskclient.get(url, headers=auth_headers) assert response.status_code == 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_abort_route_when_id_route_not_exist(self):\n\n pass", "def test_invalid_route_is_status_404(self):\n response = self.client.get(\"/bad\")\n self.assertTrue(response.status_code == 404)", "def test_get_not_exist(self):\n attempt_id = 9999\n _, err = self.resource.get(...
[ "0.79099095", "0.7777701", "0.7710656", "0.74232954", "0.7345149", "0.7320109", "0.72961736", "0.72232884", "0.7213825", "0.7210203", "0.7210203", "0.7210203", "0.71886194", "0.7063012", "0.7047675", "0.7047675", "0.7047675", "0.70446867", "0.70419216", "0.7034017", "0.701497...
0.66408324
56
Test that the latest update is returned for a grainbin.
def test_grainbin_updates_latest_get(flaskclient, auth_headers, dbsession): grainbin = GrainbinFactory().save() # create some GrainbinUpdates for x in range(25): grainbin_update = GrainbinUpdate(grainbin.id) grainbin_update.timestamp = dt.datetime.now() grai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_grainbin_updates_latest_get_no_grainbin(flaskclient, auth_headers):\n\n url = url_for(\"grainbin.GrainbinUpdatesLatest\", grainbin_id=1)\n rep = flaskclient.get(url, headers=auth_headers)\n rep_json = rep.get_json()\n\n assert rep.status_code == 404\n assert rep_json[\"m...
[ "0.74496186", "0.74427164", "0.7228825", "0.7219329", "0.7081327", "0.6192386", "0.6191242", "0.6138488", "0.6053932", "0.60485196", "0.6036927", "0.60094035", "0.59835637", "0.59826946", "0.5981819", "0.59290934", "0.5925972", "0.5916462", "0.59100217", "0.59100217", "0.5910...
0.7818452
0
Test that the route returns 404 for a bin that has no updates.
def test_grainbin_updates_latest_get_no_updates(flaskclient, auth_headers): grainbin = GrainbinFactory().save() url = url_for("grainbin.GrainbinUpdatesLatest", grainbin_id=grainbin.id) rep = flaskclient.get(url, headers=auth_headers) rep_json = rep.get_json() assert rep.status...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_05d_get_nonexistant_app_update(self):\r\n self.register()\r\n # GET\r\n res = self.app.get('/app/noapp/update', follow_redirects=True)\r\n assert res.status == '404 NOT FOUND', res.status\r\n # POST\r\n res = self.update_application(short_name=\"noapp\")\r\n ...
[ "0.6995781", "0.6985993", "0.694409", "0.6922905", "0.6905113", "0.687438", "0.67871505", "0.6763535", "0.67333657", "0.6730479", "0.6726473", "0.6709454", "0.6686213", "0.66578496", "0.6631366", "0.66178167", "0.66136503", "0.6611465", "0.6608927", "0.6598293", "0.6596177", ...
0.71373457
0
Create a new Quantity from a value and a unit.
def __init__(self, value=None, unit=None): # When no unit is specified, bend over backwards to handle all one-argument possibilities if unit == None: # one argument version, copied from UList if is_unit(value): # Unit argument creates an empty list with that unit attached ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_casa_quantity(myqatool,value,unit):\n if (type(casac.Quantity) != type): # casa 4.x\n myqa = myqatool.quantity(value, unit)\n else: # casa 3.x\n myqa = casac.Quantity(value, unit)\n return(myqa)", "def __init__(__self__, *,\n quantity: Optional[float] = None,\n...
[ "0.66371435", "0.6636565", "0.6582691", "0.657488", "0.6430611", "0.6391831", "0.6361407", "0.6358738", "0.6355004", "0.6311368", "0.6294118", "0.62140423", "0.61569035", "0.615172", "0.6095781", "0.6078041", "0.59428024", "0.590696", "0.5871284", "0.5842227", "0.5832974", ...
0.7118831
0
Compares two quantities. Raises TypeError if the Quantities are of different dimension (e.g. length vs. mass) Returns True if self < other, False otherwise.
def __lt__(self, other): return self._value < other.value_in_unit(self.unit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, other: Compound[Scalar]) -> bool:\n return (self._points_set > other._points_set\n if isinstance(other, Multipoint)\n else NotImplemented)", "def __eq__(self, other):\n s = len(self)\n r = len(other)\n\n if s != r:\n raise(Veto...
[ "0.7101258", "0.7021969", "0.70164955", "0.6973979", "0.69552064", "0.6937958", "0.6877706", "0.68679726", "0.6844896", "0.6844577", "0.6840631", "0.6815787", "0.67985433", "0.67751455", "0.6771951", "0.6767034", "0.67476803", "0.6730255", "0.67173743", "0.6712549", "0.671163...
0.64814734
64
Returns a reference to self.
def __pos__(self): return Quantity(+(self._value), self.unit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self):\n return self", "def _self(self):\n return self.__self", "def __enter__(self):\n\n return self", "def __enter__(self):\n\n return self", "def __enter__(self):\n\n return self", "def __enter__(self):\n\n return self", "def __enter__(self):\n\...
[ "0.8216298", "0.7785575", "0.7374065", "0.7374065", "0.7374065", "0.7374065", "0.7374065", "0.7374065", "0.73627603", "0.7326855", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72388554", "0.72...
0.0
-1
Returns True if value underlying Quantity is zero, False otherwise.
def __bool__(self): return bool(self._value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_zero(self) -> bool:\n return self.field.zero == self", "def is_zero(self):\n return self._express.is_zero()", "def isZero(self):\n\t\treturn (self.p.isZero() & (self.q.isZero() == False))", "def is_zero(self):\n return (self._num == 0)", "def isZero(self):\n return self.c...
[ "0.7824971", "0.7677371", "0.74709904", "0.7386951", "0.73624486", "0.7342036", "0.726924", "0.7255914", "0.72231394", "0.71562845", "0.7072766", "0.7014095", "0.6984774", "0.6961421", "0.6935813", "0.68843806", "0.68366724", "0.6814878", "0.6724647", "0.6682406", "0.66638947...
0.0
-1
Unescapes a string according the TOML spec. Raises BadEscapeCharacter when appropriate.
def _unescape_str(text): text = text.decode('utf-8') if isinstance(text, six.binary_type) else text tokens = [] i = 0 basicstr_re = re.compile(r'[^"\\\000-\037]*') unicode_re = re.compile(r'[uU]((?<=u)[a-fA-F0-9]{4}|(?<=U)[a-fA-F0-9]{8})') escapes = { 'b': '\b', 't': '\t', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unescape(string):\n\n def unescape_entity(m):\n try:\n return unichr(name2codepoint[m.group(1)])\n except KeyError:\n return m.group(0) # use as is\n\n return pattern.sub(unescape_entity, string)", "def _unescape_string(s):\n # We don't use codecs.decode() straig...
[ "0.68957305", "0.67507964", "0.6735677", "0.671735", "0.6694295", "0.6671184", "0.6660934", "0.66045773", "0.6595168", "0.65667087", "0.651074", "0.6464239", "0.6453427", "0.6441426", "0.6437797", "0.643328", "0.642588", "0.6388378", "0.63663006", "0.62686414", "0.62450916", ...
0.65154916
10
TensorFlow implementation of error rate and impurity metrics.
def tf_error_rate_impurity(X_encoded, X, y, k=18): err_impr_ = tf.map_fn( fn=lambda x: votes_and_error(x, X_encoded, y, k), elems=tf.concat( [X_encoded, tf.expand_dims(tf.cast(y, X_encoded.dtype), axis=1)], axis=1 ), fn_output_signature=tf.TensorSpec(shape=(2, ), dtype=tf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_rate_impurity(X_valid_encoded, X_valid, y_valid, k=18):\n errors = 0\n impurities = 0\n for i, x_enc in enumerate(X_valid_encoded):\n top_k_indices = ann.knn(x_enc, X_valid_encoded, k)\n label = y_valid[i]\n votes_against = 0\n for index in top_k_indices:\n ...
[ "0.64840347", "0.64691603", "0.63370705", "0.5966092", "0.58942133", "0.5884066", "0.58490205", "0.5840327", "0.5825993", "0.5818321", "0.5760266", "0.5747591", "0.57456416", "0.57385576", "0.5710653", "0.5704699", "0.56901276", "0.5669724", "0.56637275", "0.56505656", "0.564...
0.7213236
0
Constructor to setup analytical base table.
def __init__(self): self.df_incoming = load_incoming(path_incoming = './', incoming_data = 'data/incoming.csv') self.df_incoming['incoming_outgoing'] = 0 self.df_outgoing = load_outgoing(path_outgoing = './', outgoing_data = 'data/outgoing.csv') self.df_outgoing['incoming_outgoing'] = 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, flowchart=None, extension=None):\n logger.debug(\"Creating Table {}\".format(self))\n\n # Initialize our parent class\n super().__init__(\n flowchart=flowchart, title=\"Table\", extension=extension, logger=logger\n )\n\n # This needs to be after init...
[ "0.69520074", "0.69430363", "0.6765809", "0.6564771", "0.65217125", "0.65116155", "0.6510653", "0.6490506", "0.64674765", "0.6453262", "0.6453262", "0.6443674", "0.64340156", "0.6411098", "0.63690954", "0.63458157", "0.63347024", "0.63340175", "0.6329653", "0.6310645", "0.630...
0.0
-1
Return shortname of a spectrum designation.
def getShortname(input_id): name = formatDesignation(input_id) return name[0:6] + name[10:15]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ShortName(name):\n if name in CODEC_MAP:\n return CODEC_MAP[name].shortname\n raise encoder.Error('Unrecognized codec name %s' % name)", "def short_displayname(self):\n return self.get_short_displayname()", "def __str__(self):\n temp = 'Fourier'\n if self.dagger:\n temp...
[ "0.6740192", "0.6607399", "0.66031855", "0.6465426", "0.64076483", "0.64076483", "0.64076483", "0.64076483", "0.64076483", "0.64076483", "0.64076483", "0.64076483", "0.63940346", "0.63900787", "0.6355494", "0.6355494", "0.6338392", "0.63350594", "0.62363094", "0.62051797", "0...
0.68120545
0
Returns a batch containing all data
def full_batch(self): return self.X_data, self.Y_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch(self):\n return self._client.batch()", "def batches(self):\n return [self.get_batch(i) for i in range(self.num_batches)]", "def Batch(dataset, batch_size, drop_last=False):\n\n return dataset.batch(batch_size=batch_size, drop_remainder=drop_last)", "def batch(self):\n return sel...
[ "0.7790328", "0.7177194", "0.71468604", "0.7128562", "0.70859176", "0.70261997", "0.70214003", "0.69988525", "0.6971844", "0.6911753", "0.6910679", "0.688955", "0.68849987", "0.6864026", "0.6861834", "0.6808274", "0.6782749", "0.6782749", "0.67817575", "0.675747", "0.67209905...
0.67459166
20
Get the PyPi version of this package.
def get_pypi_version(): url = 'https://pypi.org/pypi/pyupdate/json' try: version = '==' + requests.get(url).json()['info']['version'] except json.decoder.JSONDecodeError: version = '' return version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pypi_version(name):\n r = requests.get(\"https://pypi.org/pypi/{name}/json\".format(name=name))\n return r.json()[\"info\"][\"version\"]", "def get_version():\n\n version_string = version_from_versioneer()\n\n if not version_string:\n version_string = version_from_pip()\n\n return v...
[ "0.7684346", "0.76745534", "0.74824935", "0.7432789", "0.7432789", "0.7432789", "0.73973405", "0.7386508", "0.7336247", "0.7310399", "0.7303104", "0.7235463", "0.72258526", "0.7215278", "0.7204435", "0.7190287", "0.71650755", "0.71650755", "0.71650755", "0.71650755", "0.71650...
0.7843095
0
Convert date object to string
def date_to_string(date) -> str: return date.strftime('%m/%d/%Y')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_to_str(obj: \"date\") -> str:\n return obj.isoformat()", "def date_to_final_str(date_obj: datetime) -> str:\n return date_obj.strftime(\"%Y-%m-%d\")", "def date_to_str(obj):\n if not obj:\n return False\n return obj.strftime(DEFAULT_SERVER_DATE_FORMAT)", "def date2str(datetime...
[ "0.84640604", "0.8098093", "0.7792208", "0.76681894", "0.7385603", "0.7385603", "0.7290326", "0.72753716", "0.7229564", "0.7228089", "0.7211817", "0.71365774", "0.7098219", "0.7063778", "0.7049933", "0.7047697", "0.7047697", "0.70399976", "0.7001789", "0.69895333", "0.6978896...
0.7394363
4
Return name of selected column
def get_name(self): return self.col_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def columnName(self):\n return self.__column", "def column_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"column_name\")", "def column_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"column_name\")", "def column_name(self) -> Optional[str]:\n return pulu...
[ "0.78004587", "0.7797923", "0.7797923", "0.7668352", "0.75347626", "0.7418969", "0.73949283", "0.73806936", "0.71719795", "0.7153578", "0.7153578", "0.7071536", "0.70506084", "0.6982507", "0.698185", "0.69454706", "0.6932765", "0.6918896", "0.6868051", "0.6750093", "0.6697990...
0.7862703
0
Return number of missing values for selected column
def get_missing(self): return self.serie.isna().sum()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_missing(self):\n missing_values = self.df[self.col_name].isnull().sum()\n return missing_values", "def check_missing_values(col):\n return np.sum(np.isnan(col))", "def count_missing(a_dataframe):\n missing_count = []\n for category in a_dataframe.dtypes.keys():\n try:\n ...
[ "0.7710043", "0.76435965", "0.719693", "0.69899046", "0.67944235", "0.6767239", "0.67486644", "0.67146564", "0.66854715", "0.65716153", "0.65413487", "0.65193695", "0.6477303", "0.64713204", "0.6462284", "0.6422103", "0.64116657", "0.6402662", "0.6371612", "0.63603926", "0.63...
0.6742597
7