_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q231300
List.contains_all
train
def contains_all(self, items): """ Determines whether this list contains all of the items in specified collection or not. :param items: (Collection), the specified collection which includes the items to be searched. :return: (bool), ``true`` if all of the items in specified collection e...
python
{ "resource": "" }
q231301
List.index_of
train
def index_of(self, item): """ Returns the first index of specified items's occurrences in this list. If specified item is not present in this list, returns -1. :param item: (object), the specified item to be searched for. :return: (int), the first index of specified items's occu...
python
{ "resource": "" }
q231302
List.last_index_of
train
def last_index_of(self, item): """ Returns the last index of specified items's occurrences in this list. If specified item is not present in this list, returns -1. :param item: (object), the specified item to be searched for. :return: (int), the last index of specified items's o...
python
{ "resource": "" }
q231303
List.remove
train
def remove(self, item): """ Removes the specified element's first occurrence from the list if it exists in this list. :param item: (object), the specified element. :return: (bool), ``true`` if the specified element is present in this list. """ check_not_none(item, "Value...
python
{ "resource": "" }
q231304
List.remove_all
train
def remove_all(self, items): """ Removes all of the elements that is present in the specified collection from this list. :param items: (Collection), the specified collection. :return: (bool), ``true`` if this list changed as a result of the call. """ check_not_none(items...
python
{ "resource": "" }
q231305
List.retain_all
train
def retain_all(self, items): """ Retains only the items that are contained in the specified collection. It means, items which are not present in the specified collection are removed from this list. :param items: (Collection), collections which includes the elements to be retained in thi...
python
{ "resource": "" }
q231306
List.set_at
train
def set_at(self, index, item): """ Replaces the specified element with the element at the specified position in this list. :param index: (int), index of the item to be replaced. :param item: (object), item to be stored. :return: (object), the previous item in the specified index...
python
{ "resource": "" }
q231307
Map.add_index
train
def add_index(self, attribute, ordered=False): """ Adds an index to this map for the specified entries so that queries can run faster. Example: Let's say your map values are Employee objects. >>> class Employee(IdentifiedDataSerializable): >>> act...
python
{ "resource": "" }
q231308
Map.add_interceptor
train
def add_interceptor(self, interceptor): """ Adds an interceptor for this map. Added interceptor will intercept operations and execute user defined methods. :param interceptor: (object), interceptor for the map which includes user defined methods. :return: (str),id of registered intercep...
python
{ "resource": "" }
q231309
Map.entry_set
train
def entry_set(self, predicate=None): """ Returns a list clone of the mappings contained in this map. **Warning: The list is NOT backed by the map, so changes to the map are NOT reflected in the list, and vice-versa.** :param predicate: (Predicate), predicate for the map to filt...
python
{ "resource": "" }
q231310
Map.evict
train
def evict(self, key): """ Evicts the specified key from this map. **Warning: This method uses __hash__ and __eq__ methods of binary form of the key, not the actual implementations of __hash__ and __eq__ defined in key's class.** :param key: (object), key to evict. :retu...
python
{ "resource": "" }
q231311
Map.execute_on_entries
train
def execute_on_entries(self, entry_processor, predicate=None): """ Applies the user defined EntryProcessor to all the entries in the map or entries in the map which satisfies the predicate if provided. Returns the results mapped by each key in the map. :param entry_processor: (object), ...
python
{ "resource": "" }
q231312
Map.execute_on_key
train
def execute_on_key(self, key, entry_processor): """ Applies the user defined EntryProcessor to the entry mapped by the key. Returns the object which is the result of EntryProcessor's process method. :param key: (object), specified key for the entry to be processed. :param entry_...
python
{ "resource": "" }
q231313
Map.execute_on_keys
train
def execute_on_keys(self, keys, entry_processor): """ Applies the user defined EntryProcessor to the entries mapped by the collection of keys. Returns the results mapped by each key in the collection. :param keys: (Collection), collection of the keys for the entries to be processed. ...
python
{ "resource": "" }
q231314
Map.force_unlock
train
def force_unlock(self, key): """ Releases the lock for the specified key regardless of the lock owner. It always successfully unlocks the key, never blocks, and returns immediately. **Warning: This method uses __hash__ and __eq__ methods of binary form of the key, not the actual impleme...
python
{ "resource": "" }
q231315
Map.get_all
train
def get_all(self, keys): """ Returns the entries for the given keys. **Warning: The returned map is NOT backed by the original map, so changes to the original map are NOT reflected in the returned map, and vice-versa.** **Warning 2: This method uses __hash__ and __eq__ ...
python
{ "resource": "" }
q231316
Map.get_entry_view
train
def get_entry_view(self, key): """ Returns the EntryView for the specified key. **Warning: This method returns a clone of original mapping, modifying the returned value does not change the actual value in the map. One should put modified value back to make changes visible to all...
python
{ "resource": "" }
q231317
Map.is_locked
train
def is_locked(self, key): """ Checks the lock for the specified key. If the lock is acquired, it returns ``true``. Otherwise, it returns ``false``. **Warning: This method uses __hash__ and __eq__ methods of binary form of the key, not the actual implementations of __hash__ and __eq__ de...
python
{ "resource": "" }
q231318
Map.key_set
train
def key_set(self, predicate=None): """ Returns a List clone of the keys contained in this map or the keys of the entries filtered with the predicate if provided. **Warning: The list is NOT backed by the map, so changes to the map are NOT reflected in the list, and vice-versa.** ...
python
{ "resource": "" }
q231319
Map.load_all
train
def load_all(self, keys=None, replace_existing_values=True): """ Loads all keys from the store at server side or loads the given keys if provided. :param keys: (Collection), keys of the entry values to load (optional). :param replace_existing_values: (bool), whether the existing values ...
python
{ "resource": "" }
q231320
Map.put_if_absent
train
def put_if_absent(self, key, value, ttl=-1): """ Associates the specified key with the given value if it is not already associated. If ttl is provided, entry will expire and get evicted after the ttl. This is equivalent to: >>> if not map.contains_key(key): >>> ...
python
{ "resource": "" }
q231321
Map.remove_if_same
train
def remove_if_same(self, key, value): """ Removes the entry for a key only if it is currently mapped to a given value. This is equivalent to: >>> if map.contains_key(key) and map.get(key).equals(value): >>> map.remove(key) >>> return true ...
python
{ "resource": "" }
q231322
Map.replace
train
def replace(self, key, value): """ Replaces the entry for a key only if it is currently mapped to some value. This is equivalent to: >>> if map.contains_key(key): >>> return map.put(key,value) >>> else: >>> return None except that ...
python
{ "resource": "" }
q231323
Map.replace_if_same
train
def replace_if_same(self, key, old_value, new_value): """ Replaces the entry for a key only if it is currently mapped to a given value. This is equivalent to: >>> if map.contains_key(key) and map.get(key).equals(old_value): >>> map.put(key, new_value) >>>...
python
{ "resource": "" }
q231324
Map.set
train
def set(self, key, value, ttl=-1): """ Puts an entry into this map. Similar to the put operation except that set doesn't return the old value, which is more efficient. If ttl is provided, entry will expire and get evicted after the ttl. **Warning: This method uses __hash__ and __eq__ me...
python
{ "resource": "" }
q231325
Map.try_put
train
def try_put(self, key, value, timeout=0): """ Tries to put the given key and value into this map and returns immediately if timeout is not provided. If timeout is provided, operation waits until it is completed or timeout is reached. :param key: (object), key of the entry. :para...
python
{ "resource": "" }
q231326
Map.try_remove
train
def try_remove(self, key, timeout=0): """ Tries to remove the given key from this map and returns immediately if timeout is not provided. If timeout is provided, operation waits until it is completed or timeout is reached. :param key: (object), key of the entry to be deleted. :p...
python
{ "resource": "" }
q231327
Map.unlock
train
def unlock(self, key): """ Releases the lock for the specified key. It never blocks and returns immediately. If the current thread is the holder of this lock, then the hold count is decremented. If the hold count is zero, then the lock is released. :param key: (object), the key to lock....
python
{ "resource": "" }
q231328
Map.values
train
def values(self, predicate=None): """ Returns a list clone of the values contained in this map or values of the entries which are filtered with the predicate if provided. **Warning: The list is NOT backed by the map, so changes to the map are NOT reflected in the list, and ...
python
{ "resource": "" }
q231329
TransactionManager.new_transaction
train
def new_transaction(self, timeout, durability, transaction_type): """ Creates a Transaction object with given timeout, durability and transaction type. :param timeout: (long), the timeout in seconds determines the maximum lifespan of a transaction. :param durability: (int), the durabili...
python
{ "resource": "" }
q231330
Transaction.begin
train
def begin(self): """ Begins this transaction. """ if hasattr(self._locals, 'transaction_exists') and self._locals.transaction_exists: raise TransactionError("Nested transactions are not allowed.") if self.state != _STATE_NOT_STARTED: raise TransactionError...
python
{ "resource": "" }
q231331
Transaction.commit
train
def commit(self): """ Commits this transaction. """ self._check_thread() if self.state != _STATE_ACTIVE: raise TransactionError("Transaction is not active.") try: self._check_timeout() request = transaction_commit_codec.encode_request(s...
python
{ "resource": "" }
q231332
Transaction.rollback
train
def rollback(self): """ Rollback of this current transaction. """ self._check_thread() if self.state not in (_STATE_ACTIVE, _STATE_PARTIAL_COMMIT): raise TransactionError("Transaction is not active.") try: if self.state != _STATE_PARTIAL_COMMIT: ...
python
{ "resource": "" }
q231333
HazelcastCloudAddressProvider.load_addresses
train
def load_addresses(self): """ Loads member addresses from Hazelcast.cloud endpoint. :return: (Sequence), The possible member addresses to connect to. """ try: return list(self.cloud_discovery.discover_nodes().keys()) except Exception as ex: self.l...
python
{ "resource": "" }
q231334
HazelcastCloudAddressTranslator.translate
train
def translate(self, address): """ Translates the given address to another address specific to network or service. :param address: (:class:`~hazelcast.core.Address`), private address to be translated :return: (:class:`~hazelcast.core.Address`), new address if given address is known, othe...
python
{ "resource": "" }
q231335
HazelcastCloudAddressTranslator.refresh
train
def refresh(self): """ Refreshes the internal lookup table if necessary. """ try: self._private_to_public = self.cloud_discovery.discover_nodes() except Exception as ex: self.logger.warning("Failed to load addresses from Hazelcast.cloud: {}".format(ex.args...
python
{ "resource": "" }
q231336
HazelcastCloudDiscovery.get_host_and_url
train
def get_host_and_url(properties, cloud_token): """ Helper method to get host and url that can be used in HTTPSConnection. :param properties: Client config properties. :param cloud_token: Cloud discovery token. :return: Host and URL pair """ host = properties.get(...
python
{ "resource": "" }
q231337
CountDownLatch.try_set_count
train
def try_set_count(self, count): """ Sets the count to the given value if the current count is zero. If count is not zero, this method does nothing and returns ``false``. :param count: (int), the number of times count_down() must be invoked before threads can pass through await(). ...
python
{ "resource": "" }
q231338
Proxy.destroy
train
def destroy(self): """ Destroys this proxy. :return: (bool), ``true`` if this proxy is deleted successfully, ``false`` otherwise. """ self._on_destroy() return self._client.proxy.destroy_proxy(self.service_name, self.name)
python
{ "resource": "" }
q231339
ClusterService.add_listener
train
def add_listener(self, member_added=None, member_removed=None, fire_for_existing=False): """ Adds a membership listener to listen for membership updates, it will be notified when a member is added to cluster or removed from cluster. There is no check for duplicate registrations, so if you regist...
python
{ "resource": "" }
q231340
ClusterService.remove_listener
train
def remove_listener(self, registration_id): """ Removes the specified membership listener. :param registration_id: (str), registration id of the listener to be deleted. :return: (bool), if the registration is removed, ``false`` otherwise. """ try: self.listen...
python
{ "resource": "" }
q231341
ClusterService.get_member_by_uuid
train
def get_member_by_uuid(self, member_uuid): """ Returns the member with specified member uuid. :param member_uuid: (int), uuid of the desired member. :return: (:class:`~hazelcast.core.Member`), the corresponding member. """ for member in self.get_member_list(): ...
python
{ "resource": "" }
q231342
ClusterService.get_members
train
def get_members(self, selector): """ Returns the members that satisfy the given selector. :param selector: (:class:`~hazelcast.core.MemberSelector`), Selector to be applied to the members. :return: (List), List of members. """ members = [] for member in self.get_...
python
{ "resource": "" }
q231343
VectorClock.is_after
train
def is_after(self, other): """ Returns true if this vector clock is causally strictly after the provided vector clock. This means that it the provided clock is neither equal to, greater than or concurrent to this vector clock. :param other: (:class:`~hazelcast.cluster.VectorCloc...
python
{ "resource": "" }
q231344
Set.contains
train
def contains(self, item): """ Determines whether this set contains the specified item or not. :param item: (object), the specified item to be searched. :return: (bool), ``true`` if the specified item exists in this set, ``false`` otherwise. """ check_not_none(item, "Valu...
python
{ "resource": "" }
q231345
Set.contains_all
train
def contains_all(self, items): """ Determines whether this set contains all of the items in the specified collection or not. :param items: (Collection), the specified collection which includes the items to be searched. :return: (bool), ``true`` if all of the items in the specified colle...
python
{ "resource": "" }
q231346
AtomicLong.alter
train
def alter(self, function): """ Alters the currently stored value by applying a function on it. :param function: (Function), A stateful serializable object which represents the Function defined on server side. This object must have a serializable Function counter part reg...
python
{ "resource": "" }
q231347
AtomicLong.alter_and_get
train
def alter_and_get(self, function): """ Alters the currently stored value by applying a function on it and gets the result. :param function: (Function), A stateful serializable object which represents the Function defined on server side. This object must have a serializab...
python
{ "resource": "" }
q231348
AtomicLong.get_and_alter
train
def get_and_alter(self, function): """ Alters the currently stored value by applying a function on it on and gets the old value. :param function: (Function), A stateful serializable object which represents the Function defined on server side. This object must have a seri...
python
{ "resource": "" }
q231349
main
train
def main(jlink_serial, device): """Prints the core's information. Args: jlink_serial (str): the J-Link serial number device (str): the target CPU Returns: Always returns ``0``. Raises: JLinkException: on error """ buf = StringIO.StringIO() jlink = pylink.JLink(log=...
python
{ "resource": "" }
q231350
JLock.acquire
train
def acquire(self): """Attempts to acquire a lock for the J-Link lockfile. If the lockfile exists but does not correspond to an active process, the lockfile is first removed, before an attempt is made to acquire it. Args: self (Jlock): the ``JLock`` instance Returns: ...
python
{ "resource": "" }
q231351
JLock.release
train
def release(self): """Cleans up the lockfile if it was acquired. Args: self (JLock): the ``JLock`` instance Returns: ``False`` if the lock was not released or the lock is not acquired, otherwise ``True``. """ if not self.acquired: retur...
python
{ "resource": "" }
q231352
calculate_parity
train
def calculate_parity(n): """Calculates and returns the parity of a number. The parity of a number is ``1`` if the number has an odd number of ones in its binary representation, otherwise ``0``. Args: n (int): the number whose parity to calculate Returns: ``1`` if the number has an odd...
python
{ "resource": "" }
q231353
pack
train
def pack(value, nbits=None): """Packs a given value into an array of 8-bit unsigned integers. If ``nbits`` is not present, calculates the minimal number of bits required to represent the given ``value``. The result is little endian. Args: value (int): the integer value to pack nbits (int)...
python
{ "resource": "" }
q231354
long_description
train
def long_description(): """Reads and returns the contents of the README. On failure, returns the project long description. Returns: The project's long description. """ cwd = os.path.abspath(os.path.dirname(__file__)) readme_path = os.path.join(cwd, 'README.md') if not os.path.exists(...
python
{ "resource": "" }
q231355
CleanCommand.finalize_options
train
def finalize_options(self): """Populate the attributes. Args: self (CleanCommand): the ``CleanCommand`` instance Returns: ``None`` """ self.cwd = os.path.abspath(os.path.dirname(__file__)) self.build_dirs = [ os.path.join(self.cwd, 'build...
python
{ "resource": "" }
q231356
CoverageCommand.finalize_options
train
def finalize_options(self): """Finalizes the command's options. Args: self (CoverageCommand): the ``CoverageCommand`` instance Returns: ``None`` """ self.cwd = os.path.abspath(os.path.dirname(__file__)) self.test_dir = os.path.join(self.cwd, 'tests')
python
{ "resource": "" }
q231357
unlock_kinetis_identified
train
def unlock_kinetis_identified(identity, flags): """Checks whether the given flags are a valid identity. Args: identity (Identity): the identity to validate against flags (register.IDCodeRegisterFlags): the set idcode flags Returns: ``True`` if the given ``flags`` correctly identify the t...
python
{ "resource": "" }
q231358
unlock_kinetis_abort_clear
train
def unlock_kinetis_abort_clear(): """Returns the abort register clear code. Returns: The abort register clear code. """ flags = registers.AbortRegisterFlags() flags.STKCMPCLR = 1 flags.STKERRCLR = 1 flags.WDERRCLR = 1 flags.ORUNERRCLR = 1 return flags.value
python
{ "resource": "" }
q231359
unlock_kinetis_read_until_ack
train
def unlock_kinetis_read_until_ack(jlink, address): """Polls the device until the request is acknowledged. Sends a read request to the connected device to read the register at the given 'address'. Polls indefinitely until either the request is ACK'd or the request ends in a fault. Args: jlin...
python
{ "resource": "" }
q231360
unlock_kinetis_swd
train
def unlock_kinetis_swd(jlink): """Unlocks a Kinetis device over SWD. Steps Involved in Unlocking: 1. Verify that the device is configured to read/write from the CoreSight registers; this is done by reading the Identification Code Register and checking its validity. This register is ...
python
{ "resource": "" }
q231361
unlock_kinetis
train
def unlock_kinetis(jlink): """Unlock for Freescale Kinetis K40 or K60 device. Args: jlink (JLink): an instance of a J-Link that is connected to a target. Returns: ``True`` if the device was successfully unlocked, otherwise ``False``. Raises: ValueError: if the J-Link is not connecte...
python
{ "resource": "" }
q231362
JLink.minimum_required
train
def minimum_required(version): """Decorator to specify the minimum SDK version required. Args: version (str): valid version string Returns: A decorator function. """ def _minimum_required(func): """Internal decorator that wraps around the given f...
python
{ "resource": "" }
q231363
JLink.open_required
train
def open_required(func): """Decorator to specify that the J-Link DLL must be opened, and a J-Link connection must be established. Args: func (function): function being decorated Returns: The wrapper function. """ @functools.wraps(func) def wr...
python
{ "resource": "" }
q231364
JLink.connection_required
train
def connection_required(func): """Decorator to specify that a target connection is required in order for the given method to be used. Args: func (function): function being decorated Returns: The wrapper function. """ @functools.wraps(func) de...
python
{ "resource": "" }
q231365
JLink.interface_required
train
def interface_required(interface): """Decorator to specify that a particular interface type is required for the given method to be used. Args: interface (int): attribute of ``JLinkInterfaces`` Returns: A decorator function. """ def _interface_require...
python
{ "resource": "" }
q231366
JLink.log_handler
train
def log_handler(self, handler): """Setter for the log handler function. Args: self (JLink): the ``JLink`` instance Returns: ``None`` """ if not self.opened(): handler = handler or util.noop self._log_handler = enums.JLinkFunctions.LOG...
python
{ "resource": "" }
q231367
JLink.detailed_log_handler
train
def detailed_log_handler(self, handler): """Setter for the detailed log handler function. Args: self (JLink): the ``JLink`` instance Returns: ``None`` """ if not self.opened(): handler = handler or util.noop self._detailed_log_handler...
python
{ "resource": "" }
q231368
JLink.error_handler
train
def error_handler(self, handler): """Setter for the error handler function. If the DLL is open, this function is a no-op, so it should be called prior to calling ``open()``. Args: self (JLink): the ``JLink`` instance handler (function): function to call on error mes...
python
{ "resource": "" }
q231369
JLink.warning_handler
train
def warning_handler(self, handler): """Setter for the warning handler function. If the DLL is open, this function is a no-op, so it should be called prior to calling ``open()``. Args: self (JLink): the ``JLink`` instance handler (function): function to call on warni...
python
{ "resource": "" }
q231370
JLink.connected_emulators
train
def connected_emulators(self, host=enums.JLinkHost.USB): """Returns a list of all the connected emulators. Args: self (JLink): the ``JLink`` instance host (int): host type to search (default: ``JLinkHost.USB``) Returns: List of ``JLinkConnectInfo`` specifying the ...
python
{ "resource": "" }
q231371
JLink.supported_device
train
def supported_device(self, index=0): """Gets the device at the given ``index``. Args: self (JLink): the ``JLink`` instance index (int): the index of the device whose information to get Returns: A ``JLinkDeviceInfo`` describing the requested device. Raises...
python
{ "resource": "" }
q231372
JLink.close
train
def close(self): """Closes the open J-Link. Args: self (JLink): the ``JLink`` instance Returns: ``None`` Raises: JLinkException: if there is no connected JLink. """ self._dll.JLINKARM_Close() if self._lock is not None: ...
python
{ "resource": "" }
q231373
JLink.sync_firmware
train
def sync_firmware(self): """Syncs the emulator's firmware version and the DLL's firmware. This method is useful for ensuring that the firmware running on the J-Link matches the firmware supported by the DLL. Args: self (JLink): the ``JLink`` instance Returns: ...
python
{ "resource": "" }
q231374
JLink.exec_command
train
def exec_command(self, cmd): """Executes the given command. This method executes a command by calling the DLL's exec method. Direct API methods should be prioritized over calling this method. Args: self (JLink): the ``JLink`` instance cmd (str): the command to run ...
python
{ "resource": "" }
q231375
JLink.jtag_configure
train
def jtag_configure(self, instr_regs=0, data_bits=0): """Configures the JTAG scan chain to determine which CPU to address. Must be called if the J-Link is connected to a JTAG scan chain with multiple devices. Args: self (JLink): the ``JLink`` instance instr_regs (int...
python
{ "resource": "" }
q231376
JLink.coresight_configure
train
def coresight_configure(self, ir_pre=0, dr_pre=0, ir_post=0, dr_post=0, ir_len=0, perform_tif_init=True): """Prepares target and J-Link for Core...
python
{ "resource": "" }
q231377
JLink.connect
train
def connect(self, chip_name, speed='auto', verbose=False): """Connects the J-Link to its target. Args: self (JLink): the ``JLink`` instance chip_name (str): target chip name speed (int): connection speed, one of ``{5-12000, 'auto', 'adaptive'}`` verbose (bool): b...
python
{ "resource": "" }
q231378
JLink.compile_date
train
def compile_date(self): """Returns a string specifying the date and time at which the DLL was translated. Args: self (JLink): the ``JLink`` instance Returns: Datetime string. """ result = self._dll.JLINKARM_GetCompileDateTime() return ctypes....
python
{ "resource": "" }
q231379
JLink.version
train
def version(self): """Returns the device's version. The device's version is returned as a string of the format: M.mr where ``M`` is major number, ``m`` is minor number, and ``r`` is revision character. Args: self (JLink): the ``JLink`` instance Returns: ...
python
{ "resource": "" }
q231380
JLink.compatible_firmware_version
train
def compatible_firmware_version(self): """Returns the DLL's compatible J-Link firmware version. Args: self (JLink): the ``JLink`` instance Returns: The firmware version of the J-Link that the DLL is compatible with. Raises: JLinkException: on er...
python
{ "resource": "" }
q231381
JLink.firmware_outdated
train
def firmware_outdated(self): """Returns whether the J-Link's firmware version is older than the one that the DLL is compatible with. Note: This is not the same as calling ``not jlink.firmware_newer()``. Args: self (JLink): the ``JLink`` instance Returns: ...
python
{ "resource": "" }
q231382
JLink.hardware_info
train
def hardware_info(self, mask=0xFFFFFFFF): """Returns a list of 32 integer values corresponding to the bitfields specifying the power consumption of the target. The values returned by this function only have significance if the J-Link is powering the target. The words, indexed, ...
python
{ "resource": "" }
q231383
JLink.hardware_status
train
def hardware_status(self): """Retrieves and returns the hardware status. Args: self (JLink): the ``JLink`` instance Returns: A ``JLinkHardwareStatus`` describing the J-Link hardware. """ stat = structs.JLinkHardwareStatus() res = self._dll.JLINKARM_G...
python
{ "resource": "" }
q231384
JLink.hardware_version
train
def hardware_version(self): """Returns the hardware version of the connected J-Link as a major.minor string. Args: self (JLink): the ``JLink`` instance Returns: Hardware version string. """ version = self._dll.JLINKARM_GetHardwareVersion() ma...
python
{ "resource": "" }
q231385
JLink.firmware_version
train
def firmware_version(self): """Returns a firmware identification string of the connected J-Link. It consists of the following: - Product Name (e.g. J-Link) - The string: compiled - Compile data and time. - Optional additional information. Args: ...
python
{ "resource": "" }
q231386
JLink.extended_capabilities
train
def extended_capabilities(self): """Gets the capabilities of the connected emulator as a list. Args: self (JLink): the ``JLink`` instance Returns: List of 32 integers which define the extended capabilities based on their value and index within the list. ""...
python
{ "resource": "" }
q231387
JLink.features
train
def features(self): """Returns a list of the J-Link embedded features. Args: self (JLink): the ``JLink`` instance Returns: A list of strings, each a feature. Example: ``[ 'RDI', 'FlashBP', 'FlashDL', 'JFlash', 'GDB' ]`` """ buf = (ctypes.c_char * ...
python
{ "resource": "" }
q231388
JLink.product_name
train
def product_name(self): """Returns the product name of the connected J-Link. Args: self (JLink): the ``JLink`` instance Returns: Product name. """ buf = (ctypes.c_char * self.MAX_BUF_SIZE)() self._dll.JLINKARM_EMU_GetProductName(buf, self.MAX_BUF_SIZ...
python
{ "resource": "" }
q231389
JLink.oem
train
def oem(self): """Retrieves and returns the OEM string of the connected J-Link. Args: self (JLink): the ``JLink`` instance Returns: The string of the OEM. If this is an original SEGGER product, then ``None`` is returned instead. Raises: JLinkEx...
python
{ "resource": "" }
q231390
JLink.set_speed
train
def set_speed(self, speed=None, auto=False, adaptive=False): """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 tha...
python
{ "resource": "" }
q231391
JLink.speed_info
train
def speed_info(self): """Retrieves information about supported target interface speeds. Args: self (JLink): the ``JLink`` instance Returns: The ``JLinkSpeedInfo`` instance describing the supported target interface speeds. """ speed_info = structs.J...
python
{ "resource": "" }
q231392
JLink.licenses
train
def licenses(self): """Returns a string of the built-in licenses the J-Link has. Args: self (JLink): the ``JLink`` instance Returns: String of the contents of the built-in licenses the J-Link has. """ buf_size = self.MAX_BUF_SIZE buf = (ctypes.c_char...
python
{ "resource": "" }
q231393
JLink.custom_licenses
train
def custom_licenses(self): """Returns a string of the installed licenses the J-Link has. Args: self (JLink): the ``JLink`` instance Returns: String of the contents of the custom licenses the J-Link has. """ buf = (ctypes.c_char * self.MAX_BUF_SIZE)() ...
python
{ "resource": "" }
q231394
JLink.add_license
train
def add_license(self, contents): """Adds the given ``contents`` as a new custom license to the J-Link. Args: self (JLink): the ``JLink`` instance contents: the string contents of the new custom license Returns: ``True`` if license was added, ``False`` if license a...
python
{ "resource": "" }
q231395
JLink.supported_tifs
train
def supported_tifs(self): """Returns a bitmask of the supported target interfaces. Args: self (JLink): the ``JLink`` instance Returns: Bitfield specifying which target interfaces are supported. """ buf = ctypes.c_uint32() self._dll.JLINKARM_TIF_GetAv...
python
{ "resource": "" }
q231396
JLink.set_tif
train
def set_tif(self, interface): """Selects the specified target interface. Note that a restart must be triggered for this to take effect. Args: self (Jlink): the ``JLink`` instance interface (int): integer identifier of the interface Returns: ``True`` if ta...
python
{ "resource": "" }
q231397
JLink.gpio_properties
train
def gpio_properties(self): """Returns the properties of the user-controllable GPIOs. Provided the device supports user-controllable GPIOs, they will be returned by this method. Args: self (JLink): the ``JLink`` instance Returns: A list of ``JLinkGPIODescrip...
python
{ "resource": "" }
q231398
JLink.gpio_get
train
def gpio_get(self, pins=None): """Returns a list of states for the given pins. Defaults to the first four pins if an argument is not given. Args: self (JLink): the ``JLink`` instance pins (list): indices of the GPIO pins whose states are requested Returns: ...
python
{ "resource": "" }
q231399
JLink.gpio_set
train
def gpio_set(self, pins, states): """Sets the state for one or more user-controllable GPIOs. For each of the given pins, sets the the corresponding state based on the index. Args: self (JLink): the ``JLink`` instance pins (list): list of GPIO indices state...
python
{ "resource": "" }