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
Applies the output activation, to compute the output layer. The input a_o is a linear transformation applied to the outputs of the hidden layer. The output activation is just a "passthrough" for regression, and a sigmoid for classification (which means that the output is a probability).
def compute_output(self, a_o): if self.regression: return a_o else: return 1/(1+np.exp(-a_o))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_layer_activation(x):\n return x", "def calculate_transformation(self, p: np.ndarray, o: np.ndarray):\n self.set_inputs(p)\n self.set_outputs(o)\n self.reset_transformation_to_rest()\n self.reset_output_transformation_to_rest()\n # activation resets the hidden laye...
[ "0.7378827", "0.654507", "0.648718", "0.6473971", "0.6276383", "0.6154669", "0.6117569", "0.60129976", "0.5990998", "0.59691036", "0.5965095", "0.59633946", "0.59431756", "0.59381074", "0.5890933", "0.5860945", "0.5829159", "0.5810095", "0.5783276", "0.5761257", "0.57477754",...
0.70803094
1
Applies the hiddenlayer activation, to compute the outputs of the hidden layer. The input a_h is a linear transformation applied to the input feature vector. The hiddenlayer activation is either a rectified linear unit (ReLU) or hyperbolic tangent (tanh).
def compute_hidden(self, a_h): if self.relu: return a_h*(a_h > 0) else: return np.tanh(a_h)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient_hidden(self, h):\n if self.relu:\n return 1.0*(h > 0)\n else:\n return 1 - h * h", "def _rnn_tanh_cell(inputs, hidden, w_ih, w_hh, b_ih, b_hh):\n if b_ih is None:\n igates = P.MatMul(False, True)(inputs, w_ih)\n hgates = P.MatMul(False, True)(hidd...
[ "0.70174444", "0.66397685", "0.6614369", "0.65750206", "0.64854455", "0.64799356", "0.64581615", "0.6457086", "0.63954556", "0.63420075", "0.63313335", "0.6275259", "0.6266388", "0.6238639", "0.61874425", "0.61874425", "0.61874425", "0.6158821", "0.61507523", "0.6135204", "0....
0.8398793
0
(int) > bool Return True iff age is legal voting age of at least 18 years. >>> can_vote(16) False >>> can_vote(21) True
def can_vote(age): return age >= 18
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_vintage(self):\n return self.get_age()>=AGE", "def is_vintage(self):\n if self.get_age() >= 50: # Vintage age\n return True\n return False", "def can_run_for_president(age):\n # The US Constitution says you must \"have attained to the Age of thirty-five Years\"\n retu...
[ "0.69812596", "0.6967812", "0.6909014", "0.6806583", "0.6673685", "0.6648924", "0.6648924", "0.6380486", "0.6318661", "0.6078412", "0.59651506", "0.581013", "0.580044", "0.57363886", "0.5545304", "0.54582554", "0.5432943", "0.5424192", "0.54197764", "0.5407651", "0.5390675", ...
0.88429683
0
Get the current hour.
def get_hour(self): hour = None # First we get the first 8 bits stored in the hour register # and translate it to an integer hour_bcd = self.__read_register(_REGISTER_HOUR) # In case there was an issue with enabling the 14hour mode, we still want # to be able to read the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hour_today() -> str:\n return datetime.now().strftime(\"%H\")", "def hour(self) -> int:\n return pulumi.get(self, \"hour\")", "def hour(self):\n return self._hour", "def hour(self) -> int:\r\n return self._hour", "def hour(self) -> int:\r\n return self._hour", "...
[ "0.82712454", "0.82465154", "0.801574", "0.793617", "0.793617", "0.78343207", "0.7648808", "0.7648808", "0.7648808", "0.75672096", "0.7524421", "0.752284", "0.7453129", "0.73889446", "0.7352279", "0.7337304", "0.7194429", "0.708654", "0.7079084", "0.6995999", "0.6991205", "...
0.75844353
9
Get the current day.
def get_day(self): # First we get the first 8 bits stored in the day register # and translate it to an integer day_bcd = self.__read_register(_REGISTER_DAY) # Then we extract the digits and the tens tens = (day_bcd & 0x30) >> 4 # 0x30 = 0b00110000 digit = (day_bcd & 0x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def currentDay(self):\n day = datetime.datetime.today().day\n return day", "def get_current_day() -> int:\n return datetime.now().day", "def get_current_day():\n current_day = datetime.now().strftime('%A').lower()\n return current_day", "def current_day():\n now = pytz.timezone(...
[ "0.89019656", "0.87446654", "0.84334147", "0.8377963", "0.77826554", "0.7664841", "0.76103127", "0.753028", "0.744316", "0.7437444", "0.74246436", "0.7421293", "0.7405761", "0.739473", "0.739271", "0.73850554", "0.7375929", "0.7338691", "0.73320633", "0.7331383", "0.7331383",...
0.62116784
83
Get the current month. By default, "1" corresponds to January and "12" to December
def get_month(self, as_str=False): # First we get the first 8 bits stored in the month register month_bcd = self.__read_register(_REGISTER_MONTH) # Then we extract the digits and the tens tens = (month_bcd & 0x10) >> 4 # 0x10 = 0b00010000 digit = (month_bcd & 0x0F) # 0x0F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_month() -> int:\n return datetime.now().month", "def month(self):\n return gocept.month.Month(self.calendar_month, self.calendar_year)", "def getMonth(self):\n return _libsbml.Date_getMonth(self)", "def month(self) -> str:\r\n return self._month", "def get_defaul...
[ "0.8693448", "0.7810969", "0.7804206", "0.7755243", "0.7685103", "0.7659672", "0.7628564", "0.76119006", "0.76119006", "0.7498304", "0.7489281", "0.7404207", "0.73754907", "0.728309", "0.72606003", "0.7165027", "0.7165027", "0.7124135", "0.712345", "0.70782936", "0.70665544",...
0.7184432
15
Set the current day. month an int comprised between 0 and 31 included. if the month as less than 31 day and a value in the range is entered then we just clamp it to the month max value
def set_day(self, day): if day not in range(1, 31): raise ValueError("Day value must be in range [1..12] but is {}".format(day)) # First we separate the tens and the digit tens, digit = divmod(int(day), 10) # Then we add them in a single int reg_value = (tens << 4) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMonth(self, *args):\n return _libsbml.Date_setMonth(self, *args)", "def setDay(self, *args):\n return _libsbml.Date_setDay(self, *args)", "def day_of_month(self, day_of_month):\n\n self._day_of_month = day_of_month", "def set_month(self, month):\n # if the sting value of mo...
[ "0.6452005", "0.6294713", "0.62335676", "0.6146818", "0.599181", "0.5883398", "0.5883398", "0.5797814", "0.5774968", "0.5765846", "0.5757933", "0.5684835", "0.5684835", "0.56780803", "0.5666805", "0.5645776", "0.5640803", "0.5621009", "0.56143266", "0.55986", "0.55831635", ...
0.5835359
7
accepts Django queryset and converts to pandas Dataframe
def qset_to_df(qset, datatype='object'): df = pd.DataFrame(list(qset.values()), dtype=datatype) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_DataFrame(cls, qs):\n dates = [pd.to_datetime(x[0]) for x in qs.values_list('date')]\n data = qs.values('open', 'close', 'high', 'low', 'volume')\n df = pd.DataFrame.from_records(data, index=dates)\n return df", "def to_dataframe(self):\n return df_util.to_dataframe(requ...
[ "0.68925416", "0.68274003", "0.6782496", "0.6747656", "0.6742659", "0.6742659", "0.6678006", "0.6658762", "0.6639171", "0.66298676", "0.6539771", "0.65246814", "0.65002006", "0.64637244", "0.64524496", "0.64177334", "0.64098847", "0.63991857", "0.63991857", "0.63991857", "0.6...
0.6747639
4
Liefert die XKoordinate des Camps
def getX(self): return self.__x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def x(self):\n return self.coords[0]", "def get_x(self):\n return self.coords[0]", "def x(self):\n return self._coords[0]", "def get_x(self):\n return self.posX", "def origin_x(self):\n return self._origin[0]", "def x(self):\n return _libsbml.Point_x(self)", "d...
[ "0.7670646", "0.75055623", "0.74605876", "0.7457655", "0.73581153", "0.7342449", "0.733228", "0.73297685", "0.7285944", "0.7255017", "0.725432", "0.7226361", "0.71551824", "0.71322227", "0.70855474", "0.70839643", "0.70198053", "0.7002853", "0.69984174", "0.69879353", "0.6945...
0.70135856
17
Checks if the user is allowed to add to the starboard Allows bot owner to always add messages for testing disallows users from adding their own messages
async def _check_roles( self, starboard: StarboardEntry, member: Union[discord.Member, discord.User] ) -> bool: if isinstance(member, discord.User): return True user_roles = set([role.id for role in member.roles]) if starboard.whitelist_role: for role in starb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow(self, message):\n if message.author.id == Guard.AUTHOR:\n return True\n if message.author.id in Guard.BANNED_USERS:\n return False\n if self.state == State.TRUSTED_ONLY and not Guard.is_trusted(message):\n return False\n if self.state == State....
[ "0.66932666", "0.66473734", "0.656856", "0.6452586", "0.64373976", "0.6410777", "0.6363607", "0.6363607", "0.62959766", "0.6288816", "0.6170215", "0.61560464", "0.6127145", "0.6100664", "0.60804486", "0.60804486", "0.6066443", "0.6066443", "0.6063583", "0.6063583", "0.6048378...
0.5666381
50
CHecks if the channel is allowed to track starboard messages
async def _check_channel( self, starboard: StarboardEntry, channel: discord.TextChannel ) -> bool: if starboard.whitelist_channel: return channel.id in starboard.whitelist_channel else: return channel.id not in starboard.blacklist_channel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_message(guild, channel):\n\treturn authorized(guild, channel) and not muted(guild, channel)", "def ccheck(self, msg):\r\n if msg.channel == self.channel or (msg.channel.is_private and self.ispm):\r\n return True\r\n return False", "def is_channel(self):\n return True", ...
[ "0.72480434", "0.7006796", "0.6650223", "0.6483194", "0.64428604", "0.6338502", "0.630341", "0.630341", "0.630341", "0.610875", "0.605647", "0.6034046", "0.60247314", "0.600697", "0.59771013", "0.59696406", "0.59644717", "0.59628195", "0.5960815", "0.5960484", "0.59310514", ...
0.7273373
0
Converts a list of regions into a `regions.ShapeList` object.
def to_shape_list(region_list, coordinate_system='fk5'): shape_list = ShapeList() for region in region_list: coord = [] if isinstance(region, SkyRegion): reg_type = region.__class__.__name__[:-9].lower() else: reg_type = region.__class__.__name__[:-11].lower() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RegionList(self):\n command = \"\"\"\n IPython.notebook.kernel.execute(\"RegionList=\" + JSON.stringify(JS9.GetShapes(\"regions\", {{display: '{wid}JS9'}})));\n \"\"\".format(wid=self.wid)\n get_ipython().run_cell_magic('javascript', '', command)", "def getRegionPlotList(self, lRe...
[ "0.6151488", "0.5893315", "0.5783878", "0.55699325", "0.53976065", "0.5359901", "0.5345112", "0.531558", "0.5311427", "0.5240538", "0.52029264", "0.51673865", "0.5158325", "0.5151528", "0.51512146", "0.5146775", "0.51373124", "0.51259625", "0.51221657", "0.5119681", "0.510125...
0.79059553
0
Crawls the given API for Android applications. As the individual stores differ greatly, most of the implementation is located in the API itself. The crawler only handles retries and rate limiting, otherwise, it is just a wrapper for a few chained API calls.
def crawl(api, limit): LOGGER.info(f'Crawling apps for {api.store}') app_lists = _discover_apps(api, limit) retry = [] busy = [] downloaded = set() for app_list in app_lists: LOGGER.info(f'Started processing "{app_list.name()}"') local_retry, local_busy, local_success = _download...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self) -> None:\n self.urls_list = self._create_api_ulr_list()\n self.results = self._sort_results(\n AsyncGetAPI(\n self.urls_list, self.threads, max_requests=self.max_requests\n ).results\n )", "def call_api(self):\n #generate the final ca...
[ "0.6122036", "0.5855563", "0.56604767", "0.5513933", "0.547434", "0.5443834", "0.53556794", "0.5336995", "0.53289735", "0.5322662", "0.53153175", "0.52760464", "0.52617234", "0.52569926", "0.5244941", "0.523031", "0.52245915", "0.52217346", "0.5209151", "0.5205418", "0.520001...
0.67652845
0
register a new product, pid should not exist
def register_product(p: Product) -> ExecRet: market = get_market() pid = p.pid if pid in market.products.keys(): return ExecRet.err(message='pid %d already exists' % pid) market.add_product(p) LOGGER.info('added product %s' % p.json()) return ExecRet.ok()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_product(self, product: Product):\n log.debug(\"Adding a new product\")\n product_parameters = product.to_db()\n try:\n with DBCursor(self.host) as cursor:\n cursor.execute(\"INSERT INTO items VALUES (?, ?, ?, ?, ?)\", (product_parameters['name'].lower(), produ...
[ "0.67300665", "0.6612151", "0.6606944", "0.655817", "0.6537552", "0.65079683", "0.65015566", "0.649082", "0.6486718", "0.6441199", "0.64357674", "0.6420912", "0.6411423", "0.63969386", "0.6383478", "0.625264", "0.6210495", "0.61211944", "0.6081814", "0.6079311", "0.607317", ...
0.8296651
0
modify price of a product
def modify_price(pid: int, price: float) -> ExecRet: if price < 0.0: return ExecRet.err(message='invalid price %.4f' % price) market = get_market() product = market.get_product(pid) if not product: return ExecRet.err(message='pid %d not exist' % pid) LOGGER.info('pid %s, pre-price: %...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_price(self, value): \n value = self.price", "def setPrice(self, val):\n self.price = val", "def modify_price(self, price):\n if price is not None and self.is_cancellable:\n log.info(\"bo#%s: modify price (pending) order \" % self.ticket)\n not_implemented_e...
[ "0.82996565", "0.74662405", "0.7457776", "0.7402657", "0.7402657", "0.7402657", "0.7402657", "0.73959154", "0.72863895", "0.7248535", "0.72239375", "0.72038305", "0.7146542", "0.7143393", "0.7143393", "0.71098924", "0.7005034", "0.6981008", "0.6943831", "0.6843206", "0.669916...
0.8164723
1
date_str is expected to be in form 'Feb 9 2012' result is in form '2012.040'
def datestr_to_yearday(date_str): date = datetime.datetime.strptime(date_str, '%b %d %Y') day_of_year = get_month_day_offset(date.month, date.year) + date.day return '%d.%03d' % (date.year, day_of_year)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reformat_date(date_str: str) -> str:\n if date_str is None or date_str == '':\n return None\n [month_key, year] = date_str.split()\n return f'{year}-{MONTHS[month_key]}'", "def _dateFmt(self, string):\n return time.strftime('%m/%d', time.strptime(string, '%B %d, %Y'))", "def date(str...
[ "0.70587945", "0.6814057", "0.68101496", "0.67597455", "0.67072135", "0.663582", "0.66262287", "0.66205996", "0.6598928", "0.65919906", "0.652199", "0.6476376", "0.6432075", "0.64294857", "0.6418424", "0.6402856", "0.63934296", "0.6386207", "0.6376564", "0.63578916", "0.63508...
0.6554864
10
Returns a StrinIO file with YAML contents for new tags.
async def import_tags(f): conn = await db.get_db() cur = await conn.execute("select id, tag from poi") poi_tags = {row[0]: row[1] async for row in cur} new_tags = {} for row in csv.DictReader(f): if not row['id'].isdecimal(): continue poi_id = int(row['id']) tag =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(self) -> IO[bytes]:\n return io.StringIO(yaml.safe_dump(self.config, None))", "def generate_write_yaml_to_file(file_name):\n def write_yaml(config):\n with open(file_name, 'w+') as fh:\n fh.write(yaml.dump(config))\n return write_yaml", "def save_yaml_to_file(i):\n\n...
[ "0.5948949", "0.5849259", "0.57686996", "0.57367444", "0.5722431", "0.5696467", "0.56751835", "0.5610695", "0.55598193", "0.5544549", "0.54864717", "0.54862875", "0.5442701", "0.54379475", "0.5424253", "0.54016197", "0.5394013", "0.53921795", "0.5389805", "0.5381289", "0.5373...
0.0
-1
Function for detecting local maximas and minmias in a signal.
def peakdetect_parabole(y_axis, x_axis, points = 9): # check input data x_axis, y_axis = _datacheck_peakdetect(x_axis, y_axis) # make the points argument odd points += 1 - points % 2 #points += 1 - int(points) & 1 slower when int conversion needed # get raw peaks...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_maxima(X_nm):\n N,M = X_nm.shape\n return (\n np.r_[X_nm[:-1,:] >= X_nm[1:,:],np.zeros((1,M),bool)] & \n np.r_[np.zeros((1,M),bool),X_nm[1:,:] >= X_nm[:-1,:]] & \n np.c_[X_nm[:,:-1] >= X_nm[:,1:],np.zeros((N,1),bool)] &\n np.c_[np.zeros((N,1),bool),X_nm[:,1:] > X_nm[:,:-...
[ "0.6565807", "0.65137964", "0.643818", "0.6242099", "0.6203035", "0.61771697", "0.61574894", "0.61067325", "0.60828364", "0.6033065", "0.60308796", "0.6026541", "0.59773844", "0.5968948", "0.59654987", "0.5937297", "0.5909303", "0.5904444", "0.5898721", "0.5840842", "0.582047...
0.0
-1
Function for detecting local maximas and minmias in a signal.
def peakdetect_sine(y_axis, x_axis, points = 9, lock_frequency = False): # check input data x_axis, y_axis = _datacheck_peakdetect(x_axis, y_axis) # make the points argument odd points += 1 - points % 2 #points += 1 - int(points) & 1 slower when int conversion needed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_maxima(X_nm):\n N,M = X_nm.shape\n return (\n np.r_[X_nm[:-1,:] >= X_nm[1:,:],np.zeros((1,M),bool)] & \n np.r_[np.zeros((1,M),bool),X_nm[1:,:] >= X_nm[:-1,:]] & \n np.c_[X_nm[:,:-1] >= X_nm[:,1:],np.zeros((N,1),bool)] &\n np.c_[np.zeros((N,1),bool),X_nm[:,1:] > X_nm[:,:-...
[ "0.6565628", "0.65142024", "0.6439172", "0.6243571", "0.6202709", "0.61741936", "0.6157937", "0.6107042", "0.60829705", "0.603339", "0.6027726", "0.60256445", "0.59786993", "0.5967879", "0.5962049", "0.5936866", "0.5910016", "0.59014964", "0.58990127", "0.5839643", "0.5819702...
0.0
-1
Function for detecting local maximas and minmias in a signal. Discovers peaks by dividing the signal into bins and retrieving the maximum and minimum value of each the even and odd bins respectively. Division into bins is performed by smoothing the curve and finding the zero crossings. Suitable for repeatable signals, ...
def peakdetect_zero_crossing(y_axis, x_axis = None, window = 11): # check input data x_axis, y_axis = _datacheck_peakdetect(x_axis, y_axis) zero_indices = zero_crossings(y_axis, window = window) period_lengths = np.diff(zero_indices) bins_y = [y_axis[ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peakdet2d(image):\n # define an 8-connected neighborhood\n neighborhood = generate_binary_structure(2,2)\n\n #apply the local maximum filter; all pixel of maximal value \n #in their neighborhood are set to 1\n local_max = maximum_filter(image, footprint=neighborhood)==image\n #local_max is a ...
[ "0.72096425", "0.72083247", "0.7183641", "0.71372336", "0.7083208", "0.70606834", "0.7052734", "0.6963452", "0.6962696", "0.68721324", "0.68721324", "0.68654156", "0.68139464", "0.68004745", "0.6797195", "0.6787529", "0.6786708", "0.6751143", "0.6723607", "0.6717963", "0.6705...
0.68844086
9
Format a timestamp for display.
def format_datetime(timestamp): return datetime.utcfromtimestamp(timestamp).strftime('%Y-%m-%d @ %H:%M')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_ts(cls, timestamp):\n return localtime(timestamp).strftime('%Y-%m-%d %H:%M:%S')", "def formatTimestamp(self, timestamp):\n return time.strftime('%Y%m%d-%H%M%S-%Z', time.localtime(timestamp))", "def render_timestamp(timestamp):\n return datetime.fromtimestamp(timestamp).strftime(\"%...
[ "0.83113927", "0.8024185", "0.78500414", "0.7596884", "0.7578498", "0.7574983", "0.7447329", "0.743664", "0.7395809", "0.73817986", "0.727902", "0.71649474", "0.7120334", "0.70975757", "0.70693433", "0.7055185", "0.698", "0.698", "0.6962262", "0.6930938", "0.69197065", "0.6...
0.7109238
14
add edge, an edge is pair of nodes, order is not important in undirected graphs.
def add_edge(self, node_a, node_b, **kwargs): # add nodes if node_a not in self._nodes: self._nodes[node_a] = self.node_factory() # holds nodes meta data self._adj[node_a] = {} self._adj[node_a][node_b] = {} if node_b not in self._nodes: self._nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n self[edge[0]][edge[1]] = edge\n self[edge[1]][edge[0]] = edge", "def add_edge(self, edge):\n if(self.has_edge(edge) == 0):\n self.__graph_dict[edge[0]].append(edge[1])", "def add_edge(self, edge):\n edge = set(edge)\n (vertex1, vertex2) ...
[ "0.8484236", "0.8433297", "0.83732414", "0.83498186", "0.8328947", "0.83219105", "0.8260263", "0.8241739", "0.8189298", "0.81835526", "0.81493336", "0.8134426", "0.8132961", "0.80490434", "0.79959124", "0.7992253", "0.7962051", "0.79309756", "0.79121256", "0.7895349", "0.7878...
0.0
-1
x.__str__() str(x) Return a string representation of this SessionOptions. Call of 'str(options)' is equivalent to 'options.toString()' called with default parameters.
def __str__(self): return self.toString()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n return repr(self._options)", "def __str__(self):\n # Note: Before equate was handled explicitly, the old\n # code would do either \"--name \" or \"--name=value \",\n # or \" -name \" or \" -name value \". This choice is now\n # now made explicitly ...
[ "0.72901094", "0.63979083", "0.6388186", "0.62312984", "0.61370546", "0.6128117", "0.6053902", "0.60383713", "0.60163933", "0.60163933", "0.60163933", "0.60163933", "0.60163933", "0.59703046", "0.5968799", "0.5968642", "0.5949198", "0.5949198", "0.5913862", "0.590067", "0.587...
0.0
-1
Set the maximum number of outstanding undelivered events per session.
def setMaxEventQueueSize(self, eventQueueSize): internals.blpapi_SessionOptions_setMaxEventQueueSize( self.__handle, eventQueueSize)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMaxNbEvts(self, nbevts):\n self._checkArgs( { 'nbevts' : types.IntType } )\n self.maxNumberOfEvents = nbevts", "def set_max_order_count(self, max_count, on_error='fail'):\n control = MaxOrderCount(on_error, max_count)\n self.register_trading_control(control)", "def fixupMaxEvents(pro...
[ "0.66537917", "0.64102626", "0.6361605", "0.62539124", "0.6175825", "0.60728705", "0.60728705", "0.58439726", "0.5830554", "0.5799825", "0.5788743", "0.57680464", "0.57173634", "0.5709644", "0.57019734", "0.5696911", "0.56933975", "0.56780946", "0.56770444", "0.5638366", "0.5...
0.5848352
7
Recursively replaces. This is the function that's actually called for applications.
def replace(old, new, l): if type(l) == list:#Here both elements need to be checked if l[0] == old:#Replacement r1 = new elif type(l[0]) != str:#if it's either list or tuple r1 = replace(old, new, l[0])#recursive checking is needed else: r1 = l[0]#nothing ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_place_substitute(self):\r\n if self.substitute is not None:\r\n node = self.convert_type()\r\n self.leaf_replace(node) # for internals only\r\n self.root_replace(node)", "def _replace_activations_recursive(module: nn.Module, new_activation: nn.Module, activations_to...
[ "0.56722194", "0.55485344", "0.5367969", "0.53274214", "0.5191095", "0.5146842", "0.51360446", "0.5113383", "0.5067729", "0.50510967", "0.50341964", "0.50280774", "0.5014026", "0.50121444", "0.49776348", "0.49365956", "0.49203375", "0.49102923", "0.48686558", "0.4866605", "0....
0.0
-1
Compute the distance in km between two points based on their latitude and longitude. Assumes both are given in radians.
def _compute_dist_lat_lon(graph): R = 6371 # Radius of the earth in km for edge in graph.edges(): node1, node2 = edge lon1 = np.radians(graph.nodes[node1]['Longitude']) lon2 = np.radians(graph.nodes[node2]['Longitude']) lat1 = np.radians(graph.nodes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_distance_two_points(lat_from, long_from, lat_to, long_to):\n distance_in_km = haversine(\n (lat_from, long_from),\n (lat_to, long_to),\n unit='km')\n\n return distance_in_km", "def dist_between(lon1, lat1, lon2, lat2):\n # convert decimal degrees to radians \n lon1, lat1...
[ "0.81582415", "0.8127357", "0.8072967", "0.8009574", "0.7985263", "0.79717284", "0.7942318", "0.7924649", "0.7900881", "0.7861417", "0.7830831", "0.78157", "0.78147054", "0.77925515", "0.77726495", "0.7741419", "0.77273756", "0.7724471", "0.770529", "0.7698506", "0.7695479", ...
0.0
-1
Return the user email.
def log_useremail(self): return self.user.email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def user_email(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"user_email\")", "def email(self, instance):\r\n return instance.user.email", "def get_email(...
[ "0.9023478", "0.8724384", "0.84640574", "0.8437554", "0.8299231", "0.8291282", "0.81561744", "0.81502944", "0.81502944", "0.81502944", "0.8146896", "0.80633223", "0.8039969", "0.8038464", "0.80271536", "0.8007943", "0.7959299", "0.79229593", "0.79229593", "0.79229593", "0.792...
0.8513016
2
Bullet specific logic to do when it collides with another object. This bullet creates explosion particles as well as hurting the colliding sprite if it has a health attribute.
def on_collision(self, sprite: arcade.Sprite, time: float, sprites, block_grid) -> None: if type(sprite) == BLOCK.GOLD: make_explosion_particles(ParticleGold, sprite.position, time, sprites) block_grid.break_block(sprite, sprites) self.remove_from_sprite_lists() elif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_bullet_collisions(self):\n #remove bullets and aliens that have collided\n collisions = pygame.sprite.groupcollide(\n self.bullets, self.aliens, True, True)\n\n if collisions:\n\n for aliens in collisions.values():\n #up the alien shot counter\n ...
[ "0.7057944", "0.6960146", "0.6934109", "0.6830193", "0.67725927", "0.67536503", "0.67534524", "0.6729442", "0.67167175", "0.6648119", "0.6645657", "0.65834665", "0.6566084", "0.65551037", "0.6519642", "0.65134495", "0.6511482", "0.6507124", "0.6503192", "0.6498198", "0.648674...
0.74376637
1
Represents a fireball. Removed upon collision. Damages and makes explosion particles.
def __init__(self, parent: Entity, relative_x: Union[float, int] = 0.0, relative_y: Union[float, int] = 0.0, angle: float = 0.0, speed: Union[float, int] = 2) -> None: base_sprite = "resources/images/weapons/fireball.png" sprite_scale = 0.4 damage = 15 super().__init__(b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fire(self):\n prepare.SFX[\"explosion\"].play()\n pos = project(self.base_rect.center, self.angle, 38)\n return Gift(pos, self.angle, self.fire_speed)", "def fire_bullet(self):\n if self.time_til_drop > 0:\n self.time_til_drop -= 1\n else:\n new_boss_p...
[ "0.63505405", "0.6312572", "0.6166826", "0.6161392", "0.61004573", "0.60712475", "0.60696745", "0.606355", "0.60303015", "0.60113686", "0.59909135", "0.5979084", "0.59604144", "0.59604144", "0.595165", "0.5951317", "0.5943751", "0.5906862", "0.5890469", "0.587337", "0.5845841...
0.5506108
51
Bullet specific logic to do when it collides with another object. This bullet creates explosion particles as well as hurting the colliding sprite if it has a health attribute.
def on_collision(self, sprite: arcade.Sprite, time: float, sprites, block_grid) -> None: if type(sprite) == BLOCK.GOLD: make_explosion_particles(ParticleGold, sprite.position, time, sprites) block_grid.break_block(sprite, sprites) self.remove_from_sprite_lists() elif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_bullet_collisions(self):\n #remove bullets and aliens that have collided\n collisions = pygame.sprite.groupcollide(\n self.bullets, self.aliens, True, True)\n\n if collisions:\n\n for aliens in collisions.values():\n #up the alien shot counter\n ...
[ "0.70582306", "0.69615835", "0.69347", "0.68313336", "0.67728674", "0.6753836", "0.6753365", "0.67300594", "0.67169917", "0.66484463", "0.6645797", "0.6583692", "0.6566292", "0.6555173", "0.65198517", "0.65132934", "0.65126526", "0.65067947", "0.6504111", "0.6498646", "0.6487...
0.7437566
0
Return all types clients
def types_clients_view(request): query = request.dbsession.query(ClientType).all() return Utils.serialize_many(query)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n return get_clientes()", "def get_client_list(self):\r\n cursor = self.conn.cursor()\r\n cursor.execute(\"\"\"SELECT * FROM CLIENT\"\"\")\r\n return cursor.fetchall()", "def list_clients(self):\n\n return self.clients_info", "def get_clients():\n data = D...
[ "0.7594124", "0.7374165", "0.7338392", "0.7236041", "0.7186249", "0.7033225", "0.70260704", "0.70078915", "0.699009", "0.69609416", "0.69609416", "0.6934304", "0.6933307", "0.691484", "0.68709755", "0.6783719", "0.6775058", "0.6772178", "0.67625827", "0.6758404", "0.670473", ...
0.7718405
0
Return all Django models that match a list of class names. It also returns models whose parents match that classname
def get_models_by_name(class_names: Iterable[str]) -> List[models.Model]: matching_models = [] for model in apps.get_models(): parent_class_names = set([parent.__name__ for parent in model.mro()]) if parent_class_names.intersection(class_names): matching_models.append(model) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(self, *args, **kwargs):\n list_to_return = []\n if not self.object_type:\n return list_to_return\n class_name = eval(self.object_type)\n if self.objects_id:\n for id in self.objects_id.split(';'):\n if id:\n list_to_return.append(class_name.objects.get(id=id))\n ret...
[ "0.653098", "0.64891374", "0.63833594", "0.63428104", "0.6290913", "0.61210924", "0.61077917", "0.60354364", "0.599386", "0.59590846", "0.59265536", "0.59265536", "0.59265536", "0.59265536", "0.5921282", "0.59177095", "0.58643514", "0.5831897", "0.581242", "0.58037347", "0.57...
0.84780604
0
Get a list of all classes that inherit from the given newstyle class.
def inheritors(cls): subclasses = set() work = [cls] while work: parent = work.pop() for child in parent.__subclasses__(): if child not in subclasses: subclasses.add(child) work.append(child) return subclasses
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_class_list(self):\n t = []\n for cls in self.classes:\n if not self.is_opaque(cls.classobj):\n t.append(cls)\n elif cls.parents or cls.childs:\n t.append(cls)\n \n return t", "def get_subclasses(self, class_name):\n ...
[ "0.70615417", "0.7044172", "0.6913776", "0.6885176", "0.6828971", "0.68230736", "0.68230736", "0.68152004", "0.68077534", "0.6753701", "0.67457587", "0.6725153", "0.65626276", "0.6556444", "0.6548919", "0.6499253", "0.6487304", "0.6478585", "0.6453797", "0.64317644", "0.64205...
0.70211667
2
check if pl exists and return its index in list
def pl_exists(self, name): for i, d in enumerate(self.ui.leftwin.data): if d.data.name == name: return i return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_of_portfolio_id(l, name):\n for i in range(len(l)):\n if l[i].portfolio_id == name:\n return i\n return -1", "def index(*, list : Union[List[Any], ConduitVariable], item : Any) -> int:\n return -1 if item not in list else list.index(item)", "def _get_playlist_index_by_n...
[ "0.65671927", "0.63812125", "0.6354064", "0.6253163", "0.62382615", "0.6209992", "0.6186003", "0.61597717", "0.6116969", "0.60835725", "0.6080337", "0.6070099", "0.6064684", "0.60628283", "0.60303485", "0.6024828", "0.5999192", "0.596747", "0.5964286", "0.5960087", "0.594364"...
0.66348875
0
Return the integer ID for the given ConnectorRelation. If ``project_id`` is given and you know this project's mappings are already populated, (possibly via a different instance this can be used as a class method.
def to_id(self, relation, project_id=None): if relation == ConnectorRelation.other: return -1 return self._get_dict(True, project_id)[relation]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_id(self, relation_id, project_id=None):\n if relation_id == -1:\n return ConnectorRelation.other\n return self._get_dict(False, project_id)[relation_id]", "def id(self) -> ProjectID:\n _args: list[Arg] = []\n _ctx = self._select(\"id\", _args)\n return _ctx....
[ "0.6769873", "0.63865155", "0.6123257", "0.5922329", "0.5905271", "0.575819", "0.56327844", "0.56327844", "0.56302494", "0.56211215", "0.55516624", "0.5534812", "0.55200624", "0.55172956", "0.5392919", "0.5356745", "0.5354939", "0.53435385", "0.53435385", "0.53435385", "0.534...
0.7714556
0
Returns one of the ELIGIBILITY_STATES values depending on if the model is eligible or not. If PropertyExpectedException is raised, it means that we don't have enough data to determine the state so we set the `state` property to UNKNOWN.
def get_eligibility_state(self): ec = EligibilityChecker(self.to_case_data()) try: if ec.is_eligible(): return ELIGIBILITY_STATES.YES, ec, [] else: return ELIGIBILITY_STATES.NO, ec, self.get_ineligible_reason(ec) except PropertyExpectedExc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_set_away_mode_bad_attr(opp):\n state = opp.states.get(ENTITY_WATER_HEATER)\n assert state.attributes.get(\"away_mode\") == \"off\"\n with pytest.raises(vol.Invalid):\n await common.async_set_away_mode(opp, None, ENTITY_WATER_HEATER)\n assert state.attributes.get(\"away_mode\") == ...
[ "0.582218", "0.57549953", "0.5448287", "0.5444199", "0.53879064", "0.53762007", "0.53665465", "0.5329055", "0.53241354", "0.53000975", "0.5297494", "0.5279481", "0.5257997", "0.5238019", "0.5141039", "0.51303214", "0.5092865", "0.5037537", "0.5035159", "0.5032429", "0.5023455...
0.73037124
0
Get nonempty parts in string list.
def split_strings(text: str, delimiter: str = ',') -> list[str]: parts = text.split(delimiter) parts = [part.strip() for part in parts] return [part for part in parts if len(part) > 0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_empty_string(str_list):\n return list(filter(None, str_list))", "def without_empty(s):\n return {i for i in s if not i.is_empty()}", "def remove_blanks_list(src):\n return [el for el in src if el]", "def filter_empty(word_list):\n new_list = []\n for x in word_list:\n if(x):\...
[ "0.72256285", "0.64848864", "0.63037276", "0.6269391", "0.62154627", "0.6197963", "0.6157669", "0.61432177", "0.6121079", "0.6108731", "0.604458", "0.60187", "0.5995731", "0.5994909", "0.59894717", "0.5983224", "0.59784126", "0.58785903", "0.5787329", "0.57694286", "0.5748917...
0.51812494
61
Get the primary text channel for a guild.
def primary_channel(guild: discord.Guild) -> discord.TextChannel | None: if guild.system_channel is not None: return guild.system_channel for channel_candidate in guild.channels: if ( isinstance(channel_candidate, discord.TextChannel) and channel_candidate.permissions_fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_text_channel(\n self,\n guild: Guild,\n channel_id: int,\n ) -> Optional[TextChannel]:\n return guild.get_channel(channel_id)", "async def get_vote_channel(self, guild: discord.Guild):\n\n vote_channels = [\n ch for ch in guild.channels\n if \"...
[ "0.78348774", "0.635502", "0.61550915", "0.6138986", "0.6105853", "0.60538965", "0.59965503", "0.5959703", "0.59299284", "0.59209013", "0.58989936", "0.58989936", "0.5857903", "0.58493716", "0.58147705", "0.5729414", "0.5704498", "0.56753546", "0.5663948", "0.5661828", "0.565...
0.76956457
1
Converts timedelta to readable string.
def readable_timedelta( *, days: float = 0, hours: float = 0, minutes: float = 0, seconds: float = 0, ) -> str: delta = datetime.timedelta( days=days, hours=hours, minutes=minutes, seconds=seconds, ) remainder = int(delta.total_seconds()) days, remain...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timedelta_to_string(td: datetime.timedelta) -> str:\n return str(td)", "def convert_timedelta_to_string(td):\n # type: (datetime.timedelta) -> str\n days = td.days\n hours = td.seconds // 3600\n minutes = (td.seconds - (hours * 3600)) // 60\n seconds = (td.seconds - (hours * 3600) - (minute...
[ "0.8271794", "0.7770404", "0.7728229", "0.75993073", "0.7275913", "0.6867306", "0.6744467", "0.6669001", "0.6579803", "0.65796435", "0.65500236", "0.6512946", "0.6396771", "0.6372163", "0.6353616", "0.6314628", "0.6302277", "0.62965506", "0.62876606", "0.62809473", "0.6270718...
0.6287932
18
Get current voice channel of a member.
def voice_channel(member: discord.Member) -> discord.VoiceChannel | None: if member.voice is None or member.voice.channel is None: return None if isinstance(member.voice.channel, discord.VoiceChannel): return member.voice.channel return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getChannel(self):\r\n return self.channel", "def connected_channel(self):\n if not self.channel_id:\n return None\n\n return self._bot.get_channel(int(self.channel_id))", "def get_member(self, *args, **kwargs):\n return self.bot.get_chat_member(self.id, *args, **kwarg...
[ "0.646373", "0.63648546", "0.6305858", "0.62118584", "0.6203733", "0.6181258", "0.61497027", "0.61497027", "0.6102127", "0.6016535", "0.59557235", "0.58959514", "0.5863564", "0.5860873", "0.5852965", "0.5784614", "0.5762108", "0.5737559", "0.5734102", "0.5708895", "0.5708895"...
0.81967366
0
Bucket constructor. Limits are enforced as `requests` / `time unit`.
def __init__( self, *, requests: int, time_unit: int, cooldown: int, count_failed_requests: bool = True, bypass: _BYPASS_TYPE = lambda: False, ): # Instance management self.request_id = itertools.count(0) self.state: __B...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, bucket_size, bucket_fill_rate, current_time=None):\n self.__bucket_contents = bucket_size\n self.__bucket_size = bucket_size\n self.__bucket_fill_rate = bucket_fill_rate\n\n if current_time is None:\n current_time = time.time()\n\n self.__last_bucket...
[ "0.7358357", "0.72986186", "0.72158414", "0.7204161", "0.69393927", "0.6914902", "0.6793608", "0.66649693", "0.66311467", "0.64815974", "0.64363503", "0.63744074", "0.63471764", "0.6287608", "0.6276963", "0.62408215", "0.6165582", "0.61594194", "0.61138505", "0.61004996", "0....
0.76893324
0
Return the number of remaining requests. Logic wrapper for _remaining_getter.
async def get_remaining_requests(self, request_id: int) -> int: state = self.state[request_id] # Skip call if it is already known for this request. if state.remaining_requests is None: state.remaining_requests = await self._calculate_remaining_requests(request_id) return sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remaining_requests(self):\n try:\n return self._get_limit('Remaining')\n except ValueError:\n logging.error(\n \"Unable to gather limit statistics until log() has been called. Returning -1\")\n return -1", "def get_remaining_count(self):\n ...
[ "0.8034647", "0.78535706", "0.7503283", "0.7374397", "0.7324763", "0.72857106", "0.72857106", "0.69635326", "0.6848871", "0.6715063", "0.6646195", "0.660766", "0.65200216", "0.6515231", "0.6500833", "0.6476873", "0.6351322", "0.63236535", "0.6292025", "0.6267013", "0.624735",...
0.7247335
7
Converts pandas dataframe or series index to datetime
def index_to_datetime(series): series.index = pd.to_datetime(series.index, errors='coerce')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertIndex(df):\n df.index = pd.to_datetime(df['Date'])\n return df", "def to_datetime(self, *args, **kwargs):\n return SeriesDefault.register(pandas.to_datetime)(self, *args, **kwargs)", "def datetime_to_int64(df):\n if isinstance(df.index, pd.DatetimeIndex):\n df.index = df.index...
[ "0.77881825", "0.69020075", "0.6850709", "0.672727", "0.66963947", "0.6612447", "0.65201455", "0.6344673", "0.6316727", "0.6304035", "0.62812907", "0.62066734", "0.62047505", "0.61543256", "0.61308193", "0.60734314", "0.5988572", "0.5981229", "0.595011", "0.58702993", "0.5805...
0.8173054
0
Plots the data in each column of a dataframe as subplots.
def plot_all_df_columns(df, col_nums, title='', xlabel=''): i = 1 values = df.values for col in col_nums: plt.subplot(len(col_nums), 1, i) plt.plot(values[:, col]) plt.title(title) plt.ylabel(dr_df.columns[col]) plt.xlabel(xlabel) i += 1 plt.tight_layout()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_subs(df, cols):\n plt.figure(figsize=(16,20))\n for i, col in enumerate(cols):\n plot_number = i + 1\n plt.subplot(5,3,plot_number)\n plt.title(col)\n sns.boxplot(data=df[col])", "def plot(*data):\n # split DataFrames into separate Series\n columns = []\n for d...
[ "0.7424321", "0.7145835", "0.7103161", "0.66957754", "0.66021943", "0.6595078", "0.65018976", "0.64641875", "0.6399836", "0.6358784", "0.6308148", "0.6299926", "0.6269817", "0.6253631", "0.6222589", "0.6215915", "0.6194121", "0.61399424", "0.6138811", "0.61320245", "0.6131212...
0.7594794
0
Plots observed, trend, seasonal, residuals of timeseries
def plot_decomposition(series, params, freq=None, title=''): plt.rcParams.update(params) decomp = sm.tsa.seasonal_decompose(series, freq=freq) fig = decomp.plot() plt.title(title) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_decompose(self):\n try:\n assert self._arr_seasonal is not None\n except AssertionError:\n self.ts_decompose()\n\n fig, axes = plt.subplots(5, 1, figsize=(20, 9), sharex=True)\n axes[0].plot(self._res_decomp.observed)\n axes[0].set_ylabel(\"Original...
[ "0.7123303", "0.7065652", "0.698833", "0.68718785", "0.6788437", "0.6691346", "0.66833913", "0.6530051", "0.65237814", "0.6494639", "0.6491399", "0.64687955", "0.63992894", "0.63675916", "0.63450295", "0.6343195", "0.6334397", "0.6321076", "0.6320379", "0.63198453", "0.630124...
0.6320901
18
Convert a one dimensional numpy array to a column vector.
def make_col_vector(array): return array.reshape(-1, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_col_vec(x):\n assert x.ndim == 1\n return jnp.expand_dims(x, 1)", "def _colvec(x):\n x = np.atleast_1d(x)\n return x[:, None]", "def as_column_vector(array):\n if array.ndim != 1:\n raise ValueError(\"Array must be 1D\")\n\n idx = _new_attribute_label('idx', array)\n ds = arr...
[ "0.8097338", "0.8036689", "0.7952678", "0.69864815", "0.693612", "0.67363846", "0.67027205", "0.6632903", "0.6618991", "0.65988797", "0.65857434", "0.6555784", "0.6544394", "0.645134", "0.6441944", "0.6408721", "0.64072996", "0.63616693", "0.6346052", "0.62689024", "0.62566",...
0.85594624
0
Set new target fan mode.
async def async_set_fan_mode(self, fan_mode: str) -> None: if fan_mode not in FAN_MODE_TO_DECONZ: raise ValueError(f"Unsupported fan mode {fan_mode}") await self.gateway.api.sensors.thermostat.set_config( id=self._device.resource_id, fan_mode=FAN_MODE_TO_DECONZ[fan_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_fan_mode(self, fan):\n if fan == STATE_AUTO:\n self._device.set_fan(self._device.FAN_AUTO)\n elif fan == STATE_ON:\n self._device.set_fan(self._device.FAN_ON)", "def set_fan_mode(self, value):\n return self.parent.controller.set_fan_auto_mode(value)", "def set...
[ "0.78884286", "0.77543575", "0.77154255", "0.7704043", "0.7611645", "0.75783825", "0.7501574", "0.74044466", "0.7102789", "0.7077084", "0.70231044", "0.6946794", "0.6912525", "0.67700696", "0.67671233", "0.6766175", "0.67127615", "0.6685691", "0.66704637", "0.666543", "0.6571...
0.6440846
23
Return current hvac operation ie. heat, cool. Preset 'BOOST' is interpreted as 'state_on'.
def hvac_action(self) -> HVACAction: if self._device.mode == ThermostatMode.OFF: return HVACAction.OFF if self._device.state_on or self._device.preset == ThermostatPreset.BOOST: if self._device.mode == ThermostatMode.COOL: return HVACAction.COOLING re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hvac_action(self):\n if self._hvac_mode == HVAC_MODE_OFF:\n return CURRENT_HVAC_OFF\n elif self._hvac_mode == HVAC_MODE_HEAT:\n return CURRENT_HVAC_HEAT\n elif self._hvac_mode == HVAC_MODE_COOL:\n return CURRENT_HVAC_COOL\n elif self._hvac_mode == HV...
[ "0.7340451", "0.72909945", "0.69554013", "0.6913438", "0.67911565", "0.67322415", "0.66792256", "0.64127743", "0.6215127", "0.6182708", "0.6125296", "0.61037546", "0.60784155", "0.6077235", "0.6056752", "0.6033827", "0.5899372", "0.5875682", "0.5835467", "0.5756557", "0.57563...
0.70218587
2
Set new preset mode.
async def async_set_preset_mode(self, preset_mode: str) -> None: if preset_mode not in PRESET_MODE_TO_DECONZ: raise ValueError(f"Unsupported preset mode {preset_mode}") await self.gateway.api.sensors.thermostat.set_config( id=self._device.resource_id, preset=PRESET_M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_preset_mode(self, preset_mode: str | None) -> None:\n self.svc_set_system_mode(PRESET_TO_TCS.get(preset_mode, SystemMode.AUTO))", "def set_preset_mode(self, preset_mode: str) -> None:\n if self.target_temperature == 0:\n self._data.homestatus.setroomThermpoint(\n s...
[ "0.7811572", "0.75192153", "0.74921536", "0.7414985", "0.72874016", "0.722293", "0.72137654", "0.71587706", "0.7121615", "0.71170485", "0.709526", "0.7089373", "0.67866254", "0.6745228", "0.6735515", "0.67020357", "0.6690951", "0.66362596", "0.662614", "0.65985346", "0.658549...
0.64480853
25
Return the state attributes of the thermostat.
def extra_state_attributes(self) -> dict[str, bool | int]: attr = {} if self._device.offset is not None: attr[ATTR_OFFSET] = self._device.offset if self._device.valve is not None: attr[ATTR_VALVE] = self._device.valve if self._device.locked is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_attributes(self) -> Dict[str, Any]:\n return {**super(WarmupThermostat, self).state_attributes, **self.attributes}", "def state_attributes(self):\n return self._wan", "def device_state_attributes(self):\n # Move these to Thermostat Device and make them global\n return {\n ...
[ "0.8418585", "0.80888754", "0.79596484", "0.7928174", "0.77769744", "0.7770484", "0.7748039", "0.7748039", "0.77043676", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051", "0.7701051",...
0.6979889
84
``self.sumparts`` is a ``property`` returning a boolean which controls whether the output should contain the "TOTAL_PARTS" field which specifies the number of tracks. This method also ensures the "DATE_RECORDED" field is a 4digit year. Note that when specified, the number of tracks is not simply ``len(self.tracks)`` bu...
def _Finalize(self): logging.debug("Sumparts = %s", self.sumparts) if self.sumparts: # Because some files may have corresponded to subtracks of a single logical # track, it's possible that the number of items in ``self.tracks`` is greater # than the actual number of t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _trackHasTrackOrSubTrackItems(self, track):\n if (\n len(track.items()) > 0 or\n (isinstance(track, hiero.core.VideoTrack) and len( [ item for item in itertools.chain(*track.subTrackItems()) ] ) > 0)\n ):\n return True\n else:\n return False", "def test_song_counts(self):\n ...
[ "0.5413596", "0.49820969", "0.49548176", "0.4898981", "0.4871035", "0.47825426", "0.47696367", "0.47605562", "0.47512332", "0.47228643", "0.47130257", "0.47130257", "0.4701558", "0.46913803", "0.46683884", "0.46615458", "0.46272737", "0.46184593", "0.46146587", "0.45950046", ...
0.68145597
0
get max depth form conf
def __get_max_depth(self, conf): return conf[self.conf_item.get_max_depth()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_depth(self) -> int:\n return pulumi.get(self, \"max_depth\")", "def get_max_depth(self):\n return self.MAX_DEPTH", "def option_max_depth(self):\n return six.next(six.itervalues(self.zap._request(self.zap.base + 'spider/view/optionMaxDepth/')))", "def max_depth(self) -> int:\n ...
[ "0.75725985", "0.7538911", "0.7454018", "0.7450648", "0.7442064", "0.7410549", "0.72915477", "0.7190313", "0.705415", "0.70381933", "0.69950545", "0.6929115", "0.6892667", "0.685023", "0.6834587", "0.67977357", "0.677795", "0.67759055", "0.67506486", "0.6688563", "0.6664063",...
0.89074475
0
Change the shooting direction of the bullet while tank is moving.
def start_dir(self, dir, rect): if dir.y < 0: # upward self.pos = vec(rect.midtop) if dir.y > 0: # downward self.pos = vec(rect.midbottom) if dir.x < 0: # left forward self.pos = vec(rect.midleft) if dir.x > 0: # right forward self.pos ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shoot(self):\n if self.direction == 'left':\n self.__temp_bullet = Bullet(self.position, 60)\n elif self.direction == 'forward':\n self.__temp_bullet = Bullet(self.position, 90)\n else:\n self.__temp_bullet = Bullet(self.position, 120)\n global game\...
[ "0.7117726", "0.7092369", "0.68411607", "0.67803645", "0.6585659", "0.6517875", "0.64485234", "0.6442039", "0.63504446", "0.6348335", "0.6337833", "0.63111126", "0.63073546", "0.6292689", "0.6249705", "0.6216758", "0.61497456", "0.6141508", "0.6091669", "0.60604894", "0.60500...
0.0
-1
Sends a HTTP DELETE command to the BIGIP REST Server. Use this method to send a DELETE command to the BIGIP. When calling this method with the optional arguments ``name`` and ``partition`` as part of ``kwargs`` they will be added to the ``uri`` passed in separated by ~ to create a proper BIGIP REST API URL for objects....
def delete(self, uri, **kwargs): return self.session.delete(uri, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_delete(self, **kwargs):\n return self.rabjcallable.delete(**kwargs)", "def delete(self, method, uri, query_param, request_param, headers, **kwargs):\n raise NotImplementedError", "def delete(self, **kwargs):\n\n return self.api_request(self._get_method_fullname(\"delete\"), kwargs...
[ "0.72230494", "0.7146717", "0.71016866", "0.71016866", "0.69271374", "0.68814486", "0.678748", "0.6776569", "0.6642293", "0.66297936", "0.6615379", "0.65910774", "0.6567189", "0.6536478", "0.6448481", "0.6414796", "0.64112455", "0.63953257", "0.63904166", "0.6388219", "0.6349...
0.6735619
8
Sends a HTTP PATCH command to the BIGIP REST Server. Use this method to send a PATCH command to the BIGIP. When calling this method with the optional arguments ``name`` and ``partition`` as part of ``kwargs`` they will be added to the ``uri`` passed in separated by ~ to create a proper BIGIP REST API URL for objects. A...
def patch(self, uri, data=None, **kwargs): return self.session.patch(uri, data=data, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)", "def patch(self, method, uri, query_param, request_param, headers, **kwargs):\n raise NotImplementedError", "def patch(self, uri, format='json', data=None, authentication=None, **kwargs):\r\n content_type = self...
[ "0.6252898", "0.60863453", "0.60355854", "0.59809643", "0.5946998", "0.5918233", "0.5874833", "0.58528024", "0.5833583", "0.5788615", "0.5787189", "0.577392", "0.5743103", "0.5738194", "0.57108855", "0.5701517", "0.5693799", "0.5692567", "0.5690625", "0.5672842", "0.5670992",...
0.6068852
2
Check that the extraction of column one works correctly for content.
def test_extract_column_zero_and_one_correct_content(): data = """kylebarnes@hotmail.com,Records manager joe70@yahoo.com,Network engineer torresjames@white.info,Electrical engineer shawkins@watson.com,Science writer""" result = extract.extract_data_given_column(data, 0) assert "shawkins@watson.com" in resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_extract_column_zero_and_one_correct_length():\n data = \"\"\"kylebarnes@hotmail.com,Records manager\njoe70@yahoo.com,Network engineer\ntorresjames@white.info,Electrical engineer\nshawkins@watson.com,Science writer\"\"\"\n result = extract.extract_data_given_column(data, 0)\n assert len(result) ==...
[ "0.7340439", "0.68426824", "0.6494972", "0.63817054", "0.63435924", "0.6151288", "0.61424875", "0.60746175", "0.6072085", "0.60530925", "0.6028731", "0.6021631", "0.59821373", "0.59754664", "0.59649813", "0.5963303", "0.5932593", "0.58658236", "0.58116144", "0.5772247", "0.57...
0.7626619
0
Fetch "stations" data. This will be used to populate the navigation chooser and to render the map. The data will be stored on a hidden within the browser DOM.
def fetch_stations(parameter: str, resolution: str, period: str): log.info( f"Requesting stations for " f"parameter={parameter}, " f"resolution={resolution}, " f"period={period}" ) try: stations = DwdObservationRequest( parameter=DwdObservationDataset(para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_viewer():\r\n name = request.args[\"address\"]\r\n stations = get_zipcode_stations(name)\r\n\r\n if len(stations) > 0:\r\n stations['coordinate'] = 'end_point='+stations['name'].astype(str)+'&'+'end_lng=' + stations['lon'].astype(str)+'&'+'end_lat='+stations['lat'].astype(str)\r\n\r\n ...
[ "0.7273993", "0.7258499", "0.723975", "0.68918824", "0.6795684", "0.6639082", "0.6566143", "0.6510326", "0.65040064", "0.64892286", "0.64819694", "0.64650744", "0.64633775", "0.6453867", "0.6448804", "0.6427053", "0.64231086", "0.63927823", "0.6389035", "0.6384712", "0.635695...
0.5941787
53
Create a "map" Figure element from "stations" data.
def render_map(payload): stations_data = pd.read_json(payload, orient="split") layout_germany = dict( hovermode="closest", mapbox=dict( bearing=0, center=go.layout.mapbox.Center(lat=51.5, lon=10), style="open-street-map", pitch=0, zoom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_map(data, station_counter):\n r = 6373.0\n\n phi = np.cos(55.943894)\n\n stations = list(set(data['start_station_name'].tolist() + data['end_station_name'].tolist()))\n dict = {name: () for name in stations}\n for index, row in data.iterrows():\n dict[row['start_station_name']] = ...
[ "0.69929117", "0.6867457", "0.6586602", "0.63805616", "0.6285111", "0.624049", "0.61132395", "0.6033008", "0.59531164", "0.59201807", "0.5758123", "0.5695573", "0.56743705", "0.56669354", "0.5657619", "0.5618954", "0.5614635", "0.55620027", "0.5557842", "0.5534206", "0.549230...
0.66812956
2
Construct a null block device.
def bdev_null_create(client, num_blocks, block_size, name, physical_block_size=None, uuid=None, md_size=None, dif_type=None, dif_is_head_of_md=None): params = {'name': name, 'num_blocks': num_blocks, 'block_size': block_size} if physical_block_size: params['physical_bl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_null_bdev(py,\n accelerator,\n name,\n total_size,\n block_size\n ):\n acc_client = get_accelerator_client(py, accelerator)\n acc_client.construct_null_bdev(name, total_size, block...
[ "0.72011095", "0.6911057", "0.6407407", "0.6216481", "0.6159703", "0.57735413", "0.57350004", "0.573209", "0.56739014", "0.56219906", "0.56040597", "0.560022", "0.55833966", "0.5570926", "0.5520338", "0.55086553", "0.5506752", "0.54959744", "0.5445582", "0.54366297", "0.54228...
0.69894385
1
Get opal locking range info.
def bdev_opal_get_info(client, bdev_name, password): params = { 'bdev_name': bdev_name, 'password': password, } return client.call('bdev_opal_get_info', params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_range_info(self):\n with open(self.range_path, 'r') as _file:\n for line in _file.readlines():\n list0 = line.strip().split('-')\n range_dict = {\n 'min': int(list0[0], 16),\n 'max': int(list0[1], 16),\n ...
[ "0.6120731", "0.61178946", "0.6035887", "0.5963606", "0.5926782", "0.5904029", "0.5850885", "0.5796294", "0.57727844", "0.57727844", "0.5756763", "0.57513326", "0.573994", "0.5689641", "0.56649274", "0.5650829", "0.56088203", "0.5596191", "0.5571833", "0.55567974", "0.5550548...
0.0
-1
Enable queue depth tracking on a specified bdev.
def bdev_set_qd_sampling_period(client, name, period): params = {} params['name'] = name params['period'] = period return client.call('bdev_set_qd_sampling_period', params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lun_queue_depth(self, lun_queue_depth):\n\n self._lun_queue_depth = lun_queue_depth", "def enable_depth_of_field(self, automatic_focal_distance=True):\n self._render_passes.enable_depth_of_field_pass(automatic_focal_distance)", "def set_depth(self, d):\r\n self.depth = d", "def set_d...
[ "0.5421721", "0.5097271", "0.5024116", "0.47581866", "0.4750036", "0.47438604", "0.46845233", "0.4684089", "0.46615517", "0.4557632", "0.4546334", "0.4518843", "0.44999108", "0.44991753", "0.44897863", "0.44814664", "0.44812837", "0.4476156", "0.44685832", "0.4461392", "0.443...
0.0
-1
Normalizes weather data using precomputed mean and std values.
def normalize_weather_data(self, weather_data): feat_means = np.array([self.summary[field][0] for field in self.weather_fields]) feat_stds = np.array([self.summary[field][1] for field in self.weather_fields]) # Standardize weather_standardized = (weather_data - feat_means) / feat_stds ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_data(data):\n mean = np.mean(data)\n std = np.std(data)\n return (data - mean) / std", "def normalize_data(self, data):\n self.find_mean_std(data)\n return (data - self._data_mean) / self._data_std", "def normalizeData(meanAndStd, dataset):\n\n for i in range(len(dataset)):\n ...
[ "0.77008003", "0.7683789", "0.7623165", "0.7581906", "0.7523884", "0.7482498", "0.7423822", "0.72929496", "0.7226362", "0.7226362", "0.71781135", "0.70942605", "0.70485973", "0.70324755", "0.70256686", "0.70146173", "0.6990891", "0.6990483", "0.6932159", "0.69080865", "0.6884...
0.7797831
0
Get the charge at physiological pH
def get_charge(self, table=1, cds=True): seq = self.get_seq(table=table, cds=cds) n_r = seq.count('R') n_h = seq.count('H') n_k = seq.count('K') n_d = seq.count('D') n_e = seq.count('E') return (n_r + n_h + n_k) - (n_d + n_e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_charge(self):\n\n return self.charge", "def charge(self):\n return self._charge", "def get_charge(self):\n\n return self._charge", "def getCharge(self):\n return _libsbml.FbcSpeciesPlugin_getCharge(self)", "def getCharge(self):\n return _libsbml.Species_getCharge(...
[ "0.6892906", "0.67316055", "0.6656998", "0.65494215", "0.6511157", "0.64620936", "0.62494373", "0.62494373", "0.62245363", "0.61000305", "0.6077151", "0.5996474", "0.5935002", "0.59244025", "0.59244025", "0.5923014", "0.59078825", "0.58950114", "0.5881547", "0.58723515", "0.5...
0.59569347
12
Qt MainWindow for snake control
def __init__(self, title: str = '贪吃蛇', col_row_num: tuple = (10, 10), icon: str = 'resources/ico.svg', default_len: int = 3, cell_edge: int = 50, step: int = 500, acc_rate: float = 2., ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __run(self):\n # init snake show\n self.__init_snake()\n self.__introduction.hide()\n # start ticktock for snake moving\n self.__ticker.start()\n # enable key press\n self.__enable_key = True", "def __init__widget(self):\n self.__introduction = QtWidget...
[ "0.6822868", "0.6458875", "0.64405525", "0.6217316", "0.60782987", "0.60129046", "0.58928996", "0.5873715", "0.58387583", "0.58106816", "0.580351", "0.58008415", "0.5792476", "0.5764259", "0.5763951", "0.57026845", "0.5680759", "0.5651827", "0.5651298", "0.5640487", "0.563153...
0.0
-1
Returns a given json file as a Dictionary
def load_json(file_path): with open(file_path, 'r') as json_file: # print(file_path) dictionary = json.loads(json_file.read()) return dictionary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dictionary_from_json_file(_json_file):\n with open(_json_file) as _f:\n _dict = json.load(_f)\n return _dict", "def json_dict(path):\n json_file=open(path)\n json_str = json_file.read()\n json_data = json.loads(json_str)\n return json_data", "def json_dict(path):\n json_file=ope...
[ "0.8254985", "0.82322174", "0.8196849", "0.8071217", "0.8043506", "0.79116935", "0.7819511", "0.77898854", "0.7752582", "0.7691127", "0.7676575", "0.7623366", "0.7618924", "0.76128185", "0.7608531", "0.75296813", "0.75006914", "0.74936914", "0.7470768", "0.7469812", "0.745452...
0.7830059
6
Pops the empty keys of a dictiionary.
def pop_empty_keys(dictionary): for key in dictionary.keys(): if not dictionary[key] or dictionary[key] == ['']: dictionary.pop(key) return dictionary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeAllKeys(self) -> None:\n ...", "def remove_empty(d):\n for key in d.keys():\n if d[key] is None:\n del d[key]\n return d", "def clear():\n global d\n for key in d.keys():\n del d[key]", "def removeAll(self):\n self.pDict.clear()", "def remove_key...
[ "0.7621784", "0.7524712", "0.7133096", "0.7127948", "0.69935316", "0.698208", "0.69332474", "0.6904185", "0.6850489", "0.68143654", "0.6741369", "0.6739296", "0.67257726", "0.6715927", "0.67019325", "0.6669009", "0.6663716", "0.66298836", "0.66005886", "0.6592812", "0.6544241...
0.79560703
0
Function that returns or doesn't return the inputted item if its first value is either a False value or is in the inputted null_vals list. This function first determines if the item's first value is equivalent to False using bool(), with one exception; 0 is considered as "True". If the first value is in null_vals, the ...
def filter_null(item, keep_null=False, null_vals=None): if item[0] == 0: keep = True else: keep = bool(item[0]) if null_vals and str(item[0]) in null_vals and keep: keep = False keep ^= keep_null return item if keep else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _first_non_none_value(items: Iterable[tuple[bool | None, str] | None]) -> tuple[bool, str]:\n for item_opt in items:\n if item_opt is not None:\n item, reason = item_opt\n if item is not None:\n return item, reason\n return False, \"default\"", "def FirstTrue...
[ "0.6556684", "0.56401205", "0.5630811", "0.55810654", "0.55238616", "0.5523238", "0.5503321", "0.5491755", "0.5347961", "0.53444695", "0.5330185", "0.523692", "0.52329344", "0.5226661", "0.52062654", "0.520076", "0.5113766", "0.5105992", "0.5066625", "0.505526", "0.5004646", ...
0.71539
0
Return the current rate.
def rate(self): return self._rate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_rate(self):\n pass", "def rate(self):\n return self.__rate", "def rate(self):\n return self.brate / FAC", "def getRate(self, context):\n try:\n return VTypeHelper.toDouble(context.getDevice(\"rate\").read())\n except:\n return 60.0", ...
[ "0.9319835", "0.85844415", "0.8120739", "0.7820254", "0.78136176", "0.7747039", "0.7623322", "0.7517669", "0.7501384", "0.74664474", "0.7410081", "0.7408415", "0.73838", "0.72704977", "0.7187863", "0.71433514", "0.7127786", "0.71275437", "0.70923495", "0.7082337", "0.7082337"...
0.8576214
2
Creates a dataset in the node given.
def _create_dataset(self, node): self.dataset_node = node creating = self.control_service.create_dataset( primary=node.uuid) # Not sure about handling errors and timeout in the same errback. # How could I handle them differently? def handle_timeout_and_errors(failure...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataset(store, dataset, author=None, initial_head='main'):\n dataset_path = store.get_dataset_path(dataset)\n if os.path.isdir(dataset_path):\n raise Exception('Dataset already exists')\n if not author:\n author = pygit2.Signature(COMMITTER_NAME, COMMITTER_EMAIL)\n repo = pygit...
[ "0.7120187", "0.70983845", "0.7023693", "0.70179695", "0.69900274", "0.68959284", "0.6878499", "0.6844477", "0.6844115", "0.68070936", "0.6795049", "0.6747086", "0.67453957", "0.6715302", "0.66496027", "0.6615141", "0.65884537", "0.65575504", "0.65387535", "0.652629", "0.6510...
0.7162864
0
Update the rate with the current value and send `request_rate` number of new requests.
def _request_and_measure(self, count): for i in range(count): self.rate_measurer.update_rate() def handle_request_error(result): self.rate_measurer.request_failed(result) write_failure(result) for i in range(self.request_rate): d = self.control_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_rate_limit(self, request: Request):\n if request.response is None:\n return\n headers = request.response.headers\n\n self.rate_limit_remaining = int(headers[\"x-ratelimit-remaining\"])\n\n self.rate_limit_sleep = int(headers.get(\"Retry-After\", 0))\n if sel...
[ "0.7583443", "0.7467058", "0.70391893", "0.7016838", "0.7016838", "0.7009841", "0.6968647", "0.6946577", "0.6896168", "0.68309087", "0.67792064", "0.67350847", "0.66967624", "0.6686689", "0.668299", "0.6599215", "0.6549367", "0.6403643", "0.6278206", "0.6195801", "0.6184583",...
0.60265154
26
Index page for the application. This returns the static HTML+JS application.
def kitero(): return dict(hostname=hostname)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n return app.send_static_file(\"index.html\")", "def index():\n return app.send_static_file('index.html')", "def index(self):\n return render_template(\"{0}/index.html\".format(self.__APP_DIR__))", "def get(self):\n return app.send_static_file('index.html')", "def index():\...
[ "0.82270736", "0.8197629", "0.80663246", "0.80203515", "0.798658", "0.798658", "0.798477", "0.79842746", "0.79695183", "0.7964928", "0.7953235", "0.7933499", "0.79268426", "0.7926638", "0.7926638", "0.791699", "0.7910857", "0.7905433", "0.7905433", "0.78973514", "0.78973514",...
0.0
-1
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
def get_euclidian_distance(lon1, lat1, lon2, lat2): # convert decimal degrees to radians lon1, lat1, lon2, lat2 = map(math.radians, [lon1, lat1, lon2, lat2]) # haversine formula dlon = lon2 - lon1 dlat = lat2 - lat1 a = math.sin(dlat/2)**2 + math.cos(lat1) * math.cos(lat2) * math.sin(dlon/2)**2 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.81450045", "0.7863265", "0.76322985", "0.76064754", "0.75978696", "0.75965863", "0.75944835", "0.75720793", "0.75630087", "0.7555095", "0.7528691", "0.7517629", "0.7492963", "0.7467739", "0.7452678", "0.7434477", "0.73914117", "0.7357736", "0.73318124", "0.73289627", "0.73...
0.73484355
18
Override the setUp method to instanciate and serve a request factory.
def setUp(self): super().setUp() self.request_factory = RequestFactory() self._auth_backend = LTIBackend()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.factory = RequestFactory()", "def setUp(self):\n self.factory = RequestFactory()", "def setUp(self):\n self.factory = RequestFactory()", "def setUp(self):\n ResourceFactory.create(project=Project.objects.get(pk=1))\n\n self.factory = RequestFactory()...
[ "0.8844217", "0.8844217", "0.8844217", "0.7831437", "0.7739649", "0.73787636", "0.73464376", "0.73022383", "0.7300717", "0.7241567", "0.72129756", "0.72099733", "0.7179487", "0.716274", "0.7161548", "0.71559304", "0.7148763", "0.7120404", "0.7120404", "0.7120404", "0.7120404"...
0.77170587
5
The expiry duration is the number of seconds that added to a value's creation time in order to work out its expiry timestamp.
def test_EXPIRY_DURATION(self): self.assertIsInstance(constants.EXPIRY_DURATION, int, "constants.EXPIRY_DURATION must be an integer.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expiration(self) -> typing.Optional[aws_cdk.core.Duration]:\n return self._values.get('expiration')", "def expiry(self):\n return self._expiry", "def duration(self):\n if self.is_valid:\n return relativedelta(self.expiry, datetime.date.today()).years\n else:\n ...
[ "0.7302992", "0.7282172", "0.7257041", "0.7087311", "0.6808043", "0.6790155", "0.67458475", "0.6716937", "0.66687685", "0.6602629", "0.6580407", "0.6530894", "0.6520544", "0.6503872", "0.64631903", "0.64127606", "0.6401119", "0.63962066", "0.6390618", "0.6390618", "0.6390618"...
0.68862474
4
Return the total number of available data items.
def __len__(self): return max(0, min(self.numberOfExperiences - self.phiLength, self.memorySize - self.phiLength))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_items(self):\r\n return self.num_items", "def n_items(self) -> int:\n return len(self._data_vars)", "def items_num(self):\n\t\treturn len(self.items)", "def items_num(self):\n\t\treturn len(self.items)", "def items_count(self):\n return len(self.items)", "def items_num(se...
[ "0.81978625", "0.7761586", "0.7757627", "0.7757627", "0.7757405", "0.77235377", "0.77106154", "0.77077776", "0.76719534", "0.75956345", "0.7589848", "0.75801885", "0.75574213", "0.75050837", "0.7498189", "0.7473891", "0.7445308", "0.7358157", "0.7332515", "0.73106784", "0.725...
0.0
-1
Gets the response_description of this BalanceResponse.
def response_description(self): return self._response_description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n\n return self._description", "def res_description(self):\n return self.get(\"res_description\", decode=True)", "def get_description(self):\n return self._description", "def getDescription(self):\n return self._description", "def description(self):\n ...
[ "0.65866274", "0.6508319", "0.65009356", "0.64687234", "0.6436871", "0.6389884", "0.6375548", "0.6375548", "0.63621277", "0.6349323", "0.6349323", "0.6349323", "0.6349323", "0.6318632", "0.6315536", "0.6309487", "0.6268444", "0.6268444", "0.6268444", "0.6268444", "0.6268444",...
0.7975454
0
Sets the response_description of this BalanceResponse.
def response_description(self, response_description): self._response_description = response_description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, description):\n self._description = description", "def set_description(self, description):\n self.description = description", "def set_description(self, description):\n self.__description = description", "def set_description(self, description):\r\n self._...
[ "0.6704333", "0.6592441", "0.65899867", "0.6531504", "0.6524647", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", "0.65015316", ...
0.8572948
0
Sets the account_balance of this BalanceResponse.
def account_balance(self, account_balance): self._account_balance = account_balance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_balance(self, balance=0.0):\n self.balance = balance", "def set_balance(self, balance=0.0):\n self.balance = balance", "def balance(self, balance):\n\n self._balance = balance", "def balance(self, balance):\n\n self._balance = balance", "def balance(self, balance):\n\n ...
[ "0.6933307", "0.6933307", "0.6879846", "0.6879846", "0.6879846", "0.6712804", "0.67106897", "0.6373822", "0.63054186", "0.6284406", "0.62710506", "0.6174084", "0.6068498", "0.6013402", "0.5816647", "0.57962954", "0.5770135", "0.5742681", "0.5742681", "0.5742681", "0.5742681",...
0.83401114
1
Sets the account_balance_in_card_currency of this BalanceResponse.
def account_balance_in_card_currency(self, account_balance_in_card_currency): self._account_balance_in_card_currency = account_balance_in_card_currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card_balance_in_card_currency(self, card_balance_in_card_currency):\n\n self._card_balance_in_card_currency = card_balance_in_card_currency", "def card_balance(self, card_balance):\n\n self._card_balance = card_balance", "def card_currency(self, card_currency):\n\n self._card_currency ...
[ "0.848598", "0.69174606", "0.6685792", "0.65165967", "0.65165967", "0.6510602", "0.6182031", "0.6013153", "0.57711375", "0.5396714", "0.5388921", "0.5388921", "0.5313337", "0.5313337", "0.5313337", "0.52577215", "0.52051204", "0.5089966", "0.5063683", "0.5063683", "0.5063683"...
0.88441443
0
Sets the card_balance_in_card_currency of this BalanceResponse.
def card_balance_in_card_currency(self, card_balance_in_card_currency): self._card_balance_in_card_currency = card_balance_in_card_currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_balance_in_card_currency(self, account_balance_in_card_currency):\n\n self._account_balance_in_card_currency = account_balance_in_card_currency", "def card_balance(self, card_balance):\n\n self._card_balance = card_balance", "def card_currency(self, card_currency):\n\n self._ca...
[ "0.84182423", "0.71682155", "0.7155726", "0.6446258", "0.6177303", "0.56521356", "0.540316", "0.540316", "0.53143454", "0.51900417", "0.51084125", "0.51084125", "0.5087072", "0.5087072", "0.5087072", "0.5087072", "0.5087072", "0.50439787", "0.50439787", "0.50439787", "0.50439...
0.8828694
0
Sets the card_currency of this BalanceResponse.
def card_currency(self, card_currency): self._card_currency = card_currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card_balance_in_card_currency(self, card_balance_in_card_currency):\n\n self._card_balance_in_card_currency = card_balance_in_card_currency", "def card_balance(self, card_balance):\n\n self._card_balance = card_balance", "def currency(self, currency):\n if self.local_vars_configuration...
[ "0.6891777", "0.6808106", "0.6602071", "0.65634596", "0.65634596", "0.65634596", "0.65634596", "0.6485927", "0.6462461", "0.64460295", "0.6263015", "0.6241046", "0.6111962", "0.6111962", "0.6111962", "0.6111962", "0.6111962", "0.6072923", "0.603939", "0.5835077", "0.58223206"...
0.8292337
0
Gets the last_processed of this BalanceResponse.
def last_processed(self): return self._last_processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pb_last_updated(self):\n pb = ProcessingBlock(self._pb_id)\n return pb.updated.isoformat()", "def last_updated(self):\n return self._last_updated", "def last_update(self):\n return self._last_update", "def last_update(self):\n return self._last_update", "def get_last_...
[ "0.6785164", "0.66292846", "0.6493561", "0.6493561", "0.64875865", "0.6448187", "0.63932717", "0.63466597", "0.6307924", "0.62404853", "0.61744714", "0.6126184", "0.61239445", "0.6036552", "0.60223156", "0.6021105", "0.60099995", "0.6002602", "0.6001012", "0.5977738", "0.5962...
0.8099312
0
Sets the last_processed of this BalanceResponse.
def last_processed(self, last_processed): self._last_processed = last_processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_updated(self, last_updated):\n\n self._last_updated = last_updated", "def last_updated(self, last_updated):\n\n self._last_updated = last_updated", "def last_updated(self, last_updated):\n\n self._last_updated = last_updated", "def last_updated(self, last_updated):\n\n se...
[ "0.63959205", "0.63959205", "0.63959205", "0.63959205", "0.63555986", "0.60623235", "0.6008", "0.5988248", "0.5966478", "0.5878634", "0.5876219", "0.58055454", "0.5767173", "0.5763818", "0.5736892", "0.5715711", "0.5681684", "0.54709196", "0.54101515", "0.53855467", "0.537584...
0.823827
0
Sets the requested_currency of this BalanceResponse.
def requested_currency(self, requested_currency): self._requested_currency = requested_currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card_currency(self, card_currency):\n\n self._card_currency = card_currency", "def billing_currency(self, billing_currency):\n\n self._billing_currency = billing_currency", "def requested_currency(self):\n return self._requested_currency", "def currency(self, currency):\n\n se...
[ "0.64741117", "0.62081194", "0.61715996", "0.6131625", "0.6131625", "0.6131625", "0.6131625", "0.59626883", "0.5876541", "0.5838058", "0.575627", "0.56445694", "0.56435454", "0.5596611", "0.5542865", "0.54932034", "0.542552", "0.538134", "0.53659385", "0.5329358", "0.528591",...
0.8503866
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, BalanceResponse): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Link to a referral detail view in "sent referrals" for the current user.
def sent_referrals_referral_detail(referral): return f"/app/sent-referrals/referral-detail/{referral}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draft_referrals_referral_detail(referral):\n return f\"/app/new-referral/{referral}\"", "def sent_referrals_referral_answer(cls, referral):\n return f\"{cls.sent_referrals_referral_detail(referral)}/answer\"", "def unit_referral_detail(unit, referral):\n return f\"/app/unit/{unit}/refe...
[ "0.7147881", "0.6585035", "0.6576611", "0.641894", "0.639392", "0.63225895", "0.62768316", "0.6271963", "0.6214087", "0.611338", "0.60661477", "0.6064334", "0.6040632", "0.60182035", "0.59537464", "0.58885133", "0.5843062", "0.5794584", "0.57667434", "0.5763479", "0.5760908",...
0.7448459
0
Link to a new referral detail view for the current user.
def draft_referrals_referral_detail(referral): return f"/app/new-referral/{referral}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('users:detail', kwargs={'pk': self.pk})", "def unit_referral_detail(unit, referral):\n return f\"/app/unit/{unit}/referrals-list/referral-detail/{referral}\"", "def new_address():\n user = dbwrangler.get_current_user()\n if user:\n return ...
[ "0.61695504", "0.6166776", "0.6153021", "0.6125948", "0.612041", "0.59993905", "0.59376127", "0.59194005", "0.59162706", "0.5878898", "0.5878898", "0.5878898", "0.5785096", "0.57160604", "0.57091427", "0.5663604", "0.5648643", "0.56104046", "0.55967194", "0.55912024", "0.5590...
0.69247
0
Link to a referral detail view in "sent referrals" for the current user, opening the "Messages" tab.
def sent_referrals_referral_detail_messages(cls, referral): return f"{cls.sent_referrals_referral_detail(referral)}/messages"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_new_message_for_requester(cls, user, referral, message):\n\n template_id = settings.SENDINBLUE[\n \"REFERRAL_NEW_MESSAGE_FOR_REQUESTER_TEMPLATE_ID\"\n ]\n\n # Get the path to the referral detail view from the requester's \"my referrals\" view\n link_path = FrontendLi...
[ "0.6244765", "0.6096016", "0.6082507", "0.6043666", "0.6037706", "0.6015374", "0.57555443", "0.5739524", "0.5671564", "0.56422365", "0.5625392", "0.5588801", "0.55259186", "0.55095476", "0.5484472", "0.54510975", "0.54476535", "0.54333305", "0.5378581", "0.53643185", "0.53618...
0.64179254
0
Send the "new message" email to unit members (assignees if they exist, otherwise unit owners) when a new message is created in the "Messages" tab.
def send_new_message_for_unit_member(cls, contact, referral, message): template_id = settings.SENDINBLUE[ "REFERRAL_NEW_MESSAGE_FOR_UNIT_MEMBER_TEMPLATE_ID" ] # Get the path to the referral detail view from the unit inbox unit = referral.units.filter(members=contact).first()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_created_email(self):\n if settings.NOTIFY_NEW_REG:\n to = settings.NOTIFY_NEW_REG\n message = \"\"\"\\\nGreetings,<br><br>\n\nA new vehicle registration has been submitted by %s.<br><br>\n\nGo here to view or edit the request: <br>\n<a href=\"%s\">%s</a>\n<br><br>\nSincerely,<...
[ "0.64453775", "0.63253736", "0.62276924", "0.6157891", "0.60691935", "0.6046418", "0.60343397", "0.6025324", "0.60106707", "0.6007506", "0.5917029", "0.5896104", "0.58904874", "0.5877433", "0.585522", "0.58525544", "0.5842253", "0.58254147", "0.5825204", "0.581126", "0.580712...
0.6583633
0
Generates the characters from `c1` to `c2`, inclusive.
def char_range(c1, c2): for c in range(ord(c1), ord(c2)+1): yield c, chr(c)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charRange(c1, c2):\n for c in range(ord(c1), ord(c2)+1):\n yield chr(c)", "def char_range(c1, c2):\n step = 1\n start, end = ord(c1), ord(c2)\n if start > end:\n step = -1\n for charcode in range(start, end + step, step):\n yield chr(charcode)", "def char_range(c1, c2):\...
[ "0.83376324", "0.83340454", "0.8326007", "0.83015174", "0.83015174", "0.79031044", "0.76585656", "0.62162405", "0.5940145", "0.5873479", "0.58353704", "0.5817567", "0.5673452", "0.55203587", "0.55189306", "0.5505749", "0.5457218", "0.5440957", "0.54394704", "0.53521955", "0.5...
0.82671356
5
Generate a random 43 character secret key.
def gen_key(): key = os.urandom(32) # 256 bit return base64.b64encode(key).rstrip('=') # strip off padding
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_secret_key():\n chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'\n return get_random_string(50, chars)", "def _generateSecretKey():\n return ''.join(SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(20))", "def generate_random_key():\n return '%03...
[ "0.8826276", "0.8592027", "0.825432", "0.822637", "0.81854314", "0.8018401", "0.8016688", "0.8014678", "0.7983817", "0.7959007", "0.79524624", "0.79099405", "0.7764944", "0.7750754", "0.76637924", "0.76340264", "0.7537045", "0.7534324", "0.74640524", "0.7462314", "0.741844", ...
0.8078835
5
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(optimizer, epoch): lr = args.lr * (0.1 ** (epoch // 15)) for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.7913536", "0.7906521", "0.7849834", "0.777524", "0.77338326", "0.77306354", "0.7722718", "0.77224237", "0.771982", "0.77092624", "0.7693604", "0.76742035", "0.7665748", "0.7665748", "0.7665748", "0.7655329", "0.76419765", "0.76399755", "0.7637868", "0.7626077", "0.76247585...
0.7513922
50
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].view(-1).float().sum(0, keepdim=Tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.76427615", "0.74189496", "0.7418079", "0.72710466", "0.72456723", "0.72446615", "0.7237539", "0.72213703", "0.7210107", "0.7058935", "0.6852219", "0.6786084", "0.67836976", "0.6768417", "0.67273885", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0....
0.0
-1
create a flask application object. and setting the application route.
def create_application(config=None): app = Flask(__name__) if config is not None: print('mewo') app.config.from_object(config) # else: # print(os.environ['APP_SETTINGS']) # app.config.from_object(os.environ['APP_SETTINGS']) @app.route('/') def example(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app(self):\r\n self.app = Flask(__name__, instance_relative_config=True)\r\n\r\n # Init the secret key of the app -it is a must for flask to run\r\n self.app.config.from_mapping(\r\n SECRET_KEY='!ZNeverSayNever116Z!',\r\n MONGODB_SETTINGS= {'host': 'mongodb://l...
[ "0.8175308", "0.80585176", "0.78370136", "0.7793039", "0.7790902", "0.7778967", "0.7746222", "0.76689", "0.7666189", "0.76416814", "0.7631374", "0.7585342", "0.7535479", "0.75154716", "0.7494448", "0.74778146", "0.74693", "0.746866", "0.74488324", "0.74393874", "0.7437458", ...
0.7528246
13
Generate PROVES JSON from GCIS doc metadata.
def get_doc_prov(j, gcis_url, refList): gcis_ns = "https://gcis-search-stage.jpl.net:3000/gcis.owl#" doc = ProvEsDocument() bndl = None #to get people attributed to, you need to grab article -> jornal_identifier -> look up in references # for ref in refList: # if ref['child_publication'] == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata_json(self):\n return {\n \"flavor_classes\": \"*,!io1,!memory1,!compute1,!onmetal\",\n \"image_type\": \"base\",\n \"os_type\": \"linux\",\n \"org.openstack__1__os_distro\": \"org.ubuntu\",\n \"vm_mode\": \"xen\",\n \"auto_disk_c...
[ "0.56872636", "0.5659917", "0.5643951", "0.56439006", "0.5601175", "0.55936474", "0.55513567", "0.55330396", "0.55260265", "0.552419", "0.55240315", "0.5523316", "0.55225444", "0.5510592", "0.5508546", "0.550216", "0.55009013", "0.5496174", "0.54876566", "0.54853266", "0.5476...
0.6034842
0
Cons a value onto the beginning of an iterator. Like itertools.chain([new_head], tail) >>> list(itercons(1, [2, 3, 4])) [1, 2, 3, 4]
def itercons(new_head, tail): return itertools.chain([new_head], tail)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepend(value, iterable):\n yield value\n yield from iterable", "def cons(el, seq):\n yield el\n for s in seq:\n yield s", "def with_previous(iterable, *, fillvalue=None):\n previous = fillvalue\n for item in iterable:\n yield previous, item\n previous = item", "def...
[ "0.6557596", "0.6092001", "0.5819682", "0.57241154", "0.5284187", "0.52675825", "0.5260504", "0.5122208", "0.5119563", "0.5101817", "0.5059252", "0.5058522", "0.50429195", "0.503335", "0.5009067", "0.496819", "0.49171364", "0.4900811", "0.48886877", "0.48679635", "0.48677492"...
0.79199505
0
Return iterables concatenated into one iterable. This is just a shortcut to itertools.chain.from_iterable. If you're only using this library for concat, consider using the itertools version instead. >>> list(concat([[1, 2, 3], [4, 5, 6]])) [1, 2, 3, 4, 5, 6]
def concat(iterables): return itertools.chain.from_iterable(iterables)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat(seqs):\n return itertools.chain.from_iterable(seqs)", "def concat_list(in_list):\n return list(itertools.chain(*in_list))", "def concat(*seqs):\n return itertools.chain.from_iterable(seqs)", "def flatten(iterable):\n return it.chain.from_iterable(iterable)", "def concat(cls, *args):\...
[ "0.76289684", "0.7571353", "0.7481826", "0.69393384", "0.6895636", "0.68653035", "0.6823265", "0.65461135", "0.6456404", "0.64540917", "0.64111114", "0.6399213", "0.6340035", "0.63255745", "0.63147336", "0.6299533", "0.6252468", "0.6234325", "0.6225675", "0.62250686", "0.6185...
0.80481744
0
Map function f over an iterable xs and concatenate the results. This is useful if you want to return a variable number of items into your output list from your input list. For example you may be building a list of arguments for a program that takes the same option multiple times with a different
def concat_map(f, xs): return concat(imap(f, xs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maplist(f, xs):\n return list(map(f, xs))", "def map_(func, some_list):\n \n result = []\n \n for arg in some_list:\n result.append(func(arg))\n \n return result", "def mapcat(f, seqs):\n return concat(map(f, seqs))", "def simple_map(f, l):\n # Again, my first take i...
[ "0.7363304", "0.7274947", "0.72654444", "0.6984252", "0.68078107", "0.6765618", "0.67417544", "0.6677258", "0.6648193", "0.6538361", "0.65284467", "0.6491846", "0.6468115", "0.6464553", "0.6441485", "0.63178885", "0.6308614", "0.629928", "0.62929094", "0.6184362", "0.6174395"...
0.7938518
0
Return whether at most number items in iterator are truthy. This consumes the iterator lazily, returning False as soon as the count exceeds the given number. >>> at_most(2, [False, 3, None, '']) True >>> at_most(2, [False, 3, True, 'something']) False
def at_most(number, iterator): count = 0 for item in iterator: if item: count += 1 if count > number: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def at_least(number, iterator):\n count = 0\n for item in iterator:\n if item:\n count += 1\n if count >= number:\n return True\n return False", "def __numRecordsMoreThanMax(self, numRecords):\n return numRecords > self.maxRecordCount", "def exceeded_max(self...
[ "0.67187345", "0.561398", "0.54044235", "0.5373825", "0.526374", "0.5257544", "0.5168409", "0.51239187", "0.5033381", "0.5027212", "0.4913775", "0.488875", "0.48590702", "0.4829211", "0.4800703", "0.4794531", "0.47778463", "0.47709262", "0.47654995", "0.47647685", "0.47519162...
0.78833455
0