query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Evaluate the NER model on the examples given.
def evaluate(ner_model, examples): # The Scorer computes and stores evaluation scores scorer = Scorer() for text, annotations in examples: # Process the text to get entities predicted document = ner_model.make_doc(text) correct_annotations = GoldParse(document, entities=annotations['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_model():\n\n # Get the processed data (in proper format to evaluate the NER model)\n data = get_json_from_file_path(PROCESSED_DATA_PATH)\n # Split the dataset for training and test as we did for training\n train_data, test_data = train_test_split(data, train_size=0.7, \n ...
[ "0.6644543", "0.6285906", "0.62076914", "0.61468154", "0.5994535", "0.59692717", "0.59335965", "0.58229786", "0.58054614", "0.5794374", "0.5765685", "0.5763517", "0.57432854", "0.5719396", "0.5703791", "0.56885344", "0.5686573", "0.56428343", "0.5631374", "0.5617793", "0.5611...
0.7269016
0
Return pointer value given pointer label
def _getPointerValue(self, pointerLabel): index = POINTER_LABEL_LIST.index(pointerLabel) return float(self._raw_data['POINTERS'][index])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pointer_value(pointer):\n return ct.cast(pointer, ct.c_void_p).value", "def _get_pointer(self) -> str:\n pointers = {1: \"THAT\", 0: \"THIS\"}\n try:\n return pointers[self.value]\n except KeyError:\n raise InvalidSegmentException(\n f\"Expecte...
[ "0.6980862", "0.65615785", "0.6370699", "0.62846607", "0.61790186", "0.59617084", "0.5798804", "0.5661203", "0.5612971", "0.5582321", "0.55821013", "0.5565275", "0.5552737", "0.5509971", "0.5504101", "0.54816645", "0.5463516", "0.5462277", "0.5452433", "0.5444844", "0.5442483...
0.70721763
0
Return a list of atomic masses in the system
def getMasses(self): try: return self._massList except AttributeError: self._massList = [float(x) for x in self._raw_data['MASS']] return self._massList
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mol_masses(mol):\n return np.array([a.GetMass() for a in mol.GetAtoms()])", "def list_masses(self):\n masses = self.contents['Sub_ID']\n for i in range(self.num_atom_types):\n masses = np.where(masses == i, float(self.masses[i]), masses)\n self.contents['Mass'] = masses...
[ "0.7253688", "0.7055852", "0.69788456", "0.68436766", "0.67790216", "0.6521679", "0.6353674", "0.63500553", "0.6138948", "0.6096922", "0.60727", "0.60612094", "0.60016483", "0.59859467", "0.59844255", "0.59775376", "0.5960306", "0.5930356", "0.5856117", "0.58186483", "0.58042...
0.7420046
0
Return the atom name for iAtom
def getAtomName(self, iAtom): atomNames = self.getAtomNames() return atomNames[iAtom]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def residueName(self,i):\n assert(i >= 0 and i < self.nAtoms())\n assert(self._c_structure is not NULL)\n return freesasa_structure_atom_res_name(self._c_structure,i)", "def atom(self, atom_name, resnum, chain_id, icode=' ', alt=' ', model_num=0):\n return self.struct[model_num][chain...
[ "0.70414406", "0.67510134", "0.6505652", "0.64932865", "0.6349202", "0.63090885", "0.6273081", "0.6271318", "0.6240153", "0.6228405", "0.6224214", "0.61911225", "0.61390066", "0.61277556", "0.6111768", "0.6108843", "0.6106719", "0.61022294", "0.6067352", "0.60657865", "0.6065...
0.88223165
0
Return the list of the system atom names
def getAtomNames(self): return self._raw_data['ATOM_NAME']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_system_keys(self) -> list[str]:\n return self.get(\"npc.systems\").keys()", "def get_system_managers(only_name: bool = False) -> list[str]:\n\tHasRole = DocType(\"Has Role\")\n\tUser = DocType(\"User\")\n\n\tif only_name:\n\t\tfields = [User.name]\n\telse:\n\t\tfields = [User.full_name, User.name]...
[ "0.6531567", "0.61736906", "0.61188096", "0.6103787", "0.6051859", "0.600426", "0.5983814", "0.5960197", "0.593975", "0.58576983", "0.58465", "0.5842698", "0.5842698", "0.5801767", "0.5748718", "0.5717563", "0.5702873", "0.56862754", "0.5666746", "0.5666746", "0.5654697", "...
0.6822885
0
Return the AMBER atom type for iAtom
def getAtomType(self, iAtom): atomTypes=self.getAtomTypes() return atomTypes[iAtom]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_atom_type(self, atom):\n if self.check_if_keyword(atom):\n # 1 for keyword\n return 1\n if self.check_if_var(atom):\n # 2 for identifier\n return 2\n if self.check_if_const(atom):\n # 3 for constant\n return 3\n i...
[ "0.7361625", "0.71134794", "0.6390988", "0.6096414", "0.60266525", "0.59143364", "0.5900974", "0.5879816", "0.5861368", "0.5848359", "0.58214134", "0.58087665", "0.576012", "0.57093835", "0.5701356", "0.5661256", "0.5641102", "0.5638334", "0.5619124", "0.5604778", "0.5604421"...
0.80560255
0
Return the list of the AMBER atom types
def getAtomTypes(self): return self._raw_data['AMBER_ATOM_TYPE']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_atypes(self):\n self.atypes = []\n self.hybs = []\n #self.zs = []\n for ai in self.m.GetAtoms():\n hybi = str( ai.GetHybridization() )\n self.hybs.append( hybi )\n zi = ai.GetAtomicNum()\n #self.zs.append( zi )\n si = ai.Get...
[ "0.7295159", "0.68550354", "0.6841875", "0.6571123", "0.6437429", "0.6416755", "0.6404617", "0.6334528", "0.6310776", "0.6259186", "0.6259186", "0.6229412", "0.6226737", "0.62120646", "0.62048405", "0.6127053", "0.60887516", "0.6074563", "0.60686255", "0.60447425", "0.6012904...
0.8205202
0
Return iAtom's residue number
def getResidueNumber(self, iAtom): return self._getResiduePointer(iAtom)+1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def residueNumber(self,i):\n assert(i >= 0 and i < self.nAtoms())\n assert(self._c_structure is not NULL)\n return freesasa_structure_atom_res_number(self._c_structure,i)", "def residueName(self,i):\n assert(i >= 0 and i < self.nAtoms())\n assert(self._c_structure is not NULL)\...
[ "0.84820133", "0.68570244", "0.6592199", "0.61061615", "0.60807073", "0.6075778", "0.59794825", "0.5964086", "0.59245735", "0.59171975", "0.5898385", "0.5881746", "0.5792914", "0.5792746", "0.57736784", "0.57659894", "0.56949157", "0.56466013", "0.560639", "0.5595741", "0.555...
0.8190536
1
Return residue label for iAtom OR iRes
def getResidueLabel(self, iAtom=None, iRes=None): if iRes is None and iAtom is None: raise Exception("only specify iRes or iAtom, not both") if iRes is not None and iAtom is not None: raise Exception("iRes or iAtom must be set") if iRes is not None: return sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getResidueLabel(self):\n residueLabel = self.getFlagData('RESIDUE_LABEL')\n residueLabel = map(str, residueLabel)\n if residueLabel[0] != residueLabel[0].upper():\n self.printWarn(\"residue label '%s' in '%s' is not all UPPERCASE\" %\n (residueLabel[0],...
[ "0.69392586", "0.68396", "0.65880954", "0.626143", "0.61504877", "0.59839684", "0.5865712", "0.5863954", "0.5814182", "0.5686845", "0.56801265", "0.5625831", "0.56091756", "0.55119324", "0.5510289", "0.5485855", "0.53934896", "0.5372719", "0.5372673", "0.53568137", "0.5353786...
0.78172517
0
Return list of all rVdw, epsilon pairs for each atom. If offdiagonal elements of the LennardJones A and B coefficient matrices are found, NbfixPresent exception is raised
def getNonbondTerms(self): if self._has_nbfix_terms: raise NbfixPresent('Off-diagonal Lennard-Jones elements found. ' 'Cannot determine LJ parameters for individual atoms.') try: return self._nonbondTerms except AttributeError: pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_all_params_from_kx(params):\r\n new_params = find_kzs(deepcopy(params))\r\n w = new_params['w']\r\n d_list = new_params['d_list']\r\n kx = new_params['kx']\r\n kz_list = new_params['kz_list']\r\n ex_list = new_params['ex_list']\r\n ez_list = new_params['ez_list']\r\n mu_list = new_...
[ "0.5617916", "0.540578", "0.53865945", "0.5325545", "0.52052456", "0.51788265", "0.51686805", "0.5112846", "0.508617", "0.5080375", "0.5077638", "0.50694567", "0.50590456", "0.50240624", "0.50136775", "0.49985772", "0.49803355", "0.49557477", "0.49493426", "0.49493426", "0.49...
0.6525174
0
Return number of CMAPs. Return 0 if CMAP does not exist
def getNumMaps(self): try: return self._numCMAP except AttributeError: pass flag = 'CMAP_COUNT' if flag not in self._raw_data and self.chamber: flag = 'CHARMM_CMAP_COUNT' if flag in self._raw_data: self._numCMAP = int(self._raw_data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_count(filename):\n f = open(filename, \"r+\")\n buf = mmap.mmap(f.fileno(), 0)\n lines = 0\n readline = buf.readline\n while readline():\n lines += 1\n return lines", "def len():\n if not CpuMap.arr:\n CpuMap.arr = CpuMap._cpus()\n return len(CpuMap.arr)"...
[ "0.6600952", "0.6299485", "0.6144771", "0.6009182", "0.6002554", "0.5962962", "0.59225476", "0.5918922", "0.59180444", "0.5889421", "0.5880783", "0.58007944", "0.5787575", "0.5780228", "0.57729685", "0.5754686", "0.57487535", "0.5747835", "0.5746384", "0.5744093", "0.5739804"...
0.75202054
0
Return CMAP resolution info. Return 0 if CMAP does not exist
def getCMAPResolutions(self): try: return self._cmapResolution except AttributeError: pass flag = 'CMAP_RESOLUTION' if flag not in self._raw_data and self.chamber: flag = 'CHARMM_CMAP_RESOLUTION' if flag in self._raw_data: self._cma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumMaps(self):\n try:\n return self._numCMAP\n except AttributeError:\n pass\n flag = 'CMAP_COUNT'\n if flag not in self._raw_data and self.chamber:\n flag = 'CHARMM_CMAP_COUNT'\n if flag in self._raw_data:\n self._numCMAP = int(...
[ "0.64817363", "0.5936191", "0.5852588", "0.56650823", "0.5629899", "0.55542696", "0.5476778", "0.54461724", "0.54426503", "0.5433428", "0.54026765", "0.5396244", "0.5388371", "0.53813756", "0.5373326", "0.53725666", "0.53344905", "0.5324073", "0.5314475", "0.5301652", "0.5289...
0.75949377
0
Return CMAP type, list of first four atoms, and list of second four atoms
def getCMAPDihedrals(self): try: return self._cmapList except AttributeError: pass flag = 'CMAP_INDEX' if flag not in self._raw_data and self.chamber: flag = 'CHARMM_CMAP_INDEX' cmapPointers = self._raw_data[flag] self._cmapList=[] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_carboxyl_map(atom_list):\n carboxyl_map = [[atom_list[x], atom_list[x+1], atom_list[x+2], atom_list[x+3]] for x in range(len(atom_list)-3) if ((atom_list[x].residue_name == atom_list[x+1].residue_name == atom_list[x+2].residue_name == atom_list[x+3].residue_name == \"C1A\") and (atom_list[x].residue_num...
[ "0.6316456", "0.5423948", "0.54129374", "0.5391436", "0.53679574", "0.52848315", "0.5265358", "0.5238747", "0.5222712", "0.52078694", "0.51621914", "0.5157384", "0.5152001", "0.51297927", "0.51236004", "0.5117469", "0.5099584", "0.5091966", "0.5074277", "0.5069184", "0.506480...
0.5589476
1
Return list of atom pairs, chargeProduct, rMin and epsilon for each 14 interaction
def get14Interactions(self): dihedralPointers = self._raw_data["DIHEDRALS_INC_HYDROGEN"] \ +self._raw_data["DIHEDRALS_WITHOUT_HYDROGEN"] returnList=[] charges=self.getCharges() length_conv = units.angstrom.conversion_factor_to(units.nanometers) ene_conv ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_charged_pairs(self):\n charges = [ ai.GetFormalCharge() for ai in self.m.GetAtoms() ]\n # search for the pairs of atoms with smarts like '[N+](=O)[O-]'\n patt = '[+1]~[-1]'\n q = Chem.MolFromSmarts(patt)\n cpairs = np.array( self.m.GetSubstructMatches(q) ).astype(np.int)\...
[ "0.55804133", "0.55528504", "0.55493754", "0.55289745", "0.5501587", "0.54684055", "0.5379743", "0.5365766", "0.5360747", "0.5359474", "0.5317505", "0.5289808", "0.52889115", "0.5276612", "0.5248068", "0.5214959", "0.5205706", "0.5186701", "0.51694226", "0.5148966", "0.514807...
0.6232562
0
Return periodic boundary box beta angle and dimensions
def getBoxBetaAndDimensions(self): beta=float(self._raw_data["BOX_DIMENSIONS"][0]) x=float(self._raw_data["BOX_DIMENSIONS"][1]) y=float(self._raw_data["BOX_DIMENSIONS"][2]) z=float(self._raw_data["BOX_DIMENSIONS"][3]) return (units.Quantity(beta, units.degree), un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beta(self):\n eTheta = self.eTheta()\n cosOmg = np.cos(self.omega())\n return self.a1()/c.c*(1-eTheta**2)**0.5*cosOmg", "def getBeta(self, alpha):\n return 2.0*(2.0-alpha) + -4.0*np.sqrt(1.0-alpha)", "def Bimat(self):\n a, b, c, alpha, beta, gamma = self.lattice_parameter...
[ "0.65462947", "0.6462211", "0.6127845", "0.6089902", "0.6024211", "0.59340787", "0.5925929", "0.5891913", "0.5888504", "0.58726263", "0.58666295", "0.58666295", "0.58666295", "0.58211255", "0.580363", "0.58013934", "0.5800614", "0.57164824", "0.57111526", "0.5701021", "0.5693...
0.70399827
0
Create an OpenMM System from an Amber prmtop file. REQUIRED ARGUMENT topology (forcefield.Topology) The topology for the system that is about to be created ARGUMENTS (specify one or the other, but not both) prmtop_filename (String) name of Amber prmtop file (newstyle only) prmtop_loader (PrmtopLoader) the loaded prmtop...
def readAmberSystem(topology, prmtop_filename=None, prmtop_loader=None, shake=None, gbmodel=None, soluteDielectric=1.0, solventDielectric=78.5, implicitSolventKappa=0.0*(1/units.nanometer), nonbondedCutoff=None, nonbondedMethod='NoCutoff', scee=None, scnb=None, mm=None, verbose=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_top(openff_sys: \"System\", file_path: Union[Path, str]):\n if isinstance(file_path, str):\n path = Path(file_path)\n if isinstance(file_path, Path):\n path = file_path\n\n with open(path, \"w\") as top_file:\n top_file.write(\"; Generated by OpenFF System\\n\")\n _write...
[ "0.5573243", "0.55360574", "0.53219885", "0.5308998", "0.5227083", "0.51333475", "0.5017997", "0.49888855", "0.49778077", "0.49404794", "0.4938319", "0.49289978", "0.48723698", "0.4865901", "0.48460186", "0.48352525", "0.4804288", "0.47721088", "0.474612", "0.47237206", "0.47...
0.7227145
0
Read atomic coordinates (and optionally, box vectors) from Amber formatted coordinate file. ARGUMENTS filename (string) name of Amber coordinates file to be read in OPTIONAL ARGUMENTS asNumpy (boolean) if True, results will be returned as Numpy arrays instead of lists of Vec3s RETURNS coordinates, velocities, boxVector...
def readAmberCoordinates(filename, asNumpy=False): try: crdfile = AmberNetcdfRestart(filename) except ImportError: # See if it's an ASCII file. If so, no need to complain try: crdfile = AmberAsciiRestart(filename) except TypeError: raise TypeError('Probl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coordinates_xyz(filename):\n\n f = open(filename, 'r')\n V = list()\n atoms = list()\n n_atoms = 0\n\n # Read the first line to obtain the number of atoms to read\n try:\n n_atoms = int(f.readline())\n except ValueError:\n print(\"Could not obtain the number of atoms in t...
[ "0.65199834", "0.6151185", "0.5955771", "0.5821698", "0.5642972", "0.55947125", "0.5586875", "0.5569145", "0.55424154", "0.55242324", "0.5440504", "0.5354222", "0.5305724", "0.5268994", "0.52577853", "0.5247618", "0.5231697", "0.5143245", "0.51137674", "0.5104983", "0.5052237...
0.82705474
0
Init new bag based on Dynamic Array DO NOT CHANGE THIS METHOD IN ANY WAY
def __init__(self, start_bag=None): self.da = DynamicArray() # populate bag with initial values (if provided) # before using this feature, implement add() method if start_bag is not None: for value in start_bag: self.add(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.bag = {}", "def __init__(self):\n self.da = DynamicArray()", "def __init__(self):\n self.da = DynamicArray()", "def __init__(self):\n self.da = DynamicArray()", "def __init__(self):\r\n self.da = DynamicArray()", "def bag(self, bag):\n ...
[ "0.7149582", "0.64862925", "0.64862925", "0.64862925", "0.6427819", "0.6324125", "0.6016864", "0.5974724", "0.58734715", "0.58185697", "0.5818552", "0.5756172", "0.5755289", "0.57449216", "0.5724783", "0.57152706", "0.57088006", "0.57087326", "0.5704826", "0.57008696", "0.570...
0.7376073
0
Empties bag by dereferencing the Dynamic Array
def clear(self) -> None: self.da = DynamicArray()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_bag(self):", "def clear(self) -> None:\n # Creates a new, empty bag and assigns self.da to the new, empty bag.\n new_bag = Bag()\n self.da = new_bag.da", "def clear(self):\n if self.size == 0:\n return\n self.modCount += 1\n self.size = 0\n ...
[ "0.69397724", "0.66944885", "0.6348022", "0.62654585", "0.62618214", "0.62593454", "0.62128514", "0.6195912", "0.6195912", "0.61813796", "0.61733335", "0.61612505", "0.61371595", "0.6111838", "0.6082362", "0.6075432", "0.60725045", "0.60725045", "0.6012886", "0.600536", "0.59...
0.7057705
0
Submit facebox hits from the training video url table to MTurk for QA
def submit_hits(self): # query all processed urls (TrainingVideoURL table) for boxes # create BoxHits for all boxes and submit hits to Mturk boxes = [] num_hits_submitted = 0 for url in session.query(VideoTrainingURL).filter_by(training_job_id = self.id, processed = False): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_embed_ok(self):\n self.go200('minus_upload')\n self.formfile('minus_upload', 'file', AUDIO_FILE)\n self.fv('minus_upload', 'id_embed_video', YOUTUBE_URL) \n self.submit200()\n self.notfind(\"Невірний\")\n self.show()\n self.find(\"youtube_video\")\n ...
[ "0.5325902", "0.52249277", "0.5168434", "0.51396066", "0.51172984", "0.51164895", "0.50506824", "0.50284046", "0.49790028", "0.49683398", "0.4964888", "0.49612203", "0.49269286", "0.49201757", "0.4912672", "0.48896024", "0.48839724", "0.48567656", "0.48537496", "0.48426962", ...
0.7386757
0
get status of outstanding Hits and unprocessed URLS for a training job
def _get_job_status(self): total_hits = session.query(BoxHit).filter_by(training_job_id=self.id).count() num_hits_left = session.query(BoxHit).filter_by(training_job_id=self.id, outstanding=True).count() total_urls = self.num_urls num_urls_left = session.query(VideoTrainingURL).filter_by...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_status(cls):\n for job in cls.query.filter(cls.finished == False):\n num_hits_left = session.query(BoxHit).filter_by(training_job_id = job.id, outstanding=True).count()\n urls_left = session.query(VideoTrainingURL).filter_by(training_job_id=job.id, processed = False)\n ...
[ "0.7707184", "0.63947445", "0.63776845", "0.6374783", "0.6318901", "0.63123906", "0.62420017", "0.6170347", "0.6152266", "0.6072089", "0.6031808", "0.6019294", "0.59752125", "0.59679496", "0.594853", "0.59385747", "0.59290457", "0.5922479", "0.5907669", "0.5902595", "0.588397...
0.7045921
1
Sets the allowed_processes of this RuntimeAntiMalwareRule.
def allowed_processes(self, allowed_processes): self._allowed_processes = allowed_processes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def denied_processes(self, denied_processes):\n\n self._denied_processes = denied_processes", "def _set_processes(self, processes: int = 1):\n self.__processes = processes", "def set_process_limits(): # pragma: no cover\n # Set a new session id so that this process and all its children w...
[ "0.6635991", "0.6162344", "0.5399079", "0.52147853", "0.50356615", "0.48677087", "0.48677087", "0.48211288", "0.48211288", "0.4768049", "0.4627171", "0.46265787", "0.45992205", "0.4593496", "0.45846242", "0.45787704", "0.45422518", "0.4504017", "0.45009166", "0.44671568", "0....
0.8159298
0
Sets the crypto_miner of this RuntimeAntiMalwareRule.
def crypto_miner(self, crypto_miner): self._crypto_miner = crypto_miner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetMiningMethod(self,miningMethod):\n self.theMiningSystem.miningMethod = miningMethod", "def setArmor(self, armor):\n self.av = armor", "def setCryptographicHandlers( self , tkip = None , aes = None ):\n\t\tself.handleTKIP = tkip\n\t\tself.handleAES \t= aes", "def set_encryption(key):\n g...
[ "0.50891584", "0.4544723", "0.45225394", "0.44707024", "0.43791777", "0.4358885", "0.43324634", "0.43239263", "0.429425", "0.42103016", "0.4189996", "0.41426286", "0.41291493", "0.41247395", "0.40786296", "0.40624338", "0.40478006", "0.40322292", "0.40299213", "0.4029869", "0...
0.7893291
0
Sets the custom_feed of this RuntimeAntiMalwareRule.
def custom_feed(self, custom_feed): self._custom_feed = custom_feed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intelligence_feed(self, intelligence_feed):\n\n self._intelligence_feed = intelligence_feed", "def custom(self, custom):\n self._context[\"custom\"] = custom", "def is_custom(self, is_custom):\n\n self._is_custom = is_custom", "def is_custom(self, is_custom):\n\n self._is_cust...
[ "0.54938793", "0.51673585", "0.5140491", "0.5140491", "0.5040152", "0.49456972", "0.48383343", "0.4757906", "0.47423247", "0.46796066", "0.46738562", "0.46644983", "0.45845363", "0.44624054", "0.44565436", "0.4375623", "0.437332", "0.437332", "0.43702433", "0.43596616", "0.43...
0.7653512
0
Sets the denied_processes of this RuntimeAntiMalwareRule.
def denied_processes(self, denied_processes): self._denied_processes = denied_processes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_processes(self, allowed_processes):\n\n self._allowed_processes = allowed_processes", "def _set_processes(self, processes: int = 1):\n self.__processes = processes", "def forbidden_processes(self):\n return {name for name, flag in self._required_processes.items() if not flag}",...
[ "0.67622226", "0.56745166", "0.5228589", "0.49396628", "0.47714043", "0.46959263", "0.46451238", "0.46282858", "0.46127596", "0.45595217", "0.45097315", "0.45039085", "0.44965488", "0.4474816", "0.44690263", "0.44690263", "0.44617447", "0.445545", "0.4427608", "0.44184902", "...
0.8523715
0
Sets the detect_compiler_generated_binary of this RuntimeAntiMalwareRule.
def detect_compiler_generated_binary(self, detect_compiler_generated_binary): self._detect_compiler_generated_binary = detect_compiler_generated_binary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compiler(self, target):\n self._check_target(target)\n return target.compiler or self._default_compiler", "def _set_default_compiler():\n ccompiler = new_compiler()\n customize_compiler(ccompiler)\n # xcrun wrapper must bring all args\n if ccompiler.compiler[0] == 'xcrun':\n ccompile...
[ "0.530806", "0.52711153", "0.50642806", "0.49096715", "0.4879422", "0.47851434", "0.47082952", "0.47038898", "0.46928558", "0.4621693", "0.46136343", "0.45942175", "0.4587293", "0.45800072", "0.45751333", "0.45120305", "0.44635862", "0.44575647", "0.44558978", "0.4375184", "0...
0.8249588
0
Sets the encrypted_binaries of this RuntimeAntiMalwareRule.
def encrypted_binaries(self, encrypted_binaries): self._encrypted_binaries = encrypted_binaries
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_binaries(self, *args, **kw):\n for arg in args:\n if isinstance(arg, dict):\n self._binaries.update(arg)\n self._binaries.update(kw)\n return self", "def with_binaries(self, *args, **kw):\r\n for arg in args:\r\n if isinstance(arg, dict):\r\n self._binaries.update(arg...
[ "0.54808533", "0.54465693", "0.49112743", "0.4622234", "0.44396767", "0.4362359", "0.42449024", "0.42383167", "0.41990164", "0.4191991", "0.4178983", "0.41608432", "0.4141621", "0.41358182", "0.41355053", "0.40910557", "0.40817374", "0.4080167", "0.40563214", "0.40544382", "0...
0.8090969
0
Sets the execution_flow_hijack of this RuntimeAntiMalwareRule.
def execution_flow_hijack(self, execution_flow_hijack): self._execution_flow_hijack = execution_flow_hijack
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flow(self, flow):\n\n self._flow = flow", "def update_flow(self, flow):\r\n self.flow = flow", "def action_flow(self, action_flow):\n\n self._action_flow = action_flow", "def set_mass_flow(self):\n self.exh.mdot_exp = self.exh.flow_array * self.exh.rho_array\n self.exh....
[ "0.56771505", "0.53746784", "0.5147958", "0.4890891", "0.4810104", "0.48073435", "0.47732478", "0.4772554", "0.47238106", "0.46238196", "0.461203", "0.45992157", "0.45734128", "0.45235664", "0.44804186", "0.44751072", "0.44331065", "0.442998", "0.44087604", "0.43752292", "0.4...
0.80146104
0
Sets the intelligence_feed of this RuntimeAntiMalwareRule.
def intelligence_feed(self, intelligence_feed): self._intelligence_feed = intelligence_feed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def microsoft_emerging_threat_feed(self) -> 'outputs.MSTIDataConnectorDataTypesResponseMicrosoftEmergingThreatFeed':\n return pulumi.get(self, \"microsoft_emerging_threat_feed\")", "def feed(self):\n # or intelligence discard\n pass", "def exempt_feed_retroactive(db, c, feed_uid, **kwargs)...
[ "0.5143359", "0.4976248", "0.49088368", "0.4797253", "0.4771624", "0.4526682", "0.44206625", "0.43195665", "0.4269245", "0.4269245", "0.4240957", "0.4240386", "0.41880623", "0.4182926", "0.41601658", "0.41359985", "0.41315413", "0.41298312", "0.4120521", "0.40738678", "0.4046...
0.7596608
0
Sets the reverse_shell of this RuntimeAntiMalwareRule.
def reverse_shell(self, reverse_shell): self._reverse_shell = reverse_shell
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_reverse(rev):\n global is_reverse\n is_reverse = rev", "def reverse(self):\n self.command.append(\"reverse\")\n return self", "def autodefined_reverse_flag(self) -> pulumi.Input['ResolverConfigAutodefinedReverseFlag']:\n return pulumi.get(self, \"autodefined_reverse_flag\")",...
[ "0.539246", "0.51156425", "0.50046355", "0.48777938", "0.4789494", "0.4750256", "0.47339043", "0.46712825", "0.46478534", "0.46473414", "0.46026647", "0.45961767", "0.4544838", "0.45404893", "0.45341587", "0.4533405", "0.4475226", "0.44358587", "0.44093126", "0.436193", "0.43...
0.8084292
0
Sets the service_unknown_origin_binary of this RuntimeAntiMalwareRule.
def service_unknown_origin_binary(self, service_unknown_origin_binary): self._service_unknown_origin_binary = service_unknown_origin_binary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_unknown_origin_binary(self, user_unknown_origin_binary):\n\n self._user_unknown_origin_binary = user_unknown_origin_binary", "def set_as_not_handled(self):\n if self.type == MessageTypes.AGENT:\n raise InvalidMessageTypeError(\n 'Cannot set not_handled as True whe...
[ "0.7573631", "0.46184886", "0.46148548", "0.44912875", "0.44772303", "0.44517532", "0.44046047", "0.43538424", "0.43421948", "0.43409202", "0.43242526", "0.43002045", "0.4295388", "0.42937005", "0.42800286", "0.42621157", "0.4238971", "0.4207718", "0.42001417", "0.41846082", ...
0.86087584
0
Sets the skip_ssh_tracking of this RuntimeAntiMalwareRule.
def skip_ssh_tracking(self, skip_ssh_tracking): self._skip_ssh_tracking = skip_ssh_tracking
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_suppress_flow(self):\n self.suppressed = self.packet_count\n self.fcip.update_one({'hash': self.fcip_hash},\n {'$set': {'suppressed': self.suppressed},})", "def set_skip_current_track(self):\n self.get(COMMAND_CPM, 'SetSkipCurrentTrack')", "def ssh_tu...
[ "0.52679175", "0.51133686", "0.50047815", "0.49796999", "0.49359134", "0.48416126", "0.47192234", "0.4642725", "0.46380436", "0.4610448", "0.454691", "0.45164886", "0.44933212", "0.44694534", "0.44682866", "0.4461396", "0.44300166", "0.44300166", "0.44300166", "0.4425383", "0...
0.83099043
0
Sets the suspicious_elf_headers of this RuntimeAntiMalwareRule.
def suspicious_elf_headers(self, suspicious_elf_headers): self._suspicious_elf_headers = suspicious_elf_headers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elf_images_some(self, elf_images_some):\n\n self._elf_images_some = elf_images_some", "def allow_headers(self, allow_headers):\n\n self._allow_headers = allow_headers", "def _enforce_user_agent(headers: dict) -> dict:\n headers.update(SYNAPSE_USER_AGENT_HEADER)\n return headers", "def...
[ "0.484491", "0.47857866", "0.4715581", "0.46925652", "0.46410558", "0.46366873", "0.46366873", "0.46242186", "0.46089914", "0.4551534", "0.45476323", "0.45103273", "0.4486765", "0.4470622", "0.43418282", "0.43411455", "0.42955545", "0.42435467", "0.42423066", "0.42370942", "0...
0.86457044
0
Sets the temp_fs_proc of this RuntimeAntiMalwareRule.
def temp_fs_proc(self, temp_fs_proc): self._temp_fs_proc = temp_fs_proc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_temp_file(self):\n\n index = self.filename.rfind('/') + 1\n self.temp_filename = self.filename[:index] + \"tmp_\" + self.filename[index:]", "def fill_stat(self, fs=None, **options):\n self.filestat = StatTuple(fs=fs, **options)", "def _register_temporary_file(self):\n _parti...
[ "0.55050707", "0.48121423", "0.47581938", "0.47221127", "0.46554834", "0.46197382", "0.46076837", "0.4597256", "0.45485073", "0.4537833", "0.44469118", "0.44351405", "0.44220942", "0.43939075", "0.43752405", "0.4364896", "0.4347796", "0.43418652", "0.4332066", "0.4307438", "0...
0.8137083
0
Sets the user_unknown_origin_binary of this RuntimeAntiMalwareRule.
def user_unknown_origin_binary(self, user_unknown_origin_binary): self._user_unknown_origin_binary = user_unknown_origin_binary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_unknown_origin_binary(self, service_unknown_origin_binary):\n\n self._service_unknown_origin_binary = service_unknown_origin_binary", "def set_unknown_user(self):\n self.objects[self.ids.TOPBAR].setText(\"User: <Unknown card>\")", "def set_as_not_handled(self):\n if self.type =...
[ "0.7047199", "0.5043389", "0.47182634", "0.46471974", "0.45888796", "0.45770887", "0.45130247", "0.45042887", "0.4406569", "0.44012833", "0.43978664", "0.43925205", "0.433955", "0.43356243", "0.42788303", "0.42750442", "0.42617148", "0.42207563", "0.4216584", "0.4216363", "0....
0.8767857
0
Sets the web_shell of this RuntimeAntiMalwareRule.
def web_shell(self, web_shell): self._web_shell = web_shell
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shell(self, shell):\n\n self._shell = shell", "def reverse_shell(self, reverse_shell):\n\n self._reverse_shell = reverse_shell", "def use_shell(self, shell):\n return ShellContext(self, shell)", "def use_shell(self):\n return self._shell", "def set(self, shell=None):\n\n ...
[ "0.5257477", "0.50713885", "0.5045325", "0.50029993", "0.49303526", "0.4911177", "0.47862864", "0.47516662", "0.47228616", "0.47115886", "0.46809548", "0.46645325", "0.46355623", "0.4607884", "0.45009336", "0.44623724", "0.44550326", "0.4440212", "0.44241655", "0.44138148", "...
0.76740456
0
Sets the wild_fire_analysis of this RuntimeAntiMalwareRule.
def wild_fire_analysis(self, wild_fire_analysis): self._wild_fire_analysis = wild_fire_analysis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tax_analysis(self, tax_analysis):\n\n self._tax_analysis = tax_analysis", "def wildtype(self, wildtype):\n self._wildtype = wildtype\n self.add_binary()", "def set_suppress_flow(self):\n self.suppressed = self.packet_count\n self.fcip.update_one({'hash': self.fcip_hash},\...
[ "0.4805896", "0.47317153", "0.46334144", "0.45518073", "0.45493808", "0.45445997", "0.4506532", "0.4447285", "0.44388187", "0.43485162", "0.43185204", "0.4318399", "0.4295372", "0.42945984", "0.42902604", "0.42520434", "0.42520025", "0.42445207", "0.42425737", "0.4240613", "0...
0.8094492
0
Find and attach everything in the scene which has an oceanHeightHook attribute to the ocean
def connectAllWithOceanHeightAttr(object = ''): inprogressBar = pbui.ProgressBarUI(title = 'Hooking To Ocean:') inprogressBar.show() inprogressBar.updateProgress(percent = 0, doingWhat = 'Hooking everything to ocean now...') debug(None, method = 'connectAllWithOceanHeightAttr', message = 'Rebuilding Ocean Hooks', v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self):\n new_nodes_to_update = {}\n nodes_to_update = {}\n\n for agent_id in self.cameras.keys():\n nodes_to_update[agent_id] = []\n new_nodes_to_update[agent_id] = []\n if agent_id not in self.beliefs:\n world_name = self.cameras[agen...
[ "0.49975762", "0.49543297", "0.4924213", "0.4898339", "0.47883928", "0.4763674", "0.4763674", "0.4763674", "0.47636473", "0.47518608", "0.46925193", "0.4639078", "0.45988846", "0.45873675", "0.4581882", "0.45816454", "0.45418066", "0.45392635", "0.4534433", "0.45265785", "0.4...
0.6640332
0
Tries to cast a value to a Python timedeltaobject. It supports datetime, time and nicely formatted strings. It will return timedelta(0) in case it fails.
def to_timedelta(value) -> timedelta: # For values >=24hrs, Pandas converts them to a datetime object. # For values <24hrs, Pandas converts them to time object. if isinstance(value, timedelta): return value elif isinstance(value, datetime): return value - datetime(1900, 1, 1) + timedelt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_timedelta(obj: \"Any\") -> \"timedelta\":\n if obj is None:\n raise ValueError(\"obj cannot be None\")\n if isinstance(obj, timedelta):\n return obj\n elif isinstance(obj, (int, float)):\n return timedelta(seconds=obj)\n elif isinstance(obj, Decimal):\n return timedel...
[ "0.7840131", "0.7054532", "0.67763466", "0.677437", "0.67289245", "0.66318434", "0.65796596", "0.638643", "0.63777906", "0.62535816", "0.62382054", "0.6190961", "0.6165697", "0.6086364", "0.60375947", "0.5968157", "0.595131", "0.593763", "0.5933334", "0.5932459", "0.58310056"...
0.74394506
1
Sets microseconds of a timedeltaobject to 0.
def td_remove_microseconds(td: timedelta) -> timedelta: try: return td - timedelta(microseconds=td.microseconds) except ValueError: logging.warning( "There was an error removing the microseconds from a" f" timedelta object. The object was {td}." ) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_microseconds(value):\n return _UTC_EPOCH + datetime.timedelta(microseconds=value)", "def changenonetotimedeltazero(s): \r\n if s=='None' or s is None: \r\n return pd.Timedelta(0)\r\n else:\r\n return s", "def clear_time_override():\r\n utcnow.override_time = None", "def...
[ "0.60122955", "0.58582336", "0.5800418", "0.5604118", "0.55773675", "0.5552772", "0.54199773", "0.5383407", "0.53719836", "0.52956426", "0.5292495", "0.52892756", "0.5240672", "0.521666", "0.5192984", "0.5188158", "0.51750684", "0.5170097", "0.5154471", "0.5137825", "0.513755...
0.6468977
0
Permutate a mesh, record the maximum it deviates from the original mesh and the resulting value of an identifier function.
def permutations(mesh, function=lambda x: x.identifier, displacement_max=1e-8, count=1000, subdivisions=2, cutoff=3600): identifiers = [] start = time.time() # do subdivisions divided = [mesh.copy()] f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identifier_simple(mesh):\n # verify the cache once\n mesh._cache.verify()\n\n # don't check hashes during identifier as we aren't\n # changing any data values of the mesh inside block\n # if we did change values in cache block things would break\n with mesh._cache:\n # pre-allocate ide...
[ "0.5798947", "0.5716331", "0.55502725", "0.55502725", "0.55502725", "0.5410889", "0.53264076", "0.52080476", "0.5147973", "0.51004106", "0.5062747", "0.50544333", "0.49495655", "0.49182805", "0.49177897", "0.49008822", "0.4881483", "0.4853714", "0.48349267", "0.4832497", "0.4...
0.5895573
0
Get a list of single body meshes to test identifiers on.
def get_meshes(path='../../../models', cutoff=None): bodies = collections.deque() for file_name in os.listdir(path): try: mesh = trimesh.load(os.path.join(path, file_name)) split = mesh.split() bodies.extend(split) if len(split) > 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mesh_ids(self, body):\n with self.lock:\n return self.send_command('get_kinbody_link_mesh_ids ' + body.GetName())", "def collectionMeshes(collection):\n return [o for o in collection.all_objects if o.type == 'MESH']", "def filter_legislative_bodies(self):\n return self.filte...
[ "0.73483276", "0.5918279", "0.57549536", "0.5689863", "0.5679754", "0.56532514", "0.56160617", "0.56097174", "0.54366004", "0.5387349", "0.5338473", "0.5329637", "0.52505124", "0.5202831", "0.5134976", "0.51091045", "0.5063652", "0.5014104", "0.4995707", "0.49625397", "0.4910...
0.59325
1
Encrypt text with the given key. key > any string with length smaller than or equal to 16 text > the data to encrypt, as a string Returns an array of bytes.
def encrypt(key, text): key = _key_array(key) text = _text_array(text) aes = mxit.aes.AES() parts = _split(text, 16) encoded = [] for part in parts: encoded += aes.encrypt(part, key, aes.keySize["SIZE_128"]) return encoded
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(text, key):\n encrypted = []\n for i in text:\n encrypted.append(key[i])\n return encrypted", "def encrypt_key(data, key):\n data = MegaCrypto.base64_decode(data)\n return sum((MegaCrypto.str_to_a32(MegaCrypto.cbc_encrypt(data[_i:_i + 16], key))\n for _...
[ "0.70797527", "0.6840706", "0.6558892", "0.64273185", "0.64126307", "0.6379325", "0.6335545", "0.6279772", "0.62030673", "0.6136716", "0.61286926", "0.61280227", "0.6042837", "0.5989007", "0.59492034", "0.5916038", "0.5902616", "0.5860912", "0.5793804", "0.57515836", "0.56915...
0.72668356
0
For a graph represented by its adjacency matrix A, computes the cooccurence matrix by random surfing on the graph with returns. 1alpha is the probability to make, at each step, a return to the original step.
def PCO(A, K, alpha): A=np.array(A, dtype=float) #The adjacency matrix A is first normalized A=normalize(A) n=A.shape[0] I=np.eye(n) P=I M=np.zeros((n, n)) for i in range(K): P = alpha*np.dot(P,A) + (1-alpha)*I M = M+P return(M)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conductance_matrix(A):\n if issparse(A):\n G = nx.from_scipy_sparse_matrix(A)\n else:\n G = nx.from_numpy_matrix(A)\n subgraphC = []\n for subgraph in nx.connected_component_subgraphs(G):\n a_sub = nx.adjacency_matrix(subgraph)\n r_sub = resistance_matrix(a_sub)\n ...
[ "0.6241756", "0.600505", "0.59761393", "0.59632105", "0.58276546", "0.58211476", "0.57884556", "0.5777621", "0.5756752", "0.56359476", "0.55702484", "0.5567716", "0.55158526", "0.54752773", "0.54675233", "0.5442799", "0.54157084", "0.54124737", "0.53701353", "0.53666514", "0....
0.6560323
0
Reverse lines of old file into new file
def reverse(old, new): infile = open(old, "r") xs = infile.readlines() # Turn lines of old file into a list infile.close() xs.reverse() # Reverse this list outfile = open(new, "w") for i in xs: outfile.write(i) # Write a line-at-a-time at reversed list outfile.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_lines(file1, file2):\n with open(file1) as input, open(file2, 'w') as output:\n for word in input:\n word.rstrip() #to remove the newline character at the end\n word1 = word[::-1]\n output.write(f'{word1}\\n')\n print(word1)", "def reverse_file(fi...
[ "0.75387704", "0.7520648", "0.6905407", "0.6788678", "0.67051935", "0.6465679", "0.6307585", "0.61510444", "0.60499054", "0.57435423", "0.57397157", "0.5700939", "0.5695171", "0.56869304", "0.55833876", "0.5526218", "0.55017537", "0.5463649", "0.54575527", "0.5442164", "0.542...
0.8367213
0
Player's age in given year (or currentyear)
def age(self, year=None): y, m = self.master['birthYear'], self.master['birthMonth'] return (year if year else self.currentyear) - y - (m > 6)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age(self):\n return CURRENT_YEAR - self.year", "def get_age(self):\n return CURRENT_YEAR - self.year", "def get_age(self):\n age = CURRENT_YEAR - self.year\n return age", "def get_age(self):\n return int(CURRENT_YEAR[:4]) - self.year # String-slice only the year", ...
[ "0.79131144", "0.79131144", "0.78705555", "0.7868375", "0.78410995", "0.7790479", "0.776395", "0.7680984", "0.7429875", "0.7400296", "0.73505896", "0.72571224", "0.72172093", "0.71441853", "0.7121638", "0.70939815", "0.6984901", "0.6898371", "0.68906313", "0.68311346", "0.678...
0.83400005
0
Block/unblock users from following/commenting/liking another user's posts
def block_user(user_id): if not g.user: flash("Access unauthorized.", "danger") return redirect("/") user = User.query.get_or_404(user_id) users_blocking = [block.user_blocking_id for block in Blocks.query.all() if block.user_being_blocked_id == g.user.id] likes = [message for message ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def block_uid(self, uid):", "def unlike(self, request, pk=None):\n\n user_wall_post = self.get_object()\n user_wall_post.likes.remove(self.request.user)\n return Response(status=201)", "def unlike(self, data_base, user):\n cursor = data_base.cursor()\n cursor.execute(f\"UPDAT...
[ "0.64359105", "0.63649625", "0.6310728", "0.62724555", "0.6253589", "0.61984795", "0.6175689", "0.61384624", "0.6075013", "0.6074085", "0.6063862", "0.6048989", "0.59944564", "0.5955434", "0.5939078", "0.59326166", "0.58704615", "0.5840826", "0.5819313", "0.58187544", "0.5817...
0.6597587
0
Have currentlyloggedinuser stop blocking this user.
def stop_blocking(block_id): if not g.user: flash("Access unauthorized.", "danger") return redirect("/") blocked_user = User.query.get_or_404(block_id) g.user.blocked_users.remove(blocked_user) db.session.commit() return redirect(f"/users/{g.user.id}/blocked-users")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_user(self):\n self.currentuser = None\n self.carlocked = False", "def unblock(self):\n self.failed_logins = 0\n self.blocked = False", "def deactivate_user(self, user):\n if user.active:\n user.active = False\n return True\n return Fals...
[ "0.66507185", "0.6560793", "0.6545891", "0.64561146", "0.63917685", "0.631987", "0.61726075", "0.6152056", "0.6083656", "0.6043075", "0.6001118", "0.5989291", "0.5986588", "0.5967347", "0.59479684", "0.5893107", "0.5890102", "0.58710134", "0.586824", "0.586824", "0.586824", ...
0.692223
0
Include only representative combos from the matrix of the two lists making sure that each of the elements contributing is present at least once.
def representative_combos(list_1: list[str], list_2: list[str]) -> list[tuple[str, str]]: all_selected_combinations: list[tuple[str, str]] = [] for i in range(max(len(list_1), len(list_2))): all_selected_combinations.append((list_1[i % len(list_1)], list_2[i % len(list_2)])) return all_selected_comb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def excluded_combos(list_1: list[str], list_2: list[str]) -> list[tuple[str, str]]:\n all_combos: list[tuple[str, str]] = []\n for item_1 in list_1:\n for item_2 in list_2:\n all_combos.append((item_1, item_2))\n return [item for item in all_combos if item not in set(representative_combo...
[ "0.6463747", "0.6072654", "0.6063343", "0.5942452", "0.5933756", "0.59013903", "0.58814776", "0.58771676", "0.5853014", "0.5846436", "0.58372587", "0.5833355", "0.5817443", "0.5816979", "0.5809175", "0.57999456", "0.5792333", "0.5792333", "0.57877153", "0.5774353", "0.5765378...
0.6188967
1
Return exclusion lists of elements that should be excluded from the matrix of the two list of items if what's left should be representative list of combos (i.e. each item from both lists, has to be present at least once in the combos).
def excluded_combos(list_1: list[str], list_2: list[str]) -> list[tuple[str, str]]: all_combos: list[tuple[str, str]] = [] for item_1 in list_1: for item_2 in list_2: all_combos.append((item_1, item_2)) return [item for item in all_combos if item not in set(representative_combos(list_1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __sub__(self, vs):\n return [v for v in self.__elements if tuple(v) not in map(tuple, vs)]", "def set_difference(lst1, lst2):\n elements = []\n indicies = []\n for indx, item in enumerate(lst1):\n if item not in lst2:\n elements.append(item)\n indicies.append(indx...
[ "0.62029153", "0.60917294", "0.6032032", "0.5976475", "0.5959076", "0.59407663", "0.59237903", "0.59000987", "0.5852017", "0.5805686", "0.57930046", "0.57798666", "0.57722604", "0.57628405", "0.57605445", "0.57564837", "0.5749208", "0.5745465", "0.5721658", "0.5686724", "0.56...
0.76312757
0
Load event property file picks for a given experiment number and return that data as an array
def load_event_properties(experiment): return np.loadtxt('../Slip_Property_Data/%s_event_properties.txt'%experiment,delimiter=',',skiprows=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_events(experiment):\n event_properties = load_event_properties(experiment)\n blacklist = load_blacklist(experiment)\n return np.delete(event_properties,blacklist,axis=0)", "def load_events(experiment):\n event_properties = load_event_properties(experiment)\n blacklist = load_blacklist(exp...
[ "0.63500786", "0.63500786", "0.54971594", "0.5481163", "0.5479993", "0.54658467", "0.54637396", "0.5439347", "0.5426198", "0.53566355", "0.53481495", "0.53481495", "0.5347761", "0.5314206", "0.5293709", "0.5277644", "0.5244304", "0.5231523", "0.52066195", "0.51659846", "0.514...
0.8261329
0
Load event numbers from the blacklist file for each experiment and return them as an array
def load_blacklist(experiment): blacklist = np.loadtxt('../Slip_Property_Data/%s_blacklist.txt'%experiment) return blacklist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_events(experiment):\n event_properties = load_event_properties(experiment)\n blacklist = load_blacklist(experiment)\n return np.delete(event_properties,blacklist,axis=0)", "def load_events(experiment):\n event_properties = load_event_properties(experiment)\n blacklist = load_blacklist(exp...
[ "0.660259", "0.660259", "0.6048789", "0.57697254", "0.5728082", "0.56975484", "0.5672603", "0.5634948", "0.56291896", "0.5584334", "0.557808", "0.5545715", "0.5494566", "0.54839736", "0.5439858", "0.5413065", "0.5389082", "0.5352533", "0.5331738", "0.52484757", "0.5247818", ...
0.71201795
0
Loads all events from a given experiment that are not on the blacklist file for that experiment. Returns array of event properties.
def load_events(experiment): event_properties = load_event_properties(experiment) blacklist = load_blacklist(experiment) return np.delete(event_properties,blacklist,axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_blacklist(experiment):\n blacklist = np.loadtxt('../Slip_Property_Data/%s_blacklist.txt'%experiment)\n return blacklist", "def load_blacklist(experiment):\n blacklist = np.loadtxt('../Slip_Property_Data/%s_blacklist.txt'%experiment)\n return blacklist", "def load_event_properties(experimen...
[ "0.6039847", "0.6039847", "0.59158844", "0.59158844", "0.5699845", "0.52346635", "0.51764226", "0.51480323", "0.5146169", "0.5146137", "0.51326334", "0.5104683", "0.50849926", "0.50769466", "0.5074125", "0.50419056", "0.5038742", "0.5038058", "0.5028962", "0.5018109", "0.4980...
0.8164338
0
Take array, filter out rows in which the element in the given column is not in the range lowhigh (inclusive)
def filter(data,col,low,high): inds = np.where(data[:,col]>=low) data_trim = data[inds] inds = np.where(data_trim[:,col]<=high) data_trim = data_trim[inds] return data_trim
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_out_of_bounds(self, data, low_bound, high_bound):\n data = data.dropna()\n data = data[(data > low_bound).all(axis=1) & (data < high_bound).all(axis=1)] \n return data", "def isolate_burned_pixels(array, upper, lower):\n not_burned = numpy.logical_or(array <= lower,\n ...
[ "0.6622279", "0.62409604", "0.62121946", "0.60105443", "0.5949661", "0.5949454", "0.58782387", "0.5841053", "0.57375765", "0.5733186", "0.5720308", "0.5711006", "0.5705007", "0.56055427", "0.5593223", "0.5579824", "0.5573033", "0.556831", "0.55604434", "0.5549569", "0.5492338...
0.74447274
0
Create a storage group template. The new storage group will be associated with the CPC identified by the `cpcuri` input property.
def create(self, properties): if properties is None: properties = {} result = self.session.post(self._base_uri, body=properties) # There should not be overlaps, but just in case there are, the # returned props should overwrite the input props: props = copy.deepcopy(p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capacitygroup_create(cmd_ctx, cpc, **options):\n cmd_ctx.execute_cmd(\n lambda: cmd_capacitygroup_create(cmd_ctx, cpc, options))", "def add_storage_group1(self):\n\n faked_storage_group = self.faked_console.storage_groups.add({\n 'object-id': SG1_OID,\n # object-uri wil...
[ "0.65889084", "0.5891975", "0.5885409", "0.58008415", "0.5717402", "0.55526215", "0.5502991", "0.5459517", "0.5453945", "0.53172046", "0.53113604", "0.5268771", "0.5266061", "0.5265724", "0.5209222", "0.5186905", "0.51733065", "0.5149206", "0.5142596", "0.51349574", "0.510072...
0.635483
1
Adds the given log string to the database
def add_log_entry_string(self, logstring): parsed = self.parse_log_entry(logstring) self.add_log_entry(parsed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_db(self, loglines):\n self.database = self.database.append(loglines, ignore_index=True)", "def InsertLog():", "def add_log(self, log):\n try:\n if log.name in self.existing_logs:\n raise Exception(\"A log with the name already exists\")\n # if len(l...
[ "0.74086714", "0.6943016", "0.67869294", "0.6622376", "0.64174575", "0.64174575", "0.6402143", "0.630372", "0.62612665", "0.620834", "0.61886513", "0.6175429", "0.61297804", "0.61234784", "0.61194706", "0.61027837", "0.60944754", "0.60650307", "0.6048371", "0.60200405", "0.59...
0.7881291
0
parses the given logstring into MAC source, MAC dest, IP source, IP dest, IP source, IP dest, timestamp
def parse_log_entry(self, logstring): splitLogInfo = logstring.partition(self.LOGFILE_PREFIX) if len(splitLogInfo[1]) == 0: raise errorhandler.LogDatabaseError("separator {} not found in log entry".format(self.LOGFILE_PREFIX)) str2 = splitLogInfo[2] entrytype = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parseMonitorLog(log_file, attack_props):\n if not os.path.exists(log_file):\n return\n report = open(log_file, 'r')\n lines = report.readlines()\n #print lines\n report.close()\n \n readingStations = False\n readingAps = False\n for line in lines:\n line = line.strip()\...
[ "0.64265484", "0.59902716", "0.5971159", "0.57045716", "0.5659824", "0.5659817", "0.5655153", "0.5649358", "0.56467295", "0.5573839", "0.55555034", "0.5528865", "0.55214393", "0.5519047", "0.55149513", "0.5511338", "0.54538894", "0.5397081", "0.5387243", "0.5363179", "0.53597...
0.7670208
0
Set speed limit of servo on a given channel.
def servo_set_speed_limit(ch, speed): # Check to make sure speed is in range speed = max(speed, speed_limit_min) speed = min(speed, speed_limit_max) # Send command to servo controller servo_send_cmd(cmd_set_speed, ch, speed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servo_set_speed_limit(ch, accel):\n\n # Check to make sure speed is in range\n speed = max(accel, accel_limit_min)\n speed = min(accel, accel_limit_max)\n\n # Send command to servo controller\n servo_send_cmd(cmd_set_accel, ch, accel)", "def set_param_motor():\n servo.setSpeed(0, 0) # ma...
[ "0.8116307", "0.7313522", "0.6900925", "0.68464", "0.683779", "0.6770115", "0.6756657", "0.6677769", "0.6668522", "0.6620393", "0.66193795", "0.6602939", "0.65876895", "0.6579509", "0.65753126", "0.6565928", "0.6559673", "0.6551852", "0.6544445", "0.6532947", "0.6528034", "...
0.8289777
0
Set accel limit of servo on a given channel.
def servo_set_speed_limit(ch, accel): # Check to make sure speed is in range speed = max(accel, accel_limit_min) speed = min(accel, accel_limit_max) # Send command to servo controller servo_send_cmd(cmd_set_accel, ch, accel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_param_motor():\n servo.setSpeed(0, 0) # max = 255\n servo.setAccel(0, 0)\n servo.setSpeed(1, 150) # max = 255\n servo.setAccel(1, 150)", "def servo_set_speed_limit(ch, speed):\n\n # Check to make sure speed is in range\n speed = max(speed, speed_limit_min)\n speed = min(speed, ...
[ "0.6756529", "0.66715246", "0.6317015", "0.6237403", "0.6211317", "0.6124698", "0.6102591", "0.6064866", "0.60071737", "0.5985983", "0.59721977", "0.59433496", "0.5912166", "0.5886724", "0.58355105", "0.5830066", "0.58292514", "0.58101195", "0.577613", "0.577541", "0.57703537...
0.7922705
0
Looks up or creates the gsutil tracker file directory. This is the configured directory where gsutil keeps its resumable transfer tracker files. This function creates it if it doesn't already exist.
def CreateTrackerDirIfNeeded(): tracker_dir = config.get( 'GSUtil', 'resumable_tracker_dir', os.path.join(GetGsutilStateDir(), 'tracker-files')) CreateDirIfNeeded(tracker_dir) return tracker_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_directory(tracking_id):\n upload_path = os.path.join(app.config['DRS_UPLOADS'], '{0}'.format(tracking_id))\n if not os.path.isdir(upload_path):\n os.mkdir(upload_path)", "def create_base_temp_dir(cls):\n if cls._thread_local.state.temp_dirs:\n base_temp_dir = os.path.j...
[ "0.5943972", "0.5766383", "0.57206106", "0.57040995", "0.5617084", "0.5609605", "0.5540115", "0.5536164", "0.55042833", "0.5486796", "0.5483267", "0.54412764", "0.54346126", "0.54261184", "0.5397497", "0.53728074", "0.5369626", "0.5355074", "0.534489", "0.5343588", "0.5302992...
0.827229
0
Creates an MD5 hex digest of the parameters for a rewrite call. Resuming rewrites requires that the input parameters are identical. Thus, the rewrite tracker file needs to represent the input parameters. For easy comparison, hash the input values. If a user does a performs a samesource/samedestination rewrite via a dif...
def HashRewriteParameters( src_obj_metadata, dst_obj_metadata, projection, src_generation=None, gen_match=None, meta_gen_match=None, canned_acl=None, fields=None, max_bytes_per_call=None): if (not src_obj_metadata or not src_obj_metadata.bucket or not src_obj_metadata.name or not src_obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_hash(*args):\n key = bytes(' '.join(args), 'utf_8')\n hashh = hashlib.md5()\n hashh.update(key)\n return hashh.hexdigest()", "def MD5(self) -> _n_0_t_3[_n_0_t_9]:", "def hash_args(self, args, secret=None):\n for a in args:\n if isinstance(args[a], list): args[a] = jso...
[ "0.5853579", "0.58514607", "0.5819284", "0.5770626", "0.5658538", "0.55982107", "0.5581722", "0.55005234", "0.5434314", "0.54289603", "0.5340615", "0.53380597", "0.53380597", "0.53380597", "0.53380597", "0.53380597", "0.53380597", "0.53021276", "0.5255513", "0.52426136", "0.5...
0.693234
0
Attempts to read a rewrite tracker file.
def ReadRewriteTrackerFile(tracker_file_name, rewrite_params_hash): # Check to see if we already have a matching tracker file. tracker_file = None if not rewrite_params_hash: return try: tracker_file = open(tracker_file_name, 'r') existing_hash = tracker_file.readline().rstrip('\n') if existing_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(path):", "def read(self, filename):\n pass", "def read(self, filename):\n pass", "def read_from_file(self, filename: str) -> None:", "def read_file(self):\n try:\n with open(self.file_name, 'r') as ach_file:\n file_contents = ach_file.read().replace('...
[ "0.5381786", "0.5348522", "0.5348522", "0.5151396", "0.5106103", "0.5066471", "0.50565517", "0.5037974", "0.5034386", "0.5010468", "0.5004394", "0.49670166", "0.49628448", "0.49199966", "0.49115968", "0.4866254", "0.48558313", "0.48332718", "0.481736", "0.4799835", "0.4788824...
0.7462509
0
Writes a rewrite tracker file.
def WriteRewriteTrackerFile(tracker_file_name, rewrite_params_hash, rewrite_token): _WriteTrackerFile(tracker_file_name, '%s\n%s\n' % (rewrite_params_hash, rewrite_token))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, outfile, rebasings=None):\r\n raise NotImplementedError()", "def _WriteTrackerFile(tracker_file_name, data):\n try:\n with os.fdopen(os.open(tracker_file_name,\n os.O_WRONLY | os.O_CREAT, 0600), 'w') as tf:\n tf.write(data)\n return False\n except (IOErro...
[ "0.6788737", "0.63134295", "0.62709975", "0.62709975", "0.6243932", "0.6146459", "0.6125916", "0.5933308", "0.5903819", "0.588318", "0.5856907", "0.5842018", "0.579014", "0.577316", "0.57695144", "0.57399994", "0.5729899", "0.5718736", "0.56982774", "0.5697997", "0.568461", ...
0.7979988
0
Checks for a download tracker file and creates one if it does not exist.
def ReadOrCreateDownloadTrackerFile(src_obj_metadata, dst_url, api_selector): if src_obj_metadata.size < ResumableThreshold(): # Don't create a tracker file for a small downloads; cross-process resumes # won't work, but restarting a small download is inexpensive. return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_agent_if_missing(filename):\n if file_missing(filename):\n print filename+'is missing, downloading it first'\n download(filename)", "def download_if_needed(url, filename):\n if os.path.exists(filename):\n print \"already exists\"\n else:\n wget.download(url)", ...
[ "0.6273756", "0.60826844", "0.597988", "0.59786946", "0.59786946", "0.59084964", "0.577573", "0.5752773", "0.5725254", "0.56218076", "0.5591753", "0.55877703", "0.55799156", "0.55631", "0.55320764", "0.5526527", "0.5502081", "0.5462428", "0.5462428", "0.5461796", "0.54582834"...
0.69397694
0
appends line to file if not present
def add_line_to_file(line, filepath): filepath = os.path.realpath(filepath) if not os.path.isdir(os.path.dirname(filepath)): os.makedirs(os.path.dirname(filepath)) found = False if os.path.isfile(filepath): with open(filepath, 'r+') as myfile: lst = myfile.readlines() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_line(self, line):\n if self.status:\n with open(self.file_out_name,'a') as fout:\n fout.write(line)", "def append_line(self, file_path, line):\n try:\n with open(file_path, \"a\") as file:\n file.write(line + \"\\n\")\n re...
[ "0.704986", "0.6987986", "0.6951259", "0.6841392", "0.673778", "0.67046696", "0.6702362", "0.65841836", "0.6418238", "0.6222445", "0.61815375", "0.6160046", "0.61536825", "0.6147683", "0.6115943", "0.60670424", "0.60089946", "0.60089946", "0.59469897", "0.594275", "0.5923019"...
0.7030425
1
Return gold labels as a list.
def gold(self): return self.labels
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self):\n return []", "def get_labels(self):\n return [token.label for token in self.tokens]", "def get_labels(self) -> List[str]:\n return self.labels", "def labels(self) -> list:\n return self._labels", "def get_labels() -> list[Label]:\n\n labels_file = deepc...
[ "0.73611605", "0.7302142", "0.72801894", "0.713625", "0.7063405", "0.7038624", "0.70314384", "0.69941795", "0.6881636", "0.68506217", "0.6839455", "0.6778665", "0.6774362", "0.6774362", "0.6774362", "0.6774362", "0.6774362", "0.6774362", "0.6681522", "0.6644164", "0.66342205"...
0.8026147
0
Randomly dropout tokens (IDs) and replace them with tokens.
def word_dropout(tokens, dropout): return [constant.UNK_ID if x != constant.UNK_ID and np.random.random() < dropout \ else x for x in tokens]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_tokens(self, tokens):\n details = []\n idx = 0\n if len(tokens) >= min_token_num:\n for i in range(len(tokens)):\n old_token = tokens[i]\n if old_token in self.vocab and self.get_random_prob() < self.token_prob:\n tokens[i...
[ "0.64954305", "0.6290737", "0.6272901", "0.6272901", "0.6272901", "0.6148785", "0.59451646", "0.5890986", "0.5751701", "0.5737682", "0.57351816", "0.563494", "0.56142646", "0.55326474", "0.54899573", "0.5485592", "0.547473", "0.542751", "0.54229766", "0.53995466", "0.5398629"...
0.7062326
0
This function pulls dalys for specified cause IDs from GBD
def pull_dalys(cause_ids, nonfatal_cause_ids, location_ids, ages, sexes, index_cols): if len(cause_ids) + len(nonfatal_cause_ids) == 0: raise Exception("Must select at least one fatal or nonfatal cause_id") #init empty dfs ylds, ylls = pd.DataFrame(), pd.DataFrame() if len(nonfatal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adhd(caseids,mydb=None):\n\tif mydb is None:\n\t\tmydb = db_manager('vrclassroomdata')\n\tcids = ','.join([str(x) for x in caseids])\n\tthis_df = mydb.sql_query_fetch_df(\"select a.Id, b.ADHDDiagnose from `case` a, patient b where b.Id=a.SubjectId and a.Id in (%s) order by field (a.Id,%s)\"%(cids,cids),pr...
[ "0.56230086", "0.53120613", "0.5277913", "0.5180252", "0.51693785", "0.507765", "0.5014216", "0.49858776", "0.4975915", "0.49524066", "0.49363998", "0.49002153", "0.48908767", "0.48766443", "0.48478845", "0.48225546", "0.48033267", "0.4801104", "0.4785761", "0.4774491", "0.47...
0.7026445
0
Following Nathaniel's Vitamin A multiplicative model writeup Calculates, in draw space, the PAF of some outcome 'o' (such as NTD incidence) given some dichomotous exposure 'r' (such as a lack of folic acid fortification)
def paf_o_r(rr_o_r, alpha): return ((rr_o_r - 1) * (1 - alpha)) / ((rr_o_r - 1) * (1 - alpha) + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prf(stats):\n if stats['pred'] == 0:\n return 0, 0, 0\n p = stats['corr']/stats['pred']\n r = stats['corr']/stats['gold']\n if p > 0 and r > 0:\n f = 2*p*r/(p+r)\n else:\n f = 0\n return p, r, f", "def pif_o_r(paf_o_r, alpha, alpha_star):\n return paf_o_r * ((alpha_s...
[ "0.6252921", "0.6047141", "0.5921848", "0.5919183", "0.58074903", "0.580166", "0.573012", "0.57079667", "0.5702805", "0.56922394", "0.5558143", "0.5557235", "0.5544737", "0.5510745", "0.5489067", "0.54731345", "0.54717034", "0.5446004", "0.5440856", "0.54358524", "0.54325265"...
0.61302215
1
a pd.DataFrame() with age_group_id age_group_name age_start float for neonatal + 1 to 4 year old age groups
def pull_u5_age_groups_formatted(): age_start_map = { 'Early Neonatal': 0, 'Late Neonatal': 7/365, 'Post Neonatal': 28/365, '1 to 4': 1 } age_end_map = { 'Early Neonatal': 7/365, 'Late Neonatal': 28/365, 'Post Neonatal': 365/365, '1 to 4': 5 } # pull...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_df():\n df = load_df_from_files()\n df = clean_df(df)\n df = expand_df_dates(df)\n df[\"age_at_t\"] = ((df[\"date\"] - df[\"birthday\"]) / 365).dt.days # Yeah, this is weird.\n return df", "def age_binning(df):\n\n # bins that age is sorted into\n age_bins = np.append(np.array([0,1,4]), np...
[ "0.6269801", "0.5932561", "0.58339566", "0.5740221", "0.5732571", "0.5659223", "0.5570736", "0.5543955", "0.5441446", "0.5404643", "0.53028536", "0.52629364", "0.522845", "0.52063704", "0.5162005", "0.51570964", "0.5115626", "0.5105394", "0.509224", "0.5091394", "0.50578034",...
0.60626066
1
a pd.DataFrame() with specified location_ids age_group_ids for 1, 2, 3, and 4 year olds sex_ids "age_name" with an age group label "prop_1_4" with the proportion of age_group X out of age_group_id 5
def get_age_1_4_age_splits(location_ids, sexes): # pull population data location_ids = list(location_ids) age_split_pop_count = get_population( location_id=location_ids, year_id=2019, age_group_id=[49,50,51,52], single_year_age=True, sex_id=sexes, gbd_round_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_iron_hemoglobin_age_related_effective_coverage_restrictions(data,\n sex_ids,\n age_group_ids,\n effective_fractions)...
[ "0.63705397", "0.6071489", "0.6071489", "0.5912261", "0.5603249", "0.5497298", "0.54729533", "0.54188925", "0.5374897", "0.53565705", "0.52926534", "0.52469796", "0.5227463", "0.52265364", "0.52131486", "0.5205063", "0.52038306", "0.5188397", "0.51701516", "0.5131363", "0.512...
0.74131227
0
adds lines to the swim object. with the arguments forwarded to __util__.scope_lines
def _add_scope(self, *args, **kwargs): lines = scope_lines(*args, **kwargs) self.lines.extend(lines) return len(lines)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_raw(self, lines):\n return self._add_scope(lines, None, None, indent=None, inline=False)", "def add_lines(self, *lines, **kwargs):\n assert len(lines) > 0\n lines = [_endline(line) for line in lines]\n all_stages = kwargs.pop('all_stages', False)\n at_start = kwargs.pop...
[ "0.67846817", "0.650356", "0.6448292", "0.63999695", "0.63545126", "0.6267685", "0.6185877", "0.61215115", "0.610109", "0.59473467", "0.5920031", "0.5920031", "0.5853437", "0.57996607", "0.5771026", "0.5769285", "0.57038033", "0.5693841", "0.56882554", "0.56811553", "0.562985...
0.75363743
0
add lines to the swim without an enclosing scope
def add_raw(self, lines): return self._add_scope(lines, None, None, indent=None, inline=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, line):\n self.cull()\n self.lines.append(line)", "def add_line(self, line):\n self.code.extend([\" \" * self.indent_level, line, \"\\n\"])", "def add_line(self, line):\n self.code.extend([\" \" * self.indent_level, line, \"\\n\"])", "def new_line():\n print()", "def add...
[ "0.65126455", "0.6127987", "0.6127987", "0.60583615", "0.603168", "0.59646225", "0.59486276", "0.59404665", "0.5914367", "0.58971936", "0.58896637", "0.58696604", "0.5858786", "0.58379865", "0.5834611", "0.578282", "0.5762538", "0.57595", "0.5711435", "0.5685841", "0.5636901"...
0.6349906
1
add lines to the swim with an insert scope %{ %}
def add_insert(self, lines): return self._add_scope(lines, '%{', '%}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self):\n #vim.command(\"autocmd! CursorMovedI *\")\n try:\n placeholder = self.placeholders.pop()\n pos = self.findPlaceholder(placeholder)\n except IndexError:\n #TODO here I could do a findAllPlaceHolders on the complete file, for\n #reducing errors!\n pos = (0,0,0)\n...
[ "0.67922753", "0.6663215", "0.6172989", "0.61030936", "0.5942064", "0.59274566", "0.5889628", "0.5855325", "0.5761353", "0.5761353", "0.5756298", "0.57560426", "0.5698956", "0.568308", "0.5626498", "0.55507535", "0.55334395", "0.55170107", "0.551231", "0.55110294", "0.5495745...
0.7928264
0
add lines to the swim with an %init scope
def add_init(self, lines): return self._add_scope(lines, '%init %{', '%}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(self):\n sys_init_lines = CodeWriter.write_init()\n self.init_lines.extend(sys_init_lines)", "def add_begin(self, lines):\n return self._add_scope(lines, '%begin %{', '%}')", "def beginScope():", "def add_python_begin(self, lines):\n return self._add_scope(lines, '%python...
[ "0.67998314", "0.64131415", "0.60576457", "0.58872247", "0.57417905", "0.57333225", "0.56565", "0.56419224", "0.55961514", "0.55780023", "0.5516226", "0.5493941", "0.5476834", "0.5469563", "0.54207057", "0.54154503", "0.54121745", "0.5371379", "0.5362003", "0.53599983", "0.53...
0.7650657
0
add lines to the swim with an %inline scope
def add_inline(self, lines): return self._add_scope(lines, '%inline %{', '%}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_raw(self, lines):\n return self._add_scope(lines, None, None, indent=None, inline=False)", "def add_begin(self, lines):\n return self._add_scope(lines, '%begin %{', '%}')", "def add_python(self, lines):\n return self._add_scope(lines, '%pythoncode %{', '%}', inline=False)", "def ...
[ "0.6796899", "0.64170915", "0.64074826", "0.62847924", "0.6172507", "0.6146074", "0.60593814", "0.60490286", "0.5909625", "0.5909625", "0.5829333", "0.5821996", "0.5814859", "0.58125925", "0.5644606", "0.56434417", "0.5574224", "0.5539332", "0.5471069", "0.5402047", "0.537886...
0.83485454
0
add lines to the swim with a %pythoncode scope
def add_python(self, lines): return self._add_scope(lines, '%pythoncode %{', '%}', inline=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_python_begin(self, lines):\n return self._add_scope(lines, '%pythonbegin %{', '%}', inline=False)", "def add_code(self, code_lines: List[str]) -> None:\n self.__code_block__ += code_lines", "def write_code(self, code):\n self.buffer.scope_line(code.lstrip(' \\t'))", "def maybe_ap...
[ "0.72855204", "0.67737067", "0.64277625", "0.6366127", "0.6319772", "0.61823004", "0.6182049", "0.6001075", "0.5914849", "0.59011936", "0.5879456", "0.5847941", "0.5823648", "0.5823648", "0.576693", "0.57615745", "0.5663095", "0.5660934", "0.5612203", "0.5569046", "0.5562889"...
0.82194614
0
add lines to the swim with a %pythonbegin scope
def add_python_begin(self, lines): return self._add_scope(lines, '%pythonbegin %{', '%}', inline=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_begin(self, lines):\n return self._add_scope(lines, '%begin %{', '%}')", "def add_python(self, lines):\n return self._add_scope(lines, '%pythoncode %{', '%}', inline=False)", "def beginScope():", "def add_python_prepend(self, method: Function, lines):\n return self.add_feature(li...
[ "0.7444203", "0.7173692", "0.6397793", "0.5903751", "0.5727093", "0.56622964", "0.5648465", "0.55984676", "0.55900687", "0.55078626", "0.545898", "0.54386294", "0.54139555", "0.5387291", "0.53734475", "0.53591806", "0.5343911", "0.53297573", "0.5301706", "0.52969384", "0.5292...
0.8458866
0
add lines to the swim with a %pythonappend scope. requires the method to which to bind.
def add_python_append(self, method: Function, lines): return self.add_feature(lines, method.pattern, 'pythonappend')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_python(self, lines):\n return self._add_scope(lines, '%pythoncode %{', '%}', inline=False)", "def add_python_prepend(self, method: Function, lines):\n return self.add_feature(lines, method.pattern, 'pythonprepend')", "def add_extend(self, lines, name=''):\n return self._add_scope(l...
[ "0.6781854", "0.64491373", "0.6193824", "0.61880773", "0.6120018", "0.6037418", "0.58205456", "0.5801156", "0.575452", "0.5685965", "0.5684664", "0.5610529", "0.5569516", "0.5468532", "0.5458067", "0.5443156", "0.54287255", "0.5416714", "0.5333754", "0.53315073", "0.5325522",...
0.79051167
0
add lines to the swim with a %pythonprepend scope. requires the method to which to bind.
def add_python_prepend(self, method: Function, lines): return self.add_feature(lines, method.pattern, 'pythonprepend')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_python_begin(self, lines):\n return self._add_scope(lines, '%pythonbegin %{', '%}', inline=False)", "def add_python(self, lines):\n return self._add_scope(lines, '%pythoncode %{', '%}', inline=False)", "def add_python_append(self, method: Function, lines):\n return self.add_feature...
[ "0.73254114", "0.6698062", "0.65658134", "0.61451954", "0.6006999", "0.56337845", "0.5618978", "0.56152195", "0.5612275", "0.55361205", "0.55361205", "0.55045193", "0.55004585", "0.54829097", "0.54454756", "0.5405922", "0.5385084", "0.5319596", "0.5301912", "0.5252837", "0.52...
0.81695557
0
add lines to the swim with a %exception scope. requires the method to which to bind.
def add_exception_check(self, lines): return self.add_feature(lines, '', 'exception')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addExceptionMessage(self, q, inst, traceback):\n self.fail('FAIL: Exception raised: %s' % inst)\n self.addMessage('')\n for line in traceback.format_exc().split('\\n'):\n self.addMessage(line)", "def append_exception(self, message=u''): \n if isinstance(sys.exc_info()[1...
[ "0.5950198", "0.58148843", "0.57832515", "0.5621935", "0.5551961", "0.5530148", "0.5487709", "0.5476564", "0.5469961", "0.54511577", "0.5426439", "0.5423702", "0.5421121", "0.5376286", "0.53517544", "0.5350704", "0.5337269", "0.53213924", "0.5309759", "0.53026044", "0.5300409...
0.66227597
0
add lines to the swim with a %contract scope. requires the method to which to bind.
def add_contract(self, method: Function, lines): return self.add_feature(lines, method.pattern, 'contract')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_contract(self, contract):\n self.contracts[contract.name] = contract\n self.alphabet = list(set(self.alphabet) | set(contract.variables))", "def _add_scope(self, *args, **kwargs):\n lines = scope_lines(*args, **kwargs)\n self.lines.extend(lines)\n return len(lines)", ...
[ "0.59992", "0.5861132", "0.58554286", "0.55261743", "0.5306385", "0.52570355", "0.5239001", "0.52368", "0.51944435", "0.5152344", "0.5056834", "0.50365", "0.49871847", "0.49718606", "0.49624184", "0.49624184", "0.49115306", "0.4886142", "0.48651546", "0.48415607", "0.4821491"...
0.730265
0
Parse a Post Office Box PMB digits POB digits P.O.B digits P.O. Box digits P.O. digits
def parse_pob(self): index = self.index start = self.index if self.words[index]['word'] == 'pob' or self.words[index]['word'] == 'pmb': index += 1 if index == self.length: return None, 0 if self.words[index]['word'] ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_postcode(s):\n pc_regex = r'([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y]'\n pc_regex += r'[0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]'\n pc_regex += r'))))\\s?[0-9][A-Za-z]{2})'\n\n re_search = re.search(pc_regex, s)\n if re_searc...
[ "0.5509301", "0.5439012", "0.5419785", "0.5337647", "0.5337647", "0.5328429", "0.53065366", "0.51627904", "0.5156804", "0.5141506", "0.5076204", "0.50632983", "0.5041245", "0.50348336", "0.49797523", "0.49784377", "0.4953256", "0.4939872", "0.4927507", "0.49075076", "0.489521...
0.6392054
0
Parse a Postal Station (STN|RPO|Station) word
def parse_stn(self): index = self.index start = self.index if index == self.length: return None, 0 if self.words[index]['word'] == 'stn' or self.words[index]['word'] == 'station' or self.words[index]['word'] == 'rpo': index += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_station_name (station_name):\n try:\n _,chinese_name,code,full_pinyin,short_pinyin = station_name.split('|')\n except ValueError:\n # print(station_name)\n _,chinese_name,code,full_pinyin,short_pinyin,_ = station_name.split('|')\n return {chinese_name:code,full_pinyin:code,s...
[ "0.623392", "0.6233269", "0.61185384", "0.60672194", "0.5706585", "0.5652462", "0.5631425", "0.5517574", "0.5503128", "0.5474191", "0.5456381", "0.5427626", "0.53800154", "0.53769773", "0.5357613", "0.53118235", "0.527336", "0.5262144", "0.52560794", "0.5253394", "0.5230342",...
0.6842843
0
Parse a Street Direction (n|s|w|e|nw|ne|sw|se) (north|south|west|east) (north[[sp]west|east]|south[[sp]west|east])
def parse_streetdir(self): first = self.words[self.index]['word'] if self.index + 1 < self.length: second = self.words[self.index+1]['word'] else: second = None if first in ['northwest', 'northeast', 'southwest', 'southeast']: return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_streetname(self):\n index = self.index\n \n name = \"\"\n for i in range(4):\n if index + i == self.length:\n break\n if self.words[index+i]['word'] == ',':\n break\n # Hack\n if self.words[index+i]['wor...
[ "0.6338947", "0.61096317", "0.56044453", "0.5496037", "0.54842347", "0.544372", "0.53669584", "0.53196144", "0.53152376", "0.5198874", "0.51243407", "0.51109093", "0.5085592", "0.50316674", "0.500003", "0.49935362", "0.49368477", "0.49091184", "0.4898173", "0.48960108", "0.48...
0.7305631
0
Parse a Street Name
def parse_streetname(self): index = self.index name = "" for i in range(4): if index + i == self.length: break if self.words[index+i]['word'] == ',': break # Hack if self.words[index+i]['word'] == 'doctor': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def street_parser(*street_data):\n\n # parsing tuples\n if len(street_data) == 2:\n if not isinstance(street_data[0], str) and not isinstance(street_data[1], str):\n raise WrongInput(\"Invalid format\")\n # street name as the tuple's first item\n strname, strnumber = street_da...
[ "0.73314106", "0.66084766", "0.6545703", "0.6426236", "0.62570745", "0.61638844", "0.6144636", "0.6112116", "0.6097728", "0.6069476", "0.60527843", "0.60126626", "0.5993045", "0.5958215", "0.5957148", "0.5909725", "0.5891397", "0.58875704", "0.58830124", "0.58734214", "0.5872...
0.75930023
0
Parse a Street Type
def streettype(self): if self.index >= self.length: return False self._typ, n = self.parse_streettype() if self._typ is not None: self.idx_typ = self.index self.index += n if self.index < self.length and self.words[self.index]['word'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_streettype(self):\n \n\n try:\n word = sttype[self.words[self.index]['word']]\n if Vocabulary.STREET_TYPE in word['tag']:\n itag = word['tag'].index(Vocabulary.STREET_TYPE)\n lemma = word['lemma'][itag]\n return lemma, 1\n ...
[ "0.7352092", "0.646472", "0.63622284", "0.6181158", "0.60935646", "0.6071878", "0.6047718", "0.59844154", "0.5948823", "0.57437384", "0.56188196", "0.5609972", "0.55859494", "0.55766195", "0.5505224", "0.5481181", "0.54733306", "0.5466849", "0.5461348", "0.5458719", "0.541112...
0.66800004
1
Parse a Street Type
def parse_streettype(self): try: word = sttype[self.words[self.index]['word']] if Vocabulary.STREET_TYPE in word['tag']: itag = word['tag'].index(Vocabulary.STREET_TYPE) lemma = word['lemma'][itag] return lemma, 1 retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def streettype(self):\n if self.index >= self.length:\n return False\n \n self._typ, n = self.parse_streettype()\n if self._typ is not None:\n self.idx_typ = self.index\n self.index += n\n if self.index < self.length and self.words[self.in...
[ "0.66808707", "0.6464034", "0.63617694", "0.61796737", "0.6092625", "0.60736203", "0.6047013", "0.5983775", "0.5950236", "0.574458", "0.56168497", "0.5609434", "0.5587649", "0.557688", "0.550519", "0.548075", "0.5472097", "0.54645866", "0.54608816", "0.54602647", "0.5409267",...
0.73535156
0
Parse a City and State
def parse_citystate(self): index = self.index if self.words[index]['tag'] != Vocabulary.NAME: return None, None, 0, 0 if self.words[index]['word'] == 'mt': city = "mountain" else: city = self.words[index]['word'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def city_parser(city: str = None):\n return city.text.strip().split(',')[1]", "def parse_city_state_from_row(row):\n city, state = ['NULL', 'NULL']\n if row['Geographic area'].count(' - ') == 2:\n state, city = row['Geographic area'].lower().split(' - ')[-2:]\n city = remove_substring_from_end_of_stri...
[ "0.7167144", "0.7103394", "0.69272184", "0.68638027", "0.6724114", "0.6408183", "0.6401508", "0.63388", "0.6293635", "0.6257335", "0.6255003", "0.6098398", "0.6051419", "0.5989935", "0.5964835", "0.5951598", "0.5909424", "0.5863681", "0.5793439", "0.57704103", "0.5766389", ...
0.7390942
0
Parse a US Postal Code
def parse_postalUS(self): index = self.index # US Postal Code if len(self.words[index]['word']) != 5 or not self.words[index]['word'].isdigit(): return None, 0 postal = self.words[index]['word'] if index + 1 < self.length: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_postcode(s):\n pc_regex = r'([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y]'\n pc_regex += r'[0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]'\n pc_regex += r'))))\\s?[0-9][A-Za-z]{2})'\n\n re_search = re.search(pc_regex, s)\n if re_searc...
[ "0.68169475", "0.6787212", "0.66331065", "0.6465904", "0.62327194", "0.6120119", "0.6045608", "0.60441333", "0.5938737", "0.5917331", "0.5902725", "0.58611923", "0.5851294", "0.582264", "0.5816804", "0.57870555", "0.57870555", "0.57870555", "0.57870024", "0.5727899", "0.57092...
0.74377286
0
Insert a line of Updates data into the database.
def insert_updates(self, values): assert len(values) == len(COLUMNS_BGPEVENTS) bound = self.prep_stmt_insert_bgpevents.bind(values) self.futures.append(self.session.execute_async(bound)) if (len(self.futures) > MAX_ASYNC_REQUESTS): self.check_deferred_responses()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dbUpdate():\n dbAddress = config.get('database', 'dbAddress')\n dbUser = config.get('database', 'dbUser')\n dbPassword = config.get('database', 'dbPassword')\n dbName = config.get('database', 'dbName')\n dbPort = config.getint('database', 'dbPort')\n con = MySQLdb.connect(host=dbAddress, port...
[ "0.59201044", "0.5902824", "0.5817334", "0.5641299", "0.56094337", "0.5608667", "0.55930495", "0.5567229", "0.552885", "0.55259585", "0.552431", "0.5485754", "0.547772", "0.5477715", "0.5470331", "0.546635", "0.5462415", "0.54596007", "0.5446681", "0.5443039", "0.5435018", ...
0.5996981
0
Query the table to determine if a file with the given name has already been ingested.
def is_file_ingested(self, original_name, tablename): prep_stmt = self.session.prepare( 'SELECT * FROM {0} WHERE {1}=?'.format(tablename, COLUMNS_META[2]) ) bound = prep_stmt.bind([original_name]) results = self.session.execute(bound) return True if len(results.curren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_file(self, name):\n self.assertTrue(os.path.exists(name), \"Could not find table %s.\" % name)", "def check_if_row_already_loaded(self, row, file_name):\n\t\tquery = \"SELECT count(*) FROM \" + TABLE_NAME + \" WHERE GLOBALEVENTID = \" + \"'\" + row[0] + \"'\"\n\n\t\ttry:\t\t\t\n\t\t\t# print qu...
[ "0.6910452", "0.6595102", "0.6392822", "0.63660973", "0.63485706", "0.631363", "0.62860954", "0.6237048", "0.6236886", "0.6213956", "0.61991674", "0.6077491", "0.6071262", "0.6054262", "0.60468805", "0.60399336", "0.5992716", "0.5989239", "0.59744495", "0.59658456", "0.595866...
0.7780518
0
Checks ResponseFuture objects stored in self.futures. Exceptions that occurred during async query executions will occur here.
def check_deferred_responses(self): for future in self.futures: results = future.result() self.futures = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __check_futures(cls, output, futures):\n for _ in range(len(futures)):\n future = futures.popleft()\n if future.done():\n try:\n port, status = future.result()\n output[port] = status\n except socket_error:\n ...
[ "0.63616014", "0.62636966", "0.62554723", "0.58126837", "0.5771574", "0.57408834", "0.5710376", "0.5639147", "0.5591878", "0.55765843", "0.55355513", "0.55083793", "0.5503552", "0.55019253", "0.5415703", "0.5412277", "0.5355434", "0.535387", "0.53446335", "0.5322889", "0.5311...
0.7792941
0
Download a file from the SweetTea API If the destination path has no file extension, it is assumed to be a directory.
def download(self, api_route, dest_path, payload=None, file_type_header=None, extract_archives=True): resp = None payload = payload or {} file_type_header = file_type_header or self.default_file_type_header try: # Fetch the file from the API. resp = self.api.get(api_route, payload=payload, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download(self, url, destination):\n fileDownloader = utils.HttpFileDownloader(url, destination)\n fileDownloader.download()", "def filedownload(source, destination):\n\n # Initiate the download\n urllib.request.urlretrieve(source, destination)", "def download_file(self, source, dest=Non...
[ "0.74462014", "0.717291", "0.70779574", "0.707318", "0.70136386", "0.68301034", "0.68121547", "0.6757707", "0.67238814", "0.6722531", "0.6690708", "0.6689046", "0.66746974", "0.666172", "0.66608715", "0.66608715", "0.6646723", "0.6643791", "0.6632525", "0.66285616", "0.661064...
0.7325945
1
This is used for count of total record of product queue line.
def _compute_queue_line_record(self): for product_queue in self: queue_lines = product_queue.product_data_queue_lines product_queue.queue_line_total_records = len(queue_lines) product_queue.queue_line_draft_records = len( queue_lines.filtered(lambda x:x.st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_items(self):\n num_items = 0\n for line in self.lines.all():\n num_items += line.quantity\n return num_items", "def _calc_line_quantity(self, cr, uid, line, context=None):\n return line.product_qty", "def _numQueuedTotal(self):\n queueSize = len(self.__queue) +...
[ "0.6728332", "0.6686901", "0.6675879", "0.661672", "0.6524404", "0.65208846", "0.6467402", "0.6437851", "0.628259", "0.6237059", "0.6163172", "0.6153888", "0.6095286", "0.6084754", "0.60840166", "0.6058307", "0.60508925", "0.60508925", "0.60508925", "0.60508925", "0.6024711",...
0.74769735
0
Computes state from different states of queue lines.
def _compute_queue_state(self): for record in self: if record.queue_line_total_records == record.queue_line_done_records + record.queue_line_cancel_records: record.state = "completed" elif record.queue_line_draft_records == record.queue_line_total_records: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_state(self):\n\t\tif self.state_type == 'Queues':\n\t\t\t#self.queue_state =\\\n\t\t\t#[0. if movement.AttValue('QLen(Current, Last)') is None else movement.AttValue('QLen(Current, Last)') for movement in self.lanes_movement]\n\n\t\t\tself.queue_state =\\\n\t\t\t[0. if queue.AttValue('QLen(Current,...
[ "0.73550963", "0.61763006", "0.6168835", "0.5914047", "0.5880033", "0.572045", "0.571621", "0.57087564", "0.57029647", "0.5688683", "0.568061", "0.56745815", "0.56616175", "0.56164336", "0.56039417", "0.5602903", "0.559187", "0.5574628", "0.55613846", "0.55613846", "0.5560258...
0.75306606
0
This method used to create a product queue as per the split requirement of the queue. It is used for process the queue manually.
def shopify_create_product_queue(self, instance, created_by='import'): #Added created_by field which is used to identify the queue is created from which process import or webhook : Dipak Gogiya product_queue_vals = { 'shopify_instance_id':instance and instance.id or False, 'state...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_queue(self):\n # Instantiate\n queue = pbs.queue(verbose=not self.quiet)\n\n if self.q == 'ember':\n # Submitting to Utah ember cluster\n ppn = 12\n cpus = ppn if self.cpus is None else min(self.cpus, ppn)\n walltime = self.walltime if in...
[ "0.67427164", "0.65279806", "0.6462158", "0.64437056", "0.63512075", "0.62755984", "0.6275351", "0.6238054", "0.6213989", "0.6196298", "0.6086965", "0.6037728", "0.59987074", "0.59665084", "0.59183425", "0.58791554", "0.5871936", "0.5869609", "0.5861172", "0.5843961", "0.5843...
0.73897463
0
This method used to create a product data queue line.
def shopify_create_product_data_queue_line(self, result, instance, product_queue_data_id): product_data_queue_line_obj = self.env["shopify.product.data.queue.line.ept"] product_queue_line_vals = {} #doesn't need to convert the response into dictionary while response is getting from webhook [Add ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_product_queue_line_data(self):\n shopify_product_template_obj = self.env['shopify.product.template.ept']\n comman_log_obj = self.env[\"common.log.book.ept\"]\n shopify_tmpl_id = False\n\n product_queue_dict = {}\n queue_id = self.product_data_queue_id if len(self.prod...
[ "0.6933381", "0.69173896", "0.6856358", "0.68060774", "0.675189", "0.62019813", "0.6040637", "0.5978801", "0.59644425", "0.59393656", "0.59366614", "0.59186864", "0.5887491", "0.5809255", "0.58090496", "0.5801302", "0.5761373", "0.57500213", "0.57416767", "0.56782055", "0.566...
0.74084526
0
Build a pdf version of sa_summary.
def sa_summary_pdf(sa_id): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def produce_summary_pdf(model_name, img_path, hyperparams, model_arch, train_stats):\n # datetime object containing current date and time\n now = datetime.now()\n dt_string = now.strftime(\"%d/%m/%Y %H:%M:%S\")\n\n pdf = FPDF()\n pdf.set_title(\"training_summary_{}_{}\".format(model_name.lower(), dt...
[ "0.625413", "0.62132585", "0.6162406", "0.60121036", "0.5929205", "0.58661926", "0.57498765", "0.57135904", "0.5660982", "0.5657245", "0.56555516", "0.5653621", "0.5631681", "0.5626717", "0.5612419", "0.55790055", "0.5574666", "0.5551953", "0.5544516", "0.5527586", "0.5504218...
0.78915954
0
Returns a file path for the anonymised c3d file to be save to. Format "{outputdir}/{subjectname}_{condition}_{trialno}.c3d
def createFilePath(self, outputdir, condition, trialno): # Create file name filename= self.trialC3D['parameters']['SUBJECTS']['NAMES']['value'] if condition!=None: filename = "{}_{}".format(filename, condition) else: pass if trialno!=None: fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveC3D(self, outputdir=None, condition=None, trialno=None):\n fpath = self.createFilePath(outputdir, condition, trialno)\n self.trialC3D.write(fpath)\n return", "def _make_output_path(self, filename):\n return os.path.join(self._output_directory, filename)", "def write_file(cou...
[ "0.79284745", "0.65506065", "0.6297584", "0.61337495", "0.6113784", "0.6045709", "0.6026302", "0.6013044", "0.60040236", "0.59769714", "0.5932844", "0.5885488", "0.58698124", "0.5857384", "0.5840238", "0.58320004", "0.57913876", "0.5790887", "0.5785458", "0.57839334", "0.5778...
0.8017994
0