query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Assert that two multiline strings are equal. If they aren't, show a nice diff.
def assertMultiLineEqual(self, first, second, msg=None): self.assertTrue(isinstance(first, str), 'First argument is not a string') self.assertTrue(isinstance(second, str), 'Second argument is not a string') if first != second: message = ''.join(diffli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertMultiLineEqual(self, first, second, msg=None):\r\n self.assert_(isinstance(first, basestring), (\r\n 'First argument is not a string'))\r\n self.assert_(isinstance(second, basestring), (\r\n 'Second argument is not a string'))\r\n\r\n if first != second:...
[ "0.82592815", "0.74987626", "0.72812736", "0.726718", "0.7259299", "0.72427946", "0.718826", "0.71434915", "0.7009044", "0.6992177", "0.6975448", "0.6975448", "0.69021523", "0.6861659", "0.6852261", "0.68281657", "0.681266", "0.67798996", "0.67484903", "0.6747903", "0.6730730...
0.8611194
0
test Biblio's eq method for duplicates
def isduplicate(a, b): db = bibtexparser.loads(a+'\n'+b) e1, e2 = db.entries refs = Biblio() return refs.eq(e1, e2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isduplicate(self, a, b):\n db = bibtexparser.loads(a+'\\n'+b)\n e1, e2 = db.entries\n refs = Biblio(similarity=self.similarity)\n return refs.eq(e1, e2)", "def test_duplicate_entries(self):", "def testEquality(self):\n pass", "def isduplicate(self, a, b):\n open(...
[ "0.7259203", "0.65145224", "0.6298735", "0.62130135", "0.6186938", "0.61241937", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", "0.6092625", ...
0.7169162
1
test Biblio's eq method for duplicates
def isduplicate(self, a, b): db = bibtexparser.loads(a+'\n'+b) e1, e2 = db.entries refs = Biblio(similarity=self.similarity) return refs.eq(e1, e2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isduplicate(a, b):\n db = bibtexparser.loads(a+'\\n'+b)\n e1, e2 = db.entries\n refs = Biblio()\n return refs.eq(e1, e2)", "def test_duplicate_entries(self):", "def testEquality(self):\n pass", "def isduplicate(self, a, b):\n open(self.mybib, 'w').write(a)\n ...
[ "0.71667874", "0.65124714", "0.62988126", "0.62106305", "0.61856186", "0.6122873", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985", "0.60917985",...
0.72566575
0
test Biblio's eq method in 'add' mode
def isduplicate(self, a, b): open(self.mybib, 'w').write(a) open(self.otherbib, 'w').write(b) res = sp.call('papers add {} --bibtex {} --update-key --mode r --debug'.format(self.otherbib, self.mybib), shell=True) return res != 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add(self):\n self.assertEqual(3, foo.add(1, 2))\n self.assertNotEqual(3, foo.add(2, 2))", "def test_add():\n\n assert add(1, 1) == 2\n assert add(1, 2) == add(2, 1) == 3", "def test_add(self):\n self.assertEqual(3, add(1, 2))\n self.assertNotEqual(3, add(2, 2))", "...
[ "0.6051355", "0.60280013", "0.5969772", "0.579601", "0.5704755", "0.5684875", "0.56681126", "0.5622322", "0.5596762", "0.5589284", "0.55776083", "0.55707574", "0.55216604", "0.55134535", "0.5512043", "0.5476853", "0.54704183", "0.54682106", "0.54536456", "0.54457116", "0.5427...
0.5490873
15
Gives a list of bounding boxes containg faces in the given image
def get_faceboxes(self,img,threshold): faces = self.mark_detector.extract_cnn_facebox(img,threshold) faceboxes = [] for face in faces: start = (face[0],face[1]) end = (face[2],face[3]) box = Box.setStartEnd(start,end) faceboxes.append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _box_faces(image):\n for face in image.faces:\n _box_face(image, face)\n return image", "def get_faceboxes(self, image, threshold):\n rows, cols, _ = image.shape\n\n confidences = []\n faceboxes = []\n\n self.face_net.setInput(cv2.dnn.blobFromImage(image, 1.0, (300, 3...
[ "0.8085123", "0.7980415", "0.79564846", "0.7850688", "0.7760176", "0.77158284", "0.76029724", "0.760038", "0.75674653", "0.7496214", "0.74177533", "0.74149823", "0.7411155", "0.727319", "0.72631246", "0.7260427", "0.7202723", "0.7196494", "0.7174461", "0.7151705", "0.71304613...
0.7947982
3
Returns marks, (x1,x2) x1 and x2 are points identifying a line ortogonal to the face plane
def getGazeDirection(self,img, facebox): facebox_list = facebox.getList() #extrat face box and downsampling face_img = img[facebox_list[1]: facebox_list[3],facebox_list[0]: facebox_list[2]] face_img = cv2.resize(face_img, (128, 128)) face_img = cv2.cvtColor(face_img, cv2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pose_marks(self, marks):\n pose_marks = []\n pose_marks.append(marks[30]) # Nose tip\n pose_marks.append(marks[8]) # Chin\n pose_marks.append(marks[36]) # Left eye left corner\n pose_marks.append(marks[45]) # Right eye right corner\n pose_marks.append(...
[ "0.6497237", "0.61907125", "0.59628296", "0.57378024", "0.5665428", "0.55966413", "0.5570014", "0.55657524", "0.55437905", "0.5528099", "0.552023", "0.55149305", "0.5482512", "0.54736346", "0.54707223", "0.5448917", "0.5430297", "0.54257905", "0.5408462", "0.5394228", "0.5390...
0.5477771
13
Create the cached links. These are the links between locations caused by using direction keys for navigation as opposed to using dungeon features.
def cache_links(self): for source_location in self.gen_locations(): for vi, delta in vi_delta_pairs: drow, dcol = delta for command, magnitude in ((vi, 1), (vi.upper(), 8)): target_location = source_location for i in range(magni...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_links(self):\n xygrid = self.xymap.xygrid\n\n # we must use the xygrid coordinates\n x, y = self.x, self.y\n\n # scan in all directions for links\n for direction, (dx, dy) in MAPSCAN.items():\n\n lx, ly = x + dx, y + dy\n\n if lx in xygrid and ly i...
[ "0.69821167", "0.63550127", "0.5738111", "0.57277435", "0.5647053", "0.56404555", "0.5520767", "0.55009866", "0.54728156", "0.5469091", "0.5463365", "0.54544103", "0.54356766", "0.54338235", "0.5429366", "0.5406448", "0.5374355", "0.5365685", "0.53489137", "0.5334808", "0.533...
0.78895026
0
Build the transition and dynamic programming tables used to find the shortest path to a location. One object picker should be created per selection.
def __init__(self, location_to_ascii, row_min=1, col_min=0, row_max=21, col_max=78): # Define the area of interest. Rect.__init__(self, row_min, col_min, row_max, col_max) # Define the transition table. self.transition_table = AscDP.BackwardsForwardsTable() # Add direction moves ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_lookuptable(self):\n\n if self.uselookuptable:\n # Evaluation lookup tables \n self.action_isok = np.zeros( ( self.nodes_n , self.actions_n ) , dtype = bool )\n self.x_next = np.zeros( ( self.nodes_n , self.actions_n , self.DS.n ) , dtype = float ) ...
[ "0.5611639", "0.55651593", "0.5509236", "0.5498048", "0.54785836", "0.5462349", "0.5421589", "0.54057175", "0.54055935", "0.53959197", "0.5389567", "0.53534895", "0.5275653", "0.5274709", "0.52581483", "0.52575547", "0.5246054", "0.52256", "0.5220583", "0.5214623", "0.5211673...
0.0
-1
This function simply calculates the epsilon effective if you don't give the value for epsiln one or two it will consider it to be 0.9 by default
def epsilonEffective(epsilon1=0.9, epsilon2=0.9): result=1/(1/epsilon1+1/epsilon2-1) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def epsilon():\n return _EPSILON", "def epsilon(current_episode, num_episodes):\n # return 1 - (current_episode/num_episodes)\n return .5 * .9**current_episode", "def epsilon_delta(self):", "def epsilon(self):\n return self.__epsilon", "def update_epsilon(self):\n\t\tif self.epsilon > self.ep...
[ "0.7814464", "0.77845764", "0.74526864", "0.73508424", "0.7289584", "0.7287363", "0.7250014", "0.7202939", "0.6998537", "0.6994459", "0.6985205", "0.69818515", "0.6932892", "0.6892059", "0.688799", "0.6879037", "0.6791216", "0.67908436", "0.67772293", "0.6705519", "0.6654876"...
0.77440226
2
This function simply calculates the epsilon effective for a list of emissivities while the other one is a normal wall it returns a list of effective epsilons
def epsilonEffectiveVectorialOtherOneNormalWall(ListOfEpsilons): epsilon2= 0.9 ListOFEffectiveEpsilons= [] for anyEpsilon in ListOfEpsilons: result=1/(1/anyEpsilon+1/epsilon2-1) ListOFEffectiveEpsilons.append(result) return ListOFEffectiveEpsilons
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_epsilon(env, num_of_bandits, iterations, episodes):\n\n # Initialize total mean rewards array per episode by zero\n epsilon_rewards = np.zeros(iterations)\n\n for i in range(episodes):\n print(f\"Running Epsilon episode:{i}\")\n\n n = 1\n action_count_per_bandit = np.ones(num_...
[ "0.63106453", "0.60338986", "0.5957807", "0.59423536", "0.59085244", "0.5789438", "0.5741385", "0.5716987", "0.5681946", "0.5657834", "0.5606077", "0.55730236", "0.5513506", "0.5452497", "0.5435057", "0.54325557", "0.54113334", "0.54066813", "0.5396189", "0.5393934", "0.53853...
0.7452661
0
Define and evaluate the limit state functions that may be computationally expensive
def lsf_multimodal_function(theta): y_out = -((theta[:, 0] ** 2 + 4) * (theta[:, 1] - 1) / 20 - np.sin(5 * theta[:, 0] / 2) - 2) return y_out.reshape(y_out.shape[0], -1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPolicy(self, state):\n \"\"\"Description:\n Find all of q-values of current state, and choose the action \n with the hight q-value as optimal policy\n \"\"\"\n \"\"\" YOUR CODE HERE \"\"\"\n legalActions = self.getLegalActions(state)\n action = None\n policy = util.Counter() # us...
[ "0.60537744", "0.5802507", "0.57057804", "0.570512", "0.5688094", "0.5668728", "0.56588054", "0.5634615", "0.5567792", "0.55573106", "0.5543706", "0.5541091", "0.5526567", "0.55199945", "0.5508761", "0.55018425", "0.5476276", "0.5455228", "0.5455228", "0.5450378", "0.5447722"...
0.0
-1
An STL Formula is initialized with a robustness function, which is commonly specified using a Predicate. More complex formulas are determined by logical operations like conjuction and disjunction (see other methods in this class).
def __init__(self, robustness): self.robustness = robustness
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def negation(self):\n new_robustness = lambda s, t : - self.robustness(s,t)\n new_formula = STLFormula(new_robustness)\n\n return new_formula", "def always(self, t1, t2):\n new_robustness = lambda s, t : min([ self.robustness(s,k) for k in range(t+t1, t+t2+1)])\n\n new_formula ...
[ "0.6757594", "0.6180851", "0.5799073", "0.5723463", "0.55895317", "0.5459583", "0.54238963", "0.5402407", "0.5294606", "0.523891", "0.5227728", "0.51561034", "0.5148659", "0.50738364", "0.5040158", "0.50378716", "0.5034396", "0.5031577", "0.50058746", "0.5001457", "0.4999761"...
0.54243535
6
Return a new STL Formula object which represents the negation of this one. The robustness degree is given by rho(s,phi,t) = rho(s,phi,t)
def negation(self): new_robustness = lambda s, t : - self.robustness(s,t) new_formula = STLFormula(new_robustness) return new_formula
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def negated(self):\n ops = {Eq: Ne, Ge: Lt, Gt: Le, Le: Gt, Lt: Ge, Ne: Eq}\n # If there ever will be new Relational subclasses, the following line\n # will work until it is properly sorted out\n # return ops.get(self.func, lambda a, b, evaluate=False: ~(self.func(a,\n # b, ...
[ "0.63784575", "0.60499424", "0.6047615", "0.6025719", "0.5980413", "0.59710944", "0.5950272", "0.5905911", "0.5871128", "0.5808477", "0.57869494", "0.57742417", "0.57666385", "0.5696955", "0.56903917", "0.5639218", "0.5592459", "0.55629545", "0.55408806", "0.552846", "0.55211...
0.85079247
0
Return a new STL Formula object which represents the conjuction of
def conjunction(self, second_formula): new_robustness = lambda s, t : min( self.robustness(s,t), second_formula.robustness(s,t) ) new_formula = STLFormula(new_robustness) return new_formula
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formula(self):\n terms = []\n for ff in self.formulae:\n terms += list(ff.terms)\n return Formula(terms)", "def test4():\r\n xmlstr = u\"\"\"\r\n<math xmlns=\"http://www.w3.org/1998/Math/MathML\">\r\n <mstyle displaystyle=\"true\">\r\n <mn>1</mn>\r\n <mo>+</mo>\r\n ...
[ "0.6481127", "0.6069892", "0.6016193", "0.60097945", "0.59924656", "0.59799284", "0.5961672", "0.59534395", "0.59182185", "0.5858698", "0.58271897", "0.58195424", "0.5794693", "0.57394606", "0.5685279", "0.5664971", "0.56265134", "0.5540472", "0.5539249", "0.5527984", "0.5519...
0.557829
17
Return a new STL Formula object which represents the disjunction of
def disjunction(self, second_formula): new_robustness = lambda s, t : max( self.robustness(s,t), second_formula.robustness(s,t) ) new_formula = STLFormula(new_robustness) return new_formula
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_not_and_or(formula: Formula) -> Formula:\r\n # Task 3.5\r\n\r\n map_operators = {'->': Formula.parse('(~p|q)'),\r\n '+': Formula.parse('((p&~q)|(~p&q))'),\r\n '<->': Formula.parse('~((p&~q)|(~p&q))'),\r\n '-&': Formula.parse('~(p&q)'),\r\n ...
[ "0.6928513", "0.64927626", "0.64809364", "0.63076943", "0.6272961", "0.62019426", "0.6155834", "0.61348367", "0.6078864", "0.6068255", "0.60622615", "0.6024921", "0.6003905", "0.59905654", "0.59699976", "0.59579724", "0.59041035", "0.5857507", "0.5839025", "0.5812397", "0.580...
0.6939579
0
Return a new STL Formula object which represents this formula holding at some point in [t+t1, t+t2]. rho(s, F_[t1,t2](phi), t) = max_{k in [t+t1,t+t2]}( rho(s,phi,k) )
def eventually(self, t1, t2): new_robustness = lambda s, t : max([ self.robustness(s,k) for k in range(t+t1, t+t2+1)]) new_formula = STLFormula(new_robustness) return new_formula
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def always(self, t1, t2):\n new_robustness = lambda s, t : min([ self.robustness(s,k) for k in range(t+t1, t+t2+1)])\n\n new_formula = STLFormula(new_robustness)\n\n return new_formula", "def disjunction(self, second_formula):\n new_robustness = lambda s, t : max( self.robustness(s,t)...
[ "0.60814774", "0.5594397", "0.5511437", "0.5436593", "0.54058003", "0.53587633", "0.53587633", "0.5265794", "0.5249713", "0.52059805", "0.52044696", "0.5127763", "0.5115574", "0.5098548", "0.5070726", "0.50691354", "0.5043683", "0.49980867", "0.49883643", "0.49751607", "0.497...
0.65423965
0
Return a new STL Formula object which represents this formula holding at all times in [t+t1, t+t2]. rho(s, F_[t1,t2](phi), t) = min_{k in [t+t1,t+t2]}( rho(s,phi,k) )
def always(self, t1, t2): new_robustness = lambda s, t : min([ self.robustness(s,k) for k in range(t+t1, t+t2+1)]) new_formula = STLFormula(new_robustness) return new_formula
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eventually(self, t1, t2):\n new_robustness = lambda s, t : max([ self.robustness(s,k) for k in range(t+t1, t+t2+1)])\n\n new_formula = STLFormula(new_robustness)\n\n return new_formula", "def conjunction(self, second_formula):\n new_robustness = lambda s, t : min( self.robustness(...
[ "0.6225095", "0.5380109", "0.52846324", "0.5268822", "0.5250239", "0.507966", "0.5078371", "0.5048716", "0.5048716", "0.5045929", "0.50276214", "0.501732", "0.49967548", "0.4975366", "0.49715793", "0.49676615", "0.4959879", "0.49277917", "0.49169645", "0.49146962", "0.4910409...
0.6450866
0
data_id The data_id that will be attached to the records produced. course_fields speed_fields heading_fields wind_dir_fields wind_speed_fields Commaseparated lists of field names from which we should take values for course, speed over ground, heading, relative wind speed and relative wind direction. update_on_fields If...
def __init__(self, data_id, course_fields, speed_fields, heading_fields, wind_dir_fields, wind_speed_fields, update_on_fields=None, zero_line_reference=0, convert_wind_factor=1, convert_speed_factor=1, output_nmea=False): supe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processData(self,data):\n #print 'I GOT DATA',data,[0],data[1]\n # Check for valid data (not null or empty string)\n #print '**************NOTIFICATION***************',type(_RobotCommunicator.WALL_HEADER),type(data[0])\n if data:\n #print '**************NOTIFICATION******...
[ "0.53975344", "0.52873915", "0.50456554", "0.50301075", "0.49908647", "0.49831617", "0.48950723", "0.47512385", "0.47308448", "0.4730168", "0.47279853", "0.47256327", "0.47077668", "0.46848103", "0.46756554", "0.46603763", "0.46585894", "0.46537262", "0.46511868", "0.46418202",...
0.69498223
0
Incorporate any useable fields in this record, and if it gives us a new true wind value, return it.
def transform(self, record): if not record: return None if not type(record) is DASRecord: logging.warning('Improper format record: %s',record) return None update = False for field_name in record.fields: if field_name in self.course_fields: self.course_val = record.field...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wind_meta(self):\n return self.data.wind_meta", "def wind(self):\n return self._wind", "def _get_wred(self):\n return self.__wred", "def _get_wred(self):\n return self.__wred", "def _get_wred(self):\n return self.__wred", "def calc_generation_wind_proposed (self):\n if s...
[ "0.5335317", "0.52828914", "0.52291673", "0.52291673", "0.52291673", "0.51694596", "0.49782172", "0.49209738", "0.49078652", "0.48731014", "0.48608252", "0.48421362", "0.48118705", "0.4774674", "0.47562644", "0.47545525", "0.4751787", "0.4737342", "0.47335005", "0.472048", "0...
0.6221449
0
retrieves a dictionary representation of a Student instance
def to_json(self, attrs=None): if type(attrs) is list: my_dict = {} for i in attrs: if i in self.__dict__: my_dict[i] = self.__dict__[i] return(my_dict) return(self.__dict__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_to_dict_creates_dict(self):\n user = User()\n user_details = {\"student_id\": user.id, \"first_name\": \"Joe\"}\n u = Student(**user_details)\n new_d = u.to_dict()\n self.assertEqual(type(new_d), dict)\n self.assertFalse(\"_sa_instance_state\" in new_d)\n f...
[ "0.6967492", "0.6854172", "0.68230337", "0.68190545", "0.6693714", "0.65850425", "0.64653426", "0.6447594", "0.63673645", "0.6365533", "0.6316791", "0.6198606", "0.6174732", "0.6135114", "0.6131578", "0.61182433", "0.61072487", "0.6086442", "0.608156", "0.60479915", "0.601603...
0.0
-1
Initialise empty list to store movie objects.
def __init__(self): self.movies = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.movie_reviews = []", "def __init__(self, movie_list, handler):\n self = self\n self.movie_list = movie_list\n self.handler = handler", "def movies(self) -> List[Movie]:\n return super(MoviesManager, self).items", "def __init__(self):\n self...
[ "0.65290993", "0.64381063", "0.6387146", "0.6362394", "0.6308672", "0.62854606", "0.6260135", "0.61852294", "0.6150018", "0.60788643", "0.60733324", "0.60368407", "0.60368407", "0.603464", "0.6025904", "0.60086554", "0.5979831", "0.59669375", "0.5956342", "0.5935932", "0.5929...
0.7599408
0
Return a string representation of movie_collection.
def __str__(self): return str([str(movie) for movie in self.movies])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n if len(self.movies) == 1:\n return \"[ %s\" % ( self.movies.head )\n else:\n i, l, s = 0, len(self.movies), \"\"\n ch = chr(201)\n for movie in self.movies:\n s += \"%s %s\" % ( ch, movie )\n i += 1\n ...
[ "0.6659319", "0.6628551", "0.62493557", "0.60645914", "0.58099663", "0.57829535", "0.5771873", "0.5735844", "0.5735844", "0.5711104", "0.5698495", "0.56329626", "0.5529546", "0.5506747", "0.5498773", "0.54663736", "0.54648674", "0.5462892", "0.5462892", "0.5462892", "0.546289...
0.7336832
0
Add a movie to the list of movies.
def add_movie(self, movie): self.movies.append(movie)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, movie):\n self.movies.append(movie)", "def insert(self, movie):\n self._currentMovie = self.movies.add(movie)\n self._updateMovieList = True", "def add_movie(self, movie_id, title, syn, actorsList):\n if movie_id in self.movies:\n \t\treturn False\n \tfor actor_i...
[ "0.8900799", "0.8045397", "0.7768572", "0.76284903", "0.7500664", "0.7352316", "0.7212312", "0.7136348", "0.7030553", "0.6866704", "0.6758157", "0.66564816", "0.65935546", "0.6266042", "0.6245702", "0.6196159", "0.6195921", "0.6169882", "0.6088118", "0.6033789", "0.60107416",...
0.8978601
0
Returns number of movies unwatched.
def get_number_un_watched(self): movies_un_watched = 0 for movie in self.movies: if not movie.is_watched: movies_un_watched += 1 return movies_un_watched
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_number_watched(self):\n movies_watched = 0\n for movie in self.movies:\n if movie.is_watched:\n movies_watched += 1\n return movies_watched", "def get_number_of_movies(self):\n raise NotImplementedError", "def unseen_count_for(self, user):\r\n ...
[ "0.7755944", "0.6540844", "0.61782014", "0.6130556", "0.6059607", "0.57578415", "0.57013404", "0.569084", "0.567021", "0.56334585", "0.55824435", "0.5575674", "0.55153644", "0.5513155", "0.5429644", "0.5418207", "0.5391372", "0.5387409", "0.5384734", "0.5315951", "0.5298279",...
0.90050864
0
Returns number of movies watched.
def get_number_watched(self): movies_watched = 0 for movie in self.movies: if movie.is_watched: movies_watched += 1 return movies_watched
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_number_of_movies(self):\n raise NotImplementedError", "def get_number_un_watched(self):\n movies_un_watched = 0\n for movie in self.movies:\n if not movie.is_watched:\n movies_un_watched += 1\n return movies_un_watched", "def tot_movies():\n ...
[ "0.79504406", "0.78356934", "0.684265", "0.6501998", "0.6493687", "0.64376444", "0.64284354", "0.6427606", "0.63701856", "0.63086224", "0.6142869", "0.61026233", "0.6084461", "0.60532176", "0.6037645", "0.58779836", "0.5861516", "0.5820638", "0.5809127", "0.5804819", "0.58046...
0.88137585
0
Read the file containing movies saving as a list.
def load_movies(self, file_name): in_file = open('{}'.format(file_name), 'r') for line in in_file: line_str = line.strip().split(',') # Create movie instance and convert year to an integer movie = Movie(line_str[INDEX_OF_TITLE], int(line_str[INDEX_OF_YEAR]), line_str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_movies(filename):\n movies = []\n # TODO: Read the file correctly and instantiate movie objects to store them\n # inside the movies list.\n return movies", "def loadMovieList():\n # Read the fixed movieulary list\n fid = open('movie.txt', 'r', encoding='UTF-8')\n ls = fid.readlines(...
[ "0.8445153", "0.7818126", "0.7173876", "0.71036965", "0.69080424", "0.68292606", "0.6827025", "0.67422503", "0.66594076", "0.66577935", "0.6559717", "0.6392808", "0.6307358", "0.6306428", "0.62772185", "0.6257083", "0.62313277", "0.6198048", "0.61694336", "0.6110801", "0.6096...
0.7236775
2
Save movies to file.
def save_movies(self, filename): out_file = open('{}'.format(filename), 'w') for movie in self.movies: out_file.write("{}\n".format(movie)) out_file.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_csv(outfile, movies):\n fieldnames = ['title', 'rating', 'year', 'actors', 'runtime']\n with open('movies.csv', 'w') as outfile:\n writer = csv.DictWriter(outfile, fieldnames=fieldnames)\n writer.writeheader()\n for line in movies:\n writer.writerow(line)\n\n\n # A...
[ "0.72095114", "0.71403253", "0.68307644", "0.6719887", "0.67072356", "0.6481229", "0.64616996", "0.6323915", "0.6316662", "0.6286281", "0.6236424", "0.62208205", "0.61929744", "0.6184691", "0.61743426", "0.60964686", "0.6085657", "0.60776585", "0.6068898", "0.6067825", "0.606...
0.8231782
0
Sort objects by keyword attribute.
def sort_movies(self, keyword): self.movies.sort(key=attrgetter(keyword, "title"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortby(self):\n ...", "def keysort(*args, **kwargs): # real signature unknown\n pass", "def sort(self, field='word', order=None):\n self.data = list(self.sorted(field, order))", "def sort_key(self):\n ...", "def sort_books(self):\n self.foods = sorted(self.foods, key=attr...
[ "0.6517557", "0.62519825", "0.621693", "0.618207", "0.61291474", "0.60603756", "0.5968144", "0.591704", "0.58679897", "0.58125305", "0.57413775", "0.5737953", "0.5718942", "0.5710644", "0.5701423", "0.5689594", "0.5621519", "0.5617988", "0.5601959", "0.5600666", "0.5600666", ...
0.7797052
0
Return longest movie title length.
def calculate_longest_title(self): longest_title_length = 0 for movie in self.movies: title_length = len(movie.title) if title_length > longest_title_length: longest_title_length = title_length return longest_title_length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest_word_length(words):", "def display_count_longest_title():\n longest_title = reports.count_longest_title(filename)\n print(\n \"The longest title in {} has a {} characters\\n\".format(\n filename,\n longest_title))", "def get_movie_longest_runtime(movies: list) -> ...
[ "0.77722895", "0.7590663", "0.7366647", "0.7108653", "0.7067252", "0.6978308", "0.69709504", "0.68817616", "0.683693", "0.6814063", "0.66816366", "0.66371953", "0.6625562", "0.66211367", "0.66208327", "0.6615058", "0.6594465", "0.6562419", "0.6558994", "0.6544149", "0.6536397...
0.8994632
0
Sort movies by year and prints formatted table labeling unwatched with .
def list_movies(self, longest_title_length): for i, movie in enumerate(self.movies): unwatched_string = ' ' if not movie.is_watched: unwatched_string = '*' print("{:2}. {} {:{}} - {:5} ({})".format(i, unwatched_string, movie.title, longest_title_length, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yr_fewest_movies():\n copy = movies.copy()\n year = copy.sort_values(['Number of Movies', 'Year']).reset_index(drop = True).Year.loc[0]\n return ('yr_fewest_movies', year)", "def main():\n movies = read_movies('bond.csv')\n\n print('Original list (first 10):')\n print_movies(mov...
[ "0.6516226", "0.6265513", "0.6254855", "0.6015417", "0.59726846", "0.59625655", "0.57363737", "0.5729767", "0.5654759", "0.56210405", "0.5605649", "0.5573096", "0.5542348", "0.55401593", "0.54924494", "0.5470789", "0.5466671", "0.54481035", "0.54068506", "0.54062355", "0.5404...
0.623919
3
Set movie at specified index watched if not already.
def set_movie_watched(self, movie_index): if self.movies[movie_index].is_watched: print("You have already watched {}".format(self.movies[movie_index].title)) else: self.movies[movie_index].watch_movie() print("{} from {} watched".format(self.movies[movie_index].title,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_target_movie(self, movie_title):\n self.target_movie = self.db.query(Movie).filter_by(\n title=movie_title).first()", "def setMovie(self, movie):\n if movie != None:\n self.titleText.set(movie.title)\n if isinstance(movie.director, types.StringTypes):\n ...
[ "0.5464972", "0.53104514", "0.5152905", "0.5102784", "0.50916296", "0.5083048", "0.50648904", "0.50172126", "0.49893054", "0.4985861", "0.49777514", "0.49769378", "0.4974608", "0.49403375", "0.49258924", "0.49239987", "0.4907317", "0.4899596", "0.489666", "0.48950246", "0.489...
0.7617139
0
Set is_watched to 'w' or 'u' ready for saving so that it matched sample output.
def bool_to_status(self): for movie in self.movies: if movie.is_watched: movie.is_watched = WATCHED else: movie.is_watched = UNWATCHED
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_movie_watched(self, movie_index):\n if self.movies[movie_index].is_watched:\n print(\"You have already watched {}\".format(self.movies[movie_index].title))\n else:\n self.movies[movie_index].watch_movie()\n print(\"{} from {} watched\".format(self.movies[movie...
[ "0.5912901", "0.555388", "0.51608515", "0.506256", "0.50503856", "0.5013928", "0.5003339", "0.4994564", "0.49897543", "0.49845046", "0.49726027", "0.49247593", "0.48908532", "0.48908532", "0.4881085", "0.4878073", "0.48633444", "0.48521966", "0.48514238", "0.48476604", "0.482...
0.5689392
1
Browse for .sm files
def BuildStack(self): try: dialog = wx.DirDialog(None, "Choose a directory", style=wx.DD_DIR_MUST_EXIST|wx.DD_CHANGE_DIR) #dialog.SetWildcard(wildcard) if dialog.ShowModal() == wx.ID_OK: directory = dialog.GetPath() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OpenSoundFiles():\n\n wildcard = create_wildcard(\"Sound files\", sppas.src.audiodata.aio.extensionsul)\n wildcard += '|' + create_wildcard(\"All files\", ['*', '*.*'])\n\n files = list()\n dlg = wx.FileDialog(None, \n \"Select sound file(s)\", \n paths...
[ "0.5978283", "0.58677226", "0.58519614", "0.5773267", "0.57463515", "0.5632323", "0.5517103", "0.5515584", "0.55132335", "0.5501415", "0.54622257", "0.5433972", "0.5403349", "0.53323007", "0.5332251", "0.5292054", "0.5290622", "0.5265916", "0.5265916", "0.5256516", "0.5248227...
0.0
-1
Browse for .hdf5 file
def SaveStackH5(self): try: wildcard = "HDF5 files (*.hdf5)|*.hdf5" dialog = wx.FileDialog(None, "Save as .hdf5", wildcard=wildcard, style=wx.SAVE|wx.OVERWRITE_PROMPT) if dialog.ShowModal() == wx.ID_OK: filepath = dialog....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onBrowse_imp1(self, event):\n data_folder = \"\"\n self.m_textCtrl_input_model_path1.Clear()\n\n dlg = wx.FileDialog(self, \"Open a file:\", wildcard=\"hdf5 files (*.h5)|*.h5\",\n style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)\n default_path = self.m_textCtrl_i...
[ "0.6836094", "0.6743301", "0.6585112", "0.6546339", "0.6539629", "0.6506283", "0.6453404", "0.6368453", "0.6287706", "0.61447805", "0.6013481", "0.5968393", "0.59644145", "0.5950732", "0.5905181", "0.5824385", "0.58210135", "0.58210135", "0.5788737", "0.5786438", "0.577736", ...
0.60527533
10
Browse for .hdf5 file
def SaveResultsToH5(self): try: wildcard = "HDF5 files (*.hdf5)|*.hdf5" dialog = wx.FileDialog(None, "Save as .hdf5", wildcard=wildcard, style=wx.SAVE|wx.OVERWRITE_PROMPT) if dialog.ShowModal() == wx.ID_OK: filepath = dia...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onBrowse_imp1(self, event):\n data_folder = \"\"\n self.m_textCtrl_input_model_path1.Clear()\n\n dlg = wx.FileDialog(self, \"Open a file:\", wildcard=\"hdf5 files (*.h5)|*.h5\",\n style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)\n default_path = self.m_textCtrl_i...
[ "0.6836139", "0.6741686", "0.65854824", "0.65471804", "0.6537863", "0.6507506", "0.6452145", "0.6367841", "0.6143151", "0.6052056", "0.60112906", "0.59678173", "0.5963143", "0.5948905", "0.5905889", "0.5825003", "0.58213663", "0.58213663", "0.5788032", "0.5785552", "0.5780011...
0.6287379
8
Generate the dataset's data if it does not exist.
def generate_data(self): self.remove_hdf5_file() hdf5_handler = self.create_hdf5_file() self.populate_hdf5_file(hdf5_handler, self.dataset)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_data_set(self):\n if not self.assert_data_correct():\n self.download_all_data()\n self.unpack_rename_data()\n self.split_data_characters()\n self.clean_data_fragments()\n self.create_font_data()\n if not self.assert_train_augmented():\n...
[ "0.69200563", "0.67951465", "0.6723771", "0.6610489", "0.6583298", "0.65758735", "0.65656567", "0.6530771", "0.64458627", "0.64342827", "0.6404715", "0.6372979", "0.63223845", "0.62426066", "0.62412035", "0.6232917", "0.6224932", "0.6188829", "0.6183252", "0.6165206", "0.6160...
0.7456934
0
Generate the test dataset and store it to disk.
def generate_dataset(self): sets = { "train": 10, "test": 5, } fields = { "strings_list": lambda x: str_to_ascii(self.generate_string_list(x)), "data": lambda x: np.random.randint(0, 10, (x, 10)), "number": lambda x: np.array(range(x))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateDataset(self):\n if self.outdir[-1] != \"/\": \n self.outdir += \"/\"\n self.outdir += \"dataset_trackml\"\n i = 1\n while os.path.exists(self.outdir):\n self.outdir.replace(\"_\"+str(i-1), \"\")\n self.outdir += (\"_\"+str(i))\n i...
[ "0.7327681", "0.7252", "0.72127897", "0.71530336", "0.70798606", "0.6980536", "0.697719", "0.6964925", "0.6962602", "0.6940431", "0.6919756", "0.6919424", "0.68703735", "0.6856671", "0.684216", "0.68320286", "0.6830385", "0.6785239", "0.67756003", "0.669554", "0.6651334", "...
0.66815734
20
Generate a list of strings.
def generate_string_list(self, n): template_str = 'string_' string_list = [template_str + str(i) for i in range(n)] return string_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_string_list(char_list, length):\n return [e for e in generate_strings(char_list, length)]", "def generate_str(self, num):\n str_list = []\n for _ in range(num):\n str_list.append(self.fake.pystr())\n return str_list", "def generate_strings(char_list, length):\n ...
[ "0.78389084", "0.7442578", "0.72651327", "0.7240272", "0.7009902", "0.6672038", "0.6522357", "0.65052104", "0.64621574", "0.6427473", "0.64225364", "0.6373771", "0.6346114", "0.6333544", "0.6331938", "0.63198966", "0.6306335", "0.62754685", "0.6215374", "0.6160407", "0.615534...
0.777014
1
Load data for testing the FieldLoader class.
def get_test_data_FieldLoader(self, set_name='train', field='data'): path = "/{set_name}/{field}".format(set_name=set_name, field=field) field_loader = self.load_hdf5_file_FieldLoader(path) set_data = self.dataset[set_name] return field_loader, set_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self) -> None:", "def load_data(self):", "def test_dataloader(self) -> DataLoader:\n return self._custom_data_loader()", "def load_data(self):\n raise NotImplementedError()", "def load_data(self, data):\n self.data = data\n self.validate()", "def setUp(self):\n ...
[ "0.7236644", "0.7104567", "0.7077611", "0.67128515", "0.6609189", "0.6563617", "0.6536698", "0.6475042", "0.6435233", "0.6316149", "0.6312232", "0.6294654", "0.6196114", "0.61840767", "0.61840767", "0.6171941", "0.61452377", "0.6128587", "0.6126146", "0.6096968", "0.6084923",...
0.7161606
1
Return a dataset for testing the FieldLoader class.
def get_test_dataset_SetLoader(self, set_name='train'): set_loader = self.load_hdf5_file_SetLoader(set_name) set_data = self.dataset[set_name] set_fields = self.data_fields[set_name] return set_loader, set_data, set_fields
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_test_dataset_DataLoader(self):\n test_info = self.get_test_DataLoader_info()\n name = test_info[\"name\"]\n task = test_info[\"task\"]\n data_dir = test_info[\"data_dir\"]\n hdf5_file = test_info[\"hdf5_file\"]\n\n data_loader = DataLoader(name, task, data_dir, hdf...
[ "0.78888327", "0.7603223", "0.73044086", "0.72188866", "0.7082152", "0.7069775", "0.69244474", "0.6873793", "0.6871499", "0.68013656", "0.6789716", "0.6701403", "0.67012626", "0.66969347", "0.65904266", "0.6579232", "0.6568345", "0.65629375", "0.6548726", "0.65372163", "0.652...
0.6751672
11
Return a dataset for testing the FieldLoader class.
def get_test_dataset_DataLoader(self): test_info = self.get_test_DataLoader_info() name = test_info["name"] task = test_info["task"] data_dir = test_info["data_dir"] hdf5_file = test_info["hdf5_file"] data_loader = DataLoader(name, task, data_dir, hdf5_file) ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_test_data_FieldLoader(self, set_name='train', field='data'):\n path = \"/{set_name}/{field}\".format(set_name=set_name, field=field)\n field_loader = self.load_hdf5_file_FieldLoader(path)\n set_data = self.dataset[set_name]\n return field_loader, set_data", "def test_dataloade...
[ "0.76030594", "0.73050845", "0.7218909", "0.70823777", "0.707011", "0.6923885", "0.6874425", "0.68715763", "0.680077", "0.67888016", "0.6751399", "0.670098", "0.67003936", "0.66979426", "0.6590271", "0.6578667", "0.65673375", "0.6562923", "0.6548202", "0.65370923", "0.6524199...
0.7889583
0
Get the expected values of an object index from the test dataset.
def get_expected_object_values(set_data, fields, idx): assert set_data assert fields assert idx is not None if isinstance(idx, int): expected = get_single_object_values(set_data, fields, idx) else: expected = [] for i in idx: expected.append(get_single_object_val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_dimensions_by_index(self):\n\n dimensions, dim_names = pyjstat.get_dimensions(\n self.oecd_datasets['oecd'], 'index')\n self.assertTrue(dim_names[2] == 'year')\n self.assertTrue(dimensions[0].iloc[0]['index'] == 0)", "def get_test_index(self):\n return self.tes...
[ "0.6085354", "0.59751713", "0.58467215", "0.5743093", "0.56780034", "0.5677077", "0.5662826", "0.5632936", "0.5603338", "0.5561478", "0.55502975", "0.55169076", "0.55166215", "0.54973763", "0.549305", "0.5478096", "0.5470087", "0.54686487", "0.54338706", "0.5414726", "0.53993...
0.71672696
0
Sending request to server to go north.
def north(self): self.send("north") msg = self.recv() return [msg.get(0), msg.get(1), msg.get(2)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_request(self):\n route_chosen = self.comboBox_route_list.currentText()\n route_id = route_chosen.split(',')[0] #to get the id of the route\n trip_headsign_chosen = self.comboBox_trip_headsign_list.currentText()\n stop_chosen = self.comboBox_stop_list.currentText()\n sel...
[ "0.68568325", "0.60774213", "0.5888379", "0.5861923", "0.58271545", "0.58136475", "0.5812446", "0.5806612", "0.57657135", "0.5717081", "0.5715121", "0.57071674", "0.5697722", "0.5621315", "0.5606508", "0.5528312", "0.55264795", "0.54878163", "0.54593533", "0.5439747", "0.5436...
0.5340307
28
Sending request to server to go south.
def south(self): self.send("south") msg = self.recv() return [msg.get(0), msg.get(1), msg.get(2)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_request(self):\n route_chosen = self.comboBox_route_list.currentText()\n route_id = route_chosen.split(',')[0] #to get the id of the route\n trip_headsign_chosen = self.comboBox_trip_headsign_list.currentText()\n stop_chosen = self.comboBox_stop_list.currentText()\n sel...
[ "0.600601", "0.5746862", "0.5328608", "0.5302231", "0.5262662", "0.523163", "0.5223088", "0.52230334", "0.5204523", "0.51989526", "0.51729643", "0.5167329", "0.51483107", "0.5123291", "0.50991184", "0.50874394", "0.5070086", "0.5035433", "0.50285786", "0.50116074", "0.4985136...
0.52593195
5
Sending request to server to go east.
def east(self): self.send("east") msg = self.recv() return [msg.get(0), msg.get(1), msg.get(2)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_request(self):\n route_chosen = self.comboBox_route_list.currentText()\n route_id = route_chosen.split(',')[0] #to get the id of the route\n trip_headsign_chosen = self.comboBox_trip_headsign_list.currentText()\n stop_chosen = self.comboBox_stop_list.currentText()\n sel...
[ "0.6274922", "0.5875293", "0.5605408", "0.5532936", "0.54392785", "0.535141", "0.5335515", "0.53249854", "0.53071964", "0.52963245", "0.52826065", "0.52774185", "0.5245262", "0.5241447", "0.52274114", "0.5207281", "0.5201629", "0.5138268", "0.5125515", "0.510253", "0.5096249"...
0.55065286
4
Sending request to server to go west.
def west(self): self.send("west") msg = self.recv() return [msg.get(0), msg.get(1), msg.get(2)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_request(self):\n route_chosen = self.comboBox_route_list.currentText()\n route_id = route_chosen.split(',')[0] #to get the id of the route\n trip_headsign_chosen = self.comboBox_trip_headsign_list.currentText()\n stop_chosen = self.comboBox_stop_list.currentText()\n sel...
[ "0.6707941", "0.62575036", "0.60849", "0.5973586", "0.5947263", "0.59331524", "0.5829443", "0.57833195", "0.57456744", "0.571326", "0.570843", "0.56466776", "0.5621991", "0.562119", "0.5541215", "0.5491085", "0.5484851", "0.5437864", "0.5435183", "0.5387633", "0.5369891", "...
0.5426729
19
Sending request to server to look around. Recieves status of adjacent tiles from server.
def look(self): self.send("look") msg = self.recv() msg_tokens = [] tiles = [] for i in range(msg.size()): msg_tokens.append(msg.get(i)) for tok in msg_tokens: tiles.append(tok.split("|")) return tiles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_status(request):\n raw_data = request.raw_post_data\n logging.info(\"isrproxy update_status: %s\" % raw_data)\n\n update_status_data = simplejson.loads(raw_data)\n\n # redirect update to dev server in production environment\n if update_status_data.get('Operator_ID') == WB_DEV_OPERATOR_ID ...
[ "0.5576414", "0.5564557", "0.55327535", "0.54753107", "0.5401497", "0.5369825", "0.52473956", "0.5235013", "0.52159554", "0.5207385", "0.5200553", "0.5155084", "0.5091361", "0.507583", "0.50586957", "0.505842", "0.5037245", "0.5036804", "0.50064236", "0.49962437", "0.49942917...
0.0
-1
Sending request to disarm an adjacent trap.
def disarm(self, direction): self.send("disarm " + direction) msg = self.recv() return msg.get(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disassociation_from_ap(self):\n # send disassociation\n self.ap1.tx_msdu(da=self.host.macaddr, body=wifi.disassociation(), \n fctl=wifi.fctl_disassociation)\n \n # expect a deauth frame\n mpdu = self.ap1.rx_mpdu(wifi.AIR_MGMT)\n \n # sanity ch...
[ "0.5579351", "0.55666995", "0.53452766", "0.531071", "0.5253965", "0.52062815", "0.5178076", "0.51533264", "0.5106116", "0.50844777", "0.5076529", "0.5076529", "0.5076118", "0.5061429", "0.5057326", "0.5043118", "0.5009013", "0.4985737", "0.49818358", "0.49659583", "0.4953678...
0.6480957
0
Sends the given operation to the server.
def send(self, op): tokens = op.split() msg = message() for token in tokens: msg.add(token) self.pb.send(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_operation(self):\n operation = self.inputs['operation']\n res = self.entity.do_operation(self.context, **self.inputs)\n if res:\n return self.RES_OK, \"Node operation '%s' succeeded.\" % operation\n else:\n return self.RES_ERROR, \"Node operation '%s' failed...
[ "0.65273005", "0.65004045", "0.6436639", "0.6344679", "0.62421525", "0.61538506", "0.6068884", "0.6068392", "0.6000146", "0.5946958", "0.5913439", "0.5902766", "0.58820164", "0.58820164", "0.5862677", "0.5844414", "0.5798752", "0.5796108", "0.5752205", "0.5738845", "0.5728808...
0.6920459
0
Recieves a response from the server.
def recv(self): msg = self.pb.recv() if msg.get(0) == "timeout": print "You failed to find Toby before the time ran out!" self.cleanup() elif msg.get(0) == "toby": print "You found Toby. Good job!" self.cleanup() elif msg.get(0) == "dead": print "You died!" self.cleanup() return msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive_response(self):\n return self.socket.receive()", "def get_response(command):\n connection = get_client()\n\n connection.send(command)\n\n data = connection.recv()\n connection.close()\n\n return data", "async def recv(self):\n return await self.receptor.response_queue.g...
[ "0.7011037", "0.6589897", "0.6541744", "0.65120596", "0.6485724", "0.64145404", "0.636809", "0.6295736", "0.6292598", "0.62294203", "0.6223843", "0.62168163", "0.6214169", "0.6213474", "0.61884505", "0.616017", "0.609996", "0.6066863", "0.6066863", "0.6059501", "0.6054074", ...
0.0
-1
Close connections and notify server that session is over.
def cleanup(self): self.pb.cleanup() sys.exit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_close(self):\n\t\tpass", "def handle_close(self):\n LOGGER.debug(\"server closed\")\n self.clear()\n data = {}\n self.update_notify_state(data, STAGE_SERVER_UNCONNECTED)\n self.close()\n\n # close all and restart\n asyncore.close_all()", "def close_co...
[ "0.7452282", "0.73618275", "0.72769415", "0.7209967", "0.717841", "0.71199244", "0.71067214", "0.7071134", "0.7059105", "0.70334625", "0.7006491", "0.7002468", "0.6992781", "0.6979551", "0.6966999", "0.6948275", "0.6938148", "0.69095916", "0.690229", "0.69008005", "0.68724394...
0.0
-1
Scheduler a model defined in OpenAPI
def __init__(self, type=None, metadata=None): # noqa: E501 self.openapi_types = {"type": str, "metadata": Metadata} self.attribute_map = {"type": "type", "metadata": "metadata"} self._type = type self._metadata = metadata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> \"Scheduler\":\n return util.deserialize_model(dikt, cls)", "def dynamic_import_scheduler(module):\n model_class = dynamic_import(module, SCHEDULER_DICT)\n assert issubclass(\n model_class, SchedulerInterface\n ), f\"{module} does not implement SchedulerInterfac...
[ "0.56897783", "0.5681567", "0.5592761", "0.54756105", "0.54454046", "0.54212445", "0.5406241", "0.53492516", "0.5316051", "0.5295895", "0.5273675", "0.5245985", "0.52314985", "0.5217647", "0.5206941", "0.52057344", "0.51626253", "0.5124587", "0.512223", "0.51163745", "0.51105...
0.0
-1
Returns the dict as a model
def from_dict(cls, dikt) -> "Scheduler": return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'ModelClass':\n return util.deserialize_model(dikt, cls)", "def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())", "def from_dict(cls, dikt):\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, ...
[ "0.6939894", "0.68444926", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.6739522", "0.6698291", "0.6698291", "0.66464084", "0.66383654", "0.66022646", "0.660082", "0.65999925", "0.6593835", "0.6580194", "0.65621036", "0.64150435", "0.6...
0.0
-1
Gets the type of this Scheduler.
def type(self): return self._type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_type(self):\n return self._schedule_type", "def get_type(self):\n return self._TYPE", "def get_type (self):\n return self._stype", "def get_type(self):\n return self._type", "def get_type(self):\n return self._type", "def get_type(self):\n return sel...
[ "0.8195117", "0.71118546", "0.71044254", "0.70377827", "0.70377827", "0.7005059", "0.698471", "0.6981658", "0.6981658", "0.6939486", "0.69035137", "0.6889826", "0.68877524", "0.68441236", "0.6835996", "0.6827982", "0.6810675", "0.68067247", "0.6794449", "0.67832", "0.6767924"...
0.69478595
27
Sets the type of this Scheduler.
def type(self, type): if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 self._type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_type(self, schedule_type):\n\n self._schedule_type = schedule_type", "def schedule_type(self, schedule_type):\n\n self._schedule_type = schedule_type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self...
[ "0.80057335", "0.80057335", "0.75507337", "0.75507337", "0.7483278", "0.7115609", "0.7019111", "0.70181847", "0.69953287", "0.6979536", "0.6979536", "0.695165", "0.695165", "0.69398105", "0.69398105", "0.69398105", "0.69398105", "0.69398105", "0.69398105", "0.69398105", "0.69...
0.6880235
43
Gets the metadata of this Scheduler.
def metadata(self): return self._metadata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metadata(self):\n return self.manager.get_metadata(self)", "def get_metadata(self):\n return self._metadata", "def metadata(self):\n return self.meta.metadata", "def metadata(self):\r\n return self._metadata", "def get(self):\n return self._metadata", "def get_s...
[ "0.71406114", "0.70414925", "0.6984677", "0.6975013", "0.69092923", "0.6902686", "0.6902265", "0.6890652", "0.68209904", "0.6809682", "0.6779367", "0.6746391", "0.6677705", "0.6677705", "0.6659976", "0.664664", "0.664664", "0.66246855", "0.6524459", "0.6507235", "0.6486973", ...
0.7021962
6
Sets the metadata of this Scheduler.
def metadata(self, metadata): self._metadata = metadata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_metadata(self, metadata):\n return self.manager.set_metadata(self, metadata)", "def set_metadata(self, metadata):\n return self.manager.set_metadata(self, metadata)", "def set_metadata(self, metadata):\n self.metadata = metadata\n return self", "def metadata(self, metadata...
[ "0.7284354", "0.7284354", "0.72251797", "0.6924326", "0.6924326", "0.6912875", "0.65728146", "0.65576124", "0.6509923", "0.64945316", "0.63769543", "0.63764304", "0.6335112", "0.6334947", "0.63345087", "0.63050437", "0.6295306", "0.6257091", "0.6245504", "0.6149908", "0.61499...
0.7268934
8
Simple animation of the wave advecting ...
def animate(x,y,title=None,step=None,pause=0.001): plt.clf() if step is not None and title is not None: plt.title("%s (Step %d)" %(title,step)) plt.plot(x,y) plt.draw() plt.pause(pause) plt.show(block=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def animatevelocity(j):\n i = j/v_intervals\n uanim.set_data(x, u[j])\n massanim.set_data(t[:j], mass[:j])\n vanim.set_data(v_times[:i], velocity[:i])\n ampanim.set_data(t[:j], amplitudes[:j])\n #txt1.set_text(\"j = %s\" %j)\n if j > stop1:\n wave1.set_data(x, u[stop1])\n if j > stop...
[ "0.63495135", "0.6196701", "0.61764556", "0.6165962", "0.6140859", "0.604862", "0.588793", "0.5788353", "0.5768238", "0.57620364", "0.57617486", "0.5733577", "0.5728057", "0.5728057", "0.57244307", "0.5708346", "0.57071495", "0.5693935", "0.5686925", "0.56790626", "0.565908",...
0.5371441
50
Shift perfectly, no calculations of y; just y(n) > y((n+1)%L) (basically a rotateright) ... just for reference
def perfect_shift(y): return np.append([y[-1]],y[0:-1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift(image,shift_x,shift_y):\n return np.roll(np.roll(image,shift_y,axis=0),shift_x,axis=1)", "def lrshift(val, n) -> np.int64:\n return (val % (1 << 64)) >> n", "def _shift(self, s):\n start_pos = self._relative_head_pos()\n l = 1 + 2 * self.shift_length\n shift = int(s * l - 0...
[ "0.67403364", "0.6632031", "0.6628545", "0.6394657", "0.61860895", "0.61860895", "0.61860895", "0.61860895", "0.6110119", "0.606753", "0.59852594", "0.59837425", "0.5971836", "0.5950179", "0.5943645", "0.5943645", "0.58661544", "0.5860182", "0.5842202", "0.58294725", "0.58097...
0.6870793
0
Advance 1 step using Forwardtime, Centeredspace
def ftcs(_x,_y,_cs,_dx,_dt): #todo: in a loop ... think about a more pythonic way to do this # s = _cs * _dt / (2. * _dx) # next_y = np.zeros(np.shape(_y)) #next time step # nLen = len(_y) # for n in range(nLen): # n_next = (n + 1) if n < (nLen-1) else 0 # n_prev = (n - 1) if n > 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def advance(self): \n self.center.x = self.center.x + self.velocity.dx\n self.center.y = self.center.y + self.velocity.dy", "def Advance():\n warp.step()", "def step_forward(self):", "def _forward_kinematics_step(self, t_step):\n (s_1, s_12, s_123) = self._sines\n (c_1, c_12...
[ "0.6634304", "0.6587821", "0.6553405", "0.625148", "0.62141305", "0.6194353", "0.6151987", "0.61328804", "0.6068492", "0.60640913", "0.60591906", "0.6024224", "0.60145533", "0.598659", "0.59727436", "0.59276134", "0.59168255", "0.59158915", "0.5887274", "0.5885864", "0.584553...
0.0
-1
Advance 1 step using Lax
def lax(_x,_y,_cs,_dx,_dt): s = _cs * _dt / (2. * _dx) next_y = 0.5 *(np.append(_y[1:], _y[0]) + np.append(_y[-1], _y[:-1])) \ - s * (np.append(_y[1:], _y[0]) - np.append(_y[-1], _y[:-1])) return next_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _advance(self):\t\t# override inherited version\n self._current *= self._base", "def _advance(self):\n self._current += 1", "def step_forward(self):", "def forward(self, x):\n return self.l1(x)", "def _advance(self):\n self._prev, self._current = self._current, self._prev + ...
[ "0.65308684", "0.64072937", "0.6387594", "0.6321694", "0.631977", "0.6288484", "0.61668223", "0.6070409", "0.6040912", "0.6014779", "0.59810954", "0.5952722", "0.59403884", "0.58998656", "0.58883333", "0.58578897", "0.58270264", "0.5812622", "0.58045393", "0.5791352", "0.5787...
0.0
-1
Advance 1 step using LaxWendroff
def lax_wen(_x,_y,_cs,_dx,_dt): s = _cs * _dt / (2. * _dx) s2 = (_cs**2.) * (_dt**2.) / (2. * (_dx**2.)) next_y = _y[:] - s*(np.append(_y[1:], _y[0]) - np.append(_y[-1], _y[:-1])) \ + s2*(np.append(_y[1:], _y[0]) + np.append(_y[-1], _y[:-1]) - 2*_y[:]) return next_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _advance(self):\n self._current += 1", "def _advance(self):\t\t# override inherited version\n self._current *= self._base", "def _advance(self):\n self._prev, self._current = self._current, self._prev + self._current", "def step_forward(self):", "def step1ab(self):\n\t\tif self.b[s...
[ "0.6488334", "0.6316092", "0.6051661", "0.6036867", "0.6003655", "0.5999034", "0.59847456", "0.59441745", "0.5922006", "0.58752036", "0.5836568", "0.58160806", "0.5786469", "0.5781549", "0.5757453", "0.57362497", "0.5721856", "0.5717035", "0.5706227", "0.5685344", "0.56851834...
0.0
-1
Fills the template of python configuration file for datacard preparation
def createCfg_prep_dcard(self, jobOptions): category_output = self.channel if jobOptions['label']: category_output += "_%s" % jobOptions['label'] lines = [] lines.append("process.fwliteInput.fileNames = cms.vstring('%s')" % jobOptions['inputFile']) lines.append("process.fwliteOutput.fileName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_config(container_data, file_path):\n pass", "def _init_config(self):\n self.config = self.config_template.specialize()\n print('MMH CONFIG:\\n' + str(self.config))", "def config():\n file_path = None # path to the input file\n db_path = None # path to the output db\n ...
[ "0.67815447", "0.66767985", "0.65957564", "0.6537106", "0.6500459", "0.6379473", "0.6368642", "0.6317948", "0.6295786", "0.6284518", "0.62698406", "0.6262515", "0.6262515", "0.6257156", "0.62318164", "0.62216794", "0.62152416", "0.62152135", "0.6213334", "0.6205779", "0.62026...
0.6349458
7
I'm the a property.
def a(self): return self._a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def property( self, prop ):\n raise NotImplementedError(\"property\")", "def property(self, p_int): # real signature unknown; restored from __doc__\n pass", "def _property(attr):\n name = '_' + attr\n @property\n def prop(self):\n \"\"\"Get the specific attribute.\"\"\"\n r...
[ "0.7833885", "0.7020226", "0.6798755", "0.6784938", "0.67531514", "0.6735335", "0.672958", "0.672958", "0.672958", "0.6631659", "0.66263175", "0.658225", "0.64780694", "0.6433763", "0.6425462", "0.6395595", "0.6384428", "0.6369832", "0.63278943", "0.6311077", "0.62527674", ...
0.0
-1
I'm the e property.
def e(self): return self._e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_E(self):\r\n return self.E", "def e(self, e):\n\n self._e = e", "def get_E(self):\n return self.E", "def E(self):\n return self._properties['E']", "def E(self):\n return self._E", "def E(self):\n return self._E", "def ehandle(self):\n return self._eh...
[ "0.74820995", "0.7460332", "0.73928255", "0.72371143", "0.71522623", "0.71522623", "0.6508572", "0.6490028", "0.6425671", "0.6375467", "0.6284834", "0.6227812", "0.6227812", "0.62267196", "0.6221513", "0.6193148", "0.60434306", "0.5989004", "0.5946854", "0.5887836", "0.584394...
0.8164787
0
I'm the inc property.
def inc(self): return self._inc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inc(self):\n self._value += 1", "def increment(self):\r\n return self.add(1)", "def increment(self) -> global___Expression:", "def increment_counter(self) -> None:", "def _modifyProperty(self,dec):\n pass", "def incr_operand(self):\n pass", "def get_inc(self):\n retur...
[ "0.69979954", "0.6902046", "0.6662313", "0.66253597", "0.6607319", "0.6580319", "0.65539956", "0.65401846", "0.65195906", "0.6515084", "0.6501719", "0.63391596", "0.63147354", "0.6312719", "0.6285045", "0.6224541", "0.6216525", "0.6214255", "0.62074393", "0.6182061", "0.61629...
0.77464503
0
I'm the Om property.
def Om(self): return self._Om
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def om(self):\n return self._om", "def moi(self):\n\n pass", "def get_o(self):\n return self.o", "def property(self, p_int): # real signature unknown; restored from __doc__\n pass", "def _showProperty(self):\n pass", "def property( self, prop ):\n raise NotImplem...
[ "0.7130849", "0.60610646", "0.59436876", "0.59310603", "0.5916612", "0.58097064", "0.5673482", "0.5673482", "0.5673482", "0.54857105", "0.54576874", "0.5444633", "0.54392326", "0.5419425", "0.53296006", "0.5305579", "0.5263575", "0.52366114", "0.52342314", "0.5233221", "0.520...
0.7669906
0
I'm the om property.
def om(self): return self._om
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Om(self):\n return self._Om", "def moi(self):\n\n pass", "def property( self, prop ):\n raise NotImplementedError(\"property\")", "def get_o(self):\n return self.o", "def property(self, p_int): # real signature unknown; restored from __doc__\n pass", "def properties...
[ "0.7034278", "0.63692933", "0.6175412", "0.61665934", "0.61052203", "0.591592", "0.591592", "0.591592", "0.59120154", "0.58743906", "0.58643997", "0.5859979", "0.5732439", "0.56568724", "0.559987", "0.5554393", "0.5553714", "0.55381227", "0.54483944", "0.5425846", "0.54186624...
0.7430322
0
I'm the H property.
def H(self): return self._H
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def h(self) -> float:\n return self._h", "def h(self): # pylint: disable=invalid-name\n return self._h", "def is_H(self):\n return True", "def is_H(self):\n return True", "def h(self):\n return self._h", "def update_H(self):", "def get_h0(self, t):\n return se...
[ "0.73934793", "0.71388894", "0.710541", "0.710541", "0.6980057", "0.6904231", "0.6783644", "0.6776315", "0.674058", "0.6728726", "0.6598538", "0.6571018", "0.65669626", "0.6494272", "0.6486298", "0.6455249", "0.642911", "0.6422516", "0.6390683", "0.63494384", "0.6303365", "...
0.78022635
0
I'm the epoch property.
def epoch(self): return self._epoch
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def epoch(self):\n return _coordsys.coordsys_epoch(self)", "def set_epoch(self, epoch):\r\n pass", "def epoch():\n\treturn time.time()", "def epoch():\n return datetime2epoch(datetime.now())", "def GetEpoch(self):\n return _gmat_py.Attitude_GetEpoch(self)", "def cur_epoch(self):\n...
[ "0.7948318", "0.7636237", "0.7558367", "0.75083977", "0.7421768", "0.7372495", "0.7297328", "0.7210528", "0.70881516", "0.6936589", "0.6905358", "0.68977195", "0.6741958", "0.66929716", "0.66661257", "0.666138", "0.66086245", "0.6600611", "0.6585031", "0.65276086", "0.6485145...
0.83609456
0
I'm the epoch_M property.
def epoch_M(self): return self._epoch_M
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def epoch(self):\n return self._epoch", "def set_epoch(self, epoch):\r\n pass", "def epoch(self):\n return _coordsys.coordsys_epoch(self)", "def GetEpoch(self):\n return _gmat_py.Attitude_GetEpoch(self)", "def epoch():\n\treturn time.time()", "def epoch_detail(self):\n ...
[ "0.74173445", "0.6983966", "0.69142866", "0.6853805", "0.659223", "0.6501514", "0.6478274", "0.62859935", "0.62701535", "0.62441427", "0.62349266", "0.6152219", "0.60909456", "0.5969186", "0.5957573", "0.5929347", "0.5902148", "0.58972347", "0.586194", "0.58306897", "0.581658...
0.8976243
0
I'm the M property.
def M(self): return self._M
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def M(self):\n return self._properties['M']", "def getM(self):\r\n return self.M", "def moi(self):\n\n pass", "def get_m1(self):\n\n pass", "def M(self) -> int:\n return self.params.M", "def Mxy(self):\n return self.Mx.My", "def get_M(self):\n return 1.0...
[ "0.79089844", "0.74489814", "0.6702801", "0.6698779", "0.65353805", "0.63709855", "0.63307273", "0.62976044", "0.62114793", "0.6201829", "0.6127184", "0.61061794", "0.60908824", "0.60109353", "0.5946789", "0.5889533", "0.5845052", "0.5767508", "0.5726675", "0.5717197", "0.570...
0.706804
2
Print the current orbital parameters a, e, inc, argperi, capom, H
def __str__(self): status = ("\na: %.2f \n" % self.a + "e: %.2f \n" % self.e + "inc: %.2f deg \n" % (self.inc * 180/math.pi) + "om: %.2f deg \n" % (self.om * 180/math.pi) + "Om: %.2f deg \n" % (self.Om * 180/math.pi) + "H:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_parameters(self):\n with np.printoptions(precision=3, suppress=True):\n print('number of wind phase = {}'.format(self.ncomp))\n print('galactic parameter = {}'.format(self.scaling_field))\n print('reference height = {}'.format(self.z0))\n for p in ['cool_...
[ "0.701719", "0.69558907", "0.6840527", "0.62526584", "0.6218964", "0.6205169", "0.6191117", "0.61182123", "0.6115266", "0.6083515", "0.6077989", "0.60738575", "0.6051088", "0.60151744", "0.600268", "0.5972984", "0.59588736", "0.59405583", "0.5915042", "0.5900441", "0.58979195...
0.0
-1
Compute and assign and Hmagnitude from a socalled singlE powerlaw, knee, or divot Hmagnitude distribution. When provided a slope alpha and a faintside maximum Hmagnitude (hmax), a Hmagnitude is drawn randomly from the distribution dN/dH propto 10(alpha H) in the range hmin = 1 to hmax. Specify hmin to change the bright...
def drawH(self, alpha, hmax, alpha_faint=None, contrast=1, hbreak=None, hmin=1): # Avoid singularity for alpha = 0 alpha = 0.0000000001 if alpha == 0 else alpha # Set alpha_faint to alpha for the case of a single power-law alpha_faint = alpha if alpha_faint is None else al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_height_fwhm_calculation(peakdata):\n # mu = 0\n # variance = 1.0\n # sigma = np.sqrt(variance)\n # x = np.linspace(mu - 20*sigma, mu + 20*sigma, 100.0)\n # y = norm.pdf(x, mu, 1)\n x = peakdata[0]\n y = peakdata[1]\n check_height_fwhm(x, y, lineshapes.voigt, models.VoigtModel())\n ...
[ "0.57013035", "0.561052", "0.5579129", "0.55207247", "0.548725", "0.54475385", "0.537149", "0.5325857", "0.5278528", "0.5268215", "0.52665937", "0.52601075", "0.5251945", "0.52324474", "0.5193713", "0.5178757", "0.5177294", "0.51746935", "0.5156782", "0.51521426", "0.51354307...
0.761445
0
Perturb (fuzz) semimajor axis randomly by up to + percent specified Input is treated as percentage if type is not specified as 'abs'. If type = 'abs', a will be changed randomly by + amount specified. The first argument is a string containing the variable to be fuzzed. The appropriate options are 'a', 'e', 'inc', 'Om',...
def fuzz(self, variable, fz, type=None): # Check to see if the attribute exists, if so get the value if not hasattr(self, variable): raise ValueError("You tried to fuzz a parameter that does not exit") var = getattr(self, variable) # if variable is an angle, treat it properly...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def defuzzification(self):\n self.price = fuzz.defuzz(self.psf,self.fuzzy_output, 'som')", "def main():\r\n _evaluative_test(5)\r\n _fuzz_test(1)\r\n _fuzz_test(1, 512)\r\n _fuzz_test(1, 1512)\r\n _fuzz_test(1000)\r\n _fuzz_test(1000, 512)\r\n _fuzz_test(1000, 4077)", "def fuzz():\n...
[ "0.5732995", "0.55186677", "0.5119221", "0.50102854", "0.49203992", "0.48581415", "0.4821607", "0.48188433", "0.47911242", "0.4722664", "0.4682123", "0.4677746", "0.4645468", "0.46381727", "0.4637192", "0.46334326", "0.45095548", "0.450736", "0.44810542", "0.44614375", "0.442...
0.73384976
0
Determines smallest number divisible by all numbers 1 to x.
def smallestMultiple(x): ans = 1 for prime in xprime(x): ans *= prime**int(log(x, prime)) return ans
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smallest_number_divisible(n):\n\tprime_numbers = generate_prime_less_than_n(n)\n\tlog_n = math.log(n)\n\tres = 1\n\tfor pi in prime_numbers:\n\t\tres *= math.pow(pi, math.floor(log_n/math.log(pi)))\n\treturn res", "def finddiv(x):\r\n \r\n div = (1, x)\r\n for i in range(2, x//2+1):\r\n if x%...
[ "0.76617324", "0.74890375", "0.708696", "0.70112544", "0.6964907", "0.69107777", "0.6902035", "0.68590194", "0.68404037", "0.683988", "0.67654645", "0.6758752", "0.6721042", "0.67108655", "0.66632086", "0.65752566", "0.65006626", "0.64714175", "0.64620346", "0.64505184", "0.6...
0.7994635
0
Modify a python object that supports the buffer interface internally. This is useful for testing things like socket.recv_into() dest_buffer must be smaller than source_buffer, or the code will assert.
def modify_buffer_object(source_buffer, dest_buffer, nbytes=None): assert len(source_buffer) <= len(dest_buffer) copy_len = len(source_buffer) if nbytes is None else min(nbytes, source_buffer) buffer_ptr = (ctypes.c_byte * len(dest_buffer)).from_buffer(dest_buffer) new_value_ptr = (ctypes.c_byte * len(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tobuffer(self, object_):\n\n raise NotImplementedError", "def use_buffer(self, buffer_size):\n self.__buffer_size = buffer_size\n if self.__buffer is None:\n self.__buffer = []", "def swap_buffers(self):\n raise NotImplementedError()", "def _read_into_buffer(self):...
[ "0.71334606", "0.632377", "0.62844825", "0.6151401", "0.61270875", "0.61198306", "0.61197627", "0.602732", "0.594199", "0.5892748", "0.5892748", "0.5892748", "0.5828508", "0.5773723", "0.5754132", "0.5739361", "0.5726852", "0.5726852", "0.5720015", "0.571318", "0.568297", "...
0.78256
0
Await a condition function to return True, otherwise raise an AssertionError if the condition did not return True within the alloted time.
def await_condition(description, condition_eval_callable, on_failure=lambda: True, timeout=10, poll_s=0.1): start_time = time.time() def should_continue(): return time.time() - start_time < timeout while not condition_eval_callable(): if not should_continue(): on_failure() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def await_condition(condition, timeout=2000):\n\n for _ in range(timeout):\n if condition():\n return True\n time.sleep(0.001)\n return False", "def until_true(condition, timeout, error_msg):\n timeout = timestr_to_secs(timeout)\n max_wait = time.time() + timeout\n ...
[ "0.7560678", "0.72292703", "0.7114256", "0.7015878", "0.69801235", "0.69610274", "0.6899991", "0.6843958", "0.6793191", "0.6574894", "0.6491553", "0.64850456", "0.6315587", "0.6235223", "0.61285186", "0.6070208", "0.6060411", "0.60604", "0.6031214", "0.6023985", "0.6023985", ...
0.7275414
1
Return the density of states in a 1D array (according to get_frequencies())
def get_dos(self): return self.get_array('dos')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def density(self):\r\n return self.count_ones() / float(self.xspan * self.yspan)", "def density(self):\n return self.nnz/self.dim", "def counts_to_density(\n x: Union[_cpp.DataArray, _cpp.Dataset], dim: str\n) -> Union[_cpp.DataArray, _cpp.Dataset]:\n return _call_cpp_func(_cpp.counts_to_densit...
[ "0.67306876", "0.6545734", "0.652916", "0.6466963", "0.64478296", "0.63397855", "0.63013804", "0.6270028", "0.614507", "0.60950315", "0.60252184", "0.5969756", "0.59521574", "0.592468", "0.59091216", "0.58831763", "0.5864672", "0.58550507", "0.58550507", "0.58550507", "0.5813...
0.0
-1
Return the number of atoms (equivalent to the dimension of partial density of states)
def get_number_of_partial_dos(self, full=False): partial_dos = self.get_array('partial_dos') if full: return len(partial_dos) return len(partial_dos[self._get_equivalent_atom_list()])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numAtoms(self):\n return self.nAtoms", "def size(self):\r\n return len(atoms)", "def get_number_of_atoms_to_optimize(self):\n v = self.c.get(simulation_cell=True)\n return len(v.data.stoichiometry)", "def natoms(self):\n return len(self.atoms)", "def num_atoms(self):\...
[ "0.7615236", "0.7479874", "0.7446102", "0.7385822", "0.73555297", "0.7247755", "0.7196846", "0.71780443", "0.7173893", "0.7165874", "0.7159424", "0.71553284", "0.7118576", "0.7118576", "0.70925087", "0.7039619", "0.70308644", "0.70176536", "0.6989161", "0.6988811", "0.6936567...
0.0
-1
Return the partial density of states
def get_partial_dos(self, full=False): partial_dos = self.get_array('partial_dos') if full: return partial_dos indices, weights = self._get_equivalent_atom_list(with_weights=True) partial_dos = [partial * weight for weight, partial in zip(weights, partial_dos[indices])] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def density(self):\r\n return self.count_ones() / float(self.xspan * self.yspan)", "def getDensityOfStates(self, Elist):\n\t\treturn _modes.freerotor_densityofstates(Elist, self.frequencies, 1 if self.linear else 0)", "def getDensityOfStates(self, Elist):\n\t\tpass", "def getDensityOfStates(self, Elist):\...
[ "0.6990002", "0.68468076", "0.6540495", "0.64641935", "0.64567894", "0.6429281", "0.6427787", "0.6427787", "0.6427787", "0.6426647", "0.6402431", "0.6341133", "0.633433", "0.6293956", "0.62743706", "0.62305063", "0.61604667", "0.6110642", "0.6062941", "0.6012021", "0.5964267"...
0.0
-1
Return the corresponding frequencies to get_dos() and get_partial_dos()
def get_frequencies(self): return self.get_array('frequencies')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frequency(self):\r\n # print '*********in get freq'\r\n self.cntr.run('FREQ 1')\r\n f_0_ = self.cntr.get_measurements(1)\r\n self.f_0 = f_0_[0]\r\n self.cntr.run('FREQ 2')\r\n f_rep_ = self.cntr.get_measurements(1)\r\n self.f_rep = f_rep_[0]", "def get_cw_...
[ "0.6753553", "0.6381248", "0.63641745", "0.6289217", "0.6214848", "0.61800855", "0.616702", "0.6142434", "0.60968804", "0.6092314", "0.6045899", "0.6002879", "0.59977996", "0.5992096", "0.5984933", "0.59689164", "0.596595", "0.5947886", "0.59470624", "0.59387994", "0.59163076...
0.59397584
19
Store the atomic symbols as a numpy array.
def get_atom_labels(self, full=False): import numpy labels = self.get_attr("atom_labels") if full: return labels return numpy.array(labels)[self._get_equivalent_atom_list()].tolist()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _raw_to_arrays(self):\n self.update_geometry()\n if isinstance(self, Molecule):\n # normal qcdb.Molecule\n geom = self.geometry(np_out=True)\n else:\n # psi4.core.Molecule\n geom = np.array(self.geometry())\n mass = np.asarray([self.mass(a...
[ "0.64369416", "0.6005739", "0.5834887", "0.56393343", "0.5608841", "0.5587981", "0.5584245", "0.5577252", "0.55483854", "0.5543307", "0.55303025", "0.54635966", "0.5408", "0.5402539", "0.5385811", "0.53760046", "0.53566366", "0.53395516", "0.53386134", "0.53217524", "0.532157...
0.0
-1
Store the phonon dos as a numpy array
def set_atom_labels(self, labels): self.set_attribute("atom_labels", labels)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_numpy_array(self):\n np.save(\"smallest_particles.npy\", self.smallest_particles)\n np.save(\"number_counts.npy\", self.number_counts)\n np.save(\"number_counts_2.npy\", self.number_counts_2)", "def to_array(self, normalize: bool = True) -> jnp.ndarray:\n return NotImplemente...
[ "0.57991946", "0.5630915", "0.56130564", "0.5575848", "0.5575372", "0.5550803", "0.5545238", "0.5543249", "0.5534787", "0.5514769", "0.54567087", "0.5446889", "0.5446504", "0.5414669", "0.5401872", "0.53778", "0.537432", "0.53715014", "0.53292847", "0.53037775", "0.5284815", ...
0.0
-1
Store the phonon dos as a numpy array
def set_dos(self, array): self.set_array('dos', array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_numpy_array(self):\n np.save(\"smallest_particles.npy\", self.smallest_particles)\n np.save(\"number_counts.npy\", self.number_counts)\n np.save(\"number_counts_2.npy\", self.number_counts_2)", "def to_array(self, normalize: bool = True) -> jnp.ndarray:\n return NotImplemente...
[ "0.5800146", "0.5632037", "0.5612084", "0.55791765", "0.5577007", "0.5552041", "0.55471516", "0.5545793", "0.5535587", "0.5516911", "0.5459809", "0.54493976", "0.5447765", "0.5417437", "0.54042953", "0.5378878", "0.5376346", "0.53732157", "0.53298765", "0.5306282", "0.5282699...
0.5284786
20
Store the frequencies as a numpy array
def set_frequencies(self, array): self.set_array('frequencies', array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frequencies(self):\n\n return self.get_array('frequencies')", "def get_frequency_array(self):\n\t\treturn np.logspace(np.log10(self.converted_range[0]), np.log10(\n\t\t\tself.converted_range[1]), num=129)[:self.maximum_frequency]", "def as_counts_array(counts):\n if isinstance(counts, (Mappin...
[ "0.74099725", "0.7206024", "0.70724887", "0.70608664", "0.67623717", "0.67613375", "0.6740164", "0.673538", "0.673538", "0.6565815", "0.65468955", "0.64563775", "0.6386303", "0.63798875", "0.63664573", "0.63525856", "0.63240004", "0.6315427", "0.6312897", "0.62865484", "0.622...
0.6563629
10
Store the partial dos as a numpy array
def set_partial_dos(self, array): self.set_array('partial_dos', array) self.set_attribute("n_partial_dos", len(array))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_fits_array(self):\n return self.data", "def array(self):", "def make_data(self): \n s = numpy.arange(0.0, 10.0, 0.01)\n s = numpy.reshape(s, (10,10,10))\n s = numpy.transpose(s)\n\n v = numpy.zeros(3000, 'd')\n v[1::3] = 1.0\n v = numpy.reshape(v, ...
[ "0.58784777", "0.58602244", "0.56124526", "0.56086195", "0.55979156", "0.55947816", "0.55429274", "0.5539849", "0.55386084", "0.5537771", "0.5529546", "0.5492652", "0.5482164", "0.54607034", "0.541553", "0.5411863", "0.541172", "0.54034406", "0.54002327", "0.54000807", "0.539...
0.6228336
0
Returns true if no imaginary modes (shown as negative frequency DOS)
def is_stable(self, tol=1e-6): import numpy as np dos = self.get_dos() freq = self.get_frequencies() mask_neg = np.ma.masked_less(freq, 0.0).mask mask_pos = np.ma.masked_greater(freq, 0.0).mask if mask_neg.any() == False: return True if mask_pos.an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_imaginary(self):\r\n return self._real.is_zero()", "def is_imaginary(self) -> bool:\n return self < 0", "def is_real(self):\r\n return self._imag.is_zero()", "def is_isotropic(self):\n return self.fibres is None", "def is_zero(self):\r\n return self._real.is_zero()...
[ "0.7435767", "0.7236454", "0.70290595", "0.677156", "0.6736559", "0.64063257", "0.64053893", "0.6321965", "0.6316691", "0.6256833", "0.620375", "0.615895", "0.61450577", "0.6060106", "0.6021838", "0.60216886", "0.59767884", "0.59512895", "0.5950726", "0.594923", "0.5943724", ...
0.0
-1
_test_mtr_regression This demo demonstrates how to evaluate a MultiTarget Regressor. The employed dataset is 'scm1d', which is contained in the data folder.
def demo(output_file=None): stream = RegressionGenerator(n_samples=5000, n_features=20, n_informative=15, random_state=1, n_targets=7) stream.prepare_for_use() classifier = MultiTargetRegressionHoeffdingTree(leaf_prediction='adaptive') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testRegression(self):\n cont_features = [\n tf.contrib.layers.real_valued_column('feature', dimension=4)]\n\n regressor = tf.contrib.learn.DNNRegressor(feature_columns=cont_features,\n hidden_units=[3, 3])\n\n regressor.fit(input_fn=_iris_input_multi...
[ "0.64248", "0.6264158", "0.6189551", "0.61789185", "0.6148435", "0.60771984", "0.60628456", "0.5992778", "0.59514636", "0.59385335", "0.5908251", "0.5893649", "0.5882528", "0.58807784", "0.5873406", "0.5850031", "0.57582396", "0.5741631", "0.5733211", "0.57257617", "0.5722824...
0.5806374
16
Launch python.exe subprocess which will in turn launch the user's program.
def open(self, cmd, lines, columns, python_exe='python.exe', communicator_py='conque_sole_communicator.py', options={}): self.lines = lines self.columns = columns self.bucket = u('') # create a shm key self.shm_key = 'mk' + str(time.time()) # python command cmd_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Run_command_window(argument):\n if os.name == 'posix':\n argument = argument.replace(\".exe\",\"\")\n os.system(argument)\n\n else:\n startupinfo = subprocess.STARTUPINFO()\n startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW\n\n process = subprocess.Popen(argument,...
[ "0.6752562", "0.6670607", "0.6139621", "0.61282873", "0.6070133", "0.60197455", "0.60073906", "0.60036474", "0.5989704", "0.5966463", "0.58947265", "0.58886284", "0.5873769", "0.58675075", "0.5839422", "0.58391964", "0.5838483", "0.58278173", "0.5817032", "0.58005387", "0.573...
0.0
-1
Read a range of console lines from shared memory. Returns a pair of lists containing the console text and console text attributes.
def read(self, start_line, num_lines, timeout=0): # emulate timeout by sleeping timeout time if timeout > 0: read_timeout = float(timeout) / 1000 #logging.debug("sleep " + str(read_timeout) + " seconds") time.sleep(read_timeout) output = [] attributes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def read_console(self):\n while self.proc is not None and self.proc.poll() is None:\n line = await self.loop.run_in_executor(None, self.proc.stdout.readline) # Async readline\n # Parse the command output and get the time in epoch format\n match = re.match(r'\\[([0-9]{...
[ "0.60659015", "0.5939009", "0.58916974", "0.57521653", "0.56490976", "0.5647062", "0.564037", "0.56112045", "0.5468083", "0.5451037", "0.53977436", "0.5367511", "0.53567046", "0.531081", "0.5267202", "0.5250136", "0.52072364", "0.51704943", "0.51641566", "0.51494616", "0.5137...
0.60982656
0
Return a dictionary with current console cursor and scrolling information.
def get_stats(self): try: rescroll = self.shm_rescroll.read() if rescroll != '' and rescroll != None: logging.debug('cmd found') logging.debug(str(rescroll)) self.shm_rescroll.clear() # close down old memory ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def screen_status(self):\n height, width = self.stdscr.getmaxyx()\n i_start = self.y_start * width + self.x_start\n\n return i_start, height, width", "def get_position():\n return win32api.GetCursorPos()", "def get_cursor(self):\n k, font, txt = self._cursor, self.font, self.txt\...
[ "0.6328449", "0.61619335", "0.6097711", "0.5976729", "0.59197915", "0.5848462", "0.5822547", "0.5798608", "0.5695266", "0.5680687", "0.5673493", "0.5661445", "0.56608653", "0.56183183", "0.55158216", "0.54739004", "0.54739004", "0.54709613", "0.54708505", "0.54678154", "0.546...
0.0
-1
Write input to shared memory.
def write(self, text): self.bucket += text istr = self.shm_input.read() if istr == '': logging.debug('input shm is empty, writing') self.shm_input.write(self.bucket[:500]) self.bucket = self.bucket[500:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_mem(self):\n request = 'commands/writemem'\n return self._post(request)", "def init_shared_memory(self, mem_key):\n\n self.shm_input = ConqueSoleSharedMemory(CONQUE_SOLE_INPUT_SIZE, 'input', mem_key)\n self.shm_input.create('write')\n self.shm_input.clear()\n\n ...
[ "0.60039324", "0.5930608", "0.59300476", "0.59215933", "0.5888126", "0.5880619", "0.5785169", "0.57275254", "0.5707015", "0.56850415", "0.56826055", "0.5598872", "0.5578339", "0.5567999", "0.5565713", "0.5556433", "0.5556433", "0.5539855", "0.5533115", "0.5515601", "0.5509092...
0.6564761
0
Write virtual key code to shared memory using proprietary escape sequences.
def write_vk(self, vk_code): seq = u("\x1b[") + u(str(vk_code)) + u("VK") self.write(seq)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendKeyEventVirtualMachine(self,node,vmid, key):\n post_data = {'key': str(key)}\n data = self.connect('put',\"nodes/%s/qemu/%s/sendkey\" % (node,vmid), post_data)\n return data", "def write_key():\n key = fernet.Fernet.generate_key()\n keyfile = open(KEY_PATH,'wb')\n keyfile.wr...
[ "0.5687842", "0.5372233", "0.53592056", "0.53062105", "0.51792115", "0.5168341", "0.51523745", "0.51337457", "0.51326776", "0.5097107", "0.5078062", "0.5057081", "0.50533074", "0.50469446", "0.50351524", "0.5021595", "0.49984193", "0.49932158", "0.49932158", "0.4989421", "0.4...
0.70451427
0
Write idle command to shared memory block, so subprocess controller can hibernate.
def idle(self): logging.info('writing idle shm') self.shm_command.write({'cmd': 'idle', 'data': {}})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def idle():", "def standby() -> None:", "def idle(self):\n return", "def send_cmd(self, cmd):\n logger.info(\"sending cmd %s to fuse\", cmd)\n with open(self.ipc + \".\" + str(threading.current_thread().ident), 'w', 0) as f:\n #with open(self.ipc, 'a+') as f:\n f.write(...
[ "0.644398", "0.5689538", "0.55050457", "0.5367759", "0.5346736", "0.532258", "0.52653563", "0.52629304", "0.5259209", "0.5252185", "0.52438426", "0.52135015", "0.52101225", "0.51984185", "0.51957124", "0.5160946", "0.51504266", "0.51238734", "0.51017064", "0.509163", "0.50765...
0.8227453
0
Write resume command to shared memory block, so subprocess controller can wake up.
def resume(self): self.shm_command.write({'cmd': 'resume', 'data': {}})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resume(self):\n self.stdin_queue.put(\"resume\")", "def resume(self):\n\t\treturn Job(SDK.PrlVm_Resume(self.handle)[0])", "def resume(self):\n\t\tpass", "def resume(vm='', env=''):\n local( main_dir + '/vagrant/bin/vm.sh resume ' + str(vm) + ' ' + str(env) )", "def resume(self):\n pass",...
[ "0.62004507", "0.6185218", "0.6178511", "0.61511475", "0.6130952", "0.6130952", "0.6130952", "0.6088023", "0.593814", "0.5913175", "0.5753355", "0.57384956", "0.57384956", "0.56370336", "0.561635", "0.561405", "0.5585171", "0.5578812", "0.55781746", "0.55668956", "0.5525529",...
0.7903206
0
Shut it all down.
def close(self): self.shm_command.write({'cmd': 'close', 'data': {}}) time.sleep(0.2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shutdown(self):\n\n pass", "def shutdown(self) -> None:", "def shutdown(self) -> None:", "def shutdown(self):\n pass", "def shutdown(self):\n pass", "def shutdown(self):\n pass", "def shutdown(self):", "def shutdown(self) -> None:\n pass", "def shutdown(self):...
[ "0.817547", "0.8154512", "0.8154512", "0.81257796", "0.81257796", "0.81257796", "0.8089488", "0.79877144", "0.797899", "0.7859694", "0.77252233", "0.77156514", "0.7689519", "0.76439804", "0.7624332", "0.7596953", "0.75795174", "0.7547538", "0.75161654", "0.7500131", "0.747837...
0.0
-1
Create shared memory objects.
def init_shared_memory(self, mem_key): self.shm_input = ConqueSoleSharedMemory(CONQUE_SOLE_INPUT_SIZE, 'input', mem_key) self.shm_input.create('write') self.shm_input.clear() self.shm_output = ConqueSoleSharedMemory(CONQUE_SOLE_BUFFER_LENGTH * self.columns, 'output', mem_key, True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_shared_memory_manager(\n address: typing.Tuple[str, int], authkey: typing.Optional[bytes]\n) -> SharedMemoryManager:\n smm = SharedMemoryManager(address=address, authkey=authkey)\n return smm", "def __init__(self):\n\t\tself.dataMemory = sysv_ipc.SharedMemory(65)\n\t\tself.statusMemory = sysv...
[ "0.6806886", "0.6637284", "0.6420833", "0.5987398", "0.5987398", "0.5987398", "0.59054685", "0.5809415", "0.5729596", "0.5698809", "0.5693551", "0.5631676", "0.561561", "0.561286", "0.56091833", "0.5602408", "0.56005305", "0.5592581", "0.55451244", "0.5470646", "0.5406517", ...
0.58049566
8
PID algorithm for anything
def computePID(setpoint, _input, last_error, prev_time): kp = 0.5 kd = 5 ki = 0.02 current_time = time.time() d_time = current_time - prev_time error = setpoint - _input #print("error", error) #error_sum += (error * d_time) d_error = (error - last_error) / d_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ppid(self):", "def pid(self):", "def pidGet(self) -> float:\n ...", "def pidGet(self) -> float:\n ...", "def inspire_pidstore():", "def dynamic_pid(self):\n pass", "def _update_PID(self):\n self.pid = PID(p=self.paramP, i=self.paramI, d=self.paramD, setpoint=self.voltage...
[ "0.71910334", "0.6614745", "0.6562891", "0.6562891", "0.6499642", "0.63020134", "0.616472", "0.5998051", "0.59355164", "0.5924834", "0.5907015", "0.5819289", "0.5810391", "0.5769309", "0.5708543", "0.56778383", "0.56778383", "0.5675718", "0.5638636", "0.5638505", "0.55943847"...
0.5710995
14
calculates PID for x, y and z
def xyzPID(home_lon, home_lat, home_alt, lon, lat, alt, error_sum, last_error_lon, last_error_lat, prev_time): #x PID output_lon, last_error_lon, prev_time = calculatePID(home_lon,lon,error_sum, last_error_lon, prev_time) #y PID output_lat, last_error_lat, prev_time = calculatePID(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elec_p_xyz_loop(x, y, z):\n U = 0.\n\n r = np.sqrt(x**2 + y**2 + z**2)\n x = x/r\n y = y/r\n z = z/r\n\n npts = x.size\n for i in range(npts-1):\n for j in range(i+1, npts):\n dsq = (x[i]-x[j])**2 + (y[i]-y[j])**2 + (z[i]-z[j])**2\n U += 1./np.sqrt(dsq)\n re...
[ "0.6086874", "0.59364504", "0.5866037", "0.5758806", "0.5704394", "0.56775993", "0.5539624", "0.5480766", "0.5472652", "0.544325", "0.544325", "0.54417825", "0.5440501", "0.54281235", "0.53789955", "0.53669405", "0.5355419", "0.5350521", "0.5342179", "0.53407073", "0.52950525...
0.6788774
0