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
r""" A util function to assert equality between DataFrame schemas `actual` and `expected`.
def assertSchemaEqual(actual: StructType, expected: StructType): if not isinstance(actual, StructType): raise PySparkAssertionError( error_class="UNSUPPORTED_DATA_TYPE", message_parameters={"data_type": type(actual)}, ) if not isinstance(expected, StructType): rai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_frame_equal(*args, **kwargs):\n return pandas.testing.assert_frame_equal(*args, **kwargs)", "def assertDataFrameEqual(\n actual: Union[DataFrame, \"pandas.DataFrame\", \"pyspark.pandas.DataFrame\", List[Row]],\n expected: Union[DataFrame, \"pandas.DataFrame\", \"pyspark.pandas.DataFrame\", Li...
[ "0.76983297", "0.73875946", "0.73732233", "0.7292583", "0.7259319", "0.6952309", "0.6891865", "0.676894", "0.675779", "0.67065775", "0.66105354", "0.6542659", "0.6516614", "0.64949", "0.6438868", "0.6395335", "0.6391977", "0.63785875", "0.63687503", "0.63269514", "0.6319671",...
0.7725539
0
r""" A util function to assert equality between `actual` and `expected` (DataFrames or lists of Rows), with optional parameters `checkRowOrder`, `rtol`, and `atol`. Supports Spark, Spark Connect, pandas, and pandasonSpark DataFrames. For more information about pandasonSpark DataFrame equality, see the docs for `assertP...
def assertDataFrameEqual( actual: Union[DataFrame, "pandas.DataFrame", "pyspark.pandas.DataFrame", List[Row]], expected: Union[DataFrame, "pandas.DataFrame", "pyspark.pandas.DataFrame", List[Row]], checkRowOrder: bool = False, rtol: float = 1e-5, atol: float = 1e-8, ): if actual is None and expe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compare_tables(expected_table, actual_table):\n\n expected_num_rows = len(expected_table.index)\n actual_num_rows = len(actual_table.index)\n if expected_num_rows != actual_num_rows:\n return False\n\n expected_column_names = list(expected_table)\n actual_column_names = list(actual_table...
[ "0.69159925", "0.6901112", "0.68442774", "0.6634684", "0.65648437", "0.65572244", "0.6544937", "0.6445347", "0.63448954", "0.6335299", "0.62914133", "0.6286389", "0.6203698", "0.6195336", "0.61271876", "0.60658383", "0.6018451", "0.5992225", "0.59762865", "0.5937835", "0.5916...
0.8470979
0
Compute the area of a circle.
def area_circle(radius): pi = 3.1459 area = pi * radius * radius return area
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circle_area(circle):\n return pi * circle.radius * circle.radius", "def area_of_circle(radius):\n return radius", "def area(self):\n\t\t#print (self.radius*self.radius*math.pi)\n\t\tcircle_area = (self.radius*self.radius*math.pi)\n\t\treturn circle_area", "def circle_area(radius):\n area = radiu...
[ "0.88504136", "0.85048157", "0.85001105", "0.8386002", "0.83100843", "0.8227617", "0.8169852", "0.8162947", "0.811259", "0.811259", "0.80413824", "0.8018954", "0.7989672", "0.7985272", "0.7985272", "0.7925053", "0.790935", "0.7903146", "0.7883748", "0.7854282", "0.77885884", ...
0.8264187
5
Determines if a number is prime or not Assumes number >= 2.
def is_prime(number): if number <=3: return True for i in range(2, number): if number % i == 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime(number):\n\t\n\tif number < 2: return False\n\telif number == 2: return True\n\telif number % 2 == 0: return False\n\telse:\n\t\tfor x in range(2, number):\n\t\t\tif number % x == 0:\n\t\t\t\treturn False\n\t\telse:\n\t\t\treturn True", "def is_prime(number):\n if number == 2:\n return Tru...
[ "0.8489698", "0.83052456", "0.82943106", "0.8213757", "0.8149834", "0.8135847", "0.81108284", "0.81106746", "0.81100315", "0.8079408", "0.8075915", "0.80657643", "0.8062846", "0.80615866", "0.80513763", "0.8051195", "0.80415773", "0.8012108", "0.7976685", "0.7965905", "0.7959...
0.81217796
6
Returns a list of all the prime numbers up to some point.
def find_primes_up_to(up_to=100): primes = [] for i in range(2, up_to + 1): if is_prime(i): primes.append(i) return primes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes(n):\n result = []\n i = 2\n while n > 0:\n if isPrime(i):\n result += [i]\n n -= 1\n i += 1\n return result", "def primes(n):\n return [i for i, v in enumerate(prime_cache(n)) if v]", "def allprimes():\n\n key = [] ...
[ "0.7541519", "0.7422097", "0.74013466", "0.7386543", "0.7381085", "0.7351718", "0.7328013", "0.7320042", "0.73178786", "0.730062", "0.72995716", "0.72492504", "0.7247809", "0.72209156", "0.72175145", "0.7160399", "0.7154014", "0.71406513", "0.71346384", "0.7105755", "0.710436...
0.7662729
0
test unauthorized updating of an article
def test_unauthorized_update_article(self): response = self.client.put( reverse( "article", kwargs={ "slug": self.stored_articles[0].slug }), self.article_data, content_type='application/json', ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_by_non_owner(self):\n # User 1\n saved1 = self.create_article()\n article_url = saved1[0]\n # get user2 details\n token = self.create_article_user2()\n response = self.test_client.put(article_url,self.article_update_data, format='json', HTTP_AUTHORIZATION=t...
[ "0.82482296", "0.7753639", "0.774073", "0.76733994", "0.7619352", "0.7618392", "0.74182343", "0.7311979", "0.7310526", "0.7160378", "0.7158078", "0.71107006", "0.7110057", "0.7068463", "0.7053723", "0.70387393", "0.7034788", "0.6986374", "0.69689155", "0.696123", "0.6958695",...
0.847877
0
Escape string if it needed
def escape_if_needed(text, options): if hasattr(text, '__html__'): # Text has escape itself: return to_string(text.__html__()) if need_to_escape(options): return escape(to_string(text)) return to_string(text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def escape_string(text):\n return escape(text)", "def _escapeString(self, value):\n if '\"' in value and \"'\" in value:\n substrings = value.split(\"\\\"\")\n result = [\"concat(\"]\n for substring in substrings:\n result.append(\"\\\"%s\\\"\" % substrin...
[ "0.7720622", "0.734751", "0.72297686", "0.715109", "0.7141102", "0.713001", "0.71193695", "0.70924956", "0.70805585", "0.7066848", "0.7053307", "0.7052727", "0.7048034", "0.7025315", "0.6966079", "0.6952095", "0.69413227", "0.691578", "0.6883722", "0.6872962", "0.6847334", ...
0.62162924
69
Returns the string uniquely identifying the objects supported by this adapter.
def GetKind(self): return self._persistentHandler.GetKind()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\r\n\r\n return 'v{} ({} objects)'.format(self.get_version(), len(self.objects))", "def id_str(self):\n if hasattr(self, 'id'):\n return str(self.id)\n else:\n return 'obj%s' % id(self)", "def key(self) -> str:\n return f\"{self.model.__module...
[ "0.6308345", "0.5993113", "0.5831586", "0.58136255", "0.57996637", "0.5786493", "0.5757091", "0.57227117", "0.5686962", "0.5657973", "0.5656497", "0.5644706", "0.56261927", "0.55964285", "0.55956435", "0.55956435", "0.55956435", "0.5589599", "0.5574854", "0.55719423", "0.5571...
0.0
-1
Adds a name to the ``BAD_DEFAULT_NAMES`` constant.
def AddBadDefaultName(self, name): global BAD_DEFAULT_NAMES BAD_DEFAULT_NAMES.append(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDefaultName(self): # real signature unknown; restored from __doc__\n pass", "def add_name(self, name: str) -> None:\n self._names.append(name)", "def test_bad_names(self):\n self.do_test_bad_name('', 'tmp/frog')\n self.do_test_bad_name('.b', 'tmp/frog')\n self.do_test_...
[ "0.59021527", "0.5378136", "0.5306618", "0.52976656", "0.52873755", "0.5273112", "0.5210146", "0.518594", "0.5145325", "0.51442534", "0.51395917", "0.5127722", "0.5116573", "0.5061738", "0.50417435", "0.50306684", "0.50078964", "0.49940425", "0.49924943", "0.49736753", "0.495...
0.86145234
0
Create gaussian random neurons with mean 0 and std 0.1 Paramters
def create_weight_variables(shape, seed, name, use_gpu=False): #import ipdb; ipdb.set_trace() if len(shape) == 4: in_out = shape[0] * shape[1] * shape[2] + shape[3] else: in_out = shape[0] + shape[1] import math stddev = math.sqrt(3.0 / in_out) # XAVIER INITIALIZER (GAUSSIAN) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian_noise(shape, mean, std):\n return tf.random.normal(shape=shape, mean=mean, stddev=std, dtype=tf.float32)", "def convert_gaussian_random(g, op, block):\n\n mean = op.attr(\"mean\")\n std = op.attr(\"std\")\n shape = op.attr(\"shape\")\n seed = op.attr(\"seed\")\n dtype = op.attr(\"d...
[ "0.7242885", "0.70618623", "0.7009105", "0.69712627", "0.69441926", "0.6901758", "0.6845194", "0.6832439", "0.6757164", "0.6742909", "0.6687057", "0.6656068", "0.65831083", "0.655626", "0.655626", "0.6539461", "0.65062827", "0.6494746", "0.64495975", "0.643922", "0.64358133",...
0.0
-1
Create the Sigmoid activations
def create_sigmoid(x, bias): return tf.nn.sigmoid(tf.nn.bias_add(x, bias))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(X,W,b):\n preActivation = np.dot(X, W) + b\n return (1.0)/(1.0 + np.exp(-preActivation))", "def test_sigmoid_activation(self):\n self.assertEqual([0.5, 0.5], list(\n af.Sigmoid().output(np.array([0, 0]))))\n self.assertEqual([0.25, 0.25], list(\n af.Sigmoid()...
[ "0.7342629", "0.71994466", "0.7126781", "0.70241576", "0.7006406", "0.69733554", "0.6897453", "0.6887438", "0.682553", "0.67981684", "0.67945796", "0.67911595", "0.6777103", "0.67690724", "0.67690724", "0.6767741", "0.67479026", "0.67454016", "0.67336917", "0.6723501", "0.672...
0.66957223
29
Load a dataset from a pseudoJSON format into a dataframe using regular expressions.
def load_dataset(path: str) -> pd.DataFrame: with open(path) as f: data = [] problems = 0 for line_num, line in enumerate(f): try: # replace ' around keys/values with " cleaned_line = re.sub(r"(?<={|\s)'|'(?=,|:|})", '"', line) # re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pandas(data: str) -> pandas.DataFrame:\n src = json.loads(data)\n if isinstance(src, list): # list of row dicts\n return pandas.DataFrame.from_records(src)\n if 'instances' in src: # TF serving's \"instances\" format\n return pandas.DataFrame.from_records(src['in...
[ "0.65512294", "0.64251316", "0.63482034", "0.626196", "0.6242598", "0.62420356", "0.6228313", "0.6217159", "0.61914164", "0.61044127", "0.60880584", "0.602224", "0.5987146", "0.5970327", "0.59500456", "0.5946346", "0.59037405", "0.58589023", "0.58433455", "0.583905", "0.57889...
0.707326
0
Test whether simple language assignments work.
def test_default_language(self): with translation.override("ca-fr"): x = SimpleModel( id=99 ) # uses get_language(), ID is to avoid reading cached items for 'en' self.assertEqual(x.get_current_language(), translation.get_language()) self.assertEqu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testCheck(self):\r\n from pydsl.Check import PLYChecker\r\n from pydsl.contrib.grammar import example_ply\r\n from pydsl.Grammar.Definition import PLYGrammar\r\n grammardef = PLYGrammar(example_ply)\r\n checker = PLYChecker(grammardef)\r\n self.assertTrue(checker.check...
[ "0.6310641", "0.6060468", "0.599178", "0.56740606", "0.56232727", "0.5611379", "0.55829835", "0.5528159", "0.5500011", "0.5457057", "0.54499966", "0.54244083", "0.5416987", "0.53762317", "0.53744453", "0.5359855", "0.53310466", "0.5323407", "0.5316347", "0.53136516", "0.53128...
0.0
-1
Test whether the fallback language will be returned.
def test_fallback_language(self): x = SimpleModel() x.set_current_language(self.conf_fallback) x.tr_title = "TITLE_FALLBACK" x.set_current_language(self.other_lang1) x.tr_title = "TITLE_XX" x.save() with translation.override(self.other_lang2): x = Si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fallback_language_no_current(self):\n x = SimpleModel()\n x.set_current_language(self.conf_fallback)\n x.tr_title = \"TITLE_FALLBACK\"\n\n self.assertEqual(\n x.safe_translation_getter(\"tr_title\", language_code=self.other_lang1), \"TITLE_FALLBACK\"\n )", "...
[ "0.6848912", "0.68328774", "0.6577089", "0.6419347", "0.63697207", "0.6334066", "0.63288254", "0.62855226", "0.6222532", "0.621996", "0.61875546", "0.61556274", "0.6140968", "0.6094647", "0.6042376", "0.60421646", "0.60056376", "0.60056376", "0.5968734", "0.5946268", "0.59452...
0.6194439
10
Test whether the fallback language will be returned, even when the current language does not have a translation.
def test_fallback_language_no_current(self): x = SimpleModel() x.set_current_language(self.conf_fallback) x.tr_title = "TITLE_FALLBACK" self.assertEqual( x.safe_translation_getter("tr_title", language_code=self.other_lang1), "TITLE_FALLBACK" )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fallback_trans(x):\r\n t = _(x)\r\n if t == x:\r\n l = h.get_lang()\r\n h.set_lang('en', graceful_fail = True)\r\n t = _(x)\r\n if l and l[0] != 'en':\r\n h.set_lang(l[0])\r\n return t", "def test_fallback_language(self):\n x = SimpleModel()\n x.s...
[ "0.68344426", "0.6577702", "0.6505614", "0.64714944", "0.6422906", "0.6281233", "0.6223175", "0.6146871", "0.6022335", "0.5994682", "0.59941596", "0.5975893", "0.59654105", "0.5961348", "0.59572476", "0.5945812", "0.5936099", "0.59205437", "0.5916614", "0.5916575", "0.5916294...
0.7377528
0
Test whether a failure in the fallback language can return any saved language (if configured for it).
def test_any_fallback_model(self): x = AnyLanguageModel() x.set_current_language(self.other_lang1) x.tr_title = "TITLE_XX" x.save() with translation.override(self.other_lang2): x = AnyLanguageModel.objects.get(pk=x.pk) self.assertRaises( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fallback_language_no_current(self):\n x = SimpleModel()\n x.set_current_language(self.conf_fallback)\n x.tr_title = \"TITLE_FALLBACK\"\n\n self.assertEqual(\n x.safe_translation_getter(\"tr_title\", language_code=self.other_lang1), \"TITLE_FALLBACK\"\n )", "...
[ "0.7212526", "0.6849443", "0.6600157", "0.6560149", "0.6535749", "0.64586776", "0.64235204", "0.6392549", "0.6263481", "0.62573576", "0.6206418", "0.6178404", "0.61254287", "0.60736537", "0.6070547", "0.6039757", "0.6025215", "0.6023762", "0.5987965", "0.594508", "0.5931846",...
0.68017066
2
Create a new point at the given coordinates.
def __init__(self, initX, initY): self.x = initX self.y = initY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_point(self, coords, **options):\n\n if 'fill' not in options:\n options['fill'] = self.variables.foreground_color\n\n x1, y1 = (coords[0] - self.variables.point_size), (coords[1] - self.variables.point_size)\n x2, y2 = (coords[0] + self.variables.point_size), (coords[...
[ "0.7404491", "0.7181391", "0.71479046", "0.71479046", "0.7141722", "0.6773949", "0.67493427", "0.650266", "0.6469327", "0.64393455", "0.6358204", "0.63443464", "0.6252241", "0.62502253", "0.6229518", "0.62291485", "0.6227966", "0.6197312", "0.61617047", "0.61275893", "0.60861...
0.0
-1
Extract the sender's user name (along with domain) from a message.
def get_sender_username(self, mess): jid = mess.getFrom() typ = mess.getType() username = jid.getNode() domain = jid.getDomain() if typ == "chat": return "%s@%s" %(username, domain) else: return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sender_email(message):\r\n message_headers = message['payload']['headers']\r\n for header in message_headers:\r\n if header['name'] == 'From':\r\n return header['value']", "def extract_sender(emailstr):\n msg = email.message_from_string(emailstr)\n sender = msg['From']\n ...
[ "0.71224266", "0.670886", "0.6625382", "0.64819384", "0.6446587", "0.6266081", "0.6256763", "0.6192217", "0.61241996", "0.60984236", "0.60064584", "0.59985036", "0.5958869", "0.5958743", "0.5937346", "0.58827424", "0.5855", "0.5834904", "0.5834348", "0.5829208", "0.58213013",...
0.7252869
0
GIVEN association_schemas, schemas and expected schemas WHEN _combine_defined_expected_schemas is called with the association_schemas and schemas THEN the expected schemas are returned.
def test_(association_schemas, schemas, expected_schemas): returned_schemas = association._combine_defined_expected_schemas( association_schemas=association_schemas, schemas=schemas ) assert list(returned_schemas) == expected_schemas
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_compare_schemas_happypath(self):\n status = schema_utils.compare_schemas(\n self.base_schema,\n self.base_schema\n )\n\n assert status == schema_utils.Update.no_update", "def test_get_supported_schemas(self):\n supported_schemas = modelprop.get_supported...
[ "0.5959065", "0.58535624", "0.57733697", "0.57481474", "0.56645024", "0.56559", "0.5615618", "0.55334675", "0.54384345", "0.5413236", "0.5248974", "0.5242514", "0.5219947", "0.52178687", "0.516955", "0.51643205", "0.5131712", "0.5037063", "0.5019627", "0.49969617", "0.4936883...
0.87451875
0
Returns a list of categories.
def get_categories(self, blogid=1): return self.execute('metaWeblog.getCategories', blogid, self.username, self.password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllCategories(self):\n return self.categories", "def categories(self) -> List[str]:\n return self._categories", "def categories(self):\n game_categories = self.game_categories.all()\n return [ gc.category for gc in game_categories ]", "def categories(self):\n cur = s...
[ "0.8440817", "0.8315814", "0.8314017", "0.8310888", "0.83058816", "0.82756895", "0.82337904", "0.8194744", "0.8162497", "0.81154656", "0.81095296", "0.80690354", "0.80144095", "0.79708874", "0.79260206", "0.7908823", "0.78879285", "0.78876674", "0.7869511", "0.7858786", "0.78...
0.7163902
58
Returns the template type identifed by templateType
def get_template(self, templateType, blogid=1): return self.execute("metaWeblog.getTemplate", self.appkey, blogid, self.username, self.password, templateType)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_name(self, template_type: Union[TemplateType, str]) -> str:\n return self.options.get(\"templates\", {}).get(template_type, template_type)", "def template(self):\n template_names = self.get_template_names()\n if template_names:\n return template_names[0]\n retu...
[ "0.7040897", "0.62723136", "0.6185413", "0.61840194", "0.61464596", "0.6105184", "0.6094218", "0.6094218", "0.60608715", "0.60608715", "0.60573214", "0.60502917", "0.6006524", "0.59371454", "0.58809084", "0.5845159", "0.5840387", "0.5825666", "0.5813442", "0.5795834", "0.5787...
0.592524
14
Sets the new template value for templateType
def set_template(self, template, templateType, blogid=1): return self.execute("metaWeblog.setTemplate", self.appkey, blogid, self.username, self.password, template, templateType)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_template(self, name, value):\n\n self.templates[name] = value", "def setTemplate(self, template):\n self.template = template", "def template(self, value: str):\n self._template = value", "def template(self, template):\n self._template = template", "def template(self, tem...
[ "0.72401804", "0.69655174", "0.6950046", "0.6802819", "0.67317826", "0.67317826", "0.6559379", "0.64316505", "0.6042992", "0.6042992", "0.60326844", "0.60045385", "0.5961694", "0.5880146", "0.5880146", "0.5879733", "0.5845343", "0.5827922", "0.5739706", "0.5727141", "0.571689...
0.6361871
8
Sample images from the generator. Images are returned as a 4D tensor of values between 1 and 1. Dimensions are (number, channels, height, width). Returns the tensor on cpu.
def generate_samples(self, latent_vec=None, num=None): num = self.batch_size if num is None else num latent_vec = self.noise_fn(num) if latent_vec is None else latent_vec with torch.no_grad(): samples = self.generator(latent_vec) samples = samples.cpu() # move images to cpu ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):\n z_sample = np.random.normal(0, 1,[self.batch_size, self.n_z])\n gen_images = self.sess.run(self.gen_img, feed_dict={self.z: z_sample})\n return gen_images", "def sample_image(generator, n_row, batches_done):\r\n # Sample noise\r\n z = Variable(float_tensor(np.rand...
[ "0.71397203", "0.6762263", "0.66119605", "0.65456355", "0.65301275", "0.63306653", "0.6296912", "0.6291886", "0.6173806", "0.6147632", "0.61286056", "0.61251837", "0.6118454", "0.6080944", "0.6076369", "0.6019585", "0.5981345", "0.59795886", "0.59572834", "0.5936184", "0.5931...
0.58694637
27
Get the front element.
def peek(self) -> int: if not self.empty(): return self.queue[0] return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def getFront(self):\n if not self.isEmpty():\n return self._data[0]\n else:\n return -1", "def front(self):\n return self.queue[0] if not self.empty() else None", "def peek_front(...
[ "0.82009244", "0.79261875", "0.7852642", "0.7791182", "0.77886623", "0.75723046", "0.752337", "0.7510604", "0.7478953", "0.7379256", "0.7379256", "0.734284", "0.7323573", "0.7320296", "0.7291721", "0.72772557", "0.7269801", "0.72657627", "0.7253295", "0.72355044", "0.72213495...
0.0
-1
Returns whether the queue is empty.
def empty(self) -> bool: if(self.queue is not None and len(self.queue) > 0): print("len > 0" ) return False else: print("len = 0" ) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return self.queue == []", "def ...
[ "0.9269721", "0.92503", "0.92358637", "0.92358637", "0.915549", "0.9098092", "0.9094519", "0.9092212", "0.9072709", "0.9053566", "0.8920166", "0.8913699", "0.8877523", "0.8843482", "0.8843482", "0.88358456", "0.88035", "0.8757838", "0.87572837", "0.87309694", "0.8628997", "...
0.86455876
20
Dot product of a multidimensional array `X` with `y` The dimensions in `dims_to_omit` will not be summed across during dot product
def spm_dot(X, y, dims_to_omit=None, obs_mode=False): X = utils.to_numpy(X) y = utils.to_numpy(y) # if `X` is array of array, we need to construct the dims to sum if utils.is_arr_of_arr(X): dims = (np.arange(0, len(y)) + X.ndim - len(y)).astype(int) else: """ Deal with par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spm_dot_torch(X, x, dims_to_omit=None):\n\n if x.dtype == object:\n dims = (np.arange(0, len(x)) + X.ndim - len(x)).astype(int)\n else:\n if x.shape[0] != X.shape[1]:\n \"\"\"\n Case when the first dimension of `x` is likely the same as the first dimension of `A`\n ...
[ "0.7115924", "0.6953984", "0.6933321", "0.68162864", "0.6706298", "0.6659779", "0.65913343", "0.65912616", "0.65912616", "0.65912616", "0.65912616", "0.658698", "0.6584329", "0.64502925", "0.64465165", "0.6437212", "0.6432815", "0.6425201", "0.63853264", "0.63719", "0.6287879...
0.7780148
0
Computes the softmax function on a set of values
def softmax(dist, return_numpy=True): dist = utils.to_numpy(dist) output = [] if utils.is_arr_of_arr(dist): for i in range(len(dist.values)): output.append(softmax(dist[i]), return_numpy=True) output = dist - dist.max(axis=0) output = np.exp(output) output = output / np.su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(values):\n exps = np.exp(values)\n return exps / sum(exps)", "def softmax(x):\n \"\"\"\"\"\"\n return exp(x) / sum(exp(x), axis=0)", "def softmax(x): \n return np.exp(x) / np.sum(np.exp(x), axis=0)", "def softmax(x):\n # https://stackoverflow.com/questions/349...
[ "0.8528085", "0.8507878", "0.8450174", "0.84251046", "0.8408506", "0.83823514", "0.83823514", "0.83611655", "0.83611655", "0.83611655", "0.83611655", "0.83611655", "0.83611655", "0.83611655", "0.83611655", "0.8348335", "0.83306015", "0.82923174", "0.8276887", "0.825371", "0.8...
0.0
-1
Dot product of a multidimensional array with `x` Pytorch version, using Tensor instances
def spm_dot_torch(X, x, dims_to_omit=None): if x.dtype == object: dims = (np.arange(0, len(x)) + X.ndim - len(x)).astype(int) else: if x.shape[0] != X.shape[1]: """ Case when the first dimension of `x` is likely the same as the first dimension of `A` e.g. inv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _layerwise_dot_product(x_s, y_s):\n return [torch.sum(x * y).item() for x, y in zip(x_s, y_s)]", "def dot_product(x, kernel):\n return K.squeeze(K.dot(x, K.expand_dims(kernel)), axis=-1)", "def dot_product(x, kernel):\n if K.backend() == 'tensorflow':\n return K.squeeze(K.dot(x, K.expan...
[ "0.71418947", "0.7107715", "0.7055948", "0.7055948", "0.7055948", "0.7055948", "0.7044271", "0.70261943", "0.70071626", "0.69877404", "0.6953907", "0.6940456", "0.6814771", "0.6814771", "0.6766073", "0.6666709", "0.66335356", "0.66203845", "0.64884347", "0.6363446", "0.634066...
0.76654434
0
Assert that a request to get the list of financing statements by account works as expected.
def test_get_account_financing_list(session, client, jwt, desc, roles, status, has_account): headers = None # setup if has_account: headers = create_header_account(jwt, roles) else: headers = create_header(jwt, roles) # test response = client.get('/api/v1/financing-statements', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_iso20022_account_statement(self):\n pass", "def test_retrieve_iso20022_account_statement_ids(self):\n pass", "def test_client_bank_accounts_list(self):\n pass", "def test_get_statement(session, client, jwt, desc, roles, status, has_account, reg_num):\n # setup\n c...
[ "0.66166705", "0.65591276", "0.64822525", "0.6476762", "0.6369302", "0.6149325", "0.6130372", "0.60753024", "0.60651505", "0.6049486", "0.603502", "0.59404", "0.59388465", "0.58264506", "0.5817997", "0.5815823", "0.58110297", "0.58095855", "0.5800521", "0.5799558", "0.5786518...
0.77414936
0
Assert that a valid registration statement request payment details setup works as expected.
def test_get_payment_details(session, client, jwt, reg_type, reg_class, reg_num, label, value, life): # setup registration = Registration() registration.base_registration_num = reg_num registration.registration_type = reg_type registration.registration_type_cl = reg_class registration.life = lif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_submit_iso20022_payment_instruction(self):\n pass", "def test_individual_donation_required(self):\n form_data = self.form_data()\n form = DonationPaymentForm(data=form_data)\n self.assertTrue(form.is_valid())", "def test_valid_credentials(self):\n self.tc_id = \"Ts_0...
[ "0.689102", "0.66715384", "0.65011936", "0.64929", "0.63131696", "0.6284002", "0.62742704", "0.62742704", "0.625769", "0.6255785", "0.6253347", "0.62246287", "0.620609", "0.62058455", "0.62017286", "0.6190478", "0.61643046", "0.6083413", "0.6055412", "0.6051621", "0.6037832",...
0.6471333
4
Retrieves and returns an operator function from the operators dictionary
def fetch_operators_function(self, operator): operators_function = self.operators_dict[operator]['function'] return operators_function
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_operator(key):\n # Check for simple operators\n if key.startswith('re_'):\n operator = np.real\n newkey = key[3:]\n elif key.startswith('im_'):\n operator = np.imag\n newkey = key[3:]\n elif key.startswith('abs_'):\n operator = np.abs\n newkey = key[4:]...
[ "0.7313074", "0.6987077", "0.69248444", "0.690362", "0.6759537", "0.67052007", "0.66636276", "0.66033304", "0.6590329", "0.65899694", "0.65899694", "0.65899694", "0.6580057", "0.65425295", "0.6518205", "0.6518205", "0.6507782", "0.645952", "0.64503586", "0.64333814", "0.63877...
0.8350798
0
== operator >>> a=vec4(1.0, 0.5, 1.8, 0.2) >>> b=vec4(0.3, 0.75, 0.5, 0.6) >>> c=vec4(0.3, 0.75, 0.5, 0.6) >>> print a==b 0 >>> print b==c 1 >>> print a==None 0
def __eq__(self, other): if isinstance(other, vec4): return self.x==other.x and self.y==other.y and self.z==other.z else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testEquals(self):\n v1 = Vector(3, 4, 5)\n assert (v1 == [3, 4, 5])\n assert (v1 != [0, 2, 4])\n v2 = Vector(3.0, 4.0, 5.000)\n assert (v1 == v2)\n v3 = Vector(2, 2)\n assert v1 != v3", "def values_eq(self, a, b):\r\n return a == b", "def test_equal_s...
[ "0.71596485", "0.6752081", "0.6558199", "0.64226145", "0.6393129", "0.63800573", "0.6372398", "0.63587886", "0.62853384", "0.6281824", "0.62749404", "0.6266902", "0.6252037", "0.62360805", "0.6228141", "0.6159024", "0.61418253", "0.61297715", "0.60959065", "0.60959065", "0.60...
0.7216642
0
!= operator >>> a=vec4(1.0, 0.5, 1.8, 0.2) >>> b=vec4(0.3, 0.75, 0.5, 0.6) >>> c=vec4(0.3, 0.75, 0.5, 0.6) >>> print a!=b 1 >>> print b!=c 0 >>> print a!=None 1
def __ne__(self, other): if isinstance(other, vec4): return self.x!=other.x or self.y!=other.y or self.z!=other.z else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, v):\n\t\treturn not (self == v)", "def test_not_equal_on_equal(self):\n a = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n self.assertFalse(a != b)\n self.assertFalse(b != a)", "def...
[ "0.67293215", "0.6710038", "0.6705562", "0.66843194", "0.66678643", "0.6649943", "0.6638707", "0.65897065", "0.6585865", "0.6579708", "0.65600467", "0.6547943", "0.6546595", "0.6506967", "0.6465807", "0.6460124", "0.6458504", "0.6458486", "0.64293873", "0.6391207", "0.6371383...
0.7350774
0
Return the length of the vector. abs(v) is equivalent to v.length(). >>> a=vec4(1.0, 0.5, 1.8, 0.2) >>> print abs(a) 2.12837966538
def __abs__(self): return math.sqrt(self*self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length_vector(v):\n return sqrt(dot_vectors(v, v))", "def length(vec):\n return np.linalg.norm(vec)", "def length(v: Vec2) -> float:\n return sqrt(v.x ** 2 + v.y ** 2)", "def get_vector_length(vector):\n return np.linalg.norm(vector)", "def length(v):\n return math.sqrt(v[0]**2 + v[1]**2...
[ "0.71823514", "0.7158193", "0.71298605", "0.70785236", "0.6977913", "0.6934305", "0.6925117", "0.6742262", "0.6704664", "0.6516641", "0.6505409", "0.64873105", "0.6460217", "0.64487803", "0.64338255", "0.64201725", "0.64109606", "0.63741386", "0.62219065", "0.6197205", "0.616...
0.0
-1
Return normalized vector. >>> a=vec4(1.0, 0.5, 1.8, 1.2) >>> print a.normalize() (0.4107, 0.2053, 0.7392, 0.4928)
def normalize(self): nlen = 1.0/math.sqrt(self*self) return vec4(self.x*nlen, self.y*nlen, self.z*nlen, self.w*nlen)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(v):\n return v / np.linalg.norm(v)", "def testNormalize(self):\n v1 = Vector.ones(4)\n n = v1.norm()\n assert n == 2\n assert v1.normalize() == [ 0.5, 0.5, 0.5, 0.5 ]", "def test_normalize(self):\n\n a1 = vectors.Vector(4, 0, 0)\n self.assertEqual(a1.n...
[ "0.788879", "0.7861582", "0.7850532", "0.7795936", "0.7792428", "0.7788715", "0.77336645", "0.7667583", "0.7648203", "0.75915927", "0.75636274", "0.7538247", "0.7512167", "0.74981666", "0.7475287", "0.74209076", "0.7387201", "0.73497456", "0.731963", "0.72808266", "0.7265521"...
0.72553086
22
Gets the last monday from the current date.
def get_last_monday(): today = get_current_india_time() # Weekday for Monday is 0. if today.date().weekday() == 0: ts = today.replace(hour=0, minute=0, second=0, microsecond=0) else: next_monday = get_next_closest_day("monday") week_delta = get_time_delta(7) ts = next_mon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monday_last_week():\n today = datetime.date.today()\n last_week = today - datetime.timedelta(days=7)\n return last_week - datetime.timedelta(days=(last_week.isoweekday() - 1))", "def _get_next_monday(self):\n today = datetime.date.today()\n weekday_int = today.weekday()\n if weekday_i...
[ "0.80530095", "0.75411814", "0.70993084", "0.61955106", "0.6064312", "0.6052801", "0.5919568", "0.59080815", "0.58877736", "0.5881692", "0.58812904", "0.5820446", "0.5801678", "0.5776073", "0.5769336", "0.56857544", "0.5675953", "0.56252724", "0.56252724", "0.56074405", "0.55...
0.8217596
0
Fakes kivy.app.App().user_data_dir behavior. On Android, `/sdcard/` is returned.
def user_data_dir(): # TODO: hardcoded app_name = 'etheroll' data_dir = os.path.join('/sdcard', app_name) data_dir = os.path.expanduser(data_dir) if not os.path.exists(data_dir): os.mkdir(data_dir) return data_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_dir():\n return Path(current_app.config[\"USER_DIR\"]) / \"data\"", "def user_data_dir(appname=None, appauthor=None, version=None, roaming=False):\n if system == \"win32\":\n if appauthor is None:\n appauthor = appname\n const = \"CSIDL_APPDATA\" if roaming else \"CSID...
[ "0.7553962", "0.7316263", "0.70587647", "0.70180464", "0.7005296", "0.692841", "0.6765933", "0.66890043", "0.66840297", "0.6629934", "0.6536314", "0.6534623", "0.6509561", "0.6482653", "0.64717263", "0.6399371", "0.63757616", "0.6300804", "0.6299296", "0.62900484", "0.6281457...
0.8476021
0
Returns the full user store path.
def get_store_path(cls): user_data_dir = cls.user_data_dir() store_path = os.path.join(user_data_dir, 'store.json') return store_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_path(self):\n return path.join(env.store_home, self._store_path)", "def path(self):\n path = os.path.join(self.base_dir, self.store().replace(' ', '_'), self.package_name())\n return os.path.abspath(path)", "def user_home_path(self):\n return path.join(env.user_home, self....
[ "0.81895006", "0.7218433", "0.70371765", "0.70076007", "0.6771286", "0.6631976", "0.656026", "0.6530616", "0.6466402", "0.6441794", "0.6434768", "0.64077437", "0.63808817", "0.63743067", "0.6348079", "0.6331507", "0.63272524", "0.63159424", "0.630236", "0.62826437", "0.627674...
0.8070438
1
Returns user Store object.
def get_store(cls): store_path = cls.get_store_path() store = JsonStore(store_path) return store
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_store(self):\n return self._store", "def get_user_store(self, uid: int) -> UserStore:\n if uid not in self.user_store.keys():\n self.user_store[uid] = UserStore()\n return self.user_store[uid]", "def get_store(self, store_name: str) -> Any:\n pass", "def get_st...
[ "0.7637911", "0.74381936", "0.70836437", "0.7053572", "0.6722289", "0.6647391", "0.6490641", "0.6461784", "0.6457468", "0.6434544", "0.6426389", "0.64130074", "0.63642406", "0.6328346", "0.63175863", "0.6257397", "0.6242331", "0.61393493", "0.6101946", "0.6097517", "0.6048142...
0.71066767
2
Convert PointcloudObject from json format to PointcloudObject class object. Raise error if object class name is not found in the given project meta.
def from_json(cls, data, project_meta: ProjectMeta, key_id_map: Optional[KeyIdMap] = None): obj_class_name = data[LabelJsonFields.OBJ_CLASS_NAME] obj_class = project_meta.get_obj_class(obj_class_name) if obj_class is None: raise RuntimeError(f'Failed to deserialize a object from JSO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(cls, point_source, json_text):\n data = json.loads(json_text)\n point = point_source.getPoint(data['index'])\n # Fairly limited amount of verification we can do\n assert point.label == data['label']\n return point", "def _json_to_obj(cls, serialized_str):\n ...
[ "0.5674716", "0.56341666", "0.5249367", "0.5205585", "0.5200604", "0.5124668", "0.51157826", "0.5095639", "0.509161", "0.508861", "0.50402766", "0.50354743", "0.50292784", "0.4970865", "0.4955115", "0.49413005", "0.4935173", "0.49193874", "0.4916021", "0.4881285", "0.4866979"...
0.6292825
0
Check if arguments are bytearray type.
def bytearray_check(*args, func=None): func = func or inspect.stack()[2][3] for var in args: if not isinstance(var, (bytearray, collections.abc.ByteString, collections.abc.MutableSequence)): name = type(var).__name__ raise BytearrayError( 'Function {} expected byt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes_check(*args, func=None):\n func = func or inspect.stack()[2][3]\n for var in args:\n if not isinstance(var, (bytes, collections.abc.ByteString)):\n name = type(var).__name__\n raise BytesError(\n 'Function {} expected bytes, {} got instead.'.format(func, ...
[ "0.7123308", "0.69805497", "0.6775227", "0.6613514", "0.6410562", "0.63643706", "0.6336684", "0.6321724", "0.62752074", "0.62711704", "0.6221194", "0.6170714", "0.6151636", "0.61204803", "0.60709316", "0.60700154", "0.6061411", "0.60583705", "0.6043087", "0.6032286", "0.60289...
0.805826
0
Check if arguments are valid IP fragments.
def _ip_frag_check(*args, func=None): func = func or inspect.stack()[2][3] for var in args: dict_check(var, func=func) bufid = var.get('bufid') str_check(bufid[3], func=func) bool_check(var.get('mf'), func=func) ip_check(bufid[0], bufid[1], func=func) bytearray_ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frag_check(*args, protocol, func=None):\n func = func or inspect.stack()[2][3]\n if 'IP' in protocol:\n _ip_frag_check(*args, func=func)\n elif 'TCP' in protocol:\n _tcp_frag_check(*args, func=func)\n else:\n raise FragmentError('Unknown fragmented protocol {}.'.format(protocol...
[ "0.69496536", "0.6913988", "0.68251556", "0.67215425", "0.6707531", "0.6686689", "0.65425295", "0.6470914", "0.64500386", "0.6441643", "0.6431439", "0.6421317", "0.6419145", "0.63725364", "0.6369929", "0.62483984", "0.6155837", "0.60663074", "0.60530376", "0.603464", "0.60288...
0.76423246
0
Index number of Node's parent.
def get_parent(self, index): return (index - 1) // (2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parent_index(self):\n return (self.index - 1) // 2", "def _parent(self, index):\r\n # Declaring the \"root\" its own parent, otherwise usual math\r\n return (index - 1) // 2 if index else 0", "def parent(self, index):\n if index == 0:\n print(\"index 0 has no pare...
[ "0.8465723", "0.84116554", "0.8338773", "0.8079576", "0.8058377", "0.7990692", "0.7978887", "0.79007167", "0.7893246", "0.7802129", "0.7769121", "0.77592045", "0.76885056", "0.7567606", "0.7537025", "0.7433137", "0.7433137", "0.7386975", "0.7386975", "0.73465246", "0.7342386"...
0.7914551
7
Push new node to heap.
def push(self, val): self.high_low.append(val) try: self.compare_parent(self.high_low.index(self.high_low[-1])) except (ValueError, IndexError): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, new_node):\n # Add a new node into the data list\n self.data.append(new_node)\n # Maintain the min heap\n self.heapify_up(len(self.data) - 1)", "def push(self, item):\n heapq.heappush(self.heap, item)", "def push(self, x):\n assert x not in self.rank\n ...
[ "0.8444514", "0.7848727", "0.78118044", "0.78118044", "0.7649651", "0.76081616", "0.7455478", "0.74523085", "0.74441534", "0.74408734", "0.7437499", "0.7362907", "0.7360342", "0.73462677", "0.7332794", "0.7312991", "0.7278878", "0.7253293", "0.72472167", "0.7245877", "0.72455...
0.0
-1
Returns a dictionary containing all \ keys/values of __dict__ of the instance
def to_dict(self): dic = self.__dict__.copy() dic['__class__'] = self.__class__.__name__ dic['created_at'] = self.created_at.isoformat() dic['updated_at'] = self.updated_at.isoformat() return (dic)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(...
[ "0.8119648", "0.8119648", "0.8119648", "0.8119648", "0.8119648", "0.8119648", "0.8119648", "0.8113213", "0.80770403", "0.8059921", "0.80488795", "0.7931788", "0.78788424", "0.7855015", "0.7850087", "0.7835467", "0.7804142", "0.78040427", "0.77662045", "0.77662045", "0.7761186...
0.0
-1
Merge multiple peerattention vectors with softmax weighted sum. Summation weights are to be learned.
def softmax_merge_peer_attentions(peers, data_format): assert data_format == 'channels_last' if FLAGS.precision == 'bfloat16': dtype = tf.bfloat16 else: dtype = tf.float32 initial_attn_weights = lambda: tf.random.truncated_normal( # pylint: disable=g-long-lambda [len(peers)], mean=0.0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _align_without_softmax(self, sum_heads_encoded, sum_bodies_encoded):\n _tmp_heads_encoded = tf.expand_dims(sum_heads_encoded, 1)\n vector_attn = tf.reduce_sum(\n tf.multiply(tf.nn.l2_normalize(sum_bodies_encoded, 2), tf.nn.l2_normalize(_tmp_heads_encoded, 2)), axis=2,\n keep...
[ "0.63174134", "0.6019576", "0.59645855", "0.5860701", "0.58158046", "0.58050877", "0.5740221", "0.5724694", "0.5657316", "0.5654487", "0.5631598", "0.5629281", "0.5627464", "0.56265223", "0.55272156", "0.54916185", "0.54543835", "0.5452842", "0.5412232", "0.53938234", "0.5389...
0.6785601
0
Applies peerattention or selfattention to the input tensor. Depending on the attention_mode, this function either applies channelwise selfattention or peerattention. For the peerattention, the function combines multiple candidate attention vectors (given as attention_in), by learning softmaxsum weights described in the...
def apply_attention(inputs, attention_mode=None, attention_in=None, use_5d_mode=False, data_format='channels_last'): assert data_format == 'channels_last' h_ch_loc = 2 if use_5d_mode else 1 if attention_mode == 'peer': attn = so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fusion_with_peer_attention(inputs,\n index=None,\n attention_mode=None,\n attention_in=None,\n use_5d_mode=False,\n data_format='channels_last'):\n assert data_...
[ "0.6992957", "0.6568058", "0.6156407", "0.61359924", "0.60557026", "0.60174334", "0.5929724", "0.58681947", "0.5831827", "0.5756102", "0.57403576", "0.57319397", "0.5724981", "0.5673115", "0.56562346", "0.56551075", "0.5627412", "0.56231594", "0.5611072", "0.5598629", "0.5582...
0.7708854
0
Weighted summation of multiple tensors, while using peerattention. Summation weights are to be learned. Uses spatial max pooling and 1x1 conv. to match their sizes. Before the summation, each connection (i.e., each input) itself is scaled with channelwise peerattention. Notice that attention is applied for each connect...
def fusion_with_peer_attention(inputs, index=None, attention_mode=None, attention_in=None, use_5d_mode=False, data_format='channels_last'): assert data_format == '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weighted_sum(self, inputs):\r\n weighted_sum = 0\r\n for i in range(self.num_inputs):\r\n weighted_sum += self.weights[i]*inputs[i]\r\n return weighted_sum", "def weighted_sum(matrix: torch.Tensor, attention: torch.Tensor) -> torch.Tensor:\n # We'll special-case a few settings here, where th...
[ "0.64456135", "0.64004964", "0.6128083", "0.5837993", "0.5818645", "0.57929534", "0.5750522", "0.57195956", "0.57069093", "0.5691577", "0.5686715", "0.5661932", "0.5614349", "0.5606911", "0.56056756", "0.55789816", "0.55646145", "0.55515784", "0.55425936", "0.55415326", "0.55...
0.613748
2
Layers for an object input stem. It expects its input tensor to have a separate channel for each object class.
def object_conv_stem(inputs, data_format='channels_last'): inputs = tf.layers.max_pooling2d( inputs=inputs, pool_size=4, strides=4, padding='SAME', data_format=data_format) inputs = tf.identity(inputs, 'initial_max_pool') return inputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_stem_layer(self, in_channels: int, stem_channels: int) -> None:\n if self.deep_stem:\n self.stem = nn.Sequential(\n build_conv_layer(\n self.conv_cfg,\n in_channels,\n stem_channels // 2,\n kernel...
[ "0.66733164", "0.5661516", "0.5449797", "0.54201984", "0.54192364", "0.5331143", "0.53262913", "0.5311166", "0.52820355", "0.5276426", "0.5272333", "0.5253867", "0.52439356", "0.5229762", "0.5223", "0.5218706", "0.52033144", "0.51987857", "0.51977605", "0.5194592", "0.5185334...
0.6407818
1
Initialize the device tracker.
def __init__(self, coordinator, name, icon, system_id, item_id): super().__init__( coordinator=coordinator, name=name, icon=icon, system_id=system_id, item_id=item_id, ) self._is_connected = None self._mac = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doInitializeDevice(self):\n super().doInitializeDevice()", "def __init__(self):\n self._device_info = None", "def initialise(self):\n logging.debug(\"TrackerPlugin.initialise\")", "def _initialize(self):\n self.flush()\n print(\"Initializing sensor...\")\n try:\n...
[ "0.7160093", "0.7106584", "0.6990375", "0.68960536", "0.68530416", "0.6840721", "0.6785245", "0.6755943", "0.6738518", "0.673659", "0.6674065", "0.6674065", "0.6674065", "0.66533786", "0.66435075", "0.66409814", "0.66363734", "0.6611633", "0.6580973", "0.65477747", "0.6540741...
0.0
-1
Method to return the nth layer in the current Circuit object. The parameter must be between 0 and the actual number of the layers.
def wrapper(self, nth): if isinstance(nth, int): return function(self, nth) else: raise TypeError('Invalid input! Argument must be integer.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_layer(self, i):\n return self.layers[i]", "def get_nth_layer_check(function):\n\n def wrapper(self, nth):\n \"\"\"Method to return the n-th layer in the current Circuit object. The parameter must be \n between 0 and the actual number of the layers.\n \n Arguments:\n ...
[ "0.74039906", "0.7303725", "0.69746095", "0.68346196", "0.68017435", "0.67166066", "0.6616348", "0.63373065", "0.62569845", "0.62414855", "0.61188614", "0.61021084", "0.60773087", "0.59991795", "0.59467095", "0.593577", "0.5902343", "0.58861685", "0.58295953", "0.58232975", "...
0.0
-1
flatten the sequences in each example of the true captions and predictions so we have tensors of words instead of sequences for loss and accuracy calculations
def flatten_sequences(output, truth): sequence_flattened_output = output.reshape(-1, output.shape[-1]) sequence_flattened_truth = truth.reshape(-1) return sequence_flattened_output, sequence_flattened_truth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batchify(self, observations):\n # valid examples\n exs = [ex for ex in observations if 'text' in ex]\n # the indices of the valid (non-empty) tensors\n valid_inds = [i for i, ex in enumerate(observations) if 'text' in ex]\n\n # set up the input tensors\n batchsize = le...
[ "0.6802924", "0.6551474", "0.6539345", "0.6402594", "0.63733006", "0.63539624", "0.6330711", "0.63050795", "0.6302647", "0.62914574", "0.6282509", "0.62229526", "0.62117743", "0.61994916", "0.61399454", "0.6124157", "0.61102086", "0.6097946", "0.6077377", "0.60758656", "0.606...
0.0
-1
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83695436", "0.8280479", "0.82485795", "0.8139178", "0.8114118", "0.80985415", "0.80940944", "0.80797124", "0.80677074", "0.80673695", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.80569947", "0.80545217", "0.80403364", "0.802...
0.80448323
32
Convert a XYZ to a linear RGB color.
def XYZ_to_sRGB_linear(XYZ): rgb = np.tensordot(T, XYZ, axes=([1, 0])) if clip_method == CLIP_CLAMP_TO_ZERO: # set negative rgb values to zero rgb = np.where(rgb < 0, 0, rgb) return rgb if clip_method == CLIP_ADD_WHITE: # add enough white to make all rgb values nonnegative...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xyz2linear_rgb(rgb):\n arr = _prepare_colorarray(rgb).copy()\n return _convert(rgb_from_xyz, arr)", "def xyz_to_lin_a98rgb(xyz: Vector) -> Vector:\n\n return alg.dot(XYZ_TO_RGB, xyz, dims=alg.D2_D1)", "def linear_rgb2xyz(rgb):\n arr = _prepare_colorarray(rgb).copy()\n return _convert(xyz_fro...
[ "0.81819946", "0.79236525", "0.74586886", "0.72327024", "0.71910244", "0.7093997", "0.691178", "0.69071716", "0.68039477", "0.6675804", "0.66532797", "0.66480094", "0.65368104", "0.6492271", "0.6417387", "0.63902515", "0.6373076", "0.6356713", "0.6335993", "0.6333796", "0.630...
0.7181704
5
Convert a spectrum to an XYZ color.
def spec_to_XYZ(spec): if spec.ndim == 1: Δλ = (780 - 380) / (spec.shape[0] - 1) λ_list = np.arange(380.0, 780.00001, Δλ) X = np.dot(spec, cs_x(λ_list)) * Δλ * 0.003975 * 683.002 Y = np.dot(spec, cs_y(λ_list)) * Δλ * 0.003975 * 683.002 Z = np.dot(spec, cs_z(λ_list)) * Δλ *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def example_rgb_to_xyz():\r\n\r\n print(\"=== RGB Example: RGB->XYZ ===\")\r\n # Instantiate an Lab color object with the given values.\r\n rgb = sRGBColor(120, 130, 140)\r\n # Show a string representation.\r\n print(rgb)\r\n # Convert RGB to XYZ using a D50 illuminant.\r\n xyz = convert_color...
[ "0.68718624", "0.6836622", "0.65651786", "0.6556949", "0.63715595", "0.6284183", "0.6274084", "0.622245", "0.6151981", "0.6149913", "0.6128306", "0.60980576", "0.6085835", "0.5869543", "0.5809921", "0.5785121", "0.5774022", "0.57447714", "0.5670647", "0.5559354", "0.55158025"...
0.0
-1
returns a string of current date time
def now(self): os.environ['TZ'] = conf.timezone time.tzset() return time.strftime("%B %d %Y %H:%M:%S IST", time.localtime())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_datetime_string ( ) :\n return get_current_datetime( ).strftime( \"%Y%m%d-%H%M%S\" )", "def time_now() -> str:\n return datetime_to_str(datetime_now())", "def get_now():\r\n now = dt.datetime.now()\r\n now_str = now.strftime(\"%d/%m %H:%M\")\r\n return now_str", "def get_current...
[ "0.8863057", "0.85551643", "0.8418663", "0.8417083", "0.84119695", "0.83947015", "0.839124", "0.8383969", "0.83806187", "0.8353671", "0.8292408", "0.8200105", "0.81669843", "0.8157392", "0.8141736", "0.81312805", "0.81081635", "0.809255", "0.80834556", "0.8061674", "0.8042652...
0.7843392
27
A standard HTTP 401 response A quick helper for defining 401 responses. If you're using a custom error schema you'll have to build those manually. Otherwise you can use this little helper.
def response_401(description=None): resp_def = dict(util.RESPONSE_404) if description is not None: resp_def['description'] = description return response(401, resp_def)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unauthorized():\n return {'errors': ['Unauthorized']}, 401", "def unauthorized():\n return HttpError(401)", "def response_unauthorised():\n\n response = {\n 'status': 'failed',\n 'error': 'Not Authorised'\n }\n\n return response_json(response, status=401)", "def auth_failure(...
[ "0.7609733", "0.75625587", "0.75416195", "0.72230184", "0.72032976", "0.7132038", "0.69067967", "0.67542374", "0.6681121", "0.66397214", "0.660845", "0.6597849", "0.65929997", "0.6530423", "0.652699", "0.65259355", "0.6523081", "0.6523081", "0.6523081", "0.6523081", "0.652308...
0.7693875
0
Gets the directory of the GCD emulator installation in the Cloud SDK.
def GetGCDRoot(): sdk_root = util.GetCloudSDKRoot() gcd_dir = os.path.join(sdk_root, 'platform', 'cloud-datastore-emulator') if not os.path.isdir(gcd_dir): raise NoGCDError() return gcd_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_install_dir(self):\n return EventGenerator.get_install_dir(self) + \"/egs5\"", "def get_installdir(self):\n import mewlo\n path = os.path.dirname(os.path.realpath(mewlo.__file__))\n return path", "def get_install_dir(self):\n return EventGenerator.get_install_dir(self...
[ "0.70556486", "0.70523596", "0.6851314", "0.6815847", "0.6671107", "0.6644766", "0.6583252", "0.65683895", "0.65080917", "0.6471657", "0.64602643", "0.64542145", "0.6446775", "0.6358676", "0.62971956", "0.6295621", "0.62947387", "0.62768257", "0.6275268", "0.6265594", "0.6265...
0.79414386
0
Return an array of nodes that match the selector.
def get(self, selector): stage = self.get_stage() arr = [] key = selector[1:] if selector[0] == '#': arr = [stage.ids[key]] if stage.ids[key] else [] elif selector[0] == '.': arr = [stage.name[key]] if stage.name[key] else [] elif selector ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_nodes(self, selector):\r\n arr = []\r\n def traverse(cont):\r\n children = cont.get_children()\r\n for n in xrange(len(children)):\r\n child = children[n]\r\n if child.node_type == selector:\r\n arr.append(child)\r\n ...
[ "0.79346216", "0.6637341", "0.6591449", "0.63993907", "0.63603497", "0.6252161", "0.6182585", "0.6114835", "0.6106636", "0.6079316", "0.6057584", "0.6050366", "0.59143454", "0.585621", "0.5775321", "0.57579166", "0.57579166", "0.57494694", "0.5744418", "0.5727931", "0.5727556...
0.67726207
1
Raise a warning when there is no bold.json file in the derivatives and no TR value is passed as argument. create_fake_bids_dataset does not add JSON files in derivatives, so the TR value will be inferred from the raw.
def test_first_level_from_bids_set_repetition_time_warnings(tmp_path): bids_path = create_fake_bids_dataset(base_dir=tmp_path, n_sub=10, n_ses=1, tasks=['main'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_broken_json_dataset(bids_examples, tmp_path):\n\n dataset = \"asl003\"\n dataset_path = os.path.join(bids_examples, dataset)\n dataset_json = os.path.join(dataset_path, \"dataset_description.json\")\n\n broken_json = load_test_data(\"broken_dataset_description.json\")\n shutil.copyfile(brok...
[ "0.67136127", "0.6419759", "0.6279266", "0.60406315", "0.5771079", "0.570997", "0.55316436", "0.54587936", "0.538173", "0.5353694", "0.52473235", "0.51361567", "0.510288", "0.50434864", "0.50396687", "0.50316787", "0.50310415", "0.5016742", "0.50019306", "0.49982435", "0.4986...
0.55570894
6
Throw errors for impossible values of slice_time_ref.
def test_first_level_from_bids_set_slice_timing_ref_errors( tmp_path, slice_time_ref, error_type, error_msg): bids_path = create_fake_bids_dataset(base_dir=tmp_path, n_sub=1, n_ses=1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_time_with_invalid_interval(self):\n now = datetime(2015, 2, 1, 0, 0, 0)\n self.assert_TPVE(parse_time, \"-0\", now)\n self.assert_TPVE(parse_time, \"-12\", now)\n self.assert_TPVE(parse_time, \"-12fortnights\", now)\n self.assert_TPVE(parse_time, \"-20150101\", now...
[ "0.59740174", "0.5969644", "0.59234804", "0.55987054", "0.552183", "0.5508553", "0.54925036", "0.54893005", "0.54732615", "0.54333735", "0.5414704", "0.5399426", "0.5391708", "0.5383287", "0.53792614", "0.5348952", "0.5314342", "0.5313568", "0.530637", "0.53061914", "0.530222...
0.56039155
3
Create a fake BIDS dataset for testing purposes. Only use if the dataset does not need to me modified.
def bids_dataset(tmp_path_factory): base_dir = tmp_path_factory.mktemp("bids") n_sub, n_ses, tasks, n_runs = _inputs_for_new_bids_dataset() return create_fake_bids_dataset( base_dir=base_dir, n_sub=n_sub, n_ses=n_ses, tasks=tasks, n_runs=n_runs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _new_bids_dataset(base_dir=Path()):\n n_sub, n_ses, tasks, n_runs = _inputs_for_new_bids_dataset()\n return create_fake_bids_dataset(\n base_dir=base_dir,\n n_sub=n_sub,\n n_ses=n_ses,\n tasks=tasks,\n n_runs=n_runs\n )", "def create_dataset(base_path, batch_size, ...
[ "0.7589008", "0.67663085", "0.66735876", "0.66464376", "0.64651084", "0.6411151", "0.63837785", "0.63636094", "0.6352759", "0.62958187", "0.62745464", "0.6217625", "0.6174667", "0.6173498", "0.6153021", "0.61488056", "0.614349", "0.61408573", "0.60948145", "0.6094493", "0.608...
0.7406092
1
Create a new BIDS dataset for testing purposes. Use if the dataset needs to be modified after creation.
def _new_bids_dataset(base_dir=Path()): n_sub, n_ses, tasks, n_runs = _inputs_for_new_bids_dataset() return create_fake_bids_dataset( base_dir=base_dir, n_sub=n_sub, n_ses=n_ses, tasks=tasks, n_runs=n_runs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_sandbox_dataset(project_id, dataset_id):\n sandbox_dataset_id = get_sandbox_dataset_id(dataset_id)\n friendly_name = f'Sandbox for {dataset_id}'\n description = f'Sandbox created for storing records affected by the cleaning rules applied to {dataset_id}'\n label_or_tag = {'label': '', 'tag':...
[ "0.72225416", "0.71146643", "0.6973474", "0.6835339", "0.68005854", "0.6789647", "0.67770785", "0.6750304", "0.67432195", "0.672013", "0.6676298", "0.66512585", "0.6648852", "0.66420376", "0.65818185", "0.65669626", "0.65132225", "0.64935243", "0.6442006", "0.6441676", "0.643...
0.73201877
0
Returns an int64_list from a bool / enum / int / uint.
def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _BoolsToInts(arg_list):\n result = []\n for arg in arg_list:\n if isinstance(arg, (list, tuple)):\n result.append(_BoolsToInts(arg))\n elif arg is True:\n result.append(1)\n elif arg is False:\n result.append(0)\n else:\n result.append(arg)\n\n return result", "def convertT...
[ "0.68822104", "0.6595804", "0.6461252", "0.6448161", "0.6367609", "0.62926817", "0.6269916", "0.621823", "0.6104528", "0.59533274", "0.5947467", "0.5901199", "0.5863832", "0.5863832", "0.58563983", "0.5844792", "0.58434534", "0.5829844", "0.5801042", "0.5793561", "0.5793561",...
0.54461515
68
Check multi hot output when num_oov_indices=0.
def test_multi_hot_output_no_oov(self): vocab_data = ["earth", "wind", "and", "fire"] valid_input = np.array( [["earth", "wind", "and", "fire"], ["fire", "and", "earth", ""]] ) invalid_input = np.array( [ ["earth", "wind", "and", "michigan"], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_one_hot_output_hard_maximum(self):\n vocab_data = [\"earth\", \"wind\", \"and\", \"fire\"]\n input_array = np.array([\"earth\", \"wind\", \"and\", \"fire\", \"michigan\", \"\"])\n expected_output = [\n [0, 1, 0, 0, 0, 0],\n [0, 0, 1, 0, 0, 0],\n [0, 0,...
[ "0.6768287", "0.66786337", "0.6630894", "0.6470745", "0.64362365", "0.63419646", "0.62434363", "0.6220508", "0.61954635", "0.61909366", "0.6139158", "0.61019975", "0.60925364", "0.5979992", "0.5893066", "0.58705664", "0.58368444", "0.5836512", "0.5836512", "0.5836512", "0.583...
0.7623501
0
Convert class labels from scalars to onehot vectors.
def dense_to_one_hot(labels_dense, num_classes=2): # copied from TensorFlow tutorial num_labels = labels_dense.shape[0] index_offset = np.arange(num_labels) * num_classes labels_one_hot = np.zeros((num_labels, num_classes)) labels_one_hot.flat[(index_offset + labels_dense.ravel()).astype(int)] = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(labels, classes=None):\n return K.utils.to_categorical(labels, classes)", "def one_hot(labels, classes=None):\n\n one_hot_ = K.utils.to_categorical(labels, classes)\n return(one_hot_)", "def to_onehot(labels: torch.Tensor, num_classes: int) -> torch.Tensor:\n if len(labels.size()) == 1:...
[ "0.8250402", "0.807683", "0.80523187", "0.7977843", "0.7908335", "0.7900327", "0.7892233", "0.7869711", "0.7849721", "0.7849721", "0.7826951", "0.7826122", "0.77677035", "0.7765413", "0.77540547", "0.77540547", "0.77540547", "0.77489346", "0.7742955", "0.7737176", "0.77226317...
0.7352546
56
Generates a sparse map from code point (range) to enum value. The first value in each array entry starts a new range of code points (with the given value).
def generate_code_point_map(cpp, public_name, enum_name, table): private_name = public_name + "_" cpp.write( f"static constexpr MapEntry<CodePoint, {enum_name}> " f"{private_name}[] = {{\n" ) # Generate one array entry at the start of the mapping. # Only emit a new entry if the current va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_label_map():\n\n cnt = 1\n tmp_array = np.array([10, 15, 25, 30, 40, 47, 57, 63, 69, 74, 81])\n dictionary = dict()\n dictionary[1] = 1\n for idx, val in enumerate(tmp_array):\n for j in range(cnt + 1, val):\n dictionary[j] = int(idx + 2)\n cnt = j\n return dic...
[ "0.6391758", "0.5867845", "0.57499003", "0.57434297", "0.561485", "0.55679965", "0.55129176", "0.54985493", "0.549772", "0.549772", "0.549772", "0.549772", "0.54837114", "0.5459323", "0.54566735", "0.54491353", "0.5380602", "0.53535604", "0.5346144", "0.5328194", "0.5302363",...
0.64528584
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8192804", "0.8094402", "0.80277497", "0.80176693", "0.7992383", "0.7989708", "0.7979215", "0.79741204", "0.7959607", "0.7955097", "0.79358983", "0.79329205", "0.7932711", "0.79295874", "0.79247147", "0.79228914", "0.792216", "0.79215133", "0.7921201", "0.7920765", "0.79161...
0.78950405
28
Get limit of Yaxis
def getXLimit(self): return self._myCanvas.getXLimit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getYLimit(self):\n return self.axes.get_ylim()", "def getYLimit(self):\n return self._myCanvas.getYLimit()", "def get_ylim(self):\n if isinstance(self._frame, root.TH1F):\n return (self._frame.GetMinimum(), self._frame.GetMaximum())\n else:\n return (self._...
[ "0.8265511", "0.75236475", "0.7141598", "0.7037268", "0.7024883", "0.69983655", "0.69983655", "0.6991727", "0.69353473", "0.69142056", "0.68743515", "0.67710173", "0.6748132", "0.66947263", "0.6654522", "0.6604168", "0.6550604", "0.65480614", "0.65154654", "0.64956313", "0.64...
0.5856544
54
Get limit of Yaxis
def getYLimit(self): return self._myCanvas.getYLimit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getYLimit(self):\n return self.axes.get_ylim()", "def get_ylim(self):\n if isinstance(self._frame, root.TH1F):\n return (self._frame.GetMinimum(), self._frame.GetMaximum())\n else:\n return (self._frame.GetYaxis().GetXmin(), self._frame.GetYaxis().GetXmax())", "de...
[ "0.8265511", "0.7141598", "0.7037268", "0.7024883", "0.69983655", "0.69983655", "0.6991727", "0.69353473", "0.69142056", "0.68743515", "0.67710173", "0.6748132", "0.66947263", "0.6654522", "0.6604168", "0.6550604", "0.65480614", "0.65154654", "0.64956313", "0.64914024", "0.64...
0.75236475
1
Get the minimum Y value of the plots on canvas
def get_y_min(self): if len(self._statDict) == 0: return 1E10 line_id_list = self._statDict.keys() min_y = self._statDict[line_id_list[0]][2] for i_plot in range(1, len(line_id_list)): if self._statDict[line_id_list[i_plot]][2] < min_y: min_y = se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y_min(self):\n return self.get_min_value(self.Y_INDEX)", "def min_y_arg(self):\n return min((self(0).y,0), (self(1).y,1))[1]", "def getMinY(self):\n return self.miny", "def argminY( self ):\n min = 1e30\n for i in range( 0, self.GetN() ):\n p = ( ROOT.Double(), ROOT...
[ "0.78607774", "0.777665", "0.751787", "0.725175", "0.7201014", "0.7022723", "0.68792015", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.68529654", "0.6...
0.76430845
2
Get the maximum Y value of the plots on canvas
def get_y_max(self): if len(self._statDict) == 0: return -1E10 line_id_list = self._statDict.keys() max_y = self._statDict[line_id_list[0]][3] for i_plot in range(1, len(line_id_list)): if self._statDict[line_id_list[i_plot]][3] > max_y: max_y = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y_max(self):\n return self.get_max_value(self.Y_INDEX)", "def max_y_arg(self):\n return max((self(0).y,0), (self(1).y,1))[1]", "def getMaxY(self):\n return self.maxy", "def get_max_y(self) -> float:\n return self.pendulum2.get_max_y()", "def getYLimit(self):\n return ...
[ "0.79613554", "0.78683895", "0.7839702", "0.7352151", "0.73371184", "0.7322131", "0.72898877", "0.7154325", "0.7135273", "0.711554", "0.6986447", "0.69081545", "0.6864131", "0.6818311", "0.66734755", "0.6637421", "0.6637421", "0.663179", "0.64385056", "0.6435802", "0.6428614"...
0.8015036
0
Get limit of Yaxis
def getXLimit(self): return self.axes.get_xlim()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getYLimit(self):\n return self.axes.get_ylim()", "def getYLimit(self):\n return self._myCanvas.getYLimit()", "def get_ylim(self):\n if isinstance(self._frame, root.TH1F):\n return (self._frame.GetMinimum(), self._frame.GetMaximum())\n else:\n return (self._...
[ "0.8265511", "0.75236475", "0.7141598", "0.7037268", "0.7024883", "0.69983655", "0.69983655", "0.6991727", "0.69353473", "0.69142056", "0.68743515", "0.67710173", "0.6748132", "0.66947263", "0.6654522", "0.6604168", "0.6550604", "0.65480614", "0.65154654", "0.64956313", "0.64...
0.0
-1
Get limit of Yaxis
def getYLimit(self): return self.axes.get_ylim()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getYLimit(self):\n return self._myCanvas.getYLimit()", "def get_ylim(self):\n if isinstance(self._frame, root.TH1F):\n return (self._frame.GetMinimum(), self._frame.GetMaximum())\n else:\n return (self._frame.GetYaxis().GetXmin(), self._frame.GetYaxis().GetXmax())",...
[ "0.75236475", "0.7141598", "0.7037268", "0.7024883", "0.69983655", "0.69983655", "0.6991727", "0.69353473", "0.69142056", "0.68743515", "0.67710173", "0.6748132", "0.66947263", "0.6654522", "0.6604168", "0.6550604", "0.65480614", "0.65154654", "0.64956313", "0.64914024", "0.6...
0.8265511
0
Check if a point is within this rectangle
def isInternal(self, aPoint): if (aPoint.x >= self.pMin.x and aPoint.x <= self.pMax.x) \ and (aPoint.y >= self.pMin.y and aPoint.y <= self.pMax.y): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inside(point, rectangle):\n\n ll = rectangle.getP1() # assume p1 is ll (lower left)\n ur = rectangle.getP2() # assume p2 is ur (upper right)\n\n return ll.getX() < point.getX() < ur.getX() and ll.getY() < point.getY() < ur.getY()", "def inside(point, rectangle):\r\n\r\n ll = rectangle.getP1() # assu...
[ "0.8459191", "0.8448", "0.8276222", "0.82759917", "0.8263758", "0.81937826", "0.81937826", "0.8173055", "0.81075454", "0.81075454", "0.7951817", "0.78297275", "0.7829285", "0.7806901", "0.7800947", "0.7781443", "0.7757449", "0.77498335", "0.77234465", "0.7716403", "0.77064466...
0.68621826
78
Display 404.html if user clicks on a link that doesn't work or navigates to a page that does not exist.
def invalid_route(e): return render_template("404.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_not_found(e):\n return render_template(\"404.html\"), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def page_not_found(e):\n return render_template(\"404.html\", page_title=404)", "def page...
[ "0.798152", "0.7959293", "0.7959293", "0.7939192", "0.7917982", "0.79015326", "0.78965855", "0.78110796", "0.77109545", "0.7685571", "0.758875", "0.75545585", "0.7554513", "0.75172687", "0.75172687", "0.75172687", "0.75172687", "0.75172687", "0.75172687", "0.75172687", "0.751...
0.701538
68
Return True if the tile (m, n) has been cleaned. Assumes that (m, n) represents a valid tile inside the room.
def isTileCleaned(self, m, n): posx = math.floor(m) posy = math.floor(n) cleanOrDirty = 0 #dirty value if (posx,posy) in self.tiles.keys(): cleanOrDirty = self.tiles[(posx, posy)] #print "pos key found - clean or dirty value = " + str(cleanOrDirty) if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isTileCleaned(self, m, n):\n if (m, n) in self.clean_tiles:\n return True\n return False", "def isTileCleaned(self, m, n):\n return self.tiles[n][m] == True", "def isTileCleaned(self, m, n):\n \n if self.tiles[Position(m, n)] == 'clean':\n return Tru...
[ "0.8860509", "0.8857077", "0.8600327", "0.85327154", "0.8515746", "0.847085", "0.71480656", "0.6395455", "0.63458645", "0.6323974", "0.6269661", "0.6255303", "0.6246633", "0.6234912", "0.62200385", "0.62122416", "0.6193986", "0.6129132", "0.6123928", "0.6123849", "0.609755", ...
0.84705424
6
Return the total number of tiles in the room.
def getNumTiles(self): return self.numTiles #raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumTiles(self):\n return self.height * self.width", "def getNumTiles(self):\n return len(list(product(list(range(self.width+1))[1:], list(range(self.height+1))[1:])))", "def getNumTiles(self):\n return (self.width) * (self.height)", "def num_tiles(self):\n return self.num_row_t...
[ "0.8205867", "0.81903553", "0.81504375", "0.8046322", "0.8039323", "0.79811716", "0.7871275", "0.7472709", "0.7407938", "0.7151273", "0.7067083", "0.6982381", "0.69224", "0.6857802", "0.6832814", "0.6813225", "0.67038375", "0.66893554", "0.66816777", "0.6676057", "0.66583914"...
0.78123623
7
Return a random position inside the room.
def getRandomPosition(self): posx = random.randrange(0, self.width) posy= random.randrange(0, self.height) randPos = Position(posx, posy) return randPos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRandomPosition(self):\n return Position(random.random()*self.w, random.random()*self.h)", "def getRandomPosition(self):\n x = random.randint(0, self.width - 1)\n y = random.randint(0, self.height - 1)\n return Position(x, y)", "def getRandomPosition(self):\n return Pos...
[ "0.84095305", "0.8408874", "0.8339333", "0.8331419", "0.8253471", "0.8129327", "0.79893064", "0.7975111", "0.79634804", "0.78944933", "0.76948863", "0.74812585", "0.74559724", "0.73774105", "0.73208076", "0.730955", "0.7219106", "0.7115554", "0.7098047", "0.70740753", "0.7016...
0.83306754
4
Return True if pos is inside the room.
def isPositionInRoom(self, pos): #if key tuple position(x,y) is in dictionary tiles return True else return False posx = pos.getX() posy = pos.getY() posx = math.floor(posx) posy = math.floor(posy) if (posx >= self.width) or (posy >= self.height): return False...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPositionInRoom(self, pos):\n posX = pos.getX()\n posY = pos.getY()\n if posX >= 0 and posX < self.width and posY >= 0 and posY < self.height:\n return True\n return False", "def isPositionInRoom(self, pos):\n if pos.getX() >= 0 and pos.getX() < self.w:\n ...
[ "0.85856265", "0.85830444", "0.8501791", "0.8394953", "0.8270461", "0.81534183", "0.7664707", "0.75780624", "0.7245776", "0.7134537", "0.70549065", "0.7034335", "0.6900973", "0.6892583", "0.6865422", "0.6829012", "0.6828001", "0.6822237", "0.68087435", "0.68055147", "0.679743...
0.79472804
6
Initializes a Robot with the given speed in the specified room. The robot initially has a random direction and a random position in the room. The robot cleans the tile it is on.
def __init__(self, room, speed): self.room = room self.speed = speed self.position = room.getRandomPosition() #then clean this first tile! self.room.cleanTileAtPosition(self.position) self.direction = random.randrange(0,359) #raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, room, speed):\n self.room = room\n self.position = room.getRandomPosition()\n # clean position the robot is on.\n self.room.cleanTileAtPosition(self.position)\n #set random value for direction\n self.direction = random.random()*360\n self.speed = ...
[ "0.8125557", "0.77230936", "0.7592438", "0.61862105", "0.59543926", "0.58640534", "0.5848188", "0.5805232", "0.5797039", "0.5790063", "0.57604414", "0.5734589", "0.5660592", "0.5609966", "0.555827", "0.5556169", "0.5551704", "0.54865193", "0.54490894", "0.54391056", "0.542069...
0.77279794
1
Set the direction of the robot to DIRECTION.
def setRobotDirection(self, direction): self.direction = direction #raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setRobotDirection(self, direction):\n self.direction = direction", "def setRobotDirection(self, direction):\n self.direction = direction", "def setDirection(self,stepDir = 2):\n pass", "def set_direction(self, new_dir):\n self.__direction = new_dir", "def set_direction(self,...
[ "0.74564767", "0.74564767", "0.71080387", "0.7050842", "0.7025068", "0.6972867", "0.6806668", "0.6626092", "0.6500536", "0.6461539", "0.64010406", "0.6326288", "0.63147664", "0.6281464", "0.6212341", "0.6212341", "0.6146971", "0.61024934", "0.60986555", "0.60986555", "0.60843...
0.7256985
3
Outputs the total energy of the given spin configuration
def Total_energy(angles): energy = 0 for i in range(0,4): energy += Single_spin_energy(i,angles) return energy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(self):\n self.E = - np.sum(self.phi) + 0.5 * self.mass * np.sqrt((self.v_x ** 2 + self.v_y **2))", "def energy_tot(P,F,H,molecule):\n return energy_el(P,F,H) + energy_n(molecule)", "def energy_function(self):\n E = 0\n for i in range(len(self.config)):\n for j in r...
[ "0.6324113", "0.6247011", "0.60491854", "0.60466695", "0.59428436", "0.591719", "0.5911947", "0.58963424", "0.58858967", "0.58377", "0.5803956", "0.5790898", "0.57766014", "0.5766067", "0.5750985", "0.5746054", "0.57380354", "0.56743914", "0.56682783", "0.5667951", "0.5657655...
0.6347612
0
Universal function for getting the last check timestamp from the database.
def get_time_from_db(): if not (date := select(date for date in LastestCheck).order_by(lambda date: desc(date.id)).first()): date = LastestCheck(timestamp=int(datetime.timestamp(datetime.now()))) commit() return date.timestamp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_refreshed_on_time():\n last_checked_on = Feed.select().aggregate(fn.Max(Feed.last_checked_on))\n if last_checked_on: \n return datetime_as_epoch(last_checked_on)\n \n # Return a fallback value\n return datetime_as_epoch(datetime.utcnow())", "def get_last_entry_ti...
[ "0.7620695", "0.7239033", "0.71900094", "0.7068376", "0.7060469", "0.7007021", "0.690555", "0.69018924", "0.6866147", "0.6823457", "0.6808223", "0.6682971", "0.6656807", "0.6656807", "0.6591904", "0.657678", "0.656801", "0.65632534", "0.6553776", "0.6547247", "0.6525119", "...
0.843174
0
Universal function for putting the current timestamp to the database.
def put_time_to_db(timestamp): current = LastestCheck(timestamp=timestamp) commit() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_timestamp(self, timestamp):\n return self.insert_into_database(database_name = self.database_name,\n table_name = 'analysisprofile',\n column_names = ['table_name', 'type_name', 'timestamp'],\n ...
[ "0.7050297", "0.7008639", "0.6838591", "0.6727643", "0.66863275", "0.66773427", "0.6626668", "0.65469885", "0.652817", "0.6497407", "0.6490424", "0.6490161", "0.6482401", "0.6470913", "0.6462958", "0.6431067", "0.6386423", "0.63814455", "0.63661665", "0.6362835", "0.6331277",...
0.78021604
0
Find closest range that includes item. Items in `ranges` and `what_to_find` must be comparable.
def _find_closest_in_range(ranges: Iterable[CT], what_to_find: CT) -> Optional[CT]: ranges = sorted(ranges) while ranges: middle_item_index = len(ranges) // 2 middle_item = ranges[middle_item_index] if what_to_find == middle_item: return what_to_find elif what_to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getrange(self, item: Union[T, Iterable[T], 'RangeSet']) -> Rangelike:\n if item in self:\n for rng in self._ranges:\n if item in rng:\n return rng\n # if that doesn't work, try iterating through it\n # if this comes up non-empty, then re...
[ "0.59909505", "0.59014136", "0.5696106", "0.5512061", "0.5499331", "0.5481417", "0.54173446", "0.54109436", "0.52654797", "0.514055", "0.51252985", "0.5076432", "0.5072844", "0.50693536", "0.5057959", "0.5017377", "0.49474496", "0.49372503", "0.49328104", "0.49114496", "0.488...
0.8241459
0
Returns the concrete implementation of this class that is activated in the currently running application.
def get_implementation(cls): return get_implementation('draftcalculationset')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_active(cls):\n\n\t\tif cls._interface:\n\t\t\twindow = cls._interface.get_active()\n\t\t\tif window:\n\t\t\t\treturn cls(window)\n\t\t\telse:\n\t\t\t\treturn None\n\t\telse:\n\t\t\traise NotImplementedError('Unsupported platform')", "def get_implementation(self):\n return self.__capabilities[\"IMP...
[ "0.7264234", "0.69521856", "0.6431449", "0.63812023", "0.63368917", "0.6294266", "0.6200229", "0.6143116", "0.5998701", "0.59842914", "0.59648526", "0.5946588", "0.5946588", "0.59409744", "0.5918161", "0.58731633", "0.58670205", "0.58601266", "0.58522797", "0.5844307", "0.584...
0.0
-1
The Unique Identifier that represents this DraftCalculationSet in the datastore. Read only.
def uid(self): return self._uid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self):\n return self._id", "def unique_id(self):\n return self._id", "def getUniqueID(self):\n return self.unique_id", "def unique_id(self):\n return self._unique_id", "def unique_id(self):\n return self._unique_id", "def unique_id(self):\n return s...
[ "0.7288059", "0.7288059", "0.7219837", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "0.7182736", "...
0.0
-1
The DraftInstrumentVersion that this DraftCalculationSet is associated with. Read only.
def draft_instrument_version(self): if isinstance(self._draft_instrument_version, str): div_impl = get_implementation('draftinstrumentversion') return div_impl.get_by_uid(self._draft_instrument_version) else: return self._draft_instrument_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_firmata_version(self):\n return self.firmata_version", "def get_version(self):\n return self._version", "def get_version(self):\n return self._version", "def version(self):\r\n return self.definition_id", "def get_version(self):\r\n\r\n return self.versions[0].num...
[ "0.6429964", "0.6296803", "0.6296803", "0.6266581", "0.62297416", "0.6171772", "0.6166159", "0.6131871", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.6121966", "0.61139894", ...
0.7446886
0
Returns a unicode string that represents this DraftCalculationSet, suitable for use in humanvisible places.
def get_display_name(self): return to_unicode(self.uid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self) -> str:\n if self.afix and self.shx.frag:\n # An atom from a FRAG/FEND instruction\n return Atom._fragatomstr.format(self.name, self.x, self.y, self.z)\n else:\n if sum([abs(u) for u in self.uvals[2:]]) > 0.00001 and not self.qpeak:\n ...
[ "0.6583114", "0.655105", "0.6497109", "0.6391775", "0.6389378", "0.63841146", "0.63523316", "0.63523316", "0.6351772", "0.63037384", "0.6295328", "0.62944436", "0.6290646", "0.6235966", "0.62019545", "0.61869335", "0.6182589", "0.61641157", "0.61603343", "0.6145033", "0.61375...
0.0
-1
Adds a new colorbar with appropriate land cover colours and labels. For DEA Land Cover Level 4 data, this function must be used with a double plot. The 'ax' should be on the left side of the figure, and the colour bar will added on the right hand side.
def make_colorbar(fig, ax, measurement, horizontal=False, animation=False): # Create new axis object for colorbar # parameters for add_axes are [left, bottom, width, height], in # fractions of total plot if measurement == 'level4' and animation == True: # special spacing settings f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_colorbar(self, fig, ax, bounds, colormap, label=\"\"):\n import matplotlib as mpl\n pos = ax.get_position()\n cpos = [pos.x1 + 0.025, pos.y0 + 0.0125,\n 0.015, pos.height * 0.4] # this list defines (left, bottom, width, height\n cax = fig.add_axes(...
[ "0.71719074", "0.6997285", "0.6997285", "0.669836", "0.6589449", "0.6548926", "0.6535307", "0.6534403", "0.64707905", "0.61600375", "0.6088786", "0.6042188", "0.6027793", "0.6013357", "0.6005772", "0.58875835", "0.58337307", "0.5830993", "0.58112824", "0.5753336", "0.57336825...
0.62691385
9
Check that the argument is not an existing category shortcut name.
async def is_not_category_shortcut_name(argument, context, verbose=True): return await is_not_shortcut_name(argument, context, "category", verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def is_not_shortcut_name(argument, context, platform_type, verbose):\n data_object = getattr(context, platform_type + \"_data\")\n if argument not in data_object.shortcuts:\n return argument\n\n if verbose:\n custom_msg = await context.language.get_text(\n \"existing_\" + pl...
[ "0.7714414", "0.76516664", "0.71216595", "0.6816582", "0.6740102", "0.66602737", "0.61879903", "0.6073239", "0.5952041", "0.58476436", "0.5802075", "0.57566094", "0.57301205", "0.5690447", "0.5583418", "0.5580576", "0.55643153", "0.55020016", "0.54982567", "0.54508346", "0.54...
0.827925
0
Check that the argument is not an existing channel shortcut name.
async def is_not_channel_shortcut_name(argument, context, verbose=True): return await is_not_shortcut_name(argument, context, "channel", verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def is_not_shortcut_name(argument, context, platform_type, verbose):\n data_object = getattr(context, platform_type + \"_data\")\n if argument not in data_object.shortcuts:\n return argument\n\n if verbose:\n custom_msg = await context.language.get_text(\n \"existing_\" + pl...
[ "0.8021469", "0.77694243", "0.76260203", "0.75722325", "0.7248981", "0.7163433", "0.68407595", "0.6828904", "0.6738982", "0.6223066", "0.6189678", "0.6130569", "0.6077997", "0.60470206", "0.5755157", "0.57352763", "0.55038905", "0.5478418", "0.5454215", "0.5315024", "0.530802...
0.84186035
0
Check that the argument is not an existing user shortcut name.
async def is_not_user_shortcut_name(argument, context, verbose=True): return await is_not_shortcut_name(argument, context, "user", verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def is_not_shortcut_name(argument, context, platform_type, verbose):\n data_object = getattr(context, platform_type + \"_data\")\n if argument not in data_object.shortcuts:\n return argument\n\n if verbose:\n custom_msg = await context.language.get_text(\n \"existing_\" + pl...
[ "0.82053435", "0.7482318", "0.7463285", "0.73930466", "0.71741325", "0.7152495", "0.6540151", "0.65401393", "0.6266788", "0.6210341", "0.6193953", "0.60781914", "0.6072022", "0.59953326", "0.5864005", "0.5799297", "0.56280684", "0.5585906", "0.5585906", "0.55737007", "0.55294...
0.83287245
0
Check that the argument is an existing category shortcut name.
async def is_category_shortcut_name(argument, context, verbose=True): return await is_shortcut_name(argument, context, "category", verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def is_not_category_shortcut_name(argument, context, verbose=True):\n return await is_not_shortcut_name(argument, context, \"category\", verbose)", "async def is_not_shortcut_name(argument, context, platform_type, verbose):\n data_object = getattr(context, platform_type + \"_data\")\n if argument ...
[ "0.77973664", "0.72644895", "0.72339296", "0.6776437", "0.6587396", "0.6404537", "0.6306758", "0.62658197", "0.62185323", "0.60457426", "0.60327756", "0.5943239", "0.57920647", "0.57240665", "0.57042533", "0.5626002", "0.5623887", "0.5571702", "0.54368025", "0.5416069", "0.53...
0.83351207
0
Check that the argument is an existing channel shortcut name.
async def is_channel_shortcut_name(argument, context, verbose=True): return await is_shortcut_name(argument, context, "channel", verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def is_not_channel_shortcut_name(argument, context, verbose=True):\n return await is_not_shortcut_name(argument, context, \"channel\", verbose)", "async def is_shortcut_name(argument, context, platform_type, verbose):\n data_object = getattr(context, platform_type + \"_data\")\n if argument in dat...
[ "0.7970405", "0.7644696", "0.76247466", "0.73243815", "0.73227364", "0.7235993", "0.7053422", "0.695774", "0.6666271", "0.66454387", "0.65955013", "0.6527631", "0.6350113", "0.6033046", "0.5913773", "0.5825547", "0.5636676", "0.5555158", "0.5408972", "0.5294163", "0.5292916",...
0.8366964
0
The user's current status
def state(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_status(cls):\n return jsonify(status=cls._user_status())", "def status(self):\n return UserStatuses.Pending.value", "def status(self) -> str:\n return pulumi.get(self, \"status\")", "def status(self) -> str:\n return pulumi.get(self, \"status\")", "def status(self) -> s...
[ "0.7699138", "0.76246744", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374", "0.75170374",...
0.0
-1
Sets default input parameters for optimization
def __init__(self, encut, name="relax_settings"): ionic = {"EDIFF": 1E-17, "NSW": 20, "IBRION": 2,"ISIF": 2, "ISYM": -1, "NBLOCK": 1, "KBLOCK": 20} InputParameters.__init__(self, ionic_settings=ionic, name=name) self.update_electronic_sttings("ENCUT", encut)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, defaults={}, data=None):\n\n super().__init__(\n defaults={**OptimizationParameters.parameters, **defaults}, data=data\n )", "def set_default_parameters(self):\n super().set_default_parameters()", "def set_default_parameters(self):\n super().set_default...
[ "0.7754295", "0.73901623", "0.72867495", "0.71303463", "0.71303463", "0.71303463", "0.71063876", "0.6973967", "0.6917061", "0.68457067", "0.68178463", "0.6796467", "0.67123127", "0.67046577", "0.6677439", "0.6677376", "0.66621226", "0.66601384", "0.6644934", "0.66376185", "0....
0.0
-1
Gets the id of this Attribution. Unique ID
def id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self):\n return self._id", "def unique_id(self):\n return self._id", "def get_id(self):\n return self.__id", "def get_id(self):\n return self.__id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n...
[ "0.7676196", "0.7676196", "0.7439954", "0.7439954", "0.7434042", "0.7434042", "0.7434042", "0.7434042", "0.7434042", "0.7434042", "0.74323577", "0.74294955", "0.73866296", "0.73866296", "0.73866296", "0.73866296", "0.73866296", "0.73866296", "0.73866296", "0.73866296", "0.738...
0.0
-1
Sets the id of this Attribution. Unique ID
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_=None):\n if id_ is None:\n self.id = id(self)\n else:\n self.id = id_", "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.data['id'] = id", "def SetId(self, id):\...
[ "0.75763136", "0.7568043", "0.75300276", "0.73452944", "0.7331687", "0.73202986", "0.73202986", "0.73202986", "0.73202986", "0.73202986", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.728498", "0.7...
0.0
-1