query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Delete branches supplied on stdin. | def delete_branches(config, args):
for ref_name in lib.input_json_lines():
yield _delete_ref(config.repo, "heads/" + ref_name, args.force, args.dry_run) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __gitDeleteBranch(self):\n self.vcs.gitDeleteRemoteBranch(self.project.getProjectPath())",
"def delete_refs(config, args):\n for ref_name in lib.input_json_lines():\n yield _delete_ref(config.repo, ref_name, args.force, args.dry_run)",
"def execute(self: \"DeleteBranchOperator\", context: Dict[s... | [
"0.61387366",
"0.60993207",
"0.59554577",
"0.58781725",
"0.5740194",
"0.56796825",
"0.55576724",
"0.55374086",
"0.5471887",
"0.54350317",
"0.5410764",
"0.53992355",
"0.53512764",
"0.53059715",
"0.5246752",
"0.5204136",
"0.5189877",
"0.5152233",
"0.5135789",
"0.51050425",
"0.5... | 0.7770485 | 0 |
Show refs supplied on stdin. | def show_refs(config, args):
for item in lib.input_json_lines():
yield config.repo.ref(item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showref_output(self, *arguments, **kwargs):\n return self.get_output('show-ref', *arguments, **kwargs)",
"def list_refs(self):\n print('----\\nREFs\\n----')\n self._print_dict(self.refs)",
"def git_show(ref, filepath, **kw):\n if ref == DIRTY and filepath == 'qwerty.sh':\n re... | [
"0.6069994",
"0.58886915",
"0.5854453",
"0.57832485",
"0.5756653",
"0.5522537",
"0.53357995",
"0.5333801",
"0.53120446",
"0.5288381",
"0.52743095",
"0.50970685",
"0.5025513",
"0.5002853",
"0.49698687",
"0.49371204",
"0.49023476",
"0.49012762",
"0.4880411",
"0.48688146",
"0.48... | 0.70137686 | 0 |
Delete refs supplied on stdin. | def delete_refs(config, args):
for ref_name in lib.input_json_lines():
yield _delete_ref(config.repo, ref_name, args.force, args.dry_run) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy_input_stream(self):\n\n # Destroy the stream\n del self.inp\n\n # Garbage collect\n gc.collect()",
"def delete_branches(config, args):\n for ref_name in lib.input_json_lines():\n yield _delete_ref(config.repo, \"heads/\" + ref_name, args.force, args.dry_run)",
"def _... | [
"0.5871312",
"0.581325",
"0.580885",
"0.57998633",
"0.55749464",
"0.5556714",
"0.5533691",
"0.5417685",
"0.53445256",
"0.5335153",
"0.5274625",
"0.52526426",
"0.52349037",
"0.51906604",
"0.51687133",
"0.51614654",
"0.50775385",
"0.49584493",
"0.4955315",
"0.4947907",
"0.49212... | 0.7142282 | 0 |
Create a new release. | def create_release(config, args):
yield config.repo.create_release(args.tag_name, name=args.name,
target_commitish=args.get("target_commitish"), body=args.get("body"),
draft=args.get_bool("draft"), prerelease=args.get_bool("prerelease")) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_release(self):\n releases_before = self.hello_world_project.get_releases()\n latest_release = releases_before[0].tag_name\n count_before = len(releases_before)\n increased_release = \".\".join(\n [\n latest_release.rsplit(\".\", 1)[0],\n ... | [
"0.7423972",
"0.7373603",
"0.72825485",
"0.72434056",
"0.72312766",
"0.7177242",
"0.71613526",
"0.6713619",
"0.6458457",
"0.64256483",
"0.6405593",
"0.6399093",
"0.6364009",
"0.63438845",
"0.6276976",
"0.62543344",
"0.62176687",
"0.6215485",
"0.61449975",
"0.61290306",
"0.612... | 0.779653 | 0 |
Find line markers in program source. Returns a dict mapping line numbers to the marker on that line. | def find_line_markers(source):
markers = {}
for lineno, line in enumerate(source.splitlines(), start=1):
m = re.search(r"#=(\w+)", line)
if m:
markers[lineno] = m.group(1)
return markers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def findlinestarts(code):\n byte_increments = [ord(c) for c in code.co_lnotab[0::2]]\n line_increments = [ord(c) for c in code.co_lnotab[1::2]]\n result = []\n lastlineno = None\n lineno = code.co_firstlineno\n addr = 0\n for byte_incr, line_incr in zip(byte_increments, line_increments):\n ... | [
"0.671828",
"0.65628844",
"0.6341732",
"0.62313646",
"0.6213287",
"0.6083448",
"0.5988346",
"0.5829362",
"0.5775442",
"0.5735581",
"0.5691603",
"0.5682639",
"0.5677322",
"0.56666535",
"0.56589866",
"0.5646514",
"0.56042045",
"0.55774814",
"0.55683094",
"0.5517282",
"0.5501614... | 0.81433094 | 0 |
Run pylint on some source, collecting specific messages. `source` is the literal text of the program to check. It is dedented and written to a temp file for pylint to read. `msg_ids` is a commaseparated string of msgids we are interested in. Use "all" to enable all messages. Returns a set of messages. Each message is a... | def run_pylint(source, msg_ids):
with open("source.py", "w") as f:
f.write(textwrap.dedent(source))
reporter = SimpleReporter()
pylint_args = ["source.py", "--disable=all", "--enable={}".format(msg_ids)]
if pylint_numversion >= (2, 0):
kwargs = dict(do_exit=False)
else:
kwa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pylint(context):\n exec_cmd = 'find . -name \"*.py\" | xargs pylint'\n run_cmd(context, exec_cmd)",
"def get_rustc_messages(self):\n method = util.get_setting('rust_syntax_checking_method', 'check')\n settings = cargo_settings.CargoSettings(self.window)\n settings.load()\n c... | [
"0.5309896",
"0.51698196",
"0.50654256",
"0.50382936",
"0.502334",
"0.50012463",
"0.4978655",
"0.4832796",
"0.48249653",
"0.481423",
"0.47968087",
"0.47830123",
"0.47799236",
"0.47793913",
"0.47504056",
"0.4728472",
"0.47199067",
"0.46844485",
"0.46621025",
"0.46308056",
"0.4... | 0.84657466 | 0 |
Returns list of sensor values received since last decide() call sensor_id Optional sensor ID to filter on | def get_sensor_changes(self, sensor_id=None):
if sensor_id:
changes = self.sensor_changes.get(sensor_id)
if changes is None:
return []
return changes
return list(itertools.chain(*self.sensor_changes.itervalues())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_sensor_data(self):\n sensor_config = self.load_sensor_config()\n now_utc = datetime.utcnow()\n now = datetime.now()\n sensor_data = []\n for sensor, address in sensor_config.items():\n sensor_data.append(self.fetch_data(sensor, address, now_utc, now))\n ... | [
"0.6238891",
"0.6116132",
"0.6081854",
"0.6074288",
"0.6014159",
"0.59781206",
"0.5923391",
"0.59211385",
"0.58941704",
"0.587527",
"0.5831265",
"0.5790514",
"0.57752657",
"0.57651967",
"0.57151985",
"0.57027024",
"0.569523",
"0.5677747",
"0.5670406",
"0.56520855",
"0.5642321... | 0.6840238 | 0 |
Queries datastore for historical values of the specified sensor | def get_sensor_history(self, sensor_id, count=None, reverse=True):
raise NotImplemented("History unavailable") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sensor_history(self, sensor_name, start_time_sec, end_time_sec,\n include_value_ts=False, timeout_sec=0):\n\n if timeout_sec != 0:\n self._logger.warn(\n \"timeout_sec is no longer supported. Default tornado timeout is used\")\n\n params = {\n ... | [
"0.65677303",
"0.6302074",
"0.62936205",
"0.6027881",
"0.6020226",
"0.5967648",
"0.59240884",
"0.58668435",
"0.5859429",
"0.5792487",
"0.5791194",
"0.57694453",
"0.5730802",
"0.5720652",
"0.5709348",
"0.5704362",
"0.57018715",
"0.5627425",
"0.5591444",
"0.55871904",
"0.558089... | 0.63620734 | 1 |
Returns a list of instances in the specified state or state range state instance state to search for, or inclusive lower bound in range maxstate Optional inclusive upper bound of range search | def get_instances_by_state(self, state, maxstate=None):
if maxstate:
f = lambda i: i.state >= state and i.state <= maxstate
else:
f = lambda i: i.state == state
return [instance for instance in self.instances.itervalues()
if f(instance)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_state(self, state):\n state = state.strip().upper()\n cursor = self.households.find({\"address.state\":state})\n results = [Household.from_dict(dct) for dct in cursor]\n\n cursor = self.businesses.find({\"address.state\":state})\n results += [Business.from_dict(dct) for ... | [
"0.6024103",
"0.5945652",
"0.55922294",
"0.54625094",
"0.5405578",
"0.53978765",
"0.5371019",
"0.53080386",
"0.5269141",
"0.5192961",
"0.51860654",
"0.5179325",
"0.5164822",
"0.5131112",
"0.5073371",
"0.5061068",
"0.50448173",
"0.50413084",
"0.5032053",
"0.50298136",
"0.50287... | 0.75924146 | 0 |
Returns instances in a healthy state (OK, UNKNOWN, OUT_OF_CONTACT) | def get_healthy_instances(self):
return [instance for instance in self.instances.itervalues()
if instance.health in _HEALTHY_STATES and
instance.state < InstanceState.RUNNING_FAILED] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def describe_instances():\n # Instantiate the service resource object\n ec2_resource = session.resource('ec2', region_name=region)\n # Describe instances\n instances = ec2_resource.instances.all()\n for instance in instances:\n print('State of the instance \"' + instance.id + '\" is: \"' + in... | [
"0.6556457",
"0.64886075",
"0.64523256",
"0.63970065",
"0.6392996",
"0.63546014",
"0.6342714",
"0.63227624",
"0.6285217",
"0.62758344",
"0.6262659",
"0.62591743",
"0.61802375",
"0.61781436",
"0.61593646",
"0.61468923",
"0.6131968",
"0.6119431",
"0.61183673",
"0.6114415",
"0.6... | 0.73135567 | 0 |
Returns instances that are in the process of starting. REQUESTED <= state < RUNNING | def get_pending_instances(self):
return [instance for instance in self.instances.itervalues()
if InstanceState.REQUESTED <= instance.state < InstanceState.RUNNING] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getAllRunningInstances(self):\n return self._ec2.get_only_instances(filters={\n 'tag:leader_instance_id': self._instanceId,\n 'instance-state-name': 'running'})",
"def Get_Running_Instances():\n ec2 = boto3.resource('ec2') \n #call the features resource from the boto3 libr... | [
"0.72593683",
"0.69920015",
"0.6668451",
"0.65543133",
"0.6435387",
"0.64129454",
"0.63787186",
"0.6293619",
"0.62505805",
"0.6186412",
"0.61818695",
"0.6128028",
"0.61152625",
"0.6090981",
"0.6063504",
"0.6050054",
"0.6042504",
"0.6016165",
"0.6006805",
"0.60061955",
"0.6004... | 0.75103045 | 0 |
Returns instances in an unhealthy state (MISSING, ERROR, ZOMBIE, etc) Most likely the DE will want to terminate these and replace them Includes RUNNING_FAILED (contextualization issue) | def get_unhealthy_instances(self):
unhealthy = []
for instance in self.instances.itervalues():
if instance.state == InstanceState.RUNNING_FAILED:
unhealthy.append(instance)
continue # health report from epuagent (or absence of it) is irrelevant
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_healthy_instances(self):\n return [instance for instance in self.instances.itervalues()\n if instance.health in _HEALTHY_STATES and\n instance.state < InstanceState.RUNNING_FAILED]",
"def undead(self):\n cutoff = datetime.utcnow() - timedelta(seconds=HEA... | [
"0.73643726",
"0.67218757",
"0.64804536",
"0.64485145",
"0.62129426",
"0.6096679",
"0.59493345",
"0.58879226",
"0.5860744",
"0.5794768",
"0.5759598",
"0.5749272",
"0.573518",
"0.5708589",
"0.5697575",
"0.5680338",
"0.5633349",
"0.56002504",
"0.55971736",
"0.559316",
"0.558894... | 0.77075857 | 0 |
Notify all domain subscribers of this state change. | def notify_subscribers(self, instance, domain, state=None):
if not self.notifier:
return
if not state:
state = instance.state
tups = domain.get_subscribers()
for subscriber_name, subscriber_op in tups:
properties = {'hostname': instance.public_ip}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notify(self) -> None:\n logging.info(\"Subject: Notifying observers...\")\n for observer in self._observers:\n observer.update(self.current)",
"def _notify_observers(self):\n for observer in self.observers:\n observer.notify(self.game_state)",
"def _no... | [
"0.7030976",
"0.69969666",
"0.698127",
"0.69568694",
"0.6511763",
"0.64997935",
"0.64468664",
"0.638276",
"0.638276",
"0.63703555",
"0.63461006",
"0.63451016",
"0.6256031",
"0.6248979",
"0.62387997",
"0.620963",
"0.6196381",
"0.6106248",
"0.601511",
"0.59821796",
"0.59434026"... | 0.735021 | 0 |
Function that recalculate karma points for individual content type. it works directly in the databse using an UPDATE statement utilizing JOINs, PostgreSQL is required for this to work. | def update_karma_for_ct(content_type, owner_field, weight):
if not profile_model:
raise SiteProfileNotAvailable
try:
karma_coeficient = '%s.%s' % (
connection.ops.quote_name(profile_model._meta.db_table),
connection.ops.quote_name(profile_model._meta.get_f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recalculate_karma():\n if not profile_model:\n raise SiteProfileNotAvailable\n\n sql = '''\n UPDATE\n %s\n SET\n karma = %%s\n ''' % connection.ops.quote_name(profile_model._meta.db_table)\n cursor = connection.cursor()\n cursor.execute(sql, (INITIAL_U... | [
"0.66400015",
"0.5130959",
"0.5087561",
"0.5048017",
"0.500309",
"0.48686683",
"0.48536086",
"0.48391438",
"0.4786448",
"0.46118438",
"0.46097592",
"0.45836604",
"0.45624858",
"0.45217162",
"0.4507511",
"0.4470688",
"0.44666278",
"0.44555342",
"0.4446042",
"0.44368362",
"0.44... | 0.66255236 | 1 |
Add an item or list to store safely with mutex | def add(self, item):
with self.lock:
if isinstance(item, list):
self.items.join(item)
else:
self.items.append(item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put(self, item: Any):\n has_item = True\n with self._lock:\n if item not in self._items:\n self._items.add(item)\n has_item = False\n if not has_item:\n self._queue.put(item)",
"def add(self, item):",
"def enqueue(self, item):\n ... | [
"0.67681974",
"0.6577204",
"0.6570164",
"0.6446203",
"0.6424252",
"0.64236844",
"0.63525456",
"0.6339003",
"0.63213605",
"0.632096",
"0.6319763",
"0.62928957",
"0.6270325",
"0.62412995",
"0.62412995",
"0.62412995",
"0.6203387",
"0.61608213",
"0.6160414",
"0.61522233",
"0.6135... | 0.7073261 | 0 |
Get all items from store with thread safety and empties the store. | def get_all(self,empty=True):
with self.lock:
items = self.items
if empty: self.items = []
return items | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_all_clear(redis):\n store.store(1, 'some', data={'foo': 'bar'})\n store.store(1, 'other', triggering=True)\n store.store(2, 'irrelevant')\n\n res = list(store.get_all(1, clear=True))\n\n assert res == [\n {'name': 'some', 'triggering': '0', 'foo': 'bar'},\n {'name': 'other... | [
"0.6408989",
"0.6399276",
"0.6186034",
"0.6108333",
"0.6101899",
"0.6005134",
"0.59532785",
"0.5948577",
"0.59223735",
"0.58803606",
"0.58488554",
"0.5835522",
"0.58355045",
"0.5834219",
"0.5832918",
"0.5827161",
"0.58130026",
"0.5805279",
"0.580306",
"0.5787802",
"0.57837355... | 0.70360076 | 0 |
Returns a UnrealImporter instance using the appropriate Strategies | def init_from_entity(self, entity):
if entity.type.lower() == '1_static_mesh':
return UnrealImporter(entity, StaticImportTaskStrategy(),
AssetExecuteTaskStrategy())
elif entity.type.lower() == '2_skeletal_mesh':
return UnrealImporter(ent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __new__(cls, *args, **kwargs):\r\n if DelImporter.can_handle(args[0]):\r\n return super(Importer, cls).__new__(DelImporter)\r\n\r\n if DelXMLImporter.can_handle(args[0]):\r\n return super(Importer, cls).__new__(DelXMLImporter)\r\n\r\n if GBookmarkImporter.can_handle(a... | [
"0.6069356",
"0.5435047",
"0.53143805",
"0.52639925",
"0.5215567",
"0.5118512",
"0.50582254",
"0.5034063",
"0.50104547",
"0.4967427",
"0.49043578",
"0.4898647",
"0.48911652",
"0.4878864",
"0.48700842",
"0.48466647",
"0.48265946",
"0.48153287",
"0.4800854",
"0.4784707",
"0.478... | 0.65619564 | 0 |
Return a tuple of 2 items The first is the info of a account The second is bool indicates whether is the last nav page | def get_new_account_info_by_single_nav_page(page_num, keyword):
single_nav_info_list = []
# get the url by keywords
tmp_nav_url = get_nav_page_url_by_keywords(keyword)
nav_url = tmp_nav_url[0] + str(page_num) + tmp_nav_url[1]
print "nav_url -> ", nav_url
# connect to the website, and build s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_account_details(self):\n pass",
"def get_accounts():\n graph = facebook.GraphAPI(mytoken)\n pages = graph.get_object('me/accounts')\n pages_info=[]\n for page in pages['data']:\n pages_info.append( ( page['name'], page['access_token'] ) )\n return pages_info",
"def acco... | [
"0.6044466",
"0.5976087",
"0.5829266",
"0.57464015",
"0.5659412",
"0.56424266",
"0.56343204",
"0.56076646",
"0.5514889",
"0.5471036",
"0.54441804",
"0.5424243",
"0.54173374",
"0.54144704",
"0.53638095",
"0.530754",
"0.53059715",
"0.5296732",
"0.52962375",
"0.5289025",
"0.5258... | 0.6127092 | 0 |
Output new account info to local file | def output_new_account_to_local_file(new_account_info_list):
# get header, new account has no account_id and is_existed
header_list = get_header_list_for_new_account()
header_str = '\t'.join(header_list) + '\n'
# create new path and file to store the info
time_str = time.strftime('%Y%m%d')
pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_account_info(username: str,\n password: str\n ) -> None:\n\n with open(\"Logs/user_registry.log\", \"a\") as file:\n file.writelines(\n f\"Registered: {datetime.now()} | Username: {username} | Password: {password}\\n\"\n ... | [
"0.6695288",
"0.64806676",
"0.6382078",
"0.6199208",
"0.6061284",
"0.5941088",
"0.59329987",
"0.585552",
"0.5842724",
"0.58198285",
"0.58110714",
"0.5799273",
"0.5742463",
"0.5732201",
"0.5729018",
"0.57123405",
"0.5709112",
"0.5701413",
"0.5686208",
"0.5677078",
"0.56493515"... | 0.7422325 | 0 |
Get new weixin account from weixin.sogou.com by keywords Return a list of list of dict, which contains all the weixin_info | def get_new_account_info_by_keywords(keywords):
write_keywords_to_redis_set(keywords) # keywords_set
get_new_account_info_by_keywords_from_redis() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_header_list_for_new_account():\n\n return [\"weibo_name\", \"weibo_id\", \"home_page_url\", \"QR_code_url\",\n \"sogou_openid\", \"tou_xiang_url\", \"function_description\",\n \"is_verified\", \"verified_info\", \"keywords\"]",
"def get_vlc_users(wifi_list):\n vlc_users = [use... | [
"0.54590136",
"0.5224825",
"0.5160665",
"0.5070077",
"0.5063018",
"0.50391585",
"0.50264674",
"0.5016061",
"0.5009945",
"0.50095624",
"0.5004289",
"0.4984262",
"0.4980616",
"0.4963042",
"0.48956427",
"0.4887877",
"0.48867843",
"0.4866806",
"0.4860498",
"0.48523894",
"0.482944... | 0.6365979 | 0 |
Detects the iris and estimates the position of the iris by calculating the centroid. | def detect_iris(self, eye_frame):
self.iris_frame = self.image_processing(eye_frame, self.threshold)
contours, _ = cv2.findContours(self.iris_frame, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)[-2:]
contours = sorted(contours, key=cv2.contourArea)
try:
moments = cv2.moments(contour... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_centroid_for_each(self):",
"def calculateCentroid(self,image):\n\t\tim=cv2.imread(image,0) #reads it in greyscale\n\t\tret,thresh = cv2.threshold(img_copy,128,255,cv2.THRESH_OTSU)\n\t\tim2,contours,hierarchy = cv2.findContours(thresh, 1, 2)\n\t\tcnt = contours[0]\n\t\tM = cv2.moments(cnt)\n\t\tcx = int(... | [
"0.70674765",
"0.6779918",
"0.67179096",
"0.6653473",
"0.6641467",
"0.6560761",
"0.65302736",
"0.6523772",
"0.64802766",
"0.6386364",
"0.63286793",
"0.63093835",
"0.6247324",
"0.61976635",
"0.619526",
"0.61793876",
"0.6141683",
"0.6137925",
"0.61369115",
"0.61335605",
"0.6118... | 0.6841621 | 1 |
Calculates the optimal threshold to binarize the frame for the given eye. | def find_best_threshold(eye_frame):
average_iris_size = 0.48
trials = {}
for threshold in range(5, 100, 5):
iris_frame = Pupil.image_processing(eye_frame, threshold)
trials[threshold] = Calibration.iris_size(iris_frame)
best_threshold, iris_size = min(trials.ite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_best_threshold(self, frame: np.ndarray, save_debug_thresh_images: bool) -> Tuple[float_, Ndarray_]:\n # 1) click_xy --> click_roi (click_xy.center; size = n * MAX_BALL_SIZE -->\n self.click_roi = ROI(frame.shape, self.click_xy, self.CLICK_ZONE_SIZE)\n self.click_roi_img = self.c... | [
"0.6287282",
"0.6029786",
"0.5872237",
"0.5847439",
"0.57529837",
"0.5731695",
"0.5728439",
"0.56930214",
"0.5664887",
"0.56493634",
"0.5596113",
"0.55273634",
"0.5482887",
"0.54828566",
"0.54772717",
"0.54740804",
"0.5439138",
"0.5437861",
"0.54123086",
"0.5371561",
"0.53687... | 0.7246647 | 0 |
Returns the middle point (x,y) between two points | def _middle_point(p1, p2):
x = int((p1.x + p2.x) / 2)
y = int((p1.y + p2.y) / 2)
return (x, y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def midpoint(point1, point2):\n\n x, y = (int((point1[0] + point2[0]) / 2), int((point1[1] + point2[1]) / 2))\n return (x, y)",
"def mid_point(a: Point, b: Point) -> Point:\n return Point((a.x + b.x) / 2, (a.y + b.y) / 2)",
"def _mid(pt1, pt2):\n (x0, y0), (x1, y1) = pt1, pt2\n return 0.5 * (x0 ... | [
"0.8332387",
"0.832619",
"0.80376065",
"0.7855965",
"0.77383506",
"0.7694335",
"0.761417",
"0.7549157",
"0.73095095",
"0.7287564",
"0.7153021",
"0.71367353",
"0.7130825",
"0.71296805",
"0.70716804",
"0.6961621",
"0.68734384",
"0.67816556",
"0.67264247",
"0.6706939",
"0.670399... | 0.88593143 | 0 |
Isolate an eye, to have a frame without other part of the face. | def _isolate(self, frame, landmarks, points):
region = np.array([(landmarks.part(point).x, landmarks.part(point).y) for point in points])
region = region.astype(np.int32)
# Applying a mask to get only the eye
height, width = frame.shape[:2]
black_frame = np.zeros((height, width),... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _analyze(self, face, frame):\n try:\n landmarks = self._predictor(frame, face)\n self.eye_left = Eye(frame, landmarks, 0, self.calibration)\n self.eye_right = Eye(frame, landmarks, 1, self.calibration)\n\n except IndexError:\n self.eye_left = None\n ... | [
"0.67377675",
"0.64353824",
"0.6426797",
"0.6234659",
"0.61444426",
"0.6138402",
"0.6136822",
"0.6114689",
"0.58783746",
"0.5838993",
"0.58092284",
"0.58052915",
"0.5803719",
"0.57668346",
"0.57199407",
"0.57189333",
"0.5661947",
"0.5659864",
"0.5619834",
"0.5476179",
"0.5408... | 0.7455306 | 0 |
Detects the face and initialize Eye objects | def _analyze(self):
frame = cv2.cvtColor(self.frame, cv2.COLOR_BGR2GRAY)
faces = self._face_detector(frame)
try:
landmarks = self._predictor(frame, faces[0])
self.eye_left = Eye(frame, landmarks, 0, self.calibration)
self.eye_right = Eye(frame, landmarks, 1, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _analyze(self, face, frame):\n try:\n landmarks = self._predictor(frame, face)\n self.eye_left = Eye(frame, landmarks, 0, self.calibration)\n self.eye_right = Eye(frame, landmarks, 1, self.calibration)\n\n except IndexError:\n self.eye_left = None\n ... | [
"0.7560391",
"0.68010324",
"0.6635947",
"0.6486135",
"0.62774986",
"0.62622213",
"0.61654824",
"0.61585534",
"0.6115075",
"0.60539085",
"0.6034757",
"0.5828532",
"0.58276755",
"0.58090127",
"0.5790348",
"0.57447714",
"0.57261175",
"0.5702105",
"0.5702105",
"0.5695249",
"0.568... | 0.73852646 | 1 |
Refreshes the frame and analyzes it. | def refresh(self, frame):
self.frame = frame
self._analyze() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh(self, face, frame):\n self.frame = frame\n self._analyze(face, frame)",
"def refresh(self):\n self.reset()\n self.parse(self.source)\n return self.output()",
"def refresh(self):\n raise UncodedError",
"def refresh(self):\n self.__refresh()",
"def... | [
"0.7527248",
"0.6117611",
"0.6037707",
"0.60271585",
"0.5917527",
"0.5917527",
"0.5917527",
"0.5894402",
"0.58879447",
"0.58879447",
"0.587567",
"0.57141167",
"0.5699418",
"0.5699418",
"0.5646353",
"0.5642524",
"0.5642524",
"0.5635831",
"0.563553",
"0.56285274",
"0.5596776",
... | 0.8174805 | 0 |
Get value from default/user package configuration settings. | def get_package_value(key, default_value=None):
try:
config = sublime.load_settings(S.FILE_PACKAGE_SETTINGS)
if config and config.has(key):
return config.get(key)
except RuntimeError:
sublime.set_timeout(lambda: load_package_values(), 0)
if S.CONFIG_PACKAGE:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(key, default_value=None):\r\n # Get value from project configuration\r\n value = get_project_value(key)\r\n # Use package configuration when value has not been found\r\n if value is None:\r\n value = get_package_value(key)\r\n # Return package/project value\r\n if value is no... | [
"0.71989745",
"0.7113931",
"0.7026636",
"0.6831768",
"0.68213725",
"0.6797336",
"0.67946523",
"0.6753318",
"0.6746971",
"0.6725576",
"0.6695343",
"0.6694983",
"0.66856986",
"0.6609533",
"0.65969265",
"0.65899867",
"0.65829045",
"0.65431464",
"0.65360355",
"0.6515875",
"0.6461... | 0.80719346 | 0 |
Get value from project configuration settings. | def get_project_value(key, default_value=None):
# Load project coniguration settings
try:
load_project_values()
except RuntimeError:
sublime.set_timeout(lambda: load_project_values(), 0)
# Find value in project configuration
if S.CONFIG_PROJECT:
if key in S.CONFIG_P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_setting_value(self, title, setting):\r\n return self.parser.get(title, setting)",
"def settings():\n return _get_settings()[1]",
"def get_value(self, instance):\n try:\n return ParameterSetting.objects.get(\n base_parameter=instance,\n project=sel... | [
"0.7294889",
"0.7209854",
"0.71413344",
"0.7135972",
"0.70718896",
"0.70299363",
"0.68946207",
"0.68454206",
"0.68304175",
"0.6797999",
"0.6759331",
"0.6723995",
"0.66781276",
"0.6677022",
"0.6604862",
"0.6552394",
"0.6526165",
"0.65131354",
"0.65056795",
"0.65033174",
"0.646... | 0.7473363 | 0 |
Get value from window session settings. | def get_window_value(key, default_value=None):
try:
settings = sublime.active_window().settings()
if settings.has(S.KEY_XDEBUG):
xdebug = settings.get(S.KEY_XDEBUG)
if isinstance(xdebug, dict) and key in xdebug.keys():
return xdebug[key]
except:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_window_property(self, connection, window, atom):\n self.logger.debug(\"Getting property %s from window %s\", atom, window)\n cookie = connection.core.GetProperty(\n False,\n window,\n atom,\n GetPropertyType.Any,\n 0,\n 2 ** 32... | [
"0.66261595",
"0.64325553",
"0.6429162",
"0.631893",
"0.6249356",
"0.60630006",
"0.6051012",
"0.60194606",
"0.60169667",
"0.6002836",
"0.5986301",
"0.5914029",
"0.58700776",
"0.57338315",
"0.5727502",
"0.5706799",
"0.5663795",
"0.56559396",
"0.56440043",
"0.56431043",
"0.5643... | 0.6489666 | 1 |
Set value in package configuration settings. | def set_package_value(key, value=None):
try:
config = sublime.load_settings(S.FILE_PACKAGE_SETTINGS)
if value is not None:
config.set(key, value)
elif config and config.has(key):
return config.erase(key)
except:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def settings(self, value):\n self._settings = value",
"def set_config_value(self, value, index=None):",
"def set(name):\n set_config(name)",
"def __setitem__(self, name : str, value : object) -> None:\n self._client.set_config(name, value)",
"def __setitem__(self, key, value):\n sel... | [
"0.7311338",
"0.7118202",
"0.6904355",
"0.6775341",
"0.6744088",
"0.669977",
"0.66905695",
"0.6648466",
"0.6635281",
"0.6548569",
"0.6545358",
"0.6487815",
"0.6487815",
"0.6450585",
"0.6413807",
"0.6413584",
"0.63813865",
"0.63722456",
"0.6358219",
"0.6353778",
"0.6309333",
... | 0.7389469 | 0 |
Set value in project configuration settings. | def set_project_value(key, value=None):
# Unable to set project value if no project file
if not sublime.active_window().project_file_name():
return False
# Get current project data
project = sublime.active_window().project_data()
# Make sure project data is a dictionary
if not isi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_config_value(self, value, index=None):",
"def settings(self, value):\n self._settings = value",
"def set_setting(self, name, value):\n w = self.choices['which']\n if w == 'global_default':\n return self.settings.set_global_default(name, value)\n elif w == 'project... | [
"0.7111764",
"0.7099792",
"0.66522163",
"0.6632955",
"0.6627749",
"0.6574834",
"0.655384",
"0.65391713",
"0.6503556",
"0.6490648",
"0.649037",
"0.64851576",
"0.6446222",
"0.64171904",
"0.641131",
"0.64107877",
"0.6398408",
"0.63764775",
"0.6368775",
"0.63608354",
"0.63517946"... | 0.7227813 | 0 |
Set value in window session settings. | def set_window_value(key, value=None):
try:
settings = sublime.active_window().settings()
if settings.has(S.KEY_XDEBUG):
xdebug = settings.get(S.KEY_XDEBUG)
else:
xdebug = {}
if value is not None:
xdebug[key] = value
elif key in xd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_session_value(self, req, section_name, option_name, option_value):\n name = 'inieditor|%s|%s' % (section_name, option_name)\n req.session[name] = option_value",
"def setSession( self, name, value, REQUEST=None, cookie=None ):\n SetSessionValue( self, name, value, REQUEST, cookie )",
"def ... | [
"0.710376",
"0.65945125",
"0.65557796",
"0.6417914",
"0.6357929",
"0.63375574",
"0.61946267",
"0.61842716",
"0.60377616",
"0.6033639",
"0.60332704",
"0.60126543",
"0.5977081",
"0.5953472",
"0.5889353",
"0.58763736",
"0.5871205",
"0.5822141",
"0.5814173",
"0.5801289",
"0.57990... | 0.6698055 | 1 |
Clear variables, reset transaction_id, close socket connection. | def clear(self):
self.buffer = ''
self.connected = False
self.listening = False
del self.transaction_id
try:
self.socket.close()
except:
pass
self.socket = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self): \n\t\tself.connection = None",
"def close(self):\n self._relaypid = None\n self._portoffset = None",
"def close(self):\n self.connection = None",
"def cleanup(self):\n try:\n self.socket.close()\n except:\n pass # ignore errors when a... | [
"0.6648495",
"0.6486028",
"0.641476",
"0.64127237",
"0.6321298",
"0.63107556",
"0.62315136",
"0.6224574",
"0.6206662",
"0.6204616",
"0.6132146",
"0.6114886",
"0.6102615",
"0.60907996",
"0.6074428",
"0.6052183",
"0.59916365",
"0.59893215",
"0.59866875",
"0.5974536",
"0.5956608... | 0.7127282 | 0 |
Get response data from debugger engine and verify length of response. | def read_data(self):
# Verify length of response data
length = self.read_until_null()
message = self.read_until_null()
if int(length) == len(message):
return message
else:
raise ProtocolException("Length mismatch encountered while reading the Xdebug... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_response(self):\n if not self.debug:\n data = \"\"\n while \"\\n\" not in data:\n try:\n data = data + self.socket.recv(1024)\n except:\n logging.warning(\"Timeout on receive from socket\")\n logging... | [
"0.6138254",
"0.60079205",
"0.5994008",
"0.5862617",
"0.5815017",
"0.5750297",
"0.5744597",
"0.56532854",
"0.5628938",
"0.5628938",
"0.5623629",
"0.5534331",
"0.54961354",
"0.5474005",
"0.54733264",
"0.54455686",
"0.54353344",
"0.5434909",
"0.54348034",
"0.54214907",
"0.54110... | 0.6838978 | 0 |
Get response from debugger engine as XML document object. | def read(self, return_string=False):
# Get result data from debugger engine and verify length of response
data = self.read_data()
# Show debug output
debug('[Response data] %s' % data)
# Return data string
if return_string:
return data
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml(self):\n raise NotImplementedError('This api does not return xml')",
"def Response(self, REQUEST = None):\n stream = REQUEST.stdin\n stream.seek(0)\n response_xml = stream.read()\n self.LOG('INFO', response_xml)\n return",
"def doc(self):\n\n if not ... | [
"0.63962424",
"0.6115441",
"0.5982258",
"0.5955271",
"0.59390193",
"0.59339285",
"0.58450925",
"0.5809692",
"0.578971",
"0.5771151",
"0.5771151",
"0.5682717",
"0.5666657",
"0.5642241",
"0.56173414",
"0.558562",
"0.5565162",
"0.5531529",
"0.55026364",
"0.5488394",
"0.5481191",... | 0.70742 | 0 |
Send command to the debugger engine according to DBGp protocol. | def send(self, command, *args, **kwargs):
# Expression is used for conditional and watch type breakpoints
expression = None
# Seperate 'expression' from kwargs
if 'expression' in kwargs:
expression = kwargs['expression']
del kwargs['expression']
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_command(self):\n self.connection.sendline(self.command_string)",
"def send(cmd, server_host, server_port, debug):\n log = get_logger(__name__, debug)\n\n app = WsCmdApp(server_host, server_port, cmd, debug=debug)\n try:\n app.main()\n finally:\n log.debug('done')",
"de... | [
"0.64553404",
"0.6399784",
"0.6321185",
"0.6270414",
"0.6156327",
"0.6143036",
"0.60685354",
"0.60647917",
"0.60280377",
"0.602666",
"0.59822685",
"0.58874416",
"0.5864461",
"0.58501387",
"0.5831986",
"0.58232915",
"0.5777793",
"0.57463586",
"0.5721434",
"0.5707213",
"0.57072... | 0.6441758 | 1 |
Check if client is connected to debugger engine. | def is_connected(show_status=False):
if S.SESSION and S.SESSION.connected:
return True
elif S.SESSION and show_status:
sublime.status_message('Xdebug: Waiting for response from debugger engine.')
elif show_status:
sublime.status_message('Xdebug: No Xdebug session running.')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_debugger_active() -> bool:\n global _is_debugger_active\n return _is_debugger_active",
"def is_connected(self):\n\t\treturn bool(call_sdk_function('PrlVmDev_IsConnected', self.handle))",
"def is_connected(self):\n if self.server: return True\n return False",
"def is_connected(self)... | [
"0.7153024",
"0.70490485",
"0.686042",
"0.6858823",
"0.68451",
"0.6836221",
"0.68292624",
"0.6810803",
"0.6775631",
"0.6743227",
"0.6726612",
"0.67227787",
"0.67055386",
"0.6704794",
"0.66636837",
"0.6658324",
"0.66346407",
"0.66012424",
"0.65991205",
"0.6597719",
"0.6594343"... | 0.76421624 | 0 |
Evaluate all watch expressions in current context. | def get_watch_values(self):
for index, item in enumerate(S.WATCH):
# Reset value for watch expression
S.WATCH[index]['value'] = None
# Evaluate watch expression when connected to debugger engine
if is_connected():
if item['enabled']:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_watch(expr): #py:add_watch\n RUR.add_watch(expr)",
"def watch(self):",
"def launch_evaluations(self):\n self.report('Launching pending evaluations.')\n with self.optimizer() as opt:\n evals = {}\n evaluate_process = load_object(self.inputs.evaluate_process.value)... | [
"0.5862138",
"0.55884176",
"0.55117536",
"0.5477411",
"0.5440049",
"0.54381377",
"0.5360729",
"0.53466415",
"0.5345954",
"0.53366107",
"0.52088135",
"0.5202315",
"0.5200392",
"0.5138103",
"0.51225996",
"0.51070833",
"0.51038784",
"0.5102731",
"0.508676",
"0.507934",
"0.505759... | 0.6536313 | 0 |
Close all debugging related views in active window. | def close_debug_windows():
window = sublime.active_window()
for view in window.views():
if is_debug_view(view):
window.focus_view(view)
window.run_command('close')
window.run_command('hide_panel', {"panel": 'output.xdebug'}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self):\n self._close_viewer_window()\n self.env.close()",
"def closeAllWindows(self):\n savedEditors = self.editors[:]\n for editor in savedEditors:\n self.closeEditor(editor)",
"def close(self):\n self.window.destroy()\n self.buttons_window.destro... | [
"0.72141886",
"0.68359566",
"0.6771958",
"0.6597395",
"0.65762573",
"0.65588",
"0.65514785",
"0.653202",
"0.64203644",
"0.6415533",
"0.6388052",
"0.6387488",
"0.63611746",
"0.63113916",
"0.630339",
"0.62466866",
"0.6222382",
"0.6215285",
"0.6210483",
"0.6136153",
"0.61351377"... | 0.8673393 | 0 |
Generate output with all configured breakpoints. | def generate_breakpoint_output():
# Get breakpoints for files
values = H.unicode_string('')
if S.BREAKPOINT is None:
return values
for filename, breakpoint_data in sorted(S.BREAKPOINT.items()):
breakpoint_entry = ''
if breakpoint_data:
breakpoint_entry += "=> ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_all(self):\n self.formatter.section_start('Scratch Memory Info')\n self.formatter.section_start('Per priority')\n self.analyse_per_priority()\n self.formatter.section_end()\n self.formatter.section_start('Per task')\n self.analyse_per_task()\n self.formatter... | [
"0.5962088",
"0.57853854",
"0.5314861",
"0.5312172",
"0.52979994",
"0.52711827",
"0.5260041",
"0.5242158",
"0.52314734",
"0.5211959",
"0.51941127",
"0.51853925",
"0.5174205",
"0.5158787",
"0.51372784",
"0.513243",
"0.5131279",
"0.51104456",
"0.51040304",
"0.509372",
"0.509310... | 0.6925629 | 0 |
Generate output with all watch expressions. | def generate_watch_output():
values = H.unicode_string('')
if S.WATCH is None:
return values
for watch_data in S.WATCH:
watch_entry = ''
if watch_data and isinstance(watch_data, dict):
# Whether watch expression is enabled or disabled
if 'enabled' in w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watch(self):",
"def watch_list(self) -> list:\n return []",
"def generate(self):\n\n if not self.validated:\n self.validate()\n\n # output all the functions\n for func in self.functions:\n for line in func.generate():\n yield line\n\n ... | [
"0.557995",
"0.5556901",
"0.55564654",
"0.54869217",
"0.54548234",
"0.5220081",
"0.51911634",
"0.5181233",
"0.5108336",
"0.5106499",
"0.5085489",
"0.50828934",
"0.50764126",
"0.50764126",
"0.50461984",
"0.50137436",
"0.499449",
"0.4957965",
"0.4949818",
"0.49444643",
"0.49214... | 0.7772351 | 0 |
Retrieve configured group/index position of of debug view(s) within active window. Returns list with tuple entries for all debug views or single tuple when specified name of debug view. | def get_debug_index(name=None):
# Set group and index for each debug view
breakpoint_group = get_value(S.KEY_BREAKPOINT_GROUP, -1)
breakpoint_index = get_value(S.KEY_BREAKPOINT_INDEX, 0)
context_group = get_value(S.KEY_CONTEXT_GROUP, -1)
context_index = get_value(S.KEY_CONTEXT_INDEX, 0)
st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_view_index(self, key):\n group_settings = self.get(key)\n view_group = -1\n view_index = -1\n window = sublime.active_window()\n view = window.active_view()\n current_group, current_index = window.get_view_index(view)\n for group_setting in group_settings:\n... | [
"0.63155425",
"0.5801145",
"0.5698274",
"0.5488819",
"0.54723036",
"0.54112583",
"0.53512484",
"0.52094316",
"0.5175989",
"0.5157543",
"0.50628483",
"0.5016703",
"0.49816015",
"0.4978326",
"0.47722638",
"0.4769089",
"0.47554618",
"0.4738957",
"0.4722417",
"0.47117233",
"0.468... | 0.8199735 | 0 |
Determine if active window has any or specific debug view(s). | def has_debug_view(name=None):
for view in sublime.active_window().views():
if is_debug_view(view):
if name is not None:
if view.name() == name:
return True
else:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_debug_view(view):\r\n return view.name() == TITLE_WINDOW_BREAKPOINT or view.name() == TITLE_WINDOW_CONTEXT or view.name() == TITLE_WINDOW_STACK or view.name() == TITLE_WINDOW_WATCH",
"def is_window(game_object: GameObject) -> bool:\n from sims4communitylib.enums.tags_enum import CommonGameTag\n ... | [
"0.7726092",
"0.61963874",
"0.617813",
"0.6156924",
"0.60855526",
"0.60399705",
"0.5977938",
"0.59234774",
"0.5906835",
"0.5843346",
"0.5824371",
"0.5815837",
"0.5779083",
"0.5665754",
"0.5664455",
"0.566101",
"0.56551623",
"0.56280243",
"0.561242",
"0.5609632",
"0.5594906",
... | 0.76947206 | 1 |
Check if view name matches debug name/title. | def is_debug_view(view):
return view.name() == TITLE_WINDOW_BREAKPOINT or view.name() == TITLE_WINDOW_CONTEXT or view.name() == TITLE_WINDOW_STACK or view.name() == TITLE_WINDOW_WATCH | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_debug_view(name=None):\r\n for view in sublime.active_window().views():\r\n if is_debug_view(view):\r\n if name is not None:\r\n if view.name() == name:\r\n return True\r\n else:\r\n return True\r\n return False",
"def te... | [
"0.72773236",
"0.672046",
"0.60906345",
"0.59688354",
"0.5958039",
"0.5943498",
"0.59148294",
"0.5897037",
"0.58388567",
"0.5710619",
"0.5676585",
"0.561935",
"0.54763967",
"0.5463592",
"0.5381217",
"0.5377916",
"0.5364273",
"0.5346284",
"0.5318001",
"0.529924",
"0.52918214",... | 0.7207884 | 1 |
Toggle between debug and default window layouts. | def set_layout(layout):
# Get active window and set reference to active view
window = sublime.active_window()
previous_active = window.active_view()
# Do not set layout when disabled
if get_value(S.KEY_DISABLE_LAYOUT):
S.RESTORE_LAYOUT = window.get_layout()
set_window_value(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setLayout():\n global layout\n\n if p.GetString(\"Layout\") == \"Grid\":\n layoutFlow.setEnabled(False)\n layoutGrid.setEnabled(True)\n layoutStretch.setEnabled(True)\n layout = layoutGrid\n else:\n layoutGrid.setEnabled(False)\n layoutStretch.setEnabled(False... | [
"0.6640265",
"0.6303654",
"0.6158437",
"0.60963243",
"0.5939557",
"0.5882201",
"0.5840122",
"0.57204026",
"0.56931627",
"0.5648773",
"0.5644134",
"0.56340575",
"0.5564359",
"0.5515984",
"0.5513175",
"0.54836875",
"0.5477104",
"0.5475311",
"0.54717207",
"0.5469184",
"0.5448806... | 0.73638594 | 0 |
Show content for specific data type in assigned window view. | def show_content(data, content=None):
# Hande data type
if data == DATA_BREAKPOINT:
title = TITLE_WINDOW_BREAKPOINT
content = generate_breakpoint_output()
elif data == DATA_CONTEXT:
title = TITLE_WINDOW_CONTEXT
elif data == DATA_STACK:
title = TITLE_WINDOW_STACK... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_data():",
"def show(self, window):\r\n\r\n return",
"def show(self) -> None:",
"def show_popup(self, data):\r\n store = get_store()\r\n self.ids.inlayout.rows = 1\r\n self.ids.inlayout.add_widget(CEToolBoxLabel(text=add_color(\"Viscosity :\", \"FFFFFF\")))\r\n valu... | [
"0.6519548",
"0.58745867",
"0.5655609",
"0.5652131",
"0.56504357",
"0.56504357",
"0.56496876",
"0.5649404",
"0.56104195",
"0.5551691",
"0.55455667",
"0.5532585",
"0.55020636",
"0.54942936",
"0.5480836",
"0.5455443",
"0.54308105",
"0.5428313",
"0.5408173",
"0.5400928",
"0.5382... | 0.7020895 | 0 |
Show selected variable in an output panel when clicked in context window. | def show_context_output(view):
# Check if there is a debug session and context data
if S.SESSION and S.SESSION.connected and S.CONTEXT_DATA:
try:
# Get selected point in view
point = view.sel()[0]
# Check if selected point uses variable scope
if poi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showContextMenu(self, point):\r\n\r\n from .TableDialog import TableDialog\r\n\r\n if self.ui.variablesStackedWidget.currentWidget() == self.ui.treePage:\r\n currentView = self.ui.treeView\r\n else:\r\n currentView = self.ui.tableView\r\n\r\n self.actionExpandA... | [
"0.6082748",
"0.59997326",
"0.58182466",
"0.5732047",
"0.5720298",
"0.5720298",
"0.5709376",
"0.5693964",
"0.5678563",
"0.5666367",
"0.5639156",
"0.56358284",
"0.558612",
"0.5584882",
"0.5549745",
"0.55310434",
"0.5505653",
"0.54820645",
"0.5460914",
"0.54178786",
"0.54060364... | 0.638632 | 0 |
Scroll the view to center on the given row (line number). | def show_at_row(view, row=None):
if row is not None:
try:
# Convert row (line number) to region
row_region = rows_to_region(row)[0].a
# Scroll the view to row
view.show_at_center(row_region)
except:
# When defining row_region index ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def goto_line(editor, lineno, scroll=False):\n count = editor.blockCount()\n if lineno > count:\n lineno = count\n lineno = lineno-1\n pos = editor.document(\n ).findBlockByNumber(\n lineno).position()\n\n goto_position(editor, pos)\n \n if scroll:\n bar = editor.ve... | [
"0.61264294",
"0.60592645",
"0.5895141",
"0.5608004",
"0.5565074",
"0.5558783",
"0.54682994",
"0.5464183",
"0.54525656",
"0.53794324",
"0.5370704",
"0.5338742",
"0.53369683",
"0.5336963",
"0.5314059",
"0.5277507",
"0.5255978",
"0.52061677",
"0.51960325",
"0.518687",
"0.518395... | 0.6779723 | 0 |
Convert rows (line numbers) to a region (selection/cursor position). | def rows_to_region(rows):
# Get current active view
view = sublime.active_window().active_view()
# Unable to convert rows to regions when no view available
if view is None:
return
# List for containing regions to return
region = []
# Create list if it is a singleton
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_to_rows(region=None, filter_empty=False):\r\n\r\n # Get current active view\r\n view = sublime.active_window().active_view()\r\n # Unable to convert regions to rows when no view available\r\n if view is None:\r\n return\r\n\r\n # Use current selection/cursor position if no region d... | [
"0.610396",
"0.59846014",
"0.5704484",
"0.56925046",
"0.55756533",
"0.5571986",
"0.5461739",
"0.5458075",
"0.5431003",
"0.54107404",
"0.54012764",
"0.53785634",
"0.537536",
"0.53357387",
"0.5306939",
"0.5301132",
"0.52896553",
"0.52703184",
"0.5241149",
"0.5240699",
"0.522312... | 0.77316535 | 0 |
Convert a region (selection/cursor position) to rows (line numbers). | def region_to_rows(region=None, filter_empty=False):
# Get current active view
view = sublime.active_window().active_view()
# Unable to convert regions to rows when no view available
if view is None:
return
# Use current selection/cursor position if no region defined
if region... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rows_to_region(rows):\r\n\r\n # Get current active view\r\n view = sublime.active_window().active_view()\r\n # Unable to convert rows to regions when no view available\r\n if view is None:\r\n return\r\n\r\n # List for containing regions to return\r\n region = []\r\n\r\n # Create li... | [
"0.7069481",
"0.5763603",
"0.567343",
"0.55567485",
"0.55348265",
"0.5504504",
"0.54952544",
"0.5494017",
"0.54373735",
"0.5385983",
"0.53843707",
"0.5381587",
"0.5372232",
"0.53673124",
"0.53390056",
"0.5307433",
"0.5302229",
"0.5264201",
"0.5260492",
"0.52363807",
"0.519923... | 0.7049109 | 1 |
This method removes a particular host from the environment. | def remove_host(self, host):
from host import Host
if isinstance(host, Host):
self.hosts.pop(self.hosts.index(host))
print('Removing host %s... from environment %s' % (host.id[0:5], self.id[0:5]))
elif type(host) == int:
self.hosts.pop(host)
else:
raise TypeError('A Host object or an integer must b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_remove_absent_host(self, inventoryloader):\n inventoryloader.del_host('localhost3')",
"def remove(self, host):\n for p, c in self.configs_:\n if host in c.hosts_:\n c.remove(host)\n return\n raise ValueError(\"Host %s: not found\" % host)",
... | [
"0.7152626",
"0.71021533",
"0.70488113",
"0.68926597",
"0.6878488",
"0.68579435",
"0.6739533",
"0.66395736",
"0.66258144",
"0.6548625",
"0.6547908",
"0.6472033",
"0.64547884",
"0.64496434",
"0.64128965",
"0.63726884",
"0.6325689",
"0.6320578",
"0.6297529",
"0.62857735",
"0.62... | 0.82673234 | 0 |
handle the request through all processors | def worker(self, request):
try:
for processor in self.processors:
if processor.accepted(request):
processor.process(request)
except Exception as e:
#TODO print e
print e
pass
finally:
#waiter be awake... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process(self, request):\n pass",
"def _process_request(self, request, response):\n ...",
"def process_request(self, request):\n raise NotImplementedError('process_request not implemented in BaseService')",
"def process_request(self, req, resp):\n pass\n \"\"\"TODO: to b... | [
"0.76945394",
"0.7152305",
"0.70982635",
"0.68047994",
"0.67183316",
"0.6674533",
"0.66101474",
"0.65815645",
"0.65278983",
"0.6524481",
"0.65023655",
"0.65006196",
"0.6484686",
"0.6472722",
"0.6472722",
"0.6472722",
"0.64591116",
"0.64372677",
"0.6413186",
"0.63863945",
"0.6... | 0.72083473 | 1 |
Count for distinct colors in input image | def distict_color_count(img):
return Counter([tuple(colors) for i in img for colors in i]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getShadeMap(img):\n return np.bincount(img.astype(int).flat, minlength=256)",
"def count_from_top(img):\n pixel_count = 0\n for row in img:\n unique_pixel_vals = np.unique(row)\n if 255 not in unique_pixel_vals: # ignore shading (values between 0-255)\n pixel_count += 1\... | [
"0.7229509",
"0.7180912",
"0.71758676",
"0.6995512",
"0.6896383",
"0.6867797",
"0.68644917",
"0.68574107",
"0.67318153",
"0.6631058",
"0.65029",
"0.64882797",
"0.6371832",
"0.6367159",
"0.6241221",
"0.61794525",
"0.61754584",
"0.61583656",
"0.61462027",
"0.6143077",
"0.61315"... | 0.86316353 | 1 |
Install CockroachDB from a resource or download a binary. | def _install_binary(self):
try:
resource_path = self.model.resources.fetch('cockroach-linux-amd64')
except ModelError:
resource_path = None
if resource_path is None:
architecture = 'amd64' # hard-coded until it becomes important
version = self.mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _install(args, use_cache, debug):\n engine = choose_engine(args)\n engine.use_cache = use_cache\n\n if args['dataset'].endswith('.zip') or args.get('hash_value'):\n path_to_archive = args['dataset']\n if args.get('hash_value'):\n path_to_archive = os.path.join(\n ... | [
"0.5920222",
"0.570945",
"0.54063445",
"0.5298906",
"0.5215221",
"0.5163295",
"0.5122153",
"0.5118557",
"0.5064543",
"0.5032804",
"0.50090885",
"0.5003292",
"0.49295148",
"0.48652962",
"0.48636377",
"0.48500162",
"0.4834903",
"0.48279306",
"0.48258758",
"0.47939846",
"0.47610... | 0.71391106 | 0 |
Start the CockroachDB daemon. Starting the daemon for the first time in the single instance mode also initializes the database ondisk state. | def start(self):
self._run_start()
self._stored.is_started = True
if self._is_single_node and not self._stored.is_initialized:
self._stored.is_initialized = self._stored.is_initialized = True
self.on.cluster_initialized.emit(self._get_cluster_id())
self.on.daemon_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(self):\r\n \r\n if self.is_mongod_running():\r\n return\r\n \r\n cmd = self.mongod_bin + \" --port \" + str(self.port) + \" --smallfiles --dbpath \" + self.db_path + \" > /dev/null &\"\r\n #if self.kwargs.get('noJournal'):\r\n #argv += ['--nojourna... | [
"0.641836",
"0.59979314",
"0.5866776",
"0.574997",
"0.5693483",
"0.56565446",
"0.5556549",
"0.5523568",
"0.5519005",
"0.55078965",
"0.5410767",
"0.53996277",
"0.5395313",
"0.537986",
"0.5379154",
"0.5368634",
"0.5361941",
"0.53213876",
"0.53183514",
"0.5316747",
"0.5313777",
... | 0.6223286 | 1 |
Gets the carrier_service_code of this TransportCall. | def carrier_service_code(self) -> CarrierServiceCode:
return self._carrier_service_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_code(self):\n return self._service_code",
"def carrier_service_code(self, carrier_service_code: CarrierServiceCode):\n\n self._carrier_service_code = carrier_service_code",
"def carrier_name(self) -> str:\n return pulumi.get(self, \"carrier_name\")",
"def get_carrier_id():\n ... | [
"0.72842157",
"0.6651621",
"0.6249851",
"0.6168357",
"0.5783968",
"0.546718",
"0.5450138",
"0.53916293",
"0.53916293",
"0.53916293",
"0.53916293",
"0.5313087",
"0.5224637",
"0.51369226",
"0.51328015",
"0.51155037",
"0.50957596",
"0.5054456",
"0.50351375",
"0.50172365",
"0.500... | 0.86612034 | 0 |
Sets the carrier_service_code of this TransportCall. | def carrier_service_code(self, carrier_service_code: CarrierServiceCode):
self._carrier_service_code = carrier_service_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_code(self, service_code):\n \n self._service_code = service_code",
"def carrier_service_code(self) -> CarrierServiceCode:\n return self._carrier_service_code",
"def service_code(self, service_code):\n if service_code is None:\n raise ValueError(\"Invalid value... | [
"0.7251644",
"0.70169777",
"0.65104437",
"0.6225796",
"0.57695603",
"0.5692424",
"0.5663009",
"0.53803957",
"0.53731537",
"0.5371029",
"0.53579736",
"0.53150094",
"0.52437466",
"0.52437466",
"0.52437466",
"0.5160758",
"0.5122628",
"0.5122628",
"0.51196676",
"0.51150966",
"0.5... | 0.87002647 | 0 |
Gets the carrier_voyage_number of this TransportCall. | def carrier_voyage_number(self) -> Object:
return self._carrier_voyage_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def carrier_voyage_number(self, carrier_voyage_number: Object):\n\n self._carrier_voyage_number = carrier_voyage_number",
"def transport_call_sequence_number(self) -> TransportCallSequenceNumber:\n return self._transport_call_sequence_number",
"def get_carrier_id():\n carrier = get_carrier()\n... | [
"0.72276586",
"0.668864",
"0.63413525",
"0.62337756",
"0.6141322",
"0.60689414",
"0.5815633",
"0.57952344",
"0.5784036",
"0.5691112",
"0.5670745",
"0.563808",
"0.5626758",
"0.56090516",
"0.55814743",
"0.55477625",
"0.55419344",
"0.54970384",
"0.5410399",
"0.53442764",
"0.5310... | 0.8697055 | 0 |
Sets the carrier_voyage_number of this TransportCall. | def carrier_voyage_number(self, carrier_voyage_number: Object):
self._carrier_voyage_number = carrier_voyage_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def carrier_voyage_number(self) -> Object:\n return self._carrier_voyage_number",
"def transport_call_sequence_number(self, transport_call_sequence_number: TransportCallSequenceNumber):\n\n self._transport_call_sequence_number = transport_call_sequence_number",
"def carrier_settings_version(self,... | [
"0.7160093",
"0.6450173",
"0.6376397",
"0.61825895",
"0.6054556",
"0.5981587",
"0.59346867",
"0.59346867",
"0.59346867",
"0.59346867",
"0.59201306",
"0.59201306",
"0.5886792",
"0.58690566",
"0.58064353",
"0.5602043",
"0.55685216",
"0.55385464",
"0.55120564",
"0.55120564",
"0.... | 0.8866267 | 0 |
Gets the transport_call_sequence_number of this TransportCall. | def transport_call_sequence_number(self) -> TransportCallSequenceNumber:
return self._transport_call_sequence_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sequence_number(self):\n return self._sequence_number",
"def transport_call_sequence_number(self, transport_call_sequence_number: TransportCallSequenceNumber):\n\n self._transport_call_sequence_number = transport_call_sequence_number",
"def sequence_number(self):\n # type: () -> int\n ... | [
"0.6963038",
"0.67741954",
"0.6749771",
"0.6677467",
"0.6429742",
"0.5921302",
"0.59178203",
"0.5893854",
"0.58414215",
"0.58299685",
"0.5824347",
"0.5793729",
"0.5741379",
"0.5716518",
"0.57060516",
"0.56729215",
"0.56632364",
"0.5628967",
"0.55962527",
"0.5595896",
"0.55705... | 0.9205537 | 0 |
Sets the transport_call_sequence_number of this TransportCall. | def transport_call_sequence_number(self, transport_call_sequence_number: TransportCallSequenceNumber):
self._transport_call_sequence_number = transport_call_sequence_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transport_call_sequence_number(self) -> TransportCallSequenceNumber:\n return self._transport_call_sequence_number",
"def sequence_number(self, sequence_number):\n # type: (int) -> None\n\n if sequence_number is not None:\n if not isinstance(sequence_number, int):\n ... | [
"0.71706456",
"0.62719053",
"0.612321",
"0.600532",
"0.600532",
"0.600532",
"0.600532",
"0.5963724",
"0.59230554",
"0.57909703",
"0.57386893",
"0.55959123",
"0.55951446",
"0.55877894",
"0.55337256",
"0.54906124",
"0.54462594",
"0.5418023",
"0.5405004",
"0.53730154",
"0.536835... | 0.8826703 | 0 |
Gets the un_location_code of this TransportCall. | def un_location_code(self) -> UNLocationCode1:
return self._un_location_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def un_location_code(self, un_location_code: UNLocationCode1):\n\n self._un_location_code = un_location_code",
"def zip_code(self):\n return self._zip_code",
"def get_code(self):\n return self.code",
"def get_code(self):\n return self.code",
"def get_code(self):\n return ... | [
"0.6622405",
"0.5913561",
"0.5826909",
"0.5826909",
"0.5826909",
"0.5826909",
"0.56042856",
"0.5551572",
"0.554241",
"0.5427338",
"0.53895587",
"0.53895587",
"0.53895587",
"0.53895587",
"0.53355235",
"0.5309055",
"0.5294797",
"0.5292849",
"0.528643",
"0.5209685",
"0.5198675",... | 0.77014303 | 0 |
Sets the un_location_code of this TransportCall. | def un_location_code(self, un_location_code: UNLocationCode1):
self._un_location_code = un_location_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def un_location_code(self) -> UNLocationCode1:\n return self._un_location_code",
"def unit_code(self, unit_code):\n\n self._unit_code = unit_code",
"def set_code(self, code):\n self.set_payload(code)",
"def code(self, code: int):\n\n self._code = code",
"def code(self, code):\n ... | [
"0.6621834",
"0.583785",
"0.5650136",
"0.54014033",
"0.53402984",
"0.5337326",
"0.530074",
"0.5294318",
"0.5294318",
"0.5210932",
"0.52028036",
"0.5154951",
"0.51135373",
"0.5109619",
"0.5088651",
"0.5058072",
"0.49961406",
"0.49919757",
"0.49453282",
"0.4930251",
"0.49134666... | 0.8225933 | 0 |
Gets the facility_code of this TransportCall. | def facility_code(self) -> FacilityCode:
return self._facility_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_type_code(self) -> FacilityTypeCodeTRN:\n return self._facility_type_code",
"def facility_id(self):\n return self.facility_names.get(\n self.facility, self.facility_names['user'])",
"def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):\n\n self._fa... | [
"0.76306325",
"0.63968474",
"0.6062447",
"0.59766823",
"0.5936451",
"0.58175796",
"0.56413954",
"0.5449211",
"0.5346333",
"0.52893835",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.52063215",
"0.5197882",
"0.5197882",
"0... | 0.8236776 | 0 |
Sets the facility_code of this TransportCall. | def facility_code(self, facility_code: FacilityCode):
self._facility_code = facility_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):\n\n self._facility_type_code = facility_type_code",
"def facility_code(self) -> FacilityCode:\n return self._facility_code",
"def facility_code_list_provider(self, facility_code_list_provider: FacilityCodeListProvider):\n\n ... | [
"0.7905495",
"0.642921",
"0.6335734",
"0.62143785",
"0.60220706",
"0.5878038",
"0.5549193",
"0.5530352",
"0.55098474",
"0.55098474",
"0.5433781",
"0.5376657",
"0.53196406",
"0.5311857",
"0.5302932",
"0.527593",
"0.5275253",
"0.5267452",
"0.514797",
"0.51000214",
"0.51000214",... | 0.848967 | 0 |
Gets the facility_code_list_provider of this TransportCall. | def facility_code_list_provider(self) -> FacilityCodeListProvider:
return self._facility_code_list_provider | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code_list_provider(self, facility_code_list_provider: FacilityCodeListProvider):\n\n self._facility_code_list_provider = facility_code_list_provider",
"def facility_code(self) -> FacilityCode:\n return self._facility_code",
"def facility_type_code(self) -> FacilityTypeCodeTRN:\n ... | [
"0.6927874",
"0.6314324",
"0.5720347",
"0.5131594",
"0.51165104",
"0.5051455",
"0.49435464",
"0.49236757",
"0.48180133",
"0.4743",
"0.47290778",
"0.47071797",
"0.46978357",
"0.46914044",
"0.46867642",
"0.46514556",
"0.4645628",
"0.45946458",
"0.4540872",
"0.45404473",
"0.4532... | 0.86604375 | 0 |
Sets the facility_code_list_provider of this TransportCall. | def facility_code_list_provider(self, facility_code_list_provider: FacilityCodeListProvider):
self._facility_code_list_provider = facility_code_list_provider | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code_list_provider(self) -> FacilityCodeListProvider:\n return self._facility_code_list_provider",
"def facility_code(self, facility_code: FacilityCode):\n\n self._facility_code = facility_code",
"def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):\n\n self.... | [
"0.71877486",
"0.6635159",
"0.6307395",
"0.5216908",
"0.49269015",
"0.48540172",
"0.48303238",
"0.48276266",
"0.47824258",
"0.4757051",
"0.47439513",
"0.46738738",
"0.46177578",
"0.45575175",
"0.4557452",
"0.45428643",
"0.4487239",
"0.44737267",
"0.4467924",
"0.44652975",
"0.... | 0.8686091 | 0 |
Gets the facility_type_code of this TransportCall. | def facility_type_code(self) -> FacilityTypeCodeTRN:
return self._facility_type_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code(self) -> FacilityCode:\n return self._facility_code",
"def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):\n\n self._facility_type_code = facility_type_code",
"def type_code(self):\n return self._TYPE_CODE",
"def getTypeCode(self):\n return _li... | [
"0.7469634",
"0.70491064",
"0.6334726",
"0.6140814",
"0.60163283",
"0.5955726",
"0.59346575",
"0.5934325",
"0.5921057",
"0.5814628",
"0.5803388",
"0.5802081",
"0.57825863",
"0.57601184",
"0.57542807",
"0.5747234",
"0.5746684",
"0.5710185",
"0.56925726",
"0.5640349",
"0.563424... | 0.84395015 | 0 |
Sets the facility_type_code of this TransportCall. | def facility_type_code(self, facility_type_code: FacilityTypeCodeTRN):
self._facility_type_code = facility_type_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility_code(self, facility_code: FacilityCode):\n\n self._facility_code = facility_code",
"def facility_type_code(self) -> FacilityTypeCodeTRN:\n return self._facility_type_code",
"def facility_code_list_provider(self, facility_code_list_provider: FacilityCodeListProvider):\n\n self.... | [
"0.7423072",
"0.68273073",
"0.5729778",
"0.5681416",
"0.5639891",
"0.54400724",
"0.5416981",
"0.5416981",
"0.54142743",
"0.54113394",
"0.538243",
"0.53485966",
"0.5314421",
"0.52826625",
"0.52826625",
"0.5275592",
"0.52329594",
"0.52232313",
"0.51419693",
"0.5137019",
"0.5119... | 0.8590951 | 0 |
Gets the other_facility of this TransportCall. | def other_facility(self) -> OtherFacility:
return self._other_facility | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facility(self):\n return getattr(self, '_facility', 'user')",
"def other_facility(self, other_facility: OtherFacility):\n\n self._other_facility = other_facility",
"def get_other_end_trunk_party(self, otherDN):\n thisSiteTrunkParty = self.Call.findTrunkPartyToOtherSite(otherDN)\n ... | [
"0.62173206",
"0.6215546",
"0.60112906",
"0.5618352",
"0.55308914",
"0.55186707",
"0.5360198",
"0.5327582",
"0.520508",
"0.5185801",
"0.5175611",
"0.50265193",
"0.502354",
"0.4877988",
"0.4853956",
"0.4838288",
"0.47945",
"0.47939295",
"0.47162384",
"0.47103912",
"0.4699951",... | 0.8507804 | 0 |
Sets the other_facility of this TransportCall. | def other_facility(self, other_facility: OtherFacility):
self._other_facility = other_facility | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def other_facility(self) -> OtherFacility:\n return self._other_facility",
"def facility_name(self, facility_name):\n\n self._facility_name = facility_name",
"def facility_code(self, facility_code: FacilityCode):\n\n self._facility_code = facility_code",
"def setConnectPortal(self,otherP... | [
"0.6466638",
"0.5448923",
"0.54050916",
"0.51941055",
"0.50108624",
"0.49428844",
"0.48733217",
"0.47866112",
"0.47462025",
"0.47439834",
"0.4608091",
"0.45922807",
"0.45272255",
"0.45255762",
"0.4491326",
"0.44810724",
"0.44152954",
"0.44091251",
"0.4404139",
"0.44013253",
"... | 0.8593055 | 0 |
Gets the mode_of_transport of this TransportCall. | def mode_of_transport(self) -> ModeOfTransport:
return self._mode_of_transport | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mode_of_transport(self, mode_of_transport: ModeOfTransport):\n if mode_of_transport is None:\n raise ValueError(\"Invalid value for `mode_of_transport`, must not be `None`\") # noqa: E501\n\n self._mode_of_transport = mode_of_transport",
"def operation_mode(self):\n return se... | [
"0.6922612",
"0.6919277",
"0.6914625",
"0.68750006",
"0.6809099",
"0.68015593",
"0.67928",
"0.6741832",
"0.67172074",
"0.67172074",
"0.67172074",
"0.67147106",
"0.6696603",
"0.66642433",
"0.6643494",
"0.6643494",
"0.6643494",
"0.66030246",
"0.6578615",
"0.6506838",
"0.6487486... | 0.89913356 | 0 |
Sets the mode_of_transport of this TransportCall. | def mode_of_transport(self, mode_of_transport: ModeOfTransport):
if mode_of_transport is None:
raise ValueError("Invalid value for `mode_of_transport`, must not be `None`") # noqa: E501
self._mode_of_transport = mode_of_transport | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mode_of_transport(self) -> ModeOfTransport:\n return self._mode_of_transport",
"def transport(self, transport):\n\n self._transport = transport",
"def set_operation_mode(self, operation_mode):\n self.api.device_control(self.obj_id, \"modeSet\", {\"value\": operation_mode})",
"def tra... | [
"0.69500434",
"0.6212618",
"0.6149765",
"0.6106108",
"0.60899484",
"0.60858744",
"0.60578024",
"0.6057197",
"0.5970684",
"0.59140766",
"0.59140766",
"0.59140766",
"0.5867031",
"0.5861131",
"0.5797396",
"0.5784049",
"0.5774845",
"0.5759664",
"0.5728485",
"0.5671846",
"0.565649... | 0.7991468 | 0 |
Gets the vessel of this TransportCall. | def vessel(self) -> Vessel:
return self._vessel | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vsolar(self):\n return self.read_register(4098, 1, 3)",
"def picked_equity(self):\n if self._swarm_series is None:\n raise ValueError(\"Run pick() method before access this property\")\n return self._swarm_series['equity']",
"def vessel(self, vessel: Vessel):\n\n ... | [
"0.560301",
"0.5569039",
"0.55634546",
"0.52054715",
"0.49749368",
"0.49590352",
"0.49332634",
"0.48401356",
"0.48102656",
"0.48093945",
"0.47924298",
"0.47185913",
"0.47121373",
"0.46898058",
"0.46894285",
"0.46704713",
"0.46704713",
"0.46704713",
"0.46312952",
"0.46303323",
... | 0.7892122 | 0 |
Sets the vessel of this TransportCall. | def vessel(self, vessel: Vessel):
self._vessel = vessel | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vessel(self) -> Vessel:\n return self._vessel",
"def initialize_installation_vessel(self):\n\n support = self.config[\"oss_install_vessel\"]\n vessel = self.initialize_vessel(\"Floating Substation Installation Vessel\", support)\n self.env.register(vessel)\n vessel.initiali... | [
"0.64571583",
"0.50602514",
"0.49863067",
"0.4968891",
"0.49273208",
"0.48980075",
"0.4805866",
"0.47246557",
"0.47181147",
"0.4665186",
"0.46112278",
"0.45743716",
"0.4558273",
"0.4553667",
"0.45435265",
"0.4523039",
"0.44890124",
"0.44846553",
"0.4463271",
"0.44622236",
"0.... | 0.802577 | 0 |
Initializes an ``NLPScoreType`` instance. | def __init__(self, score_name: str, word_list: List[str]):
score_name = score_name.lower()
self._score_name = score_name
if score_name in NLPSCORE_NO_WORD_LIST:
if word_list is not None:
raise TypeError(
"NLPScoreType with score_name {} requires it... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, type_):\n\n self.type = type_",
"def __init__(self, type=np.float64):\n self._inst = None\n self._type = type",
"def __init__(self, type, powerIndex):\n self.type_ = type\n self.powerIndex_ = powerIndex",
"def initialize(cls):",
"def __init__(self,\n ... | [
"0.5848991",
"0.56890863",
"0.5672358",
"0.56720567",
"0.56430805",
"0.56430805",
"0.56374663",
"0.56294376",
"0.5619654",
"0.5610097",
"0.56031615",
"0.55874294",
"0.5572391",
"0.55575377",
"0.5544469",
"0.55251944",
"0.55247134",
"0.55247134",
"0.55083084",
"0.5495413",
"0.... | 0.60346377 | 0 |
Gets the string of the ``score_name`` argument. | def score_name(self) -> str:
return self._score_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def score_string(score):\n return str(score)",
"def get_name(self, ):\n return self.get_parameter('name')",
"def get_name() -> str:",
"def get_internal_name(self):\n return self.xml_score_part.get(\"id\")",
"def get_name() -> str:\n pass",
"def _name(self):\n return self._a... | [
"0.69342655",
"0.6606206",
"0.648812",
"0.6404699",
"0.63656956",
"0.63085794",
"0.63084936",
"0.6275363",
"0.62742746",
"0.6268287",
"0.62562263",
"0.6220512",
"0.62172204",
"0.6214668",
"0.6203236",
"0.6200231",
"0.6192213",
"0.6170113",
"0.6170113",
"0.6170113",
"0.6168906... | 0.8458246 | 0 |
Gets the string of the ``word_list`` argument. | def word_list(self) -> List[str]:
return self._word_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def word_list(self) -> Optional['outputs.PreventionStoredInfoTypeDictionaryWordList']:\n return pulumi.get(self, \"word_list\")",
"def get_word(self) -> str: \n #return str(choice(word_list).upper())\n return \"ANONYMOUS\"",
"def words_string(self):\n return ' '.join(self.wor... | [
"0.62928534",
"0.6286747",
"0.6280409",
"0.6181433",
"0.6168164",
"0.6144847",
"0.61325264",
"0.61252284",
"0.6081529",
"0.59746176",
"0.5930477",
"0.592119",
"0.5883869",
"0.58312094",
"0.579614",
"0.5784678",
"0.5781823",
"0.56994194",
"0.5697706",
"0.56848377",
"0.56803447... | 0.646538 | 0 |
Fills google form with information from the lists | def fill_listing(self):
self.driver.get(FORM)
for i in range(len(self.all_links)):
time.sleep(3)
question_1 = self.driver.find_element_by_xpath("""//*[@id="mG61Hd"]/div[2]/div/div[2]/div[1]/div/div/div[2]/div/div[1]/div/div[1]/input""")
question_1.send_keys(sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def individual_formfields():\n # Instantiate Consent Tracker\n consent = s3db.auth_Consent(processing_types = VOL_CONSENT_OPTIONS)\n\n formfields = [utable.first_name,\n utable.last_name,\n Field(\"addr_L3\",\n ... | [
"0.58535177",
"0.58265984",
"0.56552064",
"0.5567343",
"0.54555374",
"0.54505736",
"0.5448433",
"0.54234284",
"0.5412581",
"0.5398217",
"0.5337003",
"0.53042877",
"0.52922595",
"0.52883184",
"0.52389497",
"0.52169436",
"0.5204323",
"0.5200136",
"0.5189331",
"0.5177344",
"0.51... | 0.6060077 | 0 |
Generate quadratic heatmap z = (x centre_x)^2 + (y centre_y)^2 | def generate_quadratic_heatmap(batch_parameters, img_height=DEFAULT_HEIGHT, img_width=DEFAULT_WIDTH, return_params=False):
# if batch_parameters is None:
# centre_x, centre_y = get_initialization(img_height, img_width)
batch_size = batch_parameters.shape[0]
centre_x = batch_parameters[:, 0].unsquee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grid_spherical_decomposed(x, y, z, data, x_i, y_i, z_i, horz_res, missing_value=-32767):\n\n r_map = np.sqrt(x**2.0 + y**2.0) # cartesian radius from map (x,y) center\n az_map = np.arctan2(y,x) #azimuth in the cartesian system. might vary along a ray due to map projection curvature\n vcp = np.fromi... | [
"0.62040854",
"0.6041263",
"0.5950751",
"0.59310347",
"0.58542275",
"0.583864",
"0.58300734",
"0.56589",
"0.5657789",
"0.5622638",
"0.5598853",
"0.5596344",
"0.5594918",
"0.5588836",
"0.558471",
"0.5572935",
"0.5554172",
"0.5549635",
"0.55239064",
"0.5519286",
"0.5460759",
... | 0.6264529 | 0 |
Function to tune hyperparameters using validation set | def hyperparameter_tune(X_train_all, y_train_all, X_val_all, y_val_all, hyperparameters, train_size=None):
# Initialize train_size to be the full train data if no parameters passed
if train_size is None:
train_size = len(X_train_all)
# Select Subset of Data
X_train = X_train_all[:train_size]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tune_parameters(self, model, param_set, train, predictor_var, target_var):\n \n grid_search = GridSearchCV(estimator = model, param_grid = param_set,n_jobs=-1, cv=5)\n grid_search.fit(train[predictor_var],train[target_var])\n \n print(grid_search.best_params_, grid_search.bes... | [
"0.73598444",
"0.71142757",
"0.70987165",
"0.70535964",
"0.69854534",
"0.6908685",
"0.68585783",
"0.6846131",
"0.68136054",
"0.6775747",
"0.6770749",
"0.6757411",
"0.67123765",
"0.6703302",
"0.66782874",
"0.66533345",
"0.6652283",
"0.6600227",
"0.6575807",
"0.65688396",
"0.65... | 0.7670702 | 0 |
List all pages of a website. | def list_pages(request):
context = RequestContext(request)
pages = request.website.get_pages()
return render_to_response("pages/list_pages.html", {"pages": pages}, context) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_pages(url):\n page_list = []\n while True:\n # this is the only place in which we do a request and get the page from the online website case.law\n # result variable is the entire content for that page: a big dictionary of data\n result = requests.get(url).json()\n\n # resu... | [
"0.67493856",
"0.67105114",
"0.6674503",
"0.6618896",
"0.6556177",
"0.6360204",
"0.63263065",
"0.63215804",
"0.6316553",
"0.6313228",
"0.623714",
"0.6138392",
"0.61055595",
"0.61055595",
"0.60950255",
"0.6082936",
"0.6054157",
"0.5994613",
"0.59820545",
"0.59780324",
"0.59053... | 0.763061 | 0 |
Published page of a CMS | def publish(request):
context = RequestContext(request)
page = Page.objects.get(website=request.website, url=request.POST['page_route'])
try:
page.publish(context)
page.clear_cache(context)
purge_varnish(request)
except Exception, e:
# log error
raise e
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page(request,slug):\n\t\n\t# Carga la página\n\tentry = get_object_or_404(Entry,slug=slug)\n\t\n\t# Si la página no es publica y no pertenece al usuario actual (en caso de estar autentificado)\n\tif not entry.public and not (request.user.is_authenticated() and request.user==entry.author):\n\t\t# No se permitir... | [
"0.6858086",
"0.62900233",
"0.62588257",
"0.61470145",
"0.6119837",
"0.6061429",
"0.60598814",
"0.6057633",
"0.6034127",
"0.5974973",
"0.597422",
"0.59625286",
"0.59481907",
"0.59481907",
"0.59476197",
"0.5937127",
"0.59133667",
"0.5910334",
"0.5910334",
"0.58946955",
"0.5873... | 0.62911445 | 1 |
runs from the main HTTP server thread, or from write/flush() callback doesn't set/get Context; just checks if finish event was set by oboe_start() | def RequestHandler_finish(self):
if self.request._oboe_finish_ev and self.request._oboe_ctx and self.request._oboe_ctx.is_valid():
ev = self.request._oboe_finish_ev
ctx = self.request._oboe_ctx
if hasattr(self, 'get_status'): # recent Tornado
ev.add_info("Status", self.get_status... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_request_complete(self) -> Union[socket.socket, bool]:\n pass # pragma: no cover",
"def run(self):\n self.initialize()\n\n # run the start callback\n tools.run_callback(\"start\", {'request': self._request})\n\n data = self._request.getData()\n pyhttp = self._requ... | [
"0.61489683",
"0.601485",
"0.5924379",
"0.5758646",
"0.5688947",
"0.56638",
"0.5632695",
"0.561921",
"0.5604375",
"0.5604375",
"0.5604375",
"0.5589101",
"0.55162",
"0.5510065",
"0.544074",
"0.5422161",
"0.5422161",
"0.541236",
"0.5411658",
"0.53789043",
"0.53640556",
"0.533... | 0.65478677 | 0 |
Tests that SMSes are actually sent using the Nexmo outgoing backend. | def test_sending_sms(self):
try:
from django.conf import settings
except ImportError:
self.fail(msg="No TEST_NUMBER found in settings!")
from rapidsms.router import send
from rapidsms.models import Connection, Backend
from random import randint
b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_outgoing_message_send(self):\n message = self.create_outgoing_message()\n message.send()\n self.assertEqual(self.outbound[0].text, message.text)",
"def test_smsmessage_user():",
"def test_get_sms_message(self):\n pass",
"def test_sendimmessages(self):\n pass",
"d... | [
"0.71903163",
"0.718576",
"0.71739185",
"0.67822224",
"0.6528983",
"0.65068907",
"0.64795303",
"0.64254445",
"0.633896",
"0.63101304",
"0.6272128",
"0.62406963",
"0.62042356",
"0.61915684",
"0.6154555",
"0.61311525",
"0.611562",
"0.6074468",
"0.60646266",
"0.60494447",
"0.602... | 0.8424374 | 0 |
Applies binary thresholding to the picture + gaussian blurring for smoothing. | def bin_thresh(img, threshold):
_, new_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY) # 255 is the max value
# make some smoothing to get rid of unnecessary ~splashes of color
# parameters are the width and height of gaussian kernel, and standard deviation in X and Y direction,
# sig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binarize(img):\n image = cv.cvtColor(img, cv.COLOR_BGR2GRAY)\n image = cv.GaussianBlur(image, (3, 3), 0)\n ret, image = cv.threshold(image, 0, 255, cv.THRESH_BINARY_INV | cv.THRESH_OTSU)\n return image",
"def bin_thres_img(img, ksize=3):\n # Apply each of the thresholding functions\n gradx ... | [
"0.7324092",
"0.71054596",
"0.7091587",
"0.70801264",
"0.69444305",
"0.6869273",
"0.68644875",
"0.6819687",
"0.67708397",
"0.6760809",
"0.6723325",
"0.6708034",
"0.6666469",
"0.6664369",
"0.6654734",
"0.66252667",
"0.6604466",
"0.6575203",
"0.6574955",
"0.65726924",
"0.657177... | 0.77002597 | 0 |
Inverted binary thresholding + gaussian blurring. | def inv_bin_thresh(img, threshold):
# the 1st returned val = our threshold; if we use cv.THRESH_OTSU, it's optimal threshold val found by the algorithm
_, new_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY_INV)
# make some smoothing to get rid of unnecessary ~splashes of color
# parame... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bin_thresh(img, threshold):\r\n _, new_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY) # 255 is the max value\r\n\r\n # make some smoothing to get rid of unnecessary ~splashes of color\r\n # parameters are the width and height of gaussian kernel, and standard deviation in X and Y directio... | [
"0.7171413",
"0.6945607",
"0.6749838",
"0.6737633",
"0.66952235",
"0.66482",
"0.66207457",
"0.6548103",
"0.65038043",
"0.63922507",
"0.63674086",
"0.63362736",
"0.63297504",
"0.63142514",
"0.62994534",
"0.627683",
"0.62472445",
"0.6229089",
"0.620847",
"0.6207186",
"0.62064",... | 0.73282987 | 0 |
Reorder points in a rectangle in clockwise order to be consistent with OpenCV. | def reorder(pts):
# pts is a numpy array tha looks like [ [[numX numY]] [[num num]] [[num num]] [[num num]] ]
pts = pts.reshape((4, 2)) # make it look like [ [numX numY] [num num] [num num] [num num] ]
pts_new = np.zeros((4, 2), np.float32)
add = pts.sum(1) # array like [ numX+numY num+num num+n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def order_rect(pts):\n new = np.zeros((4, 2), dtype=\"int64\")\n s = pts.sum(axis=1)\n new[0] = pts[np.argmin(s)]\n new[2] = pts[np.argmax(s)]\n\n diff = np.diff(pts, axis=1)\n new[1] = pts[np.argmin(diff)]\n new[3] = pts[np.argmax(diff)]\n\n return new",
"def cw_rotate(self):\n se... | [
"0.65868545",
"0.60531944",
"0.5989526",
"0.5987584",
"0.5890502",
"0.58218336",
"0.57778597",
"0.5774815",
"0.57570964",
"0.5748878",
"0.57414097",
"0.5739227",
"0.57297975",
"0.5608051",
"0.55828094",
"0.55133444",
"0.551298",
"0.55049944",
"0.54843044",
"0.54507524",
"0.54... | 0.62090427 | 1 |
Find the playing card that is the closest to img. | def closest_card(model, img):
features = preprocess(img)
closest_match = sorted(model.values(), key=lambda x: img_compare(x[1], features))[0]
return closest_match[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _closest_front_opponent(self, raw_obs, o, target):\n delta = target - o\n min_d = None\n closest = None\n for p in raw_obs['right_team']:\n delta_opp = p - o\n if np.dot(delta, delta_opp) <= 0:\n continue\n d = self._object_distance(o,... | [
"0.6555011",
"0.62187",
"0.619973",
"0.61479795",
"0.6056538",
"0.60295075",
"0.5943659",
"0.59079975",
"0.5851555",
"0.58372027",
"0.5659895",
"0.56508833",
"0.5606912",
"0.5597794",
"0.55718666",
"0.5522358",
"0.5521956",
"0.55135345",
"0.5499731",
"0.54981595",
"0.5492757"... | 0.7752324 | 0 |
Create circuit definition from netlist file | def __init__(self, netlist_file):
with open(netlist_file, 'r') as f:
self.netlist = _parse_netlist(f)
self.G = _create_graph(self.netlist) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def netlist_to_data(path):\n\n # Open file\n try:\n f = open(path, 'r')\n except FileNotFoundError:\n print(\"ERR: File not found:\", path)\n return None\n\n # Read file\n lines = f.readlines()\n f.close()\n\n # Remove comment portion, and extra leading and trailing space ... | [
"0.6486431",
"0.60701203",
"0.603738",
"0.5973357",
"0.58117294",
"0.57797056",
"0.57046014",
"0.5669546",
"0.5610751",
"0.5566221",
"0.55411917",
"0.5510636",
"0.5489806",
"0.54371524",
"0.5434156",
"0.54064965",
"0.53968734",
"0.5383387",
"0.5373344",
"0.5353973",
"0.534787... | 0.6334496 | 1 |
Construct graph from netlist | def _create_graph(netlist):
G = nx.Graph()
for t in netlist:
G.add_edges_from([(t.name, t.drain), (t.name, t.gate), (t.name, t.source)])
return G | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_graph(lst):\n graph = networkx.Graph()\n for part in lst:\n graph.add_nodes_from(part) # each sublist is a bunch of nodes\n graph.add_edges_from(to_edges(part)) # connect nodes to each other\n return graph",
"def build_graph(self, graph, inst_name, port_nets):\n return",
... | [
"0.7109379",
"0.69437826",
"0.68915105",
"0.66920495",
"0.6622153",
"0.6574675",
"0.6552055",
"0.6395095",
"0.63143444",
"0.630303",
"0.6302468",
"0.62683815",
"0.6257332",
"0.6253556",
"0.6252897",
"0.6252008",
"0.62392086",
"0.6236919",
"0.62107337",
"0.6207032",
"0.6204621... | 0.79401857 | 0 |
Incrementing count for fish_species in fish dict. | def add_fish(self, fish_species):
if isinstance(fish_species, str):
self.fish[fish_species] += 1
else:
print("That doesn't look like a fish!") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def increment_count(dictionary, key):\n if key:\n if key in dictionary:\n dictionary[key] += 1\n else:\n dictionary[key] = 1",
"def inc_feature_count(self, f, cat):\n count = self.feature_count(f, cat)\n if count == 0:\n self.con... | [
"0.63364494",
"0.62608033",
"0.6221433",
"0.61583346",
"0.61583346",
"0.615478",
"0.6033456",
"0.6012159",
"0.58841234",
"0.58684725",
"0.5837238",
"0.57662606",
"0.57595754",
"0.57516134",
"0.573816",
"0.5726502",
"0.5670612",
"0.5655954",
"0.5641604",
"0.5635567",
"0.562045... | 0.78551525 | 0 |
Iterate over and summarize self.fish dictionary. | def generate_fish_report(self):
if len(self.fish) == 0:
print('No fish in here, come back later')
for species, count in self.fish.items():
print(f'{species}: {count}') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iter_sdfdata( self ) :\n\n return self._mol.GetPropsAsDict().iteritems()",
"def __iter__(self):\n key = list(self.keys())[0]\n length = len(self[key])\n for i in range(length):\n res = {}\n for key, feature in self.items():\n res[key] = feature... | [
"0.58494943",
"0.57512933",
"0.57478154",
"0.57263863",
"0.5619567",
"0.55276465",
"0.55168855",
"0.54726183",
"0.54520804",
"0.5434024",
"0.53709376",
"0.53632694",
"0.5362023",
"0.53565586",
"0.5345057",
"0.53156596",
"0.529168",
"0.5279276",
"0.52606505",
"0.52527803",
"0.... | 0.7074745 | 0 |
Iterate over and summarize self.animal dictionary. | def generate_animal_report(self):
print('ANIMALS IN ' + self.name)
for species, count in self.animals.items():
print(f'{species}: {count}') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_animals(self):\n for animal in self.animals:\n print(animal)",
"def animals_by_species(self):\n print self.animal()",
"def animals(self):\n return self.herbivores + self.carnivores",
"def animal(self):\n animals = self.island.individuals()\n herb = 0\n ... | [
"0.6915365",
"0.6877797",
"0.6705645",
"0.6290906",
"0.61083645",
"0.61018795",
"0.5946285",
"0.59339297",
"0.58414525",
"0.57792354",
"0.5756472",
"0.5647639",
"0.5622751",
"0.5525443",
"0.55105793",
"0.5503475",
"0.5496038",
"0.546159",
"0.545389",
"0.54315567",
"0.53777295... | 0.75849897 | 0 |
Iterate over and summarize self.plant dictionary. | def generate_plant_report(self):
print('PLANTS IN ' + self.name)
for species, count in self.plants.items():
print(f'{species}: {count}') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_animal_report(self):\n print('ANIMALS IN ' + self.name)\n for species, count in self.animals.items():\n print(f'{species}: {count}')",
"def summarize(self) -> Mapping[str, int]:\n return dict(\n compounds=self.count_compounds(),\n side_effects=se... | [
"0.5953849",
"0.5711296",
"0.5653238",
"0.558799",
"0.5580781",
"0.5508441",
"0.54803455",
"0.5412917",
"0.5354049",
"0.53201115",
"0.53123766",
"0.5299897",
"0.5291187",
"0.52609557",
"0.52435404",
"0.5237651",
"0.52314264",
"0.52255285",
"0.522146",
"0.52192724",
"0.5216853... | 0.7128834 | 0 |
Returns the projection depth. The projection depth is the depth function associated with the StagelDonoho outlyingness. | def projection_depth(X, *, pointwise=False):
depth = outlyingness_to_depth(_stagel_donoho_outlyingness)
return depth(X, pointwise=pointwise) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetDepth(*args, **kwargs):\n return _gdi_.DC_GetDepth(*args, **kwargs)",
"def get_numberOfProjections(self):\n self._nproj = len(self._projIndices)\n return self._nproj",
"def depth(self):\n return _libsbml.Dimensions_depth(self)",
"def getDepth(self):\n return _libsbml... | [
"0.66428614",
"0.6209724",
"0.61302435",
"0.6081444",
"0.6070327",
"0.6064545",
"0.60572463",
"0.6029095",
"0.6029095",
"0.6005882",
"0.5966574",
"0.59656924",
"0.5949132",
"0.59302497",
"0.5930237",
"0.5930025",
"0.5925941",
"0.59115744",
"0.59115744",
"0.5860159",
"0.585965... | 0.7283464 | 0 |
Rendering portrayal of an agent | def agent_portrayal(agent):
portrayal = {"Shape": "circle",
"Filled": "true"
}
if agent.wealth > 0:
portrayal["Color"] = "red"
portrayal["Layer"] = 0
portrayal["r"] = 0.5
else:
portrayal["Color"] = "grey"
portrayal["Layer"] = 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render(self, **kwargs):\n return print(self.game.agent_positions)",
"def display(self, agent):\n agent.prepare()\n self.env.render()\n while not self.ended():\n self.perform(agent.act(self, verbose=True), render=True, delay=FAST)\n self.update()\n ... | [
"0.63621956",
"0.61775595",
"0.6168622",
"0.5990966",
"0.57531315",
"0.5707764",
"0.5502913",
"0.5495129",
"0.5495129",
"0.5487924",
"0.54149324",
"0.5410106",
"0.5410106",
"0.5377477",
"0.5347054",
"0.5328456",
"0.53034407",
"0.53028643",
"0.52921903",
"0.5290702",
"0.527524... | 0.68932796 | 0 |
Sanitizes and sets the value. | def value(self, new_value):
self._value = self.sanitize(new_value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, value):\n self._value = self.sanitize(value)",
"def sanitize(cls, value):\n return value",
"def clean_value(self, value):\n return value",
"def clean_value(self, inst, value):\n return value",
"def set_val(self, input):\n return",
"def pre_set(self, v... | [
"0.7417627",
"0.7350656",
"0.7032721",
"0.69779694",
"0.680798",
"0.6783767",
"0.67046773",
"0.6676071",
"0.66064733",
"0.65656066",
"0.65656066",
"0.6513395",
"0.6464685",
"0.6426637",
"0.6331257",
"0.62616336",
"0.61893433",
"0.61880094",
"0.6182133",
"0.6169768",
"0.615279... | 0.7779427 | 0 |
Parses and sanitizes the new value string. | def parse_and_set_value(self, new_value_str):
self.value = self.parse(new_value_str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self, new_value):\n self._value = self.sanitize(new_value)",
"def sanitize(cls, value):\n return value",
"def __call__(self, value): # noqa: D102\n if not isinstance(value, str):\n raise ValueError(f\"Input value must be a string. '{value}' is not.\")\n\n raw_v... | [
"0.64144474",
"0.6368017",
"0.623172",
"0.61555076",
"0.61555076",
"0.61195",
"0.6064186",
"0.6043602",
"0.6024725",
"0.6024725",
"0.6023517",
"0.5925067",
"0.5922958",
"0.5919214",
"0.59167534",
"0.58619326",
"0.58619326",
"0.58216035",
"0.5792042",
"0.5762636",
"0.5730663",... | 0.67928267 | 0 |
Returns a sanitized operand value between 21000. Defaults to 10. | def sanitize(cls, value):
return cls._get_value_inside_range(value, cls.MIN_VALUE,
cls.MAX_VALUE, cls.DEFAULT_VALUE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_value(self):\n value = self.cleaned_data[\"value\"]\n m = value[-1].lower()\n if m in self.MULTIPLIERS:\n mp = self.MULTIPLIERS[m]\n value = value[:-1]\n else:\n mp = 1\n try:\n value = int(value)\n except ValueError:\n... | [
"0.5602073",
"0.5378814",
"0.5342493",
"0.52619845",
"0.52566886",
"0.50465155",
"0.5031228",
"0.50075465",
"0.50048363",
"0.5002416",
"0.49891287",
"0.4988533",
"0.4977869",
"0.49416542",
"0.49058115",
"0.48999333",
"0.4899056",
"0.48928025",
"0.4884735",
"0.4859367",
"0.485... | 0.58117086 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.