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
Confirm the email address of the user account assigned with that verification token.
def confirm_email_address_via_verification_token( verification_token: VerificationToken, ) -> Result[UserEmailAddressConfirmedEvent, str]: user = verification_token.user token_email_address = verification_token.data.get('email_address') if not token_email_address: return Err('Verification token...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm():\n if g.session.user.email_confirmed:\n return redirect(url_for('index.index'))\n\n token = request.args.get('token')\n if token:\n try:\n user: User = db.session.query(User) \\\n .filter(User.confirmation_token == token).one()\n\n user.emai...
[ "0.7406958", "0.7330046", "0.71927893", "0.70973456", "0.7094659", "0.7043124", "0.7029663", "0.6994817", "0.690848", "0.6850051", "0.68305916", "0.6808307", "0.67799187", "0.67309165", "0.6720921", "0.67207134", "0.66678584", "0.6622138", "0.6618493", "0.6606263", "0.6577554...
0.7672551
0
Confirm the email address of the user account.
def confirm_email_address( user: User, email_address_to_confirm: str ) -> Result[UserEmailAddressConfirmedEvent, str]: current_email_address = user_service.get_email_address_data(user.id) result = user_domain_service.confirm_email_address( user, current_email_address, email_address_to_confirm )...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _confirm_email(user, email):\n mail_subject = 'Подтверждение почты'\n message = render_to_string('accounts/account_verification_email.html', {\n 'user': user,\n 'uid': urlsafe_base64_encode(force_bytes(user.pk)),\n 'token': default_token_generator.make_token(user),\n 'email': ...
[ "0.75131184", "0.73492384", "0.72632384", "0.7256472", "0.72497547", "0.70477664", "0.6983332", "0.6969365", "0.69601256", "0.6832103", "0.6829499", "0.6800771", "0.6794492", "0.67908484", "0.67356503", "0.67067766", "0.666995", "0.6604407", "0.65046346", "0.6448146", "0.6436...
0.71080875
5
Invalidate the user's email address by marking it as unverified. This might be appropriate if an email to the user's address bounced because of a permanent issue (unknown mailbox, unknown domain, etc.)
def invalidate_email_address( user: User, reason: str, *, initiator: User | None = None ) -> Result[UserEmailAddressInvalidatedEvent, str]: email_address = user_service.get_email_address_data(user.id) invalidation_result = user_domain_service.invalidate_email_address( user, email_address, reason, i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_email(self, request, email_address):\n email_address.verified = True\n email_address.set_as_primary(conditional=True)\n email_address.save()\n\n u = get_user_model().objects.get(pk=email_address.user.id)\n u.is_active = True\n u.save()", "def test_modify_reus...
[ "0.659424", "0.6445138", "0.64046687", "0.6365445", "0.6309263", "0.6281519", "0.6270288", "0.6216698", "0.62076294", "0.6183843", "0.6178109", "0.6107922", "0.61079085", "0.60959595", "0.60957175", "0.6059355", "0.6044013", "0.6013797", "0.6012504", "0.60081846", "0.6000628"...
0.66173106
0
Change the email address of the user account assigned with that verification token.
def change_email_address( verification_token: VerificationToken, ) -> Result[UserEmailAddressChangedEvent, str]: new_email_address = verification_token.data.get('new_email_address') if not new_email_address: return Err('Token contains no email address.') user = verification_token.user verif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def change_email(self, new_email, password):\n data = {\"password\": password, \"emailAddress\": new_email}\n e = await self.request.request(url='https://accountsettings.roblox.com/v1/email', method='post', data=data)\n return e", "def user_profile_setemail(token, email):\n users = ...
[ "0.7459502", "0.71983385", "0.69808006", "0.6769463", "0.6691136", "0.6553011", "0.65335566", "0.64399713", "0.6418007", "0.6329617", "0.6240551", "0.6233501", "0.6212598", "0.62090987", "0.6200279", "0.61853385", "0.6175999", "0.6169611", "0.6117113", "0.6108195", "0.6108195...
0.8288327
0
Get all vertex number which the map value is not 0.0
def vertexFromMaps(self, mapName, threshold=0.1): mSLmesh = om2.MGlobal.getSelectionListByName(self.mesh).getDependNode(0) dag = om2.MFnDagNode(mSLmesh).getPath() vert_iter = om2.MItMeshVertex(dag) vertCount = vert_iter.count() vertValue = mc.getAttr('{}.{}'.format(self.meshShap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_indeg(self, vertex: np.int_):\n return sum(map(lambda x: x>0,self.__mat[:,vertex]))", "def __nonzero__(self):\n return _osgAnimation.mapVertexInfluence___nonzero__(self)", "def get_no_vertices(self):\r\n return len(self.__neighbours.keys())", "def get_zeros(self):\n ret...
[ "0.6384609", "0.6207059", "0.61508465", "0.59649444", "0.594568", "0.5860397", "0.5853227", "0.5832068", "0.56370497", "0.5619454", "0.560709", "0.5586813", "0.55769616", "0.55766934", "0.5557782", "0.5534514", "0.5516058", "0.548273", "0.54593134", "0.542462", "0.540582", ...
0.58897585
5
Convenience function to flatten a list of lists into one big list. [['a', 'b'], ['c', 'd']] > ['a', 'b', 'c', 'd']
def flatten(ls): return sum(ls, [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten(list_of_lists: List[List]) -> List:\n return list(itertools.chain(*list_of_lists))", "def flattened(list_of_lists):\n res = functools.reduce(operator.iconcat, list_of_lists, [])\n return res", "def flatten(list_of_lists):\n flattened_list = [y for x in list_of_lists for y in x]\n ret...
[ "0.8651255", "0.86453116", "0.86126614", "0.85177124", "0.8459351", "0.8425435", "0.83535093", "0.8294965", "0.8262214", "0.8228526", "0.8225043", "0.8198033", "0.8198033", "0.8137612", "0.81361604", "0.81336784", "0.807153", "0.80289674", "0.8026131", "0.80242413", "0.797382...
0.72182065
64
A simple decorator to prevent multiple calls to get_queryset() during processing of a single client request from performing the same database query. Presence or absence of queryset results is used by ImpliedPermissions to determine user access to Study internals based on StudyPermissions, which without this decorator w...
def cached_request_queryset(get_queryset): def wrapper(*args): _CACHE_VAR_NAME = 'edd_rest_cached_queryset' queryset = get_request_variable(_CACHE_VAR_NAME, use_threadlocal_if_no_request=False) view = args[0] log_msg = ('%(class)s.%(method)s. %(http_method)s %(uri)s: kwargs=%(kwargs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def takes_instance_or_queryset(func):\r\n @wraps(func)\r\n def decorated_function(self, request, queryset):\r\n if not isinstance(queryset, QuerySet):\r\n queryset = self.get_queryset(request).filter(pk=queryset.pk)\r\n return func(self, reques...
[ "0.6952325", "0.65417206", "0.64567614", "0.64152056", "0.63892466", "0.6359338", "0.6351071", "0.6277802", "0.6235977", "0.6227453", "0.621828", "0.6211943", "0.61889434", "0.61261797", "0.6080463", "0.60618794", "0.6039736", "0.60222614", "0.60133576", "0.60131824", "0.5980...
0.6601394
1
Checks that the data in input is of the correct shape.
def _check_input_len(self, data): data_len = len(data[0]) if self._input_len != data_len: msg = 'Received %d features, expected %d.' % (data_len, self._input_len) raise ValueError(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_shape(placeholder_shape, data_shape):\n\n return True", "def check_dims(self, data):\n if np.ndim(data) != 2:\n raise ValueError('Input data must be a two dimensional numpy array. '\n 'Data received has shape (%g, %g).' % data.shape)", "def check_data_shape(self, dat...
[ "0.7998423", "0.7923383", "0.78498185", "0.7793892", "0.7678593", "0.7663976", "0.76165384", "0.7614959", "0.7419527", "0.73901474", "0.7360289", "0.72865766", "0.7246357", "0.71552384", "0.71424925", "0.7015727", "0.69825786", "0.69442624", "0.69276345", "0.6926433", "0.6883...
0.7029552
15
Updates the weights of the neurons.
def update(self, x, win, t, max_iteration): eta = self._decay_function(self._learning_rate, t, max_iteration) # sigma and learning rate decrease with the same rule sig = self._decay_function(self._sigma, t, max_iteration) # improves the performances g = self.neighborhood(win, sig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self):\n self._weights = self._weights + self.update_weights_value", "def update_weights(self):\n\t\tpass", "def update_weights(self):\n self._weights = self._weights + self.update_weights_value\n self.weights_clipping()", "def update_weights(self):\r\n\r\n ined...
[ "0.82714504", "0.8120248", "0.79640955", "0.77910775", "0.77584416", "0.75556767", "0.7519713", "0.7445644", "0.7290689", "0.72896796", "0.7262221", "0.7245579", "0.7192105", "0.71910715", "0.7190435", "0.718631", "0.7158501", "0.71275824", "0.7113182", "0.7075183", "0.707073...
0.0
-1
Initializes the weights to span the first two principal components. This initialization doesn't depend on random processes and makes the training process converge faster. It is strongly reccomended to normalize the data before initializing the weights and use the same normalization for the training data.
def pca_weights_init(self, data): if self._input_len == 1: msg = 'The data needs at least 2 features for pca initialization' raise ValueError(msg) self._check_input_len(data) if len(self._neigx) == 1 or len(self._neigy) == 1: msg = 'PCA initialization inapprop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_weights(self):\n pass", "def init_weights(self) -> None:\n nn.init.kaiming_normal_(self._U)\n nn.init.kaiming_normal_(self._W)\n nn.init.kaiming_normal_(self._V)\n\n nn.init.normal_(self._b)", "def init_weights(self):\n # Initialize weights\n sel...
[ "0.73977584", "0.7207055", "0.7181754", "0.71678865", "0.71637684", "0.7123308", "0.707032", "0.7066407", "0.6999747", "0.6993847", "0.6942259", "0.6935552", "0.69330466", "0.6922939", "0.6916091", "0.69111234", "0.689527", "0.68906116", "0.6889783", "0.6876217", "0.6876217",...
0.637992
79
Return the iou for the whole batch, given a threshold.
def iou(binary_mask, prediction_mask, t=0.5): params = get_params() if params.nbr_of_classes == 1: predicted_class = prediction_mask >= t else: raise NotImplemented actual_class = binary_mask > 0.5 intersection = tf.cast(tf.logical_and(predicted_class, actual_class), tf.float32) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iou_coe(output, target, threshold=0.5, axis=(1, 2, 3), smooth=1e-5):\n pre = tf.cast(output > threshold, dtype=tf.float32)\n truth = tf.cast(target > threshold, dtype=tf.float32)\n inse = tf.reduce_sum(tf.multiply(pre, truth), axis=axis) # AND\n union = tf.reduce_sum(tf.cast(tf.add(pre, truth) >= ...
[ "0.6983425", "0.6500887", "0.622703", "0.6211275", "0.5957855", "0.5949595", "0.5938429", "0.58682966", "0.5828696", "0.58129287", "0.5801834", "0.5770209", "0.5725779", "0.57184273", "0.5701603", "0.5676066", "0.56508267", "0.5636366", "0.56249344", "0.560339", "0.560339", ...
0.5625168
18
Convert mask probabilities to a summerizable image.
def probabilities_to_image(probabilities, threshold=None): channels = probabilities.get_shape().as_list()[-1] if channels == 1: classes = probabilities else: classes = tf.expand_dims(tf.unstack(probabilities, axis=-1)[0], 3) if threshold: return tf.cast(classes > threshold, tf.u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_masks():\n for fn in sorted(glob.glob('../input/extra_data/*/masks/*.png')):\n print(fn)\n img = skimage.io.imread(fn)\n # utils.print_stats('mask', img)\n img[img > 0] = 255\n skimage.io.imsave(fn, img)", "def _preprocessing(mask, mapping, image) -> np.ndarray:\...
[ "0.6067387", "0.59146714", "0.59001726", "0.57682043", "0.5670681", "0.56542516", "0.56476283", "0.56432295", "0.5635463", "0.56152874", "0.55927056", "0.55799997", "0.55748284", "0.557412", "0.55578846", "0.55417776", "0.5537931", "0.5532473", "0.5531878", "0.5491419", "0.54...
0.0
-1
Returns a snake_case name for a camelCase json field name
def json_to_python_name(json_name: str) -> str: return re.sub(r"(?<!^)(?=[A-Z])", "_", json_name).lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_to_camelcase(key):\n return Jsonifiable.lower_first(\n ''.join(c.capitalize() or '_' for c in key.split('_')))", "def py_field_name(self, field):\n name = field.name\n name = as_identifier(name)\n if self.options(field).convert_case:\n name = from_camel_cas...
[ "0.715858", "0.7071225", "0.7009746", "0.6877947", "0.68282044", "0.6750204", "0.67464197", "0.67443997", "0.66000235", "0.65578085", "0.6552384", "0.6550539", "0.65370363", "0.65236664", "0.6511198", "0.6499788", "0.6461738", "0.6446717", "0.6418298", "0.6396964", "0.638921"...
0.70952207
1
Unmarshals a dict to an attrs object
def unmarshal_dict(data: typing.Dict, t: type) -> t: for k, v in data.items(): attr_name = json_to_python_name(k) attr_type = t.__annotations__.get(attr_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _decode(cls, input_dict):\n\n kwargs = {}\n\n for attr in cls.SERIALIZABLE_ATTRIBUTES:\n kwargs[attr] = UniversalDict.__decode_cb(input_dict[attr])\n\n return cls(**kwargs)", "def from_dict(cls, d):\n attr_cls = etau.get_class(d[\"type\"])\n return attr_cls._from...
[ "0.6925149", "0.6541121", "0.6520973", "0.64616495", "0.63589615", "0.63388866", "0.62885135", "0.6278289", "0.62366235", "0.6139307", "0.61012596", "0.6097784", "0.6078746", "0.6065307", "0.604769", "0.6014946", "0.5977304", "0.59701216", "0.59701216", "0.59701216", "0.59701...
0.7007681
0
Generate unique topic name specific to this proxy address for rx
def _gen_rx_proxy_address_topic(self, proxy_address): topic = 'rx:' + MessageToJson(proxy_address) return topic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gen_tx_proxy_address_topic(self, proxy_address):\n topic = 'tx:' + MessageToJson(proxy_address)\n return topic", "def topic(kafka_broker, request):\n topic_name = '%s_%s' % (request.node.name, random_string(10))\n kafka_broker.create_topics([topic_name])\n return topic_name", "def _...
[ "0.71542555", "0.6776412", "0.6743294", "0.66942865", "0.6675193", "0.66053945", "0.65261054", "0.64393437", "0.63515353", "0.6322403", "0.62002987", "0.61934817", "0.6184933", "0.61804456", "0.61556023", "0.6149361", "0.6122339", "0.6077515", "0.60586745", "0.6050944", "0.59...
0.7949789
0
Generate unique topic name specific to this proxy address for tx
def _gen_tx_proxy_address_topic(self, proxy_address): topic = 'tx:' + MessageToJson(proxy_address) return topic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gen_rx_proxy_address_topic(self, proxy_address):\n topic = 'rx:' + MessageToJson(proxy_address)\n return topic", "def create_key_name(callback, topic):\n\t\treturn utils.get_hash_key_name(u'%s\\n%s' % (callback, topic))", "def topic(kafka_broker, request):\n topic_name = '%s_%s' % (reques...
[ "0.7427448", "0.70357984", "0.6848313", "0.6844637", "0.6754067", "0.6687337", "0.6569904", "0.65580857", "0.6490982", "0.638119", "0.6360044", "0.6352459", "0.62631893", "0.622353", "0.62021303", "0.6116063", "0.6099514", "0.6085903", "0.6077747", "0.6069711", "0.60576504", ...
0.78557926
0
Create the Flask application and configure it.
def create_app(database_url=None): app = Flask(__name__) app.config.from_object(Config()) if database_url is not None: app.config.update( SQLALCHEMY_DATABASE_URI=database_url ) db.init_app(app) migrate = Migrate(app, db) app.register_blueprint(user_bp) return ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_app():\n\n # 1 Create Flask application\n app = Flask(\n import_name=__name__,\n template_folder=\"templates\",\n static_folder=\"static\"\n )\n\n # 2 Update the apps configuration\n app = config_selector(app)\n register_error_handlers(app)\n\n cache.init_app(app...
[ "0.8642747", "0.8480662", "0.8467452", "0.84618425", "0.8386191", "0.83841205", "0.831526", "0.8277919", "0.8239582", "0.81859887", "0.81791216", "0.8143778", "0.81364256", "0.81191105", "0.80856836", "0.8067677", "0.80538875", "0.80467844", "0.8043372", "0.8022156", "0.80200...
0.0
-1
remove the duplication of the input dictionary.
def duplicates(self, x): return list(dict.fromkeys(x))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_2_remove_dict_fields(data: DT, redundant_keys: List[str]) -> DT:\n dict2 = copy.deepcopy(data)\n for item in dict2:\n for key in redundant_keys:\n item.pop(key)\n return dict2", "def _remove_duplicates(self):\n for key in self._role_strings_info:\n self._role...
[ "0.7013582", "0.6888908", "0.6861455", "0.6695279", "0.66612136", "0.6592469", "0.65723664", "0.65679574", "0.6493597", "0.645955", "0.6447313", "0.6434343", "0.63677114", "0.63094926", "0.62834257", "0.6230814", "0.62270737", "0.62190574", "0.6212299", "0.62093747", "0.61914...
0.0
-1
Return the pygame.Rect obj from the obj
def getRect(self): try: return self.rect except: raise ReferenceError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRect(self):\n return self.rect", "def get_rect (self) :\n return self.rect.copy()", "def getRect(self):\n return self.rect()", "def getRect(self): # real signature unknown; restored from __doc__\r\n pass", "def getbounds(self):\n return pygame.Rect(self.rect)", "...
[ "0.7135398", "0.7052518", "0.6978114", "0.6972273", "0.69572777", "0.6866706", "0.6731261", "0.6623151", "0.66011053", "0.6597121", "0.6513144", "0.6450028", "0.6425996", "0.62690395", "0.62501717", "0.59888", "0.5968266", "0.5950289", "0.59469587", "0.59466666", "0.5934385",...
0.7265826
0
Creates a csv file of the standard data
def compareToStandards(method, res, STDpath='standards/all_stds'): dirtFolder = os.path.join(STDpath,'all_dirt') platFolder = os.path.join(STDpath,'all_plat') dirtPaths = [os.path.join(dirtFolder,dm) for dm in os.listdir(dirtFolder) if dm.endswith('.png')] PtPaths = [os...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_csv_file(self):\r\n # Create a new csv-file\r\n with open(self.fname, 'w') as f:\r\n writer = csv.writer(f, dialect='excel')\r\n writer.writerow(['set_time',\r\n 'read_time_P_ac',\r\n 'read_time_P_bat',\r\n ...
[ "0.7777193", "0.76978093", "0.7583775", "0.7421644", "0.72836655", "0.7215978", "0.71510273", "0.7131714", "0.7126385", "0.7087949", "0.70765847", "0.7075498", "0.7048681", "0.70434856", "0.7000909", "0.6992295", "0.6984698", "0.6967907", "0.6958154", "0.6872776", "0.6871743"...
0.0
-1
Assert that the target property returns the last column in the dataset.
def test_target_property(): atom = ATOMClassifier(X_bin, y_bin, random_state=1) atom.run("LR") assert atom.lr.target == atom.target
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_last_column(workbook):\n assert workbook.get_last_column() == 'F'", "def test_slice_last(self):\n self.table.append(['Tom', 26])\n self.table.append(['Chantelle', 24])\n self.assertEqual(self.table[-1], ['Chantelle', 24])", "def test_get_last_row(workbook):\n assert work...
[ "0.68787205", "0.64067125", "0.59580106", "0.59479105", "0.5856352", "0.5797229", "0.5766187", "0.57653254", "0.57652754", "0.57162786", "0.571363", "0.57107687", "0.5684876", "0.5679687", "0.5605005", "0.55891556", "0.5587781", "0.548944", "0.5471174", "0.5450522", "0.544493...
0.0
-1
Assert that models can be deleted.
def test_delete(): atom = ATOMRegressor(X_reg, y_reg, random_state=1) atom.run("RF") atom.rf.delete() assert not atom.models assert not atom.metric
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_permission(self):\r\n self.assertFalse(self.creator_admin.has_delete_permission(self.request))", "def assert_delete(instance:SafeDeleteModel, expected_results:ExpectedResults, force_policy:Optional[int]=None, save=True):\n model = instance.__class__\n\n assert model.objects.count() == ex...
[ "0.75435185", "0.73932844", "0.73826444", "0.72136444", "0.7196681", "0.7121459", "0.7087554", "0.7051712", "0.7047343", "0.70115685", "0.699445", "0.6973805", "0.69709283", "0.69270796", "0.6921015", "0.6908321", "0.6890536", "0.6876658", "0.6868964", "0.6864385", "0.6854180...
0.0
-1
Sets the number_of_total_results of this InlineResponse200.
def number_of_total_results(self, number_of_total_results): if (self.local_vars_configuration.client_side_validation and number_of_total_results is not None and number_of_total_results < 0): # noqa: E501 raise ValueError("Invalid value for `number_of_total_results`, must be a value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_results(self, number_of_results):\n if number_of_results is None:\n raise ValueError(\"Invalid value for `number_of_results`, must not be `None`\") # noqa: E501\n\n self._number_of_results = number_of_results", "def number_of_page_results(self, number_of_page_results):\n ...
[ "0.69300735", "0.67607576", "0.5983265", "0.5925942", "0.5699223", "0.563838", "0.5627313", "0.55313015", "0.55192906", "0.55192906", "0.5504183", "0.54788095", "0.5462937", "0.5455821", "0.54397655", "0.54299027", "0.5424952", "0.53886396", "0.53886396", "0.5346513", "0.5292...
0.73684305
0
Sets the number_of_page_results of this InlineResponse200.
def number_of_page_results(self, number_of_page_results): if (self.local_vars_configuration.client_side_validation and number_of_page_results is not None and number_of_page_results < 0): # noqa: E501 raise ValueError("Invalid value for `number_of_page_results`, must be a value great...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_pages(self, number_of_pages):\n self._number_of_pages = number_of_pages", "def number_of_results(self, number_of_results):\n if number_of_results is None:\n raise ValueError(\"Invalid value for `number_of_results`, must not be `None`\") # noqa: E501\n\n self._number...
[ "0.704695", "0.6831299", "0.62505686", "0.61895037", "0.61578405", "0.60398227", "0.60398227", "0.5977696", "0.5943195", "0.58827585", "0.5865441", "0.5805919", "0.5803412", "0.579883", "0.5781619", "0.5742893", "0.57149184", "0.565191", "0.56436837", "0.5615568", "0.5612124"...
0.7340758
0
Sets the results of this InlineResponse200.
def results(self, results): self._results = results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def results(self, results):\n self._results = results", "def results(self, results):\n self._results = results", "def process_results(self, response, results):\n return results", "def process_results(self, response, results):\n return results", "def results(self, value):\n ...
[ "0.69162434", "0.69162434", "0.6507406", "0.6507406", "0.63054717", "0.6224932", "0.6115799", "0.6035744", "0.6035744", "0.6015503", "0.6015503", "0.5915994", "0.58076644", "0.5755978", "0.5686618", "0.56550884", "0.5639663", "0.5631096", "0.56241935", "0.56228256", "0.559722...
0.6872371
3
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, InlineResponse200): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088463", "0.8088463", "0.80553037", "0.7983272", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", "0.7966844", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, InlineResponse200): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Create node name from name/hostname pair.
def nodename(name, hostname): return NODENAME_SEP.join((name, hostname))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_node_name(input_node, mode=tuple):\n key = input_node.fullname\n if len(input_node.out_ports()) > 1:\n port_number = input_node.in_port(0).get_source().out\n key = (input_node.fullname, port_number) if mode == tuple else f\"{input_node.fullname}.{port_number}\"\n return key", "d...
[ "0.70378345", "0.7031026", "0.68867064", "0.68867064", "0.6768314", "0.6705894", "0.66577464", "0.6629369", "0.6603436", "0.66018474", "0.6497095", "0.64804405", "0.64701647", "0.6461358", "0.63422203", "0.63353586", "0.6308224", "0.6306816", "0.62389475", "0.6203486", "0.617...
0.7324232
0
Return the nodename for this process (not a worker). This is used for e.g. the origin task message field.
def anon_nodename(hostname=None, prefix='gen'): return nodename(''.join([prefix, str(os.getpid())]), hostname or gethostname())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getnodename(self, node_p):\n # (const node_bn* node)\n cnetica.GetNodeName_bn.argtypes = [c_void_p]\n cnetica.GetNodeName_bn.restype = c_char_p\n return cnetica.GetNodeName_bn(node_p) # name", "def node_name(self, name_node):\n return self.fuel_web.get_nailgun_node_by_name...
[ "0.7234746", "0.70993966", "0.70993966", "0.7066431", "0.70107", "0.6883787", "0.6789494", "0.6742337", "0.6710475", "0.65791607", "0.6538801", "0.6529229", "0.6452239", "0.64472497", "0.63711977", "0.6327525", "0.63113725", "0.63001966", "0.6282226", "0.62739736", "0.6266755...
0.7027581
4
Return the default nodename for this process.
def default_nodename(hostname): name, host = nodesplit(hostname or '') return nodename(name or NODENAME_DEFAULT, host or gethostname())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _node(default=''):\n try:\n import socket\n except ImportError:\n # No sockets...\n return default\n try:\n return socket.gethostname()\n except OSError:\n # Still not working...\n return default", "def anon_nodename(hostname=None, prefix='gen'):\n ret...
[ "0.7440144", "0.7065347", "0.70232654", "0.6916747", "0.6485959", "0.6387336", "0.6387336", "0.6366217", "0.63572437", "0.6356888", "0.63192", "0.62910366", "0.6287082", "0.62723607", "0.62213004", "0.62089986", "0.617669", "0.6167348", "0.6158868", "0.6158784", "0.6144819", ...
0.7892396
0
Loads a frozen inference graph
def load_graph(self, graph_file): graph = tf.Graph() with graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(graph_file, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) tf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_frozen_graph(frozen_graph_path, graph=None, session=None):\n from diplomacy_research.utils.tensorflow import tf, tf_logging\n\n # Making sure the path exists\n if not os.path.exists(frozen_graph_path):\n LOGGER.error('The frozen graph %s does not exist.', frozen_graph_path)\n raise ...
[ "0.7145618", "0.71300054", "0.6952633", "0.64996564", "0.6480352", "0.64554673", "0.6437847", "0.6419772", "0.6419772", "0.63925844", "0.638914", "0.63779676", "0.6364601", "0.6306616", "0.6300151", "0.627973", "0.6269959", "0.6266776", "0.6258529", "0.62003803", "0.6152927",...
0.5937644
34
Return boxes with a confidence >= `min_score`
def filter_boxes(self, min_score, boxes, scores, classes): n = len(classes) idxs = [] for i in range(n): if scores[i] >= min_score: idxs.append(i) filtered_boxes = boxes[idxs, ...] filtered_scores = scores[idxs, ...] filtered_classes =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_boxes(min_score, boxes, scores, classes):\n n = len(classes)\n idxs = []\n for i in range(n):\n if scores[i] >= min_score:\n idxs.append(i)\n \n filtered_boxes = boxes[idxs, ...]\n filtered_scores = scores[idxs, ...]\n filtered_classes = classes[idxs, ...]\n ret...
[ "0.72886777", "0.72855526", "0.72492224", "0.72279024", "0.6647105", "0.6314491", "0.63112724", "0.61915874", "0.6165219", "0.61569124", "0.6156313", "0.61135215", "0.6062302", "0.5995685", "0.59620845", "0.5960607", "0.5950879", "0.59485", "0.5940718", "0.5940718", "0.593683...
0.7317321
0
Check if graph contains all the expected edges For each (subgraph) expected edge, check if a corresponding edge exists in the graph with relevant properties check
def _graph_contains_subgraph_edges(graph, subgraph, subgraph_edges): for e in subgraph_edges: graph_v_id_source = subgraph.get_vertex(e.source_id).get(MAPPED_V_ID) graph_v_id_target = subgraph.get_vertex(e.target_id).get(MAPPED_V_ID) if not graph_v_id_source or not graph_v_id_target: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_edges(self):\n\n edge_list = self.g.edges()\n self.assertEqual(42, len(edge_list))\n\n # p1 p3 and p3 p1 are valid edges\n t1 = ('p1', 'p3')\n self.assertTrue(t1 in edge_list)\n\n t2 = ('p3', 'p1')\n self.assertTrue(t2 in edge_list)\n\n made_up = ('z...
[ "0.72355753", "0.70089877", "0.686403", "0.66664", "0.66333133", "0.6595067", "0.65374804", "0.64972645", "0.644096", "0.6399739", "0.63009274", "0.62698144", "0.6247802", "0.62457895", "0.6205437", "0.617922", "0.6155238", "0.61367226", "0.6099984", "0.6090612", "0.60561705"...
0.65138876
7
Return map visualization page If iframe parameter not present, then redirect to dataverse.org homepage
def view_map_dataverse_org(request): if not request.GET.get('iframe', None): return HttpResponseRedirect('http://dataverse.org') return view_map(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_pair_page() :\r\n\r\n script = server_document( url=f'http://localhost:5006/{data_explore_route}',\r\n arguments={'session_id' : session[ session_info.session_id_key ] } )\r\n\r\n return render_template( 'data_explore_page.html', script=script )", "def html_page():\n ...
[ "0.57731485", "0.57060015", "0.5493566", "0.543434", "0.5427271", "0.5386682", "0.53590596", "0.53452104", "0.53294617", "0.5269879", "0.5267091", "0.5255815", "0.520938", "0.51639086", "0.51515675", "0.5139768", "0.5129067", "0.51283693", "0.51263964", "0.5120192", "0.510296...
0.8473592
0
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(opts, optimizer, epoch): lr = opts.lr * (0.1 ** (epoch // 30)) for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.7913536", "0.7906521", "0.7849834", "0.777524", "0.77338326", "0.77306354", "0.7722718", "0.77224237", "0.771982", "0.77092624", "0.7693604", "0.76742035", "0.7665748", "0.7665748", "0.7665748", "0.7655329", "0.76419765", "0.76399755", "0.7637868", "0.7626077", "0.76247585...
0.7501526
53
Determine if it is currently regular mark hours. Some of the test results change depending on whether the market is open or not. This rely's on the system time being in the correct timezone.
def is_market_hours(): now = datetime.datetime.now() day = now.weekday() time = now.hour * 100 + now.minute if day > 4: return False if 930 <= time < 1600: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isCurrentHour(self):\n t = time()\n gmt = safegmtime(t + _tzoffset(self._tz, t))\n return (gmt[0] == self._year and gmt[1] == self._month and\n gmt[2] == self._day and gmt[3] == self._hour)", "def market_hours():\n current_time = datetime.datetime.now().time()\n # Ch...
[ "0.729752", "0.71242255", "0.6880527", "0.64211404", "0.60956657", "0.60904753", "0.6026131", "0.6008176", "0.59810376", "0.59766793", "0.5975547", "0.5958023", "0.5927087", "0.5891509", "0.58554614", "0.58259207", "0.5823217", "0.57907814", "0.5788679", "0.5771034", "0.57667...
0.7151098
1
Patch one or more concepts.
def PatchConcepts(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PatchConceptLanguages(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')", "def test_update_concept(self):\n\n # Create a new `Concept` record.\n obj_id, refr...
[ "0.6451977", "0.6000637", "0.5803942", "0.5666523", "0.54890805", "0.548833", "0.5476283", "0.54687345", "0.5464108", "0.54599357", "0.54409325", "0.5429306", "0.54111373", "0.5351005", "0.5346034", "0.53296775", "0.5317056", "0.53112996", "0.52827597", "0.52763814", "0.52715...
0.7718841
0
Add a vocab to an app.
def PostVocabs(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_doc_to_vocab(filename, vocab):\n doc = load_doc(filename)\n tokens = clean_doc(doc)\n vocab.update(tokens)", "def add_doc_to_vocab(filename, vocab):\n doc = load_doc(filename)\n tokens = clean_doc(doc)\n vocab.update(tokens)", "def _insert_vocab(self, json_obj, mode=InsertVocabMode.AL...
[ "0.67107695", "0.67107695", "0.6485402", "0.6232132", "0.6221889", "0.62125903", "0.61097646", "0.60878897", "0.58722013", "0.5866906", "0.58443946", "0.5841103", "0.580727", "0.5753", "0.5701437", "0.5699872", "0.5697149", "0.55782783", "0.55494326", "0.55368054", "0.5521204...
0.0
-1
Add a vocab to an app.
def PostVocabConcepts(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_doc_to_vocab(filename, vocab):\n doc = load_doc(filename)\n tokens = clean_doc(doc)\n vocab.update(tokens)", "def add_doc_to_vocab(filename, vocab):\n doc = load_doc(filename)\n tokens = clean_doc(doc)\n vocab.update(tokens)", "def _insert_vocab(self, json_obj, mode=InsertVocabMode.AL...
[ "0.67107695", "0.67107695", "0.6485402", "0.6232132", "0.6221889", "0.62125903", "0.61097646", "0.60878897", "0.58722013", "0.5866906", "0.58443946", "0.5841103", "0.580727", "0.5753", "0.5701437", "0.5699872", "0.5697149", "0.55782783", "0.55494326", "0.55368054", "0.5521204...
0.5041886
56
////////////////////////////////////// annotations ////////////////////////////////////// Get a specific annotation from an app.
def GetAnnotation(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_annotation(cls, name):\n return cls.__annotations__.get(name)", "def getAnnotation(self, *args):\n return _libsbml.SBase_getAnnotation(self, *args)", "def _annotations(request):\n result = Search(request).run(MultiDict(request.params))\n\n return request.find_service(AnnotationRead...
[ "0.6783513", "0.65315443", "0.6308092", "0.61663276", "0.6123864", "0.6123864", "0.60236794", "0.60236794", "0.57168096", "0.56965256", "0.5653872", "0.56438154", "0.5608193", "0.55703485", "0.55634", "0.5544586", "0.55445564", "0.55220115", "0.5428885", "0.5403433", "0.54026...
0.5223249
35
List all the models.
def ListModels(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ListModels(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def list_models(self, fields=['model_name']):\n\t\tmodels = dbop.get_models(self, model_type='all', fields=fields)\n\t\treturn models", "def index(self, req):\n return self._get_models(req, is_detail...
[ "0.7937478", "0.7707861", "0.75323635", "0.741379", "0.7398595", "0.7172207", "0.7165623", "0.7083484", "0.70658064", "0.70654917", "0.70600194", "0.7043974", "0.702255", "0.7004309", "0.69913346", "0.68738526", "0.68485934", "0.6847666", "0.6813858", "0.6786381", "0.67810154...
0.6611709
25
Patch one or more models.
def PatchModels(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(self, request, pk=None): #pk of id of objects to be updated (DB)\n return Response({'method':'PATCH'})", "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)", "def updateModel(self):\n pass", "def patch(self, request, pk=None):\n return Response...
[ "0.6786676", "0.6588208", "0.6293383", "0.6237997", "0.61941457", "0.6169014", "0.61510795", "0.60911274", "0.608334", "0.608334", "0.608334", "0.6059701", "0.60427517", "0.6035549", "0.6017599", "0.60041153", "0.59962916", "0.5899307", "0.5863551", "0.582189", "0.58196115", ...
0.7212802
0
////////////////////////////////////// Model versions ////////////////////////////////////// Get a specific model from an app.
def GetModelVersion(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model(model):\n all_models = cmd.get_object_list()\n\n if len(all_models) == 0:\n logging.parser_error('No models are opened.')\n return\n\n model = model.lower()\n\n if model and (model in all_models):\n return model\n\n if len(all_models) > 1:\n logging.parser_e...
[ "0.7080445", "0.69368666", "0.6922189", "0.68852824", "0.68373257", "0.68370634", "0.68288267", "0.6814035", "0.6796162", "0.6704564", "0.66257113", "0.6614918", "0.65952015", "0.6533818", "0.6521674", "0.65196407", "0.6499986", "0.64622897", "0.6441396", "0.6440943", "0.6409...
0.0
-1
List all the models.
def ListModelVersions(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ListModels(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def list_models(self, fields=['model_name']):\n\t\tmodels = dbop.get_models(self, model_type='all', fields=fields)\n\t\treturn models", "def index(self, req):\n return self._get_models(req, is_detail...
[ "0.7937478", "0.7707861", "0.75323635", "0.741379", "0.7398595", "0.7172207", "0.7165623", "0.7083484", "0.70658064", "0.70654917", "0.70600194", "0.7043974", "0.702255", "0.7004309", "0.69913346", "0.68738526", "0.68485934", "0.6847666", "0.6813858", "0.6786381", "0.67810154...
0.0
-1
Get the evaluation metrics for a model version.
def GetModelVersionMetrics(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_evaluation(client, model_name):\n model_evaluations = [e for e in client.list_model_evaluations(model_name)]\n model_evaluation = model_evaluations[0]\n print(\"Model evaluation:\")\n print(model_evaluation)\n return model_evaluation", "def get_model_evaluations(self):\n return self._mo...
[ "0.67726845", "0.6365116", "0.6327483", "0.6282511", "0.61753196", "0.604747", "0.59513557", "0.59474987", "0.58851236", "0.583453", "0.57257646", "0.56936455", "0.56754416", "0.56675714", "0.5620363", "0.5619344", "0.5607953", "0.5595502", "0.5592845", "0.55916154", "0.55831...
0.5773054
10
Get the evaluation metrics for a model version.
def PostModelVersionMetrics(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_evaluation(client, model_name):\n model_evaluations = [e for e in client.list_model_evaluations(model_name)]\n model_evaluation = model_evaluations[0]\n print(\"Model evaluation:\")\n print(model_evaluation)\n return model_evaluation", "def get_model_evaluations(self):\n return self._mo...
[ "0.67726845", "0.6365116", "0.6327483", "0.6282511", "0.61753196", "0.604747", "0.59513557", "0.59474987", "0.58851236", "0.583453", "0.5773054", "0.57257646", "0.56936455", "0.56754416", "0.56675714", "0.5620363", "0.5619344", "0.5607953", "0.5595502", "0.5592845", "0.559161...
0.0
-1
Predict using a workflow.
def PostWorkflowResults(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, conf):\n conf.set_int(\"angel.worker.matrix.transfer.request.timeout.ms\", 60000)\n predict(conf, conf._jvm.com.tencent.angel.ml.classification.lr.LRModel(conf._jconf, None), 'com.tencent.angel.ml.classification.lr.LRPredictTask')", "def predict(self, review):\n raise NotIm...
[ "0.7140991", "0.69880366", "0.6901158", "0.6881536", "0.685268", "0.6852201", "0.6849659", "0.6849006", "0.68012184", "0.67836344", "0.6780603", "0.6734837", "0.67300034", "0.6729932", "0.6721434", "0.66895384", "0.6687482", "0.6687262", "0.6680892", "0.66633517", "0.6660541"...
0.0
-1
Add a app to an app. This needs to load the default workflow to make a copy, validating all the models in it, and then writing the new workflow back to this new app.
def PostApps(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_app(self, app: AppDefinition) -> None:\n\n self.db.insert_app(app=app)", "def add_app(self):\n \n pass", "def add_linked_apps(self, workflow_dict, base_path):\n app_dict = {}\n steps = workflow_dict['steps']\n for step in steps.values():\n if step.ge...
[ "0.75282323", "0.7370881", "0.6926872", "0.67481065", "0.6644168", "0.6603376", "0.6603376", "0.65811116", "0.656819", "0.63803023", "0.6316092", "0.624417", "0.6229731", "0.6199578", "0.60928833", "0.60714895", "0.6071025", "0.6047932", "0.60447127", "0.60090727", "0.5999668...
0.0
-1
Patch one or more apps.
def PatchApps(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AppUpdateApp(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def apps(self, apps):\n\n self._apps = apps", "def reload_apps(self, **kwargs) -> None:\n kwargs[\"namespace\"] = \"admin\"\n kwargs[\"__name\"] = self.name\n self.call_service...
[ "0.6728433", "0.6626188", "0.6518145", "0.6485711", "0.6471132", "0.63517594", "0.6262025", "0.625553", "0.62401044", "0.62051386", "0.6158807", "0.61349213", "0.6096015", "0.60104567", "0.59714925", "0.59245884", "0.58834285", "0.580415", "0.5767484", "0.57673156", "0.574929...
0.7689261
0
////////////////////////////////////// Subscriptions ////////////////////////////////////// List the subscriptions.
def GetSubscription(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(cls, **kwargs):\n response = Yola().list_subscriptions(**kwargs)\n return [cls(**sub) for sub in response['results']]", "def listSubscriptions() -> object:\n\n db = Db()\n return db.Subscriptions.objects().to_json()", "def get_subscriptions(self):\n url = '{}/v2/subscription...
[ "0.80601597", "0.80342317", "0.8015662", "0.7924471", "0.7903658", "0.7803257", "0.78002894", "0.77950364", "0.77611953", "0.7744561", "0.76968884", "0.74771047", "0.7448107", "0.74296814", "0.74015117", "0.73682696", "0.72993356", "0.7218356", "0.72173613", "0.72156066", "0....
0.0
-1
Get a list of valid usage intervals
def ListUsageIntervals(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_interval_stats(usages):\n\n # NOTE: with the current functionality in this particular method, we shouldn't need to worry about having to\n # localize anything; it makes no difference to the relevance of the intervals, especially as they're not mapped\n # to any particular dates on the graph or any...
[ "0.6249992", "0.61817694", "0.5971763", "0.5926436", "0.5911921", "0.58449596", "0.5843868", "0.58114576", "0.5805637", "0.5795858", "0.5732303", "0.5696217", "0.5661123", "0.5649932", "0.56366414", "0.5614341", "0.56129324", "0.55741066", "0.55674124", "0.55411005", "0.54980...
0.6858078
0
add collaborators to an app.
def PostCollaborators(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collaborators(self, collaborators):\n\n self._collaborators = collaborators", "def collaborators(self):\r\n return RepoCollaborators(self)", "def add_collaborator(\n self, repo, collaborator, db_privileges,\n file_privileges):\n # Usage is probably not the right c...
[ "0.71937215", "0.62141955", "0.61352473", "0.6108357", "0.6060241", "0.5857111", "0.58197343", "0.5755117", "0.5744066", "0.56508297", "0.54831797", "0.5300351", "0.5248528", "0.5237483", "0.5215572", "0.5202542", "0.5137326", "0.5127499", "0.5087488", "0.5052658", "0.5045274...
0.61432606
2
////////////////////////////////////// Licenses ////////////////////////////////////// Get the license with crypto security.
def FetchLicense(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_license(self) -> APIReturn:\n return await self._request(\"GET\", \"/getLicense\")", "def get_license():\n repo_fs()\n return LICENSE", "def license(self): # noqa: A003\n logger.debug(\"Get license\")\n return self._raw_api.license.get()", "def getLicense(self, resou...
[ "0.82132196", "0.7825189", "0.77396315", "0.73544955", "0.7240669", "0.7181079", "0.7171078", "0.7113171", "0.70556176", "0.70411956", "0.70296085", "0.69648707", "0.69609994", "0.68285435", "0.66893524", "0.66743356", "0.6672583", "0.6657151", "0.66416806", "0.6590019", "0.6...
0.6232396
34
Compute the Hamming Distance between the 2 strings, str1 and str2 Hamming Distance is number of mismatches between the strings
def HammingDist(str1, str2): Hdist = 0 for i, base in enumerate(str1): if base != str2[i]: Hdist += 1 return Hdist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_hamming_distance(str1, str2):\n\n mismatches = 0\n len_strs = len(str1)\n for i in range(len_strs):\n if str1[i] != str2[i]:\n mismatches = mismatches + 1\n return mismatches", "def hamming_distance(str1, str2):\n\n # TODO: Write your solution here\n # Edge case ch...
[ "0.91012865", "0.8806628", "0.8732323", "0.8633986", "0.8533682", "0.8530044", "0.84527516", "0.8397794", "0.8355999", "0.8350022", "0.82897925", "0.8268038", "0.80597866", "0.80233115", "0.8021256", "0.7991858", "0.79576993", "0.79304737", "0.79053867", "0.785357", "0.779570...
0.8856756
1
Helper function since Gazebo returns the forward kinematics of the robot as a quaternion
def quaternion_to_yaw(self, pose): quaternion = ( pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w, ) euler = transformations.euler_from_quaternion(quaternion) return euler[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_kinematics(self):\n temp_T = Matrix.eye(3)\n for i in range(len(self.lengths)):\n angle_mat = self.T_a.subs(self.q,self.angles[i]).evalf()\n len_mat = self.T_x.subs(self.l,self.lengths[i]).evalf()\n temp_T = temp_T * angle_mat * len_mat\n \n ...
[ "0.69057995", "0.6829799", "0.6501993", "0.6496118", "0.642924", "0.63414353", "0.62206423", "0.6178019", "0.6015858", "0.6006843", "0.599484", "0.59718263", "0.59617376", "0.59203285", "0.59094554", "0.5908644", "0.5905416", "0.5829237", "0.5828634", "0.5810251", "0.58076715...
0.0
-1
Initialize the dictionary that maintains all stored objects.
def __init__(self): self.objects = dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n self.__storage = {}", "def __init__(self):\n self._main_dictionary = defaultdict(set)", "def __init__(self):\n self.__dict__ = dict()\n self.load()", "def __init__(self):\n self._datastore = dict()", "def __init__(self):\n self.store = {}", ...
[ "0.77941597", "0.7549993", "0.7534235", "0.7524267", "0.7509622", "0.7472681", "0.7472681", "0.74443364", "0.74443364", "0.74443364", "0.7405535", "0.7381041", "0.72919357", "0.72919357", "0.7285011", "0.7221224", "0.72116435", "0.7188667", "0.7172964", "0.71707416", "0.71707...
0.7867476
0
Return true if light is on.
def is_on(self): return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def light_is_on(self):\r\n return self._light == \"ON\"", "def light_is_on(self):\n return self._light == \"ON\"", "def is_on(self):\n return self._light_on", "def is_light(self) -> bool:\n return ATTRIBUTE.Light.value in self.type_data.attributes", "def is_light(self) -> bool:\...
[ "0.9035416", "0.89275813", "0.86664206", "0.8008696", "0.8008696", "0.78880787", "0.7866302", "0.7610281", "0.7565963", "0.7415077", "0.7345493", "0.7335999", "0.73116577", "0.7303292", "0.72991306", "0.7243393", "0.71792775", "0.71722543", "0.7157757", "0.7157757", "0.715775...
0.6595362
98
Turn the light off.
async def async_turn_off(self, **kwargs) -> None: self._state = await self._gate.turn_off_light(self._light_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self):\n GPIO.output(self.gpio, False) # turn off light", "def lightning_turnoff(self):\n self.turnOff()", "def set_light_off(self):\n self._light = \"OFF\"", "def turn_off(self, **kwargs):\n self._light.set_color(0, 0, 0, 0)", "def set_light_off(self):\r\n ...
[ "0.9158525", "0.88893706", "0.88740003", "0.8852116", "0.8842971", "0.87965184", "0.864986", "0.85981315", "0.85843927", "0.85641575", "0.8526551", "0.8403609", "0.83990663", "0.8292084", "0.8271316", "0.82411224", "0.81950665", "0.8189084", "0.8162265", "0.8066985", "0.80102...
0.75462383
38
Return the value to put in experiment json from mobile_str >>> mobile_from_mobile_str(None) False >>> mobile_from_mobile_str('true') True >>> mobile_from_mobile_str('True') True >>> mobile_from_mobile_str('false') False >>> mobile_from_mobile_str('1') True >>> mobile_from_mobile_str('0') False >>> mobile_from_mobile_st...
def mobile_from_mobile_str(mobile_str=None): mobile_str = mobile_str or 'False' mobile_str = mobile_str.title() # upper first letter if mobile_str == 'True': return True elif mobile_str == 'False': return False try: return bool(int(mobile_str)) except ValueError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_mobile(self, mobile):\n self.mobile = mobile.strip()\n example = \"mobile number (ex. +2346787646)\"\n if re.match(r'(^[+0-9]{1,3})*([0-9]{10,11}$)',\n self.mobile) is None:\n raise GraphQLError(\n ERROR_RESPONSES[\"invalid_field_error\...
[ "0.6604178", "0.6212264", "0.5992427", "0.5992427", "0.56252736", "0.5568009", "0.5404159", "0.5284615", "0.5271323", "0.5270908", "0.5252054", "0.5239834", "0.519555", "0.5173896", "0.5118413", "0.5112872", "0.5112872", "0.50926775", "0.50926775", "0.5089801", "0.5087271", ...
0.78416073
0
Return True if line appears to be the name of a judge or judges, based on a series of heuristics.
def is_judges_or_author(line_text): # line can't be too long if len(line_text) > 80: return False line_lower = line_text.lower() # 'Before DYKMAN, VERGERONT and LUNDSTEN, JJ.' # 'Present: All the Justices.' if any(line_lower.startswith(s) for s in ("before", "present", "considered and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_candidate(line):\n line = line.lower()\n line = prepare_text_line(line)\n return (has_content(line) and any(s in line for s in copyrights_hint.statement_markers))", "def process_line(self, line):\n ltype = self.line_type(line)\n if ltype == 'gene':\n self.process_gene_lin...
[ "0.6451866", "0.62590736", "0.61232984", "0.60254794", "0.59346247", "0.5903377", "0.589355", "0.5868055", "0.5777835", "0.5746841", "0.57152617", "0.5678738", "0.5678738", "0.56613934", "0.5658491", "0.56503594", "0.5614642", "0.5585857", "0.5569993", "0.55487394", "0.554645...
0.6801767
0
Insert padding `pad_value` to the `offset`th (zerobased) byte of every tile.
def _pad_region(region_data: bytes, *, tile_size: int, offset: int, pad_value: int = 0) -> bytes: region_size = len(region_data) assert len(region_data) % tile_size == 0 assert tile_size >= offset assert pad_value < 2 ** 8 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(x, padding, fill_value=0):\n input_shape = x.shape\n output_shape = []\n indices = []\n\n for dim, pad in enumerate(padding):\n try:\n left_pad, right_pad = pad\n except TypeError:\n left_pad = right_pad = pad\n output_shape.append(left_pad + input_sha...
[ "0.6735389", "0.6561289", "0.6508607", "0.6484323", "0.63490045", "0.6324427", "0.6271659", "0.62259555", "0.6134819", "0.60889053", "0.6059609", "0.6046944", "0.6046003", "0.60401314", "0.6036333", "0.60127723", "0.5996608", "0.5975549", "0.5973435", "0.5965108", "0.59405607...
0.7423885
0
List all comment's reactions.
def reactions(self, request, *args, **kwargs): comment = self.get_object() reactions = ReactionComment.objects.filter(comment=comment) serializer = ReactionCommentModelSummarySerializer( reactions, many=True) return Response(serializer.data, status=status.HTTP_200_OK)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getListOfReactions(self):\n return self.model.getListOfReactions()", "def getListOfReactions(self, *args):\n return _libsbml.Model_getListOfReactions(self, *args)", "async def reactions(self, ctx):\n\n\t\tawait self.message_leaderboard(ctx, \"reactions\")", "def test_issue_get_comment_react...
[ "0.77879936", "0.73153013", "0.7109777", "0.69295996", "0.67360884", "0.63014376", "0.614018", "0.59485376", "0.59456325", "0.5940173", "0.58975273", "0.5890063", "0.5871353", "0.5831911", "0.5738452", "0.57197005", "0.569526", "0.5664364", "0.56287926", "0.56207687", "0.5620...
0.7678561
1
Get data directory path from the environment variable.
def get_datadir() -> Path: config = os.getenv('TOM_DATA', '') return Path(config)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_dir():\n return Path(current_app.config[\"USER_DIR\"]) / \"data\"", "def data_dir():\n return _config.datadir", "def get_data_path():\n\treturn _paths[_DATA_DIRECTORY_KEY]", "def get_data_path():\n return os.getcwd() + \"/data/\"", "def getDataPath():\n\treturn \"..\" + os.sep + \"dat...
[ "0.80008644", "0.76505756", "0.7553415", "0.7543382", "0.7494462", "0.74411625", "0.7407659", "0.73585594", "0.73448443", "0.7340255", "0.7339732", "0.7335761", "0.73046327", "0.72544104", "0.72405624", "0.72144526", "0.72081536", "0.720742", "0.7201379", "0.7187562", "0.7129...
0.7135786
20
Propagate the signal from the input to the output.
def forward(network: dict, x: np.array) -> np.array: W1, W2, W3 = network['W1'], network['W2'], network['W3'] b1, b2, b3 = network['b1'], network['b2'], network['b3'] z1 = _forward(x, W1, b1, 'sigmoid') z2 = _forward(z1, W2, b2, 'sigmoid') y = _forward(z2, W3, b3, 'identity') return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, input):\n raise NotImplementedError", "def forward(self, input):\n raise NotImplementedError", "def forward(self, input):\n raise NotImplementedError()", "def forward(self, x_in):\n x_out = x_in.mm(self.w.t())+self.b\n self.x_in = x_in\n return x_ou...
[ "0.64702564", "0.64702564", "0.6411625", "0.6357781", "0.6313237", "0.62424093", "0.622925", "0.6195842", "0.6168706", "0.6129473", "0.6107758", "0.61008", "0.6097006", "0.60716575", "0.60658383", "0.59950453", "0.59873223", "0.5971706", "0.59716606", "0.5962301", "0.59424794...
0.0
-1
void main(){ 1 + 2 = 3; return; }
def test_not_left_value_1(self): input = (Program([FuncDecl(Id("main"),[],VoidType(),Block([BinaryOp("=",BinaryOp("+",IntLiteral(1),IntLiteral(2)),IntLiteral(3)),Return()]))])) expect = "Not Left Value: BinaryOp(+,IntLiteral(1),IntLiteral(2))" self.assertTrue(TestChecker.test(input,expect,470))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def myfunc():\r\n one = 10\r\n two = 10\r\n print(one)\r\n print(two)", "def test_augassign_recursion():\n # infinitely recurses in python\n code = \"\"\"\n def rec():\n a = 0\n a += rec()\n return a\n rec()\n \"\"\"\n cls_node = extract_node(code)\n assert n...
[ "0.58310294", "0.57648647", "0.5764779", "0.5764779", "0.57633513", "0.5673162", "0.56693375", "0.56669945", "0.56583375", "0.5625018", "0.54844534", "0.5483824", "0.5459819", "0.54495597", "0.5414418", "0.5377355", "0.5372829", "0.5368221", "0.5368221", "0.53520703", "0.5352...
0.0
-1
View function for homepage of site
def index(request): num_posts = BlogPost.objects.all().count() num_bloggers = Blogger.objects.all().count() latest_blog = BlogPost.objects.latest('post_date') context = { 'num_posts': num_posts, 'num_bloggers': num_bloggers, 'latest_blog': latest_blog, } return render(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homepage(request):\n\treturn render(request, 'core/homepage.html')", "def homepage(request):\n return render_to_response('h1ds_core/homepage.html', \n context_instance=RequestContext(request))", "def homepage(request):\n \n return render(request, 'homepage.html')", "...
[ "0.8546482", "0.84757936", "0.8271713", "0.82043463", "0.81916624", "0.8133244", "0.8124655", "0.80512565", "0.8030566", "0.80149215", "0.8004634", "0.7995436", "0.796763", "0.79650605", "0.79650605", "0.79589784", "0.7929464", "0.79237723", "0.7889094", "0.787367", "0.786074...
0.0
-1
This is used to return the distance from the Origin
def distanceFromOrigin(self): return ((self.x)**2+(self.y)**2)**0.5
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) **0.5", "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n return ((self.x ** 2) + (self.y ** 2)) ** 0.5", "def distance_from_origin(self):\n ...
[ "0.8821185", "0.8804038", "0.8804038", "0.8804038", "0.8804038", "0.8804038", "0.8804038", "0.8804038", "0.86935693", "0.86848056", "0.8518761", "0.75764143", "0.750075", "0.7466257", "0.7459061", "0.7412497", "0.7411014", "0.73631036", "0.7280529", "0.72756857", "0.7274003",...
0.8751061
8
Apply a list of fillings to input data.
def apply_filling(data, filling_list): method_name = filling_list[0][MethodKeys.METHOD] method_params = filling_list[0][MethodKeys.PARAMETERS] return NonSeqFillingMethods.get_method(method_name)(**method_params)( data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _apply_workload_filling(self):\n\n # call functions corresponding to fill_in types\n for filling_strategy_config in self.config.model[\"workload_filling\"].get('operations', []):\n\n # select the appropriate workload_filling strategy\n filler = job_filling_types[filling_stra...
[ "0.61002046", "0.580959", "0.57884777", "0.5739054", "0.55940175", "0.53829044", "0.53692716", "0.53384", "0.533211", "0.5317795", "0.529654", "0.5196135", "0.51880175", "0.5176177", "0.51689035", "0.5165388", "0.51594377", "0.51235384", "0.5116412", "0.50709033", "0.5070268"...
0.80294317
0
Generate an approximate box size based on the number and molecular weight of molecules present, and a target density for the final solvated mixture. If no density is specified, the target density is assumed to be 1 g/ml. This is the adapted from the `openmoltools` package where the mol handling is switched to RDKit her...
def approximate_volume_by_density(smiles_strings, n_molecules_list, density=1.0, box_scaleup_factor=1.1, box_buffer=2.0): density = density * units.grams/units.milliliter #Load molecules to get molecular weights wts = [] mass = 0.0*units.grams/units.mole * 1./units.AV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approximate_volume_by_density(smiles_strings, n_molecules_list, density=1.0,\n box_scaleup_factor=1.1, box_buffer=2.0):\n\n oechem = import_(\"openeye.oechem\")\n\n density = density * units.grams/units.milliliter\n\n #Load molecules to get molecular weights\n wts =...
[ "0.57666254", "0.57549614", "0.5623101", "0.5590386", "0.55077815", "0.51979375", "0.50994104", "0.4968594", "0.4930115", "0.4917206", "0.48865804", "0.4859173", "0.48411345", "0.48278058", "0.48265278", "0.48189956", "0.47868267", "0.47813645", "0.47644395", "0.47523454", "0...
0.5797355
0
Return a new vector scaled to given length
def as_length(self, value): new_vec = self.copy() new_vec.length = value return new_vec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scaled_to(self, length):\n L = self.length\n if L > pygonal.EPSILON:\n vx, vy = self\n s = length / L\n v = tuple.__new__(Vec2, (vx * s, vy * s))\n v.__dict__['length'] = length\n return v\n else:\n return null", "def set_...
[ "0.77442944", "0.7430787", "0.7194575", "0.68587714", "0.68575794", "0.68156165", "0.6623489", "0.6600609", "0.65837747", "0.6570955", "0.6444619", "0.6437355", "0.64120007", "0.6404811", "0.640123", "0.6383609", "0.635326", "0.6300103", "0.62531376", "0.62308013", "0.622835"...
0.60496014
29
Return a new vector scaled to length 1
def as_unit(self): new_vec = self.copy() new_vec.normalize() return new_vec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(self):\n\n if not self.magnitude():\n return Vector(0, 0)\n\n l = 1 / self.magnitude()\n return self.scale(l)", "def normalize(vec):\n return vec / length(vec)", "def scale_vector(vector, scale):\n return vector[0] * scale, vector[1] * scale, vector[2] * scal...
[ "0.7426879", "0.7182216", "0.710997", "0.6958416", "0.6950253", "0.68998533", "0.6878066", "0.68516815", "0.6815802", "0.6811957", "0.6793999", "0.67453915", "0.6744287", "0.67430806", "0.67178947", "0.6712777", "0.6695045", "0.6693023", "0.66873103", "0.66859657", "0.6663621...
0.6552616
29
Scale the length of a vector to 1 in place
def normalize(self): self.length = 1 return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_length(vec, length):\n return normalized(vec) * length", "def normalize(vec):\n return vec / length(vec)", "def scale_vector(vector, scale):\n return vector[0] * scale, vector[1] * scale, vector[2] * scale", "def normalize(my_vector):\n my_vector = np.array(my_vector)\n size = len(my_v...
[ "0.7467612", "0.73140836", "0.6707521", "0.6652634", "0.66203254", "0.66024446", "0.6574629", "0.65698516", "0.6554325", "0.653517", "0.6527413", "0.65133053", "0.65024126", "0.64943177", "0.6440622", "0.6412929", "0.6383797", "0.63803595", "0.6380222", "0.6373517", "0.637257...
0.6086795
61
Dot product with another vector
def dot(self, vec): if not isinstance(vec, self.__class__): raise TypeError('Dot product operand must be a vector') return np.dot(self, vec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_dot(x, y):\r\n return sum(a * b for a, b in zip(x, y))", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def vector_dot(v1,v2):\n return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z)", "def dot_vectors(u, v):\n return u[0] * v[0] + u[1] * v[1] + u[2] * v[2]", "def vector_dot(x, y...
[ "0.84114784", "0.8370339", "0.8312985", "0.8252795", "0.82379544", "0.81871724", "0.8158246", "0.8124765", "0.8099084", "0.80915284", "0.80833685", "0.8076896", "0.8073098", "0.8052451", "0.8004267", "0.79843235", "0.7978377", "0.79653734", "0.79561335", "0.7947022", "0.79171...
0.7872048
24
Cross product with another vector
def cross(self, vec): if not isinstance(vec, self.__class__): raise TypeError('Cross product operand must be a vector') return self.__class__(np.cross(self, vec))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_cross(a,b):\r\n return [a[1] * b[2] - a[2] * b[1],\r\n a[2] * b[0] - a[0] * b[2],\r\n a[0] * b[1] - a[1] * b[0]]", "def cross(a, b):\n #return np.cross(a,b)\n\n return vector(a[1] * b[2] - a[2] * b[1],\n a[2] * b[0] - a[0] * b[2],\n a[0] * b[1] -...
[ "0.82980907", "0.80877286", "0.8075184", "0.8032264", "0.7972077", "0.78874713", "0.767552", "0.7644994", "0.7639585", "0.7609759", "0.75847405", "0.757985", "0.7547088", "0.7539717", "0.75131726", "0.74963576", "0.74303275", "0.74278533", "0.740938", "0.73832923", "0.7371083...
0.76248705
9
Cross product with another vector
def cross(self, vec): if not isinstance(vec, self.__class__): raise TypeError('Cross product operand must be a vector') return Vector3(0, 0, np.asscalar(np.cross(self, vec)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_cross(a,b):\r\n return [a[1] * b[2] - a[2] * b[1],\r\n a[2] * b[0] - a[0] * b[2],\r\n a[0] * b[1] - a[1] * b[0]]", "def cross(a, b):\n #return np.cross(a,b)\n\n return vector(a[1] * b[2] - a[2] * b[1],\n a[2] * b[0] - a[0] * b[2],\n a[0] * b[1] -...
[ "0.82980907", "0.80877286", "0.8075184", "0.8032264", "0.7972077", "0.78874713", "0.767552", "0.7644994", "0.7639585", "0.76248705", "0.7609759", "0.75847405", "0.757985", "0.7547088", "0.7539717", "0.75131726", "0.74963576", "0.74278533", "0.740938", "0.73832923", "0.7371083...
0.74303275
17
Array of xcomponent of vectors
def x(self): return self[:, 0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xvec(self):\n return np.array([self.x, self.y])", "def cxvec(self):\n return np.array([self.cx, self.cy])", "def xvec(self):\n return self._xvec", "def x(self):\n return np.array([f.x for f in self])", "def vec_x(self):\t\r\n if self.ox != 0:\r\n ov = self.ox\r\n ...
[ "0.80955815", "0.7425456", "0.7356799", "0.72082627", "0.7117344", "0.691272", "0.6886437", "0.6758505", "0.67255855", "0.6695993", "0.668268", "0.65264815", "0.6520387", "0.6488766", "0.6482658", "0.64782196", "0.6469322", "0.6466881", "0.6448944", "0.6404482", "0.6368724", ...
0.63799113
20
Dot product with another vector
def dot(self, vec): if not isinstance(vec, self.__class__): raise TypeError('Dot product operand must be a VectorArray') if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV: raise ValueError('Dot product operands must have the same ' 'number of elem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_dot(x, y):\r\n return sum(a * b for a, b in zip(x, y))", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def vector_dot(v1,v2):\n return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z)", "def dot_vectors(u, v):\n return u[0] * v[0] + u[1] * v[1] + u[2] * v[2]", "def vector_dot(x, y...
[ "0.84114784", "0.8370339", "0.8312985", "0.8252795", "0.82379544", "0.81871724", "0.8158246", "0.8124765", "0.8099084", "0.80915284", "0.80833685", "0.8076896", "0.8073098", "0.8052451", "0.8004267", "0.79843235", "0.7978377", "0.79653734", "0.79561335", "0.7947022", "0.79171...
0.78021836
27
Array of zcomponent of vectors
def z(self): return self[:, 2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def z(self) -> np.ndarray:\n return self.array[:, 3] if self.scalar_vector else self.array[:, 2]", "def xyz(self) -> np.ndarray:\n return np.vstack((self.x, self.y, self.z)).transpose()", "def vec_z(self):\t\t\t\r\n if self.oz != 0:\r\n ov = self.oz\r\n lv = self.self...
[ "0.716169", "0.7160589", "0.6992732", "0.6853463", "0.6837109", "0.67867416", "0.66722864", "0.6588775", "0.6565816", "0.6546007", "0.64006174", "0.6399083", "0.63821363", "0.63726604", "0.6362815", "0.63352334", "0.6312388", "0.6282767", "0.6248066", "0.62354994", "0.620558"...
0.6116441
27
Cross product with another Vector3Array
def cross(self, vec): if not isinstance(vec, Vector3Array): raise TypeError('Cross product operand must be a Vector3Array') if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV: raise ValueError('Cross product operands must have the same ' 'number of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_cross(a,b):\r\n return [a[1] * b[2] - a[2] * b[1],\r\n a[2] * b[0] - a[0] * b[2],\r\n a[0] * b[1] - a[1] * b[0]]", "def cross(a, b):\n c1 = a[1]*b[2] - a[2]*b[1]\n c2 = a[2]*b[0] - a[0]*b[2]\n c3 = a[0]*b[1] - a[1]*b[0]\n return sp.array([c1,c2,c3])", "def vector_cross(x,...
[ "0.76396585", "0.74744123", "0.74641216", "0.73626417", "0.73106533", "0.72694576", "0.7265427", "0.72172326", "0.7197437", "0.71638966", "0.71430933", "0.70918113", "0.7086664", "0.7053635", "0.7050044", "0.69422406", "0.6877302", "0.68488723", "0.6847359", "0.68236625", "0....
0.71729565
9
Converts an email into an obfuscated email. So abcdefgh123.com becomes ef3.com
def _UnicornObfuscated(self, text): obfuscated = '' separator = text.find('@') for i in range(separator-1): if i in [4, 5]: obfuscated += text[i] else: obfuscated += '*' obfuscated += text[separator-1:] return obfuscated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_email(email):\n return", "def clean_email(email: str):\n return email.lower()", "def fromemail(cls, email):\n m = md5.new()\n m.update(email.strip().lower())\n usermd5 = str(m.hexdigest())\n return cls.frommd5(usermd5)", "def parse_email(self, email):\r\n i...
[ "0.73700655", "0.712587", "0.7081213", "0.704006", "0.6922802", "0.6825111", "0.6780017", "0.671532", "0.6640984", "0.65960854", "0.65742886", "0.65631074", "0.6529898", "0.6503203", "0.64822835", "0.6354908", "0.6267966", "0.6250751", "0.6240803", "0.62321573", "0.621085", ...
0.6070228
30
Reshape signal to the desired size
def _asarray(source, size): noise = source() if size is None: return noise.next() #count = reduce(operator.mul, shape) return numpy.asarray([noise.next() for _ in range(size)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconstruct_signal(_X):\n width = _X.shape[1]\n N = _X.shape[0]\n n = N // 2\n\n head = _X[:n, 0]\n tail = _X[n:, width - 1]\n body = np.array([_X[n:, i] + _X[:n, i + 1] for i in range(width - 1)]).reshape(n * (width - 1))\n\n return np.append(head, np.append(bo...
[ "0.66626436", "0.6444748", "0.6112346", "0.6006955", "0.59729326", "0.59283286", "0.58972627", "0.58670235", "0.5855759", "0.5816633", "0.57783645", "0.57038754", "0.56766605", "0.56328136", "0.55807316", "0.5571709", "0.5535998", "0.55073535", "0.54593647", "0.54493904", "0....
0.0
-1
Add a fulfillment origin to the manager.
def add_origin(self, origin_id): if origin_id not in self.origin_queue_lookup: self.origin_queue_lookup[origin_id] = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_origin(self, account_id, media_type, origin_url, cname=None,\r\n secure=False):\r\n\r\n config = {'mediaType': media_type,\r\n 'originUrl': origin_url,\r\n 'isSecureContent': secure}\r\n\r\n if cname:\r\n config['cname'] = cname\r...
[ "0.6065946", "0.566655", "0.52984977", "0.5243545", "0.52161616", "0.5199521", "0.5179164", "0.5152549", "0.5106218", "0.5106009", "0.5103952", "0.50528055", "0.50513965", "0.50425154", "0.5032722", "0.5004059", "0.49902546", "0.49739656", "0.49731258", "0.49451202", "0.49348...
0.6080434
0
Get the top `CustomerOrder` objects in the queue. Only the first k orders in the queue will be returned. The value of k depends on `min_quantity_sum` and `min_order_count`. If there is not enough orders in the queue that could meet these two requirements, all orders will be returned.
def peek_order_queue_content(self, origin_id, min_quantity_sum, min_order_count): assert origin_id in self.origin_queue_lookup, 'origin does not exist' order_quantity_sum = 0 peek_orders, head = [], self.origin_queue_lookup[origin_id] while head is not None and (order_quantity_sum < min_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_k(self, k):\n with self.mutating:\n topk = heapq.nsmallest(k, self.queue)\n return topk", "def aggregate_order(self, customer: str, max_items_quantity: int, max_volume: int):\n items = []\n # collect items to the order here\n for i in self.order_items:\n ...
[ "0.61532", "0.57301444", "0.5709336", "0.5652294", "0.5529736", "0.5441161", "0.5376192", "0.529414", "0.5234629", "0.5225866", "0.5221205", "0.51879925", "0.5126749", "0.50780416", "0.5046578", "0.49981755", "0.49418533", "0.49357355", "0.4888696", "0.48823485", "0.48494214"...
0.5750303
1
Initialize a linked list.
def __init__(self, items: Optional[Sequence] = None, first: Optional[_Node] = None) -> None: self._first = first self._length = 0 if items: for item in items: self.append(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, lst=[]):\n self.__length = 0 # current length of the linked list\n self.__head = None # pointer to the first node in the list\n for e in lst: # initialize the list,\n self.add(e) # by adding elements one by one", "def __init__(self):\n node = ListNode...
[ "0.79075426", "0.7821055", "0.7547748", "0.7539187", "0.7428291", "0.74235463", "0.738813", "0.734946", "0.73396826", "0.7320073", "0.72963786", "0.72924286", "0.723714", "0.72336364", "0.72336364", "0.72336364", "0.72336364", "0.72336364", "0.72168773", "0.7205219", "0.71946...
0.0
-1
Append item to the end of this list.
def append(self, item: Any) -> None: new_node = _Node(item) if self._first is None: self._first = new_node else: curr = self._first while curr.next is not None: curr = curr.next curr.next = new_node self._length += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, item):\n self.update([item])", "def append(self, item):\n self.items.append(item)", "def append(self, item):\n\n items = self.list\n items.append(item)\n self.value = self.__class__.SEPARATOR.join(items)", "def append(self, item):\n # type: (Any) -> ...
[ "0.8455086", "0.83840805", "0.8229708", "0.8164659", "0.79020834", "0.78880537", "0.78721875", "0.7800917", "0.77997375", "0.77896994", "0.77554494", "0.77500236", "0.77468985", "0.7701985", "0.76822895", "0.7678969", "0.7606199", "0.758863", "0.758863", "0.7574229", "0.75177...
0.7458994
23
Return whether item is in this linked list.
def __contains__(self, item: Any) -> bool: curr = self._first while curr is not None: if curr.item == item: return True curr = curr.next return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, item):\n cur_node = self.head\n while cur_node is not None:\n if item in cur_node.data_list:\n return True\n else:\n cur_node = cur_node.next_node\n\n return False", "def isin(self, item):\n return self.get(ite...
[ "0.8340625", "0.7994819", "0.7604664", "0.7604664", "0.7490998", "0.7457284", "0.7349588", "0.7321821", "0.72691965", "0.72691154", "0.7261604", "0.72370934", "0.7208031", "0.7192644", "0.71884876", "0.71758896", "0.7132597", "0.71148264", "0.7099272", "0.70910555", "0.708770...
0.79323184
2
Return the item stored at index i in this linked list.
def __getitem__(self, i: Union[int, slice]) -> Union[Any, LinkedList]: if isinstance(i, int): if i < 0: i = self._length + i curr = self._first curr_index = 0 while curr is not None and curr_index != i: curr = curr.next ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_at_index(self, index):\n if index < 0 or index >= self.size:\n return -1\n\n if self.head is None:\n return -1\n\n curr = self.head\n for i in range(index):\n curr = curr.next\n return curr.val", "def __getitem__(self,i):\n retur...
[ "0.78084004", "0.76385605", "0.7583851", "0.75316495", "0.75256145", "0.74873406", "0.7422859", "0.7369529", "0.73593074", "0.7316032", "0.7211319", "0.7203051", "0.7155296", "0.7139868", "0.7107851", "0.7089815", "0.7087973", "0.70856994", "0.7019003", "0.7015427", "0.700352...
0.68574286
28
Return whether this list and the other list are equal.
def __eq__(self, other: LinkedList) -> bool: curr1 = self._first curr2 = other._first are_equal = True while are_equal and curr1 is not None and curr2 is not None: if curr1.item != curr2.item: are_equal = False curr1 = curr1.next curr2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_same(lst1, lst2):\n return len(lst1) == len(lst2) and all([x == y for x, y in zip(lst1, lst2)])", "def __eq__(self, other):\n\t\treturn (self.srcList == other.srcList) and (self.tgtList == other.tgtList)", "def __eq__(self, other):\r\n\t\treturn self._to_pylist() == other._to_pylist()", "def __eq...
[ "0.7958678", "0.79376346", "0.7917889", "0.7682686", "0.76320934", "0.7594405", "0.75835276", "0.75491947", "0.7534419", "0.75205344", "0.7504157", "0.74678844", "0.7444505", "0.74173194", "0.74167836", "0.7412245", "0.73959893", "0.7377191", "0.7363334", "0.73585206", "0.734...
0.77199274
3
Return a string representation of this list.
def __str__(self) -> str: return '[' + ' -> '.join([str(element) for element in self]) + ']'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.list)", "def __str__(self):\n return list.__str__(self)", "def __str__(self):\n list_string = \"\"\n for item in self._data:\n list_string += item + \", \"\n return list_string", "def __repr__(self) -> str:\n items = li...
[ "0.8396696", "0.83599466", "0.8302863", "0.8072747", "0.7987886", "0.7917348", "0.7906566", "0.7906566", "0.78887373", "0.7884145", "0.787884", "0.7874975", "0.78689", "0.785217", "0.7841869", "0.78328615", "0.7790195", "0.7739245", "0.7699023", "0.76971346", "0.76892304", ...
0.0
-1
Return the index of the first occurrence of the given item in this list.
def index(self, item: Any) -> int: index_so_far = 0 curr = self._first while curr is not None: if curr.item == item: return index_so_far index_so_far += 1 curr = curr.next raise ValueError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_indx(self, item):\n for i, s in enumerate(self._data):\n if item in s:\n return i\n return None", "def index(self, item):\n \n pos = 0\n current = self.head\n \n while current is not None:\n if current.get_data() == ite...
[ "0.78569245", "0.775842", "0.7614572", "0.76030165", "0.75487953", "0.73324394", "0.73231477", "0.73199826", "0.7229823", "0.71798074", "0.71236086", "0.7112841", "0.70924884", "0.70874745", "0.7064689", "0.6836819", "0.68299496", "0.672968", "0.6711308", "0.6710089", "0.6680...
0.83280736
0
Extend self by other linked list
def extend(self, other: LinkedList) -> None: copy = self.copy() curr = other._first while curr is not None: copy.append(curr.item) curr = curr.next self._first = copy._first
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other):\n if not isinstance(other, UnrolledLinkedList):\n raise TypeError(\"Can only add object of type UnrolledLinkedList\")\n\n # Copy the current list and add the contents of other to it\n new_list1 = deepcopy(self)\n for x in other:\n new_list...
[ "0.70469695", "0.6918109", "0.69040376", "0.68296075", "0.6701116", "0.6588985", "0.65658045", "0.6511483", "0.6506751", "0.65052944", "0.6481023", "0.64465046", "0.63940114", "0.63577956", "0.63431144", "0.6281388", "0.6236402", "0.62271035", "0.6226492", "0.6200078", "0.615...
0.8274453
0
Return the index of the minimum item
def indexOfMin(lyst): minIndex =0 currentIndex=1 while currentIndex< len(lyst): if lyst(currentIndex)<lyst(minIndex): minIndex=currentIndex currentIndex+=1 return minIndex
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __idx_of_minimum(cls, lst: list) -> int:\n\t\treturn lst.index(min(lst))", "def imin(self):\n return self.index(min(self))", "def minimum_index(self):\n return self._minidx", "def index_of_min(deck, firstIndex):\n return deck.index(np.min(deck[firstIndex:]))", "def min_index(self):\n ...
[ "0.8497552", "0.8476642", "0.8149394", "0.78183985", "0.78017116", "0.7753437", "0.77114135", "0.770127", "0.7571998", "0.7561133", "0.7552304", "0.7489492", "0.7489492", "0.74340045", "0.74201", "0.7347685", "0.7342302", "0.7336748", "0.7250572", "0.72392625", "0.7190694", ...
0.76262635
8
Generator function that yields rows as lists of values from the TSV.
def generate_tsv_rows(input_path): with open(str(input_path)) as fin: for raw_line in fin: yield raw_line.rstrip('\r\n').split('\t')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rows(self):\n with self.input().open('r') as fobj:\n for line in fobj:\n yield line.strip('\\n').split('\\t')", "def iterate_tsv_rows(file_path):\n with open(file_path, newline=\"\") as csv_fd:\n reader = csv.reader(csv_fd, delimiter=\"\\t\", quotechar='\"')\n ...
[ "0.7218706", "0.70397586", "0.65978557", "0.6547311", "0.65242463", "0.6355619", "0.6306163", "0.630094", "0.6204837", "0.619339", "0.6186118", "0.61788505", "0.61711544", "0.61693", "0.6139891", "0.61161697", "0.60954905", "0.60867953", "0.607653", "0.607653", "0.607653", ...
0.70905125
1
If no match is found, None is returned.
def test_no_match(self): non_existing_char = "q" s = "abcdef" self.assertEqual(__, re.match(non_existing_char, s)) # You can also test for False self.assertEqual(__, self._truth_value(re.match(non_existing_char, s)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_match_result(self, variable):\n try:\n return self._match_result_dict[variable]\n except KeyError:\n return None", "def _find_first(self, ast, label):\n res = self._find_all(ast, label, max_results=1)\n if len(res):\n return res[0]\n ret...
[ "0.71160364", "0.66624403", "0.6632123", "0.6621112", "0.66005296", "0.6592382", "0.6575485", "0.64349484", "0.6431345", "0.6377173", "0.6366413", "0.62752914", "0.6266844", "0.61672664", "0.6120795", "0.61185676", "0.6056555", "0.6037484", "0.6024403", "0.6004679", "0.599510...
0.0
-1
The pattern must match at the beggining of the string. If no match is found, None is returned.
def test_match_must_start_at_the_beginning(self): third_letter = "c" s = "abcdef" self.assertEqual(__, re.match(third_letter, s))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search_finds_first_match_of_pattern_in_string(self):\n pattern = \"a\"\n s = \"abcdefabcdef\"\n self.assertEqual(__, re.search(pattern, s).group())", "def test_search_must_not_start_at_the_beginning(self):\n pattern = \"cde\"\n s = \"abcdefabcdef\"\n self.assert...
[ "0.7122263", "0.68367726", "0.6835779", "0.6669322", "0.6593207", "0.65503395", "0.64866424", "0.63728267", "0.62828875", "0.6212825", "0.61911297", "0.6067129", "0.6064648", "0.6020544", "0.6020544", "0.6015649", "0.59810245", "0.59600544", "0.5927406", "0.59180105", "0.5916...
0.6568497
5
Create a new comment or update existing one.
def create_or_update_comment(comment, message, repo, pr_number, token): # repo is in the form of "org/repo" if comment is not None: print("updating existing comment") # API doc: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment # noqa response...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def createComment(self, *args, **kwargs):\n\n return await self._makeApiCall(self.funcinfo[\"createComment\"], *args, **kwargs)", "def new_comment(comment):\n attribute_state = inspect(comment).attrs.get('comment')\n # Check if the speaker has been updated\n history = attribute_state.histor...
[ "0.7175699", "0.70086664", "0.6955866", "0.6840377", "0.6840377", "0.683977", "0.6809509", "0.6748361", "0.6736023", "0.6651328", "0.6625012", "0.6620503", "0.66044897", "0.6597408", "0.6563185", "0.65545994", "0.6540747", "0.65214944", "0.65139955", "0.65037155", "0.64994943...
0.7500642
0
Returns array of the float values for the respective features (noun, verb, adjective, adverb)
def get_sentiments(self, d): words = tuple(d.split()) tagged = nltk.pos_tag(words) nouns = 0 adjectives = 0 verbs = 0 adverbs = 0 for word, pos_tag in tagged: if pos_tag.startswith("NN"): nouns += 1 if pos_tag.startswith("JJ"): adjectives += 1 if pos_tag.startswith("VB"): verbs +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feature_names(self):\n\t\treturn np.array(['nouns', 'adjectives', 'verbs', 'adverbs'])", "def feature_values(words, word_features):\r\n freq = nltk.FreqDist(words)\r\n values = []\r\n for wf in word_features:\r\n if wf in freq:\r\n values.append(freq[wf])\r\n else:\r\n ...
[ "0.6969363", "0.65727943", "0.635599", "0.63235104", "0.6305985", "0.6294422", "0.62810814", "0.61793774", "0.6171346", "0.6100987", "0.5977355", "0.5969008", "0.59666085", "0.5951879", "0.5906512", "0.58959156", "0.5893184", "0.58583623", "0.5834025", "0.5823956", "0.5816947...
0.0
-1
Returns the number of seconds represented by this instance
def to_seconds(self): return self.hours * 3600 + self.minutes * 60 + self.seconds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seconds(self):\n return int(self)", "def seconds(self):\n return self._seconds", "def seconds(self):\n return self._seconds", "def seconds(self):\n end = self.end or timezone.now()\n result = end - self.start\n return result.seconds", "def total_seconds(self):\...
[ "0.8999903", "0.8640881", "0.8640881", "0.8366317", "0.81897897", "0.7966761", "0.79462713", "0.79159373", "0.7903587", "0.78858465", "0.7743835", "0.77131283", "0.7602154", "0.7556338", "0.7509726", "0.74747944", "0.7427843", "0.7420763", "0.74206126", "0.7407542", "0.738628...
0.7476836
15
Return True if I am strictly greater than time2
def after(self, time2): return self.to_seconds() > time2.to_seconds()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after(self, time2):\r\n return self.to_seconds() > time2.to_seconds()", "def __gt__(self, other):\n return self.to_seconds() > other.to_seconds()", "def __gt__(self, other):\n return self.to_seconds() > other.to_seconds()", "def time_after(time_a, time_b=None) -> bool:\n if time_b...
[ "0.79350674", "0.74561685", "0.74561685", "0.71893257", "0.7069949", "0.7009619", "0.6986477", "0.68569267", "0.6852629", "0.6822306", "0.6813152", "0.67448246", "0.6632621", "0.65944445", "0.65576726", "0.6427953", "0.6314551", "0.6311035", "0.629302", "0.6284926", "0.627579...
0.78432876
1
add times using only seconds by to_seconds method. Due to how __init__ method is written, if seconds are higher than 59, it automatically converts it to standard time units
def __add__(self, other): return MyTime(0,0,self.to_seconds() + other.to_seconds())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment_seconds(self, seconds):\n return MyTime(0,0,self.to_seconds()+seconds)", "def to_seconds(hours, minutes, seconds):\n return hours*60**2 + minutes*60 + seconds", "def to_seconds(hours, minutes, seconds):\n return hours*3600+minutes*60+seconds", "def to_seconds(hours,minutes,seconds)...
[ "0.7420323", "0.71507484", "0.7036912", "0.7020733", "0.6750954", "0.6674788", "0.66073924", "0.6596384", "0.6435608", "0.63432765", "0.6341828", "0.6341474", "0.6333052", "0.6319802", "0.63154054", "0.63109154", "0.630273", "0.62995595", "0.6289077", "0.6283877", "0.6281663"...
0.64316493
9