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 |
|---|---|---|---|---|---|---|
Add agent to model's spill queue. | def spill(self, agent):
self.spill_list.append(agent) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_to_grid_queue(self, agent):\n self.pipes[agent.grid_queue].send(\"add\")\n self.pipes[agent.grid_queue].send(agent)",
"def add_to_simulation(self,agent):\n self.agents[agent.name] = agent\n self.network.add_node(agent)\n \n #agent given a grid queue at initializa... | [
"0.7249907",
"0.724359",
"0.6364773",
"0.6199888",
"0.610778",
"0.59546876",
"0.59015363",
"0.58994764",
"0.5738974",
"0.5690717",
"0.5538615",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
"0.5536676",
... | 0.82388806 | 0 |
Returns the next action in the path chosen earlier (in registerInitialState). Return Directions.STOP if there is no further action to take. | def getAction(self, state):
if 'actionIndex' not in dir(self): self.actionIndex = 0
i = self.actionIndex
self.actionIndex += 1
if i < len(self.actions):
return self.actions[i]
else:
return Directions.STOP | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action(self):\n next_action = self.strategy.get_next_move(self)\n return next_action",
"def get_action(self, state):\n if self.globSeq == []:\n self.globSeq = self.graphSearch(state)\n if not(self.globSeq):\n return Directions.STOP\n return sel... | [
"0.72942245",
"0.703718",
"0.703718",
"0.6975734",
"0.687244",
"0.68233156",
"0.6763603",
"0.66571885",
"0.65745246",
"0.6558087",
"0.6465374",
"0.64216137",
"0.63660026",
"0.63593185",
"0.621351",
"0.61860585",
"0.6183947",
"0.6181521",
"0.61599606",
"0.61497635",
"0.6118962... | 0.701559 | 4 |
Validate if email is already used by other user. | def clean_email(self):
email = self.cleaned_data['email'].lower()
if User.objects.filter(email__iexact=email).exists():
raise ValidationError(_('A user with that email already exists.'))
return email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_email(self, email):\n if email.data != current_user.email:\n user = User.query.filter_by(email=email.data).first()\n if user:\n raise ValidationError('That email already exists. Please choose another email.')",
"def clean_email(self):\n try:\n ... | [
"0.7807831",
"0.7748905",
"0.7703968",
"0.77026623",
"0.7623712",
"0.76225734",
"0.75870395",
"0.75870395",
"0.7544878",
"0.75052977",
"0.7495125",
"0.7474632",
"0.7456973",
"0.7412911",
"0.738862",
"0.7304129",
"0.729272",
"0.7292294",
"0.7270725",
"0.72010756",
"0.71731097"... | 0.71971816 | 20 |
Validate password with settings constraints. | def clean_password(self):
password = self.cleaned_data.get('password')
password_validation.validate_password(self.cleaned_data.get('password'), self.instance)
return password | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_password(self, value):\n policy = PasswordPolicy.from_names(\n length=8, # min length: 8\n uppercase=1, # need min. 1 uppercase letter\n numbers=1, # need min. 1 digit\n special=1, # need min. 1 special characters\n nonletters=1,\n ... | [
"0.7843949",
"0.78396183",
"0.76012516",
"0.754959",
"0.75224483",
"0.74456346",
"0.7356819",
"0.7329701",
"0.729943",
"0.7290045",
"0.7280439",
"0.7245891",
"0.7228651",
"0.7214994",
"0.7207353",
"0.7188498",
"0.7177668",
"0.71768767",
"0.7148098",
"0.7129629",
"0.7114455",
... | 0.69429576 | 31 |
Creates a DataBucket to be used for strategy tuning. | def get_data_bucket_for_strategy_tuning(
app_path: str,
tuning_level: list,
train_pattern: str,
test_pattern: str,
train_seed_pct: float,
):
label_map = LabelMap.create_label_map(app_path, train_pattern)
resource_loader = ResourceLoader.create_resource_loader(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_bucket() -> None:\n try:\n client.make_bucket(DATASETS_BUCKET)\n except BucketAlreadyOwnedByYou:\n logger.debug(f\"Not creating bucket {DATASETS_BUCKET}: Bucket already exists\")\n pass\n else:\n logger.debug(f\"Successfully created bucket {DATASETS_BUCKET}\")",
"d... | [
"0.66712546",
"0.64462686",
"0.6387001",
"0.63800037",
"0.6142138",
"0.6073936",
"0.6030172",
"0.59908855",
"0.59375703",
"0.59357345",
"0.5933943",
"0.5915313",
"0.59029347",
"0.58879966",
"0.58430094",
"0.57862043",
"0.57170695",
"0.5711254",
"0.56925535",
"0.56899697",
"0.... | 0.6229102 | 4 |
Sets the check_revocation of this TypesConsoleCertificateSettings. | def check_revocation(self, check_revocation):
self._check_revocation = check_revocation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_compatibility_check(check_status):\r\n if Config.loaded:\r\n raise Exception(\"compatibility_check must be set before before \" \\\r\n \"using any other functionalities in libclang.\")\r\n\r\n Config.compatibility_check = check_status",
"def svn_client_... | [
"0.50971395",
"0.45247346",
"0.4501634",
"0.44256946",
"0.43760172",
"0.43499175",
"0.43033206",
"0.42995754",
"0.42879218",
"0.42419428",
"0.42351454",
"0.42196298",
"0.41943878",
"0.41834015",
"0.4180629",
"0.4163931",
"0.4148873",
"0.41426238",
"0.41319498",
"0.41168395",
... | 0.7481139 | 0 |
Sets the console_ca_cert of this TypesConsoleCertificateSettings. | def console_ca_cert(self, console_ca_cert):
self._console_ca_cert = console_ca_cert | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ca_cert(self, ca_cert):\n\n self._ca_cert = ca_cert",
"def console_custom_cert(self, console_custom_cert):\n\n self._console_custom_cert = console_custom_cert",
"def ca_cert_path(self, ca_cert_path: str):\n\n self._ca_cert_path = ca_cert_path",
"def save_ca():\n cert_file = os... | [
"0.68265325",
"0.65130776",
"0.6440239",
"0.58595866",
"0.5228995",
"0.5037131",
"0.5037131",
"0.5013002",
"0.490777",
"0.48871157",
"0.48593655",
"0.48507708",
"0.48467252",
"0.4803529",
"0.48032707",
"0.47784925",
"0.4713782",
"0.46828216",
"0.46399626",
"0.4594442",
"0.456... | 0.85301137 | 0 |
Sets the console_custom_cert of this TypesConsoleCertificateSettings. | def console_custom_cert(self, console_custom_cert):
self._console_custom_cert = console_custom_cert | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def console_ca_cert(self, console_ca_cert):\n\n self._console_ca_cert = console_ca_cert",
"def set_custom_property(self, sNewVmCustomProperty):\n\t\tcall_sdk_function('PrlVmCfg_SetCustomProperty', self.handle, sNewVmCustomProperty)",
"def custom_compliance_domain(self, custom_compliance_domain):\n\n ... | [
"0.6610284",
"0.54055816",
"0.53626394",
"0.52227587",
"0.51395243",
"0.5006331",
"0.49909642",
"0.4988925",
"0.49661958",
"0.49389002",
"0.49314305",
"0.49158552",
"0.489311",
"0.4870659",
"0.48248613",
"0.4814451",
"0.47850242",
"0.4669491",
"0.460155",
"0.4534467",
"0.4508... | 0.8813465 | 0 |
Sets the hpkp of this TypesConsoleCertificateSettings. | def hpkp(self, hpkp):
self._hpkp = hpkp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pssh(self, pssh):\n self._pssh = pssh\n return self",
"def hdp_version(self, hdp_version):\n\n self._hdp_version = hdp_version",
"def set_kp():\n kp = request.params.get(\"kp\", 0, type=float)\n pid = request.params.get(\"pid\", 1, type=int)\n retval = RP_LIB.rp_PIDSetKp(pid, ... | [
"0.56403214",
"0.5224331",
"0.5040199",
"0.50149983",
"0.48443633",
"0.48201424",
"0.48000458",
"0.4754778",
"0.47419602",
"0.4728604",
"0.46491504",
"0.45619443",
"0.45580828",
"0.45580828",
"0.45580828",
"0.4547807",
"0.4547807",
"0.4547807",
"0.4473194",
"0.4460671",
"0.44... | 0.7709247 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, TypesConsoleCertificateSettings):
return False
return self.to_dict() == other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, TypesConsoleCertificateSettings):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
View function for home page of site. | def summary(request):
# Generate counts of some of the main objects
num_courses = models.Course.objects.all().count()
num_quizzes = models.Quiz.objects.all().count()
num_questions = models.Question.objects.count()
num_students = models.User.objects.count()
num_visits = request.session.get('num_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home(request):\n\treturn render(request, \"compta/home.html\")",
"def home_page(request):\r\n return render(request, 'ez_main/home_page.html')",
"def home(request):\r\n return render(request, 'home.html')",
"def homepage(request):\n\treturn render(request, 'core/homepage.html')",
"def homepage(req... | [
"0.8493426",
"0.84268916",
"0.83415145",
"0.83306193",
"0.82976943",
"0.8295291",
"0.8276345",
"0.82545686",
"0.82155704",
"0.8132563",
"0.81246215",
"0.81224865",
"0.8121264",
"0.81049734",
"0.8098485",
"0.80935514",
"0.80935514",
"0.80935514",
"0.80935514",
"0.80935514",
"0... | 0.0 | -1 |
Gives default department by checking if present in the context | def get_default_department_id(self, cr, uid, context=None):
user_obj = self.pool.get('res.users').browse(cr,uid,uid).employee_ids
if user_obj:
dept_id = self.pool.get('res.users').browse(cr,uid,uid).employee_ids[0].department_id and self.pool.get('res.users').browse(cr,uid,uid).employee_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def department(self):\n if \"department\" in self._prop_dict:\n return self._prop_dict[\"department\"]\n else:\n return None",
"def department(self):\n if \"department\" in self._prop_dict:\n return self._prop_dict[\"department\"]\n else:\n ... | [
"0.727264",
"0.727264",
"0.6299022",
"0.62791663",
"0.6205959",
"0.6025972",
"0.59099317",
"0.58730555",
"0.5781836",
"0.5762072",
"0.57508874",
"0.5684379",
"0.5670995",
"0.564136",
"0.5601505",
"0.5576277",
"0.5553041",
"0.55370617",
"0.5526694",
"0.55206823",
"0.5495728",
... | 0.8002562 | 0 |
Return a string that identifies the current platform. By default, will return the value returned by sysconfig.get_platform(), but it can be changed by calling set_platform(). | def get_platform():
global _PLATFORM
if _PLATFORM is None:
_PLATFORM = _sysconfig.get_platform()
return _PLATFORM | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def PlatformName():\n if override_platform_name:\n return override_platform_name\n if IsWindows():\n return 'win32'\n if IsLinux():\n return 'linux'\n if IsMac():\n return 'mac'\n raise NotImplementedError('Unknown platform \"%s\".' % sys.platform)",
"def current_platform() -> str:\n if sys.p... | [
"0.86419976",
"0.86189526",
"0.84946406",
"0.84425676",
"0.84221816",
"0.8408329",
"0.8267858",
"0.8102998",
"0.80069953",
"0.79900736",
"0.79565233",
"0.79265183",
"0.78920996",
"0.78262705",
"0.77958465",
"0.7738521",
"0.77015126",
"0.7699097",
"0.76611334",
"0.765293",
"0.... | 0.83564013 | 6 |
Return 'pathname' with 'new_root' prepended. If 'pathname' is relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. | def change_root(new_root, pathname):
if os.name == 'posix':
if not os.path.isabs(pathname):
return os.path.join(new_root, pathname)
else:
return os.path.join(new_root, pathname[1:])
elif os.name == 'nt':
(drive, path) = os.path.splitdrive(pathname)
if pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addPathPrefix(prefix, pathname):\n new_pathname = os.path.join(os.path.dirname(pathname), prefix + os.path.basename(pathname))\n return new_pathname",
"def makepath(plname,root):\n if (root.endswith('/') and not plname[0] =='/' ) or ( not root.endswith('/') and plname[0] =='/') :\n return ro... | [
"0.6437045",
"0.59677273",
"0.5884409",
"0.57894766",
"0.5737389",
"0.56540275",
"0.5632758",
"0.560187",
"0.55786604",
"0.55463153",
"0.54867226",
"0.5479389",
"0.5465328",
"0.5434634",
"0.5426187",
"0.5377088",
"0.5376396",
"0.52881503",
"0.5265455",
"0.5238494",
"0.5189643... | 0.77424914 | 0 |
Generate a useful error message from an EnvironmentError. This will generate an IOError or an OSError exception object. Handles Python 1.5.1 and 1.5.2 styles, and does what it can to deal with exception objects that don't have a filename (which happens when the error is due to a twofile operation, such as 'rename()' or... | def grok_environment_error(exc, prefix="error: "):
# check for Python 1.5.2-style {IO,OS}Error exception objects
if hasattr(exc, 'filename') and hasattr(exc, 'strerror'):
if exc.filename:
error = prefix + "%s: %s" % (exc.filename, exc.strerror)
else:
# two-argument functi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exception_message():\n def get_os_release():\n \"\"\"Returns detailed OS release.\"\"\"\n if platform.linux_distribution()[0]:\n return \" \".join(platform.linux_distribution())\n elif platform.mac_ver()[0]:\n return \"%s %s\" % (platform.mac_ver()[0], platform.mac... | [
"0.6228609",
"0.61467487",
"0.6119618",
"0.6091069",
"0.6041068",
"0.6019442",
"0.60053355",
"0.60053355",
"0.60053355",
"0.59858197",
"0.59780866",
"0.59780866",
"0.59780866",
"0.59780866",
"0.59780866",
"0.59780866",
"0.59780866",
"0.59780866",
"0.5958574",
"0.59230393",
"0... | 0.79304963 | 0 |
Split a string up according to Unix shelllike rules for quotes and backslashes. | def split_quoted(s):
# This is a nice algorithm for splitting up a single string, since it
# doesn't require character-by-character examination. It was a little
# bit of a brain-bender to get it working right, though...
if _wordchars_re is None:
_init_regex()
s = s.strip()
words = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split(s, posix=True):\n if isinstance(s, bytes):\n s = s.decode(\"utf-8\")\n return shlex.split(s, posix=posix)",
"def shlex_split(str_to_split: str) -> List[str]:\n return shlex.split(str_to_split, comments=False, posix=False)",
"def shlex_split(self, text):\n if six.PY2:\n ... | [
"0.78362286",
"0.7329921",
"0.7217792",
"0.72064894",
"0.71627724",
"0.7052283",
"0.705191",
"0.67389745",
"0.65934944",
"0.65557235",
"0.655108",
"0.6530101",
"0.64702815",
"0.63966805",
"0.6376275",
"0.6368482",
"0.6346435",
"0.62923265",
"0.62834394",
"0.6271737",
"0.62683... | 0.6048011 | 26 |
Return a version of the string escaped for inclusion in an RFC822 header, by ensuring there are 8 spaces space after each newline. | def rfc822_escape(header):
lines = header.split('\n')
sep = '\n' + 8 * ' '
return sep.join(lines) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tidy_string(s: str\n ) -> str:\n s = s.encode('ascii', errors='ignore').decode(FORMAT)\n s = s.replace(\"\\r\", \"\").replace(\"\\t\", \"\").replace('\\n', '') \n return s",
"def beautify(text):\n text = re.sub('\\n{3,}', '\\n\\n', text)\n text = re.sub('\\n+$', '\\n', text)\n ... | [
"0.6096191",
"0.5934842",
"0.59084433",
"0.59060633",
"0.5887525",
"0.5677352",
"0.5667074",
"0.56499064",
"0.56388175",
"0.55878687",
"0.55177206",
"0.5498205",
"0.5489415",
"0.54656357",
"0.5455645",
"0.54367644",
"0.54303896",
"0.5425611",
"0.53949904",
"0.538119",
"0.5353... | 0.7909112 | 0 |
Like os.path.splitext, but take off .tar too | def splitext(path):
base, ext = posixpath.splitext(path)
if base.lower().endswith('.tar'):
ext = base[-4:] + ext
base = base[:-4]
return base, ext | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_ext(filepath):\n\t(fn, ext) = os.path.splitext(filepath)\n\tif ext=='.gz':\n\t\t(fn, ext) = os.path.splitext(fn)\n\t\text += '.gz'\n\treturn (fn, ext)",
"def splitext( filename ):\n index = filename.find('.')\n if index == 0:\n index = 1+filename[1:].find('.')\n if index == -1:\n ... | [
"0.7256462",
"0.7026987",
"0.68934464",
"0.6722942",
"0.66994846",
"0.66748786",
"0.66710615",
"0.66696054",
"0.66661364",
"0.6614728",
"0.65565413",
"0.6543803",
"0.6525695",
"0.64786565",
"0.645979",
"0.64352673",
"0.64048153",
"0.63310933",
"0.6310813",
"0.62845665",
"0.62... | 0.80011797 | 0 |
Quote commandline arguments for DOS/Windows conventions. Just wraps every argument which contains blanks in double quotes, and returns a new argument list. | def _nt_quote_args(args):
# XXX this doesn't seem very robust to me -- but if the Windows guys
# say it'll work, I guess I'll have to accept it. (What if an arg
# contains quotes? What other magic characters, other than spaces,
# have to be escaped? Is there an escaping mechanism other than
# quo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote_arguments(args):\n if isinstance(args, str):\n args_list = [args]\n else:\n args_list = args\n\n quoted_args = []\n for a in args_list:\n qa = _double_up_quotes(a)\n if \" \" in qa or \"'\" in qa:\n qa = \"'\" + qa + \"'\"\n quoted_args.append(qa)... | [
"0.727529",
"0.7251283",
"0.72008514",
"0.685263",
"0.67948896",
"0.6764882",
"0.6530536",
"0.6420306",
"0.637898",
"0.63067955",
"0.6251415",
"0.62015647",
"0.6195781",
"0.6184979",
"0.6129439",
"0.6106405",
"0.6061542",
"0.5926107",
"0.5858475",
"0.5774904",
"0.5765774",
... | 0.78102744 | 0 |
Verifies an input team is acceptable and returns a boolean | def isValidTeamSize(size, minimum, maximum) :
return isInteger(size) and int(size) >= minimum and int(size) <= maximum | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def validate_team(\n self, team, battle_format, *, delay=0, lifespan=math.inf\n ):\n battle_format = utils.name_to_id(battle_format)\n team = team or \"null\"\n await self.upload_team(team, delay=delay, lifespan=lifespan)\n await self.add_output(\n \"|/vtm {}\... | [
"0.67006654",
"0.6519993",
"0.6371233",
"0.63663113",
"0.63397926",
"0.6335435",
"0.6324468",
"0.6309282",
"0.63051116",
"0.6235396",
"0.6210397",
"0.6076636",
"0.604586",
"0.5996683",
"0.5972928",
"0.59400946",
"0.5881027",
"0.58694565",
"0.58569884",
"0.5838882",
"0.5816535... | 0.56892246 | 30 |
Provide tests for request to retrieve non existent objects. | def test_get_not_found(self):
url = reverse('notification', kwargs={'way_id': 999, 'notification_id': 100})
response = self.client.get(url)
self.assertEqual(response.status_code, 400)
url = reverse('notification', kwargs={'way_id': 100, 'notification_id': 999})
response = self.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_no_results(self):\n self.factory.create()\n response = self._get(get_kwargs={'search': 'hello'})\n self.assertEquals(response.status_code, 200)\n self.assertTemplateUsed(response, self.template_name)\n self.assertEquals(response.context['object_list'].count(), 0)",
"de... | [
"0.75758815",
"0.71741575",
"0.71435493",
"0.71141475",
"0.7053728",
"0.70359236",
"0.69748956",
"0.69697344",
"0.69670606",
"0.6834804",
"0.6827738",
"0.68085784",
"0.68022287",
"0.6796541",
"0.6785499",
"0.6772848",
"0.6761102",
"0.6751092",
"0.6740959",
"0.6734323",
"0.673... | 0.0 | -1 |
Method that tests the success post request for creating notification. | def test_post_success(self):
data = {
'start_time': '2019-10-29',
'end_time': '2019-12-29',
'week_day': 6,
'time': '23:58:59'
}
expected_data = {
'way': 100,
'start_time': '2019-10-29',
'end_time': '2019-12-29'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_successfully_create_notifications(self):\n pre_function_notifications = Notification.objects.all()\n self.assertEqual(len(pre_function_notifications), 0)\n\n create_notification(\n user=self.user_with_targets,\n title=\"Hi.\",\n body=\"Hello there, fri... | [
"0.7629735",
"0.7618578",
"0.7364911",
"0.7363563",
"0.7363563",
"0.7052963",
"0.7042657",
"0.69984055",
"0.6988693",
"0.6985212",
"0.6984905",
"0.68905956",
"0.6883018",
"0.68676347",
"0.6836012",
"0.6821067",
"0.67853075",
"0.6779246",
"0.6734471",
"0.6721667",
"0.66970336"... | 0.7656309 | 0 |
Method that tests unsuccessful post request for creating notification with invalid post data. | def test_post_invalid_data(self):
data = {
'week_day': 'd',
'time': 'd'
}
url = reverse('notification',
kwargs={'way_id': self.notification.way_id, 'notification_id': self.notification.id})
response = self.client.post(url, json.dumps(data, cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_invalid_submission(self):\n with self.client:\n # invalid submission registration\n sub_response = register_illegal_submission(self, self.token)\n response_data = json.loads(sub_response.data.decode())\n self.assertTrue(response_data['errors']!=Non... | [
"0.748908",
"0.7362392",
"0.727116",
"0.7229355",
"0.7158507",
"0.7016817",
"0.69638264",
"0.695092",
"0.69368654",
"0.689105",
"0.6859958",
"0.6832937",
"0.68327",
"0.68105704",
"0.67939985",
"0.6764749",
"0.6753879",
"0.6751137",
"0.6747767",
"0.67406535",
"0.67373455",
"... | 0.77954644 | 0 |
Method that tests unsuccessful post request with empty JSON data. | def test_post_empty_json(self):
data = {}
url = reverse('notification',
kwargs={'way_id': self.notification.way_id, 'notification_id': self.notification.id})
response = self.client.post(url, json.dumps(data, cls=DjangoJSONEncoder), content_type='application/json')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testMissingData(self):\n data = {\n \"title\": \"Example Post\",\n }\n\n response = self.client.post(\"/api/posts\",\n data=json.dumps(data),\n content_type=\"application/json\",\n headers=[(\"Accept\", \"application/json\")]\n )\n\n ... | [
"0.80441666",
"0.7749052",
"0.77270865",
"0.7574347",
"0.7527644",
"0.7512489",
"0.7511428",
"0.7503339",
"0.750238",
"0.7471226",
"0.73760986",
"0.73705995",
"0.7363015",
"0.73613787",
"0.7355544",
"0.73533607",
"0.73203945",
"0.72921515",
"0.7282576",
"0.72331876",
"0.72312... | 0.7766148 | 1 |
Method that tests when notification was not created | def test_db_creating_post(self):
data = {
'start_time': '2019-10-29',
'end_time': '2019-12-29',
'week_day': 6,
'time': '23:58:59'
}
url = reverse('notification',
kwargs={'way_id': self.notification.way_id, 'notification_id': ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_registered_no_notifications(self):\n msg = self._send(self.reg_conn, '1')\n self.assertEqual(len(msg.responses), 1)\n self.assertEqual(msg.responses[0].text,\n self.app.no_reminders)",
"def test_registered_no_notifications(self):\n msg = self._send(sel... | [
"0.7590763",
"0.7590763",
"0.70368165",
"0.6943726",
"0.6893877",
"0.68580735",
"0.6836645",
"0.67977685",
"0.6790158",
"0.6781682",
"0.6740494",
"0.6719812",
"0.6718092",
"0.67094886",
"0.6702535",
"0.6676803",
"0.6672681",
"0.6672681",
"0.660182",
"0.6599026",
"0.6596544",
... | 0.5952441 | 87 |
Provide tests post request for updating notification with another `way_id`. | def test_put_wrong_way_id(self):
data = {
'start_time': '2019-10-29',
'end_time': '2019-12-29',
'week_day': 6,
'time': '23:58:59'
}
url = reverse('notification', kwargs={'way_id': 543, 'notification_id': self.notification.id})
response = se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_post_wrong_way_id(self):\n data = {\n 'start_time': '2019-10-29',\n 'end_time': '2019-12-29',\n 'week_day': 6,\n 'time': '23:58:59'\n }\n url = reverse('notification', kwargs={'way_id': 908, 'notification_id': self.notification.id})\n ... | [
"0.7309353",
"0.7287713",
"0.70464474",
"0.69682556",
"0.68557084",
"0.6814788",
"0.6658717",
"0.6463719",
"0.64070153",
"0.6393831",
"0.63803446",
"0.63698304",
"0.6313824",
"0.6292307",
"0.62720644",
"0.6193457",
"0.61715186",
"0.6160451",
"0.6157474",
"0.6146517",
"0.60856... | 0.75480807 | 0 |
Provide tests post request for updating notification with another `way_id`. | def test_put_from_another_way(self):
data = {
'start_time': '2019-10-29',
'end_time': '2019-12-29',
'week_day': 6,
'time': '23:58:59'
}
url = reverse('notification', kwargs={'way_id': 101, 'notification_id': self.notification.id})
response ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_put_wrong_way_id(self):\n data = {\n 'start_time': '2019-10-29',\n 'end_time': '2019-12-29',\n 'week_day': 6,\n 'time': '23:58:59'\n }\n url = reverse('notification', kwargs={'way_id': 543, 'notification_id': self.notification.id})\n ... | [
"0.7549038",
"0.73112965",
"0.70488214",
"0.6971227",
"0.685967",
"0.68185854",
"0.6662724",
"0.646378",
"0.640702",
"0.6395875",
"0.6385076",
"0.63703424",
"0.6313816",
"0.6292449",
"0.6273746",
"0.61928606",
"0.6171587",
"0.61620533",
"0.6157349",
"0.6145325",
"0.60851175",... | 0.72894514 | 2 |
Method that tests request to update object without notification id. | def test_put_non_id(self):
data = {
'time': '23:38:54'
}
url = reverse('notification',
kwargs={'way_id': self.notification.way_id})
response = self.client.put(url, json.dumps(data, cls=DjangoJSONEncoder), content_type='application/json')
self.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_update_no_data(self, valid_header_dict_with_user_id: Dict[str,\n Any]):\n headers = valid_header_dict_with_user_id\n update_json_payload = get_update_request_no_data()\n response = get_response_from_json(update_json... | [
"0.7326445",
"0.69764525",
"0.6881176",
"0.68677974",
"0.68598765",
"0.6816024",
"0.6782119",
"0.6691785",
"0.66868764",
"0.66868764",
"0.66868764",
"0.6674698",
"0.6672613",
"0.6658596",
"0.6653552",
"0.66272783",
"0.66236734",
"0.6617037",
"0.6596818",
"0.659552",
"0.658176... | 0.693124 | 2 |
Method that tests unsuccessful put request with invalid data. | def test_put_invalid_data(self):
data = {
'start_time': '201-10-29'
}
url = reverse('notification',
kwargs={'way_id': self.notification.way_id, 'notification_id': self.notification.id})
response = self.client.put(url, json.dumps(data, cls=DjangoJSONEnco... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_put_no_data(self):\n test_data = {}\n response = self.client.put(self.url, json.dumps(test_data), content_type='application/json')\n self.assertEquals(response.status_code, 400)",
"def test_update_with_invalid_data(self):\n saved_article = self.create_article()\n url =... | [
"0.80603",
"0.7946233",
"0.784097",
"0.77523243",
"0.75244886",
"0.7508853",
"0.75016356",
"0.7400866",
"0.7241939",
"0.72137624",
"0.7200401",
"0.71775615",
"0.7172664",
"0.7149172",
"0.7140384",
"0.71386945",
"0.71179557",
"0.70906204",
"0.7073103",
"0.7069364",
"0.70652556... | 0.7636739 | 4 |
Method that tests successful delete request | def test_delete_success(self):
url = reverse('notification',
kwargs={'way_id': self.notification.way_id, 'notification_id': self.notification.id})
response = self.client.delete(url)
self.assertEqual(response.status_code, 200) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_client_can_do_delete_request(self):\n response = self.httpbin_4.test_requests_delete_method()\n self.assertEqual(response.request.method, 'DELETE')\n self.assertEqual(response.status_code, 200)",
"def test_delete__valid(self):\n testing_config.sign_in('admin@example.com', 1235678... | [
"0.82243276",
"0.7960768",
"0.79481703",
"0.79142106",
"0.7868135",
"0.7867293",
"0.7829174",
"0.78112143",
"0.7803392",
"0.772959",
"0.77106404",
"0.7710564",
"0.7703078",
"0.7690606",
"0.76722753",
"0.7660884",
"0.7646906",
"0.7623302",
"0.76144546",
"0.75957584",
"0.759070... | 0.76712584 | 15 |
Method that tests unsuccessful delete request when db deleting is failed. | def test_error_db_deleting(self):
url = reverse('notification',
kwargs={'way_id': self.notification.way_id, 'notification_id': self.notification.id})
with mock.patch('notification.views.Notification.delete_by_id') as notification_delete:
notification_delete.return_valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_invalid_db_delete(env_setup, env_table, db_delete_test_data, response_test_data):\n test_string = DbManager(SqLiteHelper, {\"db_path\": env_setup, \"master_table\": env_table}) \\\n .processor(db_delete_test_data.get(\"invalid\"))\n assert test_string == response_test_data.get(\"invalid_delet... | [
"0.7845363",
"0.7661133",
"0.7618815",
"0.7579205",
"0.74916613",
"0.74349666",
"0.73349035",
"0.7333713",
"0.72599447",
"0.72522247",
"0.7246481",
"0.722398",
"0.72110033",
"0.71876705",
"0.7169879",
"0.7162017",
"0.7146241",
"0.7146241",
"0.70829624",
"0.707316",
"0.7072797... | 0.80490714 | 0 |
Convert a string to unicode | def to_unicode(string):
if not isinstance(string, unicode):
for codec in CODECS:
try:
unic = unicode(string, codec)
except UnicodeError:
pass
except TypeError:
break
else:
return unic
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_unicode(string):\n\n if isinstance(string, str):\n return string.decode('utf-8')\n else:\n return unicode(string)",
"def to_unicode(self, _string):\n if not isinstance(_string, unicode):\n try:\n _string = unicode(_string)\n except:\n ... | [
"0.8182828",
"0.793152",
"0.79177076",
"0.789158",
"0.7860761",
"0.7840225",
"0.77812076",
"0.774326",
"0.77316",
"0.7710195",
"0.76987106",
"0.7689813",
"0.76821315",
"0.7632413",
"0.7602784",
"0.75839925",
"0.7465702",
"0.7465702",
"0.74596316",
"0.7439076",
"0.7414595",
... | 0.78011256 | 6 |
Returs a list of all pandigital primes up to ``n``. | def pandigital_primes(n=10000000):
pri = [x for x in primes(n) if is_pandigital(x)]
return pri | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_primes(n):\n\n return list(primes_sieve(n))",
"def primes(n):\n return [i for i in xrange(1, n + 1) if mr_prime(i)]",
"def get_n_primes(n):\n\n primes = [' ']\n num = 2\n while len(primes) < n + 1:\n if is_prime(num):\n primes.append(num)\n num += 1\n return p... | [
"0.8037789",
"0.79828346",
"0.78280413",
"0.7799131",
"0.7784345",
"0.77557623",
"0.7705573",
"0.7680708",
"0.75602317",
"0.75260603",
"0.75113",
"0.74893403",
"0.7445755",
"0.74427813",
"0.74221474",
"0.7414387",
"0.739986",
"0.736477",
"0.7353285",
"0.7333225",
"0.73293346"... | 0.83678913 | 0 |
Mark token as revoked. Any futher use will be prohibited | async def revoke_token(self, token: str, audience: str) -> None:
ts = datetime.datetime.utcnow()
if token in self.revoked_tokens:
return None
exp = datetime.datetime.fromtimestamp(get_exp_from_jwt(token, audience))
msg = {
"token": token,
"ts": ts.isof... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def revoke_token(self, request: Request, token: str) -> None:\n token_record = ...\n token_record.revoked = True\n token_record.save()",
"def _check_token_is_revoked(self, jti: str) -> None:\n redis = self._conn_redis()\n entry = redis.get(jti)\n if entry and entry... | [
"0.7645683",
"0.72017646",
"0.69608617",
"0.68647873",
"0.6853826",
"0.684368",
"0.669052",
"0.6648324",
"0.66042507",
"0.6603621",
"0.6569389",
"0.6490145",
"0.64201844",
"0.6412793",
"0.640162",
"0.63951135",
"0.6387365",
"0.6341848",
"0.62859935",
"0.6222544",
"0.6222079",... | 0.64807594 | 12 |
Tests PUT method on google authenticator | def test_update_ga(self):
url = reverse('admin_google_authenticator')
data = {
}
self.client.force_authenticate(user=self.admin)
response = self.client.put(url, data)
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_PUT(self):\n if not self.url:\n return\n response = self.client.put(self.url, {}, format='json')\n self.assertIn(response.status_code, [status.HTTP_405_METHOD_NOT_ALLOWED,\n status.HTTP_401_UNAUTHORIZED])",
"def test_put_method(... | [
"0.75060594",
"0.74279714",
"0.7279392",
"0.7239791",
"0.71154946",
"0.7027044",
"0.6975747",
"0.6921709",
"0.68776083",
"0.68717974",
"0.6840171",
"0.6779103",
"0.6754017",
"0.6685355",
"0.6685355",
"0.6670062",
"0.6611915",
"0.6585054",
"0.6574342",
"0.6565525",
"0.65529203... | 0.74890983 | 1 |
Tests POST method on google authenticator | def test_create_ga(self):
url = reverse('admin_google_authenticator')
data = {
}
self.client.force_authenticate(user=self.admin)
response = self.client.post(url, data)
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_0050_registration_post_1(self):\n response = self.fetch(\n '/registration', method=\"POST\", follow_redirects=False,\n body=urlencode({'name':'anoop', 'email':'pqr@example.com',\n 'password':'openlabs', 'confirm_password':'wrong'}\n )\n )\n ... | [
"0.71235955",
"0.69123614",
"0.68825096",
"0.6866466",
"0.68049127",
"0.67935437",
"0.6757084",
"0.667855",
"0.6642896",
"0.66332465",
"0.6562463",
"0.6533614",
"0.65188736",
"0.64831114",
"0.6460359",
"0.6424149",
"0.64141566",
"0.6398847",
"0.6398251",
"0.6341648",
"0.63391... | 0.71679026 | 0 |
Tests DELETE method on ga without being an admin | def test_delete_ga_failure_no_admin(self):
url = reverse('admin_google_authenticator')
data = {
'google_authenticator_id': self.ga.id
}
self.client.force_authenticate(user=self.test_user_obj)
response = self.client.delete(url, data)
self.assertEqual(respon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete_ga_failure_no_ga_id(self):\n\n url = reverse('admin_google_authenticator')\n\n data = {\n }\n\n self.client.force_authenticate(user=self.admin)\n response = self.client.delete(url, data)\n\n self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST... | [
"0.78405344",
"0.7798382",
"0.7431772",
"0.73222965",
"0.73197466",
"0.7210531",
"0.71509945",
"0.71504116",
"0.71398807",
"0.71240693",
"0.71109575",
"0.7097844",
"0.7097153",
"0.70948076",
"0.705479",
"0.70487773",
"0.7041551",
"0.70338",
"0.700916",
"0.6971044",
"0.6954457... | 0.80400723 | 0 |
Returns the module path of the test, e.g. integ_tests/test_simulator_quantum_task | def s3_prefix():
# current test path, e.g. ...
# test/integ_tests/test_simulator_quantum_task.py::test_simulator_quantum_task (setup)
current_test_path = os.environ.get("PYTEST_CURRENT_TEST")
# strip off the filename extension and test/
return current_test_path.rsplit(".py")[0].replace("test/", ""... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tests_directory() -> str:\n module_file_path = os.path.abspath(__file__)\n return os.path.dirname(module_file_path)",
"def get_test_path():\n path, name = os.path.split(__file__)\n return os.path.join(path,\"..\", 'test-data')",
"def test():\n return os.path.dirname(__file__)",
"def te... | [
"0.78093123",
"0.7635861",
"0.74251395",
"0.7400401",
"0.73989546",
"0.7383977",
"0.72226346",
"0.71984273",
"0.7129021",
"0.711519",
"0.7034605",
"0.69752324",
"0.69719654",
"0.6909714",
"0.6781431",
"0.6727347",
"0.67246187",
"0.67236024",
"0.6715504",
"0.6674065",
"0.66175... | 0.0 | -1 |
Create a dictionary with file attributes for FUSE. | def create_file_attributes(permissions, time, size):
return {
'st_mode': (stat.S_IFREG | permissions),
'st_ctime': time,
'st_mtime': time,
'st_atime': time,
'st_size': size,
'st_uid': os.getuid(),
'st_gid': os.getgid(),
'st_nlink': 1
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_file_hash_dict(cls, file, file_path):\n\n file_info = {}\n file_info['path'] = file_path\n file_info['hash'] = cls.get_256_hash_from_file(file_path)\n file_info['type'] = 'file'\n file_info['name'] = file\n file_info['perm'] = stat.S_IMODE(os.lstat(file_path).st... | [
"0.6876256",
"0.6477355",
"0.642789",
"0.63974553",
"0.6374335",
"0.636785",
"0.63562584",
"0.6264039",
"0.62063867",
"0.61930203",
"0.6149867",
"0.61277133",
"0.60900444",
"0.6011493",
"0.59660053",
"0.59634185",
"0.5940534",
"0.5900107",
"0.58942765",
"0.5891259",
"0.588044... | 0.7342417 | 0 |
Initialize the file system resolver. | def __init__(self, cache, userProjects, tagRefs, commitTimes):
self.cache = cache
self.userProjects = userProjects
self.tagRefs = tagRefs
self.commitTimes = commitTimes
self.initTime = time.time() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, resolver_context, path_spec):\n super(FATFileSystem, self).__init__(resolver_context, path_spec)\n self._file_object = None\n self._fsfat_volume = None\n self._root_directory_identifier = None",
"def Init(self):\n # First iteration over all the files in root searching for symlin... | [
"0.66651976",
"0.6454042",
"0.6405603",
"0.6320611",
"0.61738366",
"0.60796",
"0.6059691",
"0.60032433",
"0.5938865",
"0.5936926",
"0.59035516",
"0.5886037",
"0.5838677",
"0.5831634",
"0.57965046",
"0.5789152",
"0.57848793",
"0.5781777",
"0.57721424",
"0.572982",
"0.57222754"... | 0.0 | -1 |
Try to resolve a path as the root of a project, group or user. | def resolve_tree(self, path):
try:
node = self.cache.get_tree(self.userProjects)[path]
if type(node) is gitlab.v4.objects.Group:
# Groups API does not return a creation time
return Entity(
EntityType.GROUP,
path,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve(self, path=''):\n path = self._sep.join([self.root] + path.split('/'))\n return realpath(path)",
"def resolvePath_(cls, path):\r\n try:\r\n fsref, isFolder, wasAliased = FSResolveAliasFile(os.path.realpath(path), 1)\r\n return os.path.abspath(fsref.as_pathna... | [
"0.690271",
"0.6536511",
"0.63718057",
"0.63490874",
"0.6301866",
"0.62900126",
"0.6237765",
"0.61903673",
"0.61896497",
"0.6180588",
"0.6035004",
"0.60347724",
"0.6028328",
"0.59886265",
"0.59836733",
"0.59700334",
"0.5952076",
"0.5937991",
"0.5922994",
"0.59141296",
"0.5866... | 0.5268292 | 96 |
Try to resolve a path as something within a project. | def resolve_project_prefix(self, path):
for nodePath, node in self.cache.get_tree(self.userProjects).items():
if type(node) is gitlab.v4.objects.Project and path.startswith(nodePath):
remainingPath = pathlib.Path(path).relative_to(pathlib.Path(nodePath))
return node,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve(self, path=''):\n path = self._sep.join([self.root] + path.split('/'))\n return realpath(path)",
"def resolve(name):\n arg = Path(name)\n return str(arg.resolve())",
"def resolve_path(self, path):\n if path:\n if path[0] == '/':\n #zope objects c... | [
"0.6934809",
"0.6887386",
"0.6778996",
"0.676396",
"0.6690466",
"0.64114004",
"0.6330802",
"0.6270743",
"0.6252713",
"0.6207397",
"0.61828643",
"0.61801094",
"0.6173589",
"0.6131582",
"0.60505766",
"0.59710646",
"0.59427816",
"0.59411895",
"0.59350175",
"0.5914711",
"0.591217... | 0.65733105 | 5 |
Try to resolve a path as the root of a ref. | def resolve_ref(self, path):
project, ref, remainingPath = self.resolve_ref_prefix(path)
if not ref or remainingPath.as_posix() != '.':
return None
refTime = iso8601.parse_date(ref.commit['committed_date']).timestamp()
return Entity(
EntityType.REPOSITORY_DIR,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve(self, path=''):\n path = self._sep.join([self.root] + path.split('/'))\n return realpath(path)",
"def resolvePath_(cls, path):\r\n try:\r\n fsref, isFolder, wasAliased = FSResolveAliasFile(os.path.realpath(path), 1)\r\n return os.path.abspath(fsref.as_pathna... | [
"0.7158143",
"0.68397033",
"0.676219",
"0.67599744",
"0.67315334",
"0.6719798",
"0.67155963",
"0.6660632",
"0.6504497",
"0.62912154",
"0.62896556",
"0.62786454",
"0.6272115",
"0.61823636",
"0.61473644",
"0.61236966",
"0.6055172",
"0.6030336",
"0.6001333",
"0.59940606",
"0.597... | 0.6833471 | 2 |
From 0 to positive infinity. | def scale(entropy):
# FIXME: Improve generation performance
# for testing viability.
# `scale_` has the desired properties of
# periodically producing very large documents.
x = 0
while entropy(1):
x += 1
return x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inf(self):\n return self._inf",
"def isinf(x):\n return False",
"def fill_with_neg_inf(t):\r\n return t.float().fill_(float(\"-inf\")).type_as(t)",
"def isInfinity(self):\n return _libsbml.ASTNode_isInfinity(self)",
"def isInfinite(value):\n if value == float('inf') or value ... | [
"0.74205124",
"0.7011005",
"0.68522996",
"0.68498147",
"0.658942",
"0.65669304",
"0.65312845",
"0.65211093",
"0.6454594",
"0.64146763",
"0.6392522",
"0.6364933",
"0.6337372",
"0.6335443",
"0.6289076",
"0.62520576",
"0.6175854",
"0.61369663",
"0.611988",
"0.6090568",
"0.607692... | 0.0 | -1 |
From 0 to positive infinity. | def scale_(entropy):
# Double scale with each successive 1.
bit_depth = 0
while entropy(1):
bit_depth += 1
# Return a random number within the scale.
return 2 ** bit_depth + entropy(bit_depth) - 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inf(self):\n return self._inf",
"def isinf(x):\n return False",
"def fill_with_neg_inf(t):\r\n return t.float().fill_(float(\"-inf\")).type_as(t)",
"def isInfinity(self):\n return _libsbml.ASTNode_isInfinity(self)",
"def isInfinite(value):\n if value == float('inf') or value ... | [
"0.7419534",
"0.70103866",
"0.6852276",
"0.68489885",
"0.65879995",
"0.6568186",
"0.65308875",
"0.65205",
"0.64529145",
"0.64138526",
"0.63921684",
"0.63641196",
"0.63368535",
"0.6335251",
"0.6289104",
"0.6252908",
"0.61746687",
"0.6135361",
"0.61183196",
"0.60907626",
"0.607... | 0.0 | -1 |
Parse Text2Text model training arguments | def parse_arguments(args):
parser = argparse.ArgumentParser(
description="Text2Text: Read input text training files, output item files and train a model"
)
parser.add_argument(
"-i",
"--input-text-path",
type=str,
required=True,
metavar="INPUT_TEXT_PATH",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_train_args():\n parser = argparse.ArgumentParser('Train a Text Summarization Model')\n\n # parser.add_argument('--hiddenDim', nargs='?', type=int, default=50, help='The size of the hidden dimension to be used for all layers')\n parser.add_argument('--hiddenDim', type=int, default=50, help='The siz... | [
"0.686333",
"0.67426586",
"0.6403633",
"0.63728684",
"0.63588935",
"0.63261265",
"0.63138217",
"0.6302748",
"0.62799126",
"0.6250235",
"0.6242753",
"0.62252027",
"0.6123396",
"0.6101539",
"0.607476",
"0.6056414",
"0.6046505",
"0.60454464",
"0.60431504",
"0.60165226",
"0.59678... | 0.6688534 | 2 |
Return the configuration object based on the name. | def get_named_config(config_name: str = 'production'):
if config_name in ['production', 'staging', 'default']:
config = ProdConfig()
elif config_name == 'testing':
config = TestConfig()
elif config_name == 'development':
config = DevConfig()
else:
raise KeyError(f'Unknown... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config(self, name):\n return self.configs[name][0]",
"def get_config_by_name(name):\r\n attrs = get_config_attributes(name)\r\n if attrs['online']:\r\n config = CONFIGS[name]()\r\n else:\r\n config = CONFIGS[name]\r\n \r\n # setting the Tune Run name attribute\r\n ... | [
"0.8064526",
"0.77655816",
"0.77019644",
"0.74938506",
"0.73495984",
"0.72860664",
"0.72388405",
"0.72321206",
"0.7196328",
"0.7142278",
"0.71287477",
"0.7099421",
"0.69440746",
"0.69259566",
"0.66691816",
"0.65930384",
"0.6522588",
"0.6522556",
"0.65188694",
"0.65184826",
"0... | 0.748673 | 4 |
UserResponse a model defined in Swagger | def __init__(self, account_type=None, business_account=None, individual_account=None, registration_marketplace_id=None, status=None, user_id=None, username=None): # noqa: E501 # noqa: E501
self._account_type = None
self._business_account = None
self._individual_account = None
self._reg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_response_model(self, data):\n pass",
"def me(self, request: Request) -> Response:\n\n serializer = self.get_serializer(instance=request.user)\n return Response(serializer.data)",
"def make_response(self):\n params = {\n 'tweet.fields': 'created_at,public_metri... | [
"0.6416418",
"0.611457",
"0.6068402",
"0.60660547",
"0.6036755",
"0.59606844",
"0.59422576",
"0.59139943",
"0.58684826",
"0.58683",
"0.5817401",
"0.580789",
"0.57984364",
"0.57502323",
"0.57425076",
"0.570621",
"0.5667755",
"0.5619348",
"0.5608451",
"0.5582353",
"0.5549562",
... | 0.0 | -1 |
Sets the account_type of this UserResponse. | def account_type(self, account_type):
self._account_type = account_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def account_type(self, account_type):\n allowed_values = [\"USER_ACCOUNT\", \"SERVICE_ACCOUNT\", \"INACTIVE_SERVICE_ACCOUNT\"] # noqa: E501\n if account_type not in allowed_values:\n raise ValueError(\n \"Invalid value for `account_type` ({0}), must be one of {1}\" # noqa:... | [
"0.769533",
"0.6538228",
"0.6500076",
"0.63005424",
"0.62570584",
"0.6248823",
"0.6172584",
"0.6130132",
"0.602886",
"0.6022206",
"0.5954991",
"0.5954991",
"0.5954991",
"0.5954991",
"0.58775336",
"0.58745277",
"0.58745277",
"0.5874434",
"0.5863808",
"0.57894033",
"0.5764235",... | 0.8373349 | 3 |
Sets the business_account of this UserResponse. | def business_account(self, business_account):
self._business_account = business_account | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def business_id(self, business_id):\n\n self._business_id = business_id",
"def business_email(self, business_email):\n\n self._business_email = business_email",
"def business_owner(self, business_owner):\n\n self._business_owner = business_owner",
"def business_phone(self, business_phone... | [
"0.68295044",
"0.6694788",
"0.65968657",
"0.64488673",
"0.63704747",
"0.61454445",
"0.60893625",
"0.58178234",
"0.58178234",
"0.5807157",
"0.5681304",
"0.5420851",
"0.5420851",
"0.5420851",
"0.5420851",
"0.53558195",
"0.5355273",
"0.53436404",
"0.5324513",
"0.52895993",
"0.52... | 0.8394445 | 0 |
Sets the individual_account of this UserResponse. | def individual_account(self, individual_account):
self._individual_account = individual_account | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setAccount(self, account_id):\n self.data_struct['_setAccount'] = account_id",
"def set_account(self, account: str):\n ret = self._call_txtrader_api('set_account', {'account': account})\n if ret:\n self.account = account\n return ret",
"def account(self, account):\n\n... | [
"0.6242222",
"0.62353134",
"0.6195874",
"0.6195874",
"0.6195874",
"0.6195874",
"0.6064232",
"0.6054456",
"0.599",
"0.5941063",
"0.59252465",
"0.58991206",
"0.5867289",
"0.5867289",
"0.5867289",
"0.5867289",
"0.5867289",
"0.5867289",
"0.58530086",
"0.56883174",
"0.5645553",
... | 0.80935436 | 0 |
Sets the registration_marketplace_id of this UserResponse. | def registration_marketplace_id(self, registration_marketplace_id):
self._registration_marketplace_id = registration_marketplace_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def marketplace_id(self, marketplace_id):\n\n self._marketplace_id = marketplace_id",
"def put(self, **kwargs):\n contract = {\n \"pushRegKey\": [\"id\",\"+\"]\n }\n try:\n self.check_params_conform(contract)\n except ValidatorException:\n retur... | [
"0.65472084",
"0.563777",
"0.5593157",
"0.55648047",
"0.5374765",
"0.52975535",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
"0.52847886",
... | 0.7918989 | 0 |
Sets the status of this UserResponse. | def status(self, status):
self._status = status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_status(self, status):\n self.status = status",
"def set_status(self, status):\n self.status = status",
"def set_status(self, status):\n self.status = status",
"def setStatus(self, status):\n self.__status = status",
"def status(self, status):\n self._status = stat... | [
"0.74828047",
"0.74828047",
"0.74828047",
"0.7289848",
"0.72221553",
"0.72221553",
"0.72221553",
"0.72221553",
"0.72221553",
"0.72221553",
"0.72221553",
"0.7198546",
"0.7092023",
"0.7053926",
"0.7053926",
"0.7014277",
"0.7011542",
"0.69944286",
"0.6962982",
"0.6766823",
"0.66... | 0.7238996 | 23 |
Sets the user_id of this UserResponse. | def user_id(self, user_id):
self._user_id = user_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_id(self, user_id):\n if user_id is None:\n raise ValueError(\"Invalid value for `user_id`, must not be `None`\") # noqa: E501\n\n self._user_id = user_id",
"def user_id(self, user_id):\n if user_id is None:\n raise ValueError(\"Invalid value for `user_id`, mus... | [
"0.80819875",
"0.80819875",
"0.8024789",
"0.79389626",
"0.792101",
"0.73899055",
"0.72080636",
"0.6856244",
"0.6813643",
"0.6710162",
"0.65760064",
"0.6520053",
"0.6400696",
"0.6400696",
"0.6400696",
"0.6400696",
"0.6400696",
"0.6400696",
"0.6400696",
"0.6400696",
"0.6400696"... | 0.80791456 | 14 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, UserResponse):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.80891633",
"0.80891633",
"0.8055254",
"0.7983334",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
"0.7967544",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Convert a pygame surface into string | def surface_to_string( surface ):
return pygame.image.tostring( surface, 'RGB' ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pygame_to_cvimage( surface ):\n cv_image = cv.CreateImageHeader( surface.get_size(), cv.IPL_DEPTH_8U, 3 )\n image_string = surface_to_string( surface )\n cv.SetData( cv_image, image_string )\n return cv_image",
"def grabRawFrame(self):\r\n \r\n self.surface = self.capture.get_image(... | [
"0.6516572",
"0.6308944",
"0.59656525",
"0.5701781",
"0.552377",
"0.5499506",
"0.54991174",
"0.54027945",
"0.53784376",
"0.5358556",
"0.53564054",
"0.5315486",
"0.5277987",
"0.5269198",
"0.526664",
"0.5256117",
"0.52520627",
"0.52384955",
"0.52231586",
"0.5221528",
"0.5211215... | 0.9001708 | 0 |
Sets the link_data of this TopologyAttachmentResultDto. | def link_data(self, link_data):
self._link_data = link_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_linked_data(\n self,\n val=None\n ):\n if val != None:\n self.linked_data = val",
"def link(self, link):\n\n self.container['link'] = link",
"def link(self, link):\n\n self._link = link",
"def link(self, link):\n\n self._link = link",
"def... | [
"0.5885388",
"0.5762334",
"0.5706907",
"0.5706907",
"0.5706907",
"0.5706907",
"0.5706907",
"0.5706907",
"0.5706907",
"0.5507466",
"0.5478151",
"0.54773843",
"0.5213641",
"0.518306",
"0.51407033",
"0.513635",
"0.5109374",
"0.5109374",
"0.5109374",
"0.5109374",
"0.5109374",
"... | 0.7365313 | 0 |
Sets the node_data of this TopologyAttachmentResultDto. | def node_data(self, node_data):
self._node_data = node_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_data(self, node_data):\n self.node_data_ = node_data\n self.label = node_data.label\n self.node_type = node_data.node_type\n self.arity = node_data.arity\n self.min_depth = node_data.min_depth\n self.child_type = node_data.child_type\n self.numpy_func = nod... | [
"0.5924504",
"0.56284124",
"0.5487792",
"0.52650934",
"0.522697",
"0.52221644",
"0.5181747",
"0.5177556",
"0.5148225",
"0.5126763",
"0.51123697",
"0.51031524",
"0.51031524",
"0.51031524",
"0.5067002",
"0.5042375",
"0.5041182",
"0.50394917",
"0.50161797",
"0.4974361",
"0.49511... | 0.6978998 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, TopologyAttachmentResultDto):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8456082",
"0.83912885",
"0.81436425",
"0.81406975",
"0.8131807",
"0.8093013",
"0.80912536",
"0.80912536",
"0.80912536",
"0.8084505",
"0.8084505",
"0.8075543",
"0.8075543",
"0.8065009"
] | 0.0 | -1 |
The call rate limit Cognitive Services account. | def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':
return pulumi.get(self, "call_rate_limit") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_rate_limit(self):\n resp = self._session.get(self.API_ROOT + \"/rate_limit\")\n log.info(resp.text)",
"def ctx(self):\n return RateLimitContextBase()",
"def get_rate_limit(client):\n query = '''query {\n rateLimit {\n limit\n remaining\n r... | [
"0.6358268",
"0.6162561",
"0.60568434",
"0.5990054",
"0.5918794",
"0.58661646",
"0.573936",
"0.57365024",
"0.5668265",
"0.5640884",
"0.56161267",
"0.5614316",
"0.5562859",
"0.5551392",
"0.5523943",
"0.5515391",
"0.54717577",
"0.54716563",
"0.5464131",
"0.5456545",
"0.54448587... | 0.73106307 | 2 |
Gets the date of cognitive services account creation. | def date_created(self) -> str:
return pulumi.get(self, "date_created") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_account_created_date(self):\n return self.account_created_date",
"def get_account_created_date_formatted(self):\n return self.account_created_date_formatted",
"def creation_date(self) -> str:\n return pulumi.get(self, \"creation_date\")",
"def creation_date(self) -> str:\n ... | [
"0.81209767",
"0.743392",
"0.7200769",
"0.7200769",
"0.7200769",
"0.6544591",
"0.64716315",
"0.6429377",
"0.6429377",
"0.6415792",
"0.64151484",
"0.64151484",
"0.64151484",
"0.6406308",
"0.6400229",
"0.6400229",
"0.6400229",
"0.63968235",
"0.63506657",
"0.63506657",
"0.635066... | 0.66924393 | 5 |
The deletion date, only available for deleted account. | def deletion_date(self) -> str:
return pulumi.get(self, "deletion_date") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleted_time(self) -> str:\n return pulumi.get(self, \"deleted_time\")",
"def decommission_date(self):\n return self._decommission_date",
"def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")",
"def delete_time(self) -> str:\n return pulumi.get(self, \"dele... | [
"0.75667304",
"0.7024116",
"0.6854214",
"0.6854214",
"0.6547442",
"0.6326043",
"0.6143451",
"0.6114624",
"0.6068728",
"0.6068728",
"0.5996998",
"0.5946708",
"0.59344095",
"0.58662504",
"0.586075",
"0.58573246",
"0.58573246",
"0.58573246",
"0.5817896",
"0.5817896",
"0.5806128"... | 0.90385526 | 0 |
(QnAMaker Only) The Azure Search endpoint key of QnAMaker. | def qna_azure_search_endpoint_key(self) -> Optional[str]:
return pulumi.get(self, "qna_azure_search_endpoint_key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qna_azure_search_endpoint_id(self) -> Optional[str]:\n return pulumi.get(self, \"qna_azure_search_endpoint_id\")",
"def _get_query_api_key(self, params: Dict) -> Optional[str]:\n return None",
"def endpoint_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"endpoint_id\")",
"... | [
"0.760087",
"0.6005936",
"0.59957916",
"0.59957916",
"0.59957916",
"0.59957916",
"0.5990177",
"0.59611803",
"0.59611803",
"0.58993065",
"0.58993065",
"0.58993065",
"0.58993065",
"0.58035594",
"0.58035594",
"0.579497",
"0.579497",
"0.579497",
"0.579497",
"0.579497",
"0.579497"... | 0.84970903 | 0 |
(Personalization Only) The storage account connection string. | def storage_account_connection_string(self) -> Optional[str]:
return pulumi.get(self, "storage_account_connection_string") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rdb_storage_connection_string(self) -> str:\n return pulumi.get(self, \"rdb_storage_connection_string\")",
"def account_connection_string(self) -> str:\n return pulumi.get(self, \"account_connection_string\")",
"def storage_account(self) -> str:\n return pulumi.get(self, \"storage_acco... | [
"0.78525084",
"0.77868885",
"0.7490864",
"0.7084924",
"0.68205947",
"0.680374",
"0.6798149",
"0.65964776",
"0.6592029",
"0.65299773",
"0.63563156",
"0.6331491",
"0.63102967",
"0.6303591",
"0.62777317",
"0.6277717",
"0.6274107",
"0.6228608",
"0.6228479",
"0.6141211",
"0.614121... | 0.8600586 | 0 |
The call rate limit Cognitive Services account. | def __init__(__self__, *,
count: Optional[float] = None,
renewal_period: Optional[float] = None,
rules: Optional[Sequence['outputs.ThrottlingRuleResponse']] = None):
if count is not None:
pulumi.set(__self__, "count", count)
if renewal_perio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':\n return pulumi.get(self, \"call_rate_limit\")",
"def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':\n return pulumi.get(self, \"call_rate_limit\")",
"def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':\n re... | [
"0.73106307",
"0.73106307",
"0.73106307",
"0.6358268",
"0.6162561",
"0.60568434",
"0.5990054",
"0.5918794",
"0.58661646",
"0.573936",
"0.57365024",
"0.5668265",
"0.5640884",
"0.56161267",
"0.5614316",
"0.5562859",
"0.5551392",
"0.5523943",
"0.5515391",
"0.54717577",
"0.547165... | 0.0 | -1 |
Commitment period end date. | def end_date(self) -> str:
return pulumi.get(self, "end_date") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self):\n return self.__end_date",
"def end_date(self):\n return self._end_date",
"def end_date(self):\n return self._end_date",
"def end_date(self):\n return self._end_date",
"def computed_enddate(self):\n if self.enddate:\n # you need to add a day... | [
"0.72664535",
"0.7117559",
"0.7117559",
"0.7117559",
"0.7070606",
"0.6941111",
"0.6776933",
"0.67016834",
"0.67016834",
"0.66824603",
"0.6518314",
"0.65141875",
"0.6463101",
"0.64071155",
"0.6389012",
"0.63748705",
"0.63725436",
"0.63416606",
"0.63072854",
"0.6300031",
"0.629... | 0.70362073 | 6 |
Commitment period start date. | def start_date(self) -> str:
return pulumi.get(self, "start_date") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def starting_date(self):\n return datetime.date(2016, 1, 4)",
"def start_date(self):\n return self.__start_date",
"def start_date(self):\n return self._start_date",
"def start_date(self):\n return self._start_date",
"def start_date(self):\n return self._start_date",
"de... | [
"0.6839815",
"0.68031985",
"0.66874164",
"0.66874164",
"0.66874164",
"0.66874164",
"0.6584549",
"0.6583291",
"0.6506471",
"0.64989716",
"0.6378951",
"0.6378951",
"0.6342821",
"0.6279255",
"0.62256783",
"0.62214386",
"0.6180699",
"0.6159274",
"0.6134331",
"0.61129344",
"0.6101... | 0.66267425 | 7 |
Properties of Cognitive Services account deployment model. | def __init__(__self__, *,
call_rate_limit: 'outputs.CallRateLimitResponse',
format: Optional[str] = None,
name: Optional[str] = None,
source: Optional[str] = None,
version: Optional[str] = None):
pulumi.set(__self__, "call_rate... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deployment_properties(self) -> Optional[pulumi.Input['EnvironmentDeploymentPropertiesArgs']]:\n return pulumi.get(self, \"deployment_properties\")",
"def deployment_properties(self) -> pulumi.Output[Optional['outputs.EnvironmentDeploymentPropertiesResponse']]:\n return pulumi.get(self, \"deploy... | [
"0.5764301",
"0.5752091",
"0.5590139",
"0.5254803",
"0.5201687",
"0.5007838",
"0.49920905",
"0.49592757",
"0.4896395",
"0.48747262",
"0.48150942",
"0.48005962",
"0.47651693",
"0.47592697",
"0.47568217",
"0.4752785",
"0.47427654",
"0.47425056",
"0.47424388",
"0.474131",
"0.474... | 0.0 | -1 |
The call rate limit Cognitive Services account. | def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':
return pulumi.get(self, "call_rate_limit") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_rate_limit(self):\n resp = self._session.get(self.API_ROOT + \"/rate_limit\")\n log.info(resp.text)",
"def ctx(self):\n return RateLimitContextBase()",
"def get_rate_limit(client):\n query = '''query {\n rateLimit {\n limit\n remaining\n r... | [
"0.6358268",
"0.6162561",
"0.60568434",
"0.5990054",
"0.5918794",
"0.58661646",
"0.573936",
"0.57365024",
"0.5668265",
"0.5640884",
"0.56161267",
"0.5614316",
"0.5562859",
"0.5551392",
"0.5523943",
"0.5515391",
"0.54717577",
"0.54716563",
"0.5464131",
"0.5456545",
"0.54448587... | 0.73106307 | 0 |
Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. | def version(self) -> Optional[str]:
return pulumi.get(self, "version") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model_version_id(self) -> Optional[str]:\n return pulumi.get(self, \"model_version_id\")",
"def model_version(self) -> str:\n return pulumi.get(self, \"model_version\")",
"def version(self, version: Optional[str]) -> Optional[ChartVersionInfo]:\n if version is None or version == \"\":\... | [
"0.6756223",
"0.65918255",
"0.6303875",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.63008827",
"0.62859136",
"0.6258136",
... | 0.61447006 | 25 |
The call rate limit Cognitive Services account. | def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':
return pulumi.get(self, "call_rate_limit") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_rate_limit(self):\n resp = self._session.get(self.API_ROOT + \"/rate_limit\")\n log.info(resp.text)",
"def ctx(self):\n return RateLimitContextBase()",
"def get_rate_limit(client):\n query = '''query {\n rateLimit {\n limit\n remaining\n r... | [
"0.6358268",
"0.6162561",
"0.60568434",
"0.5990054",
"0.5918794",
"0.58661646",
"0.573936",
"0.57365024",
"0.5668265",
"0.5640884",
"0.56161267",
"0.5614316",
"0.5562859",
"0.5551392",
"0.5523943",
"0.5515391",
"0.54717577",
"0.54716563",
"0.5464131",
"0.5456545",
"0.54448587... | 0.73106307 | 1 |
Properties of Cognitive Services account deployment model. | def model(self) -> Optional['outputs.DeploymentModelResponse']:
return pulumi.get(self, "model") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deployment_properties(self) -> Optional[pulumi.Input['EnvironmentDeploymentPropertiesArgs']]:\n return pulumi.get(self, \"deployment_properties\")",
"def deployment_properties(self) -> pulumi.Output[Optional['outputs.EnvironmentDeploymentPropertiesResponse']]:\n return pulumi.get(self, \"deploy... | [
"0.576061",
"0.5748149",
"0.558791",
"0.52540296",
"0.5202421",
"0.5008409",
"0.49905658",
"0.48957098",
"0.48766568",
"0.48135006",
"0.4802074",
"0.47638035",
"0.47576737",
"0.47554222",
"0.47512716",
"0.4743688",
"0.47434357",
"0.47413507",
"0.4739745",
"0.47396374",
"0.473... | 0.49561757 | 7 |
Properties of Cognitive Services account deployment model. | def scale_settings(self) -> Optional['outputs.DeploymentScaleSettingsResponse']:
return pulumi.get(self, "scale_settings") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deployment_properties(self) -> Optional[pulumi.Input['EnvironmentDeploymentPropertiesArgs']]:\n return pulumi.get(self, \"deployment_properties\")",
"def deployment_properties(self) -> pulumi.Output[Optional['outputs.EnvironmentDeploymentPropertiesResponse']]:\n return pulumi.get(self, \"deploy... | [
"0.576061",
"0.5748149",
"0.558791",
"0.52540296",
"0.5202421",
"0.5008409",
"0.49905658",
"0.49561757",
"0.48957098",
"0.48766568",
"0.48135006",
"0.4802074",
"0.47638035",
"0.47576737",
"0.47554222",
"0.47512716",
"0.4743688",
"0.47434357",
"0.47413507",
"0.4739745",
"0.473... | 0.0 | -1 |
Properties of Cognitive Services account deployment model. | def __init__(__self__, *,
active_capacity: int,
capacity: Optional[int] = None,
scale_type: Optional[str] = None):
pulumi.set(__self__, "active_capacity", active_capacity)
if capacity is not None:
pulumi.set(__self__, "capacity", capacity)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deployment_properties(self) -> Optional[pulumi.Input['EnvironmentDeploymentPropertiesArgs']]:\n return pulumi.get(self, \"deployment_properties\")",
"def deployment_properties(self) -> pulumi.Output[Optional['outputs.EnvironmentDeploymentPropertiesResponse']]:\n return pulumi.get(self, \"deploy... | [
"0.576061",
"0.5748149",
"0.558791",
"0.52540296",
"0.5202421",
"0.5008409",
"0.49905658",
"0.49561757",
"0.48957098",
"0.48766568",
"0.48135006",
"0.4802074",
"0.47638035",
"0.47576737",
"0.47554222",
"0.47512716",
"0.4743688",
"0.47434357",
"0.47413507",
"0.4739745",
"0.473... | 0.0 | -1 |
Name of the Key from KeyVault | def key_name(self) -> Optional[str]:
return pulumi.get(self, "key_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key_name(self) -> str:\n return pulumi.get(self, \"key_name\")",
"def key_vault_cert_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"key_vault_cert_name\")",
"def key_pair_name(self) -> str:\n return pulumi.get(self, \"key_pair_name\")",
"def key_vault_id(self) -> str:\n... | [
"0.77167165",
"0.7603939",
"0.74588174",
"0.7155055",
"0.70759636",
"0.70245236",
"0.70245236",
"0.70245236",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899",
"0.6964899... | 0.726185 | 3 |
The provisioning state of the private endpoint connection resource. | def provisioning_state(self) -> str:
return pulumi.get(self, "provisioning_state") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_provisioning_state(self):\n url = \"/api/v1/machine/{}\".format(self.machine_id)\n return self.urlhandler.get(url)",
"def private_link_service_connection_state(self) -> 'outputs.PrivateLinkServiceConnectionStateResponse':\n return pulumi.get(self, \"private_link_service_connection_st... | [
"0.72285354",
"0.68424946",
"0.66898847",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.6656034",
"0.65973026",
"0.65973026",
"0.65973026",
"0.65973026",
"0.638049... | 0.6708338 | 20 |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | def type(self) -> str:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")",
"def ... | [
"0.7918516",
"0.7918516",
"0.7866337",
"0.7866337",
"0.7866337",
"0.7866337",
"0.7866337",
"0.7708053",
"0.75534964",
"0.7282099",
"0.70591027",
"0.6979169",
"0.69202054",
"0.6868452",
"0.67303157",
"0.67049116",
"0.6654272",
"0.6646357",
"0.65510035",
"0.65426683",
"0.654266... | 0.66396123 | 55 |
The call rate limit Cognitive Services account. | def __init__(__self__, *,
customsubdomain: Optional[str] = None,
name: Optional[str] = None,
value: Optional[float] = None):
if customsubdomain is not None:
pulumi.set(__self__, "customsubdomain", customsubdomain)
if name is not None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':\n return pulumi.get(self, \"call_rate_limit\")",
"def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':\n return pulumi.get(self, \"call_rate_limit\")",
"def call_rate_limit(self) -> 'outputs.CallRateLimitResponse':\n re... | [
"0.73106307",
"0.73106307",
"0.73106307",
"0.6358268",
"0.6162561",
"0.60568434",
"0.5990054",
"0.5918794",
"0.58661646",
"0.573936",
"0.57365024",
"0.5668265",
"0.5640884",
"0.56161267",
"0.5614316",
"0.5562859",
"0.5551392",
"0.5523943",
"0.5515391",
"0.54717577",
"0.547165... | 0.0 | -1 |
Name of the region. | def name(self) -> Optional[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_name(self):\n return self.random_element(self._regions)[1]",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def regi... | [
"0.8747073",
"0.82721585",
"0.82721585",
"0.82721585",
"0.82721585",
"0.82721585",
"0.82721585",
"0.81702864",
"0.8110433",
"0.7965388",
"0.7929299",
"0.7929299",
"0.7929299",
"0.7929299",
"0.7929299",
"0.7929299",
"0.7872648",
"0.7786387",
"0.7786387",
"0.7786387",
"0.778638... | 0.0 | -1 |
The name of the SkuCapability. | def name(self) -> Optional[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")",
"def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")",
"def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")",
"def sku_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(... | [
"0.7394996",
"0.7394996",
"0.7394996",
"0.7127446",
"0.7127446",
"0.70643705",
"0.693639",
"0.6608983",
"0.6601351",
"0.6323481",
"0.6323481",
"0.63075024",
"0.63075024",
"0.62782514",
"0.6137717",
"0.6104975",
"0.60995936",
"0.60995936",
"0.6080549",
"0.60667115",
"0.6052637... | 0.0 | -1 |
The value of the SkuCapability. | def value(self) -> Optional[str]:
return pulumi.get(self, "value") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sku(self):\n return self._sku",
"def sku(self) -> pulumi.Output['outputs.IotHubDpsSku']:\n return pulumi.get(self, \"sku\")",
"def sku(self) -> pulumi.Output['outputs.SkuResponse']:\n return pulumi.get(self, \"sku\")",
"def sku(self) -> pulumi.Output[Optional['outputs.SkuDescriptionR... | [
"0.7050685",
"0.69792026",
"0.69721967",
"0.6952778",
"0.6952778",
"0.6919825",
"0.6919825",
"0.68543214",
"0.68543214",
"0.6831363",
"0.6831363",
"0.66993695",
"0.6684792",
"0.66706693",
"0.6573286",
"0.65543294",
"0.65283",
"0.64675206",
"0.6413709",
"0.61848974",
"0.613538... | 0.0 | -1 |
Gets the count of downgrades. | def count_of_downgrades(self) -> Optional[float]:
return pulumi.get(self, "count_of_downgrades") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_of_upgrades_after_downgrades(self) -> Optional[float]:\n return pulumi.get(self, \"count_of_upgrades_after_downgrades\")",
"def count_downvotes(self):\n return self.filter(value=-1).count()",
"def data_downgrades():\n pass",
"def data_downgrades():\n pass",
"def get_downlink_c... | [
"0.8287235",
"0.67211527",
"0.62132925",
"0.62132925",
"0.6082984",
"0.6066136",
"0.59956974",
"0.59314454",
"0.5926545",
"0.58456475",
"0.57416725",
"0.563767",
"0.5635512",
"0.56127214",
"0.55500185",
"0.54669005",
"0.5453762",
"0.5427202",
"0.542651",
"0.54143727",
"0.5398... | 0.8500595 | 0 |
Gets the last change date. | def last_change_date(self) -> Optional[str]:
return pulumi.get(self, "last_change_date") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def svn_info_t_last_changed_date_get(svn_info_t_self): # real signature unknown; restored from __doc__\n pass",
"def dt_last_update(self):\n return self.last_update",
"def status_change_date(self) -> str:\n return pulumi.get(self, \"status_change_date\")",
"def __last_commit_date(self):\n ... | [
"0.7332252",
"0.7219531",
"0.71956813",
"0.71701235",
"0.71467483",
"0.7004979",
"0.69549567",
"0.69372267",
"0.69336087",
"0.68705344",
"0.68644184",
"0.68644184",
"0.6829638",
"0.68113947",
"0.67973435",
"0.6780454",
"0.67783314",
"0.6749812",
"0.67184407",
"0.67096853",
"0... | 0.8572634 | 0 |
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. | def tier(self) -> Optional[str]:
return pulumi.get(self, "tier") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_tiers_tier_level_tier_name_put(self):\n pass",
"def http_method_put():\n return 'PUT'",
"def tier(self, tier):\n\n self._tier = tier",
"def post(self, tier):\n\n if self._from_cluster:\n raise exception.OperationNotPermitted\n\n try:\n tier = ... | [
"0.5875488",
"0.57447296",
"0.5693533",
"0.566215",
"0.5656812",
"0.5543094",
"0.5497317",
"0.54348516",
"0.54160964",
"0.5350421",
"0.5350164",
"0.5287727",
"0.5275415",
"0.5265335",
"0.52464986",
"0.5240691",
"0.52340543",
"0.5232816",
"0.5215241",
"0.5214215",
"0.5196083",... | 0.51187545 | 32 |
The type of identity that created the resource. | def created_by_type(self) -> Optional[str]:
return pulumi.get(self, "created_by_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self) -> pulumi.Input['ResourceIdentityType']:\n return pulumi.get(self, \"type\")",
"def type(self) -> Optional[pulumi.Input['ResourceIdentityType']]:\n return pulumi.get(self, \"type\")",
"def created_by_type(self) -> Optional[pulumi.Input[Union[str, 'IdentityType']]]:\n return ... | [
"0.8255673",
"0.8014981",
"0.7372117",
"0.71985024",
"0.7168418",
"0.71437",
"0.7070173",
"0.70280266",
"0.69838005",
"0.68890923",
"0.686309",
"0.6844002",
"0.67700636",
"0.6763271",
"0.6724401",
"0.6703369",
"0.6695644",
"0.6664346",
"0.66642934",
"0.65966016",
"0.65327346"... | 0.6752386 | 19 |
Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/subnet1'. | def id(self) -> str:
return pulumi.get(self, "id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnet_id(self) -> str:\n return pulumi.get(self, \"subnet_id\")",
"def subnet_resource_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"subnet_resource_id\")",
"def subnet_id(self) -> Optional[str]:\n return pulumi.get(self, \"subnet_id\")",
"def subnet_id(self) ... | [
"0.8063851",
"0.8047559",
"0.7693853",
"0.75608104",
"0.75608104",
"0.7479363",
"0.7479363",
"0.74655336",
"0.74591607",
"0.74558216",
"0.73330986",
"0.7293803",
"0.66670346",
"0.66211975",
"0.66166234",
"0.64410806",
"0.6400703",
"0.6184769",
"0.6160635",
"0.61162025",
"0.60... | 0.0 | -1 |
Wrapper to return the desired api response only if the specified project type is valid | def api_response(project_type, result):
if project_type not in project_types:
return invalid_project_tye_msg(project_type)
return result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_project_or_study(obj_type, obj_id):\n \n response = None\n\n try:\n if obj_type not in set([\"projects\", \"studies\"]):\n raise Exception(\"Invalid object type specified\")\n\n files_d = {}\n files_d.update(file_dict[obj_type][\"valid\"])\n files_d.update(fi... | [
"0.64074504",
"0.584251",
"0.57444906",
"0.5642053",
"0.55687165",
"0.55578846",
"0.5441781",
"0.54382634",
"0.5401079",
"0.5363507",
"0.53115785",
"0.53091395",
"0.5285356",
"0.52749294",
"0.52570665",
"0.52514297",
"0.52415955",
"0.5230785",
"0.5206412",
"0.52010256",
"0.51... | 0.80576724 | 0 |
Returns the nth item | def nth(iterable, index):
return next(itertools.islice(iterable, index, None)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nth(n, seq):\n try:\n return seq[n]\n except TypeError:\n return next(itertools.islice(seq, n, None))",
"def nth(iterable, n, default=None):\n return next(islice(iterable, n, None), default)",
"def nth(iterable, n, default=None):\n return next(islice(iterable, n, None), default)",... | [
"0.7396352",
"0.72852194",
"0.72852194",
"0.72852194",
"0.7229926",
"0.7180901",
"0.70936525",
"0.69702876",
"0.6887761",
"0.6603851",
"0.6541124",
"0.6488166",
"0.6476991",
"0.64401025",
"0.64200073",
"0.6405436",
"0.63758516",
"0.6363515",
"0.63572127",
"0.62999797",
"0.629... | 0.7512134 | 0 |
Return random item for a type specified by a mode and a single format character. | def randrange_fmt(mode, char, obj):
x = randrange(*fmtdict[mode][char])
if char == 'c':
x = bytes([x])
if obj == 'numpy' and x == b'\x00':
# http://projects.scipy.org/numpy/ticket/1925
x = b'\x01'
if char == '?':
x = bool(x)
if char == 'f' or char == 'd':
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def randitems(n, obj='ndarray', mode=None, char=None):\n if mode is None:\n mode = choice(cap[obj][MODE])\n if char is None:\n char = choice(tuple(fmtdict[mode]))\n multiplier = choice(cap[obj][MULT])\n fmt = mode + '#' + char * int(multiplier if multiplier else 1)\n items = gen_items(... | [
"0.6796878",
"0.6796878",
"0.60390544",
"0.60390544",
"0.5697757",
"0.56245166",
"0.55712277",
"0.5493748",
"0.5452205",
"0.537199",
"0.5334354",
"0.5267052",
"0.52179533",
"0.5095594",
"0.5086428",
"0.5081015",
"0.5081015",
"0.5054717",
"0.50137657",
"0.50027424",
"0.4957444... | 0.5423713 | 9 |
Return a list of random items (or a scalar). | def gen_items(n, fmt, obj):
if n == 0:
return gen_item(fmt, obj)
lst = [0] * n
for i in range(n):
lst[i] = gen_item(fmt, obj)
return lst | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sample(self):\n return self.items[self.np_random.choice(len(self.items))]",
"def generator(self, random, args):\r\n if self.duplicates:\r\n max_count = [self.capacity // item[0] for item in self.items]\r\n return [random.randint(0, m) for m in max_count]\r\n else:\r... | [
"0.7186447",
"0.68290174",
"0.67713726",
"0.6744953",
"0.6688288",
"0.6684551",
"0.661171",
"0.6610131",
"0.6610131",
"0.6610131",
"0.6610131",
"0.65993875",
"0.6582984",
"0.6574758",
"0.65567404",
"0.6546218",
"0.65396774",
"0.6507699",
"0.65028495",
"0.65009904",
"0.6481836... | 0.0 | -1 |
Calculate strides of a contiguous array. Layout is 'C' or 'F' (Fortran). | def strides_from_shape(ndim, shape, itemsize, layout):
if ndim == 0:
return ()
if layout == 'C':
strides = list(shape[1:]) + [itemsize]
for i in range(ndim-2, -1, -1):
strides[i] *= strides[i+1]
else:
strides = [itemsize] + list(shape[:-1])
for i in range(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strides_from_shape(ndim, shape, itemsize, layout):\n if ndim == 0:\n return ()\n if layout == 'C':\n strides = list(shape[1:]) + [itemsize]\n for i in range(ndim - 2, -1, -1):\n strides[i] *= strides[i + 1]\n else:\n strides = [itemsize] + list(shape[:-1])\n ... | [
"0.6671998",
"0.6667623",
"0.63901645",
"0.62995565",
"0.6209812",
"0.62079126",
"0.6108434",
"0.60595614",
"0.60080725",
"0.5996222",
"0.5996222",
"0.5860129",
"0.57919973",
"0.57440704",
"0.56975204",
"0.56885684",
"0.56631756",
"0.5634464",
"0.56175673",
"0.5605618",
"0.55... | 0.6674238 | 0 |
Verify that the parameters represent a valid array within | def verify_structure(memlen, itemsize, ndim, shape, strides, offset):
if offset % itemsize:
return False
if offset < 0 or offset+itemsize > memlen:
return False
if any(v % itemsize for v in strides):
return False
if ndim <= 0:
return ndim == 0 and not shape and not strid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_array(t):\n basetype = t.type\n if is_array(basetype):\n raise ArrayOfArrayError(t)\n validate(basetype)",
"def _validate_array_params(array_params):\n if isinstance(array_params, dict):\n # Shallow check; make sure each antenna position is a 3-vector.\n if all(len(... | [
"0.7270341",
"0.69448113",
"0.683705",
"0.6811981",
"0.6776789",
"0.67708015",
"0.6727861",
"0.6655488",
"0.6578328",
"0.6572302",
"0.65476936",
"0.6494485",
"0.64726275",
"0.64687735",
"0.64408755",
"0.6395904",
"0.6385423",
"0.635954",
"0.63554",
"0.63529444",
"0.63336235",... | 0.0 | -1 |
Location of an item in the underlying memory. | def memory_index(indices, t):
memlen, itemsize, ndim, shape, strides, offset = t
p = offset
for i in range(ndim):
p += strides[i]*indices[i]
return p | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loc(self):\n return self._loc",
"def loc(self):\n return self._loc",
"def item_location(self, item_location):\n\n self._item_location = item_location",
"def location(self, item):\n return reverse(item)",
"def findItem(self, item):\n found_location = self.__find(item)\n\n ... | [
"0.64741904",
"0.64741904",
"0.6460164",
"0.630083",
"0.6235623",
"0.61925596",
"0.61581695",
"0.61156976",
"0.6103149",
"0.6092022",
"0.60529405",
"0.6024192",
"0.6024192",
"0.6024192",
"0.60195667",
"0.59354365",
"0.59073675",
"0.5875071",
"0.5874959",
"0.58549565",
"0.5850... | 0.0 | -1 |
Create a random slice of len slicelen that fits into listlen. | def randslice_from_slicelen(slicelen, listlen):
maxstart = listlen - slicelen
start = randrange(maxstart+1)
maxstep = (listlen - start) // slicelen if slicelen else 1
step = randrange(1, maxstep+1)
stop = start + slicelen * step
s = slice(start, stop, step)
_, _, _, control = slice_indices(s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def randslice_from_slicelen(slicelen, listlen):\n maxstart = listlen - slicelen\n start = randrange(maxstart + 1)\n maxstep = (listlen - start) // slicelen if slicelen else 1\n step = randrange(1, maxstep + 1)\n stop = start + slicelen * step\n s = slice(start, stop, step)\n _, _, _, control =... | [
"0.83833927",
"0.80226773",
"0.714893",
"0.7132235",
"0.6567857",
"0.6413113",
"0.62118304",
"0.61636114",
"0.6134608",
"0.6101278",
"0.61010647",
"0.6062314",
"0.60282576",
"0.6016087",
"0.59929234",
"0.5939068",
"0.59296066",
"0.59249735",
"0.59247345",
"0.5907804",
"0.5882... | 0.8387383 | 0 |
Create two sets of slices for an array x with shape 'shape' such that shapeof(x[lslices]) == shapeof(x[rslices]). | def randslice_from_shape(ndim, shape):
lslices = [0] * ndim
rslices = [0] * ndim
for n in range(ndim):
l = shape[n]
slicelen = randrange(1, l+1) if l > 0 else 0
lslices[n] = randslice_from_slicelen(slicelen, l)
rslices[n] = randslice_from_slicelen(slicelen, l)
return tupl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def randslice_from_shape(ndim, shape):\n lslices = [0] * ndim\n rslices = [0] * ndim\n for n in range(ndim):\n l = shape[n]\n slicelen = randrange(1, l + 1) if l > 0 else 0\n lslices[n] = randslice_from_slicelen(slicelen, l)\n rslices[n] = randslice_from_slicelen(slicelen, l)\n... | [
"0.6905628",
"0.65749097",
"0.6485385",
"0.6485385",
"0.6428866",
"0.64170295",
"0.64149487",
"0.6344559",
"0.6343766",
"0.6329222",
"0.62940896",
"0.6255896",
"0.62288624",
"0.6182799",
"0.59876955",
"0.5903534",
"0.58359647",
"0.5818925",
"0.5786385",
"0.5780439",
"0.572824... | 0.6896135 | 1 |
Interpret the raw memory of 'exporter' as a list of items with size 'itemsize'. If shape=None, the new structure is assumed to be 1D with n itemsize = bytelen. If shape is given, the usual constraint for contiguous arrays prod(shape) itemsize = bytelen applies. On success, return (items, shape). If the constraints cann... | def cast_items(exporter, fmt, itemsize, shape=None):
bytelen = exporter.nbytes
if shape:
if prod(shape) * itemsize != bytelen:
return None, shape
elif shape == []:
if exporter.ndim == 0 or itemsize != bytelen:
return None, shape
else:
n, r = divmod(bytelen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast_items(exporter, fmt, itemsize, shape=None):\n bytelen = exporter.nbytes\n if shape:\n if prod(shape) * itemsize != bytelen:\n return None, shape\n elif shape == []:\n if exporter.ndim == 0 or itemsize != bytelen:\n return None, shape\n else:\n n, r = ... | [
"0.77506953",
"0.49568605",
"0.48241737",
"0.48023552",
"0.47398067",
"0.4713811",
"0.47077888",
"0.46982223",
"0.4669957",
"0.4669957",
"0.4669957",
"0.4669957",
"0.46594286",
"0.4643557",
"0.459365",
"0.4521161",
"0.45037562",
"0.44983464",
"0.4494086",
"0.4490511",
"0.4454... | 0.77280533 | 1 |
Generate random slice for a single dimension of length n. If zero=True, the slices may be empty, otherwise they will be nonempty. | def rslice(n, allow_empty=False):
minlen = 0 if allow_empty or n == 0 else 1
slicelen = randrange(minlen, n+1)
return randslice_from_slicelen(slicelen, n) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rslice(n, allow_empty=False):\n minlen = 0 if allow_empty or n == 0 else 1\n slicelen = randrange(minlen, n + 1)\n return randslice_from_slicelen(slicelen, n)",
"def get_slice(self, n):\n if n == 0:\n return slice(self._lo_atom, self._lo_atom + self._n_atoms)\n raise IndexEr... | [
"0.77326006",
"0.70148605",
"0.6813906",
"0.6813906",
"0.6412858",
"0.63864595",
"0.62999004",
"0.6264508",
"0.61941475",
"0.6164201",
"0.616065",
"0.6156945",
"0.6141035",
"0.61246413",
"0.61231834",
"0.605221",
"0.60043675",
"0.60013884",
"0.59873164",
"0.5930526",
"0.59282... | 0.77208936 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.