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
Get distance between two points going only through the defense land
def getMazeDistanceDefense(self, p1, p2): try: return self.distancerDefense.getDistance(p1, p2) except Exception: return self.getMazeDistance(p1, p2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self, other_pt, is_lla=True):\n return 0.0", "def get_distance(first: Point, second: Point) -> Float:\n\n return sqrt(\n (second.x - first.x) ** 2\n +\n (second.y - first.y) ** 2\n )", "def __get_distance(point1: np.ndarray, point2: np.ndarray) -> float:\n ...
[ "0.744277", "0.71968544", "0.7164096", "0.7129097", "0.707927", "0.7068014", "0.7024101", "0.7008225", "0.698951", "0.6964147", "0.693927", "0.6936985", "0.69191873", "0.6912923", "0.687099", "0.68569434", "0.68446594", "0.6841914", "0.68375", "0.68300796", "0.6805769", "0....
0.72054726
1
Get centroid (average point) of beliefs for an opponent
def getBeliefsCentroid(self, idx): x = 0.0 y = 0.0 total = 0.0 for p in self.beliefs[idx]: x += p[0] y += p[1] total += 1.0 return (round(x / total), round(y / total))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_centroid(self):\n num = 0\n centroid = numpy.zeros(3, float)\n for atm in self:\n if atm.position is not None:\n centroid += atm.position\n num += 1\n return centroid / num", "def centroid(self) -> Point:\n points = self.no...
[ "0.7214463", "0.6820861", "0.67982733", "0.67874646", "0.67413944", "0.6737949", "0.6652046", "0.6643116", "0.6635537", "0.6628157", "0.65908074", "0.65682214", "0.65392566", "0.65339446", "0.6527422", "0.6517385", "0.6476208", "0.6454607", "0.64542395", "0.6439064", "0.64369...
0.78195196
0
Get closest possible position of the opponent according to beliefs (if more than one possible, picks one randomly)
def getClosestPositionOpponent(self, idx, pos, defense=False): minD = 10000 opponentPos = [pos] for p in self.beliefs[idx]: if defense: d = self.getMazeDistanceDefense(pos, p) else: d = self.getMazeDistance(pos, p) if minD > d: minD = d opponentPos = [p] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _closest_front_opponent(self, raw_obs, o, target):\n delta = target - o\n min_d = None\n closest = None\n for p in raw_obs['right_team']:\n delta_opp = p - o\n if np.dot(delta, delta_opp) <= 0:\n continue\n d = self._object_distance(o,...
[ "0.7216672", "0.7017943", "0.68256783", "0.68243515", "0.67419386", "0.665059", "0.66476333", "0.6628106", "0.6597398", "0.6581693", "0.6525909", "0.6463664", "0.64581263", "0.64473104", "0.64380753", "0.6420585", "0.6400714", "0.63967943", "0.63782734", "0.6370442", "0.63704...
0.7711962
0
Get minimum possible distance to opponent
def getMinimumDistanceOpponent(self, idx, pos, defense=False): minD = 10000 if defense: for p in self.beliefs[idx]: minD = min(minD, self.getMazeDistanceDefense(pos, p)) else: for p in self.beliefs[idx]: minD = min(minD, self.getMazeDistance(pos, p)) return minD
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_distance(self):\n return round(min(self.combined_euclidian_distance))", "def min_distance(self, target):\n difference = self.pivot - target\n return max(math.sqrt(np.dot(difference, difference)) - self.radius, 0)", "def _kings_distance(self, piece):\n min_distance = cons...
[ "0.72254676", "0.68654174", "0.686012", "0.6761133", "0.65992033", "0.65834254", "0.65676284", "0.65481323", "0.64017946", "0.6369925", "0.6305183", "0.62864286", "0.62798434", "0.62714386", "0.62629676", "0.62517095", "0.6235636", "0.6219681", "0.6214266", "0.6207137", "0.62...
0.75307536
0
Get minimum distance to middle of the board (my pacmanLand, opponents ghostLand)
def getMinimumDistancePacmanLand(self, pos): minD = 10000 for p in self.ghostLandPositions: minD = min(minD, self.getMazeDistance(pos, p)) return minD
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _kings_distance(self, piece):\n min_distance = constant.BOARD_DIMENSION - 1\n opponent_pieces = self.get_all_pieces(piece.get_player().other)\n for opp_piece in opponent_pieces:\n distance = abs(piece.row - opp_piece.row) + abs(piece.col - opp_piece.col) / 2\n if dist...
[ "0.68152446", "0.6605605", "0.650739", "0.64382017", "0.6427428", "0.63290226", "0.6286821", "0.6265279", "0.62342113", "0.61676383", "0.6067976", "0.6067287", "0.6066152", "0.60641265", "0.6040633", "0.6036753", "0.6031766", "0.600847", "0.5970721", "0.5944521", "0.593572", ...
0.72644186
0
Split food in top and bottom food, separated by median
def getSplitFoodList(self, gameState, margin=1): foodList = self.getFood(gameState).asList() foodListY = [p[1] for p in foodList] med = median(foodListY) splitList = [[], []] for i, p in enumerate(foodList): if p[1] <= med - margin: splitList[0].append(p) elif p[1] > med + margin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_median(numbers):\n middle_index = len(numbers) // 2\n return sorted(numbers[middle_index]) # sorted returns the numbers sorted without changing", "def _split_medians( medians, cutoff ):\n five_prime = []\n three_prime = []\n for key, median in medians.iteritems():\n if median <...
[ "0.6657142", "0.6612814", "0.6509927", "0.64185447", "0.63596123", "0.623155", "0.62060475", "0.61511374", "0.61496574", "0.61215526", "0.608347", "0.60135335", "0.6012894", "0.6006112", "0.59933764", "0.5985323", "0.59740883", "0.5955984", "0.5941399", "0.5927735", "0.590135...
0.67823243
0
Observe noisy distance for opponent and update beliefs according to them
def observe(self, observation, gameState, myPosition, idx): noisyDistance = observation noZero = False for p in self.legalPositions: if self.beliefs[idx][p] <= 0: self.beliefs[idx].pop(p, None) continue trueDistance = util.manhattanDistance(p, myPosition) prob = gameState.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def observe(self, observation, gameState):\n noisyDistance = observation\n pacmanPosition = gameState.getPacmanPosition()\n\n \"*** YOUR CODE HERE ***\"\n\n # Replace this code with a correct observation update\n # Be sure to handle the \"jail\" edge case where the ghost is eaten...
[ "0.7071808", "0.65330017", "0.6131267", "0.6055183", "0.59546125", "0.58331645", "0.5822836", "0.57872796", "0.57719946", "0.57357174", "0.5674904", "0.5614523", "0.56074476", "0.5586609", "0.5580293", "0.55711126", "0.55707365", "0.5560386", "0.5550653", "0.5536806", "0.5532...
0.6566999
1
Get the positions of the babies (the food we are protecting) that are gone (aka have been eaten by the opponent) and save them in eaten
def getEatenBabies(self, gameState): eaten = [] newFood = self.getFoodYouAreDefending(gameState) for pos in self.babies: if not newFood[pos[0]][pos[1]]: eaten.append(pos) return eaten
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trackGhosts(self, gameState):\n\n # Get some values that we will use later\n myState = gameState.getAgentState(self.index)\n myPos = myState.getPosition()\n noisyDistances = gameState.getAgentDistances()\n eatenBabies = self.getEatenBabies(gameState)\n\n # Track each opponent\n opponentFo...
[ "0.6153549", "0.6146357", "0.6052339", "0.5816061", "0.5764447", "0.57265055", "0.5720799", "0.57053065", "0.5586472", "0.5576027", "0.5562706", "0.553079", "0.5517852", "0.55137324", "0.54935753", "0.54551", "0.5438007", "0.5432379", "0.5397186", "0.53894365", "0.5360449", ...
0.7700618
0
Detect if teammate has eaten an opponent, and update beliefs accordingly
def updateEatenOpponents1(self, gameState, idx): teammatePos = gameState.getAgentState((self.index + 2) % 4).getPosition() pos = gameState.getAgentState(idx).getPosition() if pos is None and len(self.beliefs[idx]) == 1 and self.beliefs[idx].keys()[0] == teammatePos: self.setOpponentToZeroPos(idx) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateEatenOpponents2(self, gameState, chosenAction):\n myNewPos = self.getSuccessor(gameState, chosenAction).getAgentState(self.index).getPosition()\n for idx in self.getOpponents(gameState):\n pos = gameState.getAgentState(idx).getPosition()\n if pos is not None and pos == myNewPos:\n ...
[ "0.66890574", "0.6368508", "0.61436534", "0.61104083", "0.6092847", "0.592126", "0.59061474", "0.5894191", "0.5868768", "0.58523476", "0.5842589", "0.5804285", "0.58025306", "0.5802247", "0.5759558", "0.57070696", "0.5706069", "0.56675106", "0.5637546", "0.5619569", "0.561879...
0.72929925
0
Detect if the agent has eaten an opponent after taking choseAction, and update beliefs accordingly
def updateEatenOpponents2(self, gameState, chosenAction): myNewPos = self.getSuccessor(gameState, chosenAction).getAgentState(self.index).getPosition() for idx in self.getOpponents(gameState): pos = gameState.getAgentState(idx).getPosition() if pos is not None and pos == myNewPos: self.setOp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chooseAction(self, gameState):\n actions = gameState.getLegalActions(self.index)\n\n # You can profile your evaluation time by uncommenting these lines\n # start = time.time()\n opIndices = self.getOpponents(gameState)\n opStates = [gameState.getAgentState(i) for i in opIndic...
[ "0.6729112", "0.6670614", "0.66492426", "0.6632579", "0.660503", "0.6600719", "0.6590416", "0.65770644", "0.6573669", "0.65158534", "0.6472443", "0.646066", "0.6408163", "0.64000434", "0.6376658", "0.6342673", "0.6341901", "0.6238633", "0.6162677", "0.6136566", "0.6121612", ...
0.6999971
0
Serialize compatible dictionary to bytes. Copies entire dictionary in the process.
def encode(cls, dictionary: Dict[str, Any]) -> bytes: if not isinstance(dictionary, dict): raise TypeError( # pragma: nocover "dictionary must be of dict type, got type {}".format(type(dictionary)) ) patched_dict = copy.deepcopy(dictionary) cls._patch_dic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_bytes(_dict, enc='utf-8'):\n return bytes(json.dumps(_dict), enc)", "def _encode_dict(source: dict) -> bytes:\n result_data = b\"d\"\n\n for key, value in source.items():\n result_data += encode(key) + encode(value)\n\n return result_data + b\"e\"", "def recursive_force_bytes(d):\r\n ...
[ "0.7369727", "0.67605", "0.66103524", "0.6496112", "0.6161774", "0.6155406", "0.6106692", "0.6106692", "0.6106692", "0.60654813", "0.60654813", "0.60654813", "0.5975645", "0.5975645", "0.59424126", "0.59424126", "0.59202325", "0.5919495", "0.59118193", "0.5903205", "0.5845758...
0.7491539
0
Inicializa las entradas principales de carga del formulario
def iniciarEntradas(self): tituloEntry = self.crearEntrada(self.master, self.tituloString, 30, 1, 1) descripcionEntry = self.crearEntrada(self.master, self.descripcionString, 30, 2, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.user = User.objects.get(username='Aslan')\n self.user.save()\n self.setUpFormData()\n self.form = CompoundForm(self.user, self.formData)", "def __init__(self, corp_app, field_objs, *args, **kwargs):\n self.corp_app = corp_app\n self.field_objs = f...
[ "0.60940665", "0.5666006", "0.55598676", "0.5470787", "0.5469469", "0.5435855", "0.5424151", "0.5399974", "0.53901106", "0.53865784", "0.5367861", "0.5339532", "0.5334651", "0.53280663", "0.53130263", "0.53030586", "0.5268036", "0.525582", "0.52500373", "0.52249557", "0.52124...
0.5676018
1
Use the tknukewritenode app interface to find and reset the render path of any Tank write nodes in the current script
def _reset_write_node_render_paths(self): write_node_app = self.parent.engine.apps.get("tk-nuke-writenode") if not write_node_app: return False # only need to forceably reset the write node render paths if the app version # is less than or equal to v0.1.11 from distu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateTree(self):\n self.reset()\n self.resetTree() \n self.read()", "def changeNodeLib(ned, createNodeWin):\n pass", "def updatetree(self):\n if self.node:\n self.node.update()\n self.draw()", "def fRenderTargetBackupTab():\n node = nuke.thisNode()\n # create t...
[ "0.5345771", "0.5233489", "0.5084201", "0.49955806", "0.49239224", "0.4833652", "0.48127708", "0.4807053", "0.48013398", "0.4722902", "0.47158727", "0.47130924", "0.47050682", "0.4693489", "0.46925712", "0.4680197", "0.46643654", "0.46602747", "0.46585917", "0.46569446", "0.4...
0.65005773
0
Initialisation, where df is a pandas DataFrame and var is the name of the column to study and init_pars is a dictionary with initial values
def __init__(self,df, init_pars, var='dep_var', var_name='Volume of Nile'): self.df = df self.var = var self.var_name = var_name self.y = np.array(df[var].values.flatten()) self.times = df.index self.pardict = init_pars self.options = {'eps':1e-09, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(param):\n MODULE_HELPER.check_parameter(param, key='featureCount_exec', dtype=str)\n MODULE_HELPER.check_parameter(param, key='featureCount_t', dtype=str)\n MODULE_HELPER.check_parameter(param, key='featureCount_id', dtype=str)\n MODULE_HELPER.check_parameter(param, key='featureCount_by_meta',...
[ "0.5726554", "0.55129045", "0.5489595", "0.5355379", "0.52944136", "0.5286923", "0.5284127", "0.5245464", "0.52217746", "0.52201474", "0.52157134", "0.52084327", "0.5173756", "0.5162606", "0.5160928", "0.51536846", "0.513594", "0.51033354", "0.5099015", "0.5089083", "0.508381...
0.7033673
0
multiplying a number by 5 function
def five_mult(x): return 5 * x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiply_numbers(first_number, second_number):", "def multiply(value, multiplier):\n return value*multiplier", "def helper(num):\r\n \r\n return lambda x: num * product(x)", "def mod_5(x):\r\n return x%5", "def multiplier(self) -> global___Expression:", "def multiply_by_4(x):\n\t...
[ "0.7047754", "0.6995963", "0.69738007", "0.69666034", "0.6825088", "0.6717752", "0.66833895", "0.66504025", "0.66504025", "0.657937", "0.6422854", "0.6368382", "0.6347893", "0.63396317", "0.63196534", "0.62954944", "0.6254306", "0.6249496", "0.62182474", "0.62080914", "0.6205...
0.8823891
0
recursion of a value
def tri_recursion(k): if(k>0): result = k + tri_recursion(k-1) # print(result) else: result = 0 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recur(number):\n if number == 1 or number == 0:\n return number\n else:\n check = recur(max(number - 1, 0))+recur(max(number - 2, 0))\n return check", "def recursive(input):\n\n # Base Case: Argument input greater than 0.\n if input <= 0:\n return 0\n else:\n ...
[ "0.6645191", "0.6535834", "0.6381994", "0.63048947", "0.6251828", "0.6248429", "0.61911374", "0.6188937", "0.6067438", "0.60306674", "0.5995112", "0.59597176", "0.594877", "0.59247464", "0.5921001", "0.5912498", "0.5909545", "0.58961886", "0.5894752", "0.5893231", "0.58901757...
0.686639
0
generates XML I/O mapping for package ACCO, adding it to globalMap
def makeMapping(globalMap): from memops.xml.Implementation import bool2str, str2bool # Set up top level dictionaries loadMaps = globalMap.get('loadMaps') mapsByGuid = globalMap.get('mapsByGuid') abstractTypes = globalMap.get('ACCO').get('abstractTypes') exolinks = globalMap.get('ACCO').get('exolinks') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeMapping(globalMap):\n \n from memops.xml.Implementation import bool2str, str2bool\n\n # Set up top level dictionaries\n loadMaps = globalMap.get('loadMaps')\n mapsByGuid = globalMap.get('mapsByGuid')\n\n abstractTypes = globalMap.get('ANAP').get('abstractTypes')\n exolinks = globalMap.get('ANAP').ge...
[ "0.64070976", "0.6367374", "0.62000525", "0.6076145", "0.56269336", "0.540561", "0.54037416", "0.5370882", "0.53047323", "0.51571155", "0.5128653", "0.5097843", "0.50681853", "0.5067503", "0.5059321", "0.50549144", "0.5013462", "0.50095636", "0.50081456", "0.49879944", "0.498...
0.65873575
0
Given a file returns the number of lines where a certain pattern appears.
def count_patterns(pattern, file): count = 0 with open(file, 'r') as f: for line in f: if re.search(pattern, line): count += 1 print("The pattern '{}' appears {} times.".format(pattern, count))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_count(file):\n with open(file, \"r\") as f:\n return sum(1 for line in f)", "def count_lines(filename):\n with open(filename, 'rb') as f:\n return sum(1 for line in f)", "def count_lines(filename):\r\n with open(filename, 'rb') as f:\r\n return sum(1 for line in f)", "d...
[ "0.79906595", "0.7601465", "0.7589926", "0.7400159", "0.7400159", "0.7367526", "0.7361509", "0.7314271", "0.7307912", "0.7246522", "0.72217196", "0.71740115", "0.7155738", "0.7092855", "0.7072881", "0.7064458", "0.70398235", "0.7038543", "0.7035276", "0.7028555", "0.7019521",...
0.79991657
0
Given a dataset with a string column , filter rows containing a certain pattern.
def pattern_search(pattern, dataset, column): # Filter dataset = dataset[dataset[column].str.contains(pattern, regex=True)] # Reset index dataset = dataset.reset_index(drop=True) # Return return dataset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, filter_strings):\n if filter_strings is None:\n filter_strings = []\n\n result = RowSet()\n for row in self.rows:\n match = True\n for s in filter_strings:\n if not row.filter(s):\n match = False\n ...
[ "0.6799201", "0.59878045", "0.5795762", "0.5779332", "0.5757394", "0.574811", "0.5722822", "0.57140815", "0.56623626", "0.56492823", "0.5607389", "0.5594936", "0.5588069", "0.5576866", "0.5554488", "0.5542753", "0.55349904", "0.5508957", "0.54967576", "0.546392", "0.5438134",...
0.7813946
0
Given a dataset with pollsters column and the pollsters grade in traditional format, it merges the columns and floors the grade.
def grade_cleaning(dataset, pollsters): # Merge grades dataset_grades = pd.merge(dataset, pollsters[["Pollster", "538 Grade", "Predictive Plus-Minus"]], how='inner', left_on='pollster', right_on='Pollster') dataset_grades = dataset_grades.drop(['Pollster'], axis=1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organize_data(scores, stds):\n\n scores = pd.Series(list(scores.values()),\n index=map(str, scores.keys()),\n name=\"SCORE MEAN\")\n scores.index.name = \"AUXILIARY LOSS WEIGHTS\"\n stds = pd.Series(list(stds.values()),\n ...
[ "0.5142071", "0.5063618", "0.49147916", "0.48610595", "0.4855685", "0.48401833", "0.48022565", "0.47576785", "0.47571915", "0.47113907", "0.4704346", "0.46972775", "0.46791285", "0.465144", "0.46333814", "0.46222302", "0.46004865", "0.45951855", "0.45889464", "0.45674625", "0...
0.7066124
0
Given a grade in traditional format returns its numerical value.
def grades_to_number(grade): # Conditions if grade == "A": return 1 elif grade == "B": return 0.5 elif grade == "C": return 0 elif grade == "D": return -0.5 else: return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grade_conversion(grade):\n grade_converter = {\"A\": 4.00, \"A-\":3.67, \"B+\": 3.33, \"B\": 3.00, \"B-\": 2.67, \"C+\": 2.33, \"C\": 2.00, \"C-\": 1.67, \"D\": 1.00, \"F\": 0.0}\n while True:\n for val, val2 in grade_converter.items():\n if grade == val:\n return val2", ...
[ "0.73501873", "0.68947804", "0.68758976", "0.66896164", "0.6650556", "0.663879", "0.6590116", "0.6418488", "0.641584", "0.639903", "0.6305388", "0.61268765", "0.6086562", "0.60312635", "0.588034", "0.58800024", "0.5850215", "0.5826675", "0.5701853", "0.5628017", "0.5513478", ...
0.8073355
0
Raise error if statement is false. Adds component information to message.
def assertTrue(self, statement, message): prefix = "In component %s: " % self.name if not statement: error(prefix + str(message))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def err_message(self, message):\n self.errors.append(1)\n message = \"<b>\" + message + \"</b>\"\n self.timer_id = GLib.timeout_add_seconds(5, self.error_false)\n # Show if is was hidden\n if self.hidden:\n self.toggle()\n self.was_hidden = True\n sel...
[ "0.56584454", "0.55685383", "0.5480881", "0.5420251", "0.5274064", "0.5239337", "0.5213085", "0.5182997", "0.5171589", "0.51616085", "0.51604795", "0.51502395", "0.513914", "0.5138146", "0.5124125", "0.51095736", "0.50949955", "0.5094471", "0.5077176", "0.5068538", "0.506511"...
0.6945145
0
Compile data into NUPACK format and output it
def output_nupack(self, prefix, outfile): if prefix: outfile.write("#\n## Component %s\n" % prefix[:-1]) else: outfile.write("#\n## Top Component\n") used_seqs = set() # Define structures for struct in list(self.structs.values()): outfile.write("structure %s = %s\n" % (st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pack_data( self, data ) : \r\n \r\n # hints = self._translation_table.get( type(data), None )\r\n hints = self._get_hints( data ) \r\n \r\n if hints is None : \r\n \r\n ## #debug: \r\n ## print \"_pack_data(): no hints for data ty...
[ "0.5695821", "0.55385834", "0.5406081", "0.53828984", "0.5377109", "0.53617066", "0.53571606", "0.53300756", "0.53291017", "0.53282076", "0.532767", "0.5307225", "0.5276184", "0.5275858", "0.52680707", "0.5247397", "0.5245808", "0.51902896", "0.5184493", "0.51772344", "0.5161...
0.6070958
0
test the check_sparse helper function of the class
def test_check_sparse(self): x, x_rand, s = self.create_testdata() task = mmRDTR() #check that a dense array x is passed thru unchanged check = task.check_sparse(x) self.assertEqual(np.all(check==x),True) #check that a sparse matrix s is converted to a numpy array ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_return_sparse():\n X = Vectorizer(strategy=\"bow\", return_sparse=True).fit_transform(X_text, y10)\n assert all(pd.api.types.is_sparse(X[c]) for c in X.columns)", "def is_sparse(x: Any, backend=None) -> bool:\r\n module = get_module(backend)\r\n return module.is_sparse(x)", "def test_spars...
[ "0.7598279", "0.67092216", "0.66901195", "0.66851485", "0.65175474", "0.6501066", "0.6450492", "0.63985956", "0.6397077", "0.6388959", "0.63845825", "0.6358451", "0.63335603", "0.6332554", "0.6324011", "0.63189375", "0.6216197", "0.61706775", "0.6131384", "0.61189103", "0.611...
0.82182574
0
test the apply_ridit helper function of the class
def test_apply_ridit(self): x, x_rand, s = self.create_testdata() task = mmRDTR() s = task.check_sparse(s) for data in [x, x_rand, s]: #get ecdf for data Fn=task.make_ECDF(data) out=task.apply_ridit( data, Fn ) # check same dimension ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_rirs_update(self):\n pass", "def test_ipam_rirs_partial_update(self):\n pass", "def apply(self):", "def apply(self) -> None:", "def apply(self) -> None:", "def _regr_basic():", "def test_ipam_rirs_create(self):\n pass", "def test_ipam_rirs_list(self):\n pass"...
[ "0.61163276", "0.59165066", "0.58017886", "0.5764783", "0.5764783", "0.57614654", "0.56750005", "0.5673456", "0.55145764", "0.55145764", "0.55145764", "0.55145764", "0.55145764", "0.54082805", "0.53986454", "0.5394817", "0.5368661", "0.52817476", "0.5250451", "0.5250451", "0....
0.6735588
0
insert a new element e into L before position p in L
def insertBefore(self,p,e): if p == self.head: #if p is the head node e.next = p #link e to p p.prev = e #link p to e self.head = e #set e to be the 'new' head node else: e.prev = p.prev #link e to prev node of p e.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_before(self, p, e):\n original = self._validate(p)\n return self._insert_between(e, original._prev, original)", "def insert(self, p, elem):\n node = self._validate(p)\n new_node = self._Node(elem, idx=self._curr_idx, parent=node._parent)\n self._curr_idx += 1\n n...
[ "0.7177922", "0.6874387", "0.66734815", "0.66600996", "0.66056806", "0.65625167", "0.6527007", "0.6516699", "0.6501757", "0.6501425", "0.64947516", "0.64712495", "0.64524704", "0.6429785", "0.6418433", "0.6399305", "0.63491744", "0.6340355", "0.63270706", "0.6181561", "0.6172...
0.700999
1
remove from L the element at position p
def remove(self,p): if p == self.head: #if p is the head node self.head = p.next #set the next node of p to be the 'new' head node (p.next).prev = None #remove the node at p p.next = None elif p == self.tail: #if p is the tail node ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _primerElem(l):\n return l[0]", "def _delete(self, p):\n node = self._validate_position(p)\n if self.num_children() == 2:\n raise ValueError(\"p has two children\")\n child = node.left if node.left else node.right\n if child is not None:\n child.pa...
[ "0.7094929", "0.69678015", "0.6729318", "0.6718443", "0.67099273", "0.6697062", "0.6682515", "0.6554262", "0.64620167", "0.6452039", "0.63894767", "0.6297301", "0.62565506", "0.6173853", "0.6139017", "0.60856044", "0.60625595", "0.5995619", "0.5984009", "0.5981097", "0.597260...
0.7055117
1
Corrupt the user_actions Iterate through confidence scores from the user and assign confidence scores
def act(self): channel_act = copy.deepcopy(self.observation) for user_act in channel_act['user_acts']: # Dialogue Act da_conf = self.generate_confidence() da_value = user_act["dialogue_act"]["value"] if np.random.random() > da_conf: if da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processUserAction(self, user_action):\n self.history[\"user_action\"] = user_action\n dialogue_act = user_action[\"action\"]\n self.current_function = None\n self.dont_know = False\n\n\n def provideQuery():\n self.query = user_action[\"query\"]\n self.qu...
[ "0.599231", "0.57049847", "0.5691581", "0.56584775", "0.54967844", "0.5440647", "0.537422", "0.53671217", "0.53370816", "0.52791506", "0.5246821", "0.52241063", "0.5219914", "0.521852", "0.51977473", "0.51950365", "0.5189769", "0.51806927", "0.51794785", "0.5178694", "0.51723...
0.6197056
0
Converts user_acts into tempplate utterances
def template_nlg(self, user_acts): utt_list = [] for user_act in user_acts: user_dialogue_act = user_act['dialogue_act']['value'] if user_dialogue_act == UserAct.INFORM: # Template based NLG based on intent intent_slot = user_act.get('intent', None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_ta_from_act(baseurl, userid):\n\n objects = create_api_agent(baseurl, userid).object_search(\n object_type=[\"threatActor\"], limit=1000\n )\n\n ta_set = set()\n\n for x in objects:\n ta_set.add(x.value)\n\n return list(ta_set)", "def act(self):\n channel_act = cop...
[ "0.58724743", "0.5625835", "0.551214", "0.5409075", "0.53485686", "0.5217385", "0.5202939", "0.5195586", "0.51527953", "0.5138877", "0.51198244", "0.50440043", "0.50417674", "0.50400853", "0.5015522", "0.49861735", "0.49047104", "0.49036646", "0.48940292", "0.4872141", "0.485...
0.6775663
0
Makes a list of short language targets from docopt arguments.
def short_language_targets(arguments): language_targets = [('cocoa', 'Cocoa'), ('cpp', 'C++'), ('csharp', 'C#'), ('delphi', 'Delphi'), ('erl', 'Erlang'), ('go', 'Go'), ('hs', 'Haskell'), ('java', 'Java'), ('perl', 'Perl'), ('py', 'Python'), ('r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def targets(path, args):\n if args:\n return \" \".join([\"{0}{1}\".format(path, target) for target in args])", "def main(argv, to_language=TO_LANGUAGE, from_language=FROM_LANGUAGE):\n # TODO use docopt to handle the command line arguments! Cf. http://docopt.org/\n # TODO can docopt handle a cli docume...
[ "0.6037546", "0.59513944", "0.58951634", "0.56917363", "0.55272824", "0.5514861", "0.5499981", "0.54830027", "0.53945893", "0.5386601", "0.53694504", "0.53217447", "0.5305375", "0.5300996", "0.5243239", "0.51841044", "0.51742613", "0.517381", "0.51401", "0.51359576", "0.51312...
0.7530393
0
Generate wrappers for cpp and target languages using thrift.
def generate_thrift_wrappers(maxfile_name, dirs, targets): with common.change_working_directory(dirs['scratch']): run('thrift', '--gen', 'cpp', maxfile_name + '.thrift') for target in targets: run('thrift', '--gen', target, maxfile_name + '.thrift') target_dir = os.path.joi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genlangs(self):\r\n raise NotImplementedError", "def generate(env) -> None:\n c_file, cxx_file = SCons.Tool.createCFileBuilders(env)\n\n # C\n c_file.add_action(\".l\", LexAction)\n c_file.add_emitter(\".l\", lexEmitter)\n\n c_file.add_action(\".lex\", LexAction)\n c_file.add_emitter(\"....
[ "0.6480759", "0.58898515", "0.57488286", "0.5730907", "0.57146156", "0.56862015", "0.55958766", "0.5567627", "0.5498909", "0.53208256", "0.53153443", "0.52377367", "0.52115756", "0.5196872", "0.51798254", "0.5160678", "0.5137435", "0.51359266", "0.51251113", "0.51107913", "0....
0.7060585
0
Sets the total_hits of this SearchArticlesOldGet200ApplicationJsonResponse.
def total_hits(self, total_hits): self._total_hits = total_hits
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total(self):\n return self._evaluate()['hits']['total']", "def put(self):\n global hits\n hits += 1\n return {\"hits\": hits}, 200", "def reads_total(self, reads_total):\n\n self._reads_total = reads_total", "def total(self, total):\n\n self._total = total", "def t...
[ "0.54473805", "0.54155636", "0.52267927", "0.5190426", "0.5190426", "0.5190426", "0.5190426", "0.5190426", "0.5190426", "0.5190426", "0.5190426", "0.51651007", "0.4924236", "0.4924236", "0.48841897", "0.48756126", "0.48579973", "0.48558527", "0.4820793", "0.47767225", "0.4775...
0.7280627
0
Decide a new action for the pump, given the current height of liquid in the tank and the current action of the pump. Note that the new action for the pump MAY be the same as the current action of the pump.
def decide(self, current_height, current_action, actions): actions = actions.update({'DUMMY': 10}) if current_action == 'PUMP_OFF': if current_height < self.target_height - self.margin: output = 'PUMP_IN' elif current_height > self.margin + self.target_height: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action(self, action_space, observation, info): # pylint: disable=no-self-use\n _ = observation\n equity_alive = info['player_data']['equity_to_river_alive']\n\n incremen1 = .1\n increment2 = .2\n\n if equity_alive > self.min_bet_equity + increment2 and Action.ALL_IN in actio...
[ "0.60473734", "0.5985461", "0.5977221", "0.59078944", "0.5883411", "0.5873858", "0.5844478", "0.5834539", "0.58246136", "0.5776659", "0.57639843", "0.5763768", "0.57577544", "0.57437027", "0.5739798", "0.5713187", "0.5679994", "0.5670566", "0.56656426", "0.56560576", "0.56474...
0.68249935
0
Show derivative of plotted traces
def show_derivative(self): for trace in self.plotWidget.plotDataItems: dt = float(trace.attrs['dt']) dtrace = np.diff(trace.data) x = pgplot.make_xvector(dtrace, dt) self.plotWidget.plot(x, dtrace, pen=pg.mkPen('r'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_trace(self):\n az.plot_trace(self.ifd_)", "def plotTrace(trace):\n for t in trace:\n plt.plot(range(len(t)),t,alpha=0.5)\n plt.ylabel(\"Trace\")\n plt.xlabel(\"Step\")\n\n return", "def plotalltraces(td):\n \n plotmsubtrace(td, 211)\n dftf.plotflypic(td, 212)", "de...
[ "0.63325393", "0.6113642", "0.6045664", "0.6022848", "0.5986188", "0.5986095", "0.5979825", "0.58989567", "0.5875466", "0.5855709", "0.5802141", "0.57811975", "0.5743841", "0.57375747", "0.5692409", "0.5653667", "0.5639974", "0.56074584", "0.5578918", "0.5578197", "0.5554327"...
0.858307
0
Show horizontal cursor to set Derivative threshold
def show_derivativeCursor(self, var): if self.derivativeThreshold.isChecked(): self.plotWidget.derivativeCursorThsPos = 0 self.plotWidget.derivativeCursorThs = pg.InfiniteLine(pos=self.plotWidget.derivativeCursorThsPos, angle=0, movabl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int_33H_4(self):\r\n horizontal_position = self.registers['CX'].get_int(-1)\r\n vertical_position = self.registers['DX'].get_int(-1)\r\n print(horizontal_position, vertical_position)\r\n MainWindow.set_cursor_poisition(horizontal_position, vertical_position)", "def cmd_h(self):\n ...
[ "0.5796579", "0.55734044", "0.55304766", "0.5470074", "0.5419417", "0.5379397", "0.5370672", "0.532646", "0.52975315", "0.5263073", "0.5261954", "0.52364624", "0.5232485", "0.51936173", "0.517233", "0.5167267", "0.51614726", "0.5137182", "0.5129036", "0.51274407", "0.5126044"...
0.7340794
0
Vrne konflikte z dejavnostjo, ki bi v ucilnici `ucilnica` potekala dne `datum` od ure `od` do `do`.
def konflikti(self, ucilnica, datum, od, do, ignore=None): konflikti = Konflikt() if ucilnica not in self.ucilnice: raise ValueError("Struktura iskanja ni bila pripravljena za iskanje konfliktov v učilnici {}".format(ucilnica)) if not (self.min_datum <= datum <= self.max_datum): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def afficher(dico):\n return dico", "def konvertuj_datum(self, datum):\n brojevi = datum.split(\".\")\n konvertovani = date(int(brojevi[2]), int(brojevi[1]), int(brojevi[0]))\n return konvertovani", "def get_diluciju(self, naziv):\n jedinica = self.dilucijskeJedinice[naziv]\n ...
[ "0.58726335", "0.5751894", "0.55712575", "0.53919107", "0.5346459", "0.5335857", "0.52883875", "0.5163623", "0.51620984", "0.5089418", "0.5075269", "0.50245464", "0.50216717", "0.49458143", "0.48880613", "0.48880613", "0.48863357", "0.48458362", "0.47982788", "0.47760344", "0...
0.67294
0
Calls libueye function "name" and arguments "args".
def CALL(name, *args): funcname = 'is_' + name func = getattr(libueye, funcname) new_args = [] for a in args: if isinstance (a, unicode): print name, 'argument',a, 'is unicode' new_args.append (str (a)) else: new_args.append (a) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exec_function(self, args):\n raise NotImplementedError()", "def function(args):\n pass", "def execute(*args):", "def call_command(self, name, args):\n try:\n cmd = self.commands[name]\n except KeyError:\n self.answer(\"Unknown command\", success=False)\n ...
[ "0.640477", "0.6396848", "0.622575", "0.6156197", "0.6116038", "0.60650057", "0.6060712", "0.6041498", "0.59850496", "0.598363", "0.598363", "0.59757733", "0.5974144", "0.5971125", "0.59319705", "0.5909913", "0.59068924", "0.5881039", "0.584733", "0.5842975", "0.5842975", "...
0.7134281
0
AddToSequence() inserts image memory into the image memory list, which is to be used for ring buffering. The image memory has to be allocated with AllocImageMem(). All image memory which is used for ring buffering must have been allocated the same colour depth (i.e. bits per pixel). The number of image memories for a s...
def AddToSequence(self): self.seq += 1 r = CALL('AddToSequence',self,self.image,self.id) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blit_numbering_raster_sequence(\n seq: numpy.ndarray,\n *,\n placement: DoubleNumber = (0, 30),\n color: TripleNumber = (\n 0,\n 0,\n 1,\n ), # If your images are in [0, 255] range replace (0, 0, 1) with (0, 0, 255)\n thickness: Number = 2,\n font_scale: Number = 1,\n...
[ "0.59207517", "0.5390376", "0.53259945", "0.5279279", "0.5246303", "0.52161103", "0.5213354", "0.5180779", "0.5101926", "0.50713897", "0.5061602", "0.5060367", "0.5037115", "0.5005602", "0.5003824", "0.49623504", "0.49397454", "0.49381202", "0.49326006", "0.49286252", "0.4914...
0.692556
0
LockSeqBuf() can be used to disable the overwriting of the image memory with new image data. And thus it is possible to prevent images which are required for further processing from being overwritten. Full access to the image memory is still available. Only one image memory can be disabled at the same time. To access t...
def LockSeqBuf(self,number): r = CALL('LockSeqBuf',self,INT(number),self.image) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UnlockSeqBuf(self,number):\r\n r = CALL('UnlockSeqBuf',self,INT(number),self.image)\r\n return self.CheckForSuccessError(r)", "def lock(self, writelock=False, nattempts=0):\n return _image.image_lock(self, writelock, nattempts)", "def SetImageMem(self):\r\n r = CALL(\"SetImageMe...
[ "0.6084089", "0.56645983", "0.5099585", "0.5071171", "0.5041481", "0.50194633", "0.4996996", "0.49619144", "0.49557486", "0.4897481", "0.48785716", "0.4865201", "0.47347102", "0.470923", "0.47019348", "0.46933535", "0.46878475", "0.46854433", "0.46795315", "0.46741796", "0.46...
0.71576244
0
With UnlockSeqBuf() image acquisition is allowed in a previously locked image memory. The image memory is put to the previous position in the sequence list.
def UnlockSeqBuf(self,number): r = CALL('UnlockSeqBuf',self,INT(number),self.image) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LockSeqBuf(self,number):\r\n r = CALL('LockSeqBuf',self,INT(number),self.image)\r\n return self.CheckForSuccessError(r)", "def unlock(self):\n return _image.image_unlock(self)", "def AddToSequence(self):\r\n self.seq += 1\r\n r = CALL('AddToSequence',self,self.image,self....
[ "0.6962397", "0.5811078", "0.56012094", "0.5488451", "0.52648664", "0.52333075", "0.52333075", "0.5225316", "0.51950514", "0.51867604", "0.5148955", "0.5122874", "0.5096556", "0.5069418", "0.5010914", "0.5009539", "0.500756", "0.49962044", "0.49961293", "0.49904197", "0.49895...
0.67305315
1
The function GetLastMemorySequence() returns the ID of the last recorded sequence in the memory board. This parameter can then be used in combination with the function TransferImage() to read images out of the camera memory. No memory board to test this, Not tested!
def GetLastMemorySequence(self): r = CALL('GetLastMemorySequence',self,byref(self.id)) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_sequence_ind(self,):\n return self.last_sequence_ind_", "def getLast(self):\n return self.dataBuffer[len(self.dataBuffer) - 1]", "def getLastWaveIdentifier(self): \n return self.lastWaveIdentifier", "def getLastInstruction(self) -> ghidra.program.model.listing.Instruction:\n ...
[ "0.6061169", "0.5892281", "0.58848685", "0.58324695", "0.58267003", "0.58168834", "0.5726267", "0.5687172", "0.5649448", "0.5640867", "0.5622492", "0.5602114", "0.5586681", "0.5564437", "0.55424047", "0.552731", "0.5516105", "0.55109864", "0.5494791", "0.5479138", "0.5465261"...
0.8036485
0
Experiment to find out how it works TransferImage(self, INT nMemID, INT seqID, INT imageNr, INT reserved) Not in the user manual! Not implemented!
def TransferImage(): CALL('TransferImage',self,INT(),INT(),INT(),INT())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CopyImageMem(self):\r\n r = CALL(\"CopyImageMem\",self,self.image,self.id,self.data.ctypes.data)\r\n return self.CheckForSuccessError(r)", "def upload(self, img):\n # create a connection to sendspace\n (upl_url, upl_max_size, upl_id, upl_extra_info) = self.connect()\n # ret...
[ "0.6329293", "0.6220998", "0.6046591", "0.5963438", "0.56137717", "0.5613641", "0.5574188", "0.5550258", "0.55243576", "0.55123603", "0.5489153", "0.5420019", "0.54051477", "0.5369926", "0.5334564", "0.53238004", "0.53175116", "0.5273996", "0.5253874", "0.5251831", "0.5225943...
0.8339813
0
Experiment to find out how it works TransferMemorySequence(HIDS hf, INT seqID, INT StartNr, INT nCount, INT nSeqPos); Not in the user manual! Not implemented!
def TransferMemorySequence(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer(self,num_bytes,direction=DMA_FROM_DEV):\n if num_bytes > self.bufLength:\n raise RuntimeError(\"Buffer size smaller than the transfer size\")\n if num_bytes > DMA_TRANSFER_LIMIT_BYTES:\n raise RuntimeError(\"DMA transfer size > {}\".format(\n ...
[ "0.54891014", "0.5347686", "0.5318841", "0.5270872", "0.51825416", "0.5155339", "0.5146869", "0.5104306", "0.50902504", "0.50573677", "0.50363404", "0.49797234", "0.4931008", "0.490873", "0.48839486", "0.48791245", "0.48564565", "0.48082015", "0.47808975", "0.47191754", "0.47...
0.80883545
0
The function GetMemorySequenceWindow() can be used to check the window size of a specified memory board sequence. The assigned sequence ID is required as a parameter. Not tested!
def GetMemorySequenceWindow(self,id): top = INT() left = INT() right = INT() bottom = INT() CALL('GetMemorySequenceWindow',self,INT(id),byref(left),byref(top),byref(right),byref(bottom)) return (left.value,top.value,right.value,bottom.value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_window_size():\n \n wight = 870\n height = 519\n \n window = win32gui.FindWindow(MINECRAFT_CLASS_NAME, MINECRAFT_TITLE + MINECRAFT_VERSION)\n x0, y0, x1, y1 = win32gui.GetWindowRect(window)\n # x0 and y0 are initial points, upper left corner and lower left corner\n # then we need ...
[ "0.5690125", "0.54432243", "0.53728735", "0.53610545", "0.52660197", "0.5167988", "0.51675874", "0.5138758", "0.51371366", "0.51131445", "0.5107756", "0.5100013", "0.50933105", "0.5079727", "0.5071882", "0.5068407", "0.5062683", "0.49924228", "0.49746266", "0.49321997", "0.49...
0.723778
0
With GetActSeqBuf() the image memory in which image acquisition (ppcMem) is currently taking place and the image memory which was last used for image acquisition (ppcMemLast) can be deter mined. This function is only available when the ring buffer is active. If image acquisition is started for a ring buffer, GetActSeqB...
def GetActSeqBuf(self): aqID = INT() pcMem = c_char_p() pcMemLast = c_char_p() paqID = byref(aqID) ppcMem = byref(pcMem) ppcMemLast = byref(pcMemLast) r = CALL('GetActSeqBuf',self,paqID,ppcMem,ppcMemLast) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sequenceAcqu(self):\n print('New-Seq_acq')\n exp = (self.mmc.getExposure())*0.001 #converted in s\n ledOnDuration = exp*self.expRatio[0]\n print('time LED ON (s) : ', ledOnDuration)\n\n print(\"Nb of frames : \", self.nbFrames)\n imageCount = 0\n\n pool = Threa...
[ "0.5627501", "0.5494958", "0.5061174", "0.50324005", "0.502218", "0.49722916", "0.4871921", "0.48253193", "0.47874895", "0.4785045", "0.47748902", "0.4767203", "0.47671735", "0.47668168", "0.474207", "0.46511355", "0.46315074", "0.45889023", "0.4576766", "0.4576253", "0.45573...
0.6706684
0
AllocImageMem() allocates image memory for an image with width, width and height, height and colour depth bitspixel. Memory size
def AllocImageMem(self,width=1024,height=768,bitpixel=8): self.image = c_char_p() self.id = INT() r = CALL('AllocImageMem',self, INT(width), INT(height), INT(bitpixel), byref(self.image), byref(self.id)) return self.Ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetAllocatedImageMem(self,width=1024,height=768,bitpixel=8):\r\n self.image = self.data.ctypes.data_as(c_char_p)\r\n self.id = INT()\r\n r = CALL('SetAllocatedImageMem',self,\r\n INT(width),\r\n INT(height),\r\n INT(bitpixel),\r\n self.data.ctype...
[ "0.6616378", "0.6572187", "0.58373463", "0.5794703", "0.5751268", "0.56347877", "0.5547725", "0.5499699", "0.5445616", "0.5373528", "0.52685547", "0.5174698", "0.5127752", "0.5101924", "0.5101255", "0.50806683", "0.5023088", "0.50209063", "0.49926105", "0.4966518", "0.4951278...
0.7672257
0
The function GetNumberOfMemoryImages() returns the number of valid images that are currently located in the camera memory within the specified sequence ID. This number can differ from the originally recorded number of images because of overwriting. Not tested!
def GetNumberOfMemoryImages(self): number = INT() r = CALL('GetNumberOfMemoryImages',self,INT(self.seq),byref(number)) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_of_images(self):", "def n_images_acquired(self):\n n = ct.c_long()\n self.lib.GetTotalNumberImagesAcquired(ct.pointer(n))\n return n.value", "def get_image_count(self):\n return self._num_images", "def get_cameras_number():\n lib.initlib()\n return lib.is_GetNumb...
[ "0.6676571", "0.65308803", "0.62239295", "0.62019396", "0.61771584", "0.61675495", "0.61380553", "0.61248803", "0.6089397", "0.6089397", "0.6089397", "0.60535747", "0.6038884", "0.6011779", "0.6006518", "0.6004487", "0.599203", "0.58890057", "0.58890057", "0.58890057", "0.588...
0.8223581
0
SetImageMem() sets the allocated image memory to active memory. Only an active image memory can receive image data. After calling SetImageMem() function SetImageSize() must follow to set the image size of the active memory. A pointer from function AllocImgMem() has to be given to parameter pcImgMem.
def SetImageMem(self): r = CALL("SetImageMem",self,self.image,self.id) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetAllocatedImageMem(self,width=1024,height=768,bitpixel=8):\r\n self.image = self.data.ctypes.data_as(c_char_p)\r\n self.id = INT()\r\n r = CALL('SetAllocatedImageMem',self,\r\n INT(width),\r\n INT(height),\r\n INT(bitpixel),\r\n self.data.ctype...
[ "0.7618905", "0.6651815", "0.6251461", "0.5740315", "0.57321954", "0.5631259", "0.5518322", "0.5349664", "0.52179897", "0.5142729", "0.51273984", "0.51216274", "0.5033604", "0.5016422", "0.5004", "0.49997732", "0.49759445", "0.49490502", "0.49485502", "0.49477434", "0.4937284...
0.78645116
0
FreeImageMem() deallocates previously allocated image memory.i For pcImgMem one of the pointers from AllocImgMem() has to be used. All other pointers lead to an error message! The repeated handing over of the same pointers also leads to an error message
def FreeImageMem (self): r = CALL("FreeImageMem",self,self.image,self.id) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __exit__(self, *_):\r\n\t\tself.ueye.is_FreeImageMem(self.hCam, self.pcImageMemory, self.MemID)\r\n\r\n\t\t# Disables the hCam camera handle and releases the data structures and memory areas taken up by the uEye camera\r\n\t\tself.ueye.is_ExitCamera(self.hCam)", "def free_int_mem(self):\n self.lib.Fre...
[ "0.64440423", "0.62874573", "0.61488086", "0.5999576", "0.59756696", "0.59691554", "0.59213704", "0.5740886", "0.5714064", "0.56540054", "0.5632984", "0.5619123", "0.5605082", "0.5587151", "0.5580869", "0.5533592", "0.5524327", "0.55048376", "0.5504792", "0.5502427", "0.54957...
0.7937349
0
Set an allocated memory, that was not allocated using AllocImageMem, to the driver so it can be used to store the image that will be degitized. The allocated memory must be globally locked. (Basically, use this if some nondriver function happens to have some memory already allocated, so you don't need to allocate more ...
def SetAllocatedImageMem(self,width=1024,height=768,bitpixel=8): self.image = self.data.ctypes.data_as(c_char_p) self.id = INT() r = CALL('SetAllocatedImageMem',self, INT(width), INT(height), INT(bitpixel), self.data.ctypes.data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetImageMem(self):\r\n r = CALL(\"SetImageMem\",self,self.image,self.id)\r\n return self.CheckForSuccessError(r)", "def GetImageMem(self):\r\n CALL('GetImageMem',self,byref(self.image))", "def CopyImageMem(self):\r\n r = CALL(\"CopyImageMem\",self,self.image,self.id,self.data.ct...
[ "0.7402396", "0.66219264", "0.6307344", "0.6264005", "0.6122258", "0.6064721", "0.6030779", "0.6020769", "0.60027856", "0.59418774", "0.5817562", "0.5667821", "0.5655998", "0.56383294", "0.5613352", "0.5534367", "0.5529542", "0.5491862", "0.5460692", "0.5405741", "0.54041404"...
0.7015416
1
GetActiveImageMem() returns the pointer to the beginning and the ID number of the active memory. If DirectDraw mode is active and image memory has been allocated, this function returns the pointer and the ID of the image memory, which was activated with SetImageMem(). However, it should be noted that in DirectDraw mode...
def GetActiveImageMem(self): CALL('GetActiveImageMem',self,byref(self.image),byref(self.id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetImageMem(self):\r\n CALL('GetImageMem',self,byref(self.image))", "def CopyImageMem(self):\r\n r = CALL(\"CopyImageMem\",self,self.image,self.id,self.data.ctypes.data)\r\n return self.CheckForSuccessError(r)", "def gpu_memory_info(device_id=0):\n free = ctypes.c_uint64()\n tota...
[ "0.67824006", "0.5597025", "0.5579964", "0.5479365", "0.5476903", "0.53032494", "0.50066215", "0.49821952", "0.49688146", "0.49688146", "0.49688146", "0.49688146", "0.49688146", "0.49688146", "0.49688146", "0.49657318", "0.49247557", "0.49197346", "0.49170998", "0.49014604", ...
0.8161192
0
GetImageMem() returns the pointer to the start of the active image memory. In DirectDraw mode the pointer is returned to the back buffer (or the visible area DirectDraw Primary Surface mode).
def GetImageMem(self): CALL('GetImageMem',self,byref(self.image))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetActiveImageMem(self):\r\n CALL('GetActiveImageMem',self,byref(self.image),byref(self.id))", "def CopyImageMem(self):\r\n r = CALL(\"CopyImageMem\",self,self.image,self.id,self.data.ctypes.data)\r\n return self.CheckForSuccessError(r)", "def AllocImageMem(self,width=1024,height=768,b...
[ "0.7460679", "0.6584813", "0.6127438", "0.57283247", "0.56294703", "0.5555408", "0.5555408", "0.5555408", "0.5555408", "0.5555408", "0.5555408", "0.5555408", "0.54311067", "0.5347561", "0.5340391", "0.5305238", "0.52647305", "0.5254108", "0.52021575", "0.51812404", "0.5174073...
0.78059375
0
CopyImageMem() copies the contents of the image memory, as described is pcSource and nID to the area in memory, which pcDest points to.
def CopyImageMem(self): r = CALL("CopyImageMem",self,self.image,self.id,self.data.ctypes.data) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_image(img: Image) -> Image:\n width, height = img.size\n new_img = Image.new(img.mode, img.size)\n new_pixels = new_img.load() # New Image pixels, default: all black.\n pixels = img.load() # Input Image pixels.\n for x in range(width):\n for y in range(height):\n new_pix...
[ "0.576396", "0.57384807", "0.56374925", "0.56293875", "0.5537115", "0.5518485", "0.54961926", "0.54178214", "0.53316796", "0.53236693", "0.53062844", "0.5238389", "0.5208273", "0.5200405", "0.5180205", "0.5167048", "0.51256067", "0.51174074", "0.50254786", "0.49877104", "0.49...
0.791541
0
CaptureVideo() digitizes video images in real time and transfers the images to the previously allocated image memory. Alternatively if you are using DirectDraw the images can be transferred to the graphics board. The image acquisition (DIB Mode) takes place in the memory which has been set by SetImageMem() and AllocIma...
def CaptureVideo(self,wait=IS.DONT_WAIT): r = CALL("CaptureVideo",self,INT(wait)) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capture(self):\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.grab()\n self.vid.gra...
[ "0.63115054", "0.6152999", "0.59013313", "0.58645725", "0.57968444", "0.5737996", "0.57196504", "0.5652519", "0.55645716", "0.5542248", "0.5521725", "0.55036235", "0.54414064", "0.54344016", "0.53873783", "0.5380199", "0.5375573", "0.53666544", "0.5350495", "0.5342905", "0.53...
0.70174927
0
The StopLiveVideo() function freezes the image in the VGA card or in the PC's system memory. The function is controlled with
def StopLiveVideo(self,wait=IS.DONT_WAIT): r = CALL("StopLiveVideo",self,INT(wait)) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_video_server(_total):\r\n video_server = getattr(world, 'video_source', None)\r\n if video_server:\r\n video_server.shutdown()", "def stop_live(self):\n self._toolbox.disable_streaming_flag()\n self._toolbox.disable_webcam(self._index)\n self._prompt.kill()", "def sto...
[ "0.6991777", "0.6940316", "0.6929381", "0.68190914", "0.67107403", "0.6597823", "0.6583434", "0.6512658", "0.64685744", "0.64407724", "0.6422619", "0.64002013", "0.6393008", "0.6362295", "0.6283709", "0.6258325", "0.622677", "0.62158215", "0.6209707", "0.61776364", "0.6160418...
0.7543952
0
There is a rewritable EEPROM in the camera which serves as a small memory. Additionally to the information which is stored in the EEPROM, 64 extra bytes can be written. With the ReadEEPROM() command the contents of these 64 bytes can be read. See WriteEEPROM.
def ReadEEPROM(self,offset = 0, count = 64): if offset + count > 64: sys.stderr.write("offset + count too big, must be smaller or equal 64") raise buffer = create_string_buffer(count) CALL('ReadEEPROM',self,INT(offset),buffer,INT(count)) return buffer.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def WriteEEPROM(self, content, offset = 0):\r\n count = len(content)\r\n if count + offset > 64:\r\n raise Exception(\"Content to long\")\r\n pcString = c_char_p(content)\r\n r = CALL('WriteEEPROM',self,INT(offset),pcString,INT(count))\r\n return self.CheckForSuccessEr...
[ "0.6319234", "0.56649333", "0.55280775", "0.5375901", "0.52162194", "0.5143304", "0.5135952", "0.51126176", "0.5111086", "0.5098229", "0.5038877", "0.50353706", "0.49758065", "0.49262488", "0.49171293", "0.49111095", "0.4910159", "0.49044698", "0.49027112", "0.48953053", "0.4...
0.57210016
1
In the DCU camera there is a rewritable EEPROM, where 64 bytes of information can be written. With the ReadEEPROM() function the contents of this 64 byte block can be read.
def WriteEEPROM(self, content, offset = 0): count = len(content) if count + offset > 64: raise Exception("Content to long") pcString = c_char_p(content) r = CALL('WriteEEPROM',self,INT(offset),pcString,INT(count)) return self.CheckForSuccessError(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadEEPROM(self,offset = 0, count = 64):\r\n if offset + count > 64:\r\n sys.stderr.write(\"offset + count too big, must be smaller or equal 64\")\r\n raise\r\n buffer = create_string_buffer(count)\r\n CALL('ReadEEPROM',self,INT(offset),buffer,INT(count))\r\n r...
[ "0.6042261", "0.54330003", "0.52526534", "0.52253497", "0.5193807", "0.51187974", "0.50331044", "0.5017932", "0.4991936", "0.48770434", "0.48613754", "0.4837506", "0.48153642", "0.48085576", "0.47987148", "0.4787133", "0.47628757", "0.47406593", "0.47082168", "0.46985582", "0...
0.6103962
0
Called when this item is picked up by the player
def on_take(self): print("You have picked up", self.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pickup_item(self, ):\n if (self.charac_pos.x, self.charac_pos.y) == self.pos_item['ether']:\n self.pos_item['ether'] = (0, 0 * sprite_size)\n self.item_count += 1\n self.sound_item.play()\n if (self.charac_pos.x, self.charac_pos.y) == self.pos_item['tube']:\n ...
[ "0.7146995", "0.68761605", "0.6870488", "0.6847355", "0.68059784", "0.6717971", "0.64551896", "0.6427112", "0.6412922", "0.64051783", "0.6392263", "0.63346094", "0.62734675", "0.618369", "0.61465937", "0.6142249", "0.6100217", "0.6097457", "0.60778993", "0.6074445", "0.599273...
0.70965105
1
Called when this item is dropped by the player
def on_drop(self): print("You have dropped", self.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_drop(self, item):\n dropped = self.drop(item)\n if dropped:\n self.handler.message_box.add_msg(\"You drop the {}!\".format(dropped),\n data.COLOURS['player_item_text'])", "def drop(self, item: Item):\n self.items.remove(item)\...
[ "0.80975914", "0.7594839", "0.74566597", "0.73042905", "0.7237568", "0.72101736", "0.7155132", "0.7151828", "0.7109596", "0.6984946", "0.69737184", "0.6890466", "0.68652225", "0.68452036", "0.6787491", "0.67635703", "0.64342856", "0.64155585", "0.6387442", "0.63798624", "0.63...
0.8000647
1
Accepts a list of urls and checks to see if they are formatted properly and are reachable. The function checks the scheme, then network location (hostname), and if both of those exist, it will attempt to request the url and record any error messages it receives. It uses a real UserAgent so it can get past redirects and...
def check_validity(urls): invalid_urls = [] user_agent = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X " "10_12_3) AppleWebKit/537.36 (KHTML, like " "Gecko) Chrome/56.0.2924.87 Safari/537.36"} for url in urls: result = urlpar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_unreachable_urls(list_of_urls):\n list_of_reachable_url = []\n for url in list_of_urls:\n try:\n f = requests.get(url)\n print('\\t',url, 'status_code:', f.status_code)\n list_of_reachable_url.append(url)\n except:\n print('\\t',url, 'not r...
[ "0.6424543", "0.63942724", "0.63441634", "0.6322449", "0.62593704", "0.62425035", "0.61717874", "0.61462724", "0.6141986", "0.61378294", "0.60741097", "0.6065361", "0.5937483", "0.59069526", "0.58640397", "0.5852774", "0.58442056", "0.5838501", "0.5793359", "0.5778443", "0.57...
0.76034284
0
Returns a new LDAP root for dc=example,dc=com.
def getRoot(self): return inmemory.ReadOnlyInMemoryLDAPEntry( dn=distinguishedname.DistinguishedName("dc=example,dc=com") )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domainroot(d):\n dn = str2dn(d)\n dn.pop(0)\n return dn2str(dn)", "def direct():\n\n unsafe_dc = request.args['dc']\n unsafe_filter = request.args['username']\n\n dn = \"dc={}\".format(unsafe_dc)\n search_filter = \"(user={})\".format(unsafe_filter)\n\n srv = ldap3.Server('ldap://127.0.0.1'...
[ "0.6270654", "0.5712243", "0.545023", "0.5329593", "0.50764936", "0.5068848", "0.5041615", "0.50335836", "0.49236822", "0.48996553", "0.48969284", "0.48898906", "0.48693934", "0.48487878", "0.47870293", "0.4745563", "0.47230995", "0.47035939", "0.4702607", "0.46856213", "0.46...
0.63973844
0
Objects are equal when the have the same LDAP entry.
def testAddOpEqualitySameEntry(self): first_entry = entry.BaseLDAPEntry( dn="ou=Duplicate Team, dc=example,dc=com", attributes={"foo": ["same", "attributes"]}, ) second_entry = entry.BaseLDAPEntry( dn="ou=Duplicate Team, dc=example,dc=com", attribu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_equal_on_equal(self):\n a = Certificate(\n certificate_type=self.certificate_type_b,\n certificate_value=self.certificate_value_b)\n b = Certificate(\n certificate_type=self.certificate_type_b,\n certificate_value=self.certificate_value_b)\n\n ...
[ "0.663903", "0.66290337", "0.6565405", "0.645035", "0.64484584", "0.6415347", "0.6400843", "0.628204", "0.6277051", "0.62680084", "0.62679434", "0.6235978", "0.62092066", "0.62021416", "0.61936814", "0.6190466", "0.6190466", "0.6190466", "0.6174414", "0.6152447", "0.61515516"...
0.6938779
0
Objects are not equal when the have different LDAP entries.
def testAddOpInequalityDifferentEntry(self): first_entry = entry.BaseLDAPEntry( dn="ou=First Team, dc=example,dc=com", attributes={"foo": ["same", "attributes"]}, ) second_entry = entry.BaseLDAPEntry( dn="ou=First Team, dc=example,dc=com", attribut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_differentClassesEquality(self):\n self.assertFalse(Record(1, 2) == DifferentRecord(1, 2))", "def test_not_equal_on_equal(self):\n a = Certificate(\n certificate_type=self.certificate_type_b,\n certificate_value=self.certificate_value_b)\n b = Certificate(\n ...
[ "0.6809871", "0.6767201", "0.6744707", "0.6736668", "0.66851926", "0.668116", "0.6680744", "0.6642496", "0.66402555", "0.6628646", "0.66133076", "0.65468353", "0.6545497", "0.6531632", "0.6517792", "0.6498798", "0.64390373", "0.64005816", "0.6388611", "0.63755107", "0.637537"...
0.68304837
0
It return the LDIF representation of the delete operation.
def testAsLDIF(self): sut = delta.DeleteOp("dc=example,dc=com") result = sut.asLDIF() self.assertEqual( b"""dn: dc=example,dc=com changetype: delete """, result, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self):\n return self.get_data()", "def _get_delete_packet(self):\n return self.__delete_packet", "def delete(self):\n return self.request('', pylastica.request.Request.DELETE)", "def get_delete_data(cmd, etid, request_object):\n cascade = False\n # Below will decide ...
[ "0.64063877", "0.640283", "0.63555926", "0.61276275", "0.6070813", "0.60174006", "0.5975395", "0.59719837", "0.59278756", "0.5879305", "0.5857722", "0.58412755", "0.5840907", "0.5810483", "0.5733122", "0.5722565", "0.5706737", "0.5697221", "0.5696561", "0.56930155", "0.569107...
0.6950992
0
Objects are equal when the have the same DN.
def testDeleteOpEqualitySameDN(self): first_entry = entry.BaseLDAPEntry(dn="ou=Team, dc=example,dc=com") second_entry = entry.BaseLDAPEntry(dn="ou=Team, dc=example,dc=com") first = delta.DeleteOp(first_entry) second = delta.DeleteOp(second_entry) self.assertEqual(first, second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testDeleteOpEqualityEqualDN(self):\n first_dn = distinguishedname.DistinguishedName(\n stringValue=\"ou=Team,dc=example,dc=com\"\n )\n first = delta.DeleteOp(first_dn)\n\n second_entry = entry.BaseLDAPEntry(dn=\"ou=Team, dc=example, dc=com\")\n second = delta.Delet...
[ "0.665897", "0.6595536", "0.6559323", "0.65231705", "0.64151347", "0.63600206", "0.6305464", "0.6276601", "0.62563235", "0.61931187", "0.61730045", "0.6166215", "0.61655784", "0.61634344", "0.61440104", "0.6120709", "0.6116827", "0.6102328", "0.6101921", "0.60912746", "0.6087...
0.6638436
1
DeleteOp objects are equal if their DNs are equal.
def testDeleteOpEqualityEqualDN(self): first_dn = distinguishedname.DistinguishedName( stringValue="ou=Team,dc=example,dc=com" ) first = delta.DeleteOp(first_dn) second_entry = entry.BaseLDAPEntry(dn="ou=Team, dc=example, dc=com") second = delta.DeleteOp(second_entry...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testDeleteOpEqualitySameDN(self):\n first_entry = entry.BaseLDAPEntry(dn=\"ou=Team, dc=example,dc=com\")\n second_entry = entry.BaseLDAPEntry(dn=\"ou=Team, dc=example,dc=com\")\n\n first = delta.DeleteOp(first_entry)\n second = delta.DeleteOp(second_entry)\n\n self.assertEqua...
[ "0.73695445", "0.7121779", "0.6974125", "0.6964153", "0.68876994", "0.66953886", "0.6677444", "0.62607294", "0.62252873", "0.62102026", "0.6203794", "0.61505586", "0.5923089", "0.58912915", "0.5797456", "0.57742137", "0.5747886", "0.56847215", "0.56771487", "0.56651294", "0.5...
0.7539459
0
If fail to delete when the RDN does not exists.
def testDeleteOp_DNNotFound(self): root = self.getRoot() sut = delta.DeleteOp("cn=nope,dc=example,dc=com") deferred = sut.patch(root) failure = self.failureResultOf(deferred) self.assertIsInstance(failure.value, ldaperrors.LDAPNoSuchObject)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_non_existing_resource(self):\n CommonTestCases.admin_token_assert_in(\n self,\n delete_assigned_resource_from_non_existing_resource,\n \"Resource does not exist\"\n )", "def test_delete_non_existing(created_test_helper, request):\n # delete all fi...
[ "0.6679839", "0.639518", "0.63135505", "0.62912107", "0.62724584", "0.62544453", "0.62386143", "0.6193215", "0.61845905", "0.6167773", "0.6097933", "0.6097221", "0.6082274", "0.6032078", "0.60291326", "0.6018721", "0.59913737", "0.597406", "0.59729934", "0.59676313", "0.59641...
0.645009
1
Modify operations for different DN are not equal.
def testInequalityDiffertnDN(self): first = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) second = delta.ModifyOp( "cn=doe,dc=example,dc=com", [delta.Delete("description")] ) self.assertNotEqual(first, second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInequalityDiffertnOperations(self):\n first = delta.ModifyOp(\n \"cn=john,dc=example,dc=com\", [delta.Delete(\"description\")]\n )\n second = delta.ModifyOp(\n \"cn=doe,dc=example,dc=com\", [delta.Delete(\"homeDirectory\")]\n )\n\n self.assertNotEqua...
[ "0.6681576", "0.65745145", "0.65569013", "0.6536842", "0.64830977", "0.6244514", "0.6045619", "0.6024494", "0.5961783", "0.59554327", "0.59079593", "0.58932847", "0.58687186", "0.58522695", "0.5812426", "0.5788335", "0.5754975", "0.57522243", "0.5747672", "0.573616", "0.57223...
0.7554225
0
Modify operations with different modifications are not equal
def testInequalityDifferentModifications(self): first = delta.ModifyOp("cn=john,dc=example,dc=com", [delta.Add("description")]) second = delta.ModifyOp( "cn=john,dc=example,dc=com", [delta.Delete("description")] ) self.assertNotEqual(first, second)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mutate(self, change: Statement) -> None:\n self.assertThat(\n statement_mutates(change.statement()),\n Equals(True),\n )", "def testInequalityNotModifyOP(self):\n sut = delta.ModifyOp(\"cn=john,dc=example,dc=com\", [delta.Delete(\"description\")])\n\n se...
[ "0.6674253", "0.6627485", "0.63496286", "0.6284287", "0.6184366", "0.61420083", "0.6137223", "0.6102831", "0.6047738", "0.60134405", "0.60112035", "0.6003769", "0.5979842", "0.5949728", "0.59481263", "0.5919961", "0.5910403", "0.59081334", "0.59034055", "0.58968216", "0.58823...
0.742697
0
If fail to modify when the RDN does not exists.
def testModifyOp_DNNotFound(self): root = self.getRoot() sut = delta.ModifyOp( "cn=nope,dc=example,dc=com", [delta.Add("foo", ["bar"])], ) deferred = sut.patch(root) failure = self.failureResultOf(deferred) self.assertIsInstance(failure.value, ld...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_existing_key_fail(self, data, new_data):\n message = 'exists'\n rv = self.add_success(data)\n assert not in_response(rv, message)\n rv = self.add_success(new_data)\n assert not in_response(rv, message)\n rv = self.update_fail(data, message)\n assert self....
[ "0.5711266", "0.56854874", "0.5597808", "0.5491597", "0.54523", "0.5447621", "0.5374708", "0.5363889", "0.5353114", "0.53295374", "0.5298084", "0.52946264", "0.5289387", "0.5286757", "0.5261818", "0.52331877", "0.5229697", "0.52155083", "0.51857257", "0.5172711", "0.5168168",...
0.64315724
0
Calculate the precisionrecall (PR) curve. It's not a public method. Use it only when you understand what you are doing exactly. The PR curve result is similar to that in sklearn and ROCR in R with minor difference. The first precisionrecall pair always takes the value (1,0).
def _cal_pr_curve(self, labelAndVectorisedScores): rawPredictionCol = self.rawPredictionColValue labelCol = self.labelColValue curve = precision_recall_curve(labelAndVectorisedScores, rawPredictionCol, labelCol).select("precision","recall") return curve
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision_recall(y_true, y_prob, ARGS):\n average_precision = average_precision_score(y_true, y_prob)\n if ARGS.graphs:\n precision, recall, _ = precision_recall_curve(y_true, y_prob)\n plt.style.use('ggplot')\n plt.clf()\n plt.plot(recall, precision,\n label='...
[ "0.7959289", "0.77566373", "0.7682807", "0.74131346", "0.73854953", "0.73743725", "0.73437935", "0.7288011", "0.72208554", "0.72071886", "0.718288", "0.7181433", "0.7181433", "0.7180739", "0.7163176", "0.7161011", "0.7159116", "0.70982945", "0.7091552", "0.70432097", "0.70173...
0.8154175
0
Evaluate the performance using a number of metrics, including areaUnderROC, areaUnderPR and precisionAtGivenRecall at different recall values.
def evaluateWithSeveralMetrics(self, dataset, metricSets=None): if metricSets is None: # all metrics metricSets = [{"metricName": "areaUnderROC"}, {"metricName": "areaUnderPR"}, {"metricName": "precisionAtGivenRecall", "metricParams": {"recallValue...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _eval_classifier(self):\n\n y_pred_baseline = self.df_baseline[self.score_column]\n y_pred_sample = self.df_sample[self.score_column]\n\n y_label_baseline = self.df_baseline[self.label_column]\n y_label_sample = self.df_sample[self.label_column]\n\n precision_baseline = preci...
[ "0.68614495", "0.6718771", "0.6693842", "0.6569567", "0.6557199", "0.65358484", "0.6526995", "0.6505559", "0.65005565", "0.64669365", "0.6450622", "0.6445871", "0.6443841", "0.6408051", "0.63957804", "0.6369756", "0.63612455", "0.63544005", "0.63512", "0.633024", "0.63229483"...
0.7196005
0
Gets the value of metricParams or its default value.
def getMetricValue(self): return self.getOrDefault(self.metricParams)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_metric_value(self) -> float:", "def metric_value(self) -> typing.Optional[str]:\n return self._values.get('metric_value')", "def metric_value(self) -> typing.Optional[str]:\n return self._values.get('metric_value')", "def get_metric(self):\n assert self._metric in self._metri...
[ "0.67874414", "0.67644763", "0.67644763", "0.63105017", "0.62489593", "0.60398257", "0.5935273", "0.5876949", "0.5823762", "0.58103245", "0.58067614", "0.5773091", "0.57403225", "0.57252383", "0.5723292", "0.57183594", "0.57183594", "0.5717882", "0.5708103", "0.56951916", "0....
0.8135723
0
setParams(self, rawPredictionCol="rawPrediction", labelCol="label", \ metricName="areaUnderROC") Sets params for binary classification evaluator.
def setParams(self, rawPredictionCol="rawPrediction", labelCol="label", metricName="areaUnderROC", metricParams={"recallValue": 0.6}): tmp = getattr(self, "metricParams", None) if tmp is None: self.metricParams = Param(self, "metricParams", "additional param...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setParams(self, *, predictionCol=\"prediction\", labelCol=\"label\",\n metricName=\"meanAveragePrecision\", k=10):\n kwargs = self._input_kwargs\n return self._set(**kwargs)", "def __init__(self, rawPredictionCol=\"rawPrediction\", labelCol=\"label\",\n metricNa...
[ "0.66631395", "0.65350604", "0.55556506", "0.5203026", "0.5126673", "0.5100271", "0.48111624", "0.47620893", "0.47243646", "0.4686018", "0.46371552", "0.4626044", "0.4589343", "0.45600268", "0.45395043", "0.45305347", "0.45246565", "0.4500843", "0.44883516", "0.44861096", "0....
0.8205035
0
Verify that all TEAL operations are allowed in the specified version.
def verifyOpsForVersion(teal: List[TealComponent], version: int): for stmt in teal: if isinstance(stmt, TealOp): op = stmt.getOp() if op.min_version > version: raise TealInputError( "Op not supported in TEAL version {}: {}. Minimum required version...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_supported_features(self):", "def validate_tls_min_version(self, node=None, version=\"1.2\", expect=\"fail\"):\n if node is None:\n node = self.cluster.master\n cmd = self.curl_path + \" -v --tlsv\" + version + \" --tls-max \" + version + \\\n \" -u \" + node....
[ "0.605336", "0.60329", "0.60300153", "0.60155135", "0.5997113", "0.5989051", "0.5982622", "0.5955021", "0.585883", "0.5794829", "0.5772645", "0.5752176", "0.57045716", "0.56767166", "0.5638141", "0.5625682", "0.56105036", "0.5606664", "0.5603677", "0.5598673", "0.55873007", ...
0.7799678
0
Verify that all TEAL operations are allowed in mode.
def verifyOpsForMode(teal: List[TealComponent], mode: Mode): for stmt in teal: if isinstance(stmt, TealOp): op = stmt.getOp() if not op.mode & mode: raise TealInputError( "Op not supported in {} mode: {}".format(mode.name, op) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_mode(mode: str) -> bool:\n return mode in (TEST, EASY, HARD)", "def check_enable_mode(self, *args, **kwargs):\n pass", "def check_supported_features(self):", "def test_support_MODES(self):\n self._testIntOrDefaultFeature(\"MODES\")", "def validate(self, mode): # pragma: no co...
[ "0.6500566", "0.6143098", "0.60593975", "0.6029194", "0.5904798", "0.5900099", "0.58975023", "0.5871597", "0.5865913", "0.57844806", "0.57491904", "0.5658872", "0.5654506", "0.56218165", "0.55978805", "0.55922246", "0.55898875", "0.5581408", "0.5576764", "0.5552772", "0.55508...
0.76222074
0
Compile a PyTeal expression into TEAL assembly.
def compileTeal( ast: Expr, mode: Mode, *, version: int = DEFAULT_TEAL_VERSION, assembleConstants: bool = False, ) -> str: if ( not (MIN_TEAL_VERSION <= version <= MAX_TEAL_VERSION) or type(version) is not int ): raise TealInputError( "Unsupported TEAL ver...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile(expression):", "def compile(expression: str) -> Compiled:\r\n e = Compiled(expression)\r\n e.tokenize()\r\n return e", "def translate(expr):\n return from_python(ast.parse(expr))", "def compile_expression(self):\n\t\t\n\t\tself.outfile.write('<expression>\\n')\n\t\tself.compile_term()...
[ "0.6607673", "0.61874115", "0.60439116", "0.6028703", "0.5831331", "0.5777732", "0.576733", "0.569624", "0.5684834", "0.5669194", "0.5646223", "0.56038624", "0.5554042", "0.553608", "0.553608", "0.553608", "0.5497846", "0.54754347", "0.5434601", "0.53916115", "0.53916115", ...
0.641567
1
returns a table instance suitable for holding data described by tableDef. This is the main interface to table instancation. suppressIndex=True can be used to suppress index generation on inmemory tables with primary keys. Use it when you are sure you will not need the index (e.g., if staging an ondisk table). See getPa...
def TableForDef(tableDef, suppressIndex=False, parseOptions=common.parseNonValidating, **kwargs): if isinstance(tableDef, rscdef.SimpleView): tableDef = tableDef.getTableDef() if tableDef.onDisk: if tableDef.viewStatement: cls = dbtable.View else: cls = dbtable.DBTable return cls(tableDef, suppressIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_table(self, **kwargs):\r\n options = {}\r\n table_class = self.get_table_class()\r\n table = table_class(self.get_table_data(), **kwargs)\r\n paginate = self.get_table_pagination() # pylint: disable=E1102\r\n if paginate is not None:\r\n options['paginate'] = ...
[ "0.6120025", "0.5961077", "0.5945433", "0.5808422", "0.5798979", "0.5774817", "0.5764215", "0.57284814", "0.5645541", "0.5642013", "0.55859804", "0.5583069", "0.5562619", "0.5546648", "0.5538228", "0.5529514", "0.5458134", "0.5414584", "0.54040205", "0.5359194", "0.5352598", ...
0.83285594
0
returns a table from resultTableDef containing the results for a query for fragment and pars in queriedTable. resultTableDef must be a TableDef with svc.OutputField columns (which you can easily generate from columns using svc.OutputTableDef.fromColumns) queriedTable must be a DBTable instance. The other arguments are ...
def makeTableForQuery(queriedTable, resultTableDef, fragment, pars, distinct=False, limits=None, suppressIndex=True, connection=None): return TableForDef(resultTableDef, suppressIndex=suppressIndex, connection=connection, rows=[r for r in queriedTable.iterQuery(resultTableDef, fragment, pars, distinct, lim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _makeResultTableDef(self, service, inputTable, queryMeta):\n\t\treturn base.makeStruct(outputdef.OutputTableDef,\n\t\t\tparent_=self.queriedTable.parent, id=\"result\",\n\t\t\tonDisk=False, columns=self.getQueryCols(service, queryMeta),\n\t\t\tparams=self.queriedTable.params)", "def _makeTable(self, rowIter,...
[ "0.6903858", "0.6107269", "0.6102175", "0.5799797", "0.57989585", "0.5455938", "0.5440752", "0.5417696", "0.54101384", "0.5348835", "0.52263045", "0.5221324", "0.5219741", "0.5193257", "0.51673913", "0.51188475", "0.51160085", "0.50599", "0.50572443", "0.50319016", "0.5026560...
0.757694
0
returns a table for tableDef, taking raw rows from iterator and using a defaultNone rowmaker.
def makeTableFromRows(tableDef, iterator): t = TableForDef(tableDef) rmk = rscdef.RowmakerDef.makeTransparentFromTable(tableDef ).compileForTableDef(tableDef) for row in iterator: t.addRow(rmk(row, t)) return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _makeTable(self, rowIter, resultTableDef, queryMeta):\n\t\trows = list(rowIter)\n\t\tisOverflowed = len(rows)>queryMeta.get(\"dbLimit\", 1e10)\n\t\tif isOverflowed:\n\t\t\tdel rows[-1]\n\t\tqueryMeta[\"Matched\"] = len(rows)\n\t\tres = rsc.TableForDef(resultTableDef, rows=rows)\n\t\tif isOverflowed:\n\t\t\tqu...
[ "0.70325714", "0.6607077", "0.6408103", "0.6369529", "0.6331045", "0.6286862", "0.62021285", "0.6153239", "0.60818386", "0.6070199", "0.6062928", "0.60610604", "0.6008984", "0.5969291", "0.5960584", "0.59414375", "0.59244776", "0.59010464", "0.5898795", "0.5890541", "0.584980...
0.809845
0
Take file path as string; return text as string. Takes a string that is a file path, opens the file, and turns the file's contents as one string of text.
def open_and_read_file(file_path): # your code goes here text_file = open(file_path) text_string= text_file.read() text_file.close() return text_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_and_read_file(file_path):\n\n text_file = open(file_path)\n full_text = text_file.read()\n\n return full_text", "def openFile(filepath):\n assert checkExistenceFile(filepath), \"filepath does not exist\"\n with open(filepath, \"r\", encoding=\"utf-8\") as f:\n text = \" \".join(map...
[ "0.80470866", "0.8014033", "0.7990872", "0.7920758", "0.786444", "0.7798141", "0.7678207", "0.76581025", "0.76132697", "0.76079136", "0.7569296", "0.7539552", "0.75283855", "0.75040907", "0.7503145", "0.7498271", "0.7412663", "0.73693025", "0.7360746", "0.7329229", "0.72927",...
0.80692214
0
the main backup function. The simulate option goes through the motions and outputs what would be done without executing
def do_backup(infile, simulate=False): # parse the input file cp = cparse.ConfigParser() cp.optionxform = str cp.read(infile) # store the list of files and directories we will backup # in each dictionary, the key is the root directory to copy from and the # list it indexes is the list of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup():\n\n\t# Sound backup alarm.\n\t#Sound.tone([(1000, 500, 500)] * 3)\n\n\t# Turn backup lights on:\n\tLeds.set_color(Leds.RIGHT, Leds.RED)\n\tLeds.set_color(Leds.LEFT, Leds.RED)\n\n\t# Stop both motors and reverse for 1.5 seconds.\n\t# `run-timed` command will return immediately, so we will have to wait...
[ "0.65743506", "0.62866676", "0.60612804", "0.5717248", "0.5711721", "0.5660554", "0.5612648", "0.5609111", "0.55898035", "0.5586355", "0.558241", "0.5507118", "0.54775506", "0.5468942", "0.5467805", "0.5458969", "0.54422337", "0.5414463", "0.5412901", "0.53900707", "0.5389421...
0.65804386
0
municipio de la recogida
def municipio(update, context): user = update.message.from_user context.user_data['municipio'] = update.message.text logger.info("El municipio de %s es: %s", user.first_name, update.message.text) update.message.reply_text(emoji.emojize("Muy bien, ahora la dirección para esta recogida."), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geocode(self, geocoder):\n for term in self.terms:\n # No need to geocode regions\n if not term.get('region'):\n geo = geocoder.geocode(term['string'])\n if geo:\n term['geo'] = geo\n if not self.region:\n ...
[ "0.57516754", "0.5722131", "0.5722131", "0.55322856", "0.5245639", "0.5219513", "0.51864374", "0.51653004", "0.5079808", "0.5071183", "0.5070369", "0.5064358", "0.5060312", "0.50454557", "0.50388813", "0.50386727", "0.5026934", "0.5010187", "0.50078595", "0.49691686", "0.4943...
0.62810594
0
Get a generator for the validation set
def _get_validation_generator(self): for data_element in self.validation: if self.debug: print("validating on: {}".format(data_element)) image, heatmap = self._generate_input_tuple(data_element) yield (image, heatmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_validation_iterator(self) -> tf.contrib.data.Iterator:\n return self.validation.make_initializable_iterator()", "def __get_validators__(cls) -> Generator:\n yield cls.validate_type\n yield cls.validate_strip\n yield cls.validate_allow_empty\n yield cls.validate_max_leng...
[ "0.72144264", "0.69479173", "0.68369865", "0.6305825", "0.6227489", "0.6188366", "0.6187947", "0.615651", "0.6136088", "0.6002709", "0.594444", "0.5936085", "0.59200394", "0.5869089", "0.58582646", "0.5788431", "0.5777411", "0.5755018", "0.57443184", "0.5736021", "0.569935", ...
0.70835185
1
Test for error if data_type = list but raw data file is in plate format.
def test_incorrect_data_type_list(): test_object = fa.read_in_envision(data_csv=plate_1, platemap_csv=plate_map_file, data_type='list', size=384)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_data_type_plate():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='plate', size=384)", "def test_incorrect_data_type():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='typo', siz...
[ "0.75342304", "0.70626557", "0.6768114", "0.6571354", "0.61076355", "0.59984607", "0.59412366", "0.593715", "0.58935404", "0.5881785", "0.58569247", "0.5786611", "0.57838047", "0.5749198", "0.574268", "0.5735595", "0.5733344", "0.5718264", "0.5713996", "0.56484675", "0.559914...
0.7635421
0
Test for error if data_type = plate but raw data file is in list format.
def test_incorrect_data_type_plate(): test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='plate', size=384)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_data_type_list():\n \n test_object = fa.read_in_envision(data_csv=plate_1, platemap_csv=plate_map_file, data_type='list', size=384)", "def test_incorrect_data_type():\n \n test_object = fa.read_in_envision(data_csv=list_A, platemap_csv=plate_map_file, data_type='typo', size=384...
[ "0.7794329", "0.6749305", "0.6440731", "0.63738686", "0.59231424", "0.58522236", "0.5734133", "0.572137", "0.5673078", "0.5640752", "0.56203806", "0.55289614", "0.5516629", "0.55102366", "0.5478745", "0.54479927", "0.5442712", "0.5433583", "0.5409536", "0.5393837", "0.5391756...
0.72638327
1
Test whether the invalidate function turns the value of the 'Valid' column to False in a given set of well ids, columns and rows.
def test_invalidate(): example_platemap = pd.read_csv(inval_platemap, index_col=[0]) # read in an example platemap with invalidated well ids, rows and columns test_object = fa.read_in_envision(data_csv=plate_2_repeat, platemap_csv=plate_map_file, data_type='plate', size=384) # read in actual data and p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalidate_error():\n \n test_object = fa.read_in_envision(data_csv=plate_2_repeat, platemap_csv=plate_map_file, data_type='plate', size=384)\n test_object.invalidate() # execute the invalidate function without specifying well ids, rows or columns to be invalidated", "def cell_invalidation(_f...
[ "0.61532485", "0.6008592", "0.59615946", "0.59555566", "0.5877972", "0.5876424", "0.58687544", "0.5847433", "0.58406866", "0.57983524", "0.57739675", "0.57136995", "0.5703538", "0.5683163", "0.5681022", "0.5666945", "0.5645097", "0.5643834", "0.5600089", "0.55769676", "0.5572...
0.68301916
0
Tests whether the background correction function performs correct calculations to get the background corrected values of p and s channel signal
def test_background_correct(): with open(HsHis6_PEX5C_vs_HsPEX5C_p_s_corrected, 'rb') as file: # load the list with expexcted data frames from .pkl file expected_list = pickle.load(file) test_object = fa.read_in_envision(data_csv=HsHis6_PEX5C_vs_HsPEX5C, platemap_csv=Hs_His6_PEX5C_vs_HsPEX5C_pla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBackgroundCorrected(ds, bkg, norm_ref=None, norm_target=-1):\n print 'background correction of', ds.title\n\n # normalise\n print 'Bkg before: %f' % bkg[2,25,2]\n if norm_ref:\n bkg,target = applyNormalization(bkg,norm_ref,norm_target)\n\n rs = ds.__copy__() # for metadata\n # resu...
[ "0.65292513", "0.6052669", "0.5702846", "0.5668885", "0.5588744", "0.5585142", "0.5563358", "0.5550591", "0.55287355", "0.5511105", "0.5437935", "0.5358553", "0.5357077", "0.53366697", "0.5321925", "0.52943116", "0.52937794", "0.5270108", "0.5203199", "0.51957315", "0.5175876...
0.63610095
1
return a template of nodes.html
def node(): return render_template('nodes.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graphing1():\n return render_template('graph1.html')", "def addGenericNode():\n return render_template(\"addGenericNode.html\")", "def get(self):\n return render_template ('nome do html')", "def generate_html_template(self, news_list):\n with open(self.template, \"r\") as fp:\n ...
[ "0.6528794", "0.6357709", "0.6328158", "0.62870455", "0.62844205", "0.6268067", "0.61775446", "0.61775446", "0.61438644", "0.6132522", "0.6118087", "0.6080962", "0.6065939", "0.60523665", "0.6042195", "0.60045296", "0.59810543", "0.5975848", "0.5970648", "0.59310323", "0.5926...
0.8621902
0
function that recieve an id and send to the torre api to return the information as a json
def id(text): url = "https://bio.torre.co/api/bios/{}".format(text) request = get(url) print(request.status_code) if request.status_code != 200: abort(404, 'Not Found') return request.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_from_api(_id):\n # get employee name\n employee_name = requests.get(\n 'https://jsonplaceholder.typicode.com/users/' + _id).json()['username']\n\n # get employee info\n info = requests.get(\n 'https://jsonplaceholder.typicode.com/todos?userId=' + _id).json()\n # Write to cs...
[ "0.64823586", "0.64728427", "0.6283787", "0.62567455", "0.6227529", "0.6171123", "0.6161169", "0.613851", "0.6096506", "0.6030402", "0.5998821", "0.59925264", "0.5970917", "0.59407645", "0.5916527", "0.5913766", "0.5911259", "0.58871174", "0.57844204", "0.57770264", "0.575659...
0.65873057
0
function that get the conections of an user given the id
def get_conections(user_id, limit): url_conect = "https://bio.torre.co/api/people/{}/connections?limit={}".format(user_id, limit) request = get(url_conect) if request.status_code != 200: abort(404, 'Not Found') return request.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connections(network, user):\n if not user in network:\n return None\n if not 'connections' in network[user]:\n return []\n return network[user]['connections']", "def get_connection(self, user_id):\n logging.debug('ConnectionsClient/get_connection()')\n url = '/pod/v1/...
[ "0.63471746", "0.62897015", "0.6080058", "0.60384804", "0.5986767", "0.59058696", "0.58764243", "0.5813119", "0.5799602", "0.5768668", "0.5727054", "0.57236326", "0.5715743", "0.56753516", "0.5619295", "0.5578455", "0.5575732", "0.55389047", "0.55191123", "0.5507065", "0.5499...
0.74861646
0
Return the log as a string, with entries separated by newlines.
def get_log_string(self, level=None): log_lines = [f"Name:{str(self.name)} Level:{str(level)}"] for key, item in self.log.items(): log_lines.append(f"{key}:") if item: for entry in item: if not level or (entry["level"] == level): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_log(self):\n\n open_lf = open(self.logfile, 'r')\n log_str = open_lf.read()\n sys.stdout.write(log_str)\n\n return log_str", "def get_formatted_task_log(self):\n try:\n log = requests.get(self.gs_base_url + \"/out.log\").content\n except:\n ...
[ "0.70994776", "0.6636679", "0.6498945", "0.6483803", "0.6436465", "0.6419768", "0.64023906", "0.63518935", "0.6291789", "0.6112271", "0.610589", "0.60014796", "0.59091604", "0.59091604", "0.5906159", "0.58620924", "0.58502805", "0.5849809", "0.5814813", "0.57979417", "0.57753...
0.69506097
1
Writes a flag to a register with the given offset.\n
def write_flag_data(self, flag, register_address, offset): if len(flag) + offset > 8: raise ValueError("Flag + offset exceeded 8 bit limit.") register_value = self.read_byte_data(register_address) for index, value in enumerate(flag): if value: register_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setFlag(flagbyte, pos, status):\n if status:\n return flagbyte | 2**pos\n else:\n return flagbyte & ~2**pos", "def set_flag(self, flag_name, value):\n flags = {'C':0, # Carry\n 'Z':1, # Zero\n 'I':2, # Interrupt mask\n 'D':3, # De...
[ "0.6303939", "0.62794644", "0.6193683", "0.61641306", "0.6088857", "0.5993474", "0.596513", "0.59287363", "0.5836613", "0.5812747", "0.5805649", "0.5772962", "0.5758084", "0.5718409", "0.5704642", "0.5610061", "0.5600659", "0.5600078", "0.5501439", "0.5494253", "0.548575", ...
0.7759315
0
Sleep After Interrupt. When enabled, the device will automatically enter low power mode when the INT pin is asserted. Normal operation is resumed when INT pin is cleared over I2C.\n
def set_sleep_after_interrupt(self, enable=True): self.write_flag_data([enable], APDS_9960.CONFIG_3_REG_ADDRESS, 4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sleep(self, sleep_time: float = 10) -> None:\n sleep_until_interrupt(sleep_time, lambda: self.stopped, interval=0.5)", "def irq_handler():\n # open an LED session\n with LEDs() as LED:\n # specify the LED which you want to control\n led = Led.LED1\n # specify the LED status...
[ "0.6538061", "0.64390194", "0.6414846", "0.63437057", "0.63230747", "0.62960297", "0.6261905", "0.6241375", "0.6126499", "0.6092909", "0.60635877", "0.60110074", "0.5898803", "0.58937633", "0.5853994", "0.5834014", "0.5828191", "0.5827495", "0.56839854", "0.56753117", "0.5654...
0.6614292
0
The LED_BOOST allows the LDR pin to sink more current above the maximum setting. Additional LDR current during proximity and gesture LED pulses. Current value, set by LDRIVE, is increased by the percentage of LED_BOOST.\n
def set_led_boost(self, led_boost): if not (APDS_9960.LED_BOOST_100 <= led_boost <= APDS_9960.LED_BOOST_300): raise ValueError("led_boost must be one of APDS.LED_BOOST_N") self.write_flag_data([bool(led_boost & 0b01), bool(led_boost & 0b10)], APDS_9960.CONFIG_2_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tune(self):\n if self.freq_peak < self.freq_lo:\n return\n tuning_freq = self.get_tuning_freq(self.freq_peak)\n\n # create 5 bins around the closest frequency to the current peak\n index_freq = np.argwhere(self.NOTES == tuning_freq)[0][0]\n bands = np.zeros(5)\n ...
[ "0.5621568", "0.55511063", "0.54889923", "0.54712635", "0.5467339", "0.54611146", "0.5456708", "0.5446773", "0.5445104", "0.53961974", "0.5396124", "0.5379429", "0.53387177", "0.5309808", "0.530692", "0.5287951", "0.5257031", "0.5256162", "0.5243171", "0.5240784", "0.52318925...
0.6998518
0
The Proximity Interrupt Threshold sets the high and low trigger points for the comparison function which generates an interrupt. If the value generated by the proximity channel, crosses below the lower threshold or above the higher threshold, an interrupt may be signaled to the host processor. Interrupt generation is s...
def set_proximity_interrupt_thresholds(self, low_thr, high_thr): self.write_byte_data(low_thr, APDS_9960.PROX_INT_LOW_THR_REG_ADDRESS) self.write_byte_data(high_thr, APDS_9960.PROX_INT_HIGH_THR_REG_ADDRESS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proximity_thread(self):\n count = 0\n while True:\n print(\"---------------- Analizo si debo detectar enemigos - PROXIMITY\")\n print(\"----- DEBO?? ::::> self.enemy_not_detected = {}\".format(self.enemy_not_detected))\n while self.enemy_not_detected:\n ...
[ "0.5534539", "0.54538596", "0.5126924", "0.51206297", "0.505338", "0.5048163", "0.5048163", "0.5048163", "0.5048163", "0.5048163", "0.5022339", "0.4987388", "0.4979836", "0.49741766", "0.49654108", "0.49539858", "0.4941065", "0.49398372", "0.49256364", "0.49235585", "0.491772...
0.6906886
0
The Interrupt Persistence sets a value which is compared with the accumulated amount Proximity cycles in which results were outside threshold values. Any Proximity result that is inside threshold values resets the count.\n
def set_proximity_interrupt_persistence(self, persistence): if not (0 <= persistence <= 15): raise ValueError("persistance must be in range [0-15]") flag = [] for i in range(4): flag.append(bool(persistence & (1 << i))) self.write_flag_data(flag, APDS_9960.INTERR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_als_interrupt_persistence(self, persistence):\n if not (0 <= persistence <= 15):\n raise ValueError(\"Persistence must be in range [0 - 15]\")\n\n flag = []\n for i in range(4):\n flag.append(bool(persistence & (1 << i)))\n self.write_flag_data(flag, APDS_9...
[ "0.57186526", "0.544084", "0.53434235", "0.5194584", "0.51427823", "0.5097822", "0.50370705", "0.5025331", "0.50119144", "0.49928343", "0.49647838", "0.4948093", "0.49450144", "0.4934572", "0.49326453", "0.49172455", "0.49014217", "0.48967862", "0.48871198", "0.48867267", "0....
0.59330386
0
The proximity pulse count is the number of pulses to be output on the LDR pin. The proximity pulse length is the amount of time the LDR pin is sinking current during a proximity pulse.\n
def set_proximity_pulse_count_and_length(self, pulse_count, pulse_length=PULSE_LEN_8_MICROS): if not (1 <= pulse_count <= 64): raise ValueError("pulse_count must be in range [1-64]") if not (APDS_9960.PULSE_LEN_4_MICROS <= pulse_length ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_gesture_pulse_count_and_length(self, pulse_count, pulse_length):\n if not (1 <= pulse_count <= 64):\n raise ValueError(\"pulse_count must be in range [1-64].\")\n if not (APDS_9960.PULSE_LEN_4_MICROS <= pulse_length\n <= APDS_9960.PULSE_LEN_32_MICROS):\n r...
[ "0.62280905", "0.60387653", "0.60241723", "0.58001226", "0.5613278", "0.55236006", "0.53408086", "0.5327092", "0.52434987", "0.5174105", "0.50176656", "0.49432734", "0.49347064", "0.49076405", "0.4898199", "0.4889249", "0.48849964", "0.4871372", "0.47583196", "0.47577885", "0...
0.6915799
0
In proximity mode, the UP and RIGHT and the DOWN and LEFT photodiodes are connected forming diode pairs. The offset is an 8bit value used to scale an internal offset correction factor to compensate for crosstalk in the application.\n
def set_proximity_offset(self, up_right_offset=0, down_left_offset=0): if not (-127 <= up_right_offset <= 127 and -127 <= down_left_offset <= 127): raise ValueError("up_right_offset and down_left_offset must be in range [-127-127]") ur_reg_value = abs(up_right_offset) ur_reg_value |...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_offset_mapping(self):\n self.quad_offset_mapping = {\n 'forward': direction_arr[self.direction_mod_offset % len(self.direction_arr)],\n 'right': direction_arr[(self.direction_mod_offset + 1) % len(self.direction_arr)],\n 'backward': direction_arr[(self.directio...
[ "0.5933824", "0.5909894", "0.57860225", "0.5501753", "0.54334956", "0.5392128", "0.5383301", "0.52975345", "0.52211267", "0.52162117", "0.5173359", "0.51116484", "0.50885093", "0.5061578", "0.50394344", "0.5035166", "0.49952644", "0.4973922", "0.4973023", "0.49721557", "0.496...
0.6428218
0
ALS level detection uses data generated by the Clear Channel. The ALS Interrupt Threshold registers provide 16bit values to be used as the high and low thresholds for comparison to the 16bit CDATA values. If AIEN is enabled and CDATA is greater than high_thr or less than low_thr for the number of consecutive samples sp...
def set_als_thresholds(self, low_thr, high_thr): if not (0 <= low_thr <= 0xFFFF and 0 <= high_thr <= 0xFFFF): raise ValueError("low_thr and high_thr must be in range [0 - 0xFFFF]") ailtl = low_thr & 0xFF ailth = low_thr >> 8 aihtl = high_thr & 0xFF aihth = high_thr >...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trackThresholdOptical(threshold, ants=0) :\n SPEED_OF_LIGHT = 299792458.0 # m/s\n antlist = helpers.makeList(ants)\n if antlist[0] == 0: antlist = currentAntennaNumbers()\n flo = lofreq()\n t = 0\n for ant in antlist:\n antmp = \"control.antenna%d\" %ant\n d = queryDouble(antmp ...
[ "0.5127868", "0.50271463", "0.50269413", "0.49790308", "0.49651873", "0.4957171", "0.49556398", "0.49099463", "0.4901325", "0.48932168", "0.48726988", "0.4858668", "0.48179138", "0.47960213", "0.47849968", "0.47839293", "0.47799924", "0.4759391", "0.47558066", "0.4723935", "0...
0.6228796
0