query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Compute and set the additional terms to fix the boundary values. | def set_rhs(self):
k = self.istore[:, 0]
ksym = self.stencil.get_symmetric()[k]
self.rhs[:] = self.feq[k, np.arange(k.size)] + self.feq[ksym, np.arange(k.size)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculateElementBoundaryCoefficients(self):\n pass",
"def update(self):\n\n terms_toRemove = []\n\n for termIndex, [term_constantFactor, term_unknowns_attributeAddresses] in enumerate(self.LHS):\n\n # Check if coefficient is 0 - then no need to process any of the unknowns sinc... | [
"0.59795195",
"0.59593534",
"0.59029657",
"0.5858965",
"0.5807507",
"0.57855296",
"0.5666215",
"0.56404054",
"0.5586411",
"0.55528814",
"0.5532069",
"0.5490089",
"0.5433044",
"0.5425666",
"0.5417814",
"0.54099035",
"0.54036355",
"0.53493434",
"0.5337206",
"0.5327755",
"0.5323... | 0.5336063 | 20 |
Generate the numerical code. | def generate(self, sorder):
from .generator import For
from .symbolic import nx, ny, nz, indexed, ix
ns = int(self.stencil.nv_ptr[-1])
dim = self.stencil.dim
istore, iload, ncond = self._get_istore_iload_symb(dim)
rhs, _ = self._get_rhs_dist_symb(ncond)
idx = I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def code(self):\n if not self._code:\n filename = '<fluxtools function %s>' % self.tag\n self._code = compile(self.math, filename, mode='eval')\n return self._code",
"def _get_random_number_code(self):\r\n return \"str(random.randint(0, 1e9))\"",
"def number(self):",
... | [
"0.66350216",
"0.6155325",
"0.6070667",
"0.60567296",
"0.6001382",
"0.5999806",
"0.5950534",
"0.5930682",
"0.58927596",
"0.5881666",
"0.5805855",
"0.57972014",
"0.5767194",
"0.5750545",
"0.5731919",
"0.5724899",
"0.57187545",
"0.56876415",
"0.5651061",
"0.564188",
"0.5631152"... | 0.0 | -1 |
Compute and set the additional terms to fix the boundary values. | def set_rhs(self):
k = self.istore[:, 0]
ksym = self.stencil.get_symmetric()[k]
self.rhs[:] = self.feq[k, np.arange(k.size)] + self.feq[ksym, np.arange(k.size)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculateElementBoundaryCoefficients(self):\n pass",
"def update(self):\n\n terms_toRemove = []\n\n for termIndex, [term_constantFactor, term_unknowns_attributeAddresses] in enumerate(self.LHS):\n\n # Check if coefficient is 0 - then no need to process any of the unknowns sinc... | [
"0.59818715",
"0.59583765",
"0.5903426",
"0.5859693",
"0.58076525",
"0.5784628",
"0.5665552",
"0.5640563",
"0.5586638",
"0.5551454",
"0.5532172",
"0.5490747",
"0.54334694",
"0.5426477",
"0.5416738",
"0.54091454",
"0.54014874",
"0.5349996",
"0.5336917",
"0.5327792",
"0.5323509... | 0.5335465 | 19 |
Generate the numerical code. | def generate(self, sorder):
from .generator import For
from .symbolic import nx, ny, nz, indexed, ix
ns = int(self.stencil.nv_ptr[-1])
dim = self.stencil.dim
istore, iload, ncond = self._get_istore_iload_symb(dim)
rhs, dist = self._get_rhs_dist_symb(ncond)
idx ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def code(self):\n if not self._code:\n filename = '<fluxtools function %s>' % self.tag\n self._code = compile(self.math, filename, mode='eval')\n return self._code",
"def _get_random_number_code(self):\r\n return \"str(random.randint(0, 1e9))\"",
"def number(self):",
... | [
"0.66350216",
"0.6155325",
"0.6070667",
"0.60567296",
"0.6001382",
"0.5999806",
"0.5950534",
"0.5930682",
"0.58927596",
"0.5881666",
"0.5805855",
"0.57972014",
"0.5767194",
"0.5750545",
"0.5731919",
"0.5724899",
"0.57187545",
"0.56876415",
"0.5651061",
"0.564188",
"0.5631152"... | 0.0 | -1 |
Compute and set the additional terms to fix the boundary values. | def set_rhs(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculateElementBoundaryCoefficients(self):\n pass",
"def update(self):\n\n terms_toRemove = []\n\n for termIndex, [term_constantFactor, term_unknowns_attributeAddresses] in enumerate(self.LHS):\n\n # Check if coefficient is 0 - then no need to process any of the unknowns sinc... | [
"0.59795195",
"0.59593534",
"0.59029657",
"0.5858965",
"0.5807507",
"0.57855296",
"0.5666215",
"0.56404054",
"0.5586411",
"0.55528814",
"0.5532069",
"0.5490089",
"0.5433044",
"0.5425666",
"0.5417814",
"0.54099035",
"0.54036355",
"0.53493434",
"0.5337206",
"0.5336063",
"0.5336... | 0.0 | -1 |
Compute the indices that are needed (symmertic velocities and space indices). | def set_iload(self):
k = self.istore[0]
v = self.stencil.get_all_velocities()
indices = self.istore[1:] + v[k].T
self.iload.append(np.concatenate([k[np.newaxis, :], indices])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indices_and_currents_TSC_2D( charge_electron, positions_x, positions_y, velocity_x, velocity_y,\\\n x_grid, y_grid, ghost_cells, length_domain_x, length_domain_y, dt ):\n \n \n positions_x_new = positions_x + velocity_x * dt\n positions_y_new = positions_y + velo... | [
"0.70419675",
"0.62284124",
"0.6213257",
"0.611954",
"0.60510486",
"0.6049286",
"0.5997913",
"0.59762084",
"0.59722364",
"0.59624285",
"0.59264815",
"0.5918985",
"0.5917044",
"0.5899683",
"0.5850105",
"0.5789762",
"0.5780625",
"0.5772434",
"0.57269186",
"0.5724286",
"0.570891... | 0.0 | -1 |
Generate the numerical code. | def generate(self, sorder):
from .generator import For
from .symbolic import nx, ny, nz, indexed, ix
ns = int(self.stencil.nv_ptr[-1])
dim = self.stencil.dim
istore, iload, ncond = self._get_istore_iload_symb(dim)
idx = Idx(ix, (0, ncond))
fstore = indexed(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def code(self):\n if not self._code:\n filename = '<fluxtools function %s>' % self.tag\n self._code = compile(self.math, filename, mode='eval')\n return self._code",
"def _get_random_number_code(self):\r\n return \"str(random.randint(0, 1e9))\"",
"def number(self):",
... | [
"0.66350216",
"0.6155325",
"0.6070667",
"0.60567296",
"0.6001382",
"0.5999806",
"0.5950534",
"0.5930682",
"0.58927596",
"0.5881666",
"0.5805855",
"0.57972014",
"0.5767194",
"0.5750545",
"0.5731919",
"0.5724899",
"0.57187545",
"0.56876415",
"0.5651061",
"0.564188",
"0.5631152"... | 0.0 | -1 |
Return the generated function | def function(self):
return self.generator.module.neumann | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFunction(self) -> ghidra.program.model.listing.Function:\n ...",
"def gen_function(self, function):\n if function.body:\n self.gen_function_def(function)",
"def func ( self ) :\n return self.__func",
"def func ( self ) :\n return self.__func",
"def __call... | [
"0.72852004",
"0.7195862",
"0.7117405",
"0.70892036",
"0.7076999",
"0.6858654",
"0.6826619",
"0.67727506",
"0.67657286",
"0.6740471",
"0.67363507",
"0.67158663",
"0.6688514",
"0.6664095",
"0.665405",
"0.6650802",
"0.66507447",
"0.66498697",
"0.6646827",
"0.6641116",
"0.66322"... | 0.6363463 | 32 |
Compute the indices that are needed (symmertic velocities and space indices). | def set_iload(self):
k = self.istore[0]
v = self.stencil.get_all_velocities()
indices = self.istore[1:].copy()
indices[0] += v[k].T[0]
self.iload.append(np.concatenate([k[np.newaxis, :], indices])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indices_and_currents_TSC_2D( charge_electron, positions_x, positions_y, velocity_x, velocity_y,\\\n x_grid, y_grid, ghost_cells, length_domain_x, length_domain_y, dt ):\n \n \n positions_x_new = positions_x + velocity_x * dt\n positions_y_new = positions_y + velo... | [
"0.70425975",
"0.6227534",
"0.621245",
"0.61198896",
"0.6050179",
"0.60492086",
"0.59963256",
"0.59747845",
"0.5971784",
"0.5960889",
"0.5925465",
"0.5918824",
"0.5916217",
"0.5899766",
"0.5848567",
"0.5788059",
"0.5782234",
"0.5770706",
"0.5726879",
"0.5722692",
"0.5709878",... | 0.0 | -1 |
Return the generated function | def function(self):
return self.generator.module.neumannx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFunction(self) -> ghidra.program.model.listing.Function:\n ...",
"def gen_function(self, function):\n if function.body:\n self.gen_function_def(function)",
"def func ( self ) :\n return self.__func",
"def func ( self ) :\n return self.__func",
"def __call... | [
"0.72852004",
"0.7195862",
"0.7117405",
"0.70892036",
"0.7076999",
"0.6858654",
"0.6826619",
"0.67727506",
"0.67657286",
"0.6740471",
"0.67363507",
"0.67158663",
"0.6688514",
"0.6664095",
"0.665405",
"0.6650802",
"0.66507447",
"0.66498697",
"0.6646827",
"0.6641116",
"0.662811... | 0.66322 | 20 |
Compute the indices that are needed (symmertic velocities and space indices). | def set_iload(self):
k = self.istore[0]
v = self.stencil.get_all_velocities()
indices = self.istore[1:].copy()
indices[1] += v[k].T[1]
self.iload.append(np.concatenate([k[np.newaxis, :], indices])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indices_and_currents_TSC_2D( charge_electron, positions_x, positions_y, velocity_x, velocity_y,\\\n x_grid, y_grid, ghost_cells, length_domain_x, length_domain_y, dt ):\n \n \n positions_x_new = positions_x + velocity_x * dt\n positions_y_new = positions_y + velo... | [
"0.70419675",
"0.62284124",
"0.6213257",
"0.611954",
"0.60510486",
"0.6049286",
"0.5997913",
"0.59762084",
"0.59722364",
"0.59624285",
"0.59264815",
"0.5918985",
"0.5917044",
"0.5899683",
"0.5850105",
"0.5789762",
"0.5780625",
"0.5772434",
"0.57269186",
"0.5724286",
"0.570891... | 0.0 | -1 |
Return the generated function | def function(self):
return self.generator.module.neumanny | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFunction(self) -> ghidra.program.model.listing.Function:\n ...",
"def gen_function(self, function):\n if function.body:\n self.gen_function_def(function)",
"def func ( self ) :\n return self.__func",
"def func ( self ) :\n return self.__func",
"def __call... | [
"0.72852004",
"0.7195862",
"0.7117405",
"0.70892036",
"0.7076999",
"0.6858654",
"0.6826619",
"0.67727506",
"0.67657286",
"0.6740471",
"0.67363507",
"0.67158663",
"0.6688514",
"0.6664095",
"0.665405",
"0.6650802",
"0.66507447",
"0.66498697",
"0.6646827",
"0.6641116",
"0.66322"... | 0.6605331 | 22 |
Compute the indices that are needed (symmertic velocities and space indices). | def set_iload(self):
k = self.istore[0]
v = self.stencil.get_all_velocities()
indices = self.istore[1:].copy()
indices[1] += v[k].T[2]
self.iload.append(np.concatenate([k[np.newaxis, :], indices])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indices_and_currents_TSC_2D( charge_electron, positions_x, positions_y, velocity_x, velocity_y,\\\n x_grid, y_grid, ghost_cells, length_domain_x, length_domain_y, dt ):\n \n \n positions_x_new = positions_x + velocity_x * dt\n positions_y_new = positions_y + velo... | [
"0.70425975",
"0.6227534",
"0.621245",
"0.61198896",
"0.6050179",
"0.60492086",
"0.59963256",
"0.59747845",
"0.5971784",
"0.5960889",
"0.5925465",
"0.5918824",
"0.5916217",
"0.5899766",
"0.5848567",
"0.5788059",
"0.5782234",
"0.5770706",
"0.5726879",
"0.5722692",
"0.5709878",... | 0.0 | -1 |
Return the generated function | def function(self):
return self.generator.module.neumannz | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFunction(self) -> ghidra.program.model.listing.Function:\n ...",
"def gen_function(self, function):\n if function.body:\n self.gen_function_def(function)",
"def func ( self ) :\n return self.__func",
"def func ( self ) :\n return self.__func",
"def __call... | [
"0.72852004",
"0.7195862",
"0.7117405",
"0.70892036",
"0.7076999",
"0.6858654",
"0.6826619",
"0.67727506",
"0.67657286",
"0.6740471",
"0.67363507",
"0.67158663",
"0.6688514",
"0.6664095",
"0.665405",
"0.6650802",
"0.66507447",
"0.66498697",
"0.6641116",
"0.66322",
"0.6628116"... | 0.6646827 | 18 |
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 |
Creates a userconfiguration file from parsed config. | def write_config(config, path=None):
if path is None:
path = DEFAULT_USER_CONFIG_PATH
resolved_path = os.path.expanduser(path)
with open(resolved_path, 'w') as handle:
json.dump(config, handle, sort_keys=True, indent=2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_user_configuration(self):\n\n # Ask before touching things that we do not have to!\n if self.test.user_conf_dir_exists():\n if self.test.user_configuration_seems_complete():\n reply = question(_(\"\"\"User configuration already exists.\nDo you want to rewrite it w... | [
"0.750904",
"0.6991964",
"0.6753383",
"0.6708797",
"0.66641486",
"0.6620675",
"0.6581631",
"0.6437616",
"0.64069575",
"0.6344565",
"0.6332564",
"0.6320944",
"0.6292687",
"0.62678665",
"0.62563795",
"0.6217484",
"0.6217484",
"0.6213526",
"0.6195734",
"0.61852133",
"0.6181315",... | 0.56547564 | 59 |
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 |
Create NodeCache instance in the database. | def post(node, graph_id, user_id):
assert node.node_running_status == NodeRunningStatus.SUCCESS, \
'Only Nodes with status SUCCESS can be cached'
node_cache = NodeCache.instantiate(node=node, graph_id=graph_id, user_id=user_id)
try:
node_cache.save()
except Except... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create(self, context, values):\n # initialize load stats from existing instances:\n compute_node = db.compute_node_create(context, values)\n return compute_node",
"def create_db_from_cache():\n with open('matches.cache', 'rb') as f:\n matches = pickle.load(f)\n\n Base.metad... | [
"0.62799",
"0.59791917",
"0.5849203",
"0.58280236",
"0.5817658",
"0.57958704",
"0.5713235",
"0.5698713",
"0.5695268",
"0.5674498",
"0.55803335",
"0.55680156",
"0.5558763",
"0.5550643",
"0.55430365",
"0.5531078",
"0.54658306",
"0.54646295",
"0.54312724",
"0.53560394",
"0.53405... | 0.49762714 | 69 |
Calculate the observatory location. Returns | def to_location(self) -> EarthLocation:
# Height is not in some MegaPrime files. Use the value from
# EarthLocation.of_site("CFHT")
# Some data uses OBS-LONG, OBS-LAT, other data uses LONGITUD and
# LATITUDE
for long_key, lat_key in (("LONGITUD", "LATITUDE"), ("OBS-LONG", "OBS-LA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimated_location(self):\n return (self._estimates[0].item(0), self._estimates[1].item(0))",
"def get_location(self):\n\t\treturn self.location",
"def get_location(self):\n self.location = self.func(0)",
"def test_locate():\n x, y = hyperbolic_location.locate(-.290955, -.08254229)\n ... | [
"0.6680042",
"0.6484028",
"0.6425583",
"0.6402367",
"0.6397473",
"0.63841724",
"0.6343334",
"0.6329351",
"0.62999535",
"0.62639654",
"0.62436247",
"0.6192284",
"0.6180112",
"0.61795115",
"0.61183375",
"0.60999835",
"0.60999835",
"0.60999835",
"0.60999835",
"0.60999835",
"0.60... | 0.57059807 | 85 |
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 |
Return the lifetime exposure number. Returns | def to_observation_counter(self) -> int:
return self.to_exposure_id() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_exposure(self):\n exposure = float(self._driver.ExposureTime)\n\n return exposure",
"def lifetime(self) -> str:\n return pulumi.get(self, \"lifetime\")",
"def get_life(self):\n return self.life",
"def exposuretime(self):\n _, = self.exposuretimes\n return _",
"def ... | [
"0.68661416",
"0.6797006",
"0.661743",
"0.6530258",
"0.64460176",
"0.6445488",
"0.6433524",
"0.63488317",
"0.6323735",
"0.6315333",
"0.63136095",
"0.6303788",
"0.6302292",
"0.6228902",
"0.6205906",
"0.6149555",
"0.61349577",
"0.6120186",
"0.60959166",
"0.6037626",
"0.5971728"... | 0.6145864 | 16 |
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 |
Serialize SQLAlchemy object to dictionary. | def sa_to_dict(obj):
return {c.key: getattr(obj, c.key)
for c in inspect(obj).mapper.column_attrs} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def asdict(self):\n statement_schema = StatementModelSchema()\n d = statement_schema.dump(self._dao)\n return d",
"def to_dict(self):\n dictionary = {}\n for column in self.__table__.columns:\n attribute_field_name = self.__mapper__.get_property_by_column(column).key... | [
"0.76464015",
"0.7328274",
"0.73226994",
"0.7236185",
"0.719969",
"0.70151955",
"0.69934994",
"0.69674635",
"0.69215274",
"0.68898493",
"0.6866162",
"0.68403447",
"0.6808783",
"0.6797569",
"0.6794087",
"0.6793661",
"0.6781779",
"0.6777605",
"0.6764684",
"0.6752057",
"0.674954... | 0.7069807 | 5 |
Auth Menu switch Login to use OpenID Connect | def menu_auth(cls, **attr):
auth = current.auth
logged_in = auth.is_logged_in()
settings = current.deployment_settings
if not logged_in:
request = current.request
login_next = URL(args=request.args, vars=request.vars)
if request.controller == "defaul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login():",
"def login():",
"def initiateAuthentication(identity_url, return_to=None):",
"def login(self):",
"def login():\n if app.testing:\n callback_url = url_for('user.authorize', _external=True)\n else:\n callback_url = 'https://codegolf.uqcs.org.au/user/authorize'\n return g... | [
"0.71388483",
"0.71388483",
"0.6891064",
"0.68861467",
"0.68709046",
"0.6783507",
"0.67294157",
"0.67179984",
"0.66789436",
"0.66674465",
"0.663989",
"0.6633224",
"0.66295797",
"0.6565496",
"0.6559034",
"0.65544856",
"0.65217584",
"0.65114063",
"0.64986426",
"0.6490752",
"0.6... | 0.6336725 | 33 |
Create a Scene object. | def __init__(self, *args, **kwargs):
super(Scene, self).__init__(*args, **kwargs)
self.setVar('category', 'scene') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_scene(self):\n \n self.scene=soya.World()",
"def create_scene(self, ):\n self.scene = create_scene(\n self.opt.splats_img_size, self.opt.splats_img_size, self.opt.fovy,\n self.opt.focal_length, self.opt.n_splats)",
"def create_scene():\n create_floor()\n ... | [
"0.7832718",
"0.76829076",
"0.7040221",
"0.69955343",
"0.69914776",
"0.69503456",
"0.68929964",
"0.67952603",
"0.6792957",
"0.6753707",
"0.6751715",
"0.6731313",
"0.6670138",
"0.6670138",
"0.66369474",
"0.65667254",
"0.65181655",
"0.64593786",
"0.64564496",
"0.6450259",
"0.64... | 0.61484694 | 26 |
Return the list of available extensions, to be implemented by derived classes. | def extensions(cls):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_loaded_extensions():\n raise NotImplementedError()",
"def get_required_extensions(self):\n return []",
"def extensions(self):\n raise NotImplementedError()",
"def get_available_extensions() -> DefaultDict[str, Type]:\n all_extensions:DefaultDict[str, Type] = defaultdict(lambda... | [
"0.8125247",
"0.80731523",
"0.7844905",
"0.77494496",
"0.75891924",
"0.758615",
"0.75837237",
"0.7478737",
"0.7478737",
"0.7470386",
"0.74068",
"0.7382638",
"0.7361191",
"0.7354775",
"0.73068315",
"0.7257618",
"0.7096631",
"0.70392513",
"0.6903825",
"0.6895035",
"0.67996925",... | 0.7740971 | 4 |
Process any optional arguments and possitional parameters | def processArgs(self, argv):
parser = OptionParser(usage=usage)
parser.add_option("-a", "--show_ADT", action="store_true", dest="show_ADT",
default=self.show_ADT, help="Display ADT value if set")
parser.add_option("-f", "--show_file", action="store_true", dest="show_fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_arguments(args):",
"def _parse_args(self, prepared_args):\n pass",
"def main(argv,required_arg,required_arg_type,optional_arg):\n \n # add optional_arguments to the parser\n for option in optional_arg:\n parse_option_dictionary[option]()\n \n # parse the command line\n ... | [
"0.7215743",
"0.6924504",
"0.68715715",
"0.68603635",
"0.6783448",
"0.67792857",
"0.669949",
"0.6610936",
"0.6575572",
"0.6509517",
"0.6500486",
"0.647975",
"0.64615744",
"0.64570296",
"0.6367332",
"0.63595396",
"0.6357109",
"0.6329407",
"0.632741",
"0.6317397",
"0.6285903",
... | 0.617315 | 37 |
the number of documents we got right | def get_nTruePositive(atrank, was_retrieved, gt_ranks):
TP = (np.logical_and(was_retrieved, gt_ranks <= atrank)).sum()
return TP | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def document_count(self):\n raise NotImplementedError",
"def doc_count(self):\n\t\treturn self.index.collection.count()",
"def __len__(self):\n return self.document_count",
"def get_total_number_of_documents(self):\n return self.total_number_of_documents",
"def __len__(self):\r\n ... | [
"0.83720297",
"0.834611",
"0.83426446",
"0.8186256",
"0.8172876",
"0.78365326",
"0.78216237",
"0.77700126",
"0.77594185",
"0.7749482",
"0.7686178",
"0.7670736",
"0.75798994",
"0.7450507",
"0.741355",
"0.72773093",
"0.72747123",
"0.7238578",
"0.71736395",
"0.7167141",
"0.71604... | 0.0 | -1 |
the number of documents we should have retrieved but didn't | def get_nFalseNegative(TP, atrank, nGroundTruth):
#FN = min((atrank + 1) - TP, nGroundTruth - TP)
#nRetreived = (atrank + 1)
FN = nGroundTruth - TP
#min(atrank, nGroundTruth - TP)
return FN | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __len__(self):\r\n return self.docs.count()",
"def doc_count(self):\n\t\treturn self.index.collection.count()",
"def __len__(self):\n return self.document_count",
"def document_count(self):\n raise NotImplementedError",
"def doc_count_all(self):\n\t\treturn self.index.collection.co... | [
"0.8096928",
"0.790599",
"0.7844378",
"0.7638665",
"0.76131916",
"0.7486822",
"0.7358674",
"0.7334013",
"0.7169479",
"0.71640116",
"0.71513176",
"0.7116994",
"0.70835304",
"0.70675343",
"0.7056624",
"0.70289093",
"0.7014927",
"0.6931625",
"0.68957514",
"0.68856764",
"0.685882... | 0.0 | -1 |
the number of documents we should not have retrieved | def get_nFalsePositive(TP, atrank):
#FP = min((atrank + 1) - TP, nGroundTruth)
nRetreived = (atrank + 1)
FP = nRetreived - TP
return FP | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __len__(self):\r\n return self.docs.count()",
"def __len__(self):\n return self.document_count",
"def doc_count(self):\n\t\treturn self.index.collection.count()",
"def document_count(self):\n raise NotImplementedError",
"def get_total_number_of_documents(self):\n return self... | [
"0.8050238",
"0.7914453",
"0.78075784",
"0.7796267",
"0.7544916",
"0.74754614",
"0.745773",
"0.7199693",
"0.71220094",
"0.70604914",
"0.70424837",
"0.70270365",
"0.7021762",
"0.70200664",
"0.69360805",
"0.6910879",
"0.67885685",
"0.676475",
"0.67593163",
"0.6730897",
"0.66790... | 0.0 | -1 |
precision positive predictive value | def get_precision(TP, FP):
precision = TP / (TP + FP)
return precision | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision(y_true, y_pred):\n tp = true_positive(y_true, y_pred)\n fp = false_positive(y_true, y_pred)\n precision = tp / (tp + fp)\n return precision",
"def precision(y_true, y_pred):\n true_positives = bk.sum(bk.round(bk.clip(y_true * y_pred, 0, 1)))\n predicted_positives =... | [
"0.7635932",
"0.7559498",
"0.7515403",
"0.7424766",
"0.74078333",
"0.74078333",
"0.74078333",
"0.74078333",
"0.74078333",
"0.74078333",
"0.7381328",
"0.73782855",
"0.73782855",
"0.73782855",
"0.73782855",
"0.73782855",
"0.73782855",
"0.73782855",
"0.73782855",
"0.73782855",
"... | 0.0 | -1 |
recall, true positive rate, sensitivity, hit rate | def get_recall(TP, FN):
recall = TP / (TP + FN)
return recall | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sensitivity(self):\n return self.recall",
"def sensitivity(\n targets: List[int], preds: List[float], threshold: float = 0.5\n) -> float:\n return recall(targets, preds, threshold)",
"def score(label_recall, label_precision, pred_recall, pred_precision):\n f11 = 6*label_recall*label_precisi... | [
"0.77426684",
"0.70396745",
"0.70071524",
"0.6771298",
"0.67675",
"0.67614913",
"0.67513627",
"0.6729337",
"0.6723114",
"0.67214394",
"0.6714612",
"0.6658525",
"0.6631829",
"0.6629313",
"0.6624552",
"0.66245353",
"0.6585809",
"0.6585809",
"0.6585809",
"0.6585809",
"0.6585809"... | 0.0 | -1 |
gets average percision using the PASCAL definition | def get_average_percision_(qres, ibs=None, gt_aids=None):
recall_range_, p_interp_curve = get_interpolated_precision_vs_recall_(qres, ibs=ibs, gt_aids=gt_aids)
if recall_range_ is None:
ave_p = np.nan
else:
ave_p = p_interp_curve.sum() / p_interp_curve.size
return ave_p | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eval_pascal(pascal, detections):\n ap = 0.0 \n for i in range(pascal_num_class-1):\n ap += eval_pascal_one_class(pascal, detections, i)\n ap = ap / (pascal_num_class-1)\n print('mean average precision = %f' %ap)\n return ap",
"def dishlist_avg_cal(n:list)->float:\r\n all_cal = dishli... | [
"0.7321364",
"0.6577691",
"0.63405305",
"0.62938446",
"0.6174077",
"0.61681235",
"0.61492825",
"0.61433804",
"0.60811687",
"0.6061343",
"0.60367006",
"0.59868914",
"0.59745175",
"0.59686446",
"0.59551746",
"0.58843434",
"0.58834976",
"0.5868898",
"0.58566314",
"0.58496636",
"... | 0.58434695 | 21 |
CHANGE NAME TO REFERENCE QRES | def show_precision_recall_curve_(qres, ibs=None, gt_aids=None, fnum=1):
recall_range_, p_interp_curve = get_interpolated_precision_vs_recall_(qres, ibs=ibs, gt_aids=gt_aids)
title_pref = qres.make_smaller_title() + '\n',
return draw_precision_recall_curve_(recall_range_, p_interp_curve, title_pref, fnum) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reference(self, name):\n pass",
"def ref_name(self, name):\n self._ref_name = name if self._ref_name is None else self._ref_name\n return self",
"def new_name(self,new_name):\n self.name = new_name",
"def named_back_reference(name:str) -> str:\n # TODO error handling \n ... | [
"0.6836514",
"0.68362606",
"0.6407378",
"0.6379306",
"0.6241517",
"0.6167758",
"0.6128833",
"0.61171496",
"0.61073583",
"0.60798806",
"0.6016807",
"0.60081804",
"0.5997102",
"0.5988722",
"0.59712064",
"0.59712064",
"0.5968742",
"0.5943854",
"0.5943854",
"0.5943854",
"0.594385... | 0.0 | -1 |
Generates program that finds y for which f(x1, ..., xn, y) = 0. | def generate_minimization(f: List[Statement], arg_len: int) -> List[Statement]:
minimization: List[Statement] = []
f_memory_len = used_memory_length(f)
aux_mem_len = arg_len + 2 # return register + args + loop counter
# clear memory
minimization.extend(gen_memory_zeroing(aux_mem_len + arg_len + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_zero(f,p1,d):\n if p1 > 10:\n p1 = 0.5\n c = p1 - f(p1)*d/(f(p1+d)-f(p1)) # simple\n \n # we can do this in case derivative diverges because our function is symmetric\n if c < 0:\n c = -c\n \n global n_of_zeros\n \n if n_of_zeros > 8:\n print('Go linear')\n ... | [
"0.61399925",
"0.60997206",
"0.59516954",
"0.58859956",
"0.58479446",
"0.577338",
"0.558315",
"0.55368143",
"0.5526262",
"0.5486189",
"0.5415761",
"0.540245",
"0.5390845",
"0.5369247",
"0.5368873",
"0.53535527",
"0.53404176",
"0.5335395",
"0.5289778",
"0.52180827",
"0.5190449... | 0.0 | -1 |
Single run for a given number os steps | def single_run(steps_number):
values = list()
numerator = 0
for i in trange(1, steps_number):
numerator += generate_episode()
values.append(numerator / i)
return np.array(values) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(self, steps):\n self.sim.run(steps)",
"def run(self, steps = 1000):\n for step in range(steps):\n if self.is_done():\n return\n self.step()",
"def run(self, steps=1000):\n for step in range(steps):\n if self.is_done():\n ... | [
"0.70044",
"0.68988377",
"0.68154496",
"0.68154496",
"0.6612995",
"0.6449993",
"0.63971823",
"0.6374092",
"0.63563573",
"0.63123256",
"0.626952",
"0.62044615",
"0.61865664",
"0.6184564",
"0.6179701",
"0.6162411",
"0.61162704",
"0.6086889",
"0.60608387",
"0.60608387",
"0.6023"... | 0.6324129 | 9 |
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 |
Loads a video from the given file. Will set the number of frames to `nframes` if this parameter is not `None`. | def _raw_numpy_array(video_file, nframes=None):
# Read video
cap = cv2.VideoCapture(video_file)
# Get properties of the video
frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
w = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
h = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
# Min allowed height or width (whatev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_video(self):\r\n if self.file_name=='':\r\n Tk().withdraw()\r\n self.file_name = askopenfilename()\r\n cap = cv2.VideoCapture(self.file_name)\r\n self.length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\r\n self.width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))\... | [
"0.65710473",
"0.6459613",
"0.62718266",
"0.62330824",
"0.6093606",
"0.60301775",
"0.6022871",
"0.59928685",
"0.5897636",
"0.58801794",
"0.5875664",
"0.5825672",
"0.57941103",
"0.57930225",
"0.577602",
"0.5767435",
"0.5738982",
"0.57178634",
"0.5665186",
"0.5660608",
"0.56343... | 0.50752544 | 60 |
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 |
Loads a numpy array of shape (1, nframes, size, size, 2) from a video file. Values contained in the array are based on optical flow of the video. | def flow_data(video_file, size, nframes=None):
# Load video into numpy array, and crop the video
w, h, buf = _raw_numpy_array(video_file, nframes=nframes)
buf = _crop_video(buf, (w, h), size)
num_frames = buf.shape[1]
flow = np.zeros((1, num_frames, size, size, 2), dtype='float32')
# Convert to ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_video(self, filename):\n \n reader = imageio.get_reader(filename, 'ffmpeg')\n \n return np.array(list(reader), dtype=np.float32)",
"def load_video(self):\r\n if self.file_name=='':\r\n Tk().withdraw()\r\n self.file_name = askopenfilename()\r\n ... | [
"0.76876557",
"0.72311604",
"0.7029894",
"0.6971871",
"0.6955259",
"0.6806264",
"0.6686922",
"0.66822153",
"0.66248256",
"0.6546821",
"0.63571465",
"0.63505554",
"0.63026255",
"0.62095934",
"0.6204772",
"0.61235106",
"0.6114424",
"0.605277",
"0.6019937",
"0.59952563",
"0.5959... | 0.6399514 | 10 |
Generates a link allowing the data in a given panda dataframe to be downloaded | def get_table_download_link(df, filename='download', message='Download csv result file'):
csv = df.to_csv(index=False)
b64 = base64.b64encode(csv.encode()).decode() # some strings <-> bytes conversions necessary here
href = f'<a href="data:file/csv;base64,{b64}" download="{filename}.csv" >{message}</a>'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_table_download_link(df, file_name):\n if 'embedding_average' in df.columns:\n df = df.drop(columns='embedding_average')\n # df = results_output.drop(columns='embedding_average')\n # csv = df.to_csv(index=False)\n # b64 = base64.b64encode(csv.encode()).decode() # some strings <-> bytes c... | [
"0.786993",
"0.78147745",
"0.7709416",
"0.7706891",
"0.77059466",
"0.76885927",
"0.7660378",
"0.7650191",
"0.76436126",
"0.76248795",
"0.76117146",
"0.76050746",
"0.75972474",
"0.7583626",
"0.7568017",
"0.74663305",
"0.7448636",
"0.7393948",
"0.7307408",
"0.68121195",
"0.6701... | 0.72904557 | 19 |
Represents a Datastore query. | def __init__(
self,
kind=None,
project=None,
namespace=None,
ancestor=None,
filters=(),
projection=(),
order=(),
distinct_on=(),
limit=None):
self.kind = kind
self.project = project
self.namespace = namespace
self.ancestor = ancestor
self.f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query(self):\n return Query(self)",
"def query(self):\n return Query(from_=self)",
"def query(self):\n return self.__query",
"def query(self):\n \n return self._query",
"def query(self):\n return self._query",
"def query(self):\n return self._query",
... | [
"0.73174983",
"0.7227809",
"0.72243214",
"0.714652",
"0.71254253",
"0.71254253",
"0.71254253",
"0.6894736",
"0.68534136",
"0.68317777",
"0.6830113",
"0.6821971",
"0.6767102",
"0.6731262",
"0.66612524",
"0.6653405",
"0.6631743",
"0.6621195",
"0.6618018",
"0.66041136",
"0.65197... | 0.0 | -1 |
Returns a ``google.cloud.datastore.query.Query`` instance that represents this query. | def _to_client_query(self, client):
ancestor_client_key = None
if self.ancestor is not None:
ancestor_client_key = self.ancestor.to_client_key()
# Resolve ValueProvider arguments.
self.filters = self._set_runtime_filters()
if isinstance(self.namespace, ValueProvider):
self.namespace = s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query(self):\n return Query(self)",
"def query(self):\n return Query(from_=self)",
"def get_query(self):\n return self.query_class(self)",
"def query(cls):\n query_class = cls.query_class\n return query_class(orm_class=cls)",
"def _get_query(self) -> 'Query':\n ... | [
"0.8055353",
"0.80306846",
"0.7937975",
"0.7679866",
"0.7328075",
"0.73262227",
"0.7299006",
"0.7232135",
"0.71646833",
"0.71646833",
"0.71646833",
"0.7115134",
"0.7105565",
"0.684782",
"0.6713211",
"0.66957164",
"0.66461104",
"0.6590604",
"0.65060943",
"0.6438301",
"0.642217... | 0.58400595 | 60 |
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 |
Represents a Datastore key. | def __init__(self,
path_elements, # type: List[Union[Text, int]]
parent=None, # type: Optional[Key]
project=None, # type: Optional[Text]
namespace=None # type: Optional[Text]
):
# Verification or arguments is delegated to to_client_key()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key(self):\n def validate(name):\n '''Compute the key if necessary and validate'''\n found = getattr(self, name)\n value = found() if callable(found) else found\n if value is None:\n raise BadKeyError(\"The key for %s cannot be None\" % self)\n ... | [
"0.7570667",
"0.7357783",
"0.72438025",
"0.7163873",
"0.70719796",
"0.70588857",
"0.7042483",
"0.6992325",
"0.6986345",
"0.69834507",
"0.6945903",
"0.6920999",
"0.69095767",
"0.69095767",
"0.69095767",
"0.69095767",
"0.6909118",
"0.6887839",
"0.6887839",
"0.6846041",
"0.68223... | 0.0 | -1 |
Represents a Datastore entity. Does not support the property value "meaning" field. | def __init__(
self,
key, # type: Key
exclude_from_indexes=() # type: Iterable[str]
):
self.key = key
self.exclude_from_indexes = set(exclude_from_indexes)
self.properties = {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_description(self):\n return \"It is an Entity.\"",
"def entity(self, elem):\n return data.Entity(self, elem)",
"def from_entity(cls, e):\n kwargs = {name: e.get(name) for name, prop in cls._properties.items() if prop.is_id} # we need the id value\n obj = cls(**kwargs)\n ... | [
"0.6141752",
"0.5800165",
"0.5691124",
"0.5638665",
"0.5638665",
"0.55876493",
"0.5560091",
"0.5559322",
"0.55212957",
"0.5492059",
"0.5477315",
"0.54526025",
"0.5423308",
"0.5415894",
"0.5414067",
"0.53362584",
"0.5310104",
"0.5309874",
"0.5288009",
"0.5287465",
"0.52194715"... | 0.0 | -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 |
Creates and saves a User with the given email and password. | def _create_user(self, email, password,
is_staff, is_superuser, **extra_fields):
now = timezone.now()
if not email:
raise ValueError('The given email must be set')
extra_fields['has_ticket'] = False
extra_fields['looking_for_ticket'] = True
extra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_user(self, email, password, **extra_fields):\n if not email:\n raise ValueError('The given email must be set')\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self._db)\n return user",
"def... | [
"0.84163386",
"0.8407691",
"0.8396383",
"0.83900774",
"0.83900774",
"0.83900774",
"0.83818454",
"0.83800155",
"0.83791924",
"0.83788806",
"0.83781564",
"0.83751047",
"0.83726776",
"0.83633083",
"0.83633083",
"0.83633083",
"0.8360308",
"0.8360308",
"0.8347122",
"0.8345504",
"0... | 0.0 | -1 |
AssetManagedDeviceStatus a model defined in Swagger | def __init__(self, object_type=None, cloud_port=None, connection_failure_reason=None, connection_status='Unknown', error_code=None, error_reason=None, process_id=None, server_port=None, state='New'):
self._object_type = None
self._cloud_port = None
self._connection_failure_reason = None
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model_status():\n return juju.CLIENT.Client(request=\"FullStatus\")",
"def status(cls):\n return {'type': 'Emulated camera'}",
"def getStatus():\n return json.dumps({'camera': Camera.status(), 'rover': rover.status()}), 200",
"def status_info(self):\n def subdevice_filter(info):\n ... | [
"0.6091568",
"0.58042765",
"0.5696562",
"0.55435455",
"0.55130535",
"0.53967893",
"0.5393707",
"0.538249",
"0.5330637",
"0.5280761",
"0.5251362",
"0.522015",
"0.521456",
"0.5210073",
"0.52049637",
"0.520454",
"0.5200448",
"0.519575",
"0.5175592",
"0.5169312",
"0.5150628",
"... | 0.0 | -1 |
Gets the object_type of this AssetManagedDeviceStatus. The concrete type of this complex type. The ObjectType property must be set explicitly by API clients when the type is ambiguous. In all other cases, the ObjectType is optional. The type is ambiguous when a managed object contains an array of nested documents, and ... | def object_type(self):
return self._object_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_type(self):\n if not self.Flags & gdef.ACE_OBJECT_TYPE_PRESENT:\n return None\n return self.ObjectType",
"def object_type(self) -> str:\n return pulumi.get(self, \"object_type\")",
"def object_type(self) -> str:\n return pulumi.get(self, \"object_type\")",
"d... | [
"0.67666554",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6751302",
"0.6748769",
"0.670453",
"0.670453",
"0.64563984",
"... | 0.7034013 | 4 |
Sets the object_type of this AssetManagedDeviceStatus. The concrete type of this complex type. The ObjectType property must be set explicitly by API clients when the type is ambiguous. In all other cases, the ObjectType is optional. The type is ambiguous when a managed object contains an array of nested documents, and ... | def object_type(self, object_type):
self._object_type = object_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_type(self, object_type: str):\n allowed_values = [\"actuator\", \"sensor\", \"human\", \"service\", \"skill\", \"task\", \"action\", \"healthdata\",\n \"humanrole\", \"message\", \"permission\", \"preference\", \"property\"] # noqa: E501\n if object_type not in al... | [
"0.755974",
"0.5921794",
"0.575162",
"0.56026995",
"0.56026995",
"0.56026995",
"0.56026995",
"0.56026995",
"0.55906165",
"0.5489738",
"0.54524934",
"0.544844",
"0.5446077",
"0.5446077",
"0.5446077",
"0.5446077",
"0.5446077",
"0.5446077",
"0.5446077",
"0.5446077",
"0.5446077",... | 0.7447152 | 5 |
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 |
Sets the error_code of this AssetManagedDeviceStatus. Maintains code related to error from Device Connector, if any. | def error_code(self, error_code):
self._error_code = error_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_code(self, error_code: int):\n\n self._error_code = error_code",
"def error_code(self, error_code):\n # type: (int) -> None\n\n if error_code is not None:\n if not isinstance(error_code, int):\n raise TypeError(\"Invalid type for `error_code`, type has to ... | [
"0.823226",
"0.7388846",
"0.69936895",
"0.69684315",
"0.6931816",
"0.6875407",
"0.67418885",
"0.671965",
"0.6644302",
"0.6633674",
"0.6613587",
"0.66075647",
"0.6552615",
"0.65236455",
"0.6506306",
"0.6426615",
"0.6309824",
"0.6253544",
"0.6220819",
"0.6220819",
"0.6220819",
... | 0.81758094 | 3 |
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 |
Gets the state of this AssetManagedDeviceStatus. Maintains the state of the Managed Device, such as Start Success, Start Failure, etc. See ManagedDeviceState for device connection states. | def state(self):
return self._state | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state(self) -> 'outputs.DeviceStateResponse':\n return pulumi.get(self, \"state\")",
"def device_state_attributes(self):\n return self._device.status",
"def state(self):\n return self.coordinator.data[METER_DEVICE_TYPE][self.base_unique_id][METER_STATE]",
"def state(self):\n r... | [
"0.68895024",
"0.68079215",
"0.66896343",
"0.66657823",
"0.65847945",
"0.64756274",
"0.64477634",
"0.63459176",
"0.62486476",
"0.61321944",
"0.6100846",
"0.6098232",
"0.60503274",
"0.6047438",
"0.6041383",
"0.60354865",
"0.6020574",
"0.600182",
"0.59860885",
"0.5965785",
"0.5... | 0.0 | -1 |
Sets the state of this AssetManagedDeviceStatus. Maintains the state of the Managed Device, such as Start Success, Start Failure, etc. See ManagedDeviceState for device connection states. | def state(self, state):
allowed_values = ["New", "StartSent", "StartSentFailure", "StartSuccess", "StartFailure", "UpdateSentFailure", "UpdateSent", "DeleteSentFailure", "DeleteInProgress", "DeleteFailure", "DeleteSuccess"]
if state not in allowed_values:
raise ValueError(
"I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_device_state(self, nDeviceState):\n\t\tcall_sdk_function('PrlSrvCfgDev_SetDeviceState', self.handle, nDeviceState)",
"def set_state(self, value):\n self.state = value",
"def status(self, value: ControllerStatus):\n self._status = value\n self.__status_event.set()",
"def set_state... | [
"0.60389864",
"0.5972169",
"0.59455454",
"0.586358",
"0.5798277",
"0.5724633",
"0.5717964",
"0.56944805",
"0.5671291",
"0.5637626",
"0.5637626",
"0.5637626",
"0.56337774",
"0.55684006",
"0.55684006",
"0.55684006",
"0.55684006",
"0.55684006",
"0.55684006",
"0.55684006",
"0.556... | 0.0 | -1 |
Returns the model properties as a dict | def to_dict(self):
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_dict(self):\n return self.properties",
"def to_dict(self):\n return self.properties",
"def get_properties(self):\n return self.properties",
"def asdict(self):\n return self._prop_dict",
"def json(self):\n rv = {\n prop: getattr(self, prop)\n f... | [
"0.7751993",
"0.7751993",
"0.73391134",
"0.7334895",
"0.7297356",
"0.727818",
"0.7159078",
"0.71578115",
"0.71494967",
"0.71494967",
"0.71283495",
"0.71275014",
"0.7122587",
"0.71079814",
"0.7060394",
"0.7043251",
"0.7034103",
"0.70233124",
"0.69635814",
"0.69586295",
"0.6900... | 0.0 | -1 |
Returns the string representation of the model | def to_str(self):
return pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ... | [
"0.85856473",
"0.7816244",
"0.77898955",
"0.77511245",
"0.77511245",
"0.7712556",
"0.76984036",
"0.766997",
"0.7650706",
"0.7601334",
"0.7583777",
"0.7571045",
"0.75404567",
"0.7523676",
"0.7515677",
"0.7501507",
"0.7488033",
"0.7488033",
"0.74696296",
"0.7452353",
"0.7446052... | 0.0 | -1 |
For `print` and `pprint` | def __repr__(self):
return self.to_str() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)",
"def print_out():\n pass",
"def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)",
"def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)",
"def _printable(self):\n ... | [
"0.75577617",
"0.73375154",
"0.6986672",
"0.698475",
"0.6944995",
"0.692333",
"0.6899106",
"0.6898902",
"0.68146646",
"0.6806209",
"0.6753795",
"0.67497987",
"0.6744008",
"0.6700308",
"0.6691256",
"0.6674591",
"0.6658083",
"0.66091245",
"0.6606931",
"0.6601862",
"0.6563738",
... | 0.0 | -1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, AssetManagedDeviceStatus):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Create and return a new `Snippet` instance, given the validated data. | def create(self, validated_data):
return Crawl.objects.create(**validated_data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(self, validated_data: dict) -> Snippet:\n return Snippet.objects.create(**validated_data)",
"def create(self, validated_data):\n return Snippet.objects.create(**validated_data)",
"def create(self, validated_data):\r\n return Snippet.objects.create(**validated_data)",
"def upda... | [
"0.81940943",
"0.8129525",
"0.79541415",
"0.62260485",
"0.5692621",
"0.5644111",
"0.5435174",
"0.5431034",
"0.53386927",
"0.5248465",
"0.5156116",
"0.51490825",
"0.5114162",
"0.49924678",
"0.49488798",
"0.4938365",
"0.49041247",
"0.48993644",
"0.48993644",
"0.48960307",
"0.48... | 0.511845 | 12 |
Update and return an existing `Snippet` instance, given the validated data. | def update(self, instance, validated_data):
instance.title = validated_data.get('title', instance.title)
instance.code = validated_data.get('code', instance.code)
instance.linenos = validated_data.get('linenos', instance.linenos)
instance.language = validated_data.get('language', instanc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, instance: Snippet, validated_data: dict) -> Snippet:\n instance.title = validated_data.get('title', default=instance.title)\n instance.code = validated_data.get('code', default=instance.code)\n instance.language = validated_data.get('language', default=instance.language)\n ... | [
"0.8159959",
"0.71056896",
"0.6741115",
"0.6741115",
"0.6519223",
"0.6491508",
"0.6487682",
"0.64867574",
"0.64036787",
"0.61840516",
"0.613703",
"0.6078565",
"0.6003159",
"0.59822243",
"0.59075874",
"0.58866984",
"0.58691496",
"0.58142555",
"0.57720554",
"0.5702051",
"0.5646... | 0.6663661 | 4 |
Draws the menu bar with the default palette. The `MenuItem.name` and `MenuItem.disabled` data members of each `MenuItem` object in the menu linked list are read to give the menu legends in the correct colors. The current (selected) item is highlighted. | def draw(self):
b = DrawBuffer()
cNormal = self.getColor(0x0301)
b.moveChar(0, ' ', cNormal, self.size.x)
if self.menu and self.menu.items:
x = 1
items = (item for item in self.menu.items if item.name)
for p in items:
nameLen = nameLeng... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_main_menu():\n draw_cover()\n draw_menu_buttons()\n draw_border()",
"def draw_menu(self):\n \n menu = self.get_menu_for_display()\n if not menu:\n return\n\n menu_center_x, menu_center_y, menu_cords = self.get_menu_coords(menu)\n \n arcade.dr... | [
"0.6714116",
"0.64092195",
"0.6391999",
"0.6336463",
"0.6278169",
"0.6271912",
"0.62342066",
"0.6151254",
"0.6128278",
"0.6106339",
"0.6052492",
"0.6049817",
"0.5923583",
"0.58955497",
"0.5871043",
"0.58683944",
"0.57631713",
"0.57553494",
"0.5644249",
"0.5622154",
"0.5585944... | 0.61288184 | 8 |
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 |
Moves the cursor to the cursor position | def load_position(self, name):
x = self.saved_positions[name]["x"]
y = self.saved_positions[name]["y"]
self.pos(x, y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def moveCursor(self):\n\n\t\tself._before = self.rect.center\n\t\tself.rect.center = self._pos",
"def move_to(xy):\n (x,y) = xy\n win32api.SetCursorPos((x,y))",
"def move_to(self, ypos, xpos):\n # the screen's coordinates are 1 based, but the command is 0 based\n xpos -= 1\n ypos -= ... | [
"0.79806226",
"0.76625043",
"0.75890386",
"0.75563484",
"0.7493097",
"0.74394",
"0.70027304",
"0.6946872",
"0.6946117",
"0.6937368",
"0.69056344",
"0.68984985",
"0.686893",
"0.6839718",
"0.6832886",
"0.6809983",
"0.68058115",
"0.6769414",
"0.673391",
"0.6697421",
"0.6652932",... | 0.0 | -1 |
Moves the cursor to the given position. | def pos(self, x, y):
if isinstance(x, float):
x = int(x)
self.screen.write(colorama.Cursor.POS(x, y), ansi=True)
self.x = x
self.y = y
return x, y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_to(self, ypos, xpos):\n # the screen's coordinates are 1 based, but the command is 0 based\n xpos -= 1\n ypos -= 1\n self.exec_command(\"MoveCursor({0}, {1})\".format(ypos, xpos).encode(\"utf-8\"))",
"def move_to(self, position):\n raise NotImplementedError",
"def mo... | [
"0.7895238",
"0.76631284",
"0.7501534",
"0.7380969",
"0.73343635",
"0.7191338",
"0.7153786",
"0.7147803",
"0.70859367",
"0.70397615",
"0.69729394",
"0.6962559",
"0.6808345",
"0.6795975",
"0.67927366",
"0.67927366",
"0.67739993",
"0.6652052",
"0.6622807",
"0.65959203",
"0.6581... | 0.0 | -1 |
Resets the cursor position to 1,1 | def reset_pos(self):
return self.pos(1, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resetCursor(self):\n self.personalDataList.viewport().setCursor(QtCore.Qt.ArrowCursor)\n self.personalDataList.areaClicked.disconnect()",
"def change_cursor(self, cursor):\n self.setCursor(cursor)",
"def cursor_set(self, yes: bool = True) -> None:\n unicurses.curs_set(False)",
... | [
"0.7428936",
"0.72255176",
"0.71561784",
"0.71144277",
"0.7030123",
"0.69291735",
"0.6905589",
"0.6845172",
"0.66859704",
"0.66543347",
"0.6646504",
"0.6628703",
"0.65928566",
"0.65882397",
"0.657765",
"0.6511503",
"0.6507807",
"0.6507604",
"0.64994544",
"0.64948916",
"0.6437... | 0.66577077 | 9 |
Moves the cursor up by y | def pos_up(self, y=1):
self.y -= y
return self.pos(self.x, self.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_up(self):\n\n if self.ycor() > 115:\n self.sety(130)\n else:\n new_y = self.ycor() + 40\n self.sety(new_y)",
"def move_down(self):\n self.y -= 1",
"def move_up(self, step: int = 1) -> None:\n if self.cursor_pos.x == 0:\n self.curs... | [
"0.766779",
"0.7452014",
"0.70626575",
"0.7048635",
"0.6981019",
"0.6954794",
"0.6914325",
"0.68821734",
"0.6871535",
"0.68320286",
"0.6804464",
"0.6799948",
"0.6761636",
"0.6704798",
"0.6669586",
"0.6663126",
"0.66272235",
"0.66220415",
"0.65943205",
"0.65804",
"0.65656126",... | 0.74114865 | 2 |
Moves the cursor down by y | def pos_down(self, y=1):
self.y += y
return self.pos(self.x, self.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_down(self):\n self.y -= 1",
"def move_down(self):\n\n if self.ycor() < -280:\n self.sety(-300)\n else:\n new_y = self.ycor() - 40\n self.sety(new_y)",
"def move_down(self, step: int = 1) -> None:\n if self.cursor_pos.x < self.height - 1:\n ... | [
"0.8148471",
"0.77425015",
"0.7218102",
"0.71520185",
"0.7115439",
"0.7042418",
"0.6961287",
"0.6944409",
"0.69363904",
"0.6925683",
"0.69126976",
"0.6867086",
"0.6820902",
"0.6764037",
"0.6727076",
"0.67270595",
"0.67193604",
"0.67143446",
"0.6713575",
"0.66974413",
"0.66786... | 0.76490444 | 2 |
Moves the cursor left by x | def pos_left(self, x=1):
self.x -= x
return self.pos(self.x, self.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_left(self):\n\n if self.xcor() < -230:\n self.setx(-255)\n else:\n new_x = self.xcor() - 40\n self.setx(new_x)",
"def go_left(self):\n self.change_x = -6",
"def go_left(self):\n self.change_x = -6",
"def move_left(self, step: int = 1) -> N... | [
"0.783917",
"0.7654173",
"0.7654173",
"0.7563642",
"0.7405196",
"0.73624456",
"0.73477036",
"0.73197824",
"0.731584",
"0.731225",
"0.73068446",
"0.7221028",
"0.71414727",
"0.7020229",
"0.689407",
"0.68480873",
"0.6836473",
"0.6780266",
"0.6758263",
"0.6724127",
"0.66518474",
... | 0.71670943 | 12 |
Moves the cursor right by x | def pos_right(self, x=1):
self.x += x
return self.pos(self.x, self.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_right(self):\n\n if self.xcor() > 230:\n self.setx(250)\n else:\n new_x = self.xcor() + 40\n self.setx(new_x)",
"def go_right(self):\n self.change_x = 6",
"def go_right(self):\n self.change_x = 6",
"def right(self):\n self.move(1,0)... | [
"0.79355866",
"0.78606546",
"0.78606546",
"0.7642938",
"0.761193",
"0.7546118",
"0.7541132",
"0.7499826",
"0.7395141",
"0.7340992",
"0.72915536",
"0.7289104",
"0.7052181",
"0.69055384",
"0.68711084",
"0.6652453",
"0.66317683",
"0.6611341",
"0.6591757",
"0.65911835",
"0.654829... | 0.72057855 | 12 |
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 |
Update job file if new jobs. Then make a push. | def run(self):
self._logging(logging.INFO, 'Starting the Github bot.')
with acquire_inter_process_lock('github_bot') as acquired:
if not acquired:
err_msg = 'Another instance of the Github bot is already ' \
'running, aborting now.'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maybe_commit(job):",
"def jobs_save(self, jobs, method):\n\n if len(jobs) == 0:\n print('There is no data to save')\n else:\n\n if method == 'update':\n jobs += self.old_jobs\n elif method == 'overwrite':\n pass\n\n with ... | [
"0.61409247",
"0.61179245",
"0.6025807",
"0.60051036",
"0.60051036",
"0.60051036",
"0.60051036",
"0.5990783",
"0.59635323",
"0.59406996",
"0.58899873",
"0.57941073",
"0.57504725",
"0.57485074",
"0.57399267",
"0.569218",
"0.56635946",
"0.5662834",
"0.5588222",
"0.55870295",
"0... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.