query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
various right embeding of video
def test_embed_ok(self): self.go200('minus_upload') self.formfile('minus_upload', 'file', AUDIO_FILE) self.fv('minus_upload', 'id_embed_video', YOUTUBE_URL) self.submit200() self.notfind("Невірний") self.show() self.find("youtube_video") self.find("<objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_show_video(name, vext='.mp4', ext='.png', loop=True, autoplay=True, controls=True, embed=False, figpath=figpath, **kwargs):\n import os\n from IPython.core.display import display, Image, HTML\n from base64 import b64encode\n\n opts = 'playsinline '\n if loop: opts += 'loop '\n if autoplay:...
[ "0.67641854", "0.67451173", "0.65865034", "0.6524482", "0.64924055", "0.6408578", "0.6248291", "0.624474", "0.62401366", "0.62132764", "0.62128735", "0.62014794", "0.6188429", "0.6185427", "0.6143705", "0.61265326", "0.61246544", "0.6088066", "0.6083399", "0.6083399", "0.6083...
0.70237356
0
plus should be attached to minus.user not to moderator
def test_moderator_uploads_plusrecord(self): self.go200('minus_plus_upload_user',[self.user.id]) self.formfile('minus_plus_upload', 'file', AUDIO_FILE) self.submit200() self.logout('auth_logout') self.login('u', 'p', url='auth_login', formid='id_login') self.go200('minus_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_add_permission(self, request):\n return request.user.is_superuser or super().has_add_permission(request)", "def allowed(self, user, amount):\n return True", "def isUMinus(self):\n return _libsbml.ASTNode_isUMinus(self)", "def addme(update: 'Update', context: 'CallbackContext'):\n...
[ "0.575054", "0.57219326", "0.5711969", "0.56312156", "0.54943043", "0.547881", "0.5472063", "0.544157", "0.5420743", "0.53919333", "0.5384767", "0.53588045", "0.53424716", "0.5340141", "0.5331763", "0.5317873", "0.5317257", "0.5317257", "0.53038454", "0.53020555", "0.52879685...
0.581246
0
Test case for peers_get
def test_peers_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_peers_peerid_get(self):\n pass", "def test_one_peer(self):\n\n\t\tself.n = tracker.make_peer_list \\\n\t\t\t([(\"test1\", \"100.100.100.100\", \"1000\")])\n\t\tself.assertEqual(self.n, [{'ip': '100.100.100.100', \\\n\t\t\t'peer id': 'test1', 'port': 1000}])", "def test_peers_post(self):\n ...
[ "0.8696221", "0.7192812", "0.711802", "0.70360357", "0.70274997", "0.6773914", "0.6765761", "0.67139876", "0.6710879", "0.66730374", "0.65417737", "0.6500344", "0.6307875", "0.62696064", "0.62148637", "0.61876035", "0.61713827", "0.61438066", "0.61334497", "0.6088506", "0.607...
0.8996001
0
Test case for peers_peerid_delete
def test_peers_peerid_delete(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_peers_peerid_get(self):\n pass", "def test_peers_peerid_post(self):\n pass", "def test_bgp_peer_remove(self, m_client):\n # Set up arguments\n address = '1.2.3.4'\n\n # Call method under test\n bgp_peer_remove(address, 4)\n\n # Assert\n m_client....
[ "0.7332794", "0.70445776", "0.6931957", "0.6640967", "0.6611744", "0.6462411", "0.6403419", "0.6368902", "0.6346265", "0.6344083", "0.6313252", "0.62687737", "0.6234457", "0.6207562", "0.6190389", "0.6161354", "0.6135893", "0.61328804", "0.6119607", "0.6095823", "0.60923946",...
0.94635904
0
Test case for peers_peerid_get
def test_peers_peerid_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_peers_get(self):\n pass", "def test_peers_peerid_post(self):\n pass", "def test_peers_peerid_delete(self):\n pass", "def _LookupPeer(self, peer_id):\n key = self._GetServerKey(peer_id)\n values, placemark = self._dht.Get(key)\n if not values:\n raise NessieError('N...
[ "0.76344407", "0.74507415", "0.73697764", "0.66594434", "0.65899813", "0.62889266", "0.6225391", "0.6156838", "0.61484265", "0.6077912", "0.60704", "0.5968563", "0.595071", "0.5886904", "0.587434", "0.5861096", "0.58559394", "0.5853292", "0.58342946", "0.58150953", "0.5802383...
0.93089193
0
Test case for peers_peerid_post
def test_peers_peerid_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_peers_post(self):\n pass", "def test_peers_peerid_get(self):\n pass", "def test_peers_peerid_delete(self):\n pass", "def test_peers_get(self):\n pass", "def test_duplicate_peer(self):\n\n\t\tself.db = {'test_hash': [('test', '100.100.100.100', 1000)]}\n\t\ttracker.add_p...
[ "0.8070357", "0.7367078", "0.70842206", "0.6161115", "0.60336685", "0.6007113", "0.6005517", "0.5882451", "0.58606833", "0.57756877", "0.56751156", "0.5589279", "0.54988295", "0.5494192", "0.5477512", "0.54616493", "0.54128593", "0.5382333", "0.5368021", "0.5351914", "0.53356...
0.918874
0
Test case for peers_post
def test_peers_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_peers_peerid_post(self):\n pass", "def test_post_chain(self):\n pass", "def test_post_users_post(self):\n pass", "def test_peers_get(self):\n pass", "def test_meme_post(self):\n pass", "def test_post(self):\n pass", "def test_post_user_post(self):\n ...
[ "0.8632148", "0.6686478", "0.65633565", "0.6543095", "0.65333927", "0.64554286", "0.6429344", "0.6422975", "0.6381392", "0.63392735", "0.6260694", "0.61105293", "0.6106663", "0.60841507", "0.60485256", "0.60485256", "0.6039322", "0.5976668", "0.59709466", "0.5966034", "0.5954...
0.8919058
0
Test case for volumes_get
def test_volumes_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aws_service_api_volume_get(self):\n pass", "def test_aws_service_api_volumes_get(self):\n pass", "def test_aws_service_api_volume_types_get(self):\n pass", "def volumes(self):", "def test_get_volume(self):\n self.assertEqual(self.cat_a.volume(), 6000)", "def get_volum...
[ "0.8623218", "0.86202246", "0.76679945", "0.75886875", "0.7179493", "0.7160929", "0.71130466", "0.70252365", "0.69838876", "0.69788086", "0.6976262", "0.6910008", "0.68536305", "0.6829676", "0.6827403", "0.6480373", "0.64743745", "0.6473025", "0.645679", "0.6447579", "0.64407...
0.89812547
0
Test case for volumes_post
def test_volumes_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aws_service_api_volumes_post(self):\n pass", "def test_volumes_get(self):\n pass", "def test_volumes_volname_start_post(self):\n pass", "def test_volumes_volname_stop_post(self):\n pass", "def volumes(self):", "def test_aws_service_api_volume_delete(self):\n pa...
[ "0.7987023", "0.7041567", "0.7020928", "0.68210614", "0.6572613", "0.649182", "0.64764535", "0.6456867", "0.64517254", "0.64322543", "0.63329756", "0.6299428", "0.6261842", "0.6189976", "0.61466736", "0.6118623", "0.6074925", "0.6065953", "0.6029333", "0.5986011", "0.59761596...
0.8835188
0
Test case for volumes_volname_start_post
def test_volumes_volname_start_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_volumes_volname_stop_post(self):\n pass", "def test_volumes_post(self):\n pass", "def test_aws_service_api_volumes_post(self):\n pass", "def test_pvcvolume_attach(self):\n v = self.cs.volumes.get('pvcvolume')\n self.cs.volumes.attach(v, 1, '/dev/vdc')\n self...
[ "0.79183763", "0.6501542", "0.58291066", "0.54706204", "0.54484326", "0.54408056", "0.543602", "0.53255093", "0.5283495", "0.5239277", "0.5198263", "0.5153576", "0.5123313", "0.51021636", "0.5099367", "0.5072275", "0.5065416", "0.5032697", "0.5027716", "0.5013804", "0.4997205...
0.9011076
0
Test case for volumes_volname_stop_post
def test_volumes_volname_stop_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_volumes_volname_start_post(self):\n pass", "def test_volumes_post(self):\n pass", "def test_stop(self):\n\n message = {\"method\": \"stop\",\n \"params\": {\"elem\": self.container_running}}\n response = yield self._get_response(message)\n\n self.as...
[ "0.77427644", "0.64347535", "0.5892416", "0.58504677", "0.57865006", "0.5761441", "0.568179", "0.56483597", "0.55805796", "0.5577241", "0.55441153", "0.55238473", "0.5518342", "0.54867876", "0.54762626", "0.54633987", "0.5460693", "0.5460693", "0.5460693", "0.5460693", "0.545...
0.92394954
0
Get all valid pairs of tape in rect form given a list of OpenCV contours. Using the angles and center coordinates associated with each of the contours, possible pairs of tape are identified. However, there is no verification done to ensure that contours are valid pieces of tape, as the function assumes that they are va...
def get_pair_rects(contours): rect_pairs = [] for index, cnt in enumerate(contours): # Rotated rect - ( center (x,y), (width, height), angle of rotation ) rect = cv2.minAreaRect(cnt) center_x, center_y = rect[0] rect_angle = -round(rect[2], 2) if rect_angle > 45.0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bound_shapes(contours):\r\n\r\n contours_poly = [None]*len(contours)\r\n boundRect = [None]*len(contours)\r\n centers = [None]*len(contours)\r\n radius = [None]*len(contours)\r\n for i, c in enumerate(contours):\r\n contours_poly[i] = cv2.approxPolyDP(c, 3, True)\r\n boundRect[i] =...
[ "0.6538606", "0.6144932", "0.6041295", "0.5940763", "0.57794034", "0.57555974", "0.5708939", "0.5644752", "0.56134313", "0.56101936", "0.55749595", "0.5529742", "0.5510864", "0.54971457", "0.5470397", "0.54460466", "0.54439086", "0.54020983", "0.5390673", "0.5384446", "0.5359...
0.77581185
0
Find all of the pair centers given a list of pairs of rotated rectangles. The function iterates through a list of pairs of rotated rectangles, storing the center of each pair in a list to be returned by the function, in which the indexes between a pair and its center match up. If the rect_pairs list is empty, an empty ...
def find_pair_centers(rect_pairs): centers = [] for rect1, rect2 in rect_pairs: center = midpoint(rect1[0], rect2[0]) centers.append(center) return centers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pair_rects(contours):\n\n rect_pairs = []\n for index, cnt in enumerate(contours):\n # Rotated rect - ( center (x,y), (width, height), angle of rotation )\n rect = cv2.minAreaRect(cnt)\n center_x, center_y = rect[0]\n rect_angle = -round(rect[2], 2)\n\n if rect_angl...
[ "0.62026006", "0.6162701", "0.6087304", "0.59834564", "0.5873865", "0.5657451", "0.5628694", "0.56004316", "0.55566496", "0.54699785", "0.53669983", "0.53555965", "0.53241456", "0.53177077", "0.5304112", "0.52581257", "0.5243059", "0.5207223", "0.5129527", "0.5098375", "0.506...
0.8494008
0
Gets the center of the rectangle pair closest to the center of the frame. Iterates through the rotated rectangle pairs, finding the rect pair that is closest to the center of the frame and then returning the center point of that rect pair or None if the rect_pairs list is empty. This function, however, does not detect ...
def closest_center(rect_pairs): centers = find_pair_centers(rect_pairs) min_dist = min_center = None for center in centers: dist = distance(center, FRAME_CENTER) if min_dist is None or dist < min_dist: min_dist = dist min_center = center return min_center
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_pair_centers(rect_pairs):\n\n centers = []\n for rect1, rect2 in rect_pairs:\n center = midpoint(rect1[0], rect2[0])\n centers.append(center)\n\n return centers", "def get_rect_center(rect):\n x, y, w, h = rect\n return x + w/2, y + h/2", "def get_center(self):\n ...
[ "0.67331475", "0.64515555", "0.6001059", "0.59175", "0.5892248", "0.58833814", "0.585424", "0.5841984", "0.5752221", "0.5712794", "0.56921977", "0.56689316", "0.5661196", "0.56526184", "0.56173843", "0.5592641", "0.5551825", "0.5525141", "0.54953676", "0.5477719", "0.5455593"...
0.8538978
0
Find the angle between cX and the center of the frame.
def horizontal_angle(cX): return atan(((FRAME_CENTER[0] + .5) - cX) / FOCAL_LENGTH)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _angle(self, a, b, c):\n divid = (a ** 2 + b ** 2 - c ** 2)\n divis = (2 * a * b)\n if (divis) > 0:\n result = float(divid) / divis\n if result <= 1.0 and result >= -1.0:\n return acos(result)\n return 0\n else:\n return 0",...
[ "0.67299557", "0.66971684", "0.6631527", "0.65955645", "0.65902543", "0.65793175", "0.6507206", "0.65059215", "0.64560986", "0.64042515", "0.63694596", "0.63620293", "0.63507414", "0.63388413", "0.63061696", "0.6257793", "0.6250895", "0.6244727", "0.62382525", "0.6227177", "0...
0.80907357
0
Find the midpoint between point1 and point2.
def midpoint(point1, point2): x, y = (int((point1[0] + point2[0]) / 2), int((point1[1] + point2[1]) / 2)) return (x, y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mid_point(a: Point, b: Point) -> Point:\n return Point((a.x + b.x) / 2, (a.y + b.y) / 2)", "def midpoint(p1, p2):\n return np.array([(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2, (p1[2] + p2[2]) / 2])", "def midpoint(ptA, ptB):\n return( (ptA[0] + ptB[0]) * 0.5, (ptA[1]+ ptB[1]) * 0.5 )", "def midpo...
[ "0.86495996", "0.84351975", "0.8341314", "0.83263826", "0.81008357", "0.79440206", "0.7909224", "0.76864284", "0.75956684", "0.756792", "0.7434356", "0.7314022", "0.71300644", "0.71001923", "0.70689064", "0.6998397", "0.6986347", "0.6792534", "0.67725915", "0.67189986", "0.65...
0.8921536
0
Find the tape using the VideoCapture object in this script and display it. Fetches a frame from the CAP object in this script and finds the horizontal angle between the center of the frame and the tape pair closest to the center of the frame. It prints the horizontal angle and draws various information on the frame bef...
def find_tape(): _, frame = CAP.read() hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) mask = cv2.inRange(hsv, color_lower, color_upper) _, contours, _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) # Find all valid pair rects, and reutrn if non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def record_project():\n # open the video and save the frame and return the fW,fH and the frame\n frame = video_handle_for_demo()\n\n # detect the blue square and resize the frame\n image = detect_and_rotate(frame)\n if image is None:\n return [-100, -100, 0]\n\n fW, fH, _ = image.shape\n\n...
[ "0.6334015", "0.57378316", "0.5471469", "0.5451941", "0.54345995", "0.5249486", "0.5228421", "0.5206411", "0.5178842", "0.5156065", "0.51413107", "0.5130146", "0.5097734", "0.5094007", "0.50803936", "0.50718665", "0.5069257", "0.5052582", "0.50398207", "0.50334924", "0.502657...
0.67964447
0
Takes 3 arguments and creates an incremental list of numbers.
def createNumList(start, end, increment): start = int(start) end = int(end) increment = int(increment) numbers = [] while start < end: print(f"Loop: {start}.") numbers.append(start) start += increment print("Numbers:\n{}".format(numbers)) pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def three_times_nums(num_list):", "def crange(*args):\r\n result = [[]]\r\n for arg in args:\r\n result = [x + [y] for x in result for y in range(arg)]\r\n return result", "def build_numeric_sequence(data: List[int]) -> List[str]:\n prev = -1\n start = None\n res = []\n for item in ...
[ "0.70656544", "0.64583635", "0.62111646", "0.6192229", "0.61834216", "0.6169007", "0.60984915", "0.60727", "0.60704976", "0.60547554", "0.6032393", "0.60077435", "0.5981581", "0.5950276", "0.59328985", "0.5851967", "0.58273876", "0.57553345", "0.57294756", "0.57179105", "0.57...
0.6813803
1
Takes 3 arguments and creates an incremental list of characters.
def creatCharList(start, end, increment): start = int(start) end = int(end) increment = int(increment) characters = [] i = start for i in range(start, end, increment): print(f"Loop: {i}.") characters.append(chr(i)) print("Characters:\n{}".format(characters)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_chars(length, character):\n return ''.join([character for i in range(length)])", "def letters_generator():\n def multiletters(seq):\n for n in itertools.count(1):\n for s in itertools.product(seq, repeat=n):\n yield \"\".join(s)\n ...
[ "0.6578999", "0.61975336", "0.61801773", "0.61747915", "0.61521375", "0.6133547", "0.6093438", "0.60465837", "0.59642506", "0.591356", "0.58994937", "0.58944756", "0.58723474", "0.585621", "0.58508706", "0.58382934", "0.58133805", "0.5773641", "0.5747958", "0.5738145", "0.573...
0.6889811
0
Finds the divisors of x Assumes that x is a positive integer Returns a tuple containing the divisors of x
def finddiv(x): div = (1, x) for i in range(2, x//2+1): if x%i==0: div+=(i,) return div
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divisors(x):\n x = abs(x)\n result = []\n upper_bound = int(math.sqrt(x))\n for i in range(1, upper_bound + 1):\n if x % i == 0:\n if x / i == i:\n result.append(i)\n else:\n result.append(i)\n result.append(x//i)\n return...
[ "0.8460022", "0.7699094", "0.7683258", "0.7621047", "0.7449918", "0.7439679", "0.7402586", "0.73635805", "0.73439324", "0.7196147", "0.71849275", "0.7158595", "0.71131396", "0.7095032", "0.7063125", "0.7036525", "0.70283794", "0.69887", "0.69874907", "0.69815105", "0.6960848"...
0.8262666
1
Test for MesoscopePreprocess.get_default_tau method.
def test_get_default_tau(self): subject_detail = {'genotype': [{'allele': 'Cdh23', 'zygosity': 1}, {'allele': 'Ai95-G6f', 'zygosity': 1}, {'allele': 'Camk2a-tTa', 'zygosity': 1}]} with mock.patch.object(self.task.one.alyx, 're...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDefault():", "def test_change_default_dt_static(self):\n ct.set_defaults('control', default_dt=0)\n assert ct.tf(1, 1).dt is None\n assert ct.ss([], [], [], 1).dt is None", "def default_tune(self):\n return self._default_tune", "def init_tau(self, type: str = 'safest', weig...
[ "0.58054805", "0.5766539", "0.55542696", "0.54653114", "0.53289515", "0.5280533", "0.5262529", "0.5202815", "0.518993", "0.51870537", "0.51478577", "0.5112242", "0.50845855", "0.50789475", "0.5076937", "0.5075569", "0.5075425", "0.50587046", "0.5044964", "0.50403994", "0.5038...
0.6857306
0
Test for MesoscopeFOV.get_provenance method.
def test_get_provenance(self): filename = 'mpciMeanImage.mlapdv_estimate.npy' provenance = MesoscopeFOV.get_provenance(filename) self.assertEqual('ESTIMATE', provenance.name) filename = 'mpciROIs.brainLocation_ccf_2017.npy' provenance = MesoscopeFOV.get_provenance(filename) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_provenance_extras():\n target = DummyTarget()\n provenance = target.provenance()\n assert \"qcsubmit\" in provenance\n assert \"openforcefield\" in provenance\n assert \"bespokefit\" in provenance\n assert \"openforcefield\" in provenance\n assert \"openforcefields\" in provenance\n ...
[ "0.62085104", "0.6152855", "0.6148594", "0.5985703", "0.596019", "0.57090783", "0.5705128", "0.55922544", "0.5544663", "0.5482702", "0.5366024", "0.53544986", "0.5342119", "0.52535665", "0.52333575", "0.5217271", "0.5199212", "0.5185142", "0.5115572", "0.5111425", "0.5097022"...
0.84042156
0
Test for find_triangle function.
def test_find_triangle(self): points = np.array([[2.435, -3.37], [2.435, -1.82], [2.635, -2.], [2.535, -1.7]]) connectivity_list = np.array([[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5]], dtype=np.intp) point = np.array([2.6, -1.9]) self.assertEqual(1, find_triangle(point, points, connecti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inside_triangle(self):\n\n # defining triangle vertices\n v1x, v1y = 0, 0\n v2x, v2y = 1, 1\n v3x, v3y = 1, 0\n\n # test vertices are inside\n self.assertTrue(inside_triangle(v1x, v1y, v2x, v2y, v3x, v3y, v1x, v1y))\n self.assertTrue(inside_triangle(v1x, v1...
[ "0.71465766", "0.7094666", "0.70703703", "0.69719374", "0.69642067", "0.6925323", "0.6882541", "0.68354255", "0.6797639", "0.67817736", "0.67645806", "0.6760101", "0.67553604", "0.67485696", "0.67330456", "0.6729973", "0.6727655", "0.67141724", "0.66781765", "0.6619821", "0.6...
0.82844937
0
Test for surface_normal function.
def test_surface_normal(self): vertices = np.array([[0, 1, 0], [0, 0, 0], [1, 0, 0]]) expected = np.array([0, 0, 1]) np.testing.assert_almost_equal(surface_normal(vertices), expected) # Test against multiple triangles vertices = np.r_[vertices[np.newaxis, :, :], [[[0, 0, 0], [0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_normal_always_up(self):\n z_of_normals = []\n for i in range(100):\n neighborhood, pc = create_point_cloud_in_plane_and_neighborhood()\n z_of_normals += list(EigenValueVectorizeFeatureExtractor().extract(pc, neighborhood, None, None, None)[5])\n np.testing.assert...
[ "0.7123382", "0.6521624", "0.6423122", "0.6392963", "0.6290798", "0.61473745", "0.61183316", "0.61182386", "0.60976636", "0.6091063", "0.60830945", "0.6079103", "0.6078365", "0.60698634", "0.60317665", "0.5993436", "0.5993436", "0.5993436", "0.5993436", "0.5993436", "0.594483...
0.8323997
0
Test for _nearest_neighbour_1d function.
def test_nearest_neighbour_1d(self): x = np.array([2., 1., 4., 5., 3.]) x_new = np.array([-3, 0, 1.2, 3, 3, 2.5, 4.7, 6]) val, ind = _nearest_neighbour_1d(x, x_new) np.testing.assert_array_equal(val, [1., 1., 1., 3., 3., 2., 5., 5.]) np.testing.assert_array_equal(ind, [1, 1, 1, 4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nearest_neighbour_regular_1d():\n # test with regular grid and 1d coords\n grid_lon = np.arange(100)\n grid_lat = np.arange(50)\n data = np.zeros((50, 100))\n\n # the four nearest values for the first point\n data[20:22, 10:12] = 7\n\n # the four nearest values for the second point\n ...
[ "0.69601023", "0.68331033", "0.6460805", "0.6430839", "0.6326999", "0.62910575", "0.628301", "0.6238423", "0.6171075", "0.61605567", "0.615175", "0.61391455", "0.6023545", "0.59705627", "0.5882969", "0.5794502", "0.57871974", "0.5771276", "0.57696116", "0.57694775", "0.575873...
0.8333619
0
Test MesoscopeFOV.register_fov method. Note this doesn't actually hit Alyx. Also this doesn't test stack creation.
def test_register_fov(self): task = MesoscopeFOV(self.session_path, device_collection='raw_imaging_data', one=self.one) mlapdv = {'topLeft': [2317.2, -1599.8, -535.5], 'topRight': [2862.7, -1625.2, -748.7], 'bottomLeft': [2317.3, -2181.4, -466.3], 'bottomRight': [2862.7, -2206.9, -679....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_f_from_hfov(self):\n width = 700\n height = 480\n hfov = 60\n vfov = 60\n\n # TODO(marcus): make sure these expected values are correct!\n actual = tesse_ros_bridge.utils.fx_from_hfov(hfov, width)\n expected = 606.2177826491071\n self.assertEqual(act...
[ "0.61097986", "0.6080804", "0.57732624", "0.57588035", "0.55853933", "0.54319566", "0.5408116", "0.5356413", "0.53268194", "0.5303767", "0.5239329", "0.5229449", "0.52219445", "0.51999205", "0.5182848", "0.5173113", "0.51626253", "0.51581705", "0.5127742", "0.50777745", "0.50...
0.8358435
0
Draws the optimal route/path AFTER the algorithm has found it
def draw_best_route(final_route): shape('turtle') fillcolor('purple') pencolor('purple') pensize(4) speed(1) # Finds the start position of the node in the graphical grid start_pos_x = (final_route[0].x) * 30 start_pos_y = (final_route[0].y - 1) * -30 penup() # Sets the start posi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_path(self):\n #Se repite el ciclo para el número especificado de veces\n for i in range(self.iterations):\n for ant in self.ants:\n ant.setup_ant()\n while not ant.final_node_reached:\n #Seleccion aleato...
[ "0.69775563", "0.6936342", "0.67015743", "0.66100115", "0.65149343", "0.6455855", "0.645364", "0.64318365", "0.638702", "0.6368889", "0.629313", "0.6167785", "0.6155954", "0.6152433", "0.61210215", "0.6116109", "0.61007947", "0.60975003", "0.60924315", "0.6082624", "0.6074052...
0.7546996
0
Part of the A algorithm. Sets the parent of the node and calculates the g, h and ffunction
def attach_and_eval(node, parent, goal): node.set_parent(parent) node.g = parent.g + node.get_arc_cost() node.heuristic(goal) node.f = node.g + node.h
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setF(self):\n if self.parent: self.f = self.setG(self.parent.g) + self.setH()\n else: self.f = self.setG() + self.setH()\n return self.f", "def f(self,node):\r\n return (self.a*self.nodeDegree(node))/(1+self.b*self.nodeDegree(node))", "def __init__(self, parent, data, g, h, f):\...
[ "0.6539606", "0.5932769", "0.5919824", "0.56225765", "0.5440231", "0.5285597", "0.52696234", "0.5260468", "0.5191788", "0.51808476", "0.5132827", "0.51117384", "0.5083697", "0.50612867", "0.5060935", "0.5059894", "0.50431925", "0.5036736", "0.5033938", "0.5027082", "0.5017704...
0.63525325
1
Creates a Trainer object. training_sampler Sampler that samples training dataset. validation_sampler Sampler that samples validation dataset. Can be None. executor Graph executor to run the network. optimizer The optimizer to use for training. network_output The node name of the network prediction (value or classificat...
def __init__(self, training_sampler: Sampler, validation_sampler: Optional[Sampler], executor: GraphExecutor, optimizer: Optimizer, network_output: Optional[str] = None): self.train_set = training_sampler self.test_set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(parser):\n cli_args = add_all_args(parser, TRAINING)\n if not cli_args.train_tfrecord and not cli_args.valid_tfrecord:\n assert (\n cli_args.relative_labels or cli_args.xml_labels_folder\n ), 'No labels provided: specify --relative-labels or --xml-labels-folder'\n if cli...
[ "0.6460203", "0.6075577", "0.6028676", "0.59938025", "0.58702856", "0.58700705", "0.5863667", "0.58252823", "0.57971066", "0.5793705", "0.5755463", "0.57455766", "0.5744249", "0.5733688", "0.56948066", "0.568793", "0.56833005", "0.56637686", "0.5651451", "0.5650193", "0.56278...
0.7394186
0
Runs train and test set alternately for a given number of epochs. epochs Number of epochs to run the loop for. events A list of events to use in training/testing. Instances of RunnerEvent invoke the runner events, instances of OptimizerEvent and SamplerEvent are also invoked in the optimizer and sampler objects. collec...
def run_loop(self, epochs, events: List[TrainingEvent] = None, collect_all_times: bool = False) -> TrainingStatistics: # Create statistics object stats = TrainingStatistics(self.train_set.batch_size, (0 if self.test_set is None else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_and_evaluate(model, train_dataloader, test_dataloader, optimizer, scheduler, loss_fn, total_epochs):\n\n for epoch in range(total_epochs):\n\n # Run one epoch for both train and test\n print(\"Epoch {}/{}\".format(epoch + 1, total_epochs))\n\n # compute number of batches in one ep...
[ "0.6826375", "0.6805796", "0.67925835", "0.65626717", "0.64048594", "0.6282162", "0.62598425", "0.6251268", "0.62364304", "0.6235307", "0.6235307", "0.6232785", "0.62240577", "0.6211177", "0.620107", "0.6187016", "0.61487633", "0.61325216", "0.61206204", "0.6118335", "0.60593...
0.8474212
0
Compute and return summary statistics from data.
def summarize(self, data): return self.summary(data).flatten()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_summarystat(self, data):\n if isinstance(data, pd.DataFrame):\n ma_values = self.kernel_transformer.transform(\n data, masker=self.masker, return_type=\"array\"\n )\n elif isinstance(data, list):\n ma_values = self.masker.transform(data)\n ...
[ "0.7708388", "0.75806755", "0.7545205", "0.7426084", "0.7330722", "0.71296847", "0.7019531", "0.69181734", "0.6914385", "0.6904229", "0.6891686", "0.68396693", "0.68380475", "0.6826168", "0.6781659", "0.67217654", "0.66204166", "0.6595634", "0.6595634", "0.6572965", "0.657282...
0.76487106
1
Return a DirectiveError suitable for being thrown as an exception. Call "raise self.directive_error(level, message)" from within a directive implementation to return one single system message at level `level`, which automatically gets the directive block and the line number added. Preferably use the `debug`, `info`, `w...
def directive_error(self, level, message): return DirectiveError(level, message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self, msg):\n if self.current_line and self.current_file:\n msg = '{}\\nError in {} line {}'.format(\n msg, self.current_file, self.current_line)\n return self.DirectiveError(msg)", "def error(self, message):\n return self.log(\"ERROR\", message)", "...
[ "0.6895362", "0.53421384", "0.5183119", "0.5157437", "0.49337742", "0.49263397", "0.48709092", "0.48167634", "0.47850382", "0.4774763", "0.4758415", "0.47475636", "0.47076467", "0.46929008", "0.46928918", "0.4671942", "0.46644497", "0.4658521", "0.46451083", "0.46432275", "0....
0.85326535
0
Append self.options['name'] to node['names'] if it exists. Also normalize the name string and register it as explicit target.
def add_name(self, node): if 'name' in self.options: name = nodes.fully_normalize_name(self.options.pop('name')) if 'name' in node: del(node['name']) node['names'].append(name) self.state.document.note_explicit_target(node, node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, name):\n\n # no need to add first_name while adding full_name\n name_list = name.strip().split()[1:]\n name_list.append(name)\n for item in set(name_list):\n node = self.root\n # check for every char in word, i.e. check whether is it in trie\n ...
[ "0.6573605", "0.607759", "0.60158175", "0.59481245", "0.59406054", "0.5879365", "0.5829988", "0.57405627", "0.57331866", "0.5675645", "0.5675142", "0.56737715", "0.5626971", "0.5610032", "0.5598339", "0.555156", "0.5522539", "0.5516251", "0.54982877", "0.54964846", "0.5481847...
0.76973844
0
Define & return a directive class generated from `directive_fn`. `directive_fn` uses the oldstyle, functional interface.
def convert_directive_function(directive_fn): class FunctionalDirective(Directive): option_spec = getattr(directive_fn, 'options', None) has_content = getattr(directive_fn, 'content', False) _argument_spec = getattr(directive_fn, 'arguments', (0, 0, False)) required_arguments, opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def directive(func):\n func.cfg_is_directive = True\n return func", "def from_directive(cls, directive, app):\n return cls(directive,\n app,\n arguments=directive.arguments,\n content=directive.content,\n options=directive.optio...
[ "0.6722285", "0.62953544", "0.49523148", "0.492212", "0.49055788", "0.48488826", "0.48386657", "0.48240536", "0.48149803", "0.4797709", "0.4784566", "0.47539756", "0.46898127", "0.46874297", "0.46547228", "0.4631999", "0.46281904", "0.46124476", "0.46081212", "0.45765257", "0...
0.7654575
0
Filter recipes by user's available time to cook
def filter_by_time(df, user): time = user.time_to_cook.replace('cooking_time_less_than_', '') return df.loc[df.minutes <= int(time)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n user = self.request.user\n return Recipe.objects.filter(created_by=user)", "def filter_by_date(items, start_time, end_time=None):\n start_time = parser.parse(start_time + \"UTC\").timestamp()\n if end_time:\n end_time = parser.parse(end_time + \"UTC\").timesta...
[ "0.5769205", "0.572824", "0.5692194", "0.5493567", "0.54826933", "0.53807163", "0.53594685", "0.5334486", "0.52857834", "0.52453613", "0.5186571", "0.51753074", "0.5142366", "0.5119954", "0.5114708", "0.5108634", "0.5098999", "0.50934833", "0.5086736", "0.5082143", "0.5069212...
0.6221729
0
Flag and remove the recipes that contain one or more ingredients that the user is allergic to.
def remove_recipes_with_allergies(df, user): if len(user.allergies) == 0: # User has no allergies - do not need to remove recipes return df allergies = [a + '_allergic' for a in user.allergies] return df.loc[df[allergies].any(1) == False]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_non_ingredient(ingredient_list):\n stop_words = set(stopwords.words('english'))\n \n filtered_list = []\n add_list = 0 #a dummy variable to add a text to filtered list\n for phrases in set(ingredient_list): #run through only one item in set (removes duplicates)\n\n ...
[ "0.68335766", "0.6233659", "0.60058457", "0.5908703", "0.58015865", "0.5784165", "0.57681704", "0.5734267", "0.57105947", "0.5706079", "0.5674646", "0.5661127", "0.5651522", "0.5615922", "0.56022453", "0.55409044", "0.55026895", "0.5501584", "0.5482974", "0.54780596", "0.5468...
0.6549054
1
Get list of unique tags in dataset (this is slow)
def get_unique_tags(df): tags = [] for index, row in df.iterrows(): tags = list(set(tags + ast.literal_eval(row.tags))) pdb.set_trace()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataset_tags(connection):\n assert connection\n query = \"\"\"select * from tags()\"\"\"\n result = sqlio.read_sql_query(query, connection)\n return [item.strip() for item in result['name']], [tag_id.strip() for tag_id in result['tag_id']]", "def get_unique_semantic_labels() -> Se...
[ "0.7043857", "0.68312377", "0.66289926", "0.66086257", "0.66025114", "0.65639853", "0.6363107", "0.63457936", "0.6314063", "0.62717646", "0.62587076", "0.6241535", "0.61744475", "0.61730134", "0.61709344", "0.61509275", "0.61432326", "0.6142673", "0.6115405", "0.6106224", "0....
0.79654676
0
goes through all the reservation records that are due today and sends and email. An email should be sent by invoking a task to a worker pool
def notify(self): Reservation = self.db_con.table_data['reservations'] Restaurant = self.db_con.table_data['restaurants'] data = self.db_con.session.query(Reservation, Restaurant).\ filter(Reservation.restaurant_id == Restaurant._id).\ filter(Reservation.date == datetime....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recs():\n click.echo(\"Emailing recommendations to destination...\")\n dio_dir: DioDir = DioDir()\n sched: ScheduleABC = DefaultSchedule()\n today: datetime.date = datetime.datetime.now().date()\n res: Optional[List[Person]] = get_recs(dio_dir, sched, today)\n next_day: datetime.date = sched....
[ "0.6832567", "0.6828355", "0.67634314", "0.67304164", "0.66211", "0.65371364", "0.6534062", "0.65245", "0.6519359", "0.6350347", "0.6347726", "0.6204631", "0.6189868", "0.61646235", "0.61506426", "0.61425835", "0.61145645", "0.60711306", "0.6048367", "0.597328", "0.5964545", ...
0.76157784
0
Process text using the same text processing procedure as was used in the DTM/TFIDF models, and recreate the length column with the cleaned text strings. This results in a more accurate length metric.
def process_length_in_place(flora_data_frame, tokenized_stop_words): before_process_length = flora_data_frame.text.apply(len) # Applying the same text processing used in the DTM/TFIDF models flora_data_frame.text = process_text_tokenize_detokenize(flora_data_frame.text, tokenized_stop_words) # Remove ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_text_length(row):\n derived_series = pd.read_json(json.dumps(row['text_derived']), typ='series')\n derived_series = pd.Series(derived_series)\n row[\"tweet_text_length_derived\"] = derived_series.str.len()\n return row[\"tweet_text_length_derived\"]", "def process_text(self, text):\n\n ...
[ "0.64146006", "0.6411835", "0.61727315", "0.6159938", "0.615653", "0.6079194", "0.5983894", "0.5901329", "0.5890508", "0.5824049", "0.5790439", "0.5750861", "0.57246953", "0.5720506", "0.570198", "0.5676", "0.564766", "0.56303865", "0.55933934", "0.55636495", "0.5511339", "...
0.6710242
0
Request the status of a message with the provided id and return a response dictionary. Returns a dictionary that contains a 'delivery' key with the status value string or contains 'errorCode' and 'message' on error.
def check_status(self, message_id): values = {'token': self._token, 'reference': message_id} return self._request(self.CHECK_STATUS_URL, values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_status(id):\n task = run_ctx_request.AsyncResult(id)\n if task.state == states.PENDING:\n abort(404)\n if task.state == states.RECEIVED or task.state == states.STARTED:\n return '', 202, {'Location': url_for('api.get_status', id=id)}\n return task.info", "def get_task_status(sel...
[ "0.66030747", "0.609507", "0.60182613", "0.60108596", "0.5971447", "0.5942305", "0.5873877", "0.58737046", "0.58452946", "0.58209074", "0.5817636", "0.57952654", "0.57667154", "0.57663524", "0.5756407", "0.57147986", "0.56973785", "0.5649888", "0.56432354", "0.56317407", "0.5...
0.616582
1
Returns a frame as a byte string of TIFF image data (or None). The byte string can be displayed with image(None, data=Camera.frame()).
def frame(self): try: AppHelper.runConsoleEventLoop(installInterrupt=True) return str(self._delegate.frame.representations()[0].TIFFRepresentation().bytes()) except: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFrame(self):\n s, image = self.capture.read()\n return image", "def grabRawFrame(self):\r\n \r\n self.surface = self.capture.get_image(self.surface)\r\n width, height = self.surface.get_size()\r\n return pygame.image.tostring(self.surface, 'RGB'), width, height, 1...
[ "0.6276596", "0.6158309", "0.60090196", "0.5957665", "0.58654284", "0.58341444", "0.5809219", "0.57665694", "0.5721019", "0.5706413", "0.56766975", "0.5670235", "0.56531984", "0.5624375", "0.55753624", "0.55488795", "0.55343914", "0.5529199", "0.5529199", "0.5523762", "0.5512...
0.7610338
0
Decorator which checks the user is a prof before executing a view Redirect to the index page if not
def login_prof(func): @wraps(func, assigned=available_attrs(func)) def wrapper(request, *args, **kwargs): try: request.user.prof except ObjectDoesNotExist: return redirect('gradapp:dashboard_student') res = func(request, *args, **kwargs) return res ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login_required(func):\n @wraps(func)\n def f(*args, **kwargs):\n if g.user is None:\n app.logger.info('redirecting not logged in user')\n return redirect(url_for('index'))\n elif not g.user.initialized and f.__name__ not in ['profile_create','logout']:\n ret...
[ "0.6907077", "0.688773", "0.671351", "0.66562635", "0.6634365", "0.6625549", "0.66013575", "0.65863526", "0.6540508", "0.65245664", "0.65245664", "0.65245664", "0.64538014", "0.64372694", "0.64372694", "0.64372694", "0.64372694", "0.64372694", "0.64372694", "0.64372694", "0.6...
0.7059964
0
Evaluate the assignment (pk=assignment_pk) and makes your evaluation a superevaluation. Assignment seen as eval__
def supereval_assignment(request, assignment_pk, i): assignment = Assignment.objects.get(id=assignment_pk) evalassignment = Evalassignment.objects.filter(assignment=assignment, is_supereval=True).first() redirect_url = ('/detail_assignmentype/%s/#assignment...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_evalassignment(request, pk, pts):\n student = request.user.student\n evalassignment = Evalassignment.objects.\\\n filter(pk=pk, assignment__student=student).first()\n if evalassignment:\n evalassignment.grade_evaluation = pts\n evalassignment.save()\n redirect_item = '...
[ "0.6541989", "0.6323441", "0.6086533", "0.5994296", "0.5994296", "0.5994296", "0.59660524", "0.5931263", "0.5913529", "0.5844344", "0.57308245", "0.572046", "0.5713599", "0.56698984", "0.56081396", "0.5587459", "0.55692595", "0.55667025", "0.5522861", "0.551115", "0.54968995"...
0.6349211
1
Evaluate the assignment evaluation (Evalassignment(pk=pk)). evalassignment.grade_evaluation = pts (1, 0, +1)
def eval_evalassignment(request, pk, pts): student = request.user.student evalassignment = Evalassignment.objects.\ filter(pk=pk, assignment__student=student).first() if evalassignment: evalassignment.grade_evaluation = pts evalassignment.save() redirect_item = '#assignment%s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_evaluated(evalassignment):\n if evalassignment.assignment.document.name == '' or evalassignment.\\\n assignment.assignmentype.deadline_submission > timezone.now():\n return -30\n else:\n if evalassignment.is_questions_graded:\n if evalassignment.grade_evaluation:\n ...
[ "0.6718955", "0.64347076", "0.6072748", "0.6022629", "0.5979578", "0.5979578", "0.5941105", "0.59408855", "0.593862", "0.593862", "0.593862", "0.593862", "0.593862", "0.593862", "0.5919771", "0.5919771", "0.5919771", "0.5919771", "0.5919771", "0.5919771", "0.5919771", "0.59...
0.76794904
0
Create an assignmentype or modify it (with new student list).
def create_assignmentype(request, assignmentype_id=None): prof = request.user.prof context = {} if assignmentype_id: assignmentype = Assignmentype.objects.get(id=assignmentype_id) message = 'Reset your assignment. You can upload a new student list, '\ 'but be aware that it will r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_assignmentype_students(request):\n existing_students = request.session.get('existing_students', False)\n new_students = request.session.get('new_students', False)\n assignmentype_pk = request.session.get('assignmentype_pk', False)\n if assignmentype_pk:\n tasks.create_assignment(assig...
[ "0.65984386", "0.57637066", "0.57263076", "0.56991005", "0.56055224", "0.5555415", "0.5539834", "0.55174875", "0.5380153", "0.537248", "0.5371831", "0.5370983", "0.53656816", "0.53413004", "0.5276961", "0.52551144", "0.52273005", "0.5212578", "0.5203159", "0.5169151", "0.5167...
0.6075281
1
Insert a question for an assignmentype (pk=pk). The user enters in a form a question to be created (cd=1) or a question to be deleted (cd=1)
def insert_question_assignmentype(request, pk, cd): prof = request.user.prof assignmentype = Assignmentype.objects.filter(id=pk, prof=prof).first() cd = int(cd) if cd == 1: classForm = AddQuestionForm info = 'Add' elif cd == -1: classForm = RemoveQuestionForm info = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_question(self, id):\n cursor = self.conn.cursor()\n cursor.execute(f\"insert into {self.site} values (?)\", (id, ))\n self.conn.commit()\n cursor.close()", "def ask_question():\n title_question = request.form.get(\"title\")\n question = request.form.get(\"question\")\...
[ "0.67061335", "0.61879146", "0.61045116", "0.60622334", "0.59862596", "0.59348214", "0.58540165", "0.57960665", "0.57643914", "0.5759345", "0.5720324", "0.57190794", "0.56958216", "0.5681573", "0.5672369", "0.56627357", "0.5647007", "0.5626833", "0.5582249", "0.5573245", "0.5...
0.8077942
0
Modify assignmentype fields, except student list.
def modify_assignmentype(request, pk): prof = request.user.prof assignmentype = Assignmentype.objects.filter(id=pk, prof=prof).first() if assignmentype: if request.method == 'POST': form = LightAssignmentypeForm(request.POST, instance=assignmentype) if form.is_valid(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _enchance_assignment(self, doc):\n\n results = self.get_archive_items_for_assignment(doc)\n if results.count() > 0:\n doc['item_ids'] = [str(item.get(config.ID_FIELD)) for item in results]\n\n self.set_type(doc, doc)", "def filter_allowed_fields(self):\n allowed_fields ...
[ "0.5704868", "0.54479146", "0.53199524", "0.5250077", "0.5214731", "0.5099856", "0.50951463", "0.5083383", "0.50801265", "0.503171", "0.5029087", "0.5015462", "0.500106", "0.4976095", "0.49526381", "0.49027774", "0.4893022", "0.4884994", "0.48844108", "0.48718646", "0.4853452...
0.62879336
0
Delete assignmentype with id=pk and redirect to list of running assignmentype if type_list=='1', and to list of archived assignmentype if type_list=='0'
def delete_assignmentype(request, pk, type_list): prof = request.user.prof assignmentype = Assignmentype.objects.filter(id=pk, prof=prof).first() if assignmentype: assignmentype.delete() if type_list == '1': return redirect('gradapp:list_assignmentypes_running') elif type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def archive_assignmentype(request, pk):\n prof = request.user.prof\n assignmentype = Assignmentype.objects.filter(id=pk, prof=prof).first()\n if assignmentype:\n assignmentype.archived = True\n assignmentype.save()\n return redirect('gradapp:list_assignmentypes_archived')\n else:\n...
[ "0.6607052", "0.58759385", "0.5581794", "0.5503855", "0.5462696", "0.5460969", "0.5406829", "0.5383195", "0.5348376", "0.53082585", "0.5293434", "0.5274261", "0.52701956", "0.5247633", "0.5216509", "0.5201757", "0.5200437", "0.51928216", "0.5189939", "0.5187883", "0.51853114"...
0.86916167
0
When creating an assignment, shows students that will be associated to (existing students and new students). If validated, new students are created and new+existing students are associated to the assignment.
def validate_assignmentype_students(request): existing_students = request.session.get('existing_students', False) new_students = request.session.get('new_students', False) assignmentype_pk = request.session.get('assignmentype_pk', False) if assignmentype_pk: assignmentype = Assignmentype.objects...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_assignmentype_students(request):\n existing_students = request.session.get('existing_students', False)\n new_students = request.session.get('new_students', False)\n assignmentype_pk = request.session.get('assignmentype_pk', False)\n if assignmentype_pk:\n tasks.create_assignment(assig...
[ "0.65330654", "0.60380155", "0.6018351", "0.59819305", "0.59672946", "0.5896777", "0.5893442", "0.58191305", "0.57622266", "0.57531506", "0.5744609", "0.5717306", "0.57112765", "0.5708278", "0.5666188", "0.56414866", "0.5589872", "0.5569364", "0.5552783", "0.55325806", "0.552...
0.65064394
1
After validate_assignmentype_students, create new students and associate new+existing students to an assignmentype.assignment.
def create_assignmentype_students(request): existing_students = request.session.get('existing_students', False) new_students = request.session.get('new_students', False) assignmentype_pk = request.session.get('assignmentype_pk', False) if assignmentype_pk: tasks.create_assignment(assignmentype_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_assignmentype(request, assignmentype_id=None):\n prof = request.user.prof\n context = {}\n if assignmentype_id:\n assignmentype = Assignmentype.objects.get(id=assignmentype_id)\n message = 'Reset your assignment. You can upload a new student list, '\\\n 'but be aware th...
[ "0.69684607", "0.6521637", "0.629256", "0.6040038", "0.5897248", "0.58499175", "0.5832194", "0.56943554", "0.5614065", "0.5535974", "0.55257034", "0.547506", "0.54501027", "0.5429327", "0.53555715", "0.5349613", "0.5298238", "0.5270237", "0.5244102", "0.52330476", "0.5217538"...
0.79302144
0
List all running (archived=False) assignmentype
def list_assignmentypes_running(request): prof = request.user.prof context = {'type_assignmentype': 'running', 'prof': prof} context['list_assignmentypes'] = Assignmentype.objects.\ filter(archived=False, prof=prof).order_by('deadline_submission') return render(request, 'gradapp/list_assignmenty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_assignmentypes_archived(request):\n prof = request.user.prof\n context = {'type_assignmentype': 'archived', 'prof': prof}\n context['list_assignmentypes'] = Assignmentype.objects.\\\n filter(archived=True, prof=prof)\n return render(request, 'gradapp/list_assignmentype.html',\n ...
[ "0.61839694", "0.5991135", "0.5889496", "0.57069176", "0.5693469", "0.56740314", "0.54603916", "0.544857", "0.54450536", "0.5431521", "0.54246765", "0.5392473", "0.53711426", "0.53711426", "0.5344439", "0.5297789", "0.5296468", "0.5291008", "0.5255987", "0.524345", "0.5240108...
0.6715551
0
List all archived assignmentype
def list_assignmentypes_archived(request): prof = request.user.prof context = {'type_assignmentype': 'archived', 'prof': prof} context['list_assignmentypes'] = Assignmentype.objects.\ filter(archived=True, prof=prof) return render(request, 'gradapp/list_assignmentype.html', con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def archive_assignmentype(request, pk):\n prof = request.user.prof\n assignmentype = Assignmentype.objects.filter(id=pk, prof=prof).first()\n if assignmentype:\n assignmentype.archived = True\n assignmentype.save()\n return redirect('gradapp:list_assignmentypes_archived')\n else:\n...
[ "0.646818", "0.5811683", "0.56811064", "0.55502814", "0.5527522", "0.5507093", "0.53576213", "0.53274935", "0.528445", "0.5195552", "0.5107243", "0.51069534", "0.50939465", "0.50938594", "0.50767183", "0.507538", "0.5065023", "0.50611526", "0.5055497", "0.50339127", "0.501154...
0.7493907
0
Dashboard of an assignmentype (id=pk)
def detail_assignmentype(request, pk): prof = request.user.prof context = {'prof': prof} assignmentype = Assignmentype.objects.filter(pk=pk, prof=prof).first() assignments = assignmentype.assignment_set.\ annotate(std=StdDev('evalassignment__grade_assignment'), mean=Avg('evalass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def public_visuals_assignment_id(assignment_id: str):\n\n # Get the assignment object\n assignment = Assignment.query.filter(\n Assignment.id == assignment_id\n ).first()\n\n # If the assignment does not exist, then stop\n req_assert(assignment is not None, message='assignment does not exist'...
[ "0.6137047", "0.59800327", "0.5926279", "0.59021765", "0.5885904", "0.58642113", "0.58123016", "0.5776785", "0.5736159", "0.5716246", "0.5671638", "0.5669275", "0.5610859", "0.5595668", "0.55178446", "0.5484243", "0.54227275", "0.5420696", "0.5375232", "0.53611064", "0.523408...
0.7423683
0
Set up coefficients of an assignmentype (id=pk)
def coeff_assignmentype(request, pk): prof = request.user.prof context = {'prof': prof} assignmentype = Assignmentype.objects.filter(pk=pk, prof=prof).first() if assignmentype: nb_questions = assignmentype.nb_questions if request.method == 'POST': form = CoeffForm(request.POS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, coefficients):\n self.coefficients = coefficients", "def CreateCoefficientPolyfitTables(self):\n for currentPr in self.polars:\n for currentPolar in currentPr[1]:\n # Combine (Pr, AOA) as a point\n self.points.append([currentPr[0], current...
[ "0.6066042", "0.60133684", "0.5861116", "0.5589921", "0.5528351", "0.5413231", "0.5328059", "0.52095425", "0.5183686", "0.5170293", "0.5167636", "0.5162758", "0.51383466", "0.5130969", "0.5099933", "0.5098828", "0.5098256", "0.5043545", "0.5043207", "0.50340074", "0.4991573",...
0.6348616
0
csv to html conversion.
def csv_to_html(): logging.info("Converting csv to html..") df = pd.read_csv(gTAF_config.execution_summary_csv_file) df.to_html(gTAF_config.html_report_file) htmTable = df.to_html()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_to_html(filepath):\r\n df = pd.read_csv(filepath, index_col=0)\r\n html = df.to_html()\r\n return html", "def csv_to_html_table_starter( csvdata ):\n # probably should use the readcsv function, above!\n html_string = '<table>\\n' # start with the table tag\n\n for element in csvdata:...
[ "0.7737987", "0.7237648", "0.62846726", "0.626731", "0.6242982", "0.6178104", "0.5997247", "0.57185525", "0.563922", "0.55996096", "0.5588967", "0.55867475", "0.55619586", "0.5535946", "0.5524614", "0.5508425", "0.5443588", "0.5392276", "0.53839266", "0.53739244", "0.5363368"...
0.8081197
0
Generate the name of the transformed feature from original name.
def _transformed_name(key: Text) -> Text: return key + "_xf"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_file_name(old_file_name: str) -> str:\r\n return old_file_name.split(\".\")[0] + '_features' + '.npy'", "def generate_name(self, name):\n return \"{}/{}.{}\".format(self.name, self._layer_counter, name)", "def _make_name(self, name=None):\n\n if name:\n new_name = name....
[ "0.7340735", "0.71272826", "0.6960715", "0.68877894", "0.68262595", "0.6702207", "0.6644604", "0.6562945", "0.65487856", "0.6546978", "0.65308523", "0.64949733", "0.648802", "0.6484703", "0.6465068", "0.6454453", "0.644879", "0.6445619", "0.64169896", "0.6416392", "0.63704455...
0.7195298
1
Initialize a new Hex game, and return it
def get_new_game(game_config): _type = game_config["game_type"] if _type == "hex": game = Hex(game_config["hex"], verbose=game_config["verbose"]) else: raise ValueError("Game type is not supported") return game
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_new_game(self):\n self.game = get_new_game(self.game_config)", "def __init__(self):\n\n self.width = 10\n self.height = 10\n self.new_game()", "def __init__(self):\n self.die_a = die_class.Die(self.angry_die_faces)\n self.die_b = die_class.Die(self.angry_die_...
[ "0.64138275", "0.6336094", "0.6329723", "0.6318369", "0.6295797", "0.6237595", "0.62131053", "0.61938787", "0.61470306", "0.61469275", "0.61450803", "0.61135393", "0.60844964", "0.60540015", "0.60495573", "0.6031003", "0.5994315", "0.5986799", "0.5981197", "0.5936789", "0.593...
0.6521602
0
Attempts to read auth models go to auth_db.
def db_for_read(self, model, **hints): if self.isAdminApp(model): return 'auth_db' return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth(session, db):\n\tif (session.auth != None) and db(db.User.id == session.auth).count() == 1:\n\t\treturn User(session.auth, db)\n\telse:\n\t\treturn None", "def _load_db(self):\n for type_ in self._types:\n try:\n type_.table(self._metadata)\n except InvalidReq...
[ "0.56026596", "0.5539494", "0.54292023", "0.5427826", "0.5398735", "0.53198487", "0.52996194", "0.5299112", "0.525122", "0.52342856", "0.5227345", "0.5202427", "0.5201855", "0.5185841", "0.5167866", "0.5156039", "0.51369697", "0.51359546", "0.51079786", "0.50896907", "0.50833...
0.611817
0
Allow relations if a model in the auth app is involved.
def allow_relation(self, obj1, obj2, **hints): if self.isAdminApp(obj1) or self.isAdminApp(obj2): return True return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_relation(self, obj1, obj2, **hints):\n\n result = (obj1._meta.model_name in DefaultRouting.defaultModels and \n obj2._meta.model_name in DefaultRouting.defaultModels)\n return result", "def allow_relation(self, obj1, obj2, **hints):\n return True", "def allow_relation(sel...
[ "0.70190156", "0.6990835", "0.6919564", "0.6906994", "0.69009876", "0.6783787", "0.67391515", "0.67210835", "0.6704985", "0.6668281", "0.6638815", "0.6542443", "0.6541121", "0.65383524", "0.64997756", "0.64021367", "0.6397948", "0.63407576", "0.624081", "0.6170405", "0.600265...
0.7264568
0
Find files changed in certain revisions. The function passes `revish` directly to `git diff`, so `revish` can have a variety of forms; see `git diff help` for details. Files in the diff that are matched by `ignore_rules` are excluded.
def files_changed(revish: Text, ignore_rules: Optional[Sequence[Text]] = None, include_uncommitted: bool = False, include_new: bool = False ) -> Tuple[List[Text], List[Text]]: files = repo_files_changed(revish, in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changes(self, files=[], rev=None, change=None, text=False,\n reverse=False, ignore_all_space=False, ignore_space_change=False,\n ignore_blank_lines=False, context=None, subrepos=False,\n include=None, exclude=None): \n return diffparser.parse(self.diff(file...
[ "0.6097362", "0.5880286", "0.5643552", "0.563514", "0.55972046", "0.54928887", "0.5419477", "0.5408571", "0.5355736", "0.53230184", "0.5308404", "0.5283856", "0.526689", "0.524749", "0.5239555", "0.521562", "0.5209716", "0.5176624", "0.5137223", "0.51304287", "0.5037162", "...
0.7239463
0
Creates a two dimensional n (rows) x m (columns) board filled with zeros 4 x 5 board 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 x 2 board 0 0 0 0 0 0 >>> create_board(4, 5) [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] >>> create_board(3, 2) [[0, 0], [0, 0], [0, 0]]
def create_board(n, m): if n == 0 or m == 0: raise IndexError("dimensions cannot both be zero") if n < 0 or m < 0: raise IndexError("dimensions cannot be negative") board = [] rows = [0] * m for i in range(n): board.append(rows) return board
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_board(N):\n board = [[0 for x in range(N)] for y in range(N)] \n return board", "def new_board(n: int) -> Board:\n\n return [[0 for _ in range(n)] for _ in range(n)]", "def create_board(rows, columns):\n res = [[0 for i in range(columns)] for j in range(rows)]\n return res", "def ma...
[ "0.81044716", "0.79067606", "0.78810954", "0.7877859", "0.7731745", "0.76694953", "0.7603823", "0.7559844", "0.7542552", "0.75009793", "0.74589515", "0.7425115", "0.7358076", "0.72688156", "0.72640264", "0.72328144", "0.7185882", "0.71758914", "0.71044713", "0.7032611", "0.70...
0.8604134
0
A special invert function that will return 1/x, except in the case that we pass in x = 0, in which case we return 1
def invert(x): try: return 1 / x except ZeroDivisionError as e: print(e) return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invert0(x):\n return 0 if x > 0 else 1", "def invert(x):\n return linalg.inv(x)", "def opposite(x):\n return -1*x", "def inverse(self, x):\n x = np.asarray(x)\n def r(vec):\n return utils.recycled(vec, as_=x)\n if self.zero is not None and self.multiplier is not N...
[ "0.84756213", "0.78640175", "0.765517", "0.757828", "0.74859875", "0.6893111", "0.68644345", "0.68165404", "0.6784958", "0.6714442", "0.66958183", "0.6689986", "0.6670409", "0.6670409", "0.6670409", "0.66407967", "0.6587519", "0.65857893", "0.65789133", "0.6560175", "0.656017...
0.87478536
0
Save a boxplot of given data. Boxplot display the minimum and the maximum, quartiles 1, 2 and 3 and percentiles 2th and 98th. Also the mean is displayed as a curve.
def save_box_plot(data, fname="box_plot.pdf", axis_labels=None, plot_title=None, plot_suptitle="None"): figure() transpose = lambda l: [[l[j][i] for j in range(len(l))] for i in range(len(l[0]))] tr_data = transpose(data) # boxplot boxplot(tr_data) # plot the mean as a curve avg = l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxplot(values):\n percentiles = percentile(values, [0, 25, 50, 75, 100])\n result = {'min_val': percentiles[0],\n 'q1_val': percentiles[1],\n 'mean_val': percentiles[2],\n 'q3_val': percentiles[3],\n 'max_val': percentiles[4]}\n return result", "d...
[ "0.7449266", "0.72109646", "0.70043445", "0.6898402", "0.68509275", "0.679746", "0.6785153", "0.6746497", "0.6699128", "0.63946426", "0.63684636", "0.6300891", "0.6252812", "0.62450606", "0.61390984", "0.6083131", "0.60641783", "0.606384", "0.601854", "0.5990602", "0.5925783"...
0.7397594
1
Save an errorplot based on given data. Errorplot display the average value plus/minus the standard deviation for each point.
def save_error_plot(data, fname="error_plot.pdf", axis_labels=None, plot_title=None, plot_suptitle=None): from math import sqrt figure() transpose = lambda l: [[l[j][i] for j in range(len(l))] for i in range(len(l[0]))] avg = lambda l: sum(l)/len(l) st_dev = lambda (values, mean): sqrt( su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error():\n\n # Make data set using errors\n dataset_a = DataSet(oscillating,error_y=oscillating_error,plot='error_bar',label='Data and error')\n dataset_a.set_error(interval=5,width=1,cap=2)\n dataset_b = DataSet(oscillating,plot='error_shade',error_y=oscillating_error,order=0,colour='lightgrey',la...
[ "0.7467149", "0.71385247", "0.6977244", "0.68285197", "0.6820716", "0.6669263", "0.6642838", "0.6629824", "0.65923953", "0.6511317", "0.65044206", "0.63321745", "0.6321649", "0.62116826", "0.6172719", "0.6158829", "0.6145462", "0.61333287", "0.6120439", "0.6106668", "0.610414...
0.78207517
0
Generate a MPG video showing multiple scatter plots.
def anim_scatter_plot(points_list, values, fname="anim_scatter.mpg", fps=2, *args, **kwargs): print "Genrating temp images" for idx, pts in enumerate(points_list): print "\tPlot %i of %i" % (idx, len(points_list)) scatter_plot(pts, values, "_tmp_%i.png" % idx, *args, **kwargs) print "Cr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_video(all_obj_locs, fps=30):\n i = 0\n print(len(all_obj_locs[::STEP]))\n for f in all_obj_locs[::STEP]:\n plt.figure(figsize=(SIZE * 2, SIZE), dpi=80)\n plt.ylim([-LANE_LENGTH / 4 + 25, LANE_LENGTH / 4 + 75])\n plt.xlim([-50, LANE_LENGTH + 50])\n x_s = [p[1] for p i...
[ "0.6680317", "0.64790976", "0.6428148", "0.6390699", "0.63647693", "0.6335337", "0.6217466", "0.6141426", "0.61217576", "0.605406", "0.60315275", "0.60152674", "0.59969765", "0.5970817", "0.59612995", "0.5947531", "0.5892995", "0.5829542", "0.5770267", "0.57338464", "0.569560...
0.660165
1
Compute the linear decay rate of quantity x at time t. x(t) = x0 (1alpha) x0 t / T if t T
def linear_decay(x0, alpha, T, t): if t <= T: return x0 - (1 - alpha) * x0 * t / T else: return alpha * x0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rate(self, t):\n return self.l_0 + \\\n self.alpha * sum(np.exp([self.beta * -1.0 * (t - s)\n for s in self.prev_excitations\n if s <= t]))", "def decay(time_, max_time, coeff):\n threshold = max_time - time_\n ...
[ "0.6874832", "0.68739563", "0.6858953", "0.68510693", "0.68177027", "0.6815531", "0.68047565", "0.67692065", "0.67592347", "0.6751221", "0.67395395", "0.6719127", "0.67059916", "0.6692392", "0.6672063", "0.66283715", "0.6593637", "0.656726", "0.64751", "0.641536", "0.6249071"...
0.82191306
0
Returns a feed_dict with the learning rate filled in.
def feed_dict(self): return {self.lr_tensor: self.lr()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_learning_rate(self):\n\n if (self.FLAGS.learning_rate_decay is \"exponential\"):\n self.learning_rate = tf.train.exponential_decay(\n self.FLAGS.learning_rate,\n self.global_step,\n self....
[ "0.65159", "0.615306", "0.615306", "0.6120223", "0.60584396", "0.6019127", "0.59622", "0.59313875", "0.59313875", "0.59218276", "0.5902011", "0.5895842", "0.5883783", "0.5803965", "0.57955194", "0.57940125", "0.5793272", "0.5792256", "0.5776716", "0.57706064", "0.5765436", ...
0.6703134
0
This function uses patterns to test wether or not a temporal annotation is of a known absolute format
def is_absolute_timexe(string): patterns = [ '(\d+)', # just digits '(\d+/\d+/\d+)', '(\d+/\d+)', '(\d+-\d+-\d+)', '(\d+-\d+)', '^\d{1,2}\/\d{1,2}\/\d{4}$', # matches dates of the form XX/XX/YYYY where XX can be 1 or 2 digits long and YYYY is always 4 digits long. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_format_of_annotation_in_file(self):\n if not self.is_span_valid():\n sys.exit()", "def _is_format_endpoint(pattern):\n return '?P<format>' in pattern._regex", "def __check_pattern(node):\n if node.tag != \"discover_datasets\":\n return False\n if \"from_tool_provided...
[ "0.592053", "0.5545554", "0.5531866", "0.5466324", "0.535955", "0.5319224", "0.52924705", "0.529213", "0.5254828", "0.5219572", "0.5217721", "0.520693", "0.5193551", "0.51913005", "0.51366746", "0.5125415", "0.51020896", "0.5094837", "0.5088116", "0.50763893", "0.50740904", ...
0.58306456
1
this function filters absolute timexes using the patterns above
def filter_absolute_timexes(): timexes = pd.read_excel('../TimeDatasets/i2b2 Data/i2b2_timexe_annotations.xlsx') timexes = timexes[timexes['type'].isin(['DATE', 'TIME'])] print('DATE AND TIME') print(timexes) absolute_timexes = timexes[ [is_absolute_timexe(string) for string in timexes['ann_text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_time_slices(time_slices, apt_no, exp_no):\n # Removing the extraneous time slices\n if apt_no == '102A' and exp_no == '3':\n discard_ts = time_slices[\n (time_slices.phase == 'Not Found') & (time_slices.magnitude < 100)]\n time_slices = time_slices.ix[time_slices.index - d...
[ "0.57943213", "0.57883453", "0.56736153", "0.55306923", "0.5493193", "0.54850394", "0.5452034", "0.5439739", "0.53424335", "0.5314489", "0.5308615", "0.52857965", "0.5283658", "0.5208818", "0.5194075", "0.5149346", "0.5143365", "0.50963813", "0.50858736", "0.50754476", "0.506...
0.6755016
0
check if two trees are structurally identical
def is_identical(self, tree1, tree2): if not tree1 and not tree2: return True elif tree1 and tree2: return (tree1.root == tree2.root and self.is_identical(tree1.left,tree2.left) and self.is_identical(tree1.right, tree2.right)) else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _exact_compare(tree1, tree2):\n attrs = ['name', 'length', 'support']\n for n1, n2 in zip(tree1.postorder(), tree2.postorder()):\n for attr in attrs:\n if getattr(n1, attr, None) != getattr(n2, attr, None):\n return False\n return True", "def test_deep_equals(obja, o...
[ "0.76219094", "0.719566", "0.7192063", "0.7131326", "0.7116567", "0.71084994", "0.70945626", "0.7080383", "0.70304936", "0.70223695", "0.7013674", "0.6955322", "0.69210637", "0.69146246", "0.68956894", "0.68956894", "0.68956894", "0.68956894", "0.68956894", "0.6876918", "0.68...
0.75384027
1
count no of half nodes via level order traversal
def count_half_nodes(self): queue = [self] half_nodes = 0 half = False while queue: curr_node = queue.pop(0) if curr_node.left: queue.append(curr_node.left) half = not half if curr_node.right: q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ht(node):\n n = 0\n while node: n, node = n+1, node.left\n return n", "def count_nodes(self):\n if self.is_empty():\n return 0\n elif self.is_leaf():\n return 1\n else:\n if self.get_left():\n if self.get_ri...
[ "0.7206602", "0.70298666", "0.6988069", "0.6873926", "0.6840664", "0.67481023", "0.674637", "0.66773266", "0.6636227", "0.6613095", "0.65921193", "0.65709895", "0.656669", "0.65418726", "0.6516444", "0.6488223", "0.6473618", "0.64561695", "0.64550674", "0.6419698", "0.6414584...
0.7208616
0
A metaphorical superclass for various card factory functions.
def card_factory(rank,suit): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card(self):\r\n return Card(self)", "def card(self):\r\n return Card(self)", "def mock_card():\n return Card(Suit.SPADE, 1)", "def make_card(cls, suit, pip):\n return Card(suit, pip)", "def card(self, card_id):\r\n return Card(self, card_id)", "def __init__(self):\n ...
[ "0.7251714", "0.7251714", "0.6682919", "0.65862644", "0.6558133", "0.6534848", "0.6505554", "0.6370556", "0.6358612", "0.6308622", "0.6301257", "0.62498856", "0.62281394", "0.6223822", "0.62192464", "0.6216633", "0.6190043", "0.61669254", "0.6140639", "0.6122692", "0.60871726...
0.7608941
0
This method import all data files and collect them in one big dictionary, every key is a cell, and contains the data for this cell for all time_points
def createDictBase(self): #allFiles = glob.glob(self.path + "/*"+ self.filetype) #data = pd.read_excel(allFiles[0]) #================================================================================================================== # self.list_files = self.Files_to_import() # data=pd.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self):\n\n all_data = OrderedDict()\n projects = [Path(proj) for proj in glob(str(self.data_path.joinpath(\"*\"))) if Path(proj).is_dir()]\n\n for project in projects:\n files = []\n \n # Read all csv files and save them as a list in files\n ...
[ "0.63508236", "0.6325412", "0.6257426", "0.620853", "0.6198646", "0.61051434", "0.6063956", "0.5999535", "0.5979587", "0.59757197", "0.59742457", "0.59592533", "0.5958371", "0.5948164", "0.59474903", "0.5946523", "0.5943279", "0.5918948", "0.5890966", "0.5865687", "0.585471",...
0.73970014
0
This method gives a possibility to us to export the data directly to the dataBase Sqlite3
def FrameBase_to_Sqlite(self): sql3 = Sql3(self.dataFRAME) # we import the created from us class Sql3 to add the data sql3.sql_write() # very simple and easy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_database(self):\n base_path = QtWidgets.QFileDialog.getSaveFileName(self, 'Save File', filter='CSV (*.csv)')\n database.export_to_csv(DB_PATH, base_path[0])", "def to_sqlite(self, filename):\n\n export_to_db(self.headers, self.data, filename)", "def exportDB(self):\n source...
[ "0.7042345", "0.6815941", "0.67209786", "0.6496771", "0.64334315", "0.6408996", "0.6384497", "0.6370556", "0.63649917", "0.63233453", "0.629178", "0.6223343", "0.61962664", "0.6180101", "0.6169131", "0.61296827", "0.6062206", "0.605488", "0.59702414", "0.59666187", "0.5962860...
0.76379764
0
This method checks how many experiments are given and create a key for this experiment with the data for it in a Experimets dictionary
def exper(self): self.dbase.pop('time') # since we do not want the time data to be included in our calculation we drop it out. ind=list(zip(self.start, self.stop)) # here I recomend to Google; 'zip , list python' to understand what is going on :) Experiments={} #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def experiments(self, key, value):\n experiments = self.get('experiments', [])\n\n name = value.get('e')\n recid = value.get('0')\n record = get_record_ref(recid, 'experiments')\n\n experiments.append({\n 'curated_relation': record is not None,\n 'name': name,\n 'record': record...
[ "0.67150646", "0.58456343", "0.57081664", "0.554345", "0.5494117", "0.548862", "0.5465825", "0.5458093", "0.5454368", "0.545273", "0.5450147", "0.5429693", "0.54195243", "0.5378443", "0.5368457", "0.5343318", "0.53421944", "0.5336246", "0.5334241", "0.53309494", "0.53131723",...
0.59251714
1
This method combines the previuos two methods exper and ReplicaStats end returns a list with means and std for each and every replicate
def Means_Stds(self): self.means=[] # list taking care for the means of ll experiments self.stds=[] # list taking care fro the Stds of all experiments for replica in self.exper(): # remember self.exper, from above returns ListExperiments mean, Std = self._ReplicaStats(replica.T)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ReplicaStats(self, myreplica):\n \n means=[None]*len(myreplica) # creating an empty list for the means with the length of my timepoints indexes\n std=[None]*len(myreplica) # creating an empty list for the std\n for i in range(len(myreplica)):\n means[i]=np.mean(myreplic...
[ "0.7879327", "0.6298081", "0.61253333", "0.6120532", "0.6087231", "0.60323876", "0.60249436", "0.6018178", "0.5919807", "0.591294", "0.58573043", "0.585431", "0.58437914", "0.57945544", "0.57920843", "0.57894504", "0.5778291", "0.57698476", "0.5765662", "0.5676729", "0.567446...
0.8113174
0
On fit, a distribution is created for each column along the covariance and means
def test_fit_default_distribution(self): copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data) for i, key in enumerate(self.data.columns): assert copula.columns[i] == key assert copula.univariates[i].__class__ == GaussianUnivariate assert c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, df):\n self.df_std = df.std(axis=0, skipna=True)\n self.df_mean = df.mean(axis=0, skipna=True)\n return self", "def fit ( self, X ):\n \n if self.mean:\n self.df_means = X.mean ( axis = 0 ) # Get the colwise means\n if self.std:\n sel...
[ "0.6308276", "0.62867206", "0.62607855", "0.6049176", "0.5958321", "0.58459413", "0.58255345", "0.58052725", "0.57393396", "0.57337683", "0.5629323", "0.56162274", "0.5598536", "0.5563038", "0.55481696", "0.54957813", "0.54714674", "0.5460343", "0.5455187", "0.5437176", "0.54...
0.66464084
0
On fit, the distributions for each column use instances of copula.distribution.
def test_fit_distribution_arg(self): # Setup distribution = 'copulas.univariate.gaussian_kde.GaussianKDE' copula = GaussianMultivariate(distribution=distribution) # Run copula.fit(self.data) # Check assert copula.distribution == 'copulas.univariate.gaussian_kde....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fit_distribution_selector(self):\n copula = GaussianMultivariate(distribution={\n 'column1': 'copulas.univariate.beta.BetaUnivariate',\n 'column2': 'copulas.univariate.gaussian_kde.GaussianKDE',\n })\n copula.fit(self.data)\n\n assert get_qualified_name(\n...
[ "0.6521201", "0.62778795", "0.57117486", "0.54257816", "0.5407162", "0.5365817", "0.5301138", "0.52958846", "0.5239649", "0.5227557", "0.5182711", "0.51733905", "0.51689273", "0.5161067", "0.51581097", "0.51333064", "0.51219803", "0.5097027", "0.5093943", "0.5085199", "0.5080...
0.63467205
1
Probability_density computes probability for the given values.
def test_probability_density(self): # Setup copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data) X = np.array([2000., 200., 0.]) expected_result = 0.032245296420409846 # Run result = copula.probability_density(X) # Check assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probability_density(self, X):\n raise NotImplementedError", "def probability_density(dic):\n\n var = dic['var']\n par = dic['par']\n y1 = dic['y']\n y = y1.conjugate() * y\n return dic_result(var,par,y)", "def prob_density_func(xs,norm=True,data_range='data'):\n if data_...
[ "0.7904561", "0.73715144", "0.72693807", "0.695215", "0.6619722", "0.6580916", "0.6514408", "0.64730096", "0.6420018", "0.64060086", "0.637983", "0.6354253", "0.628815", "0.6220043", "0.6208732", "0.6163211", "0.6121466", "0.6121466", "0.6105896", "0.61026055", "0.6094485", ...
0.77205503
1
Gaussian copula can sample after being fit with a constant column. This process will raise warnings when computing the covariance matrix
def test_sample_constant_column(self): # Setup instance = GaussianMultivariate() X = np.array([ [1.0, 2.0], [1.0, 3.0], [1.0, 4.0], [1.0, 5.0] ]) instance.fit(X) # Run result = instance.sample(5) # Check ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_covariance(self):\n raise RuntimeError(\"Internal cosmosis error in SingleValueGaussianLikelihood\")", "def extract_covariance(self, block):\n raise RuntimeError(\"You need to implement the method \"\n \"'extract_covariance' if you set constant_covariance=False \"\n ...
[ "0.6819969", "0.66848814", "0.6387297", "0.63568807", "0.62007195", "0.61540526", "0.6126813", "0.6081666", "0.5988317", "0.5985816", "0.58470076", "0.57394606", "0.56781876", "0.56455225", "0.5579945", "0.5579599", "0.5552339", "0.5549332", "0.55221725", "0.55005264", "0.546...
0.7020414
0
The User cannot create a month that already exist.
def clean(self, *args, **kwargs): name = self.cleaned_data.get('name') if name in Month.objects.values_list('name', flat=True): raise forms.ValidationError(f"The month of {name} already exist") return super(MonthForm, self).clean(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_creator_cannot_update_tab(self):\n\n logged_user = utils.create_user_and_authenticate(self)\n self.group.users.add(logged_user)\n expected_url = reverse('group_view', args=(self.group.pk,))\n\n utils.test_cannot_access(self, self.url, expected_url, self.data)", "def test_...
[ "0.60135305", "0.58874893", "0.5800531", "0.579681", "0.5655037", "0.5562427", "0.55525297", "0.55446094", "0.5531289", "0.5445164", "0.54375124", "0.54319006", "0.54038316", "0.538087", "0.5334421", "0.5327298", "0.531028", "0.5302743", "0.53004247", "0.5300003", "0.5290643"...
0.6488986
0
Test the help file
def test_help(self): help_file = os.path.join(cwd, indir, "r5json_help") help_text = StringIO() with redirect_stdout(help_text): with self.assertRaises(HelpPrinted): main(["--help"]) if os.path.exists(help_file): with open(help_file) as f: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_help(self):\n help_file = os.path.join(cwd, indir, \"rdfc_help\")\n help_text = StringIO()\n with redirect_stdout(help_text):\n with self.assertRaises(HelpPrinted):\n main([\"--help\"])\n if os.path.exists(help_file):\n with open(help_file) ...
[ "0.8088576", "0.8038368", "0.8033258", "0.78555655", "0.78202975", "0.78139514", "0.7774096", "0.7725733", "0.7725733", "0.7713123", "0.770867", "0.7704543", "0.763082", "0.7591885", "0.75887424", "0.75694066", "0.7549705", "0.75341034", "0.75311893", "0.75053424", "0.7505342...
0.8042502
1
Download fname from the FHIR server and save it in target_directory if necessary. If it already exists, just use it
def from_web(self, fname: str, typ: str, target_directory: str) -> str: target = os.path.join(target_directory, fname) if not os.path.exists(target): # f_url = FHIR_SERVER + typ + '/' + fname f_url = FHIR_SERVER + fname resp = requests.get(f_url) if resp.o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unavoidable_download_method(self, target, name):\n # Get path to file\n file_path = os.path.join(self.work_dir, name)\n\n # Create necessary directories if not present\n self.mkdir_p(self.work_dir)\n\n # Check if file exists, download if not presente\n if not os.path.e...
[ "0.68348867", "0.67281526", "0.6612575", "0.6554521", "0.6498222", "0.64975613", "0.6489902", "0.64766484", "0.64766484", "0.64489305", "0.64144224", "0.6401153", "0.63284457", "0.63183427", "0.63093764", "0.6271924", "0.62675196", "0.6264412", "0.6243814", "0.6232468", "0.62...
0.7087589
0
get the index of the vertex under point if within epsilon tolerance
def get_index_under_point(self, event): xy = np.asarray(list(zip(self.xs, self.ys))) xyt = self.line.get_transform().transform(xy) xt, yt = xyt[:, 0], xyt[:, 1] d = np.sqrt((xt - event.x) ** 2 + (yt - event.y) ** 2) pt_idx = np.argmin(d) if d[pt_idx] >= self.max_pix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVertex(self, x, y, z, epsilon=COMPARISON_EPSILON):\n for v in self.vertices:\n if (v.x - x)**2 + (v.y - y)**2 + (v.z - z)**2 <= epsilon**2:\n return v\n raise ValueError('No vertex found')", "def isinsidepointXY(x,p):\n \n return dist(x,p) < epsilon", "def n...
[ "0.66811496", "0.6199875", "0.6109701", "0.60955787", "0.60679823", "0.60257995", "0.59940207", "0.59482193", "0.59161484", "0.5886966", "0.58000994", "0.57858783", "0.57689637", "0.5733948", "0.5703687", "0.56951296", "0.56856495", "0.56644243", "0.5635767", "0.5627456", "0....
0.6639644
1
Returns True if the two players passed as arguments have played each other already. Queries the matches database looking for the lowest player id as player_1_id because we wrote reportMatch() to always sort the player ids before creating a new row. This eliminates us having to look for the pair in either order in this ...
def havePlayedPreviously(player1, player2): # Assign player ids in a way that'll allow us to search for the lowest # first player1ID = min(player1, player2) player2ID = max(player1, player2) # Query the database for this pairing dbconnection = connect() dbcursor = dbconnection.cursor() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def played(p1, p2):\n conn, cur = connect()\n if p1 > p2:\n p1, p2 = p2, p1\n cur.execute(\"SELECT * FROM MATCHES WHERE P1 = %s and P2 = %s;\", (p1, p2,))\n row = cur.fetchone()\n conn.close()\n return row is not None", "def check_tie(self, player1, player2):\n if self.check_win(p...
[ "0.6778872", "0.6490606", "0.62809837", "0.6271337", "0.627046", "0.62453085", "0.61801904", "0.61615", "0.61376363", "0.60704356", "0.604136", "0.5922924", "0.589727", "0.5894811", "0.5865621", "0.5854355", "0.5851207", "0.5843786", "0.5834625", "0.5811289", "0.58053577", ...
0.73695046
0
The test checks whether the virtual operation "hardfork_hive_operation" (generated on hardfork 23) contains correct data related to "air drop" HIVE.
def test_reset_data_provided_by_hardfork_hive_operation_generated_between_hf_22_and_hf_23(node: tt.InitNode): wallet = tt.Wallet(attach_to=node) wallet.create_account("goku1", hives=tt.Asset.Test(50) , hbds=tt.Asset.Tbd(50), vests=tt.Asset.Test(50)) wallet.create_account("steem", hives=tt.Asset.Test(100) ,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hms_service_dies(self):\n # Force the tables to be uncached and then kill the hive metastore.\n tbl_name = \"functional.alltypes\"\n self.client.execute(\"invalidate metadata %s\" % tbl_name)\n kill_cmd = os.path.join(os.environ['IMPALA_HOME'], 'testdata/bin/kill-hive-server.sh')\n check_ca...
[ "0.589975", "0.5518395", "0.545446", "0.5445042", "0.5427462", "0.53870016", "0.5262899", "0.52119577", "0.5174843", "0.51490927", "0.51376146", "0.5104962", "0.5064738", "0.5062418", "0.5041236", "0.5039861", "0.50327873", "0.5029942", "0.4999761", "0.4995236", "0.499059", ...
0.6844616
0
Given a filter name, import and return the filter class. By default, filter modules are searched within the ``ufo2ft.filters`` package.
def getFilterClass(filterName, pkg="ufo2ft.filters"): # TODO add support for third-party plugin discovery? # if filter name is 'Foo Bar', the module should be called 'fooBar' filterName = filterName.replace(" ", "") moduleName = filterName[0].lower() + filterName[1:] module = importlib.import_module...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadFilterFromString(spec):\n return _loadPluginFromString(spec, \"ufo2ft.filters\", isValidFilter)", "def get_filter(name):\n try:\n return FILTERS[name.upper()]\n except:\n msg = 'Unknown model of filter {}, options are {}'\n raise ValueError(msg.format(name, list(FILTERS.keys...
[ "0.6654967", "0.63984025", "0.6100772", "0.595048", "0.5546851", "0.55364734", "0.55064267", "0.55002147", "0.54450935", "0.54266375", "0.54121363", "0.53471565", "0.5288375", "0.52491266", "0.52491266", "0.52491266", "0.52397", "0.52103484", "0.51934093", "0.5180745", "0.518...
0.8785171
0
Parse custom filters from the ufo's lib.plist. Return two lists, one for the filters that are applied before decomposition of composite glyphs, another for the filters that are applied after decomposition.
def loadFilters(ufo): preFilters, postFilters = [], [] for filterDict in ufo.lib.get(FILTERS_KEY, []): namespace = filterDict.get("namespace", "ufo2ft.filters") try: filterClass = getFilterClass(filterDict["name"], namespace) except (ImportError, AttributeError): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_filters(filters_str):\n fltrs = []\n for part in str(filters_str).lower().split(\",\"):\n if part==\"blur\":\n fltrs.append(filters.blur(1))\n elif part==\"distort\":\n fltrs.append(filters.distort(18))\n\n return fltrs", "def par...
[ "0.6801903", "0.642236", "0.631748", "0.62891066", "0.59724027", "0.5944512", "0.588867", "0.58861756", "0.5837576", "0.57184476", "0.56906873", "0.5643275", "0.5557998", "0.54352415", "0.54245675", "0.5410087", "0.54082674", "0.5403556", "0.53947294", "0.5388267", "0.5363942...
0.65959525
1
Return True if 'klass' is a valid filter class. A valid filter class is a class (of type 'type'), that has a '__call__' (bound method), with the signature matching the same method
def isValidFilter(klass): if not isclass(klass): logger.error(f"{klass!r} is not a class") return False if not callable(klass): logger.error(f"{klass!r} is not callable") return False if getfullargspec(klass.__call__).args != getfullargspec(BaseFilter.__call__).args: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_filter_class(cls):\n return type(cls) is types.TypeType and issubclass(cls, BaseHostFilter)", "def match(self, cls):\n return isinstance(self, cls)", "def class_is(cls: Class) -> bool:\n pass", "def match(cls, kind: 'dsl.Any') -> bool:\n return isinstance(kind, cls)", "def p...
[ "0.8063194", "0.66540086", "0.66224563", "0.6453369", "0.63146883", "0.62318975", "0.61231554", "0.610161", "0.6072466", "0.6028027", "0.5993078", "0.5985867", "0.5985867", "0.5985867", "0.5985867", "0.5985867", "0.5985867", "0.59668183", "0.5951617", "0.5935815", "0.5927806"...
0.85365546
0
Take a string specifying a filter class to load (either a builtin filter or one defined in an external, userdefined module), initialize it with given options and return the filter object.
def loadFilterFromString(spec): return _loadPluginFromString(spec, "ufo2ft.filters", isValidFilter)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, classname=None, jobject=None, options=None):\n if jobject is None:\n jobject = Filter.new_instance(classname)\n self.enforce_type(jobject, \"weka.filters.Filter\")\n super(Filter, self).__init__(jobject=jobject, options=options)", "def getFilterClass(filterName,...
[ "0.70017433", "0.6447948", "0.6132342", "0.612842", "0.60046303", "0.5954532", "0.59166795", "0.59039634", "0.58298296", "0.5802773", "0.5751299", "0.5747215", "0.5737991", "0.57208437", "0.56715316", "0.56667185", "0.56580377", "0.56450737", "0.56390226", "0.5600757", "0.559...
0.66894424
1
Iterate over lines and yield line itself with info whether the given line represents a checkbox.
def _iterate_lines(cls, text) -> typing.Generator[str, None, None]: for line in text.split('\n'): yield line, line.lstrip().startswith(cls._CHECKBOX)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_line(self, line):\n ltype = self.line_type(line)\n if ltype == 'gene':\n self.process_gene_line(line)\n return True\n elif ltype == 'mRNA':\n self.process_mrna_line(line)\n return True\n elif ltype == 'CDS':\n self.proce...
[ "0.5809057", "0.5628909", "0.5528122", "0.5528122", "0.5431721", "0.54257345", "0.53042746", "0.5127729", "0.5053834", "0.5010728", "0.5007379", "0.49887162", "0.4927147", "0.48863062", "0.4869411", "0.48680195", "0.48293066", "0.4813869", "0.48024556", "0.47902128", "0.47862...
0.68260306
0
Get title of a checkbox item.
def _get_checkbox_title(cls, line: str) -> str: return line.strip()[len('- [ ] '):]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTitle(self, item):\n return item.Title() or item.getId()", "def get_title(self, list_item):\n title = list_item.find('a', {'class': 'biz-name'}).find('span')\n return title.get_text()", "def selected_title(self):\r\n return self.title", "def getMITItemTitle(self,xc,item,id)...
[ "0.6929655", "0.63157094", "0.62988156", "0.622051", "0.6198238", "0.6106785", "0.61048466", "0.60735077", "0.5996513", "0.5996513", "0.5996513", "0.5994052", "0.59846", "0.59846", "0.59831744", "0.59831744", "0.59831744", "0.59449315", "0.5930652", "0.59213066", "0.59195167"...
0.69560874
0
Set a checkbox tick in text based on checkbox title. >>> Checkbox.set(' Foo\\n [ ] bar', 'bar') returns ' Foo\\n [x] bar'
def set(cls, text: str, title: str, graceful: bool = True) -> str: result, found, modified = cls._do_checkbox_setting(text, title, ('[ ]', '[x]', 1)) if not found: raise UserInputError("Checkbox with title {!r} was not found in the provided text".format(title)) if not graceful and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uiCheckboxSetText(checkbox, text):\n\n clibui.uiCheckboxSetText(checkbox, bytes(text, 'utf-8'))", "def _get_checkbox_title(cls, line: str) -> str:\n return line.strip()[len('- [ ] '):]", "def _do_checkbox_setting(cls, text: str, title: str, replace_args: tuple) -> typing.Tuple[str, bool, bool]:\n...
[ "0.66640157", "0.63094", "0.61071444", "0.55329484", "0.55253977", "0.5489177", "0.53705555", "0.53607", "0.5356963", "0.5292355", "0.5292355", "0.5292355", "0.5292355", "0.5292355", "0.52801657", "0.5204396", "0.51950055", "0.5193192", "0.50891393", "0.5080792", "0.5060383",...
0.7073593
0
Unset a checkbox tick in text based on checkbox title. >>> Checkbox.unset(' Foo\\n [x] bar', 'bar') returns ' Foo\\n [ ] bar'
def unset(cls, text: str, title: str, graceful: bool = True) -> str: result, found, modified = cls._do_checkbox_setting(text, title, ('[x]', '[ ]', 1)) if not found: raise UserInputError("Checkbox with title {!r} was not found in the provided text".format(title)) if not modified: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_checkbox_title(cls, line: str) -> str:\n return line.strip()[len('- [ ] '):]", "def set(cls, text: str, title: str, graceful: bool = True) -> str:\n result, found, modified = cls._do_checkbox_setting(text, title, ('[ ]', '[x]', 1))\n\n if not found:\n raise UserInputError...
[ "0.58806765", "0.5465693", "0.5399874", "0.53318834", "0.53229344", "0.51720303", "0.51474494", "0.5123869", "0.50766873", "0.50161433", "0.5007751", "0.49832973", "0.49005058", "0.4870477", "0.4860511", "0.48524624", "0.48411223", "0.48141718", "0.4802714", "0.47882122", "0....
0.75263244
0
Serialize preprocessor and model.
def serialize_pipeline(preprocessor, clf): print("Serializing preprocessor and model.") with open(DATA_DIR + "/preprocessor.dill", "wb") as prep_f: dill.dump(preprocessor, prep_f) with open(DATA_DIR + "/model.dill", "wb") as model_f: dill.dump(clf, model_f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_model(self):", "def serialize(self): \n with open(self.path+self.name, \"wb\") as pfile:\n pickle.dump(self.pyObj, pfile)", "def serialize(self):", "def serialize(self):\n pass", "def dump(self, model_name: str) -> None:\n # Dump each preprocessor\n for ...
[ "0.6649002", "0.6420852", "0.63892835", "0.6387775", "0.63862485", "0.6346818", "0.621803", "0.6161769", "0.61575824", "0.60979456", "0.6096011", "0.5986972", "0.5961545", "0.5935674", "0.5916678", "0.5909123", "0.5811863", "0.5769323", "0.57688487", "0.5745424", "0.5719557",...
0.7590971
0
() > () Attempt to train a neural network to predict the satisfaction probability of a continuously defined environment.
def run(): cons_in, soln_in, disc = make_discriminator() target, loss, accuracy, optimiser = make_training_nodes(disc) training_set_sampler = make_sampler(cons_in, soln_in, target) test_set_sampler = make_sampler(cons_in, soln_in, target) disc.get_session().run(tf.global_variables_initializer()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trainNet():", "def test_n_and_train(self):\r\n\r\n n = NeuronNetwork(1,\r\n [1],\r\n [[[0.0,0.0]]],\r\n [[0.0]])\r\n\r\n inputs = [[0,0], [0,1], [1,0], [1,1]]\r\n targets = [[0], [0], [0], [1]]\r\n\r\n n.train(inputs,targets,1000,180)\r\n\r\n print(n)\r...
[ "0.7067374", "0.6367169", "0.63666576", "0.62751734", "0.62707525", "0.6263812", "0.62565476", "0.6230025", "0.62205124", "0.62147105", "0.6212505", "0.6206183", "0.6205297", "0.61582935", "0.61562765", "0.61477864", "0.6143865", "0.6137806", "0.6127682", "0.612734", "0.61254...
0.65185124
1
Draws a wheel of radius 1, centered at the origin, in the xy plane
def draw_wheel(): outer_radius = 1 thickness = .4 if wireframe: glutWireTorus(thickness,outer_radius - thickness,8,8) else: glutSolidTorus(thickness,outer_radius - thickness,8,8) glPushAttrib(GL_CURRENT_BIT) glPushAttrib(GL_LIGHTING_BIT) glDisable(GL_LIGHTING) glColor3f(0,0,0) glutWireTorus...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wheel():\n wheel_pos = read_npy_file('wheel.position.npy')\n wheel_timestamps = read_npy_file('wheel.timestamps.npy')\n wheel_rate = get_rate(wheel_timestamps)\n\n wheel_ts = TimeSeries(\n name='wheel_position',\n starting_time=wheel_timestamps[0, 1],\n rate=wheel_rate,\n ...
[ "0.6423294", "0.6398033", "0.636496", "0.6214387", "0.6188329", "0.6164647", "0.61628", "0.61493146", "0.6137537", "0.61131966", "0.60819876", "0.6075274", "0.60751307", "0.60751307", "0.60751307", "0.60751307", "0.60751307", "0.60751307", "0.60696834", "0.60660064", "0.60341...
0.7546296
0
Draws the car body. It is a 1x1x2 cube with its base at the origin.
def draw_car_body(): # draw the car body glPushMatrix() glTranslatef(0,.5,0) glScalef(1,1,2) if wireframe: glutWireCube(1) else: glutSolidCube(1) # draw the wireframe outer shell glPushAttrib(GL_CURRENT_BIT) glPushAttrib(GL_LIGHTING_BIT) glDisable(GL_LIGHTING) glColor3f(0,0,0) glutW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_car():\r\n\twheel_radius = .5\r\n\twheel_thickness = .4\r\n\r\n\tglPushMatrix()\r\n\r\n\t# shift the car up so the base lies at the origin\r\n\tglTranslatef(0,wheel_radius,0)\r\n\t\r\n\tdraw_car_body()\r\n\r\n\t# draw the car wheels\r\n\t# assume the car is facing down the -z axis\r\n\t# front left, front...
[ "0.77651775", "0.71250576", "0.6589624", "0.6474782", "0.6466148", "0.64601725", "0.64139956", "0.6389157", "0.6299738", "0.6197127", "0.61908185", "0.6183466", "0.61715764", "0.6170825", "0.616894", "0.6168042", "0.6151615", "0.6133578", "0.61240333", "0.61225885", "0.610904...
0.85635704
0
Draws a car. The 'car' is a 1x1x2 cube with its base at the origin, with wheels at the four corners.
def draw_car(): wheel_radius = .5 wheel_thickness = .4 glPushMatrix() # shift the car up so the base lies at the origin glTranslatef(0,wheel_radius,0) draw_car_body() # draw the car wheels # assume the car is facing down the -z axis # front left, front right, back left, back right ww = whee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_car(self):\n a = self.h / 50\n ellipse(screen, BLACK, (self.x - 15 * a, self.y + 35 * a, 30 * a, 10 * a))\n rect(screen, LIGHT_BLUE, (self.x, self.y, self.dir * 260 * a, self.h))\n rect(screen, LIGHT_BLUE, (self.x + self.dir * 40 * a, self.y - 40 * a, self.dir * 130 * a, 40 * a...
[ "0.80520225", "0.7438217", "0.6300509", "0.6198885", "0.6186315", "0.60886157", "0.6057705", "0.60341805", "0.6010062", "0.59887075", "0.5942513", "0.59070784", "0.5899582", "0.5894189", "0.5891429", "0.5858376", "0.58501995", "0.58252805", "0.58222425", "0.58174217", "0.5805...
0.8772034
0
Adds an element at the end of the list.
def addLast(self, element): if element is None: raise TypeError('The input element is NoneType') newNode = Node(element) if self.__nelems == 0: self.__head = self.__tail = newNode else: self.__tail.setNext(newNode) self.__tail = newNode ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, elem):\n self.add_last(elem)", "def add_last(self, elem):\n if self.is_empty():\n self.head = self.tail = self.Node(elem, None, None)\n else:\n self.tail.nxt = self.Node(elem, self.tail, None)\n self.tail = self.tail.nxt\n\n self.size += ...
[ "0.801837", "0.7484905", "0.7440537", "0.7360816", "0.7031695", "0.7012047", "0.6965191", "0.6942367", "0.6787635", "0.67849165", "0.6759148", "0.6757302", "0.67473555", "0.67190033", "0.664839", "0.6612984", "0.6594515", "0.6587128", "0.65869623", "0.657475", "0.65145016", ...
0.7491473
1