id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
234,000 | pyvisa/pyvisa | pyvisa/rname.py | register_subclass | def register_subclass(cls):
"""Register a subclass for a given interface type and resource class.
"""
key = cls.interface_type, cls.resource_class
if key in _SUBCLASSES:
raise ValueError('Class already registered for %s and %s' % key)
_SUBCLASSES[(cls.interface_type, cls.resource_class)] ... | python | def register_subclass(cls):
"""Register a subclass for a given interface type and resource class.
"""
key = cls.interface_type, cls.resource_class
if key in _SUBCLASSES:
raise ValueError('Class already registered for %s and %s' % key)
_SUBCLASSES[(cls.interface_type, cls.resource_class)] ... | [
"def",
"register_subclass",
"(",
"cls",
")",
":",
"key",
"=",
"cls",
".",
"interface_type",
",",
"cls",
".",
"resource_class",
"if",
"key",
"in",
"_SUBCLASSES",
":",
"raise",
"ValueError",
"(",
"'Class already registered for %s and %s'",
"%",
"key",
")",
"_SUBCL... | Register a subclass for a given interface type and resource class. | [
"Register",
"a",
"subclass",
"for",
"a",
"given",
"interface",
"type",
"and",
"resource",
"class",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/rname.py#L86-L106 |
234,001 | pyvisa/pyvisa | pyvisa/rname.py | InvalidResourceName.bad_syntax | def bad_syntax(cls, syntax, resource_name, ex=None):
"""Exception used when the resource name cannot be parsed.
"""
if ex:
msg = "The syntax is '%s' (%s)." % (syntax, ex)
else:
msg = "The syntax is '%s'." % syntax
msg = "Could not parse '%s'. %s" % (reso... | python | def bad_syntax(cls, syntax, resource_name, ex=None):
"""Exception used when the resource name cannot be parsed.
"""
if ex:
msg = "The syntax is '%s' (%s)." % (syntax, ex)
else:
msg = "The syntax is '%s'." % syntax
msg = "Could not parse '%s'. %s" % (reso... | [
"def",
"bad_syntax",
"(",
"cls",
",",
"syntax",
",",
"resource_name",
",",
"ex",
"=",
"None",
")",
":",
"if",
"ex",
":",
"msg",
"=",
"\"The syntax is '%s' (%s).\"",
"%",
"(",
"syntax",
",",
"ex",
")",
"else",
":",
"msg",
"=",
"\"The syntax is '%s'.\"",
"... | Exception used when the resource name cannot be parsed. | [
"Exception",
"used",
"when",
"the",
"resource",
"name",
"cannot",
"be",
"parsed",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/rname.py#L43-L54 |
234,002 | pyvisa/pyvisa | pyvisa/rname.py | InvalidResourceName.rc_notfound | def rc_notfound(cls, interface_type, resource_name=None):
"""Exception used when no resource class is provided and no default is found.
"""
msg = "Resource class for %s not provided and default not found." % interface_type
if resource_name:
msg = "Could not parse '%s'. %s" ... | python | def rc_notfound(cls, interface_type, resource_name=None):
"""Exception used when no resource class is provided and no default is found.
"""
msg = "Resource class for %s not provided and default not found." % interface_type
if resource_name:
msg = "Could not parse '%s'. %s" ... | [
"def",
"rc_notfound",
"(",
"cls",
",",
"interface_type",
",",
"resource_name",
"=",
"None",
")",
":",
"msg",
"=",
"\"Resource class for %s not provided and default not found.\"",
"%",
"interface_type",
"if",
"resource_name",
":",
"msg",
"=",
"\"Could not parse '%s'. %s\""... | Exception used when no resource class is provided and no default is found. | [
"Exception",
"used",
"when",
"no",
"resource",
"class",
"is",
"provided",
"and",
"no",
"default",
"is",
"found",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/rname.py#L71-L80 |
234,003 | pyvisa/pyvisa | pyvisa/rname.py | ResourceName.from_string | def from_string(cls, resource_name):
"""Parse a resource name and return a ResourceName
:type resource_name: str
:rtype: ResourceName
:raises InvalidResourceName: if the resource name is invalid.
"""
# TODO Remote VISA
uname = resource_name.upper()
for... | python | def from_string(cls, resource_name):
"""Parse a resource name and return a ResourceName
:type resource_name: str
:rtype: ResourceName
:raises InvalidResourceName: if the resource name is invalid.
"""
# TODO Remote VISA
uname = resource_name.upper()
for... | [
"def",
"from_string",
"(",
"cls",
",",
"resource_name",
")",
":",
"# TODO Remote VISA",
"uname",
"=",
"resource_name",
".",
"upper",
"(",
")",
"for",
"interface_type",
"in",
"_INTERFACE_TYPES",
":",
"# Loop through all known interface types until we found one",
"# that ma... | Parse a resource name and return a ResourceName
:type resource_name: str
:rtype: ResourceName
:raises InvalidResourceName: if the resource name is invalid. | [
"Parse",
"a",
"resource",
"name",
"and",
"return",
"a",
"ResourceName"
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/rname.py#L139-L193 |
234,004 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | set_user_handle_type | def set_user_handle_type(library, user_handle):
"""Set the type of the user handle to install and uninstall handler signature.
:param library: the visa library wrapped by ctypes.
:param user_handle: use None for a void_p
"""
# Actually, it's not necessary to change ViHndlr *globally*. However,
... | python | def set_user_handle_type(library, user_handle):
"""Set the type of the user handle to install and uninstall handler signature.
:param library: the visa library wrapped by ctypes.
:param user_handle: use None for a void_p
"""
# Actually, it's not necessary to change ViHndlr *globally*. However,
... | [
"def",
"set_user_handle_type",
"(",
"library",
",",
"user_handle",
")",
":",
"# Actually, it's not necessary to change ViHndlr *globally*. However,",
"# I don't want to break symmetry too much with all the other VPP43",
"# routines.",
"global",
"ViHndlr",
"if",
"user_handle",
"is",
... | Set the type of the user handle to install and uninstall handler signature.
:param library: the visa library wrapped by ctypes.
:param user_handle: use None for a void_p | [
"Set",
"the",
"type",
"of",
"the",
"user",
"handle",
"to",
"install",
"and",
"uninstall",
"handler",
"signature",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L52-L71 |
234,005 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | set_signature | def set_signature(library, function_name, argtypes, restype, errcheck):
"""Set the signature of single function in a library.
:param library: ctypes wrapped library.
:type library: ctypes.WinDLL or ctypes.CDLL
:param function_name: name of the function as appears in the header file.
:type function_... | python | def set_signature(library, function_name, argtypes, restype, errcheck):
"""Set the signature of single function in a library.
:param library: ctypes wrapped library.
:type library: ctypes.WinDLL or ctypes.CDLL
:param function_name: name of the function as appears in the header file.
:type function_... | [
"def",
"set_signature",
"(",
"library",
",",
"function_name",
",",
"argtypes",
",",
"restype",
",",
"errcheck",
")",
":",
"func",
"=",
"getattr",
"(",
"library",
",",
"function_name",
")",
"func",
".",
"argtypes",
"=",
"argtypes",
"if",
"restype",
"is",
"n... | Set the signature of single function in a library.
:param library: ctypes wrapped library.
:type library: ctypes.WinDLL or ctypes.CDLL
:param function_name: name of the function as appears in the header file.
:type function_name: str
:param argtypes: a tuple of ctypes types to specify the argument ... | [
"Set",
"the",
"signature",
"of",
"single",
"function",
"in",
"a",
"library",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L226-L246 |
234,006 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | assert_interrupt_signal | def assert_interrupt_signal(library, session, mode, status_id):
"""Asserts the specified interrupt or signal.
Corresponds to viAssertIntrSignal function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param mode: How... | python | def assert_interrupt_signal(library, session, mode, status_id):
"""Asserts the specified interrupt or signal.
Corresponds to viAssertIntrSignal function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param mode: How... | [
"def",
"assert_interrupt_signal",
"(",
"library",
",",
"session",
",",
"mode",
",",
"status_id",
")",
":",
"return",
"library",
".",
"viAssertIntrSignal",
"(",
"session",
",",
"mode",
",",
"status_id",
")"
] | Asserts the specified interrupt or signal.
Corresponds to viAssertIntrSignal function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param mode: How to assert the interrupt. (Constants.ASSERT*)
:param status_id: Thi... | [
"Asserts",
"the",
"specified",
"interrupt",
"or",
"signal",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L292-L304 |
234,007 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | discard_events | def discard_events(library, session, event_type, mechanism):
"""Discards event occurrences for specified event types and mechanisms in a session.
Corresponds to viDiscardEvents function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier t... | python | def discard_events(library, session, event_type, mechanism):
"""Discards event occurrences for specified event types and mechanisms in a session.
Corresponds to viDiscardEvents function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier t... | [
"def",
"discard_events",
"(",
"library",
",",
"session",
",",
"event_type",
",",
"mechanism",
")",
":",
"return",
"library",
".",
"viDiscardEvents",
"(",
"session",
",",
"event_type",
",",
"mechanism",
")"
] | Discards event occurrences for specified event types and mechanisms in a session.
Corresponds to viDiscardEvents function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param event_type: Logical event identifier.
:p... | [
"Discards",
"event",
"occurrences",
"for",
"specified",
"event",
"types",
"and",
"mechanisms",
"in",
"a",
"session",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L413-L426 |
234,008 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | enable_event | def enable_event(library, session, event_type, mechanism, context=None):
"""Enable event occurrences for specified event types and mechanisms in a session.
Corresponds to viEnableEvent function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical iden... | python | def enable_event(library, session, event_type, mechanism, context=None):
"""Enable event occurrences for specified event types and mechanisms in a session.
Corresponds to viEnableEvent function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical iden... | [
"def",
"enable_event",
"(",
"library",
",",
"session",
",",
"event_type",
",",
"mechanism",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"constants",
".",
"VI_NULL",
"elif",
"context",
"!=",
"constants",
".",
... | Enable event occurrences for specified event types and mechanisms in a session.
Corresponds to viEnableEvent function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param event_type: Logical event identifier.
:param... | [
"Enable",
"event",
"occurrences",
"for",
"specified",
"event",
"types",
"and",
"mechanisms",
"in",
"a",
"session",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L429-L448 |
234,009 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | find_resources | def find_resources(library, session, query):
"""Queries a VISA system to locate the resources associated with a specified interface.
Corresponds to viFindRsrc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session (unuse... | python | def find_resources(library, session, query):
"""Queries a VISA system to locate the resources associated with a specified interface.
Corresponds to viFindRsrc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session (unuse... | [
"def",
"find_resources",
"(",
"library",
",",
"session",
",",
"query",
")",
":",
"find_list",
"=",
"ViFindList",
"(",
")",
"return_counter",
"=",
"ViUInt32",
"(",
")",
"instrument_description",
"=",
"create_string_buffer",
"(",
"constants",
".",
"VI_FIND_BUFLEN",
... | Queries a VISA system to locate the resources associated with a specified interface.
Corresponds to viFindRsrc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session (unused, just to uniform signatures).
:param query: A ... | [
"Queries",
"a",
"VISA",
"system",
"to",
"locate",
"the",
"resources",
"associated",
"with",
"a",
"specified",
"interface",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L466-L486 |
234,010 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | gpib_command | def gpib_command(library, session, data):
"""Write GPIB command bytes on the bus.
Corresponds to viGpibCommand function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param data: data tor write.
:type data: byte... | python | def gpib_command(library, session, data):
"""Write GPIB command bytes on the bus.
Corresponds to viGpibCommand function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param data: data tor write.
:type data: byte... | [
"def",
"gpib_command",
"(",
"library",
",",
"session",
",",
"data",
")",
":",
"return_count",
"=",
"ViUInt32",
"(",
")",
"# [ViSession, ViBuf, ViUInt32, ViPUInt32]",
"ret",
"=",
"library",
".",
"viGpibCommand",
"(",
"session",
",",
"data",
",",
"len",
"(",
"da... | Write GPIB command bytes on the bus.
Corresponds to viGpibCommand function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param data: data tor write.
:type data: bytes
:return: Number of written bytes, return va... | [
"Write",
"GPIB",
"command",
"bytes",
"on",
"the",
"bus",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L534-L550 |
234,011 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | in_8 | def in_8(library, session, space, offset, extended=False):
"""Reads in an 8-bit value from the specified memory space and offset.
Corresponds to viIn8* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param s... | python | def in_8(library, session, space, offset, extended=False):
"""Reads in an 8-bit value from the specified memory space and offset.
Corresponds to viIn8* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param s... | [
"def",
"in_8",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"extended",
"=",
"False",
")",
":",
"value_8",
"=",
"ViUInt8",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
".",
"viIn8Ex",
"(",
"session",
",",
"space",
",",... | Reads in an 8-bit value from the specified memory space and offset.
Corresponds to viIn8* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:param ... | [
"Reads",
"in",
"an",
"8",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L640-L658 |
234,012 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | in_16 | def in_16(library, session, space, offset, extended=False):
"""Reads in an 16-bit value from the specified memory space and offset.
Corresponds to viIn16* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:para... | python | def in_16(library, session, space, offset, extended=False):
"""Reads in an 16-bit value from the specified memory space and offset.
Corresponds to viIn16* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:para... | [
"def",
"in_16",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"extended",
"=",
"False",
")",
":",
"value_16",
"=",
"ViUInt16",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
".",
"viIn16Ex",
"(",
"session",
",",
"space",
... | Reads in an 16-bit value from the specified memory space and offset.
Corresponds to viIn16* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:para... | [
"Reads",
"in",
"an",
"16",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L661-L679 |
234,013 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | in_32 | def in_32(library, session, space, offset, extended=False):
"""Reads in an 32-bit value from the specified memory space and offset.
Corresponds to viIn32* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:para... | python | def in_32(library, session, space, offset, extended=False):
"""Reads in an 32-bit value from the specified memory space and offset.
Corresponds to viIn32* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:para... | [
"def",
"in_32",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"extended",
"=",
"False",
")",
":",
"value_32",
"=",
"ViUInt32",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
".",
"viIn32Ex",
"(",
"session",
",",
"space",
... | Reads in an 32-bit value from the specified memory space and offset.
Corresponds to viIn32* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:para... | [
"Reads",
"in",
"an",
"32",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L682-L700 |
234,014 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | in_64 | def in_64(library, session, space, offset, extended=False):
"""Reads in an 64-bit value from the specified memory space and offset.
Corresponds to viIn64* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:para... | python | def in_64(library, session, space, offset, extended=False):
"""Reads in an 64-bit value from the specified memory space and offset.
Corresponds to viIn64* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:para... | [
"def",
"in_64",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"extended",
"=",
"False",
")",
":",
"value_64",
"=",
"ViUInt64",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
".",
"viIn64Ex",
"(",
"session",
",",
"space",
... | Reads in an 64-bit value from the specified memory space and offset.
Corresponds to viIn64* function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:para... | [
"Reads",
"in",
"an",
"64",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L703-L721 |
234,015 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | map_trigger | def map_trigger(library, session, trigger_source, trigger_destination, mode):
"""Map the specified trigger source line to the specified destination line.
Corresponds to viMapTrigger function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identif... | python | def map_trigger(library, session, trigger_source, trigger_destination, mode):
"""Map the specified trigger source line to the specified destination line.
Corresponds to viMapTrigger function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identif... | [
"def",
"map_trigger",
"(",
"library",
",",
"session",
",",
"trigger_source",
",",
"trigger_destination",
",",
"mode",
")",
":",
"return",
"library",
".",
"viMapTrigger",
"(",
"session",
",",
"trigger_source",
",",
"trigger_destination",
",",
"mode",
")"
] | Map the specified trigger source line to the specified destination line.
Corresponds to viMapTrigger function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param trigger_source: Source line from which to map. (Constant... | [
"Map",
"the",
"specified",
"trigger",
"source",
"line",
"to",
"the",
"specified",
"destination",
"line",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L838-L851 |
234,016 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | memory_allocation | def memory_allocation(library, session, size, extended=False):
"""Allocates memory from a resource's memory region.
Corresponds to viMemAlloc* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param size: Spe... | python | def memory_allocation(library, session, size, extended=False):
"""Allocates memory from a resource's memory region.
Corresponds to viMemAlloc* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param size: Spe... | [
"def",
"memory_allocation",
"(",
"library",
",",
"session",
",",
"size",
",",
"extended",
"=",
"False",
")",
":",
"offset",
"=",
"ViBusAddress",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
".",
"viMemAllocEx",
"(",
"session",
",",
"size",
","... | Allocates memory from a resource's memory region.
Corresponds to viMemAlloc* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param size: Specifies the size of the allocation.
:param extended: Use 64 bits of... | [
"Allocates",
"memory",
"from",
"a",
"resource",
"s",
"memory",
"region",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L854-L871 |
234,017 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_asynchronously | def move_asynchronously(library, session, source_space, source_offset, source_width,
destination_space, destination_offset,
destination_width, length):
"""Moves a block of data asynchronously.
Corresponds to viMoveAsync function of the VISA library.
:param l... | python | def move_asynchronously(library, session, source_space, source_offset, source_width,
destination_space, destination_offset,
destination_width, length):
"""Moves a block of data asynchronously.
Corresponds to viMoveAsync function of the VISA library.
:param l... | [
"def",
"move_asynchronously",
"(",
"library",
",",
"session",
",",
"source_space",
",",
"source_offset",
",",
"source_width",
",",
"destination_space",
",",
"destination_offset",
",",
"destination_width",
",",
"length",
")",
":",
"job_id",
"=",
"ViJobId",
"(",
")"... | Moves a block of data asynchronously.
Corresponds to viMoveAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param source_space: Specifies the address space of the source.
:param source_offset: Offset of... | [
"Moves",
"a",
"block",
"of",
"data",
"asynchronously",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L916-L940 |
234,018 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_in_8 | def move_in_8(library, session, space, offset, length, extended=False):
"""Moves an 8-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn8* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logic... | python | def move_in_8(library, session, space, offset, length, extended=False):
"""Moves an 8-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn8* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logic... | [
"def",
"move_in_8",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"extended",
"=",
"False",
")",
":",
"buffer_8",
"=",
"(",
"ViUInt8",
"*",
"length",
")",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
".",... | Moves an 8-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn8* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Con... | [
"Moves",
"an",
"8",
"-",
"bit",
"block",
"of",
"data",
"from",
"the",
"specified",
"address",
"space",
"and",
"offset",
"to",
"local",
"memory",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L971-L991 |
234,019 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_in_16 | def move_in_16(library, session, space, offset, length, extended=False):
"""Moves an 16-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique lo... | python | def move_in_16(library, session, space, offset, length, extended=False):
"""Moves an 16-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique lo... | [
"def",
"move_in_16",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"extended",
"=",
"False",
")",
":",
"buffer_16",
"=",
"(",
"ViUInt16",
"*",
"length",
")",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
"... | Moves an 16-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (C... | [
"Moves",
"an",
"16",
"-",
"bit",
"block",
"of",
"data",
"from",
"the",
"specified",
"address",
"space",
"and",
"offset",
"to",
"local",
"memory",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L994-L1015 |
234,020 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_in_32 | def move_in_32(library, session, space, offset, length, extended=False):
"""Moves an 32-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique lo... | python | def move_in_32(library, session, space, offset, length, extended=False):
"""Moves an 32-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique lo... | [
"def",
"move_in_32",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"extended",
"=",
"False",
")",
":",
"buffer_32",
"=",
"(",
"ViUInt32",
"*",
"length",
")",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
"... | Moves an 32-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (C... | [
"Moves",
"an",
"32",
"-",
"bit",
"block",
"of",
"data",
"from",
"the",
"specified",
"address",
"space",
"and",
"offset",
"to",
"local",
"memory",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1018-L1039 |
234,021 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_in_64 | def move_in_64(library, session, space, offset, length, extended=False):
"""Moves an 64-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique lo... | python | def move_in_64(library, session, space, offset, length, extended=False):
"""Moves an 64-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique lo... | [
"def",
"move_in_64",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"extended",
"=",
"False",
")",
":",
"buffer_64",
"=",
"(",
"ViUInt64",
"*",
"length",
")",
"(",
")",
"if",
"extended",
":",
"ret",
"=",
"library",
"... | Moves an 64-bit block of data from the specified address space and offset to local memory.
Corresponds to viMoveIn64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (C... | [
"Moves",
"an",
"64",
"-",
"bit",
"block",
"of",
"data",
"from",
"the",
"specified",
"address",
"space",
"and",
"offset",
"to",
"local",
"memory",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1042-L1063 |
234,022 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_out_16 | def move_out_16(library, session, space, offset, length, data, extended=False):
"""Moves an 16-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: U... | python | def move_out_16(library, session, space, offset, length, data, extended=False):
"""Moves an 16-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: U... | [
"def",
"move_out_16",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"converted_buffer",
"=",
"(",
"ViUInt16",
"*",
"length",
")",
"(",
"*",
"tuple",
"(",
"data",
")",
... | Moves an 16-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (... | [
"Moves",
"an",
"16",
"-",
"bit",
"block",
"of",
"data",
"from",
"local",
"memory",
"to",
"the",
"specified",
"address",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1120-L1140 |
234,023 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_out_32 | def move_out_32(library, session, space, offset, length, data, extended=False):
"""Moves an 32-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: U... | python | def move_out_32(library, session, space, offset, length, data, extended=False):
"""Moves an 32-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: U... | [
"def",
"move_out_32",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"converted_buffer",
"=",
"(",
"ViUInt32",
"*",
"length",
")",
"(",
"*",
"tuple",
"(",
"data",
")",
... | Moves an 32-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (... | [
"Moves",
"an",
"32",
"-",
"bit",
"block",
"of",
"data",
"from",
"local",
"memory",
"to",
"the",
"specified",
"address",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1143-L1163 |
234,024 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | move_out_64 | def move_out_64(library, session, space, offset, length, data, extended=False):
"""Moves an 64-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: U... | python | def move_out_64(library, session, space, offset, length, data, extended=False):
"""Moves an 64-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: U... | [
"def",
"move_out_64",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"length",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"converted_buffer",
"=",
"(",
"ViUInt64",
"*",
"length",
")",
"(",
"*",
"tuple",
"(",
"data",
")",
... | Moves an 64-bit block of data from local memory to the specified address space and offset.
Corresponds to viMoveOut64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (... | [
"Moves",
"an",
"64",
"-",
"bit",
"block",
"of",
"data",
"from",
"local",
"memory",
"to",
"the",
"specified",
"address",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1166-L1186 |
234,025 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | open_default_resource_manager | def open_default_resource_manager(library):
"""This function returns a session to the Default Resource Manager resource.
Corresponds to viOpenDefaultRM function of the VISA library.
:param library: the visa library wrapped by ctypes.
:return: Unique logical identifier to a Default Resource Manager ses... | python | def open_default_resource_manager(library):
"""This function returns a session to the Default Resource Manager resource.
Corresponds to viOpenDefaultRM function of the VISA library.
:param library: the visa library wrapped by ctypes.
:return: Unique logical identifier to a Default Resource Manager ses... | [
"def",
"open_default_resource_manager",
"(",
"library",
")",
":",
"session",
"=",
"ViSession",
"(",
")",
"ret",
"=",
"library",
".",
"viOpenDefaultRM",
"(",
"byref",
"(",
"session",
")",
")",
"return",
"session",
".",
"value",
",",
"ret"
] | This function returns a session to the Default Resource Manager resource.
Corresponds to viOpenDefaultRM function of the VISA library.
:param library: the visa library wrapped by ctypes.
:return: Unique logical identifier to a Default Resource Manager session, return value of the library call.
:rtype:... | [
"This",
"function",
"returns",
"a",
"session",
"to",
"the",
"Default",
"Resource",
"Manager",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1217-L1228 |
234,026 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | out_8 | def out_8(library, session, space, offset, data, extended=False):
"""Write in an 8-bit value from the specified memory space and offset.
Corresponds to viOut8* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | python | def out_8(library, session, space, offset, data, extended=False):
"""Write in an 8-bit value from the specified memory space and offset.
Corresponds to viOut8* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | [
"def",
"out_8",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"if",
"extended",
":",
"return",
"library",
".",
"viOut8Ex",
"(",
"session",
",",
"space",
",",
"offset",
",",
"data",
... | Write in an 8-bit value from the specified memory space and offset.
Corresponds to viOut8* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:para... | [
"Write",
"in",
"an",
"8",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1256-L1273 |
234,027 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | out_16 | def out_16(library, session, space, offset, data, extended=False):
"""Write in an 16-bit value from the specified memory space and offset.
Corresponds to viOut16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | python | def out_16(library, session, space, offset, data, extended=False):
"""Write in an 16-bit value from the specified memory space and offset.
Corresponds to viOut16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | [
"def",
"out_16",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"if",
"extended",
":",
"return",
"library",
".",
"viOut16Ex",
"(",
"session",
",",
"space",
",",
"offset",
",",
"data",
... | Write in an 16-bit value from the specified memory space and offset.
Corresponds to viOut16* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:pa... | [
"Write",
"in",
"an",
"16",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1276-L1293 |
234,028 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | out_32 | def out_32(library, session, space, offset, data, extended=False):
"""Write in an 32-bit value from the specified memory space and offset.
Corresponds to viOut32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | python | def out_32(library, session, space, offset, data, extended=False):
"""Write in an 32-bit value from the specified memory space and offset.
Corresponds to viOut32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | [
"def",
"out_32",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"if",
"extended",
":",
"return",
"library",
".",
"viOut32Ex",
"(",
"session",
",",
"space",
",",
"offset",
",",
"data",
... | Write in an 32-bit value from the specified memory space and offset.
Corresponds to viOut32* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:pa... | [
"Write",
"in",
"an",
"32",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1296-L1313 |
234,029 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | out_64 | def out_64(library, session, space, offset, data, extended=False):
"""Write in an 64-bit value from the specified memory space and offset.
Corresponds to viOut64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | python | def out_64(library, session, space, offset, data, extended=False):
"""Write in an 64-bit value from the specified memory space and offset.
Corresponds to viOut64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | [
"def",
"out_64",
"(",
"library",
",",
"session",
",",
"space",
",",
"offset",
",",
"data",
",",
"extended",
"=",
"False",
")",
":",
"if",
"extended",
":",
"return",
"library",
".",
"viOut64Ex",
"(",
"session",
",",
"space",
",",
"offset",
",",
"data",
... | Write in an 64-bit value from the specified memory space and offset.
Corresponds to viOut64* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param space: Specifies the address space. (Constants.*SPACE*)
:pa... | [
"Write",
"in",
"an",
"64",
"-",
"bit",
"value",
"from",
"the",
"specified",
"memory",
"space",
"and",
"offset",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1316-L1333 |
234,030 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | parse_resource | def parse_resource(library, session, resource_name):
"""Parse a resource string to get the interface information.
Corresponds to viParseRsrc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Resource Manager session (should always be the Default Resource... | python | def parse_resource(library, session, resource_name):
"""Parse a resource string to get the interface information.
Corresponds to viParseRsrc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Resource Manager session (should always be the Default Resource... | [
"def",
"parse_resource",
"(",
"library",
",",
"session",
",",
"resource_name",
")",
":",
"interface_type",
"=",
"ViUInt16",
"(",
")",
"interface_board_number",
"=",
"ViUInt16",
"(",
")",
"# [ViSession, ViRsrc, ViPUInt16, ViPUInt16]",
"# ViRsrc converts from (str, unicode, b... | Parse a resource string to get the interface information.
Corresponds to viParseRsrc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Resource Manager session (should always be the Default Resource Manager for VISA
returned from open_def... | [
"Parse",
"a",
"resource",
"string",
"to",
"get",
"the",
"interface",
"information",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1336-L1357 |
234,031 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | peek | def peek(library, session, address, width):
"""Read an 8, 16 or 32-bit value from the specified address.
Corresponds to viPeek* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address ... | python | def peek(library, session, address, width):
"""Read an 8, 16 or 32-bit value from the specified address.
Corresponds to viPeek* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address ... | [
"def",
"peek",
"(",
"library",
",",
"session",
",",
"address",
",",
"width",
")",
":",
"if",
"width",
"==",
"8",
":",
"return",
"peek_8",
"(",
"library",
",",
"session",
",",
"address",
")",
"elif",
"width",
"==",
"16",
":",
"return",
"peek_16",
"(",... | Read an 8, 16 or 32-bit value from the specified address.
Corresponds to viPeek* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:param width: Number of bits... | [
"Read",
"an",
"8",
"16",
"or",
"32",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1397-L1419 |
234,032 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | peek_8 | def peek_8(library, session, address):
"""Read an 8-bit value from the specified address.
Corresponds to viPeek8 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the valu... | python | def peek_8(library, session, address):
"""Read an 8-bit value from the specified address.
Corresponds to viPeek8 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the valu... | [
"def",
"peek_8",
"(",
"library",
",",
"session",
",",
"address",
")",
":",
"value_8",
"=",
"ViUInt8",
"(",
")",
"ret",
"=",
"library",
".",
"viPeek8",
"(",
"session",
",",
"address",
",",
"byref",
"(",
"value_8",
")",
")",
"return",
"value_8",
".",
"... | Read an 8-bit value from the specified address.
Corresponds to viPeek8 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:return: Data read from bus, return val... | [
"Read",
"an",
"8",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1422-L1435 |
234,033 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | peek_16 | def peek_16(library, session, address):
"""Read an 16-bit value from the specified address.
Corresponds to viPeek16 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the v... | python | def peek_16(library, session, address):
"""Read an 16-bit value from the specified address.
Corresponds to viPeek16 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the v... | [
"def",
"peek_16",
"(",
"library",
",",
"session",
",",
"address",
")",
":",
"value_16",
"=",
"ViUInt16",
"(",
")",
"ret",
"=",
"library",
".",
"viPeek16",
"(",
"session",
",",
"address",
",",
"byref",
"(",
"value_16",
")",
")",
"return",
"value_16",
".... | Read an 16-bit value from the specified address.
Corresponds to viPeek16 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:return: Data read from bus, return v... | [
"Read",
"an",
"16",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1438-L1451 |
234,034 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | peek_32 | def peek_32(library, session, address):
"""Read an 32-bit value from the specified address.
Corresponds to viPeek32 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the v... | python | def peek_32(library, session, address):
"""Read an 32-bit value from the specified address.
Corresponds to viPeek32 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the v... | [
"def",
"peek_32",
"(",
"library",
",",
"session",
",",
"address",
")",
":",
"value_32",
"=",
"ViUInt32",
"(",
")",
"ret",
"=",
"library",
".",
"viPeek32",
"(",
"session",
",",
"address",
",",
"byref",
"(",
"value_32",
")",
")",
"return",
"value_32",
".... | Read an 32-bit value from the specified address.
Corresponds to viPeek32 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:return: Data read from bus, return v... | [
"Read",
"an",
"32",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1454-L1467 |
234,035 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | peek_64 | def peek_64(library, session, address):
"""Read an 64-bit value from the specified address.
Corresponds to viPeek64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the v... | python | def peek_64(library, session, address):
"""Read an 64-bit value from the specified address.
Corresponds to viPeek64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the v... | [
"def",
"peek_64",
"(",
"library",
",",
"session",
",",
"address",
")",
":",
"value_64",
"=",
"ViUInt64",
"(",
")",
"ret",
"=",
"library",
".",
"viPeek64",
"(",
"session",
",",
"address",
",",
"byref",
"(",
"value_64",
")",
")",
"return",
"value_64",
".... | Read an 64-bit value from the specified address.
Corresponds to viPeek64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:return: Data read from bus, return v... | [
"Read",
"an",
"64",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1470-L1483 |
234,036 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | poke | def poke(library, session, address, width, data):
"""Writes an 8, 16 or 32-bit value from the specified address.
Corresponds to viPoke* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source ... | python | def poke(library, session, address, width, data):
"""Writes an 8, 16 or 32-bit value from the specified address.
Corresponds to viPoke* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source ... | [
"def",
"poke",
"(",
"library",
",",
"session",
",",
"address",
",",
"width",
",",
"data",
")",
":",
"if",
"width",
"==",
"8",
":",
"return",
"poke_8",
"(",
"library",
",",
"session",
",",
"address",
",",
"data",
")",
"elif",
"width",
"==",
"16",
":... | Writes an 8, 16 or 32-bit value from the specified address.
Corresponds to viPoke* functions of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:param width: Number of bi... | [
"Writes",
"an",
"8",
"16",
"or",
"32",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1486-L1507 |
234,037 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | poke_8 | def poke_8(library, session, address, data):
"""Write an 8-bit value from the specified address.
Corresponds to viPoke8 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read t... | python | def poke_8(library, session, address, data):
"""Write an 8-bit value from the specified address.
Corresponds to viPoke8 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read t... | [
"def",
"poke_8",
"(",
"library",
",",
"session",
",",
"address",
",",
"data",
")",
":",
"return",
"library",
".",
"viPoke8",
"(",
"session",
",",
"address",
",",
"data",
")"
] | Write an 8-bit value from the specified address.
Corresponds to viPoke8 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:param data: value to be written to th... | [
"Write",
"an",
"8",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1510-L1523 |
234,038 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | poke_16 | def poke_16(library, session, address, data):
"""Write an 16-bit value from the specified address.
Corresponds to viPoke16 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... | python | def poke_16(library, session, address, data):
"""Write an 16-bit value from the specified address.
Corresponds to viPoke16 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... | [
"def",
"poke_16",
"(",
"library",
",",
"session",
",",
"address",
",",
"data",
")",
":",
"return",
"library",
".",
"viPoke16",
"(",
"session",
",",
"address",
",",
"data",
")"
] | Write an 16-bit value from the specified address.
Corresponds to viPoke16 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:param data: value to be written to ... | [
"Write",
"an",
"16",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1526-L1538 |
234,039 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | poke_32 | def poke_32(library, session, address, data):
"""Write an 32-bit value from the specified address.
Corresponds to viPoke32 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... | python | def poke_32(library, session, address, data):
"""Write an 32-bit value from the specified address.
Corresponds to viPoke32 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... | [
"def",
"poke_32",
"(",
"library",
",",
"session",
",",
"address",
",",
"data",
")",
":",
"return",
"library",
".",
"viPoke32",
"(",
"session",
",",
"address",
",",
"data",
")"
] | Write an 32-bit value from the specified address.
Corresponds to viPoke32 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:param data: value to be written to ... | [
"Write",
"an",
"32",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1541-L1553 |
234,040 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | poke_64 | def poke_64(library, session, address, data):
"""Write an 64-bit value from the specified address.
Corresponds to viPoke64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... | python | def poke_64(library, session, address, data):
"""Write an 64-bit value from the specified address.
Corresponds to viPoke64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... | [
"def",
"poke_64",
"(",
"library",
",",
"session",
",",
"address",
",",
"data",
")",
":",
"return",
"library",
".",
"viPoke64",
"(",
"session",
",",
"address",
",",
"data",
")"
] | Write an 64-bit value from the specified address.
Corresponds to viPoke64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to read the value.
:param data: value to be written to ... | [
"Write",
"an",
"64",
"-",
"bit",
"value",
"from",
"the",
"specified",
"address",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1556-L1568 |
234,041 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | read_asynchronously | def read_asynchronously(library, session, count):
"""Reads data from device or interface asynchronously.
Corresponds to viReadAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param count: Number of byte... | python | def read_asynchronously(library, session, count):
"""Reads data from device or interface asynchronously.
Corresponds to viReadAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param count: Number of byte... | [
"def",
"read_asynchronously",
"(",
"library",
",",
"session",
",",
"count",
")",
":",
"buffer",
"=",
"create_string_buffer",
"(",
"count",
")",
"job_id",
"=",
"ViJobId",
"(",
")",
"ret",
"=",
"library",
".",
"viReadAsync",
"(",
"session",
",",
"buffer",
",... | Reads data from device or interface asynchronously.
Corresponds to viReadAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param count: Number of bytes to be read.
:return: result, jobid, return value of... | [
"Reads",
"data",
"from",
"device",
"or",
"interface",
"asynchronously",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1588-L1602 |
234,042 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | read_stb | def read_stb(library, session):
"""Reads a status byte of the service request.
Corresponds to viReadSTB function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:return: Service request status byte, return value of th... | python | def read_stb(library, session):
"""Reads a status byte of the service request.
Corresponds to viReadSTB function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:return: Service request status byte, return value of th... | [
"def",
"read_stb",
"(",
"library",
",",
"session",
")",
":",
"status",
"=",
"ViUInt16",
"(",
")",
"ret",
"=",
"library",
".",
"viReadSTB",
"(",
"session",
",",
"byref",
"(",
"status",
")",
")",
"return",
"status",
".",
"value",
",",
"ret"
] | Reads a status byte of the service request.
Corresponds to viReadSTB function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:return: Service request status byte, return value of the library call.
:rtype: int, :class... | [
"Reads",
"a",
"status",
"byte",
"of",
"the",
"service",
"request",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1605-L1617 |
234,043 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | read_to_file | def read_to_file(library, session, filename, count):
"""Read data synchronously, and store the transferred data in a file.
Corresponds to viReadToFile function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param fi... | python | def read_to_file(library, session, filename, count):
"""Read data synchronously, and store the transferred data in a file.
Corresponds to viReadToFile function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param fi... | [
"def",
"read_to_file",
"(",
"library",
",",
"session",
",",
"filename",
",",
"count",
")",
":",
"return_count",
"=",
"ViUInt32",
"(",
")",
"ret",
"=",
"library",
".",
"viReadToFile",
"(",
"session",
",",
"filename",
",",
"count",
",",
"return_count",
")",
... | Read data synchronously, and store the transferred data in a file.
Corresponds to viReadToFile function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param filename: Name of file to which data will be written.
:par... | [
"Read",
"data",
"synchronously",
"and",
"store",
"the",
"transferred",
"data",
"in",
"a",
"file",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1620-L1634 |
234,044 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | status_description | def status_description(library, session, status):
"""Returns a user-readable description of the status code passed to the operation.
Corresponds to viStatusDesc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | python | def status_description(library, session, status):
"""Returns a user-readable description of the status code passed to the operation.
Corresponds to viStatusDesc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | [
"def",
"status_description",
"(",
"library",
",",
"session",
",",
"status",
")",
":",
"description",
"=",
"create_string_buffer",
"(",
"256",
")",
"ret",
"=",
"library",
".",
"viStatusDesc",
"(",
"session",
",",
"status",
",",
"description",
")",
"return",
"... | Returns a user-readable description of the status code passed to the operation.
Corresponds to viStatusDesc function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param status: Status code to interpret.
:return: - ... | [
"Returns",
"a",
"user",
"-",
"readable",
"description",
"of",
"the",
"status",
"code",
"passed",
"to",
"the",
"operation",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1667-L1682 |
234,045 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | terminate | def terminate(library, session, degree, job_id):
"""Requests a VISA session to terminate normal execution of an operation.
Corresponds to viTerminate function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param deg... | python | def terminate(library, session, degree, job_id):
"""Requests a VISA session to terminate normal execution of an operation.
Corresponds to viTerminate function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param deg... | [
"def",
"terminate",
"(",
"library",
",",
"session",
",",
"degree",
",",
"job_id",
")",
":",
"return",
"library",
".",
"viTerminate",
"(",
"session",
",",
"degree",
",",
"job_id",
")"
] | Requests a VISA session to terminate normal execution of an operation.
Corresponds to viTerminate function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param degree: Constants.NULL
:param job_id: Specifies an oper... | [
"Requests",
"a",
"VISA",
"session",
"to",
"terminate",
"normal",
"execution",
"of",
"an",
"operation",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1685-L1697 |
234,046 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | unmap_trigger | def unmap_trigger(library, session, trigger_source, trigger_destination):
"""Undo a previous map from the specified trigger source line to the specified destination line.
Corresponds to viUnmapTrigger function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Uni... | python | def unmap_trigger(library, session, trigger_source, trigger_destination):
"""Undo a previous map from the specified trigger source line to the specified destination line.
Corresponds to viUnmapTrigger function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Uni... | [
"def",
"unmap_trigger",
"(",
"library",
",",
"session",
",",
"trigger_source",
",",
"trigger_destination",
")",
":",
"return",
"library",
".",
"viUnmapTrigger",
"(",
"session",
",",
"trigger_source",
",",
"trigger_destination",
")"
] | Undo a previous map from the specified trigger source line to the specified destination line.
Corresponds to viUnmapTrigger function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param trigger_source: Source line used ... | [
"Undo",
"a",
"previous",
"map",
"from",
"the",
"specified",
"trigger",
"source",
"line",
"to",
"the",
"specified",
"destination",
"line",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1745-L1757 |
234,047 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | usb_control_in | def usb_control_in(library, session, request_type_bitmap_field, request_id, request_value,
index, length=0):
"""Performs a USB control pipe transfer from the device.
Corresponds to viUsbControlIn function of the VISA library.
:param library: the visa library wrapped by ctypes.
:para... | python | def usb_control_in(library, session, request_type_bitmap_field, request_id, request_value,
index, length=0):
"""Performs a USB control pipe transfer from the device.
Corresponds to viUsbControlIn function of the VISA library.
:param library: the visa library wrapped by ctypes.
:para... | [
"def",
"usb_control_in",
"(",
"library",
",",
"session",
",",
"request_type_bitmap_field",
",",
"request_id",
",",
"request_value",
",",
"index",
",",
"length",
"=",
"0",
")",
":",
"buffer",
"=",
"create_string_buffer",
"(",
"length",
")",
"return_count",
"=",
... | Performs a USB control pipe transfer from the device.
Corresponds to viUsbControlIn function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param request_type_bitmap_field: bmRequestType parameter of the setup stage of ... | [
"Performs",
"a",
"USB",
"control",
"pipe",
"transfer",
"from",
"the",
"device",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1760-L1786 |
234,048 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | usb_control_out | def usb_control_out(library, session, request_type_bitmap_field, request_id, request_value,
index, data=""):
"""Performs a USB control pipe transfer to the device.
Corresponds to viUsbControlOut function of the VISA library.
:param library: the visa library wrapped by ctypes.
:para... | python | def usb_control_out(library, session, request_type_bitmap_field, request_id, request_value,
index, data=""):
"""Performs a USB control pipe transfer to the device.
Corresponds to viUsbControlOut function of the VISA library.
:param library: the visa library wrapped by ctypes.
:para... | [
"def",
"usb_control_out",
"(",
"library",
",",
"session",
",",
"request_type_bitmap_field",
",",
"request_id",
",",
"request_value",
",",
"index",
",",
"data",
"=",
"\"\"",
")",
":",
"length",
"=",
"len",
"(",
"data",
")",
"return",
"library",
".",
"viUsbCon... | Performs a USB control pipe transfer to the device.
Corresponds to viUsbControlOut function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param request_type_bitmap_field: bmRequestType parameter of the setup stage of a... | [
"Performs",
"a",
"USB",
"control",
"pipe",
"transfer",
"to",
"the",
"device",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1789-L1808 |
234,049 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | wait_on_event | def wait_on_event(library, session, in_event_type, timeout):
"""Waits for an occurrence of the specified event for a given session.
Corresponds to viWaitOnEvent function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | python | def wait_on_event(library, session, in_event_type, timeout):
"""Waits for an occurrence of the specified event for a given session.
Corresponds to viWaitOnEvent function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
... | [
"def",
"wait_on_event",
"(",
"library",
",",
"session",
",",
"in_event_type",
",",
"timeout",
")",
":",
"out_event_type",
"=",
"ViEventType",
"(",
")",
"out_context",
"=",
"ViEvent",
"(",
")",
"ret",
"=",
"library",
".",
"viWaitOnEvent",
"(",
"session",
",",... | Waits for an occurrence of the specified event for a given session.
Corresponds to viWaitOnEvent function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param in_event_type: Logical identifier of the event(s) to wait fo... | [
"Waits",
"for",
"an",
"occurrence",
"of",
"the",
"specified",
"event",
"for",
"a",
"given",
"session",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1828-L1849 |
234,050 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | write_asynchronously | def write_asynchronously(library, session, data):
"""Writes data to device or interface asynchronously.
Corresponds to viWriteAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param data: data to be writ... | python | def write_asynchronously(library, session, data):
"""Writes data to device or interface asynchronously.
Corresponds to viWriteAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param data: data to be writ... | [
"def",
"write_asynchronously",
"(",
"library",
",",
"session",
",",
"data",
")",
":",
"job_id",
"=",
"ViJobId",
"(",
")",
"# [ViSession, ViBuf, ViUInt32, ViPJobId]",
"ret",
"=",
"library",
".",
"viWriteAsync",
"(",
"session",
",",
"data",
",",
"len",
"(",
"dat... | Writes data to device or interface asynchronously.
Corresponds to viWriteAsync function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param data: data to be written.
:return: Job ID of this asynchronous write opera... | [
"Writes",
"data",
"to",
"device",
"or",
"interface",
"asynchronously",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1870-L1884 |
234,051 | pyvisa/pyvisa | pyvisa/ctwrapper/functions.py | write_from_file | def write_from_file(library, session, filename, count):
"""Take data from a file and write it out synchronously.
Corresponds to viWriteFromFile function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param filename:... | python | def write_from_file(library, session, filename, count):
"""Take data from a file and write it out synchronously.
Corresponds to viWriteFromFile function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param filename:... | [
"def",
"write_from_file",
"(",
"library",
",",
"session",
",",
"filename",
",",
"count",
")",
":",
"return_count",
"=",
"ViUInt32",
"(",
")",
"ret",
"=",
"library",
".",
"viWriteFromFile",
"(",
"session",
",",
"filename",
",",
"count",
",",
"return_count",
... | Take data from a file and write it out synchronously.
Corresponds to viWriteFromFile function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param filename: Name of file from which data will be read.
:param count: N... | [
"Take",
"data",
"from",
"a",
"file",
"and",
"write",
"it",
"out",
"synchronously",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/ctwrapper/functions.py#L1887-L1901 |
234,052 | pyvisa/pyvisa | pyvisa/attributes.py | Attribute.in_resource | def in_resource(cls, session_type):
"""Returns True if the attribute is part of a given session type.
The session_type is a tuple with the interface type and resource_class
:type session_type: (constants.InterfaceType, str)
:rtype: bool
"""
if cls.resources is AllSessio... | python | def in_resource(cls, session_type):
"""Returns True if the attribute is part of a given session type.
The session_type is a tuple with the interface type and resource_class
:type session_type: (constants.InterfaceType, str)
:rtype: bool
"""
if cls.resources is AllSessio... | [
"def",
"in_resource",
"(",
"cls",
",",
"session_type",
")",
":",
"if",
"cls",
".",
"resources",
"is",
"AllSessionTypes",
":",
"return",
"True",
"return",
"session_type",
"in",
"cls",
".",
"resources"
] | Returns True if the attribute is part of a given session type.
The session_type is a tuple with the interface type and resource_class
:type session_type: (constants.InterfaceType, str)
:rtype: bool | [
"Returns",
"True",
"if",
"the",
"attribute",
"is",
"part",
"of",
"a",
"given",
"session",
"type",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/attributes.py#L116-L126 |
234,053 | pyvisa/pyvisa | pyvisa/shell.py | VisaShell.do_list | def do_list(self, args):
"""List all connected resources."""
try:
resources = self.resource_manager.list_resources_info()
except Exception as e:
print(e)
else:
self.resources = []
for ndx, (resource_name, value) in enumerate(resources.item... | python | def do_list(self, args):
"""List all connected resources."""
try:
resources = self.resource_manager.list_resources_info()
except Exception as e:
print(e)
else:
self.resources = []
for ndx, (resource_name, value) in enumerate(resources.item... | [
"def",
"do_list",
"(",
"self",
",",
"args",
")",
":",
"try",
":",
"resources",
"=",
"self",
".",
"resource_manager",
".",
"list_resources_info",
"(",
")",
"except",
"Exception",
"as",
"e",
":",
"print",
"(",
"e",
")",
"else",
":",
"self",
".",
"resourc... | List all connected resources. | [
"List",
"all",
"connected",
"resources",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/shell.py#L121-L136 |
234,054 | pyvisa/pyvisa | pyvisa/shell.py | VisaShell.do_close | def do_close(self, args):
"""Close resource in use."""
if not self.current:
print('There are no resources in use. Use the command "open".')
return
try:
self.current.close()
except Exception as e:
print(e)
else:
print('... | python | def do_close(self, args):
"""Close resource in use."""
if not self.current:
print('There are no resources in use. Use the command "open".')
return
try:
self.current.close()
except Exception as e:
print(e)
else:
print('... | [
"def",
"do_close",
"(",
"self",
",",
"args",
")",
":",
"if",
"not",
"self",
".",
"current",
":",
"print",
"(",
"'There are no resources in use. Use the command \"open\".'",
")",
"return",
"try",
":",
"self",
".",
"current",
".",
"close",
"(",
")",
"except",
... | Close resource in use. | [
"Close",
"resource",
"in",
"use",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/shell.py#L179-L193 |
234,055 | pyvisa/pyvisa | pyvisa/shell.py | VisaShell.do_read | def do_read(self, args):
"""Receive from the resource in use."""
if not self.current:
print('There are no resources in use. Use the command "open".')
return
try:
print(self.current.read())
except Exception as e:
print(e) | python | def do_read(self, args):
"""Receive from the resource in use."""
if not self.current:
print('There are no resources in use. Use the command "open".')
return
try:
print(self.current.read())
except Exception as e:
print(e) | [
"def",
"do_read",
"(",
"self",
",",
"args",
")",
":",
"if",
"not",
"self",
".",
"current",
":",
"print",
"(",
"'There are no resources in use. Use the command \"open\".'",
")",
"return",
"try",
":",
"print",
"(",
"self",
".",
"current",
".",
"read",
"(",
")"... | Receive from the resource in use. | [
"Receive",
"from",
"the",
"resource",
"in",
"use",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/shell.py#L207-L217 |
234,056 | pyvisa/pyvisa | pyvisa/shell.py | VisaShell.do_attr | def do_attr(self, args):
"""Get or set the state for a visa attribute.
List all attributes:
attr
Get an attribute state:
attr <name>
Set an attribute state:
attr <name> <state>
"""
if not self.current:
print('There ar... | python | def do_attr(self, args):
"""Get or set the state for a visa attribute.
List all attributes:
attr
Get an attribute state:
attr <name>
Set an attribute state:
attr <name> <state>
"""
if not self.current:
print('There ar... | [
"def",
"do_attr",
"(",
"self",
",",
"args",
")",
":",
"if",
"not",
"self",
".",
"current",
":",
"print",
"(",
"'There are no resources in use. Use the command \"open\".'",
")",
"return",
"args",
"=",
"args",
".",
"strip",
"(",
")",
"if",
"not",
"args",
":",
... | Get or set the state for a visa attribute.
List all attributes:
attr
Get an attribute state:
attr <name>
Set an attribute state:
attr <name> <state> | [
"Get",
"or",
"set",
"the",
"state",
"for",
"a",
"visa",
"attribute",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/shell.py#L278-L356 |
234,057 | pyvisa/pyvisa | pyvisa/shell.py | VisaShell.do_exit | def do_exit(self, arg):
"""Exit the shell session."""
if self.current:
self.current.close()
self.resource_manager.close()
del self.resource_manager
return True | python | def do_exit(self, arg):
"""Exit the shell session."""
if self.current:
self.current.close()
self.resource_manager.close()
del self.resource_manager
return True | [
"def",
"do_exit",
"(",
"self",
",",
"arg",
")",
":",
"if",
"self",
".",
"current",
":",
"self",
".",
"current",
".",
"close",
"(",
")",
"self",
".",
"resource_manager",
".",
"close",
"(",
")",
"del",
"self",
".",
"resource_manager",
"return",
"True"
] | Exit the shell session. | [
"Exit",
"the",
"shell",
"session",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/shell.py#L411-L418 |
234,058 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.resource_info | def resource_info(self):
"""Get the extended information of this resource.
:param resource_name: Unique symbolic name of a resource.
:rtype: :class:`pyvisa.highlevel.ResourceInfo`
"""
return self.visalib.parse_resource_extended(self._resource_manager.session, self.resource_name... | python | def resource_info(self):
"""Get the extended information of this resource.
:param resource_name: Unique symbolic name of a resource.
:rtype: :class:`pyvisa.highlevel.ResourceInfo`
"""
return self.visalib.parse_resource_extended(self._resource_manager.session, self.resource_name... | [
"def",
"resource_info",
"(",
"self",
")",
":",
"return",
"self",
".",
"visalib",
".",
"parse_resource_extended",
"(",
"self",
".",
"_resource_manager",
".",
"session",
",",
"self",
".",
"resource_name",
")"
] | Get the extended information of this resource.
:param resource_name: Unique symbolic name of a resource.
:rtype: :class:`pyvisa.highlevel.ResourceInfo` | [
"Get",
"the",
"extended",
"information",
"of",
"this",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L176-L183 |
234,059 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.interface_type | def interface_type(self):
"""The interface type of the resource as a number.
"""
return self.visalib.parse_resource(self._resource_manager.session,
self.resource_name)[0].interface_type | python | def interface_type(self):
"""The interface type of the resource as a number.
"""
return self.visalib.parse_resource(self._resource_manager.session,
self.resource_name)[0].interface_type | [
"def",
"interface_type",
"(",
"self",
")",
":",
"return",
"self",
".",
"visalib",
".",
"parse_resource",
"(",
"self",
".",
"_resource_manager",
".",
"session",
",",
"self",
".",
"resource_name",
")",
"[",
"0",
"]",
".",
"interface_type"
] | The interface type of the resource as a number. | [
"The",
"interface",
"type",
"of",
"the",
"resource",
"as",
"a",
"number",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L186-L190 |
234,060 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.close | def close(self):
"""Closes the VISA session and marks the handle as invalid.
"""
try:
logger.debug('%s - closing', self._resource_name,
extra=self._logging_extra)
self.before_close()
self.visalib.close(self.session)
logger.... | python | def close(self):
"""Closes the VISA session and marks the handle as invalid.
"""
try:
logger.debug('%s - closing', self._resource_name,
extra=self._logging_extra)
self.before_close()
self.visalib.close(self.session)
logger.... | [
"def",
"close",
"(",
"self",
")",
":",
"try",
":",
"logger",
".",
"debug",
"(",
"'%s - closing'",
",",
"self",
".",
"_resource_name",
",",
"extra",
"=",
"self",
".",
"_logging_extra",
")",
"self",
".",
"before_close",
"(",
")",
"self",
".",
"visalib",
... | Closes the VISA session and marks the handle as invalid. | [
"Closes",
"the",
"VISA",
"session",
"and",
"marks",
"the",
"handle",
"as",
"invalid",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L238-L250 |
234,061 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.install_handler | def install_handler(self, event_type, handler, user_handle=None):
"""Installs handlers for event callbacks in this resource.
:param event_type: Logical event identifier.
:param handler: Interpreted as a valid reference to a handler to be installed by a client application.
:param user_ha... | python | def install_handler(self, event_type, handler, user_handle=None):
"""Installs handlers for event callbacks in this resource.
:param event_type: Logical event identifier.
:param handler: Interpreted as a valid reference to a handler to be installed by a client application.
:param user_ha... | [
"def",
"install_handler",
"(",
"self",
",",
"event_type",
",",
"handler",
",",
"user_handle",
"=",
"None",
")",
":",
"return",
"self",
".",
"visalib",
".",
"install_visa_handler",
"(",
"self",
".",
"session",
",",
"event_type",
",",
"handler",
",",
"user_han... | Installs handlers for event callbacks in this resource.
:param event_type: Logical event identifier.
:param handler: Interpreted as a valid reference to a handler to be installed by a client application.
:param user_handle: A value specified by an application that can be used for identifying ha... | [
"Installs",
"handlers",
"for",
"event",
"callbacks",
"in",
"this",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L281-L291 |
234,062 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.uninstall_handler | def uninstall_handler(self, event_type, handler, user_handle=None):
"""Uninstalls handlers for events in this resource.
:param event_type: Logical event identifier.
:param handler: Interpreted as a valid reference to a handler to be uninstalled by a client application.
:param user_handl... | python | def uninstall_handler(self, event_type, handler, user_handle=None):
"""Uninstalls handlers for events in this resource.
:param event_type: Logical event identifier.
:param handler: Interpreted as a valid reference to a handler to be uninstalled by a client application.
:param user_handl... | [
"def",
"uninstall_handler",
"(",
"self",
",",
"event_type",
",",
"handler",
",",
"user_handle",
"=",
"None",
")",
":",
"self",
".",
"visalib",
".",
"uninstall_visa_handler",
"(",
"self",
".",
"session",
",",
"event_type",
",",
"handler",
",",
"user_handle",
... | Uninstalls handlers for events in this resource.
:param event_type: Logical event identifier.
:param handler: Interpreted as a valid reference to a handler to be uninstalled by a client application.
:param user_handle: The user handle (ctypes object or None) returned by install_handler. | [
"Uninstalls",
"handlers",
"for",
"events",
"in",
"this",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L293-L301 |
234,063 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.discard_events | def discard_events(self, event_type, mechanism):
"""Discards event occurrences for specified event types and mechanisms in this resource.
:param event_type: Logical event identifier.
:param mechanism: Specifies event handling mechanisms to be dicarded.
(Constants.VI_QU... | python | def discard_events(self, event_type, mechanism):
"""Discards event occurrences for specified event types and mechanisms in this resource.
:param event_type: Logical event identifier.
:param mechanism: Specifies event handling mechanisms to be dicarded.
(Constants.VI_QU... | [
"def",
"discard_events",
"(",
"self",
",",
"event_type",
",",
"mechanism",
")",
":",
"self",
".",
"visalib",
".",
"discard_events",
"(",
"self",
".",
"session",
",",
"event_type",
",",
"mechanism",
")"
] | Discards event occurrences for specified event types and mechanisms in this resource.
:param event_type: Logical event identifier.
:param mechanism: Specifies event handling mechanisms to be dicarded.
(Constants.VI_QUEUE, .VI_HNDLR, .VI_SUSPEND_HNDLR, .VI_ALL_MECH) | [
"Discards",
"event",
"occurrences",
"for",
"specified",
"event",
"types",
"and",
"mechanisms",
"in",
"this",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L312-L319 |
234,064 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.enable_event | def enable_event(self, event_type, mechanism, context=None):
"""Enable event occurrences for specified event types and mechanisms in this resource.
:param event_type: Logical event identifier.
:param mechanism: Specifies event handling mechanisms to be enabled.
(Consta... | python | def enable_event(self, event_type, mechanism, context=None):
"""Enable event occurrences for specified event types and mechanisms in this resource.
:param event_type: Logical event identifier.
:param mechanism: Specifies event handling mechanisms to be enabled.
(Consta... | [
"def",
"enable_event",
"(",
"self",
",",
"event_type",
",",
"mechanism",
",",
"context",
"=",
"None",
")",
":",
"self",
".",
"visalib",
".",
"enable_event",
"(",
"self",
".",
"session",
",",
"event_type",
",",
"mechanism",
",",
"context",
")"
] | Enable event occurrences for specified event types and mechanisms in this resource.
:param event_type: Logical event identifier.
:param mechanism: Specifies event handling mechanisms to be enabled.
(Constants.VI_QUEUE, .VI_HNDLR, .VI_SUSPEND_HNDLR)
:param context: Not... | [
"Enable",
"event",
"occurrences",
"for",
"specified",
"event",
"types",
"and",
"mechanisms",
"in",
"this",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L321-L329 |
234,065 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.wait_on_event | def wait_on_event(self, in_event_type, timeout, capture_timeout=False):
"""Waits for an occurrence of the specified event in this resource.
:param in_event_type: Logical identifier of the event(s) to wait for.
:param timeout: Absolute time period in time units that the resource shall wait for a... | python | def wait_on_event(self, in_event_type, timeout, capture_timeout=False):
"""Waits for an occurrence of the specified event in this resource.
:param in_event_type: Logical identifier of the event(s) to wait for.
:param timeout: Absolute time period in time units that the resource shall wait for a... | [
"def",
"wait_on_event",
"(",
"self",
",",
"in_event_type",
",",
"timeout",
",",
"capture_timeout",
"=",
"False",
")",
":",
"try",
":",
"event_type",
",",
"context",
",",
"ret",
"=",
"self",
".",
"visalib",
".",
"wait_on_event",
"(",
"self",
".",
"session",... | Waits for an occurrence of the specified event in this resource.
:param in_event_type: Logical identifier of the event(s) to wait for.
:param timeout: Absolute time period in time units that the resource shall wait for a specified event to
occur before returning the time elapsed... | [
"Waits",
"for",
"an",
"occurrence",
"of",
"the",
"specified",
"event",
"in",
"this",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L331-L348 |
234,066 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.lock | def lock(self, timeout='default', requested_key=None):
"""Establish a shared lock to the resource.
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to ... | python | def lock(self, timeout='default', requested_key=None):
"""Establish a shared lock to the resource.
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to ... | [
"def",
"lock",
"(",
"self",
",",
"timeout",
"=",
"'default'",
",",
"requested_key",
"=",
"None",
")",
":",
"timeout",
"=",
"self",
".",
"timeout",
"if",
"timeout",
"==",
"'default'",
"else",
"timeout",
"timeout",
"=",
"self",
".",
"_cleanup_timeout",
"(",
... | Establish a shared lock to the resource.
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.timeout)
:param requested_key: Access key used by ano... | [
"Establish",
"a",
"shared",
"lock",
"to",
"the",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L350-L365 |
234,067 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.lock_excl | def lock_excl(self, timeout='default'):
"""Establish an exclusive lock to the resource.
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.timeou... | python | def lock_excl(self, timeout='default'):
"""Establish an exclusive lock to the resource.
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.timeou... | [
"def",
"lock_excl",
"(",
"self",
",",
"timeout",
"=",
"'default'",
")",
":",
"timeout",
"=",
"self",
".",
"timeout",
"if",
"timeout",
"==",
"'default'",
"else",
"timeout",
"timeout",
"=",
"self",
".",
"_cleanup_timeout",
"(",
"timeout",
")",
"self",
".",
... | Establish an exclusive lock to the resource.
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.timeout) | [
"Establish",
"an",
"exclusive",
"lock",
"to",
"the",
"resource",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L367-L377 |
234,068 | pyvisa/pyvisa | pyvisa/resources/resource.py | Resource.lock_context | def lock_context(self, timeout='default', requested_key='exclusive'):
"""A context that locks
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.... | python | def lock_context(self, timeout='default', requested_key='exclusive'):
"""A context that locks
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.... | [
"def",
"lock_context",
"(",
"self",
",",
"timeout",
"=",
"'default'",
",",
"requested_key",
"=",
"'exclusive'",
")",
":",
"if",
"requested_key",
"==",
"'exclusive'",
":",
"self",
".",
"lock_excl",
"(",
"timeout",
")",
"access_key",
"=",
"None",
"else",
":",
... | A context that locks
:param timeout: Absolute time period (in milliseconds) that a resource
waits to get unlocked by the locking session before
returning an error. (Defaults to self.timeout)
:param requested_key: When using default of 'exclusive' the lock... | [
"A",
"context",
"that",
"locks"
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/resources/resource.py#L385-L407 |
234,069 | pyvisa/pyvisa | pyvisa/thirdparty/prettytable.py | PrettyTable.del_row | def del_row(self, row_index):
"""Delete a row to the table
Arguments:
row_index - The index of the row you want to delete. Indexing starts at 0."""
if row_index > len(self._rows)-1:
raise Exception("Cant delete row at index %d, table only has %d rows!" % (row_index, len(... | python | def del_row(self, row_index):
"""Delete a row to the table
Arguments:
row_index - The index of the row you want to delete. Indexing starts at 0."""
if row_index > len(self._rows)-1:
raise Exception("Cant delete row at index %d, table only has %d rows!" % (row_index, len(... | [
"def",
"del_row",
"(",
"self",
",",
"row_index",
")",
":",
"if",
"row_index",
">",
"len",
"(",
"self",
".",
"_rows",
")",
"-",
"1",
":",
"raise",
"Exception",
"(",
"\"Cant delete row at index %d, table only has %d rows!\"",
"%",
"(",
"row_index",
",",
"len",
... | Delete a row to the table
Arguments:
row_index - The index of the row you want to delete. Indexing starts at 0. | [
"Delete",
"a",
"row",
"to",
"the",
"table"
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/thirdparty/prettytable.py#L823-L833 |
234,070 | pyvisa/pyvisa | pyvisa/thirdparty/prettytable.py | PrettyTable.get_html_string | def get_html_string(self, **kwargs):
"""Return string representation of HTML formatted version of table in current state.
Arguments:
start - index of first data row to include in output
end - index of last data row to include in output PLUS ONE (list slice style)
fields - name... | python | def get_html_string(self, **kwargs):
"""Return string representation of HTML formatted version of table in current state.
Arguments:
start - index of first data row to include in output
end - index of last data row to include in output PLUS ONE (list slice style)
fields - name... | [
"def",
"get_html_string",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"options",
"=",
"self",
".",
"_get_options",
"(",
"kwargs",
")",
"if",
"options",
"[",
"\"format\"",
"]",
":",
"string",
"=",
"self",
".",
"_get_formatted_html_string",
"(",
"options... | Return string representation of HTML formatted version of table in current state.
Arguments:
start - index of first data row to include in output
end - index of last data row to include in output PLUS ONE (list slice style)
fields - names of fields (columns) to include
header -... | [
"Return",
"string",
"representation",
"of",
"HTML",
"formatted",
"version",
"of",
"table",
"in",
"current",
"state",
"."
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/thirdparty/prettytable.py#L1158-L1188 |
234,071 | pyvisa/pyvisa | pyvisa/thirdparty/prettytable.py | TableHandler.make_fields_unique | def make_fields_unique(self, fields):
"""
iterates over the row and make each field unique
"""
for i in range(0, len(fields)):
for j in range(i+1, len(fields)):
if fields[i] == fields[j]:
fields[j] += "'" | python | def make_fields_unique(self, fields):
"""
iterates over the row and make each field unique
"""
for i in range(0, len(fields)):
for j in range(i+1, len(fields)):
if fields[i] == fields[j]:
fields[j] += "'" | [
"def",
"make_fields_unique",
"(",
"self",
",",
"fields",
")",
":",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"fields",
")",
")",
":",
"for",
"j",
"in",
"range",
"(",
"i",
"+",
"1",
",",
"len",
"(",
"fields",
")",
")",
":",
"if",
"... | iterates over the row and make each field unique | [
"iterates",
"over",
"the",
"row",
"and",
"make",
"each",
"field",
"unique"
] | b8b2d4371e1f00782856aa9176ff1ced6bcb3798 | https://github.com/pyvisa/pyvisa/blob/b8b2d4371e1f00782856aa9176ff1ced6bcb3798/pyvisa/thirdparty/prettytable.py#L1421-L1428 |
234,072 | openshift/openshift-restclient-python | openshift/dynamic/client.py | meta_request | def meta_request(func):
""" Handles parsing response structure and translating API Exceptions """
def inner(self, resource, *args, **kwargs):
serialize_response = kwargs.pop('serialize', True)
try:
resp = func(self, resource, *args, **kwargs)
except ApiException as e:
... | python | def meta_request(func):
""" Handles parsing response structure and translating API Exceptions """
def inner(self, resource, *args, **kwargs):
serialize_response = kwargs.pop('serialize', True)
try:
resp = func(self, resource, *args, **kwargs)
except ApiException as e:
... | [
"def",
"meta_request",
"(",
"func",
")",
":",
"def",
"inner",
"(",
"self",
",",
"resource",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"serialize_response",
"=",
"kwargs",
".",
"pop",
"(",
"'serialize'",
",",
"True",
")",
"try",
":",
"resp"... | Handles parsing response structure and translating API Exceptions | [
"Handles",
"parsing",
"response",
"structure",
"and",
"translating",
"API",
"Exceptions"
] | 5d86bf5ba4e723bcc4d33ad47077aca01edca0f6 | https://github.com/openshift/openshift-restclient-python/blob/5d86bf5ba4e723bcc4d33ad47077aca01edca0f6/openshift/dynamic/client.py#L71-L83 |
234,073 | openshift/openshift-restclient-python | openshift/dynamic/client.py | DynamicClient.watch | def watch(self, resource, namespace=None, name=None, label_selector=None, field_selector=None, resource_version=None, timeout=None):
"""
Stream events for a resource from the Kubernetes API
:param resource: The API resource object that will be used to query the API
:param namespace: The... | python | def watch(self, resource, namespace=None, name=None, label_selector=None, field_selector=None, resource_version=None, timeout=None):
"""
Stream events for a resource from the Kubernetes API
:param resource: The API resource object that will be used to query the API
:param namespace: The... | [
"def",
"watch",
"(",
"self",
",",
"resource",
",",
"namespace",
"=",
"None",
",",
"name",
"=",
"None",
",",
"label_selector",
"=",
"None",
",",
"field_selector",
"=",
"None",
",",
"resource_version",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
... | Stream events for a resource from the Kubernetes API
:param resource: The API resource object that will be used to query the API
:param namespace: The namespace to query
:param name: The name of the resource instance to query
:param label_selector: The label selector with which to filte... | [
"Stream",
"events",
"for",
"a",
"resource",
"from",
"the",
"Kubernetes",
"API"
] | 5d86bf5ba4e723bcc4d33ad47077aca01edca0f6 | https://github.com/openshift/openshift-restclient-python/blob/5d86bf5ba4e723bcc4d33ad47077aca01edca0f6/openshift/dynamic/client.py#L179-L217 |
234,074 | openshift/openshift-restclient-python | openshift/dynamic/client.py | DynamicClient.validate | def validate(self, definition, version=None, strict=False):
"""validate checks a kubernetes resource definition
Args:
definition (dict): resource definition
version (str): version of kubernetes to validate against
strict (bool): whether unexpected additional properti... | python | def validate(self, definition, version=None, strict=False):
"""validate checks a kubernetes resource definition
Args:
definition (dict): resource definition
version (str): version of kubernetes to validate against
strict (bool): whether unexpected additional properti... | [
"def",
"validate",
"(",
"self",
",",
"definition",
",",
"version",
"=",
"None",
",",
"strict",
"=",
"False",
")",
":",
"if",
"not",
"HAS_KUBERNETES_VALIDATE",
":",
"raise",
"KubernetesValidateMissing",
"(",
")",
"errors",
"=",
"list",
"(",
")",
"warnings",
... | validate checks a kubernetes resource definition
Args:
definition (dict): resource definition
version (str): version of kubernetes to validate against
strict (bool): whether unexpected additional properties should be considered errors
Returns:
warnings (... | [
"validate",
"checks",
"a",
"kubernetes",
"resource",
"definition"
] | 5d86bf5ba4e723bcc4d33ad47077aca01edca0f6 | https://github.com/openshift/openshift-restclient-python/blob/5d86bf5ba4e723bcc4d33ad47077aca01edca0f6/openshift/dynamic/client.py#L278-L308 |
234,075 | openshift/openshift-restclient-python | openshift/dynamic/client.py | Discoverer.parse_api_groups | def parse_api_groups(self, request_resources=False, update=False):
""" Discovers all API groups present in the cluster """
if not self._cache.get('resources') or update:
self._cache['resources'] = self._cache.get('resources', {})
groups_response = load_json(self.client.request('G... | python | def parse_api_groups(self, request_resources=False, update=False):
""" Discovers all API groups present in the cluster """
if not self._cache.get('resources') or update:
self._cache['resources'] = self._cache.get('resources', {})
groups_response = load_json(self.client.request('G... | [
"def",
"parse_api_groups",
"(",
"self",
",",
"request_resources",
"=",
"False",
",",
"update",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_cache",
".",
"get",
"(",
"'resources'",
")",
"or",
"update",
":",
"self",
".",
"_cache",
"[",
"'resources'"... | Discovers all API groups present in the cluster | [
"Discovers",
"all",
"API",
"groups",
"present",
"in",
"the",
"cluster"
] | 5d86bf5ba4e723bcc4d33ad47077aca01edca0f6 | https://github.com/openshift/openshift-restclient-python/blob/5d86bf5ba4e723bcc4d33ad47077aca01edca0f6/openshift/dynamic/client.py#L656-L678 |
234,076 | openshift/openshift-restclient-python | openshift/dynamic/client.py | Discoverer.get | def get(self, **kwargs):
""" Same as search, but will throw an error if there are multiple or no
results. If there are multiple results and only one is an exact match
on api_version, that resource will be returned.
"""
results = self.search(**kwargs)
# If there ar... | python | def get(self, **kwargs):
""" Same as search, but will throw an error if there are multiple or no
results. If there are multiple results and only one is an exact match
on api_version, that resource will be returned.
"""
results = self.search(**kwargs)
# If there ar... | [
"def",
"get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"results",
"=",
"self",
".",
"search",
"(",
"*",
"*",
"kwargs",
")",
"# If there are multiple matches, prefer exact matches on api_version",
"if",
"len",
"(",
"results",
")",
">",
"1",
"and",
"kwa... | Same as search, but will throw an error if there are multiple or no
results. If there are multiple results and only one is an exact match
on api_version, that resource will be returned. | [
"Same",
"as",
"search",
"but",
"will",
"throw",
"an",
"error",
"if",
"there",
"are",
"multiple",
"or",
"no",
"results",
".",
"If",
"there",
"are",
"multiple",
"results",
"and",
"only",
"one",
"is",
"an",
"exact",
"match",
"on",
"api_version",
"that",
"re... | 5d86bf5ba4e723bcc4d33ad47077aca01edca0f6 | https://github.com/openshift/openshift-restclient-python/blob/5d86bf5ba4e723bcc4d33ad47077aca01edca0f6/openshift/dynamic/client.py#L735-L754 |
234,077 | dhylands/rshell | rshell/main.py | add_device | def add_device(dev):
"""Adds a device to the list of devices we know about."""
global DEV_IDX, DEFAULT_DEV
with DEV_LOCK:
for idx in range(len(DEVS)):
test_dev = DEVS[idx]
if test_dev.dev_name_short == dev.dev_name_short:
# This device is already in our list. ... | python | def add_device(dev):
"""Adds a device to the list of devices we know about."""
global DEV_IDX, DEFAULT_DEV
with DEV_LOCK:
for idx in range(len(DEVS)):
test_dev = DEVS[idx]
if test_dev.dev_name_short == dev.dev_name_short:
# This device is already in our list. ... | [
"def",
"add_device",
"(",
"dev",
")",
":",
"global",
"DEV_IDX",
",",
"DEFAULT_DEV",
"with",
"DEV_LOCK",
":",
"for",
"idx",
"in",
"range",
"(",
"len",
"(",
"DEVS",
")",
")",
":",
"test_dev",
"=",
"DEVS",
"[",
"idx",
"]",
"if",
"test_dev",
".",
"dev_na... | Adds a device to the list of devices we know about. | [
"Adds",
"a",
"device",
"to",
"the",
"list",
"of",
"devices",
"we",
"know",
"about",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L176-L195 |
234,078 | dhylands/rshell | rshell/main.py | find_device_by_name | def find_device_by_name(name):
"""Tries to find a board by board name."""
if not name:
return DEFAULT_DEV
with DEV_LOCK:
for dev in DEVS:
if dev.name == name:
return dev
return None | python | def find_device_by_name(name):
"""Tries to find a board by board name."""
if not name:
return DEFAULT_DEV
with DEV_LOCK:
for dev in DEVS:
if dev.name == name:
return dev
return None | [
"def",
"find_device_by_name",
"(",
"name",
")",
":",
"if",
"not",
"name",
":",
"return",
"DEFAULT_DEV",
"with",
"DEV_LOCK",
":",
"for",
"dev",
"in",
"DEVS",
":",
"if",
"dev",
".",
"name",
"==",
"name",
":",
"return",
"dev",
"return",
"None"
] | Tries to find a board by board name. | [
"Tries",
"to",
"find",
"a",
"board",
"by",
"board",
"name",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L198-L206 |
234,079 | dhylands/rshell | rshell/main.py | is_micropython_usb_device | def is_micropython_usb_device(port):
"""Checks a USB device to see if it looks like a MicroPython device.
"""
if type(port).__name__ == 'Device':
# Assume its a pyudev.device.Device
if ('ID_BUS' not in port or port['ID_BUS'] != 'usb' or
'SUBSYSTEM' not in port or port['SUBSYSTEM'... | python | def is_micropython_usb_device(port):
"""Checks a USB device to see if it looks like a MicroPython device.
"""
if type(port).__name__ == 'Device':
# Assume its a pyudev.device.Device
if ('ID_BUS' not in port or port['ID_BUS'] != 'usb' or
'SUBSYSTEM' not in port or port['SUBSYSTEM'... | [
"def",
"is_micropython_usb_device",
"(",
"port",
")",
":",
"if",
"type",
"(",
"port",
")",
".",
"__name__",
"==",
"'Device'",
":",
"# Assume its a pyudev.device.Device",
"if",
"(",
"'ID_BUS'",
"not",
"in",
"port",
"or",
"port",
"[",
"'ID_BUS'",
"]",
"!=",
"'... | Checks a USB device to see if it looks like a MicroPython device. | [
"Checks",
"a",
"USB",
"device",
"to",
"see",
"if",
"it",
"looks",
"like",
"a",
"MicroPython",
"device",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L222-L241 |
234,080 | dhylands/rshell | rshell/main.py | is_micropython_usb_port | def is_micropython_usb_port(portName):
"""Checks to see if the indicated portname is a MicroPython device
or not.
"""
for port in serial.tools.list_ports.comports():
if port.device == portName:
return is_micropython_usb_device(port)
return False | python | def is_micropython_usb_port(portName):
"""Checks to see if the indicated portname is a MicroPython device
or not.
"""
for port in serial.tools.list_ports.comports():
if port.device == portName:
return is_micropython_usb_device(port)
return False | [
"def",
"is_micropython_usb_port",
"(",
"portName",
")",
":",
"for",
"port",
"in",
"serial",
".",
"tools",
".",
"list_ports",
".",
"comports",
"(",
")",
":",
"if",
"port",
".",
"device",
"==",
"portName",
":",
"return",
"is_micropython_usb_device",
"(",
"port... | Checks to see if the indicated portname is a MicroPython device
or not. | [
"Checks",
"to",
"see",
"if",
"the",
"indicated",
"portname",
"is",
"a",
"MicroPython",
"device",
"or",
"not",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L244-L251 |
234,081 | dhylands/rshell | rshell/main.py | autoconnect | def autoconnect():
"""Sets up a thread to detect when USB devices are plugged and unplugged.
If the device looks like a MicroPython board, then it will automatically
connect to it.
"""
if not USE_AUTOCONNECT:
return
try:
import pyudev
except ImportError:
return
... | python | def autoconnect():
"""Sets up a thread to detect when USB devices are plugged and unplugged.
If the device looks like a MicroPython board, then it will automatically
connect to it.
"""
if not USE_AUTOCONNECT:
return
try:
import pyudev
except ImportError:
return
... | [
"def",
"autoconnect",
"(",
")",
":",
"if",
"not",
"USE_AUTOCONNECT",
":",
"return",
"try",
":",
"import",
"pyudev",
"except",
"ImportError",
":",
"return",
"context",
"=",
"pyudev",
".",
"Context",
"(",
")",
"monitor",
"=",
"pyudev",
".",
"Monitor",
".",
... | Sets up a thread to detect when USB devices are plugged and unplugged.
If the device looks like a MicroPython board, then it will automatically
connect to it. | [
"Sets",
"up",
"a",
"thread",
"to",
"detect",
"when",
"USB",
"devices",
"are",
"plugged",
"and",
"unplugged",
".",
"If",
"the",
"device",
"looks",
"like",
"a",
"MicroPython",
"board",
"then",
"it",
"will",
"automatically",
"connect",
"to",
"it",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L254-L269 |
234,082 | dhylands/rshell | rshell/main.py | autoconnect_thread | def autoconnect_thread(monitor):
"""Thread which detects USB Serial devices connecting and disconnecting."""
monitor.start()
monitor.filter_by('tty')
epoll = select.epoll()
epoll.register(monitor.fileno(), select.POLLIN)
while True:
try:
events = epoll.poll()
except... | python | def autoconnect_thread(monitor):
"""Thread which detects USB Serial devices connecting and disconnecting."""
monitor.start()
monitor.filter_by('tty')
epoll = select.epoll()
epoll.register(monitor.fileno(), select.POLLIN)
while True:
try:
events = epoll.poll()
except... | [
"def",
"autoconnect_thread",
"(",
"monitor",
")",
":",
"monitor",
".",
"start",
"(",
")",
"monitor",
".",
"filter_by",
"(",
"'tty'",
")",
"epoll",
"=",
"select",
".",
"epoll",
"(",
")",
"epoll",
".",
"register",
"(",
"monitor",
".",
"fileno",
"(",
")",... | Thread which detects USB Serial devices connecting and disconnecting. | [
"Thread",
"which",
"detects",
"USB",
"Serial",
"devices",
"connecting",
"and",
"disconnecting",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L272-L308 |
234,083 | dhylands/rshell | rshell/main.py | extra_info | def extra_info(port):
"""Collects the serial nunber and manufacturer into a string, if
the fields are available."""
extra_items = []
if port.manufacturer:
extra_items.append("vendor '{}'".format(port.manufacturer))
if port.serial_number:
extra_items.append("serial '{}'".format(por... | python | def extra_info(port):
"""Collects the serial nunber and manufacturer into a string, if
the fields are available."""
extra_items = []
if port.manufacturer:
extra_items.append("vendor '{}'".format(port.manufacturer))
if port.serial_number:
extra_items.append("serial '{}'".format(por... | [
"def",
"extra_info",
"(",
"port",
")",
":",
"extra_items",
"=",
"[",
"]",
"if",
"port",
".",
"manufacturer",
":",
"extra_items",
".",
"append",
"(",
"\"vendor '{}'\"",
".",
"format",
"(",
"port",
".",
"manufacturer",
")",
")",
"if",
"port",
".",
"serial_... | Collects the serial nunber and manufacturer into a string, if
the fields are available. | [
"Collects",
"the",
"serial",
"nunber",
"and",
"manufacturer",
"into",
"a",
"string",
"if",
"the",
"fields",
"are",
"available",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L320-L332 |
234,084 | dhylands/rshell | rshell/main.py | listports | def listports():
"""listports will display a list of all of the serial ports.
"""
detected = False
for port in serial.tools.list_ports.comports():
detected = True
if port.vid:
micropythonPort = ''
if is_micropython_usb_device(port):
micropythonPort... | python | def listports():
"""listports will display a list of all of the serial ports.
"""
detected = False
for port in serial.tools.list_ports.comports():
detected = True
if port.vid:
micropythonPort = ''
if is_micropython_usb_device(port):
micropythonPort... | [
"def",
"listports",
"(",
")",
":",
"detected",
"=",
"False",
"for",
"port",
"in",
"serial",
".",
"tools",
".",
"list_ports",
".",
"comports",
"(",
")",
":",
"detected",
"=",
"True",
"if",
"port",
".",
"vid",
":",
"micropythonPort",
"=",
"''",
"if",
"... | listports will display a list of all of the serial ports. | [
"listports",
"will",
"display",
"a",
"list",
"of",
"all",
"of",
"the",
"serial",
"ports",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L335-L351 |
234,085 | dhylands/rshell | rshell/main.py | escape | def escape(str):
"""Precede all special characters with a backslash."""
out = ''
for char in str:
if char in '\\ ':
out += '\\'
out += char
return out | python | def escape(str):
"""Precede all special characters with a backslash."""
out = ''
for char in str:
if char in '\\ ':
out += '\\'
out += char
return out | [
"def",
"escape",
"(",
"str",
")",
":",
"out",
"=",
"''",
"for",
"char",
"in",
"str",
":",
"if",
"char",
"in",
"'\\\\ '",
":",
"out",
"+=",
"'\\\\'",
"out",
"+=",
"char",
"return",
"out"
] | Precede all special characters with a backslash. | [
"Precede",
"all",
"special",
"characters",
"with",
"a",
"backslash",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L354-L361 |
234,086 | dhylands/rshell | rshell/main.py | align_cell | def align_cell(fmt, elem, width):
"""Returns an aligned element."""
if fmt == "<":
return elem + ' ' * (width - len(elem))
if fmt == ">":
return ' ' * (width - len(elem)) + elem
return elem | python | def align_cell(fmt, elem, width):
"""Returns an aligned element."""
if fmt == "<":
return elem + ' ' * (width - len(elem))
if fmt == ">":
return ' ' * (width - len(elem)) + elem
return elem | [
"def",
"align_cell",
"(",
"fmt",
",",
"elem",
",",
"width",
")",
":",
"if",
"fmt",
"==",
"\"<\"",
":",
"return",
"elem",
"+",
"' '",
"*",
"(",
"width",
"-",
"len",
"(",
"elem",
")",
")",
"if",
"fmt",
"==",
"\">\"",
":",
"return",
"' '",
"*",
"(... | Returns an aligned element. | [
"Returns",
"an",
"aligned",
"element",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L377-L383 |
234,087 | dhylands/rshell | rshell/main.py | print_err | def print_err(*args, end='\n'):
"""Similar to print, but prints to stderr.
"""
print(*args, end=end, file=sys.stderr)
sys.stderr.flush() | python | def print_err(*args, end='\n'):
"""Similar to print, but prints to stderr.
"""
print(*args, end=end, file=sys.stderr)
sys.stderr.flush() | [
"def",
"print_err",
"(",
"*",
"args",
",",
"end",
"=",
"'\\n'",
")",
":",
"print",
"(",
"*",
"args",
",",
"end",
"=",
"end",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"sys",
".",
"stderr",
".",
"flush",
"(",
")"
] | Similar to print, but prints to stderr. | [
"Similar",
"to",
"print",
"but",
"prints",
"to",
"stderr",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L421-L425 |
234,088 | dhylands/rshell | rshell/main.py | validate_pattern | def validate_pattern(fn):
"""On success return an absolute path and a pattern.
Otherwise print a message and return None, None
"""
directory, pattern = parse_pattern(fn)
if directory is None:
print_err("Invalid pattern {}.".format(fn))
return None, None
target = resolve_path(dire... | python | def validate_pattern(fn):
"""On success return an absolute path and a pattern.
Otherwise print a message and return None, None
"""
directory, pattern = parse_pattern(fn)
if directory is None:
print_err("Invalid pattern {}.".format(fn))
return None, None
target = resolve_path(dire... | [
"def",
"validate_pattern",
"(",
"fn",
")",
":",
"directory",
",",
"pattern",
"=",
"parse_pattern",
"(",
"fn",
")",
"if",
"directory",
"is",
"None",
":",
"print_err",
"(",
"\"Invalid pattern {}.\"",
".",
"format",
"(",
"fn",
")",
")",
"return",
"None",
",",... | On success return an absolute path and a pattern.
Otherwise print a message and return None, None | [
"On",
"success",
"return",
"an",
"absolute",
"path",
"and",
"a",
"pattern",
".",
"Otherwise",
"print",
"a",
"message",
"and",
"return",
"None",
"None"
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L463-L479 |
234,089 | dhylands/rshell | rshell/main.py | resolve_path | def resolve_path(path):
"""Resolves path and converts it into an absolute path."""
if path[0] == '~':
# ~ or ~user
path = os.path.expanduser(path)
if path[0] != '/':
# Relative path
if cur_dir[-1] == '/':
path = cur_dir + path
else:
path = cur_... | python | def resolve_path(path):
"""Resolves path and converts it into an absolute path."""
if path[0] == '~':
# ~ or ~user
path = os.path.expanduser(path)
if path[0] != '/':
# Relative path
if cur_dir[-1] == '/':
path = cur_dir + path
else:
path = cur_... | [
"def",
"resolve_path",
"(",
"path",
")",
":",
"if",
"path",
"[",
"0",
"]",
"==",
"'~'",
":",
"# ~ or ~user",
"path",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"path",
")",
"if",
"path",
"[",
"0",
"]",
"!=",
"'/'",
":",
"# Relative path",
"if"... | Resolves path and converts it into an absolute path. | [
"Resolves",
"path",
"and",
"converts",
"it",
"into",
"an",
"absolute",
"path",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L494-L520 |
234,090 | dhylands/rshell | rshell/main.py | print_bytes | def print_bytes(byte_str):
"""Prints a string or converts bytes to a string and then prints."""
if isinstance(byte_str, str):
print(byte_str)
else:
print(str(byte_str, encoding='utf8')) | python | def print_bytes(byte_str):
"""Prints a string or converts bytes to a string and then prints."""
if isinstance(byte_str, str):
print(byte_str)
else:
print(str(byte_str, encoding='utf8')) | [
"def",
"print_bytes",
"(",
"byte_str",
")",
":",
"if",
"isinstance",
"(",
"byte_str",
",",
"str",
")",
":",
"print",
"(",
"byte_str",
")",
"else",
":",
"print",
"(",
"str",
"(",
"byte_str",
",",
"encoding",
"=",
"'utf8'",
")",
")"
] | Prints a string or converts bytes to a string and then prints. | [
"Prints",
"a",
"string",
"or",
"converts",
"bytes",
"to",
"a",
"string",
"and",
"then",
"prints",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L559-L564 |
234,091 | dhylands/rshell | rshell/main.py | extra_funcs | def extra_funcs(*funcs):
"""Decorator which adds extra functions to be downloaded to the pyboard."""
def extra_funcs_decorator(real_func):
def wrapper(*args, **kwargs):
return real_func(*args, **kwargs)
wrapper.extra_funcs = list(funcs)
wrapper.source = inspect.getsource(real_func)
wrapper.nam... | python | def extra_funcs(*funcs):
"""Decorator which adds extra functions to be downloaded to the pyboard."""
def extra_funcs_decorator(real_func):
def wrapper(*args, **kwargs):
return real_func(*args, **kwargs)
wrapper.extra_funcs = list(funcs)
wrapper.source = inspect.getsource(real_func)
wrapper.nam... | [
"def",
"extra_funcs",
"(",
"*",
"funcs",
")",
":",
"def",
"extra_funcs_decorator",
"(",
"real_func",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"real_func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")... | Decorator which adds extra functions to be downloaded to the pyboard. | [
"Decorator",
"which",
"adds",
"extra",
"functions",
"to",
"be",
"downloaded",
"to",
"the",
"pyboard",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L567-L576 |
234,092 | dhylands/rshell | rshell/main.py | auto | def auto(func, filename, *args, **kwargs):
"""If `filename` is a remote file, then this function calls func on the
micropython board, otherwise it calls it locally.
"""
dev, dev_filename = get_dev_and_path(filename)
if dev is None:
if len(dev_filename) > 0 and dev_filename[0] == '~':
... | python | def auto(func, filename, *args, **kwargs):
"""If `filename` is a remote file, then this function calls func on the
micropython board, otherwise it calls it locally.
"""
dev, dev_filename = get_dev_and_path(filename)
if dev is None:
if len(dev_filename) > 0 and dev_filename[0] == '~':
... | [
"def",
"auto",
"(",
"func",
",",
"filename",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"dev",
",",
"dev_filename",
"=",
"get_dev_and_path",
"(",
"filename",
")",
"if",
"dev",
"is",
"None",
":",
"if",
"len",
"(",
"dev_filename",
")",
">",
... | If `filename` is a remote file, then this function calls func on the
micropython board, otherwise it calls it locally. | [
"If",
"filename",
"is",
"a",
"remote",
"file",
"then",
"this",
"function",
"calls",
"func",
"on",
"the",
"micropython",
"board",
"otherwise",
"it",
"calls",
"it",
"locally",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L579-L588 |
234,093 | dhylands/rshell | rshell/main.py | cat | def cat(src_filename, dst_file):
"""Copies the contents of the indicated file to an already opened file."""
(dev, dev_filename) = get_dev_and_path(src_filename)
if dev is None:
with open(dev_filename, 'rb') as txtfile:
for line in txtfile:
dst_file.write(line)
else:
... | python | def cat(src_filename, dst_file):
"""Copies the contents of the indicated file to an already opened file."""
(dev, dev_filename) = get_dev_and_path(src_filename)
if dev is None:
with open(dev_filename, 'rb') as txtfile:
for line in txtfile:
dst_file.write(line)
else:
... | [
"def",
"cat",
"(",
"src_filename",
",",
"dst_file",
")",
":",
"(",
"dev",
",",
"dev_filename",
")",
"=",
"get_dev_and_path",
"(",
"src_filename",
")",
"if",
"dev",
"is",
"None",
":",
"with",
"open",
"(",
"dev_filename",
",",
"'rb'",
")",
"as",
"txtfile",... | Copies the contents of the indicated file to an already opened file. | [
"Copies",
"the",
"contents",
"of",
"the",
"indicated",
"file",
"to",
"an",
"already",
"opened",
"file",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L612-L622 |
234,094 | dhylands/rshell | rshell/main.py | copy_file | def copy_file(src_filename, dst_filename):
"""Copies a file from one place to another. Both the source and destination
files must exist on the same machine.
"""
try:
with open(src_filename, 'rb') as src_file:
with open(dst_filename, 'wb') as dst_file:
while True:
... | python | def copy_file(src_filename, dst_filename):
"""Copies a file from one place to another. Both the source and destination
files must exist on the same machine.
"""
try:
with open(src_filename, 'rb') as src_file:
with open(dst_filename, 'wb') as dst_file:
while True:
... | [
"def",
"copy_file",
"(",
"src_filename",
",",
"dst_filename",
")",
":",
"try",
":",
"with",
"open",
"(",
"src_filename",
",",
"'rb'",
")",
"as",
"src_file",
":",
"with",
"open",
"(",
"dst_filename",
",",
"'wb'",
")",
"as",
"dst_file",
":",
"while",
"True... | Copies a file from one place to another. Both the source and destination
files must exist on the same machine. | [
"Copies",
"a",
"file",
"from",
"one",
"place",
"to",
"another",
".",
"Both",
"the",
"source",
"and",
"destination",
"files",
"must",
"exist",
"on",
"the",
"same",
"machine",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L631-L646 |
234,095 | dhylands/rshell | rshell/main.py | cp | def cp(src_filename, dst_filename):
"""Copies one file to another. The source file may be local or remote and
the destination file may be local or remote.
"""
src_dev, src_dev_filename = get_dev_and_path(src_filename)
dst_dev, dst_dev_filename = get_dev_and_path(dst_filename)
if src_dev is ds... | python | def cp(src_filename, dst_filename):
"""Copies one file to another. The source file may be local or remote and
the destination file may be local or remote.
"""
src_dev, src_dev_filename = get_dev_and_path(src_filename)
dst_dev, dst_dev_filename = get_dev_and_path(dst_filename)
if src_dev is ds... | [
"def",
"cp",
"(",
"src_filename",
",",
"dst_filename",
")",
":",
"src_dev",
",",
"src_dev_filename",
"=",
"get_dev_and_path",
"(",
"src_filename",
")",
"dst_dev",
",",
"dst_dev_filename",
"=",
"get_dev_and_path",
"(",
"dst_filename",
")",
"if",
"src_dev",
"is",
... | Copies one file to another. The source file may be local or remote and
the destination file may be local or remote. | [
"Copies",
"one",
"file",
"to",
"another",
".",
"The",
"source",
"file",
"may",
"be",
"local",
"or",
"remote",
"and",
"the",
"destination",
"file",
"may",
"be",
"local",
"or",
"remote",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L649-L680 |
234,096 | dhylands/rshell | rshell/main.py | stat | def stat(filename):
"""Returns os.stat for a given file, adjusting the timestamps as appropriate."""
import os
try:
# on the host, lstat won't try to follow symlinks
rstat = os.lstat(filename)
except:
rstat = os.stat(filename)
return rstat[:7] + tuple(tim + TIME_OFFSET for ti... | python | def stat(filename):
"""Returns os.stat for a given file, adjusting the timestamps as appropriate."""
import os
try:
# on the host, lstat won't try to follow symlinks
rstat = os.lstat(filename)
except:
rstat = os.stat(filename)
return rstat[:7] + tuple(tim + TIME_OFFSET for ti... | [
"def",
"stat",
"(",
"filename",
")",
":",
"import",
"os",
"try",
":",
"# on the host, lstat won't try to follow symlinks",
"rstat",
"=",
"os",
".",
"lstat",
"(",
"filename",
")",
"except",
":",
"rstat",
"=",
"os",
".",
"stat",
"(",
"filename",
")",
"return",... | Returns os.stat for a given file, adjusting the timestamps as appropriate. | [
"Returns",
"os",
".",
"stat",
"for",
"a",
"given",
"file",
"adjusting",
"the",
"timestamps",
"as",
"appropriate",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L713-L721 |
234,097 | dhylands/rshell | rshell/main.py | listdir_matches | def listdir_matches(match):
"""Returns a list of filenames contained in the named directory.
Only filenames which start with `match` will be returned.
Directories will have a trailing slash.
"""
import os
last_slash = match.rfind('/')
if last_slash == -1:
dirname = '.'
... | python | def listdir_matches(match):
"""Returns a list of filenames contained in the named directory.
Only filenames which start with `match` will be returned.
Directories will have a trailing slash.
"""
import os
last_slash = match.rfind('/')
if last_slash == -1:
dirname = '.'
... | [
"def",
"listdir_matches",
"(",
"match",
")",
":",
"import",
"os",
"last_slash",
"=",
"match",
".",
"rfind",
"(",
"'/'",
")",
"if",
"last_slash",
"==",
"-",
"1",
":",
"dirname",
"=",
"'.'",
"match_prefix",
"=",
"match",
"result_prefix",
"=",
"''",
"else",... | Returns a list of filenames contained in the named directory.
Only filenames which start with `match` will be returned.
Directories will have a trailing slash. | [
"Returns",
"a",
"list",
"of",
"filenames",
"contained",
"in",
"the",
"named",
"directory",
".",
"Only",
"filenames",
"which",
"start",
"with",
"match",
"will",
"be",
"returned",
".",
"Directories",
"will",
"have",
"a",
"trailing",
"slash",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L746-L775 |
234,098 | dhylands/rshell | rshell/main.py | listdir_stat | def listdir_stat(dirname, show_hidden=True):
"""Returns a list of tuples for each file contained in the named
directory, or None if the directory does not exist. Each tuple
contains the filename, followed by the tuple returned by
calling os.stat on the filename.
"""
import os
try:
... | python | def listdir_stat(dirname, show_hidden=True):
"""Returns a list of tuples for each file contained in the named
directory, or None if the directory does not exist. Each tuple
contains the filename, followed by the tuple returned by
calling os.stat on the filename.
"""
import os
try:
... | [
"def",
"listdir_stat",
"(",
"dirname",
",",
"show_hidden",
"=",
"True",
")",
":",
"import",
"os",
"try",
":",
"files",
"=",
"os",
".",
"listdir",
"(",
"dirname",
")",
"except",
"OSError",
":",
"return",
"None",
"if",
"dirname",
"==",
"'/'",
":",
"retur... | Returns a list of tuples for each file contained in the named
directory, or None if the directory does not exist. Each tuple
contains the filename, followed by the tuple returned by
calling os.stat on the filename. | [
"Returns",
"a",
"list",
"of",
"tuples",
"for",
"each",
"file",
"contained",
"in",
"the",
"named",
"directory",
"or",
"None",
"if",
"the",
"directory",
"does",
"not",
"exist",
".",
"Each",
"tuple",
"contains",
"the",
"filename",
"followed",
"by",
"the",
"tu... | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L779-L792 |
234,099 | dhylands/rshell | rshell/main.py | remove_file | def remove_file(filename, recursive=False, force=False):
"""Removes a file or directory."""
import os
try:
mode = os.stat(filename)[0]
if mode & 0x4000 != 0:
# directory
if recursive:
for file in os.listdir(filename):
success = remo... | python | def remove_file(filename, recursive=False, force=False):
"""Removes a file or directory."""
import os
try:
mode = os.stat(filename)[0]
if mode & 0x4000 != 0:
# directory
if recursive:
for file in os.listdir(filename):
success = remo... | [
"def",
"remove_file",
"(",
"filename",
",",
"recursive",
"=",
"False",
",",
"force",
"=",
"False",
")",
":",
"import",
"os",
"try",
":",
"mode",
"=",
"os",
".",
"stat",
"(",
"filename",
")",
"[",
"0",
"]",
"if",
"mode",
"&",
"0x4000",
"!=",
"0",
... | Removes a file or directory. | [
"Removes",
"a",
"file",
"or",
"directory",
"."
] | a92a8fa8074ac792241c83c640a51b394667c324 | https://github.com/dhylands/rshell/blob/a92a8fa8074ac792241c83c640a51b394667c324/rshell/main.py#L810-L831 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.