query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Getter method for grandparent_quality_class, mapped from YANG variable /ptp_state/parent_port_detail/grandparent_quality_class (uint32)
def _get_grandparent_quality_class(self): return self.__grandparent_quality_class
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_grandparent_quality_class(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"grandparent-quality-class\", rest_name=...
[ "0.7848926", "0.6590409", "0.60517037", "0.5701664", "0.54838204", "0.51447207", "0.4988355", "0.4971686", "0.47787836", "0.47091728", "0.46418905", "0.45943207", "0.45290777", "0.4467645", "0.44479266", "0.44043422", "0.42952767", "0.42922276", "0.42082754", "0.42054063", "0...
0.6226168
2
Setter method for grandparent_quality_class, mapped from YANG variable /ptp_state/parent_port_detail/grandparent_quality_class (uint32)
def _set_grandparent_quality_class(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="grandparent-quality-class", rest_name="grandparent-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_grandparent_quality_accuracy(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"grandparent-quality-accuracy\", rest...
[ "0.6975795", "0.63981676", "0.60009694", "0.58107954", "0.528322", "0.5231671", "0.514397", "0.5075302", "0.49745506", "0.47619957", "0.4602832", "0.44740447", "0.44497818", "0.42986956", "0.42727873", "0.42663756", "0.41826543", "0.41512305", "0.41403702", "0.41351438", "0.4...
0.8437205
0
Getter method for grandparent_quality_accuracy, mapped from YANG variable /ptp_state/parent_port_detail/grandparent_quality_accuracy (uint32)
def _get_grandparent_quality_accuracy(self): return self.__grandparent_quality_accuracy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_grandparent_quality_accuracy(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"grandparent-quality-accuracy\", rest...
[ "0.8215544", "0.62436956", "0.57093245", "0.51407576", "0.4982784", "0.46198803", "0.45824733", "0.4550151", "0.44605148", "0.43255997", "0.42689747", "0.42128998", "0.40612787", "0.4050122", "0.40068048", "0.3905951", "0.38975826", "0.38896585", "0.3822706", "0.3812752", "0....
0.6529347
1
Setter method for grandparent_quality_accuracy, mapped from YANG variable /ptp_state/parent_port_detail/grandparent_quality_accuracy (uint32)
def _set_grandparent_quality_accuracy(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="grandparent-quality-accuracy", rest_name="grandp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_grandparent_quality_class(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"grandparent-quality-class\", rest_name=...
[ "0.66881293", "0.6308835", "0.6060355", "0.549621", "0.49149922", "0.4733829", "0.44734183", "0.44348142", "0.43794146", "0.4365506", "0.43030435", "0.42922997", "0.42345908", "0.41831273", "0.414971", "0.40763736", "0.40231016", "0.40006226", "0.3868732", "0.38590807", "0.38...
0.8659588
0
Getter method for grandparent_quality_oslv, mapped from YANG variable /ptp_state/parent_port_detail/grandparent_quality_oslv (uint32)
def _get_grandparent_quality_oslv(self): return self.__grandparent_quality_oslv
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_grandparent_quality_oslv(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"grandparent-quality-oslv\", rest_name=\"...
[ "0.8425746", "0.52433264", "0.50741196", "0.48801157", "0.4717152", "0.4098151", "0.40652192", "0.4022955", "0.4012799", "0.39650628", "0.38937747", "0.387784", "0.38632408", "0.3855682", "0.3770271", "0.3763099", "0.37532637", "0.3710318", "0.3708748", "0.3683843", "0.365402...
0.70810825
1
Setter method for grandparent_quality_oslv, mapped from YANG variable /ptp_state/parent_port_detail/grandparent_quality_oslv (uint32)
def _set_grandparent_quality_oslv(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="grandparent-quality-oslv", rest_name="grandparent-qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_grandparent_quality_oslv(self):\n return self.__grandparent_quality_oslv", "def _set_grandparent_quality_class(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294...
[ "0.67969686", "0.5678937", "0.5416543", "0.5180732", "0.49955714", "0.4462018", "0.42956516", "0.41585734", "0.41459513", "0.41318336", "0.4129239", "0.4121154", "0.3988967", "0.3975459", "0.39519668", "0.3947816", "0.39145526", "0.38376322", "0.38332298", "0.3809323", "0.380...
0.8863831
0
Transform a text matrix to a list of lists.
def mat2list(matrix = '1 2 3\n2 4 6'): # Split matrix into rows - after stripping leading and trailing space list_of_rows = matrix.strip().split('\n') # Split each list into elements list_of_lists = [row.split() for row in list_of_rows] # Change number strings to digits list_of_lists = [[int(s) for s i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes2matrix(text):\n return [list(text[i : i + 4]) for i in range(0, len(text), 4)]", "def convert_str_matrix(str_matrix):\n\n\n\treturn [[int(num) for num in line.split(\" \")] for line in str_matrix.splitlines()]\n \n\t\"\"\"The line above is a list comprehension. It is equivalent to:\n\tmatrix ...
[ "0.70239335", "0.6947369", "0.6775744", "0.6705223", "0.66343963", "0.65847546", "0.65369195", "0.6487502", "0.6468017", "0.64065576", "0.63951", "0.6308778", "0.62935144", "0.62866104", "0.6285754", "0.62851584", "0.6241169", "0.6212326", "0.61520934", "0.61375815", "0.60979...
0.77920943
0
compare two DEG dicts (only consider the keys in both dicts)
def compare_deg_dicts( dct_deg1, dct_deg2, df_map: Optional[pd.DataFrame] = None): common_types = sorted(set(dct_deg1.keys()).intersection(dct_deg2.keys())) # gmap = df_varmap if tag_1v1 == '' else df_varmap_1v1 record = {} for cl in common_types: deg1 = dct_deg1[cl] deg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict_compare(d1, d2):\n d1_keys = set(d1.keys())\n d2_keys = set(d2.keys())\n intersect_keys = d1_keys.intersection(d2_keys)\n added = d1_keys - d2_keys\n removed = d2_keys - d1_keys\n modified = {o: (d1[o], d2[o]) for o in intersect_keys if d1[o] != d2[o]}\n same = set(o for o in intersec...
[ "0.797678", "0.79599327", "0.7856357", "0.7805207", "0.7672942", "0.75369716", "0.7481761", "0.74809116", "0.7390292", "0.7353605", "0.73468703", "0.72802573", "0.72674567", "0.7259886", "0.72531384", "0.72442865", "0.7206933", "0.7198568", "0.71801245", "0.71646386", "0.7163...
0.6634172
62
Instantiate a new twitter.Api object.
def __init__(self, consumer_key=None, consumer_secret=None, access_token_key=None, access_token_secret=None): self.consumer_key = consumer_key self.consumer_secret = consumer_secret self.access_token_key = access_token_key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_twitter_api():\n\n keys_json = open('config/keys.json', 'r').read()\n keys = json.loads(keys_json)\n\n consumer_key = keys['consumer_key']\n consumer_secret_key = keys['consumer_secret_key']\n access_token = keys['access_token']\n access_secret_token = keys['access_secret_token']\n...
[ "0.803728", "0.7750109", "0.7705305", "0.7705305", "0.7705305", "0.7447444", "0.7395223", "0.7390613", "0.7320439", "0.73031056", "0.73031056", "0.73031056", "0.7235111", "0.7212925", "0.7162178", "0.7149766", "0.71485716", "0.7071177", "0.70321584", "0.6964768", "0.69595516"...
0.0
-1
tests to make sure the hero isnt already jumping , then assigns a yVel(the highest point in the jump) and sets isJumping to true
def jump(self): #if (self.isJumping == False): # self.yVel = -15 # self.isJumping = True self.rect.centery -= 40 self.isJumping = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jump(self):\r\n self.standing = False\r\n self.punching = False\r\n self.jumping = True\r\n self.falling = False\r\n self.current_y = float(self.rect.y)\r\n self.vel = -50", "def _jump(self):\n\n self.speed_y += PLAYER_GRAVITY\n # touched the ground\n ...
[ "0.74877596", "0.69821995", "0.68993247", "0.6859081", "0.6849504", "0.6835034", "0.6835034", "0.6785047", "0.67846894", "0.6707504", "0.6705921", "0.6697567", "0.6692874", "0.666312", "0.66200006", "0.6304539", "0.6234993", "0.6234993", "0.623083", "0.6227213", "0.61762714",...
0.7347298
1
moves the character to the left by changing their x coordinate returns nothing
def moveLeft(self): self.rect.centerx -= 10
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moveLeftOneCharacter(self):\r\n self.SendScintilla(QsciScintilla.SCI_CHARLEFT)", "def moveLeft(self,x):\n\t\tpass", "def move_left(self):\n if self.case_x > 0:\n if self.niveau.structure[self.case_y][self.case_x - 1] not in ['-', '+', '|']:\n self.case_x -= 1\n ...
[ "0.7937441", "0.79271126", "0.791954", "0.7711849", "0.766763", "0.76142496", "0.76069856", "0.76069856", "0.76069856", "0.75460505", "0.75460505", "0.7507041", "0.74073386", "0.73996705", "0.7358235", "0.7279789", "0.7194542", "0.7182047", "0.7128633", "0.7020018", "0.701942...
0.7503668
12
takes x as a parameter, which is the health value for the hero sets the health of the hero returns nothing
def setHealth(self, x): self.health = x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDamage(self, x):\r\n self.damage = x", "def setHealth (self, num) :\n\t\tself._health = num", "def reset_health(self):\n self.health = self.max_health", "def dealDamage(self,x):\n\t\tself.states['hull_integrity'] = self.states['hull_integrity'] - x\n\t\tself.updateStates", "def attack_...
[ "0.68044335", "0.6677127", "0.65987146", "0.64548373", "0.64191777", "0.6386938", "0.61658275", "0.61450464", "0.61410254", "0.60934263", "0.6051834", "0.59914243", "0.5974319", "0.59635013", "0.59310865", "0.5928601", "0.5897266", "0.5833849", "0.5826896", "0.5811031", "0.58...
0.83255666
0
Sets the time/div for of the trace.
def time_step(self, c, data): dev = self.selectedDevice(c) dataS = data['s'] yield dev.write('TBM TIM:%g' % dataS) returnValue(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_time(self, a, ti, div):\n\n\t\tself.al, self.size = gab.get_all_time(self, a, ti, div)", "def set_time(self, time):\n pass", "def set_time(self, value):\n self.print_time = value", "def set_time(self, time):\n self.__time = time", "def set_time(self, t):\n if self.paused...
[ "0.77347314", "0.7188456", "0.7056918", "0.6947983", "0.6871616", "0.68448055", "0.68248343", "0.6771658", "0.67195916", "0.6702751", "0.6689127", "0.6668274", "0.6668274", "0.6668274", "0.6668274", "0.6668274", "0.6668274", "0.6637315", "0.6559343", "0.65214294", "0.6499738"...
0.0
-1
Trigger on positive slope.
def trigger_positive(self, c): dev = self.selectedDevice(c) yield dev.write('TRI SLO:PLU')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TriggerSlope(self, slope):\n \n self.write(\"trigger:main:edge:slope {}\".format(slope))", "def slope(self, value):\n\n if (value < -3.0) or (value > 3.0):\n raise InputParameterError(\"parameter slope must be between \" \"-3.0 and 3.0\")", "def trigger_slope(self, c, slope ...
[ "0.73758566", "0.6811917", "0.67340344", "0.64308405", "0.6354972", "0.63451666", "0.59848726", "0.5958961", "0.595041", "0.5877498", "0.58056617", "0.5744927", "0.5730271", "0.5698502", "0.5697842", "0.56842226", "0.5682193", "0.56764984", "0.56757677", "0.5664877", "0.56388...
0.5089907
68
Trigger on negative slope.
def trigger_negative(self, c): dev = self.selectedDevice(c) yield dev.write('TRI SLO:NEG')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slope(self, value):\n\n if (value < -3.0) or (value > 3.0):\n raise InputParameterError(\"parameter slope must be between \" \"-3.0 and 3.0\")", "def TriggerSlope(self, slope):\n \n self.write(\"trigger:main:edge:slope {}\".format(slope))", "def testSlopeSetNegative(self):\n...
[ "0.65454596", "0.65015674", "0.6434065", "0.6293494", "0.6167307", "0.61402756", "0.60526454", "0.599829", "0.5962224", "0.5861474", "0.5831667", "0.57487994", "0.572058", "0.5718514", "0.5711906", "0.5683798", "0.56790024", "0.5659242", "0.56339395", "0.56222516", "0.5605214...
0.59324586
9
creates gaussian kernel with side length l and a sigma of sigma
def gaussian3d(l, sigma=1.0): ax = np.arange(-l//2 + 1.0, l//2 + 1.0) xx, yy, zz = np.meshgrid(ax, ax, ax) kernel = np.exp(-(xx**2 + yy**2 + zz**2)/(2.0*sigma**2)) return np.asarray(kernel, dtype=np.float32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian_kernel(l=5, sig=1.):\n\n ax = np.linspace(-(l - 1) / 2., (l - 1) / 2., l)\n\n kernel = np.exp(-0.5 * np.square(ax) / np.square(sig))\n\n return kernel / np.sum(kernel)", "def gaussian_kernel(X, sigma):\r\n return np.exp(-1 * X ** 2 / (2 * sigma ** 2))", "def gaussian_kernel(size, sigma...
[ "0.78080887", "0.76631415", "0.7499144", "0.7418548", "0.7418062", "0.73848575", "0.7378254", "0.7343433", "0.71427083", "0.7142321", "0.7105179", "0.70946354", "0.70936567", "0.7034293", "0.70242506", "0.70027745", "0.7000856", "0.6991268", "0.6935657", "0.69318444", "0.6903...
0.7450205
3
helpermethod to draws the labels of the pie chart on canvas.
def draw_label(self, angle, text): def deg_to_coord(): r = (self.diameter / 2) - 10 x_offset = int(r * math.cos(math.radians(angle)).real) y_offset = int(r * math.sin(math.radians(angle)).real) return self.center[0] + x_offset, self.center[1] - y_offset ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __pie_chart_create_labels(wedges, kw, ax, labels):\n for i, p in enumerate(wedges):\n ang = (p.theta2 - p.theta1) / 2. + p.theta1\n y = np.sin(np.deg2rad(ang))\n x = np.cos(np.deg2rad(ang))\n horizontalalignment = {-1: \"right\", 1: \"left\"}[int(np.sign(x))]\...
[ "0.7083145", "0.6873458", "0.6741883", "0.6693017", "0.65307814", "0.63284385", "0.62837225", "0.6246316", "0.6240842", "0.62206143", "0.6185173", "0.6140824", "0.60814995", "0.6027792", "0.6026043", "0.6010441", "0.5999848", "0.5978248", "0.5949457", "0.5945615", "0.5915862"...
0.7005189
1
This method is called automatically by FlaskLogin to get the user by his id whenever FlaskLogin needs the User object.
def load_user(user_id): return user_model.get_user_by_id(user_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(self):\n user_cookie = self.request.cookies.get(\"user_id\")\n if check_secure_val(user_cookie):\n user_id = user_cookie.split('|')[0]\n user = User.by_id(int(user_id))\n return user", "def get(self, id_: UserId) -> User:\n raise NotImplementedError(\"\")", "def g...
[ "0.7629456", "0.7619687", "0.7593542", "0.7593542", "0.7538125", "0.7536187", "0.75230867", "0.74684876", "0.74443144", "0.7443321", "0.74160576", "0.7410026", "0.7377086", "0.7370047", "0.735865", "0.735865", "0.735865", "0.73542583", "0.7353081", "0.7345841", "0.7342617", ...
0.0
-1
This route contains the login page and the login form. When submitted, we verify if the user exists in the database and his credentials are correct.
def login(): form = LoginForm() if request.method == 'POST' and form.validate_on_submit(): user = user_model.get_user_by_username(form.username.data) if user is not None and user.verify_password(form.password.data): login_user(user, form.remember_me.data) # If the user w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():\n if request.method == 'POST':\n try:\n user = User.select().where(User.name == request.form['name']).get()\n except User.DoesNotExist:\n return render_template('login.jinja2',\n error='Incorrect username or password'\n ...
[ "0.81039447", "0.808691", "0.80866015", "0.8045194", "0.80005115", "0.79660964", "0.7940254", "0.7872815", "0.7841892", "0.78170526", "0.7805151", "0.7801326", "0.77923757", "0.7752498", "0.7751433", "0.77496046", "0.77388656", "0.77157444", "0.77089167", "0.77064407", "0.769...
0.75281614
41
Test the ckeditor_view._getScaytLanguage method. This method will try to find out the SCAYT language to use in case SCAYT is enabled on CKeditor widget startup. It tries to map the current content used language with languages codes supported by SCAYT.
def test_getScaytLanguage(self): portal = self.layer['portal'] from Products.CMFPlone import utils as ploneutils ploneutils._createObjectByType('Document', portal, 'front-page') frontPage = getattr(portal, 'front-page') view = getMultiAdapter( (frontPage, frontPage.RE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_getScaytLanguage(self):\n portal = self.layer['portal']\n from Products.CMFPlone import utils as ploneutils\n ploneutils._createObjectByType('Document', portal, 'front-page')\n frontPage = getattr(portal, 'front-page')\n view = getMultiAdapter(\n (frontPage, f...
[ "0.771196", "0.76712775", "0.5363576", "0.5361505", "0.53372794", "0.5244073", "0.51627225", "0.5134365", "0.51231915", "0.51123816", "0.5067379", "0.5042686", "0.5014394", "0.50124323", "0.49486494", "0.49351823", "0.49197894", "0.49197894", "0.49179333", "0.48995456", "0.48...
0.7742474
0
Convenience method for reading multiple subbatches of a batch in multiple processes in order to speed up reading.
def get_words(batch, num_of_subbatches): subbatches = np.split(batch, num_of_subbatches) pool = mp.Pool(num_of_subbatches) word_batches = pool.map(_read_subbatch_words, subbatches) word_list = [word for batch in word_batches for word in batch] return list(set(word_list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_data_batch(\n self, multi_pack: MultiPack, context_type: Type[Annotation],\n requests: Optional[Dict[Type[Entry], Union[Dict, List]]] = None,\n offset: int = 0) -> Iterable[Tuple[Dict, int]]:\n input_pack = multi_pack.get_pack(self.input_pack_name)\n\n instan...
[ "0.67427194", "0.66567016", "0.6508421", "0.6461491", "0.6461069", "0.6416054", "0.63780004", "0.6376313", "0.63755864", "0.62460905", "0.61988926", "0.61929405", "0.6170706", "0.61555225", "0.6149261", "0.612725", "0.6120231", "0.61179394", "0.61096364", "0.61066717", "0.608...
0.0
-1
Gets a project with the specified slug.
def get_project(parser, token): args = token.split_contents() argc = len(args) try: assert argc == 4 except AssertionError: raise template.TemplateSyntaxError('Invalid get_project syntax.') # determine what parameters to use slug = var_name = None if argc == 4: t, slug, a, v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_project(slug):\n hits = [i for i in get_all_projects() if i.get('slug') == slug]\n if len(hits) > 1:\n raise ValueError(\"More than one YAML config slugged: %s\" % slug)\n elif len(hits) == 0:\n raise YAMLDoesNotExistError(\"Slug %s could not be found\" % slug)\n else:\n re...
[ "0.7766129", "0.7388798", "0.661334", "0.6592386", "0.6554215", "0.6551045", "0.65333277", "0.6438998", "0.64175946", "0.63602203", "0.63559914", "0.6333996", "0.63016737", "0.6276679", "0.6156239", "0.6130945", "0.61027944", "0.605446", "0.6033774", "0.5954649", "0.5941565",...
0.6605431
3
Gets projects with the specified group slug.
def get_group_projects(parser, token): args = token.split_contents() argc = len(args) try: assert argc == 6 except AssertionError: raise template.TemplateSyntaxError('Invalid get_project syntax.') # determine what parameters to use slug = count = var_name = None if argc == 6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_group_id(group_id):\n project = ProjectModel.get_by_groupid(group_id) \n project_data = project_schema.dump(project).data\n return custom_response(project_data, 200)", "def get_group_projects(group_id):\n\n base_url = \"https://gitlab.com/api/v4/\"\n base_url = base_url + \"groups/{}/...
[ "0.64042103", "0.62891763", "0.6187052", "0.6185559", "0.5914467", "0.5768041", "0.575378", "0.5710925", "0.56267065", "0.56227577", "0.5615612", "0.55885494", "0.5540591", "0.5538405", "0.5521662", "0.54716474", "0.5436133", "0.54337937", "0.5417208", "0.53984725", "0.539218...
0.67882687
0
A simple parametrized exponential function, applied elementwise.
def exponential(xs, scale, rate, x0): ys = scale * np.exp(rate * (xs - x0)) return ys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exp(x):\n return _func(\"exp\", TFloat64(), x)", "def exponential(x):\n return K.exp(x)", "def exp(x):\r\n\r\n return math.exp(x)", "def exp(x):\n return ExpOp(x)", "def exponential(x, a, b, n):\n if n < 1.000001:\n n = 1.000001\n elif n > 1.2:\n n = 1.2\n if b < -10:\n...
[ "0.8111955", "0.80935925", "0.7796515", "0.7770991", "0.76809907", "0.7626076", "0.7612482", "0.756241", "0.75199485", "0.7336274", "0.7326449", "0.7193773", "0.71568984", "0.7155962", "0.71227205", "0.70738554", "0.7054818", "0.70508015", "0.7050387", "0.7036281", "0.7031328...
0.71790373
12
Return the latest state by comparing the cursor value in the latest record with the stream's most recent state object and returning an updated state object.
def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, Any]: latest_benchmark = latest_record[self.cursor_field] if current_stream_state.get(self.cursor_field): return {self.cursor_field: max(latest_benchmark, current_str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):\n latest_benchmark = latest_record[self.cursor_field]\n if current_stream_state.get(self.cursor_field):\n return {self.cursor_field: max(latest_benchmark, current_stream_state[sel...
[ "0.7755357", "0.769625", "0.75048494", "0.75045836", "0.6110703", "0.6099592", "0.6085437", "0.60563576", "0.58867306", "0.5819013", "0.5712147", "0.56204844", "0.561747", "0.55728936", "0.5544162", "0.55006564", "0.5472746", "0.5369697", "0.53673565", "0.536545", "0.5353924"...
0.7730901
1
Return the latest state by comparing the cursor value in the latest record with the stream's most recent state object and returning an updated state object.
def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]): latest_benchmark = latest_record[self.cursor_field] if current_stream_state.get(self.cursor_field): return {self.cursor_field: max(latest_benchmark, current_stream_state[self.cursor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, Any]:\n latest_benchmark = latest_record[self.cursor_field]\n if current_stream_state.get(self.cursor_field):\n return {self.cursor_field: max(latest_benchmark, cur...
[ "0.77300423", "0.7694981", "0.7503529", "0.75034976", "0.61092895", "0.60966617", "0.6084027", "0.6053883", "0.58849186", "0.5817025", "0.5710876", "0.56194925", "0.56174743", "0.5570329", "0.5544698", "0.5499068", "0.5470746", "0.53680456", "0.536563", "0.53638333", "0.53518...
0.7754311
0
Removes data by setting individual cells in the data matrix as nan
def remove_activity_labels_random_cells(labels, percent_to_delete, remove_seed=1234): prng = np.random.RandomState(remove_seed) idx_x, idx_y = np.where(np.isfinite(labels)) num_real_labels=len(idx_x) to_delete=prng.binomial(1, 1-percent_to_delete, num_real_labels) new_labels=labels.copy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kill_nans(f):\n h = f.shape[0]\n w = f.shape[1]\n for r in range(h):\n for c in range(w):\n if np.isnan(f[r][c][0]) or np.isnan(f[r][c][1]):\n f[r][c] = np.array([0.0, 0.0], dtype='float')", "def replace_nans(self) -> None:\n self.data.replace(self.nan_value, ...
[ "0.7340118", "0.7127941", "0.7097452", "0.70898753", "0.70095444", "0.7009487", "0.69626737", "0.6937962", "0.6905754", "0.68079406", "0.6788926", "0.6776522", "0.6748796", "0.67407626", "0.6697415", "0.6672681", "0.66654456", "0.66596466", "0.6582833", "0.65706193", "0.65618...
0.0
-1
Removes data by setting whole rows in the data matrix as nan
def remove_activity_labels_random_compounds(labels, percent_to_delete, remove_seed=1234): prng = np.random.RandomState(remove_seed) real_cpds=labels.dropna(axis=0, how='all').index.values num_real_cpds=labels.dropna(axis=0, how='all').shape[0] num_real_todelete=int(percent_to_delete*num_real_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prune(self):\n mask = ~equivalent(self.data, self.fill_value)\n self.coords = self.coords[:, mask]\n self.data = self.data[mask]", "def kill_nans(f):\n h = f.shape[0]\n w = f.shape[1]\n for r in range(h):\n for c in range(w):\n if np.isnan(f[r][c][0]) or np.is...
[ "0.72670746", "0.7203605", "0.7067342", "0.70528436", "0.7049264", "0.7017055", "0.6980237", "0.6937021", "0.6926738", "0.6864405", "0.6787069", "0.67848986", "0.6685778", "0.6676286", "0.6672834", "0.6619721", "0.6612314", "0.6575703", "0.65741265", "0.65617687", "0.6537832"...
0.0
-1
Returns homepage as the landing page
def home(request): return render_to_response('homepage.html', {'tableVisiblity':"display: none;", 'loadingState':"display: none;"})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_homepage():\r\n\r\n return render_template(\"homepage.html\")", "def homepage():\n conf = Configurations.query.first()\n if conf.active:\n return render_template('home/index.html', conf=conf)\n return render_template('home/fuera_de_servicio.html', conf=conf)", "def show_homepage():\...
[ "0.8038159", "0.7973673", "0.79734033", "0.79634964", "0.7935866", "0.7885986", "0.7884535", "0.7874765", "0.78561467", "0.78561467", "0.78337824", "0.78287953", "0.7782522", "0.77753687", "0.76701784", "0.76697975", "0.7646714", "0.758605", "0.75758314", "0.7572367", "0.7571...
0.0
-1
Returns true if both filepaths have same number of lines
def have_same_lines(filepaths: List[str]) -> bool: file_sizes = [] for filepath in filepaths: with open(filepath) as f: for i, l in enumerate(f): pass file_sizes.append(i + 1) return all(sz == file_sizes[0] for sz in file_sizes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lines_equal(from_lines, to_lines, from_filename, to_filename):\n\n same = True\n for line in difflib.unified_diff(\n from_lines,\n to_lines,\n fromfile=os.path.abspath(from_filename),\n tofile=os.path.abspath(to_filename),\n ):\n sys.stderr.write(line)\n same ...
[ "0.7294545", "0.7016327", "0.6956141", "0.6883716", "0.6865348", "0.6736595", "0.64769334", "0.6420145", "0.6402281", "0.63770515", "0.6374453", "0.6293154", "0.6289797", "0.6283126", "0.62532276", "0.6247446", "0.6225109", "0.62234926", "0.6207884", "0.6205791", "0.616195", ...
0.82119846
0
Initialize a new CompanionAPI instance.
def __init__(self, core: Core): super().__init__() self.core = core self._connection: Optional[CompanionConnection] = None self._protocol: Optional[CompanionProtocol] = None self._subscribed_events: List[str] = [] self.sid: int = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def connect(self):\n if self._protocol:\n return\n\n _LOGGER.debug(\"Connect to Companion from API\")\n self._connection = CompanionConnection(\n self.core.loop,\n str(self.core.config.address),\n self.core.service.port,\n self.core....
[ "0.69755834", "0.6660902", "0.64683646", "0.64356196", "0.6399743", "0.6399743", "0.6387361", "0.63787097", "0.63638705", "0.635019", "0.63327396", "0.6329863", "0.6309226", "0.61491126", "0.614549", "0.6128948", "0.6064785", "0.6057288", "0.60436213", "0.60412306", "0.604040...
0.6202825
13
Testing the POST users//watched/reviewgroups/ API with Does Not Exist error
def test_post_with_does_not_exist_error(self): rsp = self.api_post(get_watched_review_group_list_url(self.user.username), {"object_id": "invalidgroup"}, expected_status=404) self.assertEqual(rsp["stat"], "fail") self.assertEqual(rsp["err"]["code"], DOES_NOT_EXIST.code)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get(self):\n\t\tgroup = self.create_review_group()\n\t\tprofile = self.user.get_profile()\n\t\tprofile.starred_groups.add(group)\n\t\texpected_url = self.base_url + get_review_group_item_url(group.name)\n\t\tself.api_get(get_watched_review_group_item_url(self.user.username, group.pk), expected_status=302,...
[ "0.7376094", "0.7274024", "0.6915842", "0.6910529", "0.65393925", "0.65234256", "0.6421328", "0.635671", "0.6244355", "0.6237625", "0.6175869", "0.610877", "0.6106003", "0.6097881", "0.60747147", "0.5940152", "0.5923527", "0.59200346", "0.58957446", "0.5893146", "0.58839995",...
0.79486215
0
Testing the POST users//watched/reviewgroups/ API with a local site and Does Not Exist error
def test_post_with_site_does_not_exist_error(self): user = self._login_user(local_site=True) rsp = self.api_post(get_watched_review_group_list_url(user.username, self.local_site_name), {"object_id": "devgroup"}, expected_status=404) self.assertEqual(rsp["stat"], "fail") self.assertEqual(rsp["err"]["code"], DOES...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get(self):\n\t\tgroup = self.create_review_group()\n\t\tprofile = self.user.get_profile()\n\t\tprofile.starred_groups.add(group)\n\t\texpected_url = self.base_url + get_review_group_item_url(group.name)\n\t\tself.api_get(get_watched_review_group_item_url(self.user.username, group.pk), expected_status=302,...
[ "0.7430854", "0.7378547", "0.72301894", "0.7193669", "0.64005435", "0.6196279", "0.616318", "0.609807", "0.60220015", "0.60151047", "0.60019404", "0.5925305", "0.5884186", "0.58832484", "0.58438635", "0.58438194", "0.5822098", "0.57919276", "0.5767746", "0.57443255", "0.57434...
0.74601704
0
Check if the tag is a block level HTML tag.
def isBlockLevel(tag): if isinstance(tag, string_type): return BLOCK_LEVEL_ELEMENTS.match(tag) # Some ElementTree tags are not strings, so return False. return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_tag(fragment):\n return isinstance(fragment, hp.HtmlTag)", "def is_opening_tag(self):\n return self.tag and self.content[1] != '/'", "def IsBlock(self):\r\n\r\n return self.IsType(ID_BLOCK)", "def is_tag():\n return False", "def _is_subblock(block):\n return False", ...
[ "0.6901407", "0.66529864", "0.65529037", "0.648276", "0.63576776", "0.5972607", "0.588142", "0.5810114", "0.57282525", "0.56354994", "0.5623199", "0.55531675", "0.5521877", "0.55043066", "0.54927695", "0.5464428", "0.54531336", "0.5444822", "0.5435755", "0.54272956", "0.54111...
0.7990768
0
Get the hex color value for a Person in a PersonSetCollection.
def get_person_color( person: Person, person_set_collection: PersonSetCollection ) -> str: if person.generated: return "#E0E0E0" if person_set_collection is None: return "#FFFFFF" matching_person_set = person_set_collection.get_person_set_of_person( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color(self):\n return self['color']", "def color(self):\n return self[2]", "def color(self):\n return Predator.color_dict[self.color_name]", "def getColor(self) -> str:\r\n return self.__color", "def get_color(self) -> str:\n return self._color", "def get_color(self) ...
[ "0.66208214", "0.65113896", "0.6503161", "0.64413667", "0.64224064", "0.64224064", "0.63984114", "0.6352912", "0.6350712", "0.6350712", "0.6327328", "0.63128996", "0.62702733", "0.62604326", "0.62515616", "0.62515616", "0.62366027", "0.62366027", "0.62366027", "0.6230076", "0...
0.8094047
0
Computes the distance between two geographical points in kilometers. The coordinate values are degrees.
def haversine(lat1_deg, lon1_deg, lat2_deg, lon2_deg, earth_radius=EARTH_EQUATORIAL_RADIUS): lat1 = math.radians(lat1_deg) lon1 = math.radians(lon1_deg) lat2 = math.radians(lat2_deg) lon2 = math.radians(lon2_deg) dlon = lon2 - lon1 dlat = lat2 - lat1 a = (math.sin(dlat/2))**2 + math.cos(lat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_geo_distance(c_1: City, c_2: City) -> float:\n return great_circle(c_1.coordinates, c_2.coordinates).km", "def distance(one, two):\n lon1, lat1, lon2, lat2 = map(radians, [one[0], one[1], two[0], two[1]])\n # haversine formula\n dlon = lon2 - lon1\n dlat = lat2 - lat1\n value_a = sin(dl...
[ "0.766506", "0.7645383", "0.76151013", "0.76111835", "0.7569219", "0.7416746", "0.7397698", "0.7384929", "0.7346066", "0.7344189", "0.73421633", "0.72603005", "0.72420704", "0.72340137", "0.72295487", "0.7213208", "0.7206983", "0.7206231", "0.7199088", "0.7199088", "0.7199088...
0.0
-1
Test that a channel_id that hasn't been created cannot be used to send a message
def test_standup_send_invalid_channel(): # Clear data and extract token requests.delete(url + "/clear/v1") authorised_info = requests.post(url + "/auth/register/v2", json = { 'email': 'unswstudent@gmail.com', 'password': 'kensington', 'name_first': 'unsw', 'name_last': 'stude...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_message_send_not_in_c():\n user_infor1 = auth_register(\"337992611@gamil.com\", \"ccc337992611\", \"Min\", \"Li\")\n user_infor2 = auth_register('testmeplz@gmail.com', 'ccc337992611', 'A', 'H')\n\n channel_infor_2 = channels_create(user_infor2['token'], 'test_two', True)\n\n with pytest.raises...
[ "0.7474513", "0.714607", "0.69575644", "0.67828166", "0.6695209", "0.65781474", "0.6557511", "0.65178967", "0.64862466", "0.6484185", "0.6464904", "0.6459708", "0.64104944", "0.64007735", "0.6392928", "0.63864183", "0.63801736", "0.63378936", "0.6308225", "0.62563455", "0.624...
0.6556442
7
Test checking a message that is sent by a user who is not a member of channel cannot be sent
def test_standup_send_not_member(): # Following the clearing of data, register a user requests.delete(url + "/clear/v1") authorised_info1 = requests.post(url + "/auth/register/v2", json = { 'email': 'alex.steel@gmail.com', 'password': 'alexsteel2000', 'name_first': 'alex', 'n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_message_send_not_in_c():\n user_infor1 = auth_register(\"337992611@gamil.com\", \"ccc337992611\", \"Min\", \"Li\")\n user_infor2 = auth_register('testmeplz@gmail.com', 'ccc337992611', 'A', 'H')\n\n channel_infor_2 = channels_create(user_infor2['token'], 'test_two', True)\n\n with pytest.raises...
[ "0.8087724", "0.7754117", "0.7473955", "0.72663397", "0.71000147", "0.69947815", "0.6963511", "0.6954954", "0.6853106", "0.6783258", "0.6734105", "0.6728583", "0.6698102", "0.6689619", "0.6689185", "0.66875273", "0.66801614", "0.6678034", "0.6627376", "0.6616249", "0.65960467...
0.6680047
17
Return a clone of this object.
def clone(self): return Board(self.m)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone(self):\n\t\timport copy\n\t\treturn copy.deepcopy(self)", "def clone(self):\n return copy.deepcopy(self)", "def clone(self):\n return copy.deepcopy(self)", "def clone(self):\n return _copy.deepcopy(self)", "def clone(self):\n return deepcopy(self)", "def clone(self):...
[ "0.9155637", "0.91514665", "0.91514665", "0.91308653", "0.91115016", "0.86716336", "0.86122507", "0.8582683", "0.8497535", "0.8497535", "0.8474183", "0.8461444", "0.8444582", "0.8424237", "0.8424237", "0.8424237", "0.8424237", "0.8424237", "0.8424237", "0.8424237", "0.8424237...
0.7761358
85
Return the percepts corresponding to the current state. If invert is True, the sign of all values is inverted to get the view of the other player.
def get_percepts(self, invert=False): mul = 1 if invert: mul = -1 return [[mul * self.m[i][j] for j in range(self.columns)] for i in range(self.rows)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def power_pin_polarity(invert=None):\n\n ret = {}\n\n # Read out current settings\n if invert == None:\n cfg = power_config()\n\n ret[\"_stamp\"] = cfg[\"_stamp\"]\n ret[\"value\"] = cfg[\"pwr_ctrl\"]\n\n return ret\n\n # Write settings\n res = _change(\"STSLPCP {:d}\".fo...
[ "0.5632262", "0.55153596", "0.53977066", "0.5341066", "0.52394325", "0.51496524", "0.5123706", "0.51016337", "0.50863826", "0.5050526", "0.5043996", "0.50414944", "0.50220066", "0.49898258", "0.49733838", "0.49732995", "0.4946736", "0.4941731", "0.49385864", "0.4938468", "0.4...
0.68411523
0
Return whether action is a valid action.
def is_action_valid(self, action): try: i1, j1, i2, j2 = action if i1 < 0 or j1 < 0 or i2 < 0 or j2 < 0 or \ i1 >= self.rows or j1 >= self.columns or \ i2 >= self.rows or j2 >= self.columns or \ (i1 == i2 and j1 == j2) or (abs(i1-i2) > 1) or (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_action(self, action):\n return (action.verb in self.verbs and\n action.preposition in self.prepositions and\n action.object in self.objects)", "def is_valid_action(self, state: object, player: int, action: str) -> bool:\n return True", "def _is_valid_act...
[ "0.82907546", "0.8152146", "0.8143761", "0.8103219", "0.798923", "0.79708016", "0.7413366", "0.74033445", "0.73187006", "0.7195952", "0.71117383", "0.7096117", "0.7020482", "0.6940397", "0.68805945", "0.66247845", "0.6615702", "0.6599644", "0.6599285", "0.65761924", "0.655348...
0.7382123
8
Yield all valid actions on this board.
def get_actions(self): for i, j, h in self.get_towers(): for action in self.get_tower_actions(i, j): yield action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tower_actions(self, i, j):\n h = abs(self.m[i][j])\n if h > 0 and h < self.max_height:\n for di in (-1, 0, 1):\n for dj in (-1, 0, 1):\n action = (i, j, i+di, j+dj)\n if self.is_action_valid(action):\n yiel...
[ "0.6885411", "0.6847864", "0.68393844", "0.67015547", "0.65791404", "0.6471445", "0.6462889", "0.6430412", "0.63954026", "0.63742065", "0.633503", "0.633503", "0.63047755", "0.6304652", "0.63030565", "0.6301813", "0.6295807", "0.629304", "0.6255601", "0.6254648", "0.6235747",...
0.6972763
0
Return whether no more moves can be made (i.e., game finished).
def is_finished(self): for action in self.get_actions(): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkEnd(self):\n if len(self.moves) == 0:\n return True\n else:\n return False", "def has_move(self) -> bool:\n\n return len(self.moves) != 0", "def checkGameOver(self):\n\n directions = ['UP', 'DOWN', 'LEFT', 'RIGHT']\n counter = 0\n\n # Try...
[ "0.80909055", "0.77841014", "0.76199", "0.759064", "0.7556136", "0.7542086", "0.7521425", "0.7509779", "0.7485894", "0.7475145", "0.7386942", "0.73700607", "0.73145044", "0.7307968", "0.7256242", "0.722551", "0.7215396", "0.71753556", "0.7153295", "0.7112723", "0.71001965", ...
0.65677434
69
Return a score for this board. The score is the difference between the number of towers of each player. In case of ties, it is the difference between the maximal height towers of each player. If self.is_finished() returns True,
def get_score(self): score = 0 for i in range(self.rows): for j in range(self.columns): if self.m[i][j] < 0: score -= 1 elif self.m[i][j] > 0: score += 1 if score == 0: for i in range(self.rows): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_score(self):\n return sum(self.board)", "def get_player_score(self):\n return self.score", "def get_score(self):\n return self._player_score", "def getScore(self):\n return self.wins * 3 + self.draws", "def evaluate(self, board):\n if self.wins(board, self.compute...
[ "0.71315205", "0.6612453", "0.6603832", "0.65441364", "0.65137273", "0.64978886", "0.6472718", "0.64712983", "0.64712983", "0.6411806", "0.63620603", "0.6350771", "0.6297313", "0.62644017", "0.6263373", "0.6262328", "0.6221855", "0.6194193", "0.61863405", "0.6185976", "0.6185...
0.67558706
1
Transforms the outcome enum to a human readable outcome.
def _GetOutcomeSummaryDisplayName(self, outcome): try: return self._outcome_names[outcome] except ValueError: return 'Unknown'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outcome_to_string(self, outcome):\n if not outcome: return outcome # django ignores outcomes that resolve to false\n\n if isinstance(outcome, (tuple, list)):\n return OUTCOME_DELIMITER.join(str(val) for val in outcome)\n return str(outcome)", "def outcome(self):\n retur...
[ "0.6740574", "0.6456156", "0.6456156", "0.6378913", "0.62449825", "0.6129068", "0.5996367", "0.59486955", "0.58751225", "0.5774795", "0.5773378", "0.56832284", "0.56581813", "0.564735", "0.5588758", "0.5585254", "0.55055064", "0.5502409", "0.5478761", "0.5454782", "0.545317",...
0.6694727
1
rand_vio_algorithm the function chooses a random cell in the database and randomly chooses whether to replace the value with a different value from the column or randomize a new value.
def rand_vio_algorithm(df,colomnsInConstraints,all_probs,typo_prob): rand_cell_row = random.randint(0, df.shape[0]) rand_cell_col = random.choice(colomnsInConstraints) rand_cell_data = df.iloc[rand_cell_row-1][rand_cell_col] while(pd.isnull(df.iloc[rand_cell_row-1][rand_cell_col])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize_cell(self, cell: Cell) -> None:\n pass # pragma: no cover", "def randomize(self):\r\n for r, row in enumerate(self.data):\r\n for i in range(self.cols):\r\n self.data[r][i] = random.random()", "def random(self) -> None:\n self._field = np.random.cho...
[ "0.6577975", "0.62086916", "0.5996288", "0.5876317", "0.58362687", "0.580899", "0.5796382", "0.5776982", "0.5770785", "0.5693844", "0.56399745", "0.5600852", "0.5546613", "0.5444783", "0.5436625", "0.54272115", "0.5412821", "0.5399639", "0.53987527", "0.53914523", "0.5352995"...
0.7851293
0
Each NWScript type has an 'invalid' (default) value. We need these to test if we have been passed valid NWVariables.
def GetInvalidValue(self): if self.type == "object": return "OBJECT_INVALID" elif self.type == "int": return "-1" elif self.type == "float": return "0.0" elif self.type == "string": return "\"\"" else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_var_type_code_unknown_type(self):\n\n testing.eval_bad_input(self.testInst._get_var_type_code, TypeError,\n 'Unknown Variable', [type(None)])\n return", "def test_w005_invalid(self):\n errors = check_settings_values(None)\n self.assertEqual(e...
[ "0.63372517", "0.5882105", "0.58745617", "0.5868405", "0.57765853", "0.57134444", "0.5691515", "0.55903554", "0.54838586", "0.54716647", "0.54655904", "0.54469395", "0.5437483", "0.5437132", "0.5379057", "0.53425026", "0.53387886", "0.5336576", "0.533475", "0.5332446", "0.533...
0.52724975
23
Pega as imagens cortadas por rotulo
def get_data(self, class_path, keras=True): dir_imagens = {} if class_path[-1] == '/': class_path = class_path[:-1] for label in listdir(class_path): # Verificando todas as pastas (classes) cont = 0 # print("Label:",label) for image in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotations(src: MyImage) -> MyImage:\r\n result = MyImage((src.size[0]*2, src.size[1]*2), src.pointer) #creating an image twice the original size\r\n rotated: MyImage = degrees90(src) # rotating 90 degrees for the first time\r\n for count in range(4):\r\n for i in range(src.size[0]):\r\n ...
[ "0.7286743", "0.6671644", "0.65894365", "0.6476365", "0.6452463", "0.640323", "0.63684106", "0.63384336", "0.6300444", "0.62447536", "0.62237513", "0.61403906", "0.60752434", "0.60752434", "0.60752434", "0.606326", "0.60570925", "0.6047081", "0.6044373", "0.6038686", "0.60274...
0.0
-1
> Grille constructeur de Grille
def __init__ (self): self.taille=10 self.matrix=np.zeros((self.taille,self.taille))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\t\tself.grille = Grille()\n\t\tself.utile = Utile()", "def __init__(self, nom, prenom):\n self.nom = nom\n self.prenom = prenom\n self.age = 33\n self._ville = 'nice' # pas oublier le _ : convention pour dire que l'attribut est prive ( on ne peut pas y acceder h...
[ "0.72501683", "0.65190136", "0.64972734", "0.63986015", "0.62976843", "0.6292465", "0.62885", "0.61750495", "0.6118232", "0.6079141", "0.60629207", "0.60570943", "0.60419756", "0.6017398", "0.5951752", "0.5927408", "0.59238863", "0.5869899", "0.58611566", "0.5844113", "0.5837...
0.0
-1
Update the velocity of a particle and returns the new velocity.
def update_velocity(velocity, acceleration): # create a new lsit which will contain the new position new_vel = [] # loop through the dimensions in position for i in range(dimensions): # update the velocity first v_i = velocity[i] + acceleration[i] * delta_t # + noise # append t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_velocity(self):\n if self.stop_flag == False:\n v = 0.001\n omega = 0.5\n vel = Twist()\n vel.linear.x = v\n vel.angular.z = omega\n self.pub_vel.publish(vel)\n else:\n v = 0.0\n omega = 0.0\n ...
[ "0.72753644", "0.7256813", "0.7184525", "0.71552736", "0.7042101", "0.7024983", "0.70194435", "0.69987875", "0.69737417", "0.6946464", "0.69464254", "0.69458383", "0.6943572", "0.69107676", "0.68786997", "0.68177605", "0.6763645", "0.6723124", "0.6686313", "0.6674264", "0.666...
0.61972946
43
Update the velocity of a particle and returns the new velocity.
def update_velocity_object(velocities_obj, accelerations_obj): # create a new lsit which will contain the new position new_vel = [] # loop through the dimensions in position for i in range(dimensions): # update the velocity first v_i = velocities_obj[i] + accelerations_obj[i] * delta_t ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_velocity(self):\n if self.stop_flag == False:\n v = 0.001\n omega = 0.5\n vel = Twist()\n vel.linear.x = v\n vel.angular.z = omega\n self.pub_vel.publish(vel)\n else:\n v = 0.0\n omega = 0.0\n ...
[ "0.72753644", "0.7256813", "0.7184525", "0.71552736", "0.7042101", "0.7024983", "0.70194435", "0.69987875", "0.69737417", "0.6946464", "0.69464254", "0.69458383", "0.6943572", "0.69107676", "0.68786997", "0.68177605", "0.6763645", "0.6723124", "0.6686313", "0.6674264", "0.666...
0.5739723
97
Adds a random perturbation to the angle of the incoming velocity and returns the new randomly affected acceleration.
def error_force(incoming_velocity): # get the magnitude of the velocity incoming_velocity = np.array(incoming_velocity) mag = np.sqrt(incoming_velocity.dot(incoming_velocity)) # change the velocity term to an angle acc_angle = np.arctan2(incoming_velocity[1], incoming_velocity[0]) # add a rand...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(vel, vel_prev, time):\n accel = (vel - vel_prev) / time\n return (math.atan(accel/9.81)) * (180/math.pi)", "def update_particle(self, dt):\n\n #random_v and random_theta are values to be added to the velocity and theta for randomization\n RANDOM_VELOCITY = 5\n RAN...
[ "0.61398655", "0.61002994", "0.60972494", "0.6079894", "0.6068852", "0.6014475", "0.6004028", "0.57914096", "0.5786594", "0.57757246", "0.57576746", "0.57378465", "0.5707119", "0.57056195", "0.57024616", "0.5689575", "0.56864476", "0.5671769", "0.5665229", "0.5644664", "0.563...
0.62677294
0
String for representing the Model object.
def __str__(self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n\n return str(self.model)", "def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st...
[ "0.8188433", "0.81442237", "0.8093044", "0.7905443", "0.7821154", "0.7794082", "0.77520275", "0.7728334", "0.77101016", "0.77041835", "0.7616919", "0.75828636", "0.7530188", "0.75026286", "0.74704695", "0.7447144", "0.7390358", "0.7385083", "0.73765314", "0.7370234", "0.72876...
0.0
-1
Returns the url to access a particular author instance.
def get_absolute_url(self): return reverse('author-detail', args=[str(self.slug)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_author_link(self, obj):\n\n try:\n return reverse('user', args=(obj.added_by.username,))\n except Exception:\n return obj.get_absolute_url()", "def get_absolute_url(self):\n return reverse('author-detail', args=[str(self.id)])", "def get_absolute_url(self):\n...
[ "0.7511384", "0.7441801", "0.7441801", "0.7441801", "0.7399182", "0.73700064", "0.72911644", "0.72733545", "0.7260976", "0.6759963", "0.67239976", "0.6694147", "0.667514", "0.66134596", "0.6600765", "0.6578786", "0.6578386", "0.6559714", "0.6559714", "0.6556476", "0.6556476",...
0.73669827
6
String for representing the Model object.
def __str__(self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n\n return str(self.model)", "def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st...
[ "0.8188433", "0.81442237", "0.8093044", "0.7905443", "0.7821154", "0.7794082", "0.77520275", "0.7728334", "0.77101016", "0.77041835", "0.7616919", "0.75828636", "0.7530188", "0.75026286", "0.74704695", "0.7447144", "0.7390358", "0.7385083", "0.73765314", "0.7370234", "0.72876...
0.0
-1
String for representing the Model object.
def __str__(self): return self.title
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n\n return str(self.model)", "def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st...
[ "0.8188433", "0.81442237", "0.8093044", "0.7905443", "0.7821154", "0.7794082", "0.77520275", "0.7728334", "0.77101016", "0.77041835", "0.7616919", "0.75828636", "0.7530188", "0.75026286", "0.74704695", "0.7447144", "0.7390358", "0.7385083", "0.73765314", "0.7370234", "0.72876...
0.0
-1
Returns the url to access a detail record for this book.
def get_absolute_url(self): return reverse('index')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detail_link(self) -> SafeString:\n return self.get_detail_link()", "def detail_url(self) -> str:\n return reverse(f'{self.get_meta().app_label}:detail', args=[self.pk])", "def getDetailUrl(self):\n return self.base.get(\"detailUrl\", [])", "def get_absolute_url(self):\n return...
[ "0.7418803", "0.73548794", "0.7288744", "0.7257042", "0.7257042", "0.7257042", "0.7257042", "0.7257042", "0.72548", "0.72288835", "0.72153175", "0.7122334", "0.7037265", "0.70214856", "0.70124125", "0.6963596", "0.6959101", "0.6899441", "0.6631533", "0.6539723", "0.6529737", ...
0.0
-1
Returns the dict as a model
def from_dict(cls, dikt) -> 'Word': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Create a surface of the appropriate size with the name and text rendered on it, centered appropriately.
def renderSubtitle(self, name, text): text, (textWidth, textHeight)= self.renderText(text); name, (nameWidth, nameHeight)= self.renderText(name); backingWidth= max(textWidth, nameWidth); backingHeight= textHeight + nameHeight; backingSize= Rect(0,0,backingWidth, backingHeight); backing= spyral.util.new_surf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayer(final_string, fontObj, settings, center, xpos, ypos):\r\n\ttextSurfaceObject = fontObj.render(final_string, True, settings['font_color'], settings['font_background'])\r\n\ttextRectangleObject = textSurfaceObject.get_rect()\r\n\tif center:\r\n\t\ttextRectangleObject.center = (xpos, ypos)\r\n\telse:\r\...
[ "0.7073127", "0.6960324", "0.66838497", "0.6632187", "0.6624468", "0.6606336", "0.65868855", "0.6539045", "0.6510058", "0.65014964", "0.64729273", "0.64319164", "0.6407359", "0.6350571", "0.63424134", "0.6310221", "0.62691945", "0.62248796", "0.6203549", "0.6172539", "0.61148...
0.621861
18
Generate a CORS mixin class with custom options. All keyword arguments are passed to wsgicors.CORS.
def make_cors_mixin(**options): class CORSMixin: def __call__(self, environ, start_response): cors = CORS(super().__call__, **options) return cors(environ, start_response) return CORSMixin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, cors_configuration_enabled=False, access_control_allow_origins=None, access_control_allow_credentials=False, access_control_allow_headers=None, access_control_allow_methods=None):\n\n self._cors_configuration_enabled = None\n self._access_control_allow_origins = None\n self....
[ "0.6160315", "0.58267325", "0.5826522", "0.58258194", "0.5623487", "0.56195605", "0.56113374", "0.5564785", "0.5510431", "0.54828227", "0.54828227", "0.54828227", "0.5458946", "0.54506534", "0.5432968", "0.5430464", "0.5428421", "0.5412467", "0.54109037", "0.5399196", "0.5364...
0.8176027
0
Resize a subgraph to a range of input sizes. This function uses a greedy approach to iteratively add or remove nodes one at a time to an input subgraph to reach the range of sizes specified by ``min_size`` and ``max_size``. When growth is required, the algorithm examines all nodes from the remainder of the graph as can...
def resize( subgraph: list, graph: nx.Graph, min_size: int, max_size: int, node_select: Union[str, np.ndarray, list] = "uniform", ) -> dict: nodes = graph.nodes() subgraph = set(subgraph) node_select, w = _validate_inputs(subgraph, graph, min_size, max_size, node_select) starting_si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize_to_range_helper(input_shape, min_size, max_size=None, factor=None,\n keep_aspect_ratio=True):\n input_height, input_width = input_shape\n input_height = tf.cast(input_height, tf.float32)\n input_width = tf.cast(input_width, tf.float32)\n input_min_size = tf.minimum(input_he...
[ "0.63466144", "0.63136846", "0.61027503", "0.5960827", "0.5858323", "0.5762061", "0.57493305", "0.56990284", "0.56873155", "0.56805646", "0.5676579", "0.5655227", "0.5647638", "0.5596106", "0.5543485", "0.5532336", "0.5484714", "0.53558177", "0.5344137", "0.53369915", "0.5320...
0.7925122
0
Get the minimum balance for the account to be rent exempt.
def get_min_balance_rent_for_exempt_for_account(conn: Client) -> int: resp = conn.get_minimum_balance_for_rent_exemption(ACCOUNT_LAYOUT.sizeof()) return resp["result"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_balance_rent_for_exempt_for_mint(conn: Client) -> int:\n resp = conn.get_minimum_balance_for_rent_exemption(MINT_LAYOUT.sizeof())\n return resp[\"result\"]", "def get_min_balance_rent_for_exempt_for_multisig(conn: Client) -> int:\n resp = conn.get_minimum_balance_for_rent_exempti...
[ "0.7979887", "0.7624483", "0.67296845", "0.6704839", "0.62782276", "0.6176706", "0.61651105", "0.61488223", "0.61003643", "0.61003643", "0.60711807", "0.6062186", "0.604836", "0.60302824", "0.598923", "0.5984134", "0.59774274", "0.5968733", "0.5951728", "0.5949407", "0.594564...
0.8856395
0
Get the minimum balance for the mint to be rent exempt.
def get_min_balance_rent_for_exempt_for_mint(conn: Client) -> int: resp = conn.get_minimum_balance_for_rent_exemption(MINT_LAYOUT.sizeof()) return resp["result"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_balance_rent_for_exempt_for_account(conn: Client) -> int:\n resp = conn.get_minimum_balance_for_rent_exemption(ACCOUNT_LAYOUT.sizeof())\n return resp[\"result\"]", "def get_min_balance_rent_for_exempt_for_multisig(conn: Client) -> int:\n resp = conn.get_minimum_balance_for_rent_e...
[ "0.8196182", "0.7693786", "0.6610262", "0.64412856", "0.6319049", "0.62872154", "0.62676615", "0.61504275", "0.6145499", "0.612948", "0.612948", "0.61087245", "0.6001329", "0.6001329", "0.59892774", "0.59739614", "0.59542185", "0.5951673", "0.5945977", "0.59253937", "0.590438...
0.86734927
0
Get the balance of the provided token account.
def get_balance(self, pubkey: PublicKey, commitment: Commitment = Single) -> RPCResponse: return self._conn.get_token_account_balance(pubkey, commitment)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_balance(self, token):\n data = dict(token=token)\n result = self.app.post('/get-balance', data=data)\n result = json.loads(result.data)\n return result['balance']", "def get_balance(self, token_symbol):\n\n method = 'GET'\n endpoint = '/open/api/v2/account/info'\...
[ "0.84668165", "0.7913116", "0.7625502", "0.7598506", "0.75478834", "0.7428914", "0.7397491", "0.7314443", "0.7314443", "0.7123744", "0.71037424", "0.7061587", "0.70532095", "0.6944852", "0.6943602", "0.6942453", "0.6934404", "0.6862589", "0.68615866", "0.6826462", "0.6742629"...
0.7122586
10
Set a platform on which the module is valid
def platform(this_platform): if this_platform.lower() not in system(): raise ModuleSkipPlatform
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_platform(self, windows=False, linux=False, macos=False, \\\n ios=False, android=False, raspi=False, \\\n oclea=False, mips=False):\n platforms = [False]*8\n if windows: platforms[0] = True\n elif linux: platforms[1] = True\n e...
[ "0.7393937", "0.6903689", "0.6876909", "0.6868319", "0.67816925", "0.6766418", "0.6705221", "0.6699453", "0.66675806", "0.6521683", "0.6451154", "0.6395124", "0.6357509", "0.6353809", "0.63010633", "0.62959987", "0.6291081", "0.62817186", "0.62738794", "0.62448585", "0.624162...
0.75398296
0
returns the JSON string representation of list_dictionaries
def to_json_string(list_dictionaries): if list_dictionaries is not None: return json.dumps(list_dictionaries) else: return "[]"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json_string(list_dictionaries):\n if list_dictionaries is None:\n list_dictionaries = []\n return json.dumps(list_dictionaries)", "def to_json_string(list_dictionaries):\n\n if list_dictionaries is None:\n list_dictionaries = []\n\n return json.dumps(list_...
[ "0.8429125", "0.83831185", "0.8360017", "0.835587", "0.83308315", "0.8323959", "0.8298361", "0.8296938", "0.8294085", "0.82670707", "0.8262326", "0.82561886", "0.8254502", "0.8225762", "0.8224124", "0.82240516", "0.82240516", "0.82240516", "0.8208249", "0.8208249", "0.8205251...
0.81467134
24
Return true if Amount to move coordenate is one
def isValidAmountMove(coorThisPiece, coorToMove): return coorThisPiece[0] - coorToMove[0] == 1 or coorThisPiece[0] - coorToMove[0] == -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_move(self, move):\n return self.dot_count[move] == 4", "def can_move(self):\n for pos in self.game_view.tetris_shapes[self.shape][1][self.shape_cnt]:\n x = int(self.x + pos % 4)\n y = int(self.y - pos // 4)\n if x < 0 or x >= PLWIDTH:\n return...
[ "0.7317646", "0.7142877", "0.70890313", "0.70890313", "0.704406", "0.7013593", "0.70026547", "0.6897482", "0.67796946", "0.6749851", "0.67240137", "0.6724001", "0.67204857", "0.6713248", "0.6657065", "0.6656518", "0.66563153", "0.6650349", "0.6649318", "0.6605226", "0.6590897...
0.6543389
27
Check if the move does not break any of the rules.
def valid_move(self, row, col, val): if val not in self.state[row]: if val not in [self.state[r][col] for r in range(9)]: if val not in [self.state[r][c] for (r,c) in self.quad_ids(row, col)]: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_legal(self, move):\n pass", "def has_valid_move(self) -> bool:\r\n\t\tis_valid_move = False\r\n\t\tfor row in range(self._othello_game.get_rows()):\r\n\t\t\tif is_valid_move:\r\n\t\t\t\tbreak\r\n\r\n\t\t\tfor col in range(self._othello_game.get_cols()):\r\n\r\n\t\t\t\tif len(self._othello_game.plac...
[ "0.7034956", "0.69246155", "0.6816555", "0.6759732", "0.6752828", "0.6748947", "0.66787195", "0.6675122", "0.6666341", "0.6658061", "0.66414374", "0.66063404", "0.65914756", "0.6591414", "0.6543249", "0.6540267", "0.65399206", "0.65335065", "0.65301", "0.6503006", "0.6503006"...
0.6151368
73
Find the next empty square on the board.
def find_empty(self): for i in range(9): for j in range(9): if self.state[i][j] == 0: return (i, j) # row, col return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_blank_square(self, state):\n\n return state.index(0)", "def find_blank_square(self, state):\n\n return state.index(0)", "def find_blank_square(self, state):\n\n return state.index(0)", "def find_empty(self):\n for i in range(self.n_rows):\n for j in range(self....
[ "0.74455106", "0.74455106", "0.74455106", "0.7145364", "0.7092405", "0.7035253", "0.68538743", "0.67369306", "0.665054", "0.6505918", "0.6500837", "0.6463475", "0.6273652", "0.6273266", "0.6261041", "0.6240187", "0.62301195", "0.62257105", "0.6222255", "0.6214869", "0.6203387...
0.6992794
6
Removes the element from in front of queue and returns that element.
def pop(self): while len(self.stack) > 0: self.tmp_stack.append(self.stack.pop()) r = self.tmp_stack.pop() while len(self.tmp_stack) > 0: self.stack.append(self.tmp_stack.pop()) return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def front(self):\n if self.is_empty():\n return None\n return self.queue[0]", "def getfront(self):\n\t\tif self._queue!=[]:\n\t\t\treturn self._queue[0]\n\t\treturn", "def dequeue(self):\n item = self._queue[0]\n self._queue = self._queue[1:]\n return item", "def...
[ "0.7973763", "0.7762207", "0.77227783", "0.77152604", "0.7686406", "0.76430964", "0.76407087", "0.76401305", "0.76368254", "0.759925", "0.75936073", "0.75864357", "0.7579586", "0.7558885", "0.7552301", "0.75520134", "0.75511974", "0.7528356", "0.7522579", "0.75202733", "0.747...
0.0
-1
Returns whether the queue is empty.
def empty(self): return len(self.stack) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsEmpty(self):\r\n return len(self._queue) == 0", "def is_empty(self):\n return len(self._queue) == 0", "def is_empty(self):\n if self.queue:\n return False\n return True", "def is_empty(self):\n\n return not self._queue", "def empty(self):\n return len(...
[ "0.92485046", "0.92243034", "0.9106652", "0.9098441", "0.906846", "0.9053733", "0.9053733", "0.90268433", "0.8984337", "0.8917236", "0.8912403", "0.8896071", "0.8877591", "0.88436323", "0.8737546", "0.8679591", "0.85208976", "0.8470112", "0.8325841", "0.83114576", "0.83114576...
0.0
-1
This function tests that if the user is not logged in they are redirected to the login page
def test_redirectLoginPage(self, *_): # logout to invalidate any logged-in sessions that may exist self.open(base_url +'/logout') # open login page self.open(base_url + '/') # Test that if a user accesses the homepage not logged in, is redirected to the login page ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_redirect_login(self, *_):\n\t\t# open /logout to invalidate the current session\n\t\tself.open(base_url + '/logout')\n\t\t# open /\n\t\tself.open(base_url + '/')\n\t\t# validate that current page is \"/login\"\n\t\tself.assert_element(\"#log-in-header\")", "def test_profile_page_redirects_to_login_if_no...
[ "0.80061084", "0.79464835", "0.79326993", "0.78649366", "0.77213585", "0.7716866", "0.7702475", "0.76864254", "0.7680989", "0.76713485", "0.7637212", "0.7614314", "0.7607687", "0.75961435", "0.7556421", "0.7550408", "0.75305134", "0.7524943", "0.75242215", "0.75200796", "0.74...
0.81010437
0
Creates all 12 instances of CarSource and returns an iterator listing them.
def create_car_sources(env, roundabout, slot_passing_time): for start_exit in range(4): for n_exit_hops in range(1, 4): yield CarSource(env, roundabout, start_exit, start_exit + n_exit_hops, slot_passing_time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_contacts() -> Iterator[Callable]:\n\n yield sample_contacts", "def retrieve_all(self):\n with sqlite3.connect(self.dbname) as carddb:\n for row in carddb.execute(\"SELECT code FROM CARDS\"):\n yield self.load_card(row[0])", "def get_csrs_generator(self,\n ...
[ "0.5796337", "0.57909995", "0.5692856", "0.5691547", "0.562582", "0.5574869", "0.5542986", "0.5529584", "0.549249", "0.5480007", "0.54422355", "0.5438556", "0.54142594", "0.54004586", "0.5398128", "0.53968805", "0.53930146", "0.53920573", "0.53873324", "0.53804517", "0.537330...
0.6814823
0
Buy the pallets and display a table with the details of the purchase
def buy(): # User reached route via GET if request.method == "GET": # Render the page with the form to buy the pallets return render_template("buy.html") # User reached route via POST else: # Extract the data from the form palletsPurchased, moneySpent = 0, 0 p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buy(request):\n\n price = settings.SNACK_PRICE\n if request.user.is_authenticated:\n profile = UserProfile.objects.get(user=request.user)\n status = Tiers.objects.get(user=profile)\n tier = status.tier\n else:\n tier = False\n profile = \"\"\n\n if request.method ...
[ "0.64847255", "0.646685", "0.6268695", "0.6262518", "0.6244811", "0.61624295", "0.61531204", "0.61302936", "0.60945773", "0.6090422", "0.6082367", "0.60719883", "0.6067302", "0.60512143", "0.60363084", "0.6020338", "0.5994361", "0.59726584", "0.5972597", "0.5955942", "0.59057...
0.75718397
0
Assert that a value is false, in the Python sense.
def IsFalse(v): if v: raise ValueError return v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testAssertFalse(self):\n self.assertFalse(False)", "def testEquivalentFalse(self):\n self.assertFalse(bool([]))\n self.assertFalse(bool(()))\n self.assertFalse(bool({}))\n self.assertFalse(0)\n self.assertFalse(\"\")\n self.assertFalse(None)", "def assert_fa...
[ "0.7862614", "0.7758742", "0.7686693", "0.7677754", "0.76595414", "0.7497592", "0.741662", "0.7383483", "0.7378491", "0.7270723", "0.72121906", "0.71916205", "0.71498495", "0.7109032", "0.70485735", "0.7045504", "0.7041031", "0.70031935", "0.69942826", "0.6916139", "0.6913545...
0.77915657
1
The length of a value must be in a certain range.
def Length(min=None, max=None, msg=None): @wraps(Length) def f(v): if min is not None and len(v) < min: raise Invalid(msg or 'length of value must be at least %s' % min) if max is not None and len(v) > max: raise Invalid(msg or 'length of value must be at most %s' % max) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _checkLengthValue(self, length):\n if ((length < 0) or (length > 4096)):\n raise ValueError('Invalid 12 bit length')", "def length(value, min=None, max=None):\n if (min is not None and min < 0) or (max is not None and max < 0):\n raise AssertionError(\n '`min` and `max` need to b...
[ "0.7627744", "0.7550692", "0.7256186", "0.69943523", "0.68806624", "0.6869215", "0.68602824", "0.6840466", "0.67385924", "0.66845113", "0.66331726", "0.6603236", "0.65704095", "0.6526224", "0.650061", "0.6386616", "0.6366585", "0.6355473", "0.63530946", "0.63512444", "0.63493...
0.7450519
2
Transform a string to upper case. >>> s = Schema(Upper) >>> s('hi') 'HI'
def Upper(v): return str(v).upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_upper(s):\n return s.upper()", "def my_upper(s):\n return s.upper()", "def make_upper_case(s):\n return s.upper()", "def makeupper(s):\n pass", "def upper(usr_string):\n return usr_string.upper()", "def _upper(input_string):\n return None if input_string is None else str....
[ "0.76520634", "0.74779034", "0.74140584", "0.7357706", "0.72105616", "0.71955514", "0.7187439", "0.7168309", "0.711791", "0.69756395", "0.69130105", "0.6822171", "0.66921437", "0.6606965", "0.6533385", "0.65075403", "0.6445878", "0.6439679", "0.6421443", "0.6406381", "0.63383...
0.67322373
12
Capitalise a string. >>> s = Schema(Capitalize) >>> s('hello world') 'Hello world'
def Capitalize(v): return str(v).capitalize()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Capitalize():\n return 'capitalize'", "def to_upper(s):\n return s.upper()", "def constcase(string):\n return uppercase(snakecase(string))", "def capitalise(string):\n if not len(string): return '' # noqa: E701\n return string[0].upper() + string[1:]", "def capitalize(s: str) -> str...
[ "0.73541117", "0.7206149", "0.71567637", "0.7155059", "0.71316606", "0.7104455", "0.70862406", "0.7058314", "0.697293", "0.69649947", "0.6958117", "0.69163907", "0.6812948", "0.67907315", "0.6590483", "0.65380466", "0.6526203", "0.6515729", "0.6514756", "0.6463668", "0.645914...
0.6734814
14
Define a transaction that uses a deployed contract
def use_contract(self): abi = None if os.path.exists(self.js_args['ARTIFACT_F']): with open(self.js_args['ARTIFACT_F']) as f: artifact_data = json.load(f) abi = artifact_data['abi'] if abi is None or len(abi) == 0: self.print("Err: not able t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy_contract(contract, transaction, args, bytecode=None):\n abi = open(abi_file(contract)).read()\n\n if bytecode is None: # We don't have a custom binary, get from file\n bytecode = open(bin_file(contract)).read()\n\n # Load the contract\n f = w3.eth.contract(abi=abi...
[ "0.69161975", "0.68349105", "0.65635777", "0.6463492", "0.6416976", "0.6413205", "0.6205954", "0.6183068", "0.6152367", "0.6127577", "0.60589355", "0.60422", "0.59812987", "0.59808725", "0.5935608", "0.5907849", "0.5891304", "0.587836", "0.58776456", "0.5823744", "0.5814231",...
0.70541495
0
Replace every 0 with 'nan' and return a copy.
def zero_to_nan(values): return [float('nan') if x==0 else x for x in values]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def example4(a):\n nan_mask = np.isnan(a)\n a[nan_mask] = 0\n return nan_mask", "def replace_nan_with_zero(w):\n\n return tf.where(tf.is_nan(w), tf.ones_like(w) * 0.0, w)", "def set_nan_or_inf_to_zero( array ):\n array[ np.isinf( array ) + np.isnan( array ) ] = 0\n \n return array", ...
[ "0.6993821", "0.6943131", "0.6776369", "0.6724469", "0.67061216", "0.66696775", "0.66138554", "0.65919167", "0.6501002", "0.64440656", "0.6384001", "0.62603974", "0.62436587", "0.6223821", "0.6201141", "0.61200607", "0.61182505", "0.6114999", "0.6084378", "0.60633445", "0.605...
0.7429883
0
Cumulative trapezoidal integration, flipped leftright
def fcumtrapzlr(s_span, p): P = - sciint.cumtrapz( p[-1::-1], s_span[-1::-1],)[-1::-1] P = np.concatenate((P,[0])) return P
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trapezoid_cumulative_integral(f, x):\n\n fy = f(x)\n return (0.5 * (fy[:-1] + fy[1:]) * np.diff(x)).cumsum()", "def trapezoidal( fct_x, x0, xn, N):\n dx = float(xn-x0)/N\n # compute intergral: eq. 3.17 page 60 in Linge & Langtangen\n f_Int = 0.5*(fct_x( x0) + fct_x( xn)) + ( fct_x( x0+dx*np....
[ "0.65774816", "0.61745334", "0.5899841", "0.5899841", "0.5868815", "0.58542", "0.5787824", "0.575243", "0.57204545", "0.5593084", "0.5576983", "0.5565131", "0.5542722", "0.55240166", "0.5512241", "0.5511857", "0.5499617", "0.5485093", "0.5465625", "0.545668", "0.5454803", "...
0.0
-1
Convert from Zope DateTime to Python datetime and strip timezone
def DateTime_to_datetime(Zope_DateTime): from DateTime.DateTime import DateTime naive = DateTime(str(Zope_DateTime).rsplit(' ', 1)[0]) return naive.asdatetime()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _DATETIME_to_python(self, value, dsc=None):\n if not value:\n return None\n dt = MySQLConverter._DATETIME_to_python(self, value)\n if settings.USE_TZ and timezone.is_naive(dt):\n dt = dt.replace(tzinfo=timezone.utc)\n return dt", "def clean_datetime(neo_datet...
[ "0.6979", "0.67140937", "0.6712479", "0.66340214", "0.6620833", "0.6617311", "0.65498906", "0.6508635", "0.6506096", "0.6502257", "0.6393789", "0.63585377", "0.63249415", "0.6319783", "0.629002", "0.6281284", "0.62741125", "0.6174541", "0.616745", "0.6143365", "0.612781", "...
0.7251546
0
VM admin user name.
def admin_user_name(self) -> str: return pulumi.get(self, "admin_user_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def catalog_admin_user_name(self) -> Optional[str]:\n return pulumi.get(self, \"catalog_admin_user_name\")", "def admin_username(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"admin_username\")", "def admin_username(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"admin_use...
[ "0.7532157", "0.74245244", "0.74245244", "0.70350665", "0.70350665", "0.6983849", "0.6934164", "0.6934164", "0.68900245", "0.6873148", "0.6873148", "0.6873148", "0.6830448", "0.6830448", "0.68079484", "0.67971337", "0.67971337", "0.67958796", "0.6785025", "0.6769702", "0.6769...
0.82872945
1
Setting this to true enables RDP access to the VM. The default NSG rule opens RDP port to Internet which can be overridden with custom Network Security Rules. The default value for this setting is false.
def allow_rdp_access(self) -> Optional[bool]: return pulumi.get(self, "allow_rdp_access")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def EnableGuestFirewall(self):\n command = 'netsh advfirewall set allprofiles state on'\n self.RemoteCommand(command)", "def enableRemote(self, opt):\n return opt in {ECHO, SGA, BINARY}", "def tunneling_enabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"tunneling_ena...
[ "0.5915269", "0.5627832", "0.5502649", "0.5502649", "0.55020267", "0.5269681", "0.52677524", "0.5217828", "0.5159211", "0.5127747", "0.5127747", "0.5049715", "0.5041187", "0.5020189", "0.5005513", "0.5000177", "0.49925244", "0.49925244", "0.4990763", "0.49866506", "0.4981027"...
0.7220265
0
The Service Fabric runtime version of the cluster. This property is required when clusterUpgradeMode is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use availableClusterVersion...
def cluster_code_version(self) -> Optional[str]: return pulumi.get(self, "cluster_code_version")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_version(self) -> str:\n return pulumi.get(self, \"cluster_version\")", "def cluster_version(self) -> str:\n return pulumi.get(self, \"cluster_version\")", "def cluster_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cluster_version\")", "def cluster_version(s...
[ "0.7325394", "0.7325394", "0.7130103", "0.7130103", "0.7076472", "0.6900228", "0.677772", "0.677772", "0.6638723", "0.65070707", "0.65006316", "0.63330406", "0.63330406", "0.63330406", "0.63330406", "0.63025343", "0.6301215", "0.6256871", "0.6256871", "0.6256871", "0.6256871"...
0.6355648
11
A service generated unique identifier for the cluster resource.
def cluster_id(self) -> str: return pulumi.get(self, "cluster_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self):\n node = self.get_node()\n try:\n return node.conf_get(\"cluster\", \"id\")\n except Exception as exc:\n pass\n import uuid\n cluster_id = str(uuid.uuid1())\n from cluster import ClusterSvc\n svc = ClusterSvc()\n sv...
[ "0.8089206", "0.7955162", "0.71623355", "0.71365356", "0.69988114", "0.69907165", "0.6825598", "0.68027323", "0.67989814", "0.67646146", "0.67398304", "0.67302924", "0.6728425", "0.6690805", "0.6690805", "0.6690805", "0.6690805", "0.6690805", "0.667872", "0.6670466", "0.66650...
0.7471399
5
The current state of the cluster.
def cluster_state(self) -> str: return pulumi.get(self, "cluster_state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def cluster_status(self, cluster_state):\n raise NotImplementedError", "def state(self):\n return self._client.data[self._key]", "def state(self):\n return self.get_status(self._client.data[self._key])", "def state(self):\n return self._current_state", "def state(self):\r\...
[ "0.74849826", "0.7262839", "0.7246631", "0.7113974", "0.7109411", "0.7090652", "0.70698977", "0.70698977", "0.70698977", "0.70698977", "0.6984541", "0.6984541", "0.6984541", "0.69756967", "0.69756967", "0.69756967", "0.69756967", "0.69756967", "0.69756967", "0.69756967", "0.6...
0.84223485
0
The cluster dns name.
def dns_name(self) -> str: return pulumi.get(self, "dns_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dns_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"dns_name\")", "def dns_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"dns_name\")", "def dns_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"dns_name\")", "def dns_name(self):\n\n ra...
[ "0.8117392", "0.8117392", "0.8117392", "0.8045788", "0.7730445", "0.7615766", "0.75633484", "0.7495371", "0.7495371", "0.7472757", "0.7431499", "0.7431499", "0.7404907", "0.73232126", "0.72864324", "0.72747797", "0.7178273", "0.70711356", "0.70299834", "0.702937", "0.701736",...
0.83174455
1
The provisioning state of the managed cluster resource.
def provisioning_state(self) -> str: return pulumi.get(self, "provisioning_state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provisioning_state(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_state(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"provisioning_state\")", "def provisioning_state(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"...
[ "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.78750783", "0.736145", "0.736145", "0.73138374", "0.7303453", "0.7176976", "0...
0.7851051
34
Specify the resource id of a public IP prefix that the load balancer will allocate a public IP address from. Only supports IPv4.
def public_ip_prefix_id(self) -> Optional[str]: return pulumi.get(self, "public_ip_prefix_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_public_ip_prefix_id(self) -> str:\n return pulumi.get(self, \"node_public_ip_prefix_id\")", "def src_ip_prefix(self, src_ip_prefix: str):\n\n self._src_ip_prefix = src_ip_prefix", "def add_prefix(ip):\n if ip.find(IPV6_SEPARATOR) == -1:\n ip = ip + PREFIX_SEPARATOR + \"32\"\n ...
[ "0.7102623", "0.64125484", "0.6386938", "0.63099074", "0.6232944", "0.6187979", "0.5890155", "0.5881352", "0.5845776", "0.58104604", "0.57718533", "0.57707965", "0.57707965", "0.57707965", "0.57707965", "0.568928", "0.5687135", "0.5647977", "0.5609085", "0.558419", "0.5574982...
0.7296029
0
For new clusters, this parameter indicates that it uses Bring your own VNet, but the subnet is specified at node type level; and for such clusters, the subnetId property is required for node types.
def use_custom_vnet(self) -> Optional[bool]: return pulumi.get(self, "use_custom_vnet")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_subnet(self, context, subnet):\n pass", "def _send_create_subnet_request(self, context, subnet):\n LOG.debug(_('_send_create_subnet_request: %s'), subnet['id'])\n network = self.get_network(context, subnet['network_id'])\n n1kvclient = n1kv_client.Client()\n n1kvclie...
[ "0.69418776", "0.68788207", "0.6738498", "0.66703016", "0.66621464", "0.66621464", "0.6590814", "0.65321803", "0.65321803", "0.6337017", "0.6286458", "0.6215152", "0.62108535", "0.61796826", "0.617942", "0.6153927", "0.61478", "0.61478", "0.61409163", "0.6133372", "0.6133372"...
0.0
-1
Indicates if the cluster has zone resiliency.
def zonal_resiliency(self) -> Optional[bool]: return pulumi.get(self, "zonal_resiliency")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zone_redundant(self) -> Optional[bool]:\n return pulumi.get(self, \"zone_redundant\")", "def available(self):\n status = self._coordinator.data[self._idx][\"status\"]\n\n return status != ZONE_STATUS_NOT_USED or status == ZONE_BYPASS_ON", "def zone_enabled(self, sequence_zone: IUSequen...
[ "0.7263149", "0.6159053", "0.57757807", "0.5635973", "0.5442229", "0.5404643", "0.5384885", "0.53476393", "0.5342157", "0.5329874", "0.53287965", "0.53117055", "0.5288222", "0.5261121", "0.52390486", "0.52377486", "0.5179214", "0.5169752", "0.5104321", "0.5103051", "0.5092059...
0.75870514
0
Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group.
def get_managed_cluster(cluster_name: Optional[str] = None, resource_group_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetManagedClusterResult: __args__ = dict() __args__['clusterName'] = cluster_name __args__['resource...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_group\")", "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n create_time: Optional[pulumi.Input[str]] = None,\n db_cluster...
[ "0.6261341", "0.62035805", "0.6082385", "0.59034413", "0.58943266", "0.58798045", "0.5860288", "0.5860288", "0.5809438", "0.57646614", "0.57442564", "0.57372594", "0.57372594", "0.57372594", "0.5672555", "0.56699", "0.55907845", "0.55907845", "0.55907845", "0.55907845", "0.55...
0.56613356
16
Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group.
def get_managed_cluster_output(cluster_name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetManagedClusterResult]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_group\")", "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n create_time: Optional[pulumi.Input[str]] = None,\n db_cluster...
[ "0.6262522", "0.6204883", "0.608397", "0.5904004", "0.58971846", "0.58819956", "0.5811824", "0.57688487", "0.57443416", "0.5738672", "0.5738672", "0.5738672", "0.56757903", "0.56716174", "0.5661135", "0.5591784", "0.5591784", "0.5591784", "0.5591784", "0.5591784", "0.5591784"...
0.5861758
6
Handles GET requests for the About us page.
def get(self, request): return render(request, 'tellings/about.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about(request):\n\treturn render_to_response('aboutus.html')", "def about():\n logger.info(\"About page accessed\")\n return render_template('about.html')", "def about_page(request):\n\treturn render_to_response('about.html')#, HttpResponseRedirect('/about')", "def about_view(request):\n try:\n ...
[ "0.7600251", "0.7262605", "0.69559795", "0.6941855", "0.69168687", "0.6916207", "0.6896345", "0.6878022", "0.6863263", "0.6863263", "0.68583757", "0.68583757", "0.68583757", "0.68583757", "0.68583757", "0.68583757", "0.68583757", "0.6839752", "0.682715", "0.68205714", "0.6813...
0.7084546
2
Handles POST requests for the About us page.
def post(self, request): if ('username' in request.POST) and ('pwd' in request.POST): return user_login(request) else: return render(request, 'tellings/about.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_about():\n\n # POST request\n if request.method == 'POST':\n body = request.get_json()\n\n if body is None:\n raise APIException(\"You need to specify the request body as a json object\", status_code=400)\n if 'description' not in body:\n raise APIExcepti...
[ "0.68734294", "0.664501", "0.6356997", "0.62441313", "0.6170568", "0.61183614", "0.60883087", "0.60638344", "0.5993419", "0.59748197", "0.5973598", "0.59481007", "0.5945884", "0.5928008", "0.5913524", "0.59132403", "0.59132403", "0.59057206", "0.59020895", "0.5897743", "0.589...
0.53952134
72
Handles GET requests for the Change User Details page.
def get(self, request): form = ChangeUserDetailsForm(instance=request.user) return render(request, 'tellings/changeUserDetails.html', {'form': form})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_user(request):\n\tpass", "def test_user_change_page(self):\n\n url = reverse(\n 'admin:coremodels_user_change',\n args=[self.user.id])\n response = self.client.get(url)\n\n self.assertEqual(response.status_code, 200)", "def test_user_change_page(self):\n ...
[ "0.6833093", "0.66080713", "0.65541613", "0.6538355", "0.65262014", "0.6480868", "0.64336836", "0.64042455", "0.63113624", "0.6262467", "0.62619346", "0.6259965", "0.6191074", "0.617681", "0.61586195", "0.614035", "0.6125555", "0.61190593", "0.6109797", "0.6106656", "0.610245...
0.7638815
0
Returns a list of all UserPosts from users blocked by the currently logged in user, and posts by users who have blocked the logged in user.
def get_blockedPosts_list(self): blockedUsers = self.blockedUsers() blockedBy = self.userBlockedBy() blockedList = list(set().union(blockedUsers, blockedBy)) blockedPosts = [] if blockedList: posts = UserPost.objects.filter(user__in=blockedList) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def posts_filtered_by_blocked(self):\n blockedUsers = self.blockedUsers()\n blockedBy = self.userBlockedBy()\n blockedList = list(set().union(blockedUsers, blockedBy))\n\n hiddenPosts = self.hiddenPosts()\n\n if blockedList:\n return UserPost.objects.exclude(user__in=b...
[ "0.86994743", "0.73785347", "0.73785347", "0.7055241", "0.7055241", "0.6950842", "0.63498825", "0.6207875", "0.59918636", "0.59759945", "0.5964453", "0.590172", "0.5901601", "0.5890333", "0.58872515", "0.5865012", "0.5809736", "0.5687893", "0.5673432", "0.5668793", "0.5659361...
0.87741613
0
Handles GET requests for the About us page.
def get(self, request): return render(request, 'tellings/missionstatement.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about(request):\n\treturn render_to_response('aboutus.html')", "def about():\n logger.info(\"About page accessed\")\n return render_template('about.html')", "def get(self, request):\n return render(request, 'tellings/about.html')", "def about_page(request):\n\treturn render_to_response('abou...
[ "0.75997376", "0.72618514", "0.7085504", "0.69544655", "0.69416326", "0.69164294", "0.6916041", "0.689583", "0.687715", "0.68623096", "0.68623096", "0.6857319", "0.6857319", "0.6857319", "0.6857319", "0.6857319", "0.6857319", "0.6857319", "0.6838753", "0.68268424", "0.6819873...
0.0
-1
Returns a queryset of all UserPosts excluding those from users blocked by the currently logged in user, and posts by users who have blocked the logged in user.
def posts_filtered_by_blocked(self): blockedUsers = self.blockedUsers() blockedBy = self.userBlockedBy() blockedList = list(set().union(blockedUsers, blockedBy)) hiddenPosts = self.hiddenPosts() if blockedList: return UserPost.objects.exclude(user__in=blockedList).e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_blockedPosts_list(self):\n blockedUsers = self.blockedUsers()\n blockedBy = self.userBlockedBy()\n blockedList = list(set().union(blockedUsers, blockedBy)) \n blockedPosts = []\n \n if blockedList:\n posts = UserPost.objects.filter(user__in=blockedList)...
[ "0.7942164", "0.7201756", "0.709917", "0.65846777", "0.64927006", "0.64927006", "0.64587605", "0.6447606", "0.6428641", "0.6416918", "0.62893623", "0.62893623", "0.626508", "0.61986536", "0.61817163", "0.6105904", "0.60357976", "0.60182136", "0.6010157", "0.5987037", "0.58831...
0.87164116
0