query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get historical candle data fro a given time period.
def historical_candles(self, symbol, interval, start_time, end_time, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history(self, t_minus=0):\n data = self.ohlcv_df[self.ohlcv_df.index <= utc_to_epoch(\n self.prior_time)]\n return OHLCVData(data[-t_minus:])", "def get_candles(self, exchange: str, symbol: str, timeframe: str) -> np.ndarray:\n return store.candles.get_candles(exchange, symbol...
[ "0.6971255", "0.6928205", "0.69048023", "0.68139064", "0.6760691", "0.6760632", "0.6622193", "0.65805143", "0.6545956", "0.6524185", "0.6452969", "0.64112544", "0.6368604", "0.6332906", "0.62834126", "0.6267579", "0.62272704", "0.62151915", "0.6207075", "0.6167549", "0.616567...
0.7047711
0
Place order to execute at a current market price.
def place_market_order(self, side, symbol, size, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def place_buy_order(self):\n price = request.form[\"price\"]\n stocks = request.form[\"stocks\"]\n trader_id = request.form[\"trader_id\"]\n self.market.place_buy_order(trader_id, price, stocks)\n return \"\"", "def _simulate_market_order_execution() -> None:\n if jh.is_...
[ "0.69765216", "0.69292", "0.6865394", "0.68172646", "0.67815804", "0.66491234", "0.6612978", "0.6596807", "0.65942866", "0.6575112", "0.651982", "0.6463076", "0.6432228", "0.64138097", "0.6408965", "0.6353235", "0.6305847", "0.63014066", "0.6282573", "0.6276069", "0.6270481",...
0.68720007
2
Place order to execute at a given price.
def place_limit_order(self, side, symbol, size, price, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def place(exchange: str, side: str, amount: float, pair: str, price: float):\n loop.run_until_complete(place_order(exchange, side, amount, pair, price))", "def place_order(self, exchange, pair, type, amount, price = None):\n return self.ccxt.place_order(exchange, pair, type, amount, price)", "def pla...
[ "0.74788094", "0.7128345", "0.70201325", "0.689616", "0.6730254", "0.66365486", "0.65407693", "0.6537548", "0.65215284", "0.6474264", "0.6464579", "0.6443588", "0.6407609", "0.63726", "0.63536555", "0.6338436", "0.6338136", "0.6334442", "0.63172585", "0.6302584", "0.62971854"...
0.6710089
5
Query a given order.
def order(self, order_id, symbol, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_order(self, order_id: str):\n return self._call_txtrader_api('query_order', {'id': order_id})", "def query_order(self, symbol, orderId):\n payload = {\n 'symbol': symbol,\n 'orderId': orderId\n }\n return self.signed_request('GET', '/api/v3/order', **pa...
[ "0.7486202", "0.74333036", "0.7157581", "0.69978845", "0.6756502", "0.65135545", "0.63157356", "0.6278133", "0.613502", "0.60711783", "0.60216105", "0.60098916", "0.599705", "0.5977328", "0.59540844", "0.59491086", "0.5931085", "0.59158975", "0.5893463", "0.5887605", "0.58468...
0.532939
77
Get all open orders.
def open_orders(self, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_open_orders(self):\n self.__init_client()\n open_orders = retry(lambda: self.client\n .futures_get_open_orders(symbol=self.pair)) \n if len(open_orders) > 0:\n return open_orders\n else:\n return None", "def open_orde...
[ "0.84299356", "0.8342123", "0.8311697", "0.82279056", "0.8223204", "0.8068352", "0.79213613", "0.79142207", "0.77187514", "0.77005", "0.76585364", "0.76417845", "0.76108724", "0.7528356", "0.7517391", "0.7487796", "0.74506944", "0.73906827", "0.7383538", "0.73350686", "0.7329...
0.73145187
23
Get all open orders for a given symbol.
def open_orders_for(self, symbol, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orders_for(self, symbol):\n\t\tif self._session:\n\t\t\tdata = {'symbol': symbol}\n\t\t\treturn self._session.get_open_orders(**data)\n\n\t\treturn []", "async def get_open_orders(self, symbol):\n params = {\n \"symbol\": symbol,\n \"timestamp\": tools.get_cur_timestamp_ms()\n ...
[ "0.8801361", "0.86804783", "0.86483186", "0.8514623", "0.808615", "0.797817", "0.7919081", "0.78487015", "0.7825336", "0.7795131", "0.7702692", "0.7692453", "0.76745373", "0.76318485", "0.7543502", "0.7499859", "0.7396698", "0.738475", "0.7374423", "0.72892445", "0.72152036",...
0.7731922
10
Get all orders for a given symbol.
def all_orders(self, symbol, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_all_orders(self, symbol):\n params = {\n \"symbol\": symbol,\n \"timestamp\": tools.get_cur_timestamp_ms()\n }\n success, error = await self.request(\"GET\", \"/api/v3/allOrders\", params=params, auth=True)\n return success, error", "def orders_for(...
[ "0.871888", "0.8511643", "0.7882938", "0.76025885", "0.7352556", "0.7308918", "0.7204348", "0.7117544", "0.7101336", "0.7085123", "0.69951177", "0.68210506", "0.6699723", "0.66776425", "0.6673496", "0.66453934", "0.6642084", "0.65410185", "0.65242124", "0.6509453", "0.6493752...
0.82315767
2
Get all trades executed by a user for a given symbol.
def user_trades(self, symbol, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trades_for(self, symbol, from_id=None, timestamp=None, limit=None):\n\t\tif self._session:\n\t\t\tdata = {'symbol': symbol}\n\n\t\t\tif from_id:\n\t\t\t\tdata['fromId'] = from_id\n\n\t\t\tif timestamp:\n\t\t\t\tdata['startTime'] = int(timestamp * 1000.0)\n\n\t\t\tif limit:\n\t\t\t\tdata['limit'] = limit\n\n\t\...
[ "0.6786857", "0.6675823", "0.6539069", "0.62613904", "0.6163731", "0.60968274", "0.60843253", "0.6073838", "0.60372895", "0.60368985", "0.6019417", "0.6006068", "0.59857243", "0.5983466", "0.59783465", "0.5852677", "0.58494574", "0.5848803", "0.57797194", "0.57628", "0.572351...
0.6612362
2
Sets the dimention of the stokes vector.
def set_stokes_dim(self, stokes_dim): if stokes_dim not in [1, 2, 3, 4]: raise ValueError( "The dimention of the stokes vector can only be 1, 2, 3 or 4" ) self.stokes_dim = stokes_dim
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setidd(self, iddinfo, iddindex, block, idd_version):\n self.idd_info = iddinfo\n self.block = block\n self.idd_index = iddindex\n self.idd_version = idd_version", "def duns(self, duns: str):\n\n self._duns = duns", "def set_stdeviations(self, sigma):\n stdeviations...
[ "0.632355", "0.6193907", "0.5888917", "0.5645816", "0.5536929", "0.55124253", "0.5478698", "0.544167", "0.5424394", "0.54221827", "0.53855914", "0.5377502", "0.5362815", "0.53419864", "0.53410035", "0.53191084", "0.53157526", "0.5282019", "0.52759916", "0.5262627", "0.5243309...
0.6994929
0
Set the scattering type for the model Options are scattering with an constant scattering cross section and a phasefunction based on Henyey Greenstein (0) and rayleigh scattering with an wavelength dependent cross section (1). For full polarimetric simulation (stokes_dim > 1) rayleigh scattering will be used.
def set_scattering_type(self, scattering_type): if scattering_type == "rayleigh": scattering_type = 1 elif scattering_type == "henyey_greenstein": scattering_type = 0 if scattering_type not in [0, 1]: raise ValueError( 'Only "henyey_greenstein"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_scattering(self, setting=1):\n if setting not in [0, 1, \"on\", \"off\"]:\n raise ValueError(\n \"The input for the toggle the us of scattering \"\n 'in the model must \"on\" (1) or \"off\" (0)'\n )\n self.use_scat = 1 if setting == \"on\...
[ "0.66796225", "0.62938654", "0.58174783", "0.5719786", "0.56479996", "0.54444414", "0.523036", "0.52157414", "0.5163354", "0.5094794", "0.50772446", "0.50407004", "0.50305027", "0.49877325", "0.49587128", "0.4926275", "0.4912892", "0.48998433", "0.48370242", "0.48196423", "0....
0.81008196
0
Toggle the use of planck radiation in the model. The default is on (1).
def toggle_planck_radiation(self, setting=1): if setting not in [0, 1, "on", "off"]: raise ValueError( "The setting for the toggle the use of planck " 'Radiation must "on" (1) or "off" (0)' ) self.use_planck = 1 if setting == "on" else 0 if setting...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configOperationMode(self):\n\n if self.ui.checkShowAlignStar.isChecked():\n self.ui.checkPolarAlignment.setEnabled(True)\n else:\n self.ui.checkPolarAlignment.setEnabled(False)\n if self.ui.checkPolarAlignment.isChecked():\n self.ui.checkEditNone.se...
[ "0.62344855", "0.62020314", "0.6173377", "0.6023187", "0.6016536", "0.5940673", "0.5907294", "0.5877835", "0.58360946", "0.58043313", "0.57058173", "0.56724185", "0.56472945", "0.56395024", "0.5592563", "0.55920243", "0.55766785", "0.5559038", "0.55545807", "0.5543908", "0.55...
0.79669845
0
Toggle the use of scattering in the model. (So k = abs_coef) The default is on (1).
def toggle_scattering(self, setting=1): if setting not in [0, 1, "on", "off"]: raise ValueError( "The input for the toggle the us of scattering " 'in the model must "on" (1) or "off" (0)' ) self.use_scat = 1 if setting == "on" else 0 if setting == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clicked_checkbox_model_smoothing(self):\n if self.checkbox_model_smoothing.isChecked():\n self._get_selected_model().metadata[\"smoothing_kernel\"] = True\n self.edit_manual_smoothing.setEnabled(False)\n else:\n self._get_selected_model().metadata[\"smoothing_kern...
[ "0.52622956", "0.52451706", "0.51579946", "0.5096683", "0.5060119", "0.50167304", "0.49783123", "0.49736682", "0.49626586", "0.4955168", "0.49531534", "0.4933673", "0.49187443", "0.49177575", "0.4909981", "0.4859031", "0.48441973", "0.48347628", "0.47741818", "0.4743281", "0....
0.6945123
0
Sets the wavelength for the model instance. This is needed for the scattering cross section as well as the incoming sun intensity.
def set_wavelenth(self, wavelength): if wavelength < 0: raise ValueError("The wavelength cannot be negative") self.wavelength = wavelength RT_model_1D.set_scattering_cross_sec(self) RT_model_1D.get_atmoshperic_profiles(self) self.sun_intensity = f.sun_init_intensity(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUpWavelength(self,wavelength):\n if wavelength == None:\n self.wavelength = getDefaultWavelength()\n else:\n self.wavelength = wavelength\n return self", "def set_wavelength(self, wavelength: float) -> None:\n\n assert isinstance(wavelength, float), \"Inco...
[ "0.7543897", "0.7506083", "0.7441443", "0.72564566", "0.6959144", "0.6959144", "0.6941237", "0.664906", "0.6635105", "0.65459937", "0.64332366", "0.62733537", "0.62157166", "0.61628973", "0.60751235", "0.6061872", "0.6035115", "0.6034717", "0.6006406", "0.59973127", "0.593761...
0.80278105
0
Sets the scattering cross section according to the wavelength of the model instance.
def set_scattering_cross_sec(self): if self.scat_type == 1: sigma = f.calc_rayleigh_scattering_cross_section(self.wavelength) self.scattering_cross_sec = sigma elif self.scat_type == 0: self.scattering_cross_sec = self.SCATTERING_CROSS_SEC_HENYEY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fun_set(self):\n\n self.type.set(self.xtl._scattering_type)\n # self.energy_kev.set(8)\n self.theta_offset.set(self.xtl._scattering_theta_offset)\n self.theta_min.set(self.xtl._scattering_min_theta)\n self.theta_max.set(self.xtl._scattering_max_theta)\n self.twotheta_m...
[ "0.5799355", "0.57958126", "0.5480301", "0.52612436", "0.5250689", "0.5242964", "0.51150775", "0.5089051", "0.50533265", "0.50456446", "0.49918267", "0.49321675", "0.49295756", "0.49250093", "0.4916542", "0.49130252", "0.48921743", "0.48824984", "0.48434013", "0.48340112", "0...
0.6786386
0
Set the reflection type for the model Options are lambert (0) and specular (1) and a linear combination of those two.
def set_reflection_type(self, reflection_type=0): if reflection_type < 0 or reflection_type > 1: raise ValueError("Must be 0, 1 or inbetween") self.reflection_type = reflection_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self,number):\n if number == 0:\n self.Goblin()\n \n if number == 1:\n self.Ork()\n\n if number == 2:\n self.Skeleton()\n\n if number == 3:\n self.Troll()", "def set_type_smart(self):\n self.update(type=\"smart\")"...
[ "0.52875787", "0.52531016", "0.5250906", "0.5228072", "0.5163002", "0.5162343", "0.50840604", "0.50517833", "0.5041647", "0.50235975", "0.5020327", "0.4987726", "0.49623233", "0.49217913", "0.49075902", "0.4863573", "0.48560688", "0.4852885", "0.48483944", "0.48453522", "0.48...
0.5811174
0
Sets the position (closest to the model grid) and viewing angle of the receiver e.g. where and in which direction the radiation field is evaluated. The function converts the angle into the radiation transport direction.
def set_receiver(self, height, elevation, azimuth): if height < 0: raise ValueError("The height cannot be negative") if elevation < 0 or elevation > 180: raise ValueError("The elevation cannot be negative or greater 180") if elevation == 90: raise ValueError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_robot_pos(self):\n\t\tx,y,z = self.geo2desiredENU(self.curr_lat, self.curr_lon, self.gpsAlt)\n\t\tself.robot_msg.point.x = x\n\t\tself.robot_msg.point.y = y\n\t\tself.robot_msg.point.z = z", "def move(self, t):\n if self.visible == True:\n self.x += self.vx * t\n self.y += se...
[ "0.62159103", "0.6057396", "0.6008578", "0.58065987", "0.5802125", "0.57931626", "0.5757918", "0.5615237", "0.56146073", "0.5603354", "0.5600667", "0.55741394", "0.5569498", "0.55332774", "0.55239934", "0.5523441", "0.54987025", "0.54981136", "0.54925036", "0.54598767", "0.54...
0.0
-1
Sets the elevation and azimuth angle of the sun and the intensity. The function converts the angle into the radiation transport direction.
def set_sun_position(self, elevation, azimuth, intensity=None): if elevation < 0 or elevation >= 90: raise ValueError("The elevation cannot be negative or >= 90") if azimuth < 0 or azimuth >= 360: raise ValueError("The azimuth cannot be negative or >= 360") if intensity ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_azimuth(self):\n self.azimuth = self.Calculations.convert_to_azimuth( self.declination, self.right_ascension, self.Latitude, self.LHA)\n if self.azimuth < 0:\n self.azimuth = self.azimuth + 360.0\n return self.azimuth\n else:\n pass\n return self...
[ "0.62218684", "0.6024862", "0.60163593", "0.5670285", "0.5291753", "0.5291011", "0.52647144", "0.5253364", "0.51982725", "0.5173323", "0.5167679", "0.51630104", "0.51583445", "0.5147184", "0.51196414", "0.511552", "0.51055723", "0.5090999", "0.5079181", "0.506311", "0.5036682...
0.7400268
0
Sets the Grid for the atmosheric parameters.
def define_grid(self, atm_height=200, swiping_height=1): if atm_height < 0: raise ValueError("The height cannot be negative") if swiping_height < 0: raise ValueError("The swiping height must be positive") atm_height = f.km2m(atm_height) self.swiping_height = f.k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_grid(self,ug):\n self.grd=ug\n self.set_topology()", "def grid(self, grid):\n\n self._grid = grid", "def grid(self):\r\n dimA = self.dimA ; dimC = self.dimA ; W_grid = self.W_grid\r\n \r\n self.tol = 10e-5\r\n self.Niter = 10000\r\n \r\n a0...
[ "0.7466827", "0.69703215", "0.65102744", "0.6470333", "0.6462259", "0.6410897", "0.639689", "0.63504964", "0.6303279", "0.6245297", "0.62265956", "0.62132394", "0.6193023", "0.61890674", "0.61395335", "0.61229646", "0.602347", "0.6017699", "0.6000968", "0.59987503", "0.597637...
0.0
-1
Returns atm fields of the absorption and scattering coefficent depending on the readin_densprofile
def get_atmoshperic_profiles(self): self.absorption_coeff_field = np.zeros( (len(self.height_array), self.stokes_dim, self.stokes_dim) ) self.scattering_coeff_field = np.zeros( (len(self.height_array), self.stokes_dim, self.stokes_dim) ) dens_profile_heigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atmprofileread(filename):\n f = open(filename, 'r')\n line1 = f.readline()\n Nst = int(line1.split()[-1])\n line = f.readline()\n Np = int(line.split()[1])\n atm = 0*numpy.ndarray(shape=(Nst, Np, 5), dtype=float)\n S = 0*numpy.ndarray(shape=(Nst), dtype=float)\n f = open(filename, 'r')\...
[ "0.5766092", "0.57300544", "0.5558378", "0.5503394", "0.5415505", "0.5388779", "0.5379009", "0.53642666", "0.53555596", "0.53375286", "0.53191704", "0.53132015", "0.5234382", "0.5219888", "0.5212103", "0.51860213", "0.518094", "0.51677203", "0.51662415", "0.51586294", "0.5126...
0.51104105
22
Calculates the intensity of the suns beam at the given height with just extinction. This is needed for the Scattering source term.
def calc_direct_beam_intensity(self, height): if height < 0: raise ValueError("The height cannot be negative") idx, height = f.argclosest(height, self.height_array, return_value=True) angle, _ = f.convert_direction(self.sun_elevation, self.sun_azimuth) tau = np.zeros((self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam(xb,yb,zb,wx,wy,wavelen):\n\n zRx = np.pi * wx**2 / wavelen\n zRy = np.pi * wy**2 / wavelen \n \n sqrtX = np.sqrt( 1 + np.power(zb/zRx,2) ) \n sqrtY = np.sqrt( 1 + np.power(zb/zRy,2) ) \n intensity = np.exp( -2.*( np.power(xb/(wx*sqrtX ),2) \\\n + np.power(yb/(w...
[ "0.5935863", "0.5868439", "0.5751317", "0.54317284", "0.535781", "0.53225744", "0.5312339", "0.5210378", "0.5191353", "0.5132932", "0.5099186", "0.50963634", "0.5054381", "0.50518787", "0.5045105", "0.50375617", "0.5034523", "0.50232214", "0.501657", "0.50001836", "0.4996118"...
0.72599554
0
Clalculates the extinction term based on the given intensity and the absorbtion and scattering coefficent at the given height.
def extinction_term(self, intensity, height): id = f.argclosest(height, self.height_array) k = ( self.absorption_coeff_field[id] + self.use_scat * self.scattering_coeff_field[id] ) # np.exp calculates element wise not the matricexponential! # but for diag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extinction(pyrat):\n # Load parameters for that molecular species (in future pyrat.cond.names for condensate species) \n species = 'H2O'\n pyrat.haze.cloudBenneke.readVP(species) # do this outside once in beginning of code and call it??\n # Fill in Cloud Base Pressure and Temperature\n pyrat.h...
[ "0.5243953", "0.5232212", "0.52192557", "0.52076006", "0.5106173", "0.5002402", "0.49990737", "0.497829", "0.49478427", "0.49193546", "0.49118948", "0.487345", "0.48102024", "0.4802348", "0.47917363", "0.47859445", "0.477885", "0.47580746", "0.47495157", "0.47404954", "0.4739...
0.74419826
0
creates an empty array where the field will be evaluated
def create_receiver_viewing_field(self): height = self.receiver_height # revert in viewing direct angle, _ = f.convert_direction(self.receiver_elevation, self.receiver_azimuth) if angle < 90: # from rec (at idx) to TOA (len(h.a.)) height_at_rad_field = np.arange(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_array(cls):\n return cls.for_value({})", "def type_array():\n return []", "def __array__(self):\n return pa.column(\"dummy\", self.data).to_pandas().values", "def _buildArray(self):\n if len(self.synth_spec.components) == 0:\n self.array = np.zeros(len(self.synt...
[ "0.6259808", "0.62299883", "0.6079102", "0.5930863", "0.5783783", "0.5781425", "0.5779135", "0.5701756", "0.558807", "0.5547544", "0.55269605", "0.55269605", "0.5511912", "0.5511912", "0.5511912", "0.5511912", "0.5480194", "0.54765636", "0.5469752", "0.5431977", "0.53989655",...
0.0
-1
Returns the height field for the it is seen from the receiver
def get_receiver_viewing_field(self): field = RT_model_1D.create_receiver_viewing_field(self) return np.flipud(field)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self):\n return self[\"height\"]", "def height(self):\n return self[\"height\"]", "def get_height(self):\r\n return self.state['h']", "def height(self):\n return (self.__height)", "def height(self):\n return self.client.call('GET', self.name + 'height')", "de...
[ "0.7799121", "0.7799121", "0.7622584", "0.7476387", "0.7450351", "0.74150395", "0.74150395", "0.74150395", "0.73988795", "0.7388901", "0.7386272", "0.73818356", "0.73818356", "0.73818356", "0.7372417", "0.7299199", "0.7299199", "0.7299199", "0.7299199", "0.7275214", "0.727521...
0.0
-1
Returns the starting value based on where the reciever is looking
def rad_field_initial_condition(self): # revert in viewing direct angle, _ = f.convert_direction(self.receiver_elevation, self.receiver_azimuth) # Looking at the sky if angle < 90: I_init = ( self.sun_intensity * f.delta_func(self.sun_elevatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_value(self):\n return self._start", "def __findStartValue(self):\n\t\tself.minEvidence = 1e120*np.ones(self.nStartValues)\n\t\tfor idx1 in range(self.nStartValues):\n\t\t\tself.minEvidence[self.nStartValues-1-idx1] = self.__minBayesianEvidence(self.logLamStart[self.nStartValues-1-idx1])\n\t\t\t#...
[ "0.7167975", "0.6875307", "0.6829003", "0.66621625", "0.66621625", "0.66621625", "0.6571673", "0.6541329", "0.64761525", "0.6409516", "0.63821906", "0.6366693", "0.63498056", "0.6266545", "0.6245555", "0.6236381", "0.6226824", "0.61588854", "0.6126496", "0.6062355", "0.606235...
0.0
-1
prints an attribute which must be set here. It's for testing.
def print_testvals(self): print(self.use_planck)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print_attribute(self):\n print(vars(self))", "def print_attr(self):\n return \"name : {0}\\nprice : {1}\\ndescription : {2}\".format(\n self.name, self.price, self.description\n )", "def AttributeString(self) -> str:", "def AttributeString(self) -> str:", "def print_att...
[ "0.7736712", "0.7399579", "0.6852937", "0.6852937", "0.6824587", "0.6807231", "0.6670959", "0.6625542", "0.66095066", "0.65378267", "0.65056926", "0.6415073", "0.6340306", "0.6311172", "0.6304341", "0.62643856", "0.6244496", "0.62075406", "0.6147234", "0.61126673", "0.6112667...
0.0
-1
Extracts MFCCs from music dataset and saves them into a json file along witgh genre labels.
def save_mfcc(dataset_path, json_path, num_mfcc=13, n_fft=2048, hop_length=512, num_segments=5): # dictionary to store mapping, labels, and MFCCs data = { "mapping": [], "labels": [], "mfcc": [] } samples_per_segment = int(SAMPLES_PER_TRACK / num_segments) num_mfcc_vectors_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_all_features(mp3_file):\n # Decode and read mp3\n audio, _ = librosa.load(mp3_file, sr=SR)\n\n # Compute mels\n mel = compute_melspecs(audio)\n\n # Save\n out_file = os.path.join(\n OUTPUT_DIR, os.path.basename(mp3_file).replace(\".mp3\", \"-mel.npy\"))\n np.save(out_file, m...
[ "0.5844222", "0.5784501", "0.569305", "0.5653748", "0.56458896", "0.5638793", "0.55832857", "0.55445707", "0.55068433", "0.55017704", "0.5487365", "0.5436023", "0.53990126", "0.53845435", "0.53288573", "0.53150344", "0.53050363", "0.53041786", "0.52813184", "0.5267655", "0.52...
0.77331597
0
getArchive(conf=...) Fetch an Archive instance. If conf is passed will be used instead of the default configuration. Returns a Deferred which will fire with the Archive instance.
def getArchive(conf): url = conf.get('url') maxreq = conf.getint('maxrequests', 10) maxq = conf.getint('maxquery') proxy=Proxy(url, limit=maxreq, qlimit=maxq) proxy.connectTimeout=3.0 info = proxy.callRemote('archiver.info').addErrback(_connerror) archs= proxy.callRemote('archiver.arch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_archive(*args, **kwargs):\n return get_archive_async(*args, **kwargs).get_result()", "def get_archive_async(\n hostname, project, treeish, dir_path=None, **fetch_kwargs):\n _validate_args(hostname, project, treeish, dir_path)\n dir_path = (dir_path or '').strip('/')\n if dir_path:\n dir_path = ...
[ "0.69059646", "0.58675325", "0.57660156", "0.53493696", "0.53290415", "0.53190356", "0.5217525", "0.51383114", "0.50821906", "0.5054611", "0.48578238", "0.48038158", "0.47682074", "0.47294822", "0.4705755", "0.46751308", "0.46295667", "0.46268368", "0.46169835", "0.4615044", ...
0.7841836
0
Search for PV names matching the given pattern. If archs is None then all archives are searched. Otherwise archs must be a list of strings or integers specifing archive names or keys. Returns a Deferred which fires with a dictionary. If breakDown is False (the default) then the result is
def search(self, exact=None, pattern=None, archs=None, breakDown=False, rawTime=False): if exact is None and pattern is None: raise TypeError("Must provide 'exact' or 'pattern'") if exact is not None: pattern = '^%s$'%re.escape(exact) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(regex, paths, args, ignore_case=False, verbose=False):\n printer = MultiLinePrinter()\n for path in paths:\n if os.path.isdir(path):\n for dirname, subdirs, files in os.walk(path):\n for filename in files:\n if not KNOWN_TYPES or any([filename.en...
[ "0.47382924", "0.45816582", "0.45443344", "0.45098388", "0.4450674", "0.43616328", "0.43554297", "0.42992774", "0.42957407", "0.42762348", "0.42538893", "0.42345315", "0.42316225", "0.42286372", "0.4218467", "0.4217593", "0.42083153", "0.41941893", "0.41695234", "0.41633487", ...
0.66993964
0
Fetch raw data for the given PV. Results are passed to the given callback as they arrive.
def fetchraw(self, pv, callback, cbArgs=(), cbKWs={}, T0=None, Tend=None, count=None, chunkSize=None, archs=None, breakDown=None, enumAsInt=False, displayMeta=False, rawTimes=False): if breakDown is None: breakDown ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fetch_data(self) -> T:", "def fetchplot(self, pv, callback,\n cbArgs=(), cbKWs={},\n T0=None, Tend=None,\n count=None, chunkSize=None,\n archs=None, breakDown=None,\n enumAsInt=False):\n\n delta = total_seconds(Tend-...
[ "0.55016786", "0.5248723", "0.52326065", "0.50593275", "0.493895", "0.48849452", "0.48460248", "0.4819368", "0.4760639", "0.47135985", "0.46557218", "0.46315485", "0.46160027", "0.46151036", "0.4607112", "0.45550036", "0.45491877", "0.45421728", "0.4500722", "0.44971785", "0....
0.58612335
0
Fetch raw data for the given PV. Results are passed to the given callback as they arrive.
def fetchplot(self, pv, callback, cbArgs=(), cbKWs={}, T0=None, Tend=None, count=None, chunkSize=None, archs=None, breakDown=None, enumAsInt=False): delta = total_seconds(Tend-T0) if delta<=0.0 or count<=0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetchraw(self, pv, callback,\n cbArgs=(), cbKWs={},\n T0=None, Tend=None,\n count=None, chunkSize=None,\n archs=None, breakDown=None,\n enumAsInt=False, displayMeta=False, rawTimes=False):\n if breakDown is None:\n ...
[ "0.5860869", "0.55020386", "0.52328575", "0.50589204", "0.49374425", "0.4883425", "0.48438007", "0.48192716", "0.47610128", "0.4713053", "0.4657324", "0.46313772", "0.46159387", "0.46154013", "0.46082655", "0.4553728", "0.4550245", "0.45417523", "0.4501568", "0.44982013", "0....
0.52498764
2
Fetch the value of all requested PVs at the given time
def fetchsnap(self, pvs, T=None, archs=None, chunkSize=100, enumAsInt=False): pvs = list(pvs) archs = self._archname2key(archs) # values() request time range is inclusive, so Tcur==Tlast is a no-op sec,ns = Tcur = timeTuple(makeTime(T)) ns+=10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poll(self) -> Tuple[np.ndarray]:\n t = time.time()\n try:\n v = self.controller.get(self.pvname)\n\n except TimeoutError:\n print(f\"No process variable found for {self.pvname}\")\n v = DEFAULT_SCALAR_VALUE[self.pvname]\n\n self.time = np.append(self...
[ "0.66055065", "0.6367764", "0.58524436", "0.5844636", "0.5721731", "0.5689309", "0.5669876", "0.55845404", "0.5539236", "0.5535923", "0.5528909", "0.5492437", "0.54848826", "0.54116595", "0.54083866", "0.5388092", "0.53508306", "0.5335522", "0.5291628", "0.5287209", "0.526849...
0.48753047
93
A synchronous entrance to call self.fetch()
def sync_fetch(self, *args, **kwargs): async def wrapper(): async with aiohttp.ClientSession() as session: return await self.fetch(session=session, *args, **kwargs) python_version = float(".".join(platform.python_version_tuple()[0:2])) if python_version >= 3.7: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_fetch(self):\n pass", "def fetch(self):\n pass", "def fetch(self):\n pass", "def fetch(self) -> None:\n pass", "def run(self):\n results = self.fetch()\n return results", "def fetch(self):\n raise NotImplementedError()", "async def fetch_data(self...
[ "0.85556155", "0.776958", "0.776958", "0.7708839", "0.7366698", "0.7306223", "0.7268298", "0.71274513", "0.69972205", "0.69962937", "0.6940042", "0.6909716", "0.685237", "0.68308353", "0.68101543", "0.6636323", "0.66226596", "0.6621362", "0.6556455", "0.6512855", "0.64756656"...
0.6501955
20
The version of the NDEF mapping.
def version(self): return "%d.%d" % (self._vmajor, self._vminor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version():\n return _nfc.version()", "def _get_mapVersion(self):\n return self.__mapVersion", "def getVersion(self):\n return self.get('Version', type=\"numeric\")", "def read_versionInfo(self):\n # PROTECTED REGION ID(SdpMasterLeafNode.versionInfo_read) ENABLED START #\n retur...
[ "0.72624695", "0.7213992", "0.7134265", "0.7128217", "0.7027476", "0.7016305", "0.7016305", "0.6976598", "0.69160473", "0.68602616", "0.67498976", "0.673876", "0.67278546", "0.6727481", "0.66671264", "0.6664292", "0.6662441", "0.6656609", "0.6631765", "0.6629883", "0.6629883"...
0.7023342
5
The maximum number of user bytes on the NDEF tag.
def capacity(self): return self._ndef_file_size - 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def len_max(self):\n return 16 + 16 + 8 + 8 + Tools.bin_to_dec(self.get_data_size()) + Tools.bin_to_dec(self.get_verification_size())", "def maxsize(self):\r\n return self._maxsize", "def maxMessageSize(self, appdata=None):\r\n return self.user.maxMessageSize", "def max_length(self):\n\t...
[ "0.72259533", "0.6949809", "0.69376296", "0.6894642", "0.68714035", "0.68587446", "0.6839513", "0.6792636", "0.67583084", "0.67414427", "0.6697727", "0.6697234", "0.66827977", "0.6665894", "0.6654297", "0.6569374", "0.6536132", "0.6513441", "0.6513441", "0.651174", "0.6485859...
0.632753
31
Is True if data can be read from the NDEF tag.
def readable(self): return self._cc[13] == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_data(self):\n return len(self.data) > 0", "def has_data(self) -> bool:\n return bool(self.data)", "def has_data(self) -> bool:\n raise NotImplementedError", "def isSupportedData(self, data, info):\n return True", "def is_present(self):\n try:\n self.rea...
[ "0.6675449", "0.6558587", "0.6554889", "0.64809996", "0.6385621", "0.63179773", "0.622701", "0.6197048", "0.6192307", "0.6179339", "0.6113737", "0.60905915", "0.6049415", "0.6049415", "0.59764844", "0.58661574", "0.58595383", "0.5847148", "0.5847148", "0.58342046", "0.5825380...
0.55474675
39
Is True if data can be written to the NDEF tag.
def writeable(self): return self._cc[14] == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_data(self) -> bool:\n raise NotImplementedError", "def can_insert(data):\n return hasattr(data, 'read')", "def XPLMCanWriteDataRef(inDataRef):\n return bool", "def has_data_appended(self):\n return self._incompat_flags[0] & 0x1", "def has_data(self) -> bool:\n return ...
[ "0.6688601", "0.6649141", "0.6635758", "0.6589478", "0.65562564", "0.65354025", "0.65251344", "0.6313288", "0.62992036", "0.6082002", "0.60768175", "0.6073173", "0.6066335", "0.6025633", "0.5993792", "0.5966116", "0.5966116", "0.59162486", "0.58527404", "0.58494073", "0.58494...
0.6650295
1
NDEF message data length.
def length(self): return len(self.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_length(self):\n size = self.unpack_dword(0x4)\n if size >= 0x80000000:\n size -= 0x80000000\n return size", "def Length(data):\n return len(data)", "def length(self):\n return struct.unpack('<B', self.pkt.payload[2:3])[0]", "def length(self):\n return...
[ "0.71663755", "0.71121925", "0.70100874", "0.70100874", "0.70045644", "0.69800526", "0.69625735", "0.69608307", "0.6957863", "0.692996", "0.6908471", "0.690535", "0.6900083", "0.68991673", "0.6883723", "0.683814", "0.68362767", "0.6809234", "0.6779064", "0.6772033", "0.671825...
0.6781162
20
True if the message has changed since last read.
def changed(self): if self.readable: old_data = self.data[:] data = self.tag.read_binary(0, self._max_le) size = data[0] * 256 + data[1] + 2 tail = max(0, size - len(data)) while len(data) < size: count = min(self._max_lc, size - len(da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isUpdated(self):\n seq = self.readSeq()\n\n if (seq != self.seq):\n self.seq = seq\n return True\n else:\n return False", "def has_changed(self):\n return bool(self.changed_data)", "def has_been_modified(self):\n return self._has_been_modi...
[ "0.7590222", "0.7515303", "0.74319184", "0.7383908", "0.73827004", "0.7348319", "0.7306883", "0.72848237", "0.7212825", "0.7155925", "0.71495605", "0.714205", "0.7109246", "0.7104731", "0.7051768", "0.70474595", "0.6978085", "0.6942784", "0.69229704", "0.6901572", "0.6877428"...
0.69910336
16
An NDEF message object (an empty record message if tag is empty).
def message(self): try: return nfc.ndef.Message(str(self.data)) except nfc.ndef.parser_error: pass return nfc.ndef.Message(nfc.ndef.Record())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_deserialize_empty(self):\n # Completely empty\n out = self.instance.deserialize(self._empty_msg)\n self.assert_result_equal(out[0], self.instance._empty_msg)\n self.assert_equal(out[1], dict(size=0, incomplete=False))\n # Empty metadata and message\n out = self.in...
[ "0.6054486", "0.5856007", "0.5810143", "0.5708189", "0.565236", "0.56506103", "0.55909777", "0.5566611", "0.55424976", "0.5519104", "0.54985887", "0.54669297", "0.54646397", "0.5444558", "0.54414916", "0.5432448", "0.5428145", "0.5423365", "0.5419152", "0.54155207", "0.541419...
0.72136223
0
True if the tag is still within communication range.
def is_present(self): try: self.read_binary(0, 2) return True except: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_active(self):\n now = self.sim.now\n return (now < self.stop) and (self._number < self.max_length) \\\n and (now >= self.start)", "def is_open(self):\n return Intersection(self, self.boundary).is_empty", "def is_bounded(self):\n return True", "def __bool__(self):...
[ "0.6215045", "0.61343145", "0.61313975", "0.60261875", "0.59547496", "0.590731", "0.590731", "0.5893823", "0.5837768", "0.5826704", "0.579437", "0.5790598", "0.5758101", "0.57309175", "0.56994855", "0.5659538", "0.5656623", "0.56554794", "0.56545836", "0.5650019", "0.5639016"...
0.0
-1
Select a file or directory with parameters defined in ISO/IEC 78164
def select_file(self, p1, p2, data, expected_response_length=None): log.debug("select file") cmd = bytearray([0x00, 0xA4, p1, p2]) if not data is None: cmd += bytearray([len(data)]) + bytearray(data) if not expected_response_length is None: cmd += bytearr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_file(category, performer=None):\n\n files = File.get_files_by_category(category, performer=performer)\n files_ = []\n for file in files:\n if isinstance(file, str):\n files_.append(PyInquirer.Separator())\n continue\n file.category...
[ "0.6513869", "0.6364568", "0.63109976", "0.6171725", "0.61390656", "0.609822", "0.6077192", "0.60535794", "0.6029697", "0.6011048", "0.59819657", "0.5981733", "0.59141463", "0.5894914", "0.57887304", "0.5788316", "0.57765114", "0.5741142", "0.5687205", "0.5656245", "0.5642443...
0.5514871
26
Read count bytes from selected file starting at offset
def read_binary(self, offset, count): log.debug("read binary {0} to {1}".format(offset, offset+count)) cmd = bytearray([0x00, 0xB0, offset/256, offset%256, count]) rsp = self.transceive(cmd) if rsp[-2:] != "\x90\x00": raise Type4TagError(rsp[-2:]) return rsp[0:-2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_count(buffer, offset, count):\n\n return buffer[offset:offset + count]", "def chars(count):\n\n global offset\n\n bytes=midifile[offset:offset+count]\n offset+=count\n return bytes", "def FileRead(offset, bytes):\r\n return _hiew.HiewGate_FileRead(offset, bytes)", "def read_count(f...
[ "0.7175359", "0.6825586", "0.6784585", "0.6660244", "0.6636855", "0.66041386", "0.6511718", "0.6443673", "0.64226043", "0.6303588", "0.63005584", "0.62887025", "0.62636715", "0.6233748", "0.62070924", "0.6184758", "0.6153358", "0.6116445", "0.6106086", "0.60951126", "0.608945...
0.6073786
21
Write data bytes to selected file starting at offset
def update_binary(self, offset, data): log.debug("write binary {0} to {1}".format(offset, offset+len(data))) cmd = bytearray([0x00, 0xD6, offset/256, offset%256, len(data)]) cmd = cmd + bytearray(data) rsp = self.transceive(cmd) if rsp[-2:] != "\x90\x00": raise Type4T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_at(self, data, offset):\n n_data = len(data)\n bytes_written = 0\n while bytes_written < n_data:\n available = min(\n n_data - bytes_written,\n self.channel.connection.credits * smb2.BYTES_PER_CREDIT,\n self.channel.connection....
[ "0.7502533", "0.73030454", "0.7083179", "0.67941546", "0.66155225", "0.6552972", "0.64673847", "0.64223176", "0.6390805", "0.6389237", "0.6383939", "0.6322789", "0.6318765", "0.6307246", "0.6307246", "0.62998325", "0.6293559", "0.6291714", "0.62438726", "0.62424064", "0.62251...
0.6530812
6
Get a ``sqlalchemy.orm.Session`` instance backed by a transaction. This function will hook the session to the transaction manager which will take care of committing any changes. When using pyramid_tm it will automatically be committed or aborted depending on whether an exception is raised. When using scripts you should...
def get_tm_session(session_factory, transaction_manager): dbsession = session_factory() transaction_manager.retry_attempt_count = 3 # TODO: Hardcoded for now zope.sqlalchemy.register( dbsession, transaction_manager=transaction_manager) return dbsession
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transaction_session(session=None, auto_commit=False):\n from decanter.database import db\n session = session or db.session\n try:\n yield session\n # Catch any and every exception and execute a rollback\n except Exception, e:\n session.rollback()\n # Now re-raise the excepti...
[ "0.7649063", "0.7550382", "0.7413695", "0.73852265", "0.7375639", "0.7271203", "0.71535194", "0.71199584", "0.71002847", "0.70967805", "0.69299304", "0.69023323", "0.68734854", "0.6852362", "0.6846709", "0.6803013", "0.6774827", "0.6767137", "0.6751748", "0.66976035", "0.6670...
0.74530476
2
Initialize the model for a Pyramid app. Activate this setup using ``config.include('tm.models')``.
def includeme(config): settings = config.get_settings() settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' # use pyramid_tm to hook the transaction lifecycle to the request config.include('pyramid_tm') # use pyramid_retry to retry a request when transient exceptions occur config.inclu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_model(self):\n pass", "def setup_models(self):\n pass", "def init_model(engine):\n # Must use the same engine as the session fixture used by this module.\n initialize_model(model.mapper_registry, engine)", "def initialize_model(self):\n pass", "def init_model(engine):\n ...
[ "0.72130656", "0.7058143", "0.70304936", "0.70059496", "0.69764674", "0.69742304", "0.69742304", "0.6934316", "0.6865782", "0.66890234", "0.6581824", "0.652162", "0.64924544", "0.646011", "0.6436976", "0.63920647", "0.6363125", "0.6336152", "0.62965196", "0.6273022", "0.62500...
0.0
-1
Create a grapher and stores its functions with its predefined colors.
def __init__(self,functions): Plane.__init__(self) self.functions=functions self.colors=([RED,BLUE,GREEN,YELLOW]+[window.randomColor() for i in range(len(functions)-4)])[:len(functions)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_gladiator(health, rage, damage_low, damage_high):\n return {\n 'health': health,\n 'rage': rage,\n 'damage low': damage_low,\n 'damage high': damage_high\n }", "def __init__(self):\n self.function_dict = {\n \"Sphere\": self.draw_sphere,\n \"...
[ "0.58874846", "0.5784521", "0.5688146", "0.56115836", "0.56011266", "0.5571135", "0.5527934", "0.5496483", "0.5455124", "0.52916646", "0.5273431", "0.5215701", "0.51919824", "0.51919824", "0.51919824", "0.5186563", "0.51737446", "0.5167234", "0.51666117", "0.51666117", "0.516...
0.5603802
4
Show the elements on screen using the window.
def show(self,window): self.showFunctions(window)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(self, window):\r\n\r\n return", "def show_window(self):\n self.show()", "def show(self):\n # * displays the window, after using either the iconify or the withdraw methods\n self.wm_deiconify()\n # * this method can be called after the event which needs to happen befo...
[ "0.8284488", "0.80970746", "0.78321534", "0.78083706", "0.7644032", "0.75353515", "0.73609525", "0.7251673", "0.7248585", "0.72250664", "0.71125764", "0.705759", "0.7054281", "0.7013226", "0.7011453", "0.6982777", "0.6917495", "0.69170654", "0.69159263", "0.69141114", "0.6910...
0.7856842
2
Overload of the update method of plane for the Grapher class in order to print the functions, takes window in parameter.
def showFunctions(self,window): wsx,wsy=window.size for i,function in enumerate(self.functions): self.showGraph(function,window,self.colors[i]) window.print(str(function),[wsx-wsx/5,wsy-wsy/20*(i+2)],color=self.colors[i],size=25)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plane_update(self):\n self.plane.update()", "def update_output_window(self):\n\n self.output_window.refresh(self.coordinate_dict['output_y'], 0, 0,\n self.coordinate_dict['output_x'] + 1,\n self.full_height_out - 1,\n ...
[ "0.6443978", "0.58718014", "0.5847557", "0.57163036", "0.5636099", "0.55257374", "0.55098563", "0.55029905", "0.5498726", "0.5497915", "0.54791474", "0.5451501", "0.5445614", "0.54443544", "0.54111737", "0.53994507", "0.53977495", "0.53960454", "0.5395982", "0.5382329", "0.53...
0.61533886
1
Show the graph of a function on screen using the function, the window and an optional color.
def showGraph(self,function,window,color=None): if not color: color=window.randomColor() wsx,wsy=window.size points=[] for X in range(0,wsx): x,y=self.getFromScreen([X,0],window) X,Y=self.getToScreen([x,function(x)],window) points.append((X,Y)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showFunctions(self,window):\n wsx,wsy=window.size\n for i,function in enumerate(self.functions):\n self.showGraph(function,window,self.colors[i])\n window.print(str(function),[wsx-wsx/5,wsy-wsy/20*(i+2)],color=self.colors[i],size=25)", "def show(self, window, color=None, m...
[ "0.7177986", "0.6613471", "0.64047915", "0.6390181", "0.62344164", "0.62344164", "0.62344164", "0.62308174", "0.62073886", "0.6182668", "0.6156551", "0.6082728", "0.60510904", "0.59882784", "0.59148264", "0.58654755", "0.58518666", "0.5824023", "0.5760816", "0.57189447", "0.5...
0.8408193
0
Return the context data
def get_context_data(self, **kwargs): context = super(IndexView, self).get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Return the context data
def get_context_data(self, **kwargs): context = super(IngredientsView, self).get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Return the context data
def get_context_data(self, **kwargs): context = super(IngredientCreate, self).get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Return the context data
def get_context_data(self, **kwargs): context = super(IngredientUpdate, self).get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Return the context data
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Return set of measurements.
def get_queryset(self): return Measurement.objects.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def measurements(self):\n # get available measurement types for this node\n measurement_types = self.measurement_types()\n\n # retrieve measurement for each type\n return list(self.measurement(t) for t in measurement_types)", "def measurements(self):\n return self._measurements...
[ "0.7974883", "0.7895312", "0.7810476", "0.77818793", "0.774465", "0.77199775", "0.7672082", "0.76583797", "0.76322615", "0.74093044", "0.7294998", "0.72855127", "0.7003909", "0.6999877", "0.68823", "0.68502975", "0.67978585", "0.6783351", "0.67077327", "0.6688337", "0.6600619...
0.5979516
46
Return the context data
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Return the context data
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['version'] = settings.VERSION return context
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, context):\n # Things to do\n return context", "def get_context(self):\n return self.context.generate()", "def get_context(self):\n return {}", "def context():\n return dict()", "def data_context(self):\n return self._data_context", "def get_context...
[ "0.86183727", "0.83535194", "0.8277457", "0.81600744", "0.8112438", "0.8018441", "0.7926518", "0.7838399", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7807353", "0.7761825", "0.77448404", "0.7643687", "0.7492722", "0.74027705", "0.7398663"...
0.0
-1
Defines which entries should be possible to prepare and run. Return True on error.
def setPossibleEntryList(self, redo = True): self.entry_list_possible = NTlist() if False: # DEFAULT: False self.entry_list_possible += '1brv 1dum'.split() return # end if if not self.entry_list_nmr: if self.usePreviousPdbEntries and not redo: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actionPrepare():\n \n #Do preparation that is common for all platforms. Pass true if ortc is one of targets\n result = Preparation.setUp('ortc' in Settings.targets)\n if result != NO_ERROR:\n #Terminate execution, because prepration common for all targets and platforms has failed.\n System.stopExecut...
[ "0.5940267", "0.5919323", "0.57682717", "0.57292414", "0.5697648", "0.56928116", "0.5680766", "0.5666504", "0.56541455", "0.5625737", "0.56188905", "0.5586212", "0.5575428", "0.55647486", "0.55484563", "0.5534304", "0.5534304", "0.5534304", "0.55319035", "0.55059725", "0.5505...
0.0
-1
Bundled setups that require significant resources.
def setup(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup(self):\n pass", "def _setup(self):\n pass", "def _setup(self):\n pass", "def _setup(self):\n pass", "def _setup(self):\n pass", "def _setup(self):", "def _setup(self):", "def setup_prod():\n setup_general()", "def setup():\n _confirm_branch()\n ...
[ "0.70037156", "0.70037156", "0.70037156", "0.70037156", "0.70037156", "0.69219625", "0.69219625", "0.69162136", "0.69045925", "0.6805534", "0.676886", "0.67456096", "0.67394155", "0.6735346", "0.66862106", "0.66828656", "0.66540056", "0.66175795", "0.66054", "0.6593788", "0.6...
0.0
-1
Returns True for error. This routine sets self.entry_list_todo Will remove entry directories if they do not occur in NRG up to a maximum number as not to whip out every one in a single blow by accident. If an entry has restraint data but is not in DOCR, it will be done from mmCIF until it does occur in DOCR. In NMR_RED...
def getEntryInfo(self): showTimings = False # DEFAULT: False Enable for reporting. nTmessage("Get the entries tried, todo, crashed, and stopped in %s from file system." % self.results_base) crdb = NrgCingRdb(schema=self.schema_id) # Make sure to close it. if not crdb: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPossibleEntryList(self, redo = True):\n self.entry_list_possible = NTlist()\n if False: # DEFAULT: False\n self.entry_list_possible += '1brv 1dum'.split()\n return\n # end if\n\n if not self.entry_list_nmr:\n if self.usePreviousPdbEntries and not ...
[ "0.69043577", "0.56096375", "0.5511947", "0.54344046", "0.5384412", "0.5379743", "0.53401375", "0.51841885", "0.5162066", "0.5123202", "0.5095876", "0.50184226", "0.49978057", "0.49429077", "0.49403515", "0.490497", "0.4890484", "0.48809263", "0.48709345", "0.48637065", "0.48...
0.5511539
3
Set the list of matched entries and the dictionary holding the number of matches. They need to be defined as globals to this module. Return True on error. Also searches the PDB and BMRB databases itself.
def searchPdbEntries(self, redo = False): # modification_time = os.path.getmtime("/Users/jd/.cshrc") # self.match.d[ "1brv" ] = EntryInfo(time=modification_time) # nTmessage("Looking for entries in the different preparation stages.") # for i, phaseData in enumerate(self.phaseDataList): # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_matches():\n ALL_FIXED_q = \"all_fixed_queries\" + str(17)\n ALL_FIXED_dbs = \"all_fixed_dbs\" + str(17)\n try:\n with open(\"matches\", \"rb\") as file_h:\n db_length = pickle.load(file_h)\n except:\n print \"reading files..\"\n t = time.time()\n \"\"\...
[ "0.58386177", "0.5780435", "0.5727033", "0.56841534", "0.5484644", "0.53357863", "0.53213334", "0.5216295", "0.51756287", "0.5151685", "0.5096588", "0.4999635", "0.4946475", "0.4941619", "0.49411833", "0.49349916", "0.49349916", "0.49349374", "0.49326298", "0.49273935", "0.48...
0.64668524
0
Reformat the input HTML file content and return it.
def _format_html(self, file_content): old_string = r"<!-- INSERT JUMP BOX HERE -->" new_string = self._getJumpBoxHtml() file_content = string.replace(file_content, old_string, new_string) additional_head_string = ''' <link media="screen" href="dataTableMedia/css/demo_tab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_html():\n return", "def convert_content(self, html):\n\n try:\n dom = BeautifulSoup(html, 'html.parser')\n return self.parse_content(dom)\n except:\n return html", "def parse_html(self):\n if self.file_extension == '.czm': # Caso de fichero c...
[ "0.6582659", "0.6492117", "0.6416533", "0.63923806", "0.63347447", "0.629414", "0.62634313", "0.62472993", "0.62427706", "0.61941993", "0.61035115", "0.60052234", "0.597376", "0.5970281", "0.5909006", "0.5899246", "0.5887682", "0.5870766", "0.58454716", "0.5806536", "0.578152...
0.5648374
29
Update the plots on the front page except the pretty plot webpages. Return True on error.
def updateFrontPagePlots(self): crdb = NrgCingRdb(schema=self.schema_id) # Make sure to close it. if not crdb: nTerror("In %s RDB connection was not opened" % getCallerName()) return True # end if for trending in [ 1, 0 ]: # DEFAULT: 1,0 # for trend...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateFrontPagePrettyPlots(self):\n for trending in [ 1, 0 ]: # DEFAULT: 1,0\n# for trending in [ 0 ]:\n inputDir = os.path.join(self.results_dir, PLOT_STR )\n outputDir = os.path.join(self.results_dir, PPLOT_STR )\n if trending:\n inputDir = os.pat...
[ "0.7287471", "0.6297854", "0.6288511", "0.604255", "0.58940005", "0.5868938", "0.5679945", "0.562785", "0.5612468", "0.5590711", "0.5510018", "0.5443478", "0.5443478", "0.5443478", "0.5443478", "0.5443478", "0.5441277", "0.54403853", "0.5436331", "0.5414991", "0.5399666", "...
0.7332676
0
Create an indexing page with all images linked. Return True on error.
def updateFrontPagePrettyPlots(self): for trending in [ 1, 0 ]: # DEFAULT: 1,0 # for trending in [ 0 ]: inputDir = os.path.join(self.results_dir, PLOT_STR ) outputDir = os.path.join(self.results_dir, PPLOT_STR ) if trending: inputDir = os.path.join(self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_index_file(\n root_dir, location, image_files, video_files, dirs, force_no_processing=False):\n # Put together HTML as a list of the lines we'll want to include\n # Issue #2 exists to do this better than HTML in-code\n header_text = 'imageMe: {0} [{1} image(s)] [{2} video(s)]'.format(\n...
[ "0.65096873", "0.60325557", "0.5879827", "0.57953185", "0.57412857", "0.5682427", "0.5672433", "0.5629655", "0.56278783", "0.55914193", "0.55709606", "0.55628884", "0.5557938", "0.55475134", "0.5511182", "0.55088973", "0.54807615", "0.54618657", "0.5436935", "0.53450286", "0....
0.0
-1
Create an indexing page with all images linked. It is assumed here that the two directories are located in a shared parent directory
def createPrettyPlots(self, inputDir, outputDir, fnExtension = 'png'): number_of_entries_per_row = 4 number_of_files_per_column = 2 imageWidth = 200 # 1600 org is four times as large imageHeight = 150 # 1200 nTmessage("Updating index files for input directory: %s" % inputDir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_index_file(\n root_dir, location, image_files, video_files, dirs, force_no_processing=False):\n # Put together HTML as a list of the lines we'll want to include\n # Issue #2 exists to do this better than HTML in-code\n header_text = 'imageMe: {0} [{1} image(s)] [{2} video(s)]'.format(\n...
[ "0.72902095", "0.6531778", "0.63808787", "0.6137101", "0.5913248", "0.59064376", "0.5902415", "0.58962154", "0.586412", "0.581342", "0.5738488", "0.5735766", "0.5680487", "0.5666166", "0.5649754", "0.56297827", "0.561287", "0.5594195", "0.558716", "0.5577697", "0.55735856", ...
0.6073317
4
Dumps the relational database to about 1 Gb of CSV files.
def updateCsvDumps(self): csvDumpDir = os.path.join( self.results_dir, 'pgsql' ) sqlFile = os.path.join( self.base_dir, 'sql', 'dumpNRG-CING.sql') if runSqlForSchema(sqlFile, schemaId = self.schema_id, rootPath=csvDumpDir): nTerror("Failed runSqlForSchema in updateCsvDumps") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database_dump(self):\r\n print('=====Dumping database=====')\r\n self.database_table_dump(query.TABLE_STATS)\r\n print()\r\n self.database_table_dump(query.TABLE_TWEETS)\r\n print()\r\n self.database_table_dump(query.TABLE_POSTS)\r\n print()\r\n self.data...
[ "0.66528565", "0.6367354", "0.6322796", "0.62614536", "0.622275", "0.6192562", "0.61876374", "0.61837506", "0.61021197", "0.609251", "0.6038993", "0.5967554", "0.5927112", "0.58945864", "0.5880952", "0.5828055", "0.58182377", "0.57567316", "0.57287896", "0.57047254", "0.57025...
0.59946346
11
Create a overall summary table that shows an overview of the tables. Created on Oct 13, 2011
def updateFrontPages(self): nTmessage("Starting %s" % getCallerName()) htmlDir = os.path.join(self.results_dir, "HTML") if os.path.isdir(htmlDir): # nTdebug("Removing original html directory for NRG-CING.") rmdir(htmlDir) # end if nTmessage("Creating HTML d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_split_summary_table(all_df, train_df, test_df):\n table = PrettyTable()\n table.field_names = ['set', 'N total', 'N non-ICH', 'N ICH', 'frac non-ICH', 'frac ICH']\n for df, name in zip([all_df, train_df, test_df],['All', 'Train', 'Test']):\n table.add_row([name, len(df), len(df[df.Hemorrhag...
[ "0.7423239", "0.73014647", "0.7273784", "0.70171285", "0.699093", "0.6793168", "0.67701775", "0.6736828", "0.6680276", "0.66769737", "0.6619547", "0.66166747", "0.6596528", "0.6585564", "0.651712", "0.64721656", "0.64467716", "0.6446023", "0.6446023", "0.64426595", "0.6358988...
0.0
-1
Unzips the tgz. Copies the log Removes both tgz & log. Returns True on error.
def postProcessEntryAfterVc(self, entry_code): nTmessage("Doing postProcessEntryAfterVc on %s" % entry_code) doRemoves = 0 # DEFAULT 0 enable to clean up. doLog = 1 # DEFAULT 1 disable for testing. doTgz = 0 # DEFAULT 1 disable for testing. doCopyTgz = 0 extractTgzOnly ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_zip_file (filename, path_unzip, outfile) :\n assert path_unzip is not None\n file,ext = os.path.splitext (filename)\n ext = ext.lower ()\n if ext == \".gz\" :\n \n import gzip\n \n if outfile is None :\n dest = filename.split (\"!\")\n d...
[ "0.6601055", "0.6349917", "0.6184881", "0.61692077", "0.61302775", "0.60576636", "0.6039221", "0.5867746", "0.58496195", "0.58417505", "0.5814407", "0.5787656", "0.577728", "0.5739839", "0.5729355", "0.56869155", "0.56007725", "0.5594995", "0.55871946", "0.5576418", "0.555929...
0.0
-1
On self.entry_list_todo. Return True on error.
def runCing(self): nTmessage("Starting runCing") if 0: # DEFAULT 0 nTmessage("Going to use non-default entry_list_todo in runCing") # self.entry_list_todo = readLinesFromFile('/Users/jd/NRG/lists/bmrbPdbEntryList.csv') self.entry_list_todo = "2l2e 2l2w 2l2x 2l2y 2l2z"....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(todo_list, todo_new_item):\n check = True\n try:\n todo_list.append(todo_new_item)\n except todo_list:\n print(\"Could not add new item to todo list\")\n check = False\n\n return check", "def write_todo(self, todo):\n if todo != None:\n print 'added...
[ "0.65362954", "0.6264628", "0.62457657", "0.5950381", "0.59243155", "0.591951", "0.5868918", "0.5857064", "0.5763488", "0.5735792", "0.5725641", "0.56935704", "0.566834", "0.56297255", "0.55990285", "0.5598494", "0.55606014", "0.5551346", "0.5486843", "0.54821986", "0.5474715...
0.0
-1
Return True on error.
def postProcessAfterVc(self): nTmessage("Starting postProcessAfterVc") self.entry_list_nmr = readLinesFromFile(os.path.join(self.results_dir, 'entry_list_nmr.csv')) self.entry_list_done = readLinesFromFile(os.path.join(self.results_dir, 'entry_list_done.csv')) self.entry_list_todo = NTl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_errors(self) -> bool:", "def check_errors(self) -> None:", "def _check_error(self):\n\n if self.error_code_test != 0:\n return False\n else:\n return True", "def prnt_error():\n print \"Error!\\n\"\n return False", "def hasErrors(self):\n return Fals...
[ "0.79648924", "0.78216517", "0.7730106", "0.7702022", "0.76580405", "0.7605078", "0.7452465", "0.7430146", "0.7429136", "0.7429136", "0.7369654", "0.7352932", "0.72891927", "0.7282168", "0.72466207", "0.7120696", "0.70649666", "0.7058519", "0.7055884", "0.70386034", "0.700246...
0.0
-1
Return True on error. verbosity inputDir outputDir pdbConvention restraintsConvention archiveType projectType storeCING2db ranges filterTopViolations filterVasco singleCoreOperation
def createToposTokens(self, jobId = TEST_CING_STR): # jobId = TEST_CING_STR # DEFAULT: TEST_CING_STR Set for testing. # jobId = REFINE_ENTRY_STR jobId = VALIDATE_ENTRY_NRG_STR tokenListFileName = os.path.join(self.results_dir, 'token_list_todo.txt') # Sync below code with valida...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_all_files_and_dirs(self):\n err = 0\n err_m = ''\n warning = 0\n warning_m = ''\n # Check the pdb file for refinement\n if self.refine_pdb_in == None:\n err = 1\n err_m += '\\nPdb file should be supplied'\n else:\n if self....
[ "0.5354922", "0.5183361", "0.5134487", "0.51090115", "0.5005448", "0.49695235", "0.4932564", "0.49020913", "0.48695174", "0.4862666", "0.48543862", "0.48481873", "0.48474097", "0.48417285", "0.48415136", "0.48409507", "0.48312497", "0.48222607", "0.47857195", "0.4769777", "0....
0.0
-1
On self.entry_list_todo. Return True on error.
def replaceCoordinates(self): self.entry_list_todo = readLinesFromFile(os.path.join(self.results_dir, 'list', 'entry_list_recoord_nrgcing_shuffled.csv')) self.entry_list_todo = self.entry_list_todo[:100] entryListFileName = "entry_list_recoord_todo.csv" writeTextToFile(entryListFileName,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(todo_list, todo_new_item):\n check = True\n try:\n todo_list.append(todo_new_item)\n except todo_list:\n print(\"Could not add new item to todo list\")\n check = False\n\n return check", "def write_todo(self, todo):\n if todo != None:\n print 'added...
[ "0.6535864", "0.6267024", "0.6246162", "0.5952014", "0.59265065", "0.5922316", "0.58717424", "0.5859177", "0.5764468", "0.5735906", "0.5728612", "0.56953245", "0.56699693", "0.56310666", "0.55995315", "0.55988985", "0.5561708", "0.555206", "0.5489174", "0.54824257", "0.547576...
0.0
-1
Needs to be overriden by e.g. nmr_redo. Return True on error.
def refine(self): # pylint: disable=R0201 return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_redo(self) -> bool:\n\n return self.position < len(self.history) - 1", "def has_redo(self):\n return self._current_undo_command + 1 != len(self._commands)", "def canRedo(self):\n return self._index < len(self._commands)", "def retry(self):\n # XXX: check whether it is poss...
[ "0.7054411", "0.701077", "0.692074", "0.65056694", "0.64995927", "0.6481644", "0.6417906", "0.6362988", "0.6357255", "0.6115446", "0.61079174", "0.60984766", "0.60878116", "0.5987586", "0.5986594", "0.59642196", "0.5913475", "0.5890314", "0.5882373", "0.5878642", "0.58432573"...
0.0
-1
sync images to docker machine hosts
def cli(ctx, image_file): if not image_file: return for pull_image in image_file.readline(): pull_image = pull_image.rstrip('\n') if len(pull_image) == 0: continue docker.pull(pull_image) push_image = '%s/%s/%s' % (DEFAULT_REGISTRY, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_remote_image(local_image_path, filename):\n for host in APP.config['REMOTE_HOSTS']:\n user = APP.config['REMOTE_HOST_USERNAME']\n directory = APP.config['REMOTE_IMAGE_DIRECTORY']\n ssh_command = f'''ssh -oStrictHostKeyChecking=accept-new -i /root/.ssh/id_rsa \\\n {user}@{...
[ "0.6557685", "0.6444026", "0.6244093", "0.62162626", "0.6192624", "0.6067474", "0.5999034", "0.5986492", "0.5871816", "0.5861316", "0.5789827", "0.57858646", "0.5764116", "0.5740863", "0.5707998", "0.5635532", "0.5630496", "0.56185627", "0.56116", "0.55559105", "0.54989785", ...
0.60403055
6
Reset all lengths pose with init state
def ResetPos(self): for idx in range(self.unFixJL): self._p.resetJointState(self.uid, idx, self.InitInfo["JPos"][idx], self.InitInfo["JVel"][idx])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self.steps = 0\n self.state = 0\n self.trajectory = []", "def reset(self):\n self.position = np.zeros(self.ndegres)\n self.velocity = np.zeros(self.ndegres)\n self.state = np.zeros(2*self.ndegres)\n self.flag = 0\n self.h_ref = np.array([...
[ "0.7203299", "0.7193509", "0.7189836", "0.71515554", "0.71506715", "0.702369", "0.69588333", "0.6910216", "0.6836779", "0.6830261", "0.67455906", "0.6727042", "0.672369", "0.672369", "0.672369", "0.67201173", "0.66877395", "0.66546106", "0.66449106", "0.66274893", "0.6600268"...
0.68099713
10
Robot Simulation Env, every cmd exec need to run (sim_freq / cmd_freq) sim_tims steps;
def Apply_Pos(self, act_cmd, record_joints = False): # limit motor vel, if surplus, then clip if record_joints: cur_cmd_js = [] # cur_cmd_js.append(self.GetPosObs()) for _ in range(self.cmd_step): # print("pos : ", self.GetMotorAng()) # print("v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runRobot():", "def main():\n run_simulation(spectral=False, ml=False, num_procs=1)\n run_simulation(spectral=True, ml=False, num_procs=1)\n run_simulation(spectral=False, ml=True, num_procs=1)\n run_simulation(spectral=True, ml=True, num_procs=1)\n run_simulation(spectral=False, ml=True, num_p...
[ "0.638473", "0.6331924", "0.632148", "0.61970353", "0.61686397", "0.60981554", "0.6055782", "0.6055782", "0.59908384", "0.5978672", "0.59524536", "0.595225", "0.5946836", "0.5919655", "0.5914979", "0.586384", "0.5856052", "0.5836727", "0.58234084", "0.58036256", "0.5795908", ...
0.0
-1
Get a list of dates that contain memories for a user.
def list_memories(self, user_id, start_date=None, end_date=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_memos():\n records = []\n for record in collection.find({\"type\": \"dated_memo\"}):\n record['date'] = arrow.get(record['date']).isoformat()\n del record['_id']\n records.append(record)\n # sorted() function use taken from Rob Murray:\n # https://stackoverflow.com/question...
[ "0.62519693", "0.589958", "0.5861902", "0.5788278", "0.5683896", "0.5669883", "0.5618058", "0.5612521", "0.5612506", "0.55803084", "0.55629635", "0.5521892", "0.5515748", "0.54657376", "0.5464114", "0.54432034", "0.54235256", "0.5418274", "0.54057574", "0.5374128", "0.5370449...
0.7138492
0
Return whether a memory exists for a user at a date.
def has_memory(self, user_id, memory_date): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def record_exists(self, date):\n for record in self.records:\n if self.date_str == record[\"date\"]:\n return True\n return False", "def alreadyStored(self, date_):\r\n for day in self._repo:\r\n if day.date == date_:\r\n return True\r\n ...
[ "0.64419144", "0.5881912", "0.5841056", "0.5658975", "0.56083417", "0.56036156", "0.5585815", "0.5566384", "0.5522872", "0.55008674", "0.53935784", "0.53619343", "0.5356803", "0.52772665", "0.5258884", "0.5247556", "0.52393395", "0.5212584", "0.5209245", "0.51901716", "0.5186...
0.8038259
0
Configure and return the Flask app
def create_app(self): app.config.from_object('config.TestingConfig') return app
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app(self):\n\n ## set flask specific things that are non-optional\n error = lambda k: 'Fatal: You need to specify a \"flask\" section ' + \\\n 'with an entry like \"'+k+'=...\" in your .ini file'\n try: app_name = self['flask.app']\n except KeyError: raise SystemExit...
[ "0.85104823", "0.81120455", "0.8054589", "0.80477077", "0.7995264", "0.7929426", "0.7846994", "0.7837908", "0.7773335", "0.7747373", "0.7746391", "0.7729097", "0.77219594", "0.7708146", "0.77017826", "0.76943517", "0.7686414", "0.7680069", "0.76726705", "0.76552176", "0.76191...
0.76463825
20
Copy description from manual page 79
def h_o(self): return self._h_o
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description():", "def description(self):", "def get_description(self):", "def help_description():\n pass", "def description(self):\n pass", "def description(self):\n pass", "def get_description(self):\n return re.sub('\\n\\W+',' ', self.__doc__)", "def Description(self...
[ "0.798952", "0.74467456", "0.7336333", "0.72837377", "0.71202844", "0.71202844", "0.7059274", "0.70321923", "0.70321923", "0.6990859", "0.696746", "0.6894048", "0.68891364", "0.6875786", "0.6862433", "0.6778213", "0.6750307", "0.6750307", "0.67375386", "0.6713404", "0.6671586...
0.0
-1
Returns bootstrap estimate of 100.0(1alpha) CI for statistic.
def bootstrap(data, num_samples, statistic, alpha): n = len(data) idx = npr.randint(0, n, (num_samples, n)) samples = x[idx] stat = np.sort(statistic(samples, 1)) return (stat[int((alpha/2.0)*num_samples)], stat[int((1-alpha/2.0)*num_samples)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bootstrap_CI(self, alpha, num_samples):\n\n # set random number generator seed\n numpy.random.seed(1)\n\n # initialize delta array\n delta = numpy.zeros(num_samples)\n\n # obtain bootstrap samples\n for i in range(num_samples):\n sample_i = numpy.random....
[ "0.76049566", "0.7369145", "0.7369145", "0.7200213", "0.69077885", "0.68503654", "0.68281436", "0.65225583", "0.6516209", "0.6500391", "0.6483958", "0.6221434", "0.61406034", "0.6129345", "0.60075456", "0.598997", "0.5946004", "0.59068424", "0.5902341", "0.5886393", "0.586061...
0.6811339
7
check to see if a site is live
def is_alive(self, site): try: return requests.get(site).status_code == 200 except Exception: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_website_online(host):\n try:\n socket.gethostbyname(host)\n except socket.gaierror:\n return False\n else:\n return True", "def isonline():\n\n conn = httplib.HTTPConnection(\"www.google.com\", timeout=5)\n try:\n conn.request(\"HEAD\", \"/\")\n conn.close...
[ "0.7184357", "0.6925616", "0.69226384", "0.6872171", "0.68130124", "0.680132", "0.65696245", "0.64950216", "0.6441501", "0.64284706", "0.6418446", "0.6374213", "0.63635945", "0.6330601", "0.6329618", "0.6314663", "0.6310036", "0.6304025", "0.62810314", "0.62600166", "0.624670...
0.7745489
0
method to inject the url with a query
def blind(self): print("Performing blind sql injection on {}".format(self.domain)) return self.inject()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url_replace(context, **kwargs):\n query = context['request'].GET.dict()\n query.update(kwargs)\n return urlencode(query)", "def url_replace(context, **kwargs):\n query = context['request'].GET.dict()\n query.update(kwargs)\n return urlencode(query)", "def url_with_querystring(url, **kwarg...
[ "0.70120484", "0.70120484", "0.7010469", "0.699704", "0.68464214", "0.6821921", "0.6809707", "0.6648688", "0.6613393", "0.66075397", "0.6583891", "0.6579221", "0.6572595", "0.6557424", "0.6557424", "0.65356547", "0.6489736", "0.648267", "0.64804256", "0.6476738", "0.6470362",...
0.0
-1
Run method for the start of the application, accepts the domain as an argument.
def run(self, domain): url = re.findall('(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', domain) if len(url) >= 1: for r in url: self.domain = r else: print("Provide a valid url ie www.example.com ") self.blind # calling a m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.app.run()", "def run(self):\n self.app.run()", "def run():\n app = Application()\n #app.sentry_client = AsyncSentryClient(app.settings['sentry_url'])\n http_server = HTTPServer(app, xheaders=True)\n http_server.listen(options.port)\n print('Running on port %d'...
[ "0.6693647", "0.6693647", "0.6408186", "0.6318336", "0.62469375", "0.6231638", "0.6231638", "0.62093973", "0.6198194", "0.61581784", "0.6132528", "0.6112055", "0.6091389", "0.60707957", "0.60672754", "0.60449064", "0.6042374", "0.60180104", "0.6017973", "0.60146195", "0.60134...
0.66517687
2
10 ms faster, than import uuid4
def uuid4(): b = ''.join('%x' % x for x in os.urandom(16)) return "%s-%s-%s-%s-%s" % (b[0:8], b[8:12], b[12:16], b[16:20], b[20:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v4():\n return base64.urlsafe_b64encode(uuid.uuid4().bytes)[:-2] # Drop '==' padding", "def test_uuid():\n for _ in range(1000):\n uuid = uuid_generator()\n assert len(uuid) == 36\n assert uuid.count('-') == 4", "def _get_uuid():\n return str(uuid.uuid4())", "def generate_id...
[ "0.749502", "0.74192566", "0.73969394", "0.73628277", "0.72862285", "0.7247379", "0.7240885", "0.7184937", "0.7184937", "0.7184658", "0.717396", "0.71590453", "0.71353364", "0.711079", "0.70460355", "0.70416224", "0.7026545", "0.70200133", "0.69982344", "0.6930404", "0.692983...
0.7622199
0
Create an index of mapped letters (zip to dict).
def translation(first, second): if len(first) != len(second): raise WrongLengthException('The lists are not of the same length!') return dict(zip(first, second))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mapping_letter(letters):\n my_list = list(map(lambda x: x.upper(), letters))\n return dict(zip(letters, my_list))", "def create_dictionaries(chars):\n return dict((c, i) for i, c in enumerate(chars)), dict((i, c) for i, c in enumerate(chars))", "def _create_subscript_mapping():\n # Create the no...
[ "0.7323739", "0.6905413", "0.68344617", "0.6818953", "0.6551249", "0.6550341", "0.6446107", "0.64334625", "0.64166945", "0.63979185", "0.63765055", "0.6270741", "0.62367254", "0.62338865", "0.6211539", "0.619778", "0.61915135", "0.61460876", "0.6141319", "0.61408085", "0.6139...
0.0
-1
Squeeze the given sequence by dropping consecutive duplicates.
def squeeze(word): return ''.join(x[0] for x in groupby(word))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeDuplicates(seq):\n\n pass", "def removeDuplicates(seq):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in seq if not (x in seen or seen_add(x))]", "def uniq(seq):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in seq if x not in seen and no...
[ "0.7483001", "0.7261245", "0.65032953", "0.6358768", "0.6315142", "0.6266054", "0.6199574", "0.61771053", "0.6175709", "0.61725605", "0.61043745", "0.60808164", "0.60753167", "0.605259", "0.6049053", "0.60409445", "0.60155874", "0.59284973", "0.59154576", "0.5809901", "0.5727...
0.0
-1
Constructs the Linear module.
def __init__( self, output_size: int, with_bias: bool = True, w_init: tp.Optional[hk.initializers.Initializer] = None, b_init: tp.Optional[hk.initializers.Initializer] = None, name: tp.Optional[str] = None, ): super().__init__( output_size=output_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, units, activation=None, use_bias=True, kernel_initializer=None, bias_initializer=None,\n trainable=True, dtype=tf.float32, name=None):\n # general init\n if name is None:\n name = \"Linear\"\n self.name = str(name)\n self.variable_scope = tf...
[ "0.6729752", "0.64801776", "0.6456392", "0.63238543", "0.63191384", "0.621048", "0.6181088", "0.6168781", "0.61668515", "0.6132894", "0.6119526", "0.6119526", "0.6091859", "0.6075223", "0.603353", "0.6022447", "0.60161537", "0.5987431", "0.5971014", "0.5959086", "0.595031", ...
0.0
-1
Initialize layers of the head.
def _init_layers(self): self.relu = nn.ReLU(inplace=True) self.cls_convs = nn.ModuleList() self.reg_convs = nn.ModuleList() for i in range(self.stacked_convs): chn = self.in_channels if i == 0 else self.feat_channels self.cls_convs.append( ConvModu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self):\n self._init_predictor()\n if self.use_edge_fusion:\n self._init_edge_module()", "def _init_layers(self) -> None:\n self.self_attn = MultiheadAttention(**self.self_attn_cfg)\n self.cross_attn = MultiheadAttention(**self.cross_attn_cfg)\n self....
[ "0.7565452", "0.73801965", "0.7378758", "0.70826614", "0.70083666", "0.68058515", "0.6793121", "0.6747672", "0.6699219", "0.6565106", "0.6552534", "0.6548868", "0.6536724", "0.6533556", "0.65013635", "0.64803135", "0.6478405", "0.6438143", "0.6429889", "0.6428964", "0.6401287...
0.67046845
8
Initialize weights of the head.
def init_weights(self): for m in self.cls_convs: normal_init(m.conv, std=0.01) for m in self.reg_convs: normal_init(m.conv, std=0.01) bias_cls = bias_init_with_prob(0.01) normal_init(self.retina_cls, std=0.01, bias=bias_cls) normal_init(self.retina_reg, st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_weights(self):\n pass", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)", "def setWeightInitializer(self,weights):\n self.init_w = weights", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weigh...
[ "0.8231931", "0.8066145", "0.8041016", "0.8037346", "0.79638714", "0.78825206", "0.7794443", "0.7718116", "0.76905215", "0.76740956", "0.7660412", "0.76257116", "0.76194113", "0.75636816", "0.7554319", "0.7554319", "0.75442475", "0.75423366", "0.75423366", "0.75423366", "0.75...
0.66495466
96
Forward feature of a single scale level.
def forward_single(self, x): cls_feat = x reg_feat = x for cls_conv in self.cls_convs: cls_feat = cls_conv(cls_feat) for reg_conv in self.reg_convs: reg_feat = reg_conv(reg_feat) cls_score = self.retina_cls(cls_feat) bbox_pred = self.retina_reg(reg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_forward(self, x):\n raise NotImplementedError", "def forward(self, x):\n x = self.features(x)\n return x", "def forward_single(self, x, scale):\n cls_feat = x\n reg_feat = x\n for cls_conv in self.cls_convs:\n cls_feat = cls_conv(cls_feat)\n ...
[ "0.74690366", "0.68007946", "0.65777415", "0.6515914", "0.6515914", "0.6404764", "0.6320513", "0.6306763", "0.6299315", "0.6285584", "0.6279949", "0.6200305", "0.6179189", "0.6158268", "0.6132828", "0.6124821", "0.61077636", "0.61061907", "0.6104554", "0.6101124", "0.6098391"...
0.0
-1
Compute losses of the head.
def loss(self, cls_scores, bbox_preds, gt_bboxes, gt_labels, img_metas, gt_bboxes_ignore=None): featmap_sizes = [featmap.size()[-2:] for featmap in cls_scores] assert len(featmap_sizes) == self.anchor_generator.num_levels ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def losses(self):\n pass", "def compute_loss(self):", "def losses(self):\n # compute all kinds of losses \n\n # 1. Logits losses for classification \n\n # 2. regression loss for bbox \n\n return classification_loss, bbox_reg_loss", "def compute_loss(self, obs, returns):", ...
[ "0.7471189", "0.6744396", "0.6732741", "0.66957474", "0.6637872", "0.65996355", "0.65996355", "0.6463765", "0.6462264", "0.6452444", "0.6387869", "0.63160586", "0.6304027", "0.6283066", "0.6242887", "0.6218127", "0.61900795", "0.617547", "0.6174948", "0.6159635", "0.6144969",...
0.0
-1
Reads the discounts csv file & returns a dataframe
def read_discounts(self, file_name): discounts = pd.read_csv(f'{file_name}.csv') return discounts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_extract(cryptocurrency):\n df = pd.read_csv(f'input_12mo/{cryptocurrency}.csv')\n df = df['Close'].copy()\n df = df[-183:].copy()\n return df", "def loan_data():\n return pd.read_csv(data_path / \"credit_data.csv\")", "def read_csv():", "def read_data(filepath):\n df = pd.read_...
[ "0.67762727", "0.66502154", "0.657781", "0.65579677", "0.65579677", "0.65579677", "0.6523957", "0.6514698", "0.64671755", "0.6462768", "0.6447732", "0.63911945", "0.63872385", "0.6359474", "0.6340352", "0.6323935", "0.6310876", "0.62966776", "0.6278205", "0.6277503", "0.62688...
0.7847184
0
Consumes discount dataframe & returns multiple metadata from it
def get_product_vs_offer_and_volume(self, df): product_vs_min_volume = {} product_offer = {} base_product_vs_offer_product = {} for i in df.itertuples(): product_vs_min_volume[i[4].lower()] = i[5] product_offer[i[4].lower()] = i[1] base_product_vs_of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata(self, df):\n raise NotImplementedError(\"missing metadata() method\")", "def get_metadata(self):\n df_data = pd.read_csv(self.path_bin)\n # df_data = df_data[df_data['subject'] == 0] # limit data to certain subject.\n\n df = pd.DataFrame()\n df['mean'] = np.mean(df...
[ "0.6035103", "0.5869", "0.5865952", "0.58466834", "0.5742667", "0.57354236", "0.5657524", "0.5648695", "0.56444234", "0.5626451", "0.5606854", "0.5591722", "0.55566615", "0.55493385", "0.5523179", "0.5518336", "0.5508248", "0.5500367", "0.54583555", "0.54141194", "0.54134256"...
0.0
-1
Takes in the product volume dictionary & returns applicable discounts, any residuals (product codes) which doesnt have any offers
def get_applicable_discounts(self, actual_volume): applicable_discounts = [] residual = {} min_vol_criteria, product_vs_offer, base_product_vs_offer_product = self.get_product_vs_offer_and_volume(self.discounts) for basket_item, volume in actual_volume.items(): offer_on_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_basket_with_discounts(self, actual_volume, applicable_discounts, residual):\n\n # product_vs_min_volume, product_offer = self.get_product_vs_offer_and_volume(self.discounts)\n pr = Product('items')\n product_prices = pr.product_meta\n\n basket = []\n\n for discount in app...
[ "0.64345753", "0.6058145", "0.57161295", "0.5696214", "0.5675615", "0.56543845", "0.5502182", "0.54654807", "0.544653", "0.5391345", "0.5367731", "0.5360388", "0.53320503", "0.53056145", "0.5287403", "0.526012", "0.52296513", "0.52091134", "0.52077895", "0.5205086", "0.519474...
0.7132442
0
Computes all applicable offers if the offer type is Dicsount. Buy 1 get 1 or any other discounts
def get_basket_items_discount(self, offer_info, actual_volume, product_prices): prod_code = offer_info.base_prod_code base_prod_vol = actual_volume.get(prod_code.lower()) discount_basket = [] if base_prod_vol >= offer_info.min_vol: offer_on_prod = offer_info.offer_on ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_offers_to_send(self) -> Dict[Tuple[float, float], float]:\n partial_asgt = self._neighbors_values.copy()\n offers = dict()\n\n for limited_asgt in generate_assignment_as_dict([self.variable, self._partner]):\n partial_asgt.update(limited_asgt)\n cost = self._...
[ "0.55473804", "0.5530387", "0.55122185", "0.5472553", "0.5421471", "0.5414957", "0.53732795", "0.53643686", "0.53457385", "0.5306167", "0.52392435", "0.523554", "0.52336174", "0.52059656", "0.5203071", "0.51802623", "0.51542354", "0.5132325", "0.5119246", "0.50583845", "0.505...
0.5732468
0
Computes all applicable offers if the offer type is PriceDrop.
def get_basket_items_pricedrop(self, offer_info, actual_volume, product_prices): prod_code = offer_info.base_prod_code base_prod_vol = actual_volume.get(prod_code.lower()) pricedrop_basket = [] if base_prod_vol >= offer_info.min_vol: offer_on_prod = offer_info.offer_on ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_viable_offers(want, have, offers) -> List:\n return [x for x in offers if is_offer_viable(want, have, x) is True]", "def _compute_offers_to_send(self) -> Dict[Tuple[float, float], float]:\n partial_asgt = self._neighbors_values.copy()\n offers = dict()\n\n for limited_asgt in g...
[ "0.6091617", "0.56822497", "0.5510932", "0.54817843", "0.5454564", "0.5445133", "0.5424857", "0.5380617", "0.5372044", "0.53682536", "0.52954173", "0.52618384", "0.52528185", "0.5248819", "0.5241865", "0.5238828", "0.5230508", "0.5212023", "0.51742303", "0.5160276", "0.515464...
0.55353993
2
Methd for invoking discount & price drop offer computation methods
def get_basket_with_discounts(self, actual_volume, applicable_discounts, residual): # product_vs_min_volume, product_offer = self.get_product_vs_offer_and_volume(self.discounts) pr = Product('items') product_prices = pr.product_meta basket = [] for discount in applicable_disco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discount(self, cart):", "def get_discount(self, price):\r\n pass", "def apply_discount(self, product):\n pass", "def compute(self):\r\n \r\n if self.option_type == \"European call\":\r\n option_price = BS_call(self.S0, self.K, self.T_scaled, self.vola, self.div_yiel...
[ "0.69941723", "0.6785887", "0.66767174", "0.6378575", "0.6193816", "0.6177383", "0.61754054", "0.60723627", "0.5998024", "0.59970456", "0.5993197", "0.59507436", "0.59506613", "0.59471047", "0.59038407", "0.58806396", "0.5844756", "0.58214176", "0.58164537", "0.57721055", "0....
0.0
-1
Generates background and labels for the Cafeteria Menu
def menu_handler(menu,fileout_path): image = Image.open("icons/menu_template.jpg") draw = ImageDraw.Draw (image) if menu is None: TITLE_X_OFFSET=0.05*image.size[0] TITLE_Y_OFFSET=0.25*image.size[1] huge_font=ImageFont.truetype("fonts\Ariblk.ttf",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_menu():", "def create_menus( self ):", "def draw_main_menu():\n draw_cover()\n draw_menu_buttons()\n draw_border()", "def main_menu(self):\n\n # Set the window background\n self.palette = QPalette()\n self.pixmap = QPixmap('./pictures/menu_cat.png').scaled(860, 640)\...
[ "0.7138286", "0.699841", "0.65738827", "0.65555376", "0.6499045", "0.64050287", "0.63404286", "0.6264091", "0.6249606", "0.6249606", "0.6233549", "0.62195414", "0.6210253", "0.61664957", "0.6162381", "0.6152219", "0.61354536", "0.60851127", "0.6030847", "0.60096836", "0.59637...
0.5933318
26
A partir de un diccionario que representa un punto P devuelve una estructura de C.
def PyC_Punto(P): C = CPunto() C.x[0] = P['x'][0] C.x[1] = P['x'][1] C.x[2] = P['x'][2] C.y[0] = P['y'][0] C.y[1] = P['y'][1] C.y[2] = P['y'][2] C.D = P['D'] C.n = P['n'] C.a, C.b, C.c = P['a'], P['b'], P['c'] C.d, C.e, C.f = P['d'], P['e'], P['f'] return C
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CPy_Punto(C, P):\n \n P['x'][0] = C.x[0]\n P['x'][1] = C.x[1]\n P['x'][2] = C.x[2]\n\n P['y'][0] = C.y[0]\n P['y'][1] = C.y[1]\n P['y'][2] = C.y[2]\n\n P['D'] = C.D\n P['a'], P['b'], P['c'] = C.a, C.b, C.c\n P['d'], P['e'], P['f'] = C.d, C.e, C.f", "def findpc(self):\n u ...
[ "0.68054706", "0.63273036", "0.59791553", "0.58777106", "0.58699834", "0.5814331", "0.574379", "0.5730052", "0.57189286", "0.5685744", "0.5653829", "0.5597755", "0.55749863", "0.55708575", "0.5543975", "0.553301", "0.55071986", "0.5486988", "0.5479547", "0.54753065", "0.54649...
0.7179086
0