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 |
|---|---|---|---|---|---|---|
Check that dates are correctly disallowed / allowed when autocreating a new reporting period. | def test_disallowed_dates_irrelevant_dates(self):
irrelevant_end_dates = [(2015, 2, 2), (2015, 11, 30)]
ct_existing_rps = len(hours.models.ReportingPeriod.objects.all())
for i in irrelevant_end_dates:
self.reporting_period.end_date = datetime.date(
year=i[0], month=i[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_disallowed_dates_safe_dates(self):\n safe_end_dates = [(2011, 9, 28), (2011, 10, 2), (2016, 9, 29),\n (2016, 10, 3)]\n ct_existing_rps = len(hours.models.ReportingPeriod.objects.all())\n for i in safe_end_dates:\n self.reporting_period.end_date = datetime.date(\n... | [
"0.77968085",
"0.7698771",
"0.707749",
"0.7014297",
"0.6884822",
"0.687822",
"0.6774892",
"0.6666843",
"0.6529984",
"0.6527829",
"0.6521866",
"0.65159553",
"0.6483164",
"0.6441659",
"0.6416569",
"0.6396082",
"0.6392582",
"0.63592756",
"0.63519114",
"0.63483226",
"0.6317232",
... | 0.76360506 | 2 |
Tests that a 404 is raised when a reporting period is not found. | def test_reportperiod_updatetimesheet_no_reportperiod(self):
date = datetime.date(1980, 10, 1).strftime('%Y-%m-%d')
response = self.app.get(
reverse(
'reportingperiod:UpdateTimesheet',
kwargs={'reporting_period': date}
),
user=self.regu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_404(self, response_GET):\n assert response_GET.status_code == 404",
"def test_404(self):\n pagename = \"arbitraryname\"\n response = self.client.get('/%s/' % pagename)\n self.assertEqual(404, response.status_code)",
"def test_404():\n errorURL = \"gdfipjdfgspi\"\n ... | [
"0.75614256",
"0.7432876",
"0.74284613",
"0.7203633",
"0.71612805",
"0.7075298",
"0.70667654",
"0.705628",
"0.704824",
"0.700587",
"0.6946102",
"0.6892896",
"0.6892196",
"0.68912864",
"0.6870355",
"0.6859525",
"0.68569124",
"0.68569124",
"0.6854004",
"0.68535656",
"0.68314797... | 0.71486217 | 5 |
Tests that the project choices are filtered to only include those assigned to the user's organization and those with no organization assignment. | def test_project_choice_filtering(self):
# additional test setup
org_18f = Organization.objects.create(name='18F')
org_18f.save()
org_coe = Organization.objects.create(name='CoE')
org_coe.save()
accounting_code = AccountingCode.objects.get(pk=1)
project_18f = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_accessible_projects(self, user):\n model = self.model\n if user.is_project_admin():\n flt = Q()\n else:\n membs = user.projectmembership_set.associated()\n memb_projects = membs.values_list(\"project\", flat=True)\n flt = (Q(application__own... | [
"0.6641838",
"0.6225805",
"0.6059173",
"0.60482776",
"0.6010728",
"0.58393925",
"0.5832138",
"0.58174145",
"0.57480633",
"0.5712427",
"0.5707613",
"0.57019717",
"0.5701706",
"0.5701599",
"0.5675278",
"0.56499195",
"0.5647367",
"0.56324446",
"0.5616264",
"0.5607845",
"0.560144... | 0.73948216 | 0 |
Check that ReportingPeriodDetailView properly allocates those who filled out (submitted) time vs. not | def test_ReportingPeriodDetailView_add_submitted_time(self):
self.timecard = hours.models.Timecard.objects.create(
user=self.regular_user,
submitted=True,
reporting_period=self.reporting_period
)
response = self.app.get(
reverse(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_ReportingPeriodDetailView_add_unsubmitted_time(self):\n\n self.timecard = hours.models.Timecard.objects.create(\n user=self.regular_user,\n submitted=False,\n reporting_period=self.reporting_period\n )\n\n response = self.app.get(\n reverse(... | [
"0.73541933",
"0.6158955",
"0.6013145",
"0.5919478",
"0.59192145",
"0.58321595",
"0.57999563",
"0.5773941",
"0.576367",
"0.5754915",
"0.5632372",
"0.5629072",
"0.562852",
"0.56011426",
"0.55982995",
"0.55448246",
"0.55413",
"0.55127287",
"0.5485287",
"0.5461131",
"0.5452352",... | 0.6837181 | 1 |
Check that ReportingPeriodDetailView properly allocates those who filled out (submitted) time vs. not, another example | def test_ReportingPeriodDetailView_add_unsubmitted_time(self):
self.timecard = hours.models.Timecard.objects.create(
user=self.regular_user,
submitted=False,
reporting_period=self.reporting_period
)
response = self.app.get(
reverse(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_ReportingPeriodDetailView_add_submitted_time(self):\n\n self.timecard = hours.models.Timecard.objects.create(\n user=self.regular_user,\n submitted=True,\n reporting_period=self.reporting_period\n )\n\n response = self.app.get(\n reverse(\n ... | [
"0.68354475",
"0.6157524",
"0.6016419",
"0.5944293",
"0.58190775",
"0.58138067",
"0.5749262",
"0.5744311",
"0.57175803",
"0.55900764",
"0.55719703",
"0.5562543",
"0.55400264",
"0.5510874",
"0.5509013",
"0.5508616",
"0.55024004",
"0.54906446",
"0.5458355",
"0.54554063",
"0.544... | 0.7302744 | 0 |
Common method for obtaining user agent | def get_user_agent():
global USERAGENT
if not USERAGENT:
USERAGENT = "mbed-cloud-sdk-python/{sdk_ver} ({pfm}) Python/{py_ver}".format(
sdk_ver=__version__,
pfm=platform.platform(),
py_ver=platform.python_version()
)
return USERAGENT | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_agent():\n\n global _user_agent\n\n return _user_agent",
"def user_agent(self):\n ua_list = [\n 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101',\n 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like... | [
"0.8323051",
"0.7876789",
"0.7711473",
"0.76195496",
"0.750242",
"0.73865265",
"0.73173153",
"0.72956014",
"0.72387725",
"0.721986",
"0.7184236",
"0.7156263",
"0.7085454",
"0.70512456",
"0.70208144",
"0.6991465",
"0.69139963",
"0.69139016",
"0.6878742",
"0.6869681",
"0.685544... | 0.7680961 | 3 |
Returns the optimiser's current best estimate of where the optimum is. For many optimisers, this will simply be the point for which the minimal error or maximum likelihood was observed, so that | def x_guessed(self):
return self.x_best() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_best_fitness(self):\n if self.maximize:\n return -self.best_fitness\n else:\n return self.best_fitness",
"def get_best(self):\n return min(self.solutions, key=lambda s: s.f)",
"def best(self):\n return self.params.iloc[-1]",
"def get_best_fitness(self... | [
"0.74143434",
"0.699834",
"0.6985954",
"0.69836646",
"0.6905419",
"0.6890662",
"0.6874809",
"0.6852573",
"0.6828254",
"0.6734075",
"0.6668067",
"0.6660641",
"0.6609865",
"0.65823156",
"0.65776056",
"0.6575652",
"0.6481568",
"0.64793223",
"0.64668506",
"0.64590347",
"0.6451221... | 0.0 | -1 |
Returns this optimiser's population size. If no explicit population size has been set, ``None`` may be returned. Once running, the correct value will always be returned. | def population_size(self):
return self._population_size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _suggested_population_size(self):\n raise NotImplementedError",
"def size(self, population: int) -> int: # noqa pylint: disable=invalid-overridden-method, disable=arguments-differ\n if population < 1:\n return 0 \n\n probability = 0.5\n n_zero = (((self._get_alpha() **... | [
"0.76119936",
"0.74137014",
"0.73680866",
"0.72531927",
"0.70109326",
"0.70109326",
"0.69495815",
"0.69495815",
"0.69495815",
"0.6932996",
"0.6849542",
"0.67861056",
"0.67861056",
"0.67434186",
"0.66359437",
"0.6628878",
"0.6628878",
"0.6628878",
"0.6628878",
"0.6597806",
"0.... | 0.87317485 | 0 |
Returns the number of parallel worker processes this routine will be run on, or ``False`` if parallelisation is disabled. | def parallel(self):
return self._n_workers if self._parallel else False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_num_MPI_workers():\n return _num_MPI_workers",
"def get_num_procs():\n return get_num_MPI_workers()",
"def get_num_workers() -> int:\n if \"SLURM_CPUS_PER_TASK\" in os.environ:\n return int(os.environ[\"SLURM_CPUS_PER_TASK\"])\n if hasattr(os, \"sched_getaffinity\"):\n return ... | [
"0.7409304",
"0.7361417",
"0.71491647",
"0.70036024",
"0.6999105",
"0.6967634",
"0.6964194",
"0.69532514",
"0.67751443",
"0.67692494",
"0.6694534",
"0.66717523",
"0.6658294",
"0.66336495",
"0.66188824",
"0.66045016",
"0.66045016",
"0.6604069",
"0.66034085",
"0.66034085",
"0.6... | 0.83644134 | 0 |
Changes the frequency with which messages are logged. | def set_log_interval(self, iters=20, warm_up=3):
iters = int(iters)
if iters < 1:
raise ValueError('Interval must be greater than zero.')
warm_up = max(0, int(warm_up))
self._message_interval = iters
self._message_warm_up = warm_up | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setFrequency(self,freq):\n self.write(\"FREQ:FIXED %f\" % (freq*1e9))\n return self.frequency()",
"def update_frequency(self, frequency):\n\n self._frequency = frequency",
"def set_freq(self, count):\n self.element.set_freq(count)",
"def set_frequency(self, frequency):\n self._... | [
"0.71132225",
"0.704733",
"0.6979209",
"0.6943041",
"0.6857384",
"0.6843564",
"0.66859967",
"0.66381824",
"0.65911967",
"0.6585567",
"0.65704584",
"0.6502774",
"0.6445657",
"0.64280176",
"0.6422337",
"0.63709867",
"0.6309642",
"0.6308087",
"0.62611",
"0.6229278",
"0.620694",
... | 0.5360812 | 99 |
Enables logging to file when a filename is passed in, disables it if ``filename`` is ``False`` or ``None``. The argument ``csv`` can be set to ``True`` to write the file in comma separated value (CSV) format. By default, the file contents will be similar to the output on screen. | def set_log_to_file(self, filename=None, csv=False):
if filename:
self._log_filename = str(filename)
self._log_csv = True if csv else False
else:
self._log_filename = None
self._log_csv = False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_logging(cls, filename=None, filemode='a',\n stream=sys.stdout, level=logging.INFO):\n\n cls.disable_logging() # clear previously set logging info\n\n if filename is None:\n logging.basicConfig(stream=stream, level=level)\n else:\n loggin... | [
"0.6603974",
"0.5903285",
"0.5843677",
"0.5772465",
"0.5758034",
"0.57300866",
"0.5568301",
"0.54659355",
"0.54461217",
"0.5403246",
"0.5371382",
"0.5352832",
"0.5268111",
"0.52493167",
"0.5231791",
"0.52231187",
"0.51632136",
"0.51486814",
"0.51363194",
"0.5134641",
"0.50891... | 0.7784217 | 0 |
Enables/disables parallel evaluation. If ``parallel=True``, the method will run using a number of worker processes equal to the detected cpu core count. The number of workers can be set explicitly by setting ``parallel`` to an integer greater than 0. Parallelisation can be disabled by setting ``parallel`` to ``0`` or `... | def set_parallel(self, parallel=False):
if parallel is True:
self._parallel = True
self._n_workers = pints.ParallelEvaluator.cpu_count()
elif parallel >= 1:
self._parallel = True
self._n_workers = int(parallel)
else:
self._parallel = Fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_parallel(self):\n self._technical_vision_system.is_parrallel_processing = True\n return self",
"def disable_parallel():\n env.parallel = False",
"def parallel(self, parallel):\n self._parallel = parallel",
"def set_inter_op_parallelism_threads(num_threads):\n context.context()... | [
"0.6798402",
"0.65742874",
"0.6560508",
"0.609886",
"0.5972114",
"0.5971042",
"0.5763355",
"0.57475686",
"0.5746025",
"0.5730751",
"0.5698842",
"0.56891817",
"0.56306255",
"0.5627279",
"0.56073606",
"0.56073606",
"0.5592142",
"0.5583025",
"0.5509113",
"0.5472543",
"0.54536206... | 0.8028691 | 0 |
Returns the threshold stopping criterion, or ``None`` if no threshold | def threshold(self):
return self._threshold | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def threshold(self) -> Optional[float]:\n return pulumi.get(self, \"threshold\")",
"def threshold(self) -> Optional[pulumi.Input[float]]:\n return pulumi.get(self, \"threshold\")",
"def threshold(self) -> Optional[pulumi.Input[float]]:\n return pulumi.get(self, \"threshold\")",
"def thre... | [
"0.74610376",
"0.72877043",
"0.72877043",
"0.72657484",
"0.7203553",
"0.70013696",
"0.68740445",
"0.68740445",
"0.6780566",
"0.6726478",
"0.659642",
"0.659642",
"0.65609884",
"0.65609884",
"0.65609884",
"0.65609884",
"0.65609884",
"0.65609884",
"0.65609884",
"0.65609884",
"0.... | 0.6717696 | 14 |
Compute FirstPreference Tallies (1b) Assumes there is at least one ballot. | def compute_first_preference_tallies(cob_ballots: List[CandidateOrderBallot],
private_key_ring: PrivateKeyRing,
public_key: PublicKey) -> Tuple[List[FirstPreferenceBallot], List[int]]:
debug('Computing first preference tallies')
# Initia... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_count(self):\n for vote in self.ballot:\n for index, i in enumerate(vote):\n if i == 1:\n self.candidates[index].first_votes.append(vote.copy())\n\n for j in self.candidates:\n j.votes_per_count.append(len(j.first_votes))\n self... | [
"0.5528067",
"0.53458405",
"0.52926904",
"0.5269104",
"0.5247976",
"0.52079445",
"0.5198953",
"0.5148296",
"0.5137599",
"0.5133807",
"0.5092041",
"0.50895023",
"0.50155246",
"0.5001481",
"0.49564356",
"0.49161515",
"0.48998162",
"0.48996696",
"0.48967198",
"0.48782843",
"0.48... | 0.765121 | 0 |
Reweight a single FirstPreferenceBallot and convert it to a CandidateOrderBallot. | def reweight_and_convert_ballot(fpb: FirstPreferenceBallot,
d_lcm: int,
elected: Set[int],
tallies: List[int],
quota: int,
zero: EncryptedNumber) -> CandidateOrderBa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reweight_votes(fpb_ballots: List[FirstPreferenceBallot],\n elected: Set[int],\n quota: int,\n tallies: List[int],\n public_key: PublicKey) -> Tuple[List[CandidateOrderBallot], int]:\n debug('Reweighting votes')\n\n if len(fpb_ballots... | [
"0.5847335",
"0.5463291",
"0.50853056",
"0.48526862",
"0.47801855",
"0.47655332",
"0.47343463",
"0.47118902",
"0.46291298",
"0.45698544",
"0.45558283",
"0.45312876",
"0.45219943",
"0.44877988",
"0.44689104",
"0.4442062",
"0.44183296",
"0.44058016",
"0.43944445",
"0.4373531",
... | 0.5825361 | 1 |
Copy user string n number of times. | def string_copy(user_string, no_of_copy):
return user_string * no_of_copy | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repeat_string_n_times(string, count):\n return string * int(count)",
"def repeat_char(char: str, n_times: int):\r\n return char*n_times",
"def string_times(str, n):\n return str * n",
"def repeat(s, n):\n\n if n > 0:\n return s * n\n else:\n return",
"def repeat(phrase,... | [
"0.739596",
"0.6900853",
"0.67257446",
"0.63742894",
"0.6328386",
"0.6232217",
"0.6117573",
"0.61083716",
"0.5987238",
"0.59180826",
"0.5614455",
"0.55454534",
"0.5511693",
"0.5378775",
"0.53740317",
"0.5326628",
"0.52962613",
"0.5286316",
"0.5257397",
"0.5249922",
"0.5237686... | 0.7653097 | 0 |
Initialize the tokenbased replay streaming conformance | def __init__(self, net, im, fm, parameters=None):
if parameters is None:
parameters = {}
self.case_id_key = exec_utils.get_param_value(Parameters.CASE_ID_KEY, parameters, constants.CASE_CONCEPT_NAME)
self.activity_key = exec_utils.get_param_value(Parameters.ACTIVITY_KEY, parameters,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n\n self.__tokens = list()\n self.__messages = MessageList()",
"def __init__(self, tokenizer, seq2seq, decoder_start_token_id=101, eos_token_id=102):\n self.tokenizer = tokenizer\n self.seq2seq = seq2seq\n self.decoder_start_token_id = decoder_start_token_id... | [
"0.6553564",
"0.64522713",
"0.6105662",
"0.60979724",
"0.60894054",
"0.60648674",
"0.6011314",
"0.60104257",
"0.6003984",
"0.59723693",
"0.5969509",
"0.5961585",
"0.5938851",
"0.5932635",
"0.59169453",
"0.58934224",
"0.5888008",
"0.5866631",
"0.5865806",
"0.583411",
"0.583411... | 0.0 | -1 |
Custom method for checking if user has a particular global permission which doesn't apply to a specific resource but it's systemwide aka global permission. | def _user_has_global_permission(self, user_db, permission_type):
log_context = {
'user_db': user_db,
'permission_type': permission_type,
'resolver': self.__class__.__name__
}
self._log('Checking user permissions', extra=log_context)
# First check the ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_special_restriction(self, user, perm):\n return False",
"def has_special_perm(self, user, perm):\n return False",
"def _global_permissions_for(self, principal, permission):\n groups = getUtility(IGroups)\n if self.principal and principal == self.principal.id:\n # ... | [
"0.7074027",
"0.68993783",
"0.6710469",
"0.6543376",
"0.64832187",
"0.6446929",
"0.63969374",
"0.636285",
"0.6294999",
"0.626011",
"0.62359214",
"0.61834896",
"0.6174503",
"0.615102",
"0.615102",
"0.6105435",
"0.6104026",
"0.61028093",
"0.6078019",
"0.6078019",
"0.6078019",
... | 0.69412816 | 1 |
Check the user system roles and return True if user has the required permission. | def _user_has_system_role_permission(self, user_db, permission_type):
permission_name = PermissionType.get_permission_name(permission_type)
user_role_dbs = get_roles_for_user(user_db=user_db)
user_role_names = [role_db.name for role_db in user_role_dbs]
if SystemRole.SYSTEM_ADMIN in us... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_has_role(cls, user, obj):\n return user.has_perms(cls.class_to_permissions[type(obj)], obj)",
"def can_manage_users(self, object):\n admin_roles = ('Manager', 'Site Administrator', 'StaffMember')\n is_adm = False\n if not api.user.is_anonymous():\n user = api.user.... | [
"0.7229037",
"0.70914364",
"0.7012235",
"0.700399",
"0.700399",
"0.700399",
"0.700399",
"0.700399",
"0.69430304",
"0.67995733",
"0.6765237",
"0.675107",
"0.66892284",
"0.6669128",
"0.66556156",
"0.66414285",
"0.66096395",
"0.66044",
"0.6580919",
"0.6579713",
"0.6576141",
"0... | 0.7908721 | 0 |
Retrieve "ALL" permission type for the provided resource. | def _get_all_permission_type_for_resource(self, resource_db):
resource_type = resource_db.get_resource_type()
permission_type = PermissionType.get_permission_type(resource_type=resource_type,
permission_name='all')
return permission_ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_user_permissions_for_resource(\n self, resource_id: str, resource_type: PermissionableResourceType\n ) -> Dict[str, Dict[str, int]]:\n url = self._create_url(\"/users/permissions\")\n return self._call_api(\n url, data=json.dumps({\"resource_id\": resource_id, \"resource_... | [
"0.6177559",
"0.6165522",
"0.5992802",
"0.56761193",
"0.56761193",
"0.56761193",
"0.5604099",
"0.55567116",
"0.5552753",
"0.55473304",
"0.55473304",
"0.55401105",
"0.55262464",
"0.5525513",
"0.55180115",
"0.55141187",
"0.55056334",
"0.5503641",
"0.54959357",
"0.54923123",
"0.... | 0.8312391 | 0 |
Check if the user has access to the provided trigger. This method is to be used during rule create and update where we check if the user has the necessary trigger permissions. | def user_has_trigger_permission(self, user_db, trigger):
log_context = {
'user_db': user_db,
'trigger': trigger,
'resolver': self.__class__.__name__
}
trigger_type = trigger['type']
trigger_parameters = trigger.get('parameters', {})
if trigge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_permission(self, request, view):\n if settings.ENHANCED_ORG_ADMIN and request.user.admin:\n return True\n\n resource_access = request.user.access\n if resource_access is None or not isinstance(resource_access, dict):\n return False\n\n res_type_access = res... | [
"0.6657865",
"0.66505104",
"0.6619383",
"0.6619383",
"0.6610587",
"0.6566698",
"0.65393794",
"0.65185916",
"0.65185916",
"0.6502062",
"0.64832675",
"0.64598775",
"0.6416737",
"0.63905066",
"0.6346886",
"0.6333278",
"0.6328383",
"0.6308835",
"0.6308835",
"0.6308835",
"0.630883... | 0.79630125 | 0 |
Call this function to write dict contents. | def _append_dict(self, value, file):
tabs = '\t' * self._tctr
labs = '{tabs}<dict>\n'.format(tabs=tabs)
file.write(labs)
self._tctr += 1
for (item, text) in value.items():
if text is None:
continue
tabs = '\t' * self._tctr
key... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __writeDict(obj, output):\n output.write(\"%i:{\" % len(obj))\n for key in sorted(obj.keys()):\n __serialize(key, output)\n __serialize(obj[key], output)\n output.write(\"}\")",
"def dict_storage_write(self):\n\n r = lib.il_servo_dict_storage_write(self._servo)\n raise_err(r)",
"def ... | [
"0.72946733",
"0.72605324",
"0.6734507",
"0.6687559",
"0.66782635",
"0.6630329",
"0.66106826",
"0.6453021",
"0.63609856",
"0.63142216",
"0.6277541",
"0.6237108",
"0.6198458",
"0.61680394",
"0.6161695",
"0.61536914",
"0.61213017",
"0.61141235",
"0.6081109",
"0.60611594",
"0.60... | 0.6950074 | 2 |
Create the logging console. | def CreateOutputWindow(self, st): # noqa
self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, style=wx.DEFAULT_FRAME_STYLE)
self.text = wx.TextCtrl(self.frame, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH)
self.text.AppendText(st)
self.frame.Show(True)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logger_creator():\r\n\r\n logger = logging.getLogger()\r\n logger.setLevel(logging.INFO)\r\n formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\r\n\r\n file_handler = logging.FileHandler('logs.log')\r\n file_handler.setLevel(logging.INFO)\r\n file_handler.setFormatter(... | [
"0.6924227",
"0.6845379",
"0.68105227",
"0.66861874",
"0.6672366",
"0.6577003",
"0.6558855",
"0.654947",
"0.65203595",
"0.6508284",
"0.6492344",
"0.6486415",
"0.64557517",
"0.64408964",
"0.64179224",
"0.6404769",
"0.6404269",
"0.63962275",
"0.6388216",
"0.6377787",
"0.6362551... | 0.0 | -1 |
Check to see if this is the only instance. | def ensure_single_instance(self, name):
self.name = "%s-%s" % (self.single_instance, wx.GetUserId())
self.instance = wx.SingleInstanceChecker(self.name)
if self.instance.IsAnotherRunning():
# wx.MessageBox("Only one instance allowed!", "ERROR", wx.OK | wx.ICON_ERROR)
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasInstance():\n\n pass",
"def is_instance_okay(self):\n\n return self.instance_okay",
"def instance_exists(self, instance):\n pass",
"def is_one(self):\n return self == self.parent().one()",
"def is_sync_instance(self):\n return True",
"def private_instance(self) -... | [
"0.7293873",
"0.7220457",
"0.66642237",
"0.6603298",
"0.6571663",
"0.6567953",
"0.6555846",
"0.6455965",
"0.6401864",
"0.6381869",
"0.636055",
"0.6346171",
"0.6335933",
"0.63092065",
"0.62829417",
"0.6281139",
"0.6261675",
"0.6251727",
"0.6205083",
"0.61775154",
"0.6145711",
... | 0.7064159 | 2 |
Return whether this is the only instance. | def is_instance_okay(self):
return self.instance_okay | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasInstance():\n\n pass",
"def is_sync_instance(self):\n return True",
"def is_static_instance(self):\r\n _static_instance = vars(self._res)[\"static_instance\"]\r\n _static_instance = (_static_instance == \"True\")\r\n return _static_instance",
"def private_instance(self) ... | [
"0.696714",
"0.6917706",
"0.68672425",
"0.68480486",
"0.681965",
"0.67272604",
"0.66820705",
"0.6603025",
"0.65989923",
"0.6549998",
"0.641907",
"0.6393837",
"0.6334295",
"0.6326949",
"0.6326949",
"0.63095796",
"0.630807",
"0.6299857",
"0.62929696",
"0.62874395",
"0.6275848",... | 0.7218336 | 0 |
Return if the thread is still busy. | def IsRunning(self): # noqa
return self.running | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isBusy(self):\r\n\t\treturn 0",
"def ready_to_work(self):\n return self._time + self.thread_work_timer < time.time()",
"def is_task_done(self):\n return not self.thread.is_alive()",
"def isBusy(self) -> bool:\n ...",
"def is_holding(self):\n\n return time.time() > self.runni... | [
"0.7439245",
"0.73742074",
"0.7213975",
"0.7210378",
"0.7149182",
"0.7111122",
"0.69676876",
"0.6954496",
"0.6917342",
"0.68968993",
"0.68968993",
"0.68968993",
"0.68438894",
"0.6837093",
"0.67907375",
"0.67699796",
"0.6743701",
"0.67174417",
"0.67174417",
"0.6713603",
"0.669... | 0.0 | -1 |
Get the debug mode. | def get_debug_mode():
return DEBUG_MODE | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_debug_mode():\n return __DEBUG_MODE",
"def get_debug_mode(self):\n\n raise NotImplementedError",
"def inDEBUGMode(self):\n return DEBUG",
"def get_debug(cls):\n return cls.get(\"debug\", \"general\")",
"def debug_mode(value):\n if settings.DEBUG:\n return \... | [
"0.8927291",
"0.89100194",
"0.79499954",
"0.79357034",
"0.7879769",
"0.7791722",
"0.7737419",
"0.77345765",
"0.7706466",
"0.7626303",
"0.7570308",
"0.74043673",
"0.74032104",
"0.73173785",
"0.73173785",
"0.7307791",
"0.7251454",
"0.7227361",
"0.7154393",
"0.7035953",
"0.68873... | 0.93026114 | 0 |
Get debug console mode. | def get_debug_console():
return DEBUG_CONSOLE | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_debug_mode():\n\n return DEBUG_MODE",
"def get_current_debug_mode():\n return __DEBUG_MODE",
"def get_debug_mode(self):\n\n raise NotImplementedError",
"def debug_mode(value):\n if settings.DEBUG:\n return \"true\"\n return \"\"",
"def get_debug():\n return os.environ.g... | [
"0.84469527",
"0.82876426",
"0.8108852",
"0.7338829",
"0.7216558",
"0.7174535",
"0.704934",
"0.69092774",
"0.69064754",
"0.6890909",
"0.68667704",
"0.68153894",
"0.6635333",
"0.66277987",
"0.6603123",
"0.656061",
"0.6557044",
"0.6541856",
"0.64679235",
"0.6449281",
"0.6448426... | 0.83408165 | 1 |
Returns whether the queue is empty or not. | def isEmpty(self):
return self.head == None and self.tail == None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsEmpty(self):\r\n return len(self._queue) == 0",
"def is_empty(self):\n return len(self._queue) == 0",
"def is_empty(self):\n if self.queue:\n return False\n return True",
"def is_empty(self):\n\n return not self._queue",
"def empty(self):\n return len(... | [
"0.9237016",
"0.91808623",
"0.9150773",
"0.910462",
"0.9010867",
"0.9010867",
"0.9001721",
"0.8987532",
"0.89514333",
"0.89002913",
"0.8879796",
"0.88773483",
"0.885158",
"0.8815195",
"0.88077414",
"0.8806507",
"0.859514",
"0.8322011",
"0.8238974",
"0.8233937",
"0.8216378",
... | 0.0 | -1 |
Adds a new element at the beginning of the queue. | def append(self, data):
if self.isEmpty():
# If the queue is empty, simply create a new node at the
# end, and refer the head to this one
self.tail = Node(data)
self.head = self.tail
else:
temp = Node(data, self.head)
self.h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push_front(self, item):\n self.list.prepend(item)",
"def push_front(self, val):\r\n self.deque.insert(0, val)",
"def enqueue(queue, element):\n push(queue.stack1, element)\n queue.size += 1",
"def enqueue(self, item):\r\n self.items.insert(0, item)",
"def enqueue(self, item):... | [
"0.7761072",
"0.7625746",
"0.75843406",
"0.75275207",
"0.7512845",
"0.7512003",
"0.7421575",
"0.7421575",
"0.74146646",
"0.7338709",
"0.7276793",
"0.72758394",
"0.72470117",
"0.72085184",
"0.7208361",
"0.71647984",
"0.7152936",
"0.7132964",
"0.7126764",
"0.70792586",
"0.70607... | 0.0 | -1 |
Removes the oldest element of the queue. | def pop(self):
if self.isEmpty():
raise IndexError("Tried to dequeue from an empty queue.")
temp = self.tail.data
if self.head == self.tail:
# When there's only one element in the queue, both head
# and tail refer to no element
self.head =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delMin(self):\n N = self.size()\n min = self.__queue[1]\n self.__exch(1, N)\n self.__queue.pop()\n self.__sink(1)\n return min",
"def pop_min(self):\n self.queue[0], minimum = self.queue.pop(), self.queue[0]\n self._rebalance_deletion(0)\n return... | [
"0.79290926",
"0.7597523",
"0.726985",
"0.72598284",
"0.7230689",
"0.7104415",
"0.7090502",
"0.70796734",
"0.7066969",
"0.7062795",
"0.70210946",
"0.702011",
"0.698412",
"0.6946987",
"0.6941074",
"0.6939538",
"0.6916231",
"0.68985474",
"0.68734646",
"0.6871192",
"0.68609595",... | 0.0 | -1 |
Set the schedule for loopy belief propagation. | def set_schedule(self, schedule):
self._schedule = []
for elem in schedule:
if isinstance(elem, Factor):
for variable in self.factor_edges[elem]:
self._schedule.append((elem, variable))
if isinstance(elem, Variable):
for factor ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_lr_schedule(self, ):\n self.lr_schedule.apply_schedule()\n self.lr = self.lr_schedule.get_lr()",
"def setup_lr_sched(self):\n assert (self.opts['lr_policy'] in [None, 'multisteps', 'cyclic'])\n self.g_step_op = tf.train.get_or_create_global_step()\n\n # Use a set lear... | [
"0.58741957",
"0.56386805",
"0.55973285",
"0.55613637",
"0.54954755",
"0.5481164",
"0.5443592",
"0.53947836",
"0.5393209",
"0.5390523",
"0.5383084",
"0.5373929",
"0.52940834",
"0.529066",
"0.52452946",
"0.52282715",
"0.5203015",
"0.51804036",
"0.5166172",
"0.5135087",
"0.5118... | 0.51642215 | 19 |
This function calculate the distance between to points on the Earth Surface not considering the curvature of the earth. the Latitude and Longitude should be measured in DD (DegreeDecimal). | def ecluidianDist(lat1, lon1, lat2, lon2):
deltalat = (np.float(lat2) - np.float(lat1)) * 110.9463
deltalong = (np.float(lon2) - np.float(lon1)) * 90.4219
dist1 = np.sqrt(np.power(lon2 - lon1, 2) + np.power(lat2 - lat1, 2))
dist2 = np.float(np.linalg.norm([deltalat, deltalong]))
return np.float(dist... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance_on_earth(start, end):\n import math\n\n def recalculate_coordinate(val, _as=None):\n \"\"\"\n Accepts a coordinate as a tuple (degree, minutes, seconds)\n You can give only one of them (e.g. only minutes as a floating point number) and it will be duly\n recalculated i... | [
"0.670297",
"0.6674379",
"0.66425526",
"0.64594394",
"0.64369994",
"0.6407928",
"0.63839966",
"0.6317682",
"0.6310998",
"0.629603",
"0.6267399",
"0.6231753",
"0.6172961",
"0.61504126",
"0.610534",
"0.6104822",
"0.61036634",
"0.61011034",
"0.60882163",
"0.60858196",
"0.6085805... | 0.6574493 | 3 |
Convert lists to frozensets, return rest. | def hash_if_list(val):
if isinstance(val, list):
return frozenset(val)
return val | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method2():\n atoms = []\n for cet in F:\n if len(cet) == 0:\n # An atom must be nonempty.\n continue\n\n # We just go through the elements of F. If another nonempty\n # element is a strict subset cet, then cet is not an atom.\n ... | [
"0.63285214",
"0.62120855",
"0.59819585",
"0.59333074",
"0.5895203",
"0.5878369",
"0.5871241",
"0.5828153",
"0.5812657",
"0.57925916",
"0.57204336",
"0.5711652",
"0.57072604",
"0.5668494",
"0.5655666",
"0.5653809",
"0.562886",
"0.5612216",
"0.5598928",
"0.55621845",
"0.554485... | 0.5481265 | 22 |
Clean a scraped mapping list and return as a dict. If the field used as dict key is empty or nonunique a warning is raise and that entry skipped. | def consume_entries(self, units, key_val, require=None, only=None):
if require:
require = common.listify(require) # allow both single str and list
presentable_units = {}
for entry in units:
clean_entry = self.clean_entry(entry)
if require and not any(clean_e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cleanup_mapping(mapping: Mapping[str, Any]) -> dict:\n cleaned = {}\n for key, value in mapping.items():\n if isinstance(value, collections.abc.Mapping):\n cleaned[key] = cleanup_mapping(value)\n elif value is not None and value != '':\n cleaned[key] = value\n retur... | [
"0.6616703",
"0.6355308",
"0.6135623",
"0.6093804",
"0.6071954",
"0.5972483",
"0.5952861",
"0.5847593",
"0.5782557",
"0.57701176",
"0.57551825",
"0.5676454",
"0.5674733",
"0.5669197",
"0.5666181",
"0.5647225",
"0.5640692",
"0.56292397",
"0.56054807",
"0.55881345",
"0.55749214... | 0.0 | -1 |
Obtains the value of the metric. | def result(self) -> Optional[TResult]:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self) -> float:\n return pulumi.get(self, \"value\")",
"def value(self) -> float:\n return pulumi.get(self, \"value\")",
"def value(self) -> pulumi.Output[float]:\n return pulumi.get(self, \"value\")",
"def getValue( self ) :\n\n return( self.value )",
"def getValue(se... | [
"0.77215785",
"0.77215785",
"0.7614662",
"0.75855833",
"0.758207",
"0.75733536",
"0.75733536",
"0.75733536",
"0.75733536",
"0.7565378",
"0.75560653",
"0.75560653",
"0.75560653",
"0.75560653",
"0.75560653",
"0.75560653",
"0.75560653",
"0.75560653",
"0.75560653",
"0.7532445",
"... | 0.0 | -1 |
Creates an instance of a plugin metric. Child classes can safely invoke this (super) constructor as the first experience. | def __init__(self):
super().__init__()
self._metric_x_counters: Dict[str, int] = dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _metric_init(self): # pragma: no cover\n raise NotImplementedError('_metric_init() must be implemented by %r' % self)",
"def __init__(__self__, *,\n metric: pulumi.Input[str],\n value: pulumi.Input[float]):\n pulumi.set(__self__, \"metric\", metric)\n pul... | [
"0.64185715",
"0.6321763",
"0.62755346",
"0.6237256",
"0.6235338",
"0.60977316",
"0.605897",
"0.60535914",
"0.6039822",
"0.6033404",
"0.5998209",
"0.5991497",
"0.5947943",
"0.58903205",
"0.58873546",
"0.5854948",
"0.5842756",
"0.5808932",
"0.57478136",
"0.5712828",
"0.5698495... | 0.57822937 | 18 |
Get CUBLAS version. Returns version number of installed CUBLAS libraries. | def cublasGetVersion(handle):
version = ctypes.c_int()
status = _libcublas.cublasGetVersion_v2(handle, ctypes.byref(version))
cublasCheckStatus(status)
return version.value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_cublas_version():\n\n cublas_path = utils.find_lib_path('cublas')\n try:\n major, minor = re.search(r'[\\D\\.]+\\.+(\\d+)\\.(\\d+)',\n utils.get_soname(cublas_path)).groups()\n except:\n\n # Create a temporary context to run cublasGetVersion():\n ... | [
"0.8150555",
"0.6379007",
"0.6256633",
"0.62494606",
"0.61516786",
"0.59956974",
"0.5993636",
"0.5988495",
"0.5944245",
"0.58758074",
"0.58321404",
"0.5797965",
"0.5797965",
"0.57711875",
"0.57424444",
"0.5720351",
"0.57182413",
"0.57136744",
"0.57136744",
"0.57126296",
"0.56... | 0.6702518 | 1 |
Get and save CUBLAS version using the CUBLAS library's SONAME. This function tries to avoid calling cublasGetVersion because creating a CUBLAS context can subtly affect the performance of subsequent CUDA operations in certain circumstances. Results | def _get_cublas_version():
cublas_path = utils.find_lib_path('cublas')
try:
major, minor = re.search(r'[\D\.]+\.+(\d+)\.(\d+)',
utils.get_soname(cublas_path)).groups()
except:
# Create a temporary context to run cublasGetVersion():
warnings.warn('cr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cublasGetVersion(handle):\n\n version = ctypes.c_int()\n status = _libcublas.cublasGetVersion_v2(handle, ctypes.byref(version))\n cublasCheckStatus(status)\n return version.value",
"def ggml_cpu_has_cublas() -> int:\n ...",
"def cublasCreate():\n\n handle = _types.handle()\n status = _... | [
"0.6337884",
"0.5591958",
"0.55325055",
"0.5318613",
"0.50645703",
"0.49699083",
"0.47905228",
"0.4784208",
"0.47709712",
"0.47709712",
"0.47693714",
"0.47534612",
"0.46634176",
"0.4648932",
"0.45780656",
"0.45358157",
"0.45224652",
"0.4517956",
"0.4509969",
"0.45086175",
"0.... | 0.72070044 | 0 |
Matrixvector product for real double precision symmetricbanded matrix. References | def cublasDsbmv(handle, uplo, n, k, alpha, A, lda, x, incx, beta, y, incy):
status = _libcublas.cublasDsbmv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n, k,
ctypes.byref(ctypes.c_double(alpha)),
int(A), ld... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def double_product(x, m, y):\n return (x * np.dot(m, y.T).T).sum(1)",
"def inner_product_derivative_matrix(self, base_point=None):\n return gs.autodiff.jacobian_vec(self.metric_matrix)(base_point)",
"def matvec(self, x):\n x = np.reshape(x, [self.N]*self.L + [1])\n y = np.reshape(self.R... | [
"0.63941044",
"0.63654476",
"0.6314728",
"0.6263458",
"0.61417836",
"0.61319655",
"0.6109527",
"0.60996383",
"0.6069832",
"0.605422",
"0.60410124",
"0.60217965",
"0.60178345",
"0.60085726",
"0.60046935",
"0.5991867",
"0.59725446",
"0.59706414",
"0.5947663",
"0.5937037",
"0.59... | 0.0 | -1 |
Matrixvector product for complex single precision triangular banded matrix. References | def cublasCtbmv(handle, uplo, trans, diag, n, k, A, lda, x, incx):
status = _libcublas.cublasCtbmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
_CUBLAS_DIAG[diag],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complex_conj_multiplication(t1, t2):\n\treal1, imag1 = t1.t()\n\treal2, imag2 = t2.t()\n\timag1_conj = -1*imag1\n\treturn torch.stack([real1 * real2 - imag1_conj * imag2, real1 * imag2 + imag1_conj * real2], dim = -1)",
"def scalarMultiplication(self,c):\n matrixResult = [[complex.ComplexNumber(0,0) f... | [
"0.65264016",
"0.64512885",
"0.6329177",
"0.62659013",
"0.6260649",
"0.6230641",
"0.61821556",
"0.61606866",
"0.605771",
"0.60560584",
"0.60503554",
"0.60052836",
"0.5978095",
"0.5975138",
"0.59749395",
"0.59747756",
"0.5970377",
"0.59606475",
"0.5958867",
"0.5949834",
"0.594... | 0.5698296 | 56 |
Matrixvector product for complex double triangular banded matrix. References | def cublasZtbmv(handle, uplo, trans, diag, n, k, A, lda, x, incx):
status = _libcublas.cublasZtbmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
_CUBLAS_DIAG[diag],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matvec(self, x):\n x = np.reshape(x, [self.N]*self.L + [1])\n y = np.reshape(self.Rp, (1, self.Rp.shape[0]))\n x = np.tensordot(y, x, axes=([0], [self.L]))\n\n for j in range(self.L-1, -1, -1):\n x = np.tensordot(self.Ws[j], x, axes=([1, 2], [0, self.L]))\n\n x = n... | [
"0.625442",
"0.6214787",
"0.6187202",
"0.60709274",
"0.60534513",
"0.6045405",
"0.6035374",
"0.6034342",
"0.6032808",
"0.6026894",
"0.60200536",
"0.59804165",
"0.59639436",
"0.5953096",
"0.587776",
"0.58770245",
"0.586871",
"0.5866232",
"0.58493054",
"0.5840578",
"0.5836343",... | 0.54442334 | 76 |
This function performs the LU factorization of an array of n x n matrices. References | def cublasSgetrfBatched(handle, n, A, lda, P, info, batchSize):
status = _libcublas.cublasSgetrfBatched(handle, n,
int(A), lda, int(P),
int(info), batchSize)
cublasCheckStatus(status) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LU_factorization(A: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:\n\n assert A.shape[0] == A.shape[1] # requires square matrix\n\n n = A.shape[0]\n\n U = A.copy()\n L = np.eye(n, dtype=np.double)\n p = np.eye(n, dtype=np.double)\n\n # Loop over rows\n for i in range(n):\n\n ... | [
"0.7042069",
"0.6883848",
"0.68408316",
"0.68111515",
"0.6684758",
"0.64371485",
"0.6347903",
"0.6337908",
"0.62288886",
"0.6110575",
"0.6101528",
"0.607263",
"0.6064168",
"0.5983725",
"0.5977063",
"0.59523886",
"0.59356725",
"0.5816368",
"0.57788813",
"0.5752959",
"0.5750673... | 0.0 | -1 |
This function performs the LU factorization of an array of n x n matrices. References | def cublasDgetrfBatched(handle, n, A, lda, P, info, batchSize):
status = _libcublas.cublasDgetrfBatched(handle, n,
int(A), lda, int(P),
int(info), batchSize)
cublasCheckStatus(status) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LU_factorization(A: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:\n\n assert A.shape[0] == A.shape[1] # requires square matrix\n\n n = A.shape[0]\n\n U = A.copy()\n L = np.eye(n, dtype=np.double)\n p = np.eye(n, dtype=np.double)\n\n # Loop over rows\n for i in range(n):\n\n ... | [
"0.7042069",
"0.6883848",
"0.68408316",
"0.68111515",
"0.6684758",
"0.64371485",
"0.6347903",
"0.6337908",
"0.62288886",
"0.6110575",
"0.6101528",
"0.607263",
"0.6064168",
"0.5983725",
"0.5977063",
"0.59523886",
"0.59356725",
"0.5816368",
"0.57788813",
"0.5752959",
"0.5750673... | 0.0 | -1 |
This function performs the LU factorization of an array of n x n matrices. References | def cublasCgetrfBatched(handle, n, A, lda, P, info, batchSize):
status = _libcublas.cublasCgetrfBatched(handle, n,
int(A), lda, int(P),
int(info), batchSize)
cublasCheckStatus(status) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LU_factorization(A: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:\n\n assert A.shape[0] == A.shape[1] # requires square matrix\n\n n = A.shape[0]\n\n U = A.copy()\n L = np.eye(n, dtype=np.double)\n p = np.eye(n, dtype=np.double)\n\n # Loop over rows\n for i in range(n):\n\n ... | [
"0.7040052",
"0.68815416",
"0.6838935",
"0.6809866",
"0.6681816",
"0.6435288",
"0.6345982",
"0.63353264",
"0.62277186",
"0.6109764",
"0.6099781",
"0.60712546",
"0.606313",
"0.59824544",
"0.5975189",
"0.5951346",
"0.59356594",
"0.5814607",
"0.57755405",
"0.57515264",
"0.574904... | 0.0 | -1 |
This function performs the LU factorization of an array of n x n matrices. References | def cublasZgetrfBatched(handle, n, A, lda, P, info, batchSize):
status = _libcublas.cublasZgetrfBatched(handle, n,
int(A), lda, int(P),
int(info), batchSize)
cublasCheckStatus(status) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def LU_factorization(A: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:\n\n assert A.shape[0] == A.shape[1] # requires square matrix\n\n n = A.shape[0]\n\n U = A.copy()\n L = np.eye(n, dtype=np.double)\n p = np.eye(n, dtype=np.double)\n\n # Loop over rows\n for i in range(n):\n\n ... | [
"0.7040181",
"0.6883301",
"0.6839005",
"0.68098825",
"0.66832215",
"0.64369017",
"0.63468367",
"0.6336719",
"0.62285244",
"0.61098075",
"0.6099156",
"0.60712683",
"0.606193",
"0.59817857",
"0.59753853",
"0.5950609",
"0.59360695",
"0.5815305",
"0.577679",
"0.5752755",
"0.57496... | 0.0 | -1 |
Function to check if the dst value was below the threshold on the 5 days leading to the given datetime. threshold is 50 if nothing given. | def test_date(df,date,*threshold):
D=df.iloc[df.index.get_loc(date,method='nearest')]
date=D.name
lower_date=date-datetime.timedelta(days=5)
upper_date=date +datetime.timedelta(hours=1)
exact_value=df.loc[date].dst
values=df.loc[lower_date:upper_date].dst
minimum=values.min()
average=val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_time_judge(self, time_now, time_threshold):\r\n if time_now - self.frame_end <= time_threshold:\r\n return True\r\n else:\r\n return False",
"def test_is_closest_hour05(self):\n now = dt(2019, 1, 25, 19, 30, 0, 0, TO_ZONE)\n sunset = dt(2019, 1, 25, 19, 38... | [
"0.5753392",
"0.565246",
"0.5508194",
"0.5458844",
"0.5442393",
"0.54406303",
"0.54131776",
"0.53834045",
"0.5252206",
"0.525192",
"0.5233867",
"0.5216322",
"0.512226",
"0.5105162",
"0.50956875",
"0.50735956",
"0.5034517",
"0.5028781",
"0.5000307",
"0.49938542",
"0.49866992",... | 0.70792466 | 0 |
Given a list of all possible paths and list of elevations, return the path with the least total elevation change | def find_best_path(self, all_paths, elevations_list):
# create list of [path/elevation pairs:[coordinates[(x, y),..], elevations[<ints>,..]],..]
path_elevation_list = []
for path in all_paths:
elevations = []
for coord in path:
elevations.append(elevations... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pathfinder(start_pt):\n x = 1\n y = start_pt\n points_in_path = [(0, start_pt)]\n path_and_change = []\n total_change = 0\n current_elevation = nest[start_pt][0]\n while x < (columns - 2):\n # automatically goes straight forward if neither up-forward or down-forward has less change\... | [
"0.6668457",
"0.6626313",
"0.6475955",
"0.63614404",
"0.6242309",
"0.6092978",
"0.5949776",
"0.5948654",
"0.5719343",
"0.5654259",
"0.5641133",
"0.56143266",
"0.55498046",
"0.5533872",
"0.5515811",
"0.5494785",
"0.5477782",
"0.54674953",
"0.5464927",
"0.5414775",
"0.53967667"... | 0.86522305 | 0 |
Given a map height and 2D list of elevations, return a list of all possible paths of least resistance from west to east | def find_path_all(self, height, elevations):
optimal_path_all = []
for i in range(height):
optimal_path_all.append(self.find_path(i, elevations))
return optimal_path_all | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_best_path(self, all_paths, elevations_list):\n # create list of [path/elevation pairs:[coordinates[(x, y),..], elevations[<ints>,..]],..]\n path_elevation_list = []\n for path in all_paths:\n elevations = []\n for coord in path:\n elevations.append... | [
"0.6639006",
"0.6420694",
"0.6258827",
"0.5806868",
"0.5686912",
"0.5671301",
"0.56123877",
"0.5610354",
"0.55950934",
"0.5590082",
"0.55672544",
"0.5548158",
"0.54925364",
"0.5484643",
"0.5477103",
"0.5444826",
"0.5444733",
"0.5358106",
"0.5335992",
"0.53299993",
"0.5312667"... | 0.71101815 | 0 |
Turns self into an interpolation between mobject1 and mobject2. | def interpolate(self, mobject1, mobject2, alpha, path_func=straight_path):
self.points = path_func(mobject1.points, mobject2.points, alpha)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interpolate(self, mobject1, mobject2, alpha):\n #TODO\n Mobject.align_data(mobject1, mobject2)\n for attr in self.get_array_attrs():\n setattr(target_mobject, attr, interpolate(\n getattr(mobject1, attr), \n getattr(mobject2, attr), \n al... | [
"0.7400995",
"0.6134981",
"0.59156513",
"0.58861685",
"0.5851096",
"0.57550424",
"0.5703546",
"0.56898516",
"0.55838096",
"0.55644774",
"0.5374627",
"0.5360585",
"0.5352605",
"0.53388184",
"0.53388184",
"0.5333188",
"0.52729326",
"0.5256139",
"0.5230154",
"0.522166",
"0.52205... | 0.7065808 | 1 |
Generates a parcel ID corresponding to the current time. | def new_parcel_id():
return datetime.utcnow().strftime('%Y-%m-%dT%H%M%SZ') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gen_id() -> str:\n # id is set according to the current unix time\n return f'cli-reminder-{time.time()}'",
"def newGuid(self):\n \n timeStamp = strftime(\"%Y-%m-%d-%H:%M:%S\")\n \n if timeStamp == self.lastTimeStamp:\n serial = self.lastTimeSerial + 1\n self.lastTimeSerial = seria... | [
"0.7223101",
"0.6692619",
"0.66864914",
"0.66815716",
"0.6488588",
"0.6459685",
"0.63833463",
"0.6378378",
"0.63403434",
"0.63088226",
"0.6260615",
"0.6258069",
"0.6177063",
"0.61644554",
"0.61602014",
"0.61558115",
"0.61078435",
"0.6093227",
"0.6072271",
"0.6047825",
"0.6042... | 0.8388028 | 0 |
Returns the pathlib.Path to the stderr log, or None. The log contains the stderr of the export command that produced the parcel. | def find_stderr(self):
path = self.dataset_accessor.log_path.joinpath(f'{self.parcel_id}.err')
if path.is_file():
return path
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_agent_stderr_log() -> Path:\n return get_agent_log_dir() / \"com.alienwallpaper.alienwallpaper.err.log\"",
"def app_stderr(self):\n return os.path.join(LOGS, self.app_name, \"err.log\")",
"def get_stderr_file(self):\n return self.__err_file",
"def STDERR_filepath(self):\n retu... | [
"0.7373961",
"0.72815084",
"0.6689136",
"0.66067034",
"0.631906",
"0.62971187",
"0.62822664",
"0.62671506",
"0.62502605",
"0.62302554",
"0.61993706",
"0.61907434",
"0.6126947",
"0.60833824",
"0.59199005",
"0.5866622",
"0.5806572",
"0.5800835",
"0.5760875",
"0.56316066",
"0.56... | 0.84374636 | 0 |
Returns True if there is any record of this parcel existing. The presence of a complete or incomplete data file, log files, or an entry in metrics.csv counts. | def is_known(self):
return bool(self.find_data()
or self.find_incomplete()
or self.find_stdout()
or self.find_stderr()
or self.parcel_id in self.dataset_accessor.read_metrics()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exists(self):\n return self._len() > 0",
"def is_exist_data(self):\n is_exist = True\n for split in self.get_available_splits():\n check_file = self.get_dir(split) / EXIST_DATA\n is_exist &= check_file.is_file()\n return is_exist",
"def is_exist_data(self):... | [
"0.67366236",
"0.6575602",
"0.6575602",
"0.65708464",
"0.6539004",
"0.6518724",
"0.6433781",
"0.63772595",
"0.6375268",
"0.63656944",
"0.6350262",
"0.6328741",
"0.63153917",
"0.62888616",
"0.62850094",
"0.625875",
"0.6254288",
"0.6236296",
"0.6236296",
"0.62165904",
"0.621375... | 0.6781892 | 0 |
Repeat each element of the iterable n times. | def repeat_n(iterable, n_iter):
for i in iterable:
for _ in range(n_iter):
yield i | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def times(n, iteratee=None):\n if iteratee is None:\n iteratee = identity\n argcount = 1\n else:\n argcount = getargcount(iteratee, maxargs=1)\n\n return [callit(iteratee, index, argcount=argcount) for index in _range(n)]",
"def _Repeat(fn):\n def wrapper(*args, **kwargs):\n for... | [
"0.764082",
"0.740802",
"0.72268885",
"0.7157547",
"0.70255303",
"0.69980013",
"0.69602746",
"0.68537056",
"0.6838321",
"0.68365",
"0.67750674",
"0.67726624",
"0.6769258",
"0.6729535",
"0.6709915",
"0.670387",
"0.66769564",
"0.6676847",
"0.6671476",
"0.66159856",
"0.6581414",... | 0.8694455 | 0 |
Convert a quadratic bezier curve (with control point p1) into a cubic bezier curve. Note the start point is NOT returned. | def _quadratic_to_qubic(p0, p1, p2):
# We are at a quadratic bezier curve point. We need to convert this into a
# cubic curve for this implementation
cp1 = p0 + 2/3*(p1-p0)
cp2 = p2 - 2/3*(p2-p1)
return (cp1, cp2, p2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cubic_curve(p0, p1, p2, p3, npts=20):\n t = np.linspace(0, 1, npts)[:, np.newaxis]\n # cubic bezier curve from http://en.wikipedia.org/wiki/Bezier_curve\n b = (1-t)**3 * p0 + 3*t*(1-t)**2 * p1 + 3*t**2*(1-t) * p2 + t**3 * p3\n x, y = b.transpose()\n return x, y",
"def cubic_bezier(pts, t):\n ... | [
"0.76881236",
"0.73122835",
"0.688373",
"0.6508147",
"0.6364836",
"0.6364836",
"0.6314602",
"0.62927955",
"0.6243972",
"0.62286335",
"0.61912096",
"0.61462694",
"0.6074339",
"0.5915731",
"0.5896235",
"0.58903927",
"0.58685184",
"0.58653057",
"0.5771036",
"0.5760144",
"0.57537... | 0.77392584 | 0 |
Render some text to a block. | def render_to_block(lib, text="", name=None, height=10, layer=0):
if not isinstance(text, str):
raise TypeError("Text must be a string.")
if name is None:
block = lib.new_cell("text_block")
else:
block = lib.new_cell(name)
cpos = Vector((0, 0, 0))
for letter in text:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def highlight_block(self, text, block):\n raise NotImplementedError()",
"def text_block (self, line):\n self.IS_BLOCK = False\n return line.rstrip()",
"def TextBlock(self, *args, **kwargs):\n tb = TextBlock(*args, **kwargs)\n self.append(tb)\n return tb",
"def render... | [
"0.653922",
"0.6345728",
"0.6267",
"0.6209463",
"0.6194842",
"0.61634517",
"0.6159452",
"0.6136479",
"0.6132225",
"0.6084107",
"0.6068119",
"0.60130066",
"0.6010467",
"0.6007151",
"0.5992082",
"0.5961811",
"0.59609276",
"0.59196013",
"0.59096396",
"0.59090483",
"0.58897185",
... | 0.7182593 | 0 |
Initialize the period of BF. | def initialize_period(self, period=None):
if not period:
self.current_period = dt.datetime.now()
else:
self.current_period = period
self.current_period = dt.datetime(self.current_period.year, self.current_period.month, self.current_period.day)
self.date = self.cur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(self, bcDict):\n\n self.update(bcDict)\n\n self.Tperiod = self.Tspace + 1.0 / self.freq\n\n self.pulseTime = []\n for puls in np.arange(self.Npulse):\n self.pulseTime.append([self.Tpulse + (self.Tperiod) * puls,\n self.Tpulse +... | [
"0.62832206",
"0.62015367",
"0.61907274",
"0.6159473",
"0.6127722",
"0.6093484",
"0.60156375",
"0.60098815",
"0.5964754",
"0.5955969",
"0.5943002",
"0.5933536",
"0.5921069",
"0.58133894",
"0.57991844",
"0.57991844",
"0.5788731",
"0.5787384",
"0.5784774",
"0.5758465",
"0.57489... | 0.6480301 | 0 |
prepro 210x160x3 uint8 frame into 6400 (80x80) 1D float vector | def prepro(I):
I = I[35:195] # crop
I = I[::2,::2,0] # downsample by factor of 2
I[I == 144] = 0 # erase background (background type 1)
I[I == 109] = 0 # erase background (background type 2)
I[I != 0] = 1 # everything else (paddles, ball) just set to 1
return I.astype(np.float).ravel() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def processing_data(raw_data):\n data = np.frombuffer(raw_data, np.uint8)\n data = np.reshape(data, [data.shape[0]//1029, -1])\n data = data[:, 5:]\n data = np.reshape(data, [1, -1])\n data = 256 * data[0, 0::2] + data[0, 1::2]\n data = 10 * (data / 65535)\n data = np.reshape(data, [-1, 8]).T\... | [
"0.64404005",
"0.63954383",
"0.5984817",
"0.5970473",
"0.58001566",
"0.5770839",
"0.5739648",
"0.5688951",
"0.5685306",
"0.5682967",
"0.5679596",
"0.5663486",
"0.5641581",
"0.56320035",
"0.56229436",
"0.56085426",
"0.5594326",
"0.5570601",
"0.55430925",
"0.55269176",
"0.55258... | 0.0 | -1 |
Gets the actions of this BreRule. A list of actions to execute, and the mapping for their parameters, when the rule runs. Minimum 1 | def actions(self):
return self._actions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def actions(self) -> Optional['outputs.RuleActions']:\n return pulumi.get(self, \"actions\")",
"def actions(self) -> pulumi.Input[Sequence[pulumi.Input['ObfuscationRuleActionArgs']]]:\n return pulumi.get(self, \"actions\")",
"def actions(self) -> pulumi.Output[Sequence['outputs.ObfuscationRuleAct... | [
"0.75413924",
"0.7530907",
"0.7313533",
"0.7310513",
"0.7288054",
"0.72855365",
"0.7271427",
"0.7230885",
"0.71781206",
"0.7117435",
"0.70400614",
"0.6957138",
"0.69332665",
"0.6930719",
"0.6905879",
"0.6869602",
"0.6858656",
"0.67713934",
"0.67661124",
"0.67628866",
"0.67536... | 0.70005155 | 13 |
Sets the actions of this BreRule. A list of actions to execute, and the mapping for their parameters, when the rule runs. Minimum 1 | def actions(self, actions):
if actions is None:
raise ValueError("Invalid value for `actions`, must not be `None`")
self._actions = actions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def actions(self, actions):\n self._actions = actions",
"def actions(self, actions):\n\n self._actions = actions",
"def set_actions(self, actions):\n self.actions = list(actions)\n #for a in self.actions:\n # a.set_scope(self)\n self.name2action = None",
"def appl... | [
"0.7607714",
"0.7530357",
"0.74836206",
"0.74350184",
"0.68952304",
"0.6695765",
"0.6479618",
"0.63889587",
"0.6239441",
"0.62165034",
"0.6210418",
"0.6151138",
"0.613511",
"0.6133387",
"0.6088754",
"0.6082064",
"0.6039475",
"0.6024372",
"0.6006939",
"0.59588027",
"0.5947627"... | 0.75281155 | 2 |
Gets the description of this BreRule. The human readable description of the rule | def description(self):
return self._description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_description(self) :\n return self.__description",
"def get_description(self):\n return self._desc",
"def description(self):\n return self._get_validated().description",
"def getDescription(self):\n return self.__description",
"def getDescription(self):\n return se... | [
"0.73908406",
"0.73614556",
"0.7352229",
"0.7340411",
"0.7340411",
"0.7323046",
"0.7316291",
"0.7300597",
"0.72943735",
"0.72943735",
"0.7253933",
"0.72393936",
"0.72393936",
"0.72393936",
"0.72393936",
"0.72393936",
"0.723456",
"0.723456",
"0.7234081",
"0.7211622",
"0.721162... | 0.71921176 | 52 |
Sets the description of this BreRule. The human readable description of the rule | def description(self, description):
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\n\t\tself.descript... | [
"0.79358363",
"0.79358363",
"0.7918647",
"0.78879416",
"0.7836465",
"0.77774596",
"0.77452147",
"0.7737705",
"0.7737705",
"0.7737705",
"0.7737705",
"0.7737705",
"0.7737705",
"0.7737705",
"0.7709029",
"0.76862675",
"0.7630464",
"0.7630464",
"0.7630464",
"0.7630464",
"0.7630464... | 0.769907 | 60 |
Gets the enabled of this BreRule. Whether the rule is enabled to run (in conjunction with dates). Default true | def enabled(self):
return self._enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled(self):\n\n return self.__enabled",
"def enabled(self):\n\n return self.__enabled",
"def enabled(self):\n\n return self.__enabled",
"def enabled(self):\n\n return self.__enabled",
"def getEnabled(self):\n return self.isEnabled",
"def getEnabled(self):\r\n ... | [
"0.7408852",
"0.7408852",
"0.7408852",
"0.7408852",
"0.7371068",
"0.73448133",
"0.728184",
"0.728184",
"0.728184",
"0.728184",
"0.728184",
"0.728184",
"0.72771513",
"0.72771513",
"0.72771513",
"0.72771513",
"0.72771513",
"0.72771513",
"0.72771513",
"0.7260262",
"0.7260262",
... | 0.7368949 | 7 |
Sets the enabled of this BreRule. Whether the rule is enabled to run (in conjunction with dates). Default true | def enabled(self, enabled):
self._enabled = enabled | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_enabled(self, enable=True):\n pass",
"def set_enabled(self, enabled=True):\n validate_boolean(enabled)\n self._config['enabled'] = enabled\n return self",
"def enabled(self, enabled: bool):\n\n self._enabled = enabled",
"def enable(self, enabled):\n self.enab... | [
"0.69503236",
"0.67892987",
"0.6765495",
"0.6581365",
"0.6577311",
"0.65703773",
"0.6569757",
"0.6569757",
"0.6563941",
"0.6563941",
"0.65499485",
"0.6543783",
"0.6543783",
"0.6538837",
"0.6538837",
"0.6525766",
"0.6525096",
"0.6525096",
"0.65187657",
"0.65187657",
"0.6495024... | 0.6843582 | 4 |
Sets the end_date of this BreRule. The date the rule ceases to take effect, or null if never. Unix timestamp in seconds | def end_date(self, end_date):
self._end_date = end_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self, end_date):\n self._end_date = end_date",
"def end_date(self, value):\n self._end_date = value",
"def end_date(self, end_date: date):\n if end_date is None:\n raise ValueError(\"Invalid value for `end_date`, must not be `None`\") # noqa: E501\n\n self._... | [
"0.8136816",
"0.8068396",
"0.7992553",
"0.788734",
"0.76813966",
"0.76813966",
"0.76813966",
"0.7325671",
"0.72080314",
"0.7178838",
"0.71385",
"0.70446175",
"0.69568676",
"0.69290155",
"0.6853944",
"0.6853944",
"0.6853944",
"0.6853944",
"0.6853944",
"0.6839857",
"0.6806424",... | 0.81505114 | 7 |
Gets the evaluation_count of this BreRule. How many times the rule has been evaluated (it's conditions checked, whether it then runs or not) | def evaluation_count(self):
return self._evaluation_count | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getCount(self):\n return self.rule.count()",
"def get_fitness_evaluation_count(self):\n return self._ea.evaluation.eval_count",
"def evaluation_function(self, board):\n evalCount = 0 #Make compatible\n evalCount += self.check_three(1, board)\n evalCount -= self.check_thre... | [
"0.7371071",
"0.72787106",
"0.7006906",
"0.7002427",
"0.6686602",
"0.6605359",
"0.6596234",
"0.6590409",
"0.6550333",
"0.6455293",
"0.6398856",
"0.6335543",
"0.63281316",
"0.63139826",
"0.6295667",
"0.6284489",
"0.6284489",
"0.6284489",
"0.6284489",
"0.6284489",
"0.6284489",
... | 0.8372585 | 0 |
Sets the evaluation_count of this BreRule. How many times the rule has been evaluated (it's conditions checked, whether it then runs or not) | def evaluation_count(self, evaluation_count):
self._evaluation_count = evaluation_count | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluation_count(self):\n return self._evaluation_count",
"def _nb_evaluation_loops(self):\n return 2",
"def evaluator_count(self) -> str:\n return pulumi.get(self, \"evaluator_count\")",
"def get_fitness_evaluation_count(self):\n return self._ea.evaluation.eval_count",
"def... | [
"0.7321835",
"0.61665946",
"0.60727626",
"0.5930629",
"0.58519536",
"0.58125305",
"0.58122146",
"0.5796355",
"0.5765952",
"0.5756152",
"0.5744942",
"0.56535816",
"0.5651088",
"0.5559484",
"0.5555985",
"0.554217",
"0.55035025",
"0.5499962",
"0.54948205",
"0.54948205",
"0.54948... | 0.78051 | 0 |
Gets the id of this BreRule. The id of the rule for later references. If left null a random guid will be generated. Must be unique. Cannot be changed | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rule_id(self) -> int:\n return self._rule_id",
"def Rule_Id(self) -> int:\n return self.__rule_id",
"def rule_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"rule_id\")",
"def get_id(self):\n try:\n return self.id\n except AttributeError:\n ... | [
"0.7626988",
"0.7575197",
"0.731723",
"0.7213899",
"0.7166434",
"0.7150372",
"0.7106497",
"0.70980906",
"0.70980906",
"0.70980906",
"0.70875776",
"0.7075764",
"0.7075764",
"0.7075764",
"0.7075764",
"0.7075764",
"0.7075764",
"0.7075764",
"0.7075764",
"0.7065761",
"0.7041398",
... | 0.0 | -1 |
Sets the id of this BreRule. The id of the rule for later references. If left null a random guid will be generated. Must be unique. Cannot be changed | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self, id):\n if id is None:\n raise ValueError(\"Invalid value for `id`, must not be `None`\")\n\n self._id = id",
"def id(self, id):\n if id is None:\n raise ValueError(\"Invalid value for `id`, must not be `None`\")\n\n self._id = id",
"def id(self, id... | [
"0.7262188",
"0.7262188",
"0.7262188",
"0.70919144",
"0.7073814",
"0.7073814",
"0.7073814",
"0.7073814",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.70681506",
"0.... | 0.0 | -1 |
Sets the name of this BreRule. The human readable name of the rule | def name(self, name):
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rule_name(self, rule_name):\n\n self._rule_name = rule_name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_nam... | [
"0.76000583",
"0.7396497",
"0.7396497",
"0.7396497",
"0.7396497",
"0.7396497",
"0.7336355",
"0.7336355",
"0.7336355",
"0.7336355",
"0.7336355",
"0.7336355",
"0.73310614",
"0.7326499",
"0.729572",
"0.7285066",
"0.7258309",
"0.7236414",
"0.7181337",
"0.71787566",
"0.71264917",
... | 0.6795051 | 39 |
Sets the start_date of this BreRule. The date the rule begins to take effect, or null if always. Unix timestamp in seconds | def start_date(self, start_date):
self._start_date = start_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_date(self, start_date: date):\n if start_date is None:\n raise ValueError(\"Invalid value for `start_date`, must not be `None`\") # noqa: E501\n\n self._start_date = start_date",
"def start_date(self, start_date):\n self._start_date = start_date",
"def start_date(self... | [
"0.80540884",
"0.8034888",
"0.8009387",
"0.781647",
"0.77775717",
"0.7743242",
"0.74905086",
"0.74905086",
"0.74438804",
"0.7302551",
"0.70977026",
"0.6900143",
"0.6825303",
"0.6825303",
"0.6799532",
"0.67032903",
"0.666161",
"0.66233104",
"0.66211575",
"0.6594166",
"0.658433... | 0.8048534 | 7 |
Returns the string representation of the model | def to_str(self):
return pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def __str__(self):\n\n return str(self.model)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n return self.model",
"def serialize_model(self):\n return dill.dumps(self.model)",
"def __str_... | [
"0.8602374",
"0.85093755",
"0.8237104",
"0.8050309",
"0.80128866",
"0.79348034",
"0.78766525",
"0.77898884",
"0.7786461",
"0.7745792",
"0.7627315",
"0.76055235",
"0.757999",
"0.7514394",
"0.75038797",
"0.75035286",
"0.74850684",
"0.7440529",
"0.74325883",
"0.74239755",
"0.740... | 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 return not self == other",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other):\n return self.__dict__ != other.__dict__",
"def __eq__(self, other):\n return not self.__ne__(other)",
... | [
"0.8410411",
"0.8391477",
"0.8172175",
"0.81410587",
"0.80920255",
"0.8088807",
"0.80676955"
] | 0.0 | -1 |
Scales, crops, and normalizes a PIL image for a PyTorch model, returns an Numpy array | def process_image(image):
# Resize to 256x256
image.thumbnail((256, 256))
# Centre crop to 224x224
width, height = image.size
new_width, new_height = 224, 224
left = width // 2 - new_width // 2
upper = height // 2 - new_height // 2
right = width // 2 + new_width // 2
lower = height... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preprocess_image(image, model_image_size):\n resized_image = image.resize(model_image_size, Image.BICUBIC)\n image_data = np.asarray(resized_image).astype('float32')\n #image_data = normalize_image(image_data)\n image_data = np.expand_dims(image_data, 0)\n return image_data",
"def _process_ima... | [
"0.7204184",
"0.71030366",
"0.69037104",
"0.689708",
"0.683116",
"0.67852783",
"0.6757966",
"0.66346043",
"0.659301",
"0.65311486",
"0.6521073",
"0.64870334",
"0.64712834",
"0.64236504",
"0.64045006",
"0.6400734",
"0.63998216",
"0.6380576",
"0.6373744",
"0.6370097",
"0.632241... | 0.6869426 | 4 |
The id of the stream. | def id(self) -> uuid.UUID:
return uuid.UUID(self._internal_stream.id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream_id(self):\n # type: () -> string_types\n return self._stream_id",
"def stream_id(self):\n return self.__sid",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._py_extract_stream.id())",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._py_read_stream.id())"... | [
"0.881548",
"0.86462593",
"0.8097274",
"0.79414034",
"0.770639",
"0.7530603",
"0.73330516",
"0.7240115",
"0.7225941",
"0.7215331",
"0.7126243",
"0.7126243",
"0.7126243",
"0.7126243",
"0.7126243",
"0.7126243",
"0.7126243",
"0.7126243",
"0.7119209",
"0.71076465",
"0.7107083",
... | 0.8625321 | 2 |
The name of the stream. A string version of the stream's ID if no name was given. | def name(self) -> str:
return self._py_read_stream.name() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_stream_name(self) -> str:\n return getattr(self.stream, \"name\", \"\")",
"def get_stream_name(self) -> str:\n return self.stream.name or \"\"",
"def stream_name(self):\n return self._stream_name",
"def get_name(stream):\n try:\n return stream.name\n except Attribute... | [
"0.87955946",
"0.8752139",
"0.8493148",
"0.83304894",
"0.8191093",
"0.740221",
"0.73222435",
"0.73222435",
"0.7290423",
"0.7236052",
"0.7053822",
"0.6828747",
"0.67847884",
"0.6768247",
"0.6697476",
"0.6685996",
"0.6627253",
"0.6549303",
"0.65481406",
"0.6529218",
"0.650394",... | 0.71058166 | 10 |
The id of the ReadStream. | def id(self) -> uuid.UUID:
return uuid.UUID(self._py_read_stream.id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream_id(self):\n # type: () -> string_types\n return self._stream_id",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._internal_stream.id())",
"def stream_id(self):\n return self.__sid",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._py_extract_stream.id())... | [
"0.7572484",
"0.75306755",
"0.7436598",
"0.7424297",
"0.724789",
"0.6897887",
"0.68365735",
"0.6834267",
"0.679819",
"0.6709378",
"0.6709378",
"0.66117275",
"0.6576606",
"0.64841926",
"0.64805174",
"0.6458116",
"0.639214",
"0.63188106",
"0.63085085",
"0.6288825",
"0.62879086"... | 0.8442938 | 0 |
Whether a top watermark message has been received. | def is_closed(self) -> bool:
return self._py_read_stream.is_closed() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def message_acceptable(self):\n return False if (self.latest_message is None or (time.time() - self.latest_message_time) >= self.timeout)\\\n else True",
"def isStillRelevant(self):\n\t\tif (len(self.channels) > 0 or time()-self.lastPrivateMsg < self.PRIVATE_CONVERSATION_TIMEOUT):\n\t\t\treturn... | [
"0.6130089",
"0.60296315",
"0.602776",
"0.58692896",
"0.5813896",
"0.5782649",
"0.57789534",
"0.5764287",
"0.5759844",
"0.5741086",
"0.57385385",
"0.5661363",
"0.56479335",
"0.56265485",
"0.55858785",
"0.5581099",
"0.5578519",
"0.5569901",
"0.55506897",
"0.5547794",
"0.553685... | 0.0 | -1 |
The name of the stream. A string version of the stream's ID if no name was given. | def name(self) -> str:
return self._py_write_stream.name() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_stream_name(self) -> str:\n return getattr(self.stream, \"name\", \"\")",
"def get_stream_name(self) -> str:\n return self.stream.name or \"\"",
"def stream_name(self):\n return self._stream_name",
"def get_name(stream):\n try:\n return stream.name\n except Attribute... | [
"0.8796684",
"0.87534136",
"0.8494333",
"0.8331501",
"0.8190655",
"0.7403442",
"0.7323097",
"0.7323097",
"0.72347325",
"0.7104511",
"0.70548743",
"0.68291825",
"0.67826355",
"0.67684364",
"0.6697436",
"0.6685615",
"0.6625275",
"0.65455943",
"0.65453595",
"0.6528669",
"0.65009... | 0.7289154 | 8 |
The id of the WriteStream. | def id(self) -> uuid.UUID:
return uuid.UUID(self._py_write_stream.id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream_id(self):\n # type: () -> string_types\n return self._stream_id",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._internal_stream.id())",
"def stream_id(self):\n return self.__sid",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._py_read_stream.id())",
... | [
"0.795391",
"0.79399997",
"0.7716443",
"0.76514816",
"0.7465713",
"0.7093099",
"0.6796138",
"0.6796138",
"0.6779917",
"0.6716208",
"0.668886",
"0.66739434",
"0.6632464",
"0.66214263",
"0.65374404",
"0.65304035",
"0.6473965",
"0.64663863",
"0.6463802",
"0.6463244",
"0.6463244"... | 0.8377922 | 0 |
Whether a top watermark message has been sent. | def is_closed(self) -> bool:
return self._py_write_stream.is_closed() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_highspam(self):\n for key in list(self.tags['highspam'].keys()):\n val = self.tags['highspam'][key]\n if val:\n return True\n return False",
"def is_on_top(self):\n return self.own_order == self._top_manager_order",
"def message_acceptable(self):... | [
"0.60612994",
"0.59556633",
"0.5907544",
"0.59034485",
"0.5871583",
"0.5814034",
"0.577153",
"0.57654494",
"0.57240295",
"0.56943214",
"0.5674009",
"0.56629544",
"0.56492054",
"0.5645529",
"0.56241125",
"0.56120896",
"0.560465",
"0.5602257",
"0.559597",
"0.55927014",
"0.55607... | 0.0 | -1 |
The name of the stream. The stream ID if no name was given. | def name(self) -> str:
return self._py_extract_stream.name() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_stream_name(self) -> str:\n return self.stream.name or \"\"",
"def get_stream_name(self) -> str:\n return getattr(self.stream, \"name\", \"\")",
"def stream_name(self):\n return self._stream_name",
"def get_name(stream):\n try:\n return stream.name\n except Attribute... | [
"0.8918531",
"0.8874268",
"0.8704335",
"0.82948744",
"0.8031446",
"0.7596285",
"0.73499674",
"0.72876406",
"0.72876406",
"0.71660864",
"0.70014465",
"0.69084656",
"0.6812812",
"0.6753686",
"0.66932404",
"0.6590598",
"0.65805745",
"0.6398847",
"0.6391516",
"0.628141",
"0.62783... | 0.7049975 | 10 |
The id of the ExtractStream. | def id(self) -> uuid.UUID:
return uuid.UUID(self._py_extract_stream.id()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream_id(self):\n # type: () -> string_types\n return self._stream_id",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._internal_stream.id())",
"def stream_id(self):\n return self.__sid",
"def id(self) -> uuid.UUID:\n return uuid.UUID(self._py_read_stream.id())",
... | [
"0.7792222",
"0.7640867",
"0.749769",
"0.72875005",
"0.6937299",
"0.68454105",
"0.6698829",
"0.65858173",
"0.6543235",
"0.65346897",
"0.65321344",
"0.65107745",
"0.6501535",
"0.6497966",
"0.648407",
"0.64803344",
"0.64803344",
"0.64803344",
"0.64803344",
"0.64803344",
"0.6480... | 0.8394511 | 0 |
Render the homepage template on the / route check if home is available | def homepage():
conf = Configurations.query.first()
if conf.active:
return render_template('home/index.html', conf=conf)
return render_template('home/fuera_de_servicio.html', conf=conf) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_homepage():\n return render_template('home.html')",
"def homepage():\n return render_template('home/index.html')",
"def home():\n return render_template('homepage.html')",
"def home_page():\n return render_template('home.html')",
"def get_home():\n return render_template(\"/home.htm... | [
"0.8019264",
"0.79613096",
"0.79347205",
"0.7897502",
"0.7847751",
"0.78472215",
"0.7817106",
"0.77875024",
"0.77875024",
"0.77794385",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
"0.77751714",
... | 0.77785015 | 10 |
Render the dashboard template on the /dashboard route | def dashboard():
return render_template('home/dashboard.html', title="Dashboard") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_dashboard():\n return render_template('dashboard.html')",
"def dashboard():\n return render_template('dashboard.html', title=\"Dashboard\")",
"def dashboard(request):\n return render(request, 'dashboard/dashboard.html', {})",
"def dashboard(request):\n return render(request, \"analytic... | [
"0.8728665",
"0.85913026",
"0.8225045",
"0.7897087",
"0.78385943",
"0.77997077",
"0.77576",
"0.77198666",
"0.7714339",
"0.7672504",
"0.75783604",
"0.7496667",
"0.7327408",
"0.72439855",
"0.7238173",
"0.71459055",
"0.69971365",
"0.6956797",
"0.6933144",
"0.6818061",
"0.6767648... | 0.86026055 | 2 |
Return whether the given row should be displayed, given our current filters. | def filterAcceptsRow(self, row, parent):
if not self.__customFilterEnabled:
return super(
_JobFilterProxyModel, self).filterAcceptsRow(row, parent)
if not self.__regex:
return True
model = self.sourceModel()
idx = model.index(row, 0, parent)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filterAcceptsRow(\n self, row, parent=QModelIndex()\n ): # pylint: disable=invalid-name\n\n index = self.sourceModel().index(row, 0, parent)\n if not index.isValid():\n return False\n\n return self.index_has_person(index)\n # return self.task_matcher.match(node... | [
"0.6518681",
"0.63946766",
"0.63655233",
"0.63360524",
"0.6273318",
"0.6145247",
"0.58216226",
"0.57915425",
"0.57526815",
"0.5722292",
"0.57179266",
"0.57160455",
"0.568814",
"0.56330794",
"0.5631836",
"0.56315887",
"0.5573192",
"0.5547536",
"0.5519849",
"0.55065215",
"0.550... | 0.56021667 | 16 |
Modifies input array using specified number of left rotations. | def find_min_bribes(self, A):
if not A:
return list()
N = len(A)
Z = [self.count_bribes(*A[x])
for x
in range(0, N, 1)]
return Z | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotate_left(arr, l, r):\n temp = arr[l]\n for i in range(l, r):\n arr[i] = arr[i+1]\n arr[r] = temp",
"def rotate_left3(nums):\n pass",
"def left_rotation(nr, arr):\n part1 = arr[:nr] # list slicing from index 0 to nr - 1\n part2 = arr[nr:] # list slicing from index nr to last\n\n ... | [
"0.7215704",
"0.70711994",
"0.70400405",
"0.7013684",
"0.66446763",
"0.6439736",
"0.64244604",
"0.6402857",
"0.6391476",
"0.6387595",
"0.628988",
"0.62895733",
"0.62722224",
"0.62591106",
"0.6242384",
"0.6224396",
"0.6214534",
"0.62092155",
"0.6207346",
"0.618277",
"0.6171965... | 0.0 | -1 |
Modifies input array using specified number of left rotations. | def find_min_bribes(self, A):
if not A:
return list()
N = len(A)
Z = [self.count_bribes(*A[x])
for x
in range(0, N, 1)]
return Z | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotate_left(arr, l, r):\n temp = arr[l]\n for i in range(l, r):\n arr[i] = arr[i+1]\n arr[r] = temp",
"def rotate_left3(nums):\n pass",
"def left_rotation(nr, arr):\n part1 = arr[:nr] # list slicing from index 0 to nr - 1\n part2 = arr[nr:] # list slicing from index nr to last\n\n ... | [
"0.7216296",
"0.70701814",
"0.70395994",
"0.70136434",
"0.66443044",
"0.6439302",
"0.6423307",
"0.6401902",
"0.6390036",
"0.6387302",
"0.62891847",
"0.62891245",
"0.62714416",
"0.62601596",
"0.6242273",
"0.6223725",
"0.6215997",
"0.6210299",
"0.62069756",
"0.61821",
"0.617073... | 0.0 | -1 |
Gets a genre from the table by a given id. | def get_genre_by_id(genre_id: Union[str, uuid4]) -> Optional[dict]:
validate_params(func='get_genre_by_id', params={'genre_id': genre_id})
return data.get_genre_by_id(genre_id=genre_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_genre_by_id(genre_id):\n\n return Genre.query.filter(Genre.genre_id == genre_id).one()",
"def get(self, genre_id: int):\n return GenreService.get_movies(genre_id)",
"def tmdb_movies_genre(id, page, raw=False):\n import_tmdb()\n result = tmdb.Genres(id).movies(id=id, language=LANG, page=... | [
"0.83708066",
"0.7246679",
"0.71357894",
"0.6943075",
"0.6320119",
"0.60882807",
"0.60071194",
"0.59590304",
"0.5932928",
"0.5918556",
"0.5883065",
"0.58751756",
"0.58575124",
"0.57341695",
"0.57315266",
"0.5730908",
"0.57247216",
"0.5716817",
"0.5694232",
"0.56870514",
"0.56... | 0.7738277 | 1 |
Updates a genre by a given id. | def update_genre(
user_id: Union[str, uuid4],
name: str,
display_name: str,
genre_id: Union[str, uuid4]
) -> Optional[dict]:
validate_params(
func='update_genre',
params={'name': name, 'display_name': display_name, 'genre_id': genre_id}
)
validate_entity_is_unique(
fu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, id: int, title: str, description: str, genre: str):\n\n try:\n m = self._movie_repository[id]\n\n m_before_change = copy(m)\n m.update(\n title=title,\n genre=genre,\n description=description,\n )\n ... | [
"0.7167963",
"0.6812466",
"0.6623294",
"0.59016347",
"0.58958054",
"0.58736587",
"0.5783006",
"0.5732765",
"0.56410635",
"0.56306434",
"0.5572438",
"0.5535668",
"0.5534064",
"0.5516713",
"0.5504682",
"0.546949",
"0.5469279",
"0.5468761",
"0.54397494",
"0.538763",
"0.5335515",... | 0.7236954 | 0 |
Draw bins on the image. | def draw_sections(img, contour, bins, filter_=None):
props = ft.contour_properties([contour], 'BoundingRect')
box = props[0]['BoundingRect']
rect_x, rect_y, width, height = box
centroid = (width/2+rect_x, height/2+rect_y)
longest = max([width, height])
incr = float(longest) / bins
# Calcul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_bins(img, out, contour, bins):\n draw_sections(img, contour, bins, filter_=[2])\n cv2.imwrite(out, img)",
"def binning_pipeline(self):\n self.bin_visualize()",
"def setBins(self, bins):\n self._bins = bins\n self._counts = np.zeros_like(self._bins)\n bar_width = bins[... | [
"0.77920556",
"0.6599712",
"0.63811165",
"0.62730867",
"0.61611086",
"0.6156029",
"0.6131379",
"0.6121857",
"0.6115434",
"0.6044097",
"0.6002493",
"0.5949982",
"0.593617",
"0.5934655",
"0.5901591",
"0.5855639",
"0.5847039",
"0.58280855",
"0.58185023",
"0.5807787",
"0.58048934... | 0.5815538 | 19 |
Get a timestamped name for the new database. | def get_new_database_name():
timestamp = int(time.time())
db_name = f"inputs.{timestamp}.db"
return os.path.join(constants.DATA_PATH, db_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_name(self) -> str:\n return pulumi.get(self, \"database_name\")",
"def database_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"database_name\")",
"def db_name(self):\n return self._db_name",
"def database_name(self) -> pulumi.Output[Optional[str]]:\n re... | [
"0.75002384",
"0.7334252",
"0.72733754",
"0.71726716",
"0.7115167",
"0.6956763",
"0.6956763",
"0.6956763",
"0.6956763",
"0.6956763",
"0.69276536",
"0.68260956",
"0.68260956",
"0.68260956",
"0.6798669",
"0.67726207",
"0.6698723",
"0.6452613",
"0.641182",
"0.6378721",
"0.635232... | 0.8295392 | 0 |
get the line with the actual length | def get_calculated_line(self):
if self.line:
return self.line
# get an infinite line
diff = self.base_plane.Normal * 9999
p1 = rg.Point3d.Subtract(self.base_plane.Origin, diff)
p2 = rg.Point3d.Subtract(self.base_plane.Origin, -diff)
dowel_line = rg.Line(p1,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_length(self):\n return len(self.line)",
"def buf_line_length(self):\n return len(self.buf_line)",
"def __len__(self) -> int:\n return self.chunk.end.line_i - self.chunk.start.line_i + 1",
"def __len__(self):\n longest = 0\n for line in self.data:\n t... | [
"0.7381152",
"0.6966866",
"0.68249774",
"0.6684926",
"0.66000247",
"0.65814155",
"0.6578789",
"0.6578789",
"0.6578789",
"0.644011",
"0.6437795",
"0.6426265",
"0.6412417",
"0.6353759",
"0.634679",
"0.6341464",
"0.6336436",
"0.6305837",
"0.6278326",
"0.6248882",
"0.62237996",
... | 0.0 | -1 |
get a cylinder drilled | def get_hole_pipe(self, line = None):
return self.__get_pipe(self.hole_radius, line) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mock_2d_cylinder():\n cyl_radius = 0.1\n start = np.array([1.0, 2.0, 0.0])\n direction = np.array([0.0, 0.0, 1.0])\n normal = np.array([1.0, 0.0, 0.0])\n base_length = 1.0\n cylinder = ea.Cylinder(\n start, direction, normal, base_length, cyl_radius, density=1e3\n )\n cylinder.ve... | [
"0.66970026",
"0.6635324",
"0.66193724",
"0.64667195",
"0.64653003",
"0.6375914",
"0.63634664",
"0.6362765",
"0.63549656",
"0.6255214",
"0.61288005",
"0.60475993",
"0.6031073",
"0.59382397",
"0.5936577",
"0.58995676",
"0.58966625",
"0.5863015",
"0.579994",
"0.5776153",
"0.571... | 0.0 | -1 |
Generates the training input in an s3 location and returns the s3 uri. | def training_input(self):
label_attribute_name = self.event['LabelAttributeName']
s3_input_uri = self.event['ManifestS3Uri']
meta_data = self.event['meta_data']
source = S3Ref.from_uri(s3_input_uri)
dest = S3Ref.from_uri(self.training_folder_uri + "training_input.manifest")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def s3_upload_base():\n return \"https://testing.s3.amazonaws.com/course-1/\"",
"def s3_uri(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"s3_uri\")",
"def s3_uri(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"s3_uri\")",
"def s3_uri(self) -> pulumi.Input[str]:\n ret... | [
"0.70141613",
"0.6609991",
"0.6609991",
"0.6609991",
"0.6609991",
"0.6609991",
"0.6609991",
"0.6504403",
"0.6379291",
"0.6345393",
"0.6337538",
"0.63187605",
"0.630588",
"0.62415165",
"0.61117595",
"0.6110196",
"0.5910728",
"0.5900828",
"0.59003526",
"0.58938164",
"0.5861032"... | 0.6790783 | 1 |
configure hyper parameters used for training. | def hyper_parameters(self, event):
return {
"base_network": "vgg-16",
"early_stopping": "false",
"early_stopping_min_epochs": "10",
"early_stopping_patience": "5",
"early_stopping_tolerance": "0.0",
"epochs": "40",
"freeze_layer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_hyper_parameters(self):\n pass",
"def set_hyperparams(self):\n # Instantiate hyper parameters for MSN algorithm\n self.alpha = self.hyper_params[\"alpha\"]\n self.beta = self.hyper_params[\"beta\"]\n self.def_integrity = self.hyper_params[\"default integrity\"]\n ... | [
"0.8027084",
"0.7336348",
"0.6964374",
"0.69524056",
"0.68404067",
"0.6639403",
"0.66167295",
"0.6574711",
"0.6516228",
"0.6490041",
"0.64890444",
"0.64805526",
"0.6480234",
"0.64580876",
"0.6435437",
"0.6432564",
"0.64037716",
"0.63990337",
"0.6386174",
"0.6361063",
"0.63577... | 0.6409243 | 16 |
return True if double equals dodge. | def double(self) -> bool:
self.multiplier *= 2
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def est_double(self):\n if self.get_val_droite()==self.get_val_gauche():\n return True\n else:\n return False",
"def rechercher_le_domino_double(main):\n for m in main:\n if m.est_double():\n return True\n return False",
"def isDouble(self):\n ... | [
"0.76458156",
"0.68786436",
"0.6651084",
"0.6343241",
"0.6339965",
"0.62845904",
"0.6283011",
"0.62632",
"0.6157641",
"0.6104405",
"0.59747213",
"0.5947358",
"0.59066623",
"0.59060276",
"0.5848963",
"0.58001435",
"0.57783",
"0.5757421",
"0.57564735",
"0.5702927",
"0.56651026"... | 0.5957396 | 11 |
Add sensors for passed config_entry in HA. | async def async_setup_entry(hass, config_entry, async_add_devices):
hass_data = hass.data[DOMAIN][config_entry.entry_id]
collector = hass_data[COLLECTOR]
forecast_region = collector.daily_forecasts_data["metadata"]["forecast_region"]
new_devices = []
if config_entry.data[CONF_OBSERVATIONS_CREATE] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def async_setup_entry(\n hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities\n):\n coordinator = hass.data[DOMAIN][config_entry.entry_id][DATA_COORDINATOR]\n user_id = config_entry.data[CONF_ID]\n\n async_add_entities(\n HuisbaasjeSensor(coordinator, user_id=user_id, **senso... | [
"0.6570586",
"0.65439224",
"0.62263507",
"0.62123686",
"0.6157461",
"0.6145561",
"0.6145274",
"0.61379266",
"0.61339194",
"0.61142373",
"0.6097723",
"0.6019288",
"0.6006434",
"0.5999261",
"0.59785485",
"0.59625006",
"0.59427035",
"0.5935046",
"0.59254074",
"0.5915147",
"0.586... | 0.56843174 | 39 |
Return the name of the sensor. | def device_class(self):
return SENSOR_NAMES[self.sensor_name][1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.sensor.name",
"def name(self):\n return self.sensor.name",
"def name(self) -> str:\n return self._sensor.name",
"def sensor_name(self):\n return self._sensor_name",
"def name(self):\n return SENSOR_NAME",
"def name(self):\n return '{... | [
"0.9172938",
"0.9172938",
"0.9119264",
"0.90965885",
"0.8981336",
"0.85841",
"0.8511273",
"0.8511273",
"0.82223254",
"0.81386924",
"0.809015",
"0.79436237",
"0.77122",
"0.7700968",
"0.7556649",
"0.7541934",
"0.7540329",
"0.7538318",
"0.75381917",
"0.7537575",
"0.74322224",
... | 0.0 | -1 |
Return the unit of measurement. | def unit_of_measurement(self):
return SENSOR_NAMES[self.sensor_name][0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unit_of_measurement(self):\n return self._def[ATTR_UNIT]",
"def unit_of_measurement(self):\n\t\treturn self._unit_of_measurement",
"def unit_of_measurement(self):\n return self._unit",
"def unit_of_measurement(self):\n return self._unit",
"def unit_of_measurement(self):\n re... | [
"0.9143818",
"0.9064786",
"0.9044233",
"0.9044233",
"0.9044233",
"0.8998565",
"0.8998565",
"0.8944517",
"0.8927589",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"0.8920099",
"... | 0.86308604 | 30 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.