query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Test recalibration on miscalibration area on the test set for some dummy values. | def test_recal_model_miscal_area_criterion_on_test_set(supply_test_set):
test_miscal_area = miscalibration_area(
*supply_test_set, num_bins=100, vectorized=True, recal_model=None
)
test_exp_props, test_obs_props = get_proportion_lists_vectorized(
*supply_test_set, num_bins=100, recal_model=N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_optimize_recalibration_ratio_miscal_area_criterion(supply_test_set):\n random.seed(0)\n np.random.seed(seed=0)\n\n y_pred, y_std, y_true = supply_test_set\n miscal_ratio = optimize_recalibration_ratio(\n y_pred, y_std, y_true, criterion=\"miscal\"\n )\n recal_ma_cal = mean_absolut... | [
"0.7078644",
"0.6984861",
"0.64138526",
"0.6360497",
"0.6355049",
"0.62292653",
"0.607696",
"0.6076645",
"0.6066254",
"0.59505856",
"0.59010434",
"0.5849274",
"0.58171123",
"0.5809038",
"0.5802807",
"0.579075",
"0.5784233",
"0.57722926",
"0.5768517",
"0.5767379",
"0.5767379",... | 0.7004949 | 1 |
Test standard deviation recalibration on miscalibration area on the test set for some dummy values. | def test_optimize_recalibration_ratio_miscal_area_criterion(supply_test_set):
random.seed(0)
np.random.seed(seed=0)
y_pred, y_std, y_true = supply_test_set
miscal_ratio = optimize_recalibration_ratio(
y_pred, y_std, y_true, criterion="miscal"
)
recal_ma_cal = mean_absolute_calibration_e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_stddev(self):\n self.assertEqual(stddev(list1, sample=False), np.std(list1))\n self.assertEqual(stddev(list1), np.std(list1, ddof=1))",
"def test_get_std_recalibrator(supply_test_set):\n random.seed(0)\n np.random.seed(seed=0)\n\n y_pred, y_std, y_true = supply_test_set\n\n tes... | [
"0.6400955",
"0.63658786",
"0.6343135",
"0.6270333",
"0.6140341",
"0.6086555",
"0.5983014",
"0.5954912",
"0.59430236",
"0.5943003",
"0.59329057",
"0.5928763",
"0.59189224",
"0.5856124",
"0.58148545",
"0.58137846",
"0.58114743",
"0.5772152",
"0.5748592",
"0.5743156",
"0.573902... | 0.6641412 | 0 |
Test get_std_recalibration on the test set for some dummy values. | def test_get_std_recalibrator(supply_test_set):
random.seed(0)
np.random.seed(seed=0)
y_pred, y_std, y_true = supply_test_set
test_quantile_prop_list = [
(0.01, 0.00, 0.00),
(0.25, 0.06, 0.00),
(0.50, 0.56, 0.00),
(0.75, 0.74, 0.56),
(0.99, 0.89, 0.88),
]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_recal_model_rmce_criterion_on_test_set(supply_test_set):\n test_rmsce = root_mean_squared_calibration_error(\n *supply_test_set, num_bins=100, vectorized=True, recal_model=None\n )\n test_exp_props, test_obs_props = get_proportion_lists_vectorized(\n *supply_test_set, num_bins=100, ... | [
"0.6505581",
"0.62848127",
"0.6166301",
"0.6148035",
"0.61447227",
"0.60626143",
"0.6036705",
"0.59206575",
"0.58688235",
"0.5843493",
"0.58413756",
"0.58250403",
"0.58108264",
"0.581074",
"0.58021724",
"0.5734694",
"0.5729315",
"0.57172924",
"0.5690789",
"0.5595119",
"0.5591... | 0.74163544 | 0 |
The reason that we name this function "delete_and_update_priority" instead of "delete" is because, for some reason, Django would not use overriden version of "delete". | def delete_and_update_priority(self):
for pbi in PBI.objects.filter(priority__gt=self.priority, project=self.project):
pbi.priority -= 1
pbi.save()
self.delete() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def beforeDelete(self):",
"def delete_order():",
"def _safedelete_policy(self):\n from customers.models import OrderedFood\n\n active_order = OrderedFood.objects.active_with(\n menu=self\n ).exists()\n if active_order:\n return SOFT_DELETE_CASCADE\n retu... | [
"0.6307487",
"0.6188662",
"0.61558974",
"0.5996629",
"0.5860172",
"0.5721956",
"0.5721956",
"0.56621903",
"0.56426454",
"0.5627721",
"0.5596805",
"0.5573574",
"0.5550034",
"0.5545524",
"0.53902364",
"0.5388889",
"0.53433895",
"0.5339659",
"0.53315383",
"0.5323481",
"0.5308124... | 0.6607951 | 0 |
Performs the provided computations and saves them to persistent storage. Next time, when this functions is called, the objects that exist in persistent storage are loaded instead of being computed again. If force_update is true, the computations are performed regardless of whether or not the objects already exist in pe... | def perist_computation(self, computations: List[Tuple], force_update: bool = False) -> List:
results = []
for computation, persistence_name in computations:
if force_update or self.object_exists(persistence_name) is False:
object = computation()
self.save_obje... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate(self, force=False, save=True):\n # Return if force=False and we can load the data\n if not force:\n # Check if data available\n data_available = True\n warn_about_field = False\n try:\n self.get_path\n except FieldNot... | [
"0.6010212",
"0.5683793",
"0.56278723",
"0.56136256",
"0.5568429",
"0.5504329",
"0.5497629",
"0.5462576",
"0.5449101",
"0.5385872",
"0.53525746",
"0.5348165",
"0.53130764",
"0.5286999",
"0.5138636",
"0.51332575",
"0.51114035",
"0.51005125",
"0.50958186",
"0.5075913",
"0.50753... | 0.7227986 | 0 |
Simulate random cassandra node failure and 'rejoin' into cluster | def simulate_node_failure(node_ips, max_duration, tests_completed):
run = True
l.info("START Cassandra Node Failure Simulation. Entering.")
while run:
# If stress-tests are still running continue with node failure simulation
if not tests_completed.isSet():
# Select 'random' node ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fail_without_replace_test(self):\n debug(\"Starting cluster with 3 nodes.\")\n cluster = self.cluster\n cluster.populate(3)\n node1, node2, node3 = cluster.nodelist()\n cluster.seeds.remove(node3)\n NUM_TOKENS = os.environ.get('NUM_TOKENS', '256')\n if DISABLE_V... | [
"0.6744955",
"0.6396412",
"0.62461376",
"0.6158001",
"0.6150235",
"0.6105334",
"0.60693353",
"0.6061685",
"0.6027248",
"0.60244936",
"0.59283906",
"0.5908653",
"0.5904325",
"0.5896519",
"0.58952236",
"0.58450353",
"0.58429205",
"0.58371437",
"0.5836464",
"0.5831239",
"0.58115... | 0.71292084 | 0 |
Select a random cassandra node from a list of IPs | def select_random_node(cluster_ips):
return random.choice(cluster_ips) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_ip():\n return new_ip(\"%i.%i.%i.%i\" % (randint(1, 254), # nosec\n randint(1, 254), # nosec\n randint(1, 254), # nosec\n randint(1, 254))) # nosec",
"def random_neighbor(node, topology):\n ... | [
"0.6310144",
"0.61539555",
"0.5864997",
"0.5807833",
"0.57944274",
"0.57607293",
"0.57581854",
"0.5710877",
"0.5589766",
"0.5574285",
"0.5568728",
"0.5555998",
"0.5545959",
"0.5511832",
"0.5511508",
"0.54947114",
"0.548818",
"0.5485526",
"0.5479142",
"0.54763126",
"0.54730475... | 0.82653457 | 0 |
Normalize path (like os.path.normpath) for given os. >>> from piecutter.engines.jinja import path_normalize >>> path_normalize('foo/bar') 'foo/bar' >>> path_normalize('foo/toto/../bar') 'foo/bar' Currently, this is using os.path, i.e. the separator and rules for the computer running Jinja2 engine. A NotImplementedError... | def path_normalize(path, target_os=None):
if target_os and target_os is not os.name:
raise NotImplementedError('Cannot join path with "{target}" style. '
'Host OS is "{host}".'.format(
target=target_os,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pathnormalize(p):\n return os.path.normcase(os.path.normpath(p))",
"def normalized_file_path(path: str) -> str:\n # Convert Unix path to Windows path for WSL\n if PLATFORM == \"WSL\":\n return path.replace(\"/\", \"\\\\\")\n\n return path",
"def normalizePath(path):\n\tfrom os.path impor... | [
"0.69371617",
"0.67665124",
"0.665144",
"0.6578206",
"0.65317076",
"0.64201766",
"0.6414548",
"0.641109",
"0.64075416",
"0.6395663",
"0.63524914",
"0.6351524",
"0.6309331",
"0.62953085",
"0.6282432",
"0.62260747",
"0.622361",
"0.61913955",
"0.61844265",
"0.61584127",
"0.61320... | 0.7767334 | 0 |
Populate self.environment.globals with some global functions. | def register_environment_functions(self):
self.environment.globals['path_join'] = path_join
self.environment.globals['path_normalize'] = path_normalize | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_globals(self, exp):\n for k, v in self.globals().iteritems():\n exp[k] = v\n return exp",
"def init_environment(self):\n # import outside of cell so we don't get a traceback\n from sage import all_cmdline\n from sage.repl.user_globals import initialize_global... | [
"0.6909919",
"0.6874173",
"0.67832756",
"0.67712545",
"0.66405827",
"0.64935255",
"0.64612424",
"0.6331751",
"0.62386405",
"0.6226703",
"0.61710274",
"0.61660385",
"0.6154513",
"0.6116108",
"0.6116108",
"0.6116108",
"0.6116108",
"0.6116108",
"0.6116108",
"0.6070834",
"0.60642... | 0.72794414 | 0 |
Return a ratio showing whether template looks like using engine. >>> engine = Jinja2Engine() >>> engine.match('', {}) 0.0 >>> engine.match('{ Jinja2 }', {}) 1.0 >>> engine.match('Not shebang { Jinja2 }', {}) 0.0 >>> engine.match('{{ key }}', {}) 0.9 | def match(self, template, context):
# Try to locate a root variable in template.
if template.startswith('{# Jinja2 #}'):
return 1.0
if re.search(r'{{ .+ }}', template):
return 0.9
return 0.0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _match(a, b):\n return SequenceMatcher(None, a, b).ratio()",
"def isMatched(expr):\n pass",
"def define_string(self, query):\n matches_tmvar = (regex.match(query) for regex in self.compiled_regexps)\n matches_custom = (regex.match(query) for regex in self.compiled_regexps_custom)\n\... | [
"0.5242781",
"0.5144096",
"0.51266867",
"0.5037971",
"0.5025544",
"0.4987474",
"0.4974875",
"0.4974875",
"0.49732393",
"0.49446538",
"0.48739052",
"0.4868412",
"0.48183316",
"0.4817297",
"0.48136428",
"0.47989908",
"0.47848785",
"0.47171175",
"0.47110495",
"0.47098234",
"0.47... | 0.7091385 | 0 |
Create Icy with model and tokenizer. | def __init__(self, model, tokenizer):
self.model = model
self.tokenizer = tokenizer
self.max_context_size = max_context
self.predict_len = steps
self.beam_size = beam_size
self.beam_steps = beam_steps | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, nlp_model):\n\n self.__nlp_model: spacy = nlp_model\n self.__pipe_mode = False\n self.__documents = None\n self.__nlp_model.tokenizer = custom_tokenizer(self.__nlp_model.vocab)",
"def __init__(self, tokenizer, model, text=None, **kwargs):\n self.tokenizer = t... | [
"0.5589102",
"0.5566447",
"0.5491463",
"0.5411294",
"0.53614414",
"0.5348173",
"0.5348173",
"0.533487",
"0.52875996",
"0.5251338",
"0.52298087",
"0.51757205",
"0.5174747",
"0.5170746",
"0.51701635",
"0.5164658",
"0.5152748",
"0.5152634",
"0.5151378",
"0.51377016",
"0.51334906... | 0.5784847 | 0 |
Predict the code complettion candidates from a given context. | def predict(self, context, filepath=None):
if len(context.splitlines()) < 5:
context = self.get_guide_context(filepath) + context
context_ids = self.tokenizer.encode(context)
if len(context_ids) <= 1:
return None
context_ids = context_ids... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict(self, context, question):\n log.info(\"----------------%s------------------\" % question)\n\n # when context given, detect entities\n slot_values = {}\n intent2entities = self._io.get_all_intent_entities()\n if context[\"intent\"] is not None:\n intent = co... | [
"0.57777715",
"0.5553709",
"0.5541172",
"0.53022724",
"0.5178504",
"0.5174268",
"0.517047",
"0.5168796",
"0.51625395",
"0.5130912",
"0.5128763",
"0.50554484",
"0.504819",
"0.50202686",
"0.4982282",
"0.49798957",
"0.4975732",
"0.49570844",
"0.49487984",
"0.4942885",
"0.4940701... | 0.6032909 | 0 |
Check whether this environment will allow multiprocessing. | def check_multiprocessing():
try:
import multiprocessing
except ImportError:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_multiprocessing_problematic():\n # Handling numpy linked against accelerate.\n config_info = str([value for key, value in\n np.__config__.__dict__.items()\n if key.endswith(\"_info\")]).lower()\n\n if \"accelerate\" in config_info or \"veclib\" in config_... | [
"0.77166367",
"0.6926131",
"0.67507607",
"0.6573761",
"0.6434448",
"0.6429325",
"0.6409346",
"0.63330084",
"0.63054895",
"0.61414415",
"0.60852826",
"0.6052636",
"0.605046",
"0.604755",
"0.59875536",
"0.59836596",
"0.59297264",
"0.5878702",
"0.58478266",
"0.58189756",
"0.5813... | 0.8002852 | 0 |
Apply task_function to each element of task_iterable using a parallel producer/consumer algorithm over nproc processes. Skip over input data where an error occurs. | def parallel_pc(task_function, task_iterable, nproc):
import multiprocessing
work_queue = multiprocessing.Queue()
results_queue = multiprocessing.Queue()
loader = get_worker_processes(
_load_data,
(task_iterable, work_queue, nproc),
nproc=1,
allow_scalar=True
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task_mapper(task_function, task_iterable, parallel_procs=None):\n\n num_procs = get_num_processors(parallel_procs)\n\n if num_procs == 0:\n LOG.debug('Using serial task processor...')\n return serial_pc(task_function, task_iterable)\n else:\n LOG.debug('Using %d-parallel task proc... | [
"0.7105109",
"0.64452964",
"0.63037914",
"0.6259437",
"0.6258113",
"0.6242203",
"0.6223304",
"0.6153528",
"0.60014147",
"0.59484875",
"0.59234285",
"0.59115857",
"0.5895072",
"0.5890376",
"0.5888246",
"0.5885095",
"0.58666056",
"0.58489543",
"0.5820315",
"0.58188766",
"0.5772... | 0.7429277 | 0 |
Return a set of worker processes for a given function and argument set. If no process count is given, use the CPU count of the current machine. If allow_scalar is set to True, allow this routine to return a single process instead of listoflength1 containing a single process. | def get_worker_processes(f, args, nproc=None, allow_scalar=False):
import multiprocessing
num_procs = get_num_processors(nproc)
workers = [
multiprocessing.Process(target=f, args=args) for _ in range(num_procs)
]
if allow_scalar and len(workers) == 1:
return workers[0]
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_and_launch_subprocesses(num_cpu, classify_warnings_fn, arg_groups,\n group_results):\n pool = multiprocessing.Pool(num_cpu)\n for cpu in range(num_cpu):\n proc_result = pool.map(classify_warnings_fn, arg_groups[cpu])\n if proc_result is not None:\n group_re... | [
"0.5776231",
"0.5610852",
"0.5502144",
"0.54802424",
"0.54682064",
"0.5405658",
"0.5333091",
"0.53030944",
"0.5295295",
"0.5265611",
"0.5222424",
"0.521971",
"0.5210371",
"0.5204518",
"0.51769847",
"0.51721096",
"0.5168093",
"0.51659495",
"0.5157962",
"0.5135003",
"0.51296496... | 0.78362644 | 0 |
Wrapper function to load the data from the iterable l into queue q, assuming that there will be nproc processes working on the queue. This is the "producer" in the producer/consumer algorithm. | def _load_data(l, q, nproc):
for element in l:
q.put(element)
for _ in range(nproc):
q.put(FINISHED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def producer():\n try:\n # Build a new iterable for each thread. This is crucial if working with\n # tensorflow datasets because tf.Graph objects are thread local.\n for item in iterable:\n buffer.put(item)\n except Exception as e: # pylint: disable=broad-except\n logging.exceptio... | [
"0.5999951",
"0.59393436",
"0.5907556",
"0.58371013",
"0.5630263",
"0.5578153",
"0.557121",
"0.5554266",
"0.5534063",
"0.55166733",
"0.5499694",
"0.5488578",
"0.5444545",
"0.5303388",
"0.5298439",
"0.5263151",
"0.52552044",
"0.52300864",
"0.5228879",
"0.5210839",
"0.52089936"... | 0.7580215 | 0 |
Wrapper function that will apply the function f to each element of the work queue and place the results in the results queue. This is the "consumer" in the producer/consumer algorithm. | def _process_data(f, work_queue, results_queue):
for element in iter(work_queue.get, FINISHED):
try:
results_queue.put(f(element))
except Exception, work_error:
LOG.critical('parallel_pc Error: {0}\n\n\tconfig settings {1}\n'.format(work_error, element))
results_queue.put... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queue_wrapper(result_queue, wid,\n func, args):\n result_queue.put((wid, func(*args)))",
"def ReturnWrapper(queue, fn):\n queue.put(fn())",
"def putting_on_queue(*args):\n results.put(main_func(*args))",
"def do(self, f, *args, **kwArgs):\n self.queue.put((f, args, kwArgs... | [
"0.7173841",
"0.651375",
"0.6504675",
"0.63891065",
"0.62190926",
"0.6109023",
"0.60184014",
"0.59957427",
"0.5989655",
"0.59775716",
"0.5975474",
"0.5956622",
"0.5890804",
"0.5883489",
"0.5870453",
"0.5839059",
"0.5837863",
"0.5823577",
"0.5803956",
"0.57904065",
"0.5779821"... | 0.72473073 | 0 |
Set up the OpenGL environment. | def setup(self):
# Initialize the drawing environment (create main windows, etc)
glutInit(sys.argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT)
glutCreateWindow(name)
glShadeModel(GL_SMOOTH)
glClearDep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initengine(self):\n\n\t\tif glutInit(sys.argv):\n\t\t\tglutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)\n\n\t\t\t# get a 640 x 480 window\n\t\t\tglutInitWindowSize(640, 480)\n\n\t\t\t# the window starts at the upper left corner of the screen\n\t\t\tglutInitWindowPosition(0, 0)\n\t\t\tself.window = glu... | [
"0.77284586",
"0.74582535",
"0.7332466",
"0.7204142",
"0.71726733",
"0.6988461",
"0.69814813",
"0.6957631",
"0.6926351",
"0.68892497",
"0.6870068",
"0.68252224",
"0.6823144",
"0.6786168",
"0.6768307",
"0.67527705",
"0.67306805",
"0.67032796",
"0.6683165",
"0.6625951",
"0.6577... | 0.7841261 | 0 |
Returns a segmentlist that is the union of all excitation, segdb and bitmasked channels. | def inj_seg(self, exclude_coinc_flags=None):
if exclude_coinc_flags is None:
exclude_coinc_flags = []
tmp_list = segments.segmentlist([])
for key in self.exc_dict.keys():
if key[3:] not in exclude_coinc_flags:
tmp_list.extend(self.exc_dict[key])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mask(self):\n return list(self._mask_generator())",
"def get_all(self):\n return self._segments",
"def get_all_bandgaps(cluster, spin_list, dir=\"/home/pv278/Platinum/\"):\n E, s = [], []\n for spin in spin_list:\n Ebg = get_bandgap(cluster, spin, dir)\n if Ebg:\n ... | [
"0.55168074",
"0.55116516",
"0.53419673",
"0.52560097",
"0.5237809",
"0.5221073",
"0.52103925",
"0.5172005",
"0.5163735",
"0.51265466",
"0.5036416",
"0.49907035",
"0.49392647",
"0.49160463",
"0.4905207",
"0.48919618",
"0.4861622",
"0.48559573",
"0.48539546",
"0.48505044",
"0.... | 0.6122778 | 0 |
Logical check that there was only one excitation at the time. | def check_single_excitation(self):
if len(self.exc_dict.keys()) != 1:
return False
for key in self.exc_dict.keys():
if len(self.exc_dict[key]) != 1:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def only_once(self) -> bool:\n return self.times == 1",
"def check_if_previously_escalated(self, event: EventRecord) -> None:\n with self.session.begin() as session:\n return (\n session.query(EventRecord)\n .filter(EventRecord.fingerprint == event.fingerpri... | [
"0.67595613",
"0.65658116",
"0.63393676",
"0.58317894",
"0.58310616",
"0.5688911",
"0.56728333",
"0.56637764",
"0.5656513",
"0.564039",
"0.56181943",
"0.5608127",
"0.560435",
"0.5599052",
"0.55835783",
"0.5581732",
"0.5554329",
"0.5548371",
"0.55300975",
"0.5522579",
"0.55165... | 0.7150156 | 0 |
scrape function starts scraping a channel for its playlists, checks for multiple pages, and returns a list of playlistId for all the playlist of the channel. | def scrape(self):
request = self.youtube.playlists().list(
part="id,snippet",
channelId=self.channelId,
maxResults=50)
response = request.execute()
items = response['items']
for item in items:
self.playlists.append(item['id'])
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scrape_channel(channel_id):\n youtube = googleapiclient.discovery.build(\"youtube\", \"v3\", developerKey=DEV_KEY)\n\n channel_request = youtube.channels().list(id=channel_id, part=\"contentDetails\")\n channel_response = channel_request.execute()\n\n channels = channel_response['items']\n\n # T... | [
"0.681034",
"0.655809",
"0.6413915",
"0.6066267",
"0.57549113",
"0.56889176",
"0.5649715",
"0.5583313",
"0.5550227",
"0.54708487",
"0.5464353",
"0.5461795",
"0.54606503",
"0.54446054",
"0.54353076",
"0.54159486",
"0.53916603",
"0.53819853",
"0.5381344",
"0.53627723",
"0.53571... | 0.73098916 | 0 |
Returns API instance for cloud provider. | def get_api(provider):
# TODO(b/167685797): Use thread-local.
if provider == storage_url.ProviderPrefix.GCS:
return gcs_api.GcsApi()
elif provider == storage_url.ProviderPrefix.S3:
return s3_api.S3Api()
raise ValueError('Provider API value must be "gs" or "s3".') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_api(self):\n return self.api",
"def api(self):\n if self._api is None:\n self._api = Api(self)\n return self._api",
"def api_conn(self):\n try:\n credentials = None\n if tuple(googleapiclient.__version__) < tuple(\"1.6.0\"):\n ... | [
"0.6938213",
"0.66804665",
"0.6465663",
"0.645735",
"0.645735",
"0.645735",
"0.645735",
"0.6449945",
"0.64465636",
"0.64265794",
"0.6422378",
"0.6416929",
"0.63810474",
"0.634576",
"0.6292377",
"0.62358004",
"0.6193966",
"0.6150923",
"0.61457396",
"0.61454266",
"0.6131071",
... | 0.69704527 | 0 |
Find the value which corresponds to a given quantile, based on a rolling window | def quantile(obj, quantile, window, min_periods=None, interpolation='linear'):
return obj.rolling(window=window, min_periods=min_periods).quantile(quantile, interpolation=interpolation) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quantile_inv(obj, window, min_periods=None):\n return obj.rolling(window=window, min_periods=min_periods).apply(lambda x: stats.percentileofscore(x, x[-1]))",
"def calc(self,newValue):\n idx=np.searchsorted(self.quantiles, newValue, side=\"left\")\n if idx>=self.n-1:\n return idx/... | [
"0.7310786",
"0.61414087",
"0.6122393",
"0.57424635",
"0.57070076",
"0.56710184",
"0.5660278",
"0.5632572",
"0.55865735",
"0.55555063",
"0.5538501",
"0.5472462",
"0.5457015",
"0.54006314",
"0.5374632",
"0.5362339",
"0.5356736",
"0.534758",
"0.53464705",
"0.53464705",
"0.53464... | 0.7560787 | 0 |
Find the quantile which corresponds to a given value, based on a rolling window | def quantile_inv(obj, window, min_periods=None):
return obj.rolling(window=window, min_periods=min_periods).apply(lambda x: stats.percentileofscore(x, x[-1])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quantile(obj, quantile, window, min_periods=None, interpolation='linear'):\n return obj.rolling(window=window, min_periods=min_periods).quantile(quantile, interpolation=interpolation)",
"def calc(self,newValue):\n idx=np.searchsorted(self.quantiles, newValue, side=\"left\")\n if idx>=self.n-... | [
"0.7717787",
"0.61630803",
"0.59890836",
"0.5905023",
"0.5796287",
"0.57600486",
"0.5695445",
"0.5688301",
"0.5684145",
"0.5641279",
"0.5595518",
"0.55840075",
"0.55814624",
"0.5574285",
"0.5565961",
"0.5564753",
"0.5556741",
"0.5551058",
"0.55195904",
"0.5509968",
"0.5484216... | 0.74475795 | 1 |
Get the height of the utopian tree after the given number of "cycles" | def get_tree_height(num_cycles):
# Base case, at 0 cycles the tree is of height 1
if num_cycles < 1:
return 1
# Recursive case 1, in the spring (odd numbered cycles) the tree's height doubles
elif num_cycles % 2 == 1:
return get_tree_height(num_cycles - 1) * 2
# Recursive case 2, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _height1(self): #works but n^2 time\n return max(self.depth(p) for p in self.positions() if self.is_leaf(p))",
"def height(T):\r\n if T.isLeaf:\r\n return 0\r\n return 1 + height(T.child[0])",
"def get_height_tree(self):\n layers = self.breadth_first_traversal()\n \n ... | [
"0.7027907",
"0.69764644",
"0.680126",
"0.6791401",
"0.67711425",
"0.67225134",
"0.6675838",
"0.6674541",
"0.6652776",
"0.66284823",
"0.6626358",
"0.6612011",
"0.65853816",
"0.6568385",
"0.6562906",
"0.6559787",
"0.65568864",
"0.6546335",
"0.6542986",
"0.65341276",
"0.6494415... | 0.8040597 | 0 |
Sets the color at index c_ix to the value given by rgb data in threetuple. | def set_color_rgb(self, c_ix, data):
if c_ix < 0 or c_ix > 1:
print "Don't understand color ix %d" % c_ix
return
if len(data) < 3:
print "Not enough data values to set rgb color: %s" % (str(data))
return
self.chosen_colors[c_ix] = (data[0],dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setColorIndex(idx):\n dislin.setclr(idx)",
"def _indexTupleToColor(self, index):\n coltuple = self.graphColors[index]\n color = wx.Colour()\n color.Set(coltuple[0] * 255, coltuple[1] * 255, coltuple[2] * 255)\n return color",
"def setByRGB(self, rgb: tuple):\n pass",
... | [
"0.6088867",
"0.60392755",
"0.58951443",
"0.5751649",
"0.5748489",
"0.5734999",
"0.5712137",
"0.56729895",
"0.56509113",
"0.5626888",
"0.56182015",
"0.55422664",
"0.5537102",
"0.5525229",
"0.55225873",
"0.5498315",
"0.5456852",
"0.5447531",
"0.5418946",
"0.5409829",
"0.539431... | 0.7667625 | 0 |
How many friends does _user_ have? | def number_of_friends(user):
user_id = user["id"]
friend_ids = friendships[user_id]
return len(friend_ids) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_friends(users):\n all_friends=[]\n for u_dict in users:\n for items in u_dict['friends']:\n all_friends.append(items)\n count = Counter()\n for frnd in all_friends:\n count[frnd]+=1\n return count",
"def count_friends(users):\n ###TODO-- Completed\n\n ... | [
"0.76322424",
"0.7539812",
"0.74160075",
"0.72380906",
"0.71189487",
"0.703479",
"0.6933848",
"0.68708676",
"0.65430224",
"0.64357305",
"0.6395951",
"0.62994045",
"0.6272538",
"0.6253553",
"0.6249366",
"0.6245729",
"0.6233796",
"0.6211341",
"0.6203296",
"0.61625165",
"0.61239... | 0.8672473 | 0 |
Implementation of AlexNet for Imagenet dataset | def AlexNet_ImageNet(sobel, batch_normalization, device, concat_sobel=False):
n_input_channels = 2 + int(not sobel) if not concat_sobel else 5
alexnet_features_cfg = [
{
"type": "convolution",
"out_channels":96,
"kernel_size":11,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def imagenet_alexnet(**kwargs):\r\n model = ImageNetAlexNet(**kwargs)\r\n return model",
"def trainNet():",
"def alexnet(**kwargs):\n model = AlexNet(**kwargs)\n # if pretrained:\n # model.load_state_dict(model_zoo.load_url(model_urls['alexnet']))\n return model",
"def __init__(self):\n... | [
"0.77431744",
"0.67590797",
"0.651037",
"0.64679104",
"0.6362905",
"0.61453205",
"0.61120945",
"0.6064081",
"0.604904",
"0.6042127",
"0.6042127",
"0.59999096",
"0.5974013",
"0.5967346",
"0.59515446",
"0.59452873",
"0.5936499",
"0.58984286",
"0.5892701",
"0.58571655",
"0.58525... | 0.6788389 | 1 |
L{eridanus.superfeedr.SuperfeedrService.subscribe} returns a C{Deferred} that is fired once the service is in a ready state. | def test_deferredSubscribe(self):
d = self.service.subscribe(u'url', None)
@d.addCallback
def clientConnected(dummy):
pubsubClient = self.service.pubsubClient
self.assertIn(u'url', pubsubClient.subscriptions)
# This makes d callback.
self.assertFalse(d.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subscribe(self):\n res = self._subscribe()\n if res is not None:\n self._subscribed = True\n return res",
"def subscribe(self, feed, **args):\n args.update(feed=feed)\n return self.fetch(\"/subscribe\", post_args=args)",
"def _subscribe(self):\n self.sub... | [
"0.7005694",
"0.6520945",
"0.6508914",
"0.63334703",
"0.6230734",
"0.6230734",
"0.6230734",
"0.6218599",
"0.6153157",
"0.61151624",
"0.6036387",
"0.6032836",
"0.602734",
"0.59833026",
"0.592212",
"0.58125806",
"0.58123523",
"0.58123523",
"0.57911456",
"0.5782523",
"0.5743202"... | 0.6906649 | 1 |
L{eridanus.superfeedr.SuperfeedrService.itemsReceived} is called when PubSub notifications arrive. | def test_itemsReceived(self):
called = []
def cb(url, items):
called.append((url, items))
self.service.clientConnected()
self.service.subscribe(u'url', cb)
event = EventMock(
nodeIdentifier=u'url',
items=[1, 2])
self.service.pubsubCli... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itemsReceived(self, url, items):\n callbacks = self._subscribers.get(url, [])\n for callback in callbacks:\n callback(url, items)",
"def run(self):\n\t\tfor item in self.pubSub.listen():\n\t\t\tself.processItem(item)",
"def _on_received(self):\n self._call_subscribers(on_lev... | [
"0.7075475",
"0.6652092",
"0.6082608",
"0.6082608",
"0.57806486",
"0.5743074",
"0.5678831",
"0.5677309",
"0.56297594",
"0.56297594",
"0.56297594",
"0.5567043",
"0.55572915",
"0.55317163",
"0.5472725",
"0.5414597",
"0.54049253",
"0.539446",
"0.538861",
"0.53758514",
"0.5369328... | 0.72041386 | 0 |
Saves list of dicts to a JSON file | def save_to_json(self, dict_list, filename):
try:
with open(filename + ".json", "w") as outfile:
dump(dict_list, outfile)
return True
except:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_to_file(cls, list_objs):\n filen = cls.__name__ + \".json\"\n\n list = []\n if list_objs is not None:\n for i in list_objs:\n i = i.to_dictionary()\n json_dict = json.loads(cls.to_json_string(i))\n list.append(json_dict)\n\n ... | [
"0.812433",
"0.8101076",
"0.8034094",
"0.80325276",
"0.80239636",
"0.8006303",
"0.7982375",
"0.7974182",
"0.7963977",
"0.793117",
"0.7928884",
"0.7928584",
"0.7923342",
"0.7910249",
"0.79055107",
"0.78935516",
"0.7851474",
"0.7844906",
"0.7818903",
"0.7780727",
"0.7774821",
... | 0.8160963 | 0 |
Decorator to specify the minimum SDK version required. | def minimum_required(version):
def _minimum_required(func):
"""Internal decorator that wraps around the given function.
Args:
func (function): function being decorated
Returns:
The wrapper unction.
"""
@functools.wraps(fun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _minimum_required(func):\n @functools.wraps(func)\n def wrapper(self, *args, **kwargs):\n \"\"\"Wrapper function to compare the DLL's SDK version.\n\n Args:\n self (JLink): the ``JLink`` instance\n args (list): list of argume... | [
"0.7227269",
"0.70044327",
"0.68048614",
"0.6800172",
"0.6800172",
"0.6445839",
"0.6249007",
"0.6184641",
"0.6159075",
"0.61492",
"0.61127204",
"0.60979486",
"0.5975494",
"0.59290665",
"0.58905935",
"0.5858444",
"0.584437",
"0.58316547",
"0.5806837",
"0.57859117",
"0.57829833... | 0.71969086 | 1 |
Decorator to specify that the JLink DLL must be opened, and a JLink connection must be established. | def open_required(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
"""Wrapper function to check that the given ``JLink`` has been
opened.
Args:
self (JLink): the ``JLink`` instance
args: list of arguments to pass to the wr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wrapper(self, *args, **kwargs):\n if not self.opened():\n raise errors.JLinkException('J-Link DLL is not open.')\n elif not self.connected():\n raise errors.JLinkException('J-Link connection has been lost.')\n return func(self, *args, **kwargs)",
... | [
"0.78086674",
"0.6620665",
"0.62595177",
"0.57813656",
"0.57425207",
"0.5700647",
"0.56000966",
"0.55962557",
"0.55041784",
"0.54924643",
"0.54419804",
"0.54177487",
"0.53156185",
"0.5271732",
"0.51947314",
"0.5189019",
"0.5170462",
"0.5170462",
"0.51138115",
"0.51135314",
"0... | 0.80194086 | 0 |
Decorator to specify that a target connection is required in order for the given method to be used. | def connection_required(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
"""Wrapper function to check that the given ``JLink`` has been
connected to a target.
Args:
self (JLink): the ``JLink`` instance
args: list of argume... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_connected(func):\r\n # preserve information about the function/method being wrapped\r\n @functools.wraps(func)\r\n def check_connection(self, *args, **kwargs):\r\n # require a non-empty resource\r\n if self.resource:\r\n return func(self, *args, **kwargs)\r\n els... | [
"0.61650705",
"0.6022926",
"0.60208786",
"0.59255743",
"0.5888884",
"0.5861941",
"0.58322555",
"0.573983",
"0.57139367",
"0.54727703",
"0.5403576",
"0.5344252",
"0.532783",
"0.5316756",
"0.5296651",
"0.52574956",
"0.5224839",
"0.5205566",
"0.51977617",
"0.51880735",
"0.517724... | 0.66222745 | 0 |
Decorator to specify that a coresight configuration or target connection is required in order for the given method to be used. | def coresight_configuration_required(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
"""Wrapper function to check that the given ``JLink`` has been
connected to a target or at least the coresight configuration has been done.
Args:
self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wrapper(self, *args, **kwargs):\n if not self.target_connected() and not self._coresight_configured:\n raise errors.JLinkException('Target is not connected neither coresight is not configured.')\n return func(self, *args, **kwargs)",
"def setup_required(func):\n @functoo... | [
"0.61328244",
"0.5900312",
"0.57780474",
"0.560044",
"0.5460201",
"0.54337233",
"0.54335177",
"0.54075634",
"0.53957355",
"0.53917134",
"0.535524",
"0.5343701",
"0.5336054",
"0.5287578",
"0.5285673",
"0.5273829",
"0.525915",
"0.5221203",
"0.51871645",
"0.51871645",
"0.5184034... | 0.6577142 | 0 |
Decorator to specify that a particular interface type is required for the given method to be used. | def interface_required(interface):
def _interface_required(func):
"""Internal decorator that wraps around the decorated function.
Args:
func (function): function being decorated
Returns:
The wrapper function.
"""
@functool... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _interface_required(func):\n @functools.wraps(func)\n def wrapper(self, *args, **kwargs):\n \"\"\"Wrapper function to check that the given ``JLink`` has the\n same interface as the one specified by the decorator.\n\n Args:\n se... | [
"0.67693275",
"0.6165727",
"0.59447145",
"0.5887659",
"0.5707012",
"0.56894696",
"0.5671177",
"0.56697464",
"0.5638895",
"0.5552767",
"0.55196726",
"0.5499579",
"0.5456859",
"0.5451604",
"0.542961",
"0.535381",
"0.53382504",
"0.52555335",
"0.52167374",
"0.52148",
"0.52148",
... | 0.70886105 | 0 |
Converts a register name to a register index | def _get_register_index_from_name(self, register):
regs = list(self.register_name(idx) for idx in self.register_list())
if isinstance(register, six.string_types):
try:
result = regs.index(register)
except ValueError:
error_message = "No register fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def regToInt(name):\n match = re.match(r\"r([0-9]+)\", name)\n if match:\n index = int(match.group(1))\n if 0 <= index <= 15:\n return index\n raise AsmException(\"incorrect register %s\" % name)",
"def _name2idx(name):\n match = re.search(r\"eth(\\d+)\", name, re.I)\n if ... | [
"0.70673144",
"0.6649662",
"0.635421",
"0.6062443",
"0.6032531",
"0.5843755",
"0.5819884",
"0.5759141",
"0.5676344",
"0.5626392",
"0.5623612",
"0.55866206",
"0.55866206",
"0.55742085",
"0.55464315",
"0.5542527",
"0.5532774",
"0.552761",
"0.5522242",
"0.550427",
"0.5448669",
... | 0.7770433 | 0 |
Returns whether the DLL is open. | def opened(self):
return bool(self._dll.JLINKARM_IsOpen()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_open(self):\n opened = ctypes.c_bool()\n\n result = self._lib.NRFJPROG_is_dll_open(ctypes.byref(opened))\n if result != NrfjprogdllErr.SUCCESS:\n raise APIError(result)\n \n return opened.value",
"def IsOpen(self):\n return self._is_open",
"def is_ope... | [
"0.8668237",
"0.7349179",
"0.72719353",
"0.72139436",
"0.7168035",
"0.7164919",
"0.7164339",
"0.6957772",
"0.6935094",
"0.6889131",
"0.6811832",
"0.6811832",
"0.6801945",
"0.6798037",
"0.6733291",
"0.67018276",
"0.6690784",
"0.6680774",
"0.6678992",
"0.66655904",
"0.66569847"... | 0.7768863 | 1 |
Returns whether a target is connected to the JLink. | def target_connected(self):
return self.connected() and bool(self._dll.JLINKARM_IsConnected()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_connected(self) -> bool:\n for node in self.nodes.values():\n if node.is_connected:\n return True\n return False",
"def is_connected(self):\n return self.is_connected",
"def is_connected(self) -> bool:",
"def is_connected(self):\n return True",
"... | [
"0.7403369",
"0.73424965",
"0.72780055",
"0.7252627",
"0.7252624",
"0.7238673",
"0.72304535",
"0.72159207",
"0.7209926",
"0.71412647",
"0.7140218",
"0.71304137",
"0.71304137",
"0.71304137",
"0.71304137",
"0.71304137",
"0.7100552",
"0.70282114",
"0.7027194",
"0.7001871",
"0.69... | 0.7943016 | 0 |
Returns the log handler function. | def log_handler(self):
return self._log_handler | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_logging_handler(args):\n fmt = '[%(levelname)s]%(message)s'\n log_level = args.log_level\n if args.log_level is not None:\n log_level = args.log_level\n if args.verbose:\n log_level = 'INFO'\n if args.quiet:\n log_level = 'CRITICAL'\n if args.debug:\n log_level... | [
"0.7126928",
"0.6878996",
"0.66978246",
"0.660131",
"0.63742185",
"0.63344777",
"0.62945443",
"0.61907",
"0.6165826",
"0.6022696",
"0.6003615",
"0.5993942",
"0.5972416",
"0.59456354",
"0.5932187",
"0.5925418",
"0.58838403",
"0.58657324",
"0.58575475",
"0.58319557",
"0.5790733... | 0.79250294 | 0 |
Returns the detailed log handler function. | def detailed_log_handler(self):
return self._detailed_log_handler | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_handler(self):\n return self._log_handler",
"def detailed_log_handler(self, handler):\n if not self.opened():\n handler = handler or util.noop\n self._detailed_log_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)\n self._dll.JLINKARM_EnableLogCom(self._... | [
"0.7082022",
"0.65838003",
"0.65482056",
"0.6501629",
"0.64679796",
"0.6204221",
"0.5989575",
"0.5933296",
"0.5849936",
"0.58108133",
"0.5767951",
"0.57203615",
"0.5707107",
"0.5707057",
"0.57023436",
"0.5663176",
"0.5620886",
"0.55988926",
"0.5586699",
"0.55785894",
"0.55465... | 0.79858005 | 0 |
Setter for the detailed log handler function. | def detailed_log_handler(self, handler):
if not self.opened():
handler = handler or util.noop
self._detailed_log_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)
self._dll.JLINKARM_EnableLogCom(self._detailed_log_handler) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detailed_log_handler(self):\n return self._detailed_log_handler",
"def setLogFunction(function):\n None",
"def set_debug_log_handler(log_function, user_data=None):\n return _librepo.set_debug_log_handler(log_function, user_data)",
"def setLogFunction(function):\n _setLogFunction(function)",
... | [
"0.74418867",
"0.69215786",
"0.6792493",
"0.6735235",
"0.6626798",
"0.64447534",
"0.6302193",
"0.6161881",
"0.61607116",
"0.6128542",
"0.60915595",
"0.60413516",
"0.60339576",
"0.60198784",
"0.59885824",
"0.5963814",
"0.5873186",
"0.5793344",
"0.57862794",
"0.57723296",
"0.57... | 0.76726156 | 0 |
Returns the error handler function. | def error_handler(self):
return self._error_handler | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_error_handler(self):\n\t\treturn self.error_handler",
"def getErrorHandler(self):\n pass",
"def error(self, func):\n self.error_handler = func\n return func",
"def get_exception_handler(self):\n return code_exception_handler",
"def error(self, func):\r\n if not as... | [
"0.8371953",
"0.7606664",
"0.7584393",
"0.69459677",
"0.6923569",
"0.6825693",
"0.67239016",
"0.6692205",
"0.6666494",
"0.6623788",
"0.65177417",
"0.6411838",
"0.6401807",
"0.6368209",
"0.6359435",
"0.63409716",
"0.6334751",
"0.62598646",
"0.62301916",
"0.6216253",
"0.6215068... | 0.820654 | 1 |
Setter for the error handler function. If the DLL is open, this function is a noop, so it should be called prior to calling ``open()``. | def error_handler(self, handler):
if not self.opened():
handler = handler or util.noop
self._error_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)
self._dll.JLINKARM_SetErrorOutHandler(self._error_handler) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error(self, func):\n self.error_handler = func\n return func",
"def _set_error_handler(self):\n if self.on_error:\n error_step = self.context.root.path_to_step(self.on_error)\n self._on_error_handler = error_step.run",
"def fl_set_error_handler(pyfn_ErrorFunc):\n ... | [
"0.74925685",
"0.7387786",
"0.7344395",
"0.70944905",
"0.6933359",
"0.6879701",
"0.68742484",
"0.67411596",
"0.67097634",
"0.6619814",
"0.6573823",
"0.6540704",
"0.6537449",
"0.6534454",
"0.6526444",
"0.6499119",
"0.6385315",
"0.62835646",
"0.6235538",
"0.62319547",
"0.614860... | 0.8089257 | 0 |
Returns the warning handler function. | def warning_handler(self):
return self._warning_handler | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning_handler(self, handler):\n if not self.opened():\n handler = handler or util.noop\n self._warning_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)\n self._dll.JLINKARM_SetWarnOutHandler(self._warning_handler)",
"def warning ( self , message , *args , **kwar... | [
"0.68627477",
"0.6812948",
"0.67166984",
"0.66707367",
"0.6633648",
"0.656866",
"0.6511098",
"0.634329",
"0.6324963",
"0.6302217",
"0.6240703",
"0.62289506",
"0.62278974",
"0.6188815",
"0.6184146",
"0.61821425",
"0.617723",
"0.613908",
"0.612199",
"0.61199313",
"0.60952175",
... | 0.84366107 | 0 |
Setter for the warning handler function. If the DLL is open, this function is a noop, so it should be called prior to calling ``open()``. | def warning_handler(self, handler):
if not self.opened():
handler = handler or util.noop
self._warning_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)
self._dll.JLINKARM_SetWarnOutHandler(self._warning_handler) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def warning_handler(self):\n return self._warning_handler",
"def warning(self, warning):\n pass",
"def warn():\n pass",
"def warning(self, *args, **kwargs):",
"def warning(self, msg, *args, **kwargs):\n pass",
"def svn_fs_set_warning_func(*args):\r\n return _fs.svn_fs... | [
"0.74930274",
"0.68050313",
"0.66184044",
"0.64902145",
"0.64758855",
"0.64538974",
"0.6352675",
"0.6313998",
"0.6251754",
"0.6212504",
"0.62080586",
"0.6202343",
"0.6189506",
"0.61887527",
"0.6175453",
"0.61310583",
"0.6126053",
"0.6124863",
"0.61062783",
"0.6102249",
"0.607... | 0.8037608 | 0 |
Returns the number of emulators which are connected via USB to the host. | def num_connected_emulators(self):
return self._dll.JLINKARM_EMU_GetNumDevices() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_usb_devices_count(self):\n\t\treturn call_sdk_function('PrlVmCfg_GetUsbDevicesCount', self.handle)",
"def get_device_count():\n debug(\"MpOrLibUsb.get_device_count()\")\n num = MpOrLibUsb.__get_device_count_Mpusb()\n num = num + MpOrLibUsb.__get_device_count_Libusb()\n return ... | [
"0.75948143",
"0.7488303",
"0.7421823",
"0.7240447",
"0.712322",
"0.7011725",
"0.6707582",
"0.6692651",
"0.6673403",
"0.6633537",
"0.6535353",
"0.644166",
"0.63627905",
"0.63612276",
"0.63183844",
"0.63135296",
"0.61730975",
"0.61198235",
"0.6083296",
"0.6074928",
"0.6061014"... | 0.79808414 | 0 |
Returns a list of all the connected emulators. | def connected_emulators(self, host=enums.JLinkHost.USB):
res = self._dll.JLINKARM_EMU_GetList(host, 0, 0)
if res < 0:
raise errors.JLinkException(res)
num_devices = res
info = (structs.JLinkConnectInfo * num_devices)()
num_found = self._dll.JLINKARM_EMU_GetList(host,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_connected_emulators(self):\n return self._dll.JLINKARM_EMU_GetNumDevices()",
"def get_simulators(self,online=False):\n teknon_clients = HWIOS.pb_server.get_clients()\n simulators = []\n for client in teknon_clients:\n for service in client.services:\n ... | [
"0.719934",
"0.66296625",
"0.63787234",
"0.62710494",
"0.62122655",
"0.62082034",
"0.6189037",
"0.5985569",
"0.5930733",
"0.5926629",
"0.5916771",
"0.5916495",
"0.5916495",
"0.5916495",
"0.5916495",
"0.5911042",
"0.58931977",
"0.5877987",
"0.5876969",
"0.58666605",
"0.5838837... | 0.79644364 | 0 |
Finds index of device with chip name | def get_device_index(self, chip_name):
index = self._dll.JLINKARM_DEVICE_GetIndex(chip_name.encode('ascii'))
if index <= 0:
raise errors.JLinkException('Unsupported device selected.')
return index | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device_number_if_usb_soundcard(index_info):\n\n index, info = index_info\n\n if \"USB Audio Device\" in info[\"name\"]:\n return index\n return False",
"def device_index(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"device_index\")",
"def _LookupDiskIndex(self, idx):\n ... | [
"0.6791446",
"0.6763107",
"0.66210264",
"0.6451419",
"0.6380812",
"0.63570654",
"0.630005",
"0.6242776",
"0.62230045",
"0.6196892",
"0.6186131",
"0.61579293",
"0.6139403",
"0.6093957",
"0.60845935",
"0.6042164",
"0.60021895",
"0.59756386",
"0.5963729",
"0.596066",
"0.5954575"... | 0.78707826 | 0 |
Returns the number of devices that are supported by the opened JLink DLL. | def num_supported_devices(self):
return int(self._dll.JLINKARM_DEVICE_GetInfo(-1, 0)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_number_devices(self):\n no_devices = c_int()\n self._dll.ShamrockGetNumberDevices(byref(no_devices))\n return no_devices.value",
"def get_count():\n _check_init()\n return _pypm.CountDevices()",
"def get_device_count():\n debug(\"MpOrLibUsb.get_device_count()\")\n ... | [
"0.8036905",
"0.74780697",
"0.73417294",
"0.7198005",
"0.7023647",
"0.7010175",
"0.6907719",
"0.6780509",
"0.6728959",
"0.66914535",
"0.6675222",
"0.6625763",
"0.6375574",
"0.6238672",
"0.621861",
"0.6217971",
"0.61899847",
"0.61450744",
"0.6122327",
"0.6098339",
"0.6085897",... | 0.8533519 | 0 |
Connects to the JLink emulator (defaults to USB). If ``serial_no`` and ``ip_addr`` are both given, this function will connect to the JLink over TCP/IP. | def open(self, serial_no=None, ip_addr=None):
if self._open_refcount > 0:
self._open_refcount += 1
return None
# For some reason, the J-Link driver complains if this isn't called
# first (may have something to do with it trying to establish a
# connection). With... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connect_to_device(self):\n result = self._lib.NRFJPROG_connect_to_device()\n if result != NrfjprogdllErr.SUCCESS:\n raise APIError(result)",
"def connect_to_emu_with_snr(self, serial_number, jlink_speed_khz=_DEFAULT_JLINK_SPEED_KHZ):\n if not self._is_u32(serial_number):\n ... | [
"0.65271443",
"0.6175279",
"0.61522955",
"0.60783523",
"0.60641503",
"0.60453105",
"0.6026043",
"0.59534824",
"0.59258455",
"0.5891086",
"0.5874427",
"0.585972",
"0.58303195",
"0.5800243",
"0.57978296",
"0.5713613",
"0.5676599",
"0.5661067",
"0.56441355",
"0.55945945",
"0.559... | 0.728185 | 0 |
Invalidates the emulator's firmware. This method is useful for downgrading the firmware on an emulator. By calling this method, the current emulator's firmware is invalidated, which will make the emulator download the firmware of the JLink SDK DLL that this instance was created with. | def invalidate_firmware(self):
self.exec_command('InvalidateFW')
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_firmware(self):\n self.execute_command(CMD_UPDATE_FIRMWARE)",
"def update_firmware(self) -> None:\n\n BROADCAST_ID = 0xFFF\n firmware_update_message = self.__set_module_state(\n BROADCAST_ID, Module.State.UPDATE_FIRMWARE, Module.State.PNP_OFF\n )\n self._s... | [
"0.6273632",
"0.5948957",
"0.59276915",
"0.5857047",
"0.5772112",
"0.5314016",
"0.5307123",
"0.52961135",
"0.5278046",
"0.5258549",
"0.5185406",
"0.5167135",
"0.5115055",
"0.5088576",
"0.505341",
"0.49990544",
"0.49989754",
"0.49672616",
"0.4960554",
"0.49433836",
"0.49426115... | 0.77288085 | 0 |
Performs a firmware update. If there is a newer version of firmware available for the JLink device, then updates the firmware. | def update_firmware(self):
return self._dll.JLINKARM_UpdateFirmwareIfNewer() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_firmware(self):\n self.execute_command(CMD_UPDATE_FIRMWARE)",
"def update_firmware(self) -> str:",
"def update_firmware(self) -> None:\n\n BROADCAST_ID = 0xFFF\n firmware_update_message = self.__set_module_state(\n BROADCAST_ID, Module.State.UPDATE_FIRMWARE, Module.St... | [
"0.7726776",
"0.7109466",
"0.70599735",
"0.6738031",
"0.66742176",
"0.64888185",
"0.6487171",
"0.6463621",
"0.612739",
"0.61112225",
"0.5972747",
"0.59701437",
"0.593723",
"0.582996",
"0.5805375",
"0.57768875",
"0.5694887",
"0.56347",
"0.55717975",
"0.5567664",
"0.554064",
... | 0.7426606 | 1 |
Syncs the emulator's firmware version and the DLL's firmware. This method is useful for ensuring that the firmware running on the JLink matches the firmware supported by the DLL. | def sync_firmware(self):
serial_no = self.serial_number
if self.firmware_newer():
# The J-Link's firmware is newer than the one compatible with the
# DLL (though there are promises of backwards compatibility), so
# perform a downgrade.
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_firmware(self):\n self.execute_command(CMD_UPDATE_FIRMWARE)",
"def update_firmware(self):\n return self._dll.JLINKARM_UpdateFirmwareIfNewer()",
"def update_firmware(self) -> str:",
"def test_update_hyperflex_server_firmware_version(self):\n pass",
"def test_patch_hyperflex_s... | [
"0.6560816",
"0.6445315",
"0.62348735",
"0.6225299",
"0.60480595",
"0.5931844",
"0.565636",
"0.55615395",
"0.55086553",
"0.5472634",
"0.5371156",
"0.5344871",
"0.53404367",
"0.5314066",
"0.525104",
"0.52466255",
"0.5244462",
"0.52401656",
"0.5199905",
"0.51960653",
"0.5150123... | 0.7375722 | 0 |
Enables showing dialog boxes on certain methods. | def enable_dialog_boxes(self):
self.exec_command('SetBatchMode = 0')
self.exec_command("HideDeviceSelection = 0")
self.exec_command("EnableInfoWinFlashDL")
self.exec_command("EnableInfoWinFlashBPs") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def onPreferences():\n cpp.createWidgets()\n dialog = cpp.dialog()\n dialog.show()",
"def _show_dialog(self, content: dict):\n raise NotImplementedError",
"def show_gui():\n pass",
"def ask_dialog(self, title=\"\", vars=[], help=\"\"):\n\t\tpass",
"def handleActionAdd(self):\n ... | [
"0.6548572",
"0.6431024",
"0.60055816",
"0.59957856",
"0.5972085",
"0.5950025",
"0.5936551",
"0.59014827",
"0.59014827",
"0.59014827",
"0.5859909",
"0.5849776",
"0.5845164",
"0.5812282",
"0.5799158",
"0.5750245",
"0.5745709",
"0.5739468",
"0.5732928",
"0.5678844",
"0.5654422"... | 0.6900347 | 0 |
Disables showing dialog boxes on certain methods. | def disable_dialog_boxes(self):
self.exec_command('SilentUpdateFW')
self.exec_command('SuppressInfoUpdateFW')
self.exec_command('SetBatchMode = 1')
# SuppressControlPanel
self.exec_command("HideDeviceSelection = 1")
self.exec_command("SuppressControlPanel")
# Hid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_gui():\n pass",
"def HidePopups(self):\n if self.AutoCompActive():\n self.AutoCompCancel()\n\n self.CallTipCancel()",
"def hideRunDialogs(self):\n self.runsDialog.close()",
"def enable_dialog_boxes(self):\n self.exec_command('SetBatchMode = 0')\n ... | [
"0.6990624",
"0.6787528",
"0.6686516",
"0.6570393",
"0.6482137",
"0.6474563",
"0.6391344",
"0.6346253",
"0.63196933",
"0.6312333",
"0.6310078",
"0.62974524",
"0.6265103",
"0.6261722",
"0.62368166",
"0.6221866",
"0.6188039",
"0.6154547",
"0.61539656",
"0.61188716",
"0.61164397... | 0.76230663 | 0 |
Clears the DLL internal error state. | def clear_error(self):
error = self.error
self._dll.JLINKARM_ClrError()
return error | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_error(self):\n self.got_error = False",
"def reset_error_state(self):\n self.error_state = Error.none\n self.error_info = ''",
"def reset_error(self):\n\t\t\n\t\tself.error = None",
"def clear_errors(self) -> None:",
"def clear_errors(self) -> None:",
"def clear(self) -> No... | [
"0.70795584",
"0.7057548",
"0.6713366",
"0.6652732",
"0.6652732",
"0.657427",
"0.60997975",
"0.5999428",
"0.5968291",
"0.58419234",
"0.5831106",
"0.5782868",
"0.57485276",
"0.5728033",
"0.57103884",
"0.56874764",
"0.56582403",
"0.56524",
"0.56213224",
"0.56045973",
"0.5521045... | 0.7359057 | 0 |
Returns a string specifying the date and time at which the DLL was translated. | def compile_date(self):
result = self._dll.JLINKARM_GetCompileDateTime()
return ctypes.cast(result, ctypes.c_char_p).value.decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getApplicationBuildDate(self) -> unicode:\n ...",
"def bspb_dateTime():\n return time.strftime(\"%c\")",
"def getdate():\n return strftime(\"%A %B %d, %I:%M %p\")",
"def get_date():\n return datetime.now().strftime(\"%c\")",
"def timeStamp():\n import time\n return str(time.strfti... | [
"0.6626718",
"0.6428493",
"0.6405169",
"0.62003773",
"0.61683446",
"0.6164931",
"0.6145021",
"0.6145021",
"0.6133342",
"0.61302215",
"0.61001295",
"0.6089877",
"0.6078893",
"0.6024622",
"0.6003678",
"0.59833175",
"0.5951833",
"0.5906212",
"0.58974415",
"0.58756155",
"0.586970... | 0.681691 | 0 |
Returns the DLL's compatible JLink firmware version. | def compatible_firmware_version(self):
identifier = self.firmware_version.split('compiled')[0]
buf_size = self.MAX_BUF_SIZE
buf = (ctypes.c_char * buf_size)()
res = self._dll.JLINKARM_GetEmbeddedFWString(identifier.encode(), buf, buf_size)
if res < 0:
raise errors.JLi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def firmware_version(self):\n buf = (ctypes.c_char * self.MAX_BUF_SIZE)()\n self._dll.JLINKARM_GetFirmwareString(buf, self.MAX_BUF_SIZE)\n return ctypes.string_at(buf).decode()",
"def firmware_version(self):\n return self._get_system_status()[\"firmware\"]",
"def version(self):\n ... | [
"0.81136453",
"0.7407501",
"0.7352537",
"0.73288053",
"0.7198567",
"0.7127076",
"0.7099566",
"0.69830626",
"0.6921074",
"0.69126314",
"0.687439",
"0.68079406",
"0.6804166",
"0.6751391",
"0.66990024",
"0.6666999",
"0.66542935",
"0.6648657",
"0.6644194",
"0.6637442",
"0.6600397... | 0.77596503 | 1 |
Returns whether the JLink's firmware version is newer than the one that the DLL is compatible with. | def firmware_newer(self):
if self.firmware_outdated():
return False
return self.firmware_version != self.compatible_firmware_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_old_firmware():\n # Read firmware version from runt.\n fw_version = get_runt(PROP_FW_VERSION)\n\n # Compare firmware year and month with old versions.\n year = int(fw_version.split(\".\")[0])\n month = int(fw_version.split(\".\")[1])\n if year < OLD_FW_YEAR:\n return True\n if ye... | [
"0.7358437",
"0.7010743",
"0.69943875",
"0.69896126",
"0.6812961",
"0.67926925",
"0.66695076",
"0.66645914",
"0.6650351",
"0.64594024",
"0.6443112",
"0.6440123",
"0.639947",
"0.63430756",
"0.6319107",
"0.6310919",
"0.6270985",
"0.6252749",
"0.62371534",
"0.62368095",
"0.61762... | 0.8374788 | 0 |
Retrieves and returns the hardware status. | def hardware_status(self):
stat = structs.JLinkHardwareStatus()
res = self._dll.JLINKARM_GetHWStatus(ctypes.byref(stat))
if res == 1:
raise errors.JLinkException('Error in reading hardware status.')
return stat | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_status(self) -> str:\n return await self.hw_device.status()",
"def get_status(self):\n return self.o.read_register(self.dev_id, STATUS)",
"def get_status(self):\n return self.read_register(259, 0, 3)",
"def _do_get_status(self):\n logging.info(__name__ + ' : Get status o... | [
"0.83062685",
"0.78518456",
"0.7734178",
"0.7694439",
"0.74336684",
"0.7413922",
"0.737868",
"0.73229784",
"0.72049797",
"0.6938613",
"0.6874521",
"0.6864607",
"0.68446654",
"0.68185717",
"0.68121564",
"0.68008447",
"0.6794162",
"0.6723889",
"0.6715048",
"0.6710874",
"0.66716... | 0.83743304 | 0 |
Returns the hardware version of the connected JLink as a major.minor string. | def hardware_version(self):
version = self._dll.JLINKARM_GetHardwareVersion()
major = version / 10000 % 100
minor = version / 100 % 100
return '%d.%02d' % (major, minor) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operatingsystem_version_minor(self):\n # type: () -> string_types\n return self._operatingsystem_version_minor",
"def minor_version(self) -> str:\n return pulumi.get(self, \"minor_version\")",
"def browser_version_minor(self):\n # type: () -> string_types\n return self._b... | [
"0.7464443",
"0.7388721",
"0.7359873",
"0.73588896",
"0.735307",
"0.703832",
"0.6949709",
"0.69274527",
"0.6908899",
"0.69068843",
"0.6825626",
"0.6823148",
"0.68003297",
"0.6736887",
"0.67257535",
"0.6721916",
"0.66738814",
"0.664943",
"0.6572924",
"0.65156627",
"0.65128624"... | 0.75893694 | 0 |
Returns a bitwise combination of the emulator's capabilities. | def capabilities(self):
return self._dll.JLINKARM_GetEmuCaps() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extended_capabilities(self):\n buf = (ctypes.c_uint8 * 32)()\n self._dll.JLINKARM_GetEmuCapsEx(buf, 32)\n return list(buf)",
"def capabilities(self):\n return []",
"def capabilities(self):\n pass",
"def capabilities(self):\n\n class Capabilities(ct.Structure):\n ... | [
"0.7870932",
"0.7322991",
"0.7188403",
"0.70267147",
"0.70134294",
"0.69892305",
"0.6859117",
"0.67896795",
"0.66960335",
"0.6687127",
"0.65947616",
"0.65633094",
"0.65249825",
"0.650482",
"0.64728695",
"0.6463111",
"0.6456096",
"0.64103836",
"0.64103836",
"0.63915354",
"0.63... | 0.7693325 | 1 |
Gets the capabilities of the connected emulator as a list. | def extended_capabilities(self):
buf = (ctypes.c_uint8 * 32)()
self._dll.JLINKARM_GetEmuCapsEx(buf, 32)
return list(buf) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capabilities(self):\n return []",
"def capabilities(self):\n return self._dll.JLINKARM_GetEmuCaps()",
"def capabilities(self):\n pass",
"def list_caps():\n global _CAPABILITIES_MAP\n\n try:\n return tuple(sorted(_CAPABILITIES_MAP.keys()))\n\n except NameError:\n ... | [
"0.7730975",
"0.7171184",
"0.6884316",
"0.6861759",
"0.68260896",
"0.6775502",
"0.6723433",
"0.6700927",
"0.6584009",
"0.6577421",
"0.6565169",
"0.65406597",
"0.6537834",
"0.6492856",
"0.64845836",
"0.6441089",
"0.64211535",
"0.6418847",
"0.64146817",
"0.64065176",
"0.6404807... | 0.7705912 | 1 |
Checks if the emulator has the given extended capability. | def extended_capability(self, capability):
res = self._dll.JLINKARM_EMU_HasCapEx(capability)
return (res == 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_capable(cls, requested_capability):\r\n for c in requested_capability:\r\n if not c in cls.capability:\r\n return False\r\n return True",
"def is_capable(self, *capabilities):\n caps = 0\n\n for cap in capabilities:\n caps |= int(cap)\n\n ... | [
"0.67414325",
"0.61519855",
"0.61198384",
"0.6112067",
"0.5987982",
"0.59692895",
"0.5861822",
"0.58458626",
"0.57023656",
"0.56940114",
"0.5680762",
"0.5673025",
"0.5656052",
"0.56358683",
"0.5632635",
"0.55984086",
"0.5522125",
"0.55074704",
"0.54911345",
"0.5487508",
"0.54... | 0.8234832 | 0 |
Returns the product name of the connected JLink. | def product_name(self):
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
self._dll.JLINKARM_EMU_GetProductName(buf, self.MAX_BUF_SIZE)
return ctypes.string_at(buf).decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_name(self):\n return self._product_name",
"def product_name(self):\n return self._stub.List(self._message).product_name",
"def product(self):\n return self.__values['product_name']",
"def product_name(self) -> Optional[str]:\n return pulumi.get(self, \"product_name\")"... | [
"0.72924954",
"0.7274736",
"0.70811665",
"0.69281614",
"0.66689706",
"0.6582853",
"0.6564504",
"0.65499675",
"0.65312827",
"0.6528013",
"0.63338166",
"0.6318037",
"0.62749875",
"0.62446964",
"0.6211255",
"0.6199241",
"0.61873746",
"0.6156995",
"0.6150432",
"0.60853916",
"0.60... | 0.73690933 | 0 |
Returns the serial number of the connected JLink. | def serial_number(self):
return self._dll.JLINKARM_GetSN() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serial_num(self) -> int:\n return self._serial_num",
"def _serial_number(self):\n hops_config = self._configurations[TextualDevice.connection_hops]\n cfg_ux2adb = hops_config[UnixRemote.unix_remote][AdbRemote.adb_shell]\n serial_number = cfg_ux2adb[\"command_params\"][\"serial_num... | [
"0.74930537",
"0.7472519",
"0.7297177",
"0.72521365",
"0.7209481",
"0.71740746",
"0.7126016",
"0.7054488",
"0.7054488",
"0.6969124",
"0.6953128",
"0.6952548",
"0.68861836",
"0.6873921",
"0.68738985",
"0.68629664",
"0.6844236",
"0.6748973",
"0.6740233",
"0.6600878",
"0.6553017... | 0.7896385 | 0 |
Retrieves and returns the OEM string of the connected JLink. | def oem(self):
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
res = self._dll.JLINKARM_GetOEMString(ctypes.byref(buf))
if res != 0:
raise errors.JLinkException('Failed to grab OEM string.')
oem = ctypes.string_at(buf).decode()
if len(oem) == 0:
# In the case... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jcn(self) -> str:\n\t\treturn None",
"def get_com(self):\n return self.com",
"def connection(entity) -> str:\n return entity.__connection__",
"def om(self):\n return self._om",
"def get_fullname(self):\n if self.controller.oem_config:\n return 'OEM Configuration (... | [
"0.5808167",
"0.5617447",
"0.5599845",
"0.5554633",
"0.54862267",
"0.54852885",
"0.54849464",
"0.5472016",
"0.5472016",
"0.5448756",
"0.5399291",
"0.5399291",
"0.53514236",
"0.53486705",
"0.53486705",
"0.53486705",
"0.53486705",
"0.53486705",
"0.53486705",
"0.53190345",
"0.53... | 0.6868049 | 0 |
Sets the speed of the JTAG communication with the ARM core. If no arguments are present, automatically detects speed. If a ``speed`` is provided, the speed must be no larger than ``JLink.MAX_JTAG_SPEED`` and no smaller than ``JLink.MIN_JTAG_SPEED``. The given ``speed`` can also not be ``JLink.INVALID_JTAG_SPEED``. | def set_speed(self, speed=None, auto=False, adaptive=False):
if speed is None:
speed = 0
elif not util.is_natural(speed):
raise TypeError('Expected positive number for speed, given %s.' % speed)
elif speed > self.MAX_JTAG_SPEED:
raise ValueError('Given speed e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_speed(self, speed):\n self.device.set_speed(speed)\n return \"OK\"",
"def set_speed(self, speed: str) -> None:\n if speed == SPEED_HIGH:\n self._bond.setSpeed(self._deviceId, self._speed_high)\n elif speed == SPEED_MEDIUM:\n self._bond.setSpeed(self._devi... | [
"0.77228916",
"0.76773125",
"0.76645964",
"0.7556887",
"0.7487982",
"0.74708396",
"0.7388966",
"0.735085",
"0.73193073",
"0.7287285",
"0.72854716",
"0.72389597",
"0.7221359",
"0.7159828",
"0.71560454",
"0.6976063",
"0.6959427",
"0.6866141",
"0.68435514",
"0.6811078",
"0.67788... | 0.8203385 | 0 |
Sets JTAG communication speed to the maximum supported speed. | def set_max_speed(self):
self._dll.JLINKARM_SetMaxSpeed()
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def use_max_speed(self):\n command = _build_robovac_command(RobovacModes.SET_SPEED, RobovacCommands.FAST_SPEED)\n message = self._build_command_user_data_message(command)\n\n self._send_packet(message, False)",
"def init_max_speed(self, speed):\n self.max_speed = speed",
"def set_ma... | [
"0.7703856",
"0.760545",
"0.7574005",
"0.75104946",
"0.7438816",
"0.73911256",
"0.73307776",
"0.7304634",
"0.7277663",
"0.72594523",
"0.72380924",
"0.7100713",
"0.708789",
"0.7066199",
"0.70402837",
"0.70343775",
"0.6960239",
"0.6932046",
"0.6921788",
"0.69128805",
"0.6910427... | 0.7672911 | 1 |
Returns a string of the builtin licenses the JLink has. | def licenses(self):
buf_size = self.MAX_BUF_SIZE
buf = (ctypes.c_char * buf_size)()
res = self._dll.JLINK_GetAvailableLicense(buf, buf_size)
if res < 0:
raise errors.JLinkException(res)
return ctypes.string_at(buf).decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def custom_licenses(self):\n buf = (ctypes.c_char * self.MAX_BUF_SIZE)()\n result = self._dll.JLINK_EMU_GetLicenses(buf, self.MAX_BUF_SIZE)\n if result < 0:\n raise errors.JLinkException(result)\n return ctypes.string_at(buf).decode()",
"def licenses(self) -> Sequence[str]:... | [
"0.7823846",
"0.7631993",
"0.6969341",
"0.68796015",
"0.6644712",
"0.66071224",
"0.65296596",
"0.6483877",
"0.6422204",
"0.63812995",
"0.63121504",
"0.62354946",
"0.61277324",
"0.6099809",
"0.6060002",
"0.60524994",
"0.6048665",
"0.60459536",
"0.6032868",
"0.6027193",
"0.5985... | 0.77635115 | 1 |
Returns a string of the installed licenses the JLink has. | def custom_licenses(self):
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
result = self._dll.JLINK_EMU_GetLicenses(buf, self.MAX_BUF_SIZE)
if result < 0:
raise errors.JLinkException(result)
return ctypes.string_at(buf).decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def licenses(self):\n buf_size = self.MAX_BUF_SIZE\n buf = (ctypes.c_char * buf_size)()\n res = self._dll.JLINK_GetAvailableLicense(buf, buf_size)\n if res < 0:\n raise errors.JLinkException(res)\n return ctypes.string_at(buf).decode()",
"def licenses(self) -> Sequen... | [
"0.8306052",
"0.7703566",
"0.6928596",
"0.692542",
"0.65299475",
"0.6383517",
"0.63345724",
"0.63305396",
"0.62964326",
"0.62551224",
"0.61774635",
"0.61500096",
"0.61296695",
"0.6076609",
"0.6066867",
"0.6051764",
"0.60314894",
"0.6010827",
"0.59672576",
"0.58672863",
"0.586... | 0.7874683 | 1 |
Adds the given ``contents`` as a new custom license to the JLink. | def add_license(self, contents):
buf_size = len(contents)
buf = (ctypes.c_char * (buf_size + 1))(*contents.encode())
res = self._dll.JLINK_EMU_AddLicense(buf)
if res == -1:
raise errors.JLinkException('Unspecified error.')
elif res == -2:
raise errors.JL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_license(fitsfile, lic):\n try:\n hdulist = pyfits.open(fitsfile, mode=\"update\")\n except:\n print(\"Oops! Something's gone wrong :-(\", file=sys.stderr)\n else:\n prihdr = hdulist[0].header\n prihdr[\"LICENSE\"] = liclist[lic][\"name\"]\n prihdr[\"LICVER\"] = l... | [
"0.5791714",
"0.54519194",
"0.54418665",
"0.5415837",
"0.536234",
"0.53025603",
"0.5089603",
"0.5057118",
"0.50209594",
"0.50054395",
"0.49415272",
"0.4904747",
"0.49017844",
"0.48947182",
"0.4884487",
"0.48772773",
"0.48758823",
"0.48673916",
"0.4860569",
"0.4846386",
"0.482... | 0.79595304 | 0 |
Erases the custom licenses from the connected JLink. | def erase_licenses(self):
res = self._dll.JLINK_EMU_EraseLicenses()
return (res == 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def licensecleanup(): # 3\n res = _msk.Env.licensecleanup()\n if res != 0:\n raise Error(rescode(res),\"\")",
"def licensecleanup():\n res = __library__.MSK_XX_licensecleanup()\n if res != 0:\n raise Error(rescode(res),Env.getcodedesc(rescode(res))[1])",
"def fusion_api_remove_all_l... | [
"0.7005333",
"0.68788034",
"0.61466384",
"0.5993776",
"0.5878803",
"0.5766113",
"0.56358415",
"0.5620082",
"0.5318468",
"0.52957314",
"0.5272305",
"0.52443534",
"0.5220673",
"0.5192017",
"0.51773405",
"0.51538986",
"0.514808",
"0.5131194",
"0.51025444",
"0.5053739",
"0.501980... | 0.7211269 | 0 |
Returns a bitmask of the supported target interfaces. | def supported_tifs(self):
buf = ctypes.c_uint32()
self._dll.JLINKARM_TIF_GetAvailable(ctypes.byref(buf))
return buf.value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_iops(self):\n return self._target_iops",
"def get_bitmask(self):\r\n return self.__bitmask__",
"def supported_firmware_interfaces(self):\n return [fake.FakeFirmware] + super().supported_firmware_interfaces",
"def supported_features(self):\n return self._support_flags",
"d... | [
"0.5479481",
"0.5466839",
"0.5331652",
"0.5219462",
"0.5219462",
"0.5219462",
"0.5219462",
"0.5208209",
"0.5208209",
"0.5183276",
"0.5162029",
"0.5147319",
"0.51413816",
"0.5125746",
"0.5075815",
"0.5070249",
"0.506683",
"0.50626093",
"0.5061384",
"0.50433564",
"0.504145",
... | 0.56031305 | 0 |
Returns the properties of the usercontrollable GPIOs. Provided the device supports usercontrollable GPIOs, they will be returned by this method. | def gpio_properties(self):
res = self._dll.JLINK_EMU_GPIO_GetProps(0, 0)
if res < 0:
raise errors.JLinkException(res)
num_props = res
buf = (structs.JLinkGPIODescriptor * num_props)()
res = self._dll.JLINK_EMU_GPIO_GetProps(ctypes.byref(buf), num_props)
if re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_special_props(self):\n return _uhd_swig.dboard_iface_get_special_props(self)",
"def get_gpio(request):\n lines=[]\n append=False\n with open(tasmotadir + \"/sonoff/sonoff_template.h\", \"r\") as f:\n for line in f:\n if append==True:\n split = line.split('... | [
"0.56739914",
"0.5628798",
"0.55746144",
"0.5554046",
"0.5516643",
"0.5462817",
"0.54455227",
"0.5444812",
"0.5427482",
"0.5419844",
"0.54165584",
"0.5354491",
"0.5345417",
"0.5320189",
"0.52873176",
"0.5278891",
"0.5238333",
"0.5213858",
"0.5193446",
"0.51826954",
"0.5171521... | 0.7572945 | 0 |
Returns a list of states for the given pins. Defaults to the first four pins if an argument is not given. | def gpio_get(self, pins=None):
if pins is None:
pins = range(4)
size = len(pins)
indices = (ctypes.c_uint8 * size)(*pins)
statuses = (ctypes.c_uint8 * size)()
result = self._dll.JLINK_EMU_GPIO_GetState(ctypes.byref(indices),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gpio_set(self, pins, states):\n if len(pins) != len(states):\n raise ValueError('Length mismatch between pins and states.')\n\n size = len(pins)\n indices = (ctypes.c_uint8 * size)(*pins)\n states = (ctypes.c_uint8 * size)(*states)\n result_states = (ctypes.c_uint8... | [
"0.6325355",
"0.58825517",
"0.57909244",
"0.5696706",
"0.5689667",
"0.5671641",
"0.56096876",
"0.55983794",
"0.5502997",
"0.54794824",
"0.5339975",
"0.5330621",
"0.53096783",
"0.52971077",
"0.52949315",
"0.5291582",
"0.5272392",
"0.5272307",
"0.5263267",
"0.52492994",
"0.5245... | 0.645705 | 0 |
Sets the state for one or more usercontrollable GPIOs. For each of the given pins, sets the the corresponding state based on the index. | def gpio_set(self, pins, states):
if len(pins) != len(states):
raise ValueError('Length mismatch between pins and states.')
size = len(pins)
indices = (ctypes.c_uint8 * size)(*pins)
states = (ctypes.c_uint8 * size)(*states)
result_states = (ctypes.c_uint8 * size)()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_in_pins(pins):\n for pin in pins:\n GPIO.setup(pin, GPIO.IN, GPIO.PUD_DOWN)\n\tGPIO.setup(LEDPIN, GPIO.OUT)\n\tGPIO.output(LEDPIN, GPIO.LOW)",
"def set_output_pins(gpio_pi, pins):\n for pin in pins:\n gpio_pi.set_mode(pin, pigpio.OUTPUT)",
"def control_lights(state):\n for led in... | [
"0.67630583",
"0.6701876",
"0.66943204",
"0.667867",
"0.6631768",
"0.6084266",
"0.590363",
"0.5820405",
"0.57538754",
"0.57185996",
"0.56616455",
"0.56322324",
"0.56210387",
"0.5613424",
"0.5591593",
"0.55910563",
"0.55717963",
"0.5569654",
"0.55475074",
"0.5527521",
"0.54831... | 0.72917193 | 0 |
Returns true if the connected emulator supports ``comm_`` functions. | def comm_supported(self):
return bool(self._dll.JLINKARM_EMU_COM_IsSupported()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform_supported(self):\n return platform.system().lower() in self.platforms if self.platforms else False",
"def is_implemented(self, strcommand):\n result = ct.c_bool()\n command = ct.c_wchar_p(strcommand)\n self.lib.AT_IsImplemented(self.AT_H, command, ct.addressof(result))\n ... | [
"0.6294339",
"0.6247626",
"0.62126076",
"0.62111324",
"0.61141217",
"0.60866046",
"0.5913596",
"0.59061253",
"0.587912",
"0.5868121",
"0.58662134",
"0.58477944",
"0.581536",
"0.5792787",
"0.57603824",
"0.5732553",
"0.57130605",
"0.5685708",
"0.56756186",
"0.56597596",
"0.5658... | 0.7504666 | 0 |
Turns on the power supply over pin 19 of the JTAG connector. If given the optional ``default`` parameter, activates the power supply by default. | def power_on(self, default=False):
if default:
return self.exec_command('SupplyPowerDefault = 1')
return self.exec_command('SupplyPower = 1') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_power(self, power: bool):\r\n if not self.backlight:\r\n return\r\n\r\n self.backlight.power = power",
"def enable_sensor_power():\n sen = digital.SensorPower(\"senpwr\") \n sen.set()",
"def power_off(self, default=False):\n if default:\n return self.ex... | [
"0.59848994",
"0.58197916",
"0.5765819",
"0.5646491",
"0.56057185",
"0.5539767",
"0.5523567",
"0.546071",
"0.54217446",
"0.54076535",
"0.53823274",
"0.53624934",
"0.534944",
"0.525806",
"0.525012",
"0.525012",
"0.5246774",
"0.52432984",
"0.5230443",
"0.52265006",
"0.52264374"... | 0.7342173 | 0 |
Turns off the power supply over pin 19 of the JTAG connector. If given the optional ``default`` parameter, deactivates the power supply by default. | def power_off(self, default=False):
if default:
return self.exec_command('SupplyPowerDefault = 0')
return self.exec_command('SupplyPower = 0') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def power_on(self, default=False):\n if default:\n return self.exec_command('SupplyPowerDefault = 1')\n return self.exec_command('SupplyPower = 1')",
"def turn_off(self, **kwargs: Any) -> None:\n self._device.power_on = False\n _LOGGER.debug(\"Turn off light %s\", self._dev... | [
"0.6328211",
"0.62576807",
"0.6225595",
"0.6173055",
"0.5999021",
"0.59706545",
"0.59181386",
"0.5881481",
"0.57981247",
"0.5797737",
"0.5783779",
"0.575179",
"0.5746744",
"0.56743556",
"0.5668693",
"0.56165165",
"0.5604504",
"0.5584084",
"0.55808145",
"0.55499864",
"0.554723... | 0.7711565 | 0 |
Unlocks the device connected to the JLink. Unlocking a device allows for access to read/writing memory, as well as flash programming. | def unlock(self):
if not unlockers.unlock(self, self._device.manufacturer):
raise errors.JLinkException('Failed to unlock device.')
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unlock(self):\n assert self._locked\n\n for interface in (self._if_data, self._if_comm):\n num = interface.bInterfaceNumber\n usb.util.release_interface(self._dev, num)\n try:\n self._dev.attach_kernel_driver(num)\n except NotImplementedE... | [
"0.6938925",
"0.660725",
"0.64760107",
"0.6440715",
"0.62717754",
"0.6236688",
"0.62313265",
"0.6193607",
"0.6143534",
"0.613259",
"0.60984814",
"0.6051488",
"0.59999526",
"0.597438",
"0.5960463",
"0.59416103",
"0.59392333",
"0.591275",
"0.5905867",
"0.5901939",
"0.5900084",
... | 0.68897253 | 1 |
Checks whether the JLink has support for a CPU capability. This method checks if the emulator has builtin intelligence to handle the given CPU capability for the target CPU it is connected to. | def cpu_capability(self, capability):
res = self._dll.JLINKARM_EMU_HasCPUCap(capability)
return (res == 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_cpu_usage():\n usage = psutil.cpu_percent(1)\n return usage < 73",
"def check_cpu_usage():\n usage = psutil.cpu_percent(1)\n return usage < 75",
"def hasaccelerator():\n\n return torch.cuda.is_available() or torch.backends.mps.is_available() or bool(Models.finddevice())",
"de... | [
"0.6257282",
"0.62404746",
"0.6172745",
"0.6169188",
"0.6149486",
"0.60734123",
"0.6064867",
"0.60474193",
"0.59851557",
"0.56941956",
"0.5656142",
"0.55845547",
"0.5547036",
"0.5547036",
"0.55439806",
"0.55230147",
"0.5507119",
"0.5467797",
"0.54413694",
"0.54222214",
"0.540... | 0.7686013 | 0 |
Sets the source to be used for tracing. The ``source`` must be one of the ones provided by ``enums.JLinkTraceSource``. | def set_trace_source(self, source):
self._dll.JLINKARM_SelectTraceSource(source)
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_source(self, source_name):\n self.source = source_name",
"def set_source(self, source):\n self.data['source'] = source",
"def source(self, source: str):\n if source is None:\n raise ValueError(\"Invalid value for `source`, must not be `None`\") # noqa: E501\n\n s... | [
"0.7424912",
"0.7381461",
"0.7311171",
"0.7253388",
"0.68773925",
"0.6792636",
"0.6792636",
"0.6792636",
"0.6792636",
"0.6792636",
"0.6792636",
"0.6792636",
"0.6792282",
"0.67182785",
"0.67182785",
"0.66947204",
"0.66931814",
"0.6658792",
"0.66483253",
"0.6540488",
"0.6418507... | 0.8096896 | 0 |
Sets the trace source to ETB. | def set_etb_trace(self):
return self.set_trace_source(enums.JLinkTraceSource.ETB) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_trace_source(self, source):\n self._dll.JLINKARM_SelectTraceSource(source)\n return None",
"def set_etm_trace(self):\n return self.set_trace_source(enums.JLinkTraceSource.ETM)",
"def set_flow_source(self, source):\n self._source = source",
"def set_source(self, source):\n ... | [
"0.67526037",
"0.66253936",
"0.58463424",
"0.56614417",
"0.5585869",
"0.55556214",
"0.55095434",
"0.55043924",
"0.53060555",
"0.53060555",
"0.53060555",
"0.53060555",
"0.53060555",
"0.53060555",
"0.53060555",
"0.52926004",
"0.5289176",
"0.52746224",
"0.52723837",
"0.5267305",
... | 0.7192863 | 0 |
Sets the trace source to ETM. | def set_etm_trace(self):
return self.set_trace_source(enums.JLinkTraceSource.ETM) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_trace_source(self, source):\n self._dll.JLINKARM_SelectTraceSource(source)\n return None",
"def set_etb_trace(self):\n return self.set_trace_source(enums.JLinkTraceSource.ETB)",
"def set_source(self, source):\n Analyzer.set_source(self, source)\n\n # Phy-layer logs\n ... | [
"0.6810518",
"0.61798775",
"0.5914067",
"0.57936245",
"0.5706354",
"0.5657605",
"0.55403554",
"0.54769146",
"0.53619367",
"0.53619367",
"0.53619367",
"0.53619367",
"0.53619367",
"0.53619367",
"0.53619367",
"0.5357929",
"0.5349075",
"0.5329953",
"0.5299414",
"0.52555674",
"0.5... | 0.70468456 | 0 |
Sets the reset strategy for the target. The reset strategy defines what happens when the target is reset. | def set_reset_strategy(self, strategy):
return self._dll.JLINKARM_SetResetType(strategy) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self, model):\n self.reset_strategy(model)",
"def reset(self, reset):\n\n self._reset = reset",
"def reset(\n self,\n seed: int | None = None,\n options: dict | None = None,\n ) -> None:\n raise NotImplementedError",
"def _reset(self, reason: str=None):\... | [
"0.6495099",
"0.6385841",
"0.6166843",
"0.6044985",
"0.59898937",
"0.59530026",
"0.5915435",
"0.588634",
"0.5809561",
"0.57993025",
"0.5762693",
"0.5718891",
"0.57155836",
"0.5715117",
"0.5715117",
"0.5714403",
"0.57122886",
"0.568944",
"0.5682338",
"0.56767076",
"0.56539863"... | 0.7554464 | 0 |
Sets the reset pin high. | def set_reset_pin_high(self):
self._dll.JLINKARM_SetRESET()
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_high(pin):\n _write_value(HIGH, \"{0}/gpio{1}/value\".format(_path_prefix, pin))",
"def set_pin_high(pin):\n HIGH_PINS.append(pin)",
"def set_pin(self):\n GPIO.setwarnings(False)\n GPIO.setmode(GPIO.BOARD)\n GPIO.setup(self.pin, GPIO.OUT)\n GPIO.output(self.pin, GPIO.L... | [
"0.76762646",
"0.7392624",
"0.7216663",
"0.71714914",
"0.70699817",
"0.6996814",
"0.6917991",
"0.67941666",
"0.67145264",
"0.6690107",
"0.6652306",
"0.6647311",
"0.6606071",
"0.6596769",
"0.65450037",
"0.65297806",
"0.6518503",
"0.64832616",
"0.64662075",
"0.64414",
"0.639654... | 0.82298005 | 0 |
Sets the TCK pin to the high value (1). | def set_tck_pin_high(self):
res = self._dll.JLINKARM_SetTCK()
if res < 0:
raise errors.JLinkException('Feature not supported.')
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_tms_pin_high(self):\n self._dll.JLINKARM_SetTMS()",
"def set_tck_pin_low(self):\n res = self._dll.JLINKARM_ClrTCK()\n if res < 0:\n raise errors.JLinkException('Feature not supported.')\n return None",
"def set_high(pin):\n _write_value(HIGH, \"{0}/gpio{1}/valu... | [
"0.6983898",
"0.68569297",
"0.6654362",
"0.66001517",
"0.6404542",
"0.63803303",
"0.63711846",
"0.62969327",
"0.6294428",
"0.6188276",
"0.6144547",
"0.6044994",
"0.6014647",
"0.60079336",
"0.59776324",
"0.59690744",
"0.59175617",
"0.5872067",
"0.5842171",
"0.5835622",
"0.5830... | 0.81199163 | 0 |
Sets the TCK pin to the low value (0). | def set_tck_pin_low(self):
res = self._dll.JLINKARM_ClrTCK()
if res < 0:
raise errors.JLinkException('Feature not supported.')
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_tck_pin_high(self):\n res = self._dll.JLINKARM_SetTCK()\n if res < 0:\n raise errors.JLinkException('Feature not supported.')\n return None",
"def low(self) -> None:\n self._fd.write(SYSFS_GPIO_VALUE_LOW)\n self._fd.seek(0)",
"def set_low(pin):\n _write_... | [
"0.73971844",
"0.6994287",
"0.6880128",
"0.6808424",
"0.65625274",
"0.6546796",
"0.65377206",
"0.6483757",
"0.6449713",
"0.6396966",
"0.6375537",
"0.6350863",
"0.63117564",
"0.6214217",
"0.6209135",
"0.6123354",
"0.6103005",
"0.5989524",
"0.59685767",
"0.595526",
"0.59463185"... | 0.7376907 | 1 |
Sets the TRST pin to high (``1``). Deasserts the TRST pin. | def set_trst_pin_high(self):
self._dll.JLINKARM_SetTRST() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_trst_pin_low(self):\n self._dll.JLINKARM_ClrTRST()",
"def set_tms_pin_high(self):\n self._dll.JLINKARM_SetTMS()",
"def set_tdi_pin_high(self):\n self._dll.JLINKARM_SetTDI()",
"def set_tms_pin_low(self):\n self._dll.JLINKARM_ClrTMS()",
"def set_tdi_pin_low(self):\n ... | [
"0.76595914",
"0.6956277",
"0.69485646",
"0.6418955",
"0.6314893",
"0.6187271",
"0.61263037",
"0.5990363",
"0.59893334",
"0.59088856",
"0.5772113",
"0.56703496",
"0.5660919",
"0.5581691",
"0.55683947",
"0.5527358",
"0.5515669",
"0.5486913",
"0.5483119",
"0.54626435",
"0.54057... | 0.8256027 | 0 |
Sets the TRST pin to low (``0``). This asserts the TRST pin. | def set_trst_pin_low(self):
self._dll.JLINKARM_ClrTRST() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_trst_pin_high(self):\n self._dll.JLINKARM_SetTRST()",
"def set_tms_pin_low(self):\n self._dll.JLINKARM_ClrTMS()",
"def set_tdi_pin_low(self):\n self._dll.JLINKARM_ClrTDI()",
"def set_tms_pin_high(self):\n self._dll.JLINKARM_SetTMS()",
"def set_low(pin):\n _write_value... | [
"0.7731158",
"0.6825987",
"0.66356045",
"0.63269836",
"0.6292216",
"0.62280554",
"0.6048894",
"0.60226434",
"0.59968835",
"0.587299",
"0.5822418",
"0.5759895",
"0.5642852",
"0.559276",
"0.5503428",
"0.54660255",
"0.54590565",
"0.54342633",
"0.5392334",
"0.5366156",
"0.5317279... | 0.7863832 | 0 |
Flashes the target device. The given ``on_progress`` callback will be called as ``on_progress(action, progress_string, percentage)`` periodically as the data is written to flash. The action is one of ``Compare``, ``Erase``, ``Verify``, ``Flash``. | def flash_file(self, path, addr, on_progress=None, power_on=False):
if on_progress is not None:
# Set the function to be called on flash programming progress.
func = enums.JLinkFunctions.FLASH_PROGRESS_PROTOTYPE(on_progress)
self._dll.JLINK_SetFlashProgProgressCallback(func)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flash(self, flash_mode, serial_port):\n os.chdir(espqdir)\n # Flash the right software.\n if self.software == 'tasmota':\n self.flashed = self.flash_tasmota(flash_mode, serial_port)\n else:\n self.flashed = self.flash_custom(flash_mode, serial_port)\n # ... | [
"0.5982783",
"0.5871337",
"0.5782275",
"0.5753777",
"0.5745075",
"0.5576129",
"0.54386854",
"0.5426334",
"0.53471774",
"0.5330711",
"0.5328667",
"0.5231093",
"0.522487",
"0.5213469",
"0.51910174",
"0.5178589",
"0.515408",
"0.51481056",
"0.51158154",
"0.5088761",
"0.5060716",
... | 0.63523215 | 0 |
Resets the TAP controller via TRST. | def reset_tap(self):
self._dll.JLINKARM_ResetTRST() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resetSimulator():\n\tif settings._telnet == True:\n\t\toutput('Resetting simulator...')\n\t\tsettings.obj = []\n\t\tsendData('RESET', read=True, flush=True)\n\t\t\n\t\ttry:\n\t\t\tsettings._tn.close()\n\t\texcept:\n\t\t\tpass\n\t\t\n\t\tsettings._tn = None\n\t\tsettings._telnet = False\n\t\ttime.sleep(5)\n\t\t... | [
"0.6881509",
"0.676529",
"0.66275734",
"0.65582836",
"0.6431777",
"0.64174914",
"0.63991785",
"0.63991785",
"0.63991785",
"0.63991785",
"0.6386106",
"0.6347729",
"0.63173145",
"0.63109154",
"0.62667215",
"0.6265245",
"0.6255568",
"0.62467414",
"0.62467414",
"0.6244591",
"0.62... | 0.750661 | 0 |
Returns the identifier of the target ARM core. | def core_id(self):
return self._dll.JLINKARM_GetId() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def core_name(self):\n buf_size = self.MAX_BUF_SIZE\n buf = (ctypes.c_char * buf_size)()\n self._dll.JLINKARM_Core2CoreName(self.core_cpu(), buf, buf_size)\n return ctypes.string_at(buf).decode()",
"def core(self):\r\n return self._arm.arm_cmd",
"def core_cpu(self):\n ... | [
"0.7490066",
"0.7196427",
"0.71677345",
"0.6338329",
"0.62525463",
"0.61177325",
"0.61026776",
"0.6046521",
"0.59956616",
"0.59377795",
"0.5886101",
"0.5875638",
"0.5840084",
"0.57903725",
"0.57705945",
"0.5755306",
"0.57216656",
"0.57216656",
"0.5697404",
"0.5680583",
"0.565... | 0.8001003 | 0 |
Returns the identifier of the core CPU. | def core_cpu(self):
return self._dll.JLINKARM_CORE_GetFound() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cpu_core():\n processor_info = subprocess.getoutput('dmidecode -t processor')\n cpu_core_value = re.findall(r'(?i)Core Count:\\s+(.*?)\\n', processor_info, re.S)[0]\n log.info('cpu_core value:{}'.format(cpu_core_value))\n if cpu_core_value:\n cpu_core = cpu_core_value\n else:\n ... | [
"0.7623723",
"0.7305994",
"0.72736806",
"0.7247865",
"0.71696126",
"0.69153386",
"0.69153386",
"0.6903136",
"0.6880217",
"0.68542415",
"0.68542415",
"0.68542415",
"0.680591",
"0.6636795",
"0.6579709",
"0.6579709",
"0.6521728",
"0.6521728",
"0.650771",
"0.64685994",
"0.6417266... | 0.7587402 | 1 |
Returns the name of the target ARM core. | def core_name(self):
buf_size = self.MAX_BUF_SIZE
buf = (ctypes.c_char * buf_size)()
self._dll.JLINKARM_Core2CoreName(self.core_cpu(), buf, buf_size)
return ctypes.string_at(buf).decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def core_cpu(self):\n return self._dll.JLINKARM_CORE_GetFound()",
"def core(self):\r\n return self._arm.arm_cmd",
"def core_id(self):\n return self._dll.JLINKARM_GetId()",
"def core_device_thing_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"core_device_thing_name\")... | [
"0.7254818",
"0.70973575",
"0.6809045",
"0.67588556",
"0.6106954",
"0.60881776",
"0.59571433",
"0.5943938",
"0.59264773",
"0.5901319",
"0.5877642",
"0.58724964",
"0.58507866",
"0.58507866",
"0.58507866",
"0.58202237",
"0.5818371",
"0.57700187",
"0.5728202",
"0.5728065",
"0.57... | 0.8275722 | 0 |
Returns the device family of the target CPU. | def device_family(self):
return self._dll.JLINKARM_GetDeviceFamily() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_device_family(self):\n family = ctypes.c_int()\n\n result = self._lib.NRFJPROG_read_device_family(ctypes.byref(family))\n if result != NrfjprogdllErr.SUCCESS:\n raise APIError(result)\n\n return DeviceFamily(family.value).name",
"def get_family(self):\n\n re... | [
"0.6909385",
"0.64434975",
"0.6229879",
"0.6129597",
"0.6112738",
"0.60420865",
"0.59965724",
"0.59965724",
"0.59965724",
"0.59877867",
"0.5918032",
"0.5864088",
"0.5853863",
"0.583038",
"0.583038",
"0.58042604",
"0.58042604",
"0.57857424",
"0.57783484",
"0.57301265",
"0.5730... | 0.716312 | 0 |
Returns a list of the indices for the CPU registers. The returned indices can be used to read the register content or grab the register name. | def register_list(self):
num_items = self.MAX_NUM_CPU_REGISTERS
buf = (ctypes.c_uint32 * num_items)()
num_regs = self._dll.JLINKARM_GetRegisterList(buf, num_items)
return buf[:num_regs] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_all_registers(self):\n return self.REGISTERS",
"def GetRegisterList():\n return ida_idp.ph_get_regnames()",
"def getRegisterValues(self) -> Dict[str,int]:\n regs = {}\n arch = self.root.arch\n for i in range(len(arch.registers)):\n name = self.__values.item(i, 0).... | [
"0.6909058",
"0.67586297",
"0.65199894",
"0.60588837",
"0.6034606",
"0.5986358",
"0.5985805",
"0.5894652",
"0.5816669",
"0.58057624",
"0.57803863",
"0.57582706",
"0.57518476",
"0.5719443",
"0.5698639",
"0.56965935",
"0.5689453",
"0.5578393",
"0.55681276",
"0.55467296",
"0.554... | 0.72000444 | 0 |
Retrives and returns the name of an ARM CPU register. | def register_name(self, register_index):
result = self._dll.JLINKARM_GetRegisterName(register_index)
return ctypes.cast(result, ctypes.c_char_p).value.decode() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetReg():\n\n global Asm\n\n # Save pointer in case we need to start all over again\n pointer = dec.Asm.Parse_Pointer\n # First try to get a register name\n reg = assem.GetWord().upper()\n\n family = dec.Asm.AVR_Family\n\n if reg == '':\n # Operand was expected but not found\n ... | [
"0.6660186",
"0.65312827",
"0.64798576",
"0.63942313",
"0.6103637",
"0.6086033",
"0.60574824",
"0.5978311",
"0.5967892",
"0.5963139",
"0.5961032",
"0.59516",
"0.58829755",
"0.57470155",
"0.57256436",
"0.5714934",
"0.5709603",
"0.5694411",
"0.56490207",
"0.56295955",
"0.562133... | 0.67324847 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.