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
Plot a heatmap of a pivoted data frame with automatic labeling of axes.
def contour(df, levels=None, ax=None, clabel=True, label=None, clabelkwargs=dict(), **kwargs): if ax is None: ax = plt.gcf().add_subplot(111) X, Y = np.meshgrid(df.columns, df.index) cs = ax.contour(X, Y, df, levels=levels, #extent=(min(df.columns), max(df.columns), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_heatmap(df_to_plot):\n # create figure and axis\n fig, ax = plt.subplots(figsize=(20, 20))\n\n # Generate a custom diverging colormap\n cmap = sns.diverging_palette(50, 10, as_cmap=True)\n\n # Draw the heat map with the mask and correct aspect ratio\n sns.heatmap(df_to_plot,\n ...
[ "0.6828943", "0.67445254", "0.6637914", "0.6619798", "0.65957004", "0.6593485", "0.64882815", "0.64739066", "0.64739066", "0.64646447", "0.6400666", "0.638765", "0.63753533", "0.63726336", "0.6371619", "0.6360415", "0.63224274", "0.63086444", "0.6300981", "0.6300981", "0.6289...
0.0
-1
make a LaTeX multiline text bold in matplotlib
def latexboldmultiline(text): return '\n'.join([r'{\bf %s}' % line for line in text.split()])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_formatting(self,fam='serif',fam_font='Computer Modern Roman',font_size=14,tick_size=14):\n\t\t\"\"\"like, if you want bold text or not.\t\t\t\t\t\t\t\t \"\"\"\n\t\n\t\tplt.rc('text',usetex=True)\n\t\taxis_font={'family': fam,'serif':[fam_font],'size':font_size}\n\t\tplt.rc('font',**axis_font)\n\t\tplt.rc...
[ "0.66870797", "0.6488609", "0.61785024", "0.61259305", "0.6086314", "0.6063681", "0.6061988", "0.605338", "0.605338", "0.5965966", "0.59432095", "0.5890951", "0.588158", "0.58688694", "0.5780316", "0.57744294", "0.5770649", "0.57321393", "0.57255304", "0.5711248", "0.5696202"...
0.76215917
0
Removes all periods before the '@' and changes to all lowercase to get unique email address
def fix_email(email): email = email.lower() # Only remove before '@', or everywhere if there is no '@' idx = email.index('@') if '@' in email else len(email) return email[:idx].replace('.', '') + email[idx:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_email(email):\n email_part = email.split('@')\n domain = email_part[1].lower()\n email = email_part[0]+'@'+domain\n return email", "def normalize_email(cls, email):\n email = email or \"\"\n try:\n email_name, domain_part = email.strip().rsplit(\...
[ "0.8273756", "0.8046925", "0.80073524", "0.7922966", "0.7830592", "0.7707495", "0.73935795", "0.7391432", "0.72607476", "0.7210595", "0.7205964", "0.69973475", "0.69607365", "0.6867269", "0.6832445", "0.6723733", "0.6722814", "0.6712977", "0.66952777", "0.6672716", "0.6626954...
0.80960953
1
Generates the hash and salt to store in the password_hash in the database
def gen_crypt(password_hash): # Make a random salt using the verification code salt = generate_verification_code() return salt + hashlib.sha256(str.encode(password_hash + salt)).hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_password(self):\n # Note: It is needed to encode in base64 the salt, otherwise it will\n # cause an exception trying to store non utf-8 characteres\n # self.salt = base64.urlsafe_b64encode(Crypto.Random.get_random_bytes(16))\n self.salt = \"Not salty enough!\";\n hash_he...
[ "0.731245", "0.7275403", "0.7128301", "0.7046336", "0.6949822", "0.6884509", "0.68697387", "0.6859415", "0.6857898", "0.68112594", "0.67891115", "0.6786745", "0.6776947", "0.6758393", "0.6741091", "0.6727978", "0.67151344", "0.6694429", "0.6685058", "0.6670567", "0.6670567", ...
0.7285311
1
Returns true if the password matches the given password hash
def password_correct(password_hash, server_password_hash): return server_password_hash[VERIFICATION_CODE_SIZE:] == \ hashlib.sha256(str.encode(password_hash + server_password_hash[:VERIFICATION_CODE_SIZE])).hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_verify(password, password_hash):\n hashed_password = password_hash(password)\n if hashed_password == password_hash:\n return True\n return False", "def check_password(cls, *, password: str, password_hash: str) -> bool:\n salt = password_hash[: cls.algorithm_length]\n st...
[ "0.8482373", "0.8327016", "0.8210353", "0.81825846", "0.8035718", "0.8026372", "0.796486", "0.7891355", "0.78127474", "0.7807413", "0.77822906", "0.7776687", "0.77703077", "0.77539563", "0.77485895", "0.77479535", "0.77338034", "0.77338034", "0.77228236", "0.77228236", "0.772...
0.75695574
45
Nonstatic timestamp that changes based on the user's defined timezone
def timestamp(self): from util import Clock clock = Clock() return (clock.from_time(self.time) .strftime('%Y-%m-%d %H:%M:%S'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def now(self, tz=None): # real signature unknown; restored from __doc__\n pass", "def timestamp_calculator(self): \r\n\r\n current_time = datetime.now(timezone.utc)\r\n\r\n return current_time.isoformat()", "def _get_timestamp(self) -> str:\n return datetime.now(self.timezone).isofo...
[ "0.75035334", "0.7297389", "0.7283329", "0.72401476", "0.7202168", "0.7182164", "0.7129241", "0.7078193", "0.7042159", "0.7035841", "0.69759274", "0.69462883", "0.6937208", "0.69343066", "0.6917449", "0.6897425", "0.68695325", "0.68687946", "0.6864617", "0.67959684", "0.67863...
0.0
-1
Convert a time zone aware datetime to a POSIX timestamp (with fractional component.)
def to_timestamp(value): value = parse_datetime(value) return (value - epoch).total_seconds()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_timestamp(datetime):\n return time.mktime(time.strptime('%s UTC' % datetime.value, '%Y%m%dT%H:%M:%S %Z')) - time.timezone", "def py_timestamptz(data):\n dt, timezone_delta = _extract_timezone(data)\n if \".\" in dt:\n return datetime.datetime.strptime(dt, \"%Y-%m-%d %H:%M:%S.%f\") + timezo...
[ "0.7012504", "0.67938256", "0.6640565", "0.6452121", "0.63978815", "0.63767093", "0.6239259", "0.61992735", "0.61691934", "0.61675835", "0.6164961", "0.6103623", "0.6098181", "0.6092198", "0.6087752", "0.606815", "0.6052747", "0.6047611", "0.60460943", "0.6030414", "0.6030411...
0.5939166
32
Creates a string representing the date and time information provided by the given `timestamp` object.
def format_datetime(cls, timestamp): if not timestamp: raise PolyaxonDateTimeFormatterException( "timestamp must a valid string {}".format(timestamp) ) return timestamp.strftime(cls.DATETIME_FORMAT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_time_string(self, timestamp=None):\n if timestamp is None:\n timestamp = time.time()\n year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp)\n s = \"%s %3s %0d %02d:%02d:%02d %4d\" % (\n self.weekdayname[wd],\n self.monthname[month], day,\n hh, mm, ss, year...
[ "0.82437986", "0.8021403", "0.798338", "0.798338", "0.7742758", "0.76873654", "0.7517088", "0.74655735", "0.7335693", "0.7304558", "0.7302799", "0.72141606", "0.7203246", "0.71921456", "0.71921456", "0.7175624", "0.71749586", "0.71360594", "0.7131842", "0.7112541", "0.7111104...
0.7139489
17
Tries to extract a `datetime` object from the given string, expecting date information only. Raises `PolyaxonDateTimeFormatterException` if the extraction fails.
def extract_date(cls, date_str, timezone, force_tz: bool = False): if not date_str: raise PolyaxonDateTimeFormatterException( "date_str must a valid string {}.".format(date_str) ) if not timezone: raise PolyaxonDateTimeFormatterException( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_datetime(cls, datetime_str, timezone, force_tz: bool = False):\n if not datetime_str:\n raise PolyaxonDateTimeFormatterException(\"datetime_str must a valid string\")\n\n if not timezone:\n raise PolyaxonDateTimeFormatterException(\n \"timezone is requ...
[ "0.75052994", "0.7364768", "0.7264914", "0.72123456", "0.71324104", "0.7116804", "0.7059267", "0.69421834", "0.6926648", "0.6920125", "0.68627733", "0.6855819", "0.6845765", "0.68426514", "0.6840151", "0.682079", "0.6782085", "0.67763466", "0.6764949", "0.6747058", "0.671618"...
0.7007915
7
Tries to extract a `datetime` object from the given string, including time information. Raises `PolyaxonDateTimeFormatterException` if the extraction fails.
def extract_datetime(cls, datetime_str, timezone, force_tz: bool = False): if not datetime_str: raise PolyaxonDateTimeFormatterException("datetime_str must a valid string") if not timezone: raise PolyaxonDateTimeFormatterException( "timezone is required, received...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_datetime_string(input):\n result = parser.parse(input)\n return result", "def delicious_datetime(str):\n return datetime.datetime(*time.strptime(str, ISO_8601_DATETIME)[0:6])", "def parse_datetime(datetime):\n if not datetime:\n return None\n try:\n return parse(datetime)...
[ "0.7328561", "0.72677785", "0.7251663", "0.72333944", "0.7165111", "0.71545655", "0.7145946", "0.7140803", "0.70466113", "0.6998847", "0.6994901", "0.6982844", "0.69331264", "0.6929038", "0.6892252", "0.6882476", "0.68793154", "0.6839537", "0.6835664", "0.68291634", "0.682309...
0.7432874
0
Tries to extract a `datetime` object from the given string, including only hours. Raises `PolyaxonDateTimeFormatterException` if the extraction fails.
def extract_datetime_hour(cls, datetime_str, timezone, force_tz: bool = False): if not datetime_str: raise PolyaxonDateTimeFormatterException("datetime_str must a valid string") if not timezone: raise PolyaxonDateTimeFormatterException( "timezone is required, rec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delicious_datetime(str):\n return datetime.datetime(*time.strptime(str, ISO_8601_DATETIME)[0:6])", "def extract_datetime(cls, datetime_str, timezone, force_tz: bool = False):\n if not datetime_str:\n raise PolyaxonDateTimeFormatterException(\"datetime_str must a valid string\")\n\n ...
[ "0.7196038", "0.7061219", "0.6982017", "0.693457", "0.6749628", "0.6734084", "0.6701493", "0.66872734", "0.6683911", "0.6674195", "0.6647473", "0.6589579", "0.6572227", "0.6563062", "0.6513299", "0.65049815", "0.6470816", "0.6468535", "0.6453196", "0.6449263", "0.6435425", ...
0.729007
0
Convert from normalized coordinates to original image coordinates
def denormalise_box(box, image_size): box[:,0] = box[:,0] * image_size[1] box[:,1] = box[:,1] * image_size[0] box[:,2] = box[:,2] * image_size[1] box[:,3] = box[:,3] * image_size[0] return box
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def un_normalize_img_coords(cx, cy, w, h):\n cx = int((cx + 1) * w / 2)\n cy = int((cy + 1) * h / 2)\n return cx, cy", "def normalize(image):\n return image - 127", "def normalize(image):\n return image - 127", "def normalize(self):\n return _almathswig.Position2D_normalize(self)", "d...
[ "0.7129741", "0.7070566", "0.7070566", "0.68763286", "0.6847255", "0.6770011", "0.6716405", "0.6657218", "0.6656764", "0.6642853", "0.65931606", "0.6572553", "0.65659094", "0.65605164", "0.6485139", "0.64607406", "0.6441469", "0.6436043", "0.6433531", "0.64305675", "0.6407423...
0.0
-1
Return a BeautifulSoup object by downloading `url`.
def request(url, **kwargs): fields = kwargs.get('fields', {}) timeout = Timeout(connect=2.0, read=10.0) http = PoolManager(timeout=timeout) result = http.request('GET', url, fields=fields, headers=HEADERS) if result.status...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def soup_from_url(url):\n page = requests.get(url)\n return bs4.BeautifulSoup(page.text)", "def get_soup_from_url(url=BASE_URL):\n\tresponse = requests.get(url)\n\treturn BeautifulSoup(response.content, features=\"html.parser\")", "def get_soup(url):\n request = Request(url, headers={'User-Agent': USE...
[ "0.8046294", "0.80031323", "0.79197466", "0.7875856", "0.78469855", "0.77903587", "0.76575416", "0.76486224", "0.7596937", "0.749557", "0.74569887", "0.7406293", "0.7355541", "0.7312966", "0.72863966", "0.72572184", "0.7245271", "0.7242117", "0.72403055", "0.72283196", "0.722...
0.6610441
51
Number of points / nodes in the mesh
def npoint(self): return self.points.shape[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_nodes(self):\n return self.number_of_vertices()", "def num_nodes(self):\n return len(self.vertices)", "def num_nodes(self):\n return len(self.vertices.array)", "def number_of_vertices(self):\n if self.properties.node_count is None:\n self.properties.node_c...
[ "0.82863086", "0.8279626", "0.82433695", "0.7813126", "0.7697921", "0.7667612", "0.76644236", "0.7588518", "0.75830704", "0.75771517", "0.75728804", "0.7563244", "0.75323653", "0.7506133", "0.7488791", "0.7479225", "0.7469638", "0.74285835", "0.7422198", "0.7418111", "0.74017...
0.6617471
91
Replaces self.current_item with the next in the series, and returns it thereafter.
def next_item(self) -> Any: self.current_item = self._cycle_dict[self.current_item] return self.current_item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __next__(self):\n\t\ttry:\n\n\t\t\tcurrent = self.items[self.index]\n\t\t\tself.index += 1\n\t\t\treturn current\n\t\texcept:\n\t\t\traise StopIteration()", "def next(self):\n try:\n value = self.frames[self.current_item]\n except IndexError:\n raise StopIteration\n ...
[ "0.66679287", "0.6492445", "0.64472246", "0.6402532", "0.6216288", "0.6204363", "0.617291", "0.61516196", "0.6140389", "0.6110977", "0.61076367", "0.6107602", "0.6106131", "0.6094654", "0.6078015", "0.6071823", "0.6059432", "0.60217327", "0.6013355", "0.6008146", "0.60047156"...
0.7305294
0
Given a start point, initial bearing, and distance, calculate the destination point along a (shortest distance) great circle arc using the same formula as GNOME. lat and lon are in decimal degrees. bearing, also in decimal degrees, is measured clockwise from north. distance is in meters.
def reckon_GNOMEstyle( lat, lon, distance, bearing, ): EarthRadius = 6371. * 1000. # Earth's mean radius, in m. # Convert from degrees to radians. lat = np.deg2rad(lat) lon = np.deg2rad(lon) bearing = np.deg2rad(bearing) # Convert linear distance to angular distance (in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_on_great_circle(start_point, direction, distance):\n start_xyz = geodesy.conversions.lla_to_xyz(start_point)\n direction = geometry.conversions.to_unit_vector(direction)\n delta_xyz = geodesy.conversions.ned_to_xyz(\n direction, numpy.array(start_point, ndmin=2))\n\n rotation_axis =...
[ "0.69068336", "0.67691207", "0.6648388", "0.64668244", "0.63812596", "0.6361396", "0.63476175", "0.6326729", "0.62959707", "0.6241269", "0.6101691", "0.6045097", "0.6020267", "0.6016687", "0.5998949", "0.59773433", "0.5963903", "0.59496087", "0.59438455", "0.5924934", "0.5902...
0.60442317
12
Merge two sorted lists. Returns a new sorted list containing all of the elements that are in either list1 and list2. This function can be iterative.
def merge(list1, list2): copy_list1 = list(list1) copy_list2 = list(list2) merge_list = [] while len(copy_list1)>0 and len(copy_list2)>0: if copy_list1[0] < copy_list2[0]: merge_list.append(copy_list1[0]) copy_list1.pop(0) else: merge_list.append(copy_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge(list1, list2): \n merge_list = []\n _ind1 = _ind2 = 0\n while _ind1 < len(list1) and _ind2 < len(list2) :\n if list1[_ind1] < list2[_ind2]:\n merge_list.append(list1[_ind1])\n _ind1 += 1\n else:\n merge_list.append(list2[_ind2])\n _ind2...
[ "0.84007674", "0.81886697", "0.80378366", "0.8029078", "0.80263525", "0.79886216", "0.7969406", "0.78856474", "0.7839694", "0.78390676", "0.77887726", "0.7781034", "0.7725013", "0.7674213", "0.7644619", "0.7604539", "0.75903517", "0.75364786", "0.7517239", "0.75109893", "0.74...
0.7887341
7
Sort the elements of list1. Return a new sorted list with the same elements as list1. This function should be recursive.
def merge_sort(list1): if len(list1) == 0: return [] if len(list1) == 1: return list1 else: length = len(list1) half = length / 2 half1_sorted = merge_sort(list1[:half]) half2_sorted = merge_sort(list1[half:]) #print half1_sorted, half2_sorted ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_sort(list1): \n if len(list1) <= 1: # base case\n return list1\n length = len(list1) / 2\n new_list1 = list(list1[:length])\n new_list2 = list(list1[length:])\n sorted_new_list1 = merge_sort(new_list1)\n sorted_new_list2 = merge_sort(new_list2)\n return merge(sorted_new_lis...
[ "0.75821227", "0.7575528", "0.7231825", "0.72298104", "0.70658964", "0.7042686", "0.70247453", "0.7021579", "0.6881011", "0.6853012", "0.6843797", "0.6775013", "0.67070514", "0.6677912", "0.65802056", "0.656611", "0.6559866", "0.65572", "0.65555125", "0.64441574", "0.6441799"...
0.6798664
11
Returns a dict mapping of configurations for all environments. These keys correspond to static values, CloudFormation outputs, and Secrets Manager (passwords only) records.
def get_all_configurations() -> dict: return { DEPLOYMENT: { ENVIRONMENT: DEPLOYMENT, GITHUB_TOKEN: '/DataLake/GitHubToken', **get_local_configuration(DEPLOYMENT), }, DEV: get_environment_configuration(DEV), TEST: get_environment_configuration(TEST...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_configurations():\n return sorted([e.id for e in gym.envs.registry.all()])", "def configs(self) -> Sequence['outputs.GetEnvironmentConfigResult']:\n return pulumi.get(self, \"configs\")", "def get_configs(self):\n configs = {}\n for name, wd in self.working_dirs.items(...
[ "0.6997317", "0.69413126", "0.6617569", "0.6614992", "0.6600736", "0.6559342", "0.6538835", "0.64468825", "0.64221966", "0.6332693", "0.62343836", "0.6190785", "0.618228", "0.6122918", "0.6093159", "0.6090641", "0.6087408", "0.6054713", "0.604788", "0.60431397", "0.6036573", ...
0.7821981
0
Add a node at the front of the linked list
def pushFront(self, key) -> None: node = LLNode(key, self.head) self.head = node if self.tail == None: # if list was previously empty self.tail = node self.len += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_front(self,new_data):\n temp = SLLNode(new_data)\n temp.next = self.head \n self.head = temp", "def addFront(self,data):\n newNode = Node(data)\n newNode.next_node = self.head\n self.head = newNode", "def pushToFront(self, node):\n self.head.insertBefore...
[ "0.8245618", "0.82242686", "0.789469", "0.77757543", "0.77039814", "0.76164174", "0.7591575", "0.7509623", "0.7488055", "0.7466601", "0.7455729", "0.7427976", "0.7412148", "0.74084723", "0.73895866", "0.73789865", "0.73661405", "0.7344487", "0.73411965", "0.7337702", "0.73370...
0.757909
7
Add a node at the end of the linked list
def pushBack(self, key) -> None: node = LLNode(key) if self.isEmpty(): # if empty self.head = node self.tail = node else: self.tail.next = node self.tail = node self.len += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_last(self, node):\n if self.head is None:\n self.head = node\n return\n for current_node in self:\n pass\n current_node.next = node", "def append_in_end(self, data):\n node = Node(data)\n if self.head is None:\n self.head = no...
[ "0.8330799", "0.79077154", "0.78753626", "0.7750594", "0.7611637", "0.754291", "0.75286156", "0.7492905", "0.74620473", "0.7461289", "0.7460838", "0.7458136", "0.7445159", "0.74304676", "0.7401985", "0.73920673", "0.736467", "0.736467", "0.73626804", "0.73590994", "0.73342085...
0.0
-1
Add a node at the front of the doubly linked list
def pushFront(self, key) -> None: node = DLLNode(key, None, self.head) if self.head: # if list was not previously empty self.head.prev = node self.head = node if self.tail == None: # if list was previously empty self.tail = node self.len += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addFront(self,data):\n newNode = Node(data)\n newNode.next_node = self.head\n self.head = newNode", "def add_front(self,new_data):\n temp = SLLNode(new_data)\n temp.next = self.head \n self.head = temp", "def pushfront(lst, node):\n assert type(node) == type(lst...
[ "0.8014939", "0.7946289", "0.77410656", "0.7688781", "0.74091655", "0.7356233", "0.7335036", "0.7310499", "0.7279645", "0.72723186", "0.72675186", "0.7252464", "0.72040325", "0.71683526", "0.71523684", "0.7145031", "0.7142346", "0.7137309", "0.71314526", "0.71229273", "0.7121...
0.74843246
4
Add a node at the end of the doubly linked list
def pushBack(self, key) -> None: node = DLLNode(key) if self.isEmpty(): # if empty self.head = node self.tail = node else: self.tail.next = node node.prev = self.tail self.tail = node self.len += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_last(self, node):\n if self.head is None:\n self.head = node\n return\n for current_node in self:\n pass\n current_node.next = node", "def append_in_end(self, data):\n node = Node(data)\n if self.head is None:\n self.head = no...
[ "0.7901653", "0.7623876", "0.7603233", "0.75609285", "0.75281256", "0.7527013", "0.74293625", "0.7395261", "0.7361775", "0.73607004", "0.7233522", "0.7215266", "0.7201416", "0.7176648", "0.7173244", "0.71669173", "0.715723", "0.71536386", "0.7136522", "0.7136522", "0.71346086...
0.0
-1
Returns the dict as a model
def from_dict(cls, dikt) -> 'OrgApacheSlingI18nImplJcrResourceBundleProviderProperties': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73129255", "0.7228769", "0.6894892", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.6774813", "0.67373973", "0.6700414", "0.6700414", "0.6700414", "0.66989803", "0.6652754", "0.66460764",...
0.0
-1
Gets the locale_default of this OrgApacheSlingI18nImplJcrResourceBundleProviderProperties.
def locale_default(self) -> ConfigNodePropertyString: return self._locale_default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_locale():\n return app.config['BABEL_DEFAULT_LOCALE']", "def locale_default(self, locale_default: ConfigNodePropertyString):\n\n self._locale_default = locale_default", "def get_default_language(self):\n if not hasattr(self, \"_default_language\"):\n self._default_langua...
[ "0.6575314", "0.6573614", "0.651607", "0.64598125", "0.64114505", "0.63746053", "0.63746053", "0.6275921", "0.61593634", "0.610573", "0.6033745", "0.6020818", "0.60064775", "0.60064775", "0.5945668", "0.5880754", "0.5868139", "0.5868139", "0.5856583", "0.5832186", "0.5815949"...
0.7796896
0
Sets the locale_default of this OrgApacheSlingI18nImplJcrResourceBundleProviderProperties.
def locale_default(self, locale_default: ConfigNodePropertyString): self._locale_default = locale_default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_locale_codes(self, default_locale_codes):\n\n self._default_locale_codes = default_locale_codes", "def locale_default(self) -> ConfigNodePropertyString:\n return self._locale_default", "def set_default_locale(code):\r\n global _default_locale\r\n global _supported_locales\r\n ...
[ "0.65133584", "0.647708", "0.5719745", "0.5719745", "0.55220443", "0.5471349", "0.54059607", "0.5350308", "0.5151711", "0.51427364", "0.51427364", "0.5139901", "0.5125244", "0.5120448", "0.50683147", "0.5009879", "0.49388066", "0.49214813", "0.47888395", "0.47726464", "0.4766...
0.75497216
0
Gets the invalidation_delay of this OrgApacheSlingI18nImplJcrResourceBundleProviderProperties.
def invalidation_delay(self) -> ConfigNodePropertyInteger: return self._invalidation_delay
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retry_delay_sec(self):\n return self._retry_delay_sec", "def invalidation_delay(self, invalidation_delay: ConfigNodePropertyInteger):\n\n self._invalidation_delay = invalidation_delay", "def get_delay(self):\n return self._delay", "def get_cqrs_retry_delay(current_retry):\n re...
[ "0.63166326", "0.6275723", "0.62045753", "0.61872154", "0.60964936", "0.57816344", "0.57816344", "0.57628113", "0.576216", "0.5755539", "0.57401425", "0.5689008", "0.56173295", "0.56173295", "0.5521598", "0.55086476", "0.54611975", "0.54567873", "0.542927", "0.54094505", "0.5...
0.7656261
0
Render the home page where visitors can feed Moby Dock.
def index(): # check if "feed" is an argument on the request if request.args.get('feed'): # grabbing a random message random_message = db.session.query(Feedback).order_by(func.random()).limit(1).scalar().message feed_count = redis_store.incr('feed_count') else: # feeding the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_home():\n return render_template(\"home.html\", stories=stories)", "def show_homepage():\n return render_template('home.html')", "def show_homepage():\r\n\r\n return render_template(\"homepage.html\")", "def display_homepage():\n return render_template(\"toolbar_template.html\", on_home=...
[ "0.765587", "0.760933", "0.75781906", "0.7464141", "0.7443559", "0.739825", "0.7382182", "0.7334935", "0.73297465", "0.73165816", "0.7295139", "0.7291813", "0.7279723", "0.72105944", "0.7188337", "0.7188337", "0.7187303", "0.71867704", "0.71839213", "0.7175229", "0.7172939", ...
0.0
-1
Check if current user has Administration role
def is_admin(self, user: User) -> bool: return self.verify_roles(user, [Role.ADMIN], warnings=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin(self):\n if self.role.value == \"admin\":\n return True\n return False", "def is_admin(self):\n # Temporarily comment out before the 'and' if you need to manually create the first admin\n return current_user.is_authenticated() and current_user.has_role('Admin')...
[ "0.7982827", "0.7729777", "0.7661473", "0.7647481", "0.7591508", "0.7565002", "0.7558788", "0.7518448", "0.7506781", "0.75026596", "0.7459557", "0.73993284", "0.7374272", "0.7372313", "0.7367539", "0.7362236", "0.7357434", "0.7339879", "0.7323841", "0.7303978", "0.7295143", ...
0.69068456
44
Application loop just consists of alternating paint and config modes. Each function has its own condition for return (switching to the opposite mode). Repeat forever.
def run(self): while True: self.paint() self.config_select()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\n # First make sure we dont have reset pressed from before\n while True:\n if self.dashboard.reset.off():\n break\n\n # Begin the main loop\n while True:\n # First, check the reset button\n if self.dashboard.reset.on():\n ...
[ "0.7046022", "0.6867728", "0.6684376", "0.6377302", "0.63607454", "0.62088466", "0.6202557", "0.61518294", "0.6131307", "0.61312747", "0.61048657", "0.6080839", "0.60668385", "0.60426366", "0.603869", "0.60162205", "0.60010725", "0.59743094", "0.5966257", "0.59616876", "0.596...
0.72425574
0
Backward pass (i.e., compute gradient).
def backward(self, dout): db = dout dw = np.dot(self.x.T, dout) dx = np.dot(dout, self.params['weight'].T) self.grads['weight'] = dw self.grads['bias'] = db self.sum_grads['weight'] += self.grads['weight'] self.sum_grads['bias'] += self.grads['bias'] r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_backward(self, loss):\n raise NotImplementedError", "def backward_pass(self, accum_grad):\n raise NotImplementedError()", "def _compute_gradient(\n self,\n loss: TensorType,\n parameters: List[ParameterType],\n step: int,\n component_names: List[str],\n...
[ "0.8105472", "0.8017144", "0.78609335", "0.78548276", "0.7824603", "0.7824446", "0.7798457", "0.7736055", "0.7681731", "0.7632832", "0.76205415", "0.7615327", "0.7590119", "0.7586665", "0.7586455", "0.7516054", "0.74634176", "0.7461905", "0.74530977", "0.74486667", "0.7447858...
0.73401016
33
Move the screen cursor to the up
def cursorUp(amount): print(ESC + f"[{amount}A")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_up(self):\n self.y -= MOVE_BY_PIXELS", "def move_up(self):\n self.move_to_position(self.position - 1)", "def cursorscrollup(self):\n self._command(\"M\")", "def cursor_up(self, count=None):\r\n self.cursor.y -= count or 1\r\n self.ensure_bounds(use_margins=True)", ...
[ "0.79879004", "0.7960751", "0.79416823", "0.78808045", "0.7878802", "0.76337314", "0.7617187", "0.7452181", "0.7446584", "0.74338055", "0.7372263", "0.73388445", "0.7309511", "0.7308151", "0.7302066", "0.72837543", "0.72532797", "0.72183716", "0.72087413", "0.72041935", "0.71...
0.6810952
40
Move the screen cursor to the down
def cursorDown(amount): print(ESC + f"[{amount}B")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_down(self):\r\n if self.ycor() >= -240:\r\n self.back(20)", "def move_down(self):\n self.y += MOVE_BY_PIXELS", "def move_down(self):\n self.move_to_position(self.position + 1)", "def move_down(self):\n pass", "def move_down(self):\n\n self.head_move.x ...
[ "0.78891796", "0.78500646", "0.77251047", "0.7723584", "0.7504622", "0.74693745", "0.74575496", "0.7434447", "0.7400841", "0.735301", "0.7273662", "0.71785283", "0.71531254", "0.7039987", "0.7039837", "0.70189774", "0.70082504", "0.699562", "0.6973619", "0.69535375", "0.69393...
0.6698159
39
Move the screen cursor to the right
def cursorRight(amount): print(ESC + f"[{amount}C")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_right(self):\n self.cursor.right(90)\n self.update_trace()", "def moveCursorRight(self):\r\n self.SendScintilla(QsciScintilla.SCI_CHARRIGHT)", "def go_right(self):\n self.change_x = 6\n self.status = 'move_r'", "def right(self):\r\n self.set_position(2, self...
[ "0.85666996", "0.8529716", "0.78281987", "0.7804418", "0.7745847", "0.7609317", "0.7609317", "0.7609317", "0.7561588", "0.7553186", "0.7553186", "0.7449416", "0.736908", "0.73512566", "0.7287087", "0.726285", "0.7256039", "0.7245791", "0.7206464", "0.7202843", "0.7184114", ...
0.74403167
12
Send a fast preflight request to test the upload. This is a shortcut for calling `upload_image` with ``preflight=True``.
def preflight_image(self, image_file, **kwargs): return self.upload_image(image_file, **kwargs, preflight=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_image(self, image_file, *,\n file_name=None, segmentation=False, preflight=False):\n if preflight:\n image_data = image_file.read(PREFLIGHT_DATA_LENGTH)\n else:\n image_data = image_file\n\n if file_name is None:\n file_name = os....
[ "0.6117184", "0.58303386", "0.5758648", "0.56173825", "0.5546902", "0.5448055", "0.54390097", "0.537447", "0.53727317", "0.5269151", "0.52046037", "0.5116812", "0.5103087", "0.50784564", "0.5067867", "0.5041155", "0.5017553", "0.500973", "0.5004735", "0.50021726", "0.5000475"...
0.6601407
0
Setter for the club name
def set_user_name(self, new_name): self.__name = new_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\r\n self._name = name.strip()", "def set_name(self,new_name):\r\n self.__name=new_name", "def set_teamname(self, new_name):\n self.teamname = new_name", "def _set_name(self, new_name):\n self._name = new_name", "def name(self, newVal):\n self._na...
[ "0.70988744", "0.7036982", "0.7032675", "0.70072275", "0.6964903", "0.69522154", "0.69335425", "0.6881991", "0.6881991", "0.6881991", "0.6881991", "0.6881991", "0.68678683", "0.6859134", "0.67693925", "0.67558473", "0.6745091", "0.67341095", "0.6691633", "0.66801804", "0.6670...
0.6403466
59
Test overlap filter on a array field of string.
def test_array_field_overlap_multiple(schema): query = """ query { events (tags_Overlap: ["concert", "music"]) { edges { node { name } } } } """ result = schema.execute(query) assert not result.errors ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_array_field_overlap_one(schema):\n\n query = \"\"\"\n query {\n events (tags_Overlap: [\"music\"]) {\n edges {\n node {\n name\n }\n }\n }\n }\n \"\"\"\n result = schema.execute(query)\n assert not resul...
[ "0.66927975", "0.63308847", "0.5966935", "0.57039416", "0.56745565", "0.54746574", "0.5428648", "0.5326355", "0.5301086", "0.5278818", "0.52757984", "0.52661395", "0.5252755", "0.5247932", "0.5233226", "0.5227937", "0.5202571", "0.5195346", "0.5190731", "0.51677835", "0.51665...
0.6817819
0
Test overlap filter on a array field of string.
def test_array_field_overlap_one(schema): query = """ query { events (tags_Overlap: ["music"]) { edges { node { name } } } } """ result = schema.execute(query) assert not result.errors assert result....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_array_field_overlap_multiple(schema):\n\n query = \"\"\"\n query {\n events (tags_Overlap: [\"concert\", \"music\"]) {\n edges {\n node {\n name\n }\n }\n }\n }\n \"\"\"\n result = schema.execute(query)\n ...
[ "0.68168086", "0.633062", "0.59663963", "0.5702449", "0.56739324", "0.5472824", "0.5426868", "0.5324362", "0.5299955", "0.5278403", "0.52747", "0.526596", "0.52523625", "0.52472425", "0.5232642", "0.5227641", "0.52024496", "0.51938206", "0.5190359", "0.5166382", "0.5166294", ...
0.6692068
1
Test overlap filter on a array field of string.
def test_array_field_overlap_empty_list(schema): query = """ query { events (tags_Overlap: []) { edges { node { name } } } } """ result = schema.execute(query) assert not result.errors assert result....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_array_field_overlap_multiple(schema):\n\n query = \"\"\"\n query {\n events (tags_Overlap: [\"concert\", \"music\"]) {\n edges {\n node {\n name\n }\n }\n }\n }\n \"\"\"\n result = schema.execute(query)\n ...
[ "0.68161017", "0.66907126", "0.59666276", "0.570372", "0.56740606", "0.5473892", "0.5427842", "0.5325847", "0.53016895", "0.52784914", "0.5274862", "0.5266034", "0.5253281", "0.5248518", "0.5232839", "0.5228755", "0.52016884", "0.519588", "0.5191313", "0.51674634", "0.5166690...
0.63292885
2
The column in the main data to work with. This function is the part of training process.
def _get_topic_extractor_data(self): return self.data[self.topic_extract_col]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_col(self):\n return self.__col", "def get_col(self):\n return self.__col", "def get_column(self, col_num):\r\n return self.chunk[:, col_num]", "def col(self):\n return self._col", "def column(self):\n return self._column", "def column(self):\n return ...
[ "0.69711095", "0.6909932", "0.6900582", "0.68019253", "0.67913914", "0.664777", "0.6594219", "0.6588864", "0.6478645", "0.64531076", "0.6397358", "0.6351882", "0.6315105", "0.6209758", "0.61754", "0.6168403", "0.6108778", "0.60942805", "0.6087486", "0.6071519", "0.6062087", ...
0.5713272
49
Returns True is string is a number.
def is_number(s): try: float(s) return True except ValueError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(string):\n\n try:\n float(string)\n is_num = True\n except ValueError:\n is_num = False\n\n return is_num", "def is_number(string):\n\tstring = string.strip()\n\ttry:\n\t\tfloat(string[0])\n\t\treturn True\n\texcept ValueError:\n\t\treturn False", "def _isnumber(str...
[ "0.8829205", "0.8633826", "0.86303985", "0.86303985", "0.86080456", "0.85907716", "0.8583435", "0.85775715", "0.8561529", "0.8530116", "0.85079587", "0.85026324", "0.8460913", "0.84534436", "0.8394571", "0.83240926", "0.8253416", "0.8247111", "0.8243984", "0.8073315", "0.8029...
0.8597067
9
We're logged in but present a bogus token.
def test_bad_token(self): create_and_login() for method in (self.client.get, self.client.post): response = \ method(SEARCH_URL, HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % BAD_TOKEN) self.assertContains(response, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_token_missing_data(self):\n samples.sample_user('test@email.com', 'te$tpwd1')\n data = {'email': 'test@email.com', 'password': ''}\n response = self.client.post(LOGIN_URL, data)\n # asserts\n self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)\n se...
[ "0.75192994", "0.7459679", "0.742013", "0.729367", "0.7188508", "0.7111593", "0.70400006", "0.6931287", "0.6904473", "0.6853135", "0.67356527", "0.6688241", "0.66463727", "0.6630853", "0.6621945", "0.66119266", "0.6605481", "0.66047263", "0.6594821", "0.65653414", "0.65546256...
0.0
-1
We're logged in as a normal user. This test should pass. Because of how DRF works, we only need to test one call (GET) to verify that everything is hooked up correctly.
def test_normal(self): # Create a normal user and get the authorization token. token = create_and_login() response = \ self.client.get(SEARCH_URL, HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token) # pylint: disable=E1101 self.assertEqual...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_regular_user(self):\n with self.login(self.reg_user):\n response = self.client.get(\n reverse('projectroles:ajax_user_current')\n )\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.data, self.get_serialized_user(self.reg_us...
[ "0.78694", "0.77105796", "0.76596844", "0.76522976", "0.7631665", "0.75822127", "0.7542135", "0.7520075", "0.7488629", "0.747223", "0.74574023", "0.7405245", "0.73484594", "0.7333486", "0.73292613", "0.7314432", "0.7314432", "0.7314432", "0.730781", "0.72550964", "0.72534716"...
0.75005144
8
Calculate the thermal field double Hamiltonian expectation value.
def calc_tfd_hamiltonian(pauli_terms: dict, g: float = 1, T=1): H_A = 1.57*pauli_terms['ZZII'] + g*pauli_terms['XIII'] + g*pauli_terms['IXII'] H_B = 1.57*pauli_terms['IIZZ'] + g*pauli_terms['IIXI'] + g*pauli_terms['IIIX'] H_AB = pauli_terms['ZIZI'] + pauli_terms['IZIZ'] + \ pauli_terms['XIXI'] + pau...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcThermExp(self):\n T,dT,V,dV,dVdT,ddVdT,midT = self.getForwDif(\"Temp\",\"Volume\")\n N = len(midT)\n tE = [dVdT[i]/V[i] for i in range(len(dVdT))]\n dtE = [abs(tE[i])*np.sqrt((ddVdT[i]/dVdT[i])**2 + (dV[i]/V[i])**2) for i in range(len(tE))]\n return tE,dtE,T[:-1],dT[:-1]"...
[ "0.6182277", "0.6168221", "0.60424596", "0.5821505", "0.5773272", "0.5736933", "0.57177466", "0.57035905", "0.5702255", "0.56963444", "0.56869537", "0.567247", "0.56539696", "0.5653549", "0.56501305", "0.56208557", "0.5617025", "0.5614957", "0.5610231", "0.56086063", "0.55835...
0.0
-1
Returns list of str identifiers for all the reports in this report manager
def report_keys(self): return list(self._data.keys())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_reports():\n return _ensure_list(request('report/list')['reports']['report'])", "def list(self):\n results = [cls.as_string() for name, cls in self.reports.items()]\n return results", "def identifiers(self) -> List[str]:\n return [\"id\"]", "def get_node_names(self):\n ...
[ "0.6881867", "0.64997214", "0.6247129", "0.617482", "0.60078084", "0.59790254", "0.5963396", "0.59596366", "0.59325343", "0.5898226", "0.58797884", "0.5876094", "0.5823753", "0.5819364", "0.5819364", "0.5819364", "0.5819364", "0.5819364", "0.5819364", "0.57831526", "0.5782383...
0.5694798
24
Loads data for the specified city and filters by month and day from the bikeshare data
def load_data(city,month,day): df = pd.read_csv(CITY_DATA[city]) df['Start Time'] = pd.to_datetime(df['Start Time']) #converts into standard time df['month'] = df['Start Time'].dt.month df['day_of_week'] = df['Start Time'].dt.weekday_name if month != 'all': #if choice not none ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA[city])\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n\n # month filter\n df['Month'] = df['Start Time'].dt.month_name()\n if month != 'all':\n df = df[df['Month'] == month.title()]\n\n # day of week filter\n df['Week...
[ "0.81466424", "0.81275445", "0.8117404", "0.81042916", "0.8101893", "0.80855083", "0.8066673", "0.8062103", "0.80397695", "0.802282", "0.8011881", "0.7965326", "0.7948484", "0.7947133", "0.7938663", "0.79116696", "0.7908146", "0.7906163", "0.7905613", "0.7899026", "0.7894681"...
0.7690304
72
Getter for dut resource id.
def resource_id(self): if self.dutinformation: return self.dutinformation.resource_id return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_id(self) -> str:\n return pulumi.get(self, \"resource_id\")", "def resource_id(self) -> str:\n return pulumi.get(self, \"resource_id\")", "def resource_id(self) -> str:\n return pulumi.get(self, \"resource_id\")", "def resource_id(self) -> str:\n return pulumi.get(sel...
[ "0.7651376", "0.7651376", "0.7651376", "0.7651376", "0.7651376", "0.7635889", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "0.7437072", "...
0.8254645
0
Getter for build information.
def build(self): if self.dutinformation: return self.dutinformation.build return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_details(self) -> str:\n return self._data['build_info']", "def build_info_get():\n try:\n filename = os.path.join(\n os.path.dirname(__file__), 'resource', 'buildInfo.json')\n with open(filename) as f:\n config = json.load(f)\n build_info = Build...
[ "0.8238768", "0.7750852", "0.7631875", "0.7290321", "0.71604484", "0.71170866", "0.6976935", "0.6937237", "0.6879746", "0.6844128", "0.6797977", "0.67914397", "0.67709744", "0.67096764", "0.6594065", "0.6574736", "0.65599906", "0.65157115", "0.65052664", "0.6469419", "0.63850...
0.6270963
21
Set time function to be used.
def set_time_function(self, function): if isinstance(function, types.FunctionType): self.get_time = function else: raise ValueError("Invalid value for DUT time function")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_time(self, time):\n pass", "def set_time(self, time):\n self._set_time(time, True)", "def set_time(self, value):\n self.print_time = value", "def set_time(self, time):\n self.__time = time", "def set_time(self, time):\n self.game_inst.set_time(time)", "def set_t...
[ "0.7755372", "0.7222357", "0.71257305", "0.70807475", "0.706426", "0.6865946", "0.6845234", "0.6744268", "0.67438686", "0.6707116", "0.66789484", "0.6661396", "0.661891", "0.65320355", "0.6477042", "0.6475735", "0.6475735", "0.6475735", "0.6475735", "0.6475735", "0.6475735", ...
0.8503352
0
The id of the group.
def id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self):\n return self._group_id", "def group_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"group_id\")", "def gro...
[ "0.8965468", "0.8965468", "0.8874665", "0.84502476", "0.8435923", "0.83896005", "0.83794165", "0.82724136", "0.81854856", "0.81854856", "0.81854856", "0.7873748", "0.78646845", "0.7850168", "0.7846704", "0.78458166", "0.78013647", "0.7763642", "0.7591224", "0.75842774", "0.75...
0.0
-1
Mired color temperature of the light. (2000K 6500K)
def ct(self): return self._ct
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_temp(self):\n temp_in_k = int(\n EUFYHOME_MIN_KELVIN\n + (self._temp * (EUFYHOME_MAX_KELVIN - EUFYHOME_MIN_KELVIN) / 100)\n )\n return kelvin_to_mired(temp_in_k)", "def color_temp(self):\n if not self._device.color_temp:\n return None\n ...
[ "0.8359171", "0.8356628", "0.83085513", "0.807789", "0.80225927", "0.7831146", "0.7711825", "0.72471404", "0.7175957", "0.70779324", "0.70551854", "0.70551854", "0.70551854", "0.69878983", "0.6920018", "0.6905834", "0.6871627", "0.686779", "0.6834334", "0.6802971", "0.6763081...
0.0
-1
Test if we get the same json string back if we enter a ndarray
def test_ndarray_equal(self): self.assertEqual(self.restored_json_ndarray.tolist(), self.decompressed_ndarray.tolist(), msg="ndarray is not decompressed properly")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_array(obj):\r\n return isinstance(obj, np.ndarray)", "def is_jsonable(obj):\n try:\n json.dumps(obj,cls=NumpyEncoder)\n return True\n except:\n return False", "def test_json_string(self):\n a = Base.to_json_string([])\n self.assertEqual(a, \"[]\")\n a ...
[ "0.67202026", "0.6597804", "0.6414195", "0.6344398", "0.63022906", "0.6277534", "0.6245435", "0.62449133", "0.6176561", "0.6168625", "0.61047214", "0.6062099", "0.60337716", "0.593704", "0.5931298", "0.5909435", "0.5886341", "0.5858802", "0.58515924", "0.5782562", "0.57763124...
0.69520724
0
prime_decomposition. Calculates the primes decomposition powers and sums them to get the number of divisors that `n` has. The sum of the powers minus for each prime plus the num of prime factors will be the amount of divisors. Arguments
def prime_decomposition(n: int) -> int: prime_factors = set() powers = 1 aux = n for prime in primes: current_pow = 1 residual = aux % prime if residual == 0: prime_factors.add(prime) while residual == 0: aux = aux // prime residual = a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prime_decomposition(n): \r\n step = lambda x: 1 + (x << 2) - ((x >> 1) << 1)\r\n maxq = int(sqrt(n)) + 1\r\n d = 1\r\n q = n % 2 == 0 and 2 or 3 \r\n while q <= maxq and n % q != 0:\r\n q = step(d)\r\n d += 1\r\n return q <= maxq and [q] + prime_decomposition(n // q) or [n]", ...
[ "0.77302825", "0.76683265", "0.7515015", "0.7154876", "0.7041091", "0.7025516", "0.699783", "0.68704844", "0.68129486", "0.6753536", "0.6699756", "0.6695736", "0.6693411", "0.66592056", "0.6653814", "0.66256833", "0.65886945", "0.65863186", "0.6556211", "0.65514255", "0.65370...
0.81746566
0
Return a Selection instance for a D+ > D0 pi+ decay.
def makeDstar2D0Pi(self, name, inputSel, decDescriptors): combCuts = '((AM - AM1) < {0[Dstar_AMDiff_MAX]})'.format(self.config) dstarCuts = '(VFASPF(VCHI2/VDOF) < {0[Dstar_VCHI2VDOF_MAX]})'.format( self.config ) _Dstar = CombineParticles( name='Combine{0}'.forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeDstar2D0Pi0(self, name, inputSel, decDescriptors):\n combCuts = '((AM - AM1) < {0[Dstar_AMDiff_MAX]})'.format(self.config)\n\n dstarCuts = '(ALL)'.format(self.config)\n\n _Dstar = CombineParticles(\n name='Combine{0}'.format(name),\n DecayDescriptors=decDescriptor...
[ "0.5402862", "0.53733903", "0.52867144", "0.5100665", "0.50469166", "0.49896362", "0.4881455", "0.48131803", "0.47954223", "0.475162", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456", "0.4635456"...
0.5547185
0
Rotate the image of the sprite around its center.
def rotate(self): self.image = pygame.transform.rotozoom(self.orig_image, self.angle, 1) self.image.set_colorkey((0,0,0)) # Create a new rect with the center of the old rect. self.rect = self.image.get_rect(center=self.rect.center)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotateCenter(image, angle):\n loc = image.get_rect().center #rot_image is not defined\n rot_sprite = pygame.transform.rotate(image, angle)\n rot_sprite.get_rect().center = loc\n return rot_sprite", "def rotate(self):\n\t\tlast_center = self.rect.center\n\t\tself.image = pg.transform.rotate(self....
[ "0.80937165", "0.7626241", "0.7490655", "0.73569757", "0.7323381", "0.7323381", "0.73138416", "0.7264708", "0.72449183", "0.72444874", "0.7234317", "0.7184873", "0.7151269", "0.7151269", "0.712557", "0.712557", "0.7108491", "0.70718837", "0.70188826", "0.691946", "0.68779474"...
0.7390857
3
get the index of the device speicified by name
def get_device_index(name): dev_list = get_device_list() for i in range(0, len(dev_list)): if name == dev_list[i]["name"]: return i raise DRTError("Name: %s is not a known type of devices" % name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_device_indexes(device_name):\n sys = System()\n ids = sys.device_ids()\n indexes = []\n for item in ids:\n if item['name'] == device_name:\n indexes.append(item['index'])\n if 0 in indexes:\n indexes.append(None)\n return indexes", "def get_index(self, name):\n...
[ "0.71184313", "0.7048659", "0.6973172", "0.69387406", "0.6847957", "0.6670318", "0.65525925", "0.6485203", "0.64524907", "0.642821", "0.64215624", "0.63326573", "0.6329299", "0.629399", "0.6265628", "0.6259731", "0.6248213", "0.6213603", "0.61658835", "0.60783935", "0.6077975...
0.88024956
0
Init database structure for storing simulations.
def init_simulation_db_structure(db_conn): db_conn.root.simulations = OOBTree.BTree() # To store summary statistics of simulations. db_conn.root.n_simulations = Length.Length() db_conn.root.n_simulation_batches = Length.Length() # To store least common multiple of sizes of simulation batches. db...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\t\tsuper(DatabaseSimulator, self).__init__()\n\n\t\t#init table\n\t\tself.content[\"temperatures\"] = list()", "def init_db(self):\n\n self.f = h5py.File(self.db_file, 'w')\n # put in values from initial condition\n self.bumat_dict, mat_def = self.read_bumat(self.input_...
[ "0.6980116", "0.67604995", "0.6750175", "0.6637405", "0.66006494", "0.65275794", "0.6449728", "0.6334147", "0.6322146", "0.6321745", "0.6308436", "0.63005483", "0.6298263", "0.6289771", "0.62377995", "0.6229722", "0.62223953", "0.62166655", "0.6214921", "0.61816597", "0.61790...
0.80929375
0
Find the shard number from an op which shares colocation information with the given operation.
def get_shard_from_colocation(op): g = op.graph for c in op.colocation_groups(): try: coloc_op = g.get_operation_by_name(c.decode('utf-8')[5:]) if has_attr(coloc_op, _XLA_SHARDING): attr = coloc_op.get_attr(_XLA_SHARDING) return attr except KeyError: continue for c in op....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_shard_index(job_name, task_id):\n if job_name != 'worker':\n return None\n return task_id", "def index_op(self):\n ids = {}\n for i, op in enumerate(self.graph.ops):\n ids[op] = i\n if self.enable_recompute:\n for k, v in self.recom_area.recom_map....
[ "0.56767654", "0.5412559", "0.5405369", "0.5352765", "0.52925545", "0.5235255", "0.5132824", "0.511449", "0.510139", "0.5083082", "0.50816363", "0.5040346", "0.50089025", "0.50083774", "0.49542242", "0.49540672", "0.49468473", "0.49075496", "0.4906064", "0.48754716", "0.48676...
0.7675648
0
Checks if any of the documents pointed is part of the documents to avoid. Returns True if there is an overlap, False otherwise.
def pointers_and_documents_overlap(pointed_documents, documents_to_avoid): return len(pointed_documents.intersection(documents_to_avoid)) != 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_overlap(self):\n return False", "def _is_allowed_span(self, doc, start, end):\n\n for other_source in self.incompatible_sources:\n\n intervals = sorted((span.start, span.end) for span in\n doc.spans.get(other_source, []))\n\n # Performs a ...
[ "0.6837646", "0.6721037", "0.63415784", "0.6329963", "0.62766767", "0.6266462", "0.62499666", "0.6242168", "0.6198417", "0.61705387", "0.61117893", "0.6085479", "0.6084371", "0.6050824", "0.5999374", "0.59744483", "0.593318", "0.59185654", "0.5914874", "0.590848", "0.58783674...
0.87609124
0
Returns the dict as a model
def from_dict(cls, dikt) -> 'OrgApacheJackrabbitOakPluginsIndexAsyncIndexerServiceProperties': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Gets the lease_time_out_minutes of this OrgApacheJackrabbitOakPluginsIndexAsyncIndexerServiceProperties.
def lease_time_out_minutes(self) -> ConfigNodePropertyInteger: return self._lease_time_out_minutes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lease_time_out_minutes(self, lease_time_out_minutes: ConfigNodePropertyInteger):\n\n self._lease_time_out_minutes = lease_time_out_minutes", "def failing_index_timeout_seconds(self) -> ConfigNodePropertyInteger:\n return self._failing_index_timeout_seconds", "def lease_durations(self):\n ...
[ "0.6885998", "0.59024906", "0.5848572", "0.5716697", "0.5601805", "0.55631673", "0.54979366", "0.5465877", "0.54151964", "0.54022825", "0.538432", "0.5377841", "0.5368161", "0.5368161", "0.5368161", "0.53656054", "0.53388023", "0.53077286", "0.53053313", "0.5288729", "0.52589...
0.793326
0
Gets the failing_index_timeout_seconds of this OrgApacheJackrabbitOakPluginsIndexAsyncIndexerServiceProperties.
def failing_index_timeout_seconds(self) -> ConfigNodePropertyInteger: return self._failing_index_timeout_seconds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def failing_index_timeout_seconds(self, failing_index_timeout_seconds: ConfigNodePropertyInteger):\n\n self._failing_index_timeout_seconds = failing_index_timeout_seconds", "def timeout_seconds(self):\n return self.table.timeout_seconds", "def getFailedTestIndexes(self):\n return self.fail...
[ "0.73250216", "0.5685279", "0.56175613", "0.5534532", "0.5447351", "0.5419935", "0.53789186", "0.5366802", "0.5351622", "0.53346884", "0.53198236", "0.53198236", "0.5319532", "0.5319532", "0.5319532", "0.52941054", "0.52881587", "0.52709985", "0.5268816", "0.5248397", "0.5164...
0.8178265
0
Sets the failing_index_timeout_seconds of this OrgApacheJackrabbitOakPluginsIndexAsyncIndexerServiceProperties.
def failing_index_timeout_seconds(self, failing_index_timeout_seconds: ConfigNodePropertyInteger): self._failing_index_timeout_seconds = failing_index_timeout_seconds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def failing_index_timeout_seconds(self) -> ConfigNodePropertyInteger:\n return self._failing_index_timeout_seconds", "def failure_indexes(self, failure_indexes):\n\n self._failure_indexes = failure_indexes", "def timeout_seconds(self, timeout_seconds):\n\n self._timeout_seconds = timeout_s...
[ "0.7259942", "0.5621704", "0.53340405", "0.5094763", "0.5091238", "0.49319053", "0.49204555", "0.47802004", "0.47367823", "0.4733946", "0.46901977", "0.46852216", "0.46824634", "0.46799853", "0.46489394", "0.46319523", "0.46319523", "0.46292114", "0.45993868", "0.45964998", "...
0.84233266
0
Gets the error_warn_interval_seconds of this OrgApacheJackrabbitOakPluginsIndexAsyncIndexerServiceProperties.
def error_warn_interval_seconds(self) -> ConfigNodePropertyInteger: return self._error_warn_interval_seconds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_warn_interval_seconds(self, error_warn_interval_seconds: ConfigNodePropertyInteger):\n\n self._error_warn_interval_seconds = error_warn_interval_seconds", "def failing_index_timeout_seconds(self) -> ConfigNodePropertyInteger:\n return self._failing_index_timeout_seconds", "def error_det...
[ "0.66240245", "0.6517944", "0.5436181", "0.5409475", "0.5333583", "0.5296744", "0.52182823", "0.5166265", "0.5165528", "0.49687958", "0.49650928", "0.49626073", "0.49577448", "0.494385", "0.4940173", "0.49276268", "0.49136993", "0.4863798", "0.48527327", "0.4847661", "0.48397...
0.7875359
0
Plots the values of a loss function through training time (epoches).
def plot_loss(history): plt.plot(history.history['loss']) plt.plot(history.history['val_loss']) plt.title('Loss of the Model') plt.ylabel('Loss') plt.xlabel('Epoch') plt.legend(['Train', 'Test'], loc='upper left') plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_loss_epochs(loss_functions):\n plt.plot(loss_functions, np.arange(len(loss_functions)))\n plt.xlabel(\"Loss Functions\")\n plt.ylabel(\"Epochs (Number Of full Iterations)\")\n plt.title(\"Loss Functions vs Epochs\")\n plt.show()", "def loss_plot(self,train_loss):\n plt.figure(1)\n ...
[ "0.75840896", "0.7351714", "0.7329775", "0.7283755", "0.7220254", "0.71691644", "0.7144385", "0.7142074", "0.7108839", "0.7101062", "0.70749944", "0.70150656", "0.6960804", "0.6948555", "0.693847", "0.6916583", "0.68616563", "0.68555325", "0.685269", "0.6826072", "0.68243384"...
0.7336157
2
Plots the accuracy of a model through training time (epoches).
def plot_accuracy(history): plt.plot(history.history['acc']) plt.plot(history.history['val_acc']) plt.title('Accuracy of the Model') plt.ylabel('Accuracy') plt.xlabel('Epoch') plt.legend(['Train', 'Test'], loc='upper left') plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_model_output(trial_train_accuracies, trial_test_accuracies, trial_losses, model_name=\"Model\"):\n nb_trials, nb_epoch = trial_train_accuracies.size()\n trial_train_accuracies_std, trial_train_accuracies_mean = torch.std_mean(trial_train_accuracies, axis = 0)\n trial_test_accuracies_std, trial_test_acc...
[ "0.7361501", "0.73462605", "0.73301595", "0.7303719", "0.7303719", "0.7286781", "0.7285111", "0.72179407", "0.72088945", "0.7194033", "0.7181286", "0.70996755", "0.7076227", "0.70381296", "0.70229596", "0.70195705", "0.696734", "0.6879957", "0.68367267", "0.68321925", "0.6829...
0.73157024
3
Create a heatmap from a numpy array and two lists of labels.
def heatmap(data, row_labels, col_labels, ax=None, cbar_kw={}, cbarlabel="", annotate=True, **kwargs): if not ax: ax = plt.gca() # Plot the heatmap im = ax.imshow(data, **kwargs) # Create colorbar cbar = ax.figure.colorbar(im, ax=ax, **cbar_kw) cbar.ax.set_ylabel(cbarlabel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heatmap(data, row_labels, col_labels, ax=None,\r\n cbar_kw={}, cbarlabel=\"\", **kwargs):\r\n\r\n if not ax:\r\n ax = plt.gca()\r\n\r\n # Plot the heatmap\r\n im = ax.imshow(data, **kwargs)\r\n\r\n # We want to show all ticks...\r\n ax.set_xticks(np.arange(data.shape[1]))\r\n ...
[ "0.68181986", "0.6713618", "0.66837937", "0.66761607", "0.66761607", "0.65200794", "0.6483312", "0.64338195", "0.6395992", "0.63565475", "0.6190447", "0.6170368", "0.6020642", "0.5996789", "0.5981317", "0.5900491", "0.5864067", "0.5855121", "0.58276665", "0.581948", "0.580386...
0.66082054
5
Append another Particle(s) object to this one and returns it as a new object.
def append(self, particles): if not isinstance(particles, Particle) and not isinstance(particles, Particles): raise ValueError('Can only append Particles or Particle objects.') if particles.number == 0: return self.copy() if 'particle' not in particles.columns: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, particle: ParticleLike):\n # TODO: use particle_input when it works with CustomParticle and ParticleLike\n if not isinstance(particle, (Particle, CustomParticle)):\n particle = Particle(particle)\n self.data.append(particle)", "def add(self, p):\n self.part...
[ "0.713018", "0.6921559", "0.64229107", "0.6401459", "0.6251738", "0.62341166", "0.6219511", "0.6116875", "0.6100896", "0.59027225", "0.57752746", "0.5774941", "0.57578415", "0.57568973", "0.5752768", "0.5747693", "0.5739747", "0.5666247", "0.5663047", "0.56309867", "0.5619601...
0.77816004
0
Delete all cookies. It forces flushes user session by cookies deleting.
def flush_session(self): self.webdriver.delete_all_cookies()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_all_cookies(self):\n self.log.info('py.delete_all_cookies() - Delete all cookies')\n self.webdriver.delete_all_cookies()", "def clear_all_cookies(self):\r\n for name in self.request.cookies:\r\n self.clear_cookie(name)", "def clear_cookies(self):\n self.driver....
[ "0.8331253", "0.8282952", "0.78926677", "0.7376271", "0.7286857", "0.70566016", "0.6900106", "0.6548183", "0.6443117", "0.6401763", "0.61793584", "0.61779416", "0.6167445", "0.6082943", "0.6076759", "0.6049217", "0.6039787", "0.5981321", "0.59524924", "0.5919649", "0.5868006"...
0.7687338
3
Serializes this instance to a JSON string.
def to_json_string(self): return json.dumps(dataclasses.asdict(self), indent=2) + "\n"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -...
[ "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.87360686", "0.8691753", "0.8649985", "0.8638214", "0.86037296", "0.86037296", "0.86037296", "0.86037296", "0.86037296", "0.8598524", "0.8598524", "0.8580314...
0.8268372
47
Serializes this instance to a JSON string.
def to_json_string(self): return json.dumps(dataclasses.asdict(self), indent=2) + "\n"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -...
[ "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.8805053", "0.87360686", "0.8691753", "0.8649985", "0.8638214", "0.86037296", "0.86037296", "0.86037296", "0.86037296", "0.86037296", "0.8598524", "0.8598524", "0.8580314...
0.8268372
46
Serializes this instance to a JSON string.
def to_json_string(self): return json.dumps(dataclasses.asdict(self)) + "\n"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -...
[ "0.8804255", "0.8804255", "0.8804255", "0.8804255", "0.8804255", "0.8804255", "0.8804255", "0.8804255", "0.8804255", "0.87365294", "0.86909604", "0.8650419", "0.86388916", "0.86028755", "0.86028755", "0.86028755", "0.86028755", "0.86028755", "0.8598205", "0.8598205", "0.85791...
0.8344827
39
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_examples(self):\n return self.get_dialog_examples(\"train\")", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(data_dir):\r\n examples = []\r\n for line in op...
[ "0.73395765", "0.7173421", "0.7173421", "0.6852461", "0.65894455", "0.6499195", "0.64133793", "0.63846534", "0.63422555", "0.631376", "0.629028", "0.62816536", "0.6278668", "0.62387705", "0.62302077", "0.6225844", "0.62234706", "0.62225735", "0.6216135", "0.62097645", "0.6205...
0.62466323
29
Gets the list of labels for this data set.
def get_labels(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self):\n if not hasattr(self, 'label_set'):\n raise NotImplementedError()\n else:\n return list(self.label_set.label_list)", "def labels(self):\n return self.dataset.labels", "def get_labels(self) -> List[str]:\n pass", "def get_labels(self):\n...
[ "0.87288016", "0.87208813", "0.8675048", "0.85584927", "0.84707737", "0.84707737", "0.8436226", "0.8436226", "0.8436226", "0.8436226", "0.83454776", "0.83089083", "0.82682127", "0.8267779", "0.8244558", "0.81719303", "0.81707025", "0.81638056", "0.8131303", "0.8095703", "0.80...
0.7890629
51
Truncates a sequence pair in place to the maximum length.
def _truncate_seq_pair(tokens_a, tokens_b, max_length): while True: total_length = len(tokens_a) + len(tokens_b) if total_length <= max_length: break if len(tokens_a) > len(tokens_b): tokens_a.pop() else: tokens_b.pop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _truncate_seq_pair(tokens_a, tokens_b, max_length):\n\n\t# This is a simple heuristic which will always truncate the longer sequence\n\t# one token at a time. This makes more sense than truncating an equal percent\n\t# of tokens from each, since if one sequence is very short then each token\n\t# that's truncat...
[ "0.7615645", "0.7604508", "0.7604508", "0.76036716", "0.75670713", "0.7559492", "0.7559492", "0.7529625", "0.7527809", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", ...
0.74213403
27
(non offset) gaussian function. with annotations.
def gaussian(x, a: float = 1., mu: float = 1., sigma: float = 1., c: float = 1): import math return a * math.e ** (-0.5 * ((x - mu) / sigma) ** 2) + c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian(x, mu, sig):\n\treturn 1 / (sig * np.sqrt(2 * np.pi)) * np.exp((-1 / 2) * ((x - mu) / sig)**2)", "def gaussian(x, mu, sig):\n return np.exp(-np.power(x - mu, 2.0) / (2 * np.power(sig, 2.0)))", "def gaussian(x, mu, sig):\n return np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.)))", "de...
[ "0.7169703", "0.7039787", "0.70270914", "0.6951285", "0.6896448", "0.6876288", "0.6819487", "0.67797613", "0.67426926", "0.67334557", "0.67115486", "0.67115486", "0.67011595", "0.6700823", "0.6672681", "0.6671764", "0.6659314", "0.665073", "0.6643825", "0.6624744", "0.659142"...
0.64889985
24
Returns the sum of all elements of the tensor
def sum(self, pow=1): s = 0 for v in self.dic.values(): if pow == 1: s += v else: s += v**pow return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_reduce_sum(tensor: torch.Tensor) -> torch.Tensor:\n return all_reduce_op(tensor, torch.distributed.ReduceOp.SUM)", "def sum_reduce(self, tensor):\n #op=ReduceOp.SUM,\n dist.reduce(tensor=tensor, dst=self.master_node)", "def sum_reduce(self, tensor):\n #op=ReduceOp.SUM,\n ...
[ "0.8245708", "0.7675754", "0.7675754", "0.7675754", "0.7406939", "0.7270014", "0.71817565", "0.71661854", "0.7131892", "0.71093184", "0.7107814", "0.70860213", "0.70690936", "0.70409673", "0.7022995", "0.7002622", "0.6994476", "0.6983163", "0.69821894", "0.69763565", "0.69494...
0.0
-1
Returns the least significant digit, offset by `index`.
def lsdigit(number, index): return int(number % (10**(index + 1)) / (10**index))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_number(index):\n number = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine']\n return number[index]", "def _first_num(i:int)->int:\n \n # convert int to str, then slice out first digit, convert \n # it back to an int and return it.\n s = str(i)\n return int(s[0])"...
[ "0.67954975", "0.6438404", "0.6181416", "0.61168736", "0.60329425", "0.59868294", "0.5907095", "0.5832913", "0.56718034", "0.5659298", "0.5551572", "0.5550673", "0.55454737", "0.5529725", "0.5524", "0.55139416", "0.55114645", "0.5509396", "0.54981226", "0.5493981", "0.5470927...
0.66436845
1
Returns the date of creation of a file
def _get_file_date(self, pth): try: return os.stat(pth).st_ctime except Exception as e: self.logger.error('Error get date: {0} {1}'.format(pth, e)) return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_file_creation(path_to_file):\n if platform.system() == 'Windows':\n return os.path.getctime(path_to_file)\n else:\n stat = os.stat(path_to_file)\n try:\n return stat.st_birthtime\n except AttributeError:\n # We're probably on Linux. No easy way t...
[ "0.8535579", "0.84425914", "0.84425914", "0.8277021", "0.81660503", "0.74911267", "0.71593416", "0.71206367", "0.7094442", "0.70910215", "0.70455295", "0.7016761", "0.6966341", "0.6910292", "0.6910292", "0.6877701", "0.6877248", "0.6873627", "0.6857545", "0.68375057", "0.6820...
0.7717008
5
Creates a new instance of the appropriate class based on discriminator value
def create_from_discriminator_value(parse_node: Optional[ParseNode] = None) -> Run: if not parse_node: raise TypeError("parse_node cannot be null.") return Run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_from_discriminator_value(parse_node: Optional[ParseNode] = None) -> RiskDetection:\n if not parse_node:\n raise TypeError(\"parse_node cannot be null.\")\n return RiskDetection()", "def create_from_discriminator_value(parse_node: Optional[ParseNode] = None) -> ThreatAssessment...
[ "0.6823209", "0.6506791", "0.63858217", "0.63626087", "0.63133126", "0.6280121", "0.6200303", "0.61717325", "0.6156252", "0.6107049", "0.61056674", "0.60897696", "0.6029265", "0.5991419", "0.5966992", "0.5938014", "0.5928447", "0.5881392", "0.5869065", "0.58682287", "0.586293...
0.6290549
5
return a list of dictionaries keyed by the header
def read_csv(fileName, **kwargs): df = [] usecols = kwargs["usecols"] with open(fileName, mode='r') as csv_file: csv_reader = csv.DictReader(csv_file) for row in csv_reader: data = {} for header in usecols: if header in row: val = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def headers(self):\n return {}", "def process_headers(self, listed_data):\n\t\treturn { val.rstrip().split(\": \")[0]: val.rstrip().split(\": \")[1] for val in listed_data }", "def get_headers(self):\n return {}", "def get_headers(self):\n return []", "def get_header_items(self):\n ...
[ "0.7235069", "0.7209123", "0.7129688", "0.6980671", "0.69738567", "0.69084376", "0.690003", "0.6892536", "0.68865424", "0.6839906", "0.68289405", "0.6745487", "0.6726851", "0.6715886", "0.66589767", "0.66551286", "0.6622817", "0.66194326", "0.6604023", "0.6500636", "0.6491919...
0.0
-1
Starts listening in the background.
def start(self): self.greenlet = gevent.spawn(self.run)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n print(\"Starting to listen\")\n self._register_listener()", "def start(self):\n self.run = True\n self.t = Thread(target=self._listen)\n self.t.start()", "def start(self):\n self._stop_listening = False\n self._logger.debug(\"Starting listener...
[ "0.78452396", "0.7770413", "0.7736", "0.7571446", "0.75316006", "0.72828776", "0.7186574", "0.7093432", "0.70489943", "0.6987283", "0.6964647", "0.695341", "0.6901863", "0.68529344", "0.68419427", "0.6832631", "0.68136513", "0.67664206", "0.6743179", "0.6734324", "0.67333233"...
0.0
-1
Set up the Govee Light platform.
async def async_setup_entry(hass, entry, async_add_entities): _LOGGER.debug("Setting up Govee lights") config = entry.data options = entry.options hub = hass.data[DOMAIN]["hub"] # refresh update_interval = timedelta( seconds=options.get(CONF_DELAY, config.get(CONF_DELAY, 10)) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupScene():\n global ogre_scene_manager\n global ogre_render_window\n global ogre_root_node\n\n ogre_render_window = ogre_root.getAutoCreatedWindow()\n ogre_scene_manager = ogre_root.createSceneManager(ogre.ST_GENERIC,\n \"Default SceneManage...
[ "0.6386009", "0.61921126", "0.6191073", "0.6180878", "0.61690855", "0.61467016", "0.6140317", "0.6134755", "0.6102114", "0.60958266", "0.60952634", "0.6090836", "0.6039496", "0.6027853", "0.5943268", "0.59304225", "0.59142435", "0.5873843", "0.58727777", "0.5838366", "0.58143...
0.54760486
81
Return if the entity should be enabled when first added to the entity registry.
def entity_registry_enabled_default(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_registry_enabled_default(self) -> bool:\n return self._enabled", "def entity_registry_enabled_default(self) -> bool:\n return self._enabled_default", "def entity_registry_enabled_default(self) -> bool:\n return self._enabled_default", "def entity_registry_enabled_default(self)...
[ "0.76853055", "0.7446062", "0.7446062", "0.7364936", "0.73120487", "0.6909979", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", "0.6639338", ...
0.7317286
4
Return true if device is on.
def is_on(self): return self._device.power_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on(self) -> bool:\n return self.device.is_on", "def is_on(self):\n return self._device.is_on()", "def is_on(self) -> bool:\n return self.device.level == \"on\"", "def is_on(self):\n return self._device.state", "def is_on(self) -> bool:\n if (self._device.status == ...
[ "0.8902581", "0.867975", "0.8444767", "0.83666635", "0.82516414", "0.82283235", "0.81573427", "0.80865455", "0.8056087", "0.779205", "0.7741024", "0.7723503", "0.7629083", "0.7618972", "0.7618972", "0.76084316", "0.7583229", "0.75048006", "0.748958", "0.74754006", "0.7435943"...
0.742237
22
Return true if the state is assumed. This can be disabled in options.
def assumed_state(self): return ( self._coordinator.use_assumed_state and self._device.source == GoveeSource.HISTORY )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assumed_state(self) -> bool:\n return not self.device.states", "def assumed_state(self):\n return True", "def assumed_state(self):\n return True", "def assumed_state(self):\n return True", "def assumed_state(self):\n return True", "def assumed_state(self) -> bool:\n...
[ "0.80651116", "0.7762611", "0.7762611", "0.7762611", "0.7762611", "0.76720417", "0.7657227", "0.76262635", "0.76125044", "0.76125044", "0.7601663", "0.7584625", "0.7539341", "0.72823644", "0.7216629", "0.7140612", "0.71361256", "0.71361256", "0.71361256", "0.71361256", "0.710...
0.6688423
78
Return the hs color value.
def hs_color(self): return color.color_RGB_to_hs( self._device.color[0], self._device.color[1], self._device.color[2], )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hs_color(self):\n return color_util.color_RGB_to_hs(*self._rgb_color)", "def hs_color(self):\n return self._hscolor", "def hs_color(self):\n return self._hs_color", "def hs_color(self):\n return self._hs_color", "def hs_color(self):\n return self._hs", "def hs_color...
[ "0.8860094", "0.8835622", "0.87878764", "0.87878764", "0.87754637", "0.87754637", "0.87754637", "0.87754637", "0.860663", "0.85759944", "0.8478871", "0.8453253", "0.8425429", "0.764352", "0.75040394", "0.7167388", "0.71574044", "0.7093016", "0.6981752", "0.69282603", "0.68709...
0.8731145
8
Return the color_temp of the light.
def color_temp(self): if not self._device.color_temp: return None return color.color_temperature_kelvin_to_mired(self._device.color_temp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_temp(self):\n return self._temperature", "def color_temp(self):\n return self._color_temp", "def color_temp(self):\n return self._color_temp", "def color_temp(self):\n return self._color_temp", "def color_temp(self):\n return color_util.color_temperature_kelvin_...
[ "0.88101125", "0.8809613", "0.8809613", "0.8809613", "0.85615724", "0.8530835", "0.8518775", "0.85079706", "0.84316915", "0.82724935", "0.80621356", "0.788836", "0.71777296", "0.68665385", "0.6831695", "0.67693096", "0.6747023", "0.6735025", "0.6713537", "0.6695743", "0.66957...
0.85542816
5
Return the coldest color_temp that this light supports.
def min_mireds(self): return color.color_temperature_kelvin_to_mired(COLOR_TEMP_KELVIN_MAX)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_temp(self):\n return self._color_temp", "def color_temp(self):\n return self._color_temp", "def color_temp(self):\n return self._color_temp", "def color_temp(self):\n return self._ct", "def color_temp(self) -> int | None:\n return self._color_temp", "def color...
[ "0.8144326", "0.8144326", "0.8144326", "0.79874784", "0.79792964", "0.7937669", "0.7934352", "0.7722136", "0.75662094", "0.75644845", "0.7358534", "0.71433246", "0.6856017", "0.654204", "0.6537465", "0.6353053", "0.63245183", "0.62851423", "0.6276324", "0.6231321", "0.6212319...
0.0
-1
Return the warmest color_temp that this light supports.
def max_mireds(self): return color.color_temperature_kelvin_to_mired(COLOR_TEMP_KELVIN_MIN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_temp(self):\n if self._device.supports_color_temperature:\n kelvin = self._device.current_color_temperature\n # Avoid division by zero if actuator reported 0 Kelvin (e.g., uninitialized DALI-Gateway)\n if kelvin is not None and kelvin > 0:\n return c...
[ "0.8278129", "0.8252291", "0.8252291", "0.8252291", "0.8197826", "0.80970484", "0.804787", "0.80198234", "0.79973406", "0.7983397", "0.79176617", "0.77807117", "0.7589388", "0.729649", "0.6636117", "0.6608908", "0.651283", "0.6510995", "0.6501945", "0.6457387", "0.644921", ...
0.0
-1
Return the device state attributes.
def device_state_attributes(self): return { # rate limiting information on Govee API "rate_limit_total": self._hub.rate_limit_total, "rate_limit_remaining": self._hub.rate_limit_remaining, "rate_limit_reset_seconds": self._hub.rate_limit_reset_seconds, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\n\t\treturn self._attributes", "def device_state_attributes(self):\n\t\treturn self._state_attributes", "def device_state_attributes(self):\r\n return self._attr", "def device_state_attributes(self):\n return self._attrs", "def device_state_attributes(self):...
[ "0.9320364", "0.92886734", "0.92286974", "0.92207897", "0.92207897", "0.92147964", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975", "0.91909975",...
0.8055408
54
Returns the name of the flagspecific configuration if it's specified in flagspecific option, or None. The name must be defined in FlagSpecificConfig or an AssertionError will be raised.
def flag_specific_config_name(self): config_name = self.get_option('flag_specific') if config_name: configs = self.flag_specific_configs() assert config_name in configs, '{} is not defined in FlagSpecificConfig'.format( config_name) return config_name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_opts_name(self):\n return self.name", "def __GetFlag(self, parser):\n name = self.__args[0]\n for flag in parser.flag_args:\n if name in flag.option_strings:\n return flag\n return None", "def configuration_set_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.ge...
[ "0.6122376", "0.6072979", "0.58718413", "0.58718413", "0.57772946", "0.5675298", "0.56555897", "0.56027776", "0.5538155", "0.55090064", "0.54743963", "0.54743963", "0.5469565", "0.5469407", "0.5456328", "0.54464066", "0.54034734", "0.53896385", "0.5382518", "0.5380593", "0.53...
0.8238586
0
Returns the number of child processes to use for this port.
def default_child_processes(self): return self._executive.cpu_count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nprocs(self):\n return self._nprocs", "def get_num_procs():\n return get_num_MPI_workers()", "def number_of_workers(self) -> int:\n return pulumi.get(self, \"number_of_workers\")", "def max_fork_bomb_processes(self):\n return int(self.get(\"max_fork_procs\"))", "def num_procs():...
[ "0.7621422", "0.723613", "0.71615845", "0.70701855", "0.70065796", "0.6900383", "0.689658", "0.6855091", "0.6842365", "0.68164444", "0.68134785", "0.679778", "0.6782495", "0.6685084", "0.6685084", "0.6685084", "0.6685084", "0.6671355", "0.66372097", "0.6614938", "0.65502656",...
0.74988145
1
Given a test name, returns an absolute path to its next fallback baseline.
def fallback_expected_filename(self, test_name, extension): baselines = self.expected_baselines( test_name, extension, all_baselines=True) if len(baselines) < 2: actual_test_name = self.lookup_virtual_test_base(test_name) if actual_test_name: if len(ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expected_filename(self,\n test_name,\n extension,\n return_default=True,\n fallback_base_for_virtual=True,\n match=True):\n # The [0] means the first expected baseline (which is t...
[ "0.70272774", "0.6481176", "0.62385076", "0.6047606", "0.604033", "0.59425527", "0.5822362", "0.57964337", "0.56741697", "0.5655726", "0.55820864", "0.5502925", "0.5501996", "0.5446235", "0.5411839", "0.53684545", "0.5367542", "0.52789456", "0.5255385", "0.5209104", "0.517103...
0.7836563
0
Returns whether a WPT test is a crashtest.
def is_wpt_crash_test(self, test_name): match = self.WPT_REGEX.match(test_name) if not match: return False wpt_path = match.group(1) path_in_wpt = match.group(2) return self.wpt_manifest(wpt_path).is_crash_test(path_in_wpt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_wpt_test(self, test_name):\n return self.port.is_wpt_test(test_name)", "def is_wpt_test(test):\n return Port.WPT_REGEX.match(test)", "def has_test(self):\n\n if self.test:\n return True\n\n return False", "def is_test_mode() -> bool:\n ctt_test_mode = os.gete...
[ "0.706438", "0.682065", "0.67466855", "0.6385144", "0.6342569", "0.61721677", "0.6042198", "0.59856725", "0.5960805", "0.594193", "0.593825", "0.5848826", "0.57921493", "0.57761276", "0.5752971", "0.5736392", "0.569966", "0.56652594", "0.565803", "0.5645367", "0.56254625", ...
0.5985782
7
Returns whether a WPT test is a manual.
def is_manual_test(self, test_name): match = self.WPT_REGEX.match(test_name) if not match: return False wpt_path = match.group(1) path_in_wpt = match.group(2) return self.wpt_manifest(wpt_path).is_manual_test(path_in_wpt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isManual(self):\r\n return not self.isAutomated()", "def manual(self) -> bool:\n return pulumi.get(self, \"manual\")", "def isAutomated(self):\r\n if self._domInstance.find('art2testscript'):\r\n return True\r\n else:\r\n return False", "def is_manual(sel...
[ "0.75656974", "0.7311548", "0.66666114", "0.6524292", "0.6448943", "0.6252638", "0.62007207", "0.61034536", "0.6099225", "0.6031144", "0.58977085", "0.58977085", "0.5790726", "0.57418925", "0.57418925", "0.5687748", "0.5641196", "0.55814934", "0.55751085", "0.555013", "0.5550...
0.8029916
0
Turns a string into a list of string and number chunks.
def _natural_sort_key(self, string_to_split): def tryint(val): try: return int(val) except ValueError: return val return [tryint(chunk) for chunk in re.split(r'(\d+)', string_to_split)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunk_string(string, chunk_size):\n return [string[i:i+chunk_size] for i in range(0, len(string),chunk_size)]", "def chunks(string):\n return (string[0+i:CHUNK_LENGTH+i] for i in range(0, len(string), CHUNK_LENGTH))", "def chunks(string, n):\n for start in range(0, len(string), n):\n ...
[ "0.7566389", "0.7487891", "0.6976484", "0.6756771", "0.6664733", "0.65726715", "0.6535802", "0.6504915", "0.64984286", "0.6451667", "0.63872665", "0.6383375", "0.63761044", "0.6295206", "0.628656", "0.62844974", "0.6266965", "0.6231902", "0.62291247", "0.62036204", "0.6180734...
0.0
-1
Returns a normalized version of the test name or test directory.
def normalize_test_name(self, test_name): if test_name.endswith('/'): return test_name if self.test_isdir(test_name): return test_name + '/' return test_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __stripTestDirPrefix(self, path):\n\t\tif not path: return path\n\t\tpath = os.path.normpath(path)\n\t\treturn path.split(self.output+os.sep, 1)[-1].split(self.descriptor.testDir+os.sep, 1)[-1]", "def abspath_for_test(self, test_name):\n return self._filesystem.join(self.web_tests_dir(), test_name)", ...
[ "0.691942", "0.6634559", "0.6633729", "0.66072994", "0.6600894", "0.6498556", "0.6477912", "0.63528866", "0.6352552", "0.6311317", "0.6311005", "0.61859435", "0.617325", "0.6149682", "0.6127558", "0.60954165", "0.6089973", "0.60453486", "0.5993206", "0.59816414", "0.59689254"...
0.85814506
0
Checks if the test is skipped based on the set of Smoke tests. Returns True if this port runs only smoke tests, and the test is not in the smoke tests file; returns False otherwise.
def skipped_due_to_smoke_tests(self, test): if not self.default_smoke_test_only(): return False smoke_test_filename = self.path_to_smoke_tests_file() if not self._filesystem.exists(smoke_test_filename): return False smoke_tests = self.tests_from_file(smoke_test_fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skips_test(self, test):\n return (self.skipped_due_to_smoke_tests(test)\n or self.skipped_in_never_fix_tests(test)\n or self.virtual_test_skipped_due_to_platform_config(test)\n or self.skipped_due_to_exclusive_virtual_tests(test)\n or self.skip...
[ "0.73537916", "0.6944409", "0.6531222", "0.64909106", "0.64780587", "0.6298396", "0.6098519", "0.6063346", "0.6040276", "0.60210514", "0.60141087", "0.6013521", "0.59987664", "0.5998264", "0.5953285", "0.591899", "0.58997375", "0.57893986", "0.57851684", "0.5774473", "0.57602...
0.86389023
0
Checks if the test is marked as Skip in NeverFixTests for this port. Skip in NeverFixTests indicate we will never fix the failure and permanently skip the test. Only Skip lines are allowed in NeverFixTests. Some lines in NeverFixTests are platformspecific.
def skipped_in_never_fix_tests(self, test): test_expectations = self._never_fix_test_expectations() return ResultType.Skip in test_expectations.expectations_for( test).results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skips_test(self, test):\n return (self.skipped_due_to_smoke_tests(test)\n or self.skipped_in_never_fix_tests(test)\n or self.virtual_test_skipped_due_to_platform_config(test)\n or self.skipped_due_to_exclusive_virtual_tests(test)\n or self.skip...
[ "0.70933074", "0.679819", "0.6782662", "0.6631817", "0.65419096", "0.6535467", "0.6495078", "0.64848906", "0.64712864", "0.63558346", "0.6295211", "0.62873954", "0.6258148", "0.6158798", "0.61425763", "0.6087957", "0.60130984", "0.59350896", "0.5934049", "0.5922039", "0.58535...
0.747233
0