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
Clear the entry and disable the entry and button, making them unable to be interacted with.
def _disable_entry(self): self.insert_entry.delete(0, tk.END) self.insert_entry.configure(state=tk.DISABLED) self.insert_button.configure(state=tk.DISABLED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _enable_entry(self):\n self.insert_entry.configure(state=tk.NORMAL)\n self.insert_button.configure(state=tk.NORMAL)", "def disable(self):\n self.colour_combo.config(state=tk.DISABLED)\n self.game_name_entry.config(state=tk.DISABLED)\n self.num_tickets_entry.config(state=tk....
[ "0.7374178", "0.7091176", "0.69988054", "0.6810369", "0.6747967", "0.6718996", "0.66457295", "0.66114336", "0.6587659", "0.657904", "0.65177935", "0.6464455", "0.6444957", "0.64396936", "0.64141905", "0.6369983", "0.6315798", "0.6310327", "0.6289078", "0.6275729", "0.6267464"...
0.8018426
0
Enable the entry and button, allowing them to be interacted with.
def _enable_entry(self): self.insert_entry.configure(state=tk.NORMAL) self.insert_button.configure(state=tk.NORMAL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable(self):\n self.colour_combo.config(state=tk.NORMAL)\n self.game_name_entry.config(state=tk.NORMAL)\n self.num_tickets_entry.config(state=tk.NORMAL)", "def entryToggle(self):\n status = \"normal\" if self.optionVar.get() == 4 else \"disabled\"\n for i in range(3):\n ...
[ "0.7409319", "0.71389174", "0.70984125", "0.7005315", "0.69770306", "0.6830249", "0.6821063", "0.6814235", "0.66365004", "0.66365004", "0.6594615", "0.6568778", "0.6562422", "0.6550833", "0.64541245", "0.6368428", "0.6348056", "0.6330938", "0.62833095", "0.62203044", "0.62186...
0.8187393
0
Internal method used as the callback for ">" events on the listboxes. This method enables or disabled the entry as appropriate to the new data selection and sets ``NTBrowser._curr_indices``.
def _listbox_select_callback(self, _): self._curr_indices = self.key_listbox.curselection() or self.value_listbox.curselection() if self._curr_indices: kind = None for idx in self._curr_indices: # Break if any one of the selected rows is a table. i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_selected(self, window, values, branch_log_dict, key_event):\n utils.convert_to_numeric(values)\n if(values[key_event] in branch_log_dict[key_event]):#if there is branching for the chosen option\n for element_key in branch_log_dict[key_event][values[key_event]]:\n ...
[ "0.56618375", "0.5659626", "0.5594502", "0.55678624", "0.55105686", "0.54801536", "0.5462772", "0.5423531", "0.5406913", "0.5393726", "0.53336704", "0.5322919", "0.5308489", "0.5301149", "0.5258873", "0.5217732", "0.5205504", "0.5205093", "0.51920545", "0.5189554", "0.5184486...
0.6361306
0
Valida que la Entry tenga contenido
def on_autentificar(self, dni, nom, apellidos, telf, zona, nacion): condicion = True if dni == '': self.txtDni.set_placeholder_text("Inserte DNI") condicion = False elif nom == '': self.txtNombre.set_placeholder_text("Inserte Nombre") condicion = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entry_valid(entry):\n\n if len(entry) != 4:\n return False\n date_list = re.split('\\\\W', entry[0])\n if len(date_list) != 2:\n return False\n try:\n int(date_list[0])\n int(date_list[1])\n float(entry[2])\n except ValueError:\n return False\n return...
[ "0.66552776", "0.63749236", "0.63739693", "0.62847894", "0.61125356", "0.6112476", "0.6091118", "0.6018688", "0.6016615", "0.59852767", "0.5921662", "0.58458686", "0.58458686", "0.5830254", "0.5830254", "0.5790145", "0.5789397", "0.578424", "0.5778492", "0.5757876", "0.574536...
0.0
-1
Metodo que tras elegir un Dni del ComboBOx manda el Dni a un metodo de la Clase MetodosBD que busca el Dni y devuelve los datos de este
def update_vendedor(self, control): # Sacamos el texto seleccionado del ComboBox dniSelect = self.cbDniAdd.get_active_text() # Condición para que sí no hay nada seleccionado en el Combox no haga una consula en vacío if not dniSelect == None: # Al selecionar el ComboBox el P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buscar_dni(self, dni_socio):\n socio = session.query(Socio).filter(Socio.dni == dni_socio)\n print(socio)\n return socio", "def __init__(self,dni):\n self.dni=dni\n self.categoria=None", "def promjeni_broj_dana(self, x):\r\n broj = int(self.brojDana.itemText(x))\r\...
[ "0.576518", "0.5675576", "0.53287965", "0.52096784", "0.51820225", "0.5141113", "0.5070689", "0.49685782", "0.4959294", "0.49140248", "0.48694426", "0.48601225", "0.4840701", "0.4827355", "0.48273042", "0.48123306", "0.47667524", "0.47375727", "0.4700875", "0.46558082", "0.46...
0.53349787
2
Metodo que separa los datos recogidos y luego los guarda en sus respectivos Entrys
def on_mostrarDatos(self, datos): # Condición que cambia los estados de los RadioButons if datos[0][1] == self.tipo1: self.rbJefe.set_active(True) else: self.rbEmpleado.set_active(True) self.txtDni.set_text(datos[0][2]) self.txtNombre.set_text(datos[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_entry(self):\n\n for line_item in self.entry:\n pairs = line_item.split(' ')\n for pair in pairs:\n if ':' in pair:\n key, value = pair.split(':')\n if value.isdigit():\n self.fields[key] = int(valu...
[ "0.5730647", "0.5605589", "0.5579856", "0.5542733", "0.54659736", "0.53285813", "0.5324847", "0.5312408", "0.5309465", "0.5300458", "0.5299451", "0.52908236", "0.52476543", "0.52413005", "0.51975745", "0.51943165", "0.51857114", "0.51321214", "0.51309603", "0.5124592", "0.512...
0.0
-1
Metodo que recarga el valor de la fecha en el Entry Fecha
def on_refreshTime(self, control): self.txtFecha.set_text(str(self.localTime))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fecha(self):\n return self.fecha_cadena(self.__anno, self.__mes, self.__dia)", "def date(self):", "def edit_date(entry):\n entry.date = get_date()\n entry.save()\n input(\"Edit successful. \")\n return entry", "def fecha_formateada(self):\n dia = self.__dia\n anno = self....
[ "0.6490757", "0.62001157", "0.6148122", "0.6108368", "0.5942775", "0.59411937", "0.5755369", "0.56978303", "0.5674952", "0.5674355", "0.5674355", "0.5674355", "0.5673695", "0.56399345", "0.56206447", "0.55997974", "0.55540234", "0.55150414", "0.55111825", "0.5510722", "0.5485...
0.53953075
26
Metodo que envia el Dni seleccionado a un Metodo de la Clase MetodosBD y elimina de la base de datos al vendedor, luego llama al metodo recarga los ComboBox y al de limpiar los Entrys
def on_remove_clicked(self, control): # Recogemos el valor del ComboBox dniBaja = self.cbDniRemove.get_active_text() # Lo enviamos al metodo de la Clase MetodosBD MetodosBD.MetodosBD.borrar_vendedor(self, dniBaja) # Metodo que refresca los Combobox vendedores.actualizar_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_vendedor(self, control):\n\n # Sacamos el texto seleccionado del ComboBox\n dniSelect = self.cbDniAdd.get_active_text()\n\n # Condición para que sí no hay nada seleccionado en el Combox no haga una consula en vacío\n if not dniSelect == None:\n # Al selecionar el C...
[ "0.6170028", "0.5915866", "0.5834186", "0.55128026", "0.55051804", "0.5465432", "0.54020417", "0.54001635", "0.5369259", "0.53511274", "0.5347668", "0.5345777", "0.5301571", "0.5253992", "0.52424556", "0.5225088", "0.5221306", "0.51731884", "0.51015127", "0.50831175", "0.4994...
0.6815479
0
Medoto que limpia las cajas de texto
def on_limpiar(self, control): self.btnAdd.set_label(self.vbtnAdd) self.txtDni.set_text("") self.txtNombre.set_text("") self.txtApellidos.set_text("") self.txtTelf.set_text("") self.txtZona.set_text("") self.txtNacionalidad.set_text("") self.txtFecha.set_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getText():", "def getText():", "def getText():", "def getText():", "def getText():", "def text(self) -> str:", "def get_text(self):", "def getText(self):", "def get_texte(name):\r\n #with open(name, 'r', encoding='utf-8') as myfile:\r\n with open(name, 'r', encoding='utf-8') as myfile:\r\n ...
[ "0.6467837", "0.6467837", "0.6467837", "0.6467837", "0.6467837", "0.62152416", "0.6208919", "0.60020155", "0.5827453", "0.5817684", "0.57927465", "0.5781781", "0.5766028", "0.57578844", "0.5744636", "0.5743139", "0.5718214", "0.56402254", "0.5570407", "0.55581504", "0.5549819...
0.0
-1
Metodo para navegar a la ventana Main
def on_cerrar_clicked(self, Button): main = Main.Main(self.tipo, self.id, self.nombre) self.set_visible(False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\r\n pass", "def main():\n pass", "def main(self):", "def main(self) -> None:\n pass", "def main():\n return", "def main():\n\tpass", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main()...
[ "0.82190335", "0.81940186", "0.80682105", "0.80224806", "0.8015938", "0.7978871", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", "0.78195494", ...
0.0
-1
Metodo para navegar a la ventana TablaVendedores
def on_tabla_vendedores_clicked(self, Button): tablavendedores = TablaVendedores.tablaVendedores(self.tipo, self.id, self.nombre) self.set_visible(False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limpiarVentana(self):\n self.limpiarTabla(self.tableFactura)\n self.lineNumero.setEnabled(True)\n self.lineNumero.clear()\n self.limpiarTabla(self.tableNC)", "def limpiarVentana(self):\n\n self.productosAgregados=0\n self.lotesVentas={}\n self.facturaCobrada=F...
[ "0.7634896", "0.6529628", "0.6476412", "0.6044319", "0.60242695", "0.5978414", "0.59579563", "0.59432954", "0.59077317", "0.5905856", "0.57944804", "0.5777909", "0.5723357", "0.56998986", "0.5681946", "0.5668569", "0.56681406", "0.5663566", "0.56567395", "0.5638073", "0.56278...
0.68094844
1
Generate linearly increasing price data for unit tests
def get_dummy_data(num_days, low, high, end_date='1970-01-01'): step = (high - low) / (num_days - 1) ref = datetime.strptime(end_date, '%Y-%m-%d').date() start_dt = ref - timedelta(days=(num_days - 1)) end_dt = ref + timedelta(days=1) ts = np.arange(start_dt, end_dt, timedelta(days=1)).astype(date) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_price():\n return uniform(1.0, 350.0)", "def generate(data, d=0.1):\n \n p = pd.DataFrame({\n \"Price\": data\n })\n p[\"Event\"] = ''\n event = 'upturn'\n ph = p['Price'][0] # highest price\n pl = ph # lowest price\n\n for i in range(0, len(p)):\n\n if event is '...
[ "0.6204404", "0.6130902", "0.6102203", "0.6053854", "0.5952796", "0.5948425", "0.5891981", "0.58904123", "0.58473146", "0.58167547", "0.5776299", "0.5765693", "0.5744515", "0.57234496", "0.5695937", "0.56842405", "0.5671014", "0.5656032", "0.56525654", "0.56476706", "0.561017...
0.53852504
51
mu = k sqrt(1 + m2/m1)
def mu_sun(m2_over_m1: float) -> float: mu = K * np.sqrt(1. + m2_over_m1) return mu * mu
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mu(k, z):\n return 1", "def kl(mu1, mu2):\n return (mu2-mu1)**2/2", "def kl(mu1, mu2):\n return (mu2-mu1)**2/2", "def mu_gm1m2(m1: float, m2: float) -> float:\n from astropy.constants import G\n\n return G * (m1 + m2)", "def kl(mu1, mu2):\n return (mu2 - mu1) ** 2 / 2", ...
[ "0.7373971", "0.7282575", "0.7282575", "0.71900904", "0.713643", "0.70311916", "0.6701206", "0.66690695", "0.6589319", "0.6589319", "0.653416", "0.6494656", "0.64828813", "0.6404334", "0.6363272", "0.6352015", "0.63444686", "0.63004714", "0.62986004", "0.62357163", "0.6228569...
0.75852823
0
mu = n^2 / a^3
def mu_na(n: float, a: float) -> float: return n * n * a * a * a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mu(k, z):\n return 1", "def npa_norm(a):\n\n return a / sum(a)", "def blauNormal(blau, N):\n nom = blau - (1/N)\n den = 1 - (1/N)\n\n return nom / den", "def U(n,gamma,A,y):\n return (2*A*gamma*math.sin(math.pi*n*y/A) - 2*math.pi*n*math.cos (math.pi*n*y/A))/(A**2*gamma**2 + math.pi**2 *...
[ "0.71695036", "0.6887994", "0.6764852", "0.6750625", "0.6626473", "0.65062326", "0.646334", "0.6444955", "0.6417958", "0.63273966", "0.6327223", "0.6312752", "0.6302596", "0.6301676", "0.6299949", "0.6273926", "0.6273746", "0.62690264", "0.6258225", "0.62508994", "0.6235605",...
0.79202384
0
mu = G (m1 + m2)
def mu_gm1m2(m1: float, m2: float) -> float: from astropy.constants import G return G * (m1 + m2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mu(o1, o2):\n return o1*o2", "def M_g(self):\n\n print(\"\", file=self.logfile)\n print(\"Updating g\", file=self.logfile)\n M_mu1 = np.lib.stride_tricks.as_strided(self.mu_pad,\n shape=[self.P+1, self.L_h],\n ...
[ "0.6987635", "0.685425", "0.64364874", "0.6391254", "0.6263511", "0.62258524", "0.6198913", "0.6146619", "0.6080753", "0.60386586", "0.60144967", "0.6013963", "0.60115695", "0.59763104", "0.5964742", "0.59455556", "0.59150636", "0.5887213", "0.58644265", "0.5807733", "0.58037...
0.81322044
0
Generates site containing first page of recipes list sorted by published_date.
def recipes_list(request): recipes = Recipe.objects.all().order_by('published_date') # prawidlowy sposob zbierania URLa - object.image.url # recipe = recipes[0] # print("path: " + recipe.image.url) paginator = Paginator(recipes, INITIAL_PAGE_SIZE) page = paginator.page(1) context = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes_page(request):\n page_number = request.GET.get('page', None)\n if page_number is None:\n raise Http404\n\n # Get sorting parameter, if none is provides, sort by published_date\n sorting = request.GET.get('sorting', 'published_date')\n\n possible_sortings = ['up_votes', 'published_...
[ "0.6796219", "0.6157274", "0.61321515", "0.5978671", "0.5944646", "0.5935294", "0.5908201", "0.5867303", "0.5837911", "0.5787703", "0.57855505", "0.57358456", "0.5721771", "0.57205456", "0.57116795", "0.56696147", "0.56615347", "0.5653457", "0.55879027", "0.55861884", "0.5579...
0.6504416
1
View responding to AJAX request for list of all ingredients currently stored in database.
def get_ingredients(request): items = Ingredient.objects.all().order_by('name') # return list of {item.name: item.pk} context = [] for item in items: context.append({item.name: item.pk}) return HttpResponse(json.dumps(context), content_type='application/json')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _show_ingredient_list(self):\n if self._ingredients_view:\n self._ingredients_view.destroy()\n\n username = self.food_service.get_user().get_username()\n ingredients = self.food_service.list_added_ingredients(username, expire=True)\n self._ingredients_view = IngredientsVi...
[ "0.71443564", "0.6621847", "0.6533707", "0.6456862", "0.63419956", "0.62605214", "0.6260338", "0.6219494", "0.61849874", "0.61646134", "0.61379063", "0.6126435", "0.608624", "0.60640466", "0.60598683", "0.6016408", "0.6010413", "0.5991127", "0.59910214", "0.59663296", "0.5936...
0.72881126
0
View to generate updates to recipes list when user scrolls down the page.
def recipes_page(request): page_number = request.GET.get('page', None) if page_number is None: raise Http404 # Get sorting parameter, if none is provides, sort by published_date sorting = request.GET.get('sorting', 'published_date') possible_sortings = ['up_votes', 'published_date', 'title...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes():\n recipes = mongo.db.recipes.find()\n return render_template(\"recipes/list.html\", recipes=recipes)", "def view_recipes():\n if 'name' in session:\n recipeitem = PLAN.users[session['name']].view_recipes()\n return render_template('recipes.html', recipeitem=recipeitem)\n ...
[ "0.6429831", "0.6382163", "0.630745", "0.6247727", "0.62205404", "0.6193851", "0.61043197", "0.6032494", "0.60179096", "0.5995997", "0.5900895", "0.5899395", "0.58730197", "0.5853571", "0.5706099", "0.569316", "0.56857574", "0.56070364", "0.5564621", "0.55582577", "0.55518806...
0.53443766
28
View called when user clicks on search button on website. Searches database for recipces that contain ingredients selected by user.
def get_filtered_recipes(request): page_number = 1 if not request.GET: # If GET data is empty, assume no filters and return list of all recipes recipes = Recipe.objects.all().order_by('published_date') else: get_data = request.GET.dict() page_number = get_data.get('page', N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search():\n query = request.form.get(\"query\")\n # pylint: disable=redefined-outer-name\n recipes = list(mongo.db.recipes.find({\"$text\": {\"$search\": query}}))\n return render_template(\"recipes.html\", recipes=recipes)", "def search():\n query = request.form.get(\"query\")\n recipes = ...
[ "0.71865153", "0.7176708", "0.71316457", "0.7104751", "0.710362", "0.7047182", "0.6896128", "0.6818153", "0.6713402", "0.6696172", "0.66647226", "0.6662139", "0.66172695", "0.6577977", "0.65558565", "0.6540747", "0.65292764", "0.6525435", "0.65035963", "0.64904493", "0.648865...
0.0
-1
View called when user enters some string into textbox on website.
def search_recipes(request): string_to_find = request.GET.get("term", None) if string_to_find is None: return HttpResponse(status=400) matching_recipes = Recipe.objects.filter(title__icontains=string_to_find) context = {} for r in matching_recipes: context[r.title] = reverse('rec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ev_textinput(self, event: TextInput) -> None:", "def ui_input_text() -> str:\n\ttext = input('enter your text ')\n\treturn text", "def ev_textinput(self, event: tcod.event.TextInput) -> T | None:", "def input(self, *fields, title=\"User input window\"):\n pass", "def present_view(self, error: st...
[ "0.69977003", "0.6499313", "0.643579", "0.60679567", "0.5956231", "0.59006214", "0.5868776", "0.58517617", "0.58469707", "0.5841802", "0.5837776", "0.5805453", "0.57927436", "0.57762057", "0.5740888", "0.57314384", "0.57291365", "0.5711473", "0.5703694", "0.5688913", "0.56503...
0.0
-1
Generates site of a given recipe.
def recipe(request, recipe_slug): current_recipe = get_object_or_404(Recipe, pk=recipe_slug) ingredients = IngredientDetails.objects.filter(recipe=current_recipe) ingredients_list = [] price = 0 for ingredient in ingredients: ingredients_list.append(str(ingredient.ingredient) + " - " + str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"layout_path\", help=\"relative path to the directory \"\n \"containing .rst files with site content and jinja \"\n \"templates that define the site structure\")\n parser.add_argument(\"ou...
[ "0.6079024", "0.5831689", "0.5802067", "0.56758296", "0.549623", "0.5449182", "0.5430671", "0.5370831", "0.536884", "0.5350261", "0.5342263", "0.53291833", "0.5299164", "0.5240385", "0.5228364", "0.5220168", "0.5200309", "0.51567054", "0.51305586", "0.5121077", "0.5110726", ...
0.0
-1
Add a new entry in the results table in RV arguments below.. session == SQLAlchemy Session data == the json message received from the agent
def add_results_non_json(session, node_id=None, oper_id=None, error=None, toppatch_id=None, reboot=False, result=False, results_received=datetime.now(), username='system_user'): session = validate_session(session) operation = operation_exists(session, oper_id) results = None if result an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_records(self, data: dict, execution_context: dict):", "def add_results(session, data, username='system_user'):\n session = validate_session(session)\n operation = operation_exists(session, data['operation_id'])\n node = node_exists(session,node_id=data['node_id'])\n if node:\n node_id ...
[ "0.62482166", "0.6078163", "0.58265", "0.5792383", "0.57908404", "0.5740843", "0.57107496", "0.55978835", "0.55917794", "0.54867315", "0.5469462", "0.5465754", "0.5449438", "0.5412065", "0.5400628", "0.53911936", "0.5387508", "0.5379521", "0.5369491", "0.536726", "0.536726", ...
0.57755756
5
Add a node to the database
def add_node(session, client_ip=None, agent_timestamp=None, node_timestamp=None, host_name=None, display_name=None, computer_name=None, username='system_user'): session = validate_session(session) if not host_name and client_ip: try: host_name = gethostbyaddr(client_ip)[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(self, node):", "def add_node (self, node):\n self.network.add_node(node.id)\n self.network.node[node.id] = node", "def add_node(self, node: Node):\n prop_str = \",\\n\".join([\"n.%s = '%s'\" % (k, v) for k, v in node.data.items()])\n query = \"\"\"\n MERGE (n:%s {id:...
[ "0.7865234", "0.774182", "0.76837397", "0.755156", "0.7240712", "0.7240318", "0.7185423", "0.71095324", "0.7092884", "0.7006346", "0.7006007", "0.6973722", "0.6973722", "0.6971237", "0.69533014", "0.6950354", "0.6934846", "0.69242233", "0.69175804", "0.69062704", "0.688924", ...
0.0
-1
Add a Global User ACL to the database
def add_global_user_acl(session, user_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_r...
[ "0.6790956", "0.66984755", "0.6193511", "0.60840625", "0.6061878", "0.59698826", "0.5953534", "0.5937081", "0.59253997", "0.5908613", "0.58513284", "0.57258356", "0.56943804", "0.5650924", "0.55833733", "0.5550112", "0.55397975", "0.550241", "0.550241", "0.54835874", "0.54700...
0.7756629
0
Add a Global Group ACL to the database
def add_global_group_acl(session, group_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=Fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapsho...
[ "0.7196082", "0.6934653", "0.67724866", "0.6646024", "0.64088714", "0.62780404", "0.6215141", "0.6154451", "0.6126776", "0.6117893", "0.6082822", "0.60679877", "0.6067281", "0.60590637", "0.60528725", "0.603411", "0.6033565", "0.59680486", "0.5946027", "0.5942363", "0.5935729...
0.81567854
0
Add a User ACL to a node in the database
def add_node_user_acl(session, node_id=None, user_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_node_user_acl(session, node_id=None, user_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=False...
[ "0.66488713", "0.65743196", "0.6349004", "0.63126117", "0.6273757", "0.61371654", "0.611919", "0.61177486", "0.60286134", "0.60237795", "0.60100114", "0.59730655", "0.59480417", "0.59110665", "0.5888698", "0.58862835", "0.58632857", "0.5845603", "0.58204746", "0.5783785", "0....
0.75014323
0
Add a Group ACL to a Node in the database
def add_node_group_acl(session, node_id=None, group_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_node_group_acl(session, node_id=None, group_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=Fal...
[ "0.7298856", "0.67762434", "0.6739489", "0.64854664", "0.6471868", "0.64582276", "0.6363607", "0.6359242", "0.63551635", "0.63349617", "0.6279043", "0.6272919", "0.6272078", "0.6271495", "0.6215116", "0.6162174", "0.6120281", "0.6107547", "0.60900867", "0.6056464", "0.6030693...
0.7867277
0
Add a User ACL to a Tag in the database
def add_tag_user_acl(session, tag_id=None, user_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tag_user_acl(session, tag_id=None, user_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=False, ...
[ "0.6768385", "0.66185904", "0.6288666", "0.62353295", "0.62045974", "0.61111546", "0.5938137", "0.59312445", "0.5828969", "0.58216935", "0.5819768", "0.58164734", "0.57813776", "0.5755194", "0.56963474", "0.5630525", "0.56261504", "0.5620099", "0.5584222", "0.5578137", "0.557...
0.7627426
0
Add a Group ACL to a Tag in the database
def add_tag_group_acl(session, tag_id=None, group_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tag_group_acl(session, tag_id=None, group_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=False...
[ "0.7413525", "0.6949173", "0.6515452", "0.638341", "0.6300268", "0.619689", "0.618565", "0.6143435", "0.6096526", "0.6077261", "0.60423136", "0.60403264", "0.6036486", "0.60344684", "0.60183716", "0.6016755", "0.59663004", "0.5962972", "0.59606135", "0.5952664", "0.5943046", ...
0.80384266
0
Add a tag to the database
def add_tag(session, tag_name, user_id=None, username='system_user'): session = validate_session(session) date_created=datetime.now() try: add_tag = TagInfo(tag_name, date_created, user_id) session.add(add_tag) session.commit() return(True, "Tag %s added" % (tag_name), add_ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddTag(self, tag):\n\n if not self.persistant:\n return\n\n self.db.ExecuteSql('insert into tags(tag, track_id) values(\"%s\", %d);'\n %(tag, self.persistant['id']))\n self.db.ExecuteSql('commit;')", "def add_tag_data(tag):\n\n add_tag = Tag(tag=tag)\n db.session.add...
[ "0.8637184", "0.85335076", "0.7906371", "0.7768422", "0.7698887", "0.75692403", "0.7459467", "0.73945993", "0.7363522", "0.73570436", "0.73460793", "0.7338917", "0.7332982", "0.715787", "0.70944375", "0.7073959", "0.70276374", "0.69505596", "0.68091697", "0.67844456", "0.6769...
0.7250298
13
Add a dependency to the corresponding toppatch_id into the database
def add_dependency(session, data, username='system_user'): session = validate_session(session) failed_count = 0 for deps in data['data']: pkg_id = deps['toppatch_id'] for dep in deps['dependencies']: dep_exists = session.query(LinuxPackageDependency).\ filter(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_dependency(self, dep):\n self.dependency.append(dep)", "def add_depend(self, data):\n try:\n self._session.add(StepDependencyEntity(\n child_id=data['child_id'],\n parent_id=data['parent_id']\n ))\n except SQLAlchemyError as err:\n...
[ "0.6426406", "0.64062476", "0.5922514", "0.5561254", "0.5473387", "0.53967816", "0.5364266", "0.5284696", "0.5237298", "0.51207536", "0.50454897", "0.5004042", "0.4978844", "0.49685213", "0.49589285", "0.49584004", "0.49383095", "0.49302614", "0.49144408", "0.4911285", "0.491...
0.65303063
0
Add a list of nodes to an existing tag into the database arguments.... session == SQLAlchemy Session nodes = list of nodes tag_id = id of tag or tag_name = name of tag
def add_tag_per_node(session, nodes=[], tag_id=None, tag_name=None, user_id=None, username='system_user'): session = validate_session(session) completed = False count = 0 tag = None if not tag_id and tag_name: tag = tag_exists(session, tag_name=tag_name) elif tag_id and n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_tag(args):\n\n if not args.nodespec and not args.software_profile and \\\n not args.hardware_profile:\n sys.stderr.write('Error: must specify --nodes'\n '/--software-profile/--hardware-profile\\n')\n sys.stderr.flush()\n sys.exit(1)\n\n session ...
[ "0.72279805", "0.66229963", "0.62487316", "0.62040484", "0.60978645", "0.60316706", "0.59950036", "0.58186054", "0.5780188", "0.57044286", "0.56786096", "0.5670054", "0.56257105", "0.56120104", "0.56080633", "0.55849946", "0.5579145", "0.55715966", "0.55562085", "0.5544375", ...
0.6936174
1
Add a new timeblock to RV. arguments below.. session == SQLAlchemy Session label == The name of the timeblock that you added start_date == "12/1/2012"
def add_time_block(session, label, start_date, start_time, end_time, days, end_date=None, span_end_date_time=None, span=False, enabled=False, username='system_user'): session = validate_session(session) try: add_block = TimeBlocker(label, start_date, start_time, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_block(self, drip_campaign_id, start_time, nodes_id):\n new_block = Block(\n drip_campaign_id=drip_campaign_id,\n start_time=start_time,\n nodes_id=nodes_id\n )\n new_block.save()", "def insert_machine_time(self, start: int, end: int):\n today ...
[ "0.59659165", "0.5863345", "0.58183277", "0.5808236", "0.5762933", "0.5504239", "0.5437054", "0.543419", "0.541414", "0.53787965", "0.5373741", "0.53152436", "0.53119665", "0.53105295", "0.5307636", "0.5295561", "0.5291936", "0.52910906", "0.52751726", "0.52628547", "0.526211...
0.7227159
0
Add a new Certificate Signed Request into RV arguments below.. session == SQLAlchemy Session client_ip == "192.168.0.1" location == The directory location ("/opt/TopPatch/var/lib/ssl/client/csr/192.168.0.1.csr")
def add_csr(session, client_ip, location, csr_name, signed=False, signed_date=False, username='system_user'): session = validate_session(session) try: add_csr = CsrInfo(csr_name, client_ip, location, signed, signed_date) session.add(add_csr) session.commit() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ssl_cert_request ( ssl_hostnames ) :\n first_hostname = ssl_hostnames[ 0 ]\n csr_filename = get_ssl_csr_filename( first_hostname )\n key_filename = get_ssl_key_filename( first_hostname )\n openssl_cnf = \"\"\"\n[req]\ndistinguished_name = req_distinguished_name\nreq_extensions = san_ext\n\n[req_...
[ "0.61794984", "0.6074754", "0.59074855", "0.5900829", "0.5836028", "0.5689883", "0.5686247", "0.562675", "0.55683374", "0.5503503", "0.5464923", "0.5438911", "0.5392701", "0.5382747", "0.53479296", "0.5293224", "0.5291298", "0.526492", "0.526492", "0.5234707", "0.51935923", ...
0.6758308
0
Add a new Signed Certificate into RV arguments below.. session == SQLAlchemy Session node_id == 1 This is the id of the node that this cert belongs too. cert_id == 1 This is the id corresponding csr_id cert_location == The directory location ("/opt/TopPatch/var/lib/ssl/client/keys/192.168.0.1.cert")
def add_cert(session, node_id, cert_id, cert_name, cert_location, cert_expiration, username='system_user'): session = validate_session(session) try: add_cert = SslInfo(node_id, cert_id, cert_name, cert_location, cert_expiration) session.add(add_cert) sessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_certificate(csr):\n unique_filename = str(uuid.uuid4().hex)\n\n file = open(\"./csr_req/%s.csr\" % unique_filename, \"w\")\n file.write(csr.decode(\"utf-8\"))\n file.close()\n\n subprocess.run([\"../ca/scripts/sign.sh\", unique_filename], check=False)\n\n file = open(\"./csr_req/%s.p7b\"...
[ "0.64046806", "0.6280815", "0.58989143", "0.58835256", "0.5829155", "0.5638251", "0.5638251", "0.5616477", "0.561596", "0.56122303", "0.56050044", "0.55840075", "0.5552402", "0.5530964", "0.5524219", "0.55238885", "0.547166", "0.5467346", "0.5456534", "0.54513323", "0.5449576...
0.7471709
0
Add a new Operation into RV arguments below.. session == SQLAlchemy Session node_id == 1 The id of the node that this operation belongs too. operation == reboot|install|uninstall (The operation type)
def add_operation(session, node_id, operation, operation_sent=None, operation_received=None, username='system_user'): session = validate_session(session) add_oper = Operations(node_id, operation, operation_sent, operation_received, username ) if add_oper: session.add(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_operation(self, op):\n\n self.operations[op.name] = op", "def AddOperation(self, op):\n self._operations.append(op)", "def add(self, **kwargs) -> None:\n self.append(Operation(**kwargs))", "def addOp(self, op):\n self.operations << op", "def _register_operation(self, **opera...
[ "0.6588329", "0.65164876", "0.6259452", "0.61404794", "0.61376673", "0.6107332", "0.5795392", "0.5693794", "0.55513954", "0.55419517", "0.5538352", "0.55040187", "0.5494577", "0.5494577", "0.5481137", "0.5445538", "0.5424925", "0.5406836", "0.5382247", "0.5344137", "0.5303606...
0.7123489
0
update the stats of the node in the node_stats table in RV arguments below.. session == SQLAlchemy Session node_id == the id of the node
def update_node_stats(session, node_id, username='system_user'): session = validate_session(session) rebootspending = session.query(NodeInfo).\ filter(NodeInfo.reboot == True).\ filter(NodeInfo.id == node_id).count() agentsdown = session.query(NodeInfo).\ filter(NodeInfo....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self, context, values, prune_stats=False):\n return db.compute_node_update(context, self.compute_node['id'],\n values, prune_stats)", "def update_node(session, node_id, ipaddress, username='system_user'):\n session = validate_session(session)\n node = node_exists(session, ...
[ "0.64276147", "0.63328195", "0.6140318", "0.61300564", "0.59009504", "0.5846118", "0.58422846", "0.5800655", "0.5799475", "0.5791402", "0.5769188", "0.5705976", "0.5678018", "0.56424344", "0.56188697", "0.5593942", "0.54787344", "0.54753065", "0.5434515", "0.54333824", "0.541...
0.76589245
0
update the global stats in network_stats table in RV arguments below.. session == SQLAlchemy Session
def update_network_stats(session, username='system_user'): session = validate_session(session) rebootspending = session.query(NodeInfo).\ filter(NodeInfo.reboot == True).count() agentsdown = session.query(NodeInfo).\ filter(NodeInfo.agent_status == False).count() agentsup = sessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_stats():\n list_db = get_list_database()\n\n list_db.group_stats_force_update()\n transaction_commit(None, 'GroupStatsUpdate')\n\n list_db.user_stats_force_update()\n transaction_commit(None, 'UserStatsUpdate')", "def RefreshStats(self):\n with self.ctx.Profile(\n 2,\n lamb...
[ "0.6264449", "0.6093104", "0.6002179", "0.59345603", "0.5877387", "0.5864414", "0.57928675", "0.5755806", "0.56649154", "0.5663315", "0.5632987", "0.5613733", "0.5571354", "0.5542132", "0.5508326", "0.5491335", "0.5465955", "0.54624546", "0.5394556", "0.5383795", "0.53818923"...
0.7032283
0
update the global tag stats in tag_stats table in RV arguments below.. session == SQLAlchemy Session
def update_tag_stats(session, username='system_user'): session = validate_session(session) tags = session.query(TagInfo).all() if len(tags) > 0: for tag in tags: nodes = session.query(TagsPerNode).\ filter(TagsPerNode.tag_id == tag.id).all() patchesinstalled =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags_stats():\n # Update total search count of tag\n yesterday = timezone.now() - timezone.timedelta(days=1)\n yesterdays_tag_stats = DailyStats.objects.filter(date=yesterday)\n for daily_stat in yesterdays_tag_stats:\n tag_stat, created = TagStats.objects.get_or_create(tag=daily_stat.tag)\n...
[ "0.5773769", "0.54053193", "0.5400968", "0.52657", "0.52549785", "0.52491444", "0.5185269", "0.5166207", "0.5146414", "0.5125556", "0.5114296", "0.5061952", "0.5055679", "0.5025211", "0.50249416", "0.5000762", "0.49919817", "0.4971272", "0.49520138", "0.49110574", "0.48714864...
0.7582618
0
Add the system information of an existing node arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener. node_id == 1 The id of the node that this information belongs too.
def add_system_info(session, data, node_info, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = node_info.id if node_id: if 'computer_name' in data: node_info.computer_name = data['computer_name'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(session, client_ip=None, agent_timestamp=None,\n node_timestamp=None, host_name=None, display_name=None,\n computer_name=None, username='system_user'):\n session = validate_session(session)\n if not host_name and client_ip:\n try:\n host_name = gethostbyaddr(clien...
[ "0.55243963", "0.5523504", "0.5343963", "0.5328363", "0.528189", "0.5176631", "0.51527655", "0.5116902", "0.51146966", "0.50991744", "0.50980383", "0.5058517", "0.5044866", "0.50412124", "0.502948", "0.5010761", "0.49565998", "0.4954844", "0.49528837", "0.49521717", "0.490679...
0.6849514
0
Add software to the RV database, if the software does not exist. arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener.
def add_software_update(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: if operation: results = add_results_non_json(session, node_id=node_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_software_available(session, data, username='system_user'):\n session = validate_session(session)\n operation = operation_exists(session, data['operation_id'])\n node_id = data['node_id']\n if node_id:\n if operation:\n results = add_results_non_json(session, node_id=node_id,\n...
[ "0.6986253", "0.65802455", "0.5349323", "0.50320786", "0.5021822", "0.49379858", "0.49077955", "0.48968634", "0.48968634", "0.48828244", "0.48783493", "0.48638728", "0.48364192", "0.48274758", "0.47938216", "0.47691125", "0.4736469", "0.47224382", "0.47190717", "0.46946776", ...
0.609844
2
Create a new entry in the packages_per_node table arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener.
def add_software_per_node(session, data, username='system_user'): session = validate_session(session) session.commit() operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: node = session.query(SystemInfo).\ filter(SystemInfo.node_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_node(self, node_tup):\n signature = hashlib.sha256((node_tup[0]+node_tup[4]).encode('utf-8')).hexdigest()\n app_process = sqlite3.connect('app_process::memory:', check_same_thread=False)\n app_process_cursor = app_process.cursor()\n app_process_cursor.execute(\"INSERT INTO no...
[ "0.5677619", "0.52482593", "0.5195922", "0.5182733", "0.5168917", "0.5161152", "0.5148398", "0.5096421", "0.5047914", "0.5011684", "0.4945328", "0.49099624", "0.49062672", "0.48959848", "0.48884022", "0.48753202", "0.48561898", "0.4854296", "0.48465168", "0.48298782", "0.4828...
0.59259677
0
Create a new entry in the software_available table This table is as of right now, strictly for Windows 3rd party applications arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener.
def add_software_available(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: if operation: results = add_results_non_json(session, node_id=node_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_software_installed(session, data, username='system_user'):\n session = validate_session(session)\n operation = operation_exists(session, data['operation_id'])\n node_id = data['node_id']\n if node_id:\n if operation:\n results = add_results_non_json(session, node_id=node_id,\n...
[ "0.6103432", "0.5414766", "0.5199664", "0.5104203", "0.5090083", "0.5016022", "0.495569", "0.4950043", "0.49389824", "0.49013168", "0.4894648", "0.48890445", "0.486498", "0.48560277", "0.48234528", "0.47895136", "0.4771943", "0.47551453", "0.47511882", "0.47435394", "0.473403...
0.7131
0
Create a new entry in the software_installed table This table is a foreignKey to an existing row in software_available for a node. This table is as of right now, strictly for Windows 3rd party applications arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and receive...
def add_software_installed(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: if operation: results = add_results_non_json(session, node_id=node_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_software_available(session, data, username='system_user'):\n session = validate_session(session)\n operation = operation_exists(session, data['operation_id'])\n node_id = data['node_id']\n if node_id:\n if operation:\n results = add_results_non_json(session, node_id=node_id,\n...
[ "0.70858717", "0.6096228", "0.60859156", "0.5863044", "0.51974237", "0.5174665", "0.5118672", "0.50887364", "0.49734944", "0.4848716", "0.4818761", "0.4803903", "0.47979134", "0.47967765", "0.4779577", "0.47724435", "0.4764106", "0.47607633", "0.47565302", "0.47553998", "0.47...
0.73042756
0
Remove a tag from the database arguments below.. session == SQLAlchemy Session tagname == name of the tag you want to remove
def remove_tag(session, tagname, username='system_user'): session = validate_session(session) tag = tag_exists(session, tag_name=tagname) tagid= tag.id tag_stats = session.query(TagStats).\ filter(TagStats.tag_id == tag.id) if tag: try: tag_stats.delete() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_tag(args):", "def delete_tag(self, session, tag):\n self._tag(session.delete, key=tag, delete=True, session=session)", "def delete_tag(self,tag):\r\n\r\n # with shelf\r\n if self.using_shelf:\r\n del self.tag_dict[tag]", "def delete_tags(self, session):\n sel...
[ "0.70557207", "0.6804026", "0.67596817", "0.6461948", "0.6456595", "0.63579917", "0.6332792", "0.63208556", "0.6299995", "0.61536014", "0.6106683", "0.6092737", "0.6069462", "0.60459316", "0.6033632", "0.6030218", "0.6010136", "0.59909695", "0.5976501", "0.5967643", "0.595496...
0.6806664
1
Remove all nodes from a tag in the database arguments below.. session == SQLAlchemy Session tag_name == name of the tag you want to remove
def remove_all_nodes_from_tag(session, tagname, username='system_user'): session = validate_session(session) tag = tag_exists(session, tag_name=tagname) if not tag: return(False, "Tag %s does not exists" % (tagname), tagname) tags_per_node = \ session.query(TagsPerNode, TagInfo).\ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_node_by_tagname(nodes: List, tagname: str):\n\n for remove in [node for node in nodes if node.tagname == tagname]:\n nodes.remove(remove)", "def remove_nodes_from_tag(session, tag_name, nodes=[], username='system_user'):\n session = validate_session(session)\n nodes_completed = []\n ...
[ "0.6951803", "0.6640433", "0.65312904", "0.64291734", "0.63873076", "0.6245773", "0.6116087", "0.60846364", "0.5978277", "0.5966734", "0.59097797", "0.5845086", "0.57912904", "0.57787085", "0.5764835", "0.5753481", "0.56975526", "0.56918705", "0.56644845", "0.56517816", "0.56...
0.7298875
0
Remove a node from a tag in the database arguments below.. session == SQLAlchemy Session tag_name == name of the tag you want to remove nodes == list of nodes to be removed
def remove_nodes_from_tag(session, tag_name, nodes=[], username='system_user'): session = validate_session(session) nodes_completed = [] nodes_failed = [] for node in nodes: tags_per_node = \ session.query(TagsPerNode, TagInfo).\ join(TagInfo).filter(TagInfo.tag =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_node_by_tagname(nodes: List, tagname: str):\n\n for remove in [node for node in nodes if node.tagname == tagname]:\n nodes.remove(remove)", "def removeNode(cTag, nTag): #@NoSelf", "def remove_all_nodes_from_tag(session, tagname, username='system_user'):\n session = validate_session(ses...
[ "0.728888", "0.70585287", "0.6895703", "0.68373203", "0.66836995", "0.64089173", "0.6372061", "0.6279932", "0.62658787", "0.6255787", "0.6096605", "0.60705644", "0.60271204", "0.5984538", "0.5976618", "0.5961547", "0.59454566", "0.59317696", "0.5918149", "0.5907452", "0.59072...
0.6854731
3
Remove a timeblock from the database arguments below.. session == SQLAlchemy Session id == the id of the timeblock label == the name of the timeblock
def remove_time_block(session, id=None, label=None, start_date=None, start_time=None, username='system_user'): session = validate_session(session) timeblock = time_block_exists(session, id, label, start_date, start_time) if timeblock: object_deleted = False, "Time Block %s ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _do_remove_block(self, args):\r\n bus_type = args[1]\r\n slave_id = int(args[2])\r\n name = args[3]\r\n if bus_type == 'rtu':\r\n slave = self.server._servers[0].get_slave(slave_id)\r\n elif bus_type == 'tcp':\r\n slave = self.server._servers[1].get_slav...
[ "0.62156653", "0.61247504", "0.6073977", "0.59137785", "0.58951217", "0.5816906", "0.56836355", "0.56813055", "0.56748646", "0.5583618", "0.5541887", "0.55088216", "0.5492939", "0.54708785", "0.54360646", "0.5434126", "0.5344612", "0.5317905", "0.53122264", "0.52653545", "0.5...
0.7277625
0
update an existing operation in the RV database arguments below.. session == SQLAlchemy Session oper_id == the id of the operation
def update_operation_row(session, oper_id, oper_recv=None, username='system_user'): session = validate_session(session) operation = operation_exists(session, oper_id) if operation and oper_recv: operation.operation_received = datetime.now() session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n sess = u.get_default_session()\n # sess.run(self.update_op)\n u.run(self.update_op)", "def update_maintenance_operation(session, operation=None):\n op_text = None\n if operation:\n op_text = operation.__name__\n\n with session.begin():\n row = session.query(...
[ "0.73067856", "0.6703859", "0.63593596", "0.60409796", "0.6018797", "0.58479035", "0.57298386", "0.5725205", "0.5643036", "0.5614167", "0.5578289", "0.5562358", "0.55372816", "0.5493391", "0.5493391", "0.54723907", "0.54620504", "0.54222816", "0.5418531", "0.5410402", "0.5410...
0.6572419
2
update an existing node in the RV database arguments below.. session == SQLAlchemy Session node_id == the id of the node ipaddress == The ipaddress of the node
def update_node(session, node_id, ipaddress, username='system_user'): session = validate_session(session) node = node_exists(session, node_id=node_id) error = None if not node.ip_address == ipaddress: try: node.ip_address = ipaddress session.commit() except Except...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_node(uuid, **values):\n fields_ver = values.copy()\n with session_for_write() as session:\n stmt = update(\n model.Node\n ).where(\n model.Node.uuid == uuid\n ).values(\n fields_ver\n ).execution_options(\n synchronize_session...
[ "0.72816133", "0.6820707", "0.65893435", "0.63527095", "0.63042516", "0.62814516", "0.62209684", "0.62012744", "0.6197582", "0.617847", "0.61486435", "0.6116205", "0.60991526", "0.60634166", "0.60237116", "0.597929", "0.5899573", "0.58901024", "0.5856175", "0.578596", "0.5714...
0.7498598
0
update the reboot status on a node in the node_info table in RV arguments below.. session == SQLAlchemy Session node_id == The node_id of the node oper_type == "reboot"
def update_reboot_status(session, node_id, oper_type, username='system_user'): session = validate_session(session) node = node_exists(session, node_id=node_id) if node: if oper_type == 'reboot': try: node.reboot = False node.agent_status = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reboot(self, node):", "def reboot_node(self, node):\n params = {'Action': 'RebootInstances'}\n params.update(self._pathlist('InstanceId', [node.id]))\n res = self.connection.request(self.path, params=params).object\n return self._get_boolean(res)", "def reboot(self):\n mo...
[ "0.75722855", "0.65329576", "0.6325448", "0.63181406", "0.6158265", "0.6149083", "0.61210716", "0.5949359", "0.5911771", "0.58813804", "0.5879121", "0.58717173", "0.5868806", "0.58477396", "0.58019197", "0.57642186", "0.569657", "0.5694058", "0.56701624", "0.5667073", "0.5651...
0.81069905
0
Modify the Global ACL of a User in the database
def update_global_user_acl(session, user_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_global_user_acl(session, user_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_rev...
[ "0.67252845", "0.64107996", "0.6400784", "0.63297886", "0.62673974", "0.62673974", "0.6256225", "0.6214258", "0.61393476", "0.6122256", "0.6052427", "0.59978604", "0.5933742", "0.5896206", "0.5861808", "0.5853026", "0.5822896", "0.5802331", "0.5785494", "0.57674253", "0.57431...
0.7438068
0
Modify the Global ACL of a Group in the database
def update_global_group_acl(session, group_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_r...
[ "0.7254382", "0.7022326", "0.6990606", "0.66523886", "0.6245156", "0.6238742", "0.6161424", "0.60740215", "0.6051832", "0.60211515", "0.60041064", "0.5945894", "0.5921249", "0.59133536", "0.58938885", "0.5891286", "0.5863889", "0.5847468", "0.5813295", "0.58117294", "0.579712...
0.7849561
0
modify the global permissions of a user on a node in the database
def update_node_user_acl(session, node_id=None, user_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_admin_permission(self) -> None:\n session = self.appbuilder.get_session\n dag_resources = session.scalars(\n select(Resource).where(Resource.name.like(f\"{permissions.RESOURCE_DAG_PREFIX}%\"))\n )\n resource_ids = [resource.id for resource in dag_resources]\n\n ...
[ "0.6568234", "0.6538204", "0.6426908", "0.6406976", "0.63939655", "0.62912196", "0.62615925", "0.62319654", "0.62132657", "0.60724735", "0.60161483", "0.59777075", "0.5943838", "0.5896214", "0.5890716", "0.58770514", "0.58673644", "0.58455306", "0.5797841", "0.5782578", "0.57...
0.665373
0
Modify the Global ACL of a Group on a node in the database
def update_node_group_acl(session, node_id=None, group_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapsho...
[ "0.7562661", "0.69415545", "0.6795446", "0.67245346", "0.65660304", "0.63047767", "0.61979157", "0.60958225", "0.604146", "0.60362536", "0.6010592", "0.5890728", "0.5883822", "0.58646387", "0.5860503", "0.5860379", "0.5858269", "0.5849576", "0.5836339", "0.58308", "0.5780648"...
0.7714923
0
Modify the Global ACL of a User on a Tag in the database
def update_tag_user_acl(session, tag_id=None, user_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow_tag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_user_acl(session, user_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_...
[ "0.6504644", "0.6162827", "0.6132806", "0.6129733", "0.6129733", "0.61052823", "0.5915916", "0.5805578", "0.5663717", "0.56336033", "0.56317526", "0.56130934", "0.55700725", "0.5557551", "0.5554141", "0.5528745", "0.5457469", "0.5451234", "0.54343987", "0.54223025", "0.541061...
0.7183954
0
Modify the Global ACL of a Group on a Tag in the database
def update_tag_group_acl(session, tag_id=None, group_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapsho...
[ "0.7220257", "0.68494946", "0.667716", "0.6487375", "0.6400578", "0.6063529", "0.6004117", "0.59780467", "0.59366125", "0.5917353", "0.59126985", "0.5803076", "0.5781316", "0.5769561", "0.5747072", "0.5723387", "0.56890684", "0.5651428", "0.5624252", "0.56194323", "0.56056285...
0.7822554
0
Add a new entry in the results table in RV arguments below.. session == SQLAlchemy Session data == the json message received from the agent
def add_results(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node = node_exists(session,node_id=data['node_id']) if node: node_id = data['node_id'] if data['operation'] == 'reboot': nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_records(self, data: dict, execution_context: dict):", "def add_row(self, row_id):", "def add_next_iteration_results(self, *args, **kwargs):\n \n # Passing all the parameters to the graph object\n # which upates the internal state of the graph\n self.sql_model_instance.graphs...
[ "0.62482166", "0.58265", "0.5792383", "0.57908404", "0.57755756", "0.5740843", "0.57107496", "0.55978835", "0.55917794", "0.54867315", "0.5469462", "0.5465754", "0.5449438", "0.5412065", "0.5400628", "0.53911936", "0.5387508", "0.5379521", "0.5369491", "0.536726", "0.536726",...
0.6078163
1
Sets defaults for the provided configuration
def prepare_config(config: dict) -> dict: config.setdefault('password', None) config.setdefault('private_key', None) config.setdefault('private_key_pass', None) config.setdefault('host_key', None) config.setdefault('dirs', ['.']) return config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setdefaults(self):\n self.config = {\n 'dbuser': Infopage.DEFAULT_DBUSER,\n 'dbname': Infopage.DEFAULT_DBNAME,\n 'dbpassword': Infopage.DEFAULT_DBPASSWORD,\n 'dbhost': Infopage.DEFAULT_DBHOST\n }", "def initConfiguration():\n UTIL.SYS.s_configuration...
[ "0.76838875", "0.7363561", "0.72177184", "0.72016305", "0.71853375", "0.711877", "0.7100197", "0.7085253", "0.7073906", "0.6964687", "0.69576526", "0.6949763", "0.69288844", "0.6916137", "0.6914883", "0.6879722", "0.6874769", "0.6867838", "0.68650156", "0.68600667", "0.686006...
0.0
-1
Downloads the file(s) described in entry
def download_entry(cls, entry: Entry, config: dict, sftp: SftpClient) -> None: path: str = unquote(urlparse(entry['url']).path) or '.' delete_origin: bool = config['delete_origin'] recursive: bool = config['recursive'] to: str = config['to'] try: to = render_from_ent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_files(self):", "def download_files(self) -> None:\n\n for name, url in self.files.items():\n print(f\"Download {name.split('/')[-1]}\")\n wget.download(url, os.path.join(\"data\", name))", "def download_file(self, parsed_event, input_dir_path):", "def get_files(self)...
[ "0.7334557", "0.6602971", "0.6455047", "0.6433068", "0.63911927", "0.63551885", "0.6316714", "0.63050663", "0.62683964", "0.6251234", "0.62311596", "0.6145604", "0.6142242", "0.6126038", "0.6105735", "0.6086469", "0.60783595", "0.60621864", "0.60366726", "0.60366726", "0.6033...
0.57467943
56
Register this as an output plugin
def on_task_output(cls, task: Task, config: dict) -> None:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load():\n return SyslogOutOutputPlugin", "def LoadOutputPlugin(self, path):\n\n self._LoadPlugin(self._output_registry, 'output.yml', path)", "def AddOutputCallback(self, callback):\n self.output_callbacks.append(callback)", "def __init__(self, name, node):\n super(OutputPlug, self)._...
[ "0.646148", "0.6417916", "0.63977176", "0.63373387", "0.63265157", "0.63160986", "0.62953615", "0.625948", "0.61171454", "0.61171454", "0.61171454", "0.60817516", "0.6065714", "0.6065195", "0.60583955", "0.6028981", "0.5910007", "0.58735806", "0.58735806", "0.5791759", "0.578...
0.5472557
54
Task handler for sftp_download plugin
def on_task_download(cls, task: Task, config: dict) -> None: socket_timeout_sec: int = config['socket_timeout_sec'] connection_tries: int = config['connection_tries'] # Download entries by host so we can reuse the connection for sftp_config, entries in groupby(task.accepted, cls._get_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ssh_download_files(data):\n with _ssh_connect() as ssh:\n with ssh.open_sftp() as sftp:\n with click.progressbar(data, label='downloads') as items: # noqa\n for item in items:\n _, filename = os.path.split(item)\n sftp.get(item, f'{DOWN...
[ "0.6760415", "0.6119707", "0.61096543", "0.605568", "0.6042737", "0.5958615", "0.5922521", "0.5888617", "0.5864169", "0.58393395", "0.58332944", "0.58228356", "0.5801318", "0.5736366", "0.5667004", "0.56512177", "0.5642449", "0.55854475", "0.55769396", "0.55599636", "0.554756...
0.6754636
1
Parses a url and returns a hashable config, source path, and destination path
def _get_sftp_config(cls, entry: Entry): # parse url parsed = urlparse(entry['url']) host: str = parsed.hostname username: str = parsed.username password: str = parsed.password port: int = parsed.port or DEFAULT_SFTP_PORT # get private key info if it exists ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_url_dict(self, url):\n # TODO: what if URL is an exact attribute in site config and not relative?\n try:\n return (\n url['path'],\n self.SITE_CONFIG.parse_relative_url_dict(url)\n )\n except KeyError as e:\n raise utils...
[ "0.65322584", "0.63917404", "0.6330404", "0.6198452", "0.6170337", "0.59986144", "0.5937309", "0.5862404", "0.58555067", "0.57999516", "0.5785985", "0.57678366", "0.5765161", "0.57554877", "0.57271445", "0.57167894", "0.5666716", "0.5650904", "0.56488854", "0.5627165", "0.561...
0.49634185
91
Sets defaults for the provided configuration
def prepare_config(config: dict) -> dict: config.setdefault('password', None) config.setdefault('private_key', None) config.setdefault('private_key_pass', None) config.setdefault('to', None) return config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setdefaults(self):\n self.config = {\n 'dbuser': Infopage.DEFAULT_DBUSER,\n 'dbname': Infopage.DEFAULT_DBNAME,\n 'dbpassword': Infopage.DEFAULT_DBPASSWORD,\n 'dbhost': Infopage.DEFAULT_DBHOST\n }", "def initConfiguration():\n UTIL.SYS.s_configuration...
[ "0.76838875", "0.7363561", "0.72177184", "0.72016305", "0.71853375", "0.711877", "0.7100197", "0.7085253", "0.7073906", "0.6964687", "0.69576526", "0.6949763", "0.69288844", "0.6916137", "0.6914883", "0.6879722", "0.6874769", "0.6867838", "0.68650156", "0.68600667", "0.686006...
0.0
-1
Uploads accepted entries to the specified SFTP server.
def on_task_output(cls, task: Task, config: dict) -> None: config = cls.prepare_config(config) socket_timeout_sec: int = config['socket_timeout_sec'] connection_tries: int = config['connection_tries'] sftp_config: SftpConfig = task_config_to_sftp_config(config) sftp = sftp_con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(self) -> list:\n\n _sftp = None\n try:\n if self._sftpSecret.find(os.sep) == -1:\n _sftp = pysftp.Connection(self._sftpHost,\n username=self._sftpUsername,\n password=self._sftpSecre...
[ "0.6215347", "0.6154818", "0.61220515", "0.5922133", "0.5869823", "0.58326346", "0.58278227", "0.57609874", "0.569599", "0.56464106", "0.56426567", "0.5636189", "0.5588572", "0.5574974", "0.5569968", "0.5566738", "0.5537185", "0.5459689", "0.5443172", "0.5424469", "0.5420793"...
0.5403493
22
Creates an SFTP connection from a Flexget config object
def task_config_to_sftp_config(config: dict) -> SftpConfig: host: int = config['host'] port: int = config['port'] username: str = config['username'] password: str = config['password'] private_key: str = config['private_key'] private_key_pass: str = config['private_key_pass'] host_key: Optio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, config):\n self.config = config\n\n # setup logging\n if config.get('ssh_log_path'):\n ssh.util.log_to_file(config['ssh_log_path'])\n\n hostname = config.get('remote_host', 'localhost')\n port = config.get('remote_port', 22)\n username = confi...
[ "0.6799001", "0.65101117", "0.6486627", "0.64719737", "0.640493", "0.616897", "0.60081565", "0.59975857", "0.58954567", "0.5877264", "0.5876884", "0.58517414", "0.5846761", "0.575433", "0.57234526", "0.56997186", "0.5404839", "0.5399757", "0.5369568", "0.5320579", "0.5308505"...
0.664715
1
prepare the cosimulation environment
def _prep_cosim(args, **sigs): # compile the verilog files with the verilog simulator files = ['./dwt_top.v','./tb_dwt_top.v',] print("compiling ...") cmd = "iverilog -o dwt_top %s " % (" ".join(files)) print(" *%s" % (cmd)) os.system(cmd) # get the handle to the print("cosimulat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initFromEnv(self):\n #self.command = 'scram' # SB I think this line is not needed\n self[\"SCRAM_ARCH\"] = None\n\n if 'SCRAM_ARCH' in os.environ:\n self[\"SCRAM_ARCH\"] = os.environ[\"SCRAM_ARCH\"]\n else:\n stdout, _, _ = execute_command(command='scram arch'...
[ "0.629472", "0.6261593", "0.6040992", "0.60047394", "0.5995163", "0.59356046", "0.59223294", "0.5901636", "0.58975756", "0.5884308", "0.58454937", "0.5835247", "0.58315617", "0.58204514", "0.5817271", "0.57970774", "0.5790427", "0.5772942", "0.5740951", "0.57361805", "0.57207...
0.56129134
31
Convert symbolic permission notation to numeric notation.
def symb_to_num(symbolic): if len(symbolic) == 9: group = (symbolic[:-6], symbolic[3:-3], symbolic[6:]) try: numeric = notation[group[0]] + notation[group[1]] + notation[group[2]] except: numeric = "Invalid Symbolic Representation!" else: numeric = "Symbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_to_symb(num):\n\n num = str(num)\n if len(num) == 3:\n group = (num[0], num[1], num[2])\n symbolic = \"\"\n\n for key, value in notation.items():\n for g in group:\n if int(g) > 8 or int(g) < 0:\n symbolic = \"Invalid Numerical Represe...
[ "0.5681998", "0.521568", "0.51752305", "0.5127067", "0.5117769", "0.50925183", "0.5087651", "0.50793535", "0.50348747", "0.5022774", "0.4999135", "0.49990058", "0.49702394", "0.4968009", "0.4900085", "0.4852676", "0.48500445", "0.4836129", "0.47774908", "0.4772518", "0.476453...
0.6173098
0
Convert number permission notation to symbolic notation.
def num_to_symb(num): num = str(num) if len(num) == 3: group = (num[0], num[1], num[2]) symbolic = "" for key, value in notation.items(): for g in group: if int(g) > 8 or int(g) < 0: symbolic = "Invalid Numerical Representation!" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_octal_from_file_permission(rwx: str) -> str:\n octals = {'r': 4, 'w': 2, 'x': 1, '-': 0}\n chars = []\n temp = []\n \n for i in range(len(rwx)):\n val = octals.get(rwx[i])\n temp.append(val)\n if len(temp) == 3:\n chars.append(list(t for t in temp))\n ...
[ "0.53374124", "0.527418", "0.5249602", "0.520306", "0.5150457", "0.5133376", "0.51284754", "0.5085775", "0.5078872", "0.50376916", "0.5032838", "0.50220686", "0.50122875", "0.4994668", "0.4976482", "0.49640882", "0.49295864", "0.4921475", "0.48928908", "0.48783267", "0.486434...
0.6568608
0
Show all resolutions received
def get(self, request, **kwargs): template = 'resolutions.html' context = {} show_logo_instead = random.randint(0, 100) if show_logo_instead <= 15: # 15% of the time, show the logo instead context['show_logo_instead'] = True else: resolution_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(self, resolutions):\r\n # This is optional behavior\r\n return resolutions", "def populate_resolution_box(self, fmt: str):\n self.resolution_combo.reset()\n self.fps_combo.reset()\n res_list = self.caps_desc.get_resolution_list(fmt)\n\n if not res_list:\n ...
[ "0.6274222", "0.6270068", "0.60677403", "0.60651636", "0.5923708", "0.58746326", "0.5865114", "0.57543665", "0.5643217", "0.5525964", "0.54416966", "0.5438535", "0.53689474", "0.5335733", "0.52837765", "0.5249803", "0.5241965", "0.5237411", "0.5233322", "0.5208205", "0.520241...
0.58790886
5
Used by the Twilio API to receive a text message and save a resolution.
def post(self, request, **kwargs): resolution = request.POST.get('Body') if resolution: new_resolution = Resolution(text=resolution) new_resolution.save() template = 'response.html' context = {} return render(request, template, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive_message():\n\n msg_data = flask.request.get_json(silent=True, force=True)\n\n name = msg_data['name']\n picture_url = msg_data['picture_url']\n text = msg_data['text']\n time_sent = msg_data['time_sent']\n settings_key = ndb.Key(settings.Settings, msg_data['settings'])\n\n logging....
[ "0.61034733", "0.5759642", "0.56703115", "0.5655322", "0.55951816", "0.55487496", "0.5543905", "0.5532788", "0.5527256", "0.5474542", "0.54218113", "0.5394618", "0.5394216", "0.5389646", "0.538614", "0.53798556", "0.5357868", "0.53256536", "0.5321131", "0.5317306", "0.5306554...
0.55867094
5
Negative binomial distribution, p is the probability of a FAILURE. Result is the number of failures until the rth success.
def pdfPR(self,x,p,r): return gammaF(x + r) / (factorial(x)*gammaF(r)) * p**r * (1-p)**x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_bernoulli_trials(n, p):\n # Initialize number of successes: n_success\n n_success = 0\n\n\n # Perform trials\n for i in range(n):\n # Choose random number between zero and one: random_number\n random_number = np.random.random()\n\n # If less than p, it's a success so ad...
[ "0.69135344", "0.6888008", "0.6885063", "0.6876171", "0.6778513", "0.65672594", "0.6561243", "0.65516794", "0.6487053", "0.64328194", "0.64263123", "0.6340225", "0.63180155", "0.626795", "0.61252296", "0.6105334", "0.610038", "0.60903025", "0.6064486", "0.60568416", "0.599576...
0.0
-1
Convert between mu/[sigma|theta|alpha] parameterization and p/r
def convertParameters(self,mu,sigma=None,theta=None,alpha=None): if sigma is not None: r = mu**2 / (sigma**2-mu) elif theta is not None: r = theta elif alpha is not None: r = 1./alpha p = r / (r + mu) return r,p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pdf(self,x,mu,sigma=None,theta=None,alpha=None):\n\t\n\t\tr,p = self.convertParameters(mu,sigma,theta,alpha)\n\t\treturn self.pdfPR(x,p,r)", "def normalisedProductionPDF(p, theta, mDarkPhoton, epsilon, norm):\n return (1. / norm) * dNdPdTheta(p, theta, mDarkPhoton, epsilon)", "def A(param):\n return ...
[ "0.6166494", "0.592515", "0.58565605", "0.58215654", "0.57992804", "0.5755113", "0.57434535", "0.57369626", "0.572879", "0.56506467", "0.562362", "0.56022376", "0.5598592", "0.5592415", "0.55910724", "0.55903745", "0.5589684", "0.55826247", "0.55582327", "0.5554927", "0.55528...
0.7524006
0
Regression style negative binomial. Set one of sigma, theta or alpha. Theta is an antidispersion or clumping parameter (NB > poisson as theta > infinity) Alpha is 1/theta, a dispersion parameter (NB > poisson as alpha > 0)
def pdf(self,x,mu,sigma=None,theta=None,alpha=None): r,p = self.convertParameters(mu,sigma,theta,alpha) return self.pdfPR(x,p,r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def r_neg_binom(alpha,mean,num=1):\n\tr = 1.0 / np.float(alpha)\n\tp = r / (r + mean)\n\treturn nbinom.rvs(r,p,size=num)", "def p_neg_binom(x,alpha,mean,log=True):\n\tr = 1.0 / np.float(alpha)\n\tp = r / (r + mean)\n\tlog_p = nbinom.logpmf(x, r, p, loc=0)\n\tif log:\n\t\treturn log_p\n\telse:\n\t\treturn np.ex...
[ "0.6528253", "0.6305876", "0.62928", "0.60620314", "0.5975161", "0.58808404", "0.57638305", "0.5680509", "0.5664412", "0.5663479", "0.56550664", "0.5652778", "0.5637215", "0.5634644", "0.5557861", "0.550218", "0.54884833", "0.5469649", "0.5456584", "0.54441684", "0.543265", ...
0.0
-1
Draw random samples from a negative binomial distribution
def sample(self,mu,sigma=None,theta=None,alpha=None,size=None): r,p = self.convertParameters(mu,sigma,theta,alpha) return numpy.random.negative_binomial(n=r,p=p,size=size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_sample(x):\n return np.random.binomial(1, p=x)", "def NegativeBinomial_sampling(K=100, P=0.5,size=None,rng=np.random.RandomState(100)):\n if (not np.isscalar(P)):\n size=P.shape\n if (np.isscalar(P) and size is None):\n size=1\n X=rng.negative_binomial(K,P,size)\n return X...
[ "0.6792101", "0.67824376", "0.6604079", "0.65796167", "0.6571323", "0.6419903", "0.6192945", "0.6190055", "0.61820704", "0.6168806", "0.6156702", "0.6154157", "0.6120292", "0.61190623", "0.6068932", "0.6015622", "0.60140365", "0.6008499", "0.60048985", "0.5993291", "0.5988804...
0.5806599
38
Create list of player objects
def __init__(self, number_players=1000): self.player_list = [] for i in range(number_players): self.player_list.append(Player())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_players_list(self):\n for p in self.players_names:\n self._players_list.append(Player(p))", "def create_players(self):\n players = []\n count = self.query('player', 'count', '?')\n for index in range(0, int(count)):\n player_id = self.query('player', '...
[ "0.8415683", "0.77281135", "0.7500566", "0.74741745", "0.7420029", "0.74105877", "0.7283305", "0.7032042", "0.7028725", "0.69137144", "0.6816953", "0.67063427", "0.66382223", "0.65988654", "0.65697956", "0.6518914", "0.6506067", "0.6476675", "0.6456089", "0.6455565", "0.64398...
0.80597174
1
Write out info for analysis
def to_csv(self): with open('Players.csv', 'wt', newline='\n') as out: fields = ('mmr', 'communication', 'tilt', 'internet', 'leadership', 'gameKnowledge', 'reactionTimes', 'early_game', 'late_game', 'mechanics') writer = csv.writer(out) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_info_to_file(self):\n\n self.info.write_mission_info()\n\n self.logger.info(\"Mission instance write succeeded.\")", "def info(out: Export = Export(\"cwb.encoded/data/.info\"),\n sentences: AnnotationCommonData = AnnotationCommonData(\"misc.<sentence>_count\"),\n firstdate...
[ "0.7056108", "0.67680436", "0.66807693", "0.6658253", "0.6530391", "0.6467057", "0.6400526", "0.6373689", "0.6348998", "0.6335972", "0.62535244", "0.6248077", "0.62222004", "0.6186441", "0.6185751", "0.61435616", "0.6140123", "0.6113667", "0.610965", "0.6107006", "0.6099229",...
0.0
-1
Testing if amount of players initialized is correct
def _test_player_list_size(self): return len(self.player_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enough_players():\n return True", "def noOfPlayers(self):\n\t\tnumber = 0\n\t\tfor n in range(6):\n\t\t\tif self.playerList[n] != None:\n\t\t\t\tnumber = number + 1\n\t\treturn number", "def test_valid_game_setup(self):\n self.assertEqual(self._game.active_players(), 1)\n for x in xrange(1...
[ "0.7769488", "0.72755575", "0.72210413", "0.71589714", "0.7081436", "0.7074838", "0.70711625", "0.68413734", "0.6811846", "0.6798778", "0.6792549", "0.6791493", "0.66448987", "0.6587905", "0.65837675", "0.6579726", "0.65554416", "0.6517425", "0.64908224", "0.64804053", "0.645...
0.7485758
1
Test that no line in the corpus exceeds the maximum number of characters.
def test_character_count(self): from chatterbot_corpus.corpus import DIALOG_MAXIMUM_CHARACTER_LENGTH corpora = corpus.load_corpus('chatterbot.corpus') for conversations in corpora: for conversation in conversations: for statement in conversation: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_max_length(self, p: list) -> bool:\n\n return (\n len(p[0].split(\" \")) < self.max_length\n and len(p[1].split(\" \")) < self.max_length\n )", "def test__limit_string_length(string, max_length):\n return limit_string_length(string, max_length)", "def is_doc_le...
[ "0.67271656", "0.65961367", "0.65796036", "0.65796036", "0.6576228", "0.64568543", "0.6453824", "0.64388967", "0.6435205", "0.6282319", "0.62795603", "0.6278928", "0.62316865", "0.62316865", "0.62293184", "0.62266916", "0.6223264", "0.6187261", "0.6175471", "0.61711305", "0.6...
0.68706644
0
CALL THIS FUNCTION IN ORDER TO TRANSFORM FROM RAW DATA (TASK TRACK 2015 AND TASK TRACK 2015) INTO A NEW DATA WHICH WILL BE STORED IN processed_data
def transform_queries_qrels_new_ids(self): self.dict_mapper_old_to_new_qid = {} self.count_subtasks = {} self.dict_missingqueries = {} self.dict_assessed_queries = self.get_queries_assessed() self.map_old_qid_to_new() self.map_qrels_to_newqids() exit() sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self, data):", "def get_preprocessed_from_raw(sess_no, raw_path, align_on, from_time, to_time) :\n \n #params\n sess = '01'\n \n trial_length = abs(from_time - to_time)\n\n # Paths\n #raw_path = base_path + 'data/raw/' + sess_no + '/session' + sess + '/'\n rinfo_path = ra...
[ "0.655736", "0.6204332", "0.6135723", "0.6135723", "0.60281587", "0.5999329", "0.59822136", "0.5944262", "0.5943839", "0.5940451", "0.5896695", "0.58625484", "0.5858024", "0.58525944", "0.58229464", "0.5819861", "0.58159506", "0.5804405", "0.5796359", "0.57509035", "0.5743336...
0.0
-1
Reparameterization trick by sampling fr an isotropic unit Gaussian.
def sampling(args): z_mean, z_log_var = args # K is the keras backend batch = K.shape(z_mean)[0] dim = K.int_shape(z_mean)[1] # by default, random_normal has mean=0 and std=1.0 epsilon = K.random_normal(shape=(batch, dim)) return z_mean + K.exp(0.5 * z_log_var) * epsilon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resample_from_mf(self):\n self.g = np.zeros((self.K, self.K, self.B))\n for k1 in xrange(self.K):\n for k2 in xrange(self.K):\n self.g[k1,k2,:] = np.random.dirichlet(self.mf_gamma[k1,k2,:])", "def sampling_latent(self):\n \n self.z = gaussian_sample(s...
[ "0.62867767", "0.6282071", "0.62459034", "0.60686386", "0.5999096", "0.58914125", "0.58084226", "0.58028454", "0.57550585", "0.5752261", "0.57308155", "0.5696021", "0.5695068", "0.5642431", "0.5633219", "0.5607014", "0.55823493", "0.55755717", "0.5550761", "0.5548663", "0.550...
0.0
-1
Adds the obstacle as a GL_QUAD, does not allow obstacles less than step size
def add_to_default_batch(self): ''' self.shape = shared.batch.add(4, gl.GL_QUADS, None, ('v2f', (self.x, self.y, self.x + self.width, self.y, self.x + self.width, self.y +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_obstacle(self, obstacle_to_add):\n if self.obstacles.size != 0:\n self.obstacles = np.hstack((self.obstacles, obstacle_to_add))\n else:\n self.obstacles = np.array([obstacle_to_add])", "def draw_cube(self, vec):\n # TOP FACE\n gl.glBegin(gl.GL_QUADS)\n ...
[ "0.5752157", "0.5704695", "0.55139184", "0.5475178", "0.54358566", "0.5433752", "0.54157096", "0.54004365", "0.5338123", "0.5258591", "0.51662725", "0.5163054", "0.51443285", "0.51314676", "0.5076834", "0.5071217", "0.50524515", "0.5043967", "0.5039486", "0.5000148", "0.49988...
0.5838143
0
Deletes the obstacle Deletes the graphics object if it exists then remove from the obstacles list
def delete(self): if self.shape is not None: self.shape.delete() if self in shared.obstacles: shared.obstacles.remove(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_obstacle(self, x, y):\n self.BOARD[y][x].traversable = True\n self.board_array[y][x] = 0", "def remove_dead_obstacles(obstacle_list):\n\tfor obstacle in obstacle_list:\n\t\tobstacle.lifetime -= 1\n\t\tif obstacle.lifetime == 0:\n\t\t\tobstacle_list.remove(obstacle)\n\t\tprint(obstacle)",...
[ "0.71443987", "0.6765844", "0.65129733", "0.6281675", "0.6277408", "0.62500167", "0.61455756", "0.6092859", "0.6083727", "0.6079878", "0.59569687", "0.5912045", "0.5907866", "0.5899834", "0.5867926", "0.58546644", "0.58154076", "0.57985085", "0.5795229", "0.57503587", "0.5691...
0.79736793
0
utility function for the RBM class
def train_rbm(fp_path="data/fp.bin", out_path="data/rbm_J.bin", batch_size=16, all_units=2048, use_gpu=True, epochs=100, k=1, check_reconstruction=3, plot=True, qubo_mode=False ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _regr_basic():", "def mezclar_bolsa(self):", "def b(self):\n pass", "def b(self):\n pass", "def regular(self):", "def get_bias(self):", "def CL(self):", "def __init__(self, R, K, alpha, beta, iterations, type='bias'):\n\n self.R = R\n self.num_users, self.num_items = R...
[ "0.6392282", "0.63511866", "0.5900039", "0.5900039", "0.58350194", "0.5814893", "0.5629363", "0.55948657", "0.5561734", "0.5524386", "0.5512239", "0.5512239", "0.5509656", "0.5509656", "0.54481226", "0.54441166", "0.54224724", "0.5413811", "0.536525", "0.5350975", "0.5350825"...
0.0
-1
Create app Factory pattern
def create_app(config_name): app = Flask(__name__) # create app instance app.config.from_object(config_by_name[config_name]) flask_bcrypt.init_app(app) CORS(app) routes.init_routes(app) return app
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app(self):\n raise NotImplementedError", "def create():\n\n return App()", "def app():\n return create_app()", "def app():\n app = create_app()\n return app", "def _create_app_instance(script_info):\n return create_app()", "def factory(cls, global_config):\n\n def ...
[ "0.77792275", "0.7639172", "0.7576647", "0.7531317", "0.74922377", "0.73317295", "0.7285012", "0.7199269", "0.7168266", "0.7152351", "0.714875", "0.714829", "0.7128589", "0.70836276", "0.7069791", "0.702057", "0.6999516", "0.6984093", "0.6977224", "0.69723654", "0.69707006", ...
0.6698907
55
r"""Load a JAMS Annotation from a file.
def load(path_or_file, validate=True, strict=True, fmt='auto'): with _open(path_or_file, mode='r', fmt=fmt) as fdesc: jam = JAMS(**json.load(fdesc)) if validate: jam.validate(strict=strict) return jam
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_annotation(json_path):\n # Open the file containing the annotation\n with open(json_path) as annotation_file:\n\n # Parse the AI2D annotation from the JSON file into a dictionary\n annotation = json.load(annotation_file)\n\n # Return the annotation\n retu...
[ "0.72324926", "0.6892697", "0.66138506", "0.6469069", "0.64096445", "0.6335099", "0.6076997", "0.58904", "0.58181393", "0.5814854", "0.5813344", "0.57950807", "0.5775708", "0.5774268", "0.5764761", "0.5746504", "0.57462776", "0.5741542", "0.5730799", "0.56957155", "0.5694569"...
0.6470887
3
r"""Return the JObject as a set of native data types for serialization.
def __json__(self): filtered_dict = dict() for k, item in six.iteritems(self.__dict__): if k.startswith('_'): continue if hasattr(item, '__json__'): filtered_dict[k] = item.__json__ else: filtered_dict[k] = serialize_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json(self) -> Union[dict, list, str, int, float]:\n raise NotImplementedError # pragma: no cover", "def data_types(self):", "def json(self) -> Dict[str, Union[List, Dict, str, int, float]]:", "def toJSType(self):\n return dict(\n name=self.name,\n description=self.des...
[ "0.6872278", "0.62380904", "0.6095021", "0.6073043", "0.6053912", "0.6046117", "0.6027797", "0.6000453", "0.58964735", "0.587078", "0.5852057", "0.5852057", "0.5848348", "0.58386344", "0.58100027", "0.58068883", "0.5797225", "0.5795872", "0.5778331", "0.57390094", "0.57096803...
0.0
-1
Initialize the object from a dictionary of values
def __json_init__(cls, **kwargs): return cls(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, keys, values):\n self.keys = keys\n self.values = values", "def from_dict(cls, dictionary: Dict[str, Any]):\n return cls(**dictionary)", "def from_dict(cls, dct):\n pass", "def from_dict(cls, data):\n return cls(**data)", "def from_dict(cls, data):\r\n ...
[ "0.7609474", "0.74423563", "0.7432553", "0.7426584", "0.7413911", "0.74106115", "0.73779005", "0.7373955", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "0.73540986", "...
0.0
-1
Render the object alongside its attributes.
def __repr__(self): indent = len(self.type) + 2 jstr = ',\n' + ' ' * indent props = self._display_properties() params = jstr.join('{:}={:}'.format(p, summary(self[p], indent=indent)) for (p, dp) in props)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self):\r\n super().render()", "def render(self):\n pass", "def render(self):\n pass", "def render(self):\n pass", "def render(self):\n pass", "def render(self):\n pass", "def render(self):\n pass", "def render(self):\n\n context = {\n ...
[ "0.66662323", "0.66044813", "0.66044813", "0.66044813", "0.66044813", "0.66044813", "0.66044813", "0.6551538", "0.6535275", "0.6530759", "0.6495157", "0.6471163", "0.6454085", "0.6423458", "0.64134127", "0.6337314", "0.6335119", "0.63111424", "0.62728167", "0.62338614", "0.61...
0.0
-1
Return a list of the attributes of the object. Returns
def keys(self): return self.__dict__.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attrs(self):\n attrs = []\n for attribute in self.__dict__.keys():\n attrs.append(attribute)", "def get_attributes(cls):\r\n return []", "def get_attributes(self):\n return self.attributes", "def getAttributes(self):\n pass", "def getAttributes(self):\n...
[ "0.8378631", "0.8124402", "0.811878", "0.80819845", "0.80225986", "0.80225986", "0.7986042", "0.7955869", "0.7923143", "0.788158", "0.7864873", "0.776589", "0.77455765", "0.76674074", "0.75634915", "0.7563442", "0.7475031", "0.74707925", "0.7440739", "0.74406534", "0.74261725...
0.0
-1
Create an Annotation. Note that, if an argument is None, an empty Annotation is created in its place. Additionally, a dictionary matching the expected structure of the arguments will be parsed (i.e. instantiating from JSON).
def __init__(self, namespace, data=None, annotation_metadata=None, sandbox=None, time=0, duration=None): super(Annotation, self).__init__() if annotation_metadata is None: annotation_metadata = AnnotationMetadata() self.annotation_metadata = AnnotationMetadata(**a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RDFAnnotationParser_createAnnotation():\n return _libsbml.RDFAnnotationParser_createAnnotation()", "def createAnnotation():\n return _libsbml.RDFAnnotationParser_createAnnotation()", "def create_annotation(timestamp, value, host):\n return zipkin_core.Annotation(timestamp=timestamp, value=value,...
[ "0.59611523", "0.59427184", "0.58710736", "0.5766063", "0.5743713", "0.5684858", "0.5537817", "0.55328065", "0.5502203", "0.53965425", "0.52998286", "0.51879084", "0.51839596", "0.5171853", "0.51343316", "0.51239586", "0.5122177", "0.50803316", "0.5056191", "0.50431263", "0.5...
0.5776535
3
r"""Return the JObject as a set of native data types for serialization.
def __json_light__(self, data=True): filtered_dict = dict() for k, item in six.iteritems(self.__dict__): if k.startswith('_'): continue elif k == 'data': if data: filtered_dict[k] = self.__json_data__ else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json(self) -> Union[dict, list, str, int, float]:\n raise NotImplementedError # pragma: no cover", "def data_types(self):", "def json(self) -> Dict[str, Union[List, Dict, str, int, float]]:", "def toJSType(self):\n return dict(\n name=self.name,\n description=self.des...
[ "0.6870413", "0.62396663", "0.609319", "0.60719466", "0.6052096", "0.60452205", "0.602536", "0.600013", "0.58979076", "0.5868783", "0.5850369", "0.5850369", "0.5846776", "0.5836646", "0.5810545", "0.58071244", "0.5795777", "0.57938355", "0.5778446", "0.5737332", "0.57085997",...
0.0
-1
r"""JSONserialize the observation sequence.
def __json_data__(self): if schema.is_dense(self.namespace): dense_records = dict() for field in Observation._fields: dense_records[field] = [] for obs in self.data: for key, val in six.iteritems(obs._asdict()): dense_recor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toJson(self):\n text = '{'\n if len(self._sequence):\n for key in self._sequence:\n text += '\"%s\":%s,' % (key,json.dumps(self.dictionary[key]))\n text = text[:-1]\n text += '}'\n\n return text", "def as_json(self) -> str:\n return json...
[ "0.6776155", "0.6708074", "0.64370257", "0.6387373", "0.6361001", "0.63252026", "0.6286282", "0.6286282", "0.62822974", "0.62637067", "0.6223078", "0.6172028", "0.6171983", "0.6165653", "0.6129194", "0.6123974", "0.6119053", "0.61068493", "0.61020386", "0.6077638", "0.6077155...
0.0
-1
Create an AnnotationMetadata object.
def __init__(self, curator=None, version='', corpus='', annotator=None, annotation_tools='', annotation_rules='', validation='', data_source=''): super(AnnotationMetadata, self).__init__() if curator is None: curator = Curator() if annotator is Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createAnnotation():\n return _libsbml.RDFAnnotationParser_createAnnotation()", "def RDFAnnotationParser_createAnnotation():\n return _libsbml.RDFAnnotationParser_createAnnotation()", "def create_annotation(timestamp, value, host):\n return zipkin_core.Annotation(timestamp=timestamp, value=value,...
[ "0.64496595", "0.62409776", "0.60126007", "0.5973326", "0.597268", "0.58234113", "0.5532421", "0.5525132", "0.548961", "0.54375076", "0.5433396", "0.54108304", "0.54048735", "0.53936356", "0.5359755", "0.5265134", "0.52208763", "0.5198275", "0.5187576", "0.5115082", "0.510276...
0.56469256
6
Create a filelevel Metadata object.
def __init__(self, title='', artist='', release='', duration=None, identifiers=None, jams_version=None): super(FileMetadata, self).__init__() if jams_version is None: jams_version = __VERSION__ if identifiers is None: identifiers = Sandbox() se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file_metadata(self):\n metadata = self.__file.require_group(METADATA)\n self.__write_value(metadata, DATE_CREATED, date.today().strftime(\"%Y-%m-%d\"))\n self.__write_value(metadata, SDK_VERSION, __version__)", "def gen_meta(self, filename):\n nf_meta = {}\n nf_meta['fi...
[ "0.6603724", "0.64794075", "0.6444975", "0.63011587", "0.62964076", "0.60185266", "0.60181475", "0.60088", "0.59797317", "0.5959526", "0.5949016", "0.5931138", "0.58757067", "0.5871233", "0.58695316", "0.58607626", "0.58580416", "0.5799596", "0.57732666", "0.5763947", "0.5746...
0.6083752
5
Create a Jams object.
def __init__(self, annotations=None, file_metadata=None, sandbox=None): super(JAMS, self).__init__() if file_metadata is None: file_metadata = FileMetadata() if sandbox is None: sandbox = Sandbox() self.annotations = AnnotationArray(annotations=annotations) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_jams(self):\n return jams_utils.jams_converter(\n audio_path=self.audio_path,\n events=self.events,\n metadata={\n \"split\": self._clip_metadata.get(\"split\"),\n \"subdataset\": self._clip_metadata.get(\"subdataset\"),\n },\n...
[ "0.6043115", "0.6028612", "0.6020422", "0.595867", "0.5869286", "0.51103055", "0.48313457", "0.48313457", "0.4821683", "0.48106268", "0.47865143", "0.47502753", "0.47477722", "0.47190872", "0.4700809", "0.46956456", "0.46870407", "0.46566224", "0.4654095", "0.4651156", "0.463...
0.5316625
5
Add the contents of another jam to this object. Note that, by default, this method fails if file_metadata is not identical and raises a ValueError; either resolve this manually (because conflicts should almost never happen), force an 'overwrite', or tell the method to 'ignore' the metadata of the object being added.
def add(self, jam, on_conflict='fail'): if on_conflict not in ['overwrite', 'fail', 'ignore']: raise ParameterError("on_conflict='{}' is not in ['fail', " "'overwrite', 'ignore'].".format(on_conflict)) if not self.file_metadata == jam.file_metadata: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other):\r\n # Make a defaultdict of defaultdicts, the latter of which returns\r\n # None when an key is not present\r\n merged_data = defaultdict(lambda: defaultdict(lambda: None))\r\n\r\n # We will keep track of all unique sample_ids and metadata headers\r\n # ...
[ "0.6023381", "0.5716449", "0.5619332", "0.5605447", "0.5589624", "0.5504831", "0.54868376", "0.546581", "0.5444086", "0.54176193", "0.54172623", "0.53960514", "0.5354634", "0.52778107", "0.5238899", "0.52343297", "0.5198953", "0.5158326", "0.5157256", "0.51571655", "0.5131289...
0.649641
0
Serialize annotation as a JSON formatted stream to file.
def save(self, path_or_file, strict=True, fmt='auto'): self.validate(strict=strict) with _open(path_or_file, mode='w', fmt=fmt) as fdesc: json.dump(self.__json__, fdesc, indent=2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_annotations(self):\n fname = 'annotations'\n if self.split is not None:\n fname = 'annotations_{}'.format(self.split)\n fname = os.path.join(self.dest_folder, '{}.json'.format(fname))\n self.save(self.dataset, fname, \"annotations\")", "def _save_annotation(self, p...
[ "0.65512836", "0.65278125", "0.65025586", "0.63029265", "0.6299647", "0.628952", "0.61956006", "0.61616343", "0.60725665", "0.6022213", "0.6013489", "0.6011242", "0.5988493", "0.5966148", "0.5930022", "0.5913455", "0.59128827", "0.5912753", "0.590443", "0.590443", "0.58865786...
0.53753155
97
r"""Return the JObject as a set of native data types for serialization.
def __json_light__(self): filtered_dict = dict() for k, item in six.iteritems(self.__dict__): if k.startswith('_') or k == 'annotations': continue if hasattr(item, '__json__'): filtered_dict[k] = item.__json__ else: fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json(self) -> Union[dict, list, str, int, float]:\n raise NotImplementedError # pragma: no cover", "def data_types(self):", "def json(self) -> Dict[str, Union[List, Dict, str, int, float]]:", "def toJSType(self):\n return dict(\n name=self.name,\n description=self.des...
[ "0.6872278", "0.62380904", "0.6095021", "0.6073043", "0.6053912", "0.6046117", "0.6027797", "0.6000453", "0.58964735", "0.587078", "0.5852057", "0.5852057", "0.5848348", "0.58386344", "0.58100027", "0.58068883", "0.5797225", "0.5795872", "0.5778331", "0.57390094", "0.57096803...
0.0
-1
Main module execution method
def exec_module(self, **kwargs): for key in list(self.module_arg_spec.keys()) + ['tags']: if hasattr(self, key): setattr(self, key, kwargs[key]) elif kwargs[key] is not None: if key == "location": self.parameters["location"] = kwargs[k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\r\n pass", "def main():\n pass", "def main(self) -> None:\n pass", "def main():\n return", "def run():\n main()", "def main(self):", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def mai...
[ "0.80925983", "0.8029987", "0.80148256", "0.7824878", "0.78073204", "0.78043985", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", "0.77332145", ...
0.0
-1