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
Returns a single host dict by its hostname or alias. If create_host is True (default) a new user will be derived from the default user template.
def by_name(name, create_user=True): return get_obj_by_name(OBJT_HOST, name, create_user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_host(self, object_name, user_key = None):\n\t\treturn self.get_object('host',object_name, user_key = user_key)", "def get(self, **kwargs):\n if not any([i in kwargs for i in ('addr', 'address', 'host')]):\n raise TypeError('Expected addr, address, or host.')\n return self.dbget('...
[ "0.6629961", "0.60218567", "0.5988932", "0.592875", "0.5875189", "0.58727497", "0.5856598", "0.5808289", "0.578193", "0.5696028", "0.5666245", "0.56256807", "0.56175834", "0.5569968", "0.55674946", "0.5515782", "0.5486324", "0.54789126", "0.5478748", "0.54766566", "0.54755056...
0.61675847
1
Returns the default values of a host
def get_defaultvalues(host): return get_obj_defaultvalues(OBJT_HOST, host)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_host_variables(self, host):\n vars = {}\n for i in self.parsers:\n vars.update(i.get_host_variables(host))\n return vars", "def get_defaults(self):\n\t\treturn self.__defaults", "def _connection_info():\n defaults = {'host': 'http://127.0.0.1:8081',\n '...
[ "0.650391", "0.62575424", "0.6218614", "0.6216953", "0.6203403", "0.61912376", "0.6110315", "0.6091161", "0.60520464", "0.59781325", "0.5958998", "0.59001625", "0.5893235", "0.58595127", "0.5839163", "0.5815324", "0.5801299", "0.57845575", "0.5763748", "0.57625663", "0.576087...
0.89422065
0
Returns bad response on response validation errors.
def on_response_validation_error(err): return jsonify(message='Bad response'), 500
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_response():\n return Response(\n '{\"error\": \"Invalid request\"}',\n status=400,\n mimetype='application/json'\n )", "def validate_response(self, response: requests.Response) -> None:\n if 400 <= response.status_code < 500:\n msg = (\n ...
[ "0.7957971", "0.7649618", "0.74914646", "0.7456368", "0.73698705", "0.73698705", "0.73698705", "0.7343411", "0.73405534", "0.7328041", "0.7253684", "0.7207405", "0.71976", "0.71240443", "0.71097517", "0.708896", "0.7068561", "0.6963485", "0.6949408", "0.6906186", "0.68362963"...
0.82996505
0
simplifies writing of modulo num
def apply_mod(num): return num % MODULO
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mod(num1, num2):\n return num1 % num2", "def mod(num1, num2):\n\n return num1 % num2", "def mod(numbers):\n result = numbers[0]\n for i in numbers[1:]:\n result = result % i\n return result", "def remainder(numbers):\n \n return numbers[0] % numbers[1]", "def mod(num1, num2)...
[ "0.7439163", "0.74280417", "0.71949303", "0.71195555", "0.70992845", "0.70734406", "0.697118", "0.69260424", "0.6877001", "0.68180573", "0.6809527", "0.6780207", "0.677797", "0.6771008", "0.67468256", "0.67297643", "0.67297643", "0.6689993", "0.66676354", "0.6664751", "0.6631...
0.84601164
0
r"""Sets the pixmap and resizes the Widget to the size of the pixmaps as this is just connected to the Scene and the image_viewer will display the scene respectively a view into the scene
def setPixmap(self, pixmap: QPixmap): self.pixmap = pixmap self.resize(self.pixmap.size()) self.sRequestFitInView.emit(QRectF(self.pixmap.rect()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resizeEvent(self, event):\n size = self.size()\n size = QSize(int(size.width()),int(size.height()))\n\n scaledPix = self.pixmap.scaled(size, Qt.KeepAspectRatio, transformMode = Qt.FastTransformation )\n self.setPixmap(scaledPix)", "def display(self):\n image_qt = ImageQt.Im...
[ "0.6906152", "0.68018556", "0.67493755", "0.66781586", "0.664704", "0.65599024", "0.65227294", "0.6480243", "0.6434544", "0.6400854", "0.6380686", "0.63757336", "0.63677216", "0.6359593", "0.63545936", "0.6313794", "0.6313474", "0.62604856", "0.6237176", "0.6208776", "0.61922...
0.6942845
0
Handles both shape and vertex highlighting in one call as I then only have to update it once
def handleShapeHovered(self, shape_idx: int, closest_vertex_shape: int, vertex_idx: int): self.on_ResetHighlight() if shape_idx > -1: self.labels[shape_idx].isHighlighted = True self.handleVertexHighlighted(closest_vertex_shape, vertex_idx) self.update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self, vertex_highlighting=False):\n pass", "def highlight_existing_shape(self, shape_id):\n\n original_color = self.get_vector_object(shape_id).color\n colors = color_utils.get_full_hex_palette(self.variables.highlight_color_palette, self.variables.highlight_n_colors_cycle)\n ...
[ "0.71883494", "0.6647079", "0.6636567", "0.6160493", "0.60443217", "0.59967685", "0.59644943", "0.5855235", "0.5832109", "0.57607514", "0.5742571", "0.57149696", "0.55284345", "0.55280054", "0.55238646", "0.5516578", "0.55148584", "0.5509678", "0.5496163", "0.5492145", "0.548...
0.6718518
1
r"""Resets the highlighting attribute
def resetHighlight(label: Shape): label.isHighlighted = False label.vertices.highlightedVertex = -1 return label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __unhighlight(self):\n self.unhighlight()", "def _reset(self):\n\t\tself._style = TextStyle()", "def no_highlight(): #py:no_highlight\n RUR._no_highlight_()", "def restore_default_highlights(bv=None):\n highlight_set(covdb.total_coverage)\n log.log_info(\"Default highlight colors restore...
[ "0.7720191", "0.71484816", "0.69789344", "0.6960583", "0.6897859", "0.6886628", "0.6730216", "0.6714988", "0.67105377", "0.66212463", "0.66007227", "0.6596942", "0.656078", "0.6525315", "0.64958566", "0.6462456", "0.6429444", "0.64173263", "0.63748735", "0.63467145", "0.63433...
0.7469723
1
Limit listed photos to those owned by the user.
def get_queryset(self): return Photo.objects.filter(user=self.request.user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n username = self.kwargs.get('username', None)\n filters = {}\n if username:\n filters['user__username'] = username\n return super(PhotosListView, self).get_queryset().filter(**filters)", "def filter_queryset(self, request, queryset, view):\n ...
[ "0.64396197", "0.6325318", "0.631855", "0.6233492", "0.6211919", "0.6111809", "0.6091555", "0.60355544", "0.5955981", "0.5822542", "0.5776902", "0.57308805", "0.5698283", "0.5678779", "0.56709296", "0.56704575", "0.56508374", "0.5634454", "0.5628911", "0.5567986", "0.5567196"...
0.685758
0
x ari8mos Epistrefei tin timi 1/(2 + 3/(x+4) + 1/x). >>> f(1) 0.5 >>> round(f(2), 4) 0.3333 >>> round(f(8), 4) 0.8889
def f(x): """ Xrhsimopoihste MONO ekfraseis klhshs, p.x., stis add, mul, pow, sqrt, truediv, ... OXI infix telestes (+, /, ...) """ return round(truediv(1,add(add(2,truediv(3,add(x,4))),truediv(1,x))),4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f(x):\n\treturn (sc.log(x**2+5)*sc.cos(0.8*x)+3.5*x)/(sc.e**(x/10))", "def f(x):\n\treturn np.sin(x / 5.0) * np.exp(x / 10.0) + 5 * np.exp(-x / 2.0)", "def f4(x):\n return sin(x)/x", "def f(x):\n return math.exp(-x**2)/(1+x**2)+(2*math.cos(x)**2)/(1+(x-4)**2)", "def erf(x):\n return 0.0", ...
[ "0.7804204", "0.7319616", "0.7271761", "0.7207731", "0.7081612", "0.6894789", "0.6824029", "0.6681554", "0.6641251", "0.6607357", "0.6604795", "0.6576071", "0.6565177", "0.6556117", "0.6518178", "0.64871585", "0.6469389", "0.646889", "0.6410249", "0.64093155", "0.6365752", ...
0.7505399
1
x,y ari8moi Epistrefei timi isi me sqrt(add(pow(add(x, y), 2), pow(sub(x, y), 2))) >>> g(1, 1) 2.0 >>> g(1.5, 1.5) 3.0 >>> round(g(3, 1), 5) 4.47214
def g(x, y): """ Xrhsimopoihste infix telestes(+, -, *, **, ...) OXI ekfraseis klhshs """ return ((((x+y)**2)+((x-y)**2))**(1/2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pythagoras(x, y):\n\tprint \"Square-rooting squares of a and b via a function...\",\n\treturn round(sqrt(x ** 2 + y ** 2), 3)", "def g(x, y=1):\r\n return x ** 2 + y", "def hypotenuse(x,y):\n xx = multiply(x, x)\n yy = multiply(y, y)\n zz = add(xx, yy)\n return sqrt(zz)", "def sqrt(a):", ...
[ "0.6900435", "0.6853186", "0.6589764", "0.6331073", "0.6273317", "0.612009", "0.61199635", "0.6081252", "0.60773027", "0.6076306", "0.606729", "0.6044322", "0.60405034", "0.6026022", "0.602443", "0.6017192", "0.6009642", "0.60044956", "0.6003208", "0.59706", "0.5939834", "0...
0.71866375
0
Symplhrwste ta kena wste na didetai to akolou8o apotelesma >>> func0('I') + ' ' + func0('Bi') + ' ' + 'Spider' 'Itsy Bitsy Spider'
def func0(s): return s+"tsy"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def func2(s):\n return(s+'-'+s)", "def functionName6(self, parameter1):\n say = \"say\"\n fu = \"fu\"\n return say + \" \" + fu", "def do(s):\r\n return get_AA_subs(generate_mutString(s))", "def question_12(one_string: str, two_string: str) -> str:\n return one_string + two_stri...
[ "0.61380494", "0.5769687", "0.57303476", "0.5698516", "0.55588144", "0.55307215", "0.55186653", "0.55057865", "0.5462907", "0.54281235", "0.5417769", "0.5371464", "0.5346984", "0.5335251", "0.5330256", "0.5282163", "0.5243402", "0.52318233", "0.52143747", "0.5206821", "0.5198...
0.74949634
0
Symplhrwste ta kena wste na didetai to akolou8o apotelesma >>> func2('la') 'lala' >>> func2(func2('la')) 'lalalala' >>> func2(func2(func2('la'))) 'lalalalalalalala'
def func2(s): return(s+'-'+s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def func2():", "def func0(s):\n\n return s+\"tsy\"", "def func1 (arg1, arg2):\n arg1 = arg2\n return arg1", "def second(a, b):", "def func2():\n return None", "def func2():\n return None", "def func2():\n print \"FUNCTION 2 WORKS!\"", "def func1():", "def _func2_undecorated(arg1=N...
[ "0.64997566", "0.62055784", "0.6156945", "0.5778348", "0.5693035", "0.5693035", "0.56810576", "0.56753767", "0.5598338", "0.5527507", "0.55036", "0.54614425", "0.54521406", "0.54373187", "0.537936", "0.5350809", "0.5327767", "0.53065926", "0.53026664", "0.52947396", "0.526200...
0.63625854
1
Ypologizei to a8roisma twn pshfiwn synexws ews otou to apotelesma exei ena mono pshfio x 8etikos akeraios >>> keep_summing(3) 3 >>> keep_summing(32) 5 >>> keep_summing(344) 2 >>> keep_summing(999) 9 >>> print(keep_summing(999)) 9
def keep_summing(x): """ GRAPSTE TON KWDIKA SAS APO KATW """ s=0 k=0 while(x>0): s = s+(x%10) x = x//10 while(s>9): while(s>0): k = k + (s%10) s = s//10 s = k return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem077():\n\n cond = lambda n: num_prime_sum_ways(n) > 5000\n ans = next(filter(cond, itertools.count(2)))\n return ans", "def truncatable_primes():\n list_tp = []\n i = 8\n while len(list_tp) < 11:\n if is_truncatable(i):\n list_tp.append(i)\n i += 1\n i...
[ "0.57436836", "0.5371317", "0.53180903", "0.5316107", "0.527315", "0.527162", "0.51575464", "0.50923574", "0.5087488", "0.5067311", "0.50259244", "0.49990165", "0.49702796", "0.49467757", "0.49435613", "0.49422958", "0.49001965", "0.4887011", "0.48768586", "0.48740196", "0.48...
0.70589316
0
Emfanizei ton xarakthra + 'h x fores >>> draw_number(5) +++++ >>> draw_number(0) >>> draw_number(3) >>> draw_number(2) == None ++ True
def draw_number(x): """ GRAPSTE TON KWDIKA SAS APO KATW """ if(x>0): while(x>0): print("+",end='') x = x-1 print("",end="\n") if(x<0): while(x<0): print("-",end='') x = x+1 print("",end="\n")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_g_number():\n return fake.bothify(text='??#########')", "def draw_number(self):\n text_color = (0, 0, 0)\n if self.bombs_around == 1:\n text_color = (0, 0, 150)\n if self.bombs_around == 2:\n text_color = (0, 150, 0)\n if self.bombs_around == 3:\n ...
[ "0.6625197", "0.6267678", "0.6067534", "0.6010962", "0.6001872", "0.5981044", "0.5974195", "0.5958875", "0.5908862", "0.5780947", "0.57210135", "0.5682297", "0.56792927", "0.5621736", "0.56105256", "0.5583004", "0.55642796", "0.5532919", "0.54764783", "0.5461584", "0.5452835"...
0.722774
0
Ypologizei to mikrotero pshfio tou x x 8etikos akeraios >>> min_digit(45874543) 3 >>> min_digit(98287334) min_digit(8) 6
def min_digit(x): """ GRAPSTE TON KWDIKA SAS APO KATW """ s = 10 while(x>0): if(s>(x%10)): s = x%10 x = x//10 return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_digit_14_min_base(self):\n expected = 6\n digit = 14\n\n assert expected == min_base(digit)", "def minimumNumber(n, password):\n lower = 0\n upper = 0\n num = 0\n special = 0\n\n for let in password:\n if re.search(r'[a-z]', let):\n lower = 1\n ...
[ "0.6890375", "0.66855925", "0.6640512", "0.6503085", "0.6352919", "0.6293025", "0.60733414", "0.60316145", "0.6022881", "0.5976361", "0.59730667", "0.5955225", "0.59172624", "0.5866273", "0.5829663", "0.5823117", "0.5795223", "0.57707405", "0.5746424", "0.5728074", "0.5728074...
0.77921313
0
Ypologizei to plh8os twn emfanisewn enos pshfiou x 8etikos akeraios i pshfio (1 = 1o pshfio apo dexia, 2 = 2o apo dexia, ktl.) >>> count_digit(1000, 1) 3 >>> count_digit(12944342, 2) 3 >>> count_digit(121,1) == 2 True
def count_digit(x, i): """ GRAPSTE TON KWDIKA SAS APO KATW """ su = 0 s = 0 k = x while(i>1): x = x//10 i = i-1 s = x%10 while(k>0): if((k%10)==s): su = su + 1 k = k//10 return su
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_digits(n):\n return len(str(n))", "def ndigits(n):\n return len(str(abs(n)))", "def digit_count(x):\n return int(math.floor(math.log10(x)) + 1)", "def unique_digits(n):\n \"*** YOUR CODE HERE ***\"\n count = 0\n for k in range(0, 10):\n if has_digit(n, k):\n ...
[ "0.7340401", "0.7093553", "0.66344553", "0.6602231", "0.65825194", "0.65592545", "0.64974916", "0.64576924", "0.6397428", "0.62622404", "0.62432045", "0.6186722", "0.6159538", "0.61126745", "0.6107705", "0.60876423", "0.60841936", "0.60686624", "0.60594434", "0.6050491", "0.6...
0.76411873
0
Read characters in the lexer until valid returns False. Returns the full string which matched the valid function.
def _read(self, valid): start = self.pos while valid(self.char) and self.pos < self.length: self._read_char() return self.data[start : self.pos]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_until(self, chars):\n\n start_index = self.index\n\n while self.index < self.length and self.xtext[self.index] not in chars:\n self.index += 1\n\n assert self.index < self.length\n\n return self.xtext[start_index:self.index]", ...
[ "0.59841585", "0.57557213", "0.5655832", "0.56430787", "0.5590526", "0.5502035", "0.5451717", "0.543003", "0.5401282", "0.536999", "0.5287866", "0.52811235", "0.52096885", "0.5209315", "0.5179383", "0.51660734", "0.5112536", "0.51015806", "0.5095416", "0.5086354", "0.5068716"...
0.6585572
0
Read a character from input advancing the cursor.
def _read_char(self): if self.read_pos >= len(self.data): self.char = "" else: self.char = self.data[self.read_pos] self.pos = self.read_pos self.read_pos += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _readchar(self):\n if len(self.user) == 0:\n return sys.stdin.read(1)\n\n else:\n iRet = self.user[0]\n self.user = self.user[1:]\n return iRet", "def _readchar() -> str: # pragma: no cover\n if not sys.stdin.isatty():\n return sys.stdin.re...
[ "0.7571372", "0.75443214", "0.73233837", "0.7198287", "0.71166", "0.705326", "0.69643044", "0.6880996", "0.6811291", "0.6751959", "0.6630639", "0.6599619", "0.6560791", "0.64894485", "0.64808", "0.6374758", "0.6315922", "0.6314672", "0.6304695", "0.6288336", "0.62472695", "...
0.7585787
0
Imports the module that is to be interpreted as the main module. pyextensions is often invoked with a script meant to be run as the main module its source is transformed with the s (or source) option,
def import_main(name): config.MAIN_MODULE_NAME = name return importlib.import_module(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exec_module(self, module):\n\n if not self.filename.endswith(config.FILE_EXT) and not self.filename.endswith(\n \"__init__.py\"\n ):\n print(\"Fatal error: ExtensionLoader is asked to load a normal file.\")\n print(\"filename:\", self.filename)\n print(...
[ "0.65324384", "0.64057744", "0.62598825", "0.6077473", "0.6036916", "0.5985425", "0.59391975", "0.5933208", "0.59137946", "0.58559144", "0.58559144", "0.5842428", "0.5842031", "0.5836723", "0.5833713", "0.58056444", "0.5782057", "0.5755326", "0.5733975", "0.5733975", "0.57339...
0.71191955
0
import the source code, transforma it before executing it so that it is known to Python.
def exec_module(self, module): if not self.filename.endswith(config.FILE_EXT) and not self.filename.endswith( "__init__.py" ): print("Fatal error: ExtensionLoader is asked to load a normal file.") print("filename:", self.filename) print("Expected extensio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_python_source(self, module, source):\n\n return source", "def importCode(code, name, add_to_sys_modules=False):\r\n import sys, imp\r\n\r\n module = imp.new_module(name)\r\n \r\n exec code in module.__dict__\r\n if add_to_sys_modules:\r\n sys.modules[name] = module\r\n\r\n...
[ "0.7041533", "0.64492446", "0.6442441", "0.6277837", "0.6273036", "0.62038636", "0.6173961", "0.6034582", "0.5993349", "0.5945107", "0.59193313", "0.58717954", "0.58709335", "0.5852815", "0.58517003", "0.5814591", "0.5814591", "0.58098817", "0.5801209", "0.57900393", "0.57634...
0.67737865
1
Writes an html file showing the difference between the original and the transformed source.
def write_html_diff(self, name, original, transformed): html = name + ".html" fromlines = original.split("\n") tolines = transformed.split("\n") diff = difflib.HtmlDiff().make_file( fromlines, tolines, name + "." + config.FILE_EXT, name + ".py" ) with open(ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_html_diff(diff_output):\n diff_output_file = tempfile.NamedTemporaryFile(delete=False)\n with open(diff_output_file.name, 'w') as t:\n t.write(diff_output)\n\n # Use the default colorscheme on a light background for the\n # generated html\n diff_colorize_cmd = shlex.split(\n ...
[ "0.67266417", "0.65682834", "0.6520338", "0.6440082", "0.6222954", "0.6218581", "0.6206595", "0.6205092", "0.6182369", "0.6151593", "0.61094284", "0.60966027", "0.60597765", "0.60160697", "0.60086703", "0.597496", "0.59409356", "0.5888599", "0.58799285", "0.5873379", "0.58676...
0.8478159
0
Converts an ``Any`` protobuf to the specified message type.
def from_any_pb(pb_type, any_pb): msg = pb_type() if not any_pb.Unpack(msg): raise TypeError( 'Could not convert {} to {}'.format( any_pb.__class__.__name__, pb_type.__name__)) return msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pack_Any(msg):\n if msg is None:\n return None\n\n result = any_pb2.Any()\n result.Pack(msg)\n return result", "def _create_any(x):\n new_any = test_any_pb2.MessageWithAny().my_any\n new_any.Pack(x)\n return new_any", "def _ConvertAnyMessage(self, value, message, path):\n if isinstance(value, ...
[ "0.7126968", "0.66563433", "0.6475371", "0.63823396", "0.62809163", "0.53274417", "0.527759", "0.5226287", "0.50681186", "0.49302799", "0.48690864", "0.48633096", "0.47665414", "0.47246772", "0.4702296", "0.46796158", "0.46623188", "0.46507588", "0.4640827", "0.46358275", "0....
0.78045005
0
Can be overridden by a subclass to hook into the matching of the request.
def match_request(self): try: url_rule, self.request.view_args = \ self.url_adapter.match(return_rule=True) self.request.url_rule = url_rule except HTTPException as e: self.request.routing_exception = e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_request(self, request, response):\n ...", "def process(self, request):\n pass", "def __call__(self, request):", "def process_request(self, request):\n return None", "def process_request(self, req):\n return None", "def process_request(self, request):\n rais...
[ "0.6908388", "0.6870007", "0.686559", "0.6744623", "0.6741862", "0.672604", "0.6700192", "0.6583313", "0.6478586", "0.638393", "0.6293519", "0.62806493", "0.62801313", "0.6277613", "0.62571067", "0.6238866", "0.6235524", "0.620396", "0.6201966", "0.61397576", "0.6138776", "...
0.6930013
0
get cpu temperature using vcgencmd
def get_cpu_temperature(): process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE) output, _error = process.communicate() return float(output[output.index('=') + 1:output.rindex("'")])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cpu_temperature():\n\n output = \"\"\n\n try:\n process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)\n output, _error = process.communicate()\n output = str(output)\n except Exception:\n logger.error(\"Exception while reading cpu temp\")\n\n float_temp = 0\n\n ...
[ "0.7961807", "0.7516922", "0.7404315", "0.7328762", "0.72872525", "0.726738", "0.70768756", "0.6978585", "0.69713825", "0.6902673", "0.68359214", "0.67305464", "0.66349685", "0.65609646", "0.6480483", "0.64705694", "0.6459016", "0.64148575", "0.6406313", "0.63737273", "0.6368...
0.80389243
0
Gets certificate map entry.
def Get(self, entry_ref): get_req = self.messages.CertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesGetRequest( name=entry_ref.RelativeName()) return self._service.Get(get_req)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_map(self):\n return self.map", "def get_certificate(self, cert_id):\r\n return self.ssl.getObject(id=cert_id)", "def cert(self):\n return self._cert", "def get(self, cache_id):\n return self.certificates.get(cache_id)", "def __getitem__(self, key):\n ndx = self._f...
[ "0.6165978", "0.5772128", "0.568349", "0.5651153", "0.5645807", "0.55815387", "0.5579765", "0.557887", "0.5559984", "0.5441365", "0.5436712", "0.5408322", "0.5396146", "0.5364751", "0.5355108", "0.53274196", "0.53168195", "0.5299229", "0.52908343", "0.52768815", "0.52768815",...
0.5991944
1
Deletes certificate map entry.
def Delete(self, entry_ref): delete_req = self.messages.CertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesDeleteRequest( name=entry_ref.RelativeName()) return self._service.Delete(delete_req)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, key):\n self.map.pop(key, None)", "def delete(self, entry): # Hashmap.delete\n\n entry.delete()\n\n # remove the entry from the hashmap\n list=self.contentHash[entry.hexdigest]\n newlist = []\n for e in list:\n if e != entry...
[ "0.6904046", "0.6832291", "0.6776447", "0.67669976", "0.6742739", "0.66874945", "0.6667151", "0.65369827", "0.6281584", "0.6236622", "0.62125397", "0.62125397", "0.6212534", "0.6177583", "0.612269", "0.6111177", "0.61072004", "0.61011654", "0.60283065", "0.601049", "0.6008433...
0.6933377
0
Updates a certificate map entry. Used for updating labels, description and attached certificates.
def Patch(self, entry_ref, labels=None, description=None, cert_refs=None): certificate_map_entry = self.messages.CertificateMapEntry() updated_fields = [] if labels is not None: certificate_map_entry.labels = labels updated_fields.append('labels') if description is not None: certificat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, update):\n\n params = shlex.split(update)\n if params[0] in self.addr:\n self.addr[params[0]].update(*params)\n\n else:\n a = Addr(self)\n # add both name and IP address\n self.addr[params[0]] = a\n self.addr[params[1]] = ...
[ "0.5541341", "0.53984946", "0.5396106", "0.53094494", "0.5294186", "0.526122", "0.5246804", "0.5242925", "0.5234264", "0.51917976", "0.51388353", "0.51115656", "0.5084047", "0.50568765", "0.5051519", "0.50308716", "0.5008161", "0.49916035", "0.49732277", "0.4966167", "0.49259...
0.6769963
0
Generate tasks containing two addends with a sum less or equal 10.
def generate_plus_in_10space_tasks(self): task_list = [] for _ in range(self.no_of_tasks): while True: x = random.randint(0, 9) y = random.randint(0, 9) result = x + y if result <= 10: operation = " + " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_plus_minus_in_10space_tasks(self):\n task_list = []\n\n # https://stackoverflow.com/a/6486895/6597765\n plus_minus = [random.randint(1, 2) for i in range(self.no_of_tasks)]\n\n for i in range(self.no_of_tasks):\n x = random.randint(0, 9)\n y = random.r...
[ "0.6856205", "0.59472996", "0.56959444", "0.56595284", "0.5618493", "0.5537565", "0.55292755", "0.54505646", "0.5360406", "0.53035504", "0.5285208", "0.5230644", "0.52279437", "0.51888925", "0.5181251", "0.5178015", "0.51722014", "0.5169594", "0.516696", "0.5156897", "0.50666...
0.7023091
0
Generate tasks containing two addends with a sum less or equal 10 or tasks containing a minuend and a subtrahend with a difference higher or equal 0. The number of plus tasks and the number of minus tasks is also random.
def generate_plus_minus_in_10space_tasks(self): task_list = [] # https://stackoverflow.com/a/6486895/6597765 plus_minus = [random.randint(1, 2) for i in range(self.no_of_tasks)] for i in range(self.no_of_tasks): x = random.randint(0, 9) y = random.randint(0, 9) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_plus_in_10space_tasks(self):\n task_list = []\n for _ in range(self.no_of_tasks):\n while True:\n x = random.randint(0, 9)\n y = random.randint(0, 9)\n result = x + y\n if result <= 10:\n operation ...
[ "0.73492134", "0.71207744", "0.6193745", "0.60952926", "0.59697425", "0.588848", "0.5736932", "0.5665107", "0.56328374", "0.5631857", "0.5624525", "0.553134", "0.5522844", "0.550593", "0.55019504", "0.5480469", "0.54450953", "0.5431656", "0.542974", "0.54256785", "0.5320747",...
0.77595276
0
returns an email address as a unquoted unicode string
def decode_email_address(address, charset="utf8"): name = decode_email_header(address[0]) addr = address[1] addr = "<" + addr + ">" if not name: return addr return name + " " + addr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_email(email):\n return", "def email(email_str):\n if is_valid_email(email_str):\n return email_str\n else:\n raise ValueError('{} is not a valid email'.format(email_str))", "def email_address(self) -> \"str\":\n return self._attrs.get(\"emailAddress\")", "def _extract...
[ "0.71394217", "0.702159", "0.69071203", "0.68899196", "0.6840699", "0.6702935", "0.66950506", "0.65692395", "0.6528242", "0.65049773", "0.65012676", "0.64955735", "0.6491553", "0.6484322", "0.6463048", "0.6436164", "0.639294", "0.63714993", "0.6341899", "0.6336248", "0.630566...
0.71918446
0
checks a given s3 location for new emails
def check_mail_dir(self, directory="", update=False): directory = (self.s3_base_dir + "/" + directory.strip("/")).strip("/") objects = self.client.list_objects(self.s3_bucket, directory) results = [] for obj in objects: tmp = tempfile.NamedTemporaryFile(mode='w',delete=F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handler(event, context):\n message = [record['body'] for record in event.get('Records', [])]\n email_record = json.loads(message[0])[\"Records\"][0]\n\n new_email = [(email_record['s3']['bucket']['name'],\n urllib.parse.unquote(email_record['s3']['object']['key']))]\n\n if new_emai...
[ "0.5955936", "0.5538886", "0.5537708", "0.550546", "0.5364438", "0.53589046", "0.5358571", "0.5334869", "0.52795297", "0.52528745", "0.5246856", "0.521892", "0.5208308", "0.5185604", "0.51778376", "0.51601833", "0.51424307", "0.51229244", "0.5106424", "0.5093459", "0.5091574"...
0.63587916
0
Calculate and save the ETag value.
def calculate_etag_value(self) -> str: if not self.pk: warnings.warn( "You should not calculate ETags on unsaved objects", RuntimeWarning ) self._etag = calculate_etag(self) self.save(update_fields=["_etag"]) return self._etag
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_etag(self):\n return None", "def _get_etag():\n now = datetime.utcnow().isoformat()\n etag_src = \"%s--%s-%s\" % (request.script_root, request.path, now,)\n etag = hashlib.sha1(etag_src.encode('utf8', 'replace')).hexdigest()\n return etag", "def setETag(etag):", "def compute_et...
[ "0.6806306", "0.66351354", "0.6533135", "0.6444931", "0.63672316", "0.6171583", "0.6171583", "0.6171583", "0.6171583", "0.6171583", "0.6171583", "0.6171583", "0.61630785", "0.61630785", "0.61630785", "0.61630785", "0.61630785", "0.61630785", "0.61630785", "0.61630785", "0.616...
0.78844357
0
Check if the frame has torch. related bits
def has_tensor_in_frame(frame): # Check if the function was decorated with torchdynamo.optimize if frame.f_code in always_optimize_code_objects: return True # Check if there is global import of torch.* for co_name in frame.f_code.co_names: if co_name in frame.f_globals: if i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_frame(self):\n first_byte_as_bits = bin(int(self.packet_body[self.reader], base=16))[2:].zfill(8)\n return first_byte_as_bits[0:3] == \"001\"", "def is_trained(self) -> bool:", "def is_isotropic(self):\n return self.fibres is None", "def detect(frame: numpy.ndarray) -> bool:\n ...
[ "0.5915599", "0.5800602", "0.5735256", "0.5692999", "0.560612", "0.55900073", "0.5528049", "0.5466312", "0.5456641", "0.5453819", "0.5449128", "0.5444774", "0.5444005", "0.5372606", "0.53473073", "0.53346103", "0.5321155", "0.5306434", "0.5289983", "0.5289083", "0.5267994", ...
0.6421592
0
Check if a function raises a specified exception type, args and kwargs are forwarded to the function
def raises(self, exception_type, function, *args, **kwargs): try: result = function(*args, **kwargs) self.log_error("{} did not throw exception {}".format( function.__name__, exception_type.__name__ ), None) return result ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _raise_ex(fn):\n\n def _decorated(*args, **kwargs):\n v = fn(*args, **kwargs)\n if isinstance(v, Exception): raise v\n return v\n\n return _decorated", "def check_raises(func, exception_type, msg=None):\n # type: (Callable[[], Any], Type[Exception], Optional[...
[ "0.7132166", "0.7124145", "0.7005126", "0.6949762", "0.6882091", "0.6822025", "0.66970545", "0.66717947", "0.66653216", "0.6662217", "0.66123974", "0.657078", "0.6560267", "0.65555966", "0.6504161", "0.64829916", "0.6470136", "0.6460966", "0.64334077", "0.6410111", "0.6370902...
0.76564085
0
Check if a function does not raise an exception, args and kwargs are forwarded to the function
def does_not_raise(self, function, *args, **kwargs): try: return function(*args, **kwargs) except Exception as e: self.log_error("{} did raise {}: {}".format( function.__name__, type(e).__name__, e ), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tolerate_decorated_function_raise_if_exception_is_not_found():\n def test_function():\n raise AttributeError()\n fn = tolerate(exceptions=[KeyError])(test_function)\n fn()", "def test_tolerate_decorated_function_fail_silently_if_exception_is_found():\n def test_function():\n ra...
[ "0.71287996", "0.70307195", "0.7029238", "0.69262666", "0.6858184", "0.68228906", "0.68219864", "0.68191665", "0.6802466", "0.6753376", "0.66846067", "0.65879685", "0.6546923", "0.6457626", "0.6439646", "0.64380676", "0.6383104", "0.63781434", "0.6368654", "0.6364995", "0.633...
0.78791827
0
Retrieve the image to use for this flow deployment. Will start by looking for an `image` value in the flow's `environment.metadata`. If not found then it will fall back to using the `flow.storage`.
def get_flow_image(flow: "Flow") -> str: environment = flow.environment if hasattr(environment, "metadata") and environment.metadata.get("image"): return environment.metadata.get("image", "") else: storage = flow.storage if not isinstance(storage, prefect.environments.storage.Docker,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_image(runtime):\n return \"{}:{}\".format(LambdaContainer._IMAGE_REPO_NAME, runtime)", "def get_image(self) -> Text:\n return self._get_value(KubernetesResource.Keys.IMAGE)", "def image(self) -> Optional[str]:\n return pulumi.get(self, \"image\")", "def image(self) -> Optional[s...
[ "0.7372754", "0.6980138", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "0.6598327", "...
0.8058826
0
Compute midranks for two samples
def rankdata_2samp(x1, x2): x1 = np.asarray(x1) x2 = np.asarray(x2) nobs1 = len(x1) nobs2 = len(x2) if nobs1 == 0 or nobs2 == 0: raise ValueError("one sample has zero length") x_combined = np.concatenate((x1, x2)) if x_combined.ndim > 1: rank = np.apply_along_axis(rankdata,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mw_test(n1, n2):\r\n # find smaller sample, defined historically as n2. modify the names so we\r\n # don't risk modifying data outside the scope of the function.\r\n if len(n2) > len(n1):\r\n sn1, sn2 = array(n2), array(n1)\r\n else:\r\n sn1, sn2 = array(n1), array(n2)\r\n # sum th...
[ "0.6518385", "0.5826122", "0.5818515", "0.57466877", "0.56599826", "0.56200427", "0.56158584", "0.5568266", "0.55678874", "0.5514589", "0.54840845", "0.5477036", "0.5434129", "0.5424695", "0.5422914", "0.5417575", "0.54164684", "0.5388198", "0.5381166", "0.53557986", "0.53445...
0.6174634
1
Stochastically larger probability for 2 independent ordinal samples. This is a special case of `rank_compare_2indep` when the data are given as counts of two independent ordinal, i.e. ordered multinomial, samples. The statistic of interest is the probability that a random draw from the population of the first sample ha...
def rank_compare_2ordinal(count1, count2, ddof=1, use_t=True): count1 = np.asarray(count1) count2 = np.asarray(count2) nobs1, nobs2 = count1.sum(), count2.sum() freq1 = count1 / nobs1 freq2 = count2 / nobs2 cdf1 = np.concatenate(([0], freq1)).cumsum(axis=0) cdf2 = np.concatenate(([0], freq2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mw_test(n1, n2):\r\n # find smaller sample, defined historically as n2. modify the names so we\r\n # don't risk modifying data outside the scope of the function.\r\n if len(n2) > len(n1):\r\n sn1, sn2 = array(n2), array(n1)\r\n else:\r\n sn1, sn2 = array(n1), array(n2)\r\n # sum th...
[ "0.5853824", "0.5713708", "0.56760705", "0.5572656", "0.5536304", "0.55313593", "0.55175346", "0.5492681", "0.53141546", "0.5305513", "0.5303183", "0.52902704", "0.5279434", "0.52564424", "0.5242513", "0.5214222", "0.5187763", "0.51874787", "0.51846594", "0.5179172", "0.51285...
0.5937891
0
Probability indicating that distr1 is stochastically larger than distr2. This computes p = P(x1 > x2) for two continuous distributions, where `distr1` and `distr2` are the distributions of random variables x1 and x2 respectively.
def prob_larger_continuous(distr1, distr2): return distr1.expect(distr2.cdf)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discrete_one_samp_ks(distribution1: np.array, distribution2: np.array, num_samples: int) -> Tuple[float, bool]:\n cutoff = 1.36 / math.sqrt(num_samples)\n ecdf1 = np.array([sum(distribution1[:i + 1]) for i in range(len(distribution1))])\n ecdf2 = np.array([sum(distribution2[:i + 1]) for i in range(len...
[ "0.6662403", "0.6294873", "0.62087137", "0.61623836", "0.6130926", "0.6119506", "0.6086299", "0.5972438", "0.5949373", "0.5860906", "0.58309996", "0.57572234", "0.5731907", "0.5711454", "0.5706631", "0.57034963", "0.56746656", "0.56686604", "0.56481624", "0.5624627", "0.56072...
0.7804903
0
Convert Cohen's d effect size to stochasticallylargerprobability. This assumes observations are normally distributed. Computed as p = Prob(x1 > x2) = F(d / sqrt(2)) where `F` is cdf of normal distribution. Cohen's d is defined as d = (mean1 mean2) / std where ``std`` is the pooled within standard deviation.
def cohensd2problarger(d): return stats.norm.cdf(d / np.sqrt(2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cohen_d(x_arr, y_arr):\n delta = np.mean(x_arr) - np.mean(y_arr)\n pooled_std = np.sqrt(\n (\n (len(x_arr) - 1) * np.std(x_arr, ddof=1) ** 2 +\n (len(y_arr) - 1) * np.std(y_arr, ddof=1) ** 2\n ) / (len(x_arr) + len(y_arr))\n )\n return delta / pooled_std", "def...
[ "0.62903917", "0.6092724", "0.5854814", "0.5814859", "0.58076376", "0.57111233", "0.5642833", "0.5614208", "0.56010324", "0.5499328", "0.54770863", "0.5456112", "0.543066", "0.5401293", "0.5387434", "0.5343079", "0.5338465", "0.5328492", "0.53196543", "0.5310944", "0.5307831"...
0.70773894
0
Check Gst.Buffer for a valid Gst.Meta object and return the contained Gst.Structure
def get_meta(gst_buffer): meta = gst_buffer.get_meta("TcamStatisticsMetaApi") if not meta: return None # fill meta_out_buffer with the result of gst_structure_get_string(meta->structure) ret = clib.tcam_statistics_get_structure(hash(meta), meta_out_buffer, meta_out_buffer_size) # ret is a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_buffer(self, sample: Gst.Sample) -> typ.Optional[GstBuffer]:\n buffer = sample.get_buffer()\n caps = sample.get_caps()\n\n cnt = buffer.n_memory()\n if cnt <= 0:\n self.log.warning(\"%s No data in Gst.Buffer\", self)\n return None\n\n memory = b...
[ "0.60231775", "0.56412804", "0.5452405", "0.51938736", "0.51725936", "0.51601523", "0.5155606", "0.5037849", "0.502877", "0.50011075", "0.49986577", "0.4976831", "0.49686676", "0.49594298", "0.49436444", "0.4934218", "0.49310675", "0.49008685", "0.48759425", "0.48469302", "0....
0.7387252
0
This function will be called in a separate thread when our appsink says there is data for us. user_data has to be defined when calling g_signal_connect. It can be used to pass objects etc. from your other function to the callback.
def callback(appsink, user_data): sample = appsink.emit("pull-sample") if sample: print("new sample") # caps = sample.get_caps() gst_buffer = sample.get_buffer() tcam_meta = get_meta(gst_buffer) if tcam_meta: def print_structure(field_id, value, user_data)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callback(self, data):\n\n self.connection = pika.BlockingConnection(self.params)\n self.channel = self.connection.channel()\n\n # The fanout exchange broadcasts all the messages it receives to all the queues it knows.\n # That is what we need for our logger.\n # Tony changed ...
[ "0.63807166", "0.6068513", "0.60181034", "0.6002374", "0.5991285", "0.59471875", "0.59287995", "0.58374184", "0.58084", "0.58083236", "0.5759804", "0.5757115", "0.5752903", "0.5747895", "0.57409054", "0.5715448", "0.57148373", "0.570914", "0.57061666", "0.57004416", "0.569008...
0.64953643
0
Returns the emotion data
def emotions(self): return self[self.emotion_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emotions(self):\n if self.pickled_emotions:\n return pickle_util.load(self.pickled_emotions)\n else:\n return None", "def emotion(self) -> float:\n return self._emotion", "def emotions(self):\n return self._emotions", "def get_emotions(tweet):\n classi...
[ "0.6880182", "0.68539816", "0.6814753", "0.6810639", "0.658213", "0.64223844", "0.6377358", "0.62019813", "0.6088722", "0.5989526", "0.59705657", "0.58666164", "0.5770225", "0.56846887", "0.56213516", "0.5575791", "0.55638385", "0.5541292", "0.5520387", "0.55034524", "0.54438...
0.74380046
1
Returns the facepose data
def facepose(self): return self[self.facepose_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pose_data(self):\n # print(self.PoseData)\n ft = ai.feature.Feature()\n ft.type = ai.feature.Type.CHARGING.value\n ft.received_time = time.time()\n ft.timeout = 1.0\n ft.data['posedata'] = self.pose_data_dict\n ft.data['id'] = self._id\n self.pose_dat...
[ "0.68594277", "0.6650493", "0.66034865", "0.65250057", "0.6386517", "0.6297485", "0.6143139", "0.61246437", "0.611792", "0.608507", "0.603082", "0.59891045", "0.5961749", "0.59352034", "0.5827096", "0.5808161", "0.57841897", "0.5770004", "0.57681656", "0.5766837", "0.5765943"...
0.7621905
0
Returns the x landmarks.
def landmark_x(self): ######## TODO: NATSORT columns before returning ####### x_cols = [col for col in self.landmark_columns if "x" in col] return self[x_cols]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def landmarks(self):\n return self._landmarks", "def get_landmarks(self):\n lm_x = [x for x, y in self.landmarks]\n lm_y = [y for x, y in self.landmarks]\n return [lm_x, lm_y]", "def extract_all_face_landmarks(x_data, verbose=True):\r\n\t# Initialize dlib's face detector and create ...
[ "0.7586855", "0.7534776", "0.6912879", "0.6814206", "0.6814206", "0.6728881", "0.67018175", "0.6402738", "0.63192886", "0.631126", "0.6233338", "0.62030745", "0.6141274", "0.61072856", "0.60617316", "0.6041984", "0.6034537", "0.60201955", "0.59966767", "0.5995502", "0.5975829...
0.79233575
0
Returns the y landmarks.
def landmark_y(self): y_cols = [col for col in self.landmark_columns if "y" in col] return self[y_cols]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def landmarks(self):\n return self._landmarks", "def locations_y(self):\n return self._locations[1]", "def get_landmarks(self):\n lm_x = [x for x, y in self.landmarks]\n lm_y = [y for x, y in self.landmarks]\n return [lm_x, lm_y]", "def y_coords(self):\n y_coords = s...
[ "0.7341517", "0.7265816", "0.71972823", "0.69466007", "0.6769998", "0.67277694", "0.6713877", "0.669324", "0.66164315", "0.6506177", "0.64940673", "0.6489154", "0.64699805", "0.6467375", "0.64124066", "0.6398934", "0.6394789", "0.63886476", "0.6371233", "0.6367145", "0.634745...
0.8515602
0
Returns the facebox data
def facebox(self): return self[self.facebox_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebox(self):\n \n return self[self.facebox_columns]", "def draw_face_box(data):\n head = extract_head(data);\n face_box = data['position_data']['face_box'][data['i']];\n sefs = data['sefs'][data['i']];\n if face_box is not None:\n cv2.rectangle(head, *face_box, (0, 255,...
[ "0.7457201", "0.69105774", "0.6370029", "0.6214854", "0.616454", "0.61206293", "0.60300285", "0.60226756", "0.60168964", "0.59493166", "0.59246117", "0.58778685", "0.5825585", "0.5782007", "0.56937283", "0.5680105", "0.5648131", "0.5643691", "0.56274027", "0.5615741", "0.5593...
0.7377882
1
Returns the design data
def design(self): return self[self.design_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_designs(self):", "def get_data(self):", "def view(self, parent, **kargs):\n design = Service('Design')\n return design.view_list(parent, self, **kargs)", "def get_data(self):\n\n raise NotImplementedError('''\n Must Implement get_data. Call help() for details.\n ...
[ "0.81266415", "0.6521401", "0.6422064", "0.639929", "0.6390707", "0.6390707", "0.6361629", "0.6359346", "0.6331586", "0.633074", "0.6275754", "0.6176268", "0.6140829", "0.60969645", "0.60894704", "0.6072802", "0.6069498", "0.6025528", "0.6005216", "0.60030055", "0.5997425", ...
0.71724844
1
Print class meta data.
def info(self): attr_list = [] for name in self._metadata: attr_list.append(name + ": " + str(getattr(self, name, None)) + "\n") print(f"{self.__class__}\n" + "".join(attr_list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_verbose(self) -> None:\n print(self)\n if self.meta is not None:\n print(self.meta.__repr__())", "def print_me(self):\n \n print(\"CLASS {}\".format(self))\n print(\"Name: {}\".format(self.name))\n print(\"Class ID: {}\".format(self.id))\n pri...
[ "0.72509426", "0.68377686", "0.6808279", "0.6543676", "0.64946127", "0.6461602", "0.6453636", "0.6445805", "0.6434776", "0.63573337", "0.6277063", "0.6264057", "0.62280554", "0.61515313", "0.6147044", "0.61289895", "0.61179006", "0.61155254", "0.61133903", "0.6093714", "0.609...
0.7479938
0
Propagate metadata from other to self
def __finalize__(self, other, method=None, **kwargs): self = super().__finalize__(other, method=method, **kwargs) # merge operation: using metadata of the left object if method == "merge": for name in self._metadata: print("self", name, self.au_columns, other.left.au_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __finalize__(self, other, method=None, **kwargs):\r\n # merge operation: using metadata of the left object\r\n if method == 'merge':\r\n for name in self._metadata:\r\n object.__setattr__(self, name, getattr(other.left, name, None))\r\n # concat operation: using m...
[ "0.6780202", "0.67716676", "0.65638983", "0.6485073", "0.6469043", "0.6219015", "0.6206449", "0.6086112", "0.60206133", "0.5998195", "0.59597987", "0.5931629", "0.59275526", "0.5912445", "0.5859331", "0.5858528", "0.58537036", "0.585096", "0.58435243", "0.5836848", "0.5761391...
0.7063689
0
Returns the Action Units data Returns Action Unit data using the columns set in fex.au_columns.
def aus(self): return self[self.au_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_units(self):\n #assert self.ser.isOpen()\n\n self.serial_connection.write('UNI' + self.CR + self.LF)\n acknowledgement = self.serial_connection.readline()\n self._check_acknowledgement(acknowledgement)\n\n self.serial_connection.write(self.ENQ)\n unit = self.MEASU...
[ "0.5700567", "0.5493671", "0.5422409", "0.5387512", "0.5327655", "0.52716213", "0.52092063", "0.5201407", "0.5199174", "0.5128869", "0.51084507", "0.505595", "0.5023489", "0.50056165", "0.498955", "0.49802196", "0.49586868", "0.49586332", "0.49579597", "0.4953716", "0.4934360...
0.59638333
0
Returns the emotion data Returns emotions data using the columns set in fex.emotion_columns.
def emotions(self): return self[self.emotion_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_emotions():\n with open('../data/design_matrix.csv', mode='r') as csv_file:\n csv_reader = csv.DictReader(csv_file)\n line_count = 0\n song_index_to_emotion = {}\n for row in csv_reader:\n if line_count == 0:\n print(f'Column names are {\", \".join(r...
[ "0.70589125", "0.6640249", "0.62843037", "0.6141261", "0.61380875", "0.5900639", "0.58939177", "0.5864521", "0.5816451", "0.579204", "0.5561311", "0.5504103", "0.54901123", "0.5466655", "0.5430467", "0.5424743", "0.5372616", "0.5364838", "0.53223664", "0.5315507", "0.5309463"...
0.81996137
0
Returns the landmark data Returns landmark data using the columns set in fex.landmark_columns.
def landmark(self): return self[self.landmark_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def landmark_x(self):\n ######## TODO: NATSORT columns before returning #######\n x_cols = [col for col in self.landmark_columns if \"x\" in col]\n return self[x_cols]", "def landmark_x(self):\n ######## TODO: NATSORT columns before returning #######\n x_cols = [col for col in ...
[ "0.6794752", "0.6794752", "0.65209115", "0.6399292", "0.6370954", "0.6270488", "0.60754454", "0.607118", "0.59740293", "0.59070575", "0.58828425", "0.57682526", "0.55960494", "0.55682206", "0.55381674", "0.54718405", "0.5458486", "0.54239976", "0.54214114", "0.54005456", "0.5...
0.7740967
1
Returns the facepose data Returns facepose data using the columns set in fex.facepose_columns
def facepose(self): return self[self.facepose_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebox(self):\n \n return self[self.facebox_columns]", "def facebox(self):\n return self[self.facebox_columns]", "def get_pose_data(self):\n # print(self.PoseData)\n ft = ai.feature.Feature()\n ft.type = ai.feature.Type.CHARGING.value\n ft.received_time...
[ "0.63843197", "0.6273101", "0.59165555", "0.5586807", "0.5567384", "0.5509971", "0.54848564", "0.5475028", "0.545142", "0.5449467", "0.5415388", "0.5318611", "0.5299302", "0.5239533", "0.5221949", "0.52017903", "0.5186216", "0.51813877", "0.5175315", "0.5161512", "0.5136092",...
0.7442376
1
Returns the x landmarks. Returns the xcoordinates for facial landmarks looking for "x" in fex.landmark_columns.
def landmark_x(self): ######## TODO: NATSORT columns before returning ####### x_cols = [col for col in self.landmark_columns if "x" in col] return self[x_cols]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_all_face_landmarks(x_data, verbose=True):\r\n\t# Initialize dlib's face detector and create the facial landmark predictor\r\n\tdetector = dlib.get_frontal_face_detector()\r\n\tpredictor = dlib.shape_predictor(face_predictor_path)\r\n\r\n\tx_int = np.uint8(np.multiply(x_data, 256))\r\n\tface_landmarks =...
[ "0.689068", "0.68787104", "0.68787104", "0.673929", "0.66141653", "0.61886597", "0.611724", "0.5882194", "0.5851471", "0.58252877", "0.5794902", "0.57377267", "0.5733932", "0.5688064", "0.56825036", "0.5644469", "0.5632531", "0.56302077", "0.56162626", "0.56021917", "0.558027...
0.8438608
1
Returns the y landmarks. Returns the ycoordinates for facial landmarks looking for "y" in fex.landmark_columns.
def landmark_y(self): y_cols = [col for col in self.landmark_columns if "y" in col] return self[y_cols]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y_coords(self):\n y_coords = self.get_fre_band_arr()\n y_coords = np.insert(y_coords, 0, self.low_fre)\n return y_coords", "def locations_y(self):\n return self._locations[1]", "def get_landmarks(self):\n lm_x = [x for x, y in self.landmarks]\n lm_y = [y for x, y i...
[ "0.68861693", "0.6827498", "0.6579861", "0.64362013", "0.64037704", "0.62177044", "0.62062657", "0.6192689", "0.61864173", "0.6103495", "0.6103495", "0.6094811", "0.6025159", "0.6012506", "0.59943825", "0.5970289", "0.5959096", "0.5958271", "0.5945194", "0.59229875", "0.59149...
0.8711755
1
Returns the facebox data Returns the facebox data using fex.facebox_columns.
def facebox(self): return self[self.facebox_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebox(self):\n return self[self.facebox_columns]", "def draw_face_box(data):\n head = extract_head(data);\n face_box = data['position_data']['face_box'][data['i']];\n sefs = data['sefs'][data['i']];\n if face_box is not None:\n cv2.rectangle(head, *face_box, (0, 255, 0));\n els...
[ "0.786718", "0.58591956", "0.5781269", "0.57674426", "0.57323515", "0.57317066", "0.57074684", "0.5695902", "0.5650277", "0.5650277", "0.5629819", "0.5547583", "0.54429126", "0.53911495", "0.53716815", "0.5363829", "0.5342121", "0.532826", "0.53220755", "0.5313227", "0.525019...
0.7945136
0
Returns the time data Returns the time information using fex.time_columns.
def time(self): return self[self.time_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_col(self):\n return self.time_col", "def get_time_info(self):\n\n raise NotImplementedError", "def with_time(self):\n if self.time_slices is None:\n raise FeatureError(\"Feature has no time reference.\")\n\n for i, datum in enumerate(self.data[self.name]):\n ...
[ "0.7014698", "0.6923805", "0.67468506", "0.67368346", "0.67090327", "0.658415", "0.6543247", "0.6336397", "0.63319355", "0.63107556", "0.6210474", "0.6203365", "0.61833215", "0.61768675", "0.6173609", "0.61264443", "0.61259824", "0.6095268", "0.60722256", "0.6033134", "0.6017...
0.7733573
1
Returns the design data Returns the study design information using columns in fex.design_columns.
def design(self): return self[self.design_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_designs(self):", "def get_design_matrix(self, experiment_id, stimulus_name, stimulus_key, design):\n # get ophys data object\n ophys_experiment_id = self.get_ophys_experiment_id(\n experiment_id=experiment_id,\n stimulus_name=stimulus_name\n )\n data = se...
[ "0.7306858", "0.63865215", "0.60775685", "0.5910949", "0.5850781", "0.58157325", "0.5733523", "0.57295346", "0.5702907", "0.56654894", "0.5642688", "0.563569", "0.56031746", "0.5503446", "0.54609805", "0.54590154", "0.5453203", "0.54348665", "0.5434695", "0.54331785", "0.5396...
0.741482
1
Loads file into FEX class This function checks the detector set in fex.detector and calls the appropriate read function that helps utilize functionalities of Feat.
def read_file(self, *args, **kwargs): if self.detector == "FACET": return self.read_facet(self.filename) elif self.detector == "OpenFace": return self.read_openface(self.filename) elif self.detector == "Affectiva": return self.read_affectiva(self.filename) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_raw_file(\n self, fname, allow_maxshield, preload, do_check_ext=True, verbose=None\n ):\n logger.info(\"Opening raw data file %s...\" % fname)\n\n # Read in the whole file if preload is on and .fif.gz (saves time)\n if not _file_like(fname):\n if do_check_ext:\...
[ "0.6147519", "0.5951095", "0.5951095", "0.59167904", "0.58575606", "0.5834986", "0.580114", "0.5781498", "0.57687646", "0.5754102", "0.57528377", "0.5736434", "0.5724523", "0.57080907", "0.5684574", "0.5659309", "0.5659229", "0.5636044", "0.5604596", "0.5603135", "0.55872434"...
0.6481866
0
Iterate over Fex sessions as (session, series) pairs.
def itersessions(self): for x in np.unique(self.sessions): yield x, self.loc[self.sessions == x, :]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_sessions():\n return iter(_session_stack)", "def sessions(self):\n for session_id in self.get_sessions(): \n session = Session(self.session_cache, self.sid, session_id)\n yield session", "def find_sessions(sfe):\n print(\"-\" * 20 + \" find_sessions started\")\n i...
[ "0.6874132", "0.63287437", "0.59944016", "0.56000066", "0.5594249", "0.5591585", "0.55397385", "0.5520923", "0.5505161", "0.5461788", "0.5461154", "0.54568434", "0.54461384", "0.5442089", "0.54219115", "0.53983855", "0.5392752", "0.5353661", "0.53511155", "0.5350862", "0.5341...
0.7170882
0
Regress using nltools.stats.regress. fMRIlike regression to predict Fex activity (y) from set of regressors (X).
def regress(self, X, y, fit_intercept=True, *args, **kwargs): if type(X) == list: mX = self[X] else: mX = X if fit_intercept: mX["intercept"] = 1 if type(y) == str: my = self[y] else: my = y b, t, p, df, res = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _regress(self, X, y):\n self._model.fit(X, np.ravel(y))\n self._set_attributes(self._model)", "def fit(self, X, y):\n return BaseRegressor.fit(self, X, y)", "def pred_linreg_fxn(x_train, y_train, x_pred):\n slope_train, intercept_train = linreg_fxn(x_train, y_train)\n y_pred = x_...
[ "0.7447834", "0.6585582", "0.6509971", "0.6369692", "0.6323566", "0.63188696", "0.6300263", "0.62936854", "0.62825525", "0.6240916", "0.61859304", "0.6147922", "0.6119251", "0.60608816", "0.6035462", "0.6030132", "0.601473", "0.5992373", "0.5990867", "0.59855616", "0.5960224"...
0.6643355
1
Predicts y from X using a sklearn model. Predict a variable of interest y using your model of choice from X, which can be a list of columns of the Fex instance or a dataframe.
def predict(self, X, y, model=LinearRegression, *args, **kwargs): if type(X) == list: mX = self[X] else: mX = X if type(y) == str: my = self[y] else: my = y clf = model(*args, **kwargs) clf.fit(mX, my) return clf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, model, x_test):\n pass", "def predict(self, X):\n raise NotImplementedError", "def predict(self, X): \n return self.f(X, self.coefficients)", "def predict(model, X_testing):\n predictions = model.predict(X_testing)\n\n return predictions", "def predict(se...
[ "0.72025687", "0.7194512", "0.71440125", "0.7110538", "0.7071522", "0.7071522", "0.7071522", "0.7058019", "0.7050511", "0.7050511", "0.7050511", "0.70422536", "0.7017724", "0.6990414", "0.6990414", "0.69841176", "0.6982238", "0.6981132", "0.6970793", "0.69642055", "0.69642055...
0.77036595
0
Downsample Fex columns. Relies on nltools.stats.downsample, but ensures that returned object is a Fex object.
def downsample(self, target, **kwargs): df_ds = downsample( self, sampling_freq=self.sampling_freq, target=target, **kwargs ).__finalize__(self) df_ds.sampling_freq = target if self.features is not None: ds_features = downsample( self.features, sa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def down_sampling(record, down_sampling_factor=16):\n\n if len(record.shape) == 1:\n return record[slice(0, record.shape[0], down_sampling_factor)]\n else:\n row_idx = np.arange(record.shape[0])\n col_idx = np.arange(0, record.shape[1], down_sampling_factor)\n\n return record[np.i...
[ "0.61145216", "0.5847198", "0.58068836", "0.5790899", "0.5703903", "0.56799656", "0.56491375", "0.5568498", "0.5540041", "0.5380406", "0.5372991", "0.53409344", "0.5321933", "0.52729267", "0.52621406", "0.5232055", "0.52248317", "0.52205735", "0.5118854", "0.51038283", "0.507...
0.616639
0
Calcule y axis for square function over x_axis with corners given by pars, starting at y_base. pars = [x1,x2,y0,y1,y2] y_base = 0 (default)
def square_fn(pars, x_axis): # vector to fill y_axis = np.zeros(len(x_axis)) # pars = [x1,x2,y1] # find indexs in x axis idx1 = np.argmin(abs(x_axis-pars[0])) idx2 = np.argmin(abs(x_axis-pars[1])) # fill y ax...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def squareY(self):\n \n ## square the y portion element-wise ##\n self.y = [yElement**2 for yElement in self.y]", "def _apply_y(self, state, axes, **kwargs):\n return 1j * self._apply_x(self._apply_z(state, axes), axes)", "def coordinateY(self, x):\n if self.ch > 2:\n ...
[ "0.5903985", "0.58551747", "0.5773819", "0.5681453", "0.55416", "0.5516044", "0.54789364", "0.54711497", "0.5428421", "0.54117155", "0.53866035", "0.5373865", "0.5372409", "0.53593844", "0.5340977", "0.5339875", "0.53394115", "0.5330012", "0.53258795", "0.5298314", "0.5290562...
0.78402364
0
Task to insure that none of the object is missed from indexing. The object ids are sent to `index_objects_to_es` task for indexing. While the task is running, new objects can be created/deleted in database and they will not be in the tasks for indexing into ES. This task will index all the objects that got into DB afte...
def index_missing_objects(app_label, model_name, document_class, index_generation_time): model = apps.get_model(app_label, model_name) document = _get_document(model=model, document_class=document_class) query_string = "{}__lte".format(document.modified_model_field) queryset = ( document().get_q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sync_object_task_syncs(es):\n obj = SimpleModel.objects.create()\n sync_object_task.apply(args=(SimpleModelSearchApp.name, str(obj.pk)))\n es.indices.refresh()\n\n assert doc_exists(es, SimpleModelSearchApp, obj.pk)", "def _create_missing_notifications_partition_indices(self, conn, operator_...
[ "0.5471132", "0.53730834", "0.5247841", "0.5194043", "0.5150828", "0.514465", "0.51158416", "0.50489616", "0.5028721", "0.50161606", "0.5004496", "0.49241456", "0.48938733", "0.4837935", "0.4830223", "0.4811446", "0.48008862", "0.47940287", "0.47820997", "0.47795725", "0.4764...
0.7200472
0
Delete old SearchQuery objects older than ``RTD_ANALYTICS_DEFAULT_RETENTION_DAYS``. This is run by celery beat every day.
def delete_old_search_queries_from_db(): retention_days = settings.RTD_ANALYTICS_DEFAULT_RETENTION_DAYS days_ago = timezone.now().date() - timezone.timedelta(days=retention_days) search_queries_qs = SearchQuery.objects.filter( created__date__lt=days_ago, ) if search_queries_qs.exists(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _purge_old(self):\n now = dt_util.utcnow()\n\n _LOGGER.debug(\n \"%s: purging records older then %s(%s)\",\n self.entity_id,\n dt_util.as_local(now - self._samples_max_age),\n self._samples_max_age,\n )\n\n while self.ages and (now - self....
[ "0.6024795", "0.5863673", "0.58329403", "0.57610565", "0.5700413", "0.5654228", "0.56503767", "0.56467724", "0.55715185", "0.54492605", "0.5445687", "0.5418494", "0.540462", "0.53811735", "0.5378508", "0.53753483", "0.5360381", "0.5336582", "0.5313498", "0.5311069", "0.524316...
0.74056435
0
Record/update a search query for analytics.
def record_search_query(project_slug, version_slug, query, total_results, time_string): if not project_slug or not version_slug or not query: log.debug( "Not recording the search query.", project_slug=project_slug, version_slug=version_slug, query=query, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self, query):", "def __on_query_edited(self):\n self.__refresh_search_results()", "def updateSearch(self, authenticationToken, search):\r\n pass", "def search(self, q):\n self.__query = q\n self.scrape_page()", "def search(self, query, maxhits=100):", "def append(self, ...
[ "0.68897855", "0.6664643", "0.6521552", "0.64968044", "0.6479175", "0.64629936", "0.6414087", "0.6403683", "0.63518894", "0.63447225", "0.62915343", "0.62901837", "0.62480265", "0.62298983", "0.6198868", "0.6177738", "0.61231995", "0.61162543", "0.6096994", "0.6071269", "0.60...
0.69176954
0
Show the user all of their reports
def my_reports(page_num=1): # Download reports that belong to the current user reports = Report.query.filter_by( user_id=current_user.id, ).paginate(page_num) form = SearchForm() return render_template('reports/me.html', reports=reports, form=form)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reports(request, template_name='reporting/reports.html'):\n object_list = reporting.all_reports()\n # storing current user position in session\n request.session['enter_url'] = reverse('reports')\n return direct_to_template(request, template_name, {\n # HACK: object list rendered incorrectly ...
[ "0.73886967", "0.7309074", "0.7073552", "0.69619435", "0.69179285", "0.6843328", "0.66446334", "0.66243786", "0.64708054", "0.643594", "0.64056015", "0.6387676", "0.63818693", "0.6347149", "0.6287377", "0.6261165", "0.6239527", "0.6220643", "0.6213937", "0.6212233", "0.620444...
0.7455786
0
Add a report to the user's favorite reports
def favorite_report(report_id): report = Report.query.get(report_id) if report is None: flash( "No report with that report_id found!", "alert-warning", ) else: current_user.favorite(report) db.session.commit() flash( "Added Report: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gReport(self, event):\n \n reports.createReports()", "def _add_staff_report_worksheet(self):\n worksheet = self.workbook.create_sheet(title='wagtail staff')\n for record in self._get_staff_report_data():\n worksheet.append(record)", "def addReportData(cls, session, ac...
[ "0.6233046", "0.61016184", "0.6088631", "0.6085726", "0.6065707", "0.58682525", "0.58227706", "0.5736659", "0.57219994", "0.569743", "0.56968087", "0.5580388", "0.556407", "0.55199593", "0.5513932", "0.5511201", "0.5502078", "0.5496138", "0.54870605", "0.54592955", "0.5438931...
0.74841064
0
Remove a report from the user's favorite reports
def unfavorite_report(report_id): report = Report.query.get(report_id) if report is None: flash( "No report with that report_id found!", "alert-warning", ) else: current_user.unfavorite(report) db.session.commit() flash( "Removed Re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_report(report_id):\n report = Report.query.get(report_id)\n if report is None:\n flash(\n \"Report not found!\",\n \"alert-warning\",\n )\n elif not current_user.is_admin and not report.user.id == current_user.id:\n flash(\n \"You don't have...
[ "0.68605214", "0.64141953", "0.6412739", "0.64123213", "0.6269163", "0.62281585", "0.6033412", "0.5947403", "0.5925766", "0.58741385", "0.58716273", "0.5827843", "0.5825591", "0.5808973", "0.57478625", "0.57023764", "0.56983984", "0.5683633", "0.5668569", "0.5653125", "0.5622...
0.78201544
0
Create a new report If the user successfully submitted the form, add the new report to the db, commit the session, and redirect the user to the list of their reports. Otherwise, render the template to show the user the create report page.
def create_report(): LocalCreateReportForm = CreateReportForm.get_instance() for department in Department.query.all(): if len(department.fields) > 0: LocalCreateReportForm.add_department(department) form = LocalCreateReportForm() form.user_id.data = current_user.id if form.vali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_form(self, r, **attr):\n\n # User must be permitted to create site activity reports\n authorised = self._permitted(method=\"create\")\n if not authorised:\n r.unauthorised()\n\n s3db = current.s3db\n\n T = current.T\n response = current.response\n ...
[ "0.6411249", "0.60946006", "0.6040443", "0.60005903", "0.59966075", "0.589741", "0.58751255", "0.5867423", "0.5809522", "0.57828504", "0.57769436", "0.57742625", "0.5707309", "0.57065016", "0.56933373", "0.56524", "0.5636362", "0.5633302", "0.5631826", "0.5624362", "0.5617733...
0.8307628
0
Submit new report data If the user successfully submitted the form, submit all of the report data, commit the session, and redirect the user to view their reports. Otherwise, render the template to show the user the report data submission form.
def submit_report_data(report_id, ds=None, dept_id=None): if not ds or ds == 'today': ds = datetime.now().strftime('%Y-%m-%d') elif ds == 'yesterday': ds = (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d') # Check to see if the user picked a different day or department change_fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_report():\n\n LocalCreateReportForm = CreateReportForm.get_instance()\n for department in Department.query.all():\n if len(department.fields) > 0:\n LocalCreateReportForm.add_department(department)\n\n form = LocalCreateReportForm()\n form.user_id.data = current_user.id\n ...
[ "0.6911105", "0.6204668", "0.60054195", "0.5996447", "0.59340674", "0.5930376", "0.59077144", "0.59062237", "0.581144", "0.5738335", "0.5702757", "0.56902033", "0.56902033", "0.56859964", "0.5660975", "0.55879337", "0.55659604", "0.5565869", "0.55448514", "0.55324984", "0.552...
0.67280376
1
Edit the specified report
def edit_report(report_id): report = Report.query.get(report_id) if report is None: flash( "Report not found!", "alert-warning", ) elif not current_user.is_admin and not report.user.id == current_user.id: flash( "You don't have permission to edit t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_report(self):\n\n\t\t#Instantiates the rules engine class as a checker object with a\n\t\t#LAR schema, a TS schema, and geographic geographic data. \n\t\tchecker = rules_engine(lar_schema=self.lar_schema_df, \n\t\t\tts_schema=self.ts_schema_df, geographic_data=self.geographic_data)\n\n\t\t#Seperates data ...
[ "0.6600966", "0.6493607", "0.6335445", "0.6061638", "0.6041867", "0.5906429", "0.58719105", "0.5768308", "0.5757925", "0.56970507", "0.5674672", "0.56685144", "0.5648595", "0.5632936", "0.56074166", "0.56002784", "0.5590973", "0.5505178", "0.5439791", "0.534049", "0.5256519",...
0.71364826
0
View the current user's charts
def my_charts(page_num=1): # Download charts that belong to the current user charts = Chart.query.filter_by(owner_id=current_user.id).paginate(page_num) return render_template('reports/my_charts.html', charts=charts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_charts(request):\n\n logger.debug('called')\n\n context = {}\n\n simulations = request.user.simulations.all().exclude(\n name__icontains=settings.STANDARD_CHART_NAME\n ).select_related(\n 'fight_style',\n 'result',\n 'simulation_type',\n 'wow_class',\n '...
[ "0.66730094", "0.6137271", "0.60657316", "0.598059", "0.5963142", "0.5948254", "0.5946689", "0.59163296", "0.5855251", "0.5844389", "0.5842928", "0.58329755", "0.5808511", "0.57807225", "0.57748824", "0.5772974", "0.573626", "0.57063985", "0.5685432", "0.5678684", "0.5667025"...
0.70598507
0
View a specific chart
def view_chart(chart_id): chart = Chart.query.get(chart_id) if chart is None: flash('Error: Chart not found', 'alert-warning') return redirect(url_for('reports.my_charts')) else: return render_template('reports/view_chart.html', chart=chart)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(self, **options):\n return vedo.plotter.show(self, **options)", "def view_select(view):\n \n if view == '2D Plot':\n trace = trace_dict(view)\n\n elif view == '3D Plot':\n trace = trace_dict(view)\n \n return trace", "def chart(request):\n assert isinst...
[ "0.6274667", "0.6108786", "0.60972965", "0.60379535", "0.60276425", "0.59471476", "0.59150136", "0.58710355", "0.58591956", "0.58561414", "0.5854659", "0.58366585", "0.58164656", "0.58060074", "0.57918483", "0.5791626", "0.5770353", "0.5748716", "0.56853324", "0.5676849", "0....
0.6988433
0
Add a chart to the user's favorite charts
def favorite_chart(chart_id): chart = Chart.query.get(chart_id) if chart is None: flash( "No chart with that chart_id found!", "alert-warning", ) else: current_user.favorite_chart(chart) db.session.commit() flash( "Added Chart: {nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_chart(self, chart: Chart):\n self.charts.append(chart)", "def charts(self, charts):\n\n self.container['charts'] = charts", "def add_chart(self, chart, *charts):\n if _vtk.vtkRenderingContextOpenGL2 is None: # pragma: no cover\n from pyvista.core.errors import VTKVersio...
[ "0.7049451", "0.6410442", "0.61321414", "0.5957534", "0.5892939", "0.5771648", "0.57403374", "0.56806546", "0.54605895", "0.5392306", "0.528696", "0.52682036", "0.52662975", "0.52512485", "0.5236775", "0.52314466", "0.521132", "0.5181843", "0.51703775", "0.516885", "0.5114498...
0.7018973
1
Remove a chart from the user's favorite charts
def unfavorite_chart(chart_id): chart = Chart.query.get(chart_id) if chart is None: flash( "No chart with that chart_id found!", "alert-warning", ) else: current_user.unfavorite_chart(chart) db.session.commit() flash( "Removed Chart...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_chart(chart_id):\n chart = Chart.query.get(chart_id)\n if chart is None:\n flash(\"Error: Chart not found!\", \"alert-warning\")\n elif not current_user.is_admin and not chart.user.id == current_user.id:\n flash(\n \"You don't have permission to delete that.\",\n ...
[ "0.66009134", "0.64706516", "0.6103392", "0.5888672", "0.5843564", "0.5824595", "0.5779869", "0.5693091", "0.56466514", "0.561041", "0.55987537", "0.5561714", "0.55574405", "0.55101097", "0.5500889", "0.547702", "0.54680014", "0.5463635", "0.54336745", "0.5430693", "0.5401367...
0.75849396
0
Create a new chart If the user successfully submitted the form, add the new chart to the db, commit the session, and redirect the user to the list of their charts. Otherwise, render the template to show the user the create chart page.
def create_chart(): LocalCreateChartForm = CreateChartForm.get_instance() for department in Department.query.all(): if len(department.fields) > 0: LocalCreateChartForm.add_department(department) form = LocalCreateChartForm() form.user_id.data = current_user.id form.chart_type.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_chart(request):\n logger.debug('called')\n\n context = {}\n\n if request.method == 'POST':\n\n form = SimulationCreationForm(request.POST)\n\n if form.is_valid() and request.user.can_create_chart:\n\n # check if user has empty slots\n\n simulations = Simulati...
[ "0.7399366", "0.6259725", "0.60140634", "0.59311575", "0.58836275", "0.5881369", "0.5859985", "0.58270174", "0.58146036", "0.58051664", "0.57316524", "0.570405", "0.56302613", "0.56278455", "0.562", "0.5609638", "0.559025", "0.5578943", "0.5574375", "0.5567082", "0.55449164",...
0.8241281
0
Delete the specified chart
def delete_chart(chart_id): chart = Chart.query.get(chart_id) if chart is None: flash("Error: Chart not found!", "alert-warning") elif not current_user.is_admin and not chart.user.id == current_user.id: flash( "You don't have permission to delete that.", "alert-warnin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_chart(request) -> JsonResponse:\n logger.debug('called')\n\n message = \"\"\n\n chart_id = None\n if request.method == 'POST':\n chart_id = request.POST.get('chart_id', None)\n\n if not chart_id:\n return JsonResponse(data={'status': 'error', 'message': _(\"Chart deletion wo...
[ "0.7288429", "0.6492655", "0.63746667", "0.6286706", "0.62034285", "0.6163901", "0.606251", "0.6008555", "0.5991254", "0.59728926", "0.5959897", "0.58948183", "0.58880144", "0.58394146", "0.58390933", "0.58183795", "0.57881844", "0.57484305", "0.5742656", "0.5736351", "0.5712...
0.73378265
0
Edit the specified chart
def edit_chart(chart_id): chart = Chart.query.get(chart_id) if chart is None: flash( "Error: Chart not found!", "alert-warning", ) elif not current_user.is_admin and not chart.user.id == current_user.id: flash( "You don't have permission to delete ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_chart():\n selected_team = variable.get()\n selected_period = period_variable.get()\n if selected_period == \"All\":\n selected_period = -1\n elif selected_period == \"OT\":\n selected_period = 4\n selected_id = -1\n if selected_team == home_team:\n selected_id = d...
[ "0.59246886", "0.57893014", "0.57478505", "0.5732447", "0.56441325", "0.56202275", "0.552035", "0.5515685", "0.5385053", "0.53688186", "0.53561294", "0.53519845", "0.53332204", "0.5257063", "0.52493787", "0.5221216", "0.5209201", "0.5183176", "0.5178819", "0.5167688", "0.5157...
0.6844908
0
Returns the signals names list of the 128 signals available in the software Returns
def NamesGet(self): ## Make Header hex_rep = self.NanonisTCP.make_header('Signals.NamesGet', body_size=0) self.NanonisTCP.send_command(hex_rep) response = self.NanonisTCP.receive_response() # signals_names_size = self.NanonisTCP.hex_to_int32(response[0:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_signal_text_labels(self):\n\n return [self.signal_label(chn) for chn in range(self.signals_in_file)]", "def get_signal_info(self, signal_names):\n result = []\n for name in signal_names:\n description = self._pio.signal_description(name)\n domain_type = self._pi...
[ "0.7081996", "0.6256773", "0.62184995", "0.6027004", "0.602181", "0.59879315", "0.58767784", "0.58168095", "0.57998013", "0.5774171", "0.5773198", "0.57506484", "0.5691146", "0.5681253", "0.56616247", "0.5658089", "0.56555593", "0.56504756", "0.5634074", "0.5604724", "0.55868...
0.67688495
1
Returns a list of the signals names and indexes of the 24 signals assigned to the slots of the Signals Manager. The 24 signals are selected in the Signals Manager out of the 128 signals available in the software, and they are used in the list of available signals to display in graphs and other modules. The index of eve...
def InSlotsGet(self): ## Make Header hex_rep = self.NanonisTCP.make_header('Signals.InSlotsGet', body_size=0) self.NanonisTCP.send_command(hex_rep) response = self.NanonisTCP.receive_response() # signals_names_size = self.NanonisTCP.hex_to_int32(respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_signal_info(self, signal_names):\n result = []\n for name in signal_names:\n description = self._pio.signal_description(name)\n domain_type = self._pio.signal_domain_type(name)\n aggregation, format_type, behavior = self._pio.signal_info(name)\n res...
[ "0.6066125", "0.5995287", "0.5794139", "0.57714015", "0.5720278", "0.5499448", "0.5462212", "0.54593736", "0.54577917", "0.5445506", "0.5444441", "0.5394684", "0.5279112", "0.52662045", "0.52632016", "0.5243538", "0.5241672", "0.52246445", "0.52108747", "0.52093685", "0.52091...
0.6148247
0
Distribue toutes les mains initiales
def _distribueMainsInitiales(self): self._set_taille_main() logger.info("Distribution des mains de départ") logger.debug(f"liste des joueurs : {self.list_joueur}") for joueur in self.list_joueur: joueur.complete_main()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise(self):", "def initialize_bolsa(self,nivel):", "def init():", "def post_init(self):\n\t\tpass", "def initialize(self):\n # FIX: INITIALIZE PROCESS INPUTS??\n for mech, value in self.initial_values.items():\n mech.initialize(value)", "def reset_parameters(self, para...
[ "0.63212276", "0.6203425", "0.61902964", "0.6189004", "0.61754924", "0.61515385", "0.6107354", "0.6104479", "0.6073546", "0.60652846", "0.6061433", "0.6052168", "0.60309803", "0.60269314", "0.6002648", "0.5984808", "0.5973918", "0.59712225", "0.5935138", "0.5921213", "0.59212...
0.745396
0
Indique si la partie est perdue
def estPerdue(self) -> bool: joueur = self.list_joueur[self.joueur] return not joueur.canJouer() and not joueur.canFinish()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def offrable(self) -> bool:\n if date.today() > self.cagnotte.fin_achat:\n return False\n return (\n self.beneficiaires == 0\n or self.offre_set.filter(valide=True).count() < self.beneficiaires\n )", "def _checkstate(self, queryset):\n for presup in qu...
[ "0.64837927", "0.63919663", "0.6129559", "0.6111752", "0.58846676", "0.58651435", "0.58506036", "0.5799659", "0.5761914", "0.5742582", "0.5742582", "0.5742582", "0.5742582", "0.56962293", "0.56943893", "0.56930566", "0.56583714", "0.564043", "0.5637352", "0.5630104", "0.55847...
0.7276697
0
This endpoint receives a dictionary with some search criteria and return the athletes that match it.
def search(self, request): search_serializer = serializers.SearchSerializer(data=request.data) # First we validate if the search dictionary is correct if search_serializer.is_valid(): search = search_serializer.data # Then we get the queryset with all the athletes so we c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(bearer_token, price, location, categories, radius, openat):\n\n RESTAURANT_LIMIT = 3\n\n url_params = {\n 'term': 'restaurants',\n 'location': location.replace(' ', '+'),\n 'limit': RESTAURANT_LIMIT,\n 'open_at': openat,\n 'price': price,\n 'categories': c...
[ "0.6145727", "0.60702515", "0.60699165", "0.60188603", "0.5983652", "0.59467036", "0.59340394", "0.59202266", "0.5903568", "0.582468", "0.57958424", "0.5782362", "0.57683784", "0.5734495", "0.5733316", "0.5733316", "0.5733316", "0.5733316", "0.5733316", "0.5733316", "0.573331...
0.7957402
0
Test that it raises an error if priors is the wrong length.
def test_wrong_priors_len(self): with self.assertRaises(ValueError): hmm.Viterbi([1], [], [[1]], [lambda x: 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_if_it_accepts_lists(self):\n with self.assertRaises(TypeError):\n prime_numbers([])", "def test_primes_under_1000000(self):\n self.assertEqual(len(sieve(100)), 25)\n self.assertEqual(len(sieve(1000)), 168)\n self.assertEqual(len(sieve(10000)), 1229)\n self.a...
[ "0.66139674", "0.65844715", "0.652231", "0.65075994", "0.6494571", "0.64897907", "0.64802206", "0.6462158", "0.6427523", "0.64034253", "0.6361062", "0.636043", "0.6347527", "0.6347213", "0.6305311", "0.6305231", "0.628904", "0.6275885", "0.62746966", "0.62681043", "0.6223683"...
0.7000984
0
Test that it raises an error if transitions is the wrong size.
def test_wrong_transitions_dim(self): with self.assertRaises(ValueError): hmm.Viterbi([1], [1], [[]], [lambda x: 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_transitions(self, transitions: np.ndarray) -> np.ndarray:\n if not isinstance(transitions, np.ndarray):\n raise TypeError('Transition matrix must be a numpy.ndarray')\n if not transitions.shape == (self.n_states, self.n_states):\n raise ValueError('Transition matrix mu...
[ "0.67167807", "0.66485035", "0.65419185", "0.64016193", "0.6346695", "0.6316185", "0.6251593", "0.6177131", "0.6109697", "0.6097884", "0.6073906", "0.60323924", "0.5990011", "0.59798384", "0.59667546", "0.5940059", "0.5925748", "0.5901199", "0.5878569", "0.5870042", "0.584557...
0.6723367
0
Detailed error messages configuration.
def detailed_error_messages(self) -> Optional['outputs.EnabledConfigResponse']: return pulumi.get(self, "detailed_error_messages")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self, message=None, show_help=True):", "def collect_errors_and_warnings(self) -> str:\n # Complete error message\n message = \"----------------ERRORS----------------\\n\"\n if self.errors == \"\":\n message = \"YOUR FILE IS VALIDATED!\\n\"\n logger.info(messag...
[ "0.6567676", "0.6544795", "0.65382415", "0.6298965", "0.61711144", "0.6089125", "0.60782903", "0.60468245", "0.6037014", "0.6027185", "0.5993998", "0.5935929", "0.5926732", "0.5920064", "0.58990425", "0.5881799", "0.5873439", "0.5851841", "0.5839566", "0.57978344", "0.5786679...
0.67332065
0
Failed requests tracing configuration.
def failed_requests_tracing(self) -> Optional['outputs.EnabledConfigResponse']: return pulumi.get(self, "failed_requests_tracing")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_request_error(locust_instance, exception, tb, **kwargs):", "def get_failures(self, request, credentials: dict = None) -> int:\n\n raise NotImplementedError(\n \"The Axes handler class needs a method definition for get_failures\"\n )", "def configureTrace(self,traceString):\n ...
[ "0.5787462", "0.5563583", "0.55228883", "0.54398984", "0.532494", "0.5266826", "0.5174222", "0.51674783", "0.51600605", "0.5156298", "0.51515007", "0.51364285", "0.5133246", "0.5120781", "0.50974685", "0.5095027", "0.5057255", "0.5013128", "0.5003495", "0.4991646", "0.4931087...
0.7359959
0
update the page_offset, if the offset exceeds 300, send it to be refreshed and given a new date update. I had to use this stupid string to list to string formatting, but it works
def page_offset_update(date, page_offset, date_ed_url, c): if page_offset <= 300: if date <=10: pg_list = list(date_ed_url) new = list(str(page_offset)) better = pg_list[0:296] + new #this will update the page_offset from 25 to 50 and so on until it hits 300 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_setup(date, page_offset, url,c):\r\n\r\n if date <= 10:\r\n page_offset = 0\r\n url = \"http://data.terapeak.com/?id=0&search=1&view=item_browse&query=iphone+5s&date=2015-02-1&date_range=1&buyer_country_id=1&condition=rollup_3&type%5Bfixed%5D=1&from_start_price=100&to_start_price=800&from...
[ "0.6544635", "0.5793967", "0.56920743", "0.56920743", "0.5585497", "0.5528778", "0.54406804", "0.54134136", "0.5403463", "0.5403245", "0.53995085", "0.53965527", "0.53563327", "0.53444225", "0.53245133", "0.5265951", "0.5265951", "0.5265951", "0.52649504", "0.52252585", "0.52...
0.8073454
0
Create an anagram of n strings randomly chosen from word_list. The jumble is enough to create any one of the selected words, but duplicates between words are merged (see letterbag).
def jumbled(word_list, n): # Create the anagram selected = random.sample(word_list, n) bag = LetterBag("") for word in selected: bag.merge(LetterBag(word)) letters = list(bag.as_string()) print("Letters: {}".format(letters)) random.shuffle(letters) result = "".join(letters) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def anagrams(word_list):\n output = dict()\n\n for word in word_list:\n word = word.strip()\n letters = word_to_tuple(word)\n # add letters as key to output dict\n # if not present already\n output[letters] = output.get(letters, [])\n # append word to list at key\n ...
[ "0.6486426", "0.6453043", "0.62561107", "0.62456477", "0.6220896", "0.6153321", "0.6135814", "0.6116987", "0.6116987", "0.6116987", "0.6115867", "0.6113457", "0.61019075", "0.61019075", "0.61019075", "0.61014646", "0.6096232", "0.60750294", "0.5975778", "0.5920062", "0.590144...
0.8471332
0
Opens a pyaudio stream that's needed to record
def _open_stream(config): p = pyaudio.PyAudio() stream = p.open( format = config["format"], channels = config["channels"], rate = config["rate"], input = True, frames_per_buffer = config["chunk"] ) return p, stream
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recorder():\n # Following block gets rid of annoying config errors by ALSA\n def py_error_handler(filename, line, function, err, fmt):\n pass\n ERROR_HANDLER_FUNC = CFUNCTYPE(None, c_char_p, c_int, c_char_p, c_int, c_char_p)\n c_error_handler = ERROR_HANDLER_FUNC(py_error_handler)\n asoun...
[ "0.74706465", "0.67602795", "0.6739799", "0.67312104", "0.67217994", "0.6652263", "0.6594284", "0.650094", "0.6491284", "0.64722407", "0.6468531", "0.64509577", "0.63947153", "0.63394165", "0.6235703", "0.61654496", "0.614031", "0.6131962", "0.6125602", "0.6106866", "0.604365...
0.75601125
0
Get the bigip configuration as a string for the given partition self the object type config_file the f5 configuration file partition the partition in question.
def get_config(self, config_file='bigip.conf', partition='Common'): if partition == 'Common': path = "/config/{}".format(config_file) else: path = "/config/partitions/{}/{}".format(partition, config_file) offset = 0 chunk_size = 32768 config = '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_partition_cfg(partition_type: str) -> Dict:\n raise NotImplementedError('Not supported yet.')", "def load_config(self):\n with h5py.File(iop.fields, 'r') as hf:\n # fields = hf.get('data')[:]\n config = hf.get('config')[:]\n return config", "def get_partition_...
[ "0.60281533", "0.57505965", "0.57372063", "0.55928534", "0.5584561", "0.5579986", "0.5559166", "0.55569065", "0.55331886", "0.5522723", "0.5453139", "0.540465", "0.54017454", "0.5378639", "0.53541183", "0.5343337", "0.52421504", "0.52404404", "0.5229395", "0.5226048", "0.5195...
0.7477016
0
Check to see if the device has at least the min_version self the object type
def is_version_sufficient(self, min_version): try: current_version = self.get_software_version() return LooseVersion(current_version) >= LooseVersion(min_version) except: raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_version(self):\n pass", "def is_requested_version_specified(self):\n return self.requested_version > FlexibleVersion(VERSION_0)", "def is_for(self, model_type: str, version: Version):\n return model_type == self.model_type and version in self.version_spec", "def is_requested...
[ "0.6726614", "0.65966207", "0.65494555", "0.6443246", "0.62730974", "0.62312984", "0.6210474", "0.6067942", "0.60381806", "0.60043263", "0.59886086", "0.5967476", "0.5882349", "0.58156115", "0.5811074", "0.581068", "0.57969534", "0.57927155", "0.5761563", "0.5733594", "0.5732...
0.7009069
0
Analogue of math.isclose for space points.
def point_isclose(a, b, *args, **kwargs): for x, y in zip(a, b): if not isclose(x, y, *args, **kwargs): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(a,b):\n return abs(a-b) < epsilon", "def is_close(x, y, thresh=1e-8):\n\n diff = x - y\n return diff > (-thresh) and diff < thresh", "def are_close(coord1, coord2, tolerance=10):\n return vincenty(coord1, coord2).meters < tolerance", "def is_close(coord_a: tuple, coord_b: tuple, mindist...
[ "0.68759096", "0.6594233", "0.657802", "0.6509197", "0.64613205", "0.6381611", "0.634457", "0.63269377", "0.62973565", "0.6267877", "0.6149076", "0.61151576", "0.6104251", "0.6093859", "0.6087839", "0.60522425", "0.6018204", "0.5978456", "0.5960303", "0.5933644", "0.59240377"...
0.7138271
0
Test that equivalent instances of `space` do appear equal, and that distinct instances do not appear equal.
def test_equality(self): s3 = space(curvature=1/5) for k in (0, -1, 1, 1.75, 0.325, 1/7, -1.75, -0.325, -1/7): s1 = space(fake_curvature=k) s2 = space(fake_curvature=k) self.assertTrue(s1 == s2) self.assertTrue(hash(s1) == hash(s2)) self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertSpacelessEqual(self, first, second):\n self.assertEqual(set(first.split()), set(second.split()))", "def same_as(self, space, in_space):\n if self.marks == space.marks and self.genus == space.genus:\n return True\n space = space.complementary_component(in_space)\n ...
[ "0.6720806", "0.63527405", "0.62508553", "0.62464815", "0.62412024", "0.6169877", "0.613675", "0.61344224", "0.6130319", "0.61145246", "0.60542357", "0.5968805", "0.59609544", "0.5952627", "0.5894517", "0.5886115", "0.5879031", "0.5876873", "0.58695185", "0.5844071", "0.58430...
0.71558976
0
Test that the repr of the class can be used to exactly reconstruct a point. For this test, we don't care so much what the space or point is, only that it is reconstructible exactly.
def test_repr(self): direction = (3/13, 4/13, 12/13) magnitude = 7.33337377737737773737 for k in (0, -1, 1, 1.75, 0.325, 1/7, -1.75, -0.325, -1/7): s = space(fake_curvature=k) p = s.make_point(direction, magnitude) r = repr(p) v = eval(r) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_point_positive_repr(self):\n p = Point(x=3, y=5)\n self.assertTupleEqual(p.__repr__(), (3.0, 5.0),\n 'Test of Point(x=3, y=5).__repr__() failed. Returned value != (3.0, 5.0)')", "def test_point_positive_str(self):\n p = Point(x=3, y=5)\n self.assertEqu...
[ "0.74315566", "0.7010876", "0.6719743", "0.64998335", "0.6484903", "0.634178", "0.6326949", "0.629799", "0.62194276", "0.6167945", "0.6164364", "0.6142622", "0.61114615", "0.6019057", "0.59666646", "0.5960959", "0.59585816", "0.5937703", "0.5936237", "0.58785623", "0.5838388"...
0.7450213
0
Test that the magnitude of a point constructed from the (direction, magnitude) method actually has correct magnitude. Also checks that the magnitude matches the distance to the origin.
def test_magnitude(self): # test small magnitudes with regular unit vectors u1 = (1,) u2 = (0, 1/2, 0, 1/2, 1/2, 0, 0, 0, 1/2) u3 = (12/13, 4/13, 3/13) for k in (0, -1, 1): s = space(fake_curvature=k) for d in (0, 1, 1/3, 3/2): for n in (u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_magnitude(self):\n\n a1 = vectors.Vector(1, 2, 3)\n self.assertEqual(a1.magnitude(), math.sqrt(14))\n\n a1 = vectors.Vector(-1, -2, -3)\n self.assertEqual(a1.magnitude(), math.sqrt(14))\n\n a1 = vectors.Vector(1, 0, 0)\n self.assertEqual(a1.magnitude(), 1)\n\n ...
[ "0.6976977", "0.62176955", "0.61258674", "0.609689", "0.609689", "0.6085904", "0.6048376", "0.6014426", "0.5913031", "0.5852871", "0.58514756", "0.5800771", "0.5755077", "0.5749432", "0.57480156", "0.5734468", "0.5716839", "0.57111055", "0.56150967", "0.56097627", "0.55773836...
0.7013087
0
There's no way we could get the Pythagorean theorem wrong, right?
def test_pythagorean_triples(self): s = space(0) for a, b, c in ( (3, 4, 5), (8, 15, 17), (33, 56, 65) ): self.assertTrue(isclose( s.hypot(a, b), c )) self.assertTrue(isclose( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pythagorean_triples(n):\n pass", "def is_pythagorean_triplet(a,b,c):\n\treturn a**2 + b**2 == c**2", "def main():\n # Since a < b < c, we have a + b + c = 1000 > a + a + a, making a < 334.\n for a in range(1, 334):\n # Then b + c = 1000 - a > b + b, making b < 500 - a/2.\n for b in r...
[ "0.7482487", "0.7141298", "0.70660967", "0.69818455", "0.69427586", "0.6846207", "0.6814899", "0.6763118", "0.67095196", "0.6648897", "0.66418886", "0.65896046", "0.6483696", "0.64367366", "0.63799393", "0.6368848", "0.63656247", "0.63272536", "0.6307229", "0.6277572", "0.625...
0.740637
1