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
Version modificada de Insertion Sort la cual solo ordena el subarreglo de A que inicie en la posicion p y termine en la posicion f. Luego, se inserta el subarreglo ordenado en el arreglo original
def insertionsortIndex(A:list, p:int, r:int) -> "void": for i in range(p + 1, r + 1): key = A[i] j = i - 1 while j >= p and key < A[j]: A[j+1] = A[j] j = j - 1 A[j+1] = key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insertionsort(A:list) -> \"void\":\n\tfor j in range(1, len(A)):\n\n\t\tkey = A[j]\n\t\ti = j - 1\n\n\t\twhile i >= 0 and A[i] > key:\n\t\t\tA[i+1] = A[i]\n\t\t\ti = i - 1\n\n\t\tA[i+1] = key", "def insert_sort(a):\n size = len(a)\n # find key\n for key in range(1, size):\n key_to_insert = a[...
[ "0.73015803", "0.6895954", "0.68779826", "0.6839426", "0.6661824", "0.66550356", "0.6573191", "0.6566813", "0.65580696", "0.6491283", "0.64678144", "0.63766116", "0.6364499", "0.6304453", "0.62836397", "0.6257932", "0.61871", "0.61598057", "0.6136436", "0.6125022", "0.6120758...
0.7273093
1
Version iterativa del Quick Sort
def quicksortIterative(A:list) -> "void": N = len(A) n, m = 0, 1 while m < N: n,m = n + 1, m * 2 x = [0] * n y = [0] * n k, p, q = 0, 0, N while k != 0 or q-p >= 2: if q - p <= 1: k = k - 1 p, q = x[k], y[k] elif q - p >= 2: z = A[(p+q)//2] r, w, b = p, p, q while w != b: if A[w] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quickSort(self, Q, inicio, final):\n if Q!= None:\n # Definimos el caso base del quicksort\n if final == 1 or final == 0:\n return Q\n\n if inicio < final:\n \n # Se obtiene la posición del pivote y se ordena según el pivote\n ...
[ "0.7049601", "0.68829525", "0.68284094", "0.67811495", "0.6778684", "0.67769396", "0.6711192", "0.6702589", "0.66523683", "0.6631796", "0.66098505", "0.6572385", "0.6567772", "0.65490806", "0.6532172", "0.65030396", "0.6448044", "0.64347774", "0.6427004", "0.6418817", "0.6379...
0.7157968
0
Can the sentence be found in the structure
def contain(self, structure, sentence) -> Bool: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasConstantForm(self, sentence):", "def match(self, sentence) -> bool:\r\n pass", "def match(self, sentence) -> bool:\r\n if (any(word[0] in sentence.lower() for word in self.word_list if word[1] == \"partial\") or any(\r\n word[0].lower() == sentence.lower() for word in se...
[ "0.73162323", "0.70101756", "0.6730221", "0.67206764", "0.6626828", "0.6530189", "0.63969374", "0.62941104", "0.61810255", "0.6152796", "0.59838545", "0.5971964", "0.5967614", "0.5963797", "0.5959129", "0.5826816", "0.582074", "0.5816149", "0.5814922", "0.5802744", "0.5798784...
0.7626938
1
Answer a clause asked of the data structure
def query(self, structure, clause : Sentence, ctxs : Contexts, engine : AcabEngine): # TODO is this part of call semantics? # open / closed world # depth / breath search # match as pattern? # return type pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _clause_query(self, structure, clause : Sentence, contexts, engine):\n logging.debug(\"Testing Clause: {}\".format(repr(clause)))\n\n clause = self._start_word_semantics(structure, contexts, clause)\n # Go down from the root by query element:\n # For each word of the clause sentence...
[ "0.57286453", "0.5628476", "0.5500024", "0.53816324", "0.53411394", "0.5290375", "0.524779", "0.5212534", "0.5203001", "0.5137833", "0.512704", "0.51134884", "0.5099076", "0.50866145", "0.5069617", "0.50670767", "0.5033463", "0.50306624", "0.5021113", "0.4987227", "0.4984828"...
0.5996676
0
Test a single clause, annotating contexts upon success and failure
def _clause_query(self, structure, clause : Sentence, contexts, engine): logging.debug("Testing Clause: {}".format(repr(clause))) clause = self._start_word_semantics(structure, contexts, clause) # Go down from the root by query element: # For each word of the clause sentence, eg: a. in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_conditional():\n # verify that conditioning increases the likelihood of getting a sample with the specified\n # categorical value", "def _test_word(query_word, query_context):\n assert(not query_word.is_at_var)\n engine = query_context._engine\n # TODO: validate on activate context too\n ...
[ "0.60679346", "0.60564893", "0.5922108", "0.5819795", "0.5816394", "0.57831323", "0.5753106", "0.5743619", "0.57055974", "0.5626308", "0.5575598", "0.55002815", "0.54955316", "0.5487813", "0.5475603", "0.54629236", "0.545074", "0.54501975", "0.54336506", "0.5428322", "0.54276...
0.6125073
0
Can the sentence be found in the structure
def contain(self, structure, sentence) -> Bool: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasConstantForm(self, sentence):", "def match(self, sentence) -> bool:\r\n pass", "def match(self, sentence) -> bool:\r\n if (any(word[0] in sentence.lower() for word in self.word_list if word[1] == \"partial\") or any(\r\n word[0].lower() == sentence.lower() for word in se...
[ "0.73158884", "0.70089906", "0.6729112", "0.67201436", "0.6625677", "0.65299416", "0.63968074", "0.62940687", "0.6181285", "0.61520094", "0.59832996", "0.5972964", "0.59678173", "0.5963993", "0.59594107", "0.5826873", "0.58204365", "0.58164454", "0.58150554", "0.5803164", "0....
0.7626514
0
Answer a clause asked of the data structure
def query(self, structure, clause : Sentence, ctxs : Contexts, engine : AcabEngine): # TODO is this part of call semantics? # open / closed world # depth / breath search # match as pattern? # return type pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _clause_query(self, structure, clause : Sentence, contexts, engine):\n logging.debug(\"Testing Clause: {}\".format(repr(clause)))\n\n clause = self._start_word_semantics(structure, contexts, clause)\n # Go down from the root by query element:\n # For each word of the clause sentence...
[ "0.57304245", "0.56317174", "0.5498811", "0.5381762", "0.53415763", "0.5290115", "0.5247972", "0.52136916", "0.5201485", "0.5140064", "0.5126363", "0.51145726", "0.50974137", "0.50875694", "0.5072135", "0.5065046", "0.50327265", "0.503227", "0.5022749", "0.49876425", "0.49863...
0.59968257
1
query word, with a sequence of tests, in all available bind groups, BFS manner
def _test_word(query_word, query_context): assert(not query_word.is_at_var) engine = query_context._engine # TODO: validate on activate context too alphas, betas, regexs, annotations = validate_and_split_constraints(query_word, engine=engine) callable_annotations = [word for word in annotations if h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_words(self):\n words = \"Python Django Junior\"\n self.q.construct_query(all_words=words)\n self.assertEqual(self.q.query, \"Python+Django+Junior\")", "def test_find_word(self):\n self.assertEqual(find_word('GREEN'), [(1, 1), (1, 1), (0, 9)])\n self.assertEqua...
[ "0.60711026", "0.56372243", "0.5561934", "0.5557492", "0.5549413", "0.55387396", "0.548914", "0.54698044", "0.5414719", "0.5408874", "0.5399487", "0.53983855", "0.5317206", "0.529749", "0.5295724", "0.52945083", "0.52828383", "0.52675676", "0.5258201", "0.525644", "0.52533174...
0.5893108
1
Run word beta tests against word retrieved value, with supplied bindings
def test_betas(node, comps, data=None, engine=None): return all([word(node, data=data, engine=engine) for word in comps])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _test_word(query_word, query_context):\n assert(not query_word.is_at_var)\n engine = query_context._engine\n # TODO: validate on activate context too\n alphas, betas, regexs, annotations = validate_and_split_constraints(query_word, engine=engine)\n callable_annotations = [word for word in annota...
[ "0.6456236", "0.5540558", "0.54794437", "0.53515416", "0.53394747", "0.53126997", "0.52856416", "0.5246273", "0.5244106", "0.52422476", "0.5233224", "0.519381", "0.51922524", "0.51665515", "0.51632446", "0.51623213", "0.51590866", "0.51411915", "0.51370984", "0.5124757", "0.5...
0.60333085
1
Returns True if the file name matches the format of a stone backend,
def is_stone_backend(cls, path): path_without_ext, _ = os.path.splitext(path) _, second_ext = os.path.splitext(path_without_ext) return second_ext == cls.backend_extension
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _IsWellFormattedFilePath(path):\n return path.startswith(SRC) and path.endswith(_OWNERS)", "def is_filename_safe(file: Union[str, FileStorage]) -> bool:\n filename = _retrieve_filename(file)\n accepted_formats = '|'.join(IMAGES) #png|jpg|svg|jpeg\n # start with any of alphanumeric, follwed by alhpa...
[ "0.64359665", "0.6340506", "0.6326994", "0.62419397", "0.6208198", "0.61874557", "0.61513036", "0.61503506", "0.6149628", "0.6138735", "0.6091237", "0.6079817", "0.6058845", "0.6048278", "0.60310197", "0.60259676", "0.60164034", "0.6002061", "0.5960908", "0.5952439", "0.59194...
0.7266556
0
Return a list of the conjuncts in the sentence s.
def conjuncts(s): return dissociate("AND", s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conjuncts(s):\n return dissociate('&', [s])", "def disjuncts(s):\n return dissociate('|', [s])", "def disjuncts(s):\n return dissociate(\"OR\", s)", "def _get_consonants(sequence: str) -> list:\n consonants = []\n for char in sequence:\n if char in CONSONANTS:\n ...
[ "0.7016275", "0.6150098", "0.5971689", "0.5914656", "0.57284665", "0.57089305", "0.56972504", "0.56908816", "0.56278276", "0.5598754", "0.55947864", "0.5414384", "0.5368523", "0.5352811", "0.5301386", "0.5299393", "0.5298131", "0.5294413", "0.5262815", "0.5257579", "0.5246124...
0.6904887
1
Return a list of the disjuncts in the sentence s.
def disjuncts(s): return dissociate("OR", s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disjuncts(s):\n return dissociate('|', [s])", "def conjuncts(s):\n return dissociate('&', [s])", "def conjuncts(s):\n return dissociate(\"AND\", s)", "def makeDisjunction(solver, v, disjuncts):\n cn = solver.Constraint(0, (len(disjuncts) - 1))\n cn.SetCoefficient(v, len(disjuncts))\n fo...
[ "0.74348295", "0.63344043", "0.61811227", "0.54869086", "0.5472047", "0.5224561", "0.51693934", "0.5095302", "0.50586647", "0.50297517", "0.5022578", "0.5018593", "0.5012466", "0.4957564", "0.49223596", "0.49091622", "0.48938423", "0.4880621", "0.48643947", "0.48643947", "0.4...
0.68307835
1
Return a copy of seq that was removed its elements which are equal to item.
def removeDup(item, seq): return [x for x in seq if x != item]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeDuplicates(seq):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in seq if not (x in seen or seen_add(x))]", "def remove_every_other_item(seq):\n seq_copy = seq [0::2]\n return seq_copy", "def remove(self, item):\n # type: (Any) -> None\n return l...
[ "0.66424644", "0.6517567", "0.651225", "0.64054257", "0.63929474", "0.63372123", "0.6255507", "0.6249946", "0.61885285", "0.61528766", "0.61447644", "0.6095686", "0.60715044", "0.60569215", "0.60440314", "0.60279125", "0.6020194", "0.5989983", "0.5988553", "0.5984628", "0.591...
0.81202203
0
retrieve functions from module iff they have exactly 1 argument and that argument==arg_pattern
def _harvest(modyool, arg_pattern=None, test=None): if not test: def test(obj): if callable(obj) and inspect.isfunction(obj): func_sig = pep362.Signature(obj) parameter_dict = func_sig._parameters if arg_pattern is not None: if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_require_at_least_one_and_several_provided(self):\n _func = at_least_one_of('arg1', 'arg2')(undecorated_func)\n self.assertEqual(_func('ahoy', 'there'), 'foo')\n self.assertEqual(_func(arg1='ahoy', arg2='there'), 'foo')\n self.assertEqual(_func('ahoy', arg2='there', arg3='matey'...
[ "0.5840372", "0.5823815", "0.578434", "0.5691881", "0.5639754", "0.55919427", "0.55658495", "0.5557475", "0.5557475", "0.5557475", "0.55547905", "0.5538202", "0.5529765", "0.55165", "0.54950196", "0.5494009", "0.5491232", "0.54660934", "0.5443653", "0.5404899", "0.5401204", ...
0.6088999
0
mines heuristic functions out of ixle.heuristics.
def get_heuristics(): from ixle import heuristics def is_heuristic(obj): FORBID = 'Heuristic SuggestiveHeuristic'.split() # sigh make metaclass return getattr(obj,'__name__', None) not in FORBID and \ getattr(obj, 'is_heuristic', False) return _harvest(heuristics, test=is_heur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_static_heuristic(self):\n pass", "def known_mines(self):\n self.mines", "def all_heuristics(self) -> List[Heuristic]:\n return [\n Grid2DManhattanDistance(self),\n Grid2DSingleDimensionDistance(self),\n Grid2DDiscreteMetric(self),\n H...
[ "0.620152", "0.6009492", "0.5749479", "0.5610601", "0.5610601", "0.5553557", "0.55421245", "0.55206877", "0.5508374", "0.54744697", "0.5435163", "0.54327136", "0.5430671", "0.54164946", "0.5397289", "0.53729004", "0.53707594", "0.5363146", "0.53624463", "0.53422534", "0.53125...
0.647915
0
Compte le nombre de commentaire dans le fichier.
def commentaires(file_name_c): com = subprocess.run(["grep", "eleves_bis/" + file_name_c, "-e", '/\*'], stdout=subprocess.PIPE) return com.stdout.decode().count("\n")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_comment(cursor: Cursor, child: Optional[Cursor]) -> str:\n try:\n token = next(cursor.get_tokens())\n except StopIteration:\n # Only happens with a completely empty file\n return \"\"\n\n if token.kind == cindex.TokenKind.COMMENT:\n if child is not None:\n ...
[ "0.60935336", "0.6034249", "0.5994588", "0.5884942", "0.58772486", "0.58674", "0.58168876", "0.5793827", "0.57559174", "0.5739505", "0.57187057", "0.57148314", "0.5697035", "0.5669349", "0.5666282", "0.562409", "0.5594346", "0.5581789", "0.558152", "0.55629194", "0.5555957", ...
0.7118211
0
calculates TM Helix Stats and plots histograms to .png
def single_helix_stats (self): for Value in ['TMHelix_Tilt', 'TMHelix_Tilt_EC', 'TMHelix_Tilt_IC', 'TMHelix_KinkAngle', 'TMHelix_Overhang']: # print self. values_list('TMHelix_Tilt', flat=True) HistogramPlot(np.array(self. values_list(Value, flat=True)), 'myproject/myapp/static/myapp/st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fn_total_photon_hist(file_name,folder,total_photon):\n import numpy as np\n import matplotlib.pyplot as plt\n from scipy.stats import lognorm\n from pylab import text\n \n n_molecules=len(total_photon)\n \n #Plot histogram\n figure_name=file_name+'_totalPhotons'\n ax = plt.subplot...
[ "0.6798116", "0.6651219", "0.6620528", "0.6601682", "0.66000724", "0.6587906", "0.64787877", "0.6458226", "0.6444838", "0.64234453", "0.63555384", "0.6355515", "0.6293227", "0.6275462", "0.62753123", "0.6250587", "0.6230647", "0.62133145", "0.6198267", "0.6172284", "0.6171148...
0.6749862
1
reads PDB file to SQL database
def ReadPDB (self, pdb_path, db_path): ReadPDBFile (pdb_path, db_path) #
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_pdb_into_database_flat(self, filePath, specific_chain=False, read_header=False, header_only=False, ):\n if filePath == \"PDB\":\n print \"Fetching \"+self.pdbID+\" from the PDB\"\n FILE = urllib2.urlopen(self.pdb_url+'/'+self.pdbID.lower()+'.pdb')\n else:\n F...
[ "0.7233259", "0.71250963", "0.6508904", "0.64518845", "0.644668", "0.63776624", "0.63600737", "0.62621015", "0.62617236", "0.6235072", "0.620346", "0.619246", "0.61737716", "0.6161046", "0.61598706", "0.6141323", "0.6089211", "0.6068337", "0.6049745", "0.60233474", "0.5981344...
0.7805226
0
calculates TM Helix Pair Stats and plots histograms to .png
def helix_pair_stats (self): for Value in ['CrossingAngle','CrossingAngleEC','CrossingAngleIC']: HistogramPlot(np.array(self. values_list(Value, flat=True)), 'myproject/myapp/static/myapp/static/Stats/HelixPair/'+Value ) #zrobic jakies dict coby robilo ranges, uzaleznialo np od zakresu alb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_histograms(PrimaryParticleName, LongVectorSignals, LongVectorSignalsCher,\n\tShortVectorSignals, ShortVectorSignalsCher, LongScinMaxFiber, LongCherMaxFiber, \n\tShortScinMaxFiber, ShortCherMaxFiber, EnergyTotContainer, MaxEnergyTotContainer):\n\n\t#Set ROOT histograms\n\tTH1LongScin = TH1F(\"LongScintil...
[ "0.6597499", "0.65844977", "0.6579564", "0.6578281", "0.6572896", "0.6552333", "0.6495228", "0.64294934", "0.64203167", "0.6416392", "0.63734186", "0.629218", "0.6282961", "0.6270068", "0.6254055", "0.624618", "0.6241999", "0.62274456", "0.6217575", "0.62115186", "0.61651194"...
0.6788684
0
calculates TM Helix Triplet Stats and plots histograms to .png
def helix_triplet_stats (self): for Value in ['Phi']: HistogramPlot(np.array(self. values_list(Value, flat=True)), 'myproject/myapp/static/myapp/static/Stats/HelixTriplet/'+Value ) #zrobic jakies dict coby robilo ranges, uzaleznialo np od zakresu albo od czegos return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single_helix_stats (self):\n\n for Value in ['TMHelix_Tilt', 'TMHelix_Tilt_EC', 'TMHelix_Tilt_IC', 'TMHelix_KinkAngle', 'TMHelix_Overhang']:\n# print self. values_list('TMHelix_Tilt', flat=True)\n\n HistogramPlot(np.array(self. values_list(Value, flat=True)), 'myproject/myapp/stati...
[ "0.67400146", "0.65252954", "0.64205676", "0.6363566", "0.63199985", "0.62624985", "0.62537646", "0.62112683", "0.61888003", "0.6166209", "0.61460257", "0.61407554", "0.61190194", "0.60926706", "0.6064606", "0.60625905", "0.60435295", "0.60221434", "0.60090464", "0.5992847", ...
0.71043295
0
calculates Crossing Angle in the Extracellular Leaflet
def getCrossingAngleEC (self): Axes = [] Axes = [[tmhelix.ECAxis_X,tmhelix.ECAxis_Y,tmhelix.ECAxis_Z] for tmhelix in self.tmhelixmodel_set] CrossingAngleEC = SetOfVectors([Axes[0], Axes[1] ]) .AngleDEG () return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(z):", "def angle(self) -> float:\n ...", "def angle(self) -> int:", "def getCrossingAngleIC (self):\n \n Axes = []\n \n Axes = [[tmhelix.ICAxis_X,tmhelix.ICAxis_Y,tmhelix.ICAxis_Z] for tmhelix in self.tmhelixmodel_set]\n \n Crossi...
[ "0.59698373", "0.5968203", "0.59016615", "0.5901351", "0.5759019", "0.5602756", "0.55923563", "0.55917186", "0.5583569", "0.5472733", "0.54602724", "0.54173803", "0.5356547", "0.5349384", "0.533688", "0.5319905", "0.52797836", "0.5248654", "0.5240663", "0.5220008", "0.5213893...
0.63749987
0
calculates Crossing Angle in the Intracellular Leaflet
def getCrossingAngleIC (self): Axes = [] Axes = [[tmhelix.ICAxis_X,tmhelix.ICAxis_Y,tmhelix.ICAxis_Z] for tmhelix in self.tmhelixmodel_set] CrossingAngleIC = SetOfVectors([Axes[0], Axes[1] ]) .AngleDEG () return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCrossingAngleEC (self):\n \n Axes = []\n \n Axes = [[tmhelix.ECAxis_X,tmhelix.ECAxis_Y,tmhelix.ECAxis_Z] for tmhelix in self.tmhelixmodel_set]\n \n CrossingAngleEC = SetOfVectors([Axes[0], Axes[1] ]) .AngleDEG ()\n \n return", "de...
[ "0.6039813", "0.60044205", "0.59900826", "0.5900222", "0.57783407", "0.5727738", "0.5669056", "0.56265926", "0.5509579", "0.54878104", "0.5467338", "0.5456283", "0.54486775", "0.5441209", "0.5372762", "0.53574044", "0.5351903", "0.5342864", "0.53314936", "0.5287098", "0.52612...
0.61769545
0
Helper function. This allows me to easily find a specific attribute in more than one dictionary, as well as having a default value.
def find_info( attr, kw, metadata, default='' ): str_attr = str(attr) return kw.get( str_attr, metadata.get( str_attr, default ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_attrs(d, *ks, **kwargs):\n if not isinstance(d, dict):\n raise TypeError(\"expected dict as first argument, \"\n \"got {}\".format(type(d)))\n if len(ks) == 1 and isinstance(ks[0], collections.Iterable):\n ks = ks[0]\n if \"default\" in kwargs:\n default ...
[ "0.6359249", "0.6319832", "0.6311589", "0.62128234", "0.6210899", "0.601887", "0.5992946", "0.59298855", "0.5923405", "0.5839765", "0.5779411", "0.5699869", "0.568165", "0.5668034", "0.56522757", "0.56488687", "0.5629423", "0.5586229", "0.55593264", "0.54900086", "0.5483849",...
0.674042
0
Add text to the bottom of the graph; usually used for graph statistics.
def make_bottom_text( self ): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bottom_rigth_text(self, text):\n self._bot_right_label.setText(text)", "def set_bottom_left_text(self, text):\n self._bot_left_label.setText(text)", "def footer(self):\n self.set_y(-15)\n self.set_font(self.police, 'I', 8)\n self.cell(w=0, h=10, txt=f\"Page {self.page...
[ "0.6930294", "0.64354545", "0.6349125", "0.60617787", "0.583432", "0.5778963", "0.5705938", "0.5705807", "0.56533813", "0.56523556", "0.5645726", "0.5635977", "0.55764925", "0.5570103", "0.54952115", "0.5491554", "0.54886", "0.5481551", "0.5478849", "0.5445165", "0.54253423",...
0.741721
0
The only default setting up we do is to make the labels and pick colors.
def setup(self): self.labels = getattr( self, 'labels', self.make_labels_common( self.parsed_data ) ) keys = list( self.sort_keys(self.parsed_data) ) # We reverse so the `first` colors get given to the `largest` # data elements. #keys.reverse() self.colors = self.preset_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, label, LEDStrips, colors):\n\n self._label = label\n self._LEDStrips = LEDStrips\n self._colors = colors", "def plot_colour(self, label):\n label = label.lower()\n pretty_colours = {}\n # SPIce HD\n pretty_colours['544'] = 'maroon'\n pret...
[ "0.68524784", "0.6817314", "0.6599257", "0.6572477", "0.65242726", "0.6414057", "0.63640624", "0.6323881", "0.6304739", "0.6283227", "0.6150616", "0.61131966", "0.6039623", "0.5991862", "0.59879583", "0.5979952", "0.5969853", "0.5960542", "0.5953796", "0.5907175", "0.59067744...
0.74302125
0
Draw an empty graph; this is called if there are no keys in the parsed data.
def draw_empty( self ): prefs = self.prefs fig = Figure() canvas = FigureCanvasAgg( fig ) dpi = prefs['width'] /prefs['width_inches'] height_inches = prefs['height'] / float(dpi) fig.set_size_inches( prefs['width_inches'], height_inches ) fig.set_dpi( dpi ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_networkx(self):\n g = nx.DiGraph()\n GraphData.from_networkx(g)", "def resetGraph(self):\n self.colours = [self.uncompletedColor] * self.num_points\n self.setData(pos=self.pos, symbolBrush=self.colours, size=1, symbol=self.symbols, pxMode=False, text=self.text)", "def...
[ "0.63842547", "0.5943059", "0.588978", "0.5856785", "0.5852123", "0.58057594", "0.5745706", "0.57418954", "0.57404345", "0.56624275", "0.56230766", "0.556393", "0.55635256", "0.55127245", "0.5499341", "0.54989296", "0.5496909", "0.54944414", "0.5458829", "0.5456807", "0.54426...
0.68783253
0
The prepare_canvas lays out the "background" of the graph the axis, the title and subtitle, the legend, and the text at the bottom of the graph. This is the "heart" of the Graph object. Most subclasses should try to not touch the canvas which is prepared, in order to keep the correct look and feel.
def prepare_canvas( self ): self.bottom_text = self.make_bottom_text() title = getattr( self, 'title', self.metadata.get('title','') ) xlabel = getattr( self, 'xlabel', self.metadata.get('xlabel','') ) ylabel = getattr( self, 'ylabel', self.metadata.get('ylabel','') ) labels = ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_canvas(self):\n # Fix xlabel / ylabel as the axis is switched.\n tmp = getattr(self,'ylabel','')\n self.ylabel = getattr(self,'xlabel','')\n self.xlabel = tmp\n\n # First, prepare the canvas to calculate all the necessary parts.\n super( HorizontalGraph, self )...
[ "0.735526", "0.6886576", "0.62384844", "0.6177264", "0.60566026", "0.605605", "0.6028368", "0.59402454", "0.5869881", "0.58611226", "0.58611226", "0.58611226", "0.5847343", "0.583126", "0.5831004", "0.5811686", "0.5768939", "0.57241863", "0.5715962", "0.5704278", "0.56979865"...
0.7720108
0
Render the graph into the file; if the `svg` keyword is set, then we write out a SVG instead of a PNG.
def write_graph( self ): #If we are on a logarithmic scale, set the lowest order of magnitude if getattr(self,'log_yaxis',False): self.ax.set_ylim(ymin=10**float(find_info('log_ymin',self.kw,self.metadata,-1))) kw = self.kw file = self.file canvas = self.canvas ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_process_svg(self):\n post_processor = PostProcessor(svg_path=self.rendered_file_path)\n\n post_processor.post_process(graph_representation=self.graph_representation)\n\n post_processor.write()\n\n self.display.display(\"The graph has been exported to {}\".format(self.rendered_f...
[ "0.72486305", "0.7149824", "0.71050465", "0.70390826", "0.698254", "0.6932538", "0.6903963", "0.6787749", "0.67469597", "0.67263454", "0.6631107", "0.6620059", "0.65916616", "0.65836644", "0.6581147", "0.65766275", "0.6557482", "0.65572214", "0.6545113", "0.6542643", "0.65280...
0.7508695
0
The HorizontalGraph reuses as much as Graph's `prepare_canvas` as possible. If fixedheight is set to False, then it will change the height of the graph, depending on the number of labels that the graph has.
def prepare_canvas(self): # Fix xlabel / ylabel as the axis is switched. tmp = getattr(self,'ylabel','') self.ylabel = getattr(self,'xlabel','') self.xlabel = tmp # First, prepare the canvas to calculate all the necessary parts. super( HorizontalGraph, self ).prepare_can...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_graph(self):\n if self.ax != None:\n # Calculate the spacing of the y-tick labels:\n labels = getattr( self, 'labels', [] )\n height_per = self.ax.get_position().get_points()[1][1]\n height_inches = self.fig.get_size_inches()[-1] * height_per\n ...
[ "0.55370104", "0.5168212", "0.50846183", "0.49461204", "0.49186137", "0.48937976", "0.48863026", "0.48053548", "0.48053548", "0.4803973", "0.47916323", "0.47782838", "0.47664022", "0.4730271", "0.4714762", "0.46988732", "0.46887574", "0.46836597", "0.46802455", "0.46751517", ...
0.7502985
0
Any additional vertical padding needed in the graph.
def additional_vertical_padding(self): return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertical_spacing(self):\r\n return self.padding[0] + self.padding[2] + self.margin[0] + self.margin[2]", "def padding(self):\r\n return self._generate_spacing_info(self.config['padding'])", "def padding_height(self):\n return self.height + self.padding_top + self.padding_bottom", "de...
[ "0.69603187", "0.66282165", "0.6556933", "0.6428596", "0.640051", "0.6126408", "0.60715824", "0.6070607", "0.6038818", "0.6029026", "0.5983594", "0.58280784", "0.58103496", "0.5773128", "0.5745225", "0.5734398", "0.5700688", "0.56765234", "0.5649997", "0.5635261", "0.5621299"...
0.84145945
0
Sort all the keys (the pivots) of `results` according to the max size of all the values stored in the pivot's dictionary.
def sort_keys( self, results ): if self.sorted_keys != None: return self.sorted_keys reverse_dict = {} for key, item in results.items(): size = self.data_size( item ) if size not in reverse_dict: reverse_dict[size] = [key] else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_keys( self, results ):\n if self.sorted_keys != None:\n return self.sorted_keys\n reverse_dict = {}\n for key, item in results.items():\n size = self.data_size( item )\n if size not in reverse_dict:\n reverse_dict[size] = [key]\n ...
[ "0.6523802", "0.5974892", "0.5892739", "0.5851117", "0.579103", "0.5467213", "0.53752536", "0.53647804", "0.5258022", "0.52553546", "0.52478874", "0.51915264", "0.51795065", "0.5166401", "0.51503634", "0.5110654", "0.5089008", "0.5082312", "0.5081933", "0.50761795", "0.504260...
0.6539652
0
Determine the max data size of the `groups` dictionary. Simply takes the max of all the values.
def data_size( self, groups ): #if len(groups) == 0: # return 0 return max( groups.values() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_data_size_max(self) -> int:\n return int(self.graph_tuple_stats.graph_data_size_max or 0)", "def max_individuals(self) -> int:\n return self.group_size.upper * self.groups_allowed", "def get_max_size(self):\n max_size = 0\n file = h5py.File(self.filename, 'r')\n for idx...
[ "0.6899916", "0.6699932", "0.635335", "0.63197654", "0.6307696", "0.6242645", "0.62301195", "0.6224486", "0.6138283", "0.6105892", "0.6063618", "0.6062869", "0.60509664", "0.5999005", "0.5988454", "0.59685856", "0.59577817", "0.5954649", "0.59094137", "0.58984", "0.5894134", ...
0.8461067
0
Parse the pivot; for this class, this is the identity function.
def parse_pivot( self, pivot ): return pivot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_data( self ):\n super( PivotGraph, self ).parse_data()\n new_parsed_data = {}\n parsed_data = getattr( self, 'parsed_data', self.results )\n for pivot, data in parsed_data.items():\n new_pivot = self.parse_pivot( pivot )\n data = self.parse_datum( data )\...
[ "0.6224587", "0.5813294", "0.5772658", "0.55150163", "0.54262805", "0.53557754", "0.52123743", "0.5121823", "0.5120388", "0.5057172", "0.5045084", "0.49914885", "0.49840516", "0.4982768", "0.4954539", "0.4946914", "0.48843747", "0.48830602", "0.4878653", "0.4872142", "0.48231...
0.8571833
1
Parses the group; for this class, simply the identity function.
def parse_group( self, group ): return group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Group(self) -> _n_5_t_0:", "def Group(self) -> _n_5_t_0:", "def parsegroup(self):\n self.readtoken()\n element = OGroup()\n while self.__current_token != OControl.GROUP_RIGHT:\n if self.__current_token == OControl.GROUP_LEFT:\n element.addelement(self.parsegro...
[ "0.68660176", "0.68660176", "0.63818085", "0.6162627", "0.58532333", "0.5763342", "0.5740328", "0.5706696", "0.5688254", "0.5675189", "0.56193763", "0.5579806", "0.5571941", "0.55702394", "0.55605865", "0.555536", "0.5538593", "0.5533509", "0.55170256", "0.5504975", "0.550205...
0.715103
0
Parses the value of `data`.
def parse_datum( self, data ): return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, data):\n\t\tif 'value' in data:\n\t\t\tself.value = data['value']", "def get_value(self, data):\n value = data['value']\n return value", "def parse_string(self, data):\n pass", "def parse(data):\n parser=Parser(data, True)\n return parser.parse()", "def _parse_valu...
[ "0.70354253", "0.6956332", "0.6839343", "0.68058836", "0.68054366", "0.67547727", "0.66906995", "0.6658168", "0.66537356", "0.66131276", "0.66096735", "0.6595746", "0.65466624", "0.6498887", "0.6467496", "0.63676524", "0.6341477", "0.6313121", "0.6311566", "0.6285094", "0.626...
0.76476836
1
Sort keys according to the max data size; this function iterates through all of the data in results
def sort_keys( self, results ): if self.sorted_keys != None: return self.sorted_keys reverse_dict = {} for key, item in results.items(): size = self.data_size( item ) if size not in reverse_dict: reverse_dict[size] = [key] else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_keys( self, results ):\n if self.sorted_keys != None:\n return self.sorted_keys\n reverse_dict = {}\n for key, item in results.items():\n size = self.data_size( item )\n if size not in reverse_dict:\n reverse_dict[size] = [key]\n ...
[ "0.70187455", "0.6304944", "0.6038971", "0.6022872", "0.5990089", "0.5911962", "0.5886142", "0.5852211", "0.56895965", "0.5652263", "0.56521475", "0.5651675", "0.56125784", "0.55807835", "0.5541014", "0.5538255", "0.5512969", "0.5492933", "0.5485434", "0.5484975", "0.5475287"...
0.70183665
1
Determine a numerical size for the data; this is used to sort the keys of the graph. If the item is a tuple, take the absolute value of the first entry. Otherwise, attempt to take the absolute value of that item. If that fails, just return 1.
def data_size( self, item ): if type(item) == types.TupleType: return abs(item[0]) try: return abs(item) except TypeError, te: return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_data_size(self) -> int:\n return int(self.graph_tuple_stats.graph_data_size or 0)", "def graph_data_size_min(self) -> int:\n return int(self.graph_tuple_stats.graph_data_size_min or 0)", "def size(self):\n return self.num_item", "def get_size(self) -> int:\n total_size = 0\n ...
[ "0.61906415", "0.614888", "0.60946614", "0.6018892", "0.59881526", "0.5982419", "0.59800094", "0.59199387", "0.5912729", "0.58973604", "0.5878796", "0.5871511", "0.5863244", "0.58178437", "0.57946354", "0.57633257", "0.5734853", "0.5722001", "0.5701946", "0.5694908", "0.56736...
0.8558462
0
Parse the name of the pivot; this is the identity function.
def parse_pivot( self, pivot ): return pivot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n\t\treturn self._assetName + '_obj_pivot'", "def __next_ph_name(self, ph_type, id, orient):\n basename = slide_ph_basenames[ph_type]\n # prefix rootname with 'Vertical ' if orient is 'vert'\n if orient == PH_ORIENT_VERT:\n basename = 'Vertical %s' % basename\n ...
[ "0.5628644", "0.55079174", "0.5401305", "0.5375332", "0.51960003", "0.506003", "0.49467152", "0.49352184", "0.48954922", "0.48695764", "0.48357642", "0.48357642", "0.48357642", "0.48269987", "0.48205954", "0.47877353", "0.47844943", "0.47837895", "0.47701496", "0.47582254", "...
0.7452547
0
Parse the specific data value; this is the identity.
def parse_datum( self, data ): return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, value):\n raise NotImplementedError(\"Please implement the Class\")", "def parse_string(self, data):\n pass", "def parse(self, data):\n raise NotImplementedError", "def parse(cls, data):\n raise NotImplementedError", "def parse_data(self):\n\t\traise NotImplement...
[ "0.6982797", "0.69576305", "0.6942418", "0.6712849", "0.66698414", "0.6597265", "0.65853673", "0.65853673", "0.6578181", "0.6570331", "0.6485947", "0.63564634", "0.62541324", "0.62278384", "0.620481", "0.6203464", "0.61851126", "0.61848086", "0.61486965", "0.61447346", "0.611...
0.7306297
0
Parse all the data values passed to the graph. For this super class, basically does nothing except loop through all the data. A subclass should override the parse_datum and parse_pivot functions rather than this one.
def parse_data( self ): super( PivotGraph, self ).parse_data() new_parsed_data = {} parsed_data = getattr( self, 'parsed_data', self.results ) for pivot, data in parsed_data.items(): new_pivot = self.parse_pivot( pivot ) data = self.parse_datum( data ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_data(self):\n for i, val in enumerate(self.values.keys()):\n x_, y_ = [], []\n xy = self.values[val]\n for value in self.values.index:\n x_.append(xy[value][0])\n y_.append(xy[value][1])\n\n self.set_and_get(\"x_\", val, x_...
[ "0.71866095", "0.7174521", "0.67986673", "0.6670956", "0.6666118", "0.6395086", "0.62248075", "0.61710274", "0.6170964", "0.6170964", "0.60650575", "0.5972632", "0.5855956", "0.5798012", "0.5787308", "0.57747334", "0.5756742", "0.57437325", "0.5735234", "0.5669693", "0.566254...
0.7818525
0
Initialize some strings for the TimeGraph object.
def __init__( self, *args, **kw ): self.starttime_str = 'starttime' self.endtime_str = 'endtime' self.is_timestamps = True self.resize_time_graph = True super( TimeGraph, self ).__init__( *args, **kw )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name, time, text):\n pass", "def __init__(self, time_str, antenna, freq, epc, count, rssi, phase):\n self.time_str, self.time = time_str, timeStringToDateTime(time_str)\n self.antenna, self.freq = antenna, freq\n self.epc, self.count, self.rssi, self.phase = epc, int(...
[ "0.6221378", "0.61873984", "0.61690235", "0.61570543", "0.6033121", "0.60167414", "0.59651977", "0.59197587", "0.58912534", "0.5779226", "0.5742734", "0.56759274", "0.56637275", "0.5642294", "0.56073534", "0.5590713", "0.55670464", "0.55652684", "0.55589294", "0.5548744", "0....
0.731906
0
If this is a PivotGroupGraph, converts all the group values into unix timestamps.
def parse_group( self, group ): return to_timestamp( group )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_timestamped_metric_values_as_strings(self):\n ret_list = []\n i = 0\n while i < len(self.__metric_value_list):\n ret_list.append(self.__metric_value_list[i].timestamp.strftime(\"%Y-%m-%d %H:%M:%S\") + \" \" +\n str(self.__metric_value_list[i].value...
[ "0.5602082", "0.5509908", "0.51685166", "0.50573164", "0.505374", "0.5027908", "0.5017459", "0.5003832", "0.49901193", "0.4983311", "0.49330953", "0.49289674", "0.48855916", "0.48807856", "0.48685098", "0.4848664", "0.4848664", "0.48418328", "0.48379505", "0.4837764", "0.4818...
0.59912956
0
This function changes the xaxis according to taste. In this case, we set the tick locator and formatter to be the GraphToolcustom "PrettyDateLocator" and "PrettyDateFormatter".
def x_formatter_cb( self, ax ): ax.set_xlim( xmin=self.begin_num,xmax=self.end_num ) dl = common.PrettyDateLocator() df = common.PrettyDateFormatter( dl ) ax.xaxis.set_major_locator( dl ) ax.xaxis.set_major_formatter( df ) ax.xaxis.set_clip_on(False) sf = common.P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_xaxis (self, axes, \n n_ticks = 10, # Number of ticks we would like\n timestamp_formatting = '(%Y-%m-%d)%H:%M', # Specified formatting \n xaxis_mode = None): # Several automatic modes\n if (self.X_type == \"categorical\"):\n axes.set_xtick...
[ "0.6615751", "0.56968784", "0.54507035", "0.540138", "0.5393265", "0.5279665", "0.5211911", "0.51020366", "0.509684", "0.5040946", "0.5021235", "0.5015024", "0.50063884", "0.49845216", "0.49631745", "0.4953122", "0.49363688", "0.49241528", "0.4875899", "0.48679763", "0.484156...
0.62934744
1
Given a title and two times, adds the time info to the title.
def add_time_to_title( self, title ): begin = self.begin; end = self.end if 'span' in self.metadata: interval = self.metadata['span'] elif 'given_kw' in self.metadata and 'span' in self.metadata['given_kw']: interval = self.metadata['given_kw']['span'] else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_time_suffix_into_arguments(args: Dict[str, Any]):\n arg_keys = args.keys()\n if 'start_time' in arg_keys:\n start_time = args.get('start_time', '')\n date_time = dateparser.parse(start_time)\n if date_time:\n args['start_time'] = str(\n date_time.strftim...
[ "0.59280694", "0.590189", "0.58547324", "0.57578343", "0.5665433", "0.56358933", "0.55543375", "0.53845096", "0.5359229", "0.533562", "0.53239036", "0.52735347", "0.52632254", "0.52559114", "0.52410245", "0.522884", "0.51959974", "0.51562035", "0.5149612", "0.51471734", "0.51...
0.79875255
0
Sets up the internal structures for the TimeGraph object. This
def setup( self ): super( TimeGraph, self ).setup() if 'span' in self.metadata and isinstance(self.metadata['span'], \ types.StringType): self.metadata['span'] = float(self.metadata['span']) vars = dict(self.vars) do_croptime = str(find_info('croptime', sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(self):\n self.graph = KytosGraph()", "def __init__( self, *args, **kw ):\n self.starttime_str = 'starttime'\n self.endtime_str = 'endtime'\n self.is_timestamps = True\n self.resize_time_graph = True\n super( TimeGraph, self ).__init__( *args, **kw )", "def se...
[ "0.69164944", "0.68794334", "0.68480486", "0.66757965", "0.6461099", "0.6461099", "0.63768256", "0.6324892", "0.61484575", "0.61427516", "0.60744005", "0.60675967", "0.6063366", "0.60577935", "0.60547185", "0.60547185", "0.60547185", "0.6048043", "0.6045719", "0.6041252", "0....
0.7597894
0
The TimeGraph object overrides the write_graph to make sure that the limits of the xaxis go from `starttime` to `endtime`. We do this as some graphing methods (bar graphs) change the xlimits when you create the graphs.
def write_graph( self ): if (isinstance(self, PivotGroupGraph )) and self.ax != None and self.resize_time_graph: self.ax.set_xlim( xmin=self.begin_num, xmax=self.end_num ) super( TimeGraph, self ).write_graph()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__( self, *args, **kw ):\n self.starttime_str = 'starttime'\n self.endtime_str = 'endtime'\n self.is_timestamps = True\n self.resize_time_graph = True\n super( TimeGraph, self ).__init__( *args, **kw )", "def write_plot(self):\n with open(self._graph_data_path,...
[ "0.6395232", "0.5688147", "0.5588224", "0.5568958", "0.5316367", "0.5315703", "0.5303559", "0.5205099", "0.5200521", "0.51626545", "0.5139638", "0.5115679", "0.50963295", "0.50926846", "0.50848144", "0.50837743", "0.50438005", "0.50415236", "0.50415236", "0.50415236", "0.5029...
0.7926277
0
Flash all object in redis pipeline
def flushall(self) -> Response: self.queue.r.flushall() return self.return_ok("Sucesfully flushed all data in redis pipeline")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redis_flush(self):\n def func(server):\n return server.server.flushall()\n self.__run_redis_cmd(func)", "def flushdb(self):\n allKeys = self.redis.keys(self.appendKeys(\"*\"))\n # for some reason deleteing with a list of keys isn't working\n p = self.redis.pipeli...
[ "0.6056803", "0.553244", "0.5461215", "0.5461163", "0.5461163", "0.5461163", "0.5461163", "0.5461163", "0.5461163", "0.5381297", "0.53760654", "0.52272916", "0.522426", "0.5177104", "0.517606", "0.51638365", "0.51580495", "0.51407087", "0.513006", "0.51145136", "0.51143247", ...
0.6030524
1
Sets the close_bid of this OptionPriceEod.
def close_bid(self, close_bid): self._close_bid = close_bid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bid(self, bid):\n self.__bid = bid", "def bid_high(self, bid_high):\n\n self._bid_high = bid_high", "def open_bid(self, open_bid):\n\n self._open_bid = open_bid", "def trade_close(self, trade_close):\n\n self._trade_close = trade_close", "def close(self, close: float):\n...
[ "0.6898926", "0.6829834", "0.6697797", "0.64111316", "0.6306969", "0.6255661", "0.60562164", "0.59325427", "0.5764903", "0.5764903", "0.57194304", "0.5717518", "0.5693503", "0.55787", "0.5542667", "0.553998", "0.553998", "0.553998", "0.553998", "0.5447946", "0.54462165", "0...
0.79741925
0
Sets the close_ask of this OptionPriceEod.
def close_ask(self, close_ask): self._close_ask = close_ask
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ask_high(self, ask_high):\n\n self._ask_high = ask_high", "def open_ask(self, open_ask):\n\n self._open_ask = open_ask", "def trade_close(self, trade_close):\n\n self._trade_close = trade_close", "def ask_low(self, ask_low):\n\n self._ask_low = ask_low", "def close(self, clo...
[ "0.6284095", "0.6110656", "0.55984163", "0.5592074", "0.5563896", "0.5531795", "0.55049217", "0.5364555", "0.5258314", "0.5233035", "0.51021034", "0.50855863", "0.50693476", "0.5028924", "0.49971953", "0.49724624", "0.4882125", "0.4882125", "0.48813576", "0.48770002", "0.4864...
0.73749423
0
Sets the open_ask of this OptionPriceEod.
def open_ask(self, open_ask): self._open_ask = open_ask
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ask_low(self, ask_low):\n\n self._ask_low = ask_low", "def open(self, open: float):\n if open is None:\n raise ValueError(\"Invalid value for `open`, must not be `None`\") # noqa: E501\n\n self._open = open", "def buyOpenVal(self, buyOpenVal):\n\n self._buyOpenVal = ...
[ "0.64458877", "0.6433421", "0.6168577", "0.5936913", "0.59119046", "0.5754027", "0.5701366", "0.5676456", "0.5547602", "0.5433679", "0.5416541", "0.5281479", "0.5262344", "0.52290946", "0.5222788", "0.52052885", "0.51893926", "0.5171281", "0.5133268", "0.5052731", "0.5033423"...
0.77289987
0
Sets the open_bid of this OptionPriceEod.
def open_bid(self, open_bid): self._open_bid = open_bid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bid_low(self, bid_low):\n\n self._bid_low = bid_low", "def set_bid(self, bid):\n self.__bid = bid", "def close_bid(self, close_bid):\n\n self._close_bid = close_bid", "def bid_high(self, bid_high):\n\n self._bid_high = bid_high", "def buyOpenVal(self, buyOpenVal):\n\n ...
[ "0.6598709", "0.6574167", "0.6518713", "0.6328197", "0.63156426", "0.62678456", "0.6160232", "0.6051065", "0.6011494", "0.597753", "0.5915111", "0.58852947", "0.58852947", "0.58852947", "0.58852947", "0.5841644", "0.5752134", "0.57049876", "0.5584033", "0.558256", "0.5549361"...
0.800471
0
Sets the open_interest of this OptionPriceEod.
def open_interest(self, open_interest): self._open_interest = open_interest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open(self, open: float):\n if open is None:\n raise ValueError(\"Invalid value for `open`, must not be `None`\") # noqa: E501\n\n self._open = open", "def price_low(self, price_low):\n\n self._price_low = price_low", "def sellOpenVal(self, sellOpenVal):\n\n self._sel...
[ "0.60777515", "0.56219274", "0.540981", "0.54016566", "0.5378542", "0.5200231", "0.51905626", "0.5078293", "0.50383854", "0.5035367", "0.50349575", "0.50349575", "0.50349575", "0.50349575", "0.5031765", "0.50214624", "0.49867132", "0.49255612", "0.48535633", "0.4827508", "0.4...
0.78924406
0
Sets the high of this OptionPriceEod.
def high(self, high): self._high = high
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_high(self, price_high):\n\n self._price_high = price_high", "def high(self, high: float):\n if high is None:\n raise ValueError(\"Invalid value for `high`, must not be `None`\") # noqa: E501\n\n self._high = high", "def bid_high(self, bid_high):\n\n self._bid_h...
[ "0.8431798", "0.70563906", "0.69665706", "0.68997765", "0.66973525", "0.65262765", "0.6313029", "0.62610435", "0.6225148", "0.6203277", "0.6111208", "0.6100646", "0.6100646", "0.6100646", "0.6100646", "0.604166", "0.60049796", "0.5980259", "0.5936152", "0.58814484", "0.583469...
0.73349285
1
Sets the low of this OptionPriceEod.
def low(self, low): self._low = low
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_low(self, price_low):\n\n self._price_low = price_low", "def changeLow(self):\n self.changeLowHigh(self.ui.t_low, t_type=\"low\")", "def price_high(self, price_high):\n\n self._price_high = price_high", "def low(self, low: float):\n if low is None:\n raise Val...
[ "0.8432862", "0.7061433", "0.7055769", "0.70242584", "0.6520939", "0.65068376", "0.64659965", "0.6464714", "0.6402997", "0.63119215", "0.6309227", "0.62706184", "0.62600565", "0.6240816", "0.6196816", "0.61845684", "0.61845684", "0.61845684", "0.61845684", "0.6181241", "0.617...
0.7516024
1
Sets the mark of this OptionPriceEod.
def mark(self, mark): self._mark = mark
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPrice(self, val):\n self.price = val", "def set_mark_style(self, mark, style):\n if not isinstance(mark, Mark):\n raise ValueError(\"Mark style can only be set on toyplot.Mark instances.\")\n self._changes[self._begin][\"set-mark-style\"].append((mark, style))", "def set_mark(self, per...
[ "0.63770014", "0.634032", "0.59872603", "0.5915886", "0.57976866", "0.57811373", "0.57724184", "0.5756689", "0.5756689", "0.5756689", "0.5756689", "0.5697331", "0.567298", "0.5642524", "0.56345004", "0.54149055", "0.5409457", "0.5379739", "0.5378305", "0.5375316", "0.5365628"...
0.7040183
0
Sets the ask_high of this OptionPriceEod.
def ask_high(self, ask_high): self._ask_high = ask_high
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_high(self, price_high):\n\n self._price_high = price_high", "def bid_high(self, bid_high):\n\n self._bid_high = bid_high", "def changeHigh(self):\n self.changeLowHigh(self.ui.t_high, t_type=\"high\")", "def high(self, high):\n\n self._high = high", "def ask_low(self, a...
[ "0.78878903", "0.7249518", "0.6654902", "0.6652914", "0.64541817", "0.6418311", "0.6001223", "0.5911048", "0.5638475", "0.5620013", "0.55801886", "0.5556192", "0.54871696", "0.54424757", "0.5425311", "0.53786683", "0.5368488", "0.5331831", "0.5258917", "0.52324975", "0.520685...
0.8403245
0
Sets the ask_low of this OptionPriceEod.
def ask_low(self, ask_low): self._ask_low = ask_low
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_low(self, price_low):\n\n self._price_low = price_low", "def bid_low(self, bid_low):\n\n self._bid_low = bid_low", "def low(self, low):\n\n self._low = low", "def changeLow(self):\n self.changeLowHigh(self.ui.t_low, t_type=\"low\")", "def ask_high(self, ask_high):\n\n ...
[ "0.7904208", "0.69571954", "0.68757504", "0.6768363", "0.66986674", "0.6676048", "0.6495873", "0.62121713", "0.6168079", "0.6016537", "0.5921024", "0.5895522", "0.58552", "0.5834525", "0.57656264", "0.5727869", "0.5708445", "0.57036763", "0.56588036", "0.564048", "0.5624221",...
0.82766896
0
Sets the bid_high of this OptionPriceEod.
def bid_high(self, bid_high): self._bid_high = bid_high
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_high(self, price_high):\n\n self._price_high = price_high", "def ask_high(self, ask_high):\n\n self._ask_high = ask_high", "def high(self, high):\n\n self._high = high", "def bid_low(self, bid_low):\n\n self._bid_low = bid_low", "def high(self, high: float):\n i...
[ "0.82857585", "0.70082635", "0.6941516", "0.6897873", "0.6811397", "0.6440418", "0.64343834", "0.6136968", "0.61051846", "0.5969952", "0.5927157", "0.5685342", "0.56736416", "0.55477965", "0.55197054", "0.54935294", "0.5491943", "0.5491744", "0.54493296", "0.54073006", "0.538...
0.8605096
0
Sets the bid_low of this OptionPriceEod.
def bid_low(self, bid_low): self._bid_low = bid_low
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_low(self, price_low):\n\n self._price_low = price_low", "def low(self, low):\n\n self._low = low", "def low(self, low: float):\n if low is None:\n raise ValueError(\"Invalid value for `low`, must not be `None`\") # noqa: E501\n\n self._low = low", "def ask_lo...
[ "0.8198249", "0.70497644", "0.68363106", "0.6778051", "0.674677", "0.6685352", "0.65240926", "0.63473237", "0.6023595", "0.59492946", "0.58679277", "0.5716745", "0.57111585", "0.5675589", "0.561617", "0.5609453", "0.5585481", "0.5534617", "0.5404902", "0.5388621", "0.5374421"...
0.83897704
0
Sets the implied_volatility of this OptionPriceEod.
def implied_volatility(self, implied_volatility): self._implied_volatility = implied_volatility
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def potential_energy_rating(self, potential_energy_rating):\n\n self._potential_energy_rating = potential_energy_rating", "def annualized_volatility(self):\n return self.daily_std() * math.sqrt(252)", "def attribute_price(self, attribute_price):\n\n self._attribute_price = attribute_price"...
[ "0.5288223", "0.52400804", "0.5113599", "0.5073822", "0.5051936", "0.50330675", "0.5021391", "0.50125223", "0.5006831", "0.49934146", "0.49678788", "0.49321693", "0.4925515", "0.48250642", "0.48193374", "0.48190624", "0.48130286", "0.48130286", "0.48130286", "0.48130286", "0....
0.8333395
0
Sets the delta of this OptionPriceEod.
def delta(self, delta): self._delta = delta
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adapt_delta(self, new_delta):\n self.delta = new_delta", "def delta(self):\n \n print(\"Cannot calculate delta for base class BSOption.\" )\n return 0", "def convert(self, delta_multiplier):\n self.delta_multiplier = delta_multiplier", "def set_delta(self):\n sel...
[ "0.6098159", "0.5925429", "0.57161945", "0.5708366", "0.56754744", "0.5619428", "0.5603051", "0.5471974", "0.5461279", "0.54101735", "0.5386727", "0.5319181", "0.5319181", "0.5279107", "0.5279107", "0.5279107", "0.5279107", "0.5251465", "0.5245843", "0.5140002", "0.51292926",...
0.6868307
0
Sets the gamma of this OptionPriceEod.
def gamma(self, gamma): self._gamma = gamma
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setGamma(self, g):\n return self._set(gamma=g)", "def set_gamma(self, name):\n if name=='1H':\n self.gamma=267.513e6*self.time_fact\n #In standard freq: 42.576e6\n elif name=='13C':\n self.gamma=67.262e6*self.time_fact\n # Good average unknown\...
[ "0.7097043", "0.6941382", "0.66935456", "0.6618162", "0.6460714", "0.6335088", "0.632169", "0.6319041", "0.63157374", "0.63004094", "0.6249226", "0.6236026", "0.5975628", "0.59349066", "0.5850475", "0.5776561", "0.5753523", "0.571758", "0.5682183", "0.55729383", "0.55481917",...
0.7571498
0
Sets the theta of this OptionPriceEod.
def theta(self, theta): self._theta = theta
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_theta(self, theta=10.):\n self.eta = theta", "def theta(self, theta):\n self.kernel.theta = theta", "def theta(self, spot_price,implied_vol):\n option = self.Option.option_ql\n process = self.evaluation.get_bsmprocess_cnstvol(self.rf, spot_price, implied_vol)\n engin...
[ "0.7028837", "0.6648795", "0.6457257", "0.60566425", "0.5858821", "0.5858821", "0.5804075", "0.57036465", "0.56587344", "0.56318843", "0.55411774", "0.55188125", "0.5493025", "0.53848886", "0.535538", "0.5307934", "0.52947086", "0.5279631", "0.5266989", "0.52619404", "0.52546...
0.7407514
0
Sets the vega of this OptionPriceEod.
def vega(self, vega): self._vega = vega
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vega(self, spot_price, implied_vol):\n option = self.Option.option_ql\n process = self.evaluation.get_bsmprocess_cnstvol(self.rf, spot_price, implied_vol)\n engine = util.get_engine(process, self.engineType)\n option.setPricingEngine(engine)\n vega = option.vega()/100.0\n ...
[ "0.717984", "0.55942327", "0.5580315", "0.55003655", "0.5397013", "0.53524315", "0.524632", "0.5141835", "0.51392895", "0.51392895", "0.51392895", "0.51392895", "0.50963885", "0.50663656", "0.50507843", "0.5017207", "0.4998376", "0.4911768", "0.48774198", "0.48675045", "0.486...
0.760472
0
>>> t = Tree(1, [Tree(2, [Tree(3), Tree(4)]), Tree(5)]) >>> square_tree(t) >>> t Tree(1, [Tree(4, [Tree(9), Tree(16)]), Tree(25)])
def square_tree(t): t.entry = square(t.entry) for branch in t.branches: square_tree(branch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def square_tree(t):\n return tree(label(t)**2,[square_tree(b) for b in branches(t)])", "def test_list_passed_as_iterable():\n tree = Tree([10, 5, 100])\n assert tree.root.value == 10\n assert tree.root.left.value == 5\n assert tree.root.right.value == 100", "def tree_l2_norm(tree_x, squared=Fals...
[ "0.8137038", "0.61531997", "0.61272573", "0.6077649", "0.59902716", "0.57769245", "0.5696375", "0.56572646", "0.5542178", "0.55182546", "0.547775", "0.5469939", "0.54111975", "0.5405593", "0.54018843", "0.53920937", "0.53703284", "0.5329994", "0.5326723", "0.53083706", "0.530...
0.83945197
0
>>> t = Tree(1, [Tree(2, [Tree(3)]), Tree(4), Tree(5)]) >>> make_even(t) >>> t Assuming __repr__ is defined Tree(2, [Tree(2, [Tree(4)]), Tree(4), Tree(6)])
def make_even(t): if t.entry % 2 != 0: t.entry += 1 if t.branches: for branch in t.branches: make_even(branch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make(self, tree):\n if type(tree) != type(()):\n return tree\n return Tree(tree[0], [self.make(tree[1]), self.make(tree[2])])", "def square_tree(t):\n return tree(label(t)**2,[square_tree(b) for b in branches(t)])", "def square_tree(t):\n t.entry = square(t.entry)\n for br...
[ "0.5956446", "0.5945084", "0.5934068", "0.57101613", "0.5320942", "0.5251402", "0.52474225", "0.5233395", "0.5232098", "0.52048767", "0.51973397", "0.5186551", "0.5182969", "0.5154629", "0.5124212", "0.50911146", "0.5052893", "0.50507784", "0.5039047", "0.5026937", "0.4991912...
0.76113397
0
Returns the height of the Tree t. >>> t = BinaryTree(5, BinaryTree(1, BinaryTree(4, BinaryTree(999)), BinaryTree(1)), BinaryTree(2)) >>> height(t) 4
def height(t): if t.is_empty: return 0 else: left = height(t.left) right = height(t.right) return 1 + max([left, right])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self) -> int:\n # binary search tree == empty\n if self.root is None:\n return -1\n\n #count number\n return self.height_helper(self.root)", "def height(t: Tree):\n if len(t.children) == 0:\n return 1\n else:\n return 1 + max([height(c) for c ...
[ "0.81302696", "0.7999633", "0.79653597", "0.7861532", "0.77929825", "0.7739106", "0.7686728", "0.7606116", "0.75925314", "0.7565026", "0.7564303", "0.7540061", "0.7505533", "0.7495804", "0.74750924", "0.7457568", "0.741324", "0.7378369", "0.7377502", "0.73592407", "0.72066754...
0.8051175
1
Return the position of the center of the field
def getFieldCenter(self): return (self.field_limits[:, 1] + self.field_limits[:, 0]) / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self):\n return self.pos + self.axis / 2.0", "def get_pos(self) -> tuple:\n return self.rect.center", "def GetCenter(self):\n ...", "def GetCenter(self):\n ...", "def GetCenter(self):\n ...", "def GetCenter(self):\n ...", "def center(self):\n ...
[ "0.76034075", "0.7532529", "0.7528027", "0.7528027", "0.7528027", "0.7528027", "0.7501811", "0.7486687", "0.7475976", "0.7436562", "0.74300814", "0.7414052", "0.7401933", "0.7372685", "0.73224443", "0.7312872", "0.72552776", "0.72308713", "0.72246045", "0.7213972", "0.7211225...
0.81051105
0
Return the position I where robot R is available to intercept the ball kicked from position S to E given allowed speed v_ball and v_robot A SIPE \ | \ | C \ | B \ | \| R with the constraints |RI| / v_robot = |SI| / v_ball
def getDynamicInterception(S, E, R, v_ball, v_robot): P = linePointProjection(S,E,R) B = np.linalg.norm(P-R) D = np.linalg.norm(P-S) # We have two equations: # 1. A^2 + B^2 = C^2 # 2. (D-A) / v_ball = C / v_robot <- Same time to reach position # This leads to (with 'detailed steps') # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_vel(self, state, goal):\n\n \"\"\"\n Unicycle model control law:\n [v;w] = [kp 0 0; 0 ka kb]*[p;a;b]\n v = commanded linear velocity of robot\n w = commanded rotational velcoity of robot\n kp = gain parameter where kp > 0\n ka = gain parameter where ka -...
[ "0.63641214", "0.5830946", "0.581821", "0.5780658", "0.5746222", "0.57458776", "0.56783897", "0.56731296", "0.562764", "0.56032914", "0.5540018", "0.54777044", "0.5474523", "0.54709744", "0.54647607", "0.54438865", "0.54403406", "0.5437309", "0.543562", "0.5432923", "0.542197...
0.766836
0
Calculates the primitive of the Zhao kernel for given values.
def kernel_primitive_zhao(x, s0=0.08333, theta=0.242): c0 = 1.0 / s0 / (1 - 1.0 / -theta) if x < 0: return 0 elif x <= s0: return c0 * x else: return c0 * (s0 + (s0 * (1 - (x / s0) ** -theta)) / theta)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_kernel(self, c, d, a, b):\r\n global t\r\n \r\n t=math.radians(t_) \r\n if a == 0 and b == 0:\r\n if c == 0 and d == 0:\r\n return complex((math.cos(t*frec)**2)+((e**2)*(math.sin(t*frec)**2)/(frec**2)),0)\r\n elif c == 0 and d == 1:\r\...
[ "0.566296", "0.5597465", "0.5583761", "0.5531386", "0.5465599", "0.54411244", "0.54250675", "0.54137486", "0.5400699", "0.53392315", "0.5328538", "0.5325336", "0.5314217", "0.5311631", "0.5304065", "0.5303589", "0.52937716", "0.52925956", "0.5268716", "0.5265864", "0.5244637"...
0.56688714
0
Calculates the primitive of the Zhao kernel for given values. Optimized using ndarrays and vectorization.
def kernel_primitive_zhao_vec(x, s0=0.08333, theta=0.242): c0 = 1.0 / s0 / (1 - 1.0 / -theta) res = np.copy(x) res[x < 0] = 0 res[(x <= s0) & (x >= 0)] = c0 * res[(x <= s0) & (x >= 0)] res[x > s0] = c0 * (s0 + (s0 * (1 - (res[x > s0] / s0) ** -theta)) / theta) return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indicator_kernel(h: np.ndarray, Xi: np.ndarray, x: np.ndarray) -> np.ndarray:\n return (Xi - x) == 0", "def create_kernel(shape):\n indices = np.array(list(itertools.product([-1, 0],\n repeat=len(shape))))\n ref = np.sum(indices[0]) & 1\n parity = np.array([1 if (-sum(i) & 1...
[ "0.5905291", "0.58672535", "0.5795786", "0.5661881", "0.5627886", "0.5615516", "0.55912954", "0.5580498", "0.5527056", "0.5519148", "0.5518123", "0.5511363", "0.5500014", "0.5492102", "0.54869246", "0.5478587", "0.5474485", "0.5472177", "0.54720634", "0.5463642", "0.5459777",...
0.60308427
0
Calculates definite integral of Zhao function. Optimized using ndarrays and vectorization. x1 and x2 should be ndarrays of same size.
def integral_zhao_vec(x1, x2, s0=0.08333, theta=0.242): return kernel_primitive_zhao_vec(x2, s0, theta) - kernel_primitive_zhao_vec(x1, s0, theta)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integral_zhao(x1, x2, s0=0.08333, theta=0.242):\n return kernel_primitive_zhao(x2, s0, theta) - kernel_primitive_zhao(x1, s0, theta)", "def integralFunction(xa, ya, xb, yb):\n return psi(xb, yb) - psi(xa, ya)", "def rewofz_vectorized(x, y):\n ncut=27\n xy=x*y\n xyp=xy/jnp.pi\n exx=jnp.exp...
[ "0.6866526", "0.6183558", "0.6001204", "0.591226", "0.58619803", "0.5818304", "0.58006144", "0.579033", "0.57889", "0.5750948", "0.5749577", "0.5739879", "0.5695658", "0.56756115", "0.56444925", "0.55970865", "0.5586562", "0.5561791", "0.5549075", "0.5546972", "0.5537728", ...
0.70413643
0
Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bounds should be passed as an array in the form of [(lower r0, lower taum), (upper r0, upper taum)]. Converted to hours.
def infectious_rate_tweets(t, p0=0.001, r0=0.424, phi0=0.125, taum=2., t0=0, tm=24, bounds=None): if bounds is not None: if not (bounds[0][0] < r0 < bounds[1][0]): r0 = max(bounds[0][0], bounds[1][0] * sigmoid(taum / bounds[1][0])) if not (bounds[0][1] < taum < bounds[1][1]): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infectious_rate_tweets_vec(t, p0=0.001, r0=0.424, phi0=0.125, taum=2., t0=0, tm=24., bounds=None):\n if bounds is not None:\n if not (bounds[0][0] < r0 < bounds[1][0]):\n r0 = max(bounds[0][0], bounds[1][0] * sigmoid(taum / bounds[1][0]))\n if not (bounds[0][1] < taum < bounds[1][1]...
[ "0.60665107", "0.56878334", "0.53457487", "0.52727735", "0.51461005", "0.51240295", "0.51161927", "0.50427043", "0.4989774", "0.49829563", "0.49763635", "0.49664158", "0.4952929", "0.49515197", "0.49324962", "0.4921948", "0.4918593", "0.49098438", "0.48631173", "0.4856228", "...
0.63849777
0
Alternative form of infectious rate from paper. Supports bounds for r0 and taum. Bound should be passed as an array in the form of [(lower r0, lower taum), (upper r0, upper taum)]. Converted to hours. Vectorized version.
def infectious_rate_tweets_vec(t, p0=0.001, r0=0.424, phi0=0.125, taum=2., t0=0, tm=24., bounds=None): if bounds is not None: if not (bounds[0][0] < r0 < bounds[1][0]): r0 = max(bounds[0][0], bounds[1][0] * sigmoid(taum / bounds[1][0])) if not (bounds[0][1] < taum < bounds[1][1]): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infectious_rate_tweets(t, p0=0.001, r0=0.424, phi0=0.125, taum=2., t0=0, tm=24, bounds=None):\n if bounds is not None:\n if not (bounds[0][0] < r0 < bounds[1][0]):\n r0 = max(bounds[0][0], bounds[1][0] * sigmoid(taum / bounds[1][0]))\n if not (bounds[0][1] < taum < bounds[1][1]):\n ...
[ "0.62486327", "0.5833489", "0.5350998", "0.5235279", "0.517756", "0.5123378", "0.5100959", "0.5091549", "0.5083081", "0.50260305", "0.49602744", "0.49527758", "0.49433687", "0.49417207", "0.49394292", "0.49393627", "0.49366468", "0.4935102", "0.48775375", "0.48712638", "0.486...
0.6339537
0
Derivation of infectious rate after p0. Required for direct maximum likelihood estimation.
def infectious_rate_dv_p0(t, r0=0.424, phi0=0.125, taum=2., t0=0, tm=24.): return (1. - r0 * np.sin((48. / tm) * np.pi * ((t + t0) / 24. + phi0))) * np.exp(-t / (24. * taum))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _estim_determ_p(num_zeros, num_ones):\n p = 0.0\n if num_zeros == 0:\n p += 0.5\n if num_ones == 0:\n p += 0.5\n return p", "def P0(self):\n if not self.isVaild():\n pass\n temp = ((self.r()**self.C)*self.C) / \\\n (math.factorial(self.C)*(self.C ...
[ "0.6925612", "0.6385619", "0.62766534", "0.6248409", "0.6230271", "0.61977637", "0.61903495", "0.6152647", "0.61344415", "0.60986465", "0.6067942", "0.6046516", "0.600394", "0.59957486", "0.5991482", "0.593285", "0.5931405", "0.5924013", "0.5924013", "0.5904413", "0.59020644"...
0.6813705
1
Count of events in given interval.
def get_event_count(event_times, start, end): mask = (event_times > start) & (event_times <= end) return event_times[mask].size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(time):\n \n return len(events(time))", "def numberOfEvents(self):\n raise NotImplementedError", "def count_events(self, time_from='', time_to=''):\n count_from, count_up = self._validate_input(time_from, time_to)\n\n count = 0\n #assimption: the user more often is in...
[ "0.69337964", "0.65281546", "0.65055287", "0.6280608", "0.6276842", "0.627416", "0.6151112", "0.6149789", "0.6137922", "0.60218143", "0.5953144", "0.5951458", "0.59445477", "0.59241915", "0.5910799", "0.5881155", "0.58655775", "0.58635396", "0.5812914", "0.5809065", "0.578480...
0.65718865
1
Calculates normed prediction error.
def prediction_error_normed(event_times, intensity, window_size, obs_time, pred_time, dt): err_abs = prediction_error_absolute(event_times, intensity, window_size, obs_time, pred_time, dt) events_time_pred = event_times[event_times >= obs_time] total_count_real = get_event_count(events_time_pred, obs_time,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_error(self, params):\n return self.endog - self.predict(params)", "def calc_error_amp(amp_pred, pdur, model):\n theta_pred = list(forward_pass(model, pdur, amp_pred))[0]\n return np.log(np.maximum(1e-10, (theta_pred - model.theta) ** 2))", "def train_error(self):\n self.pred...
[ "0.7475655", "0.7263803", "0.71828383", "0.6881019", "0.68678254", "0.6853385", "0.6840796", "0.6792696", "0.6781975", "0.6657799", "0.6636575", "0.66316164", "0.6622859", "0.6614981", "0.6548927", "0.65342855", "0.6507047", "0.64708364", "0.6462097", "0.64538354", "0.6439993...
0.74031734
1
Gets free games from the store
def get_free_games(self) -> List[Game]:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fetch_games(self):\n return await self.http.get_game_list()", "def get_all_games():\n games = brain.get_all_games()\n return games", "def _get_live_games(self):\n response = requests.get(self._get_score_url())\n if response.status_code == 200:\n return [g for g i...
[ "0.70054024", "0.67379117", "0.6706292", "0.6532104", "0.64570415", "0.6355802", "0.6310289", "0.6161956", "0.6129738", "0.61240727", "0.61240166", "0.6119164", "0.5992046", "0.5942962", "0.59277385", "0.5906087", "0.5904552", "0.587229", "0.58665484", "0.58471316", "0.584243...
0.830731
0
Gets a BeautifulSoup object for the store URL
def get_soup(url: str): response = requests.get(url) return BeautifulSoup(response.content, "html.parser")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_soup_object(url: str) -> bs4.BeautifulSoup:\n request_result=requests.get(url)\n soup = bs4.BeautifulSoup(request_result.text, \"html.parser\")\n return soup", "def get_soup(url):\n return BeautifulSoup(requests.get(url).content, 'lxml')", "def get_soup(url):\n\tresponse = urlopen(url)\n\t...
[ "0.6814495", "0.660653", "0.6560137", "0.6554772", "0.6494576", "0.64601004", "0.6459595", "0.63760823", "0.635851", "0.63270485", "0.6318628", "0.6290238", "0.6288079", "0.62309664", "0.62014806", "0.61822194", "0.61659354", "0.6163864", "0.6138467", "0.6116909", "0.60730344...
0.6700664
1
Drops Duplicate rows of a dataframe and returns a new dataframe
def drop_duplicate_rows(self): if self._pandas_flag: self.data_frame = self.data_frame.drop_duplicates() else: self.data_frame = self.data_frame.dropDuplicates()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop_duplicate_rows(df):\n\n\t# No. of duplicated rows\n\tndup_rows = get_duplicate_rows(df)\n\n\tprint('There are {} duplicated rows in the dataset.'.format(ndup_rows))\n\tif (ndup_rows > 0):\n\t\treturn df.drop_duplicates().reset_index(inplace=True, drop=True)\n\t\tprint('Dropped {} rows from the dataset.'.f...
[ "0.7790184", "0.75201464", "0.7498042", "0.74540764", "0.73879814", "0.6983016", "0.685712", "0.66678673", "0.6625269", "0.6616989", "0.647398", "0.6423255", "0.6331931", "0.61438155", "0.61273277", "0.60811055", "0.60457623", "0.60332304", "0.60044366", "0.60021377", "0.5980...
0.7992035
0
Returns a column with mean impute
def mean_impute(self, column_val): mean = np.mean(column_val) column_val = column_val.fillna(mean) return column_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def impute_col(X, lbound, ubound, impute):\n impute_value = impute or np.mean(X)\n res = []\n\n for row in X:\n # check bounds + nan\n if (row < lbound) | (row > ubound) | (row == np.nan):\n res.append(impute_value)\n else:\n res.append(row)\n\n return pd.Seri...
[ "0.6753506", "0.66848755", "0.6536078", "0.65116197", "0.63915306", "0.63915306", "0.63784784", "0.6277095", "0.6196567", "0.6173568", "0.6135697", "0.6101809", "0.60659343", "0.59350526", "0.59071493", "0.5869828", "0.58685917", "0.5855822", "0.5844723", "0.58297545", "0.581...
0.79800457
0
Returns a column with median impute
def median_impute(self, column_val): median = np.median(column_val) column_val = column_val.fillna(median) return column_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_median(self):\n med_value= self.df[self.col_name].median()\n return med_value", "def median(self):\n # TO DO\n pass", "def median_reduce_nb(col, a, *args):\n return np.nanmedian(a)", "def median(self):\n return self._lift(\"median\")", "def untruncatedMedian(self):\n ...
[ "0.7132904", "0.7132179", "0.67344713", "0.6644817", "0.65914947", "0.65914947", "0.65562975", "0.64692795", "0.6369368", "0.63178164", "0.63051146", "0.6288355", "0.6287742", "0.6262517", "0.6259268", "0.62411195", "0.6238342", "0.6221524", "0.6211956", "0.62029886", "0.6174...
0.8259281
0
Returns a column with mode impute
def mode_impute(self, column_val): mode = column_val.mode()[0] column_val = column_val.fillna(mode) return column_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dim_col_imputation(self, columns):\n for column in columns:\n if column in self.col_with_nulls:\n if not self._pandas_flag:\n mode = self.data_frame.select(column).toPandas().mode().values[0][0]\n self.data_frame = self.data_frame.fillna({...
[ "0.6803265", "0.66885465", "0.6305246", "0.61283094", "0.6033685", "0.5878893", "0.56957525", "0.5686108", "0.5580328", "0.5572175", "0.55651635", "0.55067277", "0.5500597", "0.5450436", "0.53094786", "0.5252943", "0.52335274", "0.5196935", "0.519194", "0.5184051", "0.5175050...
0.81367266
0
Does missing value imputation for dimension columns
def dim_col_imputation(self, columns): for column in columns: if column in self.col_with_nulls: if not self._pandas_flag: mode = self.data_frame.select(column).toPandas().mode().values[0][0] self.data_frame = self.data_frame.fillna({ column:mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def impute_missing(df):\n\n for name in df.select_dtypes(\"number\"):\n df[name] = df[name].fillna(0)\n for name in df.select_dtypes(\"category\"):\n df[name] = df[name].fillna(\"None\")\n return df", "def impute(data):\n for column in data:\n column_data = data[column]\n ...
[ "0.7324905", "0.72256345", "0.7161492", "0.6816343", "0.67061967", "0.6647299", "0.6621759", "0.6545607", "0.65372366", "0.6473981", "0.6416059", "0.633583", "0.6306558", "0.62950486", "0.6272269", "0.6213071", "0.6188394", "0.61664844", "0.61367524", "0.6077752", "0.60691655...
0.7296146
1
Does missing value imputation for date columns
def date_col_imputation(self, columns): for column in columns: if column in self.col_with_nulls: if not self._pandas_flag: mode = self.data_frame.select(column).toPandas().mode().values[0][0] self.data_frame = self.data_frame.fillna({ column:m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def impute_missing(df):\n\n for name in df.select_dtypes(\"number\"):\n df[name] = df[name].fillna(0)\n for name in df.select_dtypes(\"category\"):\n df[name] = df[name].fillna(\"None\")\n return df", "def fill_missing(df,strategy='mean', missingValue=np.nan):\n c_name = [n for n,d in d...
[ "0.7254043", "0.69089204", "0.68500495", "0.6516593", "0.6499719", "0.6430352", "0.6366027", "0.63304436", "0.6269109", "0.61844623", "0.6179404", "0.6122593", "0.6083724", "0.60802436", "0.60375494", "0.5999926", "0.5994645", "0.5935286", "0.59316367", "0.5894391", "0.588969...
0.72439456
1
Overrides 'log' from asyncore module to produce consistent logs
def log(self, message): #logs.logger.debug("asyncore log: %s" % message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, message):\n #logs.logger.debug(\"asyncore log: %s\" % message)\n pass", "def log(self, message):", "def log(self, message: str):", "def _log(self, message):\n pass", "def log(self, level, msg, *args, **kwargs):\n pass", "def _log_some_info(self):\n logging.inf...
[ "0.73945427", "0.7118917", "0.70199424", "0.6797812", "0.6741641", "0.66817963", "0.6626405", "0.6587077", "0.6551073", "0.65086126", "0.6453528", "0.64504427", "0.6399891", "0.6391882", "0.6391672", "0.6363379", "0.6359365", "0.630858", "0.6300749", "0.6300749", "0.6300023",...
0.73849773
1
Overrides 'log_info' from asyncore module (> consistent logs)
def log_info(self, message, msg_type='info'): #logs.logger.debug("asyncore log: %s, %s" % (msg_type, message)) pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _log_some_info(self):\n logging.info('info')", "def log_info(info_dict):\n pass", "def log_info(self, message, msg_type='info'):\n pass", "def __call__(self, *args, **kwargs):\n self.logger.info(*args, **kwargs)", "def info(msg):\n log('INFO', msg)", "def info(self, msg, *args)...
[ "0.76748985", "0.7508954", "0.7478658", "0.74724054", "0.74039376", "0.7348091", "0.7332698", "0.731194", "0.73074037", "0.72752136", "0.7265679", "0.72606015", "0.72431874", "0.7238077", "0.72319376", "0.7226217", "0.7172291", "0.71302015", "0.7127174", "0.7124708", "0.71090...
0.7822655
0
Overrides 'log' from asyncore module to produce consistent logs
def log(self, message): #logs.logger.debug("asyncore log: %s" % message) pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, message):\n #logs.logger.debug(\"asyncore log: %s\" % message)", "def log(self, message):", "def log(self, message: str):", "def _log(self, message):\n pass", "def log(self, level, msg, *args, **kwargs):\n pass", "def _log_some_info(self):\n logging.info('info')", ...
[ "0.7384894", "0.7118905", "0.7019657", "0.6797171", "0.674164", "0.6684011", "0.6627498", "0.65849006", "0.6552653", "0.6509476", "0.6451976", "0.6451083", "0.64013934", "0.639292", "0.63924044", "0.6362961", "0.6359021", "0.6308002", "0.63007325", "0.63007325", "0.6299947", ...
0.7394431
0
Connects a (free) synapse to an organ
def connect(self, organ_id, target=None): # pylint: disable=W0221 return _Synapse(None, organ_id, self.signal_filter, target)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect():", "def connect_stim(self):\n self.stim = h.NetStim()\n self.stim.number = self.stim_number\n self.stim.start = 9\n self.ncstim = h.NetCon(self.stim, self.cells[0].synlist[0])\n self.ncstim.delay = 1\n self.ncstim.weight[0] = self.stim_w # NetCon weight is ...
[ "0.5826735", "0.5756301", "0.5715454", "0.5674988", "0.56469446", "0.5569563", "0.55628157", "0.5496581", "0.54916644", "0.54078114", "0.5337364", "0.5337364", "0.53349596", "0.53349596", "0.53348106", "0.53348106", "0.53348106", "0.53348106", "0.53348106", "0.53348106", "0.5...
0.6115338
0
Feeds the neuron with some time. Neuron spends this time for network transmissions.
def feed(self, amount=network.default_listen_time): asyncore.loop(timeout=amount, count=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\n # initializing random network activity\n s_rand_T = np.zeros((self.T, self.N_rand))\n p_rand_T = np.zeros((self.T, self.N_rand))\n r_rand_T = np.zeros((self.T, self.N_rand))\n\n s_rand_T[0, :] = np.random.uniform(low=0, high=0.01, size=(self.N_rand))\n\n ...
[ "0.59352946", "0.58212686", "0.5665618", "0.5590267", "0.5576826", "0.5555696", "0.538787", "0.5384795", "0.5378508", "0.5374464", "0.533984", "0.53396386", "0.53359824", "0.5324451", "0.5315425", "0.52954316", "0.52941406", "0.5293779", "0.5293748", "0.52797425", "0.5269853"...
0.610036
0
Ensure that Photo throws an error when initializing without a rover.
def test_photo_init_error_no_rover(full_photo_params): del full_photo_params['rover'] with pytest.raises(KeyError): Photo(**full_photo_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_photo_init_error_no_rover_name(full_photo_params):\n del full_photo_params['rover']['name']\n with pytest.raises(KeyError):\n Photo(**full_photo_params)", "def test_photo_init_error_no_camera(full_photo_params):\n del full_photo_params['camera']\n with pytest.raises(KeyError):\n ...
[ "0.7327981", "0.7285726", "0.69040775", "0.6025558", "0.5830418", "0.5801151", "0.57529527", "0.5731759", "0.56452024", "0.560596", "0.5561814", "0.55181646", "0.5437797", "0.53377724", "0.53321636", "0.5331785", "0.53070265", "0.52995497", "0.5293179", "0.5253804", "0.525044...
0.78876144
0
Ensure that Photo throws an error when rover has no name.
def test_photo_init_error_no_rover_name(full_photo_params): del full_photo_params['rover']['name'] with pytest.raises(KeyError): Photo(**full_photo_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_photo_init_error_no_rover(full_photo_params):\n del full_photo_params['rover']\n with pytest.raises(KeyError):\n Photo(**full_photo_params)", "def test_photo_init_error_no_camera_name(full_photo_params):\n del full_photo_params['camera']['name']\n with pytest.raises(KeyError):\n ...
[ "0.74335694", "0.6996691", "0.65777767", "0.62055403", "0.58631593", "0.5822519", "0.5732228", "0.564817", "0.56342065", "0.5631213", "0.56236756", "0.56046647", "0.54850215", "0.5476429", "0.54721916", "0.5397466", "0.53893673", "0.53836226", "0.5371092", "0.5341296", "0.532...
0.7780296
0
Ensure that Photo throws an error when initializing without a camera.
def test_photo_init_error_no_camera(full_photo_params): del full_photo_params['camera'] with pytest.raises(KeyError): Photo(**full_photo_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_photo_init_error_no_camera_name(full_photo_params):\n del full_photo_params['camera']['name']\n with pytest.raises(KeyError):\n Photo(**full_photo_params)", "def test_photo_init_error_no_rover(full_photo_params):\n del full_photo_params['rover']\n with pytest.raises(KeyError):\n ...
[ "0.7336555", "0.69021696", "0.64276576", "0.639311", "0.6110695", "0.599289", "0.5914015", "0.580355", "0.5772003", "0.5674745", "0.56280774", "0.5610565", "0.5549142", "0.55140287", "0.5456024", "0.54418856", "0.5386257", "0.53360176", "0.53304255", "0.5298963", "0.5288704",...
0.7825097
0
Ensure that Photo throws an error when camera has no name.
def test_photo_init_error_no_camera_name(full_photo_params): del full_photo_params['camera']['name'] with pytest.raises(KeyError): Photo(**full_photo_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_photo_init_error_no_camera(full_photo_params):\n del full_photo_params['camera']\n with pytest.raises(KeyError):\n Photo(**full_photo_params)", "def test_photo_init_error_no_rover_name(full_photo_params):\n del full_photo_params['rover']['name']\n with pytest.raises(KeyError):\n ...
[ "0.7436314", "0.6993028", "0.66775084", "0.61754674", "0.6083545", "0.586327", "0.586057", "0.5841849", "0.57181287", "0.5708056", "0.5676451", "0.5587943", "0.5568266", "0.5557884", "0.55574", "0.5540384", "0.55287176", "0.55091625", "0.5501754", "0.5477951", "0.54662216", ...
0.7702317
0
Test that one of each type of model can be added to the DB.
def test_db_add(dbtransaction, model_test_params): for model_name, params in model_test_params: model = globals()[model_name] instance = model(**params) DBSession.add(instance) DBSession.flush() assert DBSession.query(model).count() == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_content_add_model(self):\n content = Content(header = \"Test_Header\", content = \"Test_Content\")\n db.session.add(content)\n db.session.commit()\n self.assertEqual(Content.query.filter_by(header = \"Test_Header\", content = \"Test_Content\").count(), 1)", "def test_save_mod...
[ "0.71553296", "0.7052713", "0.7023706", "0.69520324", "0.69439405", "0.6906203", "0.6798016", "0.67727244", "0.6726556", "0.6674387", "0.6660991", "0.6636223", "0.66340625", "0.66049224", "0.66046995", "0.65821993", "0.65720916", "0.6555964", "0.6542831", "0.65185773", "0.651...
0.7535045
0
Test Rover, Photo have correct relationship after initialization.
def test_photo_rover_relationship(dbtransaction, rover_params, camera_params, photo_params): rover = Rover(**rover_params) camera_params['rover_name'] = rover.name camera_params['rover_name'] = rover.name camera = Camera(**camera_params) photo_params['camera_name'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_photo_rover_details(dbtransaction, rover_params, camera_params,\n photo_params):\n rover = Rover(**rover_params)\n camera_params['rover_name'] = rover.name\n camera_params['rover_name'] = rover.name\n camera = Camera(**camera_params)\n photo_params['camera_name']...
[ "0.72902995", "0.70749396", "0.6735969", "0.67182547", "0.6443625", "0.6435531", "0.63710725", "0.6363594", "0.63464284", "0.6342138", "0.633395", "0.6321697", "0.63158756", "0.62916815", "0.6260897", "0.62325627", "0.62233543", "0.61103344", "0.61088777", "0.6102099", "0.608...
0.7645104
0
Test that Photo can access Camera's attributes through relationship.
def test_photo_camera_relationship(dbtransaction, rover_params, camera_params, photo_params): rover = Rover(**rover_params) camera_params['rover_name'] = rover.name camera_params['rover_name'] = rover.name camera = Camera(**camera_params) photo_params['camera_name'] = camera.name photo = Photo(*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_photo_rover_relationship(dbtransaction, rover_params, camera_params,\n photo_params):\n rover = Rover(**rover_params)\n camera_params['rover_name'] = rover.name\n camera_params['rover_name'] = rover.name\n camera = Camera(**camera_params)\n photo_params['cam...
[ "0.696341", "0.69207513", "0.65761304", "0.65209633", "0.6415182", "0.626881", "0.6200796", "0.6186633", "0.61462605", "0.60756433", "0.5952229", "0.59482497", "0.5902911", "0.5896652", "0.5885544", "0.58632165", "0.5839806", "0.58376", "0.5796789", "0.5764115", "0.57595253",...
0.77699107
0
Test get_rov_sol return value for a Rover with one Camera.
def test_rov_sol_one_camera(dbtransaction, global_environ, rover_params, camera_params, sol): rover = rover_params['name'] # camera = '_'.join((rover, camera_params['name'])) DBSession.add(Rover(**rover_params)) DBSession.add(Camera(**camera_params)) DBSession.flush() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_rov_sol_negative_day(dbtransaction, global_environ, photo_params,\n rover_params, camera_params):\n rover = rover_params['name']\n sol = photo_params['sol']\n photo = Photo(**photo_params)\n DBSession.add(Rover(**rover_params))\n DBSession.add(Camera(**c...
[ "0.6838757", "0.6823348", "0.67785597", "0.6409363", "0.616384", "0.58749026", "0.5647635", "0.5620704", "0.5497842", "0.5494408", "0.54805183", "0.54371023", "0.54371023", "0.52855474", "0.5234467", "0.5222341", "0.5198283", "0.5148809", "0.5148206", "0.51439846", "0.5105485...
0.73686576
0
Test return value for get_rov_sol with one Photo.
def test_rov_sol_one_photo(dbtransaction, global_environ, rover_params, camera_params, photo_params): rover = rover_params['name'] sol = photo_params['sol'] camera = '_'.join((rover, camera_params['name'])) photo = Photo(**photo_params) DBSession.add(Rover(**rover_params))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_rov_sol_blank_day(dbtransaction, global_environ, photo_params,\n rover_params, camera_params):\n rover = rover_params['name']\n sol = photo_params['sol']\n photo = Photo(**photo_params)\n DBSession.add(Rover(**rover_params))\n DBSession.add(Camera(**camera_...
[ "0.6875754", "0.6852485", "0.67193556", "0.6707883", "0.6210592", "0.59938616", "0.58828855", "0.5871197", "0.5728891", "0.56868136", "0.55148673", "0.5502346", "0.5463598", "0.5460634", "0.544915", "0.5441245", "0.5415902", "0.5412112", "0.540413", "0.54036087", "0.53478014"...
0.74210066
0
Builds the occupancy map centered around a human from the agents around it.
def build_occupancy_map(human : Human, other_agents : np.array, cell_num : int, cell_size : float, om_channel_size : int) -> np.array: other_px = other_agents[:, 0] - human.px other_py = other_agents[:, 1] - human.py # new x-axis is in the direction of human's velocity human_velocity_angle = np.arctan2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_occupancy_map_torch(human: torch.Tensor, other_agents: torch.Tensor, cell_num: int, cell_size: float,\n om_channel_size: int) -> torch.Tensor:\n other_px = other_agents[:, 0] - human[0]\n other_py = other_agents[:, 1] - human[1]\n\n # new x-axis is in the direction of huma...
[ "0.720479", "0.63248587", "0.6324543", "0.6063618", "0.5903746", "0.587739", "0.5818112", "0.5810216", "0.5787515", "0.5699472", "0.5636457", "0.5619639", "0.5585009", "0.5582353", "0.5524585", "0.55178237", "0.5461033", "0.5446", "0.5439414", "0.54290307", "0.54025805", "0...
0.743572
0