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
5,700
arraylabs/pymyq
pymyq/device.py
MyQDevice.open_allowed
def open_allowed(self) -> bool: """Door can be opened unattended.""" return next( attr['Value'] for attr in self._device_json.get('Attributes', []) if attr.get('AttributeDisplayName') == 'isunattendedopenallowed')\ == "1"
python
def open_allowed(self) -> bool: """Door can be opened unattended.""" return next( attr['Value'] for attr in self._device_json.get('Attributes', []) if attr.get('AttributeDisplayName') == 'isunattendedopenallowed')\ == "1"
[ "def", "open_allowed", "(", "self", ")", "->", "bool", ":", "return", "next", "(", "attr", "[", "'Value'", "]", "for", "attr", "in", "self", ".", "_device_json", ".", "get", "(", "'Attributes'", ",", "[", "]", ")", "if", "attr", ".", "get", "(", "'...
Door can be opened unattended.
[ "Door", "can", "be", "opened", "unattended", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L89-L94
5,701
arraylabs/pymyq
pymyq/device.py
MyQDevice.close_allowed
def close_allowed(self) -> bool: """Door can be closed unattended.""" return next( attr['Value'] for attr in self._device_json.get('Attributes', []) if attr.get('AttributeDisplayName') == 'isunattendedcloseallowed')\ == "1"
python
def close_allowed(self) -> bool: """Door can be closed unattended.""" return next( attr['Value'] for attr in self._device_json.get('Attributes', []) if attr.get('AttributeDisplayName') == 'isunattendedcloseallowed')\ == "1"
[ "def", "close_allowed", "(", "self", ")", "->", "bool", ":", "return", "next", "(", "attr", "[", "'Value'", "]", "for", "attr", "in", "self", ".", "_device_json", ".", "get", "(", "'Attributes'", ",", "[", "]", ")", "if", "attr", ".", "get", "(", "...
Door can be closed unattended.
[ "Door", "can", "be", "closed", "unattended", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L97-L102
5,702
arraylabs/pymyq
pymyq/device.py
MyQDevice._update_state
def _update_state(self, value: str) -> None: """Update state temporary during open or close.""" attribute = next(attr for attr in self._device['device_info'].get( 'Attributes', []) if attr.get( 'AttributeDisplayName') == 'doorstate') if attribute is not None: ...
python
def _update_state(self, value: str) -> None: """Update state temporary during open or close.""" attribute = next(attr for attr in self._device['device_info'].get( 'Attributes', []) if attr.get( 'AttributeDisplayName') == 'doorstate') if attribute is not None: ...
[ "def", "_update_state", "(", "self", ",", "value", ":", "str", ")", "->", "None", ":", "attribute", "=", "next", "(", "attr", "for", "attr", "in", "self", ".", "_device", "[", "'device_info'", "]", ".", "get", "(", "'Attributes'", ",", "[", "]", ")",...
Update state temporary during open or close.
[ "Update", "state", "temporary", "during", "open", "or", "close", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L113-L119
5,703
arraylabs/pymyq
pymyq/device.py
MyQDevice._coerce_state_from_string
def _coerce_state_from_string(value: Union[int, str]) -> str: """Return a proper state from a string input.""" try: return STATE_MAP[int(value)] except KeyError: _LOGGER.error('Unknown state: %s', value) return STATE_UNKNOWN
python
def _coerce_state_from_string(value: Union[int, str]) -> str: """Return a proper state from a string input.""" try: return STATE_MAP[int(value)] except KeyError: _LOGGER.error('Unknown state: %s', value) return STATE_UNKNOWN
[ "def", "_coerce_state_from_string", "(", "value", ":", "Union", "[", "int", ",", "str", "]", ")", "->", "str", ":", "try", ":", "return", "STATE_MAP", "[", "int", "(", "value", ")", "]", "except", "KeyError", ":", "_LOGGER", ".", "error", "(", "'Unknow...
Return a proper state from a string input.
[ "Return", "a", "proper", "state", "from", "a", "string", "input", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L127-L133
5,704
arraylabs/pymyq
pymyq/device.py
MyQDevice._set_state
async def _set_state(self, state: int) -> bool: """Set the state of the device.""" try: set_state_resp = await self.api._request( 'put', DEVICE_SET_ENDPOINT, json={ 'attributeName': 'desireddoorstate', 'm...
python
async def _set_state(self, state: int) -> bool: """Set the state of the device.""" try: set_state_resp = await self.api._request( 'put', DEVICE_SET_ENDPOINT, json={ 'attributeName': 'desireddoorstate', 'm...
[ "async", "def", "_set_state", "(", "self", ",", "state", ":", "int", ")", "->", "bool", ":", "try", ":", "set_state_resp", "=", "await", "self", ".", "api", ".", "_request", "(", "'put'", ",", "DEVICE_SET_ENDPOINT", ",", "json", "=", "{", "'attributeName...
Set the state of the device.
[ "Set", "the", "state", "of", "the", "device", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L136-L161
5,705
arraylabs/pymyq
pymyq/device.py
MyQDevice.close
async def close(self) -> bool: """Close the device.""" _LOGGER.debug('%s: Sending close command', self.name) if not await self._set_state(0): return False # Do not allow update of this device's state for 10 seconds. self.next_allowed_update = datetime.utcnow() + time...
python
async def close(self) -> bool: """Close the device.""" _LOGGER.debug('%s: Sending close command', self.name) if not await self._set_state(0): return False # Do not allow update of this device's state for 10 seconds. self.next_allowed_update = datetime.utcnow() + time...
[ "async", "def", "close", "(", "self", ")", "->", "bool", ":", "_LOGGER", ".", "debug", "(", "'%s: Sending close command'", ",", "self", ".", "name", ")", "if", "not", "await", "self", ".", "_set_state", "(", "0", ")", ":", "return", "False", "# Do not al...
Close the device.
[ "Close", "the", "device", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L163-L179
5,706
arraylabs/pymyq
pymyq/device.py
MyQDevice.update
async def update(self) -> None: """Retrieve updated device state.""" if self.next_allowed_update is not None and \ datetime.utcnow() < self.next_allowed_update: return self.next_allowed_update = None await self.api._update_device_state() self._device_...
python
async def update(self) -> None: """Retrieve updated device state.""" if self.next_allowed_update is not None and \ datetime.utcnow() < self.next_allowed_update: return self.next_allowed_update = None await self.api._update_device_state() self._device_...
[ "async", "def", "update", "(", "self", ")", "->", "None", ":", "if", "self", ".", "next_allowed_update", "is", "not", "None", "and", "datetime", ".", "utcnow", "(", ")", "<", "self", ".", "next_allowed_update", ":", "return", "self", ".", "next_allowed_upd...
Retrieve updated device state.
[ "Retrieve", "updated", "device", "state", "." ]
413ae01ca23568f7b5f698a87e872f456072356b
https://github.com/arraylabs/pymyq/blob/413ae01ca23568f7b5f698a87e872f456072356b/pymyq/device.py#L200-L208
5,707
sporestack/bitcash
bitcash/network/services.py
NetworkAPI.get_transaction
def get_transaction(cls, txid): """Gets the full transaction details. :param txid: The transaction id in question. :type txid: ``str`` :raises ConnectionError: If all API services fail. :rtype: ``Transaction`` """ for api_call in cls.GET_TX_MAIN: try...
python
def get_transaction(cls, txid): """Gets the full transaction details. :param txid: The transaction id in question. :type txid: ``str`` :raises ConnectionError: If all API services fail. :rtype: ``Transaction`` """ for api_call in cls.GET_TX_MAIN: try...
[ "def", "get_transaction", "(", "cls", ",", "txid", ")", ":", "for", "api_call", "in", "cls", ".", "GET_TX_MAIN", ":", "try", ":", "return", "api_call", "(", "txid", ")", "except", "cls", ".", "IGNORED_ERRORS", ":", "pass", "raise", "ConnectionError", "(", ...
Gets the full transaction details. :param txid: The transaction id in question. :type txid: ``str`` :raises ConnectionError: If all API services fail. :rtype: ``Transaction``
[ "Gets", "the", "full", "transaction", "details", "." ]
c7a18b9d82af98f1000c456dd06131524c260b7f
https://github.com/sporestack/bitcash/blob/c7a18b9d82af98f1000c456dd06131524c260b7f/bitcash/network/services.py#L346-L361
5,708
sporestack/bitcash
bitcash/network/services.py
NetworkAPI.get_tx_amount
def get_tx_amount(cls, txid, txindex): """Gets the amount of a given transaction output. :param txid: The transaction id in question. :type txid: ``str`` :param txindex: The transaction index in question. :type txindex: ``int`` :raises ConnectionError: If all API service...
python
def get_tx_amount(cls, txid, txindex): """Gets the amount of a given transaction output. :param txid: The transaction id in question. :type txid: ``str`` :param txindex: The transaction index in question. :type txindex: ``int`` :raises ConnectionError: If all API service...
[ "def", "get_tx_amount", "(", "cls", ",", "txid", ",", "txindex", ")", ":", "for", "api_call", "in", "cls", ".", "GET_TX_AMOUNT_MAIN", ":", "try", ":", "return", "api_call", "(", "txid", ",", "txindex", ")", "except", "cls", ".", "IGNORED_ERRORS", ":", "p...
Gets the amount of a given transaction output. :param txid: The transaction id in question. :type txid: ``str`` :param txindex: The transaction index in question. :type txindex: ``int`` :raises ConnectionError: If all API services fail. :rtype: ``Decimal``
[ "Gets", "the", "amount", "of", "a", "given", "transaction", "output", "." ]
c7a18b9d82af98f1000c456dd06131524c260b7f
https://github.com/sporestack/bitcash/blob/c7a18b9d82af98f1000c456dd06131524c260b7f/bitcash/network/services.py#L383-L400
5,709
sporestack/bitcash
bitcash/network/fees.py
get_fee
def get_fee(speed=FEE_SPEED_MEDIUM): """Gets the recommended satoshi per byte fee. :param speed: One of: 'fast', 'medium', 'slow'. :type speed: ``string`` :rtype: ``int`` """ if speed == FEE_SPEED_FAST: return DEFAULT_FEE_FAST elif speed == FEE_SPEED_MEDIUM: return DEFAULT_F...
python
def get_fee(speed=FEE_SPEED_MEDIUM): """Gets the recommended satoshi per byte fee. :param speed: One of: 'fast', 'medium', 'slow'. :type speed: ``string`` :rtype: ``int`` """ if speed == FEE_SPEED_FAST: return DEFAULT_FEE_FAST elif speed == FEE_SPEED_MEDIUM: return DEFAULT_F...
[ "def", "get_fee", "(", "speed", "=", "FEE_SPEED_MEDIUM", ")", ":", "if", "speed", "==", "FEE_SPEED_FAST", ":", "return", "DEFAULT_FEE_FAST", "elif", "speed", "==", "FEE_SPEED_MEDIUM", ":", "return", "DEFAULT_FEE_MEDIUM", "elif", "speed", "==", "FEE_SPEED_SLOW", ":...
Gets the recommended satoshi per byte fee. :param speed: One of: 'fast', 'medium', 'slow'. :type speed: ``string`` :rtype: ``int``
[ "Gets", "the", "recommended", "satoshi", "per", "byte", "fee", "." ]
c7a18b9d82af98f1000c456dd06131524c260b7f
https://github.com/sporestack/bitcash/blob/c7a18b9d82af98f1000c456dd06131524c260b7f/bitcash/network/fees.py#L15-L29
5,710
Groundworkstech/pybfd
setup.py
CustomBuildExtension.find_binutils_libs
def find_binutils_libs(self, libdir, lib_ext): """Find Binutils libraries.""" bfd_expr = re.compile("(lib(?:bfd)|(?:opcodes))(.*?)\%s" % lib_ext ) libs = {} for root, dirs, files in os.walk(libdir): for f in files: m = bfd_expr.search(f) if m: ...
python
def find_binutils_libs(self, libdir, lib_ext): """Find Binutils libraries.""" bfd_expr = re.compile("(lib(?:bfd)|(?:opcodes))(.*?)\%s" % lib_ext ) libs = {} for root, dirs, files in os.walk(libdir): for f in files: m = bfd_expr.search(f) if m: ...
[ "def", "find_binutils_libs", "(", "self", ",", "libdir", ",", "lib_ext", ")", ":", "bfd_expr", "=", "re", ".", "compile", "(", "\"(lib(?:bfd)|(?:opcodes))(.*?)\\%s\"", "%", "lib_ext", ")", "libs", "=", "{", "}", "for", "root", ",", "dirs", ",", "files", "i...
Find Binutils libraries.
[ "Find", "Binutils", "libraries", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/setup.py#L117-L142
5,711
Groundworkstech/pybfd
setup.py
CustomBuildExtension.generate_source_files
def generate_source_files( self ): """ Genertate source files to be used during the compile process of the extension module. This is better than just hardcoding the values on python files because header definitions might change along differente Binutils versions and we'll...
python
def generate_source_files( self ): """ Genertate source files to be used during the compile process of the extension module. This is better than just hardcoding the values on python files because header definitions might change along differente Binutils versions and we'll...
[ "def", "generate_source_files", "(", "self", ")", ":", "from", "pybfd", ".", "gen_supported_disasm", "import", "get_supported_architectures", ",", "get_supported_machines", ",", "generate_supported_architectures_source", ",", "generate_supported_disassembler_header", ",", "gen_...
Genertate source files to be used during the compile process of the extension module. This is better than just hardcoding the values on python files because header definitions might change along differente Binutils versions and we'll be able to catch the changes and keep the correct valu...
[ "Genertate", "source", "files", "to", "be", "used", "during", "the", "compile", "process", "of", "the", "extension", "module", ".", "This", "is", "better", "than", "just", "hardcoding", "the", "values", "on", "python", "files", "because", "header", "definition...
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/setup.py#L152-L265
5,712
Groundworkstech/pybfd
setup.py
CustomBuildExtension._darwin_current_arch
def _darwin_current_arch(self): """Add Mac OS X support.""" if sys.platform == "darwin": if sys.maxsize > 2 ** 32: # 64bits. return platform.mac_ver()[2] # Both Darwin and Python are 64bits. else: # Python 32 bits return platform.processor()
python
def _darwin_current_arch(self): """Add Mac OS X support.""" if sys.platform == "darwin": if sys.maxsize > 2 ** 32: # 64bits. return platform.mac_ver()[2] # Both Darwin and Python are 64bits. else: # Python 32 bits return platform.processor()
[ "def", "_darwin_current_arch", "(", "self", ")", ":", "if", "sys", ".", "platform", "==", "\"darwin\"", ":", "if", "sys", ".", "maxsize", ">", "2", "**", "32", ":", "# 64bits.", "return", "platform", ".", "mac_ver", "(", ")", "[", "2", "]", "# Both Dar...
Add Mac OS X support.
[ "Add", "Mac", "OS", "X", "support", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/setup.py#L267-L273
5,713
Groundworkstech/pybfd
pybfd/objdump.py
init_parser
def init_parser(): """Initialize option parser.""" usage = "Usage: %(prog)s <option(s)> <file(s)>" description = " Display information from object <file(s)>.\n" description += " At least one of the following switches must be given:" # # Create an argument parser and an exclusive group. # ...
python
def init_parser(): """Initialize option parser.""" usage = "Usage: %(prog)s <option(s)> <file(s)>" description = " Display information from object <file(s)>.\n" description += " At least one of the following switches must be given:" # # Create an argument parser and an exclusive group. # ...
[ "def", "init_parser", "(", ")", ":", "usage", "=", "\"Usage: %(prog)s <option(s)> <file(s)>\"", "description", "=", "\" Display information from object <file(s)>.\\n\"", "description", "+=", "\" At least one of the following switches must be given:\"", "#", "# Create an argument parser...
Initialize option parser.
[ "Initialize", "option", "parser", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/objdump.py#L254-L341
5,714
Groundworkstech/pybfd
pybfd/objdump.py
DumpSectionContentAction.dump
def dump(self, src, length=16, start=0, preffix=""): """Dump the specified buffer in hex + ASCII format.""" FILTER = \ "".join([(len(repr(chr(x)))==3) and chr(x) or '.' \ for x in xrange(256)]) result = list() for i in xrange(0, len(src), length): ...
python
def dump(self, src, length=16, start=0, preffix=""): """Dump the specified buffer in hex + ASCII format.""" FILTER = \ "".join([(len(repr(chr(x)))==3) and chr(x) or '.' \ for x in xrange(256)]) result = list() for i in xrange(0, len(src), length): ...
[ "def", "dump", "(", "self", ",", "src", ",", "length", "=", "16", ",", "start", "=", "0", ",", "preffix", "=", "\"\"", ")", ":", "FILTER", "=", "\"\"", ".", "join", "(", "[", "(", "len", "(", "repr", "(", "chr", "(", "x", ")", ")", ")", "==...
Dump the specified buffer in hex + ASCII format.
[ "Dump", "the", "specified", "buffer", "in", "hex", "+", "ASCII", "format", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/objdump.py#L208-L224
5,715
Groundworkstech/pybfd
pybfd/section.py
BfdSection.content
def content(self): """Return the entire section content.""" return _bfd.section_get_content(self.bfd, self._ptr, 0, self.size)
python
def content(self): """Return the entire section content.""" return _bfd.section_get_content(self.bfd, self._ptr, 0, self.size)
[ "def", "content", "(", "self", ")", ":", "return", "_bfd", ".", "section_get_content", "(", "self", ".", "bfd", ",", "self", ".", "_ptr", ",", "0", ",", "self", ".", "size", ")" ]
Return the entire section content.
[ "Return", "the", "entire", "section", "content", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/section.py#L473-L475
5,716
Groundworkstech/pybfd
pybfd/section.py
BfdSection.get_content
def get_content(self, offset, size): """Return the specified number of bytes from the current section.""" return _bfd.section_get_content(self.bfd, self._ptr, offset, size)
python
def get_content(self, offset, size): """Return the specified number of bytes from the current section.""" return _bfd.section_get_content(self.bfd, self._ptr, offset, size)
[ "def", "get_content", "(", "self", ",", "offset", ",", "size", ")", ":", "return", "_bfd", ".", "section_get_content", "(", "self", ".", "bfd", ",", "self", ".", "_ptr", ",", "offset", ",", "size", ")" ]
Return the specified number of bytes from the current section.
[ "Return", "the", "specified", "number", "of", "bytes", "from", "the", "current", "section", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/section.py#L477-L479
5,717
Groundworkstech/pybfd
pybfd/opcodes.py
main
def main(): """Test case for simple opcode disassembly.""" test_targets = ( [ARCH_I386, MACH_I386_I386_INTEL_SYNTAX, ENDIAN_MONO, "\x55\x89\xe5\xE8\xB8\xFF\xFF\xFF", 0x1000], [ARCH_I386, MACH_X86_64_INTEL_SYNTAX, ENDIAN_MONO, "\x55\x48\x89\xe5\xE8\xA3\xFF\xFF\xFF", 0x1000], [ARCH_ARM...
python
def main(): """Test case for simple opcode disassembly.""" test_targets = ( [ARCH_I386, MACH_I386_I386_INTEL_SYNTAX, ENDIAN_MONO, "\x55\x89\xe5\xE8\xB8\xFF\xFF\xFF", 0x1000], [ARCH_I386, MACH_X86_64_INTEL_SYNTAX, ENDIAN_MONO, "\x55\x48\x89\xe5\xE8\xA3\xFF\xFF\xFF", 0x1000], [ARCH_ARM...
[ "def", "main", "(", ")", ":", "test_targets", "=", "(", "[", "ARCH_I386", ",", "MACH_I386_I386_INTEL_SYNTAX", ",", "ENDIAN_MONO", ",", "\"\\x55\\x89\\xe5\\xE8\\xB8\\xFF\\xFF\\xFF\"", ",", "0x1000", "]", ",", "[", "ARCH_I386", ",", "MACH_X86_64_INTEL_SYNTAX", ",", "E...
Test case for simple opcode disassembly.
[ "Test", "case", "for", "simple", "opcode", "disassembly", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/opcodes.py#L186-L211
5,718
Groundworkstech/pybfd
pybfd/opcodes.py
Opcodes.initialize_bfd
def initialize_bfd(self, abfd): """Initialize underlying libOpcodes library using BFD.""" self._ptr = _opcodes.initialize_bfd(abfd._ptr) # Already done inside opcodes.c #self.architecture = abfd.architecture #self.machine = abfd.machine #self.endian = abfd....
python
def initialize_bfd(self, abfd): """Initialize underlying libOpcodes library using BFD.""" self._ptr = _opcodes.initialize_bfd(abfd._ptr) # Already done inside opcodes.c #self.architecture = abfd.architecture #self.machine = abfd.machine #self.endian = abfd....
[ "def", "initialize_bfd", "(", "self", ",", "abfd", ")", ":", "self", ".", "_ptr", "=", "_opcodes", ".", "initialize_bfd", "(", "abfd", ".", "_ptr", ")", "# Already done inside opcodes.c", "#self.architecture = abfd.architecture", "#self.machine = abfd.machine", "#self.e...
Initialize underlying libOpcodes library using BFD.
[ "Initialize", "underlying", "libOpcodes", "library", "using", "BFD", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/opcodes.py#L84-L99
5,719
Groundworkstech/pybfd
pybfd/opcodes.py
Opcodes.initialize_non_bfd
def initialize_non_bfd(self, architecture=None, machine=None, endian=ENDIAN_UNKNOWN): """Initialize underlying libOpcodes library not using BFD.""" if None in [architecture, machine, endian]: return self.architecture = architecture self.machine = machine sel...
python
def initialize_non_bfd(self, architecture=None, machine=None, endian=ENDIAN_UNKNOWN): """Initialize underlying libOpcodes library not using BFD.""" if None in [architecture, machine, endian]: return self.architecture = architecture self.machine = machine sel...
[ "def", "initialize_non_bfd", "(", "self", ",", "architecture", "=", "None", ",", "machine", "=", "None", ",", "endian", "=", "ENDIAN_UNKNOWN", ")", ":", "if", "None", "in", "[", "architecture", ",", "machine", ",", "endian", "]", ":", "return", "self", "...
Initialize underlying libOpcodes library not using BFD.
[ "Initialize", "underlying", "libOpcodes", "library", "not", "using", "BFD", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/opcodes.py#L102-L111
5,720
Groundworkstech/pybfd
pybfd/opcodes.py
Opcodes.initialize_smart_disassemble
def initialize_smart_disassemble(self, data, start_address=0): """ Set the binary buffer to disassemble with other related information ready for an instruction by instruction disassembly session. """ _opcodes.initialize_smart_disassemble( self._ptr, data, sta...
python
def initialize_smart_disassemble(self, data, start_address=0): """ Set the binary buffer to disassemble with other related information ready for an instruction by instruction disassembly session. """ _opcodes.initialize_smart_disassemble( self._ptr, data, sta...
[ "def", "initialize_smart_disassemble", "(", "self", ",", "data", ",", "start_address", "=", "0", ")", ":", "_opcodes", ".", "initialize_smart_disassemble", "(", "self", ".", "_ptr", ",", "data", ",", "start_address", ")" ]
Set the binary buffer to disassemble with other related information ready for an instruction by instruction disassembly session.
[ "Set", "the", "binary", "buffer", "to", "disassemble", "with", "other", "related", "information", "ready", "for", "an", "instruction", "by", "instruction", "disassembly", "session", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/opcodes.py#L113-L120
5,721
Groundworkstech/pybfd
pybfd/opcodes.py
Opcodes.print_single_instruction_callback
def print_single_instruction_callback(self, address, size, branch_delay_insn, insn_type, target, target2, disassembly): """ Callack on each disassembled instruction to print its information. """ print "0x%X SZ=%d BD=%d IT=%d\t%s" % \ (address, size, branch_de...
python
def print_single_instruction_callback(self, address, size, branch_delay_insn, insn_type, target, target2, disassembly): """ Callack on each disassembled instruction to print its information. """ print "0x%X SZ=%d BD=%d IT=%d\t%s" % \ (address, size, branch_de...
[ "def", "print_single_instruction_callback", "(", "self", ",", "address", ",", "size", ",", "branch_delay_insn", ",", "insn_type", ",", "target", ",", "target2", ",", "disassembly", ")", ":", "print", "\"0x%X SZ=%d BD=%d IT=%d\\t%s\"", "%", "(", "address", ",", "si...
Callack on each disassembled instruction to print its information.
[ "Callack", "on", "each", "disassembled", "instruction", "to", "print", "its", "information", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/opcodes.py#L131-L140
5,722
Groundworkstech/pybfd
pybfd/opcodes.py
Opcodes.disassemble
def disassemble(self, data, start_address=0): """ Return a list containing the virtual memory address, instruction length and disassembly code for the given binary buffer. """ return _opcodes.disassemble(self._ptr, data, start_address)
python
def disassemble(self, data, start_address=0): """ Return a list containing the virtual memory address, instruction length and disassembly code for the given binary buffer. """ return _opcodes.disassemble(self._ptr, data, start_address)
[ "def", "disassemble", "(", "self", ",", "data", ",", "start_address", "=", "0", ")", ":", "return", "_opcodes", ".", "disassemble", "(", "self", ".", "_ptr", ",", "data", ",", "start_address", ")" ]
Return a list containing the virtual memory address, instruction length and disassembly code for the given binary buffer.
[ "Return", "a", "list", "containing", "the", "virtual", "memory", "address", "instruction", "length", "and", "disassembly", "code", "for", "the", "given", "binary", "buffer", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/opcodes.py#L142-L148
5,723
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.open
def open(self, _file, target=DEFAULT_TARGET): """ Open the existing file for reading. @param _file : A filename of file descriptor. @param target: A user-specific BFD target name. @return : None """ # Close any existing BFD structure instance. self.clos...
python
def open(self, _file, target=DEFAULT_TARGET): """ Open the existing file for reading. @param _file : A filename of file descriptor. @param target: A user-specific BFD target name. @return : None """ # Close any existing BFD structure instance. self.clos...
[ "def", "open", "(", "self", ",", "_file", ",", "target", "=", "DEFAULT_TARGET", ")", ":", "# Close any existing BFD structure instance. ", "self", ".", "close", "(", ")", "#", "# STEP 1. Open the BFD pointer.", "#", "# Determine if the user passed a file-descriptor or a _fi...
Open the existing file for reading. @param _file : A filename of file descriptor. @param target: A user-specific BFD target name. @return : None
[ "Open", "the", "existing", "file", "for", "reading", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L118-L215
5,724
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.__populate_archive_files
def __populate_archive_files(self): """Store the list of files inside an archive file.""" self.archive_files = [] for _ptr in _bfd.archive_list_files(self._ptr): try: self.archive_files.append(Bfd(_ptr)) except BfdException, err: #print "Er...
python
def __populate_archive_files(self): """Store the list of files inside an archive file.""" self.archive_files = [] for _ptr in _bfd.archive_list_files(self._ptr): try: self.archive_files.append(Bfd(_ptr)) except BfdException, err: #print "Er...
[ "def", "__populate_archive_files", "(", "self", ")", ":", "self", ".", "archive_files", "=", "[", "]", "for", "_ptr", "in", "_bfd", ".", "archive_list_files", "(", "self", ".", "_ptr", ")", ":", "try", ":", "self", ".", "archive_files", ".", "append", "(...
Store the list of files inside an archive file.
[ "Store", "the", "list", "of", "files", "inside", "an", "archive", "file", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L217-L226
5,725
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.archive_filenames
def archive_filenames(self): """Return the list of files inside an archive file.""" try: return _bfd.archive_list_filenames(self._ptr) except TypeError, err: raise BfdException(err)
python
def archive_filenames(self): """Return the list of files inside an archive file.""" try: return _bfd.archive_list_filenames(self._ptr) except TypeError, err: raise BfdException(err)
[ "def", "archive_filenames", "(", "self", ")", ":", "try", ":", "return", "_bfd", ".", "archive_list_filenames", "(", "self", ".", "_ptr", ")", "except", "TypeError", ",", "err", ":", "raise", "BfdException", "(", "err", ")" ]
Return the list of files inside an archive file.
[ "Return", "the", "list", "of", "files", "inside", "an", "archive", "file", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L239-L244
5,726
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.file_format_name
def file_format_name(self): """Return the current format name of the open bdf.""" try: return BfdFormatNamesLong[self.file_format] except IndexError, err: raise BfdException("Invalid format specified (%d)" % self.file_format)
python
def file_format_name(self): """Return the current format name of the open bdf.""" try: return BfdFormatNamesLong[self.file_format] except IndexError, err: raise BfdException("Invalid format specified (%d)" % self.file_format)
[ "def", "file_format_name", "(", "self", ")", ":", "try", ":", "return", "BfdFormatNamesLong", "[", "self", ".", "file_format", "]", "except", "IndexError", ",", "err", ":", "raise", "BfdException", "(", "\"Invalid format specified (%d)\"", "%", "self", ".", "fil...
Return the current format name of the open bdf.
[ "Return", "the", "current", "format", "name", "of", "the", "open", "bdf", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L272-L277
5,727
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.__populate_sections
def __populate_sections(self): """Get a list of the section present in the bfd to populate our internal list. """ if not self._ptr: raise BfdException("BFD not initialized") for section in _bfd.get_sections_list(self._ptr): try: bfd_secti...
python
def __populate_sections(self): """Get a list of the section present in the bfd to populate our internal list. """ if not self._ptr: raise BfdException("BFD not initialized") for section in _bfd.get_sections_list(self._ptr): try: bfd_secti...
[ "def", "__populate_sections", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "for", "section", "in", "_bfd", ".", "get_sections_list", "(", "self", ".", "_ptr", ")", ":", "try", "...
Get a list of the section present in the bfd to populate our internal list.
[ "Get", "a", "list", "of", "the", "section", "present", "in", "the", "bfd", "to", "populate", "our", "internal", "list", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L295-L309
5,728
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.__populate_symbols
def __populate_symbols(self): """Get a list of the symbols present in the bfd to populate our internal list. """ if not self._ptr: raise BfdException("BFD not initialized") try: symbols = _bfd.get_symbols(self._ptr) # Temporary dictionary or...
python
def __populate_symbols(self): """Get a list of the symbols present in the bfd to populate our internal list. """ if not self._ptr: raise BfdException("BFD not initialized") try: symbols = _bfd.get_symbols(self._ptr) # Temporary dictionary or...
[ "def", "__populate_symbols", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "try", ":", "symbols", "=", "_bfd", ".", "get_symbols", "(", "self", ".", "_ptr", ")", "# Temporary dicti...
Get a list of the symbols present in the bfd to populate our internal list.
[ "Get", "a", "list", "of", "the", "symbols", "present", "in", "the", "bfd", "to", "populate", "our", "internal", "list", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L311-L362
5,729
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.close
def close(self): """Close any existing BFD structure before open a new one.""" if self._ptr: #try: # # Release inner BFD files in case we're an archive BFD. # if self.is_archive: # [inner_bfd.close() for inner_bfd in self.archive_files] ...
python
def close(self): """Close any existing BFD structure before open a new one.""" if self._ptr: #try: # # Release inner BFD files in case we're an archive BFD. # if self.is_archive: # [inner_bfd.close() for inner_bfd in self.archive_files] ...
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_ptr", ":", "#try:", "# # Release inner BFD files in case we're an archive BFD.", "# if self.is_archive:", "# [inner_bfd.close() for inner_bfd in self.archive_files]", "#except TypeError, err:", "# pass", "t...
Close any existing BFD structure before open a new one.
[ "Close", "any", "existing", "BFD", "structure", "before", "open", "a", "new", "one", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L364-L379
5,730
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.filename
def filename(self): """Return the filename of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FILENAME)
python
def filename(self): """Return the filename of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FILENAME)
[ "def", "filename", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "FILENAME", ")" ]
Return the filename of the BFD file being processed.
[ "Return", "the", "filename", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L390-L395
5,731
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.cacheable
def cacheable(self): """Return the cacheable attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.CACHEABLE)
python
def cacheable(self): """Return the cacheable attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.CACHEABLE)
[ "def", "cacheable", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "CACHEABLE", ")" ...
Return the cacheable attribute of the BFD file being processed.
[ "Return", "the", "cacheable", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L398-L403
5,732
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.format
def format(self): """Return the format attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FORMAT)
python
def format(self): """Return the format attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FORMAT)
[ "def", "format", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "FORMAT", ")" ]
Return the format attribute of the BFD file being processed.
[ "Return", "the", "format", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L406-L411
5,733
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.target
def target(self): """Return the target of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.TARGET)
python
def target(self): """Return the target of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.TARGET)
[ "def", "target", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "TARGET", ")" ]
Return the target of the BFD file being processed.
[ "Return", "the", "target", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L414-L419
5,734
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.machine
def machine(self): """Return the flavour attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FLAVOUR)
python
def machine(self): """Return the flavour attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FLAVOUR)
[ "def", "machine", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "FLAVOUR", ")" ]
Return the flavour attribute of the BFD file being processed.
[ "Return", "the", "flavour", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L435-L440
5,735
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.family_coff
def family_coff(self): """Return the family_coff attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FAMILY_COFF)
python
def family_coff(self): """Return the family_coff attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FAMILY_COFF)
[ "def", "family_coff", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "FAMILY_COFF", ...
Return the family_coff attribute of the BFD file being processed.
[ "Return", "the", "family_coff", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L450-L455
5,736
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.big_endian
def big_endian(self): """Return the big endian attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.IS_BIG_ENDIAN)
python
def big_endian(self): """Return the big endian attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.IS_BIG_ENDIAN)
[ "def", "big_endian", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "IS_BIG_ENDIAN", ...
Return the big endian attribute of the BFD file being processed.
[ "Return", "the", "big", "endian", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L466-L471
5,737
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.little_endian
def little_endian(self): """ Return the little_endian attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.IS_LITTLE_ENDIAN)
python
def little_endian(self): """ Return the little_endian attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.IS_LITTLE_ENDIAN)
[ "def", "little_endian", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "IS_LITTLE_ENDI...
Return the little_endian attribute of the BFD file being processed.
[ "Return", "the", "little_endian", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L474-L481
5,738
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.header_big_endian
def header_big_endian(self): """ Return the header_big_endian attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.HEADER_BIG_ENDIAN)
python
def header_big_endian(self): """ Return the header_big_endian attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.HEADER_BIG_ENDIAN)
[ "def", "header_big_endian", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "HEADER_BIG...
Return the header_big_endian attribute of the BFD file being processed.
[ "Return", "the", "header_big_endian", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L484-L493
5,739
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.header_little_endian
def header_little_endian(self): """Return the header_little_endian attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.HEADER_LITTLE_EN...
python
def header_little_endian(self): """Return the header_little_endian attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.HEADER_LITTLE_EN...
[ "def", "header_little_endian", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "HEADER_...
Return the header_little_endian attribute of the BFD file being processed.
[ "Return", "the", "header_little_endian", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L496-L505
5,740
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.file_flags
def file_flags(self): """Return the file flags attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FILE_FLAGS)
python
def file_flags(self): """Return the file flags attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FILE_FLAGS)
[ "def", "file_flags", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "FILE_FLAGS", ")...
Return the file flags attribute of the BFD file being processed.
[ "Return", "the", "file", "flags", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L508-L513
5,741
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.file_flags
def file_flags(self, _file_flags): """Set the new file flags attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_file_flags(self._ptr, _file_flags)
python
def file_flags(self, _file_flags): """Set the new file flags attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_file_flags(self._ptr, _file_flags)
[ "def", "file_flags", "(", "self", ",", "_file_flags", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "set_file_flags", "(", "self", ".", "_ptr", ",", "_file_flags", ")" ]
Set the new file flags attribute of the BFD file being processed.
[ "Set", "the", "new", "file", "flags", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L516-L521
5,742
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.applicable_file_flags
def applicable_file_flags(self): """ Return the applicable file flags attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.APPLICABLE_FI...
python
def applicable_file_flags(self): """ Return the applicable file flags attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.APPLICABLE_FI...
[ "def", "applicable_file_flags", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "APPLIC...
Return the applicable file flags attribute of the BFD file being processed.
[ "Return", "the", "applicable", "file", "flags", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L524-L534
5,743
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.my_archieve
def my_archieve(self): """Return the my archieve attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.MY_ARCHIEVE)
python
def my_archieve(self): """Return the my archieve attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.MY_ARCHIEVE)
[ "def", "my_archieve", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "MY_ARCHIEVE", ...
Return the my archieve attribute of the BFD file being processed.
[ "Return", "the", "my", "archieve", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L537-L542
5,744
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.has_map
def has_map(self): """Return the has map attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.HAS_MAP)
python
def has_map(self): """Return the has map attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.HAS_MAP)
[ "def", "has_map", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "HAS_MAP", ")" ]
Return the has map attribute of the BFD file being processed.
[ "Return", "the", "has", "map", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L545-L550
5,745
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.is_thin_archieve
def is_thin_archieve(self): """ Return the is thin archieve attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.IS_THIN_ARCHIEVE)
python
def is_thin_archieve(self): """ Return the is thin archieve attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.IS_THIN_ARCHIEVE)
[ "def", "is_thin_archieve", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "IS_THIN_ARC...
Return the is thin archieve attribute of the BFD file being processed.
[ "Return", "the", "is", "thin", "archieve", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L553-L561
5,746
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.has_gap_in_elf_shndx
def has_gap_in_elf_shndx(self): """Return the has gap in elf shndx attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.HAS_GAP_IN_ELF_SHNDX)
python
def has_gap_in_elf_shndx(self): """Return the has gap in elf shndx attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.HAS_GAP_IN_ELF_SHNDX)
[ "def", "has_gap_in_elf_shndx", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "HAS_GAP...
Return the has gap in elf shndx attribute of the BFD file being processed.
[ "Return", "the", "has", "gap", "in", "elf", "shndx", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L564-L572
5,747
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.valid_reloction_types
def valid_reloction_types(self): """Return the valid_reloc_types attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.VALID_RELOC_TYPES)
python
def valid_reloction_types(self): """Return the valid_reloc_types attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.VALID_RELOC_TYPES)
[ "def", "valid_reloction_types", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "VALID_...
Return the valid_reloc_types attribute of the BFD file being processed.
[ "Return", "the", "valid_reloc_types", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L575-L581
5,748
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.user_data
def user_data(self): """Return the usrdata attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.USRDATA)
python
def user_data(self): """Return the usrdata attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.USRDATA)
[ "def", "user_data", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "USRDATA", ")" ]
Return the usrdata attribute of the BFD file being processed.
[ "Return", "the", "usrdata", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L584-L589
5,749
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.start_address
def start_address(self): """Return the start address attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.START_ADDRESS)
python
def start_address(self): """Return the start address attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.START_ADDRESS)
[ "def", "start_address", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "START_ADDRESS"...
Return the start address attribute of the BFD file being processed.
[ "Return", "the", "start", "address", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L592-L597
5,750
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.symbols_count
def symbols_count(self): """Return the symcount attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.SYMCOUNT)
python
def symbols_count(self): """Return the symcount attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.SYMCOUNT)
[ "def", "symbols_count", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "SYMCOUNT", "...
Return the symcount attribute of the BFD file being processed.
[ "Return", "the", "symcount", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L630-L635
5,751
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.out_symbols
def out_symbols(self): """Return the out symbols attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.OUTSYMBOLS)
python
def out_symbols(self): """Return the out symbols attribute of the BFD file being processed.""" if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.OUTSYMBOLS)
[ "def", "out_symbols", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "OUTSYMBOLS", "...
Return the out symbols attribute of the BFD file being processed.
[ "Return", "the", "out", "symbols", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L638-L643
5,752
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.sections_count
def sections_count(self): """Return the sections_count attribute of the BFD file being processed.""" # This should match the 'sections' attribute length so instead should # use : # # len(bfd.sections) # if not self._ptr: raise BfdException("BFD not i...
python
def sections_count(self): """Return the sections_count attribute of the BFD file being processed.""" # This should match the 'sections' attribute length so instead should # use : # # len(bfd.sections) # if not self._ptr: raise BfdException("BFD not i...
[ "def", "sections_count", "(", "self", ")", ":", "# This should match the 'sections' attribute length so instead should", "# use :", "#", "# len(bfd.sections)", "#", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "ret...
Return the sections_count attribute of the BFD file being processed.
[ "Return", "the", "sections_count", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L646-L656
5,753
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.dynamic_symbols_count
def dynamic_symbols_count(self): """Return the dynamic symbols count attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.DYNAMIC_SYMCOU...
python
def dynamic_symbols_count(self): """Return the dynamic symbols count attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.DYNAMIC_SYMCOU...
[ "def", "dynamic_symbols_count", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "DYNAMI...
Return the dynamic symbols count attribute of the BFD file being processed.
[ "Return", "the", "dynamic", "symbols", "count", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L659-L668
5,754
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.symbol_leading_char
def symbol_leading_char(self): """Return the symbol leading char attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.SYMBOL_LEADING_CHA...
python
def symbol_leading_char(self): """Return the symbol leading char attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.get_bfd_attribute( self._ptr, BfdAttributes.SYMBOL_LEADING_CHA...
[ "def", "symbol_leading_char", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "get_bfd_attribute", "(", "self", ".", "_ptr", ",", "BfdAttributes", ".", "SYMBOL_L...
Return the symbol leading char attribute of the BFD file being processed.
[ "Return", "the", "symbol", "leading", "char", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L671-L680
5,755
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.arch_size
def arch_size(self): """Return the architecure size in bits.""" if not self._ptr: raise BfdException("BFD not initialized") try: return _bfd.get_arch_size(self._ptr) except Exception, err: raise BfdException("Unable to determine architeure size.")
python
def arch_size(self): """Return the architecure size in bits.""" if not self._ptr: raise BfdException("BFD not initialized") try: return _bfd.get_arch_size(self._ptr) except Exception, err: raise BfdException("Unable to determine architeure size.")
[ "def", "arch_size", "(", "self", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "try", ":", "return", "_bfd", ".", "get_arch_size", "(", "self", ".", "_ptr", ")", "except", "Exception", ",", ...
Return the architecure size in bits.
[ "Return", "the", "architecure", "size", "in", "bits", "." ]
9e722435929b4ad52212043a6f1e9e9ce60b5d72
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L697-L705
5,756
getsenic/nuimo-linux-python
nuimo/nuimo.py
Controller.display_matrix
def display_matrix(self, matrix, interval=2.0, brightness=1.0, fading=False, ignore_duplicates=False): """ Displays an LED matrix on Nuimo's LED matrix display. :param matrix: the matrix to display :param interval: interval in seconds until the matrix disappears again :param bri...
python
def display_matrix(self, matrix, interval=2.0, brightness=1.0, fading=False, ignore_duplicates=False): """ Displays an LED matrix on Nuimo's LED matrix display. :param matrix: the matrix to display :param interval: interval in seconds until the matrix disappears again :param bri...
[ "def", "display_matrix", "(", "self", ",", "matrix", ",", "interval", "=", "2.0", ",", "brightness", "=", "1.0", ",", "fading", "=", "False", ",", "ignore_duplicates", "=", "False", ")", ":", "self", ".", "_matrix_writer", ".", "write", "(", "matrix", "=...
Displays an LED matrix on Nuimo's LED matrix display. :param matrix: the matrix to display :param interval: interval in seconds until the matrix disappears again :param brightness: led brightness between 0..1 :param fading: if True, the previous matrix fades into the new matrix ...
[ "Displays", "an", "LED", "matrix", "on", "Nuimo", "s", "LED", "matrix", "display", "." ]
1918e6e51ad6569eb134904e891122479fafa2d6
https://github.com/getsenic/nuimo-linux-python/blob/1918e6e51ad6569eb134904e891122479fafa2d6/nuimo/nuimo.py#L208-L224
5,757
secynic/ipwhois
ipwhois/net.py
Net.get_asn_origin_whois
def get_asn_origin_whois(self, asn_registry='radb', asn=None, retry_count=3, server=None, port=43): """ The function for retrieving CIDR info for an ASN via whois. Args: asn_registry (:obj:`str`): The source to run the query against (asn....
python
def get_asn_origin_whois(self, asn_registry='radb', asn=None, retry_count=3, server=None, port=43): """ The function for retrieving CIDR info for an ASN via whois. Args: asn_registry (:obj:`str`): The source to run the query against (asn....
[ "def", "get_asn_origin_whois", "(", "self", ",", "asn_registry", "=", "'radb'", ",", "asn", "=", "None", ",", "retry_count", "=", "3", ",", "server", "=", "None", ",", "port", "=", "43", ")", ":", "try", ":", "if", "server", "is", "None", ":", "serve...
The function for retrieving CIDR info for an ASN via whois. Args: asn_registry (:obj:`str`): The source to run the query against (asn.ASN_ORIGIN_WHOIS). asn (:obj:`str`): The AS number (required). retry_count (:obj:`int`): The number of times to retry in case...
[ "The", "function", "for", "retrieving", "CIDR", "info", "for", "an", "ASN", "via", "whois", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L431-L541
5,758
secynic/ipwhois
ipwhois/net.py
Net.get_http_json
def get_http_json(self, url=None, retry_count=3, rate_limit_timeout=120, headers=None): """ The function for retrieving a json result via HTTP. Args: url (:obj:`str`): The URL to retrieve (required). retry_count (:obj:`int`): The number of times to ...
python
def get_http_json(self, url=None, retry_count=3, rate_limit_timeout=120, headers=None): """ The function for retrieving a json result via HTTP. Args: url (:obj:`str`): The URL to retrieve (required). retry_count (:obj:`int`): The number of times to ...
[ "def", "get_http_json", "(", "self", ",", "url", "=", "None", ",", "retry_count", "=", "3", ",", "rate_limit_timeout", "=", "120", ",", "headers", "=", "None", ")", ":", "if", "headers", "is", "None", ":", "headers", "=", "{", "'Accept'", ":", "'applic...
The function for retrieving a json result via HTTP. Args: url (:obj:`str`): The URL to retrieve (required). retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc. are encountered. Defaults to 3. ...
[ "The", "function", "for", "retrieving", "a", "json", "result", "via", "HTTP", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L672-L793
5,759
secynic/ipwhois
ipwhois/net.py
Net.get_host
def get_host(self, retry_count=3): """ The function for retrieving host information for an IP address. Args: retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc. are encountered. Defaults to 3...
python
def get_host(self, retry_count=3): """ The function for retrieving host information for an IP address. Args: retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc. are encountered. Defaults to 3...
[ "def", "get_host", "(", "self", ",", "retry_count", "=", "3", ")", ":", "try", ":", "default_timeout_set", "=", "False", "if", "not", "socket", ".", "getdefaulttimeout", "(", ")", ":", "socket", ".", "setdefaulttimeout", "(", "self", ".", "timeout", ")", ...
The function for retrieving host information for an IP address. Args: retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc. are encountered. Defaults to 3. Returns: namedtuple: ...
[ "The", "function", "for", "retrieving", "host", "information", "for", "an", "IP", "address", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L795-L855
5,760
secynic/ipwhois
ipwhois/net.py
Net.get_http_raw
def get_http_raw(self, url=None, retry_count=3, headers=None, request_type='GET', form_data=None): """ The function for retrieving a raw HTML result via HTTP. Args: url (:obj:`str`): The URL to retrieve (required). retry_count (:obj:`int`): The numbe...
python
def get_http_raw(self, url=None, retry_count=3, headers=None, request_type='GET', form_data=None): """ The function for retrieving a raw HTML result via HTTP. Args: url (:obj:`str`): The URL to retrieve (required). retry_count (:obj:`int`): The numbe...
[ "def", "get_http_raw", "(", "self", ",", "url", "=", "None", ",", "retry_count", "=", "3", ",", "headers", "=", "None", ",", "request_type", "=", "'GET'", ",", "form_data", "=", "None", ")", ":", "if", "headers", "is", "None", ":", "headers", "=", "{...
The function for retrieving a raw HTML result via HTTP. Args: url (:obj:`str`): The URL to retrieve (required). retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc. are encountered. Defaults to 3....
[ "The", "function", "for", "retrieving", "a", "raw", "HTML", "result", "via", "HTTP", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L857-L936
5,761
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
generate_output
def generate_output(line='0', short=None, name=None, value=None, is_parent=False, colorize=True): """ The function for formatting CLI output results. Args: line (:obj:`str`): The line number (0-4). Determines indentation. Defaults to '0'. short (:obj:`str`): ...
python
def generate_output(line='0', short=None, name=None, value=None, is_parent=False, colorize=True): """ The function for formatting CLI output results. Args: line (:obj:`str`): The line number (0-4). Determines indentation. Defaults to '0'. short (:obj:`str`): ...
[ "def", "generate_output", "(", "line", "=", "'0'", ",", "short", "=", "None", ",", "name", "=", "None", ",", "value", "=", "None", ",", "is_parent", "=", "False", ",", "colorize", "=", "True", ")", ":", "# TODO: so ugly", "output", "=", "'{0}{1}{2}{3}{4}...
The function for formatting CLI output results. Args: line (:obj:`str`): The line number (0-4). Determines indentation. Defaults to '0'. short (:obj:`str`): The optional abbreviated name for a field. See hr.py for values. name (:obj:`str`): The optional name for a fi...
[ "The", "function", "for", "formatting", "CLI", "output", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L313-L350
5,762
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_header
def generate_output_header(self, query_type='RDAP'): """ The function for generating the CLI output header. Args: query_type (:obj:`str`): The IPWhois query type. Defaults to 'RDAP'. Returns: str: The generated output. """ output...
python
def generate_output_header(self, query_type='RDAP'): """ The function for generating the CLI output header. Args: query_type (:obj:`str`): The IPWhois query type. Defaults to 'RDAP'. Returns: str: The generated output. """ output...
[ "def", "generate_output_header", "(", "self", ",", "query_type", "=", "'RDAP'", ")", ":", "output", "=", "'\\n{0}{1}{2} query for {3}:{4}\\n\\n'", ".", "format", "(", "ANSI", "[", "'ul'", "]", ",", "ANSI", "[", "'b'", "]", ",", "query_type", ",", "self", "."...
The function for generating the CLI output header. Args: query_type (:obj:`str`): The IPWhois query type. Defaults to 'RDAP'. Returns: str: The generated output.
[ "The", "function", "for", "generating", "the", "CLI", "output", "header", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L406-L426
5,763
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_newline
def generate_output_newline(self, line='0', colorize=True): """ The function for generating a CLI output new line. Args: line (:obj:`str`): The line number (0-4). Determines indentation. Defaults to '0'. colorize (:obj:`bool`): Colorize the console output...
python
def generate_output_newline(self, line='0', colorize=True): """ The function for generating a CLI output new line. Args: line (:obj:`str`): The line number (0-4). Determines indentation. Defaults to '0'. colorize (:obj:`bool`): Colorize the console output...
[ "def", "generate_output_newline", "(", "self", ",", "line", "=", "'0'", ",", "colorize", "=", "True", ")", ":", "return", "generate_output", "(", "line", "=", "line", ",", "is_parent", "=", "True", ",", "colorize", "=", "colorize", ")" ]
The function for generating a CLI output new line. Args: line (:obj:`str`): The line number (0-4). Determines indentation. Defaults to '0'. colorize (:obj:`bool`): Colorize the console output with ANSI colors. Defaults to True. Returns: ...
[ "The", "function", "for", "generating", "a", "CLI", "output", "new", "line", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L428-L446
5,764
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_asn
def generate_output_asn(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output ASN results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable huma...
python
def generate_output_asn(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output ASN results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable huma...
[ "def", "generate_output_asn", "(", "self", ",", "json_data", "=", "None", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "if", "json_data", "is", "None", ":", "json_data", "=", "{", "}", "keys", "=", "...
The function for generating CLI output ASN results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readable name (default is...
[ "The", "function", "for", "generating", "CLI", "output", "ASN", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L448-L487
5,765
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_entities
def generate_output_entities(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP entity results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`b...
python
def generate_output_entities(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP entity results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`b...
[ "def", "generate_output_entities", "(", "self", ",", "json_data", "=", "None", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "output", "=", "''", "short", "=", "HR_RDAP", "[", "'entities'", "]", "[", "'...
The function for generating CLI output RDAP entity results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readable name (de...
[ "The", "function", "for", "generating", "CLI", "output", "RDAP", "entity", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L489-L532
5,766
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_events
def generate_output_events(self, source, key, val, line='2', hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP events results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (req...
python
def generate_output_events(self, source, key, val, line='2', hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP events results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (req...
[ "def", "generate_output_events", "(", "self", ",", "source", ",", "key", ",", "val", ",", "line", "=", "'2'", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "output", "=", "generate_output", "(", "line",...
The function for generating CLI output RDAP events results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (required). key (:obj:`str`): The event key 'events' or 'events_actor' (required). val (:obj:`dict`): The event dictio...
[ "The", "function", "for", "generating", "CLI", "output", "RDAP", "events", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L534-L628
5,767
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_list
def generate_output_list(self, source, key, val, line='2', hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP list results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (required)...
python
def generate_output_list(self, source, key, val, line='2', hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP list results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (required)...
[ "def", "generate_output_list", "(", "self", ",", "source", ",", "key", ",", "val", ",", "line", "=", "'2'", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "output", "=", "generate_output", "(", "line", ...
The function for generating CLI output RDAP list results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (required). key (:obj:`str`): The event key 'events' or 'events_actor' (required). val (:obj:`dict`): The event dictiona...
[ "The", "function", "for", "generating", "CLI", "output", "RDAP", "list", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L630-L673
5,768
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_notices
def generate_output_notices(self, source, key, val, line='1', hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP notices results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (...
python
def generate_output_notices(self, source, key, val, line='1', hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP notices results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (...
[ "def", "generate_output_notices", "(", "self", ",", "source", ",", "key", ",", "val", ",", "line", "=", "'1'", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "output", "=", "generate_output", "(", "line"...
The function for generating CLI output RDAP notices results. Args: source (:obj:`str`): The parent key 'network' or 'objects' (required). key (:obj:`str`): The event key 'events' or 'events_actor' (required). val (:obj:`dict`): The event dicti...
[ "The", "function", "for", "generating", "CLI", "output", "RDAP", "notices", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L675-L760
5,769
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_network
def generate_output_network(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP network results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bo...
python
def generate_output_network(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP network results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bo...
[ "def", "generate_output_network", "(", "self", ",", "json_data", "=", "None", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "if", "json_data", "is", "None", ":", "json_data", "=", "{", "}", "output", "=...
The function for generating CLI output RDAP network results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readable name (d...
[ "The", "function", "for", "generating", "CLI", "output", "RDAP", "network", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L762-L840
5,770
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_whois_nets
def generate_output_whois_nets(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output Legacy Whois networks results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. ...
python
def generate_output_whois_nets(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output Legacy Whois networks results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. ...
[ "def", "generate_output_whois_nets", "(", "self", ",", "json_data", "=", "None", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "if", "json_data", "is", "None", ":", "json_data", "=", "{", "}", "output", ...
The function for generating CLI output Legacy Whois networks results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readabl...
[ "The", "function", "for", "generating", "CLI", "output", "Legacy", "Whois", "networks", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L1085-L1164
5,771
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_nir
def generate_output_nir(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output NIR network results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Ena...
python
def generate_output_nir(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output NIR network results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Ena...
[ "def", "generate_output_nir", "(", "self", ",", "json_data", "=", "None", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ")", ":", "if", "json_data", "is", "None", ":", "json_data", "=", "{", "}", "output", "=", ...
The function for generating CLI output NIR network results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readable name (de...
[ "The", "function", "for", "generating", "CLI", "output", "NIR", "network", "results", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L1234-L1368
5,772
secynic/ipwhois
ipwhois/asn.py
IPASN.parse_fields_whois
def parse_fields_whois(self, response): """ The function for parsing ASN fields from a whois response. Args: response (:obj:`str`): The response from the ASN whois server. Returns: dict: The ASN lookup results :: { ...
python
def parse_fields_whois(self, response): """ The function for parsing ASN fields from a whois response. Args: response (:obj:`str`): The response from the ASN whois server. Returns: dict: The ASN lookup results :: { ...
[ "def", "parse_fields_whois", "(", "self", ",", "response", ")", ":", "try", ":", "temp", "=", "response", ".", "split", "(", "'|'", ")", "# Parse out the ASN information.", "ret", "=", "{", "'asn_registry'", ":", "temp", "[", "4", "]", ".", "strip", "(", ...
The function for parsing ASN fields from a whois response. Args: response (:obj:`str`): The response from the ASN whois server. Returns: dict: The ASN lookup results :: { 'asn' (str) - The Autonomous System Number ...
[ "The", "function", "for", "parsing", "ASN", "fields", "from", "a", "whois", "response", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L239-L294
5,773
secynic/ipwhois
ipwhois/asn.py
IPASN.parse_fields_http
def parse_fields_http(self, response, extra_org_map=None): """ The function for parsing ASN fields from a http response. Args: response (:obj:`str`): The response from the ASN http server. extra_org_map (:obj:`dict`): Dictionary mapping org handles to RIR...
python
def parse_fields_http(self, response, extra_org_map=None): """ The function for parsing ASN fields from a http response. Args: response (:obj:`str`): The response from the ASN http server. extra_org_map (:obj:`dict`): Dictionary mapping org handles to RIR...
[ "def", "parse_fields_http", "(", "self", ",", "response", ",", "extra_org_map", "=", "None", ")", ":", "# Set the org_map. Map the orgRef handle to an RIR.", "org_map", "=", "self", ".", "org_map", ".", "copy", "(", ")", "try", ":", "org_map", ".", "update", "("...
The function for parsing ASN fields from a http response. Args: response (:obj:`str`): The response from the ASN http server. extra_org_map (:obj:`dict`): Dictionary mapping org handles to RIRs. This is for limited cases where ARIN REST (ASN fallback HTTP...
[ "The", "function", "for", "parsing", "ASN", "fields", "from", "a", "http", "response", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L306-L404
5,774
secynic/ipwhois
ipwhois/asn.py
ASNOrigin.get_nets_radb
def get_nets_radb(self, response, is_http=False): """ The function for parsing network blocks from ASN origin data. Args: response (:obj:`str`): The response from the RADB whois/http server. is_http (:obj:`bool`): If the query is RADB HTTP instead of whoi...
python
def get_nets_radb(self, response, is_http=False): """ The function for parsing network blocks from ASN origin data. Args: response (:obj:`str`): The response from the RADB whois/http server. is_http (:obj:`bool`): If the query is RADB HTTP instead of whoi...
[ "def", "get_nets_radb", "(", "self", ",", "response", ",", "is_http", "=", "False", ")", ":", "nets", "=", "[", "]", "if", "is_http", ":", "regex", "=", "r'route(?:6)?:[^\\S\\n]+(?P<val>.+?)<br>'", "else", ":", "regex", "=", "r'^route(?:6)?:[^\\S\\n]+(?P<val>.+|.+...
The function for parsing network blocks from ASN origin data. Args: response (:obj:`str`): The response from the RADB whois/http server. is_http (:obj:`bool`): If the query is RADB HTTP instead of whois, set to True. Defaults to False. Returns: ...
[ "The", "function", "for", "parsing", "network", "blocks", "from", "ASN", "origin", "data", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L719-L770
5,775
secynic/ipwhois
ipwhois/nir.py
NIRWhois.get_nets_jpnic
def get_nets_jpnic(self, response): """ The function for parsing network blocks from jpnic whois data. Args: response (:obj:`str`): The response from the jpnic server. Returns: list of dict: Mapping of networks with start and end positions. :: ...
python
def get_nets_jpnic(self, response): """ The function for parsing network blocks from jpnic whois data. Args: response (:obj:`str`): The response from the jpnic server. Returns: list of dict: Mapping of networks with start and end positions. :: ...
[ "def", "get_nets_jpnic", "(", "self", ",", "response", ")", ":", "nets", "=", "[", "]", "# Iterate through all of the networks found, storing the CIDR value", "# and the start and end positions.", "for", "match", "in", "re", ".", "finditer", "(", "r'^.*?(\\[Network Number\\...
The function for parsing network blocks from jpnic whois data. Args: response (:obj:`str`): The response from the jpnic server. Returns: list of dict: Mapping of networks with start and end positions. :: [{ 'cidr' (str) - The ne...
[ "The", "function", "for", "parsing", "network", "blocks", "from", "jpnic", "whois", "data", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L299-L360
5,776
secynic/ipwhois
ipwhois/nir.py
NIRWhois.get_contact
def get_contact(self, response=None, nir=None, handle=None, retry_count=3, dt_format=None): """ The function for retrieving and parsing NIR whois data based on NIR_WHOIS contact_fields. Args: response (:obj:`str`): Optional response object, this bypasses ...
python
def get_contact(self, response=None, nir=None, handle=None, retry_count=3, dt_format=None): """ The function for retrieving and parsing NIR whois data based on NIR_WHOIS contact_fields. Args: response (:obj:`str`): Optional response object, this bypasses ...
[ "def", "get_contact", "(", "self", ",", "response", "=", "None", ",", "nir", "=", "None", ",", "handle", "=", "None", ",", "retry_count", "=", "3", ",", "dt_format", "=", "None", ")", ":", "if", "response", "or", "nir", "==", "'krnic'", ":", "contact...
The function for retrieving and parsing NIR whois data based on NIR_WHOIS contact_fields. Args: response (:obj:`str`): Optional response object, this bypasses the lookup. nir (:obj:`str`): The NIR to query ('jpnic' or 'krnic'). Required if respons...
[ "The", "function", "for", "retrieving", "and", "parsing", "NIR", "whois", "data", "based", "on", "NIR_WHOIS", "contact_fields", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L447-L492
5,777
secynic/ipwhois
ipwhois/rdap.py
_RDAPContact._parse_address
def _parse_address(self, val): """ The function for parsing the vcard address. Args: val (:obj:`list`): The value to parse. """ ret = { 'type': None, 'value': None } try: ret['type'] = val[1]['type'] exc...
python
def _parse_address(self, val): """ The function for parsing the vcard address. Args: val (:obj:`list`): The value to parse. """ ret = { 'type': None, 'value': None } try: ret['type'] = val[1]['type'] exc...
[ "def", "_parse_address", "(", "self", ",", "val", ")", ":", "ret", "=", "{", "'type'", ":", "None", ",", "'value'", ":", "None", "}", "try", ":", "ret", "[", "'type'", "]", "=", "val", "[", "1", "]", "[", "'type'", "]", "except", "(", "KeyError",...
The function for parsing the vcard address. Args: val (:obj:`list`): The value to parse.
[ "The", "function", "for", "parsing", "the", "vcard", "address", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L112-L148
5,778
secynic/ipwhois
ipwhois/rdap.py
_RDAPContact._parse_phone
def _parse_phone(self, val): """ The function for parsing the vcard phone numbers. Args: val (:obj:`list`): The value to parse. """ ret = { 'type': None, 'value': None } try: ret['type'] = val[1]['type'] ...
python
def _parse_phone(self, val): """ The function for parsing the vcard phone numbers. Args: val (:obj:`list`): The value to parse. """ ret = { 'type': None, 'value': None } try: ret['type'] = val[1]['type'] ...
[ "def", "_parse_phone", "(", "self", ",", "val", ")", ":", "ret", "=", "{", "'type'", ":", "None", ",", "'value'", ":", "None", "}", "try", ":", "ret", "[", "'type'", "]", "=", "val", "[", "1", "]", "[", "'type'", "]", "except", "(", "IndexError",...
The function for parsing the vcard phone numbers. Args: val (:obj:`list`): The value to parse.
[ "The", "function", "for", "parsing", "the", "vcard", "phone", "numbers", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L150-L180
5,779
secynic/ipwhois
ipwhois/rdap.py
_RDAPContact._parse_email
def _parse_email(self, val): """ The function for parsing the vcard email addresses. Args: val (:obj:`list`): The value to parse. """ ret = { 'type': None, 'value': None } try: ret['type'] = val[1]['type'] ...
python
def _parse_email(self, val): """ The function for parsing the vcard email addresses. Args: val (:obj:`list`): The value to parse. """ ret = { 'type': None, 'value': None } try: ret['type'] = val[1]['type'] ...
[ "def", "_parse_email", "(", "self", ",", "val", ")", ":", "ret", "=", "{", "'type'", ":", "None", ",", "'value'", ":", "None", "}", "try", ":", "ret", "[", "'type'", "]", "=", "val", "[", "1", "]", "[", "'type'", "]", "except", "(", "KeyError", ...
The function for parsing the vcard email addresses. Args: val (:obj:`list`): The value to parse.
[ "The", "function", "for", "parsing", "the", "vcard", "email", "addresses", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L182-L212
5,780
secynic/ipwhois
ipwhois/rdap.py
_RDAPContact.parse
def parse(self): """ The function for parsing the vcard to the vars dictionary. """ keys = { 'fn': self._parse_name, 'kind': self._parse_kind, 'adr': self._parse_address, 'tel': self._parse_phone, 'email': self._parse_email, ...
python
def parse(self): """ The function for parsing the vcard to the vars dictionary. """ keys = { 'fn': self._parse_name, 'kind': self._parse_kind, 'adr': self._parse_address, 'tel': self._parse_phone, 'email': self._parse_email, ...
[ "def", "parse", "(", "self", ")", ":", "keys", "=", "{", "'fn'", ":", "self", ".", "_parse_name", ",", "'kind'", ":", "self", ".", "_parse_kind", ",", "'adr'", ":", "self", ".", "_parse_address", ",", "'tel'", ":", "self", ".", "_parse_phone", ",", "...
The function for parsing the vcard to the vars dictionary.
[ "The", "function", "for", "parsing", "the", "vcard", "to", "the", "vars", "dictionary", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L234-L258
5,781
secynic/ipwhois
ipwhois/utils.py
ipv4_lstrip_zeros
def ipv4_lstrip_zeros(address): """ The function to strip leading zeros in each octet of an IPv4 address. Args: address (:obj:`str`): An IPv4 address. Returns: str: The modified IPv4 address. """ # Split the octets. obj = address.strip().split('.') for x, y in enumer...
python
def ipv4_lstrip_zeros(address): """ The function to strip leading zeros in each octet of an IPv4 address. Args: address (:obj:`str`): An IPv4 address. Returns: str: The modified IPv4 address. """ # Split the octets. obj = address.strip().split('.') for x, y in enumer...
[ "def", "ipv4_lstrip_zeros", "(", "address", ")", ":", "# Split the octets.", "obj", "=", "address", ".", "strip", "(", ")", ".", "split", "(", "'.'", ")", "for", "x", ",", "y", "in", "enumerate", "(", "obj", ")", ":", "# Strip leading zeros. Split / here in...
The function to strip leading zeros in each octet of an IPv4 address. Args: address (:obj:`str`): An IPv4 address. Returns: str: The modified IPv4 address.
[ "The", "function", "to", "strip", "leading", "zeros", "in", "each", "octet", "of", "an", "IPv4", "address", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L117-L138
5,782
secynic/ipwhois
ipwhois/utils.py
get_countries
def get_countries(is_legacy_xml=False): """ The function to generate a dictionary containing ISO_3166-1 country codes to names. Args: is_legacy_xml (:obj:`bool`): Whether to use the older country code list (iso_3166-1_list_en.xml). Returns: dict: A mapping of country co...
python
def get_countries(is_legacy_xml=False): """ The function to generate a dictionary containing ISO_3166-1 country codes to names. Args: is_legacy_xml (:obj:`bool`): Whether to use the older country code list (iso_3166-1_list_en.xml). Returns: dict: A mapping of country co...
[ "def", "get_countries", "(", "is_legacy_xml", "=", "False", ")", ":", "# Initialize the countries dictionary.", "countries", "=", "{", "}", "# Set the data directory based on if the script is a frozen executable.", "if", "sys", ".", "platform", "==", "'win32'", "and", "geta...
The function to generate a dictionary containing ISO_3166-1 country codes to names. Args: is_legacy_xml (:obj:`bool`): Whether to use the older country code list (iso_3166-1_list_en.xml). Returns: dict: A mapping of country codes as the keys to the country names as ...
[ "The", "function", "to", "generate", "a", "dictionary", "containing", "ISO_3166", "-", "1", "country", "codes", "to", "names", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L178-L261
5,783
secynic/ipwhois
ipwhois/utils.py
unique_everseen
def unique_everseen(iterable, key=None): """ The generator to list unique elements, preserving the order. Remember all elements ever seen. This was taken from the itertools recipes. Args: iterable (:obj:`iter`): An iterable to process. key (:obj:`callable`): Optional function to run whe...
python
def unique_everseen(iterable, key=None): """ The generator to list unique elements, preserving the order. Remember all elements ever seen. This was taken from the itertools recipes. Args: iterable (:obj:`iter`): An iterable to process. key (:obj:`callable`): Optional function to run whe...
[ "def", "unique_everseen", "(", "iterable", ",", "key", "=", "None", ")", ":", "seen", "=", "set", "(", ")", "seen_add", "=", "seen", ".", "add", "if", "key", "is", "None", ":", "for", "element", "in", "filterfalse", "(", "seen", ".", "__contains__", ...
The generator to list unique elements, preserving the order. Remember all elements ever seen. This was taken from the itertools recipes. Args: iterable (:obj:`iter`): An iterable to process. key (:obj:`callable`): Optional function to run when checking elements (e.g., str.lower) ...
[ "The", "generator", "to", "list", "unique", "elements", "preserving", "the", "order", ".", "Remember", "all", "elements", "ever", "seen", ".", "This", "was", "taken", "from", "the", "itertools", "recipes", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L424-L457
5,784
secynic/ipwhois
ipwhois/whois.py
Whois.get_nets_arin
def get_nets_arin(self, response): """ The function for parsing network blocks from ARIN whois data. Args: response (:obj:`str`): The response from the ARIN whois server. Returns: list of dict: Mapping of networks with start and end positions. :: ...
python
def get_nets_arin(self, response): """ The function for parsing network blocks from ARIN whois data. Args: response (:obj:`str`): The response from the ARIN whois server. Returns: list of dict: Mapping of networks with start and end positions. :: ...
[ "def", "get_nets_arin", "(", "self", ",", "response", ")", ":", "nets", "=", "[", "]", "# Find the first NetRange value.", "pattern", "=", "re", ".", "compile", "(", "r'^NetRange:[^\\S\\n]+(.+)$'", ",", "re", ".", "MULTILINE", ")", "temp", "=", "pattern", ".",...
The function for parsing network blocks from ARIN whois data. Args: response (:obj:`str`): The response from the ARIN whois server. Returns: list of dict: Mapping of networks with start and end positions. :: [{ 'cidr' (str) - Th...
[ "The", "function", "for", "parsing", "network", "blocks", "from", "ARIN", "whois", "data", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L337-L416
5,785
secynic/ipwhois
ipwhois/whois.py
Whois.get_nets_lacnic
def get_nets_lacnic(self, response): """ The function for parsing network blocks from LACNIC whois data. Args: response (:obj:`str`): The response from the LACNIC whois server. Returns: list of dict: Mapping of networks with start and end positions. ...
python
def get_nets_lacnic(self, response): """ The function for parsing network blocks from LACNIC whois data. Args: response (:obj:`str`): The response from the LACNIC whois server. Returns: list of dict: Mapping of networks with start and end positions. ...
[ "def", "get_nets_lacnic", "(", "self", ",", "response", ")", ":", "nets", "=", "[", "]", "# Iterate through all of the networks found, storing the CIDR value", "# and the start and end positions.", "for", "match", "in", "re", ".", "finditer", "(", "r'^(inetnum|inet6num|rout...
The function for parsing network blocks from LACNIC whois data. Args: response (:obj:`str`): The response from the LACNIC whois server. Returns: list of dict: Mapping of networks with start and end positions. :: [{ 'cidr' (str) ...
[ "The", "function", "for", "parsing", "network", "blocks", "from", "LACNIC", "whois", "data", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L428-L496
5,786
secynic/ipwhois
ipwhois/whois.py
Whois.get_nets_other
def get_nets_other(self, response): """ The function for parsing network blocks from generic whois data. Args: response (:obj:`str`): The response from the whois/rwhois server. Returns: list of dict: Mapping of networks with start and end positions. ...
python
def get_nets_other(self, response): """ The function for parsing network blocks from generic whois data. Args: response (:obj:`str`): The response from the whois/rwhois server. Returns: list of dict: Mapping of networks with start and end positions. ...
[ "def", "get_nets_other", "(", "self", ",", "response", ")", ":", "nets", "=", "[", "]", "# Iterate through all of the networks found, storing the CIDR value", "# and the start and end positions.", "for", "match", "in", "re", ".", "finditer", "(", "r'^(inetnum|inet6num|route...
The function for parsing network blocks from generic whois data. Args: response (:obj:`str`): The response from the whois/rwhois server. Returns: list of dict: Mapping of networks with start and end positions. :: [{ 'cidr' (str)...
[ "The", "function", "for", "parsing", "network", "blocks", "from", "generic", "whois", "data", "." ]
b5d634d36b0b942d538d38d77b3bdcd815f155a0
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L508-L578
5,787
klen/marshmallow-peewee
marshmallow_peewee/convert.py
ModelConverter.convert_default
def convert_default(self, field, **params): """Return raw field.""" for klass, ma_field in self.TYPE_MAPPING: if isinstance(field, klass): return ma_field(**params) return fields.Raw(**params)
python
def convert_default(self, field, **params): """Return raw field.""" for klass, ma_field in self.TYPE_MAPPING: if isinstance(field, klass): return ma_field(**params) return fields.Raw(**params)
[ "def", "convert_default", "(", "self", ",", "field", ",", "*", "*", "params", ")", ":", "for", "klass", ",", "ma_field", "in", "self", ".", "TYPE_MAPPING", ":", "if", "isinstance", "(", "field", ",", "klass", ")", ":", "return", "ma_field", "(", "*", ...
Return raw field.
[ "Return", "raw", "field", "." ]
a5985daa4072605882a9c7c41d74881631943953
https://github.com/klen/marshmallow-peewee/blob/a5985daa4072605882a9c7c41d74881631943953/marshmallow_peewee/convert.py#L78-L83
5,788
klen/marshmallow-peewee
marshmallow_peewee/schema.py
ModelSchema.make_instance
def make_instance(self, data): """Build object from data.""" if not self.opts.model: return data if self.instance is not None: for key, value in data.items(): setattr(self.instance, key, value) return self.instance return self.opts.mo...
python
def make_instance(self, data): """Build object from data.""" if not self.opts.model: return data if self.instance is not None: for key, value in data.items(): setattr(self.instance, key, value) return self.instance return self.opts.mo...
[ "def", "make_instance", "(", "self", ",", "data", ")", ":", "if", "not", "self", ".", "opts", ".", "model", ":", "return", "data", "if", "self", ".", "instance", "is", "not", "None", ":", "for", "key", ",", "value", "in", "data", ".", "items", "(",...
Build object from data.
[ "Build", "object", "from", "data", "." ]
a5985daa4072605882a9c7c41d74881631943953
https://github.com/klen/marshmallow-peewee/blob/a5985daa4072605882a9c7c41d74881631943953/marshmallow_peewee/schema.py#L68-L78
5,789
tyarkoni/pliers
pliers/extractors/text.py
ComplexTextExtractor._extract
def _extract(self, stim): ''' Returns all words. ''' props = [(e.text, e.onset, e.duration) for e in stim.elements] vals, onsets, durations = map(list, zip(*props)) return ExtractorResult(vals, stim, self, ['word'], onsets, durations)
python
def _extract(self, stim): ''' Returns all words. ''' props = [(e.text, e.onset, e.duration) for e in stim.elements] vals, onsets, durations = map(list, zip(*props)) return ExtractorResult(vals, stim, self, ['word'], onsets, durations)
[ "def", "_extract", "(", "self", ",", "stim", ")", ":", "props", "=", "[", "(", "e", ".", "text", ",", "e", ".", "onset", ",", "e", ".", "duration", ")", "for", "e", "in", "stim", ".", "elements", "]", "vals", ",", "onsets", ",", "durations", "=...
Returns all words.
[ "Returns", "all", "words", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/extractors/text.py#L44-L48
5,790
tyarkoni/pliers
pliers/stimuli/base.py
Stim.get_filename
def get_filename(self): ''' Return the source filename of the current Stim. ''' if self.filename is None or not os.path.exists(self.filename): tf = tempfile.mktemp() + self._default_file_extension self.save(tf) yield tf os.remove(tf) else: ...
python
def get_filename(self): ''' Return the source filename of the current Stim. ''' if self.filename is None or not os.path.exists(self.filename): tf = tempfile.mktemp() + self._default_file_extension self.save(tf) yield tf os.remove(tf) else: ...
[ "def", "get_filename", "(", "self", ")", ":", "if", "self", ".", "filename", "is", "None", "or", "not", "os", ".", "path", ".", "exists", "(", "self", ".", "filename", ")", ":", "tf", "=", "tempfile", ".", "mktemp", "(", ")", "+", "self", ".", "_...
Return the source filename of the current Stim.
[ "Return", "the", "source", "filename", "of", "the", "current", "Stim", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/base.py#L55-L63
5,791
tyarkoni/pliers
pliers/stimuli/compound.py
CompoundStim.get_stim
def get_stim(self, type_, return_all=False): ''' Returns component elements of the specified type. Args: type_ (str or Stim class): the desired Stim subclass to return. return_all (bool): when True, returns all elements that matched the specified type as a list. ...
python
def get_stim(self, type_, return_all=False): ''' Returns component elements of the specified type. Args: type_ (str or Stim class): the desired Stim subclass to return. return_all (bool): when True, returns all elements that matched the specified type as a list. ...
[ "def", "get_stim", "(", "self", ",", "type_", ",", "return_all", "=", "False", ")", ":", "if", "isinstance", "(", "type_", ",", "string_types", ")", ":", "type_", "=", "_get_stim_class", "(", "type_", ")", "matches", "=", "[", "]", "for", "s", "in", ...
Returns component elements of the specified type. Args: type_ (str or Stim class): the desired Stim subclass to return. return_all (bool): when True, returns all elements that matched the specified type as a list. When False (default), returns only the fi...
[ "Returns", "component", "elements", "of", "the", "specified", "type", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/compound.py#L57-L81
5,792
tyarkoni/pliers
pliers/stimuli/compound.py
CompoundStim.has_types
def has_types(self, types, all_=True): ''' Check whether the current component list matches all Stim types in the types argument. Args: types (Stim, list): a Stim class or iterable of Stim classes. all_ (bool): if True, all input types must match; if False, at ...
python
def has_types(self, types, all_=True): ''' Check whether the current component list matches all Stim types in the types argument. Args: types (Stim, list): a Stim class or iterable of Stim classes. all_ (bool): if True, all input types must match; if False, at ...
[ "def", "has_types", "(", "self", ",", "types", ",", "all_", "=", "True", ")", ":", "func", "=", "all", "if", "all_", "else", "any", "return", "func", "(", "[", "self", ".", "get_stim", "(", "t", ")", "for", "t", "in", "listify", "(", "types", ")"...
Check whether the current component list matches all Stim types in the types argument. Args: types (Stim, list): a Stim class or iterable of Stim classes. all_ (bool): if True, all input types must match; if False, at least one input type must match. Ret...
[ "Check", "whether", "the", "current", "component", "list", "matches", "all", "Stim", "types", "in", "the", "types", "argument", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/compound.py#L87-L101
5,793
tyarkoni/pliers
pliers/stimuli/audio.py
AudioStim.save
def save(self, path): ''' Save clip data to file. Args: path (str): Filename to save audio data to. ''' self.clip.write_audiofile(path, fps=self.sampling_rate)
python
def save(self, path): ''' Save clip data to file. Args: path (str): Filename to save audio data to. ''' self.clip.write_audiofile(path, fps=self.sampling_rate)
[ "def", "save", "(", "self", ",", "path", ")", ":", "self", ".", "clip", ".", "write_audiofile", "(", "path", ",", "fps", "=", "self", ".", "sampling_rate", ")" ]
Save clip data to file. Args: path (str): Filename to save audio data to.
[ "Save", "clip", "data", "to", "file", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/audio.py#L77-L83
5,794
tyarkoni/pliers
pliers/converters/base.py
get_converter
def get_converter(in_type, out_type, *args, **kwargs): ''' Scans the list of available Converters and returns an instantiation of the first one whose input and output types match those passed in. Args: in_type (type): The type of input the converter must have. out_type (type): The type of o...
python
def get_converter(in_type, out_type, *args, **kwargs): ''' Scans the list of available Converters and returns an instantiation of the first one whose input and output types match those passed in. Args: in_type (type): The type of input the converter must have. out_type (type): The type of o...
[ "def", "get_converter", "(", "in_type", ",", "out_type", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "convs", "=", "pliers", ".", "converters", ".", "__all__", "# If config includes default converters for this combination, try them", "# first", "out_type", ...
Scans the list of available Converters and returns an instantiation of the first one whose input and output types match those passed in. Args: in_type (type): The type of input the converter must have. out_type (type): The type of output the converter must have. args, kwargs: Optional p...
[ "Scans", "the", "list", "of", "available", "Converters", "and", "returns", "an", "instantiation", "of", "the", "first", "one", "whose", "input", "and", "output", "types", "match", "those", "passed", "in", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/converters/base.py#L27-L61
5,795
tyarkoni/pliers
pliers/external/tensorflow/classify_image.py
create_graph
def create_graph(): """Creates a graph from saved GraphDef file and returns a saver.""" # Creates graph from saved graph_def.pb. with tf.gfile.FastGFile(os.path.join( FLAGS.model_dir, 'classify_image_graph_def.pb'), 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) _ = tf...
python
def create_graph(): """Creates a graph from saved GraphDef file and returns a saver.""" # Creates graph from saved graph_def.pb. with tf.gfile.FastGFile(os.path.join( FLAGS.model_dir, 'classify_image_graph_def.pb'), 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) _ = tf...
[ "def", "create_graph", "(", ")", ":", "# Creates graph from saved graph_def.pb.", "with", "tf", ".", "gfile", ".", "FastGFile", "(", "os", ".", "path", ".", "join", "(", "FLAGS", ".", "model_dir", ",", "'classify_image_graph_def.pb'", ")", ",", "'rb'", ")", "a...
Creates a graph from saved GraphDef file and returns a saver.
[ "Creates", "a", "graph", "from", "saved", "GraphDef", "file", "and", "returns", "a", "saver", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/external/tensorflow/classify_image.py#L120-L127
5,796
tyarkoni/pliers
pliers/external/tensorflow/classify_image.py
run_inference_on_image
def run_inference_on_image(image): """Runs inference on an image. Args: image: Image file name. Returns: Nothing """ if not tf.gfile.Exists(image): tf.logging.fatal('File does not exist %s', image) image_data = tf.gfile.FastGFile(image, 'rb').read() # Creates graph from saved GraphDef. cr...
python
def run_inference_on_image(image): """Runs inference on an image. Args: image: Image file name. Returns: Nothing """ if not tf.gfile.Exists(image): tf.logging.fatal('File does not exist %s', image) image_data = tf.gfile.FastGFile(image, 'rb').read() # Creates graph from saved GraphDef. cr...
[ "def", "run_inference_on_image", "(", "image", ")", ":", "if", "not", "tf", ".", "gfile", ".", "Exists", "(", "image", ")", ":", "tf", ".", "logging", ".", "fatal", "(", "'File does not exist %s'", ",", "image", ")", "image_data", "=", "tf", ".", "gfile"...
Runs inference on an image. Args: image: Image file name. Returns: Nothing
[ "Runs", "inference", "on", "an", "image", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/external/tensorflow/classify_image.py#L130-L167
5,797
tyarkoni/pliers
pliers/external/tensorflow/classify_image.py
NodeLookup.load
def load(self, label_lookup_path, uid_lookup_path): """Loads a human readable English name for each softmax node. Args: label_lookup_path: string UID to integer node ID. uid_lookup_path: string UID to human-readable string. Returns: dict from integer node ID to human-readable string. ...
python
def load(self, label_lookup_path, uid_lookup_path): """Loads a human readable English name for each softmax node. Args: label_lookup_path: string UID to integer node ID. uid_lookup_path: string UID to human-readable string. Returns: dict from integer node ID to human-readable string. ...
[ "def", "load", "(", "self", ",", "label_lookup_path", ",", "uid_lookup_path", ")", ":", "if", "not", "tf", ".", "gfile", ".", "Exists", "(", "uid_lookup_path", ")", ":", "tf", ".", "logging", ".", "fatal", "(", "'File does not exist %s'", ",", "uid_lookup_pa...
Loads a human readable English name for each softmax node. Args: label_lookup_path: string UID to integer node ID. uid_lookup_path: string UID to human-readable string. Returns: dict from integer node ID to human-readable string.
[ "Loads", "a", "human", "readable", "English", "name", "for", "each", "softmax", "node", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/external/tensorflow/classify_image.py#L69-L112
5,798
tyarkoni/pliers
pliers/datasets/text.py
fetch_dictionary
def fetch_dictionary(name, url=None, format=None, index=0, rename=None, save=True, force_retrieve=False): ''' Retrieve a dictionary of text norms from the web or local storage. Args: name (str): The name of the dictionary. If no url is passed, this must match either one...
python
def fetch_dictionary(name, url=None, format=None, index=0, rename=None, save=True, force_retrieve=False): ''' Retrieve a dictionary of text norms from the web or local storage. Args: name (str): The name of the dictionary. If no url is passed, this must match either one...
[ "def", "fetch_dictionary", "(", "name", ",", "url", "=", "None", ",", "format", "=", "None", ",", "index", "=", "0", ",", "rename", "=", "None", ",", "save", "=", "True", ",", "force_retrieve", "=", "False", ")", ":", "file_path", "=", "os", ".", "...
Retrieve a dictionary of text norms from the web or local storage. Args: name (str): The name of the dictionary. If no url is passed, this must match either one of the keys in the predefined dictionary file (see dictionaries.json), or the name assigned to a previous dictionary ...
[ "Retrieve", "a", "dictionary", "of", "text", "norms", "from", "the", "web", "or", "local", "storage", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/datasets/text.py#L57-L111
5,799
tyarkoni/pliers
pliers/extractors/api/google.py
GoogleVisionAPIFaceExtractor._to_df
def _to_df(self, result, handle_annotations=None): ''' Converts a Google API Face JSON response into a Pandas Dataframe. Args: result (ExtractorResult): Result object from which to parse out a Dataframe. handle_annotations (str): How returned face annotat...
python
def _to_df(self, result, handle_annotations=None): ''' Converts a Google API Face JSON response into a Pandas Dataframe. Args: result (ExtractorResult): Result object from which to parse out a Dataframe. handle_annotations (str): How returned face annotat...
[ "def", "_to_df", "(", "self", ",", "result", ",", "handle_annotations", "=", "None", ")", ":", "annotations", "=", "result", ".", "_data", "if", "handle_annotations", "==", "'first'", ":", "annotations", "=", "[", "annotations", "[", "0", "]", "]", "face_r...
Converts a Google API Face JSON response into a Pandas Dataframe. Args: result (ExtractorResult): Result object from which to parse out a Dataframe. handle_annotations (str): How returned face annotations should be handled in cases where there are multipl...
[ "Converts", "a", "Google", "API", "Face", "JSON", "response", "into", "a", "Pandas", "Dataframe", "." ]
5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b
https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/extractors/api/google.py#L50-L89