repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L239-L244
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L272-L277
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L295-L309
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L311-L362
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L364-L379
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L390-L395
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L398-L403
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L406-L411
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L414-L419
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L435-L440
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L450-L455
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L466-L471
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L474-L481
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L484-L493
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L496-L505
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L508-L513
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L516-L521
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L524-L534
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L537-L542
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L545-L550
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L553-L561
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L564-L572
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L575-L581
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L584-L589
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L592-L597
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.start_address
def start_address(self, _start_address): """Store the new start address attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_start_address(self._ptr, _start_address)
python
def start_address(self, _start_address): """Store the new start address attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_start_address(self._ptr, _start_address)
[ "def", "start_address", "(", "self", ",", "_start_address", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "set_start_address", "(", "self", ".", "_ptr", ",", "_start_addres...
Store the new start address attribute of the BFD file being processed.
[ "Store", "the", "new", "start", "address", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L600-L608
Groundworkstech/pybfd
pybfd/bfd.py
Bfd.gp_size
def gp_size(self, _gp_size): """Store the new start address attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_gp_size(self._ptr, _gp_size)
python
def gp_size(self, _gp_size): """Store the new start address attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_gp_size(self._ptr, _gp_size)
[ "def", "gp_size", "(", "self", ",", "_gp_size", ")", ":", "if", "not", "self", ".", "_ptr", ":", "raise", "BfdException", "(", "\"BFD not initialized\"", ")", "return", "_bfd", ".", "set_gp_size", "(", "self", ".", "_ptr", ",", "_gp_size", ")" ]
Store the new start address attribute of the BFD file being processed.
[ "Store", "the", "new", "start", "address", "attribute", "of", "the", "BFD", "file", "being", "processed", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L619-L627
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L630-L635
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L638-L643
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L646-L656
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L659-L668
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L671-L680
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", "." ]
train
https://github.com/Groundworkstech/pybfd/blob/9e722435929b4ad52212043a6f1e9e9ce60b5d72/pybfd/bfd.py#L697-L705
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", "." ]
train
https://github.com/getsenic/nuimo-linux-python/blob/1918e6e51ad6569eb134904e891122479fafa2d6/nuimo/nuimo.py#L208-L224
secynic/ipwhois
ipwhois/net.py
Net.lookup_asn
def lookup_asn(self, *args, **kwargs): """ Temporary wrapper for IP ASN lookups (moved to asn.IPASN.lookup()). This will be removed in a future release. """ from warnings import warn warn('Net.lookup_asn() has been deprecated and will be removed. ' '...
python
def lookup_asn(self, *args, **kwargs): """ Temporary wrapper for IP ASN lookups (moved to asn.IPASN.lookup()). This will be removed in a future release. """ from warnings import warn warn('Net.lookup_asn() has been deprecated and will be removed. ' '...
[ "def", "lookup_asn", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'Net.lookup_asn() has been deprecated and will be removed. '", "'You should now use asn.IPASN.lookup() for IP ASN lookups.'", ")", "f...
Temporary wrapper for IP ASN lookups (moved to asn.IPASN.lookup()). This will be removed in a future release.
[ "Temporary", "wrapper", "for", "IP", "ASN", "lookups", "(", "moved", "to", "asn", ".", "IPASN", ".", "lookup", "()", ")", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L222-L235
secynic/ipwhois
ipwhois/net.py
Net.get_asn_dns
def get_asn_dns(self): """ The function for retrieving ASN information for an IP address from Cymru via port 53 (DNS). Returns: list: The raw ASN data. Raises: ASNLookupError: The ASN lookup failed. """ try: log.debug('ASN q...
python
def get_asn_dns(self): """ The function for retrieving ASN information for an IP address from Cymru via port 53 (DNS). Returns: list: The raw ASN data. Raises: ASNLookupError: The ASN lookup failed. """ try: log.debug('ASN q...
[ "def", "get_asn_dns", "(", "self", ")", ":", "try", ":", "log", ".", "debug", "(", "'ASN query for {0}'", ".", "format", "(", "self", ".", "dns_zone", ")", ")", "data", "=", "self", ".", "dns_resolver", ".", "query", "(", "self", ".", "dns_zone", ",", ...
The function for retrieving ASN information for an IP address from Cymru via port 53 (DNS). Returns: list: The raw ASN data. Raises: ASNLookupError: The ASN lookup failed.
[ "The", "function", "for", "retrieving", "ASN", "information", "for", "an", "IP", "address", "from", "Cymru", "via", "port", "53", "(", "DNS", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L237-L267
secynic/ipwhois
ipwhois/net.py
Net.get_asn_verbose_dns
def get_asn_verbose_dns(self, asn=None): """ The function for retrieving the information for an ASN from Cymru via port 53 (DNS). This is needed since IP to ASN mapping via Cymru DNS does not return the ASN Description like Cymru Whois does. Args: asn (:obj:`str`): T...
python
def get_asn_verbose_dns(self, asn=None): """ The function for retrieving the information for an ASN from Cymru via port 53 (DNS). This is needed since IP to ASN mapping via Cymru DNS does not return the ASN Description like Cymru Whois does. Args: asn (:obj:`str`): T...
[ "def", "get_asn_verbose_dns", "(", "self", ",", "asn", "=", "None", ")", ":", "if", "asn", "[", "0", ":", "2", "]", "!=", "'AS'", ":", "asn", "=", "'AS{0}'", ".", "format", "(", "asn", ")", "zone", "=", "'{0}.asn.cymru.com'", ".", "format", "(", "a...
The function for retrieving the information for an ASN from Cymru via port 53 (DNS). This is needed since IP to ASN mapping via Cymru DNS does not return the ASN Description like Cymru Whois does. Args: asn (:obj:`str`): The AS number (required). Returns: str: T...
[ "The", "function", "for", "retrieving", "the", "information", "for", "an", "ASN", "from", "Cymru", "via", "port", "53", "(", "DNS", ")", ".", "This", "is", "needed", "since", "IP", "to", "ASN", "mapping", "via", "Cymru", "DNS", "does", "not", "return", ...
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L269-L309
secynic/ipwhois
ipwhois/net.py
Net.get_asn_whois
def get_asn_whois(self, retry_count=3): """ The function for retrieving ASN information for an IP address from Cymru via port 43/tcp (WHOIS). Args: retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc....
python
def get_asn_whois(self, retry_count=3): """ The function for retrieving ASN information for an IP address from Cymru via port 43/tcp (WHOIS). Args: retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc....
[ "def", "get_asn_whois", "(", "self", ",", "retry_count", "=", "3", ")", ":", "try", ":", "# Create the connection for the Cymru whois query.", "conn", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_STREAM", ")", "conn", ...
The function for retrieving ASN information for an IP address from Cymru via port 43/tcp (WHOIS). Args: retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, etc. are encountered. Defaults to 3. Re...
[ "The", "function", "for", "retrieving", "ASN", "information", "for", "an", "IP", "address", "from", "Cymru", "via", "port", "43", "/", "tcp", "(", "WHOIS", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L311-L375
secynic/ipwhois
ipwhois/net.py
Net.get_asn_http
def get_asn_http(self, retry_count=3): """ The function for retrieving ASN information for an IP address from Arin via port 80 (HTTP). Currently limited to fetching asn_registry through a Arin whois (REST) lookup. The other values are returned as None to keep a consistent dict ou...
python
def get_asn_http(self, retry_count=3): """ The function for retrieving ASN information for an IP address from Arin via port 80 (HTTP). Currently limited to fetching asn_registry through a Arin whois (REST) lookup. The other values are returned as None to keep a consistent dict ou...
[ "def", "get_asn_http", "(", "self", ",", "retry_count", "=", "3", ")", ":", "try", ":", "# Lets attempt to get the ASN registry information from", "# ARIN.", "log", ".", "debug", "(", "'ASN query for {0}'", ".", "format", "(", "self", ".", "address_str", ")", ")",...
The function for retrieving ASN information for an IP address from Arin via port 80 (HTTP). Currently limited to fetching asn_registry through a Arin whois (REST) lookup. The other values are returned as None to keep a consistent dict output. This should be used as a last chance fallback...
[ "The", "function", "for", "retrieving", "ASN", "information", "for", "an", "IP", "address", "from", "Arin", "via", "port", "80", "(", "HTTP", ")", ".", "Currently", "limited", "to", "fetching", "asn_registry", "through", "a", "Arin", "whois", "(", "REST", ...
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L377-L429
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L431-L541
secynic/ipwhois
ipwhois/net.py
Net.get_whois
def get_whois(self, asn_registry='arin', retry_count=3, server=None, port=43, extra_blacklist=None): """ The function for retrieving whois or rwhois information for an IP address via any port. Defaults to port 43/tcp (WHOIS). Args: asn_registry (:obj:`str`)...
python
def get_whois(self, asn_registry='arin', retry_count=3, server=None, port=43, extra_blacklist=None): """ The function for retrieving whois or rwhois information for an IP address via any port. Defaults to port 43/tcp (WHOIS). Args: asn_registry (:obj:`str`)...
[ "def", "get_whois", "(", "self", ",", "asn_registry", "=", "'arin'", ",", "retry_count", "=", "3", ",", "server", "=", "None", ",", "port", "=", "43", ",", "extra_blacklist", "=", "None", ")", ":", "try", ":", "extra_bl", "=", "extra_blacklist", "if", ...
The function for retrieving whois or rwhois information for an IP address via any port. Defaults to port 43/tcp (WHOIS). Args: asn_registry (:obj:`str`): The NIC to run the query against. Defaults to 'arin'. retry_count (:obj:`int`): The number of times to retry ...
[ "The", "function", "for", "retrieving", "whois", "or", "rwhois", "information", "for", "an", "IP", "address", "via", "any", "port", ".", "Defaults", "to", "port", "43", "/", "tcp", "(", "WHOIS", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L543-L670
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L672-L793
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L795-L855
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/net.py#L857-L936
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L313-L350
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L406-L426
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L428-L446
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L448-L487
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L489-L532
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L534-L628
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L630-L673
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L675-L760
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L762-L840
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.generate_output_objects
def generate_output_objects(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP object results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`boo...
python
def generate_output_objects(self, json_data=None, hr=True, show_name=False, colorize=True): """ The function for generating CLI output RDAP object results. Args: json_data (:obj:`dict`): The data to process. Defaults to None. hr (:obj:`boo...
[ "def", "generate_output_objects", "(", "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 object 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", "object", "results", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L842-L1018
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.lookup_rdap
def lookup_rdap(self, hr=True, show_name=False, colorize=True, **kwargs): """ The function for wrapping IPWhois.lookup_rdap() and generating formatted CLI output. Args: hr (:obj:`bool`): Enable human readable key translations. Defaults to True. sh...
python
def lookup_rdap(self, hr=True, show_name=False, colorize=True, **kwargs): """ The function for wrapping IPWhois.lookup_rdap() and generating formatted CLI output. Args: hr (:obj:`bool`): Enable human readable key translations. Defaults to True. sh...
[ "def", "lookup_rdap", "(", "self", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ",", "*", "*", "kwargs", ")", ":", "# Perform the RDAP lookup", "ret", "=", "self", ".", "obj", ".", "lookup_rdap", "(", "*", "*", ...
The function for wrapping IPWhois.lookup_rdap() and generating formatted CLI output. Args: hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readable name (default is to only show short...
[ "The", "function", "for", "wrapping", "IPWhois", ".", "lookup_rdap", "()", "and", "generating", "formatted", "CLI", "output", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L1020-L1083
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L1085-L1164
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L1234-L1368
secynic/ipwhois
ipwhois/scripts/ipwhois_cli.py
IPWhoisCLI.lookup_whois
def lookup_whois(self, hr=True, show_name=False, colorize=True, **kwargs): """ The function for wrapping IPWhois.lookup_whois() and generating formatted CLI output. Args: hr (:obj:`bool`): Enable human readable key translations. Defaults to True. ...
python
def lookup_whois(self, hr=True, show_name=False, colorize=True, **kwargs): """ The function for wrapping IPWhois.lookup_whois() and generating formatted CLI output. Args: hr (:obj:`bool`): Enable human readable key translations. Defaults to True. ...
[ "def", "lookup_whois", "(", "self", ",", "hr", "=", "True", ",", "show_name", "=", "False", ",", "colorize", "=", "True", ",", "*", "*", "kwargs", ")", ":", "# Perform the RDAP lookup", "ret", "=", "self", ".", "obj", ".", "lookup_whois", "(", "*", "*"...
The function for wrapping IPWhois.lookup_whois() and generating formatted CLI output. Args: hr (:obj:`bool`): Enable human readable key translations. Defaults to True. show_name (:obj:`bool`): Show human readable name (default is to only show shor...
[ "The", "function", "for", "wrapping", "IPWhois", ".", "lookup_whois", "()", "and", "generating", "formatted", "CLI", "output", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/scripts/ipwhois_cli.py#L1370-L1427
secynic/ipwhois
ipwhois/asn.py
IPASN._parse_fields_dns
def _parse_fields_dns(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('IPASN._parse_fields_dns() has been deprecated and will be ' 'removed. You should now use IPASN.parse_fields_dns().') r...
python
def _parse_fields_dns(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('IPASN._parse_fields_dns() has been deprecated and will be ' 'removed. You should now use IPASN.parse_fields_dns().') r...
[ "def", "_parse_fields_dns", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'IPASN._parse_fields_dns() has been deprecated and will be '", "'removed. You should now use IPASN.parse_fields_dns().'", ")", ...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L172-L180
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L239-L294
secynic/ipwhois
ipwhois/asn.py
IPASN._parse_fields_whois
def _parse_fields_whois(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('IPASN._parse_fields_whois() has been deprecated and will be ' 'removed. You should now use IPASN.parse_fields_whois().') ...
python
def _parse_fields_whois(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('IPASN._parse_fields_whois() has been deprecated and will be ' 'removed. You should now use IPASN.parse_fields_whois().') ...
[ "def", "_parse_fields_whois", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'IPASN._parse_fields_whois() has been deprecated and will be '", "'removed. You should now use IPASN.parse_fields_whois().'", ...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L296-L304
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L306-L404
secynic/ipwhois
ipwhois/asn.py
IPASN._parse_fields_http
def _parse_fields_http(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('IPASN._parse_fields_http() has been deprecated and will be ' 'removed. You should now use IPASN.parse_fields_http().') ...
python
def _parse_fields_http(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('IPASN._parse_fields_http() has been deprecated and will be ' 'removed. You should now use IPASN.parse_fields_http().') ...
[ "def", "_parse_fields_http", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'IPASN._parse_fields_http() has been deprecated and will be '", "'removed. You should now use IPASN.parse_fields_http().'", ")"...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L406-L414
secynic/ipwhois
ipwhois/asn.py
IPASN.lookup
def lookup(self, inc_raw=False, retry_count=3, asn_alts=None, extra_org_map=None, asn_methods=None, get_asn_description=True): """ The wrapper function for retrieving and parsing ASN information for an IP address. Args: inc_raw (:obj:`bool`): Wh...
python
def lookup(self, inc_raw=False, retry_count=3, asn_alts=None, extra_org_map=None, asn_methods=None, get_asn_description=True): """ The wrapper function for retrieving and parsing ASN information for an IP address. Args: inc_raw (:obj:`bool`): Wh...
[ "def", "lookup", "(", "self", ",", "inc_raw", "=", "False", ",", "retry_count", "=", "3", ",", "asn_alts", "=", "None", ",", "extra_org_map", "=", "None", ",", "asn_methods", "=", "None", ",", "get_asn_description", "=", "True", ")", ":", "if", "asn_meth...
The wrapper function for retrieving and parsing ASN information for an IP address. Args: inc_raw (:obj:`bool`): Whether to include the raw results in the returned dictionary. Defaults to False. retry_count (:obj:`int`): The number of times to retry in case ...
[ "The", "wrapper", "function", "for", "retrieving", "and", "parsing", "ASN", "information", "for", "an", "IP", "address", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L416-L596
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L719-L770
secynic/ipwhois
ipwhois/asn.py
ASNOrigin._get_nets_radb
def _get_nets_radb(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('ASNOrigin._get_nets_radb() has been deprecated and will be ' 'removed. You should now use ASNOrigin.get_nets_radb().') re...
python
def _get_nets_radb(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('ASNOrigin._get_nets_radb() has been deprecated and will be ' 'removed. You should now use ASNOrigin.get_nets_radb().') re...
[ "def", "_get_nets_radb", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'ASNOrigin._get_nets_radb() has been deprecated and will be '", "'removed. You should now use ASNOrigin.get_nets_radb().'", ")", ...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L772-L780
secynic/ipwhois
ipwhois/asn.py
ASNOrigin.lookup
def lookup(self, asn=None, inc_raw=False, retry_count=3, response=None, field_list=None, asn_alts=None, asn_methods=None): """ The function for retrieving and parsing ASN origin whois information via port 43/tcp (WHOIS). Args: asn (:obj:`str`): The ASN (requir...
python
def lookup(self, asn=None, inc_raw=False, retry_count=3, response=None, field_list=None, asn_alts=None, asn_methods=None): """ The function for retrieving and parsing ASN origin whois information via port 43/tcp (WHOIS). Args: asn (:obj:`str`): The ASN (requir...
[ "def", "lookup", "(", "self", ",", "asn", "=", "None", ",", "inc_raw", "=", "False", ",", "retry_count", "=", "3", ",", "response", "=", "None", ",", "field_list", "=", "None", ",", "asn_alts", "=", "None", ",", "asn_methods", "=", "None", ")", ":", ...
The function for retrieving and parsing ASN origin whois information via port 43/tcp (WHOIS). Args: asn (:obj:`str`): The ASN (required). inc_raw (:obj:`bool`): Whether to include the raw results in the returned dictionary. Defaults to False. retry_co...
[ "The", "function", "for", "retrieving", "and", "parsing", "ASN", "origin", "whois", "information", "via", "port", "43", "/", "tcp", "(", "WHOIS", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/asn.py#L782-L956
secynic/ipwhois
ipwhois/nir.py
NIRWhois.parse_fields
def parse_fields(self, response, fields_dict, net_start=None, net_end=None, dt_format=None, field_list=None, hourdelta=0, is_contact=False): """ The function for parsing whois fields from a data input. Args: response (:obj:`str`): The respon...
python
def parse_fields(self, response, fields_dict, net_start=None, net_end=None, dt_format=None, field_list=None, hourdelta=0, is_contact=False): """ The function for parsing whois fields from a data input. Args: response (:obj:`str`): The respon...
[ "def", "parse_fields", "(", "self", ",", "response", ",", "fields_dict", ",", "net_start", "=", "None", ",", "net_end", "=", "None", ",", "dt_format", "=", "None", ",", "field_list", "=", "None", ",", "hourdelta", "=", "0", ",", "is_contact", "=", "False...
The function for parsing whois fields from a data input. Args: response (:obj:`str`): The response from the whois/rwhois server. fields_dict (:obj:`dict`): The mapping of fields to regex search values (required). net_start (:obj:`int`): The starting point of ...
[ "The", "function", "for", "parsing", "whois", "fields", "from", "a", "data", "input", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L169-L287
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L299-L360
secynic/ipwhois
ipwhois/nir.py
NIRWhois._get_nets_jpnic
def _get_nets_jpnic(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('NIRWhois._get_nets_jpnic() has been deprecated and will be ' 'removed. You should now use NIRWhois.get_nets_jpnic().') r...
python
def _get_nets_jpnic(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('NIRWhois._get_nets_jpnic() has been deprecated and will be ' 'removed. You should now use NIRWhois.get_nets_jpnic().') r...
[ "def", "_get_nets_jpnic", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'NIRWhois._get_nets_jpnic() has been deprecated and will be '", "'removed. You should now use NIRWhois.get_nets_jpnic().'", ")", ...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L362-L370
secynic/ipwhois
ipwhois/nir.py
NIRWhois._get_nets_krnic
def _get_nets_krnic(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('NIRWhois._get_nets_krnic() has been deprecated and will be ' 'removed. You should now use NIRWhois.get_nets_krnic().') r...
python
def _get_nets_krnic(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('NIRWhois._get_nets_krnic() has been deprecated and will be ' 'removed. You should now use NIRWhois.get_nets_krnic().') r...
[ "def", "_get_nets_krnic", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'NIRWhois._get_nets_krnic() has been deprecated and will be '", "'removed. You should now use NIRWhois.get_nets_krnic().'", ")", ...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L437-L445
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L447-L492
secynic/ipwhois
ipwhois/nir.py
NIRWhois._get_contact
def _get_contact(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('NIRWhois._get_contact() has been deprecated and will be ' 'removed. You should now use NIRWhois.get_contact().') return sel...
python
def _get_contact(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('NIRWhois._get_contact() has been deprecated and will be ' 'removed. You should now use NIRWhois.get_contact().') return sel...
[ "def", "_get_contact", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'NIRWhois._get_contact() has been deprecated and will be '", "'removed. You should now use NIRWhois.get_contact().'", ")", "return"...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L494-L502
secynic/ipwhois
ipwhois/nir.py
NIRWhois.lookup
def lookup(self, nir=None, inc_raw=False, retry_count=3, response=None, field_list=None, is_offline=False): """ The function for retrieving and parsing NIR whois information for an IP address via HTTP (HTML scraping). Args: nir (:obj:`str`): The NIR to query (...
python
def lookup(self, nir=None, inc_raw=False, retry_count=3, response=None, field_list=None, is_offline=False): """ The function for retrieving and parsing NIR whois information for an IP address via HTTP (HTML scraping). Args: nir (:obj:`str`): The NIR to query (...
[ "def", "lookup", "(", "self", ",", "nir", "=", "None", ",", "inc_raw", "=", "False", ",", "retry_count", "=", "3", ",", "response", "=", "None", ",", "field_list", "=", "None", ",", "is_offline", "=", "False", ")", ":", "if", "nir", "not", "in", "N...
The function for retrieving and parsing NIR whois information for an IP address via HTTP (HTML scraping). Args: nir (:obj:`str`): The NIR to query ('jpnic' or 'krnic'). Required if response is None. inc_raw (:obj:`bool`, optional): Whether to include the raw ...
[ "The", "function", "for", "retrieving", "and", "parsing", "NIR", "whois", "information", "for", "an", "IP", "address", "via", "HTTP", "(", "HTML", "scraping", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/nir.py#L504-L682
secynic/ipwhois
ipwhois/experimental.py
get_bulk_asn_whois
def get_bulk_asn_whois(addresses=None, retry_count=3, timeout=120): """ The function for retrieving ASN information for multiple IP addresses from Cymru via port 43/tcp (WHOIS). Args: addresses (:obj:`list` of :obj:`str`): IP addresses to lookup. retry_count (:obj:`int`): The number of ...
python
def get_bulk_asn_whois(addresses=None, retry_count=3, timeout=120): """ The function for retrieving ASN information for multiple IP addresses from Cymru via port 43/tcp (WHOIS). Args: addresses (:obj:`list` of :obj:`str`): IP addresses to lookup. retry_count (:obj:`int`): The number of ...
[ "def", "get_bulk_asn_whois", "(", "addresses", "=", "None", ",", "retry_count", "=", "3", ",", "timeout", "=", "120", ")", ":", "if", "not", "isinstance", "(", "addresses", ",", "list", ")", ":", "raise", "ValueError", "(", "'addresses argument must be a list ...
The function for retrieving ASN information for multiple IP addresses from Cymru via port 43/tcp (WHOIS). Args: addresses (:obj:`list` of :obj:`str`): IP addresses to lookup. retry_count (:obj:`int`): The number of times to retry in case socket errors, timeouts, connection resets, e...
[ "The", "function", "for", "retrieving", "ASN", "information", "for", "multiple", "IP", "addresses", "from", "Cymru", "via", "port", "43", "/", "tcp", "(", "WHOIS", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/experimental.py#L40-L110
secynic/ipwhois
ipwhois/experimental.py
bulk_lookup_rdap
def bulk_lookup_rdap(addresses=None, inc_raw=False, retry_count=3, depth=0, excluded_entities=None, rate_limit_timeout=60, socket_timeout=10, asn_timeout=240, proxy_openers=None): """ The function for bulk retrieving and parsing whois information for a list of IP ad...
python
def bulk_lookup_rdap(addresses=None, inc_raw=False, retry_count=3, depth=0, excluded_entities=None, rate_limit_timeout=60, socket_timeout=10, asn_timeout=240, proxy_openers=None): """ The function for bulk retrieving and parsing whois information for a list of IP ad...
[ "def", "bulk_lookup_rdap", "(", "addresses", "=", "None", ",", "inc_raw", "=", "False", ",", "retry_count", "=", "3", ",", "depth", "=", "0", ",", "excluded_entities", "=", "None", ",", "rate_limit_timeout", "=", "60", ",", "socket_timeout", "=", "10", ","...
The function for bulk retrieving and parsing whois information for a list of IP addresses via HTTP (RDAP). This bulk lookup method uses bulk ASN Whois lookups first to retrieve the ASN for each IP. It then optimizes RDAP queries to achieve the fastest overall time, accounting for rate-limiting RIRs. ...
[ "The", "function", "for", "bulk", "retrieving", "and", "parsing", "whois", "information", "for", "a", "list", "of", "IP", "addresses", "via", "HTTP", "(", "RDAP", ")", ".", "This", "bulk", "lookup", "method", "uses", "bulk", "ASN", "Whois", "lookups", "fir...
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/experimental.py#L113-L457
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L112-L148
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L150-L180
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L182-L212
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L234-L258
secynic/ipwhois
ipwhois/rdap.py
_RDAPCommon.summarize_links
def summarize_links(self, links_json): """ The function for summarizing RDAP links in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.2 Args: links_json (:obj:`dict`): A json mapping of links from RDAP results. Returns: li...
python
def summarize_links(self, links_json): """ The function for summarizing RDAP links in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.2 Args: links_json (:obj:`dict`): A json mapping of links from RDAP results. Returns: li...
[ "def", "summarize_links", "(", "self", ",", "links_json", ")", ":", "ret", "=", "[", "]", "for", "link_dict", "in", "links_json", ":", "ret", ".", "append", "(", "link_dict", "[", "'href'", "]", ")", "ret", "=", "list", "(", "unique_everseen", "(", "re...
The function for summarizing RDAP links in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.2 Args: links_json (:obj:`dict`): A json mapping of links from RDAP results. Returns: list of str: Unique RDAP links.
[ "The", "function", "for", "summarizing", "RDAP", "links", "in", "to", "a", "unique", "list", ".", "https", ":", "//", "tools", ".", "ietf", ".", "org", "/", "html", "/", "rfc7483#section", "-", "4", ".", "2" ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L290-L311
secynic/ipwhois
ipwhois/rdap.py
_RDAPCommon.summarize_notices
def summarize_notices(self, notices_json): """ The function for summarizing RDAP notices in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.3 Args: notices_json (:obj:`dict`): A json mapping of notices from RDAP results. Returns: ...
python
def summarize_notices(self, notices_json): """ The function for summarizing RDAP notices in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.3 Args: notices_json (:obj:`dict`): A json mapping of notices from RDAP results. Returns: ...
[ "def", "summarize_notices", "(", "self", ",", "notices_json", ")", ":", "ret", "=", "[", "]", "for", "notices_dict", "in", "notices_json", ":", "tmp", "=", "{", "'title'", ":", "None", ",", "'description'", ":", "None", ",", "'links'", ":", "None", "}", ...
The function for summarizing RDAP notices in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.3 Args: notices_json (:obj:`dict`): A json mapping of notices from RDAP results. Returns: list of dict: Unique RDAP notices information: ...
[ "The", "function", "for", "summarizing", "RDAP", "notices", "in", "to", "a", "unique", "list", ".", "https", ":", "//", "tools", ".", "ietf", ".", "org", "/", "html", "/", "rfc7483#section", "-", "4", ".", "3" ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L313-L373
secynic/ipwhois
ipwhois/rdap.py
_RDAPCommon.summarize_events
def summarize_events(self, events_json): """ The function for summarizing RDAP events in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.5 Args: events_json (:obj:`dict`): A json mapping of events from RDAP results. Returns: ...
python
def summarize_events(self, events_json): """ The function for summarizing RDAP events in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.5 Args: events_json (:obj:`dict`): A json mapping of events from RDAP results. Returns: ...
[ "def", "summarize_events", "(", "self", ",", "events_json", ")", ":", "ret", "=", "[", "]", "for", "event", "in", "events_json", ":", "event_dict", "=", "{", "'action'", ":", "event", "[", "'eventAction'", "]", ",", "'timestamp'", ":", "event", "[", "'ev...
The function for summarizing RDAP events in to a unique list. https://tools.ietf.org/html/rfc7483#section-4.5 Args: events_json (:obj:`dict`): A json mapping of events from RDAP results. Returns: list of dict: Unique RDAP events information: ...
[ "The", "function", "for", "summarizing", "RDAP", "events", "in", "to", "a", "unique", "list", ".", "https", ":", "//", "tools", ".", "ietf", ".", "org", "/", "html", "/", "rfc7483#section", "-", "4", ".", "5" ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L375-L417
secynic/ipwhois
ipwhois/rdap.py
_RDAPCommon._parse
def _parse(self): """ The function for parsing the JSON response to the vars dictionary. """ try: self.vars['status'] = self.json['status'] except (KeyError, ValueError, TypeError): pass for v in ['remarks', 'notices']: try: ...
python
def _parse(self): """ The function for parsing the JSON response to the vars dictionary. """ try: self.vars['status'] = self.json['status'] except (KeyError, ValueError, TypeError): pass for v in ['remarks', 'notices']: try: ...
[ "def", "_parse", "(", "self", ")", ":", "try", ":", "self", ".", "vars", "[", "'status'", "]", "=", "self", ".", "json", "[", "'status'", "]", "except", "(", "KeyError", ",", "ValueError", ",", "TypeError", ")", ":", "pass", "for", "v", "in", "[", ...
The function for parsing the JSON response to the vars dictionary.
[ "The", "function", "for", "parsing", "the", "JSON", "response", "to", "the", "vars", "dictionary", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L419-L456
secynic/ipwhois
ipwhois/rdap.py
_RDAPNetwork.parse
def parse(self): """ The function for parsing the JSON response to the vars dictionary. """ try: self.vars['handle'] = self.json['handle'].strip() except (KeyError, ValueError): log.debug('Handle missing, json_output: {0}'.format(json.dumps( ...
python
def parse(self): """ The function for parsing the JSON response to the vars dictionary. """ try: self.vars['handle'] = self.json['handle'].strip() except (KeyError, ValueError): log.debug('Handle missing, json_output: {0}'.format(json.dumps( ...
[ "def", "parse", "(", "self", ")", ":", "try", ":", "self", ".", "vars", "[", "'handle'", "]", "=", "self", ".", "json", "[", "'handle'", "]", ".", "strip", "(", ")", "except", "(", "KeyError", ",", "ValueError", ")", ":", "log", ".", "debug", "("...
The function for parsing the JSON response to the vars dictionary.
[ "The", "function", "for", "parsing", "the", "JSON", "response", "to", "the", "vars", "dictionary", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L493-L568
secynic/ipwhois
ipwhois/rdap.py
_RDAPEntity.parse
def parse(self): """ The function for parsing the JSON response to the vars dictionary. """ try: self.vars['handle'] = self.json['handle'].strip() except (KeyError, ValueError, TypeError): raise InvalidEntityObject('Handle is missing for RDAP entity') ...
python
def parse(self): """ The function for parsing the JSON response to the vars dictionary. """ try: self.vars['handle'] = self.json['handle'].strip() except (KeyError, ValueError, TypeError): raise InvalidEntityObject('Handle is missing for RDAP entity') ...
[ "def", "parse", "(", "self", ")", ":", "try", ":", "self", ".", "vars", "[", "'handle'", "]", "=", "self", ".", "json", "[", "'handle'", "]", ".", "strip", "(", ")", "except", "(", "KeyError", ",", "ValueError", ",", "TypeError", ")", ":", "raise",...
The function for parsing the JSON response to the vars dictionary.
[ "The", "function", "for", "parsing", "the", "JSON", "response", "to", "the", "vars", "dictionary", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L600-L661
secynic/ipwhois
ipwhois/rdap.py
RDAP.lookup
def lookup(self, inc_raw=False, retry_count=3, asn_data=None, depth=0, excluded_entities=None, response=None, bootstrap=False, rate_limit_timeout=120): """ The function for retrieving and parsing information for an IP address via RDAP (HTTP). Args: ...
python
def lookup(self, inc_raw=False, retry_count=3, asn_data=None, depth=0, excluded_entities=None, response=None, bootstrap=False, rate_limit_timeout=120): """ The function for retrieving and parsing information for an IP address via RDAP (HTTP). Args: ...
[ "def", "lookup", "(", "self", ",", "inc_raw", "=", "False", ",", "retry_count", "=", "3", ",", "asn_data", "=", "None", ",", "depth", "=", "0", ",", "excluded_entities", "=", "None", ",", "response", "=", "None", ",", "bootstrap", "=", "False", ",", ...
The function for retrieving and parsing information for an IP address via RDAP (HTTP). Args: inc_raw (:obj:`bool`, optional): Whether to include the raw results in the returned dictionary. Defaults to False. retry_count (:obj:`int`): The number of times to retry ...
[ "The", "function", "for", "retrieving", "and", "parsing", "information", "for", "an", "IP", "address", "via", "RDAP", "(", "HTTP", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/rdap.py#L691-L898
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L117-L138
secynic/ipwhois
ipwhois/utils.py
calculate_cidr
def calculate_cidr(start_address, end_address): """ The function to calculate a CIDR range(s) from a start and end IP address. Args: start_address (:obj:`str`): The starting IP address. end_address (:obj:`str`): The ending IP address. Returns: list of str: The calculated CIDR r...
python
def calculate_cidr(start_address, end_address): """ The function to calculate a CIDR range(s) from a start and end IP address. Args: start_address (:obj:`str`): The starting IP address. end_address (:obj:`str`): The ending IP address. Returns: list of str: The calculated CIDR r...
[ "def", "calculate_cidr", "(", "start_address", ",", "end_address", ")", ":", "tmp_addrs", "=", "[", "]", "try", ":", "tmp_addrs", ".", "extend", "(", "summarize_address_range", "(", "ip_address", "(", "start_address", ")", ",", "ip_address", "(", "end_address", ...
The function to calculate a CIDR range(s) from a start and end IP address. Args: start_address (:obj:`str`): The starting IP address. end_address (:obj:`str`): The ending IP address. Returns: list of str: The calculated CIDR ranges.
[ "The", "function", "to", "calculate", "a", "CIDR", "range", "(", "s", ")", "from", "a", "start", "and", "end", "IP", "address", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L141-L175
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L178-L261
secynic/ipwhois
ipwhois/utils.py
ipv4_is_defined
def ipv4_is_defined(address): """ The function for checking if an IPv4 address is defined (does not need to be resolved). Args: address (:obj:`str`): An IPv4 address. Returns: namedtuple: :is_defined (bool): True if given address is defined, otherwise False ...
python
def ipv4_is_defined(address): """ The function for checking if an IPv4 address is defined (does not need to be resolved). Args: address (:obj:`str`): An IPv4 address. Returns: namedtuple: :is_defined (bool): True if given address is defined, otherwise False ...
[ "def", "ipv4_is_defined", "(", "address", ")", ":", "# Initialize the IP address object.", "query_ip", "=", "IPv4Address", "(", "str", "(", "address", ")", ")", "# Initialize the results named tuple", "results", "=", "namedtuple", "(", "'ipv4_is_defined_results'", ",", ...
The function for checking if an IPv4 address is defined (does not need to be resolved). Args: address (:obj:`str`): An IPv4 address. Returns: namedtuple: :is_defined (bool): True if given address is defined, otherwise False :ietf_name (str): IETF assignment nam...
[ "The", "function", "for", "checking", "if", "an", "IPv4", "address", "is", "defined", "(", "does", "not", "need", "to", "be", "resolved", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L264-L358
secynic/ipwhois
ipwhois/utils.py
ipv6_is_defined
def ipv6_is_defined(address): """ The function for checking if an IPv6 address is defined (does not need to be resolved). Args: address (:obj:`str`): An IPv6 address. Returns: namedtuple: :is_defined (bool): True if given address is defined, otherwise False ...
python
def ipv6_is_defined(address): """ The function for checking if an IPv6 address is defined (does not need to be resolved). Args: address (:obj:`str`): An IPv6 address. Returns: namedtuple: :is_defined (bool): True if given address is defined, otherwise False ...
[ "def", "ipv6_is_defined", "(", "address", ")", ":", "# Initialize the IP address object.", "query_ip", "=", "IPv6Address", "(", "str", "(", "address", ")", ")", "# Initialize the results named tuple", "results", "=", "namedtuple", "(", "'ipv6_is_defined_results'", ",", ...
The function for checking if an IPv6 address is defined (does not need to be resolved). Args: address (:obj:`str`): An IPv6 address. Returns: namedtuple: :is_defined (bool): True if given address is defined, otherwise False :ietf_name (str): IETF assignment nam...
[ "The", "function", "for", "checking", "if", "an", "IPv6", "address", "is", "defined", "(", "does", "not", "need", "to", "be", "resolved", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L361-L421
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L424-L457
secynic/ipwhois
ipwhois/utils.py
unique_addresses
def unique_addresses(data=None, file_path=None): """ The function to search an input string and/or file, extracting and counting IPv4/IPv6 addresses/networks. Summarizes ports with sub-counts. If both a string and file_path are provided, it will process them both. Args: data (:obj:`str`): T...
python
def unique_addresses(data=None, file_path=None): """ The function to search an input string and/or file, extracting and counting IPv4/IPv6 addresses/networks. Summarizes ports with sub-counts. If both a string and file_path are provided, it will process them both. Args: data (:obj:`str`): T...
[ "def", "unique_addresses", "(", "data", "=", "None", ",", "file_path", "=", "None", ")", ":", "if", "not", "data", "and", "not", "file_path", ":", "raise", "ValueError", "(", "'No data or file path provided.'", ")", "ret", "=", "{", "}", "base", "=", "{", ...
The function to search an input string and/or file, extracting and counting IPv4/IPv6 addresses/networks. Summarizes ports with sub-counts. If both a string and file_path are provided, it will process them both. Args: data (:obj:`str`): The data to process. file_path (:obj:`str`): An option...
[ "The", "function", "to", "search", "an", "input", "string", "and", "/", "or", "file", "extracting", "and", "counting", "IPv4", "/", "IPv6", "addresses", "/", "networks", ".", "Summarizes", "ports", "with", "sub", "-", "counts", ".", "If", "both", "a", "s...
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L460-L581
secynic/ipwhois
ipwhois/utils.py
ipv4_generate_random
def ipv4_generate_random(total=100): """ The generator to produce random, unique IPv4 addresses that are not defined (can be looked up using ipwhois). Args: total (:obj:`int`): The total number of IPv4 addresses to generate. Yields: str: The next IPv4 address. """ count = ...
python
def ipv4_generate_random(total=100): """ The generator to produce random, unique IPv4 addresses that are not defined (can be looked up using ipwhois). Args: total (:obj:`int`): The total number of IPv4 addresses to generate. Yields: str: The next IPv4 address. """ count = ...
[ "def", "ipv4_generate_random", "(", "total", "=", "100", ")", ":", "count", "=", "0", "yielded", "=", "set", "(", ")", "while", "count", "<", "total", ":", "address", "=", "str", "(", "IPv4Address", "(", "random", ".", "randint", "(", "0", ",", "2", ...
The generator to produce random, unique IPv4 addresses that are not defined (can be looked up using ipwhois). Args: total (:obj:`int`): The total number of IPv4 addresses to generate. Yields: str: The next IPv4 address.
[ "The", "generator", "to", "produce", "random", "unique", "IPv4", "addresses", "that", "are", "not", "defined", "(", "can", "be", "looked", "up", "using", "ipwhois", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L584-L606
secynic/ipwhois
ipwhois/utils.py
ipv6_generate_random
def ipv6_generate_random(total=100): """ The generator to produce random, unique IPv6 addresses that are not defined (can be looked up using ipwhois). Args: total (:obj:`int`): The total number of IPv6 addresses to generate. Yields: str: The next IPv6 address. """ count = ...
python
def ipv6_generate_random(total=100): """ The generator to produce random, unique IPv6 addresses that are not defined (can be looked up using ipwhois). Args: total (:obj:`int`): The total number of IPv6 addresses to generate. Yields: str: The next IPv6 address. """ count = ...
[ "def", "ipv6_generate_random", "(", "total", "=", "100", ")", ":", "count", "=", "0", "yielded", "=", "set", "(", ")", "while", "count", "<", "total", ":", "address", "=", "str", "(", "IPv6Address", "(", "random", ".", "randint", "(", "0", ",", "2", ...
The generator to produce random, unique IPv6 addresses that are not defined (can be looked up using ipwhois). Args: total (:obj:`int`): The total number of IPv6 addresses to generate. Yields: str: The next IPv6 address.
[ "The", "generator", "to", "produce", "random", "unique", "IPv6", "addresses", "that", "are", "not", "defined", "(", "can", "be", "looked", "up", "using", "ipwhois", ")", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/utils.py#L609-L631
secynic/ipwhois
ipwhois/whois.py
Whois.parse_fields
def parse_fields(self, response, fields_dict, net_start=None, net_end=None, dt_format=None, field_list=None): """ The function for parsing whois fields from a data input. Args: response (:obj:`str`): The response from the whois/rwhois server. fields_...
python
def parse_fields(self, response, fields_dict, net_start=None, net_end=None, dt_format=None, field_list=None): """ The function for parsing whois fields from a data input. Args: response (:obj:`str`): The response from the whois/rwhois server. fields_...
[ "def", "parse_fields", "(", "self", ",", "response", ",", "fields_dict", ",", "net_start", "=", "None", ",", "net_end", "=", "None", ",", "dt_format", "=", "None", ",", "field_list", "=", "None", ")", ":", "ret", "=", "{", "}", "if", "not", "field_list...
The function for parsing whois fields from a data input. Args: response (:obj:`str`): The response from the whois/rwhois server. fields_dict (:obj:`dict`): The mapping of fields to regex search values (required). net_start (:obj:`int`): The starting point of ...
[ "The", "function", "for", "parsing", "whois", "fields", "from", "a", "data", "input", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L212-L325
secynic/ipwhois
ipwhois/whois.py
Whois._parse_fields
def _parse_fields(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('Whois._parse_fields() has been deprecated and will be ' 'removed. You should now use Whois.parse_fields().') return self.p...
python
def _parse_fields(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('Whois._parse_fields() has been deprecated and will be ' 'removed. You should now use Whois.parse_fields().') return self.p...
[ "def", "_parse_fields", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'Whois._parse_fields() has been deprecated and will be '", "'removed. You should now use Whois.parse_fields().'", ")", "return", ...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L327-L335
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", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L337-L416
secynic/ipwhois
ipwhois/whois.py
Whois._get_nets_arin
def _get_nets_arin(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('Whois._get_nets_arin() has been deprecated and will be ' 'removed. You should now use Whois.get_nets_arin().') return sel...
python
def _get_nets_arin(self, *args, **kwargs): """ Deprecated. This will be removed in a future release. """ from warnings import warn warn('Whois._get_nets_arin() has been deprecated and will be ' 'removed. You should now use Whois.get_nets_arin().') return sel...
[ "def", "_get_nets_arin", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'Whois._get_nets_arin() has been deprecated and will be '", "'removed. You should now use Whois.get_nets_arin().'", ")", "return"...
Deprecated. This will be removed in a future release.
[ "Deprecated", ".", "This", "will", "be", "removed", "in", "a", "future", "release", "." ]
train
https://github.com/secynic/ipwhois/blob/b5d634d36b0b942d538d38d77b3bdcd815f155a0/ipwhois/whois.py#L418-L426