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
Raise a changed event, unless it's been locked out by update()
def _changed(self, name, value): have_lock = self._change_lock.acquire(blocking=False) if have_lock: self._change_lock.release() self.changed() if not name.startswith('_'): self.PropertiesChanged(self.INTERFACE, {name: value}, [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changed_event(self):\n return True", "def _set_changed(self) -> None:\n self._changed = True", "def setChanged(self,value=True):\n self.changed = value", "def setChanged(self,value=True):\n self.changed = value", "def changed(self):\n\t\tpass", "def __itemChanged(self, eve...
[ "0.71976435", "0.67700016", "0.6700296", "0.6700296", "0.66102016", "0.64516914", "0.64472085", "0.6384654", "0.6346707", "0.6346707", "0.63417584", "0.63403016", "0.63403016", "0.63027227", "0.6270179", "0.62422806", "0.62234294", "0.6210248", "0.61960757", "0.6192888", "0.6...
0.7286034
0
Gets a userdefined property.
def GetProp(self, name): return self._props.get(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_property(self,name):\n return self.dp.get_property(name)", "def get_property(self, property):\n return self.shell([\"getprop\", property])", "def prop(self):\n return getattr(self, name)", "def get_property(self, name):\n if (not name in self.properties):\n raise KeyError...
[ "0.7372728", "0.7352151", "0.7138261", "0.7123359", "0.7121722", "0.70445794", "0.699618", "0.6932403", "0.68578386", "0.67842364", "0.6733945", "0.67140526", "0.6676563", "0.6603335", "0.6569704", "0.65058297", "0.64743257", "0.6459241", "0.6434125", "0.6430919", "0.642791",...
0.6837438
9
Sets a userdefined property.
def SetProp(self, name, value): self._props[name] = value self._changed(name, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_user_property(self, property, value):\n self._user_properties.update({property: value})", "def set_property(self, name, value):\n self.properties[name] = value", "def prop_set(prop, value, extra_args=None, cibfile=None):\n return item_create(\n item=\"property\",\n item_id=\"...
[ "0.8646349", "0.7482961", "0.7250825", "0.7238759", "0.69536626", "0.69182163", "0.6890837", "0.68648195", "0.680956", "0.68038446", "0.6799929", "0.66651535", "0.6622268", "0.65920764", "0.6560548", "0.6558341", "0.6558341", "0.6558341", "0.6558341", "0.6558341", "0.6515455"...
0.6766817
11
Convert this object to builtin types only.
def json(self): rv = { prop: getattr(self, prop) for prop in self.__properties__ if prop in vars(self) } rv.update(self._props) return rv
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_builtins():\n # type: () -> None\n cast_map = (\n (a, b)\n for a in (str, int, float, bool)\n for b in (str, int, float, bool)\n )\n for source, target in cast_map:\n add_conversion(1, source, (), target, (), target)\n\n # TODO: Consider support for more g...
[ "0.65351224", "0.64425725", "0.63635373", "0.62754744", "0.61544544", "0.6077892", "0.5975018", "0.5902368", "0.58236426", "0.5772046", "0.5742609", "0.5693393", "0.567364", "0.56619287", "0.5643627", "0.562659", "0.5623451", "0.5613437", "0.5570497", "0.5533262", "0.5504444"...
0.0
-1
Used to substitute the sqlite.Row factory. This is done to avoid the tuple output from sqlite.Row.
def dict_factory(cursor, row): d = {} for idx, col in enumerate(cursor.description): d[col[0]] = row[idx] return d
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def row_factory(self):\n return self._hndl.row_factory", "def row(self, row_id):\r\n return Row(self, row_id)", "def sqlite3_dict_factory(cursor, row):\n dict_row = dict()\n for idx, col in enumerate(cursor.description):\n dict_row[col[0]] = row[idx]\n dict_row[idx] = row[idx]...
[ "0.6726382", "0.6358366", "0.63440126", "0.6269724", "0.6238853", "0.6218866", "0.621269", "0.6068849", "0.60422164", "0.6018834", "0.60167015", "0.60030633", "0.5952345", "0.59359425", "0.5914724", "0.59121126", "0.5910043", "0.58957016", "0.579632", "0.5783978", "0.5777899"...
0.58094245
20
Connecto to a mongodb database.
def connect_mongo_db(): host = parsed_mongodb_url['host'] port = parsed_mongodb_url['port'] database = parsed_mongodb_url['database'] username = parsed_mongodb_url['username'] password = parsed_mongodb_url['password'] connection = Connection(host, port) if username and password: co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mongodb_connect():\n # Load environment variables\n dotenv_path = find_dotenv()\n load_dotenv(dotenv_path)\n # Connect to the db\n # DB will be created if it doesn't already exist\n client = pymongo.MongoClient(os.environ.get(\"DATABASE_URL\"), 27017)\n db = client.tweetbase\n return db...
[ "0.8210052", "0.81336415", "0.8117833", "0.80774117", "0.80349237", "0.80312437", "0.78603804", "0.7805554", "0.77723104", "0.77163285", "0.771416", "0.7606415", "0.75520486", "0.7456694", "0.7437505", "0.7350662", "0.7344814", "0.73362505", "0.73249835", "0.73201", "0.729642...
0.81907785
1
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'mongo_db'): g.db = get_mongo_db() return g.db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.77379817", "0.75827783", "0.731633", "0.716833", "0.702289", "0.6965276", "0.6953964", "0.6948672", "0.68981296", "0.68425506", "0.6828195", "0.6819551", "0.68043447", "0.67949706", "0.67684644", "0.6760031", "0.675094", "0.6747081", "0.67314476", "0.66986555", "0.668763",...
0.0
-1
Opens a new mongodb connection if there isn't one for the current application context.
def get_mongo_db(): if not hasattr(g, 'mongodb'): g.mongodb = connect_mongo_db() g.mongodb.register([Testimonial]) g.mongodb.register([Town]) return g.mongodb
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_db_connection():\n client = MongoClient() #'104.131.185.191', 27017\n db = client[\"225VOH\"]\n return client, db", "def connect_mongo():\n global MONGO_CLIENT\n\n with open('config.json') as config_file:\n config_data = json.load(config_file)\n\n MONGO_CLIENT = init_mongodb(con...
[ "0.7272311", "0.7200479", "0.71043235", "0.70114166", "0.7010941", "0.7004676", "0.6985721", "0.69536436", "0.6806279", "0.68060654", "0.6798944", "0.6794018", "0.67688376", "0.6746943", "0.6710124", "0.66940784", "0.6672508", "0.66650826", "0.6637785", "0.66296685", "0.66251...
0.6309958
40
Loads into session all towns (municipios) in PR
def load_towns(): if not hasattr(g, 'towns'): #g.towns = run_query('select id, name from municipios') g.towns = get_towns() return g.towns
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cargarObras(self):\n self.cargarObjetos(self.tableOs,\n ObraSocialModel.buscarTodos(\"razon_social\", self.sesion).all(),\n (\"razon_social\", \"cuit\", \"direccion\")\n )", "def cargar_obras(self):\n self.cargarObjetos(self.tableObra,\n ObraSocialModel.b...
[ "0.5073809", "0.50361466", "0.4984311", "0.48095226", "0.47972944", "0.47878638", "0.47013986", "0.46942475", "0.46800122", "0.46402198", "0.46401247", "0.4626877", "0.4625208", "0.46250755", "0.4604238", "0.45999122", "0.45901167", "0.45484176", "0.4535182", "0.45259017", "0...
0.6556211
0
Closes the database again at the end of the request
def close_db(error): if hasattr(g, "sqlite_db"): g.sqlite_db.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_request():\n db.close()", "def close(self):\n\t\tself.db.close()", "def close(self):\n self.db.close()", "def close(self):\n if getattr(self, \"_db\", None):\n self._db.close()\n self._db = None", "def close(self):\n self._flush()\n self.databa...
[ "0.8462045", "0.82006633", "0.79665846", "0.78968066", "0.7885584", "0.7883566", "0.78716004", "0.78716004", "0.78716004", "0.7854064", "0.7829076", "0.78159904", "0.78073823", "0.779122", "0.77713525", "0.77128124", "0.7709551", "0.7643279", "0.7643279", "0.7643279", "0.7643...
0.0
-1
Get all videos from specified city and renders them in the videos view.
def get_videos(town): entries = get_town_videos(town) print entries if entries: return render_template('videos.html', videos=entries, town=town) else: flash('No se encontraron videos.') return render_template('videos.html', town=town)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n seen = set()\n seen_add = seen.add\n videos = []\n all_videos = mythVideo.searchVideos(insertedafter = '1900-01-01 00:00:00')\n\n for video in all_videos:\n path = video.filename.split('/')[0]\n if path not in seen and not seen_add(path):\n video.url = url_for...
[ "0.6410316", "0.6264452", "0.62203085", "0.6112654", "0.6078136", "0.60360736", "0.60235083", "0.59724677", "0.5959065", "0.5951703", "0.58861005", "0.5864474", "0.58401585", "0.5825435", "0.5802346", "0.5778463", "0.57751334", "0.576849", "0.5715935", "0.57039154", "0.568702...
0.73999655
0
List available sparse deep learning sentiment analysis models.
def available_sparse_deep_model(): return ['fast-text-char']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparse_deep_model(model = 'fast-text-char', validate = True):\n return _softmax_class.sparse_deep_model(\n PATH_SENTIMENTS,\n S3_PATH_SENTIMENTS,\n 'sentiment',\n ['negative', 'positive'],\n 2,\n model = model,\n validate = validate,\n )", "def list_avai...
[ "0.6248117", "0.58962804", "0.5852594", "0.5757067", "0.5678869", "0.5617868", "0.55847305", "0.5567628", "0.5551601", "0.55444086", "0.54956007", "0.5494975", "0.5451769", "0.5421671", "0.5360751", "0.5297726", "0.529192", "0.51928556", "0.51770246", "0.516783", "0.51540864"...
0.68045807
0
List available deep learning sentiment analysis models.
def available_deep_model(): return [ 'fast-text', 'hierarchical', 'bahdanau', 'luong', 'bidirectional', 'bert', 'entity-network', ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_available_models(cls) -> List[PretrainedModelInfo]:\n list_of_models = []\n\n # en-US, ARPABET-based\n model = PretrainedModelInfo(\n pretrained_model_name=\"tts_en_radtts_aligner\",\n location=\"https://api.ngc.nvidia.com/v2/models/nvidia/nemo/tts_en_radtts_alig...
[ "0.68529797", "0.6511286", "0.6198815", "0.6003524", "0.58048916", "0.5759036", "0.57087564", "0.5695869", "0.56604546", "0.5656096", "0.5618853", "0.55990726", "0.5555275", "0.5535813", "0.5522266", "0.5472041", "0.54421264", "0.54421264", "0.54421264", "0.54421264", "0.5425...
0.659194
1
Load deep learning sentiment analysis model.
def sparse_deep_model(model = 'fast-text-char', validate = True): return _softmax_class.sparse_deep_model( PATH_SENTIMENTS, S3_PATH_SENTIMENTS, 'sentiment', ['negative', 'positive'], 2, model = model, validate = validate, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self):\n try:\n self.model = Word2Vec.load(self.config[\"model_path\"])\n self.model.init_sims(replace=True)\n except Exception as e:\n print(e)\n print(\"error in model loading!\")", "def loadSavedModel(folder, spark_session):\n fro...
[ "0.6783818", "0.66706735", "0.66299415", "0.6601698", "0.6589383", "0.6528808", "0.6501299", "0.6481838", "0.64551425", "0.64387673", "0.64037585", "0.6346428", "0.6345054", "0.63389415", "0.6333392", "0.6330937", "0.6310681", "0.6279278", "0.6274967", "0.62734914", "0.626966...
0.58360213
90
Load deep learning sentiment analysis model.
def deep_model(model = 'luong', validate = True): return _softmax_class.deep_model( PATH_SENTIMENTS, S3_PATH_SENTIMENTS, 'sentiment', ['negative', 'positive'], model = model, validate = validate, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self):\n try:\n self.model = Word2Vec.load(self.config[\"model_path\"])\n self.model.init_sims(replace=True)\n except Exception as e:\n print(e)\n print(\"error in model loading!\")", "def loadSavedModel(folder, spark_session):\n fro...
[ "0.67835915", "0.66707486", "0.6630123", "0.65895396", "0.65296984", "0.65017945", "0.6480464", "0.6453746", "0.6438888", "0.64033544", "0.6345082", "0.634343", "0.6337633", "0.633442", "0.63291806", "0.6311232", "0.62784225", "0.62733686", "0.6273227", "0.6270561", "0.626577...
0.6603306
3
Load multinomial sentiment model.
def multinomial(validate = True): return _softmax_class.multinomial( PATH_SENTIMENTS, S3_PATH_SENTIMENTS, 'sentiment', ['negative', 'positive'], validate = validate, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n filePath = self.config['data_path']['train_data']\n data = self.loadCSV(filePath)\n cleandata = self.preprocess(data)\n X, y = self.dataSplit(cleandata)\n X = self.CountVect(X, self.config['transform_path']['transform_model_path'])\n X_train, X_test, y_t...
[ "0.68189096", "0.617218", "0.60250115", "0.5983554", "0.5976382", "0.5950238", "0.5835725", "0.57773966", "0.5776157", "0.5773181", "0.5766718", "0.57583266", "0.5724592", "0.57227194", "0.5721556", "0.57197523", "0.5689089", "0.5656369", "0.5639414", "0.5621266", "0.561324",...
0.69505644
0
Load XGB sentiment model.
def xgb(validate = True): return _softmax_class.xgb( PATH_SENTIMENTS, S3_PATH_SENTIMENTS, 'sentiment', ['negative', 'positive'], validate = validate, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xgb_train(X_train, y_train, write=False):\n model_xgb = xgb.XGBClassifier(max_depth=7,\n min_child_weight=1,\n learning_rate=0.01,\n n_estimators=5000,\n gamma=0.8,\n ...
[ "0.63705534", "0.600376", "0.5956303", "0.59472424", "0.5885772", "0.5884835", "0.5846589", "0.5845727", "0.5843475", "0.5840624", "0.58338577", "0.5799269", "0.5791677", "0.5769696", "0.573035", "0.5723262", "0.5718337", "0.5708251", "0.5689359", "0.5683162", "0.5681601", ...
0.6143412
1
Train a multinomial model using your own corpus / dataset.
def train_multinomial(corpus, vector = 'tfidf', split_size = 0.2, **kwargs): if not ( isinstance(corpus, str) or isinstance(corpus, list) or isinstance(corpus, tuple) ): raise ValueError( 'corpus must be a string location or list of strings or tuple of strings' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n filePath = self.config['data_path']['train_data']\n data = self.loadCSV(filePath)\n cleandata = self.preprocess(data)\n X, y = self.dataSplit(cleandata)\n X = self.CountVect(X, self.config['transform_path']['transform_model_path'])\n X_train, X_test, y_t...
[ "0.70000553", "0.67839295", "0.6768168", "0.6745569", "0.67182845", "0.66143817", "0.64957803", "0.642929", "0.63806903", "0.6358394", "0.6341894", "0.63235986", "0.6289102", "0.6270932", "0.6254924", "0.6250245", "0.6211102", "0.6208206", "0.6197866", "0.61841744", "0.617134...
0.75276536
0
Set URL or slug.
def set_url_slug(self, slug): slug = slug[-7:] if len(slug) == 7 and \ slug[0] == "p" and \ all(x in ascii_letters + digits for x in slug): self.slug = slug self.url = "https://rpaste.com/" + slug self.api_url = "https://rpaste.com/api/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_slug(self, slug):\n if self.slug is None:\n self.slug = slug", "def set_slug(self):\n if not self.slug:\n self.slug = slugify(self.name)[:50]", "def set_url(self, url):\n self.url = url", "def set_url(self, url):\n if url is not None:\n self.ur...
[ "0.7856565", "0.7317531", "0.71623856", "0.70424086", "0.70105034", "0.6976292", "0.69207335", "0.6873143", "0.6664493", "0.65894234", "0.6582367", "0.6552071", "0.6471977", "0.6464758", "0.6464758", "0.63565755", "0.63444626", "0.6283054", "0.62376636", "0.62376636", "0.6237...
0.74837345
1
A helper function to calculate the variance/std. Used to keep the decomposition functions cleaner
def variance(self, decomp_type, n=5000, conf=0.99): if self.submitted_n is not None: n = self.submitted_n if self.submitted_conf is not None: conf = self.submitted_conf if self.submitted_weight is not None: submitted_weight = [ self.submitted_w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variance(self):\n sum_sqdif = 0 # initialize sum of squared differences\n # Calculate sum of squared differences\n for site in self.sites:\n sqdif = (site.siteZmArea - self.meanZmArea()) ** 2\n sum_sqdif = sqdif + sum_sqdif \n # Standard Deviation\n std...
[ "0.7770966", "0.77011114", "0.7629859", "0.7627399", "0.76196456", "0.76110536", "0.759898", "0.759898", "0.7584078", "0.7584078", "0.7584078", "0.7558786", "0.75491595", "0.7532591", "0.74610096", "0.74437755", "0.7442035", "0.7442035", "0.7432372", "0.7398957", "0.73813015"...
0.0
-1
Calculates the threefold Oaxaca Blinder Decompositions
def three_fold(self, std=False, n=None, conf=None): self.submitted_n = n self.submitted_conf = conf self.submitted_weight = None std_val = None self.endow_eff = ( self.exog_f_mean - self.exog_s_mean ) @ self._s_model.params self.coef_eff = self.exog_s_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f3a_ab(self,a,b,c):\n ans = ((b*b/a) * (b*c - a)/(a*a + b*b - 2.*a*b*c)) * self.g2(a,b,-c) +\\\n 7. * (b*c/a) * self.f2(a,b,-c)/2.\n\n return ans/18.", "def f3ba_a(self,a,b,c):\n ans = self.g2(a,b,c)*(7.*(b*b + a*b*c) - (b/a)**2 * (a*a + a*b*c))/\\\n (a*a+b*b+2....
[ "0.6176517", "0.6096917", "0.5984615", "0.5977737", "0.5936238", "0.59067196", "0.58038735", "0.575884", "0.5722932", "0.56830734", "0.56759137", "0.5673592", "0.56575257", "0.5650651", "0.56390727", "0.5593081", "0.5566512", "0.5547644", "0.55393654", "0.5535565", "0.5530780...
0.0
-1
Calculates the twofold or pooled Oaxaca Blinder Decompositions Methods
def two_fold( self, std=False, two_fold_type="pooled", submitted_weight=None, n=None, conf=None, ): self.submitted_n = n self.submitted_conf = conf std_val = None self.two_fold_type = two_fold_type self.submitted_weight = submit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Bo_Bosol_calc(self):\n self.Bosol = (self.g*self.alpha * self.srflx ) \n #ZEROS FOR T3W APPLICATION\n self.Bo = np.zeros([self.b.shape[0]])", "def bcL(self, rng=None):\n if rng is None:\n rng = random.PRNGKey(1)\n n = self.n\n x = onp.sin(self.bcmesh * np.pi)\n n_y = (np...
[ "0.6497755", "0.60998803", "0.57794124", "0.5739765", "0.5676304", "0.5658211", "0.5624913", "0.55605114", "0.55602336", "0.55324084", "0.55169976", "0.5512204", "0.55107075", "0.5499989", "0.5471748", "0.54679704", "0.54672104", "0.54498965", "0.5433238", "0.5411353", "0.540...
0.0
-1
Print a summary table with the OaxacaBlinder effects
def summary(self): if self.model_type == 2: if self.std is None: print( dedent( f"""\ Oaxaca-Blinder Two-fold Effects Unexplained Effect: {self.params[0]:.5f} Explained Effect: {self.params[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printSummary(self):\n pass", "def print_summary(self):\n self.model.summary()", "def print_summary(self):\n\t\t\n\t\tif not self.objects:\n\t\t\tsys.stderr.write(\"No objects.\\n\")\n\t\t\treturn\n\t\t\n\t\t# Summary header data\n\t\theader = (\"ok\", \"error\", \"zdata\", \"xdata\", \"odata\...
[ "0.6694312", "0.65748495", "0.65513104", "0.6474881", "0.64278984", "0.6423322", "0.642323", "0.6371663", "0.63329065", "0.62521726", "0.621067", "0.6206692", "0.6201745", "0.6167351", "0.616657", "0.6162669", "0.6134523", "0.61327744", "0.6120603", "0.611306", "0.6099873", ...
0.682384
0
This function builds the network architecture and performs the forward pass Two main architectures depending on where to insert the inception or residual layer
def forward_pass_unet(images, phase_train): K = 4 images = tf.expand_dims(images, -1) # Network blocks conv1 = sdn.convolution('Conv1', images, 3, K, 1, phase_train=phase_train) down = sdn.convolution('Down128', conv1, 2, K*2, 2, phase_train=phase_train) conv2 = sdn.convolution('Conv2', down,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_pass(X,architecture):\n \n architecture['layer1'][0] = X\n kernel_shape1 = architecture['layer1'][7]\n stride1 = architecture['layer1'][8]\n if kernel_shape1 is not None and not isinstance(kernel_shape1,int):\n X_input_1_im2col,imX = im2col(X,kernel_shape1,stride1,im_needed = Fals...
[ "0.68315536", "0.6485952", "0.6467596", "0.63724136", "0.62841123", "0.6239884", "0.62038857", "0.61176187", "0.61051875", "0.6099765", "0.60895264", "0.6078947", "0.6060508", "0.60420495", "0.60374236", "0.60353327", "0.6006014", "0.5988528", "0.5984095", "0.59753525", "0.59...
0.5818436
37
This function performs our backward pass and updates our gradients
def backward_pass(total_loss): # Get the tensor that keeps track of step in this graph or create one if not there global_step = tf.train.get_or_create_global_step() # Print summary of total loss tf.summary.scalar('Total_Loss', total_loss) # Decay the learning rate dk_steps = int((FLAGS.epoch_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backward(self, gradient):\n #TODO\n pass", "def backward(self, gradient):\n #TODO\n pass", "def backward(self, gradient):\n raise NotImplementedError()", "def backward_gradient(\n self, input: np.ndarray, head_gradients: Dict[str, np.ndarray]\n ) -> np.ndarray...
[ "0.8300835", "0.8300835", "0.813848", "0.78645897", "0.78537637", "0.78537637", "0.7841489", "0.7801662", "0.77778167", "0.7776895", "0.7717503", "0.76866966", "0.768577", "0.7681438", "0.7671628", "0.76125723", "0.76096076", "0.7601533", "0.7591049", "0.75710464", "0.7567065...
0.0
-1
Send OTP to given mobile number.
def send_otp_to_primary_mobile(otp, mobile): print('Sending otp to mobile: ', otp, mobile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendOTP(code):\n # Modify the code here to change from print to any output \n print(\"Your OTP is \" + code + \". Kindly do not share it with anyone\")", "def send_sms_via_modem(self, mobile, text=\"\"):\n\n mobile = self.sanitise_phone(mobile)\n\n # Add '+' before country code\n m...
[ "0.7327891", "0.6951887", "0.6793021", "0.6524199", "0.6296417", "0.6277992", "0.62462425", "0.62288713", "0.6222681", "0.61966944", "0.6191283", "0.61755615", "0.6162277", "0.6120458", "0.6107131", "0.6077225", "0.60114545", "0.6000302", "0.59869677", "0.5910572", "0.5873281...
0.81184644
0
initializes database in the proper application context
def create_database_tables(): with APP.app_context(): DB.create_all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_database(self):\n # init_database(self.engine)", "def init_database(self):\n init_database(self.engine)", "def init_db(cls, app):\n cls.logger.info(\"Initializing database\")\n cls.app = app\n # This is where we initialize SQLAlchemy from the Flask app\n db.in...
[ "0.8124815", "0.80716336", "0.80530757", "0.80530757", "0.783656", "0.7787664", "0.7693651", "0.7677367", "0.76722753", "0.76453185", "0.7514829", "0.74404836", "0.7437218", "0.74203247", "0.73997235", "0.7374926", "0.7349836", "0.7348413", "0.7294877", "0.7275894", "0.725955...
0.0
-1
error handler for 404
def page_not_found(_error): return render_template('404.html'), 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleStatus_404(self):\n log.err('HTTP Error 404')", "def not_found():\n return HttpError(404)", "def error_404(error):\n return '404 Error'", "def error404(e) -> tuple:\n return render_template('404.html'), 404", "def not_found_error_handler(error):\r\n return render_template('erro...
[ "0.8457733", "0.81392837", "0.8081069", "0.80523026", "0.80397505", "0.8021954", "0.80149484", "0.7941188", "0.7924955", "0.7918556", "0.7911572", "0.7868195", "0.7861067", "0.78284514", "0.78221476", "0.7819732", "0.7791562", "0.777492", "0.7727866", "0.77059907", "0.7682928...
0.74724215
54
callback that is used to reload user object from the User uid
def load_user(uid): return User.query.get(uid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user(self, uid):", "def update_user():", "def reload_user(self, user):\n return get_user_model().objects.get(pk=user.pk)", "def update_user():\n #TODO user update \n pass", "def update(cls, uid, func=lambda x: x):\n users = cls.db().get(cls.udb, default={}, touch=True)\n user...
[ "0.78098977", "0.71555156", "0.6917469", "0.66156393", "0.6577618", "0.6472429", "0.6440136", "0.64400506", "0.6378906", "0.63667274", "0.630829", "0.6218003", "0.6159437", "0.61501944", "0.6136581", "0.612455", "0.61069703", "0.6082375", "0.6038577", "0.6038577", "0.6038577"...
0.6200807
12
view that displays the post of the board specified by the provided bid
def board(bid): form = PostForm(request.form) posts = Post.query.filter_by( bid=bid, deleted=False).outerjoin(Comment).order_by( text("comment.date desc")) brd = Board.query.get(bid) return render_template('posts.html', posts=posts, b=brd, pform=form)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_post(post_id):\n\n posts = models.Post.select().where(models.Post.id == post_id)\n if posts.count() == 0:\n abort(404)\n return render_template('detail.html', posts=posts)", "def view_post(post_id):\n\n db_post = Post.query.get_or_404(post_id)\n full_name = db_post.user.get_full_na...
[ "0.64238364", "0.64142495", "0.6369537", "0.6365728", "0.6306215", "0.63038635", "0.6273676", "0.62036043", "0.6188795", "0.6163974", "0.61500585", "0.6116142", "0.6069818", "0.60510933", "0.60215914", "0.60149276", "0.59924364", "0.59832865", "0.5954234", "0.5937921", "0.592...
0.8378358
0
logs in user if proper parameters are entered and creates a session for that user
def login(): if current_user.is_authenticated: flash('You are already logged in!') return redirect(url_for('index')) form = LoginForm(request.form) if request.method == 'POST' and form.validate(): user = User.query.filter_by( username=form.username.data.lower()).first() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():", "def login():", "def do_login():\n\n isTeacher = False\n\n # check if this_user is admin or normal user\n this_user = User.query.filter_by(username=request.form['username']).first()\n \n # is this_user is not student or admin then check teacher table\n if this_user is None:\n ...
[ "0.757024", "0.757024", "0.7559482", "0.74683917", "0.7328798", "0.72918135", "0.7247259", "0.7220366", "0.7187893", "0.71351975", "0.70968705", "0.70551777", "0.7025809", "0.70155424", "0.69823694", "0.69715047", "0.6962551", "0.6962551", "0.69526553", "0.69518083", "0.69256...
0.0
-1
logs out user and redirects to front page
def logout(): logout_user() flash('Successfully logged out.') return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logout():\n session.pop(\"user\")\n return redirect(url_for(\"home\"))", "def logout():\n flash(_('You were logged out'))\n session.pop('user_id', None)\n return redirect(url_for('index'))\n #return redirect(url_for('public_timeline'))", "def logout_user(request):\n if request.user.is_...
[ "0.80933905", "0.8053985", "0.80535305", "0.804667", "0.8031641", "0.8031641", "0.8021012", "0.79906225", "0.7966582", "0.79636705", "0.795637", "0.793604", "0.79314876", "0.79279006", "0.7921493", "0.7912729", "0.79045266", "0.78937733", "0.78929514", "0.78929514", "0.789200...
0.7842872
27
creates board if form parameters meet requirements
def create_board(): form = BoardForm(request.form) if current_user.is_admin and request.method == 'POST' and form.validate(): if Board.query.filter( func.lower(Board.name) == func.lower(form.name.data) ).scalar() is None: DB.session.add(Board(form.name.data, form.desc.dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_board(self):\n for field in self.fields_start_locs:\n loc = self.loc_to_view(field[0], field[1])\n new_field = Field(loc, self.piece_size)\n self.sprite_group.add(new_field)\n self.click_sprites.add(new_field)\n self.fields.append(new_field)"...
[ "0.603793", "0.5859027", "0.57967037", "0.57193846", "0.5695587", "0.56434304", "0.56327605", "0.5564936", "0.5536575", "0.55322415", "0.5510225", "0.55069685", "0.54559624", "0.54472303", "0.5427493", "0.54243577", "0.5404887", "0.5402026", "0.5395092", "0.53867", "0.5363956...
0.6169846
0
allows the editing of a board with the provided bid
def edit_board(bid): form = BoardForm(request.form) brd = Board.query.get(bid) if current_user.is_admin and request.method == 'POST': if form.validate(): if brd.name != form.name.data or brd.desc != form.desc.data: brd.name = form.name.data brd.desc = form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revive_board(bid):\n if current_user.is_admin:\n Board.query.get(bid).deleted = False\n DB.session.commit()\n msg = 'Board {} is now visible again.'\n flash(msg.format(bid))\n else:\n flash(constants.DEFAULT_SUBMISSION_ERR)\n return redirect(request.referrer)", "de...
[ "0.6417084", "0.63343984", "0.6053781", "0.60441285", "0.5873083", "0.5831679", "0.5816733", "0.57996845", "0.57737195", "0.5772161", "0.57612866", "0.5756384", "0.57373023", "0.5682081", "0.56092197", "0.5580099", "0.55707616", "0.55353636", "0.5534937", "0.5500094", "0.5460...
0.8023971
0
allows the board to be flagged for deletion by an admin
def delete_board(bid): if current_user.is_admin: Board.query.get(bid).deleted = True DB.session.commit() flash('Board {} is no longer viewable.'.format(bid)) return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_delete(self):\r\n return True", "def on_model_delete(self, model):\n if not current_user.is_active or not current_user.is_authenticated:\n abort(403)\n if not user_has_permission(current_user, 'can_delete','admins'):\n abort(403)", "def test_handle_delete_not_...
[ "0.67879754", "0.6325901", "0.62908286", "0.62738276", "0.61669207", "0.6166666", "0.6165566", "0.6154188", "0.6142294", "0.61347324", "0.6094835", "0.6094835", "0.6094835", "0.6083285", "0.6021208", "0.6018292", "0.5990092", "0.5981776", "0.59772396", "0.5955287", "0.5955114...
0.707618
0
allows the creation of a post as long as parameters are met and the user is in an active session
def create_post(bid): form = PostForm(request.form) if request.method == 'POST': if form.validate(): DB.session.add( Post( bid, current_user.uid, form.name.data, form.desc.data)) DB.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_post():\n\n #Get prompt id\n prompt_id = request.form.get('prompt_id')\n\n # Get post text\n post_text = request.form.get('user_post')\n\n # Create post timestamp\n created_at = datetime.now()\n user_facing_date = created_at.strftime(\"%B %d, %Y\")\n\n # Save post and related dat...
[ "0.7211455", "0.70679027", "0.6925175", "0.67390615", "0.6700689", "0.6668551", "0.6650431", "0.6628169", "0.65903986", "0.65749836", "0.65330535", "0.6490874", "0.6482665", "0.64730823", "0.6450237", "0.6409941", "0.6389672", "0.63893265", "0.63873065", "0.6385716", "0.63759...
0.671704
4
allows the editing of a post as long as the active user is the post creator or admin
def edit_post(bid, pid): # pylint: disable=unused-argument pst = Post.query.get(pid) form = PostForm(request.form) if request.method == 'POST' and current_user.uid == pst.uid: if form.validate(): if pst.name != form.name.data or pst.text != form.desc.data: og_name = p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_permissions(request, post):\n user = request.user\n is_editable = has_ownership = False\n\n if user.is_authenticated():\n\n if user == post.author :\n has_ownership = is_editable = True\n elif user.is_moderator or user.is_staff:\n is_editable = True\n\n post...
[ "0.80510914", "0.72609615", "0.7226267", "0.71686494", "0.71497864", "0.71302485", "0.70795995", "0.7057716", "0.7032421", "0.6998917", "0.69817406", "0.69667983", "0.69324255", "0.689023", "0.6886989", "0.68172026", "0.67966056", "0.6777565", "0.6759076", "0.67485136", "0.67...
0.6869949
15
allows for the deletion of a post as long as the active user is the post creator or admin
def delete_post(bid, pid): # pylint: disable=unused-argument if current_user.is_admin or current_user == Post.query.get(int(pid)).uid: Post.query.get(pid).deleted = True DB.session.commit() return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n post_id = int(self.request.get('post_id'))\n post = Posts.get_by_id(post_id)\n if post.submitter_id == self.get_active_user().key().id():\n post.delete()\n else:\n self.error(403)\n self.redirect('/')", "def delete_post(request, post_id):...
[ "0.812043", "0.7826384", "0.7608697", "0.753139", "0.7525019", "0.75085485", "0.7404617", "0.736625", "0.73437005", "0.73198605", "0.73052835", "0.72591406", "0.723565", "0.7205305", "0.7202058", "0.7201454", "0.71928406", "0.7180946", "0.713976", "0.713678", "0.71364546", ...
0.7809568
2
allows for the creation of a comment by an active user
def create_comment(bid, pid): # pylint: disable=unused-argument form = CommentForm(request.form) if request.method == 'POST': if form.validate(): DB.session.add(Comment(pid, current_user.uid, form.text.data)) DB.session.commit() flash('Comment successfully created...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obj_create(self, bundle, request=None, **kwargs):\n return super(CommentResource, self).obj_create(bundle, request, user=request.user, site=Site.objects.get_current())", "def form_valid(self, form):\n author = Profile.objects.get(user=self.request.user)\n object = self.get_object()\n ...
[ "0.69678545", "0.68733394", "0.68367547", "0.67674065", "0.676233", "0.6698197", "0.6653947", "0.6653032", "0.6644549", "0.6617098", "0.6610111", "0.66029644", "0.65430397", "0.6537922", "0.6513555", "0.6511368", "0.6444499", "0.6426328", "0.63783514", "0.63498986", "0.627524...
0.68905306
1
allows the editing of a post as long as the active user is the post creator or admin
def edit_comment(bid, pid, cid): # pylint: disable=unused-argument comment = Comment.query.get(cid) form = CommentForm(request.form) if request.method == 'POST' and current_user.uid == comment.uid: if form.validate(): if comment.text != form.text.data: comment.text = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_permissions(request, post):\n user = request.user\n is_editable = has_ownership = False\n\n if user.is_authenticated():\n\n if user == post.author :\n has_ownership = is_editable = True\n elif user.is_moderator or user.is_staff:\n is_editable = True\n\n post...
[ "0.8052066", "0.72612363", "0.72258705", "0.71685565", "0.7149761", "0.71297675", "0.7078617", "0.70570725", "0.7032085", "0.6998435", "0.69808286", "0.69673204", "0.69330925", "0.68888074", "0.6885943", "0.6869112", "0.68170947", "0.6795856", "0.6777252", "0.67587143", "0.67...
0.0
-1
allows for a comment to be 'deleted' by the comment creator or admin
def delete_comment(bid, pid, cid): # pylint: disable=unused-argument comment = Comment.query.filter_by(pid=pid, cid=cid).first() if current_user.is_admin or current_user.uid == comment.uid: comment.deleted = True DB.session.commit() return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_comment(request, comment_id):\n raise NotImplementedError", "async def delete_comment(comment: models.Comment = Depends(resolve_comment_for_comment_owner_or_resub_owner),\n db: Session = Depends(get_db)):\n crud.delete_comment(db, comment.id)", "def delete(request, comm...
[ "0.80480784", "0.7736271", "0.77149045", "0.7659918", "0.75418705", "0.7515988", "0.7294807", "0.7271467", "0.7246589", "0.7212666", "0.7187633", "0.7138442", "0.70837605", "0.70724744", "0.70158875", "0.7010586", "0.7005397", "0.69440895", "0.6943539", "0.6927659", "0.692345...
0.7410943
6
allows for a 'deleted' comment to be 'revived' by an admin
def revive_comment(bid, pid, cid): # pylint: disable=unused-argument comment = Comment.query.filter_by(pid=pid, cid=cid).first() if current_user.is_admin: comment.deleted = False DB.session.commit() return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(request, comment_id):\n try:\n comment = comments.get_object(pk=comment_id, site__id__exact=SITE_ID)\n except comments.CommentDoesNotExist:\n raise Http404\n if not comments.user_is_moderator(request.user):\n raise Http404\n if request.POST:\n # If the comment has...
[ "0.67821044", "0.67004305", "0.6567313", "0.6491898", "0.64727014", "0.64379954", "0.6308174", "0.6294083", "0.62237483", "0.6213215", "0.61960703", "0.6177323", "0.61392194", "0.6132944", "0.61212826", "0.60846806", "0.60760844", "0.606019", "0.6057162", "0.60461766", "0.603...
0.71453315
0
admin "erase" board route
def erase_board(bid): if current_user.is_admin: DB.session.delete(Board.query.get(bid)) DB.session.commit() msg = 'Board {} permanently removed from database. '\ 'All associated posts and comments have also been removed.' flash(msg.format(bid)) else: flash(con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_board(bid):\n if current_user.is_admin:\n Board.query.get(bid).deleted = True\n DB.session.commit()\n flash('Board {} is no longer viewable.'.format(bid))\n return redirect(request.referrer)", "def revive_board(bid):\n if current_user.is_admin:\n Board.query.get(bi...
[ "0.6663433", "0.6346066", "0.61803126", "0.6123992", "0.6109822", "0.6013274", "0.5860381", "0.578081", "0.5780407", "0.5756733", "0.5743018", "0.5732131", "0.5723054", "0.56639546", "0.56594646", "0.5619822", "0.5611579", "0.5577402", "0.55449736", "0.5531958", "0.5501947", ...
0.706307
0
admin revive board route
def revive_board(bid): if current_user.is_admin: Board.query.get(bid).deleted = False DB.session.commit() msg = 'Board {} is now visible again.' flash(msg.format(bid)) else: flash(constants.DEFAULT_SUBMISSION_ERR) return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def route(self):\n pass", "def route(self):\n # TODO: wenn keine url, herausfinden, welche ????\n # TODO: wenn url = hostname (fqdn), dann -> google.ch\n if not (self.META.has_key('REMOTE_ADDR') and \n self.GET.has_key('provider')):\n #self.GET.has_key('url')):\n #return HttpRe...
[ "0.639884", "0.57397103", "0.5584636", "0.54806924", "0.54461694", "0.5399685", "0.53785545", "0.5375579", "0.53507906", "0.53437626", "0.53437626", "0.5334951", "0.5329222", "0.5291434", "0.52833575", "0.52498335", "0.5245823", "0.52204305", "0.52161586", "0.5197525", "0.519...
0.63001364
1
c7n cloudwatch log group exporter
def cli():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_name(self) -> str:\n ...", "def log_group_arn(self) -> str:\n ...", "def __on_group_created(self, logger, *args):", "def test_create_cloudwatch_log_group(cloudwatch_logs):\n cloudwatch_logs.create_log_group(\n logGroupName='/ecs/mongo/change-stream',\n tags={'env'...
[ "0.6710038", "0.6464622", "0.61767995", "0.61572605", "0.6029598", "0.5876371", "0.58752686", "0.57443726", "0.55814475", "0.5555984", "0.55552804", "0.5547609", "0.5547609", "0.5528474", "0.5375495", "0.5355001", "0.5324256", "0.53136575", "0.531029", "0.52705467", "0.527054...
0.0
-1
subscribe accounts log groups to target account log group destination
def subscribe(config, accounts, region, merge, debug): config = validate.callback(config) subscription = config.get('subscription') if subscription is None: log.error("config file: logs subscription missing") sys.exit(1) def converge_destination_policy(client, config): destinat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _subscribe_users(self):\n group = self.env.ref('odoo_magento2_ept.group_connector_manager')\n if not group:\n return\n companies = self.mapped('company_id')\n domain = [('groups_id', '=', group.id)]\n if companies:\n domain.append(('company_id', 'child_o...
[ "0.6371777", "0.6259225", "0.5749728", "0.56459796", "0.55690557", "0.55181706", "0.5429786", "0.5353789", "0.51864505", "0.5160758", "0.51556367", "0.51556367", "0.51556367", "0.51459944", "0.5069009", "0.5033788", "0.50062", "0.49968696", "0.49712193", "0.49004823", "0.4897...
0.7344485
0
run export across accounts and log groups specified in config.
def run(config, start, end, accounts, region, debug): config = validate.callback(config) destination = config.get('destination') start = start and parse(start) or start end = end and parse(end) or datetime.now() executor = debug and MainThreadExecutor or ThreadPoolExecutor with executor(max_work...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def access(config, region, accounts=()):\n config = validate.callback(config)\n accounts_report = []\n\n def check_access(account):\n accounts_report.append(account)\n session = get_session(account['role'], region)\n identity = session.client('sts').get_caller_identity()\n acco...
[ "0.61790913", "0.5990142", "0.57580197", "0.5699163", "0.56428206", "0.5430614", "0.5360654", "0.53571796", "0.5353356", "0.51873606", "0.5173957", "0.51684934", "0.5089368", "0.50287056", "0.50019586", "0.49614125", "0.49474218", "0.49337208", "0.49278173", "0.4878865", "0.4...
0.48856384
19
simple decorator that will auto fan out async style in lambda. outside of lambda, this will invoke synchrously.
def lambdafan(func): if 'AWS_LAMBDA_FUNCTION_NAME' not in os.environ: return func @functools.wraps(func) def scaleout(*args, **kw): client = boto3.client('lambda') client.invoke( FunctionName=os.environ['AWS_LAMBDA_FUNCTION_NAME'], InvocationType='Event', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def public_async_generator(func):\n @functools.wraps(func)\n def function(*args, **kwargs):\n \"Wrapped function\"\n return GeneratorFuture(func(*args, **kwargs)).future\n return function", "def async_generator(func):\n @functools.wraps(func)\n def function(*args, **kwargs):\n ...
[ "0.71401983", "0.7095293", "0.692637", "0.6761418", "0.66672474", "0.6651891", "0.66168404", "0.6510454", "0.6495293", "0.64642245", "0.6446209", "0.6440772", "0.6432568", "0.64141804", "0.63846105", "0.638452", "0.636017", "0.63143176", "0.6230892", "0.61843586", "0.61801624...
0.0
-1
Filter log groups by shell patterns.
def filter_group_names(groups, patterns): group_names = [g['logGroupName'] for g in groups] matched = set() for p in patterns: matched.update(fnmatch.filter(group_names, p)) return [g for g in groups if g['logGroupName'] in matched]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_command_filter(self, testsuite_pattern, testcase_pattern):\n return None # Hobbes-test does not support listing by filter", "def list(self, pattern='*'):\n if self._group_dict is None:\n self._group_dict = collections.OrderedDict(\n (group.name, group) for group in self._client....
[ "0.6008613", "0.5841888", "0.5739808", "0.5477056", "0.5305808", "0.5287709", "0.5283606", "0.5276361", "0.5276361", "0.5247437", "0.5243044", "0.52194685", "0.521362", "0.519743", "0.5168097", "0.5156099", "0.5154336", "0.51460075", "0.51007366", "0.50932705", "0.50567377", ...
0.6737141
0
Filter log groups by their creation date. Also sets group specific value for start to the minimum of creation date or start.
def filter_creation_date(groups, start, end): results = [] for g in groups: created = datetime.fromtimestamp(g['creationTime'] / 1000.0) if created > end: continue if created > start: g['exportStart'] = created else: g['exportStart'] = start ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _groupDate(item):\n return item.time.date()", "def filter_last_write(client, groups, start):\n retry = get_retry(('ThrottlingException',))\n\n def process_group(group_set):\n matched = []\n for g in group_set:\n streams = retry(\n client.describe_log_streams,\...
[ "0.5349732", "0.53088593", "0.5135366", "0.51161885", "0.50460446", "0.50092417", "0.49472526", "0.4919195", "0.4872214", "0.47953695", "0.47320732", "0.47296935", "0.47275117", "0.4711657", "0.4679824", "0.46712154", "0.46613857", "0.46525186", "0.46412024", "0.4633902", "0....
0.7864727
0
Filter log groups where the last write was before the start date.
def filter_last_write(client, groups, start): retry = get_retry(('ThrottlingException',)) def process_group(group_set): matched = [] for g in group_set: streams = retry( client.describe_log_streams, logGroupName=g['logGroupName'], orde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_creation_date(groups, start, end):\n results = []\n for g in groups:\n created = datetime.fromtimestamp(g['creationTime'] / 1000.0)\n if created > end:\n continue\n if created > start:\n g['exportStart'] = created\n else:\n g['exportStar...
[ "0.6635909", "0.52722096", "0.52423257", "0.518209", "0.51671964", "0.51543635", "0.5145697", "0.5122798", "0.51035225", "0.5058704", "0.50209457", "0.5015845", "0.49920514", "0.4966966", "0.49647346", "0.49560562", "0.49525395", "0.48545003", "0.48374102", "0.4812402", "0.47...
0.6843721
0
Filter days where the bucket already has extant export keys.
def filter_extant_exports(client, bucket, prefix, days, start, end=None): end = end or datetime.now() # days = [start + timedelta(i) for i in range((end-start).days)] try: tag_set = client.get_object_tagging(Bucket=bucket, Key=prefix).get('TagSet', []) except ClientError as e: if e.respo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up_old_exports(self):\n threshold = datetime.datetime.utcnow() - datetime.timedelta(days=30)\n self.session.query(Export).filter(Export.started_at < threshold).delete()", "def export_old_audits(min_to_export=1000, export_count=500):\n try:\n # print min_to_export, export_count\n...
[ "0.52053744", "0.5099278", "0.50236905", "0.5003069", "0.4969293", "0.49566582", "0.49530184", "0.49155438", "0.4885868", "0.48518157", "0.48443332", "0.48185405", "0.48138407", "0.4807479", "0.47937182", "0.47893035", "0.47234836", "0.47130275", "0.47066486", "0.46859834", "...
0.7333458
0
Check iam permissions for log export access in each account
def access(config, region, accounts=()): config = validate.callback(config) accounts_report = [] def check_access(account): accounts_report.append(account) session = get_session(account['role'], region) identity = session.client('sts').get_caller_identity() account['account_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_accessible_to_all(self, pvm: PermissionView) -> bool:\n\n return pvm.permission.name in self.ACCESSIBLE_PERMS", "def has_export_permission(self, request):\n opts = self.opts\n codename = get_permission_codename('export', opts)\n return request.user.has_perm(\"%s.%s\" % (opts.a...
[ "0.5922439", "0.5674963", "0.5661662", "0.560372", "0.5548407", "0.5503811", "0.5503811", "0.5503811", "0.5503811", "0.5503811", "0.54923755", "0.54669565", "0.5439774", "0.5423338", "0.5386345", "0.53821", "0.53797674", "0.5375663", "0.5375663", "0.5371909", "0.53555375", ...
0.60143447
0
size of exported records for a given day.
def size(config, accounts=(), day=None, group=None, human=True, region=None): config = validate.callback(config) destination = config.get('destination') client = boto3.Session().client('s3') day = parse(day) def export_size(client, account): paginator = client.get_paginator('list_objects_v2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_record_count(self):\n return os.path.getsize(self.path) / self._get_record_size()", "def get_dayu_size(self):\n return self._dayu_size", "def get_dayu_size(self):\n return self._dayu_size", "def size(self):\n\t\treturn (self.dates[1] - self.dates[0]).days", "def file_size(hdf...
[ "0.6221909", "0.6163865", "0.6163865", "0.6151718", "0.5874076", "0.5849746", "0.5767309", "0.5767309", "0.5767309", "0.5713602", "0.5705803", "0.5697264", "0.56610096", "0.5648509", "0.5621126", "0.5561575", "0.5548188", "0.5530563", "0.55203176", "0.55025476", "0.55005616",...
0.5952901
4
sync last recorded export to actual Use dryrun to check status.
def sync(config, group, accounts=(), dryrun=False, region=None): config = validate.callback(config) destination = config.get('destination') client = boto3.Session().client('s3') for account in config.get('accounts', ()): if accounts and account['name'] not in accounts: continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _post_sync(self):", "def _pre_sync(self):", "def sync() -> None:", "def _sync_log_event(self):\n # sync only after first run and if not currently running\n if self.auto_sync and not self._running and self._has_run:\n self.sync_exp(upload_resources=False)", "def sync_update(self...
[ "0.63388246", "0.6224563", "0.61723065", "0.60717195", "0.60589373", "0.59674937", "0.5963909", "0.59499013", "0.59499013", "0.5817301", "0.5811279", "0.57902735", "0.56796926", "0.5558574", "0.55518734", "0.55510104", "0.5530432", "0.55055076", "0.5468405", "0.5459672", "0.5...
0.5130186
47
report current export state status
def status(config, group, accounts=(), region=None): config = validate.callback(config) destination = config.get('destination') client = boto3.Session().client('s3') for account in config.get('accounts', ()): if accounts and account['name'] not in accounts: continue session...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):", "def _print_status(self):", "def status(self):\n pass", "def status(self):\n pass", "def export_status(self, file_id):\n response = self._client.get('workbenches/export/%(file_id)s/status',\n path_params={'file_id': file_id})\n ...
[ "0.68302184", "0.67881507", "0.6752981", "0.6752981", "0.67016155", "0.65821147", "0.6570133", "0.6531288", "0.6507663", "0.6278986", "0.62787443", "0.62783325", "0.6257841", "0.6221025", "0.61823666", "0.61173105", "0.61118686", "0.60641307", "0.60631007", "0.60592574", "0.6...
0.0
-1
Find exports for a given account
def get_exports(client, bucket, prefix, latest=True): keys = client.list_objects_v2( Bucket=bucket, Prefix=prefix, Delimiter='/').get('CommonPrefixes', []) found = [] years = [] for y in keys: part = y['Prefix'].rsplit('/', 2)[-2] if not part.isdigit(): continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by_account(cls,account):\n for credentials in cls.credential_list:\n if credentials.account == account:\n return credentials", "def export_accounts(self):\n print('=== Exporting all account data...')\n\n for account in self.client.tenant.accounts:\n ...
[ "0.59281385", "0.58018434", "0.569227", "0.5647005", "0.5508856", "0.54309577", "0.54309577", "0.54139084", "0.5381647", "0.5355028", "0.5352831", "0.5346433", "0.534154", "0.5332681", "0.5287703", "0.52789176", "0.5235002", "0.5224027", "0.51786953", "0.5165503", "0.51365143...
0.46468973
74
export a given log group to s3
def export(group, bucket, prefix, start, end, role, poll_period=120, session=None, name="", region=None): start = start and isinstance(start, str) and parse(start) or start end = (end and isinstance(start, str) and parse(end) or end or datetime.now()) start = start.replace(tzinfo=tzloc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def export_cw_logs_to_s3(global_vars, log_group_name, retention_days, bucket_name, obj_prefix = None):\n resp_data = {'status': False, 'task_info':{}, 'error_message': ''}\n if not retention_days: retention_days = 90\n if not obj_prefix: obj_prefix = log_group_name.split('/')[-1]\n now_time = dat...
[ "0.7299515", "0.6354688", "0.609733", "0.5968771", "0.5890701", "0.57919425", "0.5719376", "0.5693675", "0.5673941", "0.5615103", "0.55705446", "0.55546635", "0.5508692", "0.5500976", "0.5415052", "0.53872406", "0.5381192", "0.5351819", "0.5333531", "0.5318828", "0.52851784",...
0.76097655
0
With the option of having multiple layouts on one screen, it must be the app.py program that assigns the dimensions of the layout as the layout itself is unaware of other layouts
def assign_dimensions(self, dimensions): if self.real_size < 1: raise Layout_Error("Real size must be larger than the layout itself (hence must be more than 1)") if not self.scroll_enabled: self.real_size = 1 self._dimensions = dimensions self._layout_width = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_layout( self ):", "def _do_layout(self):\n return", "def _generate_layout(self):\n\n pass", "def test_multiple_layouts(self):\n\n # site.py\n\n self.app.layout('page.html', 'sub-layout.html', 'layout.html')\n self.app.run()\n\n # tests\n\n with open...
[ "0.69394404", "0.6680851", "0.66320705", "0.6573839", "0.6544663", "0.6506498", "0.63752866", "0.6340171", "0.6315905", "0.6302106", "0.62825966", "0.61903805", "0.6170804", "0.6136268", "0.61278975", "0.610944", "0.6046649", "0.60361177", "0.59862", "0.59726304", "0.5966327"...
0.5796929
32
With the option of having multiple layouts on one screen, it must be the app.py program that assigns the position of the layout (based on the top left corner) as the layout itself is unaware of other layouts
def assign_position(self, position): self._actual_position = list(position) self._position = [0, 0] if not self._widget_assigned: self._align() self._update_widgets() self._widget_assigned = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_layout( self ):", "def _do_layout(self):\n return", "def layout(self):\n pass", "def set_layout(layout):\r\n # Get active window and set reference to active view\r\n window = sublime.active_window()\r\n previous_active = window.active_view()\r\n\r\n # Do not set layout wh...
[ "0.6937658", "0.6772835", "0.6771903", "0.67105615", "0.66829115", "0.6522903", "0.6515964", "0.6487785", "0.6432114", "0.62702847", "0.62645257", "0.62606627", "0.62567633", "0.6252418", "0.62371427", "0.6232333", "0.62201405", "0.62193847", "0.61550915", "0.6131667", "0.611...
0.0
-1
Open a text file & return a list of lowercase strings.
def load(filename: str) -> list: try: with open(filename) as in_file: loaded_txt = in_file.read().strip().split("\n") loaded_txt = [x.lower() for x in loaded_txt] return loaded_txt except IOError as e: print("{}\nError opening {}. Terminating program.".format(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_text_file(filename):\n try:\n file = open(filename, 'r')\n except:\n print('Cannot read file ' + filename + '. Please check the path', file=sys.stderr)\n sys.exit(1)\n output = []\n \n for line in file:\n line = line.strip().lower(...
[ "0.7791968", "0.76199895", "0.7393152", "0.7225327", "0.7197625", "0.7197625", "0.71210194", "0.70748514", "0.69804806", "0.6914742", "0.6905123", "0.6821919", "0.67699254", "0.6751201", "0.66823953", "0.66470754", "0.6636171", "0.66317534", "0.6623684", "0.6623684", "0.66015...
0.76761186
1
The constructor takes in sender, receiver and a signature.
def __init__(self, sender: str, receiver: str, signature: str) -> None: super().__init__(sender, receiver) self.signature = signature
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, method, receiver):\n self.method = method\n if type(receiver) == Class:\n self.receiver = cast(receiver, objc_id)\n else:\n self.receiver = receiver", "def __init__(self, sender):\r\n\t\tself.sender = sender", "def __init__(self, sig, *args, **kwarg...
[ "0.6864943", "0.68118566", "0.6798293", "0.6582685", "0.6582685", "0.6582685", "0.64841205", "0.6334486", "0.6323883", "0.6277131", "0.60506815", "0.6022045", "0.6010426", "0.60057503", "0.5989921", "0.5977475", "0.5931117", "0.59037286", "0.59037286", "0.5903544", "0.5898120...
0.8604357
0
This is the same as the parent except it also prints out the signature.
def __str__(self) -> str: return_string = super().__str__() return_string += f"\n{self.signature}" return return_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature(self, p_int): # real signature unknown; restored from __doc__\n return \"\"", "def __repr__(self):\n args = map(repr, [self.sig] + self[1:])\n return \"%s(%s)\" % (type(self).__name__, \", \".join(args))", "def signature(self) -> global___SnippetSignature:", "def signature(...
[ "0.7024263", "0.6887671", "0.6639112", "0.6414004", "0.6403797", "0.62989455", "0.6291004", "0.6219402", "0.6180741", "0.6180741", "0.6180741", "0.61282855", "0.60823816", "0.60823816", "0.6053541", "0.6053541", "0.60462373", "0.59927696", "0.59856004", "0.5964969", "0.596038...
0.6861111
2
Search `docstr` for a type of `param_str`.
def _search_param_in_docstr(docstr, param_str): # look at #40 to see definitions of those params patterns = [re.compile(p % re.escape(param_str)) for p in DOCSTRING_PARAM_PATTERNS] for pattern in patterns: match = pattern.search(docstr) if match: return _strip_res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_doc(cls, type_str):\n do_doc_test(cls, type_str)", "def string_check(param, name):\n\tif not isinstance(param, strcomp):\n\t\traise TypeError(\"Keyword arg '%s' must be of type string. Got: %s\" % (\n\t\t\tname, type(param)))\n\telse:\n\t\tpass", "def findType(*args, deep: bool=True, exact: bool=Tr...
[ "0.63382846", "0.598061", "0.58747685", "0.5833059", "0.57483447", "0.56994957", "0.56646067", "0.56259286", "0.5518372", "0.54818416", "0.54810244", "0.5438783", "0.5408456", "0.5370847", "0.53659624", "0.5362474", "0.5314391", "0.528517", "0.528517", "0.5272139", "0.5266672...
0.75555766
0
Strip off the part looks like a ReST role in `type_str`.
def _strip_rest_role(type_str): match = REST_ROLE_PATTERN.match(type_str) if match: return match.group(1) else: return type_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_action_str(string: str) -> str:", "def keep_types_s(s, types):\n patt = \"(?s)\" + \"|\".join(\"(?<=\\n)\" + s + \"\\n.+?\\n(?=\\S+|$)\" for s in types)\n return \"\".join(re.findall(patt, \"\\n\" + s.strip() + \"\\n\")).rstrip()", "def remove_rt(token):\n if token == 'rt' or tok...
[ "0.63687265", "0.614773", "0.5987192", "0.5897323", "0.58686006", "0.5840779", "0.58221066", "0.57654697", "0.57208276", "0.5631733", "0.55604565", "0.55465204", "0.5546396", "0.54754424", "0.5445958", "0.5437278", "0.543659", "0.5418817", "0.54181844", "0.5377318", "0.536126...
0.80957615
0
SmartNvmeSize a model defined in Swagger
def __init__(self, blocks: int=None, bytes: int=None): # noqa: E501 self.swagger_types = { 'blocks': int, 'bytes': int } self.attribute_map = { 'blocks': 'blocks', 'bytes': 'bytes' } self._blocks = blocks self._bytes = by...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_representation_size(self):\n raise NotImplementedError()", "def getSize(self) -> int:\n ...", "def getSize(self) -> int:\n ...", "def from_dict(cls, dikt) -> 'SmartNvmeSize':\n return util.deserialize_model(dikt, cls)", "def getSize(self):\n return 1", "def ...
[ "0.6321575", "0.62322617", "0.62322617", "0.61111945", "0.6077867", "0.6034471", "0.5993694", "0.59876543", "0.59714866", "0.5971163", "0.5907662", "0.58435166", "0.5779695", "0.57618344", "0.5730992", "0.5667128", "0.56641084", "0.5624955", "0.5622476", "0.56101996", "0.5598...
0.0
-1
Returns the dict as a model
def from_dict(cls, dikt) -> 'SmartNvmeSize': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'ModelClass':\n return util.deserialize_model(dikt, cls)", "def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())", "def from_dict(cls, dikt):\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, ...
[ "0.6941054", "0.68435305", "0.6772809", "0.6772809", "0.6772809", "0.6772809", "0.6772809", "0.6772809", "0.6740629", "0.66985685", "0.66985685", "0.6644842", "0.6639277", "0.6602594", "0.6600973", "0.66003793", "0.65941405", "0.6579801", "0.65626", "0.6414536", "0.64143956",...
0.0
-1
Gets the blocks of this SmartNvmeSize.
def blocks(self) -> int: return self._blocks
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBlocks(self) -> List[ghidra.program.model.mem.MemoryBlock]:\n ...", "def get_blocks(self):\n block_positions = product(range(self.block_size), range(self.block_size))\n return [self._get_block(i, j) for i, j in block_positions]", "def blocks(self): # (list of size: block_period_numb...
[ "0.7196433", "0.71351993", "0.685585", "0.6758741", "0.6666133", "0.6553506", "0.65312415", "0.6421771", "0.6336547", "0.6319847", "0.6311347", "0.629077", "0.6184365", "0.6114867", "0.6088489", "0.60132515", "0.60027033", "0.5997864", "0.599185", "0.5951994", "0.59188086", ...
0.654431
6
Sets the blocks of this SmartNvmeSize.
def blocks(self, blocks: int): self._blocks = blocks
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_x_block_size(self):\n self._scene_gen.block_dimensions = (self._block_size_x_spinbox.value(),\n self._scene_gen.block_dimensions[Y],\n self._scene_gen.block_dimensions[Z])\n self._refresh_view()", "def bl...
[ "0.6569442", "0.64330506", "0.6303345", "0.60803413", "0.6073872", "0.6004342", "0.5976128", "0.59371215", "0.58781767", "0.58410674", "0.5803466", "0.5743724", "0.5650272", "0.56428427", "0.5577154", "0.5539702", "0.553863", "0.55320626", "0.55199337", "0.55170935", "0.54881...
0.71460104
0
Gets the bytes of this SmartNvmeSize.
def bytes(self) -> int: return self._bytes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\r\n return self.size.data", "def size_bytes(self) -> int:\n return pulumi.get(self, \"size_bytes\")", "def readBytes(self, size=1):\n return self.bytes", "def getSize(self):\r\n return self.size", "def getSize(self):\n return self.size", "def getSize(sel...
[ "0.7371811", "0.71968883", "0.6981857", "0.695602", "0.6946972", "0.69296885", "0.6893996", "0.687236", "0.68668884", "0.67658156", "0.6764008", "0.6752757", "0.67525524", "0.67525524", "0.67525524", "0.673711", "0.66910815", "0.66758984", "0.6666385", "0.6661358", "0.6634040...
0.70552576
3
Sets the bytes of this SmartNvmeSize.
def bytes(self, bytes: int): self._bytes = bytes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_data_size(self, num_bytes):\n self.model.data_size = num_bytes\n self.refresh_memory()", "def setsize(self, size):\n self.__size = size", "def __set_size(self, size):\n if not isinstance(size, int):\n raise TypeError('The size should be an integer')\n if si...
[ "0.65401167", "0.65033114", "0.6215887", "0.6185418", "0.61283857", "0.6123741", "0.61116976", "0.6108987", "0.60780287", "0.6022307", "0.6020796", "0.59437305", "0.59437305", "0.59437305", "0.59437305", "0.5898609", "0.5884375", "0.5875178", "0.5854943", "0.5837582", "0.5769...
0.62403035
2
Return query for get inforamtions about sides in order.
def client_supplier_query(order_id: int) -> Products: Clients = aliased(Businesses) Suppliers = aliased(Businesses) ClientSupplier = join(Orders, Clients, Orders.client_name == Clients.name)\ .join(Suppliers, Suppliers.name == Orders.supplier_name) query = aliased(select([Clients.name.label("Cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sides(self):\n\n return Finger.side_choices", "def sides(self) -> Iterable['Side']:\n for solid in self.solids:\n yield from solid", "def queryset(self, request):\n qs = super(AdRepOrderAdmin, self).queryset(request)\n qs = AdRepOrder.objects.select_related().filter(id__i...
[ "0.5445523", "0.52991235", "0.52020675", "0.5064588", "0.50240153", "0.49783623", "0.49547517", "0.49403247", "0.4938608", "0.49364024", "0.49066815", "0.48336706", "0.4826701", "0.48130545", "0.48010692", "0.4798074", "0.47941858", "0.4783131", "0.4774379", "0.4741319", "0.4...
0.0
-1
Return query for proucts on storage.
def types_query(owner_name): query = Products.query.with_entities(Products.type_name.label('Type'))\ .filter_by(owner_name=owner_name)\ .distinct() return query
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queries() -> List[str]:\n\n logging.info(\"getting query files\")\n gcs = storage.Client(project=GCP_PROJECT)\n bucket = gcs.bucket(GCS_BUCKET)\n blobs = bucket.list_blobs(prefix='layered_gis')\n queries = {}\n for blob in blobs:\n blob_name = blob.name\n if '.sh' in blob_na...
[ "0.5889063", "0.5862815", "0.57291085", "0.5719271", "0.56243545", "0.5602135", "0.5601193", "0.5601193", "0.55706", "0.5535134", "0.55129355", "0.5473278", "0.54587007", "0.54570323", "0.5442046", "0.54395086", "0.54321676", "0.5399316", "0.5397061", "0.53956485", "0.5373300...
0.0
-1
Query to describe current storage.
def statistics_query(owner_name): """ WITH p_count AS ( SELECT type_name, owner_name, COUNT(type_name) product_count FROM products GROUP BY (owner_name, type_name) ), """ p_count = db.session.query( Products.type_name, Prod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_storage(isamAppliance, statistics_duration, check_mode=False, force=False):\n return isamAppliance.invoke_get(\n \"Retrieving the Storage Usage Statistics\",\n \"/statistics/systems/storage.json{0}\".format(\n tools.create_query_string(\n timespan=statistics_durat...
[ "0.65683", "0.65081173", "0.6428925", "0.6336974", "0.6310956", "0.62664115", "0.6209134", "0.61565226", "0.61411303", "0.6129979", "0.61074126", "0.6100042", "0.60946625", "0.60684484", "0.6000856", "0.59938955", "0.5965352", "0.5947011", "0.58958423", "0.5844806", "0.584081...
0.0
-1
Return query, where provide detaled info about available products for this type.
def expand_type_query(owner_name: str, type_name: []) -> 'session query': critical_level = get_critical_level(owner_name, type_name) ordered = db.session.query( func.sum(SpecificOrders.quantity).label('number') )\ .join(Orders, Orders.order_id == SpecificOrders.order_id)\ .filter( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_products(self):\n # TODO - take into account bands, and what bands available in input products, etc\n return {k: self.__products__[k].description for k in self.__products__.keys()}", "def show_available_products(): # {{{\n products_available = {}\n try:\n with MONGO:\n ...
[ "0.6795268", "0.67284316", "0.6657121", "0.665529", "0.664184", "0.6528742", "0.650293", "0.6398634", "0.6362628", "0.6306756", "0.6292385", "0.62119484", "0.621097", "0.619985", "0.6145081", "0.6114483", "0.6106502", "0.61019003", "0.604602", "0.6039854", "0.60307074", "0....
0.53904986
64
Return query, where provide detaled info about available products for this type.
def expand_types_order(owner_name: str, type_name: [], order_id) -> 'session query': query = select([Products.type_name.label('Type'), Products.serial_number.label('Serial number'), Products.producent.label('Producent'), Products.model.label('Model'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_products(self):\n # TODO - take into account bands, and what bands available in input products, etc\n return {k: self.__products__[k].description for k in self.__products__.keys()}", "def show_available_products(): # {{{\n products_available = {}\n try:\n with MONGO:\n ...
[ "0.67935586", "0.6727523", "0.66559565", "0.6652261", "0.66405725", "0.6528544", "0.6502141", "0.6398148", "0.6359407", "0.6306457", "0.6289251", "0.62108374", "0.6210161", "0.6200407", "0.6142485", "0.61146283", "0.6102825", "0.60975516", "0.60435545", "0.60386443", "0.60282...
0.0
-1
Create new product, from provided dict.
def create_product(new_product, owner_name): if not isinstance(new_product, dict): raise ValueError(f"New product {new_product} is not a dict") new_instance = Products( serial_number=new_product['serial_number'], type_name=new_product['type_name'], owner_name=owner_name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cls, dictionary):\n return cls(**dictionary)", "def create(cls, dictionary):\n return cls(**dictionary)", "def from_dict(cls, dct):\n return cls(**dct)", "def create(cls, **kwargs):\n response = cls.get_client().create_product(**kwargs)\n object_details = cls._fl...
[ "0.71715415", "0.71715415", "0.65444577", "0.65245855", "0.6505505", "0.643091", "0.64308983", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321", "0.6385321",...
0.6412352
7
Create query object to get all orderrs from storage. Return Query
def get_orders_query(history, business_id): Clients = aliased(Businesses) Suppliers = aliased(Businesses) query = db.session.query( Orders.order_id.label("Order id"), Orders.order_date.label("Order date"), Clients.name.label("Client"), Suppliers.name.label("Supplier"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_orders():", "def query_orders(self):\n return self._call_txtrader_api('query_orders', {})", "def get(self):\n return DAO.orders", "def get_query(self):\n q = db.Query(self.KIND,keys_only=self.KEYS_ONLY)\n for prop, value in self.FILTERS:\n q.filter(\"%s =\" ...
[ "0.6642401", "0.6619481", "0.639662", "0.6373416", "0.63626057", "0.6110864", "0.60644734", "0.60009384", "0.5964549", "0.5941906", "0.59289455", "0.5920785", "0.58526146", "0.58117765", "0.5804008", "0.5788778", "0.57617706", "0.57590115", "0.5752011", "0.5750678", "0.574840...
0.562002
33
Return query, with all existing models.
def get_models_query(): query = db.session.query(Products.model).distinct() return query
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def models(self, model=None):\n for query in self.__queries:\n if isinstance(query, orb.Query):\n yield query.model(model)\n else:\n for model in query.models(model):\n yield model", "def _get_all_records(self) -> List[DBModelInstance]...
[ "0.69336724", "0.67575055", "0.6741291", "0.6721403", "0.66756815", "0.66453505", "0.65904415", "0.6569294", "0.65680003", "0.6514055", "0.6467715", "0.64061546", "0.64025044", "0.6397078", "0.6390089", "0.6326347", "0.6288563", "0.6265645", "0.6263423", "0.62535185", "0.6227...
0.75393826
0
Return query, on all existing producents.
def get_producents_query(): query = db.session.query(Products.producent).distinct() return query
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getAllProvas(self):\n return self.execSql(\"select_all_provas\")", "def generate_query(self):\n return", "def make_query(self):", "def query(self):\n pass", "def get_query(self):\n q = db.Query(self.KIND,keys_only=self.KEYS_ONLY)\n for prop, value in self.FILTERS...
[ "0.70404816", "0.60729134", "0.603747", "0.5846816", "0.58360267", "0.58090544", "0.58018607", "0.5783798", "0.57318574", "0.5725078", "0.56661415", "0.5665614", "0.56622094", "0.56526935", "0.5649819", "0.56355524", "0.56053555", "0.55854297", "0.55686235", "0.55618703", "0....
0.7525649
0
Set a minimum relative uncertainty for the HirexSr signals.
def set_min_uncertainty(signal, threshold=0.05): # Increase Hirex-Sr uncertainties to be a rel error of 5% minimum (JUST FOR TESTING) corrected_unc=signal.std_y/signal.y<=0.05 signal.std_y[corrected_unc]=0.05*signal.y[corrected_unc] # correction for normalized uncertainties if signal.s/signal.m<=0....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_min_confidence(self, new_min):\n self.__min_confidence = new_min", "def set_Ec_min(self, x):\n x = float(x)\n if self.Ec_min != x:\n self.Ec_min = x\n self.Ec[0] = x", "def setUncertainty(self, uncertainty):\n self.uncertainty = uncertainty", "def...
[ "0.6703387", "0.63027465", "0.6177287", "0.5665198", "0.56195945", "0.56136763", "0.55630547", "0.55627656", "0.555593", "0.555593", "0.54854083", "0.54678583", "0.54263455", "0.5422868", "0.54227537", "0.5412941", "0.5385455", "0.5342574", "0.53386", "0.53296685", "0.5296957...
0.69471943
0
Calculate the impurity confinement time, defined as the time constant obtained from an exponential fit of the spectroscopic signal after peaking. If signal is an array of signals, finds the impurity confinement time for each, then provides the mean and standard deviation within the set.
def get_tau_imp(signal, plots=True): tau_imp=np.zeros((signal.y.shape[1],1)) time=signal.t if plots==True: f1 = plt.figure() ax1 = f1.add_subplot(2,1,1) ax2 = f1.add_subplot(2,1,2) for i in range(signal.y.shape[1]): sig=signal.y[:,i] # Subtract the m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_squared_error_time(input_signalorspectrum, output_signalorspectrum):\n if isinstance(input_signalorspectrum, list) != True:\n observed_l = []\n observed_l.append(input_signalorspectrum)\n else:\n observed_l = input_signalorspectrum\n if isinstance(output_signalorspectrum, lis...
[ "0.5298134", "0.51132464", "0.5097189", "0.5064602", "0.50354946", "0.50028414", "0.49787804", "0.49409816", "0.49381432", "0.4925306", "0.49154824", "0.49072072", "0.49028787", "0.4901111", "0.4873843", "0.48637593", "0.48314908", "0.4823539", "0.4823539", "0.48046473", "0.4...
0.5672792
0
Spoofs given MAC address
def spoof(self, mac, air=False): if air: os.system( 'sudo ' '/System/Library/PrivateFrameworks' '/Apple80211.framework/Versions' '/Current/Resources/airport -z' ) _status = os.system('sudo ifconfig %s ether %s' % (self.id, mac)) return 'Interface %s (%s) => (%s)' % (self.id, self.ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_mac_address():\n if not sys.platform.startswith('linux'):\n raise RuntimeError(\n 'Cannot get the MAC address on non-Linux platforms'\n )\n ifname = get_default_iface_name_linux()\n s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n info...
[ "0.7184662", "0.71231216", "0.6886774", "0.68855536", "0.6876342", "0.6869648", "0.68631303", "0.68411386", "0.6823506", "0.67871636", "0.6784512", "0.6739386", "0.67346317", "0.67322683", "0.6722954", "0.6696346", "0.6696346", "0.6696346", "0.6696346", "0.66954273", "0.66713...
0.6054331
68
Returns a list of interfaces objects.
def fetch(): _interfaces = [Interface(iface) for iface in netifaces.interfaces()] for iface in _interfaces: if (iface.id in BLACK_ID) or (iface.mac in BLACK_MAC) or (len(iface.mac) < 5): _interfaces.remove(iface) return _interfaces
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interfaces(self):\n if self._interfaces is None:\n self._interfaces = list(x[\"interface\"] for x in self._interfaces_detailed_list())\n\n return self._interfaces", "def list():\n\n\treturn netifaces.interfaces()", "def _get_interfaces(self):\n return self.__interfaces", "def ...
[ "0.81987125", "0.8083309", "0.78065586", "0.78065586", "0.78065586", "0.7573135", "0.75322247", "0.7481535", "0.72989315", "0.69569594", "0.6890868", "0.68131423", "0.6807769", "0.678631", "0.67372656", "0.6702418", "0.66673565", "0.66494524", "0.66494524", "0.6603068", "0.66...
0.62256
29
Lists available interface names.
def list(): return netifaces.interfaces()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interface_list() -> List[str]:\n cmd_ip = system_command('ip')\n command = f\"{cmd_ip} -o addr show up primary scope global\".split()\n result = SUDO.execute_unit(command)\n result.assert_return()\n line_list = result.stdout.splitlines()\n pattern = re.compile(r\"^\\d+[:]\\s+(\\S+)\\s+(.+)$\"...
[ "0.7411383", "0.7232032", "0.72114456", "0.6973412", "0.69043547", "0.68619394", "0.679673", "0.6740396", "0.6686123", "0.6686123", "0.6661291", "0.66574144", "0.6648544", "0.65959096", "0.65669006", "0.65150845", "0.64693594", "0.64693594", "0.64693594", "0.6445497", "0.6410...
0.7836606
0
build weixin JSApi.chooseWXPay params
def build_jspay_params(paysign_key, appid, prepay_id): _params = { "nonceStr": sign.random_nonce_str(32), "timeStamp": int(time.time()), "package": 'prepay_id={}'.format(prepay_id), "signType": "MD5", "appId": appid } _params['paySign'] = sign.sign_for_pay(paysign_key...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_parameters(pobj):\n ViscosityWilke.build_parameters(pobj)", "def initialize(public_api_key, default_wak=None, params=None):\n\n if params is None:\n params = {}\n\n print('initializing lnpay..')\n\n global __VERSION__\n global __PUBLIC_API_KEY__\n global __ENDPOINT_URL_...
[ "0.5316788", "0.5219171", "0.49018717", "0.48517498", "0.48473987", "0.4843703", "0.47966686", "0.4786458", "0.4684021", "0.46805087", "0.46547464", "0.46540335", "0.46333072", "0.46102008", "0.46095118", "0.46002406", "0.45881376", "0.45822966", "0.4577122", "0.4576725", "0....
0.5701106
0
Change the urls in all content pages. Also changes the urls that begin with this url.
def rename_url(self, old_url, new_url): def rename_html(html): return re.sub( r"""(\s)href=(["'])%s""" % old_url, r'\1href=\2%s' % new_url, html ) def rename_markup(markup): if not 'rename_url_expressions' in editor.edi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def urls(self, urls):\n\n self._urls = urls", "def _update_urls(self):\n\n to_fix = [\n # We fix the urls in the README file.\n PyFunceble.CONFIG_DIRECTORY + \"README.rst\",\n # We fix the urls in the configuration file.\n PyFunceble.CONFIG_DIRECTORY + \"...
[ "0.66469926", "0.64842045", "0.64342177", "0.64010423", "0.6328618", "0.61935735", "0.61853534", "0.6152363", "0.61477363", "0.61453766", "0.6060277", "0.6017771", "0.59222454", "0.5780527", "0.5741267", "0.5735124", "0.5707387", "0.56970894", "0.56782633", "0.5617779", "0.56...
0.6101035
10
Return sorted content items for this block.
def get_content_for_block(self, block_name): return self.page_content_items.filter(block_name=block_name).order_by('sort')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_items(self, instance):\n sorted_items = instance.items.order_by('contentitemonpage__sort_by').all()\n return ContentItemSerializer(sorted_items, read_only=True, many=True).data", "def __get_items(self, sort_keys_function=None):\n if sort_keys_function:\n return sorted(list...
[ "0.7203827", "0.65020275", "0.6405821", "0.6380889", "0.6337046", "0.6282616", "0.62138516", "0.6061105", "0.5986232", "0.5945387", "0.59096706", "0.5909197", "0.57804215", "0.5760349", "0.57546836", "0.5749722", "0.57332176", "0.57332176", "0.57321185", "0.57300663", "0.5728...
0.7341322
0
Load an object given its absolute object path, and return it. object can be a class, function, variable or an instance.
def import_object(path): try: dot = path.rindex('.') except ValueError: raise ValueError("Error loading object '%s': not a full path" % path) module, name = path[:dot], path[dot+1:] mod = import_module(module) try: obj = getattr(mod, name) except AttributeError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_object(path):\n try:\n dot = path.rindex('.')\n except ValueError:\n raise ValueError(\"Error loading object '%s': not a full path\" % path)\n\n module, name = path[:dot], path[dot+1:]\n mod = import_module(module)\n\n try:\n obj = getattr(mod, name)\n except Attribu...
[ "0.87203074", "0.8714351", "0.86193395", "0.80881464", "0.76507956", "0.7540539", "0.75298196", "0.7481483", "0.7424371", "0.733665", "0.73353285", "0.7264761", "0.72388357", "0.7229578", "0.7178961", "0.69940937", "0.69565845", "0.6937031", "0.69023806", "0.6859193", "0.6791...
0.83069754
3
Indicates whether specific platform is need to be built
def has_platform(self, platform_name): return platform_name in self.platform_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platform_supported(self):\n return platform.system().lower() in self.platforms if self.platforms else False", "def check_platform():\n system = platform.system()\n distro = platform.platform()\n is_raspberry_pi = False\n try:\n info = open(\"/proc/cpuinfo\").read()\n except FileN...
[ "0.71212935", "0.70436865", "0.6949426", "0.6933144", "0.68413055", "0.6644802", "0.664328", "0.6630137", "0.6541337", "0.6534053", "0.65173113", "0.64472014", "0.6441205", "0.64278555", "0.6403306", "0.6343476", "0.6329101", "0.6326767", "0.63261914", "0.63257444", "0.632147...
0.6023522
59
Fetches repos from config.json
def fetch_repos(self): for repo in self.json_repos['repos']: title = str(repo["title"]) repo_url = str(repo['repo']) self.repos[title] = repo_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_repos(connection):\n\n try:\n response = connection.get_json('repository')\n except HTTPRequestError as ex:\n raise exception_from_http_error(ex) from ex\n\n result = response.get('result', [])\n return [Repository(connection, repo['rid'], data=repo) for repo in result]", "def...
[ "0.69072866", "0.68005025", "0.6771198", "0.6725589", "0.66690826", "0.6660223", "0.6563224", "0.6562054", "0.6532253", "0.6429869", "0.6419862", "0.6401692", "0.63973206", "0.62876177", "0.6262754", "0.62594336", "0.6254202", "0.6254202", "0.6208351", "0.6194637", "0.6191547...
0.78047276
0
Fetches branches for each repo from config.json
def fetch_branches(self): for jrepo in self.json_repos['repos']: title = str(jrepo["title"]) self.branches[title] = str(jrepo['current'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def branches_full(config, args):\n for b in config.repo.branches():\n yield config.repo.branch(b.name)", "def show_branches(config, args):\n for item in lib.input_json_lines():\n yield config.repo.branch(item)", "def make_branches(self, api_json=None):\n if api_json is None:\n return ...
[ "0.69463867", "0.68368787", "0.6707363", "0.6653876", "0.6577588", "0.65272236", "0.6501614", "0.64859295", "0.64772815", "0.6438882", "0.64305085", "0.6258769", "0.62371534", "0.6195701", "0.6190658", "0.61512154", "0.6114853", "0.60720813", "0.60627514", "0.60360074", "0.59...
0.7710535
0
Returns a list of initial environment setup steps
def init_workspace_steps(self): return [ InstallShellJS(), RMCommand(path="~/.cordova/" + self.platform, workdir='build', haltOnFailure=False, description='Remove cache'), RMCommand(path="*", workdir='build', haltOnFailure=False, description='Clean workdir'), Shel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def envs():\n\n # update and grab the envs from the metadata keys\n metadata = _init()\n return list(metadata.keys())", "def SetupEnvironment(self):\n pass", "def _get_install_steps(self):\n\n content = self._get_yaml_content()\n\n return self._fix_install_steps(content['install'])", ...
[ "0.66229904", "0.6526401", "0.63138646", "0.6217128", "0.6208876", "0.61686397", "0.60309076", "0.6027222", "0.59644306", "0.5938788", "0.58808476", "0.58711517", "0.5822204", "0.581619", "0.5760303", "0.57595754", "0.575318", "0.5719677", "0.5706185", "0.56916517", "0.568056...
0.6193221
5
Returns a list of steps for cloning necessary repos
def repos_clone_steps(self): platform = self.platform # required by coho tools to correctly resolve repo location if platform == "blackberry10": platform = "blackberry" return [ ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone_all_repo(self):\n repo_path = self.cfg['paths']['repo']\n since = datetime.datetime.strptime(self.cfg['filters']['since'], self.cfg['filters']['date_format'])\n threads = []\n # INITIALIZE ALL REPOS\n for repo in self.cfg[\"repos\"]:\n if (not self.cfg['repla...
[ "0.6446149", "0.6382948", "0.6273487", "0.6116369", "0.59837794", "0.59746057", "0.58794206", "0.5857089", "0.5844229", "0.5772935", "0.572115", "0.5718577", "0.57020026", "0.56601727", "0.56417", "0.5637879", "0.5619802", "0.56186646", "0.5604742", "0.5546208", "0.55187005",...
0.79946405
0
Returns a list of steps for CLI setup
def cli_steps(self): return [ ShellCommand(command=["git", "clone", "-b", CONFIG.branches['CLI'], CONFIG.repos['CLI'], "cordova-cli"], workdir='build', haltOnFailure=True, description='Clone CLI'), ShellCommand(command=["git", "clone", "--depth", "1", "-b", CONFIG.branches['CORDOVA-LIB']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_commands(self):\n return self.get_data(\"setup_commands\")", "def _get_install_steps(self):\n\n content = self._get_yaml_content()\n\n return self._fix_install_steps(content['install'])", "def get_all_steps(self):\n steps = []\n steps.extend(self.init_workspace_step...
[ "0.6651091", "0.6479719", "0.6409983", "0.6366993", "0.6313349", "0.6267738", "0.6155656", "0.6142456", "0.6105375", "0.60354024", "0.5895893", "0.5795892", "0.57458186", "0.56846845", "0.567229", "0.5646961", "0.5621909", "0.56113553", "0.5608341", "0.55730104", "0.5529855",...
0.7070678
0
Returns a list of steps for CLI setup Should not be used in common case, only for common slave tests
def plugman_steps(self): return [ ShellCommand(command=["rm", "-rf", "cordova-*"], workdir='build', haltOnFailure=False, description='Cordova Clean'), ShellCommand(command=["git", "clone", CONFIG.repos['PLUGMAN'], "cordova-plugman"], workdir='build', haltOnFailure=True, description='Get ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli_steps(self):\n return [\n ShellCommand(command=[\"git\", \"clone\", \"-b\", CONFIG.branches['CLI'], CONFIG.repos['CLI'], \"cordova-cli\"], workdir='build', haltOnFailure=True, description='Clone CLI'),\n ShellCommand(command=[\"git\", \"clone\", \"--depth\", \"1\", \"-b\", CONF...
[ "0.7121964", "0.66414857", "0.6590362", "0.6503794", "0.6442164", "0.6309476", "0.6200637", "0.60921854", "0.6006797", "0.58807784", "0.5764678", "0.5671883", "0.56505984", "0.56240004", "0.5579277", "0.55354774", "0.55034655", "0.54971015", "0.546893", "0.5453238", "0.544851...
0.61514026
7
Returns a list of steps for mobilespec app setup
def prepare_mobilespec_steps(self): platform = self.platform # required by coho tools to correctly resolve repo location if platform == "blackberry10": platform = "blackberry" return [ NPMInstall(workdir='build/cordova-mobile-spec/createmobilespec', haltOnFailure=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy_steps(self):\n return [ShellCommand(command=[\"node\", \"medic/build_\" + self.platform + \".js\"], workdir='build', timeout=CONFIG.build_timeout, description='Run tests', name='Run tests')]", "def init_workspace_steps(self):\n return [\n InstallShellJS(),\n RMComma...
[ "0.65084136", "0.642119", "0.6384407", "0.63580227", "0.6311263", "0.62183255", "0.59461796", "0.56012833", "0.555745", "0.55543995", "0.5514638", "0.54713285", "0.54269874", "0.54202676", "0.53925604", "0.5366822", "0.53609735", "0.5345367", "0.5297906", "0.5297146", "0.5282...
0.760149
0
Returns a list of steps for deploying mobilespec application to test device
def deploy_steps(self): return [ShellCommand(command=["node", "medic/build_" + self.platform + ".js"], workdir='build', timeout=CONFIG.build_timeout, description='Run tests', name='Run tests')]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_mobilespec_steps(self):\n platform = self.platform\n # required by coho tools to correctly resolve repo location\n if platform == \"blackberry10\":\n platform = \"blackberry\"\n return [\n NPMInstall(workdir='build/cordova-mobile-spec/createmobilespec',...
[ "0.75590795", "0.63454", "0.6130196", "0.6108414", "0.5982014", "0.58221376", "0.5818699", "0.56397694", "0.5596652", "0.55899227", "0.5447674", "0.54173493", "0.5405188", "0.5400062", "0.53762925", "0.53739935", "0.53050184", "0.5303761", "0.5242022", "0.5242022", "0.5223853...
0.75774807
0
Returns a list of steps for building mobilespec application
def build_platform_step(self): return [ShellCommand(command=["../cordova-cli/bin/cordova", "build", self.platform], workdir='build/mobilespec', timeout=CONFIG.build_timeout, description='Build', name='Build')]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_mobilespec_steps(self):\n platform = self.platform\n # required by coho tools to correctly resolve repo location\n if platform == \"blackberry10\":\n platform = \"blackberry\"\n return [\n NPMInstall(workdir='build/cordova-mobile-spec/createmobilespec',...
[ "0.779069", "0.67776674", "0.64382553", "0.624265", "0.60818905", "0.6052851", "0.6028818", "0.57117945", "0.56699735", "0.5631484", "0.5578449", "0.5562804", "0.5509476", "0.5509476", "0.5501834", "0.5475979", "0.5436348", "0.53203976", "0.5319532", "0.5312754", "0.5293944",...
0.6734113
2
Returns a list of all steps current platform
def get_all_steps(self): steps = [] steps.extend(self.init_workspace_steps()) steps.extend(self.repos_clone_steps()) steps.extend(self.cli_steps()) steps.extend(self.prepare_mobilespec_steps()) steps.extend(self.deploy_steps()) return steps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availableSteps( self ):\n assert isinstance( self._level, int )\n assert isinstance( self._steps, list )\n assert isinstance( self._outter, Env ) or ( self._outter is None )\n\n lst = [ ]\n self._availableSteps( lst )\n return lst", "def Platforms():\n return platforms", ...
[ "0.6643733", "0.6476299", "0.6185028", "0.59915143", "0.5967349", "0.59573674", "0.5938493", "0.5935553", "0.59315646", "0.5929291", "0.5864497", "0.58506036", "0.58318293", "0.58021766", "0.5801714", "0.57479554", "0.5633305", "0.5621189", "0.56003636", "0.55945224", "0.5584...
0.7025099
0