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
Returns the euclidean distance between two lat/long points
def get_distance(lat1, long1, lat2, long2): x = 69.1*(lat2 - lat1) y = 69.1*(long2 - long1) * math.cos(lat1/57.3) dist = math.sqrt(x*x + y*y) return dist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclideanDistance(loc1, loc2):\n return math.sqrt(sum([(a - b) ** 2 for a, b in zip(loc1, loc2)]))", "def calculateDistanceBetweenPoints(lat1,lon1,lat2,lon2):\n\treturn Geodesic.WGS84.Inverse(lat1,lon1, lat2, lon2)['s12']", "def euclidean_dist(ss1, ss2):\n lat1, lon1 = ss1.centroid\n lat2, lon2 = ...
[ "0.798512", "0.7874965", "0.784562", "0.78367096", "0.7788775", "0.77831024", "0.7747436", "0.77269596", "0.76895297", "0.7688702", "0.7679215", "0.7666751", "0.76459885", "0.7643038", "0.7623515", "0.7619535", "0.7593095", "0.7542804", "0.75427014", "0.7525883", "0.75246805"...
0.7703224
8
Produces a list of serialized tf.Examples from transformed data.
def _encode_transformed_data_batch( data: Tuple[pa.RecordBatch, Dict[str, pa.Array]], coder: example_coder.RecordBatchToExamplesEncoder) -> List[bytes]: # Drop unary pass-through features that are not relevant for this testing # framework. record_batch, _ = data return coder.encode(record_batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_examples_to_features(self):\n features = []\n for ex_index, example in enumerate(self.examples):\n taskname = example.taskname\n taskname_ids = self.tokenizer.text_to_ids(taskname)\n processor = example.processor\n if ex_index % 10000 == 0:\n ...
[ "0.6958016", "0.6748986", "0.67361456", "0.6658963", "0.6565882", "0.64636815", "0.6402347", "0.63523936", "0.63523936", "0.62863874", "0.62848586", "0.62824947", "0.6211674", "0.6141158", "0.6094538", "0.6080663", "0.6076335", "0.60522515", "0.60453117", "0.60183996", "0.600...
0.5945353
26
get dot product of Xhat and M
def XstarT_dot(self,M): if 0: #TODO: implement this properly pass else: RV = np.dot(self.Xstar().T,M) return RV
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot(self, other):\n return self.x0 * other.x0 + self.x1 * other.x1 + self.x2 * other.x2", "def _dot(a, b):\n return np.einsum('ijk,ikl->ijl', a, b)", "def dot_product(x, kernel):\n return K.squeeze(K.dot(x, K.expand_dims(kernel)), axis=-1)", "def dot(*Ms):\n N = Ms[0]\n for M i...
[ "0.69523966", "0.69397277", "0.69012904", "0.6813258", "0.6764509", "0.6756571", "0.66334325", "0.6627931", "0.6619186", "0.66163886", "0.6605976", "0.66051376", "0.659309", "0.6584659", "0.65646136", "0.6548301", "0.65213996", "0.65202147", "0.65202147", "0.65202147", "0.652...
0.7308769
0
Return a layout ID given a human layout name.
def layout_id(lang, value): kn = _get_keyboard_names() return kn.layout_id(lang, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parseLayoutId(*args):\n return _libsbml.parseLayoutId(*args)", "def getId(self):\n return _libsbml.Layout_getId(self)", "def get_study_id_from_name(self, study_name: str) -> int:\n raise NotImplementedError", "def layout_selector(layout):\n\n # This dictionary could probably be moved, n...
[ "0.63957036", "0.6245028", "0.5935354", "0.56690013", "0.56520665", "0.5636896", "0.5571918", "0.55609185", "0.55458844", "0.5537595", "0.5529953", "0.55228305", "0.5483279", "0.53768206", "0.53530204", "0.5348442", "0.5312475", "0.53113043", "0.53012615", "0.5286641", "0.528...
0.68512195
0
Computes the opcode for an instruction
def _encodeMnemonic(mnemonic, *args): opcode = opcodes[mnemonic] meta = mnemonics[mnemonic] assert len(args) == len(meta) - 1 + meta[0], '''Invalid number of arguments for `%s`''' % mnemonic bit = 0x80 for i in xrange(1, len(meta)): # at most two options assert 1 <= len(meta[i]) <= 2, '''Invalid number of ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_opcode(self, code):\r\n opcode = int(str(code)[-2:])\r\n return opcode", "def opcode(self):\n if self.op is None:\n return None\n return self.op.value", "def read_opcode(self) -> int:\n\n offset = self.current_address - self.STARTING_ADDRESS\n\n if s...
[ "0.7358185", "0.7126087", "0.70924646", "0.7036129", "0.689643", "0.65232813", "0.64296293", "0.6384594", "0.63250726", "0.6122396", "0.6010467", "0.59943783", "0.597373", "0.5923755", "0.5896763", "0.5881855", "0.5849642", "0.577331", "0.5756591", "0.5743583", "0.5733374", ...
0.5333134
41
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!') while True: city = input('Are you from Washington, New York City or Chicago: ').lower() if city in cities: break print('You selected: ', city) #fixed the missing loop and case sensitivity in 'month' and 'd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.6671029", "0.65359104", "0.6458688", "0.63752216", "0.6348333", "0.6310136", "0.6286666", "0.6259401", "0.6232757", "0.6214305", "0.6204918", "0.6181069", "0.61726975", "0.6168352", "0.61584324", "0.61533356", "0.6144159", "0.6131992", "0.61047643", "0.6102517", "0.6091326...
0.61581767
15
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): df = pd.read_csv(CITY_DATA[city]) df['Start Time'] = pd.to_datetime(df['Start Time']) #changed 'weekday_name' to just 'weekday' which outputs the weekday as integer # extract month, day of week and hour from Start Time to create new columns df['month'] = df['Start Time']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81320685", "0.8108889", "0.8045821", "0.8042514", "0.80090284", "0.80071104", "0.79991937", "0.7998333", "0.7988789", "0.797905", "0.79737365", "0.79610896", "0.7956163", "0.7947432", "0.79463065", "0.7908287", "0.7908229", "0.7904569", "0.7900715", "0.78930074", "0.788921...
0.7384618
96
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() most_common_month = df.loc[:,'month'].mode() print('The most common month is: ', most_common_month) most_common_dow = df.loc[:,'dow'].mode() print('The most common day of the week is: ',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.80247396", "0.80233026", "0.7915788", "0.78266186", "0.7822246", "0.78143597", "0.77659196", "0.7740343", "0.773628", "0.77344066", "0.76867086", "0.7668633", "0.7651731", "0.7644636", "0.76399267", "0.76367253", "0.7625196", "0.7623158", "0.7612803", "0.76002145", "0.7583...
0.74459285
40
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() most_started = df.loc[:,'Start Station'].mode() print('The most started location is: ', most_started) most_ended = df.loc[:,'End Station'].mode() print('The most common used end stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.78160274", "0.7661919", "0.75536317", "0.7491503", "0.7474813", "0.74461776", "0.7431465", "0.74235755", "0.7417586", "0.7400262", "0.73873377", "0.73855174", "0.7365086", "0.7359132", "0.73566383", "0.7355021", "0.735213", "0.7351353", "0.73503", "0.73420906", "0.73405164...
0.0
-1
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() travel_time_total = df['Trip Duration'].sum() print('The total travel time is: ',travel_time_total) travel_time_mean = df['Trip Duration'].mean() print('The average time travelled is: ',travel_time...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.8142488", "0.802504", "0.8003995", "0.7949535", "0.7937111", "0.793114", "0.7926624", "0.79147255", "0.7913882", "0.7907699", "0.79052943", "0.7900545", "0.78914416", "0.7889074", "0.7886493", "0.7884836", "0.7884105", "0.78822976", "0.78735834", "0.7868467", "0.7866015", ...
0.77027464
69
Gets the dashboard_url of this ServiceResponse.
def dashboard_url(self) -> str: return self._dashboard_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dashboardUrl(self):\n\t\turl = \"http://127.0.0.1/horizon\"\n\t\tx = urlparse(self.url)\n\t\turl = \"%s://%s/horizon\" % (x.scheme , x.netloc.split(\":\")[0] )\n\t\treturn url", "def cluster_dashboard_url_view(self):\n\n result = self._client.get(\n \"{}/dashboard\".format(LKECluster.api_en...
[ "0.674965", "0.6657662", "0.6464404", "0.63082314", "0.61133635", "0.6092367", "0.60873324", "0.6078956", "0.6078956", "0.60252345", "0.5958921", "0.5958921", "0.5872743", "0.5845644", "0.5787881", "0.5768059", "0.5744298", "0.57284445", "0.5711765", "0.5704383", "0.5704383",...
0.7959196
0
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!') # get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs while True: print('-'*40) city=str(input("choose the City : chicago, new york city, washington\n")) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.6671029", "0.65359104", "0.6458688", "0.63752216", "0.6348333", "0.6310136", "0.6286666", "0.6259401", "0.6232757", "0.6214305", "0.6204918", "0.6181069", "0.61726975", "0.6168352", "0.61584324", "0.61581767", "0.61533356", "0.6144159", "0.6131992", "0.61047643", "0.610251...
0.0
-1
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): df=pd.read_csv(CITY_DATA[city]) df['Start Time'] = pd.to_datetime(df['Start Time']) df['month'] = df['Start Time'].dt.month df['day_of_week'] = df['Start Time'].dt.weekday_name if month != 'none': months = ['january', 'february', 'march', 'april', 'may', 'jun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81323016", "0.8109424", "0.80464303", "0.8042689", "0.8009603", "0.8007148", "0.7999635", "0.7998743", "0.79891264", "0.7979305", "0.7974435", "0.7961534", "0.79565644", "0.79476094", "0.7946865", "0.7908892", "0.7908559", "0.7904986", "0.79014856", "0.7893825", "0.7889581...
0.764529
74
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() # display the most common month df['Start Time'] = pd.to_datetime(df['Start Time']) df['month'] = df['Start Time'].dt.month popular_month = df['month'].mode()[0] print('The most commo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.80247396", "0.80233026", "0.7915788", "0.78266186", "0.7822246", "0.78143597", "0.77659196", "0.7740343", "0.773628", "0.77344066", "0.76867086", "0.7668633", "0.7651731", "0.7644636", "0.76399267", "0.76367253", "0.7625196", "0.7623158", "0.7612803", "0.76002145", "0.7583...
0.7269479
60
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() # display most commonly used start station station_s=df['Start Station'].mode()[0] print('The most common start station:', station_s) # display most commonly used end station stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.7815675", "0.7662213", "0.7553417", "0.74914914", "0.74748665", "0.7446617", "0.7428588", "0.74237514", "0.74177027", "0.7400495", "0.7387161", "0.7385634", "0.73647535", "0.735934", "0.73566747", "0.73548365", "0.7351854", "0.7351274", "0.735057", "0.73421645", "0.7340198...
0.69770056
78
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # display total travel time total_duration=df['Trip Duration'].sum() print(total_duration) # display mean travel time mean_duration=df['Trip Duration'].mean() print(mean_duration) print...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.8142488", "0.802504", "0.8003995", "0.7949535", "0.7937111", "0.793114", "0.7926624", "0.79147255", "0.7913882", "0.7907699", "0.79052943", "0.7900545", "0.78914416", "0.7889074", "0.7886493", "0.7884836", "0.78822976", "0.78735834", "0.7868467", "0.7866015", "0.786337", ...
0.7884105
16
Returns nodes in nodeList which are also found from visible items.
def __getVisibleDumpNodes(self, nodeList): visibleNodesList = [] for visibleNode in self.currentState.findall('/*'): if visibleNode in nodeList: visibleNodesList.append(visibleNode) return visibleNodesList
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itervisible(self):\r\n return (x for x in self.iterall() if x.visible)", "def get_onscreen_nodes(self, graph_nodes, graph_corners):\n bottom_left = graph_corners[\"bottom_left\"]\n top_right = graph_corners[\"top_right\"]\n displayed_nodes = []\n for node in graph_nodes:\n ...
[ "0.6191649", "0.61300296", "0.60132754", "0.598446", "0.5973058", "0.5911363", "0.5887036", "0.58628905", "0.5779087", "0.5678764", "0.5678676", "0.5658043", "0.5653297", "0.56324023", "0.55945534", "0.55945534", "0.55945534", "0.5585437", "0.5577762", "0.5574191", "0.5565452...
0.7329222
0
Checks if point is inside the area.
def __isPointOnArea(self, point, area): pointX, pointY = point areaX,areaY,areaWidth,areaHeight = area if (pointX >= areaX and pointX <= areaX+areaWidth) and (pointY >= areaY and pointY <= areaY+areaHeight): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isInside(point_x, point_y, area_left, area_top, area_width, area_height):\n return (area_left <= point_x < area_left + area_width) and (area_top <= point_y < area_top + area_height)", "def insideArea(point, area):\n x=point.real\n y=point.imag\n n = len(area)\n inside = False\n p1x = area[0...
[ "0.8483719", "0.78407776", "0.7824319", "0.7771701", "0.7771701", "0.7686129", "0.758811", "0.7577771", "0.7577771", "0.7560199", "0.7516724", "0.7450646", "0.744459", "0.7415352", "0.7395527", "0.7382229", "0.7298693", "0.72819895", "0.7265682", "0.72601587", "0.7232983", ...
0.8778676
0
Checks if item is under status bar node.
def isItemInStatusBar(self, itemName): # try seeking image image = None if '/' in itemName: # if this is possibly a logical image name, try get the png name image = self._getImage(itemName) elif '.png' in itemName: image = itemName if image: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAlive(self):\n\n import wx\n\n if not fwidgets.isalive(self.parent):\n return False\n\n if isinstance(self.widget, wx.MenuItem):\n return fwidgets.isalive(self.menu)\n\n else:\n return fwidgets.isalive(self.widget)", "def is_status_dropdown_visib...
[ "0.5974627", "0.5483455", "0.54815763", "0.54495716", "0.54417586", "0.5412946", "0.53623086", "0.5341424", "0.5324679", "0.528243", "0.5275967", "0.5260092", "0.52555823", "0.5240228", "0.52298415", "0.5217563", "0.52022046", "0.5173356", "0.5172482", "0.5138362", "0.5133562...
0.747749
0
Returns height of statusbar
def __getStatusbarHeight(self): if self.currentState: statusbarNode = self.currentState.find('//statusbar') if statusbarNode: self.statusbarHeight = int(statusbarNode.getAttribute('coords').split(",")[3]) else: self.statusbarHeight = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self) -> int:\n return self.screen.getmaxyx()[0]", "def height(self):\n return(self.SCREEN_H)", "def menu_bar_height(self):\n # XXX The size hint is off by 1 pixel on Windows. What about\n # other platforms? Calling menuBar.height() here doesn't work\n # because th...
[ "0.73934215", "0.7146507", "0.71461445", "0.70575523", "0.7004772", "0.6976503", "0.6719888", "0.66348976", "0.65250176", "0.64741915", "0.6467096", "0.64663297", "0.64663297", "0.64663297", "0.64311516", "0.64189225", "0.64119846", "0.6395655", "0.6395655", "0.6395655", "0.6...
0.85646474
0
Clear text using backspacebutton in virtual keyboard
def backspace(self, number=0, doNotReport = False): if self.phone.isFullBlackBox(): if not self.blackBoxVkb: self.blackBoxVkb = BlackBoxVirtualKeyboard(self.phone) self.blackBoxVkb.backspace(times=number) return if not doNotReport: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backspace(entry):\n entry.delete_symbol()", "def delete_chr(text):\n \"\"\" if the user try to delete an empty line it will not allowed him:)\"\"\"\n if len(text.getText())<1:\n text.setText(\"\")\n return text\n else:\n text.setText(text.getText()[:-10]) # 10 is the le...
[ "0.731943", "0.72025913", "0.6991595", "0.6904566", "0.68431103", "0.6823535", "0.6741616", "0.66630244", "0.66280085", "0.65944254", "0.65479076", "0.6547558", "0.65420705", "0.6522866", "0.65187603", "0.64621216", "0.64558315", "0.6447901", "0.64295787", "0.64269745", "0.64...
0.7045059
2
internal function to retrieve a matching job id for job_name celery task (e.g., hs_core.tasks.create_bag_by_irods) from a specified celery job dictionary including active jobs, reserved jobs, and scheduled jobs. Active jobs and reserved jobs have the same dictionary format, while schedule jobs have a bit different form...
def _retrieve_task_id(job_name, res_id, job_dict): if job_dict: workers = list(job_dict.keys()) for worker in workers: for job in job_dict[worker]: if 'name' in job: if job['name'] == job_name: if res_id in job['args']: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _retrieve_job_id(job_name, res_id):\n active_jobs = celery_inspector.active()\n job_id = _retrieve_task_id(job_name, res_id, active_jobs)\n if not job_id:\n reserved_jobs = celery_inspector.reserved()\n job_id = _retrieve_task_id(job_name, res_id, reserved_jobs)\n if not job_id:\n...
[ "0.749015", "0.6708669", "0.6498497", "0.64466274", "0.6325868", "0.62780076", "0.6270872", "0.62649655", "0.626479", "0.626263", "0.6256141", "0.62498057", "0.61558545", "0.6142982", "0.6138941", "0.6131001", "0.61172235", "0.611006", "0.6107953", "0.6101227", "0.61002624", ...
0.75484824
0
r"""Call the list operations method over HTTP.
def __call__( self, request: operations_pb2.ListOperationsRequest, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _list(self, **kwargs):\n\n return self._make_request(**kwargs)", "def index():\n return make_json_response(ENDPOINT_LIST)", "def list(self):\n return self.request(\"GET\")", "def list(self, request):\n\n a_viewset = [\n 'Uses action (list, create, reteieve, update, part...
[ "0.750394", "0.72345656", "0.71966034", "0.6960108", "0.6957731", "0.68971574", "0.68971574", "0.68971574", "0.68971574", "0.68971574", "0.6850885", "0.6850885", "0.6829171", "0.68089885", "0.677977", "0.67791873", "0.67576295", "0.67576295", "0.67576295", "0.67576295", "0.67...
0.0
-1
Test the MsgVersion wire encode and decode for various protocol versions.
def test_VersionWire(): # verRelayTxFalse and verRelayTxFalseEncoded is a version message as of # BIP0037Version with the transaction relay disabled. verRelayTxFalse = baseVersionBIP0037() verRelayTxFalse.disableRelayTx = True verRelayTxFalseEncoded = baseVersionBIP0037Encoded() verRelayTxFalseE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_VersionWireErrors():\n # Use protocol version 60002 specifically here instead of the latest because\n # the test data is using bytes encoded with that protocol version.\n pver = 60002\n\n # Get a base version, and change the user agent to exceed max limits.\n bvc = baseVersion()\n exceed...
[ "0.69109744", "0.6527795", "0.6516498", "0.6410709", "0.6257993", "0.6255722", "0.6222077", "0.60945845", "0.5988695", "0.59852314", "0.5916656", "0.59074855", "0.59034663", "0.58952665", "0.58038473", "0.57968503", "0.5784908", "0.57691354", "0.5767198", "0.57452035", "0.574...
0.81781876
0
FETCHES the account balance for the authenticated user.
def get_account_balance(self): return int(self.request('get', 'fort/accounts')['balance'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_balance(self):\n return self._call_account_method(\n 'getBalance'\n )", "def authorized_get_account_balance(self, huid):\n acc = self.request('get', safeformat('fort/accounts/{:hex}', huid))\n return int(acc['balance'])", "def get_balance(self):\n r = reque...
[ "0.8052141", "0.7940275", "0.78531647", "0.77831286", "0.7749752", "0.77109885", "0.760394", "0.7587497", "0.755387", "0.7504781", "0.7497455", "0.74822396", "0.7480355", "0.7480355", "0.7476885", "0.7447644", "0.74198925", "0.7395723", "0.7389904", "0.7372493", "0.7343405", ...
0.800162
1
Creates Vingd user (profile & account), links it with the provided identities (to be verified later), and sets the delegateuser permissions (creator being the delegate). Returns Vingd user's `huid` (hashed user id).
def authorized_create_user(self, identities=None, primary=None, permissions=None): return self.request('post', 'id/users/', json.dumps({ 'identities': identities, 'primary_identity': primary, 'delegate_permissions': permissions }))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user(self, *args, **kwargs):\n user = User.objects.create_user(*args, **kwargs)\n return get_profile(user)", "def create_user(self):\n return User.objects.create_user(**self.user_data)", "def create_new_user(self):\n username = 'pseudo'\n email = 'carole@tests.com'...
[ "0.67311174", "0.6689909", "0.6633557", "0.65546554", "0.63425624", "0.6307033", "0.6301859", "0.62907606", "0.62854505", "0.62796086", "0.6278003", "0.6274424", "0.62621355", "0.6259391", "0.6257665", "0.62495583", "0.62495583", "0.62495583", "0.62495583", "0.62495583", "0.6...
0.66911
1
Compute the entropy for a diagonal Gaussian distribution.
def gaussian_entropy(log_std): return tf.reduce_sum(log_std + 0.5 * np.log(2.0 * np.pi * np.e), axis=-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(self, X):\n if isinstance(X, np.ndarray):\n X = pd.DataFrame(X, index=[str(i) for i in range(len(X))])\n K = self._posterior_covariance(X)\n L = np.linalg.cholesky(K)\n D = len(X)\n return np.sum(np.log(np.diag(L))) + 0.5 * D * np.log(2*np.pi*np.exp(1))", ...
[ "0.731719", "0.7224839", "0.7193137", "0.7116031", "0.71132463", "0.7058452", "0.7058318", "0.7029189", "0.7007923", "0.7004425", "0.7003803", "0.68979144", "0.68430084", "0.68120617", "0.6781213", "0.67537737", "0.6745347", "0.673312", "0.6730439", "0.66950405", "0.6677064",...
0.6839386
13
Generates an OpenID Connect ID token for a service account.
def GenerateIdToken(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):\n return self.rpc.call(MsfRpcMethod.AuthTokenGenerate)['token']", "def generate_token(self):\n self.__get_auth_token_and_secret()\n return self.get_token()", "def generate_token():\n return uuid4()", "def generateAuthToken(self):\n try:\n payl...
[ "0.68125063", "0.6705326", "0.6651493", "0.66225535", "0.66192704", "0.6555587", "0.6555587", "0.6542291", "0.64926434", "0.6455185", "0.64372045", "0.642733", "0.6404041", "0.6340431", "0.6311988", "0.62692636", "0.62690085", "0.62594205", "0.62009066", "0.6153982", "0.61015...
0.6514958
8
Get current storage backend
def get_storage_backend(self): return self.client.info()['Driver']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_backend():\n return _BACKEND", "def get_backend():\n return __SETTINGS__._BACKEND", "def backend(self):\n # This never changes (so no read locking needed).\n return self._backend", "def get_storage(self):\n return self.storage", "def getBackend(self):\n return self.h...
[ "0.77245086", "0.7543244", "0.74643683", "0.7432564", "0.735667", "0.7270066", "0.7269592", "0.71957856", "0.71957856", "0.71764857", "0.71272814", "0.7117252", "0.7117252", "0.71169734", "0.7092117", "0.7064129", "0.70309263", "0.70110196", "0.6972989", "0.6957128", "0.69541...
0.9084762
0
Get the container storage volume path
def get_storage_vol(self, cont_id, store_backend): if store_backend == 'devicemapper': dev_name = self.api.inspect_container( cont_id)['GraphDriver']['Data']['DeviceName'] with open('/proc/mounts') as mounts: mounts = mounts.read() mnt_re =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self):\n return self._container_dir", "def get_storage_path(target=False):\n resource_config = get_resource_config(target=target)\n deployment_dir = get_node_instance_dir(target=target)\n storage_path = resource_config.get('storage_path')\n if storage_path and storage_path is not depl...
[ "0.7043579", "0.68259627", "0.68091404", "0.6743419", "0.6702445", "0.6684674", "0.66223526", "0.66191924", "0.65854675", "0.64409286", "0.6435755", "0.64066064", "0.6361269", "0.6315192", "0.63143784", "0.6300697", "0.6281968", "0.6219981", "0.6210668", "0.61079556", "0.6021...
0.72967154
0
Get arguments from CLI
def get_args(): parser = argparse.ArgumentParser( description="""Run standard tree inference using raxml-light/examl""" ) parser.add_argument( "--phylip", required=True, type=is_file, action=FullPaths, help="""The phylip file you want to run raxml against.""" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cli_arguments(self):\n pass", "def get_args():\n\n parser = get_argument_parser()\n args = parser.parse_args()\n\n return args", "def parse_cli_args():\r\n parser = argparse.ArgumentParser(\r\n description=\"list all installed packages\")\r\n\r\n parser.add_argument(\"-v\",...
[ "0.83995515", "0.7696954", "0.7674078", "0.7656369", "0.75491726", "0.7546294", "0.7523218", "0.7521475", "0.7514517", "0.75119865", "0.74877495", "0.74807847", "0.74693704", "0.7466727", "0.74665916", "0.74520636", "0.74513096", "0.7427955", "0.7422721", "0.74211824", "0.740...
0.0
-1
AWS account ID for the launch permission.
def account_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "account_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id():\n return client.get_caller_identity()['Account']", "def accountId():\n # save the lookup if we set the account to the environment\n if \"AWS_ACCOUNT_ID\" in os.environ:\n return os.environ[\"AWS_ACCOUNT_ID\"]\n conn = iamConn()\n funcs = [\n lambda: conn.get_user()....
[ "0.673061", "0.653453", "0.65023845", "0.65023845", "0.64847326", "0.64200807", "0.6393889", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.634139", "0.62974966", "0.62974966", "0.62974966", "0.6277477", "0.6...
0.61912537
26
ARN of an organization for the launch permission.
def organization_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "organization_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organizational_unit_arn(self) -> Optional[pulumi.Input[st...
[ "0.74722975", "0.66299325", "0.66204137", "0.66204137", "0.6266184", "0.6190465", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224",...
0.74086875
2
ARN of an organizational unit for the launch permission.
def organizational_unit_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "organizational_unit_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organization_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_arn\")", "def management_account_arn(self) -> pulumi.Output[str]:\n ...
[ "0.7529855", "0.6542091", "0.6378845", "0.63642734", "0.63642734", "0.61301076", "0.61301076", "0.61301076", "0.61301076", "0.61301076", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", ...
0.74494874
1
AWS account ID for the launch permission.
def account_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "account_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id():\n return client.get_caller_identity()['Account']", "def accountId():\n # save the lookup if we set the account to the environment\n if \"AWS_ACCOUNT_ID\" in os.environ:\n return os.environ[\"AWS_ACCOUNT_ID\"]\n conn = iamConn()\n funcs = [\n lambda: conn.get_user()....
[ "0.673061", "0.653453", "0.65023845", "0.65023845", "0.64847326", "0.64200807", "0.6393889", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.63512766", "0.634139", "0.62974966", "0.62974966", "0.62974966", "0.6277477", "0.6...
0.61912537
27
ARN of an organization for the launch permission.
def organization_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "organization_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organizational_unit_arn(self) -> Optional[pulumi.Input[st...
[ "0.7473029", "0.6631884", "0.66223997", "0.66223997", "0.62663496", "0.61895424", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466", "0.6129466",...
0.7409483
1
ARN of an organizational unit for the launch permission.
def organizational_unit_arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "organizational_unit_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organization_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_arn\")", "def management_account_arn(self) -> pulumi.Output[str]:\n ...
[ "0.7529855", "0.6542091", "0.6378845", "0.63642734", "0.63642734", "0.61301076", "0.61301076", "0.61301076", "0.61301076", "0.61301076", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", ...
0.74494874
2
AWS account ID for the launch permission.
def account_id(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "account_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id():\n return client.get_caller_identity()['Account']", "def accountId():\n # save the lookup if we set the account to the environment\n if \"AWS_ACCOUNT_ID\" in os.environ:\n return os.environ[\"AWS_ACCOUNT_ID\"]\n conn = iamConn()\n funcs = [\n lambda: conn.get_user()....
[ "0.6730583", "0.6533911", "0.6502176", "0.6502176", "0.6484676", "0.64200604", "0.6394042", "0.63513505", "0.63513505", "0.63513505", "0.63513505", "0.63513505", "0.63513505", "0.63513505", "0.63513505", "0.6341447", "0.6296946", "0.6296946", "0.6296946", "0.6277986", "0.6210...
0.6117754
46
ARN of an organization for the launch permission.
def organization_arn(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "organization_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organization_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organization_arn\")", "def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]:\n r...
[ "0.74086875", "0.74086875", "0.66299325", "0.66204137", "0.66204137", "0.6266184", "0.6190465", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224", "0.6129224"...
0.74722975
0
ARN of an organizational unit for the launch permission.
def organizational_unit_arn(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "organizational_unit_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organizational_unit_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organizational_unit_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organizational_unit_arn\")", "def organization_arn(self) -> pulumi.Output[Optio...
[ "0.74494874", "0.74494874", "0.6542091", "0.6378845", "0.63642734", "0.63642734", "0.61301076", "0.61301076", "0.61301076", "0.61301076", "0.61301076", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", "0.61252874", ...
0.7529855
0
Return a custom 404 error.
def page_not_found(e): return 'Sorry, nothing at this URL.', 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found():\n return HttpError(404)", "def error_404(error):\n return '404 Error'", "def error_404(error):\n return 'Bummer, there is nothing at this URL.'", "def error_not_found(error):\n return 'No page here, dood. 404!', 404", "def not_found(self, error):\n return jsonify({'error': 'NO...
[ "0.8115719", "0.8041123", "0.7739078", "0.7737266", "0.7717824", "0.7688764", "0.76704776", "0.7609715", "0.7602159", "0.75695056", "0.75528574", "0.7545411", "0.7518652", "0.7474878", "0.74580294", "0.7454448", "0.745401", "0.74501854", "0.74424785", "0.7428265", "0.7405453"...
0.72666657
35
A generator of currentlyavailable actions for a particular player (assists validation).
def available_actions(self, colour): throws = self.throws[colour] isplayer = str.islower if colour == "lower" else str.isupper if throws < 9: sign = -1 if colour == "lower" else 1 throw_zone = ( (r, q) for r, q in self._SET_HEXES if sign * r >= 4 - throws ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def legal_actions(self):\n\n if self.player == TERMINAL: # is terminal\n return []\n elif self.player == CHANCE: # is chance\n if self.phase == PREFLOP: # preflop\n return [Action(deal=[i, j, k, l])\n for i in range(52) for j in range(52)...
[ "0.72856957", "0.6969715", "0.69145465", "0.6902022", "0.6820994", "0.6800434", "0.6715368", "0.66105497", "0.6574056", "0.65657026", "0.655319", "0.6543289", "0.6537551", "0.6512378", "0.642604", "0.63484806", "0.6338106", "0.6338106", "0.6336906", "0.630493", "0.630493", ...
0.6279755
25
Returns the base farmer reward at a certain block height. The base fee reward is 1/10 of total block reward Returns the coinbase reward at a certain block height. These halving events will not be hit at the exact times (3 years, etc), due to fluctuations in difficulty. They will likely come early, if the network space ...
def calculate_base_farmer_reward(height: uint32) -> uint64: if height == 0: return uint64(int((1 / 10) * 21000062 * _mojo_per_ethgreen)) elif height < 3 * _blocks_per_year: return uint64(int((1 / 10) * 20 * _mojo_per_ethgreen)) elif height < 6 * _blocks_per_year: return uint64(int((1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_base_farmer_reward(height: uint32) -> uint64:\n if height == 0:\n return uint64(int((1 / 8) * 21000000 * _mojo_per_chia))\n elif height < 3 * _blocks_per_year:\n return uint64(int((1 / 8) * 2 * _mojo_per_chia))\n elif height < 6 * _blocks_per_year:\n return uint64(int((1...
[ "0.7680895", "0.6885281", "0.63283885", "0.6262758", "0.61395097", "0.59923863", "0.59444034", "0.58058274", "0.5794616", "0.57711864", "0.5696624", "0.5672393", "0.55876935", "0.5580621", "0.5568555", "0.55141014", "0.5490306", "0.5452737", "0.5429339", "0.54144615", "0.5411...
0.771491
0
Reset arrays and the stored histogram
def reset_arrays(self): super().reset_arrays() self.bins = self.bin_array self.occs = np.zeros(len(self.bins),dtype=int) if np.size(self.bins) else []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\r\n self.buffer = np.zeros(self.nBins)\r\n self.counter = 0", "def reset(self):\n self.table[:, :] = 0\n self.counts[:] = 0\n self.names = []\n self.hashesperid.resize(0)\n self.dirty = True", "def reset(self):\n self.curr_idx = 0\n ...
[ "0.76720494", "0.7507554", "0.7450933", "0.7355342", "0.7341363", "0.73234266", "0.7300021", "0.729677", "0.7249146", "0.7171039", "0.7020832", "0.6990799", "0.698375", "0.6976004", "0.6950951", "0.69494426", "0.693136", "0.6918292", "0.6911276", "0.68780595", "0.68557477", ...
0.7758622
0
Returns X,Y partioned into test and train sets as row vectors.
def load_data(data_dir, split=1.0): n = 123 * 41 positive_examples = glob.glob(data_dir + '/positive_set/*.png') negative_examples = glob.glob(data_dir + '/negative_set/*.png') x = np.zeros((n, len(positive_examples) + len(negative_examples))) for k in range(len(positive_examples)): x[:,k] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getInstances(X_train,X_test,x_values,y_values):\n\n newTrain = []\n yTrain = []\n for i, train in enumerate(X_train): #loop through each train\n newTrain.append([])\n yTrain.append([])\n for index in train: #loop through each index\n newTrain[i].append(x_values[index])\...
[ "0.6941707", "0.6861946", "0.6844256", "0.67182714", "0.6681799", "0.66439235", "0.6640851", "0.65880394", "0.65516865", "0.6549463", "0.6549463", "0.65432405", "0.6425558", "0.64175075", "0.6388559", "0.6382048", "0.6360777", "0.6338826", "0.633753", "0.633238", "0.6299577",...
0.0
-1
run the steep gradient descent and updates the feature vector accordingly_
def run_steep_gradient_descent(data_x, data_y, len_data, alpha, theta): n = len_data # WE NEED TO transpose data_x into (p+1) *n ,theta is 1*(p+1) prod = np.dot(theta, data_x.transpose()) prod -= data_y print("pro: data_x", prod.shape, data_x.shape) #prod represent the loss of the hypothesis a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient_descent(self, X ,eta, tol,iter):\n gd=[]\n gd_x=[X]\n iteration=0\n # current_pt=X\n first_derivative=sym.diff(self.gdfunc)\n #print(first_derivative)\n x=sym.Symbol('x')\n first_derivative=sym.lambdify(x,first_derivative)\n learn_rate=eta...
[ "0.6919268", "0.6835989", "0.6796515", "0.678801", "0.66550475", "0.6613581", "0.65443027", "0.6537473", "0.6522454", "0.64984685", "0.64665616", "0.6432475", "0.6415778", "0.6399757", "0.6389926", "0.63830435", "0.63788575", "0.635993", "0.63427454", "0.633885", "0.63318604"...
0.70412004
0
Returns the complete filename of the gppkg
def get_filename(self): return self.get_package_name() + '-' + self.os + '-' + self.arch + GPPKG_EXTENSION
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n gppkg_spec_file = '''\nPkgName: ''' + self.name + '''\nVersion: ''' + self.version + '''\nGPDBVersion: ''' + self.gpdbversion + '''\nDescription: Temporary Test Package\nOS: ''' + self.os + '''\nArchitecture: ''' + self.arch\n\n return gppkg_spec_file", "def bkg_file(self):\n ...
[ "0.6836651", "0.67604595", "0.6589166", "0.6589166", "0.6387277", "0.6356686", "0.62559867", "0.61791956", "0.61769843", "0.60773635", "0.6065828", "0.6019408", "0.6016466", "0.59988505", "0.59789366", "0.59729147", "0.59323245", "0.5927042", "0.5916175", "0.5909429", "0.5898...
0.7743649
0
Returns the rpm spec file as a string
def __str__(self): rpm_spec_file = ''' %define _topdir %(pwd) %define __os_install_post %{nil} Summary: Temporary test package License: GPLv2 Name: ''' + self.name + ''' Version: ''' + self.version + ''' Release: ''' + self.release + ''' Group: Development/Tools ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filename(self):\n return self.get_package_name() + '.' + ARCH + \".rpm\"", "def __str__(self):\n gppkg_spec_file = '''\nPkgName: ''' + self.name + '''\nVersion: ''' + self.version + '''\nGPDBVersion: ''' + self.gpdbversion + '''\nDescription: Temporary Test Package\nOS: ''' + self.os + '''\...
[ "0.6670639", "0.6433855", "0.6353967", "0.62925345", "0.6057277", "0.59381396", "0.58980983", "0.5856129", "0.5855957", "0.5761062", "0.57462275", "0.572442", "0.5670036", "0.56660885", "0.56569576", "0.56569576", "0.56569576", "0.56569576", "0.56569576", "0.56569576", "0.565...
0.71635324
0
Whether this message should be encrypted. So far the criteria used to determine if the message should be encrypted is the pii information. Include additional criteria if necessary.
def _should_be_encrypted(self): if self._should_be_encrypted_state is not None: return self._should_be_encrypted_state self._should_be_encrypted_state = self.contains_pii return self._should_be_encrypted_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypted(self) -> Optional[bool]:\n return pulumi.get(self, \"encrypted\")", "def encrypted(self) -> Optional[bool]:\n return pulumi.get(self, \"encrypted\")", "def encrypted(self):\n return self.encryption_type is not None", "def aes_encryption(self) -> Optional[pulumi.Input[bool]]:\n ...
[ "0.7377962", "0.7377962", "0.70198", "0.6152012", "0.6102135", "0.58753145", "0.5825344", "0.5818908", "0.5801561", "0.56906086", "0.5685876", "0.5551533", "0.53881675", "0.5369593", "0.5367249", "0.5364299", "0.5364299", "0.53150374", "0.52829695", "0.5232581", "0.5224748", ...
0.7440046
0
The kafka offset, partition, and key of the message if it was consumed from kafka. This is expected to be None for messages on their way to being published.
def kafka_position_info(self): return self._kafka_position_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_message(self, topic_name, offset):\n try:\n return self.topics[topic_name][offset]\n except Exception:\n return None", "def current_offset(client, topic, partition, kafka_broker=None):\n try:\n offsets, = client.send_offset_request([OffsetRequestPayload(topi...
[ "0.6046713", "0.6001563", "0.5965681", "0.57896656", "0.55021614", "0.5459544", "0.54533", "0.5337713", "0.5303417", "0.5292401", "0.52535343", "0.5164686", "0.5152776", "0.50953954", "0.507616", "0.50486326", "0.5042511", "0.5042511", "0.5042511", "0.5042511", "0.5042511", ...
0.68136567
0
Index page for the app
def index(request): form_class = FlightCheckForm return render(request, 'presentation/index.html', { 'form': form_class, })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n return render_template('index.html')", "def index():\r\n return render_template('index.html')", "def index():\n\n\treturn(render_template('index.html'))", "def index():\n return render_template('index.html')", "def index():\n return render_template('index....
[ "0.8653464", "0.8653358", "0.86374354", "0.8622797", "0.8622797", "0.859077", "0.8581437", "0.8549043", "0.85386735", "0.84793085", "0.84552985", "0.84552985", "0.8448752", "0.84476846", "0.8410628", "0.83971375", "0.8384841", "0.83448076", "0.8324336", "0.8324336", "0.832433...
0.0
-1
Return string representation of this feed.
def __repr__(self): return '<{}(home={}, url={}, radius={}, categories={})>'.format( self.__class__.__name__, self._home_coordinates, self._url, self._filter_radius, self._filter_categories)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_string(self):\n return self.__repr__()", "def __str__(self):\n return '\\n\\n'.join(str(item) for item in self._data)", "def to_str(self):\n return '\\n'.join(str(entry) for entry in self)", "def serialize(self):\n\n return str(self)", "def to_str(self):\n return p...
[ "0.7537189", "0.7309406", "0.7297117", "0.7213547", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "0.7208946", "...
0.0
-1
Return the attribution of this entry.
def attribution(self) -> Optional[str]: return ATTRIBUTION
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_from_entry(self, entry):\n info = super().info_from_entry(entry)\n return info", "def format_attribution(attribution):\n (attribution, additional_restrictions, extra_attrs_set) = attribution\n extra_attrs = \"\\n\".join(\"<p>%s</p>\" % attr for attr in extra_attrs_set)\n return '<...
[ "0.6198795", "0.60048234", "0.57248205", "0.5623329", "0.5612462", "0.5612462", "0.5612462", "0.5599379", "0.5599379", "0.55584157", "0.55193067", "0.5516732", "0.5495592", "0.5487727", "0.5481997", "0.5469272", "0.54482573", "0.5447004", "0.5441253", "0.54380405", "0.5429029...
0.7242756
0
Return the title of this entry.
def title(self) -> str: return self._search_in_properties(ATTR_TITLE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title(self):\n return self.get(self._names[\"title\"])", "def title(self):\n return self.get(self._names[\"title\"])", "def get_title(self):\n\n return self._title", "def title(self):\n return self.__values['title']", "def get_title(self):\n return self._title", "de...
[ "0.8345656", "0.8345656", "0.828738", "0.82715714", "0.82695913", "0.82695913", "0.82695913", "0.82653916", "0.8215805", "0.8206808", "0.8196051", "0.8188343", "0.8188343", "0.8188343", "0.8188343", "0.8188343", "0.8188343", "0.8185289", "0.81744504", "0.81744504", "0.8174450...
0.7946449
52
Return the description of this entry.
def description(self) -> str: return self._search_in_properties(ATTR_DESCRIPTION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self) -> str:\n return self.data['description']", "def get_description(self):\n return DisplayText(self._description)", "def description(self):\n\n return self._get_field(\"description\")", "def getDescription(self):\n return self.description", "def description(s...
[ "0.84376496", "0.8392307", "0.8352454", "0.83094186", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", "0.8307878", ...
0.8202629
83
Return the location of this entry.
def location(self) -> str: return self._search_in_description(REGEXP_ATTR_LOCATION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\r\n return self.__location", "def get_location(self):\n return self.location", "def get_location(self) -> tuple:\n return self.__location", "def location(self):\n return self._location", "def location(self):\n return self._location", "def get_loc...
[ "0.7792907", "0.7715424", "0.77057266", "0.7695005", "0.7695005", "0.765127", "0.763714", "0.763714", "0.763714", "0.7567372", "0.75660497", "0.75515634", "0.7517319", "0.73380685", "0.7302129", "0.72863", "0.7280259", "0.7268651", "0.7259221", "0.71796286", "0.7110518", "0...
0.6693567
81
Return the council area of this entry.
def council_area(self) -> str: return self._search_in_description(REGEXP_ATTR_COUNCIL_AREA)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_area(self):\n return self._area", "def area(self):\n return _cantera.wall_area(self.__wall_id)", "def get_area(self):\n raise NotImplementedError()", "def area(self) -> ir.FloatingValue:\n return ops.GeoArea(self).to_expr()", "def getArea(self):\n return None", ...
[ "0.7380801", "0.71887845", "0.68477094", "0.6807041", "0.67806876", "0.67806876", "0.67181325", "0.6661454", "0.65517133", "0.6455968", "0.64031446", "0.6386417", "0.63736993", "0.6370824", "0.6364866", "0.6357767", "0.6349171", "0.6324751", "0.6314489", "0.6304576", "0.62982...
0.85226274
0
Return the status of this entry.
def status(self) -> str: return self._search_in_description(REGEXP_ATTR_STATUS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.get(self._names[\"status\"])", "def get_status(self):\n return self._status", "def status(self):\n return self._data['status']", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(s...
[ "0.8414215", "0.83891696", "0.838711", "0.8359924", "0.8359924", "0.8359924", "0.8318561", "0.8292346", "0.82902974", "0.8283693", "0.8279153", "0.82775193", "0.82775193", "0.82775193", "0.82775193", "0.82775193", "0.82775193", "0.82775193", "0.82775193", "0.82775193", "0.827...
0.0
-1
Return the type of this entry.
def type(self) -> str: return self._search_in_description(REGEXP_ATTR_TYPE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self):\n return self._getValue('type')", "def get_type(self):\n return self.type", "def get_type(self):\n return self.type", "def get_type(self):\n return self._type", "def get_type(self):\n return self._type", "def getType(self):\n return self.type_", ...
[ "0.8208737", "0.8076819", "0.8076819", "0.8058446", "0.8058446", "0.8012878", "0.8008621", "0.7983586", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "0.7974285", "...
0.0
-1
Return if this entry represents a fire or not.
def fire(self) -> bool: return self._search_in_description(REGEXP_ATTR_FIRE) == 'Yes'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_triggered_fire(self):\n return self == ArmingState.ALARMING_FIRE_SMOKE", "def in_fire(self):\n Fire=False\n if self.state>0 and self.state<=5:\n Fire=True\n return Fire", "def is_food(self) -> bool:\n return self in (self.off, self.off_pro)", "def time_to_...
[ "0.6493008", "0.6328547", "0.617806", "0.60281575", "0.5973896", "0.58901846", "0.58683324", "0.58683324", "0.58485836", "0.5756447", "0.5751365", "0.5699225", "0.56945336", "0.5691683", "0.5641908", "0.5633904", "0.5630512", "0.56003684", "0.5577606", "0.5566234", "0.5562791...
0.7300664
0
Return the size of this entry.
def size(self) -> str: return self._search_in_description(REGEXP_ATTR_SIZE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_size(self) -> int:\n total_size = 0\n for entry in self.__entries:\n total_size += entry.get_size()\n return total_size", "def getLength(self):\n return len(self.entries)", "def get_size(self) -> int:\n return self.__size", "def size(self) -> int:\n ...
[ "0.8634911", "0.83259577", "0.82743067", "0.8247986", "0.8247986", "0.8247986", "0.8247986", "0.8247986", "0.82321244", "0.82321244", "0.82321244", "0.82321244", "0.82321244", "0.82185453", "0.8208262", "0.8208262", "0.8208262", "0.8208262", "0.8208262", "0.8208262", "0.82082...
0.0
-1
Return the responsible agency of this entry.
def responsible_agency(self) -> str: return self._search_in_description(REGEXP_ATTR_RESPONSIBLE_AGENCY)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def honorific(self):\n\n return self._honorific", "def Agency(self, default=None):\n return self.data.get('agency', default)", "def getAgility(self):\n return self.ag", "def get_score_owner(self) -> Address:\n return self.owner", "def getAccidental(self):\n return sel...
[ "0.6425821", "0.61815757", "0.6042167", "0.60309654", "0.59888965", "0.5944114", "0.5929823", "0.580151", "0.57670677", "0.5756494", "0.56476384", "0.5611111", "0.56085956", "0.55958444", "0.5577956", "0.55708975", "0.5561138", "0.55135924", "0.54881936", "0.5473718", "0.5460...
0.75301427
0
takes a list of integers as input and returns True if the there is no duplicate items otherwise return False
def is_unique(L): for i in range(len(L)): for j in range(len(L)): if (i!=j)and (L[i]==L[j]): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_duplicates(list):\n for i in list:\n if list.count(i) > 1:\n return True\n else:\n return False", "def has_duplicates(items):\n items = list()\n items.sort()\n for i in range(len(items) - 1):\n if items[i] == items[i + 1]:\n return True\n ...
[ "0.83352244", "0.8143923", "0.8136132", "0.8080558", "0.79697365", "0.7839335", "0.7833106", "0.7818876", "0.76987725", "0.7673785", "0.7671918", "0.7667635", "0.7601926", "0.753676", "0.7516659", "0.7422831", "0.74044794", "0.7296918", "0.7197087", "0.71513706", "0.7135888",...
0.69132817
33
Check that ``x`` has no duplicate elements.
def is_unique(x): return len(set(x)) == len(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_no_duplicates(examples):\n return len(examples) == len(set(examples))", "def has_duplicates_set(L):\r\n return len(L) != len(set(L))", "def has_duplicates(l):\r\n return len(set(l)) < len(l)", "def is_unique_value(x: List[dict], key):\n return len(x) == len(set([v[key] for v in x]))...
[ "0.70385677", "0.6670744", "0.6655209", "0.64610076", "0.63938445", "0.62859946", "0.6235868", "0.62077695", "0.6196898", "0.6180783", "0.61386204", "0.61061513", "0.6094813", "0.6061544", "0.60269463", "0.5977905", "0.59601", "0.5952945", "0.5924422", "0.59243673", "0.591593...
0.7788755
0
Test case for array_of_enums
def test_array_of_enums(self): from petstore_api.model import array_of_enums, string_enum endpoint = self.api.array_of_enums assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,) assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_additional_properties_with_array_of_enums(self):\n pass", "def test_test_enum_parameters(self):\n pass", "def test_enum_datatypes(self) -> None:\n directory = os.path.join(PAYLOAD_DIRECTORY, 'enum_payloads')\n type_name = 'NULL'\n\n def get_id(type_: Dict[str, str]) ...
[ "0.83671737", "0.7173962", "0.7173662", "0.6967338", "0.6788053", "0.67861116", "0.67525107", "0.6480592", "0.64801264", "0.6460698", "0.64120245", "0.6377749", "0.6335385", "0.6285813", "0.6264646", "0.62335694", "0.62104416", "0.6157218", "0.6126124", "0.6087212", "0.608158...
0.7533772
1
Return whether `other` is equal to `self`.
def equals(self, other: Schema) -> bool: if not isinstance(other, Schema): raise TypeError( f"invalid equality comparison between Schema and {type(other)}" ) return self.__cached_equals__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n if other != None:\n return self == other\n else:\n return False", "def __eq__(self, other):\n if other != None:\n ...
[ "0.86491597", "0.86491597", "0.854738", "0.854738", "0.8474165", "0.84631306", "0.8452681", "0.8449483", "0.84473795", "0.84290755", "0.84290755", "0.84053004", "0.83532363", "0.8346449", "0.83375067", "0.83325887", "0.8330618", "0.8330618", "0.8329669", "0.8322861", "0.83128...
0.0
-1
Return the name of a schema column at position `i`.
def name_at_position(self, i: int) -> str: upper = len(self.names) - 1 if not 0 <= i <= upper: raise ValueError(f'Column index must be between 0 and {upper:d}, inclusive') return self.names[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_column(self, i):\n return self.__column_list[i]", "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 name_at_position(self, i: int) -> str:\n ...
[ "0.7554233", "0.6253363", "0.6253363", "0.6199214", "0.6171738", "0.61690795", "0.60926527", "0.60854715", "0.60502803", "0.5991299", "0.5967933", "0.596589", "0.5952607", "0.59414124", "0.5929768", "0.5908907", "0.58810186", "0.5862473", "0.5850232", "0.5824398", "0.58039063...
0.75307804
1
Returns index of a bin where xs belongs, where x is a list of bins
def torch_searchsort(x, xs): x = torch.cat((torch.tensor([-10.0]), x, torch.tensor([10000.0]))) ind = 0 for i in range(1, len(x) - 1): if x[i-1] < xs and xs <= x[i]: return i - 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bin_index(signal, bins):\n\t# could do this binary search-like at least\n\tindex = 0\n\tfor v in bin_bounds:\n\t\tif signal > v:\n\t\t\treturn index\n\t\tindex += 1\n\treturn index - 1", "def bin_index(self, xnorm):\n return _bin_index(xnorm, self.nbins, self.padding)", "def compute_bin_indices(...
[ "0.7391426", "0.71688503", "0.70027405", "0.68782103", "0.6870763", "0.6785535", "0.6691197", "0.65543705", "0.6503112", "0.64792454", "0.64708", "0.64376825", "0.64133316", "0.63161343", "0.6266589", "0.62574714", "0.6239283", "0.6239283", "0.60969806", "0.6019304", "0.60163...
0.54970753
81
Sample random value from a von Mises distribution fitted to a histogram
def randvonmises(anglegram, i, kappa_scalar=8, random_state=1): np.random.seed(random_state) xtorsion = torch.linspace(-np.pi, np.pi, 36) vmexp = torch.sum(xtorsion * anglegram[0, 1:, 0, i]) vmvar = torch.sum(anglegram[0, 1:, 0, i] * (xtorsion - vmexp) ** 2) vmkappa = 1 / vmvar ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_uniform(self):\r\n\r\n s = np.random.uniform(-1.35, 0.5, 5000)\r\n plt.hist(s, 30, density=False)\r\n plt.xlabel('Interlayer point energy [eV]')\r\n plt.ylabel('Frequency')\r\n plt.show()", "def test_normal(self):\r\n s = np.random.normal(-0.42, 0.55, 5000)\r\n ...
[ "0.6963822", "0.65853703", "0.62960523", "0.62359047", "0.62278897", "0.61735314", "0.6134931", "0.6064081", "0.5946754", "0.5934482", "0.59331197", "0.59005064", "0.5896745", "0.5893346", "0.58801866", "0.5874006", "0.5851217", "0.58503485", "0.58426416", "0.58408666", "0.58...
0.0
-1
Copy the model training history file as a csv file.
def WriteDictToCSV(csv_file,csv_columns,dict_data): with open('history.csv','wb') as csvfile: w = csv.writer(csvfile) w.writerows(dict_data.items()) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_history_to_csv_file(metaparams, history, csv_file):\n csv_writer = csv.writer(csv_file, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)\n for i in range(len(history.history['loss'])):\n training_perfs = [i+1, history.history['loss'][i], history.history['acc'][i], history.history['val...
[ "0.7263024", "0.7244534", "0.7088507", "0.70264167", "0.6847479", "0.66824704", "0.65927535", "0.643109", "0.64199144", "0.63582534", "0.63496315", "0.62587714", "0.6228208", "0.6134749", "0.6042544", "0.6006235", "0.596098", "0.59586155", "0.5953686", "0.59426624", "0.592853...
0.0
-1
Simple function to get a list of stripped lines from a file.
def _fileLinesToList(filename) : o = [] with open(filename, "r") as fi : for l in fi : if l.strip() != "" : o.append(l.strip()) return o
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readFile(filePath):\n with open(filePath, 'r') as f:\n return [l.strip() for l in f.readlines()]", "def _strip_comments(file_contents):\n lines_without_comments = []\n for line in file_contents:\n comment_position = line.find(COMMENT_INDICATOR)\n if comment_position != -1:\n ...
[ "0.72306424", "0.7225609", "0.71439695", "0.7085142", "0.7079666", "0.70322967", "0.7013946", "0.6966945", "0.69557065", "0.69428813", "0.6937935", "0.6912145", "0.69058216", "0.68987983", "0.68588674", "0.68529654", "0.68398416", "0.67880785", "0.6784584", "0.6772384", "0.67...
0.8031707
0
Return the number of documents in the collection.
def __len__(self): raise NotImplementedError() # pragma: no cover
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doc_count(self):\n\t\treturn self.index.collection.count()", "def dataCount(self, collectionName):\n count = collectionName.find().count()\n return count", "def get_count(self):\n connection = self.__get_database_connection()\n response = self.__make_request(connection, '/%s' % (self.da...
[ "0.84596354", "0.8087985", "0.79813987", "0.7949894", "0.7917015", "0.77300704", "0.76995903", "0.7632099", "0.760615", "0.74925363", "0.7487783", "0.7323223", "0.72955585", "0.72351533", "0.71950835", "0.71930176", "0.7161616", "0.71081674", "0.70914626", "0.70383906", "0.70...
0.0
-1
Assign a custom ``_get_measurable_outputs`` dispatch function to a measurable variable instance. The node is cloned and a custom `Op` that's a copy of the original node's `Op` is created. That custom `Op` replaces the old `Op` in the cloned node, and then a custom dispatch implementation is created for the clone `Op` i...
def assign_custom_measurable_outputs( node: Apply, measurable_outputs_fn: Callable = noop_measurable_outputs_fn, type_prefix: str = "Unmeasurable", ) -> Apply: new_node = node.clone() op_type = type(new_node.op) if op_type in _get_measurable_outputs.registry.keys() and isinstance(op_type, Unme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_measurable_outputs(op: Op, node: Apply) -> List[Variable]:\n if isinstance(op, MeasurableVariable):\n return _get_measurable_outputs(op, node)\n else:\n return []", "def op_convert_after_hook(\n self,\n op: Callable,\n output,\n global_op_idx: List[int],\n ...
[ "0.52684104", "0.5164222", "0.51494336", "0.5086142", "0.49548742", "0.48555547", "0.4839307", "0.48031414", "0.46365583", "0.46242976", "0.4612498", "0.46020856", "0.4562273", "0.45573407", "0.455493", "0.44791928", "0.44696432", "0.44373396", "0.44041702", "0.44010442", "0....
0.79359454
0
Create a mapping from the probe and electrode id to the row number of the electrodes table. This is used in the construction of the DynamicTableRegion that indicates what rows of the electrodes table correspond to the data in an ElectricalSeries.
def get_electrodes_mapping(electrodes): return { ( electrodes["group"][idx].device.name, electrodes["id"][idx], ): idx for idx in range(len(electrodes)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_key(self, reindex_dict):\n reindexed_marks = []\n for m in self.component1.marks:\n new_m = reindex_dict.get(m)\n if new_m == None:\n if len(reindex_dict) == 0:\n new_m = 0\n else:\n new_m = max(reinde...
[ "0.5856929", "0.56331146", "0.56234837", "0.5523431", "0.5404992", "0.53718156", "0.53213555", "0.5294005", "0.5292453", "0.5270366", "0.5077577", "0.5061778", "0.50615317", "0.5028123", "0.50062793", "0.4999126", "0.49976575", "0.49920195", "0.4984181", "0.4984181", "0.49734...
0.642383
0
Take a single argument, groups, a list of groups, which is a list of cards. Return a Boolean indicating whether all groups are valid or not
def comp10001go_valid_groups(groups): if len(groups) == 0: return True else: for cards in groups: if comp10001go_score_group(cards) < 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_all(self, groups):\n for group in groups:\n if not self._check_group(group):\n return False\n return True", "def _check_groups_support(self, groups=()):\n available_groups = set(self.df[self.col_group].unique())\n for group in groups:\n ...
[ "0.78189325", "0.71907336", "0.6966542", "0.6851445", "0.65457386", "0.62960017", "0.6272189", "0.62270635", "0.6130827", "0.6126155", "0.61214006", "0.61156225", "0.61077696", "0.6086979", "0.6072103", "0.6036542", "0.6018033", "0.59044975", "0.586869", "0.5854905", "0.58371...
0.83428794
0
Returns the left subtree of the Tree self
def get_left(self): return self.__left
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_left(self):\n return BinaryNode.or_none(self.left)", "def left_root(self):\n return self.left_child(self.virtual_root)", "def get_left_node(self):\n\t\tif self.left_child == None:\n\t\t\t# if we are at the end of a branch\n\t\t\tlowest_right_parent = self.get_lowest_right_parent()\n\t\t\t...
[ "0.83547115", "0.82174784", "0.80674964", "0.79695034", "0.7849064", "0.78173876", "0.78173876", "0.777684", "0.7746514", "0.7699593", "0.76538014", "0.7639311", "0.76253617", "0.75613594", "0.7476358", "0.74613243", "0.7400087", "0.7375694", "0.73369706", "0.7307113", "0.729...
0.81442285
2
Returns the right subtree root of the Tree self
def get_right(self): return self.__right
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_right(self):\n return BinaryNode.or_none(self.right)", "def get_right_node(self):\n\t\tif self.right_child == None:\n\t\t\t# if we are at the end of a branch\n\t\t\tlowest_left_parent = self.get_lowest_left_parent()\n\t\t\tif lowest_left_parent.parent == None:\n\t\t\t\t# if this was called from ri...
[ "0.77633584", "0.76370984", "0.72768205", "0.7249799", "0.72038996", "0.7160854", "0.71579593", "0.7150772", "0.6994499", "0.6969119", "0.6961638", "0.6961638", "0.6893926", "0.6855626", "0.67882234", "0.6628811", "0.66220385", "0.65893465", "0.6582339", "0.6554152", "0.65219...
0.73606575
2
Returns the amount of nodes in the Tree self
def count_nodes(self): if self.is_empty(): return 0 elif self.is_leaf(): return 1 else: if self.get_left(): if self.get_right(): return 1 + self.get_left().count_nodes() + self.get_right().count_nodes() else:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self):\n return self.__tree.node_count", "def count_nodes(self):\n if self.children is None:\n return 0\n\n total_count = 0\n for child in self.children:\n if child is None:\n return 0\n child_count = child.count_nodes()\n ...
[ "0.8338416", "0.8294335", "0.82845664", "0.8269646", "0.8234724", "0.82194054", "0.8160795", "0.8112656", "0.8109075", "0.8103326", "0.8044327", "0.80437356", "0.80437356", "0.8041613", "0.80054057", "0.79791635", "0.79675114", "0.79567266", "0.7927568", "0.79252064", "0.7918...
0.8445941
0
Returns the number of leaf in the tree self
def count_leaf(self): if self.is_empty(): return 0 elif self.is_leaf(): return 1 else: if self.get_left(): if self.get_right(): return 0 + self.get_left().count_leaf() + self.get_right().count_leaf() else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaf_count(self) -> int:\n if self.children == []:\n return 1\n else:\n return sum([x.leaf_count() for x in self.children])", "def count_leaves(self) -> int:\n # binary search tree == empty\n if self.root is None:\n return 0\n\n #recursive h...
[ "0.8412103", "0.78919804", "0.784241", "0.7780788", "0.75118184", "0.73116416", "0.7215212", "0.71880996", "0.7176737", "0.70690155", "0.7054718", "0.70193857", "0.6964752", "0.69204676", "0.68890953", "0.68821776", "0.6874985", "0.685049", "0.68296224", "0.6817744", "0.68149...
0.8442853
0
Splits a Pandas dataframe into three subsets (train, val, and test). Function uses train_test_split (from sklearn) and stratify to receive the same ratio response (y, target) in each splits. Args data (dataframe)
def train_validation_test_split(col_stratify='Kind of offensive language', train_percent=0.6, validate_percent=0.2, test_percent=0.2, random_state=101): data = pd.read_csv('cleaned_data.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_val_test_split(df):\n from sklearn.model_selction import train_test_split\n train, test = train_test_split(df, train_size = 0.80, test_size=0.20,\n random_state = 42)\n train, val = train_test_split(train, train_size = 0.70, val_size=0.30)\n print(train.shape, val.shape, test.shape)\n\n ...
[ "0.78385437", "0.78236824", "0.7683612", "0.7671954", "0.7671804", "0.7634413", "0.7595588", "0.75761956", "0.7526507", "0.75093204", "0.7496346", "0.7489588", "0.74887574", "0.74218714", "0.740286", "0.7400825", "0.7392323", "0.73499936", "0.73310477", "0.7288859", "0.724243...
0.74819833
13
Plot confusion matrix with part of 1 value
def plot_confusion_matrix_percent(self): plt.figure(figsize=(10, 10), facecolor='w') cm = confusion_matrix(self.y_val, self.y_pred) cm_norm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] df_cm = pd.DataFrame(cm_norm) sns.heatmap(df_cm, annot=True, cmap="Blues", cbar=False) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def confusion_matrix(y_true, y_pred):\n skplt.plot_confusion_matrix(y_true, y_pred, normalize=True)\n plt.show()", "def plot_confusion_matrix(cm,...
[ "0.807526", "0.79772776", "0.773161", "0.77096397", "0.76746887", "0.7660477", "0.76536644", "0.76535493", "0.7641164", "0.76361", "0.7630391", "0.76110554", "0.75915366", "0.757789", "0.757789", "0.75776225", "0.756955", "0.756352", "0.75554216", "0.7549354", "0.75433826", ...
0.7554634
19
Overwrites the nil_slot (first row) of the input Tensor with zeros. The nil_slot is a dummy slot and should not be trained and influence the training algorithm.
def zero_nil_slot(t, name=None): # 参数t是一个梯度 # we have found it helpful to add “dummy”memories to regularize TA. That is, at training time we can randomly add 10% of empty memoriesto the stories with tf.op_scope([t], name, "zero_nil_slot") as name: t = tf.convert_to_tensor(t, name="t")# shape of t ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_nil_slot(t, name=None):\n\twith tf.name_scope(name, \"zero_nil_slot\", [t]) as name:\n\t\tt = tf.convert_to_tensor(t, name=\"t\")\n\t\ts = tf.shape(t)[1]\n\t\tz = tf.zeros(tf.pack([1, s]))\n\t\treturn tf.concat(0, [z, tf.slice(t, [1, 0], [-1, -1])], name=name)", "def zero_nil_slot(t, name=None):\n wi...
[ "0.78301525", "0.77138686", "0.7585104", "0.65659636", "0.62051386", "0.6193775", "0.61050993", "0.60971063", "0.6095118", "0.6093879", "0.60226727", "0.5921219", "0.5920391", "0.5907843", "0.59039694", "0.58477336", "0.58266574", "0.58228636", "0.57792306", "0.57587", "0.573...
0.7400565
3
Predicts answers as onehot encoding.
def predict(self, stories, queries, memory_value): feed_dict = {self._stories: stories, self._queries: queries, self._memory_value: memory_value} return self._sess.run(self.predict_op, feed_dict=feed_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_encoding(labels, num_classes=10):\n num_labels = labels.shape[0]\n encoded = np.zeros((num_labels, num_classes))\n encoded[np.arange(num_labels), labels[np.arange(num_labels)]] = 1\n \n return encoded", "def one_hot_encoding(data):\r\n encoder = LabelEncoder()\r\n y = encoder.fit...
[ "0.7311093", "0.7238229", "0.7204466", "0.71682787", "0.7158428", "0.7137401", "0.70853174", "0.7067548", "0.70258194", "0.70258194", "0.69965976", "0.69881845", "0.69770586", "0.6960524", "0.69590366", "0.6917453", "0.69133615", "0.6876499", "0.6872374", "0.6869748", "0.6865...
0.0
-1
Change the food by the given value. Food will always stay between 0 and the specified maximum
def change_food(self, food: int): self.food += food if(self.food < 0): self.food = 0 elif(self.food > self.max_food): self.food = self.max_food self.update_color()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_fodder(self):\n self.remaining_food['Herbivore'] = self.parameters['f_max']", "def update_fodder(self):\n self.remaining_food['Herbivore'] += self.parameters['alpha'] * (\n self.parameters['f_max'] - self.remaining_food['Herbivore'])", "def add_food(add, value):\n glo...
[ "0.703781", "0.6796669", "0.6548812", "0.65128", "0.63354886", "0.6242799", "0.61964136", "0.61938757", "0.5987412", "0.59449065", "0.5935209", "0.59231365", "0.592164", "0.5900679", "0.5859077", "0.5859077", "0.5796393", "0.57765955", "0.5776306", "0.5752443", "0.57498616", ...
0.8031711
0
Yield each element in seq 'n' times
def repeat(seq, n): for e in seq: for _ in range(n): yield e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def takeNGenerator(seq, n):\n\tindex = 0\n\twhile index + n <= len(seq):\n\t\tyield seq[index:index + n]\n\t\tindex = index + 1", "def iter_n(sequence: Sequence[T], n: int) -> List[T]:\n\t\n\tfor i in range(len(sequence) - (n-1)):\n\t\tyield sequence[i:i+n]", "def split_by_n( seq, n ):\n while seq:\n ...
[ "0.795374", "0.78914726", "0.7532351", "0.75000155", "0.7488252", "0.7472996", "0.74396497", "0.7395618", "0.73442787", "0.72995883", "0.7240473", "0.7221729", "0.71742934", "0.71742934", "0.71742934", "0.7168575", "0.7142056", "0.71336323", "0.71290034", "0.71177083", "0.710...
0.8648718
0
Yield len(seq)/n groups of `n` elements each
def groups_of(seq, n): for i in range(0, len(seq), n): yield seq[i : (i + n)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grouper(iterable, n):\n for i in range(0, len(iterable), n):\n yield iterable[i:i+n]", "def grouper(iterable, n):\n it = iter(iterable)\n while True:\n chunk = tuple(islice(it, n))\n if not chunk:\n return\n yield chunk", "def grouper(n, iterable):\n it = ...
[ "0.7918132", "0.7808769", "0.7777516", "0.7749238", "0.77438915", "0.7721282", "0.7660002", "0.7573865", "0.7557007", "0.75196964", "0.74485946", "0.7437376", "0.7429672", "0.7426785", "0.7391765", "0.7384071", "0.73655576", "0.735789", "0.7357394", "0.7335495", "0.7332234", ...
0.8345066
0
Function for returning single residual model for TF2 framework, set trainable=False for BNs
def single_residual_for_tf2(): inputs = tf.keras.Input(shape=(16, 16, 3,)) x = tf.keras.layers.Conv2D(16, (3, 3))(inputs) x = tf.keras.layers.BatchNormalization(momentum=.3, epsilon=.65, trainable=False)(x) x = tf.nn.relu(x) x = tf.keras.layers.MaxPool2D()(x) residual = x residual = tf.kera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet():\n return models.resnet152(pretrained=True)", "def single_residual():\n\n inputs = tf.keras.Input(shape=(16, 16, 3,))\n x = tf.keras.layers.Conv2D(16, (3, 3))(inputs)\n x = tf.keras.layers.BatchNormalization(momentum=.3, epsilon=.65)(x)\n x = tf.nn.relu(x)\n x = tf.keras.layers.Max...
[ "0.662754", "0.662469", "0.62581784", "0.62232774", "0.61601293", "0.611893", "0.60739577", "0.6072617", "0.6051283", "0.6051283", "0.6051283", "0.6051283", "0.6051283", "0.6047257", "0.6044592", "0.60218793", "0.60096407", "0.6009477", "0.60060614", "0.59928435", "0.59586936...
0.6992582
0
Function for returning a basic keras model
def keras_model(): model = Sequential([ Conv2D(8, (2, 2), input_shape=(16, 16, 3,)), BatchNormalization(momentum=.3, epsilon=.65), AvgPool2D(), MaxPool2D(), BatchNormalization(momentum=.4, epsilon=.25), Conv2D(4, (2, 2), activation=tf.nn.tanh, kernel_regularizer=tf.k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n i = self.keras.Input(self.s)\n\n return keras.Model(inputs=[i], outputs=self.call(i))", "def get_model():\r\n model = Sequential([\r\n\r\n Lambda(normalize, input_shape=(66, 200, 3)),\r\n\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=2)...
[ "0.76437753", "0.7640163", "0.76081395", "0.75866526", "0.7486154", "0.74785733", "0.7457932", "0.7415851", "0.7364802", "0.7344194", "0.73270446", "0.728348", "0.7271681", "0.7271681", "0.7261854", "0.72530466", "0.7244245", "0.7237374", "0.7232534", "0.7220538", "0.7155339"...
0.73471385
9
Function for returning basic keras model defined functionally
def keras_model_functional(): is_training = tf.compat.v1.placeholder_with_default(tf.constant(True), shape=(), name='is_training') inputs = tf.keras.Input(shape=(32, 32, 3,)) x = tf.keras.layers.Conv2D(32, (3, 3))(inputs) x = tf.keras.layers.BatchNormalization(momentum=.3, epsilon=.65)(x, training=True)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n i = self.keras.Input(self.s)\n\n return keras.Model(inputs=[i], outputs=self.call(i))", "def get_model():\r\n model = Sequential([\r\n\r\n Lambda(normalize, input_shape=(66, 200, 3)),\r\n\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=2)...
[ "0.7587582", "0.74962825", "0.73077875", "0.72659576", "0.72103715", "0.7195533", "0.7178475", "0.7140276", "0.713921", "0.7132312", "0.71265304", "0.71158606", "0.71065485", "0.7102432", "0.709709", "0.7059756", "0.7057202", "0.70516694", "0.7042335", "0.7039617", "0.7039617...
0.67202765
73
Function for returning basic keras model defined functionally
def keras_model_functional_for_tf2(): inputs = tf.keras.Input(shape=(32, 32, 3,)) x = tf.keras.layers.Conv2D(32, (3, 3))(inputs) x = tf.keras.layers.BatchNormalization(momentum=.3, epsilon=.65)(x, training=True) with tf.compat.v1.variable_scope("scope_1"): x = tf.keras.layers.Conv2D(16, (2, 2), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n i = self.keras.Input(self.s)\n\n return keras.Model(inputs=[i], outputs=self.call(i))", "def get_model():\r\n model = Sequential([\r\n\r\n Lambda(normalize, input_shape=(66, 200, 3)),\r\n\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=2)...
[ "0.758793", "0.74959815", "0.730791", "0.72657603", "0.72104347", "0.71964765", "0.71785706", "0.7140501", "0.71394145", "0.71323156", "0.712738", "0.71146363", "0.7106462", "0.71020836", "0.7097706", "0.7059861", "0.70576423", "0.705031", "0.70420724", "0.70385784", "0.70385...
0.0
-1
Function for returning basic keras model defined functionally using non fused batchnorms
def keras_model_functional_with_non_fused_batchnorms(): is_training = tf.compat.v1.placeholder_with_default(tf.constant(True), shape=(), name='is_training') inputs = tf.keras.Input(shape=(32, 32, 3,)) x = tf.keras.layers.Conv2D(32, (3, 3))(inputs) x = tf.keras.layers.BatchNormalization(momentum=.3, epsi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model():\r\n model = Sequential([\r\n\r\n Lambda(normalize, input_shape=(66, 200, 3)),\r\n\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=2),\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=1),\r\n Convolution2D(24, (3, 3), p...
[ "0.72460485", "0.7180563", "0.71505797", "0.7091714", "0.707617", "0.70401675", "0.69312024", "0.6845208", "0.6845069", "0.68114585", "0.6792505", "0.67674506", "0.67468256", "0.67193425", "0.6713662", "0.6700302", "0.66972274", "0.66827524", "0.66806763", "0.6608428", "0.659...
0.751841
0
Function for returning basic keras model defined functionally using non fused batchnorms
def keras_model_functional_with_non_fused_batchnorms_for_tf2(): inputs = tf.keras.Input(shape=(32, 32, 3,)) x = tf.keras.layers.Conv2D(32, (3, 3))(inputs) x = tf.keras.layers.BatchNormalization(momentum=.3, epsilon=.65, fused=False)(x, training=True) with tf.compat.v1.variable_scope("scope_1"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keras_model_functional_with_non_fused_batchnorms():\n is_training = tf.compat.v1.placeholder_with_default(tf.constant(True), shape=(), name='is_training')\n inputs = tf.keras.Input(shape=(32, 32, 3,))\n x = tf.keras.layers.Conv2D(32, (3, 3))(inputs)\n x = tf.keras.layers.BatchNormalization(momentum...
[ "0.7518251", "0.72461975", "0.71498674", "0.7092196", "0.70750827", "0.7040043", "0.69309676", "0.6844964", "0.6844376", "0.6809523", "0.67918116", "0.67668504", "0.6746332", "0.671806", "0.6711712", "0.6700095", "0.6697618", "0.6682618", "0.66794235", "0.6610182", "0.6591126...
0.7180594
2
Function for returning basic tf slim model
def tf_slim_basic_model(inp): is_training = tf.compat.v1.placeholder_with_default(tf.constant(True), shape=(), name='is_training') net = slim.conv2d(inp, 32, [3, 3]) net = slim.batch_norm(net, decay=.7, epsilon=.65, is_training=True) net = slim.conv2d(net, 16, [2, 2]) net = slim.batch_norm(net, deca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_model_v1():\n tf.reset_default_graph()\n\n with tf.Session() as sess:\n # Make two simple graphs, both of which will be served by TF\n x = tf.placeholder('float', shape=(None, 3), name='Input')\n z = tf.placeholder('float', shape=(), name='ScalarMultiple')\n m = tf.Varia...
[ "0.6880595", "0.6578509", "0.64890146", "0.64533836", "0.64473027", "0.6386423", "0.63638157", "0.6362654", "0.63295364", "0.632647", "0.6324851", "0.6320358", "0.62942344", "0.62878156", "0.6284024", "0.6266783", "0.62547916", "0.6206871", "0.62033635", "0.618771", "0.614674...
0.7561886
0
Function for returning tf slim model ending in softmax
def tf_slim_with_softmax(inp): net = slim.conv2d(inp, 32, [3, 3]) net = slim.batch_norm(net, decay=.7, epsilon=.65, is_training=False) net = slim.conv2d(net, 16, [2, 2]) net = slim.batch_norm(net, decay=.6, epsilon=.25, is_training=False) net = slim.softmax(net) return net
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x, name):\n with tf.name_scope(name):\n outputs = tf.nn.softmax (x)\n # Return layer's output\n return outputs", "def tf_slim_basic_model(inp):\n is_training = tf.compat.v1.placeholder_with_default(tf.constant(True), shape=(), name='is_training')\n net = ...
[ "0.7411287", "0.6945972", "0.6899645", "0.6607712", "0.6600624", "0.6563268", "0.6555997", "0.6538027", "0.6415555", "0.6386957", "0.6386957", "0.6362761", "0.6313569", "0.63130826", "0.62917715", "0.62917715", "0.62790555", "0.62778884", "0.6271752", "0.6251279", "0.6250553"...
0.74869424
0
Returns a keras model with a dropout module (also tests identity op, which is how dropout is represented when model is in inference mode
def dropout_keras_model(): inputs = tf.keras.Input(shape=(10, 10, 3,)) x = tf.keras.layers.Conv2D(16, (3, 3))(inputs) x = tf.keras.layers.Dropout(rate=.4)(x) x = tf.identity(x) x = tf.keras.layers.Conv2D(8, (2, 2))(x) x = tf.keras.layers.Flatten()(x) outputs = tf.keras.layers.Dense(10, acti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_conv_dropout_model(only_digits: bool = True,\n seed: Optional[int] = None):\n data_format = 'channels_last'\n if seed is not None:\n tf.random.set_seed(seed)\n initializer = tf.keras.initializers.GlorotNormal(seed=seed)\n\n model = tf.keras.models.Sequential([\n ...
[ "0.73568845", "0.71900946", "0.7141542", "0.6981366", "0.6824949", "0.6686897", "0.6536798", "0.6511875", "0.64862555", "0.6456973", "0.64535743", "0.64240146", "0.63769925", "0.63667345", "0.6309021", "0.62845486", "0.627255", "0.6261135", "0.6250607", "0.6242668", "0.623889...
0.7909604
0
Returns a slim model with a dropout module (also tests identity op, which is how dropout is represented when model is in inference mode
def dropout_slim_model(): inputs = tf.keras.Input(shape=(10, 10, 3,)) x = slim.conv2d(inputs, 16, [3, 3]) x = slim.dropout(x, keep_prob=.6) x = tf.identity(x) x = slim.conv2d(x, 8, [2, 2]) x = slim.flatten(x) outputs = slim.fully_connected(x, num_outputs=10, activation_fn=tf.nn.softmax, sco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dropout_keras_model():\n\n inputs = tf.keras.Input(shape=(10, 10, 3,))\n x = tf.keras.layers.Conv2D(16, (3, 3))(inputs)\n x = tf.keras.layers.Dropout(rate=.4)(x)\n x = tf.identity(x)\n x = tf.keras.layers.Conv2D(8, (2, 2))(x)\n x = tf.keras.layers.Flatten()(x)\n outputs = tf.keras.layers.D...
[ "0.6848946", "0.6599165", "0.64668447", "0.6460733", "0.64514124", "0.64273036", "0.62774396", "0.6269653", "0.62046486", "0.61761427", "0.6105486", "0.60369855", "0.59742624", "0.5956661", "0.59543097", "0.5834335", "0.5828955", "0.5825602", "0.5797621", "0.57884353", "0.577...
0.7782718
0
Returns a model with depthwise conv2d
def depthwise_conv2d_model(): inputs = tf.keras.Input(shape=(10, 10, 3,)) x = tf.keras.layers.Conv2D(16, (1, 1))(inputs) x = tf.keras.layers.SeparableConv2D(10, (2, 2))(x) x = tf.keras.layers.DepthwiseConv2D(3, (1, 1))(x) x = tf.keras.layers.Conv2D(8, (1, 1))(x) x = tf.keras.layers.Flatten()(x)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_depthwise_conv2d(self, op):\n return self.convert_conv(op, \"depthwise\")", "def DarknetDepthwiseConv2D(*args, **kwargs):\n #darknet_conv_kwargs = {'kernel_regularizer': l2(5e-4)}\n #darknet_conv_kwargs['padding'] = 'valid' if kwargs.get('strides')==(2,2) else 'same'\n darknet_conv_kw...
[ "0.7023286", "0.70131654", "0.69815767", "0.6686101", "0.656228", "0.65223813", "0.64888674", "0.6486378", "0.64477164", "0.64250845", "0.62616694", "0.62139136", "0.62050277", "0.61900514", "0.61831915", "0.6152637", "0.610802", "0.6088378", "0.6070657", "0.60691243", "0.606...
0.879231
0
Function for returning basic keras model defined functionally
def model_with_upsample_already_present(): inputs = tf.keras.Input(shape=(8, 8, 3,)) x = tf.keras.layers.Conv2D(8, (3, 3))(inputs) with tf.name_scope("upsample"): unstacked = tf.unstack(x, axis=-1) zeros = tf.zeros_like(unstacked[0]) current_index = 0 for index in [0, 3, 4, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n i = self.keras.Input(self.s)\n\n return keras.Model(inputs=[i], outputs=self.call(i))", "def get_model():\r\n model = Sequential([\r\n\r\n Lambda(normalize, input_shape=(66, 200, 3)),\r\n\r\n Convolution2D(16, (3, 3), padding='same', activation='relu', strides=2)...
[ "0.7587431", "0.74962693", "0.7307769", "0.7266487", "0.72124827", "0.7195843", "0.71787834", "0.71410406", "0.7139803", "0.71338177", "0.71274555", "0.7116693", "0.71080786", "0.71027094", "0.7097857", "0.7060618", "0.70570135", "0.7052396", "0.70423514", "0.70387477", "0.70...
0.0
-1
Return model with three conv layers
def model_with_three_convs(): inputs = tf.keras.Input(shape=(8, 8, 3,)) x = tf.keras.layers.Conv2D(8, (2, 2))(inputs) x = tf.keras.layers.BatchNormalization(momentum=.3, epsilon=.65, trainable=False)(x) x = tf.keras.layers.Conv2D(6, (2, 2))(x) x = tf.keras.layers.BatchNormalization(momentum=.3, eps...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_3d(self):\n # Model.\n model = Sequential()\n model.add(Conv3D(32, (3,3,3), activation='relu', input_shape=self.input_shape))\n model.add(MaxPooling3D(pool_size=(1, 2, 2), strides=(1, 2, 2)))\n model.add(Conv3D(64, (3,3,3), activation='relu'))\n model.add(MaxPooli...
[ "0.823467", "0.80127525", "0.75505674", "0.7149952", "0.7043507", "0.7031587", "0.6967831", "0.6942951", "0.69189304", "0.68562496", "0.68421", "0.6762046", "0.67572063", "0.67469764", "0.6726462", "0.67199254", "0.6710771", "0.6640113", "0.66141677", "0.65729237", "0.655072"...
0.81089973
1
Return model with leaky relu op
def model_with_leaky_relu(): inputs = tf.keras.Input(shape=(8, 8, 3,)) x = tf.keras.layers.Conv2D(8, (2, 2))(inputs) x = tf.nn.leaky_relu(x, alpha=.4) x = tf.keras.layers.Conv2D(4, (2, 2))(x) x = tf.keras.layers.Flatten()(x) outputs = tf.keras.layers.Dense(10, activation=tf.nn.softmax, name="mod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_leaky(net: nn.Module, leak: float = 0.2) -> nn.Module:\n def do_it(m: nn.Module) -> nn.Module:\n if isinstance(m, nn.ReLU):\n return nn.LeakyReLU(leak, m.inplace)\n return m\n\n return edit_model(net, do_it)", "def test_model_with_leaky_relu(self):\n tf.compat.v1.re...
[ "0.7041776", "0.6772096", "0.64300394", "0.6305881", "0.6265149", "0.6253542", "0.6209827", "0.6195602", "0.6169411", "0.6154429", "0.60378766", "0.60292816", "0.60175157", "0.6001708", "0.59910387", "0.5987967", "0.59866804", "0.598009", "0.59780985", "0.5947829", "0.5924888...
0.7106728
0