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 |
|---|---|---|---|---|---|---|
Parse the bibtex into a list of records. | def _parse_records(self, customization=None):
def _add_parsed_record(record, records):
"""
Atomic function to parse a record
and append the result in records
"""
if record != "":
logger.debug('The record is not empty. Let\'s parse it.')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(self, bibtex_str):\n self.bibtex_file_obj = self._bibtex_file_obj(bibtex_str)\n self._parse_records(customization=self.customization)\n return self.bib_database",
"def parse_bib(filename, entry_regex, parse_func):\n\twith open(filename) as f:\n\t\treturn filter(None, (parse_func(it... | [
"0.7069204",
"0.66858053",
"0.6365787",
"0.6218454",
"0.61647767",
"0.6109565",
"0.605119",
"0.60247535",
"0.59034073",
"0.5703395",
"0.56781554",
"0.56023383",
"0.5566754",
"0.55462235",
"0.55357593",
"0.5528895",
"0.5505986",
"0.54787135",
"0.54554504",
"0.5440011",
"0.5430... | 0.72426885 | 0 |
Atomic function to parse a record and append the result in records | def _add_parsed_record(record, records):
if record != "":
logger.debug('The record is not empty. Let\'s parse it.')
parsed = self._parse_record(record, customization=customization)
if parsed:
logger.debug('Store the result of the parsed rec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_record(self, record):\n raise NotImplementedError()",
"def parse_record(dom, record_dict, log):\n return parser(dom, record_dict, log)",
"def _parse_records(self, customization=None):\n def _add_parsed_record(record, records):\n \"\"\"\n Atomic function to parse... | [
"0.6970799",
"0.6505174",
"0.63539755",
"0.62376463",
"0.6231728",
"0.6189907",
"0.6178221",
"0.6087885",
"0.5943535",
"0.59019214",
"0.5897599",
"0.5895698",
"0.5873401",
"0.58263826",
"0.5749148",
"0.57163817",
"0.57113546",
"0.570671",
"0.5662196",
"0.56533664",
"0.5653366... | 0.7449858 | 0 |
Parse a record. tidy whitespace and other rubbish parse out the bibtype and citekey find all the keyvalue pairs it contains | def _parse_record(self, record, customization=None):
d = {}
if not record.startswith('@'):
logger.debug('The record does not start with @. Return empty dict.')
return {}
# if a comment record, add to bib_database.comments
if record.lower().startswith('@comment')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_record(self, record):\n raise NotImplementedError()",
"def parse_record(self, in_rec):\n \n geo_util = geo.Geo()\n \n self.metadata = {}\n for k, v in in_rec.items():\n if k == 'metadata2': continue\n elif k == 'geometry':\n ... | [
"0.6419528",
"0.63260657",
"0.61760867",
"0.6131838",
"0.6122296",
"0.6120553",
"0.5983646",
"0.58799636",
"0.58595246",
"0.5855788",
"0.584823",
"0.58271646",
"0.58078647",
"0.57758385",
"0.57636255",
"0.5644182",
"0.5610186",
"0.5606317",
"0.55948454",
"0.55234295",
"0.5517... | 0.72723114 | 0 |
Strip braces enclosing string | def _strip_braces(self, val):
logger.debug('Strip braces')
val = val.strip()
if val.startswith('{') and val.endswith('}') and self._full_span(val):
return val[1:-1]
return val | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_stray_braces(self, tex):\n num_lefts, num_rights = [\n tex.count(char)\n for char in \"{}\"\n ]\n if num_rights > num_lefts:\n backwards = tex[::-1].replace(\"}\", \"\", num_rights - num_lefts)\n tex = backwards[::-1]\n elif num_lef... | [
"0.7257907",
"0.6704662",
"0.663527",
"0.663437",
"0.65309894",
"0.65099",
"0.6454627",
"0.63949865",
"0.6302393",
"0.6281844",
"0.62191236",
"0.62042516",
"0.6161475",
"0.60913813",
"0.60668725",
"0.6063109",
"0.5937413",
"0.59302425",
"0.58825225",
"0.58386445",
"0.58217025... | 0.76519185 | 0 |
Substitute string definitions inside larger expressions | def _string_subst_partial(self, val):
def repl(m):
k = m.group('id')
replacement = self.bib_database.strings[k.lower()] if k.lower() in self.bib_database.strings else k
pre = '"' if m.group('pre') != '"' else ''
post = '"' if m.group('post') != '"' else ''
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __Subst(self, m, s, l):\n if s is None:\n s = ''\n #if type(s) is types.LongType:\n #1.5.2: s = str(s)[:-1]\n return self.regexp.Subst(l, DTL.TemplateRegExp.macros[m], str(s))",
"def test_evaluate_replace_expression(self):\n value = self.evaluate_common(\"rep... | [
"0.6560497",
"0.6532088",
"0.64842784",
"0.64777434",
"0.62473774",
"0.622621",
"0.622045",
"0.6183432",
"0.6173008",
"0.6143813",
"0.61242",
"0.6123574",
"0.6107318",
"0.6066054",
"0.6050567",
"0.6044567",
"0.6040717",
"0.6009045",
"0.6002451",
"0.59890664",
"0.5989054",
"... | 0.7003312 | 0 |
Sets the access point to communicate with. | def set_access_point(self, value: str) -> None:
self.__requester.set_base_url(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setSetpoint(self, point):\n\n\t\tself._setpoint = point",
"def setPoint(self, point):\n self.point = point",
"def setpointCallback(self,setpoint):\n if not self.setpoint_valid:\n rospy.loginfo(\"First setpoint received.\")\n self.setpoint_valid = True\n self.set_p... | [
"0.6390105",
"0.62136114",
"0.6117438",
"0.5991195",
"0.5894934",
"0.5868396",
"0.5854952",
"0.58540964",
"0.58540964",
"0.58540964",
"0.5821169",
"0.5821169",
"0.580778",
"0.58021396",
"0.5796809",
"0.579131",
"0.57864845",
"0.5778461",
"0.57453096",
"0.5659611",
"0.5646041"... | 0.68554735 | 0 |
Provides the list of broadcasts of the current user. | def get_broadcasts(
self, *, params: Optional[dict] = None
) -> "resource_types.Broadcasts":
return communicator.Broadcasts(self.__requester).fetch(parameters=params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list( self, mess, args):\n user = self.get_sender_username(mess)\n args = args.replace(' ', '_')\n if user in self.users:\n user_list = 'All these users are subscribed - \\n'\n user_list += '\\n'.join(['%s :: %s' %(u, self.users[u]) for u in sorted(self.users)])\n ... | [
"0.60016054",
"0.5881634",
"0.5803563",
"0.57533914",
"0.5750388",
"0.57274336",
"0.56940734",
"0.5687119",
"0.56761175",
"0.564202",
"0.5639454",
"0.56097776",
"0.56062895",
"0.55889046",
"0.5585895",
"0.5524598",
"0.55238736",
"0.55003995",
"0.5479891",
"0.5464656",
"0.5459... | 0.6519794 | 0 |
Provides a cron from its given ID. | def get_cron(
self, cron_id: Union[str, int], *, params: Optional[dict] = None
) -> "resource_types.Cron":
return communicator.Cron(self.__requester).from_id(
cron_id=cron_id, parameters=params
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cron_id(self, cr, uid, context):\n cron_obj = self.pool.get('ir.cron')\n # find the cron that send messages\n cron_id = cron_obj.search(cr, uid, [('function', 'ilike', self.cron['function']),\n ('model', 'ilike', self.cron['model'])],\n ... | [
"0.65078187",
"0.6431072",
"0.6326919",
"0.6021894",
"0.600872",
"0.5984055",
"0.58517635",
"0.5767667",
"0.5746677",
"0.5657153",
"0.55429775",
"0.5541055",
"0.5533714",
"0.55243057",
"0.55132204",
"0.5493868",
"0.5479761",
"0.54725164",
"0.54444087",
"0.5411881",
"0.5393716... | 0.8255051 | 0 |
Provides a job from its given ID. | def get_job(
self, job_id: Union[str, int], *, params: Optional[dict] = None
) -> "resource_types.Job":
return communicator.Job(self.__requester).from_id(
job_id=job_id, parameters=params
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_job(self, _id):\n data = {\n 'class': 'Job',\n 'id': _id,\n 'attrs': {},\n }\n job = self.db_client.send_request('list', json.dumps(data))\n\n return Job(\n _id=job['id'],\n _type=job['type'],\n task=job['task'],\... | [
"0.8370322",
"0.81394696",
"0.78803784",
"0.77068985",
"0.76749647",
"0.76451606",
"0.75760686",
"0.75058204",
"0.74840623",
"0.7439674",
"0.7318414",
"0.7263681",
"0.7233894",
"0.71796244",
"0.7149467",
"0.71003586",
"0.70752484",
"0.7072272",
"0.7063138",
"0.70405346",
"0.6... | 0.8248076 | 1 |
Lints the given subject. | def lint(self, subject: Union[TextIOWrapper, bytes, str]) -> "resource_types.Lint":
if isinstance(subject, TextIOWrapper):
data = subject.read()
elif isinstance(subject, (str, bytes)):
data = subject
else:
raise TypeError(
f"<subject> must be ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_subject(self, new_subject):\n raise NotImplementedError",
"def lint(self, vartok, linted_entry):\n raise NotImplemented",
"def update(self, subject: Subject) -> None:\n pass",
"def update(self, subject: Subject) -> None:\n pass",
"def lint(ctx):\r\n print('Running ... | [
"0.54728234",
"0.5425725",
"0.54179674",
"0.54179674",
"0.540823",
"0.53795105",
"0.5342376",
"0.5280446",
"0.52239424",
"0.52239424",
"0.51792663",
"0.51792663",
"0.51792663",
"0.5109144",
"0.5057882",
"0.5050363",
"0.5030301",
"0.5018952",
"0.5015047",
"0.49664378",
"0.4952... | 0.7200309 | 0 |
Provides an organization from its given ID. | def get_organization(
self, organization_id: Union[str, int], *, params: Optional[dict] = None
) -> "resource_types.Organization":
return communicator.Organization(self.__requester).from_id(
organization_id=organization_id, parameters=params
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_organization(self, id: str) -> dict[str, Any]:\n params = {}\n\n return self.client.get(self._url(id), params=params)",
"def organization(self, organization_id):\r\n return organizations.Organization(self, organization_id)",
"def find_organization(self):\n if self.org_id is ... | [
"0.7779527",
"0.7667834",
"0.72960305",
"0.7177982",
"0.6943155",
"0.6880863",
"0.6874825",
"0.6787914",
"0.6783364",
"0.6768005",
"0.6724089",
"0.67040336",
"0.6621863",
"0.65592504",
"0.653614",
"0.6531504",
"0.64872956",
"0.64778906",
"0.6453674",
"0.64502835",
"0.6436561"... | 0.79455 | 0 |
Provides the list of repositories of the given GitHub ID. | def get_repositories_from_github_id(
self, github_id: Union[str, int], *, params: Optional[dict] = None
) -> "resource_types.Repositories":
return communicator.Repositories(self.__requester).from_github_id(
github_id=int(github_id), parameters=params
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_repos(github_id):\r\n\r\n url = 'https://api.github.com/users/{}/repos'.format(github_id)\r\n response = requests.get(url)\r\n todos = json.loads(response.text)\r\n\r\n repo_list = []\r\n \r\n for data in todos:\r\n repo_list.append(data['name'])\r\n\r\n return repo_list",
"de... | [
"0.81455076",
"0.71791214",
"0.68482614",
"0.67864573",
"0.678607",
"0.67319983",
"0.6728848",
"0.6713311",
"0.67027485",
"0.66266894",
"0.6548572",
"0.65197384",
"0.6504157",
"0.65015703",
"0.64248604",
"0.6378858",
"0.6378281",
"0.6359549",
"0.6292143",
"0.62408435",
"0.617... | 0.7886239 | 1 |
Provides the list of repositories for the given login in the given provider. | def get_repositories_from_login(
self, login: str, *, provider: str = "github", params: Optional[dict] = None
) -> "resource_types.Repositories":
return communicator.Repositories(self.__requester).from_login(
login=login, provider=provider, parameters=params
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repositories(self, user_name=None):\n user_name = user_name if user_name else self._auth[0]\n data = self._request('GET', 'users', user_name)\n return data.repositories\n #ret_val = []\n #for repository in data.repositories:\n # ret_val.append(repository.name)\n ... | [
"0.66285455",
"0.6528908",
"0.6485047",
"0.64401954",
"0.6372433",
"0.63584465",
"0.6312798",
"0.62660974",
"0.62343997",
"0.6229013",
"0.61398834",
"0.6103985",
"0.6090164",
"0.60706437",
"0.59627527",
"0.59548646",
"0.5917306",
"0.5913785",
"0.5908407",
"0.5907842",
"0.5902... | 0.83227384 | 0 |
Provides the repository from its given provider, ID or slug. | def get_repository_from_provider(
self,
provider: str,
repository_id_or_slug: Union[str, int],
*,
params: Optional[dict] = None,
) -> "resource_types.Repository":
return communicator.Repository(self.__requester).from_provider(
provider=provider,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_repository(\n self, repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None\n ) -> \"resource_types.Repository\":\n\n return communicator.Repository(self.__requester).from_id_or_slug(\n repository_id_or_slug=repository_id_or_slug, parameters=params\n )",
... | [
"0.71772826",
"0.63128215",
"0.62667835",
"0.6212255",
"0.6113477",
"0.60990375",
"0.58293307",
"0.58286536",
"0.5804322",
"0.5787218",
"0.5753442",
"0.56915164",
"0.5691488",
"0.56619483",
"0.5660118",
"0.5628283",
"0.56201863",
"0.5602806",
"0.557673",
"0.5561464",
"0.55591... | 0.79773 | 0 |
Provides the repository from its given ID or slug. | def get_repository(
self, repository_id_or_slug: Union[str, int], *, params: Optional[dict] = None
) -> "resource_types.Repository":
return communicator.Repository(self.__requester).from_id_or_slug(
repository_id_or_slug=repository_id_or_slug, parameters=params
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_repo(repo_id):\n if repo_id == \"orphans\":\n pkgs = Database().db.get_orphans()\n else:\n pkgs = Database().db.get_repo_pkgs(repo_id)\n return render_template(\"repo.html\", \n title=\" - \"+repo_id,\n repos=Database().db.get_repos_names... | [
"0.6880181",
"0.66226876",
"0.64765483",
"0.6360771",
"0.6302806",
"0.626461",
"0.62416524",
"0.6215325",
"0.6213524",
"0.6175658",
"0.60762954",
"0.604203",
"0.6022187",
"0.59854496",
"0.5957842",
"0.59500873",
"0.5933728",
"0.59310895",
"0.59252787",
"0.58837426",
"0.586411... | 0.77257586 | 0 |
Take a gaussian shell and confirm its power spectrum using shell_project_pspec. | def compare_averages_shell_pspec_dft():
select_radius = 5. #degrees
Nside=256
Npix = 12 * Nside**2
Omega = 4*np.pi/float(Npix)
Nfreq = 100
freqs = np.linspace(167.0, 177.0, Nfreq)
dnu = np.diff(freqs)[0]
Z = 1420/freqs - 1.
sig = 2.0
mu = 0.0
shell = np.random.normal(mu, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def womgau(hop):\n import numpy as np\n import logging\n import matplotlib.pyplot as plt\n from scipy.optimize import curve_fit\n from tmath.wombat.womwaverange import womwaverange\n from tmath.wombat.womget_element import womget_element\n from tmath.wombat.inputter import inputter\n from t... | [
"0.54461145",
"0.5179965",
"0.50951344",
"0.493999",
"0.4939673",
"0.4889197",
"0.48608387",
"0.48537308",
"0.48335385",
"0.48286435",
"0.4800673",
"0.4798589",
"0.47939384",
"0.47843185",
"0.47838107",
"0.47736582",
"0.47597453",
"0.47463492",
"0.47239593",
"0.47009686",
"0.... | 0.60930073 | 0 |
Adds arena model to the MJCF model. | def merge_arena(self, mujoco_arena):
self.arena = mujoco_arena
self.bin_offset = mujoco_arena.bin_abs
self.bin_size = mujoco_arena.table_full_size
self.bin2_body = mujoco_arena.bin2_body
self.merge(mujoco_arena) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append(self,aModel):\n\n self.models.append(aModel)\n self.nmodes += len(aModel.modes)",
"def _attach_to_model(self, model):\n self._model = model",
"def add_ae(self, model, dataset, latent_options, model_paths, pre_process=None):\n ae = autoencoder(self.app, model, dataset, lat... | [
"0.56313676",
"0.49615818",
"0.49567008",
"0.4920569",
"0.4859373",
"0.48569682",
"0.48476598",
"0.4833981",
"0.47855198",
"0.47855198",
"0.47557554",
"0.4750223",
"0.47291082",
"0.47220296",
"0.46787572",
"0.46525794",
"0.4638592",
"0.46205002",
"0.4614683",
"0.46135435",
"0... | 0.560865 | 1 |
Adds visual objects to the MJCF model. | def merge_visual(self, mujoco_objects):
self.visual_obj_mjcf = []
for obj_name, obj_mjcf in mujoco_objects.items():
self.merge_asset(obj_mjcf)
# Load object
obj = obj_mjcf.get_visual(name=obj_name, site=False)
self.visual_obj_mjcf.append(obj)
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addObjects(self):\n\n self.root = self.addRoot()\n vTemp = transform.getOffsetPosition(self.root, [0, 1, 0])\n self.top_loc = self.addLoc(\"top\", self.root, vTemp)\n centers = [self.root, self.top_loc]\n self.dispcrv = self.addDispCurve(\"crv\", centers)\n\n vTemp = t... | [
"0.64129865",
"0.6372637",
"0.625703",
"0.6190473",
"0.6069831",
"0.6058175",
"0.60520357",
"0.6046985",
"0.5969594",
"0.59651613",
"0.5939097",
"0.5872474",
"0.58611226",
"0.5806287",
"0.57963556",
"0.5793267",
"0.5742596",
"0.57081103",
"0.5706335",
"0.57024294",
"0.5668408... | 0.7002316 | 0 |
Samples quaternions of random rotations along the zaxis. | def sample_quat(self):
if self.z_rotation:
rot_angle = np.random.uniform(high=2 * np.pi, low=0)
return [np.cos(rot_angle / 2), 0, 0, np.sin(rot_angle / 2)]
return [1, 0, 0, 0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_quaternions(count=100):\n rands = np.random.rand(count,3)\n root_1 = np.sqrt(rands[:,0])\n minus_root_1 = np.sqrt(1-rands[:,0])\n two_pi_2 = np.pi*2*rands[:,1]\n two_pi_3 = np.pi*2*rands[:,2]\n \n res = np.zeros((count,4))\n res[:,0] = minus_root_1*np.sin(two_pi_2)\n res[:,1] ... | [
"0.7073986",
"0.68722045",
"0.6529664",
"0.6503195",
"0.6345796",
"0.6336485",
"0.6277915",
"0.61840326",
"0.61288977",
"0.60825557",
"0.6078604",
"0.60223764",
"0.60217965",
"0.60030395",
"0.6001181",
"0.5951943",
"0.59054774",
"0.58579105",
"0.58181906",
"0.57951933",
"0.57... | 0.7299934 | 0 |
Places objects randomly until no collisions or max iterations hit. | def place_objects(self):
placed_objects = []
index = 0
np.random.seed(300)
# place objects by rejection sampling
for _, obj_mjcf in self.mujoco_objects.items():
horizontal_radius = obj_mjcf.get_horizontal_radius()
bottom_offset = obj_mjcf.get_bottom_offset... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spawn_obstacles(self):\n self.obstacle_sprites.empty()\n number_of_obstacles = random.randint(MIN_OBSTACLES, MAX_OBSTACLES)\n while len(self.obstacle_sprites) < number_of_obstacles:\n obstacle = Obstacle(random.randrange(0, WIDTH), random.randrange(HEIGHT - 500, HEIGHT))\n ... | [
"0.6649374",
"0.6615201",
"0.64481175",
"0.6212739",
"0.6065585",
"0.6065585",
"0.6060398",
"0.6040957",
"0.6012398",
"0.6007238",
"0.5996292",
"0.59452283",
"0.5914823",
"0.59141505",
"0.5879403",
"0.5825326",
"0.58152974",
"0.57988673",
"0.57517725",
"0.5739899",
"0.5738482... | 0.69110835 | 0 |
Apply a patterning operator on a mesh through general transformation. | def patterning(mesh, operator):
operators = {
'conway_dual': conway_dual,
'conway_join': conway_join,
'conway_ambo': conway_ambo,
'conway_kis': conway_kis,
'conway_needle': conway_needle,
'conway_zip': conway_zip,
'conway_truncate': conway_truncate,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transform_mesh_filter(*args, **kwargs):\n import itk\n instance = itk.TransformMeshFilter.New(*args, **kwargs)\n return instance.__internal_call__()",
"def manifold_and_triangulate():\n # Switch in edit mode \n bpy.ops.object.mode_set(mode='EDIT')\n\n # Deselect everything\n ... | [
"0.5618558",
"0.5414091",
"0.5391252",
"0.538712",
"0.53303236",
"0.5186021",
"0.5045422",
"0.50429285",
"0.5039544",
"0.5029276",
"0.5006718",
"0.49956977",
"0.4982048",
"0.49593455",
"0.49355075",
"0.49018618",
"0.48980793",
"0.48942378",
"0.48899797",
"0.48395935",
"0.4818... | 0.7581529 | 0 |
>>> _map_dtype(np.dtype(np.int32)) int32 >>> _map_dtype(np.dtype(np.int64)) int64 >>> _map_dtype(np.dtype(np.object)) PyObject >>> _map_dtype(np.dtype(np.float64)) double >>> _map_dtype(np.dtype(np.complex128)) complex128 | def map_dtype(dtype):
item_idx = int(math.log(dtype.itemsize, 2))
if dtype.kind == 'i':
return [int8, int16, int32, int64][item_idx]
elif dtype.kind == 'u':
return [uint8, uint16, uint32, uint64][item_idx]
elif dtype.kind == 'f':
if dtype.itemsize == 2:
pass # half fl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _map_data_types(dtype):\n return _data_type_map[dtype]",
"def datatype_map(dtype):\n # TODO: add datetype conversion\n if 'float' in dtype:\n return 'numeric'\n elif 'int' in dtype:\n return 'int'\n elif 'bool' in dtype:\n return 'boolean'\n else:\n return 'text'... | [
"0.80567575",
"0.7175208",
"0.7003725",
"0.6944843",
"0.69013226",
"0.6860262",
"0.683389",
"0.68223584",
"0.6821523",
"0.68193454",
"0.6785528",
"0.6780237",
"0.6765619",
"0.67386276",
"0.6680076",
"0.66334206",
"0.6630267",
"0.6590078",
"0.65894043",
"0.65669954",
"0.653415... | 0.8565042 | 0 |
Transpose iload and istore. Must be fix in a future version. | def fix_iload(self):
# Fixme : store in a good way and in the right type istore and iload
for i in range(len(self.iload)):
self.iload[i] = np.ascontiguousarray(self.iload[i].T, dtype=np.int32)
self.istore = np.ascontiguousarray(self.istore.T, dtype=np.int32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transpose():",
"def transpose_load_concat(self, **kwargs):\n if self.mask_train:\n datamask=self.add_mask()\n thedatas={}\n for key, value in kwargs.items():\n if not self.mask_train:\n thedatas[key]=value.X_train.transpose('a','x','y','features').val... | [
"0.5811776",
"0.57074726",
"0.5681151",
"0.5640245",
"0.55777746",
"0.5351398",
"0.5351398",
"0.52928823",
"0.5287192",
"0.5227838",
"0.52135694",
"0.5213067",
"0.5190803",
"0.5118121",
"0.5108729",
"0.5093582",
"0.5092675",
"0.50697315",
"0.50460935",
"0.50371075",
"0.500618... | 0.684812 | 0 |
Move arrays needed to compute the boundary on the GPU memory. | def move2gpu(self):
if self.generator.backend.upper() == "LOOPY":
try:
import pyopencl as cl
import pyopencl.array # pylint: disable=unused-variable
from .context import queue
except ImportError:
raise ImportError("Please i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _data_move_out_last_dim_lt_one_block(tik_inst, dst, src, data_pos_info):\n sub_axis_1, sub_axis_0, axis_0, axis_1, axis_2, out_offset = data_pos_info\n data_size_one_block = _get_elment_cnt_one_block(src.dtype)\n\n with tik_inst.if_scope(sub_axis_1 == 1):\n with tik_inst.if_scope(sub_axis_0 * a... | [
"0.5812451",
"0.5725411",
"0.5472441",
"0.545434",
"0.54450196",
"0.54422855",
"0.5420267",
"0.53995526",
"0.5396849",
"0.53827024",
"0.5343788",
"0.53435355",
"0.5315347",
"0.5311603",
"0.52795476",
"0.52631",
"0.5237792",
"0.52351785",
"0.5228774",
"0.5220994",
"0.5220994",... | 0.6041597 | 0 |
r"""Resolves entire configuration. Default configuration is considered, then user config files, provided config files, then finally passed config arguments. | def resolve_config(*extra_paths, **extra_values):
config = CONFIG_DEFAULTS.copy()
def config_update(overrides, name):
for key in overrides:
if key not in config:
warnings.warn('{}: {} is not a known config key.'.format(name, key))
config[key] = overrides[key]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _resolve_config(self, config):\n if not isinstance(config, dict):\n config = self._default_config()\n return config",
"def load_config(self) -> Dict[str, Any]:\n config: Dict[str, Any] = {}\n # Now expecting a list of config filenames here, not a string\n for pat... | [
"0.6498011",
"0.64587957",
"0.62858284",
"0.6279721",
"0.62635815",
"0.6102991",
"0.6069409",
"0.6047892",
"0.60432506",
"0.6021356",
"0.6005486",
"0.59953827",
"0.5946184",
"0.5941089",
"0.5912244",
"0.5900707",
"0.5878806",
"0.5842799",
"0.5840996",
"0.5836247",
"0.5829575"... | 0.70140094 | 0 |
Pull NodeCache if exists. | def get(node, user_id):
key = NodeCache.generate_key(node, user_id)
db_node_cache = get_db_connector().node_cache.find({
'key': key
}).sort('insertion_date', -1).limit(1)
caches = list(db_node_cache)
if len(caches):
return NodeCache.from_dict(caches[0])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_cache(self):\n self.cache = self.cache_manager.retrieve(self.cache_file)\n if self.cache is None:\n self.cache = {}\n return",
"def _load_cached_2to3(self, path, cache):\n try:\n cache_stats = os.stat(cache)\n source_stats = os.stat(path)\n ... | [
"0.6121026",
"0.59856486",
"0.5910669",
"0.5750262",
"0.57146484",
"0.56627846",
"0.5606585",
"0.5604088",
"0.55504864",
"0.5481873",
"0.54798347",
"0.5463995",
"0.5438124",
"0.5437523",
"0.53708214",
"0.5364955",
"0.5353713",
"0.5343688",
"0.5336209",
"0.533589",
"0.53285617... | 0.6415925 | 0 |
Calculate the observation type. Returns | def to_observation_type(self) -> str:
obstype = self._header["OBSTYPE"].strip().lower()
self._used_these_cards("OBSTYPE")
if obstype == "object":
return "science"
return obstype | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_observable_type(stix_obj, log):\n obj_type = stix_obj[u\"type\"]\n if obj_type == u\"observed-data\":\n #\n # so far all the observed-data has only one embedded obj\n # if there is more, log the error\n #\n if len(stix_obj[u\"objects\"]) > 1:\n log.error(... | [
"0.66169405",
"0.64891094",
"0.64274853",
"0.6351231",
"0.6296011",
"0.61994237",
"0.6138123",
"0.6083615",
"0.6046102",
"0.6029901",
"0.60277057",
"0.5989911",
"0.5984898",
"0.59832656",
"0.5979783",
"0.5970944",
"0.5955888",
"0.5955225",
"0.5955225",
"0.5955225",
"0.5955225... | 0.728079 | 0 |
Calculate the tracking RA/Dec for this observation. Currently will be `None` for geocentric apparent coordinates. Additionally, can be `None` for nonscience observations. The method supports multiple versions of header defining tracking coordinates. Returns | def to_tracking_radec(self) -> astropy.coordinates.SkyCoord:
radecsys = ("RADECSYS", "OBJRADEC", "RADESYS")
radecpairs = (("RA_DEG", "DEC_DEG"), ("BORE-RA", "BORE-DEC"))
return tracking_from_degree_headers(self, radecsys, radecpairs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RA(self):\n return self.meta[\"header\"][\"OBJRA\"] * u.deg",
"def return_obs_RA_DEC():\n return SkyCoord('03h 32m 30s', '10d 00m 24s')",
"def getRA(self):\n return self._ra",
"def HPX_to_RAdec(x, y):\n H, K = 4.0, 3.0\n\n x = np.asarray(x, dtype=float)\n y = np.asarray(... | [
"0.6152304",
"0.60437566",
"0.5742204",
"0.5725708",
"0.56936455",
"0.5681648",
"0.51205707",
"0.49732873",
"0.4904347",
"0.48990023",
"0.48894563",
"0.48686522",
"0.4707128",
"0.46855146",
"0.46848586",
"0.46764827",
"0.4664009",
"0.46571857",
"0.46543646",
"0.4647539",
"0.4... | 0.67462915 | 0 |
Given a file return all the headers usable for metadata translation. MegaPrime files are multiextension FITS with a primary header and each detector stored in a subsequent extension. MegaPrime uses ``INHERIT=F`` therefore the primary header will always be ignored if given. | def determine_translatable_headers(
cls, filename: str, primary: MutableMapping[str, Any] | None = None
) -> Iterator[MutableMapping[str, Any]]:
# Since we want to scan many HDUs we use astropy directly to keep
# the file open rather than continually opening and closing it
# as we go... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetHeaders(the_file):\n\n data = exifread.process_file(the_file, 'UNDEF', False, False, False)\n return data",
"def fasta_headers(file_name):\n list = []\n with open('../test_files/' + file_name, 'r') as infile:\n text = infile.read()\n seqs = text.split('>')\n for seq in seqs:\n... | [
"0.64697254",
"0.6201088",
"0.6176116",
"0.6075826",
"0.60159796",
"0.59766966",
"0.59314",
"0.59232485",
"0.59153116",
"0.58796847",
"0.58565104",
"0.58057576",
"0.5794512",
"0.5752048",
"0.5713318",
"0.56249666",
"0.56110704",
"0.5596501",
"0.557292",
"0.54877764",
"0.54809... | 0.64367986 | 1 |
List all links in the project | def get_all_links(self):
links_url = "{}/links".format(self._project_url)
print(links_url)
response = requests.get(links_url).json()
return json.dumps(response, indent=4, sort_keys=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def links(self):\n\t\treturn self.list_of_links",
"def printLinks(self):\n self.browsed.sort()\n sys.stderr.write(\"\\n+ \" + _(\"URLs\") + \":\\n\")\n for lien in self.browsed:\n print(lien)",
"def links(self):\r\n return links.RepoLinks(self)",
"def get_links(self):\r... | [
"0.72448164",
"0.7127947",
"0.7005859",
"0.6930346",
"0.692595",
"0.68612486",
"0.6828732",
"0.6812377",
"0.6811093",
"0.6811093",
"0.6811093",
"0.6811093",
"0.6811093",
"0.6745569",
"0.6730515",
"0.6711342",
"0.67069626",
"0.67050976",
"0.670227",
"0.6687805",
"0.6677528",
... | 0.75768363 | 0 |
Implement the scoring function f(x) = sum_i(alpha_i y_i K(x,i)) + bias | def score(self,x,**kwargs):
if self.kfun != 'matrix' and len(self.sv):
k = self.kfun(x,self.sv,**self.cparam)
#print "Kernel after test: ", k
else:
k = x
self.W=self.alphas
self.mat=self.kfun(np.array([self.sv[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def styblinskitankfcn(x: np.ndarray) -> np.ndarray:\n n = x.shape[1]\n scores = np.zeros((x.shape[0], 1))\n for i in range(n):\n scores += x[:, i] ** 4 - 16 * x[:, i] ** 2 + 5 * x[:, i]\n scores *= 0.5\n return scores",
"def scoring_function(self, model, y_true, y_predicted_probability):",
... | [
"0.6468498",
"0.61566097",
"0.60578686",
"0.5926083",
"0.5919361",
"0.5893746",
"0.5879596",
"0.58700013",
"0.5853421",
"0.5834475",
"0.58336174",
"0.5812198",
"0.5805834",
"0.57955706",
"0.57926136",
"0.57702035",
"0.5765969",
"0.57617205",
"0.57508886",
"0.57369584",
"0.573... | 0.69548315 | 0 |
Crop a video of the given size (WIDTH, HEIGHT) into a square of `desired_size`. The video is represented as a numpy array. This func is for internal usage. | def _crop_video(numpy_video, size, desired_size):
w, h = size
h1, h2 = int(h/2) - int(desired_size/2), int(h/2) + int(desired_size/2)
w1, w2 = int(w/2) - int(desired_size/2), int(w/2) + int(desired_size/2)
return numpy_video[:, :, h1:h2, w1:w2, :] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def crop_and_resize(vid, width, height, x_min, y_min, directory,\n resize_factor):\n crop_vid = os.path.join(directory, 'cropped_out.avi')\n subprocess.Popen(\n 'ffmpeg -y -loglevel quiet -i {0} -filter:v \\\"crop={1}:{2}:{3}:{4}\\\" {5}'\n .format(vid, str(width), str(height... | [
"0.6074319",
"0.56007594",
"0.55620074",
"0.55547833",
"0.53312635",
"0.5329719",
"0.5294548",
"0.5239872",
"0.5238843",
"0.52298117",
"0.52113825",
"0.5209516",
"0.5204125",
"0.5185886",
"0.51787823",
"0.51729",
"0.5156315",
"0.5144023",
"0.5129708",
"0.5110928",
"0.5097703"... | 0.83973205 | 0 |
Visualize a video using a numpy array (for internal use only). | def _visualize_numpy_video(vid):
plt.axis('off')
num_frames = vid.shape[0]
img = plt.imshow(vid[0])
for i in range(1, num_frames):
img.set_data(vid[i])
plt.pause(1.0 / 25.0)
plt.show() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showVideo( oVideo, oPathXY=np.array([]) ):\n global oVideo_t, iFrame, oPathXY_t\n fig = plt.figure()\n # prikazi prvi okvir\n iFrame = 0\n oPathXY_t = oPathXY\n oVideo_t = oVideo\n print(oVideo.shape)\n im = plt.imshow(oVideo[...,iFrame], cmap=plt.get_cmap('Greys_r'))\n # definiraj f... | [
"0.756542",
"0.71407396",
"0.7048194",
"0.7017642",
"0.6830886",
"0.661151",
"0.64237404",
"0.6364081",
"0.63296354",
"0.6325997",
"0.6291472",
"0.61893433",
"0.6187093",
"0.6118175",
"0.6098164",
"0.6093167",
"0.6078946",
"0.60628855",
"0.6008242",
"0.60027534",
"0.59708107"... | 0.8626106 | 0 |
Loads a numpy array of shape (1, nframes, size, size, 3) from a video file. Values contained in the array are based on RGB values of each frame in the video. Parameter `size` should be an int (pixels) for a square cropping of the video. Omitting the parameter `nframes` will preserve the original frames in the video. | def rgb_data(video_file, size, nframes=None):
# Load video into numpy array
w, h, buf = _raw_numpy_array(video_file, nframes=nframes)
# Scale pixels between -1 and 1
buf[0, :] = ((buf[0, :] / 255.0) * 2) - 1
# Select center crop from the video
return _crop_video(buf, (w, h), size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_video(video_path, dim):\n videogen = skvideo.io.vreader(video_path)\n vid_data = []\n for frame in videogen:\n try:\n vid_data.append(scipy.misc.imresize(frame, dim))\n except:\n print len(vid_data)\n return np.array(vid_data)",
"def load_video(filename: s... | [
"0.68406385",
"0.67937136",
"0.66056126",
"0.65069604",
"0.6457708",
"0.6422088",
"0.63528466",
"0.63330585",
"0.61910963",
"0.5972355",
"0.5883193",
"0.58626884",
"0.5773371",
"0.5771519",
"0.5689951",
"0.56468654",
"0.56292546",
"0.56072694",
"0.5564286",
"0.54883504",
"0.5... | 0.77574 | 0 |
Extracts values from ValueProviders in `self.filters` if available | def _set_runtime_filters(self):
runtime_filters = []
if not all(len(filter_tuple) == 3 for filter_tuple in self.filters):
raise TypeError(
'%s: filters must be a sequence of tuple with length=3'
' got %r instead' % (self.__class__.__name__, self.filters))
for filter_type, filter_o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_filter_values(self):\n return [f.get() for f in self._filters[:-1]] # Ignore placeholder",
"def get_filters(self):",
"def process_filters(self, filters, queryset, view):\n return filters",
"def extract_filters(self):\n self.filters = self.controller.filters\n\n self.extrac... | [
"0.7105667",
"0.6461854",
"0.6332564",
"0.60792077",
"0.59691113",
"0.5931409",
"0.59293675",
"0.590561",
"0.5871995",
"0.58066356",
"0.5691573",
"0.5628792",
"0.5584619",
"0.55597806",
"0.5517137",
"0.55140996",
"0.54688454",
"0.5450579",
"0.5445063",
"0.53775924",
"0.534790... | 0.64968956 | 1 |
Sets a dictionary of properties on this entity. | def set_properties(self, property_dict):
self.properties.update(property_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set(self, property_dict):\r\n self.metadata = self.db.update(self.path, property_dict).json()",
"def set(self, properties):\n raise NotImplementedError",
"def properties_set(self, properties):\n self._put('properties', properties)",
"def set_properties(self, dict_properties):\n ... | [
"0.76723605",
"0.7404447",
"0.73291624",
"0.7090898",
"0.70428354",
"0.70428354",
"0.70428354",
"0.6985428",
"0.6710031",
"0.65371776",
"0.645725",
"0.63292986",
"0.6297637",
"0.6284716",
"0.6273541",
"0.62046885",
"0.62035704",
"0.61631674",
"0.6111",
"0.608803",
"0.608193",... | 0.79283345 | 0 |
Checks that the point with coordinates (x,y) is in the circle | def in_circle(x0, y0, x, y, r):
return ((x - x0) ** 2 + (y - y0) ** 2) <= (r ** 2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def point_inside_circle(x,y,center_x,center_y,radius):\n return (x-center_x)**2 + (y - center_y)**2 < radius**2",
"def isInCircle(self,x1,y1,radius1):\r\n if(distance(self.x,x1,self.y,y1) < (self.radius+radius1)):\r\n return True\r\n return False",
"def incircle(self,xpos,ypos,cellx,c... | [
"0.8734677",
"0.80806553",
"0.78531134",
"0.7849779",
"0.7158603",
"0.715088",
"0.7138565",
"0.70862067",
"0.70382285",
"0.6946563",
"0.69300437",
"0.69216365",
"0.69207144",
"0.68986845",
"0.6887953",
"0.68514484",
"0.6827371",
"0.6806171",
"0.6805743",
"0.6798786",
"0.67756... | 0.8366937 | 1 |
Test case for error_html_using_delete | def test_error_html_using_delete(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_put(self):\n pass",
"def test_error_html_using_post(self):\n pass",
"def test_error_html_using_patch(self):\n pass",
"def test_error_html_using_get(self):\n pass",
"def test_error_html_using_options(self):\n pass",
"def test_delete_post():\n\n ... | [
"0.7278657",
"0.7069914",
"0.69303477",
"0.6870161",
"0.6463486",
"0.6150458",
"0.6126175",
"0.61078084",
"0.6080546",
"0.6039261",
"0.6021578",
"0.60036695",
"0.5989664",
"0.5977707",
"0.59694934",
"0.5962308",
"0.59519184",
"0.59377635",
"0.5891771",
"0.5889499",
"0.5887225... | 0.95066696 | 0 |
Test case for error_html_using_get | def test_error_html_using_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_patch(self):\n pass",
"def test_error_html_using_post(self):\n pass",
"def test_error_html_using_put(self):\n pass",
"def test_get_problem_html_error(self):\r\n module = CapaFactory.create()\r\n\r\n # Save the original problem so we can compare it ... | [
"0.7697234",
"0.7504153",
"0.74957925",
"0.7332781",
"0.71363693",
"0.7089275",
"0.7067181",
"0.69840574",
"0.6769371",
"0.67563546",
"0.6712107",
"0.6469689",
"0.64100075",
"0.64066476",
"0.63574064",
"0.63481134",
"0.6300668",
"0.6237894",
"0.6226963",
"0.6190221",
"0.61674... | 0.9272072 | 0 |
Test case for error_html_using_head | def test_error_html_using_head(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_get(self):\n pass",
"def test_error_html_using_patch(self):\n pass",
"def test_error_html_using_options(self):\n pass",
"def test_error_html_using_put(self):\n pass",
"def test_error_html_using_post(self):\n pass",
"def test_has_error(html, exp... | [
"0.74806994",
"0.7465991",
"0.7129228",
"0.70243967",
"0.69916594",
"0.68119806",
"0.6601287",
"0.65652394",
"0.6281651",
"0.6214971",
"0.61731815",
"0.6147022",
"0.6142926",
"0.6136091",
"0.6084098",
"0.605351",
"0.6050884",
"0.59696764",
"0.5949795",
"0.5942209",
"0.5933057... | 0.9496327 | 0 |
Test case for error_html_using_options | def test_error_html_using_options(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_patch(self):\n pass",
"def test_error_html_using_get(self):\n pass",
"def test_error_html_using_post(self):\n pass",
"def test_error_html_using_head(self):\n pass",
"def test_error_html_using_put(self):\n pass",
"def html_error(string):\n re... | [
"0.7889996",
"0.7275652",
"0.7154944",
"0.70120835",
"0.693769",
"0.6798768",
"0.66905034",
"0.6673123",
"0.6662393",
"0.6308913",
"0.6205391",
"0.61972505",
"0.6189794",
"0.61593807",
"0.61521614",
"0.6100148",
"0.5991863",
"0.58674526",
"0.58648616",
"0.5850992",
"0.5848954... | 0.95218 | 0 |
Test case for error_html_using_patch | def test_error_html_using_patch(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_options(self):\n pass",
"def test_error_html_using_get(self):\n pass",
"def test_error_html_using_post(self):\n pass",
"def test_error_html_using_put(self):\n pass",
"def test_get_problem_html_error(self):\r\n module = CapaFactory.create()\r\n\r\... | [
"0.8257193",
"0.8201101",
"0.8106274",
"0.78994226",
"0.77670926",
"0.7608515",
"0.7398059",
"0.7283429",
"0.72699815",
"0.70725447",
"0.7063165",
"0.70398694",
"0.6971618",
"0.69303876",
"0.6792368",
"0.664739",
"0.66464233",
"0.6577502",
"0.6547364",
"0.65467834",
"0.652190... | 0.94252205 | 0 |
Test case for error_html_using_post | def test_error_html_using_post(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_patch(self):\n pass",
"def test_error_html_using_put(self):\n pass",
"def test_error_html_using_get(self):\n pass",
"def test_error_html_using_options(self):\n pass",
"def test_create_form_with_malformed_html(self):\n with pytest.raises(Validatio... | [
"0.76205933",
"0.7602097",
"0.7430351",
"0.7013493",
"0.7012076",
"0.69867843",
"0.68740106",
"0.67656827",
"0.6694433",
"0.66321176",
"0.66228884",
"0.65734154",
"0.64469445",
"0.6378621",
"0.6354644",
"0.6324314",
"0.62738913",
"0.6254669",
"0.6206408",
"0.6192069",
"0.6152... | 0.9513749 | 0 |
Test case for error_html_using_put | def test_error_html_using_put(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_error_html_using_get(self):\n pass",
"def test_error_html_using_patch(self):\n pass",
"def test_error_html_using_post(self):\n pass",
"def test_error_html_using_delete(self):\n pass",
"def test_error_html_using_options(self):\n pass",
"def html_error(string):\n... | [
"0.7785161",
"0.77742934",
"0.770461",
"0.7133737",
"0.71170366",
"0.7058775",
"0.70028675",
"0.6706022",
"0.6624898",
"0.65785575",
"0.65058476",
"0.6313409",
"0.6135274",
"0.61332285",
"0.612189",
"0.6096199",
"0.6077127",
"0.6075621",
"0.6027602",
"0.59867996",
"0.59439385... | 0.93983275 | 0 |
Gets the cloud_port of this AssetManagedDeviceStatus. Port used for the connection to the Cloud by the Device Connector for the Managed Device. | def cloud_port(self):
return self._cloud_port | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_port(self):\n \n return self._port",
"def get_port(self):\n return self.__port",
"def get_port(self):\n return self.port",
"def get_port(self) -> int:\n return self._port",
"def getPort(self):\n return self._port",
"def getPort(self):\n return ... | [
"0.6844844",
"0.678299",
"0.6756832",
"0.67344743",
"0.6697229",
"0.66459125",
"0.6612803",
"0.65106845",
"0.64952266",
"0.64952266",
"0.64952266",
"0.64952266",
"0.64952266",
"0.64952266",
"0.644369",
"0.64388955",
"0.64362776",
"0.6407566",
"0.6331885",
"0.63261026",
"0.628... | 0.8263323 | 0 |
Sets the cloud_port of this AssetManagedDeviceStatus. Port used for the connection to the Cloud by the Device Connector for the Managed Device. | def cloud_port(self, cloud_port):
self._cloud_port = cloud_port | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cloud_port(self):\n return self._cloud_port",
"def cloud(self, cloud):\n\n self._cloud = cloud",
"def cloud_platform(self, cloud_platform):\n\n self._cloud_platform = cloud_platform",
"def port(self, port):\n\n self._port = port",
"def port(self, port):\n\n self._port... | [
"0.6861406",
"0.6428192",
"0.63073575",
"0.57456225",
"0.57456225",
"0.57456225",
"0.5698453",
"0.5344858",
"0.53202885",
"0.5274588",
"0.5266092",
"0.5238477",
"0.5181552",
"0.50226223",
"0.5014965",
"0.49952412",
"0.49680263",
"0.49337366",
"0.49337366",
"0.4925041",
"0.492... | 0.8312118 | 0 |
Gets the connection_failure_reason of this AssetManagedDeviceStatus. Maintains the reason for the failure of connection to the Device in case of connection failure. | def connection_failure_reason(self):
return self._connection_failure_reason | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_failure_reason(self, connection_failure_reason):\n\n self._connection_failure_reason = connection_failure_reason",
"def connection_failed(self):\n return self.conn_status == self.CONN_FAILED",
"def clientconnfail(self) :\n\t\ttry :\n\t\t\treturn self._clientconnfail\n\t\texcept Exc... | [
"0.6756961",
"0.65491545",
"0.61573285",
"0.6149095",
"0.5834336",
"0.57745564",
"0.56500095",
"0.5648535",
"0.5477533",
"0.54170555",
"0.5412195",
"0.5322635",
"0.530484",
"0.5266299",
"0.5259167",
"0.52584547",
"0.5256876",
"0.525342",
"0.52365464",
"0.52296805",
"0.5179395... | 0.781147 | 0 |
Sets the connection_failure_reason of this AssetManagedDeviceStatus. Maintains the reason for the failure of connection to the Device in case of connection failure. | def connection_failure_reason(self, connection_failure_reason):
self._connection_failure_reason = connection_failure_reason | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_failure_reason(self):\n return self._connection_failure_reason",
"def device_stats_collection_failure_reason(self, device_stats_collection_failure_reason):\n\n self._device_stats_collection_failure_reason = device_stats_collection_failure_reason",
"def connection_status(self, conne... | [
"0.6536656",
"0.6511242",
"0.58143514",
"0.55780447",
"0.5561208",
"0.55560035",
"0.5433234",
"0.543293",
"0.5359135",
"0.53374857",
"0.5189162",
"0.51873845",
"0.5158157",
"0.5152747",
"0.5118603",
"0.509556",
"0.5075965",
"0.5066051",
"0.50007445",
"0.50007445",
"0.49888626... | 0.8025693 | 0 |
Gets the connection_status of this AssetManagedDeviceStatus. Maintains the status of the connection to the Device. | def connection_status(self):
return self._connection_status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status(self) -> 'outputs.ConnectionStatusResponse':\n return pulumi.get(self, \"status\")",
"def GetAdbConnectionStatus(self):\n if not self._adb_port:\n return None\n\n return self._device_information[\"adb_status\"]",
"def status(self) -> Optional[pulumi.Input[Union[str, '... | [
"0.69990855",
"0.67396075",
"0.6585936",
"0.6561341",
"0.6351244",
"0.63025033",
"0.6184628",
"0.5918606",
"0.58362716",
"0.5818522",
"0.5818522",
"0.5785592",
"0.57839364",
"0.5760275",
"0.5753956",
"0.57480794",
"0.572511",
"0.56983143",
"0.5695774",
"0.5664015",
"0.5664015... | 0.73128605 | 0 |
Sets the connection_status of this AssetManagedDeviceStatus. Maintains the status of the connection to the Device. | def connection_status(self, connection_status):
allowed_values = ["Unknown", "Success", "Failure"]
if connection_status not in allowed_values:
raise ValueError(
"Invalid value for `connection_status` ({0}), must be one of {1}"
.format(connection_status, allowe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_connection_status(self, connection_status: Literal[ConnectionState]) -> None:\n self.connection_status = connection_status\n self.publish(self.key_gen(\"connection_status\"), connection_status)",
"def set_desired_connection_status(self, connection_status: Literal[ConnectionState]) -> None:\... | [
"0.7622204",
"0.71229255",
"0.67075294",
"0.642478",
"0.6304812",
"0.57982844",
"0.5712975",
"0.5712975",
"0.5712975",
"0.5702602",
"0.56843436",
"0.56608224",
"0.5657329",
"0.56564194",
"0.5575543",
"0.5575543",
"0.5575543",
"0.5575543",
"0.5575543",
"0.5575543",
"0.5575543"... | 0.7380079 | 1 |
Gets the error_code of this AssetManagedDeviceStatus. Maintains code related to error from Device Connector, if any. | def error_code(self):
return self._error_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_code(self):\n return self.__errorCode",
"def error_code(self) -> int:\n return self._error_code",
"def error_code(self):\r\n return self._arm.error_code",
"def errorcode(self):\n return self._errorcode",
"def code(self):\n return self.m_errorCode",
"def er... | [
"0.80927086",
"0.7853982",
"0.78040093",
"0.77480996",
"0.7643988",
"0.7625981",
"0.75576156",
"0.7508924",
"0.7492747",
"0.7410365",
"0.72063196",
"0.704238",
"0.6760039",
"0.6498348",
"0.643351",
"0.64245784",
"0.640594",
"0.64022624",
"0.638448",
"0.63821507",
"0.6355265",... | 0.7911858 | 1 |
Gets the error_reason of this AssetManagedDeviceStatus. Maintains the reason for the error from Device Connector, if any. | def error_reason(self):
return self._error_reason | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_code(self):\n return self.__errorCode",
"def error_code(self):\r\n return self._arm.error_code",
"def getError(self):\n \n return self.resp[\"error\"]",
"def error(self):\n return self._error",
"def error(self):\n return self._error",
"def error(sel... | [
"0.6496357",
"0.64540976",
"0.6365287",
"0.6285341",
"0.6285341",
"0.6285341",
"0.62536263",
"0.62456876",
"0.62069446",
"0.61942303",
"0.6192524",
"0.6190862",
"0.61701447",
"0.61624485",
"0.6154781",
"0.61237407",
"0.61015075",
"0.6100719",
"0.6099042",
"0.60904706",
"0.606... | 0.7394444 | 0 |
Sets the error_reason of this AssetManagedDeviceStatus. Maintains the reason for the error from Device Connector, if any. | def error_reason(self, error_reason):
self._error_reason = error_reason | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection_failure_reason(self, connection_failure_reason):\n\n self._connection_failure_reason = connection_failure_reason",
"def error_reason(self):\n return self._error_reason",
"def error_code(self, error_code):\n\n self._error_code = error_code",
"def error_code(self, error_code... | [
"0.64051986",
"0.63003427",
"0.622438",
"0.622438",
"0.622438",
"0.62167424",
"0.6189171",
"0.6185414",
"0.61852753",
"0.6146102",
"0.6127543",
"0.6127543",
"0.6127543",
"0.6083474",
"0.6027584",
"0.6015361",
"0.59689486",
"0.5847166",
"0.5836699",
"0.583283",
"0.5718271",
... | 0.7914933 | 0 |
Gets the process_id of this AssetManagedDeviceStatus. Maintains the process pid of the Device Connector for the Managed Device. | def process_id(self):
return self._process_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pid(self):\n return self._process.pid",
"def pid(self):\n\n return getpid() if self.__process is None else self.__process.pid",
"def pid(self):\n return self._get_process_id()",
"def pid(self):\n return self.__pid",
"def pid(self):\n return self._pid",
"def pid(self... | [
"0.71282804",
"0.705832",
"0.69891465",
"0.6762518",
"0.6741815",
"0.6741815",
"0.6741815",
"0.6694708",
"0.6605939",
"0.65439236",
"0.64063627",
"0.635108",
"0.63183165",
"0.62412715",
"0.6233098",
"0.6208176",
"0.6162157",
"0.61610156",
"0.6096298",
"0.6060296",
"0.6037231"... | 0.7261856 | 1 |
Sets the process_id of this AssetManagedDeviceStatus. Maintains the process pid of the Device Connector for the Managed Device. | def process_id(self, process_id):
self._process_id = process_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pid(self, pid):\n\n self._pid = pid",
"def pid(self, pid):\n\n self._pid = pid",
"def device_mo_id(self, device_mo_id):\n\n self._device_mo_id = device_mo_id",
"def client_dunning_process_id(self, client_dunning_process_id):\n\n self._client_dunning_process_id = client_dunning... | [
"0.5971626",
"0.5971626",
"0.57851255",
"0.5710337",
"0.56569576",
"0.56569576",
"0.55577666",
"0.55124867",
"0.5456025",
"0.5456025",
"0.544736",
"0.5422159",
"0.54028785",
"0.53432256",
"0.5263329",
"0.5186211",
"0.5119531",
"0.50993544",
"0.506893",
"0.5058732",
"0.5055352... | 0.71728855 | 1 |
Gets the server_port of this AssetManagedDeviceStatus. Port used for receiving requests from Intersight Assist by the Device Connector for the Managed Device. | def server_port(self):
return self._server_port | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def port(self):\r\n _, port = self.server_address\r\n return port",
"def port(self):\n _, port = self.server_address\n return port",
"def port(self):\n if self._server_thread is None:\n raise RuntimeError('Server not started.')\n return self._port",
"def get_port(self) ... | [
"0.70885134",
"0.7069451",
"0.69931954",
"0.6854985",
"0.6834414",
"0.6822482",
"0.6795282",
"0.6764114",
"0.67573935",
"0.66935444",
"0.66761667",
"0.66706216",
"0.6642678",
"0.6642678",
"0.6642678",
"0.6642678",
"0.6642678",
"0.6642678",
"0.66204315",
"0.6578444",
"0.656821... | 0.7495894 | 1 |
Sets the server_port of this AssetManagedDeviceStatus. Port used for receiving requests from Intersight Assist by the Device Connector for the Managed Device. | def server_port(self, server_port):
self._server_port = server_port | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setServerPort(self, serverPort):\n\n _ExceptionUtil.raiseOnError(\n internals.blpapi_SessionOptions_setServerPort(self.__handle,\n serverPort))",
"def SetServerInformation(self, server, port):\n self.hostname = server\n self.por... | [
"0.70623255",
"0.65183854",
"0.64270973",
"0.64270973",
"0.6307212",
"0.6213667",
"0.61758465",
"0.60316",
"0.60316",
"0.60316",
"0.59650874",
"0.58534414",
"0.5831054",
"0.5787459",
"0.5720148",
"0.5708671",
"0.5708671",
"0.56616724",
"0.5628659",
"0.561165",
"0.5568586",
... | 0.77997637 | 0 |
Returns the rectangle occupied by the given menu item. It can be used with `mouseInView()` to determine if a mouse click has occurred on a given menu selection. | def getItemRect(self, item):
r = Rect(1, 0, 1, 1)
for p in self.menu.items:
r.topLeft.x = r.bottomRight.x
if p.name:
r.bottomRight.x += (nameLength(p.name) + 2)
if p is item:
return r
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetBoundingRect(self, item, textOnly=False):\r\n \r\n i = item\r\n\r\n startX, startY = self.GetViewStart()\r\n rect = wx.Rect()\r\n\r\n rect.x = i.GetX() - startX*_PIXELS_PER_UNIT\r\n rect.y = i.GetY() - startY*_PIXELS_PER_UNIT\r\n rect.width = i.GetWidth()\r\n ... | [
"0.6840595",
"0.6723916",
"0.62039435",
"0.60061646",
"0.5800066",
"0.5797162",
"0.570646",
"0.5655264",
"0.56232053",
"0.5483383",
"0.54546165",
"0.5424792",
"0.5416514",
"0.54087716",
"0.53720254",
"0.53371376",
"0.53336966",
"0.5329836",
"0.5325443",
"0.5323548",
"0.529638... | 0.7746237 | 0 |
Corrects the position of self.x and self.y Only Applies if the screen width or height gets smaller | def correct_position(self):
width = self.screen.get_width()
height = self.screen.get_height()
if self.last_screen_dimensions["width"] > width:
self.x -= self.last_screen_dimensions["width"] - width
if self.last_screen_dimensions["height"] > height:
self.y -= se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keepInBounds(self):\n screenWidth, screenHeight = self.screen.get_size()\n\n self.pos.x = max(0, self.pos.x)\n self.pos.x = min(screenWidth, self.pos.x)\n\n self.pos.y = max(0, self.pos.y)\n self.pos.y = min(screenHeight, self.pos.y)",
"def update(self): \n super().... | [
"0.78119874",
"0.7653817",
"0.75469375",
"0.7439028",
"0.7326057",
"0.7271567",
"0.72375256",
"0.7131026",
"0.712786",
"0.7124782",
"0.71077716",
"0.7093469",
"0.7079267",
"0.7074412",
"0.70671827",
"0.70496273",
"0.70259625",
"0.69542825",
"0.69437736",
"0.6918284",
"0.69038... | 0.8278624 | 0 |
Saves the positions, used for menu selection Position type must be a list containing [x,y] | def save_position(self, name, position):
self.saved_positions[name] = {}
self.saved_positions[name]["x"] = position[0]
self.saved_positions[name]["y"] = position[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_xy(self, position, prop):\n str_position = json.dumps(position)\n file_name = 'data/%s_%s.json'%(self.GetLabel(), prop)\n\n try:\n file = open(file_name, 'w')\n file.write(str_position)\n except OSError as err:\n print(\"can't save property: {0}... | [
"0.6660024",
"0.6584007",
"0.6335838",
"0.6331193",
"0.6278913",
"0.6218186",
"0.6180483",
"0.617787",
"0.6159392",
"0.60842675",
"0.60808206",
"0.60798794",
"0.6047011",
"0.6033767",
"0.6031618",
"0.60130155",
"0.5996627",
"0.5976005",
"0.5925281",
"0.5915364",
"0.58412266",... | 0.70034194 | 0 |
Create repository directory if not exist | def _check_repository_directory(self):
if not os.path.exists(self._repository_path):
os.makedirs(self._repository_path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mkdir ():\n name = \"-\".join(parser_arguments().classes)\n if not os.path.exists(name):\n os.mkdir(name)\n print('The repository {} have been created'.format(parser_arguments().classes))\n else:\n print('The repository {} already exists.'.format(parser_arguments().classes))\n ... | [
"0.7722939",
"0.76091725",
"0.75448835",
"0.7470805",
"0.7412247",
"0.7310484",
"0.71645266",
"0.70960295",
"0.69970864",
"0.6936333",
"0.6856878",
"0.680718",
"0.6774606",
"0.67724776",
"0.6736854",
"0.6732837",
"0.67109776",
"0.67044973",
"0.67044383",
"0.66445535",
"0.6618... | 0.80504537 | 0 |
Check if repository exist and clone it if not. Then fill _repo instance attribute et make a pull. | def _check_repository(self):
if not os.path.exists("%s/.git" % self._repository_path):
Repo.clone_from(self.REPOSITORY_ADDRESS, self._repository_path)
self._repo = Repo(self._repository_path)
self._pull() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_pull_default_remote(self, repo):\n dest = os.path.join(self._tmpdir, 'cloned_repo')\n clone(['arg0', repo.path, dest])\n cloned = ComponentTestGitRepository(dest)\n self._check_repo_state(cloned, 'master', ['master'])\n eq_(pull(['argv0']), 0)\n assert len(repo.ge... | [
"0.6971693",
"0.6818089",
"0.6796815",
"0.6781233",
"0.67644113",
"0.67389953",
"0.672424",
"0.665514",
"0.6643986",
"0.658488",
"0.6535612",
"0.6520064",
"0.6448177",
"0.64213425",
"0.64080757",
"0.63888747",
"0.6329104",
"0.63189185",
"0.63037074",
"0.6279855",
"0.6266955",... | 0.79208183 | 0 |
Current game tick number | def currentTick(self):
return self._currentTick | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tick():\n return _tick",
"def get_current_tick():\n return _pigpio_command(_control, _PI_CMD_TICK, 0, 0)",
"def get_tick_value(self):\n return self.tick",
"def lastTick():",
"def last_tick_time(self):\n return self.last_tick_",
"def tick():\n global current\n current += 1",
... | [
"0.7729197",
"0.7552153",
"0.7264076",
"0.7203146",
"0.7004014",
"0.697165",
"0.697165",
"0.6765588",
"0.6716648",
"0.6716648",
"0.6700422",
"0.6700422",
"0.66372967",
"0.6637098",
"0.662143",
"0.65604573",
"0.6550471",
"0.6546328",
"0.65204513",
"0.6507544",
"0.6485652",
"... | 0.76679164 | 1 |
Create sectors data using arena settings | def createSectorsData(self):
for sectorId, settings in self.arenaTypeData.sectors.sectors.iteritems():
entity = next((sector for sector in ACSector.entities if sector.ident == sectorId), None)
if entity:
self._sectors[sectorId] = sector = ACSectorClient.ACSectorClient(set... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def onACSectorCreated(self, entity):\n raise entity.ident in self.arenaTypeData.sectors.sectors or AssertionError(\"Unexpected sector created: '{0}', arena: {1}\".format(entity.ident, self.arenaTypeData.typeName))\n settings = self.arenaTypeData.sectors.sectors[entity.ident]\n self._sectors[en... | [
"0.55664074",
"0.55636305",
"0.542939",
"0.5337099",
"0.52993226",
"0.5280087",
"0.5258398",
"0.5203788",
"0.519687",
"0.517711",
"0.5176165",
"0.51434815",
"0.5119572",
"0.5079671",
"0.5027002",
"0.5022975",
"0.50052536",
"0.49962944",
"0.49929285",
"0.4988988",
"0.49803966"... | 0.73192996 | 0 |
Check capture sectors by team | def teamSuperiority(self, teamIndex):
sectors = 0
capturedSectors = 0
for sector in self._sectors.itervalues():
if not sector.isCapturable:
continue
sectors += 1
if sector.teamIndex == teamIndex:
capturedSectors += 1
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_team_owned_clouds(self):\n pass",
"def test_retrieve_team(self):\n pass",
"def test_get_open_requests_by_team(self):\n pass",
"def _run_test_case(radio, lines):\n calc_reachable_surface_and_people(radio, lines)",
"def test_boundary_boxes(gt_detection_combo):\n found ... | [
"0.585762",
"0.5425284",
"0.5285067",
"0.51805264",
"0.5127063",
"0.5094818",
"0.5067533",
"0.50342155",
"0.50342155",
"0.4998648",
"0.49926502",
"0.49775308",
"0.49333805",
"0.4923098",
"0.48978695",
"0.487425",
"0.48576087",
"0.48571336",
"0.48376897",
"0.48255724",
"0.4815... | 0.5762825 | 1 |
Handler for GameActionsManager.eWaveAdded event | def _onASWaveAdded(self, record, *args, **kwargs):
self.dispatch(AC_EVENTS.BOMBERS_LAUNCHED, record['sectorID'], record['targetID'], record['teamIndex'], record['waveID'], record['bomberIDsStates'], record['startTime']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enemy_waves(self):\n\n pass",
"def OnSelfAdded(event, wavelet):\n logging.info('OnSelfAdded')\n blip = event.blip\n wavelet.title = 'A wavelet title'\n blip.append(element.Image(url='http://www.google.com/logos/clickortreat1.gif',\n width=320, height=118))\n blip.append... | [
"0.6564487",
"0.6305496",
"0.6295222",
"0.624337",
"0.6228176",
"0.61882764",
"0.6124069",
"0.6016413",
"0.5928014",
"0.5927098",
"0.5856141",
"0.5809874",
"0.57393336",
"0.56411064",
"0.55959076",
"0.556875",
"0.55132854",
"0.5500313",
"0.54534775",
"0.5402665",
"0.5397432",... | 0.67384034 | 0 |
Handler for GameActionsManager.eWaveRemoved event | def _onASWaveRemoved(self, waveID, *args, **kwargs):
self.dispatch(AC_EVENTS.BOMBERS_DIED, waveID) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _handle_wave_clear(self):\n if self._wave == self._level.get_max_wave():\n self._handle_game_over(won=True)",
"def wave_delete(wave_id):\n return _u2i(_pigpio_command(_control, _PI_CMD_WVDEL, wave_id, 0))",
"def RemoveWave(self, wave_id):\n if wave_id in self._waves:\n del self.... | [
"0.72184855",
"0.6400077",
"0.6078642",
"0.59243494",
"0.568439",
"0.54848194",
"0.54277045",
"0.540061",
"0.5394511",
"0.53893125",
"0.5346797",
"0.5292275",
"0.5267865",
"0.52520764",
"0.52520764",
"0.524276",
"0.5233132",
"0.5218466",
"0.52099115",
"0.5200941",
"0.5176571"... | 0.7309811 | 0 |
Handler for GameActionsManager.eWaveStateChanged event | def _onASWaveStateChanged(self, record, stateOld, state, *args, **kwargs):
if state == AIR_STRIKE_WAVE_STATE.ATTACK_IN_PROGRESS and stateOld == AIR_STRIKE_WAVE_STATE.BOMBS_DROPPED:
self.dispatch(AC_EVENTS.BOMBERS_ATTACK_STARTED, record['sectorID'], record['waveID'], record['size'], len(record['bombe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _handle_wave_clear(self):\n if self._wave == self._level.get_max_wave():\n self._handle_game_over(won=True)",
"def updateNewWave(self):\n self.setWave(Wave())\n self.setState(STATE_ACTIVE)",
"def enemy_waves(self):\n\n pass",
"def wave(self):\n return self._wa... | [
"0.6617994",
"0.6225838",
"0.6001227",
"0.59568113",
"0.57056344",
"0.5561393",
"0.55339545",
"0.5515362",
"0.5397272",
"0.5359885",
"0.52892125",
"0.5245316",
"0.5243214",
"0.5218238",
"0.51534873",
"0.5038011",
"0.49959427",
"0.49787053",
"0.4978145",
"0.4969912",
"0.495556... | 0.6601928 | 1 |
Handler for GameActionsManager.eBomberStateChanged event | def _onASBomberStateChanged(self, record, bomberID, stateOld, state, *args, **kwargs):
if state == AIR_STRIKE_WAVE_STATE.ATTACK_NOTIFIED and stateOld == AIR_STRIKE_WAVE_STATE.INTRO_FLIGHT:
self.dispatch(AC_EVENTS.BOMBER_ATTACK_NOTIFIED, record['sectorID'], record['waveID'], bomberID, record['size'],... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def event11510110():\n header(11510110, 0)\n skip_if_this_event_off(2)\n anim.end_animation(1511010, 0)\n end()\n if_player_has_item(1, ItemType.good, ITEM.KeyToSunChamber)\n if_action_button_state(1, 'object', 1511010, 60.0, 100, 1.5, 10010400, ReactionAttribute.all, pad_id=0)\n if_condition_... | [
"0.60966915",
"0.5917737",
"0.58220637",
"0.5642345",
"0.5607595",
"0.55787665",
"0.5578585",
"0.55759805",
"0.55634815",
"0.55482996",
"0.5500401",
"0.5487836",
"0.54848653",
"0.5467751",
"0.5443894",
"0.5443894",
"0.5423846",
"0.53952",
"0.5387089",
"0.53677356",
"0.5364623... | 0.739324 | 0 |
Returns major and minor verions extracted from hal_version string. | def ParseHalVersion(hal_version):
hal_version_major, hal_version_minor = hal_version.split(".")
return int(hal_version_major), int(hal_version_minor) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_major_minor(version_string):\n return '.'.join(version_string.split('.')[0:2])",
"def version(harness_string):\n lines = harness_string.split(\"\\n\")\n version_string = lines[1][11:]\n return [int(x) for x in version_string.split(\".\")]",
"def version_info():\r\n return tuple(map(i... | [
"0.6808128",
"0.6800184",
"0.64949715",
"0.6468127",
"0.64401436",
"0.64337885",
"0.64071137",
"0.63955134",
"0.6358101",
"0.63574815",
"0.63204896",
"0.63001186",
"0.62353826",
"0.6229219",
"0.6155122",
"0.6138727",
"0.61198515",
"0.6089407",
"0.6043678",
"0.6036056",
"0.601... | 0.7774886 | 0 |
Check that uses of security with its scopes matches a securityDefinition | def check_security(swagger: Dict):
events = set()
secdefs = swagger.get("securityDefinitions", {})
security_jspath = JSPATH_SECURITY
for sec_key, scopes, path in get_elements(swagger, security_jspath):
# retrieve security definition name from security declaration
secdef = secdefs.get(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _allow_scopes(self, scopes):\n self.ensure_one()\n if not scopes:\n return True\n provided_scopes = set(self.scope.split())\n resource_scopes = set(scopes)\n return resource_scopes.issubset(provided_scopes)",
"def allow_scopes(self, scopes):\n if not scope... | [
"0.65138483",
"0.6327811",
"0.5783558",
"0.5783558",
"0.5767268",
"0.5724105",
"0.5654273",
"0.5641699",
"0.5622558",
"0.56123286",
"0.54999596",
"0.54790866",
"0.5475231",
"0.54410386",
"0.54316336",
"0.5362886",
"0.5335938",
"0.52609617",
"0.5260208",
"0.52396923",
"0.52269... | 0.685158 | 0 |
Find reference in paths, for /definitions/ and /responses/ /securityDefinitions/. Follow from these, references to other references, till no more added. | def check_references(swagger: Dict):
events = set()
ref_jspath = JSPATH_REFERENCES
for _, reference, path in get_elements(swagger, ref_jspath):
# handle only local references
if reference.startswith("#/"):
# decompose reference (error if not possible)
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve_references(path, schema):\n if isinstance(schema, dict):\n # do $ref first\n if '$ref' in schema:\n # Pull the referenced filepath from the schema\n referenced_file = schema['$ref']\n\n # Referenced filepaths are relative, so take the current path's\n ... | [
"0.5813966",
"0.580421",
"0.57232213",
"0.567098",
"0.5387027",
"0.536545",
"0.5360238",
"0.53423506",
"0.5322113",
"0.53113806",
"0.52813274",
"0.5275058",
"0.52129483",
"0.5208881",
"0.5207236",
"0.5207236",
"0.519945",
"0.5163528",
"0.5115436",
"0.510193",
"0.5087295",
"... | 0.62231946 | 0 |
Return list of Action with duplicate operationIds | def detect_duplicate_operationId(swagger: Dict):
events = set()
# retrieve all operationIds
operationId_jspath = JSPATH_OPERATIONID
def get_operationId_name(name_value_path):
return name_value_path[1]
operationIds = sorted(get_elements(swagger, operationId_jspath), key=get_operationId_nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getOperations(tasks):\n uniqueOps = []\n for t in tasks:\n if t.operation not in uniqueOps:\n uniqueOps.append(t.operation)\n return uniqueOps",
"def get_action_meanings(self) -> list[str]:\n keys = ale_py.Action.__members__.values()\n values = ale_py.Action.__members... | [
"0.5931796",
"0.5806651",
"0.5590762",
"0.5534209",
"0.5511355",
"0.54215086",
"0.54107136",
"0.53395987",
"0.53227234",
"0.5308435",
"0.5300775",
"0.52975464",
"0.5292807",
"0.5246177",
"0.5204808",
"0.520251",
"0.5185142",
"0.5185142",
"0.5164353",
"0.5164038",
"0.514922",
... | 0.6498538 | 0 |
Return a custom Task deriving from the given features. The method resolution order of the created custom task class is (features, ZenTask, celery.app.task.Task, object) where 'features' are the classes given to this function. | def requires(*features):
bases = tuple(features) + (app.Task, object)
culled = []
for feature in reversed(bases):
for cls in reversed(inspect.getmro(feature)):
if cls not in culled:
culled.insert(0, cls)
name = "".join(t.__name__ for t in features) + "Task"
baseta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task(self, *args, **options):\n\n def inner_create_task_cls(**options):\n\n def _create_task_cls(fun):\n options[\"app\"] = self\n options.setdefault(\"accept_magic_kwargs\", False)\n base = options.pop(\"base\", None) or self.Task\n\n ... | [
"0.6390325",
"0.6185908",
"0.6112467",
"0.6085256",
"0.60752213",
"0.6052281",
"0.59219766",
"0.5772356",
"0.5659865",
"0.5566926",
"0.5566227",
"0.55407",
"0.5519343",
"0.5488936",
"0.5457622",
"0.54563",
"0.5421232",
"0.5372621",
"0.5343277",
"0.53029823",
"0.52959937",
"... | 0.6746591 | 0 |
Return True if the job's log contains any ERROR messages. | def job_log_has_errors(task_id):
storage = getUtility(IJobStore, "redis")
logfile = storage.getfield(task_id, "logfile")
if not logfile:
return False
try:
with open(logfile, "r") as f:
return any(
any(txt in line for txt in _failure_text)
for l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_error_logs(self) -> bool:\n return pulumi.get(self, \"has_error_logs\")",
"def has_error_logs(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"has_error_logs\")",
"def is_error(self):\n qstat = self._grep_qstat('error')\n err = self._grep_status('error')\n ... | [
"0.7957555",
"0.7402968",
"0.7083291",
"0.679797",
"0.6731912",
"0.668849",
"0.666115",
"0.66186255",
"0.66132045",
"0.65512913",
"0.65366274",
"0.65144116",
"0.65144086",
"0.6504721",
"0.6497874",
"0.6482571",
"0.64806294",
"0.6465928",
"0.64602154",
"0.64566797",
"0.6456679... | 0.76105946 | 1 |
Save array arr as image named filename using PIL. Array values are expected to be in range 0, 255 | def save_array_as_image(arr, filename):
arr = arr.copy().clip(0, 255).astype('uint8')
im = Image.fromarray(arr)
im.save(filename) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_to_file(filename, a):\n a = normalize_array(a)\n i = Image.fromarray(a.astype('uint8'))\n return i.save(filename)",
"def save_array_as_image(array, save_location):\n image = Image.fromarray(array)\n image.save(save_location)\n image.close()",
"def save_array_as_rgb_image(data, image... | [
"0.74595904",
"0.7408031",
"0.7337335",
"0.7290139",
"0.7236084",
"0.71091694",
"0.7072147",
"0.7061919",
"0.70130265",
"0.6976142",
"0.6947858",
"0.68813074",
"0.67939574",
"0.6785626",
"0.67748415",
"0.6718204",
"0.67100114",
"0.67048955",
"0.66497797",
"0.66431254",
"0.659... | 0.86196065 | 0 |
Assuming population is sorted from best to worst, sample in proportion to rank. | def rank_selector(population):
# make a cdf of probability of being selected
invrange = np.arange(len(population), 0, -1, dtype = np.double)
cdf = np.r_[0., (invrange / invrange.sum()).cumsum()]
while True:
u = nprand.random()
ix = np.searchsorted(cdf, u) - 1
yield population[ix] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scramble_pop(pop, fit_pop, fraction):\n\n ranked_worst = np.argsort(fit_pop)\n\n for rank in ranked_worst[:int(fraction * npop)]:\n for gene in range(0, len(pop[rank])-1):\n pop[rank][gene] = np.random.uniform(dom_l, dom_u, 1)\n\n return pop",
"def roulette(total_fitness, populatio... | [
"0.6435638",
"0.628591",
"0.6211622",
"0.61294687",
"0.60651034",
"0.6053954",
"0.6044325",
"0.6033243",
"0.6014987",
"0.5992214",
"0.59467053",
"0.59455305",
"0.5945468",
"0.5937301",
"0.59296274",
"0.592006",
"0.59174055",
"0.5895622",
"0.58792055",
"0.58780485",
"0.5864598... | 0.6758833 | 0 |
Find reference file. Start one directory above where current script is located | def _find_ref_fname(fname, ref_fname):
curr_dir = ""
next_dir = os.path.dirname(os.path.abspath(fname))
while next_dir != curr_dir:
curr_dir = next_dir
rcfile = os.path.join(curr_dir, ref_fname)
if os.path.exists(rcfile):
return rcfile
next_dir = os.path.dirname(c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def here(*args):\n return os.path.join(os.path.dirname(__file__), *args)",
"def find_file(filename):\n for i in list(_ctx.include_paths) + [ os.path.dirname(_ctx.filename) ]:\n full_path = os.path.join(i, filename)\n if os.path.exists(full_path):\n return full_path\n return file... | [
"0.6440464",
"0.59702355",
"0.5936138",
"0.5847516",
"0.5828445",
"0.5815112",
"0.58074206",
"0.5772543",
"0.57669914",
"0.5754274",
"0.5753154",
"0.57404125",
"0.5732479",
"0.57175195",
"0.5709073",
"0.5703181",
"0.5684399",
"0.56781787",
"0.56758654",
"0.5631285",
"0.562101... | 0.6339929 | 1 |
Looks for the best configuration according to the metric with which the configurations are compared > best config metric | def get_optimum_config(
self, tested_configs, fold_operation=FoldOperations.MEAN
):
list_of_config_vals = []
list_of_non_failed_configs = [
conf for conf in tested_configs if not conf.config_failed
]
if len(list_of_non_failed_configs)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_best(template, config, key_seq, metric):\n possibles = get_deep(template, key_seq)\n if 1 == len(possibles):\n return None\n best_score = 2**60\n best_val = None\n for val in possibles:\n set_deep(config, key_seq, val)\n score = metric(config)\n #print \"FFFFFFFFF\", score\n if score <... | [
"0.6712287",
"0.67110497",
"0.6517062",
"0.64486647",
"0.644139",
"0.625165",
"0.6074667",
"0.5995878",
"0.5835893",
"0.57242954",
"0.57160693",
"0.56855017",
"0.56855017",
"0.56656194",
"0.5652332",
"0.564348",
"0.5612303",
"0.56057096",
"0.56019616",
"0.56008816",
"0.559924... | 0.6942822 | 0 |
Add an element to the machine learning pipeline Returns self | def __iadd__(self, pipe_element):
if isinstance(pipe_element, Preprocessing):
self.preprocessing = pipe_element
elif isinstance(pipe_element, CallbackElement):
pipe_element.needs_y = True
self.elements.append(pipe_element)
else:
if isinstance(pipe_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(self, pipe_element):\n self.__iadd__(pipe_element)",
"def add(self, element):\n pass",
"def add(self):\n self.inp.inputs.add(self)\n self.out.outputs.add(self)",
"def add(self, element):\n self.elements.append(element)",
"def __add__(self, element):\r\n sel... | [
"0.70778596",
"0.67362624",
"0.6649324",
"0.6646544",
"0.65935856",
"0.65228593",
"0.64086336",
"0.639863",
"0.6348306",
"0.6348306",
"0.62513787",
"0.62475896",
"0.62036484",
"0.6151312",
"0.614484",
"0.61237323",
"0.61083806",
"0.61050963",
"0.60869807",
"0.6086253",
"0.607... | 0.7266616 | 0 |
Add an element to the machine learning pipeline Returns self | def add(self, pipe_element):
self.__iadd__(pipe_element) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iadd__(self, pipe_element):\n if isinstance(pipe_element, Preprocessing):\n self.preprocessing = pipe_element\n elif isinstance(pipe_element, CallbackElement):\n pipe_element.needs_y = True\n self.elements.append(pipe_element)\n else:\n if isin... | [
"0.7266616",
"0.67362624",
"0.6649324",
"0.6646544",
"0.65935856",
"0.65228593",
"0.64086336",
"0.639863",
"0.6348306",
"0.6348306",
"0.62513787",
"0.62475896",
"0.62036484",
"0.6151312",
"0.614484",
"0.61237323",
"0.61083806",
"0.61050963",
"0.60869807",
"0.6086253",
"0.6079... | 0.70778596 | 1 |
Use the optimum pipe to predict the data Returns predicted targets | def predict(self, data, **kwargs):
# Todo: if local_search = true then use optimized pipe here?
if self._pipe:
return self.optimum_pipe.predict(data, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict(self, X):\n return self.opt.eval(X, top=True)",
"def predict(self, X):\n return self.opt.eval(X)",
"def getPredictions(self):\n\t\tself.bestLabel = self.testingProbs.apply(lambda x: x.argmax(),1)",
"def predict(self, data, verbose=0):\n\n if self.model is None:\n r... | [
"0.6907801",
"0.68176144",
"0.6800588",
"0.6799681",
"0.6799681",
"0.67252415",
"0.6709709",
"0.6695485",
"0.6654642",
"0.6617693",
"0.6604021",
"0.6581415",
"0.65737164",
"0.65672374",
"0.6523594",
"0.6510785",
"0.6510358",
"0.6510358",
"0.6494413",
"0.64923626",
"0.6485281"... | 0.73675454 | 0 |
Use the optimum pipe to transform the data | def transform(self, data, **kwargs):
if self._pipe:
X, _, _ = self.optimum_pipe.transform(data, y=None, **kwargs)
return X | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transform(self, data):",
"def transform():",
"def transform(config, data, transfo, *args, **kwargs):\n \n# stderr.write(str((config, data, transfo) + args) + \"\\n\")\n pipe = ktpipes.KtPipe.from_json(config[transfo])\n\n return pipe.fit_transform(get_raw(data))",
"def transform():\n p... | [
"0.71663713",
"0.7165865",
"0.68435884",
"0.6630693",
"0.6535905",
"0.65170705",
"0.6233505",
"0.6196889",
"0.61578715",
"0.6157544",
"0.6103798",
"0.6094707",
"0.6094707",
"0.6094707",
"0.6094707",
"0.6094707",
"0.6094707",
"0.6094707",
"0.59727305",
"0.5970371",
"0.5964616"... | 0.72844344 | 0 |
Helper function to copy an entire Hyperpipe | def copy_me(self):
signature = inspect.getfullargspec(OutputSettings.__init__)[0]
settings = OutputSettings()
for attr in signature:
if hasattr(self.output_settings, attr):
setattr(settings, attr, getattr(self.output_settings, attr))
settings.initialize_log_fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def threading_copy(self, data):\n r_fd, w_fd = os.pipe()\n rstream = os.fdopen(r_fd, \"rb\")\n wstream = os.fdopen(w_fd, \"wb\")\n copy_thread = threading.Thread(target=self.copystream, args=(rstream,))\n copy_thread.start()\n self.writestream(data, wstream)\n wstre... | [
"0.6295839",
"0.61451626",
"0.610873",
"0.60578406",
"0.6020367",
"0.5932582",
"0.5854358",
"0.57254714",
"0.5709322",
"0.56596786",
"0.5651965",
"0.5637481",
"0.55423003",
"0.55423003",
"0.55423003",
"0.55423003",
"0.55423003",
"0.55423003",
"0.55423003",
"0.55398184",
"0.55... | 0.62963563 | 0 |
Inverse transform data for a pipeline with specific hyperparameter configuration 1. Copy Sklearn Pipeline, 2. Set Parameters 3. Fit Pipeline to data and targets 4. Inverse transform data with that pipeline | def inverse_transform_pipeline(
self, hyperparameters: dict, data, targets, data_to_inverse
):
copied_pipe = self.pipe.copy_me()
copied_pipe.set_params(**hyperparameters)
copied_pipe.fit(data, targets)
return copied_pipe.inverse_transform(data_to_inverse) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _inverse_transform(self, X, y=None):\n return clone(self.transformer).fit(X=X, y=y).inverse_transform(X=X, y=y)",
"def inverse_transform(self, X, copy=...):\n ...",
"def inverse_transform(self, X):\n ...",
"def inverse_transform(self, X):\n ...",
"def inverse_transform(self,... | [
"0.67512584",
"0.6557717",
"0.6473889",
"0.6473889",
"0.6473889",
"0.6473889",
"0.6473889",
"0.64618254",
"0.64002866",
"0.63939637",
"0.6292726",
"0.6234573",
"0.62108785",
"0.61722",
"0.61578774",
"0.61001974",
"0.6087496",
"0.6086325",
"0.6037008",
"0.60338575",
"0.6021908... | 0.8462068 | 0 |
Data visualization with ground truth and predicted data comparison. There are two plots for them and each of them use different colors to differentiate the data with different labels. | def plot_result(data, gt_y, pred_y):
assert data.shape[0] == gt_y.shape[0]
assert data.shape[0] == pred_y.shape[0]
plt.figure()
plt.subplot(1, 2, 1)
plt.title('Ground Truth', fontsize=18)
for idx in range(data.shape[0]):
if gt_y[idx] == 0:
p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_true_predictions(self):\n \n if self.data_generated:\n \n # Choosing a different color for each target\n n_targets = len(self.true_data['targets'])\n cmap = plt.get_cmap('gnuplot')\n colors = [cmap(i) for i in np.linspace(0, 0.9, n_targe... | [
"0.72492915",
"0.69190305",
"0.6835955",
"0.66809905",
"0.667098",
"0.666655",
"0.66369617",
"0.6629329",
"0.65713775",
"0.6568579",
"0.6568099",
"0.65115273",
"0.65052915",
"0.6482675",
"0.645257",
"0.64101094",
"0.63752383",
"0.6353995",
"0.63376975",
"0.63136935",
"0.63063... | 0.761913 | 1 |
Suppresses background and don't care classes for the bounding box and depth masks. | def _suppress_bg_dc(self):
# mask for suppressing background/don't care classes
suppress_mask = 1 - (self.classification_mask[0] + self.classification_mask[1])
# Suppress bounding box mask
for i in range(self.num_coords):
self.bbox_mask[i] = np.multiply(se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_mask(mask, background=0):\n kernels = [\n np.array([[ 1, -1, -1], [-1, 1, -1], [-1, -1, -1]]), # top left standalone pixel\n np.array([[-1, -1, 1], [-1, 1, -1], [-1, -1, -1]]), # top right standalone pixel\n np.array([[-1, -1, -1], [-1, 1, -1], [ 1, -1, -1]]), # bottom left... | [
"0.65584725",
"0.6462295",
"0.6241451",
"0.6011713",
"0.5985777",
"0.58868444",
"0.58594817",
"0.5858424",
"0.5788712",
"0.5771418",
"0.5730475",
"0.57079804",
"0.5688872",
"0.5662684",
"0.56402606",
"0.56402606",
"0.56084776",
"0.5579039",
"0.5578632",
"0.55614763",
"0.55481... | 0.765611 | 0 |
Updates the classification target/mask. Sets classification mask to 1 where object resides for the specified object class (dimension), removes (sets to 0) classification mask for background class | def _update_classification_mask(self, obj_class, mask_coords):
# Remove background where object resides
self.classification_mask[0, mask_coords[1]:mask_coords[3], mask_coords[0]:mask_coords[2]] = 0
# Set classification mask where object resides
self.classification_mask[ob... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_mask_class(y_true: Tensor):\n y_true = y_true.detach().cpu()\n batch_size = y_true.size(0)\n num_classes = y_true.size(1)\n if num_classes == 1:\n y_true = y_true.view(batch_size, -1)\n elif num_classes == 2:\n y_true = y_true[:, 1, ...].contiguous().view(batch_size, -1) #... | [
"0.6051678",
"0.59728235",
"0.59617054",
"0.5888132",
"0.579369",
"0.57847327",
"0.5740755",
"0.5721277",
"0.56688094",
"0.56654084",
"0.5584212",
"0.55299306",
"0.5471518",
"0.544962",
"0.5445147",
"0.5418681",
"0.54098785",
"0.5379724",
"0.53662145",
"0.53600085",
"0.534663... | 0.8229826 | 0 |
Updates the bounding box mask. | def _update_bbox_mask(self, bbox_coords, mask_coords):
# Set target/mask regions to image bounding box values
self.bbox_mask[0, mask_coords[1]:mask_coords[3], mask_coords[0]:mask_coords[2]] = bbox_coords[0]
self.bbox_mask[1, mask_coords[1]:mask_coords[3], mask_coords[0]:mask_coords[2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_mask(self, mask):\n\n # Get general mask\n general_mask = self.general_mask\n\n # Complete with the input mask\n new_mask = (general_mask | mask)\n\n # Update attribute\n self.mask = new_mask\n\n # Correct i_bounds if it was not specified\n # self.... | [
"0.75237775",
"0.6830645",
"0.6461692",
"0.64357376",
"0.63380176",
"0.6325248",
"0.63241714",
"0.63219225",
"0.63219225",
"0.6279461",
"0.62621343",
"0.6258309",
"0.61555755",
"0.6138366",
"0.6099952",
"0.60500365",
"0.59804887",
"0.59581435",
"0.5953628",
"0.58981764",
"0.5... | 0.75807804 | 0 |
Updates the depth target/mask. Sets depth mask to the object distance value where the object resides | def _update_depth_mask(self, bbox_coords, mask_coords):
# Compute object distance in camera coordinates
distance = np.linalg.norm(bbox_coords)
# Set target/mask bounding box to distance value
self.depth_mask[0, mask_coords[1]:mask_coords[3], mask_coords[0]:mask_coords[2]]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_depth_image(self, depth_image):\n depth_image = depth_image.copy()\n mask = np.where(self.depth != 0)\n depth_image[mask] = self.depth[mask]\n return depth_image",
"def set_depth(self, d):\r\n self.depth = d",
"def update(self):\n\n obstVals = self.robot.getDept... | [
"0.65219533",
"0.6309409",
"0.60920554",
"0.6080584",
"0.58906686",
"0.5660977",
"0.56466246",
"0.56459874",
"0.5601333",
"0.55544955",
"0.5519529",
"0.54683584",
"0.54389834",
"0.54141563",
"0.54045874",
"0.5251762",
"0.5218233",
"0.5212886",
"0.5203349",
"0.5186193",
"0.512... | 0.7949633 | 0 |
Get shrink factor 0.2 for don't care classes, otherwise 0.5. | def _get_shrink_factor(self, obj_class):
return 0.5 if obj_class == 1 else 0.2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shrink(value):\n return (1 + value) / 2",
"def _shrink_main(self, amt):\n self.ratio -= amt\n self.ratio = max(self.min_ratio, self.ratio)",
"def _shrink_solo_secondary(self, amt):\n self.ratio += amt\n self.ratio = min(self.max_ratio, self.ratio)",
"def shrink(self):\n... | [
"0.6753253",
"0.6477864",
"0.6349043",
"0.6325587",
"0.62213475",
"0.6212219",
"0.59073776",
"0.5755183",
"0.5662071",
"0.5660799",
"0.55830854",
"0.5568108",
"0.5534276",
"0.55322623",
"0.5520105",
"0.54937047",
"0.54918087",
"0.54691523",
"0.54646486",
"0.5417098",
"0.54150... | 0.8377038 | 0 |
Get bounding box coordinates mapped to target/mask coordinates. | def _get_mask_coords(self, obj, shrink_factor):
# split bounding box into x,y coordinates
xmin, ymin, xmax, ymax = np.split(obj.bounding_box, len(obj.bounding_box))
# compute bounding box center coordinate
bbox_center = np.array([xmin + (xmax - xmin) / 2, ymin + (ymax - y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bounding_box(self):\n latlon00 = self.ij_to_latlon(-1,-1)\n latlon01 = self.ij_to_latlon(-1,self.domain_size[1]+1)\n latlon11 = self.ij_to_latlon(self.domain_size[0]+1,self.domain_size[1]+1)\n latlon10 = self.ij_to_latlon(self.domain_size[0]+1,-1)\n return (latlon00,latlon01,... | [
"0.72255194",
"0.7148642",
"0.7067591",
"0.6957974",
"0.68591",
"0.68346167",
"0.6829538",
"0.6804426",
"0.6800595",
"0.67711234",
"0.6754198",
"0.6741878",
"0.6736427",
"0.67342806",
"0.67342806",
"0.6726432",
"0.67016345",
"0.6692683",
"0.6662506",
"0.65757245",
"0.6558426"... | 0.7551965 | 0 |
Generates and writes the results of traversing the root directory, and translating all files in FILES. | def translate_files(root_directory, output_file):
# type: ()
root_depth = len(root_directory.split("/"))
dirs = [d for d in os.walk(root_directory) if d[0].count("/") == root_depth]
sections = get_sections_data(dirs, root_depth=root_depth)
# generate subsection headers
for section, subsectio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_files(self):\n\t\tapply_stemmer, xml_file, query_file, expected_file = self.read_config_file()\n\t\tself.generate_query_file(query_file, xml_file, apply_stemmer)\n\t\tself.generate_expected_file(expected_file, xml_file)\n\t\tlogging.info('FINALIZADO: MÓDULO PROCESSADOR DE CONSULTAS')",
"def _walk_di... | [
"0.64966166",
"0.6460757",
"0.6386852",
"0.6370105",
"0.626249",
"0.62603694",
"0.6221598",
"0.61822647",
"0.6176402",
"0.61323655",
"0.611833",
"0.61116767",
"0.6110516",
"0.6088533",
"0.6053908",
"0.6014351",
"0.5996637",
"0.59711146",
"0.59499",
"0.5925247",
"0.5915936",
... | 0.6501915 | 0 |
2.This is inner function doc | def inner():
print("2This is inner function\n", inner.__name__, inner.__doc__)
func() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def func_doc():",
"def func():",
"def outer(func):\n print(\"1This is outer function\\n\", outer.__name__, outer.__doc__)\n\n # @wraps(func)\n def inner():\n \"\"\"\n 2.This is inner function doc\n \"\"\"\n print(\"2This is inner function\\n\", inner.__name__, inner.__doc__... | [
"0.7314841",
"0.71997875",
"0.6960891",
"0.6956809",
"0.6925443",
"0.67094266",
"0.67094266",
"0.67094266",
"0.67094266",
"0.67094266",
"0.66744035",
"0.6662484",
"0.6639418",
"0.6628781",
"0.6556674",
"0.6535099",
"0.65294397",
"0.65168387",
"0.6515121",
"0.6504789",
"0.6500... | 0.7596468 | 0 |
Only changeable constraint on the factory is the number of oscillators | def __init__(self, n): # this is equivalent to starting a random one
self.n = n
# From table S1 in the supplemental materials
# each c parameters is [body,limb]
self.cv0 = [0.3, 0.0]
self.cv1 = [0.2, 0.2]
self.cR0 = [0.196,0.131]
self.cR1 = [0.065,0.131]
#[[dbodylow,dbodyhigh],[dlimblow,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circuitSat(C):",
"def force(self, osc):\n pass",
"def test_14_missing_nonbonded_handler(self, force_field):\n top = Molecule.from_smiles(\"CCCC\").to_topology()\n\n ff_no_vdw = copy.deepcopy(force_field)\n ff_no_electrostatics = copy.deepcopy(force_field)\n\n ff_no_vdw.de... | [
"0.5257939",
"0.5219081",
"0.5210399",
"0.51840174",
"0.5178341",
"0.51490057",
"0.5104576",
"0.5071589",
"0.5067967",
"0.5032624",
"0.50028354",
"0.499776",
"0.4982781",
"0.49815163",
"0.49683052",
"0.4964372",
"0.49502867",
"0.49500018",
"0.48942435",
"0.48927838",
"0.48829... | 0.55693984 | 0 |
Gets a random number, but makes sure it's not 1 | def safe_rand(self):
rand_n = np.random.rand()
if rand_n == float(1):
rand_n -= 1e-10
return rand_n | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maybe(self):\n return random.getrandbits(1)",
"def random_number():\n return random.randint(0, 9999)",
"def random_number():\n random_num = random.choice(empty)\n return random_num",
"def getRandom(self) -> int:",
"def getRandom(self) -> int:",
"def gen_unused_random_num(self):\n ... | [
"0.7610754",
"0.73537326",
"0.72561806",
"0.7106875",
"0.7106875",
"0.7073731",
"0.70407534",
"0.70076555",
"0.6958358",
"0.6942665",
"0.6919138",
"0.6918378",
"0.6899967",
"0.68962634",
"0.68693054",
"0.68458706",
"0.67763877",
"0.675229",
"0.675229",
"0.6742172",
"0.6728175... | 0.7573157 | 1 |
This method will create a button into footer layout | def create_footer_push_button(self, text, shortcut=None, connection=None):
button = QtGui.QPushButton(self.commander_window.footer_container)
button.setFont(self.font)
button.setText(text)
if (shortcut is not None):
button.setShortcut(shortcut)
if connection is ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_footer_panel(self):\r\n self.create_footer_push_button(\"F3 View\", \"F3\")\r\n self.create_footer_push_button(\"F4 Edit\", \"F4\")\r\n self.create_footer_push_button(\"F5 Copy\", \"F5\")\r\n self.create_footer_push_button(\"F6 move\", \"F6\")\r\n self.create_footer_pus... | [
"0.7278086",
"0.6899661",
"0.6563083",
"0.6563083",
"0.6352914",
"0.6226975",
"0.6212638",
"0.6148312",
"0.6068258",
"0.60441864",
"0.6039494",
"0.60364026",
"0.6031277",
"0.60041994",
"0.5968427",
"0.59683055",
"0.59562105",
"0.59323615",
"0.5884248",
"0.5879663",
"0.5878796... | 0.73384935 | 0 |
Chain and apply a list of contexts | def nested(*contexts):
with ExitStack() as stack:
for ctx in contexts:
stack.enter_context(ctx())
yield contexts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enrich_context(self, ctx: Context) -> Context:\n new_ctx = Context(ctx.expressions[:], ctx.namespace)\n for _ in range(self.expression_levels):\n new_ctx.extend(list(self.properties(new_ctx)))\n new_ctx.extend(list(self.unary_ops(new_ctx)))\n new_ctx.extend(list(s... | [
"0.6205127",
"0.6081701",
"0.5970155",
"0.58488804",
"0.57370806",
"0.57311106",
"0.5634332",
"0.56243086",
"0.56219083",
"0.55781084",
"0.55662006",
"0.5537953",
"0.5528676",
"0.55269414",
"0.5448107",
"0.54284644",
"0.541528",
"0.541528",
"0.5412888",
"0.5401186",
"0.534449... | 0.6755412 | 0 |
Returns True if filename1 has a newer modification time than filename2. | def is_newer(filename1, filename2):
return os.stat(filename1).st_mtime > os.stat(filename2).st_mtime | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_newer(a, b):\n return os.stat(a).st_mtime >= os.stat(b).st_mtime",
"def _newer(a: str, b: str) -> bool:\n if not os.path.exists(a):\n return False\n if not os.path.exists(b):\n return True\n return os.path.getmtime(a) >= os.path.getmtime(b)",
"def file_is_modified(filename, lastu... | [
"0.8237509",
"0.8148441",
"0.80743307",
"0.80290496",
"0.79828465",
"0.7979174",
"0.79657996",
"0.7751328",
"0.77098334",
"0.7662028",
"0.75494844",
"0.75325197",
"0.7447955",
"0.729623",
"0.7292164",
"0.7270774",
"0.7239093",
"0.69227624",
"0.69209176",
"0.69137496",
"0.6862... | 0.905768 | 0 |
Run SWIG if its outputs are missing or out of date. | def maybe_run_swig(wrapper_filename, module_name, base_directory,
extra_deps=None):
module_filename = 'python/bllipparser/%s.py' % module_name
swig_filename = join(base_directory, 'swig', 'wrapper.i')
extra_deps = extra_deps or []
if exists(wrapper_filename) and exists(module_filename... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compile_python(self):\n if(self.input == \"\"):\n stdout = subprocess.run(\n [\"python\", self.id+\".py\"], stdout=subprocess.PIPE).stdout.decode('utf-8')\n self.output = stdout\n if(len(stdout) == 0):\n self.output = subprocess.run(\n ... | [
"0.52748847",
"0.5227529",
"0.5040352",
"0.50146484",
"0.4976926",
"0.4908266",
"0.48579365",
"0.4817482",
"0.48093262",
"0.4803266",
"0.47972724",
"0.47972095",
"0.47310168",
"0.47299778",
"0.47203964",
"0.4704658",
"0.46845943",
"0.46779928",
"0.46702075",
"0.4669818",
"0.4... | 0.5256493 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.