query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Create a new clip
def add_clip(md5=None, pos=None): m = request.args.get('md5', None) if md5 is None else md5 u = Upload.objects.filter(md5=m).first() if not u: abort(404) p = request.args.get('pos', None) if pos is None else pos xt, t, xb, b = parse_pos(p) # make the form form = ReferenceForm(formdat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newClip(self, book, content, typ, date):\n sql = ''' insert into clippings values (NULL, '%s', '%s', '%s', '%s', '%s')\n''' % (book, '0', typ, date, content)\n\n self.__execute__(sql)\n pass", "def __init__(self,clip_list):\n self.requested_clips=clip_list", "def create_sourc...
[ "0.6420943", "0.6345022", "0.6147171", "0.6049804", "0.59528327", "0.5941645", "0.5813467", "0.5794194", "0.57903296", "0.5784902", "0.5754241", "0.5682217", "0.5648178", "0.564117", "0.5551281", "0.5475857", "0.5473375", "0.5430865", "0.54280514", "0.53824615", "0.5374996", ...
0.5473534
16
Create a new clip
def add_excerpt(md5=None, pos=None): m = request.args.get('md5', None) if md5 is None else md5 u = Upload.objects.filter(md5=m).first() if not u: abort(404) p = request.args.get('pos', None) if pos is None else pos xt, t, xb, b = parse_pos(p) # make the form form = ReferenceForm(form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newClip(self, book, content, typ, date):\n sql = ''' insert into clippings values (NULL, '%s', '%s', '%s', '%s', '%s')\n''' % (book, '0', typ, date, content)\n\n self.__execute__(sql)\n pass", "def __init__(self,clip_list):\n self.requested_clips=clip_list", "def create_sourc...
[ "0.6420943", "0.6345022", "0.6147171", "0.6049804", "0.59528327", "0.5941645", "0.5813467", "0.5794194", "0.57903296", "0.5784902", "0.5754241", "0.5682217", "0.5648178", "0.564117", "0.5551281", "0.5475857", "0.5473534", "0.5473375", "0.5430865", "0.54280514", "0.53824615", ...
0.0
-1
Conduct a search inside the text
def search_inside(md5): search_results = {} query = request.args.get('query', '') if not query == '': subqueries = query.split(',') q_idx = 0 for q in subqueries: if q_idx == 3: continue results = elastic.search('page', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self, word):", "def search(self, term):", "def search(query_string):", "def search(text):\n s = Search()\n result = _search(s, text)\n _print_results(result)\n return result", "def exact_match(self):\n text_to_match = input(\"Enter the text to search for> \")\n return t...
[ "0.7854131", "0.7629025", "0.69847673", "0.69339067", "0.6899407", "0.67962325", "0.6743438", "0.6727335", "0.6530044", "0.6522045", "0.64815676", "0.64747185", "0.64260924", "0.6422477", "0.64208305", "0.64173126", "0.64115167", "0.64115167", "0.6405989", "0.6405989", "0.637...
0.0
-1
The filename here is the structured filename
def references(md5): u = Upload.objects.filter(md5=md5).first() if not u: abort(404) # first, is this searchable? is_searchable = False count = elastic.count('page', filter={'md5': md5}) if count > 0: is_searchable = True #annotations = Reference.objects.filter(upload=u, ref_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getfilename(self):\n pass", "def filename(self):\r\n return self._filename", "def filename(self):\n return '%s%s' % (self.identifier, self.extension)", "def filename(self):\r\n\t\treturn None", "def GetFileName():\r\n d = GetData()\r\n return d.filename", "def _prettyf...
[ "0.7109889", "0.70361847", "0.6928823", "0.68720216", "0.6811418", "0.68030715", "0.67876595", "0.67835504", "0.67760605", "0.6728516", "0.6689405", "0.66837925", "0.6678177", "0.6658768", "0.6623499", "0.66140795", "0.6607564", "0.66051894", "0.66051894", "0.66051894", "0.66...
0.0
-1
The filename here is the structured filename
def figleaf(md5, user_id=None): u = Upload.objects.filter(md5=md5).first() if not u: abort(404) thing = Thing.objects.filter(files=u).first() if thing.takedown: return thing.takedown preview = u.preview() preview_url = url_for('reference.preview', filen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getfilename(self):\n pass", "def filename(self):\r\n return self._filename", "def filename(self):\n return '%s%s' % (self.identifier, self.extension)", "def filename(self):\r\n\t\treturn None", "def GetFileName():\r\n d = GetData()\r\n return d.filename", "def _prettyf...
[ "0.7110782", "0.7036862", "0.6930487", "0.6872694", "0.6812203", "0.68041015", "0.67890775", "0.6783583", "0.6777206", "0.6729934", "0.6691172", "0.66841674", "0.66787475", "0.66599196", "0.66246134", "0.6615134", "0.6608568", "0.66060024", "0.66060024", "0.66060024", "0.6606...
0.0
-1
Adds a reference notation to an upload
def create_reference(md5, pos): url = request.args.get('url', '') if not rfc3987.match(url, rule='URI'): return "Sorry, that's not a valid URL:\n" % url u = Upload.objects.filter(md5=md5).first() if not u: abort(404) # Create the reference r = Reference(upload=u, ref_url=url, pos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file_ref(self, file_name: str) -> None:\n self.referenced_in.add(file_name)", "def _add_ref_record(\n self, term: str, concept_id: str, ref_type: str, src_name: SourceName\n ) -> None:\n label_and_type = f\"{term.lower()}##{ref_type}\"\n record = {\n \"label_and_...
[ "0.63955927", "0.6236799", "0.6201154", "0.61226004", "0.5879003", "0.5841867", "0.58209884", "0.57595927", "0.57595927", "0.5746349", "0.570964", "0.56970924", "0.56944036", "0.5693124", "0.5685071", "0.5650007", "0.5620138", "0.560453", "0.5603132", "0.5598935", "0.5551821"...
0.57105976
10
Adds a reference notation to an upload
def create_reference2(md5, pos, ref_md5, ref_pos): ua = Upload.objects.filter(md5=md5).first() ub = Upload.objects.filter(md5=ref_md5).first() if not ua or not ub: abort(404) # Create the reference try: r = Reference(upload=ua, raw_pos=pos, ref_upload=ub, raw_ref_pos=ref_pos) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file_ref(self, file_name: str) -> None:\n self.referenced_in.add(file_name)", "def _add_ref_record(\n self, term: str, concept_id: str, ref_type: str, src_name: SourceName\n ) -> None:\n label_and_type = f\"{term.lower()}##{ref_type}\"\n record = {\n \"label_and_...
[ "0.63955927", "0.6236799", "0.6201154", "0.5879003", "0.5841867", "0.58209884", "0.57595927", "0.57595927", "0.5746349", "0.57105976", "0.570964", "0.56970924", "0.56944036", "0.5693124", "0.5685071", "0.5650007", "0.5620138", "0.560453", "0.5603132", "0.5598935", "0.5551821"...
0.61226004
3
Adds a reference notation to an upload
def create_annotation(md5, pos): note = request.args.get('note', '') u = Upload.objects.filter(md5=md5).first() if not u: abort(404) # Create the reference r = Reference(upload=u, note=note, raw_pos=pos) # try and extract a url urls = re.findall(r'(https?://\S+)', note) for url i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file_ref(self, file_name: str) -> None:\n self.referenced_in.add(file_name)", "def _add_ref_record(\n self, term: str, concept_id: str, ref_type: str, src_name: SourceName\n ) -> None:\n label_and_type = f\"{term.lower()}##{ref_type}\"\n record = {\n \"label_and_...
[ "0.63955927", "0.6236799", "0.6201154", "0.61226004", "0.5879003", "0.5841867", "0.58209884", "0.57595927", "0.57595927", "0.5746349", "0.57105976", "0.570964", "0.56970924", "0.56944036", "0.5693124", "0.5685071", "0.5650007", "0.5620138", "0.560453", "0.5603132", "0.5598935...
0.554887
22
A page made of clips/ highlights of the text
def clips(md5, user_id=None): u = Upload.objects.filter(md5=md5).first() thing = Thing.objects.filter(files=u).first() if not u: abort(404) # load annotations if user_id: annotations = Reference.objects.filter( upload=u, creator=user_id).order_by('pos') else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_page(page, stream):\n bleed = {\n side: page.style[f'bleed_{side}'].value\n for side in ('top', 'right', 'bottom', 'left')}\n marks = page.style['marks']\n stacking_context = StackingContext.from_page(page)\n draw_background(\n stream, stacking_context.box.background, clip...
[ "0.60184145", "0.58296853", "0.58064336", "0.5726351", "0.5624344", "0.55240214", "0.5515679", "0.54783005", "0.5467475", "0.5448062", "0.53821886", "0.5334517", "0.5334213", "0.5322485", "0.5315104", "0.5283029", "0.52648276", "0.52377385", "0.5237235", "0.5227399", "0.52244...
0.4854962
81
A page made of clips
def reference_clips(md5): u = Upload.objects.filter(md5=md5).first() thing = Thing.objects.filter(files=u).first() if not u: abort(404) # load annotations annotations = Reference.objects.filter(upload=u).order_by('pos') clips = [] for a in annotations: if a.ref_upload and a....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clips(md5, user_id=None):\n u = Upload.objects.filter(md5=md5).first()\n thing = Thing.objects.filter(files=u).first()\n if not u:\n abort(404)\n # load annotations\n if user_id:\n annotations = Reference.objects.filter(\n upload=u, creator=user_id).order_by('pos')\n ...
[ "0.63247615", "0.58544445", "0.57726026", "0.5435741", "0.5298782", "0.5247598", "0.5226496", "0.5225621", "0.51966417", "0.51824707", "0.5177477", "0.51289487", "0.51272714", "0.50894016", "0.5084546", "0.5059843", "0.50533634", "0.50295776", "0.5029249", "0.5023784", "0.502...
0.5818967
2
Returns the start state for the search problem
def getStartState(self): util.raiseNotDefined()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStartState(self):\n\t\tutil.raiseNotDefined()", "def getStartState(self):\n\t\tutil.raiseNotDefined()", "def getStartState(self):\n return self._start_loc", "def getStartState(self):\r\n\t\tutil.raiseNotDefined()", "def get_start_state(self):\r\n util.raiseNotDefined()", "def getStar...
[ "0.72630936", "0.72630936", "0.72455", "0.7215881", "0.72052455", "0.71886414", "0.7183883", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", "0.711945", ...
0.7191885
11
Returns a sequence of moves that solves tinyMaze. For any other maze, the sequence of moves will be incorrect, so only use this for tinyMaze
def tinyMazeSearch(problem): from game import Directions s = Directions.SOUTH w = Directions.WEST return [s,s,w,s,w,w,s,w]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tinyMazeSearch(problem):\n from game import Directions\n s = Directions.SOUTH\n w = Directions.WEST\n n = Directions.NORTH\n\n return [s, s, n, s, w, s, w, w, s, w]", "def tinyMazeSearch(problem):\n from game import Directions\n\n s = Directions.SOUTH\n w = Directions.WEST\n retur...
[ "0.7231158", "0.72270834", "0.72268534", "0.7179877", "0.7179877", "0.7179877", "0.7173173", "0.7173173", "0.7173173", "0.7173173", "0.7173173", "0.7173173", "0.7173173", "0.7159364", "0.7159364", "0.7159364", "0.7159364", "0.7159364", "0.7159364", "0.7159364", "0.7159364", ...
0.7181364
8
Search the deepest nodes in the search tree first
def depthFirstSearch(problem): "*** YOUR CODE HERE ***" frontier = util.Stack() start_node = problem.getStartState() if problem.isGoalState(start_node): return ['Stop'] frontier.push((start_node,[])) explored = set() while True: if frontier.isEmpty(): return [] node = frontier...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depth_first_search(self):\r\n queue = [self.root]\r\n ordered = []\r\n while queue:\r\n node = queue.pop()\r\n ordered.append(node)\r\n queue.extend(node.children)\r\n \r\n while ordered:\r\n yield ordered.pop()", "def depthFirstS...
[ "0.72788286", "0.6862371", "0.6833252", "0.6678099", "0.66124", "0.6571768", "0.65458554", "0.6541518", "0.65328586", "0.65185565", "0.6516232", "0.63959724", "0.6336154", "0.63223875", "0.6305312", "0.63027865", "0.6276852", "0.6257763", "0.6247078", "0.62291026", "0.6222544...
0.6142328
30
Search the shallowest nodes in the search tree first.
def breadthFirstSearch(problem): #import pdb;pdb.set_trace() frontier = util.Queue() start_node = problem.getStartState() if problem.isGoalState(start_node): return ['Stop'] frontier.push((start_node,())) explored = set() while True: if frontier.isEmpty(): return [] node = fron...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depth_first_search(self):\r\n queue = [self.root]\r\n ordered = []\r\n while queue:\r\n node = queue.pop()\r\n ordered.append(node)\r\n queue.extend(node.children)\r\n \r\n while ordered:\r\n yield ordered.pop()", "def depth_first...
[ "0.69203365", "0.6734959", "0.659188", "0.65315974", "0.65235966", "0.6515641", "0.64349604", "0.63706106", "0.6349397", "0.63105273", "0.62683547", "0.62573814", "0.6188355", "0.61810166", "0.6174985", "0.60993695", "0.60754585", "0.6070981", "0.60292786", "0.6028391", "0.60...
0.0
-1
Search the shallowest nodes in the search tree first.
def breadthFirstSearchPaths(problem): #import pdb;pdb.set_trace() frontier = util.Queue() start_node = problem.getStartState() if problem.isGoalState(start_node): return ['Stop'] frontier.push((start_node,())) explored = set() while True: if frontier.isEmpty(): return [] node =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depth_first_search(self):\r\n queue = [self.root]\r\n ordered = []\r\n while queue:\r\n node = queue.pop()\r\n ordered.append(node)\r\n queue.extend(node.children)\r\n \r\n while ordered:\r\n yield ordered.pop()", "def depth_first...
[ "0.69203365", "0.6734959", "0.659188", "0.65315974", "0.65235966", "0.6515641", "0.64349604", "0.63706106", "0.6349397", "0.63105273", "0.62683547", "0.62573814", "0.6188355", "0.61810166", "0.6174985", "0.60993695", "0.60754585", "0.6070981", "0.60292786", "0.6028391", "0.60...
0.0
-1
Less is more accepts (node, [path, ...])
def fun(item): node, path = item value = len(path) if node in problem.food: value -= 20 return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def less_nested_example_vanilla():\n return", "def less_nested_example_rst():\n\n return", "def less_nested_example_googlestyle(a):\n return a", "def explore(self, *args):", "def traverse(name, furtherPath):", "def process_lessjs(source, filepath):\n # This is a simple pass through, we don't ...
[ "0.58981407", "0.5750831", "0.5233719", "0.5231554", "0.5133759", "0.5094836", "0.50221986", "0.50221986", "0.49672624", "0.489807", "0.4756346", "0.46777958", "0.45781782", "0.45700714", "0.45614952", "0.4553109", "0.45303732", "0.44701698", "0.4464686", "0.44632816", "0.445...
0.0
-1
A heuristic function estimates the cost from the current state to the nearest goal in the provided SearchProblem. This heuristic is trivial.
def nullHeuristic(state, problem=None): return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uniformCostSearch(problem):\n # Initialization\n startState = problem.getStartState()\n\n if problem.isGoalState(startState):\n return [] # No action needed\n\n closedSet = set()\n queue = util.PriorityQueue()\n queue.push((startState, None, 0), 0)\n cameFrom = dict() # Stores most ...
[ "0.7426861", "0.7402951", "0.7289034", "0.7282451", "0.72603494", "0.7188548", "0.7183276", "0.7157552", "0.710176", "0.7078661", "0.7068745", "0.7043972", "0.7041973", "0.7037503", "0.7026081", "0.70163196", "0.7001862", "0.7000626", "0.69820946", "0.6965764", "0.6959505", ...
0.0
-1
write internal data to hdf5 file
def _write_data(self, filename=None, mode="a", file_kwargs=None, **kwargs): super()._write_data(filename, mode=mode, file_kwargs=file_kwargs, **kwargs) if filename is None: filename = self._cache_filename if file_kwargs is None: file_kwargs = {} # writing extra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_as_hdf5(self, filename):", "def write_hdf5(filename, data):\n \n if '.h5' in filename:\n fid = h5py.File(filename, 'w')\n else:\n filename = filename+'.h5'\n fid = h5py.File(filename, 'w')\n\n print('Writing %s...'%filename)\n\n write_hdf5_group(fid, data)\n\n fid....
[ "0.7799721", "0.7452895", "0.73623675", "0.73379844", "0.72146076", "0.71774447", "0.7131744", "0.71247923", "0.71233344", "0.708684", "0.70274025", "0.7017833", "0.70083266", "0.69717515", "0.69588876", "0.6957693", "0.69514626", "0.69412285", "0.69244695", "0.6864818", "0.6...
0.6128824
75
Retrieve one modulation mask for all kids.
def mod_mask(self): # Check the *_masq values self.__log.debug("Checking the *_masq arrays") # Retrieve the kid boxes masq_names = np.unique(["{}_masq".format(item[1]) for item in self.list_detector]) self.__check_attributes(masq_names, read_missing=False) # Check that th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mask(self, h, k):\n return self.mask[(self.h==h)&(self.k==k)]", "def mask(self):\n return self._mask", "def mask(self):\n return self._mask", "def mask(self):\n return self._mask", "def mask(self):\n return self._mask", "def mask_id(self):\n m = 2 * self.mask...
[ "0.62485987", "0.600278", "0.600278", "0.600278", "0.600278", "0.59038883", "0.58914554", "0.58771306", "0.58382463", "0.58314395", "0.58291423", "0.5816771", "0.5796399", "0.5791533", "0.5784373", "0.5745093", "0.5737748", "0.5737748", "0.5713765", "0.56971776", "0.5696885",...
0.6057825
1
Compute undersampled obstime. Properly compute the undersampled timestamp at the middle of the observed bloc
def u_obstime(self): mask = self.mod_mask == 0 obstime = self.obstime _u_mjd = [np.mean(_mjd[_mask]) for _mjd, _mask in zip(obstime.mjd, mask)] if np.any(np.isnan(_u_mjd)): _u_mjd = interp_nan(_u_mjd) return Time(_u_mjd, format="mjd", scale=obstime.scale)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def samplingTime(self):\n return self._AWG.samplingTime_ns()", "def __call__ (self, t):\n #if t <= self.last_t:\n #raise SpaceTimeContinuumError(\n #\"We're moving back in time! Last t = {}, now = {}\".format(\n #self.last_t, t))\n\n #samp = self._sample(t)\n #self.last_t = t...
[ "0.6286706", "0.5756881", "0.5651613", "0.55432194", "0.5527626", "0.54772675", "0.5466851", "0.5460345", "0.5403053", "0.5351182", "0.53404397", "0.5338423", "0.53370214", "0.5308798", "0.53036666", "0.52976394", "0.52803427", "0.5275267", "0.52614385", "0.52611965", "0.5260...
0.5138226
38
Retrieve interpolated telescope position, without shift.
def _get_positions(self, coord="pdiff", undersampled=True): if undersampled: mjd = self.u_obstime else: mjd = self.obstime.flatten() return self.telescope_positions.get_interpolated_positions(mjd, key=coord)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_original_observation(self) -> Tuple[float, np.ndarray]:\n toe_position = np.array(\n self._robot.foot_positions(), dtype=self._dtype).flatten()\n\n return self._robot.timestamp, toe_position", "def get_pos(self):\n current_angles = self.chain.get_current_values()\n current_xyz...
[ "0.65298414", "0.60537887", "0.6028942", "0.5994292", "0.5923824", "0.59053487", "0.5886543", "0.58772236", "0.58618027", "0.58261776", "0.5751239", "0.5709363", "0.5693063", "0.56841815", "0.56787586", "0.56739885", "0.5669671", "0.56431454", "0.5637774", "0.56372565", "0.56...
0.5776665
10
Calibrate the KIDS timeline.
def calib_raw(self, calib_func="kidsdata.kids_calib.get_calfact", clean_raw=False, **kwargs): if getattr(self, "__calib", None) is None: self.__log.debug("calibration using {}".format(calib_func)) self.__check_attributes(["I", "Q"], read_missing=False) fmod = self.fmod ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calibrate(self):\n self.current_state = \"calibrate\"\n self.next_state = \"idle\"\n self.kinect.loadCameraCalibration()\n # location_strings = [\"lower left corner of board\",\n # \"upper left corner of board\",\n # \"upper righ...
[ "0.6088966", "0.5734548", "0.57042384", "0.5601051", "0.5569389", "0.5563158", "0.5531026", "0.5407101", "0.536125", "0.534526", "0.5302023", "0.5276291", "0.52127695", "0.51961476", "0.5159317", "0.5137682", "0.51142454", "0.5114052", "0.5102007", "0.50755095", "0.505544", ...
0.0
-1
Check if the data has been read an attribute and read in it if not.
def __check_attributes(self, attr_list, **kwargs): dependancies = [ # I & Q will need A_masq (["I", "Q"], ["I", "Q", "A_masq"]), # Calibration data depends on the I, Q & A_masq raw data (["calfact", "Icc", "Qcc", "P0", "R0", "interferograms", "continuum"], ["I", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_attribute_reads(self):\n for serialized, attrs_read in sorted(\n six.iteritems(self.attributes_read), key=self._cls_sort\n ):\n typ = self.unserialize_type(serialized)\n if typ is None:\n continue\n # we setattr on it with an unreso...
[ "0.7005799", "0.6510016", "0.64761245", "0.64538723", "0.60407066", "0.59270316", "0.59244365", "0.5909545", "0.59069735", "0.5895281", "0.5894877", "0.58773875", "0.5852896", "0.5836397", "0.57878715", "0.5777165", "0.57314855", "0.56984305", "0.5665628", "0.5655421", "0.561...
0.52089477
83
Plot azimuth and elevation to check pointing.
def plot_pointing(self, *args, coord="tl", **kwargs): # TODO: Generalize that function warnings.warn("Deprecated function needs update.", DeprecationWarning) self.__check_attributes(["F_{}_az".format(coord), " F_{}_el".format(coord)]) return kids_plots.checkPointing(self, *args, **kwargs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fun_azimuth(self):\n\n energy_kev = self.energy_kev.get()\n hkl = self.hkl_magnetic.get()\n hkl = hkl.replace(',', ' ') # remove commas\n hkl = hkl.replace('(', '').replace(')', '') # remove brackets\n hkl = hkl.replace('[', '').replace(']', '') # remove brackets\n ...
[ "0.67514294", "0.6518079", "0.6481947", "0.6122301", "0.6084989", "0.5980787", "0.595821", "0.591427", "0.59134316", "0.5898727", "0.58961886", "0.5819812", "0.58101857", "0.5774152", "0.5765768", "0.56982815", "0.5673791", "0.5673638", "0.56489426", "0.56288075", "0.5618178"...
0.53098726
59
Read raw data. Also read the calibrated data in the cache file if present. Notes The different Kiss telescope positions are also handled
def read_data(self, *args, cache=False, array=np.array, **kwargs): super().read_data(*args, cache=cache, array=array, **kwargs) if cache and self._cache is not None: self.__log.info("Reading cached data :") datas = [] for data in ["calib"]: datas.appe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_calibration_data(self):\n #Declare global variables.\n global calDig_T1\n global calDig_T2\n global calDig_T3\n global calDig_P1\n global calDig_P2\n global calDig_P3\n global calDig_P4\n global calDig_P5\n global calDig_P6\n gl...
[ "0.6597639", "0.6477725", "0.636037", "0.63598573", "0.628827", "0.62297404", "0.6228401", "0.62251353", "0.6199615", "0.6101772", "0.6099161", "0.60946184", "0.6057053", "0.6055482", "0.60491145", "0.60060436", "0.5973747", "0.5915173", "0.5907625", "0.5891119", "0.5857807",...
0.6502552
1
Save this measurement to the database.
def save (self) : try: # This opens and closes the connections to the database. # Since writings occur only every 10 minutes it wouldn't be efficient to # let the connection open. db = MySQLdb.connect( host=config.db_host, db=config.db_name, user=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n raise NotImplementedError", "def save(self):\n raise NotImplementedError", "def save(self):\n raise NotImplementedError", "def save(self):\n\n pass", "def save(self) -> None:\n pass", "def save(self) -> None:\n pass", "def save(self) -> None:\...
[ "0.70428246", "0.70428246", "0.70428246", "0.69544524", "0.6933446", "0.6933446", "0.6933446", "0.6923404", "0.6907648", "0.6900205", "0.6877056", "0.68489957", "0.6845812", "0.6827726", "0.6827726", "0.6827726", "0.6827726", "0.6827726", "0.6798161", "0.6755691", "0.674851",...
0.73555917
0
Generate a forest to a rectangular area.
def generate_trees(self, dx, dy, width, height, freq): forest_colors = get_forest_colors() entities = [] for y in range(dy, height): for x in range(dx, width): if not self.tiles[x][y].occupied: self.tiles[x][y].spawnable = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_forest(self, verbose):\n _antecessors = []\n for key, cluster in self.clusters.items():\n if cluster.leaf_cluster is True:\n _antecessors.append(cluster.antecessor)\n _antecessors = remdup_preserve_order(_antecessors)\n _antecessors = sorted(_antecessors, key=get_cluster_idx, ...
[ "0.6471019", "0.6346258", "0.6215654", "0.5859186", "0.5726233", "0.5726233", "0.5700902", "0.57001555", "0.555477", "0.5551676", "0.52313495", "0.5187418", "0.5162394", "0.51584244", "0.513954", "0.5130539", "0.5126125", "0.5117172", "0.5082368", "0.50747824", "0.50643945", ...
0.49609655
33
Create a door entity in map. If no coordinates are given, pick a random (x, y) from room walls. If any of the room walls are against the map border, make sure that door cannot be placed there.
def create_door(self, room=None, status="open", tile=None, name="door", color=None, random=False, x=None, y=None): walls = room.get_walls() if random: door_seed = randint(0, len(room.get_walls()) - 1) while walls[door_seed][0] == 1 or walls[door_seed][0] == room.w - 1 or walls[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_room(room):\n global map\n for x in range(room.x1+1, room.x2):\n for y in range(room.y1+1, room.y2):\n map[x][y].blocked = False\n map[x][y].block_sight = False", "def create(self):\n\t\t# Pick a random starting position not on the parameter\n\t\tx = random.randint(1...
[ "0.65702087", "0.64936954", "0.64772934", "0.61564773", "0.6066264", "0.5991652", "0.59913564", "0.59820735", "0.5963644", "0.5950242", "0.59451026", "0.5929143", "0.59172434", "0.58972824", "0.58554417", "0.58528894", "0.5851147", "0.58323514", "0.57961446", "0.57167244", "0...
0.74560183
0
Check the availability of the given car to be rented in the provided time period car The availability of this car is verified start, end The time span. The car is available if it is not rented in this time span Return True if the car is available, False otherwise
def isCarAvailable(self, car, start, end): rentals = self.filterRentals(None, car) for rent in rentals: if start > rent.end or end < rent.start: continue return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_availability(car):\n plate_num = int(car.plate[-1]) # Get the last number of the plate\n date = car.date # Get the date \n weekday = (date.weekday() + 1)*2 # Get the number of the week day\n time = date.time() # Get the time \n restricted = [(weekday-1) , weekday % 10] # Create an interva...
[ "0.74762523", "0.72714204", "0.6433187", "0.6268924", "0.6050666", "0.5963115", "0.59383965", "0.59198993", "0.58526516", "0.5742015", "0.5701476", "0.5678647", "0.5672865", "0.56615305", "0.5639994", "0.56220275", "0.56133354", "0.5568478", "0.5555473", "0.55534595", "0.5498...
0.7850646
0
Return a list of rentals performed by the provided client for the provided car client The client performing the rental. None means all clients cars The rented car. None means all cars
def filterRentals(self, client, car): result = [] for rental in self.__repository.getAll(): if client != None and rental.client != client: continue if car != None and rental.car != car: continue result.append(rental) return resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clients_sorted_by_rentals(self):\n rentals = self.get_list()\n number_of_rented_movies = dict.fromkeys([rental.client for rental in rentals], 0)\n for rental in rentals:\n number_of_rented_movies[rental.client] += 1\n items = sorted(number_of_rented_movies.items(), key = ...
[ "0.60510564", "0.57855946", "0.57267207", "0.5495068", "0.5456945", "0.5285654", "0.52423316", "0.52244574", "0.5095199", "0.5042458", "0.5001045", "0.48717806", "0.48693237", "0.48531705", "0.4853079", "0.4828688", "0.48279813", "0.48155066", "0.47878057", "0.47713622", "0.4...
0.7709649
0
Simple match and replace of string within request
def ip_match_replace(request, injectionstring): newrequest = copy.deepcopy(request) rawrequest = request.get_raw_request() for r in INJECT_MATCH_REPLACE: regex = re.compile(r) if regex.search(rawrequest): LOG.tamper("IP detected! Replaced with {}".format(injectionstring)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FillForm(string_for_substitution, dictionary_of_vars):\n return_string = string_for_substitution\n for i in re.findall(\"//%%(.*)%%//\", string_for_substitution):\n return_string = re.sub(\"//%%\" + i + \"%%//\", dictionary_of_vars[i],\n return_string)\n return return_string", ...
[ "0.6405884", "0.6129814", "0.60701466", "0.6006177", "0.5986332", "0.5944586", "0.59011203", "0.5892035", "0.5869508", "0.58229357", "0.5802855", "0.5774343", "0.57707906", "0.57680464", "0.5750596", "0.5736021", "0.57268953", "0.56956047", "0.56938297", "0.5669029", "0.56484...
0.6794092
0
Generates a list of new requests with modified headers
def inject_headers(request, injectionstring): newrequest = copy.deepcopy(request) print(injectionstring) for header in INJECT_HEADERS: headername, headervalue = header.split(":", 1) if not request.get_header(headername): LOG.debug("Added {} header to the request".format(hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetNewRequests(self):\n new_requests = self._GetRequestsByState(self._REQUESTED)\n if new_requests:\n while self._MakeRequestId() == new_requests[-1]:\n pass\n for request_id in new_requests:\n self._TransitionRequest(request_id, self._REQUESTED, self._PENDING)\n return new_reques...
[ "0.6238918", "0.58712333", "0.57931423", "0.5742827", "0.57357794", "0.57014704", "0.56626743", "0.5645553", "0.5633721", "0.5582525", "0.5544495", "0.55196536", "0.55148923", "0.54854023", "0.54710114", "0.54703796", "0.545906", "0.5444627", "0.5426233", "0.54260164", "0.542...
0.53847367
22
Generates a list of new requests with replaced/modified post parameters
def inject_post_param(request, injectionstring): requests = [] return requests
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_requests(rf):\n post_url = '/docs/modify/'\n request_succ = [{\n \"request\": gen_request(rf, post_url, {\n \"user_id\": 1,\n \"type\": \"fetch\",\n \"document_id\": 1,\n }),\n \"response\": {\n \"code\": 200,\n }\n },\...
[ "0.6704369", "0.64402634", "0.6109998", "0.6028123", "0.58909523", "0.5875955", "0.58750314", "0.5556154", "0.55441815", "0.554336", "0.5475512", "0.54604536", "0.5455437", "0.5452279", "0.54406506", "0.54406506", "0.53951675", "0.538495", "0.538451", "0.53750795", "0.5369305...
0.64869267
1
Generates a list of new requests with replaced/modified POST values
def inject_get_param(request, injectionstring): requests = [] return requests
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_requests(rf):\n post_url = '/docs/modify/'\n request_succ = [{\n \"request\": gen_request(rf, post_url, {\n \"user_id\": 1,\n \"type\": \"fetch\",\n \"document_id\": 1,\n }),\n \"response\": {\n \"code\": 200,\n }\n },\...
[ "0.67716086", "0.634673", "0.6332899", "0.6027528", "0.57943386", "0.57905877", "0.5782188", "0.56972075", "0.56329113", "0.56018573", "0.5592356", "0.5592356", "0.55672026", "0.5521018", "0.5496054", "0.54681826", "0.5431428", "0.5411524", "0.5411177", "0.53842956", "0.53448...
0.48825723
84
Generates a list of new pipelined requests
def inject_pipeline(request, injectionstring): requests = [] return requests
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __http_requests_generator(request_template, parameters):\n for payload in itertools.product(*parameters):\n yield request_template.format(*payload), payload", "def _GetNewRequests(self):\n new_requests = self._GetRequestsByState(self._REQUESTED)\n if new_requests:\n while self._MakeReque...
[ "0.6724289", "0.6341322", "0.6295706", "0.61274356", "0.61229724", "0.6103675", "0.60066134", "0.59773403", "0.5966576", "0.59564644", "0.5929572", "0.59252894", "0.589654", "0.58816415", "0.58682007", "0.585584", "0.57956004", "0.5764536", "0.5764282", "0.5758561", "0.575848...
0.60393435
6
Blocks can be quite large, so we use this method to strip it down and only retain the bare essentials in memory, also converting hashes (ByteArray) into regular hexstrings
def to_dict(block): uncles = [hash_of(u) for u in block['uncles']] parentHash = hash_of(block['parentHash']) return { 'number': block['number'], 'timestamp': block['timestamp'], 'hash': hash_of(block), 'difficulty': block['difficulty'], 'totalDifficulty': block['total...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_hashes(tex):\n blocks = catlist()\n rx = hash_rx\n m = rx.search(tex)\n while m:\n if len(m.group(2)) > 40:\n tex2htm.warn(\"Possible runaway hash: {}\".format(text_sample(m.group(2))))\n raise(None)\n blocks.append(tex[:m.start()])\n blocks.app...
[ "0.65894026", "0.5872917", "0.5733087", "0.570575", "0.5691035", "0.5496473", "0.5469316", "0.5465705", "0.5374875", "0.5371656", "0.53713965", "0.5356473", "0.5353301", "0.5333334", "0.5304726", "0.5301991", "0.5291938", "0.5291055", "0.52286994", "0.5220841", "0.52200973", ...
0.50917363
31
'type' for argparse check that filename exists
def existingFile(filename): if not os.path.exists(filename): raise argparse.ArgumentTypeError("{0} does not exist".format(filename)) return filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_is_file(_string: str) -> str:\n if os.path.isfile(_string):\n return _string\n else:\n raise argparse.ArgumentTypeError(\"{0} file does \"\n \"not exists.\".format(_string))", "def is_file(filename):\n if not os.path.isfile(filename):\n ...
[ "0.7953582", "0.7749537", "0.7593216", "0.75587696", "0.7522878", "0.7518145", "0.74682087", "0.7462185", "0.7449789", "0.73844075", "0.73225045", "0.7258668", "0.7172093", "0.707981", "0.70450455", "0.6986201", "0.69795257", "0.6910114", "0.6910114", "0.6910114", "0.6910114"...
0.7269128
11
Returns the dataset metadata.
def _info(self) -> tfds.core.DatasetInfo: # TODO(a2o): Specifies the tfds.core.DatasetInfo object return tfds.core.DatasetInfo( builder=self, description=_DESCRIPTION, features=tfds.features.FeaturesDict({ # These are the features of your dataset like images, labels ... ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset_metadata(fields=[]):\n return get_dict_from_db(key='metadata', fields=fields)", "def metadata(self, ds_name):\n return self.runinfos.get(self._infer_fqn(ds_name)).metadata._metadata", "def metadata(self):\n return {\n \"namespace\": self.namespace,\n \"sho...
[ "0.7847299", "0.77888906", "0.7739118", "0.7640124", "0.761992", "0.76041394", "0.7602396", "0.7559567", "0.7550998", "0.75146365", "0.7502366", "0.7455677", "0.7444215", "0.7444215", "0.7444215", "0.7444215", "0.7444215", "0.7418739", "0.7383594", "0.73539376", "0.7330649", ...
0.6999377
44
Solves a quadratic program related to a given qubit operator.
def get_classical_solver_result(qubit_operator, offset): qp = QuadraticProgram() qp.from_ising(qubit_operator, offset) exact = MinimumEigenOptimizer(NumPyMinimumEigensolver()) return exact.solve(qp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diop_quadratic(eq, param=symbols(\"t\", integer=True)):\n var, coeff, diop_type = classify_diop(eq, _dict=False)\n\n if diop_type == BinaryQuadratic.name:\n if param is not None:\n parameters = [param, Symbol(\"u\", integer=True)]\n else:\n parameters = None\n r...
[ "0.65440845", "0.6320849", "0.63020766", "0.6229912", "0.61942685", "0.6190736", "0.6186001", "0.6118183", "0.60612786", "0.6060127", "0.59786564", "0.59761536", "0.5858187", "0.5843685", "0.5826548", "0.57481503", "0.57365835", "0.5698943", "0.56609064", "0.5646106", "0.5635...
0.65034807
1
Returns a binary vector encoding an optimal solution to an optimization problem.
def get_exact_classical_binary_solution(qubit_operator, offset): result = get_classical_solver_result(qubit_operator, offset) return result.x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimization_vector(self) -> np.ndarray:\n filtered_iterator = compress(self.vector, self.optimization_mask)\n optimization_vector = np.array(list(filtered_iterator))\n return optimization_vector", "def solve(self):\n self.m.optimize()\n if self.m.status == GRB.OPTIMAL:\n ...
[ "0.6893173", "0.665314", "0.6557473", "0.647703", "0.6345918", "0.633206", "0.63156945", "0.628036", "0.6168579", "0.61620003", "0.61477494", "0.6007469", "0.60018325", "0.59688574", "0.5909438", "0.58359194", "0.577035", "0.5728536", "0.5710103", "0.56864226", "0.5670657", ...
0.5557718
30
Returns a value of an optimal solution to an optimization problem.
def get_exact_classical_fval_solution(qubit_operator, offset): result = get_classical_solver_result(qubit_operator, offset) return result.fval
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(self):\n self.m.optimize()\n if self.m.status == GRB.OPTIMAL:\n self.solution = self.sol_as_mat()\n return self.solution", "def objective(self) -> Optional[Union[int, float]]:\n if self.solution is not None:\n if isinstance(self.solution, list):\n ...
[ "0.71841055", "0.69984436", "0.6975628", "0.6838121", "0.6757776", "0.6716559", "0.6687618", "0.66042393", "0.657063", "0.65611017", "0.6551528", "0.6525855", "0.65247995", "0.65053076", "0.64765835", "0.64513785", "0.6442589", "0.6405521", "0.63852507", "0.6353897", "0.63113...
0.0
-1
Create a new type of bow.
def main(bow: api_models.Bow): found_matching = list( BowModel.scan((BowModel.type == bow.type) & (BowModel.size == bow.size)) ) if found_matching: return bad_request(f"{bow.size} {bow.type} bows already exist") new_bow = BowModel(**bow.dict()) new_bow.save() new_bow.refresh() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_bb_object(name, data):\n global BLACKBOARD, TRACE_LEVEL\n bb_obj = BB_object(name, data)\n if TRACE_LEVEL > 2:\n print \"\\tCreating {0} object: {1}\".format( type(data), bb_obj )\n BLACKBOARD[name] = bb_obj\n signal_creation_event(bb_obj)\n return bb_obj", "def create_b_obj(ob_...
[ "0.60078704", "0.5955134", "0.5922723", "0.58871335", "0.5825036", "0.5780621", "0.56854033", "0.56650245", "0.56517565", "0.5644541", "0.5636475", "0.56316453", "0.55873847", "0.5506105", "0.54752946", "0.5444", "0.54189473", "0.54167676", "0.54038286", "0.53963405", "0.5381...
0.5628096
12
Load configuration from the command line.
def load_configuration(): argparser = ArgumentParser(description="Zoe application tester - Container Analytics as a Service core component", default_config_files=CONFIG_PATHS, auto_env_var_prefix="ZOE_MASTER_", args_for_set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli_load_config(self, args) -> str:\n path = args.config_path\n if not os.path.isfile(path):\n return error(\"Path {} DNE\".format(path))\n\n try:\n self.config = config.from_file(path)\n return ok(\"Configuration loaded from {}\".format(path))\n exc...
[ "0.7120539", "0.68881625", "0.681006", "0.6799535", "0.6736724", "0.66192234", "0.6616781", "0.65878206", "0.65739673", "0.6562336", "0.65211356", "0.6520706", "0.65050936", "0.63761", "0.6373241", "0.6360475", "0.6336217", "0.628978", "0.6279129", "0.6274624", "0.62703437", ...
0.63583165
16
The main entrypoint function.
def main(): conf = load_configuration() config.load_configuration(conf) args = config.get_conf() if args.debug: logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT) else: logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) logging.getLogger('kazoo').setLevel(loggin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n return", "def main():\n pass", "def entry_point():", "def entry_point():", "def entry_point():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():",...
[ "0.8444882", "0.82910585", "0.82036114", "0.82036114", "0.82036114", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299", "0.8200299",...
0.0
-1
Inicializamos la escena Creando los objetos pertinentes a partir de un archivo xml. Este archivo Contiene los datos de inicio del mapa, objetos, y personajes de la presente escena
def __init__(self, xdoc): self.xdoc = parse(xdoc) self.mapa = mapa.Mapa(self.xdoc) self.scrollx = 0 self.scrolly = 0 self.eventos = self.load_events()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, xml_file):\n try:\n # Load xml file\n fd = resource_stream(__name__, 'map/{}'.format(xml_file))\n self.spec = parse(fd)\n self.remove_whitespace_nodes(self.spec, True)\n fd.close()\n\n except OSError:\n raise EDIFile...
[ "0.60758257", "0.5842823", "0.5804946", "0.57069564", "0.56295884", "0.5622552", "0.5592632", "0.55789083", "0.55294085", "0.5513903", "0.54790515", "0.5420149", "0.5392184", "0.5384201", "0.53596526", "0.5341668", "0.53402734", "0.5339765", "0.53388315", "0.53207237", "0.531...
0.5259194
24
Movemos el scroll, esto simula el efecto "Camara"
def mover_scroll(self, x, y): self.scrollx += x self.scrolly += y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scroll(*args):", "def _on_scroll(self, event):", "def start_scroll():\n send_command(0x2F)", "def __window_scroll(self, x, y):\n pass", "def flash(self, **kwargs):\n self.scroll(**kwargs) # Temporary, will be replaced", "def scroll(self):\n x_position = self._player.get_posit...
[ "0.7052662", "0.67604154", "0.6638475", "0.64753455", "0.6438798", "0.6330283", "0.62574166", "0.61876434", "0.6171355", "0.6170008", "0.60271", "0.5980288", "0.5942342", "0.5936811", "0.59058535", "0.58835864", "0.58601457", "0.58331525", "0.5827912", "0.58076257", "0.579227...
0.6232758
7
Actualiza el mapa y los personajes
def update(self, wd): self.eventos[0].update(wd) self.eventos[1].update(wd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n\n # Ordenamos los personajes por fila, para luego dibujarlos correctamente. Para que no se solapen.\n self._personajes.sort(self._comparar_coordenadas_personajes)\n\n for personaje in self._personajes:\n if (personaje.andando): # Si está andando.\n ...
[ "0.7645867", "0.60846424", "0.6079712", "0.591618", "0.5849605", "0.58402264", "0.5831927", "0.58309704", "0.57731956", "0.5655802", "0.5642587", "0.56421083", "0.5594711", "0.55926394", "0.55504715", "0.5531594", "0.5530021", "0.5497458", "0.54852766", "0.5479607", "0.546547...
0.0
-1
ordering of health networks should be by priority, name
def test_health_networks_ordering(self): state = State.objects.get(name="NC") hns = HealthNetwork.objects.filter(state=state) hns_p = {n: [hn for hn in hns if hn.priority == n] for n in PRIORITY.keys()} self.assertEqual( hns_p[0], hns[: len(hns_p[0])], msg="priority 0 health ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def priority(name):\n try:\n manager = Actions()\n priority = Priority[name]\n ordered_tasks = manager.order_by_priority(priority)\n click.echo(\"Ordered by priority:\" + click.style(name, bg='red', fg='white'))\n click.echo()\n console_utils.format_print_ordered(ordere...
[ "0.5870013", "0.58105636", "0.57861495", "0.5686132", "0.56482583", "0.56482583", "0.5623373", "0.53816515", "0.53049576", "0.5292775", "0.5250956", "0.52294445", "0.52216697", "0.515409", "0.5107319", "0.51055664", "0.50733155", "0.506472", "0.50563586", "0.5054701", "0.5054...
0.795008
0
creating a network with the same name in a different state is fine, but creating a network with the same name in the same state raises an IntegrityError
def test_unique_health_networks_per_state(self): state1 = State.objects.get(name="NC") state2 = State.objects.get(name="SC") kwargs = dict(priority=0, name="My Non-existent Health Network") HealthNetwork.objects.create(state=state1, **kwargs) HealthNetwork.objects.create(state=st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_and_set_network(self) -> None:\n from hathor.transaction.storage.exceptions import WrongNetworkError\n\n network = settings.NETWORK_NAME\n stored_network = self.get_network()\n\n if stored_network is None:\n # no network is set, let's try to infer it\n s...
[ "0.62125087", "0.61994624", "0.6185668", "0.61371464", "0.6014497", "0.59862936", "0.5978605", "0.5846337", "0.5810719", "0.5770879", "0.5749314", "0.57286835", "0.57163084", "0.56837964", "0.5681908", "0.5677037", "0.5669655", "0.5665639", "0.5654778", "0.5654763", "0.564764...
0.6288055
0
adding a network with an unsupported priority raises an error
def test_add_wrong_priority(self): state = State.objects.get(name="NC") bad_priority = len(list(PRIORITY.keys())) # 1 higher than the available priorities. kwargs = dict(state=state, priority=bad_priority, name="My Non-existent Health Network") self.assertRaises(ValidationError, Health...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_network(self):\n pass", "def add_network(self, router, network, distance):\n self.routers[router].add_network(network, distance)", "def add_network(self, network, distance):\n self.networks[network] = distance", "def add_nei(self, dest: int, weight: float):\r\n if not...
[ "0.6310278", "0.5923847", "0.5907903", "0.56655437", "0.56389827", "0.55968845", "0.55506074", "0.54959756", "0.5477577", "0.5470298", "0.54657966", "0.5449305", "0.54388195", "0.5422788", "0.5414837", "0.54006034", "0.5377785", "0.5374897", "0.5343064", "0.5321249", "0.53177...
0.61365
1
Postprocess a symbol table after collecting from one source. If the symbol table contains FILE symbols, they will be removed and replaced by a 'file' column on other symbols. If the symbol table contains ARM mode symbols, they will be removed and replaced by an 'arm' column on other symbols.
def postprocess_symbols(config: Config, symbols: SymbolDF) -> SymbolDF: files = [] arms = [] arm_symbols = {} current_file = '' current_arm = '' has_file = False if config['collect.prefix-file']: prefixes = config.get_re('collect.prefix') else: prefixes = None if 'typ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postprocess_file(config: Config, dfs: DFs) -> None:\n if SymbolDF.name in dfs:\n dfs[SymbolDF.name] = postprocess_symbols(config, dfs[SymbolDF.name])", "def parse_symbol_table(data, sections, elf_header):\n if is64bit(elf_header):\n symbol_entry_str = symbol_64_entry_str\n symbol_e...
[ "0.6027799", "0.57213014", "0.5678896", "0.53370655", "0.53370655", "0.5240379", "0.510453", "0.5102045", "0.50985175", "0.50433695", "0.49907583", "0.4950016", "0.49235138", "0.4910098", "0.49089348", "0.48771235", "0.48708987", "0.4854355", "0.48283255", "0.48272", "0.47998...
0.72918737
0
Postprocess tables after collecting from one source.
def postprocess_file(config: Config, dfs: DFs) -> None: if SymbolDF.name in dfs: dfs[SymbolDF.name] = postprocess_symbols(config, dfs[SymbolDF.name])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _postprocess_arena(self):\n # Create tables\n for i, (offset, rot, half_size, friction, legs) in enumerate(\n zip(self.table_offsets, self.table_rots, self.table_half_sizes, self.table_frictions, self.has_legs)\n ):\n self._add_table(\n name=f\"table{i}...
[ "0.61825305", "0.60425353", "0.59419334", "0.58763474", "0.58517617", "0.5847505", "0.5841374", "0.5800364", "0.578673", "0.5686195", "0.56758976", "0.56543654", "0.56543654", "0.56543654", "0.56543654", "0.5629716", "0.56151396", "0.5608233", "0.5608233", "0.5608233", "0.560...
0.0
-1
Account for space not used by any symbol, or by multiple symbols.
def fill_holes(config: Config, symbols: SymbolDF, sections: SectionDF) -> DFs: # These symbols mark the start or end of unused space. start_unused = frozenset(config.get('symbol.free.start', [])) end_unused = frozenset(config.get('symbol.free.end', [])) extent_columns = ['address', 'size', 'section', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_space(self):\n return self.pos == self.SPACE_POS", "def take_symbol(self, symbol):\r\n if symbol not in self._taken_symbols:\r\n for cell in self.cells:\r\n cell.remove_possible_symbol(symbol)\r\n self._taken_symbols.add(symbol)", "def check_spacers(\n ...
[ "0.6041976", "0.5827814", "0.5804597", "0.57901514", "0.57184106", "0.568177", "0.56775665", "0.566192", "0.565856", "0.56135005", "0.5584242", "0.55753756", "0.5569027", "0.5534547", "0.55102926", "0.54688996", "0.54683703", "0.54683703", "0.54659444", "0.5464312", "0.546431...
0.0
-1
Add a row for a unaccounted gap or unused space.
def fill_gap(previous, current, from_address, to_address) -> Tuple[str, List]: size = to_address - from_address if (previous is None or previous.symbol in start_unused or current.symbol in end_unused): use = 'unused' name = memdf.name.unused(from_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_row(self, index):\n if index is None:\n index = self.size\n\n if index < self.size:\n raise ValueError(f\"Duplicate row index: {index}\")\n\n for empty in range(self.size, index):\n self._add_row(empty)\n\n self._data.append([None] * len(self._c...
[ "0.6710395", "0.6708118", "0.66811764", "0.66745555", "0.6542515", "0.64227355", "0.63794637", "0.6323013", "0.62881213", "0.62115365", "0.6197191", "0.6190543", "0.6182664", "0.61804724", "0.61694866", "0.61547035", "0.6145907", "0.6137686", "0.60447454", "0.6037223", "0.602...
0.0
-1
Add a row for overlap.
def fill_overlap(previous, current, from_address, to_address) -> Tuple[str, List]: size = to_address - from_address return ('overlap', filler(memdf.name.overlap(from_address, -size), from_address, size, previous, current))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _merge_row(self, row1, row2):\n\n duprow = list(row1)\n duprow.extend(list(row2))\n row1.clear()\n overlap_map = {}\n\n for body, overlap in duprow:\n if body not in overlap_map:\n overlap_map[body] = 0\n overlap_map[body] += overlap\n\n ...
[ "0.75222784", "0.59805727", "0.5978246", "0.5941416", "0.5901618", "0.58065987", "0.5796185", "0.5759986", "0.5754992", "0.5733107", "0.572763", "0.57233435", "0.5666602", "0.5605347", "0.5599895", "0.55902666", "0.5554072", "0.55292296", "0.5527764", "0.5526137", "0.54562134...
0.4893149
84
Postprocess tables after reading all sources.
def postprocess_collected(config: Config, dfs: DFs) -> None: # Prune tables according to configuration options. This happens before # fill_holes() so that space of any pruned symbols will be accounted for, # and to avoid unnecessary work for pruned sections. for c in [SymbolDF, SectionDF]: if c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _postprocess_arena(self):\n # Create tables\n for i, (offset, rot, half_size, friction, legs) in enumerate(\n zip(self.table_offsets, self.table_rots, self.table_half_sizes, self.table_frictions, self.has_legs)\n ):\n self._add_table(\n name=f\"table{i}...
[ "0.64844763", "0.62486094", "0.62363154", "0.6221706", "0.6031505", "0.60259247", "0.6016668", "0.6016668", "0.6016668", "0.6016668", "0.59789", "0.59558296", "0.59290904", "0.5916375", "0.5908061", "0.5895049", "0.5893003", "0.5863377", "0.584784", "0.583412", "0.58197707", ...
0.5442561
45
Read a filtered memory map from a set of files.
def collect_files(config: Config, files: Optional[List[str]] = None, method: Optional[str] = None) -> DFs: filenames = files if files else config.get('args.inputs', []) if method is None: method = config.get('collect.method', 'csv') frames: Dict[str, List[DF]] = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_mapfiles():\n mappings = []\n\n # matches stuff like\n # \"/GLOW/*\" glow\n # \"/cms/Role=pilot/Capability=NULL\" cmspilot\n # and extracts the stuff between the quotes, and the username in the second field\n regex = re.compile(r'^\\s*[\"](/[^\"]+)[\"]\\s+([A-Za-z0-9_]+)\\s*(?:$|[#])...
[ "0.6457381", "0.607028", "0.60247785", "0.5874819", "0.5851086", "0.5847088", "0.570969", "0.5702015", "0.5685579", "0.56646115", "0.5615684", "0.55467254", "0.55415946", "0.5541046", "0.5515222", "0.5513438", "0.54860705", "0.5483462", "0.5472742", "0.54673123", "0.5456363",...
0.0
-1
Common argument parsing for collection tools.
def parse_args(config_desc: Mapping, argv: Sequence[str]) -> Config: config = Config().init({ **memdf.util.config.CONFIG, **CONFIG, **config_desc }) config.argparse.add_argument('inputs', metavar='FILE', nargs='+') return config.parse(argv)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def Args(parser):", "def __parse_args(self):\n for argument in self.args:\n source_arg = re.match(\"^(--source=(([A-Z]|[a-z]|/|_|[0-9]|.)+))$\", argument)\n input_arg = re.match(\"^(--input=(([A-Z]|[a-z]|/|_|[0-9]|.)+))$\", argument)\n stats...
[ "0.7560228", "0.73836064", "0.71728504", "0.7085921", "0.6995286", "0.69865096", "0.68940294", "0.68828773", "0.6829608", "0.6814625", "0.68021065", "0.6786284", "0.6759703", "0.67539513", "0.67370564", "0.6736484", "0.67044693", "0.6697017", "0.6683502", "0.6677242", "0.6626...
0.0
-1
Make a test database to serve information to the rrlyrae test
def makeRRlyTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of stellar SEDs sedFiles = ['kp10_8750.fits_g35_8950', 'kp03_10500.fits_g45_10600', 'km50_6750.fits_g20_6750'] # a haphazard sample of RRLyrae light curves lcFiles = ['rrly_lc/RRc/959802_per.txt', 'rrly_lc/RRc/1078860...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n # Get the Flask test client.\n self.client = app.test_client()\n app.config[\"TESTING\"] = True\n app.config[\"SQLALCHEMY_TRACK_MODIFICATIONS\"] = False\n\n # Connect to the test database.\n connect_to_db(app, db_uri=\"postgresql:///testnourish\") \n\n...
[ "0.72048223", "0.7181469", "0.71430147", "0.71430147", "0.71430147", "0.7121495", "0.71103686", "0.7101406", "0.70937717", "0.7093083", "0.70615804", "0.7047677", "0.70354503", "0.696573", "0.69542927", "0.69425315", "0.6937596", "0.6917083", "0.69113886", "0.6874605", "0.686...
0.0
-1
Make a test database to serve information to the cepheid test
def makeCepheidTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of stellar SEDs sedFiles = ['kp10_8750.fits_g35_8950', 'kp03_10500.fits_g45_10600', 'km50_6750.fits_g20_6750'] # a haphazard sample of cepheid light curves lcFiles = ['cepheid_lc/classical_longPer_specfile', 'cephe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n # Get the Flask test client.\n self.client = app.test_client()\n app.config[\"TESTING\"] = True\n app.config[\"SECRET_KEY\"] = \"key\"\n app.config[\"SQLALCHEMY_TRACK_MODIFICATIONS\"] = False\n\n with self.client as c:\n with c.session_trans...
[ "0.74151266", "0.7258446", "0.721034", "0.71372515", "0.71106255", "0.7081062", "0.70735544", "0.70537037", "0.70427746", "0.7021754", "0.7007703", "0.7007703", "0.7007703", "0.69921845", "0.6984731", "0.6974774", "0.6953756", "0.69427204", "0.6927968", "0.6910455", "0.689305...
0.0
-1
Make a test database to serve information to the Eb test
def makeEbTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of eclipsing binary light curves lcFiles = ['eb_lc/EB.2294.inp', 'eb_lc/EB.1540.inp', 'eb_lc/EB.2801.inp'] conn = sqlite3.connect(database) c = conn.cursor() try: c.execute('''CREATE TABLE eb ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n # Get the Flask test client.\n self.client = app.test_client()\n app.config[\"TESTING\"] = True\n app.config[\"SQLALCHEMY_TRACK_MODIFICATIONS\"] = False\n\n # Connect to the test database.\n connect_to_db(app, db_uri=\"postgresql:///testnourish\") \n\n...
[ "0.7369731", "0.7358841", "0.73523945", "0.73413175", "0.73236394", "0.73226213", "0.72732764", "0.72732764", "0.72732764", "0.7254238", "0.72534025", "0.7238794", "0.72169465", "0.71818703", "0.7181675", "0.71753734", "0.71528864", "0.7105111", "0.70832896", "0.7079517", "0....
0.0
-1
Make a test database to serve information to the microlensing test
def makeMicrolensingTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of stellar SEDs sedFiles = ['kp10_8750.fits_g35_8950', 'kp03_10500.fits_g45_10600', 'km50_6750.fits_g20_6750'] # there are two microlensing methods; they should be equivalent method = ['applyMicrolensing', 'ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n # Get the Flask test client.\n self.client = app.test_client()\n app.config[\"TESTING\"] = True\n app.config[\"SECRET_KEY\"] = \"key\"\n app.config[\"SQLALCHEMY_TRACK_MODIFICATIONS\"] = False\n\n with self.client as c:\n with c.session_trans...
[ "0.6949616", "0.6874204", "0.67825353", "0.67642397", "0.6715823", "0.6712028", "0.669866", "0.66828644", "0.66631645", "0.6657591", "0.66463125", "0.66290164", "0.66002905", "0.6599407", "0.6549921", "0.6536971", "0.6536971", "0.6536971", "0.6516672", "0.65152085", "0.651215...
0.0
-1
Make a test database to serve information to the BHmicrolensing test
def makeBHMicrolensingTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of stellar SEDs sedFiles = ['kp10_8750.fits_g35_8950', 'kp03_10500.fits_g45_10600', 'km50_6750.fits_g20_6750'] # a sample of black hole microlensing light curves that do not repeat time steps # (repeating ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dummydb_basic(self):\n db = DummyDB()", "def setUp(self):\n\n # Get the Flask test client.\n self.client = app.test_client()\n app.config[\"TESTING\"] = True\n app.config[\"SECRET_KEY\"] = \"key\"\n app.config[\"SQLALCHEMY_TRACK_MODIFICATIONS\"] = False\n\n ...
[ "0.7080517", "0.69557416", "0.6924083", "0.6852441", "0.6830986", "0.6815932", "0.6808822", "0.6800836", "0.6785046", "0.67655325", "0.67539275", "0.6749509", "0.6723518", "0.6722012", "0.66994596", "0.6666832", "0.6664048", "0.6664048", "0.6664048", "0.66402483", "0.66355497...
0.0
-1
Make a test database to serve information to the AMCVN test
def makeAmcvnTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of white dwarf SEDs sedFiles = ['bergeron_He_4750_70.dat_4950', 'bergeron_50000_85.dat_54000'] conn = sqlite3.connect(database) c = conn.cursor() try: c.execute('''CREATE TABLE amcvn ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_db():\n test_uta_db = UTADatabase()\n await test_uta_db._create_genomic_table()\n return test_uta_db", "def create_test_db(self, *args, **kw):\n self.destroy_test_db()\n self.connection.use_test_datastore = True\n self.connection.flush()", "def setUp(self):\n\n # Get the...
[ "0.70171046", "0.6997887", "0.6953645", "0.69216573", "0.690113", "0.68899894", "0.6856438", "0.6852487", "0.68396735", "0.68202394", "0.68202394", "0.68202394", "0.68062794", "0.67793113", "0.67728156", "0.6721817", "0.6707253", "0.6691685", "0.66833436", "0.66819924", "0.66...
0.0
-1
Make a test database to serve information to the microlensing test
def makeAgnTable(size=100, database=VARIABILITY_DB, **kwargs): # a haphazard sample of galaxy SEDs sedFiles = ['Exp.31E06.0005Z.spec', 'Inst.79E06.1Z.spec', 'Const.50E07.0005Z.spec'] conn = sqlite3.connect(database) c = conn.cursor() try: c.execute('''CREATE TABLE agn (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n # Get the Flask test client.\n self.client = app.test_client()\n app.config[\"TESTING\"] = True\n app.config[\"SECRET_KEY\"] = \"key\"\n app.config[\"SQLALCHEMY_TRACK_MODIFICATIONS\"] = False\n\n with self.client as c:\n with c.session_trans...
[ "0.6950125", "0.6874638", "0.6783422", "0.6764957", "0.67164266", "0.67127717", "0.66987395", "0.6683703", "0.66637313", "0.665844", "0.6646214", "0.6629767", "0.6601191", "0.65999836", "0.65497684", "0.65371394", "0.65371394", "0.65371394", "0.6516805", "0.65154845", "0.6512...
0.0
-1
Make a test database that contains a mix of Cepheid variables and 'testVar' variables (variables that use the applySineVar method defined in the TestVariabilityMixin)
def makeHybridTable(size=100, database='VariabilityTestDatabase.db', **kwargs): # a haphazard sample of stellar SEDs sedFiles = ['kp10_8750.fits_g35_8950', 'kp03_10500.fits_g45_10600', 'km50_6750.fits_g20_6750'] # a haphazard sample of cepheid light curves lcFiles = ['cepheid_lc/classical_longPer_spec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_variational():\n # iris\n #pres = \"Test pour le data set Iris (facile, classique)\"\n #test_from_func_variational(pres, 15, 10, 3, True, Iris)\n\n # breast cancer\n pres = \"Test pour le data set Breast Cancer (facile, classique)\"\n test_from_func_variational(pres, 15, 10, 3, True, Bre...
[ "0.6573082", "0.58943033", "0.57813627", "0.5771824", "0.57339275", "0.57289785", "0.5722299", "0.5717864", "0.55727744", "0.5547445", "0.5542909", "0.55299455", "0.5520713", "0.5497947", "0.54763407", "0.5471372", "0.5468235", "0.545974", "0.5452203", "0.54360193", "0.543247...
0.5262734
37
Verify that a catalog generated by the unit tests below contains the rows it ought to. This is done by looking for a corresponding catalog in tests/testData and verifying that the two catalogs have identical rows.
def verify_catalogs(self, cat_name): control_dir = os.path.join(getPackageDir('sims_catUtils'), 'tests', 'testData') _, control_name = os.path.split(cat_name) control_name = os.path.join(control_dir, control_name) with open(control_name, 'r') as contro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_see_all_different_products(self):\n\n # create new unittest data\n ImportUnitTestData.import_data_handler()\n # create new data\n try:\n current_dir = os.getcwd()\n directory_name = current_dir + '\\\\lesson5\\\\data\\\\'\n file_name_dict = {'pr...
[ "0.64208776", "0.61701244", "0.6072419", "0.60301155", "0.6008713", "0.6000412", "0.59985", "0.5942207", "0.59310716", "0.5895737", "0.5893529", "0.5886061", "0.58684117", "0.5866197", "0.5834321", "0.5827727", "0.5790548", "0.5764453", "0.5762863", "0.575223", "0.5746735", ...
0.6838003
0
Test that we can generate a catalog which inherits from multiple variability mixins (in this case, TestVariability and VariabilityStars). This is to make sure that the register_method and register_class decorators do not mangle inheritance of methods from mixins.
def testHybridVariability(self): cat_name = os.path.join(self.scratch_dir, 'hybridTestCatalog.dat') makeHybridTable(database=self.variability_db) myDB = CatalogDBObject.from_objid('hybridTest', database=self.variability_db) myCatalog = StellarVariabilityCatalogWithTest(myDB, obs_metadata...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ProcessMixins(self, mixins):\n self._mixins = mixins", "def test():\n # the component superclass\n from p2.components.Component import Component\n # the trait factory\n from p2.traits.Measure import Measure as measure\n\n\n # subclass\n class Base(Component):\n \"\"\"\n A s...
[ "0.57527846", "0.57445997", "0.5671585", "0.5648246", "0.551333", "0.5491303", "0.54901725", "0.5403399", "0.5254813", "0.5250898", "0.5245918", "0.5179942", "0.5150097", "0.5106484", "0.5104359", "0.5093766", "0.5088895", "0.5082123", "0.5071844", "0.5065457", "0.5057772", ...
0.63517714
0
Use the hybrid variability catalog class from testHybridVariability to verify that, if we pass an array of expmjd into applyVariability, we get the expected result out.
def testApplyVariabilityWithManyMJD(self): makeHybridTable(database=self.variability_db) hybrid_db = hybridDB(database=self.variability_db) hybrid_cat = StellarVariabilityCatalogWithTest(hybrid_db, obs_metadata=self.obs_metadata, column_out...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_var_exp(self):\n with self.test_context() as session:\n test_setups, F, feed = self.prepare()\n for test_setup in test_setups:\n l = test_setup.likelihood\n y = test_setup.Y\n l.compile()\n r1 = session.run(l.logp(F, ...
[ "0.62441033", "0.5478328", "0.54694235", "0.53534585", "0.5264933", "0.5245997", "0.5183478", "0.5169352", "0.5164767", "0.5156014", "0.50279623", "0.5003747", "0.49608055", "0.49578118", "0.49560577", "0.4934729", "0.49292457", "0.487284", "0.4847929", "0.484281", "0.4840532...
0.74344283
0
Just verify that the catalog generation code runs in this case
def testAgn(self): cat_name = os.path.join(self.scratch_dir, 'agnTestCatalog.dat') makeAgnTable(database=self.variability_db) myDB = CatalogDBObject.from_objid('agnTest', database=self.variability_db) obs = ObservationMetaData(pointingRA=self.obs_metadata.pointingRA, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_hyperflex_app_catalog(self):\n pass", "def final_check(self, test_collection):\n assert True", "def test_update_hyperflex_app_catalog(self):\n pass", "def test_get_catalogue(self):\n s1 = System()\n self.assertEqual(len(s1.get_catalogue()), 0)", "def testC...
[ "0.6712688", "0.6389315", "0.6382587", "0.6253937", "0.62304395", "0.61791164", "0.6091699", "0.6074117", "0.6063963", "0.60027957", "0.5953458", "0.58575106", "0.5855261", "0.5855261", "0.582376", "0.58095646", "0.57964206", "0.5795534", "0.579538", "0.5768308", "0.57592714"...
0.5705332
23
Export data in the JSON format
def search_and_export_json(): url = 'https://jsonplaceholder.typicode.com/' users_dict = requests.get("{}users".format(url)).json() tasks_dict = requests.get("{}todos".format(url)).json() my_dict = {} usernames_dict = {} for info in users_dict: user_id = info.get('id') my_dic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_data(self):\n\n # We need to remove spaces for TW-1504, use custom separators\n data_tuples = ((key, self._serialize(key, value))\n for key, value in six.iteritems(self._data))\n\n # Empty string denotes empty serialized value, we do not want\n # to pass...
[ "0.77344227", "0.7713919", "0.75653756", "0.73680156", "0.7116531", "0.7103052", "0.7090365", "0.7061575", "0.7035093", "0.6930469", "0.6928332", "0.69176066", "0.68976426", "0.68957514", "0.6857897", "0.68488026", "0.6827105", "0.6797737", "0.6782044", "0.6780814", "0.677170...
0.0
-1
Method to change to yellow, then red light
def run(self): global moving_line global change_requested global thick_1_a, thick_1_b, thick_1_c, thick_2_a, thick_2_b, thick_2_c global lap_to_go global lights line = moving_line if line == 1: thick_1_a = 1 lights[2].write(1) t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yellow(self, new_value):\r\n if self.empty is True and self.yellow is False and self.red is False and new_value is True:\r\n self._yellow = new_value\r\n self.empty = False\r\n else:\r\n raise DomainError('Square already full! ')", "def set_color(self, new_color...
[ "0.7079132", "0.7040418", "0.70376426", "0.69809306", "0.6953118", "0.69365674", "0.68913335", "0.68814415", "0.68514913", "0.6788533", "0.67882794", "0.677916", "0.676236", "0.6749317", "0.6723421", "0.67104745", "0.6708115", "0.67057747", "0.66678286", "0.6667042", "0.66471...
0.0
-1
Return the input number if its odd, or return input number + 1 if its even or zero.
def make_odd(number): if number == 0: number += 1 if number % 2 == 0: number += -1 return number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __odd_or_even(number):\n if(number % 2) == 0:\n return 0\n else:\n return 1", "def make_number_odd(num):\n if num % 2 == 0:\n num += 1\n return num", "def even_numbers(number):\r\n\r\n if number%2 ==0:\r\n return number", "def even_odd(number):\r\n if number ...
[ "0.8168115", "0.7859249", "0.719919", "0.718165", "0.71592253", "0.7086521", "0.7042811", "0.7012443", "0.687709", "0.68506926", "0.68103355", "0.67186725", "0.66446716", "0.6642592", "0.66274685", "0.6626728", "0.6619069", "0.66058695", "0.6584184", "0.6577917", "0.65761554"...
0.7791604
2
Draw filled circles to simulate semaphore light.
def light_circles(): global frame_1, frame_2 x_circle_center = int(camera_width/11) y_circle_center = int(camera_hight/9) circle_radius = int(camera_width*.07) cv2.circle( frame_1, (x_circle_center, (circle_radius+(4*circle_radius))), circle_radius, green_color, thickness=thick_1_a) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\r\n arcade.draw_circle_filled(self.center.x, self.center.y, self.radius, TARGET_COLOR)", "def draw_circle_filled(self, x0, y0, r, color=None):\n self._draw_fast_vline(x0, y0 - r, 2 * r + 1, color)\n self._draw_circle_filled_helper(x0, y0, r, 3, 0, color)", "def draw_circle_...
[ "0.7010427", "0.698562", "0.69655234", "0.69196063", "0.67997384", "0.6717115", "0.67054826", "0.67054826", "0.67018795", "0.66960144", "0.6645909", "0.6633102", "0.6598114", "0.65929836", "0.65786374", "0.6557192", "0.6549002", "0.65449375", "0.6515338", "0.65085894", "0.647...
0.0
-1
Draw road lines to define valid detection areas.
def road_lines(): cv2.polylines(frame_1, [pts_1], True, yellow_color) cv2.polylines(frame_2, [pts_2], True, yellow_color)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawLines(self):\n\t\tintersections = [[], []]\n\t\tfor l in self.lines:\n\t\t\tif l.direction == 'v':\n\t\t\t\tif l.rtc:\n\t\t\t\t\tposition = l.coordinate + int((self.width - 1) / 2)\n\t\t\t\telse:\n\t\t\t\t\tposition = int((l.coordinate * self.width / 100) if type(l.coordinate) == float else l.coordinate)\n...
[ "0.6935589", "0.6575923", "0.6425404", "0.6305132", "0.61926347", "0.6187055", "0.6155874", "0.61299604", "0.61294866", "0.6076995", "0.60432255", "0.60113436", "0.6008314", "0.6002908", "0.59739286", "0.59024054", "0.5898999", "0.5898862", "0.5894378", "0.58699995", "0.58633...
0.7002146
0
Takes a MongoDB cursor and returns the number of documents it contains.
def _get_count(results): return len(results)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def count(self, spec=None, cursor=None):\n if not cursor:\n cursor = self._cursor\n if not spec:\n spec = {}\n spec[DELETE_FLAG] = {\"$ne\": True}\n n = await cursor.count_documents(spec)\n return n, None", "def cursor_size(cursor):\n count = 0\n ...
[ "0.76128787", "0.7467919", "0.6940241", "0.6897004", "0.68674344", "0.6788739", "0.6714874", "0.6706902", "0.6651172", "0.66301596", "0.6595173", "0.64706737", "0.64036924", "0.6355133", "0.6307477", "0.6277702", "0.6205081", "0.61664677", "0.61638486", "0.6155807", "0.608861...
0.58574283
33
Takes a list of dictionaries and a list index. Returns the id for that index.
def _get_id(results, index): return results[index]['_id']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_list_id(collection, index = \"id\", ignore_filter = False):\n\tif (not ignore_filter):\n\t\tcollection = [register[index] for register in list(collection)]\n\treturn \"'\" + (\"', '\".join(collection)) + \"'\"", "def get_id(self, index):\n return self.__keys[index]", "def get_indexed_item_from_l...
[ "0.6608865", "0.6461903", "0.6270167", "0.6254719", "0.62439704", "0.62224084", "0.60979915", "0.5953362", "0.5770354", "0.5758881", "0.57466406", "0.57018924", "0.56850445", "0.5634907", "0.5571361", "0.55570155", "0.55042535", "0.54714113", "0.5466338", "0.5462254", "0.5448...
0.6934078
0
Takes a list of dictionaries and a list index. Returns the document for that index.
def _get_doc(results, index): return results[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _index_document(index_list):\n if isinstance(index_list, abc.Mapping):\n raise TypeError(\"passing a dict to sort/create_index/hint is not \"\n \"allowed - use a list of tuples instead. did you \"\n \"mean %r?\" % list(index_list.items()))\n elif not i...
[ "0.7619862", "0.6181496", "0.6016992", "0.59967166", "0.59627914", "0.5940448", "0.59366274", "0.5891136", "0.5872575", "0.5839089", "0.58277404", "0.5806781", "0.5760332", "0.5748127", "0.5702271", "0.5691555", "0.5679571", "0.56673163", "0.5663057", "0.5657615", "0.5626698"...
0.6746059
1
Tests the _create_text_index() method when a schema is provided.
def test_create_text_index_w_schema(self): actual = self.engine._create_text_index(self.engine.schema) expected = 'TextIndex' self.assertEqual(actual, expected)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_text_index_noschema(self):\n actual = self.engine._create_text_index()\n expected = 'TextIndex'\n self.assertEqual(actual, expected)", "def test_creating_index_type(self):", "def test_string_index():\n\tlib.backup_and_restore(\n\t\tlambda context: create_indexes(lib.create_...
[ "0.8399966", "0.68847084", "0.6653272", "0.65279675", "0.6232708", "0.61420846", "0.6077263", "0.5866493", "0.57903063", "0.57808346", "0.5726722", "0.57109994", "0.5680334", "0.5675512", "0.56721723", "0.56721723", "0.5643351", "0.5582189", "0.5579941", "0.55570096", "0.5553...
0.8753069
0
Tests the _create_text_index() method when a schema is not provided.
def test_create_text_index_noschema(self): actual = self.engine._create_text_index() expected = 'TextIndex' self.assertEqual(actual, expected)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_text_index_w_schema(self):\n actual = self.engine._create_text_index(self.engine.schema)\n expected = 'TextIndex'\n self.assertEqual(actual, expected)", "def test_creating_index_type(self):", "def test_string_index():\n\tlib.backup_and_restore(\n\t\tlambda context: create_i...
[ "0.85630506", "0.6538482", "0.6379478", "0.62192476", "0.6107749", "0.60360074", "0.6031513", "0.59643614", "0.5895175", "0.5890334", "0.58874357", "0.57891434", "0.56733567", "0.5590555", "0.55498284", "0.55498284", "0.55243", "0.5514081", "0.5476263", "0.5456776", "0.544013...
0.86921626
0
Tests the __str__ method.
def test_str(self): name = str(self.engine) self.assertTrue(name.startswith('test_database_')) self.assertTrue(name.endswith('.test_docs'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_str_method(self):\n b1 = BaseModel()\n b1printed = b1.__str__()\n self.assertEqual(b1printed,\n \"[BaseModel] ({}) {}\".format(b1.id, b1.__dict__))", "def test_str(self):\n self.assertEqual(str(self.bs), str(self.wbs))\n self.assertEqual(str(sel...
[ "0.82420087", "0.8141123", "0.81234753", "0.8109608", "0.8077134", "0.80220187", "0.800164", "0.7937999", "0.7932961", "0.7748346", "0.77479196", "0.77436966", "0.77424705", "0.77423435", "0.7715638", "0.7699125", "0.76134163", "0.75954235", "0.7555366", "0.75448424", "0.7537...
0.0
-1
Sets up an ElasticSearch index and inserts the test_docs provided by FilterTestCaseMixin.
def setUp(self): super(MongoDbFilterTestCase, self).setUp() for doc in self.test_docs: self.engine.insert(doc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n body = {\n \"settings\": {\n \"number_of_shards\": 1,\n \"number_of_replicas\": 0\n }\n }\n self.assertTrue(self.es.create_index('contacts_esclient_test', body))\n self.assertFalse(self.es.create_index('contacts_escl...
[ "0.770078", "0.7126145", "0.68322456", "0.6620452", "0.6540127", "0.64694273", "0.6463141", "0.63948095", "0.63571036", "0.6345623", "0.63434756", "0.62436575", "0.6241861", "0.62167126", "0.6173552", "0.6168257", "0.6160923", "0.61488116", "0.61431104", "0.6114989", "0.61126...
0.6929581
2
Limit result list with "MAX_RESULT"
def limit_result(result_set): max_result = MAX_RESULT result = [] if max_result > 0: result = result_set[:max_result] result.append("Total result: {}".format(len(result_set))) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_result_limit(self, data):\n self.add_payload('resultLimit', data)\n self._result_limit = self._uni(data)", "def limit(self, limit):\n\n # Return between 1 and 250 results, defaults to 10\n return max(1, min(250, int(limit) if limit else 10))", "def max_results(self, max_resu...
[ "0.673919", "0.64389324", "0.62612617", "0.6195268", "0.6166678", "0.6131141", "0.60837257", "0.60630274", "0.6061646", "0.60587096", "0.6015139", "0.59791905", "0.59546673", "0.59319866", "0.5929677", "0.59154874", "0.58818", "0.58628124", "0.5826882", "0.58234286", "0.58110...
0.7924585
0
Get an Github Operator
def _github_operator(self, msg): token = self[msg.frm.person + "github_token"] result = GithubOperator(token) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_github_credendial(cls) -> 'ApiCredential':\n return cls.select_token_for_api(GITHUB_API_NAME)", "def get(self, endpoint, params=None):\n res = requests.get(\"https://api.github.com/\" + endpoint,\n auth=requests.auth.HTTPBasicAuth(self.credentials['username'], self.cre...
[ "0.60614455", "0.594694", "0.5812482", "0.5780396", "0.5726921", "0.56730396", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", "0.5613916", ...
0.73203856
0
Get an Translation Util
def _translation_util(self, msg): token = self[msg.frm.person + "github_token"] return TranslateUtil(REPOSITORY_CONFIG_FILE, token)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_translation(self):", "def get_gettext():\n local_path = os.path.realpath(os.path.dirname(sys.argv[0])) + \\\n '/translations'\n langs = []\n lc, encoding = locale.getdefaultlocale()\n if (lc):\n langs = [lc]\n osLanguage = os.environ.get('LANGUAGE', None)\n if (os...
[ "0.692908", "0.6249203", "0.6228129", "0.62209576", "0.6138939", "0.6135836", "0.61316675", "0.60002774", "0.588955", "0.5859885", "0.57699263", "0.57648146", "0.57179856", "0.5707253", "0.57066154", "0.569066", "0.56857437", "0.5651666", "0.56276864", "0.5602541", "0.5530169...
0.66220915
1
List all branches in current repository
def list_branches(self, msg, args): trans = self._translation_util(msg) yield "\n".join(trans.list_branches(REPOSITORY_NAME))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def branches(self) -> list[str]:\n _args: list[Arg] = []\n _ctx = self._select(\"branches\", _args)\n return _ctx.execute_sync(list[str])", "def list_all_branches(self) -> dict:\n try:\n branches_response = self.repo.get_branches()\n branches_list = []\n ...
[ "0.7749532", "0.7738944", "0.7703959", "0.7614574", "0.7598028", "0.7515656", "0.75033426", "0.7465316", "0.740539", "0.73894024", "0.72446", "0.7178419", "0.7082727", "0.7047357", "0.70421684", "0.6949491", "0.6943486", "0.69368696", "0.6858128", "0.6777088", "0.6739843", ...
0.7706611
2
Check if user had bound their github token.
def _github_bound(self, person): result = True try: result = len(self[person + "github_token"]) > 0 except BaseException: result = False return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_token(self):\n api_response = requests.get(self.api_config.get_api_url() + \"greetings/isloggedin\",\n headers={\"Authorization\": \"Bearer \" + self.API_TOKEN})\n\n if api_response.status_code == 401 or 403:\n return False\n else:\n ...
[ "0.65147024", "0.6480705", "0.63269347", "0.6250972", "0.62163246", "0.6209365", "0.6175841", "0.6166921", "0.6119698", "0.6116468", "0.6107161", "0.6025452", "0.6002667", "0.5976334", "0.59564173", "0.59537226", "0.59510547", "0.59139603", "0.5908455", "0.5898309", "0.582852...
0.77639025
0
Find issues with the label "welcome"
def whatsnew(self, msg, args): self._asset_bind(msg) client = self._github_operator(msg) cmd = "repo:{} label:welcome is:open type:issue".format( task_repository_name()) issue_list = client.search_issue(cmd, 10) result = limit_result( ["{}: {}".format(i.nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_get_label(self):\n pass", "def test_issue_get_labels(self):\n pass", "def test_issue_list_labels(self):\n pass", "def test_issue_add_label(self):\n pass", "def test_issue_replace_labels(self):\n pass", "def test_issue_create_label(self):\n pass", ...
[ "0.62451565", "0.6179279", "0.59356964", "0.5735456", "0.5484781", "0.54358155", "0.5402358", "0.5395643", "0.53929466", "0.5289219", "0.528681", "0.5269851", "0.52506924", "0.5225221", "0.5182275", "0.5177378", "0.5172387", "0.51599", "0.5157391", "0.5143768", "0.5141218", ...
0.0
-1
Find issues with the label "welcome" then replace with "pending" label
def confirm_recent_new_issues(self, msg, hour): self._asset_bind(msg) yield ("Processing....") trans = self._translation_util(msg) client = self._github_operator(msg) cmd = "repo:{} is:open type:issue".format( task_repository_name()) issue_list = client.search...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_replace_labels(self):\n pass", "def change_issues_label(self, msg, old_label, new_label):\n self._asset_bind(msg)\n yield (\"Processing....\")\n trans = self._translation_util(msg)\n client = self._github_operator(msg)\n cmd = \"repo:{} label:{} is:open ty...
[ "0.7193442", "0.67526186", "0.63840276", "0.6223574", "0.62127376", "0.5960943", "0.5946542", "0.58994776", "0.58699584", "0.58600855", "0.5739906", "0.57178646", "0.56967795", "0.56701887", "0.56290764", "0.5619469", "0.5574466", "0.55743533", "0.554854", "0.54189855", "0.53...
0.46344647
83
Bump the version label of issues from old_label to new_label
def change_issues_label(self, msg, old_label, new_label): self._asset_bind(msg) yield ("Processing....") trans = self._translation_util(msg) client = self._github_operator(msg) cmd = "repo:{} label:{} is:open type:issue".format( task_repository_name(), old_label) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_replace_labels(self):\n pass", "def post_issue_labels(repo, project, issue_number):\n issue_path = '%s/%s/issues/%d' % (repo, project, issue_number)\n\n new_label_ids = request.json\n\n current_label_ids = dao.get_issue_label_ids(issue_path)\n\n revised_label_ids = current_label...
[ "0.6792092", "0.6410261", "0.63336664", "0.62997633", "0.6212655", "0.6188349", "0.6131808", "0.6078506", "0.60697824", "0.5982465", "0.59715044", "0.58801395", "0.58639926", "0.5816984", "0.576189", "0.57202476", "0.57188237", "0.5707912", "0.570286", "0.565688", "0.5632423"...
0.75369704
0
Create comment for an issue
def comment_issue(self, msg, issue_id, comment): self._asset_bind(msg) client = self._github_operator(msg) comment_obj = client.issue_comment(task_repository_name(), issue_id, comment) yield comment_obj.html_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_create_comment(self):\n pass", "def create_comment(self, body):\n return self.client.request(\n \"{}/issues/{}/comments\".format(self.repo.base_path, self.num),\n params={\"body\": body},\n method=\"POST\"\n )", "def test_issue_get_comment(se...
[ "0.8301317", "0.7754753", "0.72062963", "0.7073606", "0.69860274", "0.6936139", "0.6936139", "0.6907152", "0.6887853", "0.6854214", "0.6846589", "0.68176407", "0.67910486", "0.67743784", "0.67724115", "0.6749794", "0.6749794", "0.67153496", "0.66674685", "0.664144", "0.662029...
0.71473557
3
Show issue url by its id.
def show_issue(self, msg, issue_id): self._asset_bind(msg) yield "https://github.com/{}/issues/{}".format(task_repository_name(), issue_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def issue(ctx, number: Option(int, \"Issue number\")):\n url = f\"{repo}/issues/{number}\"\n view = discord.ui.View()\n view.add_item(discord.ui.Button(label=\"View Issue\", url=url))\n await ctx.respond(f\"Here's a link\", view=view)", "def build_issue_tracker_url(issue_id):\n issue_tracker_t...
[ "0.6973641", "0.67749053", "0.64473206", "0.63432825", "0.63432825", "0.6329339", "0.6315905", "0.6126929", "0.6092506", "0.603496", "0.60116416", "0.6002365", "0.5886086", "0.58832836", "0.5794558", "0.579267", "0.57825845", "0.5674633", "0.565682", "0.5643689", "0.563147", ...
0.77199227
0
Save opening issues into a text file
def cache_issue(self, msg, args): self._asset_bind(msg) yield ("Processing....") trans = self._translation_util(msg) query = "repo:{} is:open type:issue".format( task_repository_name() ) res = trans.cache_issues(query, OPEN_CACHE, MAX_RESULT) yield "{}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issue_text_dump(issue):\n file_path = os.path.join(BIO_REQUESTS_DIR,\n str(issue.id),\n str(issue.id) + '_' + str(issue.subject) + '_redmine_details.txt')\n with open(file_path, 'w+') as file:\n for attr in dir(issue):\n file.write...
[ "0.67435944", "0.59890133", "0.58801615", "0.58345985", "0.5740403", "0.5711492", "0.5682778", "0.56753564", "0.5620525", "0.55917394", "0.55783993", "0.55623657", "0.5539575", "0.5539575", "0.5538157", "0.55351144", "0.5503311", "0.55032104", "0.5501654", "0.5491713", "0.549...
0.0
-1
Release the translating issues that have been accepted for more than specified delay days (at least 3 days)
def find_delay_issues(self, msg, delay_days, unassign): self._asset_bind(msg) yield ("Processing....") trans = self._translation_util(msg) client = self._github_operator(msg) issues = find_delay_issues(trans, client, delay_days) if unassign == 0: yield ("\n".j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maintain_leases(self) -> None:\n while not self._stop_event.is_set():\n # Determine the appropriate duration for the lease. This is\n # based off of how long previous messages have taken to ack, with\n # a sensible default and within the ranges allowed by Pub/Sub.\n ...
[ "0.5600951", "0.5391433", "0.53077644", "0.530182", "0.5256958", "0.5214244", "0.52004874", "0.5079904", "0.50456727", "0.5010773", "0.49739408", "0.49477166", "0.49456263", "0.4935877", "0.4900822", "0.48766607", "0.48477307", "0.4822325", "0.48165026", "0.48124647", "0.4810...
0.57937604
0
Find new files from a branch for a language.
def find_new_files_in(self, msg, branch, create_issue): self._asset_bind(msg) trans = self._translation_util(msg) new_file_list = trans.find_new_files( REPOSITORY_NAME, branch, TARGET_LANG) if create_issue == 0: yield ("\n".join(limit_result(new_file_list))) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_updated_files_in(self, msg, branch, create_issue):\n self._asset_bind(msg)\n trans = self._translation_util(msg)\n updated_files = trans.find_updated_files(REPOSITORY_NAME, branch, TARGET_LANG)\n if create_issue == 0:\n yield (\"\\n\".join(limit_result(list(updated_f...
[ "0.5788485", "0.57070714", "0.5683101", "0.5395942", "0.53917253", "0.5343768", "0.5339315", "0.52852684", "0.5283768", "0.52731115", "0.5249437", "0.52391535", "0.5239085", "0.52318555", "0.5212088", "0.51945984", "0.5188822", "0.5180843", "0.51768464", "0.5143592", "0.51398...
0.64677894
0
Find updated files from a branch for a language.
def find_updated_files_in(self, msg, branch, create_issue): self._asset_bind(msg) trans = self._translation_util(msg) updated_files = trans.find_updated_files(REPOSITORY_NAME, branch, TARGET_LANG) if create_issue == 0: yield ("\n".join(limit_result(list(updated_files.keys()))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_files(folder):\n print_header(\"READING FILES FROM FOLDER (RECURSIVE)\", \"=\")\n files = []\n for dirpath, dirnames, filenames in os.walk(folder):\n if not dirpath.endswith(\"updates\"):\n for filename in filenames:\n root, ext = os.path.splitext(filename)\n ...
[ "0.60385823", "0.5747651", "0.5746556", "0.5706303", "0.56910634", "0.5666029", "0.56308615", "0.56270456", "0.54923", "0.54485804", "0.5438877", "0.54278654", "0.54130405", "0.5369421", "0.536918", "0.5358993", "0.53467005", "0.53339535", "0.5308779", "0.52719516", "0.525351...
0.6335095
0
Find deleted/moved files from a branch for a language.
def find_deleted_files_in(self, msg, branch, create_issue): self._asset_bind(msg) trans = self._translation_util(msg) deleted_file_list = trans.find_deleted_files( REPOSITORY_NAME, branch, TARGET_LANG) moved_files = trans.find_moved_files_in_deleted_files(REPOSITORY_NAME, br...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_files(folder):\n print_header(\"READING FILES FROM FOLDER (RECURSIVE)\", \"=\")\n files = []\n for dirpath, dirnames, filenames in os.walk(folder):\n if not dirpath.endswith(\"updates\"):\n for filename in filenames:\n root, ext = os.path.splitext(filename)\n ...
[ "0.56908476", "0.55866516", "0.54323393", "0.532697", "0.5286356", "0.5263294", "0.52617866", "0.5237295", "0.5224555", "0.5216255", "0.52129155", "0.52084595", "0.5203285", "0.5158452", "0.5138303", "0.5135574", "0.5109658", "0.51079535", "0.51076376", "0.51058733", "0.50981...
0.6073978
0
Train a torch model
def train(get_generator, loss_fn, optimizer, num_epochs=1, monitor=None, on_epoch_start=None, on_finish=None, on_error=None): logger = logging.getLogger(__name__) t_begin_train = timer() for epoch in range(num_epochs): avg_loss = 0 if on_epoch_start: on_epoch_start(epo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(train_loader : torch.utils.data.DataLoader, model : nn.Module, criterion : nn.Module, optimizer : torch.optim.Optimizer) -> logger.Result:", "def trainNet():", "def train(args, model, train_data_loader, dev_data_loader, device):\n\n\tmodel.train()\n\toptimizer = torch.optim.Adam(model.parameters())\n...
[ "0.78621304", "0.72798127", "0.72797334", "0.7267533", "0.72607505", "0.7249732", "0.7220984", "0.72000355", "0.7183494", "0.71330434", "0.7132294", "0.71074426", "0.7061743", "0.7004282", "0.6996066", "0.6973272", "0.6952807", "0.6951445", "0.690291", "0.68992347", "0.688795...
0.0
-1
Returns True if word is in the wordList and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or wordList.
def isValidWord(word, hand, wordList): # TO DO ... <-- Remove this comment when you code this function newword = {} for x in word: newword[x] = newword.get(x,0) + 1 for l in newword: if newword.get(l,0) > hand.get(l, 0): return False is_valid = F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isValidWord(word, hand, wordList):\r\n \r\n \r\n if type(word) != str:\r\n return False\r\n \r\n if word not in wordList:\r\n return False\r\n \r\n for letter in word:\r\n if letter not in hand:\r\n return False\r\n \r\n updatedHand = hand.copy()\r\n ...
[ "0.8187714", "0.8107539", "0.7983707", "0.7944388", "0.7943436", "0.7918588", "0.78547037", "0.7823912", "0.7772084", "0.7752642", "0.773667", "0.77111965", "0.7665853", "0.76646894", "0.7465163", "0.7308262", "0.72991234", "0.7229191", "0.7229191", "0.7229191", "0.70942104",...
0.7354392
15
The set of arguments for constructing a TargetGroupAttachment resource.
def __init__(__self__, *, target: pulumi.Input['TargetGroupAttachmentTargetArgs'], target_group_identifier: pulumi.Input[str]): pulumi.set(__self__, "target", target) pulumi.set(__self__, "target_group_identifier", target_group_identifier)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: TargetGroupAttachmentArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n opts: Optional[pulumi.ResourceOptions] =...
[ "0.77026486", "0.74800813", "0.7191172", "0.61384636", "0.57487035", "0.5611284", "0.56056815", "0.5473555", "0.5462698", "0.5453623", "0.5441378", "0.54287297", "0.54172635", "0.53831756", "0.51655686", "0.51062083", "0.5021804", "0.5019914", "0.50194347", "0.501577", "0.500...
0.7296756
2