id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
5,400
datajoint/datajoint-python
datajoint/blob.py
BlobReader.read_string
def read_string(self, advance=True): """ Read a string terminated by null byte '\0'. The returned string object is ASCII decoded, and will not include the terminating null byte. """ target = self._blob.find(b'\0', self.pos) assert target >= self._pos data = self._...
python
def read_string(self, advance=True): """ Read a string terminated by null byte '\0'. The returned string object is ASCII decoded, and will not include the terminating null byte. """ target = self._blob.find(b'\0', self.pos) assert target >= self._pos data = self._...
[ "def", "read_string", "(", "self", ",", "advance", "=", "True", ")", ":", "target", "=", "self", ".", "_blob", ".", "find", "(", "b'\\0'", ",", "self", ".", "pos", ")", "assert", "target", ">=", "self", ".", "_pos", "data", "=", "self", ".", "_blob...
Read a string terminated by null byte '\0'. The returned string object is ASCII decoded, and will not include the terminating null byte.
[ "Read", "a", "string", "terminated", "by", "null", "byte", "\\", "0", ".", "The", "returned", "string", "object", "is", "ASCII", "decoded", "and", "will", "not", "include", "the", "terminating", "null", "byte", "." ]
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/blob.py#L180-L190
5,401
datajoint/datajoint-python
datajoint/blob.py
BlobReader.read_value
def read_value(self, dtype='uint64', count=1, advance=True): """ Read one or more scalars of the indicated dtype. Count specifies the number of scalars to be read in. """ data = np.frombuffer(self._blob, dtype=dtype, count=count, offset=self.pos) if advance: #...
python
def read_value(self, dtype='uint64', count=1, advance=True): """ Read one or more scalars of the indicated dtype. Count specifies the number of scalars to be read in. """ data = np.frombuffer(self._blob, dtype=dtype, count=count, offset=self.pos) if advance: #...
[ "def", "read_value", "(", "self", ",", "dtype", "=", "'uint64'", ",", "count", "=", "1", ",", "advance", "=", "True", ")", ":", "data", "=", "np", ".", "frombuffer", "(", "self", ".", "_blob", ",", "dtype", "=", "dtype", ",", "count", "=", "count",...
Read one or more scalars of the indicated dtype. Count specifies the number of scalars to be read in.
[ "Read", "one", "or", "more", "scalars", "of", "the", "indicated", "dtype", ".", "Count", "specifies", "the", "number", "of", "scalars", "to", "be", "read", "in", "." ]
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/blob.py#L192-L203
5,402
datajoint/datajoint-python
datajoint/external.py
ExternalTable.put
def put(self, store, obj): """ put an object in external store """ spec = self._get_store_spec(store) blob = pack(obj) blob_hash = long_hash(blob) + store[len('external-'):] if spec['protocol'] == 'file': folder = os.path.join(spec['location'], self.da...
python
def put(self, store, obj): """ put an object in external store """ spec = self._get_store_spec(store) blob = pack(obj) blob_hash = long_hash(blob) + store[len('external-'):] if spec['protocol'] == 'file': folder = os.path.join(spec['location'], self.da...
[ "def", "put", "(", "self", ",", "store", ",", "obj", ")", ":", "spec", "=", "self", ".", "_get_store_spec", "(", "store", ")", "blob", "=", "pack", "(", "obj", ")", "blob_hash", "=", "long_hash", "(", "blob", ")", "+", "store", "[", "len", "(", "...
put an object in external store
[ "put", "an", "object", "in", "external", "store" ]
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/external.py#L45-L74
5,403
datajoint/datajoint-python
datajoint/external.py
ExternalTable.get
def get(self, blob_hash): """ get an object from external store. Does not need to check whether it's in the table. """ if blob_hash is None: return None store = blob_hash[STORE_HASH_LENGTH:] store = 'external' + ('-' if store else '') + store ...
python
def get(self, blob_hash): """ get an object from external store. Does not need to check whether it's in the table. """ if blob_hash is None: return None store = blob_hash[STORE_HASH_LENGTH:] store = 'external' + ('-' if store else '') + store ...
[ "def", "get", "(", "self", ",", "blob_hash", ")", ":", "if", "blob_hash", "is", "None", ":", "return", "None", "store", "=", "blob_hash", "[", "STORE_HASH_LENGTH", ":", "]", "store", "=", "'external'", "+", "(", "'-'", "if", "store", "else", "''", ")",...
get an object from external store. Does not need to check whether it's in the table.
[ "get", "an", "object", "from", "external", "store", ".", "Does", "not", "need", "to", "check", "whether", "it", "s", "in", "the", "table", "." ]
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/external.py#L76-L118
5,404
datajoint/datajoint-python
datajoint/external.py
ExternalTable.delete_garbage
def delete_garbage(self): """ Delete items that are no longer referenced. This operation is safe to perform at any time. """ self.connection.query( "DELETE FROM `{db}`.`{tab}` WHERE ".format(tab=self.table_name, db=self.database) + " AND ".join( ...
python
def delete_garbage(self): """ Delete items that are no longer referenced. This operation is safe to perform at any time. """ self.connection.query( "DELETE FROM `{db}`.`{tab}` WHERE ".format(tab=self.table_name, db=self.database) + " AND ".join( ...
[ "def", "delete_garbage", "(", "self", ")", ":", "self", ".", "connection", ".", "query", "(", "\"DELETE FROM `{db}`.`{tab}` WHERE \"", ".", "format", "(", "tab", "=", "self", ".", "table_name", ",", "db", "=", "self", ".", "database", ")", "+", "\" AND \"", ...
Delete items that are no longer referenced. This operation is safe to perform at any time.
[ "Delete", "items", "that", "are", "no", "longer", "referenced", ".", "This", "operation", "is", "safe", "to", "perform", "at", "any", "time", "." ]
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/external.py#L147-L157
5,405
datajoint/datajoint-python
datajoint/external.py
ExternalTable.clean_store
def clean_store(self, store, display_progress=True): """ Clean unused data in an external storage repository from unused blobs. This must be performed after delete_garbage during low-usage periods to reduce risks of data loss. """ spec = self._get_store_spec(store) progre...
python
def clean_store(self, store, display_progress=True): """ Clean unused data in an external storage repository from unused blobs. This must be performed after delete_garbage during low-usage periods to reduce risks of data loss. """ spec = self._get_store_spec(store) progre...
[ "def", "clean_store", "(", "self", ",", "store", ",", "display_progress", "=", "True", ")", ":", "spec", "=", "self", ".", "_get_store_spec", "(", "store", ")", "progress", "=", "tqdm", "if", "display_progress", "else", "lambda", "x", ":", "x", "if", "sp...
Clean unused data in an external storage repository from unused blobs. This must be performed after delete_garbage during low-usage periods to reduce risks of data loss.
[ "Clean", "unused", "data", "in", "an", "external", "storage", "repository", "from", "unused", "blobs", ".", "This", "must", "be", "performed", "after", "delete_garbage", "during", "low", "-", "usage", "periods", "to", "reduce", "risks", "of", "data", "loss", ...
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/external.py#L159-L176
5,406
datajoint/datajoint-python
datajoint/errors.py
is_connection_error
def is_connection_error(e): """ Checks if error e pertains to a connection issue """ return (isinstance(e, err.InterfaceError) and e.args[0] == "(0, '')") or\ (isinstance(e, err.OperationalError) and e.args[0] in operation_error_codes.values())
python
def is_connection_error(e): """ Checks if error e pertains to a connection issue """ return (isinstance(e, err.InterfaceError) and e.args[0] == "(0, '')") or\ (isinstance(e, err.OperationalError) and e.args[0] in operation_error_codes.values())
[ "def", "is_connection_error", "(", "e", ")", ":", "return", "(", "isinstance", "(", "e", ",", "err", ".", "InterfaceError", ")", "and", "e", ".", "args", "[", "0", "]", "==", "\"(0, '')\"", ")", "or", "(", "isinstance", "(", "e", ",", "err", ".", "...
Checks if error e pertains to a connection issue
[ "Checks", "if", "error", "e", "pertains", "to", "a", "connection", "issue" ]
4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c
https://github.com/datajoint/datajoint-python/blob/4f29bb154a7ed2b8b64b4d3a9c8be4c16b39621c/datajoint/errors.py#L18-L23
5,407
python-hyper/brotlipy
src/brotli/brotli.py
decompress
def decompress(data): """ Decompress a complete Brotli-compressed string. :param data: A bytestring containing Brotli-compressed data. """ d = Decompressor() data = d.decompress(data) d.finish() return data
python
def decompress(data): """ Decompress a complete Brotli-compressed string. :param data: A bytestring containing Brotli-compressed data. """ d = Decompressor() data = d.decompress(data) d.finish() return data
[ "def", "decompress", "(", "data", ")", ":", "d", "=", "Decompressor", "(", ")", "data", "=", "d", ".", "decompress", "(", "data", ")", "d", ".", "finish", "(", ")", "return", "data" ]
Decompress a complete Brotli-compressed string. :param data: A bytestring containing Brotli-compressed data.
[ "Decompress", "a", "complete", "Brotli", "-", "compressed", "string", "." ]
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L82-L91
5,408
python-hyper/brotlipy
src/brotli/brotli.py
compress
def compress(data, mode=DEFAULT_MODE, quality=lib.BROTLI_DEFAULT_QUALITY, lgwin=lib.BROTLI_DEFAULT_WINDOW, lgblock=0, dictionary=b''): """ Compress a string using Brotli. .. versionchanged:: 0.5.0 Added ``mode``, ``quality``, `lgwin``,...
python
def compress(data, mode=DEFAULT_MODE, quality=lib.BROTLI_DEFAULT_QUALITY, lgwin=lib.BROTLI_DEFAULT_WINDOW, lgblock=0, dictionary=b''): """ Compress a string using Brotli. .. versionchanged:: 0.5.0 Added ``mode``, ``quality``, `lgwin``,...
[ "def", "compress", "(", "data", ",", "mode", "=", "DEFAULT_MODE", ",", "quality", "=", "lib", ".", "BROTLI_DEFAULT_QUALITY", ",", "lgwin", "=", "lib", ".", "BROTLI_DEFAULT_WINDOW", ",", "lgblock", "=", "0", ",", "dictionary", "=", "b''", ")", ":", "# This ...
Compress a string using Brotli. .. versionchanged:: 0.5.0 Added ``mode``, ``quality``, `lgwin``, ``lgblock``, and ``dictionary`` parameters. :param data: A bytestring containing the data to compress. :type data: ``bytes`` :param mode: The encoder mode. :type mode: :class:`BrotliEnco...
[ "Compress", "a", "string", "using", "Brotli", "." ]
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L94-L152
5,409
python-hyper/brotlipy
src/brotli/brotli.py
Compressor._compress
def _compress(self, data, operation): """ This private method compresses some data in a given mode. This is used because almost all of the code uses the exact same setup. It wouldn't have to, but it doesn't hurt at all. """ # The 'algorithm' for working out how big to mak...
python
def _compress(self, data, operation): """ This private method compresses some data in a given mode. This is used because almost all of the code uses the exact same setup. It wouldn't have to, but it doesn't hurt at all. """ # The 'algorithm' for working out how big to mak...
[ "def", "_compress", "(", "self", ",", "data", ",", "operation", ")", ":", "# The 'algorithm' for working out how big to make this buffer is from", "# the Brotli source code, brotlimodule.cc.", "original_output_size", "=", "int", "(", "math", ".", "ceil", "(", "len", "(", ...
This private method compresses some data in a given mode. This is used because almost all of the code uses the exact same setup. It wouldn't have to, but it doesn't hurt at all.
[ "This", "private", "method", "compresses", "some", "data", "in", "a", "given", "mode", ".", "This", "is", "used", "because", "almost", "all", "of", "the", "code", "uses", "the", "exact", "same", "setup", ".", "It", "wouldn", "t", "have", "to", "but", "...
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L283-L317
5,410
python-hyper/brotlipy
src/brotli/brotli.py
Compressor.flush
def flush(self): """ Flush the compressor. This will emit the remaining output data, but will not destroy the compressor. It can be used, for example, to ensure that given chunks of content will decompress immediately. """ chunks = [] chunks.append(self._compress(...
python
def flush(self): """ Flush the compressor. This will emit the remaining output data, but will not destroy the compressor. It can be used, for example, to ensure that given chunks of content will decompress immediately. """ chunks = [] chunks.append(self._compress(...
[ "def", "flush", "(", "self", ")", ":", "chunks", "=", "[", "]", "chunks", ".", "append", "(", "self", ".", "_compress", "(", "b''", ",", "lib", ".", "BROTLI_OPERATION_FLUSH", ")", ")", "while", "lib", ".", "BrotliEncoderHasMoreOutput", "(", "self", ".", ...
Flush the compressor. This will emit the remaining output data, but will not destroy the compressor. It can be used, for example, to ensure that given chunks of content will decompress immediately.
[ "Flush", "the", "compressor", ".", "This", "will", "emit", "the", "remaining", "output", "data", "but", "will", "not", "destroy", "the", "compressor", ".", "It", "can", "be", "used", "for", "example", "to", "ensure", "that", "given", "chunks", "of", "conte...
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L330-L342
5,411
python-hyper/brotlipy
src/brotli/brotli.py
Compressor.finish
def finish(self): """ Finish the compressor. This will emit the remaining output data and transition the compressor to a completed state. The compressor cannot be used again after this point, and must be replaced. """ chunks = [] while lib.BrotliEncoderIsFinished(...
python
def finish(self): """ Finish the compressor. This will emit the remaining output data and transition the compressor to a completed state. The compressor cannot be used again after this point, and must be replaced. """ chunks = [] while lib.BrotliEncoderIsFinished(...
[ "def", "finish", "(", "self", ")", ":", "chunks", "=", "[", "]", "while", "lib", ".", "BrotliEncoderIsFinished", "(", "self", ".", "_encoder", ")", "==", "lib", ".", "BROTLI_FALSE", ":", "chunks", ".", "append", "(", "self", ".", "_compress", "(", "b''...
Finish the compressor. This will emit the remaining output data and transition the compressor to a completed state. The compressor cannot be used again after this point, and must be replaced.
[ "Finish", "the", "compressor", ".", "This", "will", "emit", "the", "remaining", "output", "data", "and", "transition", "the", "compressor", "to", "a", "completed", "state", ".", "The", "compressor", "cannot", "be", "used", "again", "after", "this", "point", ...
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L344-L354
5,412
python-hyper/brotlipy
src/brotli/brotli.py
Decompressor.decompress
def decompress(self, data): """ Decompress part of a complete Brotli-compressed string. :param data: A bytestring containing Brotli-compressed data. :returns: A bytestring containing the decompressed data. """ chunks = [] available_in = ffi.new("size_t *", len(d...
python
def decompress(self, data): """ Decompress part of a complete Brotli-compressed string. :param data: A bytestring containing Brotli-compressed data. :returns: A bytestring containing the decompressed data. """ chunks = [] available_in = ffi.new("size_t *", len(d...
[ "def", "decompress", "(", "self", ",", "data", ")", ":", "chunks", "=", "[", "]", "available_in", "=", "ffi", ".", "new", "(", "\"size_t *\"", ",", "len", "(", "data", ")", ")", "in_buffer", "=", "ffi", ".", "new", "(", "\"uint8_t[]\"", ",", "data", ...
Decompress part of a complete Brotli-compressed string. :param data: A bytestring containing Brotli-compressed data. :returns: A bytestring containing the decompressed data.
[ "Decompress", "part", "of", "a", "complete", "Brotli", "-", "compressed", "string", "." ]
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L386-L435
5,413
python-hyper/brotlipy
src/brotli/brotli.py
Decompressor.finish
def finish(self): """ Finish the decompressor. As the decompressor decompresses eagerly, this will never actually emit any data. However, it will potentially throw errors if a truncated or damaged data stream has been used. Note that, once this method is called, the decompressor...
python
def finish(self): """ Finish the decompressor. As the decompressor decompresses eagerly, this will never actually emit any data. However, it will potentially throw errors if a truncated or damaged data stream has been used. Note that, once this method is called, the decompressor...
[ "def", "finish", "(", "self", ")", ":", "assert", "(", "lib", ".", "BrotliDecoderHasMoreOutput", "(", "self", ".", "_decoder", ")", "==", "lib", ".", "BROTLI_FALSE", ")", "if", "lib", ".", "BrotliDecoderIsFinished", "(", "self", ".", "_decoder", ")", "==",...
Finish the decompressor. As the decompressor decompresses eagerly, this will never actually emit any data. However, it will potentially throw errors if a truncated or damaged data stream has been used. Note that, once this method is called, the decompressor is no longer safe for further...
[ "Finish", "the", "decompressor", ".", "As", "the", "decompressor", "decompresses", "eagerly", "this", "will", "never", "actually", "emit", "any", "data", ".", "However", "it", "will", "potentially", "throw", "errors", "if", "a", "truncated", "or", "damaged", "...
ffddf2ea5adc584c8c353d246bb1077b7e781b63
https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L451-L466
5,414
adafruit/Adafruit_Python_CharLCD
examples/char_lcd_rgb_pwm.py
hsv_to_rgb
def hsv_to_rgb(hsv): """Converts a tuple of hue, saturation, value to a tuple of red, green blue. Hue should be an angle from 0.0 to 359.0. Saturation and value should be a value from 0.0 to 1.0, where saturation controls the intensity of the hue and value controls the brightness. """ # Algorit...
python
def hsv_to_rgb(hsv): """Converts a tuple of hue, saturation, value to a tuple of red, green blue. Hue should be an angle from 0.0 to 359.0. Saturation and value should be a value from 0.0 to 1.0, where saturation controls the intensity of the hue and value controls the brightness. """ # Algorit...
[ "def", "hsv_to_rgb", "(", "hsv", ")", ":", "# Algorithm adapted from http://www.cs.rit.edu/~ncs/color/t_convert.html", "h", ",", "s", ",", "v", "=", "hsv", "if", "s", "==", "0", ":", "return", "(", "v", ",", "v", ",", "v", ")", "h", "/=", "60.0", "i", "=...
Converts a tuple of hue, saturation, value to a tuple of red, green blue. Hue should be an angle from 0.0 to 359.0. Saturation and value should be a value from 0.0 to 1.0, where saturation controls the intensity of the hue and value controls the brightness.
[ "Converts", "a", "tuple", "of", "hue", "saturation", "value", "to", "a", "tuple", "of", "red", "green", "blue", ".", "Hue", "should", "be", "an", "angle", "from", "0", ".", "0", "to", "359", ".", "0", ".", "Saturation", "and", "value", "should", "be"...
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/examples/char_lcd_rgb_pwm.py#L9-L36
5,415
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.set_cursor
def set_cursor(self, col, row): """Move the cursor to an explicit column and row position.""" # Clamp row to the last row of the display. if row > self._lines: row = self._lines - 1 # Set location. self.write8(LCD_SETDDRAMADDR | (col + LCD_ROW_OFFSETS[row]))
python
def set_cursor(self, col, row): """Move the cursor to an explicit column and row position.""" # Clamp row to the last row of the display. if row > self._lines: row = self._lines - 1 # Set location. self.write8(LCD_SETDDRAMADDR | (col + LCD_ROW_OFFSETS[row]))
[ "def", "set_cursor", "(", "self", ",", "col", ",", "row", ")", ":", "# Clamp row to the last row of the display.", "if", "row", ">", "self", ".", "_lines", ":", "row", "=", "self", ".", "_lines", "-", "1", "# Set location.", "self", ".", "write8", "(", "LC...
Move the cursor to an explicit column and row position.
[ "Move", "the", "cursor", "to", "an", "explicit", "column", "and", "row", "position", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L183-L189
5,416
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.enable_display
def enable_display(self, enable): """Enable or disable the display. Set enable to True to enable.""" if enable: self.displaycontrol |= LCD_DISPLAYON else: self.displaycontrol &= ~LCD_DISPLAYON self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
python
def enable_display(self, enable): """Enable or disable the display. Set enable to True to enable.""" if enable: self.displaycontrol |= LCD_DISPLAYON else: self.displaycontrol &= ~LCD_DISPLAYON self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
[ "def", "enable_display", "(", "self", ",", "enable", ")", ":", "if", "enable", ":", "self", ".", "displaycontrol", "|=", "LCD_DISPLAYON", "else", ":", "self", ".", "displaycontrol", "&=", "~", "LCD_DISPLAYON", "self", ".", "write8", "(", "LCD_DISPLAYCONTROL", ...
Enable or disable the display. Set enable to True to enable.
[ "Enable", "or", "disable", "the", "display", ".", "Set", "enable", "to", "True", "to", "enable", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L191-L197
5,417
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.show_cursor
def show_cursor(self, show): """Show or hide the cursor. Cursor is shown if show is True.""" if show: self.displaycontrol |= LCD_CURSORON else: self.displaycontrol &= ~LCD_CURSORON self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
python
def show_cursor(self, show): """Show or hide the cursor. Cursor is shown if show is True.""" if show: self.displaycontrol |= LCD_CURSORON else: self.displaycontrol &= ~LCD_CURSORON self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
[ "def", "show_cursor", "(", "self", ",", "show", ")", ":", "if", "show", ":", "self", ".", "displaycontrol", "|=", "LCD_CURSORON", "else", ":", "self", ".", "displaycontrol", "&=", "~", "LCD_CURSORON", "self", ".", "write8", "(", "LCD_DISPLAYCONTROL", "|", ...
Show or hide the cursor. Cursor is shown if show is True.
[ "Show", "or", "hide", "the", "cursor", ".", "Cursor", "is", "shown", "if", "show", "is", "True", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L199-L205
5,418
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.blink
def blink(self, blink): """Turn on or off cursor blinking. Set blink to True to enable blinking.""" if blink: self.displaycontrol |= LCD_BLINKON else: self.displaycontrol &= ~LCD_BLINKON self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
python
def blink(self, blink): """Turn on or off cursor blinking. Set blink to True to enable blinking.""" if blink: self.displaycontrol |= LCD_BLINKON else: self.displaycontrol &= ~LCD_BLINKON self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
[ "def", "blink", "(", "self", ",", "blink", ")", ":", "if", "blink", ":", "self", ".", "displaycontrol", "|=", "LCD_BLINKON", "else", ":", "self", ".", "displaycontrol", "&=", "~", "LCD_BLINKON", "self", ".", "write8", "(", "LCD_DISPLAYCONTROL", "|", "self"...
Turn on or off cursor blinking. Set blink to True to enable blinking.
[ "Turn", "on", "or", "off", "cursor", "blinking", ".", "Set", "blink", "to", "True", "to", "enable", "blinking", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L207-L213
5,419
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.set_left_to_right
def set_left_to_right(self): """Set text direction left to right.""" self.displaymode |= LCD_ENTRYLEFT self.write8(LCD_ENTRYMODESET | self.displaymode)
python
def set_left_to_right(self): """Set text direction left to right.""" self.displaymode |= LCD_ENTRYLEFT self.write8(LCD_ENTRYMODESET | self.displaymode)
[ "def", "set_left_to_right", "(", "self", ")", ":", "self", ".", "displaymode", "|=", "LCD_ENTRYLEFT", "self", ".", "write8", "(", "LCD_ENTRYMODESET", "|", "self", ".", "displaymode", ")" ]
Set text direction left to right.
[ "Set", "text", "direction", "left", "to", "right", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L223-L226
5,420
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.set_right_to_left
def set_right_to_left(self): """Set text direction right to left.""" self.displaymode &= ~LCD_ENTRYLEFT self.write8(LCD_ENTRYMODESET | self.displaymode)
python
def set_right_to_left(self): """Set text direction right to left.""" self.displaymode &= ~LCD_ENTRYLEFT self.write8(LCD_ENTRYMODESET | self.displaymode)
[ "def", "set_right_to_left", "(", "self", ")", ":", "self", ".", "displaymode", "&=", "~", "LCD_ENTRYLEFT", "self", ".", "write8", "(", "LCD_ENTRYMODESET", "|", "self", ".", "displaymode", ")" ]
Set text direction right to left.
[ "Set", "text", "direction", "right", "to", "left", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L228-L231
5,421
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.autoscroll
def autoscroll(self, autoscroll): """Autoscroll will 'right justify' text from the cursor if set True, otherwise it will 'left justify' the text. """ if autoscroll: self.displaymode |= LCD_ENTRYSHIFTINCREMENT else: self.displaymode &= ~LCD_ENTRYSHIFTINCREM...
python
def autoscroll(self, autoscroll): """Autoscroll will 'right justify' text from the cursor if set True, otherwise it will 'left justify' the text. """ if autoscroll: self.displaymode |= LCD_ENTRYSHIFTINCREMENT else: self.displaymode &= ~LCD_ENTRYSHIFTINCREM...
[ "def", "autoscroll", "(", "self", ",", "autoscroll", ")", ":", "if", "autoscroll", ":", "self", ".", "displaymode", "|=", "LCD_ENTRYSHIFTINCREMENT", "else", ":", "self", ".", "displaymode", "&=", "~", "LCD_ENTRYSHIFTINCREMENT", "self", ".", "write8", "(", "LCD...
Autoscroll will 'right justify' text from the cursor if set True, otherwise it will 'left justify' the text.
[ "Autoscroll", "will", "right", "justify", "text", "from", "the", "cursor", "if", "set", "True", "otherwise", "it", "will", "left", "justify", "the", "text", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L233-L241
5,422
adafruit/Adafruit_Python_CharLCD
Adafruit_CharLCD/Adafruit_CharLCD.py
Adafruit_CharLCD.message
def message(self, text): """Write text to display. Note that text can include newlines.""" line = 0 # Iterate through each character. for char in text: # Advance to next line if character is a new line. if char == '\n': line += 1 #...
python
def message(self, text): """Write text to display. Note that text can include newlines.""" line = 0 # Iterate through each character. for char in text: # Advance to next line if character is a new line. if char == '\n': line += 1 #...
[ "def", "message", "(", "self", ",", "text", ")", ":", "line", "=", "0", "# Iterate through each character.", "for", "char", "in", "text", ":", "# Advance to next line if character is a new line.", "if", "char", "==", "'\\n'", ":", "line", "+=", "1", "# Move to lef...
Write text to display. Note that text can include newlines.
[ "Write", "text", "to", "display", ".", "Note", "that", "text", "can", "include", "newlines", "." ]
c126e6b673074c12a03f4bd36afb2fe40272341e
https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L243-L256
5,423
i3visio/osrframework
osrframework/utils/regexp.py
RegexpObject.findExp
def findExp(self, data): ''' Method to look for the current regular expression in the provided string. :param data: string containing the text where the expressions will be looked for. :return: a list of verified regular expressions. ''' temp = [] ...
python
def findExp(self, data): ''' Method to look for the current regular expression in the provided string. :param data: string containing the text where the expressions will be looked for. :return: a list of verified regular expressions. ''' temp = [] ...
[ "def", "findExp", "(", "self", ",", "data", ")", ":", "temp", "=", "[", "]", "for", "r", "in", "self", ".", "reg_exp", ":", "try", ":", "temp", "+=", "re", ".", "findall", "(", "r", ",", "data", ")", "except", ":", "print", "self", ".", "name",...
Method to look for the current regular expression in the provided string. :param data: string containing the text where the expressions will be looked for. :return: a list of verified regular expressions.
[ "Method", "to", "look", "for", "the", "current", "regular", "expression", "in", "the", "provided", "string", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/regexp.py#L125-L150
5,424
i3visio/osrframework
osrframework/utils/general.py
exportUsufy
def exportUsufy(data, ext, fileH): """ Method that exports the different structures onto different formats. Args: ----- data: Data to export. ext: One of the following: csv, excel, json, ods. fileH: Fileheader for the output files. Returns: -------- Performs the...
python
def exportUsufy(data, ext, fileH): """ Method that exports the different structures onto different formats. Args: ----- data: Data to export. ext: One of the following: csv, excel, json, ods. fileH: Fileheader for the output files. Returns: -------- Performs the...
[ "def", "exportUsufy", "(", "data", ",", "ext", ",", "fileH", ")", ":", "if", "ext", "==", "\"csv\"", ":", "usufyToCsvExport", "(", "data", ",", "fileH", "+", "\".\"", "+", "ext", ")", "elif", "ext", "==", "\"gml\"", ":", "usufyToGmlExport", "(", "data"...
Method that exports the different structures onto different formats. Args: ----- data: Data to export. ext: One of the following: csv, excel, json, ods. fileH: Fileheader for the output files. Returns: -------- Performs the export as requested by parameter.
[ "Method", "that", "exports", "the", "different", "structures", "onto", "different", "formats", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L40-L69
5,425
i3visio/osrframework
osrframework/utils/general.py
_generateTabularData
def _generateTabularData(res, oldTabularData = {}, isTerminal=False, canUnicode=True): """ Method that recovers the values and columns from the current structure This method is used by: - usufyToCsvExport - usufyToOdsExport - usufyToXlsExport - usufyToXlsxExport Args: ...
python
def _generateTabularData(res, oldTabularData = {}, isTerminal=False, canUnicode=True): """ Method that recovers the values and columns from the current structure This method is used by: - usufyToCsvExport - usufyToOdsExport - usufyToXlsExport - usufyToXlsxExport Args: ...
[ "def", "_generateTabularData", "(", "res", ",", "oldTabularData", "=", "{", "}", ",", "isTerminal", "=", "False", ",", "canUnicode", "=", "True", ")", ":", "def", "_grabbingNewHeader", "(", "h", ")", ":", "\"\"\"\n Updates the headers to be general.\n\n ...
Method that recovers the values and columns from the current structure This method is used by: - usufyToCsvExport - usufyToOdsExport - usufyToXlsExport - usufyToXlsxExport Args: ----- res: New data to export. oldTabularData: The previous data stored. ...
[ "Method", "that", "recovers", "the", "values", "and", "columns", "from", "the", "current", "structure" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L72-L266
5,426
i3visio/osrframework
osrframework/utils/general.py
usufyToJsonExport
def usufyToJsonExport(d, fPath): """ Workaround to export to a json file. Args: ----- d: Data to export. fPath: File path for the output file. """ oldData = [] try: with open (fPath) as iF: oldText = iF.read() if oldText != "": ...
python
def usufyToJsonExport(d, fPath): """ Workaround to export to a json file. Args: ----- d: Data to export. fPath: File path for the output file. """ oldData = [] try: with open (fPath) as iF: oldText = iF.read() if oldText != "": ...
[ "def", "usufyToJsonExport", "(", "d", ",", "fPath", ")", ":", "oldData", "=", "[", "]", "try", ":", "with", "open", "(", "fPath", ")", "as", "iF", ":", "oldText", "=", "iF", ".", "read", "(", ")", "if", "oldText", "!=", "\"\"", ":", "oldData", "=...
Workaround to export to a json file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "to", "a", "json", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L269-L291
5,427
i3visio/osrframework
osrframework/utils/general.py
usufyToTextExport
def usufyToTextExport(d, fPath=None): """ Workaround to export to a .txt file or to show the information. Args: ----- d: Data to export. fPath: File path for the output file. If None was provided, it will assume that it has to print it. Returns: -------- uni...
python
def usufyToTextExport(d, fPath=None): """ Workaround to export to a .txt file or to show the information. Args: ----- d: Data to export. fPath: File path for the output file. If None was provided, it will assume that it has to print it. Returns: -------- uni...
[ "def", "usufyToTextExport", "(", "d", ",", "fPath", "=", "None", ")", ":", "# Manual check...", "if", "d", "==", "[", "]", ":", "return", "\"+------------------+\\n| No data found... |\\n+------------------+\"", "import", "pyexcel", "as", "pe", "import", "pyexcel", ...
Workaround to export to a .txt file or to show the information. Args: ----- d: Data to export. fPath: File path for the output file. If None was provided, it will assume that it has to print it. Returns: -------- unicode: It sometimes returns a unicode representatio...
[ "Workaround", "to", "export", "to", "a", ".", "txt", "file", "or", "to", "show", "the", "information", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L294-L342
5,428
i3visio/osrframework
osrframework/utils/general.py
usufyToCsvExport
def usufyToCsvExport(d, fPath): """ Workaround to export to a CSV file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_io import get_data try: oldData = {"OSRFramework": get_data(fPath) } except: # No information ha...
python
def usufyToCsvExport(d, fPath): """ Workaround to export to a CSV file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_io import get_data try: oldData = {"OSRFramework": get_data(fPath) } except: # No information ha...
[ "def", "usufyToCsvExport", "(", "d", ",", "fPath", ")", ":", "from", "pyexcel_io", "import", "get_data", "try", ":", "oldData", "=", "{", "\"OSRFramework\"", ":", "get_data", "(", "fPath", ")", "}", "except", ":", "# No information has been recovered", "oldData"...
Workaround to export to a CSV file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "to", "a", "CSV", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L345-L368
5,429
i3visio/osrframework
osrframework/utils/general.py
usufyToOdsExport
def usufyToOdsExport(d, fPath): """ Workaround to export to a .ods file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_ods import get_data try: #oldData = get_data(fPath) # A change in the API now returns only an array ...
python
def usufyToOdsExport(d, fPath): """ Workaround to export to a .ods file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_ods import get_data try: #oldData = get_data(fPath) # A change in the API now returns only an array ...
[ "def", "usufyToOdsExport", "(", "d", ",", "fPath", ")", ":", "from", "pyexcel_ods", "import", "get_data", "try", ":", "#oldData = get_data(fPath)", "# A change in the API now returns only an array of arrays if there is only one sheet.", "oldData", "=", "{", "\"OSRFramework\"", ...
Workaround to export to a .ods file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "to", "a", ".", "ods", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L371-L394
5,430
i3visio/osrframework
osrframework/utils/general.py
usufyToXlsExport
def usufyToXlsExport(d, fPath): """ Workaround to export to a .xls file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_xls import get_data try: #oldData = get_data(fPath) # A change in the API now returns only an array ...
python
def usufyToXlsExport(d, fPath): """ Workaround to export to a .xls file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_xls import get_data try: #oldData = get_data(fPath) # A change in the API now returns only an array ...
[ "def", "usufyToXlsExport", "(", "d", ",", "fPath", ")", ":", "from", "pyexcel_xls", "import", "get_data", "try", ":", "#oldData = get_data(fPath)", "# A change in the API now returns only an array of arrays if there is only one sheet.", "oldData", "=", "{", "\"OSRFramework\"", ...
Workaround to export to a .xls file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "to", "a", ".", "xls", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L397-L419
5,431
i3visio/osrframework
osrframework/utils/general.py
usufyToXlsxExport
def usufyToXlsxExport(d, fPath): """ Workaround to export to a .xlsx file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_xlsx import get_data try: #oldData = get_data(fPath) # A change in the API now returns only an arr...
python
def usufyToXlsxExport(d, fPath): """ Workaround to export to a .xlsx file. Args: ----- d: Data to export. fPath: File path for the output file. """ from pyexcel_xlsx import get_data try: #oldData = get_data(fPath) # A change in the API now returns only an arr...
[ "def", "usufyToXlsxExport", "(", "d", ",", "fPath", ")", ":", "from", "pyexcel_xlsx", "import", "get_data", "try", ":", "#oldData = get_data(fPath)", "# A change in the API now returns only an array of arrays if there is only one sheet.", "oldData", "=", "{", "\"OSRFramework\""...
Workaround to export to a .xlsx file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "to", "a", ".", "xlsx", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L422-L445
5,432
i3visio/osrframework
osrframework/utils/general.py
_generateGraphData
def _generateGraphData(data, oldData=nx.Graph()): """ Processing the data from i3visio structures to generate nodes and edges This function uses the networkx graph library. It will create a new node for each and i3visio.<something> entities while it will add properties for all the attribute startin...
python
def _generateGraphData(data, oldData=nx.Graph()): """ Processing the data from i3visio structures to generate nodes and edges This function uses the networkx graph library. It will create a new node for each and i3visio.<something> entities while it will add properties for all the attribute startin...
[ "def", "_generateGraphData", "(", "data", ",", "oldData", "=", "nx", ".", "Graph", "(", ")", ")", ":", "def", "_addNewNode", "(", "ent", ",", "g", ")", ":", "\"\"\"\n Wraps the creation of a node\n\n Args:\n -----\n ent: The hi3visio-like...
Processing the data from i3visio structures to generate nodes and edges This function uses the networkx graph library. It will create a new node for each and i3visio.<something> entities while it will add properties for all the attribute starting with "@". Args: ----- d: The i3visio struct...
[ "Processing", "the", "data", "from", "i3visio", "structures", "to", "generate", "nodes", "and", "edges" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L448-L594
5,433
i3visio/osrframework
osrframework/utils/general.py
usufyToGmlExport
def usufyToGmlExport(d, fPath): """ Workaround to export data to a .gml file. Args: ----- d: Data to export. fPath: File path for the output file. """ # Reading the previous gml file try: oldData=nx.read_gml(fPath) except UnicodeDecodeError as e: print("U...
python
def usufyToGmlExport(d, fPath): """ Workaround to export data to a .gml file. Args: ----- d: Data to export. fPath: File path for the output file. """ # Reading the previous gml file try: oldData=nx.read_gml(fPath) except UnicodeDecodeError as e: print("U...
[ "def", "usufyToGmlExport", "(", "d", ",", "fPath", ")", ":", "# Reading the previous gml file", "try", ":", "oldData", "=", "nx", ".", "read_gml", "(", "fPath", ")", "except", "UnicodeDecodeError", "as", "e", ":", "print", "(", "\"UnicodeDecodeError:\\t\"", "+",...
Workaround to export data to a .gml file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "data", "to", "a", ".", "gml", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L597-L625
5,434
i3visio/osrframework
osrframework/utils/general.py
usufyToPngExport
def usufyToPngExport(d, fPath): """ Workaround to export to a png file. Args: ----- d: Data to export. fPath: File path for the output file. """ newGraph = _generateGraphData(d) import matplotlib.pyplot as plt # Writing the png file nx.draw(newGraph) plt.savefig...
python
def usufyToPngExport(d, fPath): """ Workaround to export to a png file. Args: ----- d: Data to export. fPath: File path for the output file. """ newGraph = _generateGraphData(d) import matplotlib.pyplot as plt # Writing the png file nx.draw(newGraph) plt.savefig...
[ "def", "usufyToPngExport", "(", "d", ",", "fPath", ")", ":", "newGraph", "=", "_generateGraphData", "(", "d", ")", "import", "matplotlib", ".", "pyplot", "as", "plt", "# Writing the png file", "nx", ".", "draw", "(", "newGraph", ")", "plt", ".", "savefig", ...
Workaround to export to a png file. Args: ----- d: Data to export. fPath: File path for the output file.
[ "Workaround", "to", "export", "to", "a", "png", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L628-L642
5,435
i3visio/osrframework
osrframework/utils/general.py
fileToMD5
def fileToMD5(filename, block_size=256*128, binary=False): """ A function that calculates the MD5 hash of a file. Args: ----- filename: Path to the file. block_size: Chunks of suitable size. Block size directly depends on the block size of your filesystem to avoid performanc...
python
def fileToMD5(filename, block_size=256*128, binary=False): """ A function that calculates the MD5 hash of a file. Args: ----- filename: Path to the file. block_size: Chunks of suitable size. Block size directly depends on the block size of your filesystem to avoid performanc...
[ "def", "fileToMD5", "(", "filename", ",", "block_size", "=", "256", "*", "128", ",", "binary", "=", "False", ")", ":", "md5", "=", "hashlib", ".", "md5", "(", ")", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "f", ":", "for", "chunk", ...
A function that calculates the MD5 hash of a file. Args: ----- filename: Path to the file. block_size: Chunks of suitable size. Block size directly depends on the block size of your filesystem to avoid performances issues. Blocks of 4096 octets (Default NTFS). bi...
[ "A", "function", "that", "calculates", "the", "MD5", "hash", "of", "a", "file", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L645-L668
5,436
i3visio/osrframework
osrframework/utils/general.py
getCurrentStrDatetime
def getCurrentStrDatetime(): """ Generating the current Datetime with a given format Returns: -------- string: The string of a date. """ # Generating current time i = datetime.datetime.now() strTime = "%s-%s-%s_%sh%sm" % (i.year, i.month, i.day, i.hour, i.minute) return strT...
python
def getCurrentStrDatetime(): """ Generating the current Datetime with a given format Returns: -------- string: The string of a date. """ # Generating current time i = datetime.datetime.now() strTime = "%s-%s-%s_%sh%sm" % (i.year, i.month, i.day, i.hour, i.minute) return strT...
[ "def", "getCurrentStrDatetime", "(", ")", ":", "# Generating current time", "i", "=", "datetime", ".", "datetime", ".", "now", "(", ")", "strTime", "=", "\"%s-%s-%s_%sh%sm\"", "%", "(", "i", ".", "year", ",", "i", ".", "month", ",", "i", ".", "day", ",",...
Generating the current Datetime with a given format Returns: -------- string: The string of a date.
[ "Generating", "the", "current", "Datetime", "with", "a", "given", "format" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L671-L682
5,437
i3visio/osrframework
osrframework/utils/general.py
getFilesFromAFolder
def getFilesFromAFolder(path): """ Getting all the files in a folder. Args: ----- path: The path in which looking for the files Returns: -------- list: The list of filenames found. """ from os import listdir from os.path import isfile, join #onlyfiles = [ f for ...
python
def getFilesFromAFolder(path): """ Getting all the files in a folder. Args: ----- path: The path in which looking for the files Returns: -------- list: The list of filenames found. """ from os import listdir from os.path import isfile, join #onlyfiles = [ f for ...
[ "def", "getFilesFromAFolder", "(", "path", ")", ":", "from", "os", "import", "listdir", "from", "os", ".", "path", "import", "isfile", ",", "join", "#onlyfiles = [ f for f in listdir(path) if isfile(join(path,f)) ]", "onlyFiles", "=", "[", "]", "for", "f", "in", "...
Getting all the files in a folder. Args: ----- path: The path in which looking for the files Returns: -------- list: The list of filenames found.
[ "Getting", "all", "the", "files", "in", "a", "folder", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L685-L704
5,438
i3visio/osrframework
osrframework/utils/general.py
urisToBrowser
def urisToBrowser(uris=[], autoraise=True): """ Method that launches the URI in the default browser of the system This function temporally deactivates the standard ouptut and errors to prevent the system to show unwanted messages. This method is based on this question from Stackoverflow. https:...
python
def urisToBrowser(uris=[], autoraise=True): """ Method that launches the URI in the default browser of the system This function temporally deactivates the standard ouptut and errors to prevent the system to show unwanted messages. This method is based on this question from Stackoverflow. https:...
[ "def", "urisToBrowser", "(", "uris", "=", "[", "]", ",", "autoraise", "=", "True", ")", ":", "# Cloning stdout (1) and stderr (2)", "savout1", "=", "os", ".", "dup", "(", "1", ")", "savout2", "=", "os", ".", "dup", "(", "2", ")", "# Closing them", "os", ...
Method that launches the URI in the default browser of the system This function temporally deactivates the standard ouptut and errors to prevent the system to show unwanted messages. This method is based on this question from Stackoverflow. https://stackoverflow.com/questions/2323080/how-can-i-disable-...
[ "Method", "that", "launches", "the", "URI", "in", "the", "default", "browser", "of", "the", "system" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L707-L740
5,439
i3visio/osrframework
osrframework/utils/general.py
openResultsInBrowser
def openResultsInBrowser(res): """ Method that collects the URI from a list of entities and opens them Args: ----- res: A list containing several i3visio entities. """ print(emphasis("\n\tOpening URIs in the default web browser...")) urisToBrowser(["https://github.com/i3visio/osrfr...
python
def openResultsInBrowser(res): """ Method that collects the URI from a list of entities and opens them Args: ----- res: A list containing several i3visio entities. """ print(emphasis("\n\tOpening URIs in the default web browser...")) urisToBrowser(["https://github.com/i3visio/osrfr...
[ "def", "openResultsInBrowser", "(", "res", ")", ":", "print", "(", "emphasis", "(", "\"\\n\\tOpening URIs in the default web browser...\"", ")", ")", "urisToBrowser", "(", "[", "\"https://github.com/i3visio/osrframework\"", "]", ",", "autoraise", "=", "False", ")", "# W...
Method that collects the URI from a list of entities and opens them Args: ----- res: A list containing several i3visio entities.
[ "Method", "that", "collects", "the", "URI", "from", "a", "list", "of", "entities", "and", "opens", "them" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L743-L763
5,440
i3visio/osrframework
osrframework/utils/general.py
colorize
def colorize(text, messageType=None): """ Function that colorizes a message. Args: ----- text: The string to be colorized. messageType: Possible options include "ERROR", "WARNING", "SUCCESS", "INFO" or "BOLD". Returns: -------- string: Colorized if the optio...
python
def colorize(text, messageType=None): """ Function that colorizes a message. Args: ----- text: The string to be colorized. messageType: Possible options include "ERROR", "WARNING", "SUCCESS", "INFO" or "BOLD". Returns: -------- string: Colorized if the optio...
[ "def", "colorize", "(", "text", ",", "messageType", "=", "None", ")", ":", "formattedText", "=", "str", "(", "text", ")", "# Set colors", "if", "\"ERROR\"", "in", "messageType", ":", "formattedText", "=", "colorama", ".", "Fore", ".", "RED", "+", "formatte...
Function that colorizes a message. Args: ----- text: The string to be colorized. messageType: Possible options include "ERROR", "WARNING", "SUCCESS", "INFO" or "BOLD". Returns: -------- string: Colorized if the option is correct, including a tag at the end ...
[ "Function", "that", "colorizes", "a", "message", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L766-L796
5,441
i3visio/osrframework
osrframework/utils/general.py
showLicense
def showLicense(): """ Method that prints the license if requested. It tries to find the license online and manually download it. This method only prints its contents in plain text. """ print("Trying to recover the contents of the license...\n") try: # Grab the license online and pr...
python
def showLicense(): """ Method that prints the license if requested. It tries to find the license online and manually download it. This method only prints its contents in plain text. """ print("Trying to recover the contents of the license...\n") try: # Grab the license online and pr...
[ "def", "showLicense", "(", ")", ":", "print", "(", "\"Trying to recover the contents of the license...\\n\"", ")", "try", ":", "# Grab the license online and print it.", "text", "=", "urllib", ".", "urlopen", "(", "LICENSE_URL", ")", ".", "read", "(", ")", "print", ...
Method that prints the license if requested. It tries to find the license online and manually download it. This method only prints its contents in plain text.
[ "Method", "that", "prints", "the", "license", "if", "requested", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L823-L838
5,442
i3visio/osrframework
osrframework/utils/general.py
expandEntitiesFromEmail
def expandEntitiesFromEmail(e): """ Method that receives an email an creates linked entities Args: ----- e: Email to verify. Returns: -------- Three different values: email, alias and domain in a list. """ # Grabbing the email email = {} email["type"] = "i3vis...
python
def expandEntitiesFromEmail(e): """ Method that receives an email an creates linked entities Args: ----- e: Email to verify. Returns: -------- Three different values: email, alias and domain in a list. """ # Grabbing the email email = {} email["type"] = "i3vis...
[ "def", "expandEntitiesFromEmail", "(", "e", ")", ":", "# Grabbing the email", "email", "=", "{", "}", "email", "[", "\"type\"", "]", "=", "\"i3visio.email\"", "email", "[", "\"value\"", "]", "=", "e", "email", "[", "\"attributes\"", "]", "=", "[", "]", "# ...
Method that receives an email an creates linked entities Args: ----- e: Email to verify. Returns: -------- Three different values: email, alias and domain in a list.
[ "Method", "that", "receives", "an", "email", "an", "creates", "linked", "entities" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L842-L872
5,443
i3visio/osrframework
osrframework/domainfy.py
getNumberTLD
def getNumberTLD(): """ Counting the total number of TLD being processed. """ total = 0 for typeTld in TLD.keys(): total+= len(TLD[typeTld]) return total
python
def getNumberTLD(): """ Counting the total number of TLD being processed. """ total = 0 for typeTld in TLD.keys(): total+= len(TLD[typeTld]) return total
[ "def", "getNumberTLD", "(", ")", ":", "total", "=", "0", "for", "typeTld", "in", "TLD", ".", "keys", "(", ")", ":", "total", "+=", "len", "(", "TLD", "[", "typeTld", "]", ")", "return", "total" ]
Counting the total number of TLD being processed.
[ "Counting", "the", "total", "number", "of", "TLD", "being", "processed", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L63-L70
5,444
i3visio/osrframework
osrframework/domainfy.py
getWhoisInfo
def getWhoisInfo(domain): """ Method that trie to recover the whois info from a domain. Args: ----- domain: The domain to verify. Returns: -------- dict: A dictionary containing the result as an i3visio entity with its `value`, `type` and `attributes`. """ n...
python
def getWhoisInfo(domain): """ Method that trie to recover the whois info from a domain. Args: ----- domain: The domain to verify. Returns: -------- dict: A dictionary containing the result as an i3visio entity with its `value`, `type` and `attributes`. """ n...
[ "def", "getWhoisInfo", "(", "domain", ")", ":", "new", "=", "[", "]", "# Grabbing the aliases", "try", ":", "emails", "=", "{", "}", "emails", "[", "\"type\"", "]", "=", "\"i3visio.alias\"", "emails", "[", "\"value\"", "]", "=", "str", "(", "domain", "."...
Method that trie to recover the whois info from a domain. Args: ----- domain: The domain to verify. Returns: -------- dict: A dictionary containing the result as an i3visio entity with its `value`, `type` and `attributes`.
[ "Method", "that", "trie", "to", "recover", "the", "whois", "info", "from", "a", "domain", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L73-L150
5,445
i3visio/osrframework
osrframework/domainfy.py
createDomains
def createDomains(tlds, nicks=None, nicksFile=None): """ Method that globally permits to generate the domains to be checked. Args: ----- tlds: List of tlds. nicks: List of aliases. nicksFile: The filepath to the aliases file. Returns: -------- list: list of doma...
python
def createDomains(tlds, nicks=None, nicksFile=None): """ Method that globally permits to generate the domains to be checked. Args: ----- tlds: List of tlds. nicks: List of aliases. nicksFile: The filepath to the aliases file. Returns: -------- list: list of doma...
[ "def", "createDomains", "(", "tlds", ",", "nicks", "=", "None", ",", "nicksFile", "=", "None", ")", ":", "domain_candidates", "=", "[", "]", "if", "nicks", "!=", "None", ":", "for", "n", "in", "nicks", ":", "for", "t", "in", "tlds", ":", "tmp", "="...
Method that globally permits to generate the domains to be checked. Args: ----- tlds: List of tlds. nicks: List of aliases. nicksFile: The filepath to the aliases file. Returns: -------- list: list of domains to be checked.
[ "Method", "that", "globally", "permits", "to", "generate", "the", "domains", "to", "be", "checked", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L153-L188
5,446
i3visio/osrframework
osrframework/mailfy.py
weCanCheckTheseDomains
def weCanCheckTheseDomains(email): """ Method that verifies if a domain can be safely verified. Args: ----- email: the email whose domain will be verified. Returns: -------- bool: it represents whether the domain can be verified. """ # Known platform not to be working.....
python
def weCanCheckTheseDomains(email): """ Method that verifies if a domain can be safely verified. Args: ----- email: the email whose domain will be verified. Returns: -------- bool: it represents whether the domain can be verified. """ # Known platform not to be working.....
[ "def", "weCanCheckTheseDomains", "(", "email", ")", ":", "# Known platform not to be working...", "notWorking", "=", "[", "\"@aol.com\"", ",", "\"@bk.ru\"", ",", "\"@breakthru.com\"", ",", "\"@gmx.\"", ",", "\"@hotmail.co\"", ",", "\"@inbox.com\"", ",", "\"@latinmail.com\...
Method that verifies if a domain can be safely verified. Args: ----- email: the email whose domain will be verified. Returns: -------- bool: it represents whether the domain can be verified.
[ "Method", "that", "verifies", "if", "a", "domain", "can", "be", "safely", "verified", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L112-L161
5,447
i3visio/osrframework
osrframework/mailfy.py
grabEmails
def grabEmails(emails=None, emailsFile=None, nicks=None, nicksFile=None, domains=EMAIL_DOMAINS, excludeDomains=[]): """ Method that generates a list of emails. Args: ----- emails: Any premade list of emails. emailsFile: Filepath to the emails file (one per line). nicks: A list o...
python
def grabEmails(emails=None, emailsFile=None, nicks=None, nicksFile=None, domains=EMAIL_DOMAINS, excludeDomains=[]): """ Method that generates a list of emails. Args: ----- emails: Any premade list of emails. emailsFile: Filepath to the emails file (one per line). nicks: A list o...
[ "def", "grabEmails", "(", "emails", "=", "None", ",", "emailsFile", "=", "None", ",", "nicks", "=", "None", ",", "nicksFile", "=", "None", ",", "domains", "=", "EMAIL_DOMAINS", ",", "excludeDomains", "=", "[", "]", ")", ":", "email_candidates", "=", "[",...
Method that generates a list of emails. Args: ----- emails: Any premade list of emails. emailsFile: Filepath to the emails file (one per line). nicks: A list of aliases. nicksFile: Filepath to the aliases file (one per line). domains: Domains where the aliases will be te...
[ "Method", "that", "generates", "a", "list", "of", "emails", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L164-L206
5,448
i3visio/osrframework
osrframework/mailfy.py
processMailList
def processMailList(platformNames=[], emails=[]): """ Method to perform the email search. Args: ----- platformNames: List of names of the platforms. emails: List of numbers to be queried. Return: ------- A list of verified emails. """ # Grabbing the <Platform> o...
python
def processMailList(platformNames=[], emails=[]): """ Method to perform the email search. Args: ----- platformNames: List of names of the platforms. emails: List of numbers to be queried. Return: ------- A list of verified emails. """ # Grabbing the <Platform> o...
[ "def", "processMailList", "(", "platformNames", "=", "[", "]", ",", "emails", "=", "[", "]", ")", ":", "# Grabbing the <Platform> objects", "platforms", "=", "platform_selection", ".", "getPlatformsByName", "(", "platformNames", ",", "mode", "=", "\"mailfy\"", ")"...
Method to perform the email search. Args: ----- platformNames: List of names of the platforms. emails: List of numbers to be queried. Return: ------- A list of verified emails.
[ "Method", "to", "perform", "the", "email", "search", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L209-L232
5,449
i3visio/osrframework
osrframework/mailfy.py
pool_function
def pool_function(args): """ A wrapper for being able to launch all the threads. We will use python-emailahoy library for the verification. Args: ----- args: reception of the parameters for getPageWrapper as a tuple. Returns: -------- A dictionary representing whether the ...
python
def pool_function(args): """ A wrapper for being able to launch all the threads. We will use python-emailahoy library for the verification. Args: ----- args: reception of the parameters for getPageWrapper as a tuple. Returns: -------- A dictionary representing whether the ...
[ "def", "pool_function", "(", "args", ")", ":", "is_valid", "=", "True", "try", ":", "checker", "=", "emailahoy", ".", "VerifyEmail", "(", ")", "status", ",", "message", "=", "checker", ".", "verify_email_smtp", "(", "args", ",", "from_host", "=", "'gmail.c...
A wrapper for being able to launch all the threads. We will use python-emailahoy library for the verification. Args: ----- args: reception of the parameters for getPageWrapper as a tuple. Returns: -------- A dictionary representing whether the verification was ended succes...
[ "A", "wrapper", "for", "being", "able", "to", "launch", "all", "the", "threads", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L235-L283
5,450
i3visio/osrframework
osrframework/utils/browser.py
Browser.recoverURL
def recoverURL(self, url): """ Public method to recover a resource. Args: ----- url: The URL to be collected. Returns: -------- Returns a resource that has to be read, for instance, with html = self.br.read() """ # Configuring use...
python
def recoverURL(self, url): """ Public method to recover a resource. Args: ----- url: The URL to be collected. Returns: -------- Returns a resource that has to be read, for instance, with html = self.br.read() """ # Configuring use...
[ "def", "recoverURL", "(", "self", ",", "url", ")", ":", "# Configuring user agents...", "self", ".", "setUserAgent", "(", ")", "# Configuring proxies", "if", "\"https://\"", "in", "url", ":", "self", ".", "setProxy", "(", "protocol", "=", "\"https\"", ")", "el...
Public method to recover a resource. Args: ----- url: The URL to be collected. Returns: -------- Returns a resource that has to be read, for instance, with html = self.br.read()
[ "Public", "method", "to", "recover", "a", "resource", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L141-L182
5,451
i3visio/osrframework
osrframework/utils/browser.py
Browser.setNewPassword
def setNewPassword(self, url, username, password): """ Public method to manually set the credentials for a url in the browser. """ self.br.add_password(url, username, password)
python
def setNewPassword(self, url, username, password): """ Public method to manually set the credentials for a url in the browser. """ self.br.add_password(url, username, password)
[ "def", "setNewPassword", "(", "self", ",", "url", ",", "username", ",", "password", ")", ":", "self", ".", "br", ".", "add_password", "(", "url", ",", "username", ",", "password", ")" ]
Public method to manually set the credentials for a url in the browser.
[ "Public", "method", "to", "manually", "set", "the", "credentials", "for", "a", "url", "in", "the", "browser", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L184-L188
5,452
i3visio/osrframework
osrframework/utils/browser.py
Browser.setProxy
def setProxy(self, protocol="http"): """ Public method to set a proxy for the browser. """ # Setting proxy try: new = { protocol: self.proxies[protocol]} self.br.set_proxies( new ) except: # No proxy defined for that protocol ...
python
def setProxy(self, protocol="http"): """ Public method to set a proxy for the browser. """ # Setting proxy try: new = { protocol: self.proxies[protocol]} self.br.set_proxies( new ) except: # No proxy defined for that protocol ...
[ "def", "setProxy", "(", "self", ",", "protocol", "=", "\"http\"", ")", ":", "# Setting proxy", "try", ":", "new", "=", "{", "protocol", ":", "self", ".", "proxies", "[", "protocol", "]", "}", "self", ".", "br", ".", "set_proxies", "(", "new", ")", "e...
Public method to set a proxy for the browser.
[ "Public", "method", "to", "set", "a", "proxy", "for", "the", "browser", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L190-L200
5,453
i3visio/osrframework
osrframework/utils/browser.py
Browser.setUserAgent
def setUserAgent(self, uA=None): """ This method will be called whenever a new query will be executed. :param uA: Any User Agent that was needed to be inserted. This parameter is optional. :return: Returns True if a User Agent was inserted and False if no User Agent c...
python
def setUserAgent(self, uA=None): """ This method will be called whenever a new query will be executed. :param uA: Any User Agent that was needed to be inserted. This parameter is optional. :return: Returns True if a User Agent was inserted and False if no User Agent c...
[ "def", "setUserAgent", "(", "self", ",", "uA", "=", "None", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "\"osrframework.utils\"", ")", "if", "not", "uA", ":", "# Setting the User Agents", "if", "self", ".", "userAgents", ":", "# User-Agent (this...
This method will be called whenever a new query will be executed. :param uA: Any User Agent that was needed to be inserted. This parameter is optional. :return: Returns True if a User Agent was inserted and False if no User Agent could be inserted.
[ "This", "method", "will", "be", "called", "whenever", "a", "new", "query", "will", "be", "executed", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L202-L228
5,454
i3visio/osrframework
osrframework/api/twitter_api.py
main
def main(args): """ Query manager. """ # Creating the instance tAW = TwitterAPIWrapper() # Selecting the query to be launched if args.type == "get_all_docs": results = tAW.get_all_docs(args.query) elif args.type == "get_user": results = tAW.get_user(args.query) ...
python
def main(args): """ Query manager. """ # Creating the instance tAW = TwitterAPIWrapper() # Selecting the query to be launched if args.type == "get_all_docs": results = tAW.get_all_docs(args.query) elif args.type == "get_user": results = tAW.get_user(args.query) ...
[ "def", "main", "(", "args", ")", ":", "# Creating the instance", "tAW", "=", "TwitterAPIWrapper", "(", ")", "# Selecting the query to be launched", "if", "args", ".", "type", "==", "\"get_all_docs\"", ":", "results", "=", "tAW", ".", "get_all_docs", "(", "args", ...
Query manager.
[ "Query", "manager", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L775-L811
5,455
i3visio/osrframework
osrframework/api/twitter_api.py
TwitterAPIWrapper._rate_limit_status
def _rate_limit_status(self, api=None, mode=None): """ Verifying the API limits """ if api == None: api = self.connectToAPI() if mode == None: print json.dumps(api.rate_limit_status(), indent=2) raw_input("<Press ENTER>") else: ...
python
def _rate_limit_status(self, api=None, mode=None): """ Verifying the API limits """ if api == None: api = self.connectToAPI() if mode == None: print json.dumps(api.rate_limit_status(), indent=2) raw_input("<Press ENTER>") else: ...
[ "def", "_rate_limit_status", "(", "self", ",", "api", "=", "None", ",", "mode", "=", "None", ")", ":", "if", "api", "==", "None", ":", "api", "=", "self", ".", "connectToAPI", "(", ")", "if", "mode", "==", "None", ":", "print", "json", ".", "dumps"...
Verifying the API limits
[ "Verifying", "the", "API", "limits" ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L62-L113
5,456
i3visio/osrframework
osrframework/api/twitter_api.py
TwitterAPIWrapper.get_followers
def get_followers(self, query): """ Method to get the followers of a user. :param query: Query to be performed. :return: List of ids. """ # Connecting to the API api = self._connectToAPI() # Verifying the limits of the API self....
python
def get_followers(self, query): """ Method to get the followers of a user. :param query: Query to be performed. :return: List of ids. """ # Connecting to the API api = self._connectToAPI() # Verifying the limits of the API self....
[ "def", "get_followers", "(", "self", ",", "query", ")", ":", "# Connecting to the API", "api", "=", "self", ".", "_connectToAPI", "(", ")", "# Verifying the limits of the API", "self", ".", "_rate_limit_status", "(", "api", "=", "api", ",", "mode", "=", "\"get_f...
Method to get the followers of a user. :param query: Query to be performed. :return: List of ids.
[ "Method", "to", "get", "the", "followers", "of", "a", "user", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L641-L667
5,457
i3visio/osrframework
osrframework/api/twitter_api.py
TwitterAPIWrapper.get_friends
def get_friends(self, query): """ Method to get the friends of a user. :param query: Query to be performed. :return: List of users. """ # Connecting to the API api = self._connectToAPI() # Verifying the limits of the API self._r...
python
def get_friends(self, query): """ Method to get the friends of a user. :param query: Query to be performed. :return: List of users. """ # Connecting to the API api = self._connectToAPI() # Verifying the limits of the API self._r...
[ "def", "get_friends", "(", "self", ",", "query", ")", ":", "# Connecting to the API", "api", "=", "self", ".", "_connectToAPI", "(", ")", "# Verifying the limits of the API", "self", ".", "_rate_limit_status", "(", "api", "=", "api", ",", "mode", "=", "\"get_fri...
Method to get the friends of a user. :param query: Query to be performed. :return: List of users.
[ "Method", "to", "get", "the", "friends", "of", "a", "user", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L669-L695
5,458
i3visio/osrframework
osrframework/api/twitter_api.py
TwitterAPIWrapper.get_user
def get_user(self, screen_name): """ Method to perform the usufy searches. :param screen_name: nickname to be searched. :return: User. """ # Connecting to the API api = self._connectToAPI() # Verifying the limits of the API self._...
python
def get_user(self, screen_name): """ Method to perform the usufy searches. :param screen_name: nickname to be searched. :return: User. """ # Connecting to the API api = self._connectToAPI() # Verifying the limits of the API self._...
[ "def", "get_user", "(", "self", ",", "screen_name", ")", ":", "# Connecting to the API", "api", "=", "self", ".", "_connectToAPI", "(", ")", "# Verifying the limits of the API", "self", ".", "_rate_limit_status", "(", "api", "=", "api", ",", "mode", "=", "\"get_...
Method to perform the usufy searches. :param screen_name: nickname to be searched. :return: User.
[ "Method", "to", "perform", "the", "usufy", "searches", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L698-L724
5,459
i3visio/osrframework
osrframework/api/twitter_api.py
TwitterAPIWrapper.search_users
def search_users(self, query, n=20, maxUsers=60): """ Method to perform the searchfy searches. :param query: Query to be performed. :param n: Number of results per query. :param maxUsers: Max. number of users to be recovered. :return: List ...
python
def search_users(self, query, n=20, maxUsers=60): """ Method to perform the searchfy searches. :param query: Query to be performed. :param n: Number of results per query. :param maxUsers: Max. number of users to be recovered. :return: List ...
[ "def", "search_users", "(", "self", ",", "query", ",", "n", "=", "20", ",", "maxUsers", "=", "60", ")", ":", "# Connecting to the API", "api", "=", "self", ".", "_connectToAPI", "(", ")", "# Verifying the limits of the API", "self", ".", "_rate_limit_status", ...
Method to perform the searchfy searches. :param query: Query to be performed. :param n: Number of results per query. :param maxUsers: Max. number of users to be recovered. :return: List of users
[ "Method", "to", "perform", "the", "searchfy", "searches", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L726-L772
5,460
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/source.py
Source.validate_categories
def validate_categories(categories): """Take an iterable of source categories and raise ValueError if some of them are invalid.""" if not set(categories) <= Source.categories: invalid = list(set(categories) - Source.categories) raise ValueError('Invalid categories: %s' %...
python
def validate_categories(categories): """Take an iterable of source categories and raise ValueError if some of them are invalid.""" if not set(categories) <= Source.categories: invalid = list(set(categories) - Source.categories) raise ValueError('Invalid categories: %s' %...
[ "def", "validate_categories", "(", "categories", ")", ":", "if", "not", "set", "(", "categories", ")", "<=", "Source", ".", "categories", ":", "invalid", "=", "list", "(", "set", "(", "categories", ")", "-", "Source", ".", "categories", ")", "raise", "Va...
Take an iterable of source categories and raise ValueError if some of them are invalid.
[ "Take", "an", "iterable", "of", "source", "categories", "and", "raise", "ValueError", "if", "some", "of", "them", "are", "invalid", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/source.py#L50-L55
5,461
i3visio/osrframework
osrframework/thirdparties/md5db_net/checkIfHashIsCracked.py
checkIfHashIsCracked
def checkIfHashIsCracked(hash=None): """ Method that checks if the given hash is stored in the md5db.net website. :param hash: hash to verify. :return: Resolved hash. If nothing was found, it will return an empty list. """ apiURL = "http://md5db.net/api/" + str(hash).lower() try: # Getting the result ...
python
def checkIfHashIsCracked(hash=None): """ Method that checks if the given hash is stored in the md5db.net website. :param hash: hash to verify. :return: Resolved hash. If nothing was found, it will return an empty list. """ apiURL = "http://md5db.net/api/" + str(hash).lower() try: # Getting the result ...
[ "def", "checkIfHashIsCracked", "(", "hash", "=", "None", ")", ":", "apiURL", "=", "\"http://md5db.net/api/\"", "+", "str", "(", "hash", ")", ".", "lower", "(", ")", "try", ":", "# Getting the result of the query from MD5db.net", "data", "=", "urllib2", ".", "url...
Method that checks if the given hash is stored in the md5db.net website. :param hash: hash to verify. :return: Resolved hash. If nothing was found, it will return an empty list.
[ "Method", "that", "checks", "if", "the", "given", "hash", "is", "stored", "in", "the", "md5db", ".", "net", "website", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/md5db_net/checkIfHashIsCracked.py#L26-L46
5,462
i3visio/osrframework
osrframework/usufy.py
fuzzUsufy
def fuzzUsufy(fDomains = None, fFuzzStruct = None): """ Method to guess the usufy path against a list of domains or subdomains. Args: ----- fDomains: A list to strings containing the domains and (optionally) a nick. fFuzzStruct: A list to strings containing the transforms to...
python
def fuzzUsufy(fDomains = None, fFuzzStruct = None): """ Method to guess the usufy path against a list of domains or subdomains. Args: ----- fDomains: A list to strings containing the domains and (optionally) a nick. fFuzzStruct: A list to strings containing the transforms to...
[ "def", "fuzzUsufy", "(", "fDomains", "=", "None", ",", "fFuzzStruct", "=", "None", ")", ":", "if", "fFuzzStruct", "==", "None", ":", "# Loading these structures by default", "fuzzingStructures", "=", "[", "\"http://<DOMAIN>/<USERNAME>\"", ",", "\"http://<DOMAIN>/~<USERN...
Method to guess the usufy path against a list of domains or subdomains. Args: ----- fDomains: A list to strings containing the domains and (optionally) a nick. fFuzzStruct: A list to strings containing the transforms to be performed. Returns: -------- di...
[ "Method", "to", "guess", "the", "usufy", "path", "against", "a", "list", "of", "domains", "or", "subdomains", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/usufy.py#L50-L145
5,463
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/search.py
SearchAPIRequest._prepare_filtering_params
def _prepare_filtering_params(domain=None, category=None, sponsored_source=None, has_field=None, has_fields=None, query_params_match=None, query_person_match=None, **kwargs): """Transform the params to th...
python
def _prepare_filtering_params(domain=None, category=None, sponsored_source=None, has_field=None, has_fields=None, query_params_match=None, query_person_match=None, **kwargs): """Transform the params to th...
[ "def", "_prepare_filtering_params", "(", "domain", "=", "None", ",", "category", "=", "None", ",", "sponsored_source", "=", "None", ",", "has_field", "=", "None", ",", "has_fields", "=", "None", ",", "query_params_match", "=", "None", ",", "query_person_match", ...
Transform the params to the API format, return a list of params.
[ "Transform", "the", "params", "to", "the", "API", "format", "return", "a", "list", "of", "params", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L180-L207
5,464
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/search.py
SearchAPIRequest.validate_query_params
def validate_query_params(self, strict=True): """Check if the request is valid and can be sent, raise ValueError if not. `strict` is a boolean argument that defaults to True which means an exception is raised on every invalid query parameter, if set to False an e...
python
def validate_query_params(self, strict=True): """Check if the request is valid and can be sent, raise ValueError if not. `strict` is a boolean argument that defaults to True which means an exception is raised on every invalid query parameter, if set to False an e...
[ "def", "validate_query_params", "(", "self", ",", "strict", "=", "True", ")", ":", "if", "not", "(", "self", ".", "api_key", "or", "default_api_key", ")", ":", "raise", "ValueError", "(", "'API key is missing'", ")", "if", "strict", "and", "self", ".", "qu...
Check if the request is valid and can be sent, raise ValueError if not. `strict` is a boolean argument that defaults to True which means an exception is raised on every invalid query parameter, if set to False an exception is raised only when the search request cannot be ...
[ "Check", "if", "the", "request", "is", "valid", "and", "can", "be", "sent", "raise", "ValueError", "if", "not", ".", "strict", "is", "a", "boolean", "argument", "that", "defaults", "to", "True", "which", "means", "an", "exception", "is", "raised", "on", ...
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L322-L340
5,465
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/search.py
SearchAPIResponse.group_records_by_domain
def group_records_by_domain(self): """Return the records grouped by the domain they came from. The return value is a dict, a key in this dict is a domain and the value is a list of all the records with this domain. """ key_function = lambda record: record...
python
def group_records_by_domain(self): """Return the records grouped by the domain they came from. The return value is a dict, a key in this dict is a domain and the value is a list of all the records with this domain. """ key_function = lambda record: record...
[ "def", "group_records_by_domain", "(", "self", ")", ":", "key_function", "=", "lambda", "record", ":", "record", ".", "source", ".", "domain", "return", "self", ".", "group_records", "(", "key_function", ")" ]
Return the records grouped by the domain they came from. The return value is a dict, a key in this dict is a domain and the value is a list of all the records with this domain.
[ "Return", "the", "records", "grouped", "by", "the", "domain", "they", "came", "from", ".", "The", "return", "value", "is", "a", "dict", "a", "key", "in", "this", "dict", "is", "a", "domain", "and", "the", "value", "is", "a", "list", "of", "all", "the...
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L532-L540
5,466
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/search.py
SearchAPIResponse.group_records_by_category
def group_records_by_category(self): """Return the records grouped by the category of their source. The return value is a dict, a key in this dict is a category and the value is a list of all the records with this category. """ Source.validate_categories(...
python
def group_records_by_category(self): """Return the records grouped by the category of their source. The return value is a dict, a key in this dict is a category and the value is a list of all the records with this category. """ Source.validate_categories(...
[ "def", "group_records_by_category", "(", "self", ")", ":", "Source", ".", "validate_categories", "(", "categories", ")", "key_function", "=", "lambda", "record", ":", "record", ".", "source", ".", "category", "return", "self", ".", "group_records", "(", "key_fun...
Return the records grouped by the category of their source. The return value is a dict, a key in this dict is a category and the value is a list of all the records with this category.
[ "Return", "the", "records", "grouped", "by", "the", "category", "of", "their", "source", ".", "The", "return", "value", "is", "a", "dict", "a", "key", "in", "this", "dict", "is", "a", "category", "and", "the", "value", "is", "a", "list", "of", "all", ...
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L542-L551
5,467
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/search.py
SearchAPIResponse.from_dict
def from_dict(d): """Transform the dict to a response object and return the response.""" warnings_ = d.get('warnings', []) query = d.get('query') or None if query: query = Person.from_dict(query) person = d.get('person') or None if person: ...
python
def from_dict(d): """Transform the dict to a response object and return the response.""" warnings_ = d.get('warnings', []) query = d.get('query') or None if query: query = Person.from_dict(query) person = d.get('person') or None if person: ...
[ "def", "from_dict", "(", "d", ")", ":", "warnings_", "=", "d", ".", "get", "(", "'warnings'", ",", "[", "]", ")", "query", "=", "d", ".", "get", "(", "'query'", ")", "or", "None", "if", "query", ":", "query", "=", "Person", ".", "from_dict", "(",...
Transform the dict to a response object and return the response.
[ "Transform", "the", "dict", "to", "a", "response", "object", "and", "return", "the", "response", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L576-L594
5,468
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/search.py
SearchAPIResponse.to_dict
def to_dict(self): """Return a dict representation of the response.""" d = {} if self.warnings: d['warnings'] = self.warnings if self.query is not None: d['query'] = self.query.to_dict() if self.person is not None: d['person'] = self.pe...
python
def to_dict(self): """Return a dict representation of the response.""" d = {} if self.warnings: d['warnings'] = self.warnings if self.query is not None: d['query'] = self.query.to_dict() if self.person is not None: d['person'] = self.pe...
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "if", "self", ".", "warnings", ":", "d", "[", "'warnings'", "]", "=", "self", ".", "warnings", "if", "self", ".", "query", "is", "not", "None", ":", "d", "[", "'query'", "]", "=", "se...
Return a dict representation of the response.
[ "Return", "a", "dict", "representation", "of", "the", "response", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L596-L610
5,469
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Field.from_dict
def from_dict(cls, d): """Transform the dict to a field object and return the field.""" kwargs = {} for key, val in d.iteritems(): if key.startswith('display'): # includes phone.display_international continue if key.startswith('@'): ...
python
def from_dict(cls, d): """Transform the dict to a field object and return the field.""" kwargs = {} for key, val in d.iteritems(): if key.startswith('display'): # includes phone.display_international continue if key.startswith('@'): ...
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "kwargs", "=", "{", "}", "for", "key", ",", "val", "in", "d", ".", "iteritems", "(", ")", ":", "if", "key", ".", "startswith", "(", "'display'", ")", ":", "# includes phone.display_international\r", "...
Transform the dict to a field object and return the field.
[ "Transform", "the", "dict", "to", "a", "field", "object", "and", "return", "the", "field", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L87-L102
5,470
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Field.to_dict
def to_dict(self): """Return a dict representation of the field.""" d = {} if self.valid_since is not None: d['@valid_since'] = datetime_to_str(self.valid_since) for attr_list, prefix in [(self.attributes, '@'), (self.children, '')]: for attr in attr_list: ...
python
def to_dict(self): """Return a dict representation of the field.""" d = {} if self.valid_since is not None: d['@valid_since'] = datetime_to_str(self.valid_since) for attr_list, prefix in [(self.attributes, '@'), (self.children, '')]: for attr in attr_list: ...
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "if", "self", ".", "valid_since", "is", "not", "None", ":", "d", "[", "'@valid_since'", "]", "=", "datetime_to_str", "(", "self", ".", "valid_since", ")", "for", "attr_list", ",", "prefix", ...
Return a dict representation of the field.
[ "Return", "a", "dict", "representation", "of", "the", "field", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L104-L118
5,471
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Name.is_searchable
def is_searchable(self): """A bool value that indicates whether the name is a valid name to search by.""" first = alpha_chars(self.first or u'') last = alpha_chars(self.last or u'') raw = alpha_chars(self.raw or u'') return (len(first) >= 2 and len(last) >= 2) or l...
python
def is_searchable(self): """A bool value that indicates whether the name is a valid name to search by.""" first = alpha_chars(self.first or u'') last = alpha_chars(self.last or u'') raw = alpha_chars(self.raw or u'') return (len(first) >= 2 and len(last) >= 2) or l...
[ "def", "is_searchable", "(", "self", ")", ":", "first", "=", "alpha_chars", "(", "self", ".", "first", "or", "u''", ")", "last", "=", "alpha_chars", "(", "self", ".", "last", "or", "u''", ")", "raw", "=", "alpha_chars", "(", "self", ".", "raw", "or",...
A bool value that indicates whether the name is a valid name to search by.
[ "A", "bool", "value", "that", "indicates", "whether", "the", "name", "is", "a", "valid", "name", "to", "search", "by", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L163-L169
5,472
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Address.is_searchable
def is_searchable(self): """A bool value that indicates whether the address is a valid address to search by.""" return self.raw or (self.is_valid_country and (not self.state or self.is_valid_state))
python
def is_searchable(self): """A bool value that indicates whether the address is a valid address to search by.""" return self.raw or (self.is_valid_country and (not self.state or self.is_valid_state))
[ "def", "is_searchable", "(", "self", ")", ":", "return", "self", ".", "raw", "or", "(", "self", ".", "is_valid_country", "and", "(", "not", "self", ".", "state", "or", "self", ".", "is_valid_state", ")", ")" ]
A bool value that indicates whether the address is a valid address to search by.
[ "A", "bool", "value", "that", "indicates", "whether", "the", "address", "is", "a", "valid", "address", "to", "search", "by", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L233-L237
5,473
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Address.is_valid_state
def is_valid_state(self): """A bool value that indicates whether the object's state is a valid state code.""" return self.is_valid_country and self.country.upper() in STATES and \ self.state is not None and \ self.state.upper() in STATES[self.country.upper()]
python
def is_valid_state(self): """A bool value that indicates whether the object's state is a valid state code.""" return self.is_valid_country and self.country.upper() in STATES and \ self.state is not None and \ self.state.upper() in STATES[self.country.upper()]
[ "def", "is_valid_state", "(", "self", ")", ":", "return", "self", ".", "is_valid_country", "and", "self", ".", "country", ".", "upper", "(", ")", "in", "STATES", "and", "self", ".", "state", "is", "not", "None", "and", "self", ".", "state", ".", "upper...
A bool value that indicates whether the object's state is a valid state code.
[ "A", "bool", "value", "that", "indicates", "whether", "the", "object", "s", "state", "is", "a", "valid", "state", "code", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L246-L251
5,474
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Phone.to_dict
def to_dict(self): """Extend Field.to_dict, take the display_international attribute.""" d = Field.to_dict(self) if self.display_international: d['display_international'] = self.display_international return d
python
def to_dict(self): """Extend Field.to_dict, take the display_international attribute.""" d = Field.to_dict(self) if self.display_international: d['display_international'] = self.display_international return d
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "Field", ".", "to_dict", "(", "self", ")", "if", "self", ".", "display_international", ":", "d", "[", "'display_international'", "]", "=", "self", ".", "display_international", "return", "d" ]
Extend Field.to_dict, take the display_international attribute.
[ "Extend", "Field", ".", "to_dict", "take", "the", "display_international", "attribute", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L345-L350
5,475
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Email.is_valid_email
def is_valid_email(self): """A bool value that indicates whether the address is a valid email address. Note that the check is done be matching to the regular expression at Email.re_email which is very basic and far from covering end-cases... """ ...
python
def is_valid_email(self): """A bool value that indicates whether the address is a valid email address. Note that the check is done be matching to the regular expression at Email.re_email which is very basic and far from covering end-cases... """ ...
[ "def", "is_valid_email", "(", "self", ")", ":", "return", "bool", "(", "self", ".", "address", "and", "Email", ".", "re_email", ".", "match", "(", "self", ".", "address", ")", ")" ]
A bool value that indicates whether the address is a valid email address. Note that the check is done be matching to the regular expression at Email.re_email which is very basic and far from covering end-cases...
[ "A", "bool", "value", "that", "indicates", "whether", "the", "address", "is", "a", "valid", "email", "address", ".", "Note", "that", "the", "check", "is", "done", "be", "matching", "to", "the", "regular", "expression", "at", "Email", ".", "re_email", "whic...
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L383-L391
5,476
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.age
def age(self): """int, the estimated age of the person. Note that A DOB object is based on a date-range and the exact date is usually unknown so for age calculation the the middle of the range is assumed to be the real date-of-birth. """ if se...
python
def age(self): """int, the estimated age of the person. Note that A DOB object is based on a date-range and the exact date is usually unknown so for age calculation the the middle of the range is assumed to be the real date-of-birth. """ if se...
[ "def", "age", "(", "self", ")", ":", "if", "self", ".", "date_range", "is", "None", ":", "return", "dob", "=", "self", ".", "date_range", ".", "middle", "today", "=", "datetime", ".", "date", ".", "today", "(", ")", "if", "(", "today", ".", "month"...
int, the estimated age of the person. Note that A DOB object is based on a date-range and the exact date is usually unknown so for age calculation the the middle of the range is assumed to be the real date-of-birth.
[ "int", "the", "estimated", "age", "of", "the", "person", ".", "Note", "that", "A", "DOB", "object", "is", "based", "on", "a", "date", "-", "range", "and", "the", "exact", "date", "is", "usually", "unknown", "so", "for", "age", "calculation", "the", "th...
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L619-L634
5,477
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.age_range
def age_range(self): """A tuple of two ints - the minimum and maximum age of the person.""" if self.date_range is None: return None, None start_date = DateRange(self.date_range.start, self.date_range.start) end_date = DateRange(self.date_range.end, self.date_range.end) ...
python
def age_range(self): """A tuple of two ints - the minimum and maximum age of the person.""" if self.date_range is None: return None, None start_date = DateRange(self.date_range.start, self.date_range.start) end_date = DateRange(self.date_range.end, self.date_range.end) ...
[ "def", "age_range", "(", "self", ")", ":", "if", "self", ".", "date_range", "is", "None", ":", "return", "None", ",", "None", "start_date", "=", "DateRange", "(", "self", ".", "date_range", ".", "start", ",", "self", ".", "date_range", ".", "start", ")...
A tuple of two ints - the minimum and maximum age of the person.
[ "A", "tuple", "of", "two", "ints", "-", "the", "minimum", "and", "maximum", "age", "of", "the", "person", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L637-L645
5,478
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.from_age_range
def from_age_range(start_age, end_age): """Take a person's minimal and maximal age and return a new DOB object suitable for him.""" if start_age < 0 or end_age < 0: raise ValueError('start_age and end_age can\'t be negative') if start_age > end_age: ...
python
def from_age_range(start_age, end_age): """Take a person's minimal and maximal age and return a new DOB object suitable for him.""" if start_age < 0 or end_age < 0: raise ValueError('start_age and end_age can\'t be negative') if start_age > end_age: ...
[ "def", "from_age_range", "(", "start_age", ",", "end_age", ")", ":", "if", "start_age", "<", "0", "or", "end_age", "<", "0", ":", "raise", "ValueError", "(", "'start_age and end_age can\\'t be negative'", ")", "if", "start_age", ">", "end_age", ":", "start_age",...
Take a person's minimal and maximal age and return a new DOB object suitable for him.
[ "Take", "a", "person", "s", "minimal", "and", "maximal", "age", "and", "return", "a", "new", "DOB", "object", "suitable", "for", "him", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L672-L695
5,479
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Relationship.from_dict
def from_dict(cls, d): """Extend Field.from_dict and also load the name from the dict.""" relationship = super(cls, cls).from_dict(d) if relationship.name is not None: relationship.name = Name.from_dict(relationship.name) return relationship
python
def from_dict(cls, d): """Extend Field.from_dict and also load the name from the dict.""" relationship = super(cls, cls).from_dict(d) if relationship.name is not None: relationship.name = Name.from_dict(relationship.name) return relationship
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "relationship", "=", "super", "(", "cls", ",", "cls", ")", ".", "from_dict", "(", "d", ")", "if", "relationship", ".", "name", "is", "not", "None", ":", "relationship", ".", "name", "=", "Name", "...
Extend Field.from_dict and also load the name from the dict.
[ "Extend", "Field", ".", "from_dict", "and", "also", "load", "the", "name", "from", "the", "dict", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L762-L767
5,480
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DateRange.from_dict
def from_dict(d): """Transform the dict to a DateRange object.""" start = d.get('start') end = d.get('end') if not (start and end): raise ValueError('DateRange must have both start and end') start = str_to_date(start) end = str_to_date(end) ret...
python
def from_dict(d): """Transform the dict to a DateRange object.""" start = d.get('start') end = d.get('end') if not (start and end): raise ValueError('DateRange must have both start and end') start = str_to_date(start) end = str_to_date(end) ret...
[ "def", "from_dict", "(", "d", ")", ":", "start", "=", "d", ".", "get", "(", "'start'", ")", "end", "=", "d", ".", "get", "(", "'end'", ")", "if", "not", "(", "start", "and", "end", ")", ":", "raise", "ValueError", "(", "'DateRange must have both star...
Transform the dict to a DateRange object.
[ "Transform", "the", "dict", "to", "a", "DateRange", "object", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L854-L862
5,481
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DateRange.to_dict
def to_dict(self): """Transform the date-range to a dict.""" d = {} d['start'] = date_to_str(self.start) d['end'] = date_to_str(self.end) return d
python
def to_dict(self): """Transform the date-range to a dict.""" d = {} d['start'] = date_to_str(self.start) d['end'] = date_to_str(self.end) return d
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "d", "[", "'start'", "]", "=", "date_to_str", "(", "self", ".", "start", ")", "d", "[", "'end'", "]", "=", "date_to_str", "(", "self", ".", "end", ")", "return", "d" ]
Transform the date-range to a dict.
[ "Transform", "the", "date", "-", "range", "to", "a", "dict", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L864-L869
5,482
i3visio/osrframework
osrframework/enumeration.py
enumerateURL
def enumerateURL(urlDict, outputFolder, startIndex= 0, maxErrors = 100): """ Function that performs the enumeration itself. """ for i, url in enumerate(urlDict.keys()): # Grabbing domain name: domain = re.findall("://(.*)/", url)[0] # Defining the starting index ...
python
def enumerateURL(urlDict, outputFolder, startIndex= 0, maxErrors = 100): """ Function that performs the enumeration itself. """ for i, url in enumerate(urlDict.keys()): # Grabbing domain name: domain = re.findall("://(.*)/", url)[0] # Defining the starting index ...
[ "def", "enumerateURL", "(", "urlDict", ",", "outputFolder", ",", "startIndex", "=", "0", ",", "maxErrors", "=", "100", ")", ":", "for", "i", ",", "url", "in", "enumerate", "(", "urlDict", ".", "keys", "(", ")", ")", ":", "# Grabbing domain name:\r", "dom...
Function that performs the enumeration itself.
[ "Function", "that", "performs", "the", "enumeration", "itself", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/enumeration.py#L36-L78
5,483
i3visio/osrframework
osrframework/thirdparties/haveibeenpwned_com/hibp.py
checkIfEmailWasHacked
def checkIfEmailWasHacked(email=None, sleepSeconds=1): """ Method that checks if the given email is stored in the HIBP website. This function automatically waits a second to avoid problems with the API rate limit. An example of the json received: ``` [{"Title":"Adobe","Name":"Adobe","Domain...
python
def checkIfEmailWasHacked(email=None, sleepSeconds=1): """ Method that checks if the given email is stored in the HIBP website. This function automatically waits a second to avoid problems with the API rate limit. An example of the json received: ``` [{"Title":"Adobe","Name":"Adobe","Domain...
[ "def", "checkIfEmailWasHacked", "(", "email", "=", "None", ",", "sleepSeconds", "=", "1", ")", ":", "# Sleeping just a little bit", "time", ".", "sleep", "(", "sleepSeconds", ")", "print", "(", "\"\\t[*] Bypassing Cloudflare Restriction...\"", ")", "ua", "=", "'osrf...
Method that checks if the given email is stored in the HIBP website. This function automatically waits a second to avoid problems with the API rate limit. An example of the json received: ``` [{"Title":"Adobe","Name":"Adobe","Domain":"adobe.com","BreachDate":"2013-10-4","AddedDate":"2013-12-04T00:1...
[ "Method", "that", "checks", "if", "the", "given", "email", "is", "stored", "in", "the", "HIBP", "website", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/haveibeenpwned_com/hibp.py#L30-L124
5,484
i3visio/osrframework
osrframework/searchengines/google.py
get_page
def get_page(url): """ Request the given URL and return the response page, using the cookie jar. @type url: str @param url: URL to retrieve. @rtype: str @return: Web page retrieved for the given URL. @raise IOError: An exception is raised on error. @raise urllib2.URLError...
python
def get_page(url): """ Request the given URL and return the response page, using the cookie jar. @type url: str @param url: URL to retrieve. @rtype: str @return: Web page retrieved for the given URL. @raise IOError: An exception is raised on error. @raise urllib2.URLError...
[ "def", "get_page", "(", "url", ")", ":", "request", "=", "Request", "(", "url", ")", "request", ".", "add_header", "(", "'User-Agent'", ",", "'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)'", ")", "cookie_jar", ".", "add_cookie_header", "(", "request", ")", "...
Request the given URL and return the response page, using the cookie jar. @type url: str @param url: URL to retrieve. @rtype: str @return: Web page retrieved for the given URL. @raise IOError: An exception is raised on error. @raise urllib2.URLError: An exception is raised on error...
[ "Request", "the", "given", "URL", "and", "return", "the", "response", "page", "using", "the", "cookie", "jar", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/searchengines/google.py#L62-L85
5,485
i3visio/osrframework
osrframework/searchengines/google.py
search
def search(query, tld='com', lang='en', num=10, start=0, stop=None, pause=2.0, only_standard=False): """ Search the given query string using Google. @type query: str @param query: Query string. Must NOT be url-encoded. @type tld: str @param tld: Top level domain. @...
python
def search(query, tld='com', lang='en', num=10, start=0, stop=None, pause=2.0, only_standard=False): """ Search the given query string using Google. @type query: str @param query: Query string. Must NOT be url-encoded. @type tld: str @param tld: Top level domain. @...
[ "def", "search", "(", "query", ",", "tld", "=", "'com'", ",", "lang", "=", "'en'", ",", "num", "=", "10", ",", "start", "=", "0", ",", "stop", "=", "None", ",", "pause", "=", "2.0", ",", "only_standard", "=", "False", ")", ":", "# Lazy import of Be...
Search the given query string using Google. @type query: str @param query: Query string. Must NOT be url-encoded. @type tld: str @param tld: Top level domain. @type lang: str @param lang: Languaje. @type num: int @param num: Number of results per page. @type s...
[ "Search", "the", "given", "query", "string", "using", "Google", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/searchengines/google.py#L114-L234
5,486
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.add_fields
def add_fields(self, fields): """Add the fields to their corresponding container. `fields` is an iterable of field objects from osrframework.thirdparties.pipl_com.lib.fields. """ for field in fields: cls = field.__class__ try: con...
python
def add_fields(self, fields): """Add the fields to their corresponding container. `fields` is an iterable of field objects from osrframework.thirdparties.pipl_com.lib.fields. """ for field in fields: cls = field.__class__ try: con...
[ "def", "add_fields", "(", "self", ",", "fields", ")", ":", "for", "field", "in", "fields", ":", "cls", "=", "field", ".", "__class__", "try", ":", "container", "=", "FieldsContainer", ".", "class_container", "[", "cls", "]", "except", "KeyError", ":", "r...
Add the fields to their corresponding container. `fields` is an iterable of field objects from osrframework.thirdparties.pipl_com.lib.fields.
[ "Add", "the", "fields", "to", "their", "corresponding", "container", ".", "fields", "is", "an", "iterable", "of", "field", "objects", "from", "osrframework", ".", "thirdparties", ".", "pipl_com", ".", "lib", ".", "fields", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L48-L60
5,487
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.all_fields
def all_fields(self): """A list with all the fields contained in this object.""" return [field for container in FieldsContainer.class_container.values() for field in getattr(self, container)]
python
def all_fields(self): """A list with all the fields contained in this object.""" return [field for container in FieldsContainer.class_container.values() for field in getattr(self, container)]
[ "def", "all_fields", "(", "self", ")", ":", "return", "[", "field", "for", "container", "in", "FieldsContainer", ".", "class_container", ".", "values", "(", ")", "for", "field", "in", "getattr", "(", "self", ",", "container", ")", "]" ]
A list with all the fields contained in this object.
[ "A", "list", "with", "all", "the", "fields", "contained", "in", "this", "object", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L63-L67
5,488
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.fields_from_dict
def fields_from_dict(d): """Load the fields from the dict, return a list with all the fields.""" class_container = FieldsContainer.class_container fields = [field_cls.from_dict(field_dict) for field_cls, container in class_container.iteritems() for field_dict...
python
def fields_from_dict(d): """Load the fields from the dict, return a list with all the fields.""" class_container = FieldsContainer.class_container fields = [field_cls.from_dict(field_dict) for field_cls, container in class_container.iteritems() for field_dict...
[ "def", "fields_from_dict", "(", "d", ")", ":", "class_container", "=", "FieldsContainer", ".", "class_container", "fields", "=", "[", "field_cls", ".", "from_dict", "(", "field_dict", ")", "for", "field_cls", ",", "container", "in", "class_container", ".", "iter...
Load the fields from the dict, return a list with all the fields.
[ "Load", "the", "fields", "from", "the", "dict", "return", "a", "list", "with", "all", "the", "fields", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L70-L76
5,489
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.fields_to_dict
def fields_to_dict(self): """Transform the object to a dict and return the dict.""" d = {} for container in FieldsContainer.class_container.values(): fields = getattr(self, container) if fields: d[container] = [field.to_dict() for field in fields] ...
python
def fields_to_dict(self): """Transform the object to a dict and return the dict.""" d = {} for container in FieldsContainer.class_container.values(): fields = getattr(self, container) if fields: d[container] = [field.to_dict() for field in fields] ...
[ "def", "fields_to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "for", "container", "in", "FieldsContainer", ".", "class_container", ".", "values", "(", ")", ":", "fields", "=", "getattr", "(", "self", ",", "container", ")", "if", "fields", ":", "d...
Transform the object to a dict and return the dict.
[ "Transform", "the", "object", "to", "a", "dict", "and", "return", "the", "dict", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L78-L85
5,490
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Record.from_dict
def from_dict(d): """Transform the dict to a record object and return the record.""" query_params_match = d.get('@query_params_match') query_person_match = d.get('@query_person_match') valid_since = d.get('@valid_since') if valid_since: valid_since = str_to_datetime(v...
python
def from_dict(d): """Transform the dict to a record object and return the record.""" query_params_match = d.get('@query_params_match') query_person_match = d.get('@query_person_match') valid_since = d.get('@valid_since') if valid_since: valid_since = str_to_datetime(v...
[ "def", "from_dict", "(", "d", ")", ":", "query_params_match", "=", "d", ".", "get", "(", "'@query_params_match'", ")", "query_person_match", "=", "d", ".", "get", "(", "'@query_person_match'", ")", "valid_since", "=", "d", ".", "get", "(", "'@valid_since'", ...
Transform the dict to a record object and return the record.
[ "Transform", "the", "dict", "to", "a", "record", "object", "and", "return", "the", "record", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L145-L157
5,491
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Record.to_dict
def to_dict(self): """Return a dict representation of the record.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.query_person_match is not None: d['@query_person_match'] = self.query_person_match ...
python
def to_dict(self): """Return a dict representation of the record.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.query_person_match is not None: d['@query_person_match'] = self.query_person_match ...
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "if", "self", ".", "query_params_match", "is", "not", "None", ":", "d", "[", "'@query_params_match'", "]", "=", "self", ".", "query_params_match", "if", "self", ".", "query_person_match", "is", ...
Return a dict representation of the record.
[ "Return", "a", "dict", "representation", "of", "the", "record", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L159-L171
5,492
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.is_searchable
def is_searchable(self): """A bool value that indicates whether the person has enough data and can be sent as a query to the API.""" filter_func = lambda field: field.is_searchable return bool(filter(filter_func, self.names) or filter(filter_func, self.emails) or ...
python
def is_searchable(self): """A bool value that indicates whether the person has enough data and can be sent as a query to the API.""" filter_func = lambda field: field.is_searchable return bool(filter(filter_func, self.names) or filter(filter_func, self.emails) or ...
[ "def", "is_searchable", "(", "self", ")", ":", "filter_func", "=", "lambda", "field", ":", "field", ".", "is_searchable", "return", "bool", "(", "filter", "(", "filter_func", ",", "self", ".", "names", ")", "or", "filter", "(", "filter_func", ",", "self", ...
A bool value that indicates whether the person has enough data and can be sent as a query to the API.
[ "A", "bool", "value", "that", "indicates", "whether", "the", "person", "has", "enough", "data", "and", "can", "be", "sent", "as", "a", "query", "to", "the", "API", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L222-L229
5,493
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.from_dict
def from_dict(d): """Transform the dict to a person object and return the person.""" query_params_match = d.get('@query_params_match') sources = [Source.from_dict(source) for source in d.get('sources', [])] fields = Person.fields_from_dict(d) return Person(fields=fields, sources=...
python
def from_dict(d): """Transform the dict to a person object and return the person.""" query_params_match = d.get('@query_params_match') sources = [Source.from_dict(source) for source in d.get('sources', [])] fields = Person.fields_from_dict(d) return Person(fields=fields, sources=...
[ "def", "from_dict", "(", "d", ")", ":", "query_params_match", "=", "d", ".", "get", "(", "'@query_params_match'", ")", "sources", "=", "[", "Source", ".", "from_dict", "(", "source", ")", "for", "source", "in", "d", ".", "get", "(", "'sources'", ",", "...
Transform the dict to a person object and return the person.
[ "Transform", "the", "dict", "to", "a", "person", "object", "and", "return", "the", "person", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L248-L254
5,494
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.to_dict
def to_dict(self): """Return a dict representation of the person.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.sources: d['sources'] = [source.to_dict() for source in self.sources] d.update(se...
python
def to_dict(self): """Return a dict representation of the person.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.sources: d['sources'] = [source.to_dict() for source in self.sources] d.update(se...
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "if", "self", ".", "query_params_match", "is", "not", "None", ":", "d", "[", "'@query_params_match'", "]", "=", "self", ".", "query_params_match", "if", "self", ".", "sources", ":", "d", "[",...
Return a dict representation of the person.
[ "Return", "a", "dict", "representation", "of", "the", "person", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L256-L264
5,495
i3visio/osrframework
osrframework/phonefy.py
processPhoneList
def processPhoneList(platformNames=[], numbers=[], excludePlatformNames=[]): """ Method to perform searchs on a series of numbers. Args: ----- platformNames: List of names of the platforms. numbers: List of numbers to be queried. excludePlatformNames: A list of platforms not to ...
python
def processPhoneList(platformNames=[], numbers=[], excludePlatformNames=[]): """ Method to perform searchs on a series of numbers. Args: ----- platformNames: List of names of the platforms. numbers: List of numbers to be queried. excludePlatformNames: A list of platforms not to ...
[ "def", "processPhoneList", "(", "platformNames", "=", "[", "]", ",", "numbers", "=", "[", "]", ",", "excludePlatformNames", "=", "[", "]", ")", ":", "# Grabbing the <Platform> objects", "platforms", "=", "platform_selection", ".", "getPlatformsByName", "(", "platf...
Method to perform searchs on a series of numbers. Args: ----- platformNames: List of names of the platforms. numbers: List of numbers to be queried. excludePlatformNames: A list of platforms not to be searched. Return: ------- A list of verified emails.
[ "Method", "to", "perform", "searchs", "on", "a", "series", "of", "numbers", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/phonefy.py#L37-L61
5,496
i3visio/osrframework
osrframework/utils/platforms.py
Platform.createURL
def createURL(self, word, mode="phonefy"): """ Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried. """ ...
python
def createURL(self, word, mode="phonefy"): """ Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried. """ ...
[ "def", "createURL", "(", "self", ",", "word", ",", "mode", "=", "\"phonefy\"", ")", ":", "try", ":", "return", "self", ".", "modes", "[", "mode", "]", "[", "\"url\"", "]", ".", "format", "(", "placeholder", "=", "urllib", ".", "pathname2url", "(", "w...
Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried.
[ "Method", "to", "create", "the", "URL", "replacing", "the", "word", "in", "the", "appropriate", "URL", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L86-L112
5,497
i3visio/osrframework
osrframework/utils/platforms.py
Platform.launchQueryForMode
def launchQueryForMode(self, query=None, mode=None): """ Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing...
python
def launchQueryForMode(self, query=None, mode=None): """ Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing...
[ "def", "launchQueryForMode", "(", "self", ",", "query", "=", "None", ",", "mode", "=", "None", ")", ":", "# Creating the query URL for that mode", "qURL", "=", "self", ".", "createURL", "(", "word", "=", "query", ",", "mode", "=", "mode", ")", "i3Browser", ...
Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing the recovered data or None.
[ "Method", "that", "launches", "an", "i3Browser", "to", "collect", "data", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L115-L144
5,498
i3visio/osrframework
osrframework/utils/platforms.py
Platform.getInfo
def getInfo(self, query=None, process=False, mode="phonefy", qURI=None): """ Method that checks the presence of a given query and recovers the first list of complains. Args: ----- query: Query to verify. process: Calling the processing function. mode:...
python
def getInfo(self, query=None, process=False, mode="phonefy", qURI=None): """ Method that checks the presence of a given query and recovers the first list of complains. Args: ----- query: Query to verify. process: Calling the processing function. mode:...
[ "def", "getInfo", "(", "self", ",", "query", "=", "None", ",", "process", "=", "False", ",", "mode", "=", "\"phonefy\"", ",", "qURI", "=", "None", ")", ":", "results", "=", "[", "]", "data", "=", "\"\"", "if", "self", ".", "_modeIsValid", "(", "mod...
Method that checks the presence of a given query and recovers the first list of complains. Args: ----- query: Query to verify. process: Calling the processing function. mode: Mode to be executed. qURI: A query to be checked. Return: -----...
[ "Method", "that", "checks", "the", "presence", "of", "a", "given", "query", "and", "recovers", "the", "first", "list", "of", "complains", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L147-L178
5,499
i3visio/osrframework
osrframework/utils/platforms.py
Platform._modeIsValid
def _modeIsValid(self, mode): """ Verification of whether the mode is a correct option to be used. Args: ----- mode: Mode to be executed. Return: ------- True if the mode exists in the three main folders. """ try: # Su...
python
def _modeIsValid(self, mode): """ Verification of whether the mode is a correct option to be used. Args: ----- mode: Mode to be executed. Return: ------- True if the mode exists in the three main folders. """ try: # Su...
[ "def", "_modeIsValid", "(", "self", ",", "mode", ")", ":", "try", ":", "# Suport for version 2 of wrappers", "return", "mode", "in", "self", ".", "modes", ".", "keys", "(", ")", "except", "AttributeError", "as", "e", ":", "# Legacy for mantaining old wrappers", ...
Verification of whether the mode is a correct option to be used. Args: ----- mode: Mode to be executed. Return: ------- True if the mode exists in the three main folders.
[ "Verification", "of", "whether", "the", "mode", "is", "a", "correct", "option", "to", "be", "used", "." ]
83437f4c14c9c08cb80a896bd9834c77f6567871
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L181-L201