repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
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",
"... | train | https://github.com/python-hyper/brotlipy/blob/ffddf2ea5adc584c8c353d246bb1077b7e781b63/src/brotli/brotli.py#L451-L466 |
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"... | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/examples/char_lcd_rgb_pwm.py#L9-L36 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L183-L189 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L191-L197 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L199-L205 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L207-L213 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L223-L226 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L228-L231 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L233-L241 |
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",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L243-L256 |
adafruit/Adafruit_Python_CharLCD | Adafruit_CharLCD/Adafruit_CharLCD.py | Adafruit_CharLCD.set_backlight | def set_backlight(self, backlight):
"""Enable or disable the backlight. If PWM is not enabled (default), a
non-zero backlight value will turn on the backlight and a zero value will
turn it off. If PWM is enabled, backlight can be any value from 0.0 to
1.0, with 1.0 being full intensity... | python | def set_backlight(self, backlight):
"""Enable or disable the backlight. If PWM is not enabled (default), a
non-zero backlight value will turn on the backlight and a zero value will
turn it off. If PWM is enabled, backlight can be any value from 0.0 to
1.0, with 1.0 being full intensity... | [
"def",
"set_backlight",
"(",
"self",
",",
"backlight",
")",
":",
"if",
"self",
".",
"_backlight",
"is",
"not",
"None",
":",
"if",
"self",
".",
"_pwm_enabled",
":",
"self",
".",
"_pwm",
".",
"set_duty_cycle",
"(",
"self",
".",
"_backlight",
",",
"self",
... | Enable or disable the backlight. If PWM is not enabled (default), a
non-zero backlight value will turn on the backlight and a zero value will
turn it off. If PWM is enabled, backlight can be any value from 0.0 to
1.0, with 1.0 being full intensity backlight. | [
"Enable",
"or",
"disable",
"the",
"backlight",
".",
"If",
"PWM",
"is",
"not",
"enabled",
"(",
"default",
")",
"a",
"non",
"-",
"zero",
"backlight",
"value",
"will",
"turn",
"on",
"the",
"backlight",
"and",
"a",
"zero",
"value",
"will",
"turn",
"it",
"o... | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L258-L268 |
adafruit/Adafruit_Python_CharLCD | Adafruit_CharLCD/Adafruit_CharLCD.py | Adafruit_CharLCD.write8 | def write8(self, value, char_mode=False):
"""Write 8-bit value in character or data mode. Value should be an int
value from 0-255, and char_mode is True if character data or False if
non-character data (default).
"""
# One millisecond delay to prevent writing too quickly.
... | python | def write8(self, value, char_mode=False):
"""Write 8-bit value in character or data mode. Value should be an int
value from 0-255, and char_mode is True if character data or False if
non-character data (default).
"""
# One millisecond delay to prevent writing too quickly.
... | [
"def",
"write8",
"(",
"self",
",",
"value",
",",
"char_mode",
"=",
"False",
")",
":",
"# One millisecond delay to prevent writing too quickly.",
"self",
".",
"_delay_microseconds",
"(",
"1000",
")",
"# Set character / data bit.",
"self",
".",
"_gpio",
".",
"output",
... | Write 8-bit value in character or data mode. Value should be an int
value from 0-255, and char_mode is True if character data or False if
non-character data (default). | [
"Write",
"8",
"-",
"bit",
"value",
"in",
"character",
"or",
"data",
"mode",
".",
"Value",
"should",
"be",
"an",
"int",
"value",
"from",
"0",
"-",
"255",
"and",
"char_mode",
"is",
"True",
"if",
"character",
"data",
"or",
"False",
"if",
"non",
"-",
"ch... | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L270-L290 |
adafruit/Adafruit_Python_CharLCD | Adafruit_CharLCD/Adafruit_CharLCD.py | Adafruit_CharLCD.create_char | def create_char(self, location, pattern):
"""Fill one of the first 8 CGRAM locations with custom characters.
The location parameter should be between 0 and 7 and pattern should
provide an array of 8 bytes containing the pattern. E.g. you can easyly
design your custom character at http://... | python | def create_char(self, location, pattern):
"""Fill one of the first 8 CGRAM locations with custom characters.
The location parameter should be between 0 and 7 and pattern should
provide an array of 8 bytes containing the pattern. E.g. you can easyly
design your custom character at http://... | [
"def",
"create_char",
"(",
"self",
",",
"location",
",",
"pattern",
")",
":",
"# only position 0..7 are allowed",
"location",
"&=",
"0x7",
"self",
".",
"write8",
"(",
"LCD_SETCGRAMADDR",
"|",
"(",
"location",
"<<",
"3",
")",
")",
"for",
"i",
"in",
"range",
... | Fill one of the first 8 CGRAM locations with custom characters.
The location parameter should be between 0 and 7 and pattern should
provide an array of 8 bytes containing the pattern. E.g. you can easyly
design your custom character at http://www.quinapalus.com/hd44780udg.html
To show yo... | [
"Fill",
"one",
"of",
"the",
"first",
"8",
"CGRAM",
"locations",
"with",
"custom",
"characters",
".",
"The",
"location",
"parameter",
"should",
"be",
"between",
"0",
"and",
"7",
"and",
"pattern",
"should",
"provide",
"an",
"array",
"of",
"8",
"bytes",
"cont... | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L292-L303 |
adafruit/Adafruit_Python_CharLCD | Adafruit_CharLCD/Adafruit_CharLCD.py | Adafruit_RGBCharLCD.set_color | def set_color(self, red, green, blue):
"""Set backlight color to provided red, green, and blue values. If PWM
is enabled then color components can be values from 0.0 to 1.0, otherwise
components should be zero for off and non-zero for on.
"""
if self._pwm_enabled:
# ... | python | def set_color(self, red, green, blue):
"""Set backlight color to provided red, green, and blue values. If PWM
is enabled then color components can be values from 0.0 to 1.0, otherwise
components should be zero for off and non-zero for on.
"""
if self._pwm_enabled:
# ... | [
"def",
"set_color",
"(",
"self",
",",
"red",
",",
"green",
",",
"blue",
")",
":",
"if",
"self",
".",
"_pwm_enabled",
":",
"# Set duty cycle of PWM pins.",
"rdc",
",",
"gdc",
",",
"bdc",
"=",
"self",
".",
"_rgb_to_duty_cycle",
"(",
"(",
"red",
",",
"green... | Set backlight color to provided red, green, and blue values. If PWM
is enabled then color components can be values from 0.0 to 1.0, otherwise
components should be zero for off and non-zero for on. | [
"Set",
"backlight",
"color",
"to",
"provided",
"red",
"green",
"and",
"blue",
"values",
".",
"If",
"PWM",
"is",
"enabled",
"then",
"color",
"components",
"can",
"be",
"values",
"from",
"0",
".",
"0",
"to",
"1",
".",
"0",
"otherwise",
"components",
"shoul... | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L402-L417 |
adafruit/Adafruit_Python_CharLCD | Adafruit_CharLCD/Adafruit_CharLCD.py | Adafruit_CharLCDPlate.is_pressed | def is_pressed(self, button):
"""Return True if the provided button is pressed, False otherwise."""
if button not in set((SELECT, RIGHT, DOWN, UP, LEFT)):
raise ValueError('Unknown button, must be SELECT, RIGHT, DOWN, UP, or LEFT.')
return self._mcp.input(button) == GPIO.LOW | python | def is_pressed(self, button):
"""Return True if the provided button is pressed, False otherwise."""
if button not in set((SELECT, RIGHT, DOWN, UP, LEFT)):
raise ValueError('Unknown button, must be SELECT, RIGHT, DOWN, UP, or LEFT.')
return self._mcp.input(button) == GPIO.LOW | [
"def",
"is_pressed",
"(",
"self",
",",
"button",
")",
":",
"if",
"button",
"not",
"in",
"set",
"(",
"(",
"SELECT",
",",
"RIGHT",
",",
"DOWN",
",",
"UP",
",",
"LEFT",
")",
")",
":",
"raise",
"ValueError",
"(",
"'Unknown button, must be SELECT, RIGHT, DOWN, ... | Return True if the provided button is pressed, False otherwise. | [
"Return",
"True",
"if",
"the",
"provided",
"button",
"is",
"pressed",
"False",
"otherwise",
"."
] | train | https://github.com/adafruit/Adafruit_Python_CharLCD/blob/c126e6b673074c12a03f4bd36afb2fe40272341e/Adafruit_CharLCD/Adafruit_CharLCD.py#L455-L459 |
i3visio/osrframework | osrframework/utils/regexp.py | RegexpObject.getResults | def getResults(self, parFound = None):
'''
Function to obtain the Dictionarythat represents this object.
:param parFound: values to return.
:return: The output format will be like:
[{"type" : "i3visio.email", "value": "foo@bar.com", "attri... | python | def getResults(self, parFound = None):
'''
Function to obtain the Dictionarythat represents this object.
:param parFound: values to return.
:return: The output format will be like:
[{"type" : "i3visio.email", "value": "foo@bar.com", "attri... | [
"def",
"getResults",
"(",
"self",
",",
"parFound",
"=",
"None",
")",
":",
"# Defining a dictionary",
"results",
"=",
"[",
"]",
"# Defining a dictionary inside with a couple of fields: reg_exp for the regular expression and found_exp for the expressions found.",
"#results[self.name] =... | Function to obtain the Dictionarythat represents this object.
:param parFound: values to return.
:return: The output format will be like:
[{"type" : "i3visio.email", "value": "foo@bar.com", "attributes": [] }, {"type" : "i3visio.email", "value": "bar@foo.com",... | [
"Function",
"to",
"obtain",
"the",
"Dictionarythat",
"represents",
"this",
"object",
".",
":",
"param",
"parFound",
":",
"values",
"to",
"return",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/regexp.py#L90-L111 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/regexp.py#L125-L150 |
i3visio/osrframework | osrframework/thirdparties/infobel_com/checkPhoneDetails.py | checkPhoneDetails | def checkPhoneDetails(query=None):
'''
Method that checks if the given hash is stored in the md5crack.com website.
:param query: query to verify.
:return: Python structure.
'''
results = []
#TO-DO executing the query against Google and grab the results
# The... | python | def checkPhoneDetails(query=None):
'''
Method that checks if the given hash is stored in the md5crack.com website.
:param query: query to verify.
:return: Python structure.
'''
results = []
#TO-DO executing the query against Google and grab the results
# The... | [
"def",
"checkPhoneDetails",
"(",
"query",
"=",
"None",
")",
":",
"results",
"=",
"[",
"]",
"#TO-DO executing the query against Google and grab the results",
"# The query should be something like \"<QUERY> site:infobel.com\"",
"search",
"=",
"query",
"+",
"\" site:infobel.com\""... | Method that checks if the given hash is stored in the md5crack.com website.
:param query: query to verify.
:return: Python structure. | [
"Method",
"that",
"checks",
"if",
"the",
"given",
"hash",
"is",
"stored",
"in",
"the",
"md5crack",
".",
"com",
"website",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/infobel_com/checkPhoneDetails.py#L29-L81 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L40-L69 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L72-L266 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L269-L291 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L294-L342 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L345-L368 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L371-L394 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L397-L419 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L422-L445 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L448-L594 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L597-L625 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L628-L642 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L645-L668 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L671-L682 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L685-L704 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L707-L740 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L743-L763 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L766-L796 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L823-L838 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/general.py#L842-L872 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L63-L70 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L73-L150 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L153-L188 |
i3visio/osrframework | osrframework/domainfy.py | pool_function | def pool_function(domain, launchWhois=False):
"""
Wrapper for being able to launch all the threads of getPageWrapper.
Args:
-----
domain: We receive the parameters as a dictionary.
```
{
"domain" : ".com",
"type" : "global"
}
```
l... | python | def pool_function(domain, launchWhois=False):
"""
Wrapper for being able to launch all the threads of getPageWrapper.
Args:
-----
domain: We receive the parameters as a dictionary.
```
{
"domain" : ".com",
"type" : "global"
}
```
l... | [
"def",
"pool_function",
"(",
"domain",
",",
"launchWhois",
"=",
"False",
")",
":",
"is_valid",
"=",
"True",
"try",
":",
"ipv4",
"=",
"socket",
".",
"gethostbyname",
"(",
"domain",
"[",
"\"domain\"",
"]",
")",
"# Check if this ipv4 normally throws false positives",... | Wrapper for being able to launch all the threads of getPageWrapper.
Args:
-----
domain: We receive the parameters as a dictionary.
```
{
"domain" : ".com",
"type" : "global"
}
```
launchWhois: Whether the whois info will be launched.
R... | [
"Wrapper",
"for",
"being",
"able",
"to",
"launch",
"all",
"the",
"threads",
"of",
"getPageWrapper",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L233-L297 |
i3visio/osrframework | osrframework/domainfy.py | performSearch | def performSearch(domains=[], nThreads=16, launchWhois=False):
"""
Method to perform the mail verification process.
Arguments
---------
domains: List of domains to check.
nThreads: Number of threads to use.
launchWhois: Sets if whois queries will be launched.
Returns
--... | python | def performSearch(domains=[], nThreads=16, launchWhois=False):
"""
Method to perform the mail verification process.
Arguments
---------
domains: List of domains to check.
nThreads: Number of threads to use.
launchWhois: Sets if whois queries will be launched.
Returns
--... | [
"def",
"performSearch",
"(",
"domains",
"=",
"[",
"]",
",",
"nThreads",
"=",
"16",
",",
"launchWhois",
"=",
"False",
")",
":",
"results",
"=",
"[",
"]",
"# Using threads in a pool if we are not running the program in main",
"args",
"=",
"[",
"]",
"# Returning None... | Method to perform the mail verification process.
Arguments
---------
domains: List of domains to check.
nThreads: Number of threads to use.
launchWhois: Sets if whois queries will be launched.
Returns
-------
list: A list containing the results as i3visio entities. | [
"Method",
"to",
"perform",
"the",
"mail",
"verification",
"process",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L300-L382 |
i3visio/osrframework | osrframework/domainfy.py | main | def main(params=None):
"""
Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
... | python | def main(params=None):
"""
Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
... | [
"def",
"main",
"(",
"params",
"=",
"None",
")",
":",
"if",
"params",
"==",
"None",
":",
"parser",
"=",
"getParser",
"(",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
"params",
")",
"else",
":",
"args",
"=",
"params",
"results",
"=",
"[",
"]"... | Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
params: A list with the parameters ... | [
"Main",
"function",
"to",
"launch",
"phonefy",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/domainfy.py#L424-L542 |
i3visio/osrframework | osrframework/entify.py | getEntitiesByRegexp | def getEntitiesByRegexp(data = None, listRegexp = None, verbosity=1, logFolder="./logs"):
"""
Method to obtain entities by Regexp.
Args:
-----
data: text where the entities will be looked for.
listRegexp: list of selected regular expressions to be looked for. If
None was pro... | python | def getEntitiesByRegexp(data = None, listRegexp = None, verbosity=1, logFolder="./logs"):
"""
Method to obtain entities by Regexp.
Args:
-----
data: text where the entities will be looked for.
listRegexp: list of selected regular expressions to be looked for. If
None was pro... | [
"def",
"getEntitiesByRegexp",
"(",
"data",
"=",
"None",
",",
"listRegexp",
"=",
"None",
",",
"verbosity",
"=",
"1",
",",
"logFolder",
"=",
"\"./logs\"",
")",
":",
"logSet",
".",
"setupLogger",
"(",
"loggerName",
"=",
"\"osrframework.entify\"",
",",
"verbosity"... | Method to obtain entities by Regexp.
Args:
-----
data: text where the entities will be looked for.
listRegexp: list of selected regular expressions to be looked for. If
None was provided, all the available will be chosen instead.
verbosity: the verbosity level.
logFo... | [
"Method",
"to",
"obtain",
"entities",
"by",
"Regexp",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/entify.py#L43-L81 |
i3visio/osrframework | osrframework/entify.py | scanFolderForRegexp | def scanFolderForRegexp(folder = None, listRegexp = None, recursive = False, verbosity=1, logFolder= "./logs", quiet=False):
"""
[Optionally] recursive method to scan the files in a given folder.
Args:
-----
folder: the folder to be scanned.
listRegexp: listRegexp is an array of <Regexp... | python | def scanFolderForRegexp(folder = None, listRegexp = None, recursive = False, verbosity=1, logFolder= "./logs", quiet=False):
"""
[Optionally] recursive method to scan the files in a given folder.
Args:
-----
folder: the folder to be scanned.
listRegexp: listRegexp is an array of <Regexp... | [
"def",
"scanFolderForRegexp",
"(",
"folder",
"=",
"None",
",",
"listRegexp",
"=",
"None",
",",
"recursive",
"=",
"False",
",",
"verbosity",
"=",
"1",
",",
"logFolder",
"=",
"\"./logs\"",
",",
"quiet",
"=",
"False",
")",
":",
"logSet",
".",
"setupLogger",
... | [Optionally] recursive method to scan the files in a given folder.
Args:
-----
folder: the folder to be scanned.
listRegexp: listRegexp is an array of <RegexpObject>.
recursive: when True, it performs a recursive search on the subfolders.
Returns:
--------
list: Availab... | [
"[",
"Optionally",
"]",
"recursive",
"method",
"to",
"scan",
"the",
"files",
"in",
"a",
"given",
"folder",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/entify.py#L84-L152 |
i3visio/osrframework | osrframework/entify.py | scanResource | def scanResource(uri = None, listRegexp = None, verbosity=1, logFolder= "./logs"):
"""
[Optionally] recursive method to scan the files in a given folder.
Args:
-----
uri: the URI to be scanned.
listRegexp: listRegexp is an array of <RegexpObject>.
Returns:
-------
dict:... | python | def scanResource(uri = None, listRegexp = None, verbosity=1, logFolder= "./logs"):
"""
[Optionally] recursive method to scan the files in a given folder.
Args:
-----
uri: the URI to be scanned.
listRegexp: listRegexp is an array of <RegexpObject>.
Returns:
-------
dict:... | [
"def",
"scanResource",
"(",
"uri",
"=",
"None",
",",
"listRegexp",
"=",
"None",
",",
"verbosity",
"=",
"1",
",",
"logFolder",
"=",
"\"./logs\"",
")",
":",
"logSet",
".",
"setupLogger",
"(",
"loggerName",
"=",
"\"osrframework.entify\"",
",",
"verbosity",
"=",... | [Optionally] recursive method to scan the files in a given folder.
Args:
-----
uri: the URI to be scanned.
listRegexp: listRegexp is an array of <RegexpObject>.
Returns:
-------
dict: the key is the name of the file. | [
"[",
"Optionally",
"]",
"recursive",
"method",
"to",
"scan",
"the",
"files",
"in",
"a",
"given",
"folder",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/entify.py#L155-L206 |
i3visio/osrframework | osrframework/entify.py | main | def main(params=None):
"""
Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
... | python | def main(params=None):
"""
Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
... | [
"def",
"main",
"(",
"params",
"=",
"None",
")",
":",
"if",
"params",
"==",
"None",
":",
"parser",
"=",
"getParser",
"(",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
"params",
")",
"else",
":",
"args",
"=",
"params",
"results",
"=",
"[",
"]"... | Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
params: A list with the parameters ... | [
"Main",
"function",
"to",
"launch",
"phonefy",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/entify.py#L246-L338 |
i3visio/osrframework | osrframework/thirdparties/ip_api_com/checkIpDetails.py | checkIpDetails | def checkIpDetails(query=None):
'''
Method that checks if the given hash is stored in the md5crack.com website. An example of the json received:
{
"as": "AS8560 1\u00261 Internet AG",
"city": "",
"country": "Germany",
"countryCode": "DE",
... | python | def checkIpDetails(query=None):
'''
Method that checks if the given hash is stored in the md5crack.com website. An example of the json received:
{
"as": "AS8560 1\u00261 Internet AG",
"city": "",
"country": "Germany",
"countryCode": "DE",
... | [
"def",
"checkIpDetails",
"(",
"query",
"=",
"None",
")",
":",
"try",
":",
"apiURL",
"=",
"\"http://ip-api.com/json/\"",
"+",
"query",
"# Accessing the ip-api.com RESTful API",
"data",
"=",
"urllib2",
".",
"urlopen",
"(",
"apiURL",
")",
".",
"read",
"(",
")",
"... | Method that checks if the given hash is stored in the md5crack.com website. An example of the json received:
{
"as": "AS8560 1\u00261 Internet AG",
"city": "",
"country": "Germany",
"countryCode": "DE",
"isp": "1\u00261 Internet AG",
"lat":... | [
"Method",
"that",
"checks",
"if",
"the",
"given",
"hash",
"is",
"stored",
"in",
"the",
"md5crack",
".",
"com",
"website",
".",
"An",
"example",
"of",
"the",
"json",
"received",
":",
"{",
"as",
":",
"AS8560",
"1",
"\\",
"u00261",
"Internet",
"AG",
"city... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/ip_api_com/checkIpDetails.py#L26-L159 |
i3visio/osrframework | osrframework/wrappers/infojobs.py | Infojobs.check_mailfy | def check_mailfy(self, query, kwargs={}):
"""
Verifying a mailfy query in this platform.
This might be redefined in any class inheriting from Platform. The only
condition is that any of this should return a dictionary as defined.
Args:
-----
query: The eleme... | python | def check_mailfy(self, query, kwargs={}):
"""
Verifying a mailfy query in this platform.
This might be redefined in any class inheriting from Platform. The only
condition is that any of this should return a dictionary as defined.
Args:
-----
query: The eleme... | [
"def",
"check_mailfy",
"(",
"self",
",",
"query",
",",
"kwargs",
"=",
"{",
"}",
")",
":",
"import",
"requests",
"s",
"=",
"requests",
".",
"Session",
"(",
")",
"# Getting the first response to grab the csrf_token",
"r1",
"=",
"s",
".",
"get",
"(",
"'https://... | Verifying a mailfy query in this platform.
This might be redefined in any class inheriting from Platform. The only
condition is that any of this should return a dictionary as defined.
Args:
-----
query: The element to be searched.
kwargs: Dictionary with extra p... | [
"Verifying",
"a",
"mailfy",
"query",
"in",
"this",
"platform",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/wrappers/infojobs.py#L74-L105 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L112-L161 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L164-L206 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L209-L232 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L235-L283 |
i3visio/osrframework | osrframework/mailfy.py | performSearch | def performSearch(emails=[], nThreads=16, secondsBeforeTimeout=5):
"""
Method to perform the mail verification process.
Args:
-----
emails: list of emails to be verified.
platforms: list of strings representing the wrappers to be used.
nThreads: the number of threads to be used.... | python | def performSearch(emails=[], nThreads=16, secondsBeforeTimeout=5):
"""
Method to perform the mail verification process.
Args:
-----
emails: list of emails to be verified.
platforms: list of strings representing the wrappers to be used.
nThreads: the number of threads to be used.... | [
"def",
"performSearch",
"(",
"emails",
"=",
"[",
"]",
",",
"nThreads",
"=",
"16",
",",
"secondsBeforeTimeout",
"=",
"5",
")",
":",
"# Getting starting time",
"_startTime",
"=",
"time",
".",
"time",
"(",
")",
"def",
"hasRunOutOfTime",
"(",
"oldEpoch",
")",
... | Method to perform the mail verification process.
Args:
-----
emails: list of emails to be verified.
platforms: list of strings representing the wrappers to be used.
nThreads: the number of threads to be used. Default: 16 threads.
secondsBeforeTimeout: number of seconds to wait b... | [
"Method",
"to",
"perform",
"the",
"mail",
"verification",
"process",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L286-L403 |
i3visio/osrframework | osrframework/mailfy.py | main | def main(params=None):
"""
Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
... | python | def main(params=None):
"""
Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
... | [
"def",
"main",
"(",
"params",
"=",
"None",
")",
":",
"if",
"params",
"==",
"None",
":",
"parser",
"=",
"getParser",
"(",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
"params",
")",
"else",
":",
"args",
"=",
"params",
"results",
"=",
"[",
"]"... | Main function to launch phonefy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
params: A list with the parameters ... | [
"Main",
"function",
"to",
"launch",
"phonefy",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/mailfy.py#L448-L620 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L141-L182 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L184-L188 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L190-L200 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/browser.py#L202-L228 |
i3visio/osrframework | osrframework/launcher.py | main | def main(params=None):
"""
Main function to launch OSRFramework CLI
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
... | python | def main(params=None):
"""
Main function to launch OSRFramework CLI
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
... | [
"def",
"main",
"(",
"params",
"=",
"None",
")",
":",
"parser",
"=",
"getParser",
"(",
")",
"try",
":",
"if",
"params",
"!=",
"None",
":",
"args",
"=",
"parser",
".",
"parse_args",
"(",
"params",
")",
"else",
":",
"args",
"=",
"parser",
".",
"parse_... | Main function to launch OSRFramework CLI
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
params: A list with... | [
"Main",
"function",
"to",
"launch",
"OSRFramework",
"CLI",
"The",
"function",
"is",
"created",
"in",
"this",
"way",
"so",
"as",
"to",
"let",
"other",
"applications",
"make",
"use",
"of",
"the",
"full",
"configuration",
"capabilities",
"of",
"the",
"application... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/launcher.py#L119-L152 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L775-L811 |
i3visio/osrframework | osrframework/api/twitter_api.py | TwitterAPIWrapper._connectToAPI | def _connectToAPI(self):
"""
:return: A tweepy.API object that performs the queries
"""
#authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(self.consumer_key, self.consumer_secret)
auth.set_access_token(self.access_key, self.access_secret)
api = t... | python | def _connectToAPI(self):
"""
:return: A tweepy.API object that performs the queries
"""
#authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(self.consumer_key, self.consumer_secret)
auth.set_access_token(self.access_key, self.access_secret)
api = t... | [
"def",
"_connectToAPI",
"(",
"self",
")",
":",
"#authorize twitter, initialize tweepy",
"auth",
"=",
"tweepy",
".",
"OAuthHandler",
"(",
"self",
".",
"consumer_key",
",",
"self",
".",
"consumer_secret",
")",
"auth",
".",
"set_access_token",
"(",
"self",
".",
"ac... | :return: A tweepy.API object that performs the queries | [
":",
"return",
":",
"A",
"tweepy",
".",
"API",
"object",
"that",
"performs",
"the",
"queries"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L52-L60 |
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"
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L62-L113 |
i3visio/osrframework | osrframework/api/twitter_api.py | TwitterAPIWrapper._processUser | def _processUser(self, jUser):
"""
Convert tweepy.User to a i3visio-like user. This will process the returned JSON object that the API returns to transform it to the i3visio-like format. A sample answer is copied now when testing it to the @i3visio user in Twitter.
{
"follow_request_sent": false,
... | python | def _processUser(self, jUser):
"""
Convert tweepy.User to a i3visio-like user. This will process the returned JSON object that the API returns to transform it to the i3visio-like format. A sample answer is copied now when testing it to the @i3visio user in Twitter.
{
"follow_request_sent": false,
... | [
"def",
"_processUser",
"(",
"self",
",",
"jUser",
")",
":",
"#raw_input(json.dumps(jUser, indent=2))",
"r",
"=",
"{",
"}",
"r",
"[",
"\"type\"",
"]",
"=",
"\"i3visio.profile\"",
"r",
"[",
"\"value\"",
"]",
"=",
"self",
".",
"platformName",
"+",
"\" - \"",
"+... | Convert tweepy.User to a i3visio-like user. This will process the returned JSON object that the API returns to transform it to the i3visio-like format. A sample answer is copied now when testing it to the @i3visio user in Twitter.
{
"follow_request_sent": false,
"has_extended_profile": false,
"profile_use_backgro... | [
"Convert",
"tweepy",
".",
"User",
"to",
"a",
"i3visio",
"-",
"like",
"user",
".",
"This",
"will",
"process",
"the",
"returned",
"JSON",
"object",
"that",
"the",
"API",
"returns",
"to",
"transform",
"it",
"to",
"the",
"i3visio",
"-",
"like",
"format",
"."... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L115-L396 |
i3visio/osrframework | osrframework/api/twitter_api.py | TwitterAPIWrapper.get_all_docs | def get_all_docs(self, screen_name):
"""
Method to get all the tweets emitted by a user.
:param screen_name: The Twitter username.
:return: List of tweets.
"""
def _getNewTweets(api, screen_name,count=200, oldest=None, waitTime=60):
"""
... | python | def get_all_docs(self, screen_name):
"""
Method to get all the tweets emitted by a user.
:param screen_name: The Twitter username.
:return: List of tweets.
"""
def _getNewTweets(api, screen_name,count=200, oldest=None, waitTime=60):
"""
... | [
"def",
"get_all_docs",
"(",
"self",
",",
"screen_name",
")",
":",
"def",
"_getNewTweets",
"(",
"api",
",",
"screen_name",
",",
"count",
"=",
"200",
",",
"oldest",
"=",
"None",
",",
"waitTime",
"=",
"60",
")",
":",
"\"\"\"\n MEthod that recovers ... | Method to get all the tweets emitted by a user.
:param screen_name: The Twitter username.
:return: List of tweets. | [
"Method",
"to",
"get",
"all",
"the",
"tweets",
"emitted",
"by",
"a",
"user",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L398-L639 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L641-L667 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L669-L695 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L698-L724 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/api/twitter_api.py#L726-L772 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/source.py#L50-L55 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/md5db_net/checkIfHashIsCracked.py#L26-L46 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/usufy.py#L50-L145 |
i3visio/osrframework | osrframework/usufy.py | pool_function | def pool_function(p, nick, rutaDescarga, avoidProcessing=True, avoidDownload=True, verbosity=1):
"""
Wrapper for being able to launch all the threads of getPageWrapper.
We receive the parameters for getPageWrapper as a tuple.
Args:
-----
pName: Platform where the information is stored. It ... | python | def pool_function(p, nick, rutaDescarga, avoidProcessing=True, avoidDownload=True, verbosity=1):
"""
Wrapper for being able to launch all the threads of getPageWrapper.
We receive the parameters for getPageWrapper as a tuple.
Args:
-----
pName: Platform where the information is stored. It ... | [
"def",
"pool_function",
"(",
"p",
",",
"nick",
",",
"rutaDescarga",
",",
"avoidProcessing",
"=",
"True",
",",
"avoidDownload",
"=",
"True",
",",
"verbosity",
"=",
"1",
")",
":",
"try",
":",
"#res = getPageWrapper(p, nick, rutaDescarga, avoidProcessing, avoidDownload, ... | Wrapper for being able to launch all the threads of getPageWrapper.
We receive the parameters for getPageWrapper as a tuple.
Args:
-----
pName: Platform where the information is stored. It is a string.
nick: Nick to be searched.
rutaDescarga: Local file where saving the obtained in... | [
"Wrapper",
"for",
"being",
"able",
"to",
"launch",
"all",
"the",
"threads",
"of",
"getPageWrapper",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/usufy.py#L148-L187 |
i3visio/osrframework | osrframework/usufy.py | processNickList | def processNickList(nicks, platforms=None, rutaDescarga="./", avoidProcessing=True, avoidDownload=True, nThreads=12, verbosity=1, logFolder="./logs"):
"""
Process a list of nicks to check whether they exist.
This method receives as a parameter a series of nicks and verifies whether
those nicks have a p... | python | def processNickList(nicks, platforms=None, rutaDescarga="./", avoidProcessing=True, avoidDownload=True, nThreads=12, verbosity=1, logFolder="./logs"):
"""
Process a list of nicks to check whether they exist.
This method receives as a parameter a series of nicks and verifies whether
those nicks have a p... | [
"def",
"processNickList",
"(",
"nicks",
",",
"platforms",
"=",
"None",
",",
"rutaDescarga",
"=",
"\"./\"",
",",
"avoidProcessing",
"=",
"True",
",",
"avoidDownload",
"=",
"True",
",",
"nThreads",
"=",
"12",
",",
"verbosity",
"=",
"1",
",",
"logFolder",
"="... | Process a list of nicks to check whether they exist.
This method receives as a parameter a series of nicks and verifies whether
those nicks have a profile associated in different social networks.
Args:
-----
nicks: List of nicks to process.
platforms: List of <Platform> objects to be p... | [
"Process",
"a",
"list",
"of",
"nicks",
"to",
"check",
"whether",
"they",
"exist",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/usufy.py#L190-L316 |
i3visio/osrframework | osrframework/usufy.py | main | def main(params=None):
"""
Main function to launch usufy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
pa... | python | def main(params=None):
"""
Main function to launch usufy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
pa... | [
"def",
"main",
"(",
"params",
"=",
"None",
")",
":",
"if",
"params",
"==",
"None",
":",
"parser",
"=",
"getParser",
"(",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
"params",
")",
"else",
":",
"args",
"=",
"params",
"print",
"(",
"general",
... | Main function to launch usufy.
The function is created in this way so as to let other applications make
use of the full configuration capabilities of the application. The
parameters received are used as parsed by this modules `getParser()`.
Args:
-----
params: A list with the parameters as... | [
"Main",
"function",
"to",
"launch",
"usufy",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/usufy.py#L370-L577 |
i3visio/osrframework | osrframework/alias_generator.py | generate | def generate(name=None, surname1=None, surname2=None, city=None, country=None, year=None, useNumbers=False, useCommonWords=False, useLeet=False, useLocales=False, extraWords=[]):
"""
The method that generates the given aliases.
It receives several parameters as parsed by this module's `getParser()`.
Pr... | python | def generate(name=None, surname1=None, surname2=None, city=None, country=None, year=None, useNumbers=False, useCommonWords=False, useLeet=False, useLocales=False, extraWords=[]):
"""
The method that generates the given aliases.
It receives several parameters as parsed by this module's `getParser()`.
Pr... | [
"def",
"generate",
"(",
"name",
"=",
"None",
",",
"surname1",
"=",
"None",
",",
"surname2",
"=",
"None",
",",
"city",
"=",
"None",
",",
"country",
"=",
"None",
",",
"year",
"=",
"None",
",",
"useNumbers",
"=",
"False",
",",
"useCommonWords",
"=",
"Fa... | The method that generates the given aliases.
It receives several parameters as parsed by this module's `getParser()`.
Previously referenced as `main`.
Args:
-----
name: String representing the known name of the investigated profile.
surname1: String representing the first surname of th... | [
"The",
"method",
"that",
"generates",
"the",
"given",
"aliases",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/alias_generator.py#L50-L2822 |
i3visio/osrframework | osrframework/alias_generator.py | main | def main(params=None):
"""
Main function to launch alias_generator.
Args:
-----
params: A list with the parameters as grabbed by the terminal. It is
None when this is called by an entry_point. If it is called by osrf
the data is already parsed.
"""
if params == N... | python | def main(params=None):
"""
Main function to launch alias_generator.
Args:
-----
params: A list with the parameters as grabbed by the terminal. It is
None when this is called by an entry_point. If it is called by osrf
the data is already parsed.
"""
if params == N... | [
"def",
"main",
"(",
"params",
"=",
"None",
")",
":",
"if",
"params",
"==",
"None",
":",
"parser",
"=",
"getParser",
"(",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
"params",
")",
"else",
":",
"args",
"=",
"params",
"print",
"(",
"general",
... | Main function to launch alias_generator.
Args:
-----
params: A list with the parameters as grabbed by the terminal. It is
None when this is called by an entry_point. If it is called by osrf
the data is already parsed. | [
"Main",
"function",
"to",
"launch",
"alias_generator",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/alias_generator.py#L2853-L2934 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L180-L207 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/search.py | SearchAPIRequest.add_records_filter | def add_records_filter(self, domain=None, category=None,
sponsored_source=None, has_fields=None,
query_params_match=None, query_person_match=None):
"""Add a new "and" filter for the records returned in the response.
IMPORTANT: This me... | python | def add_records_filter(self, domain=None, category=None,
sponsored_source=None, has_fields=None,
query_params_match=None, query_person_match=None):
"""Add a new "and" filter for the records returned in the response.
IMPORTANT: This me... | [
"def",
"add_records_filter",
"(",
"self",
",",
"domain",
"=",
"None",
",",
"category",
"=",
"None",
",",
"sponsored_source",
"=",
"None",
",",
"has_fields",
"=",
"None",
",",
"query_params_match",
"=",
"None",
",",
"query_person_match",
"=",
"None",
")",
":"... | Add a new "and" filter for the records returned in the response.
IMPORTANT: This method can be called multiple times per request for
adding multiple "and" filters, each of these "and" filters is
interpreted as "or" with the other filters.
For example:
>... | [
"Add",
"a",
"new",
"and",
"filter",
"for",
"the",
"records",
"returned",
"in",
"the",
"response",
".",
"IMPORTANT",
":",
"This",
"method",
"can",
"be",
"called",
"multiple",
"times",
"per",
"request",
"for",
"adding",
"multiple",
"and",
"filters",
"each",
... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L209-L263 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/search.py | SearchAPIRequest.append_priority_rule | def append_priority_rule(self, domain=None, category=None,
sponsored_source=None, has_field=None,
query_params_match=None, query_person_match=None):
"""Append a new priority rule for the records returned in the response.
IMPORTANT... | python | def append_priority_rule(self, domain=None, category=None,
sponsored_source=None, has_field=None,
query_params_match=None, query_person_match=None):
"""Append a new priority rule for the records returned in the response.
IMPORTANT... | [
"def",
"append_priority_rule",
"(",
"self",
",",
"domain",
"=",
"None",
",",
"category",
"=",
"None",
",",
"sponsored_source",
"=",
"None",
",",
"has_field",
"=",
"None",
",",
"query_params_match",
"=",
"None",
",",
"query_person_match",
"=",
"None",
")",
":... | Append a new priority rule for the records returned in the response.
IMPORTANT: This method can be called multiple times per request for
adding multiple priority rules, each call can be with only one argument
and the order of the calls matter (the first rule added is the highest
... | [
"Append",
"a",
"new",
"priority",
"rule",
"for",
"the",
"records",
"returned",
"in",
"the",
"response",
".",
"IMPORTANT",
":",
"This",
"method",
"can",
"be",
"called",
"multiple",
"times",
"per",
"request",
"for",
"adding",
"multiple",
"priority",
"rules",
"... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L265-L320 |
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",
... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L322-L340 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/search.py | SearchAPIRequest.url | def url(self):
"""The URL of the request (str)."""
query = {
'key': self.api_key or default_api_key,
'person': self.person.to_json(),
'query_params_mode': self.query_params_mode,
'exact_name': self.exact_name,
'prioritize_records_by': ',... | python | def url(self):
"""The URL of the request (str)."""
query = {
'key': self.api_key or default_api_key,
'person': self.person.to_json(),
'query_params_mode': self.query_params_mode,
'exact_name': self.exact_name,
'prioritize_records_by': ',... | [
"def",
"url",
"(",
"self",
")",
":",
"query",
"=",
"{",
"'key'",
":",
"self",
".",
"api_key",
"or",
"default_api_key",
",",
"'person'",
":",
"self",
".",
"person",
".",
"to_json",
"(",
")",
",",
"'query_params_mode'",
":",
"self",
".",
"query_params_mode... | The URL of the request (str). | [
"The",
"URL",
"of",
"the",
"request",
"(",
"str",
")",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L343-L353 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/search.py | SearchAPIRequest.send | def send(self, strict_validation=True):
"""Send the request and return the response or raise SearchAPIError.
Calling this method blocks the program until the response is returned,
if you want the request to be sent asynchronously please refer to the
send_async method.
... | python | def send(self, strict_validation=True):
"""Send the request and return the response or raise SearchAPIError.
Calling this method blocks the program until the response is returned,
if you want the request to be sent asynchronously please refer to the
send_async method.
... | [
"def",
"send",
"(",
"self",
",",
"strict_validation",
"=",
"True",
")",
":",
"self",
".",
"validate_query_params",
"(",
"strict",
"=",
"strict_validation",
")",
"query",
"=",
"{",
"'key'",
":",
"self",
".",
"api_key",
"or",
"default_api_key",
",",
"'person'"... | Send the request and return the response or raise SearchAPIError.
Calling this method blocks the program until the response is returned,
if you want the request to be sent asynchronously please refer to the
send_async method.
The response is returned as a Search... | [
"Send",
"the",
"request",
"and",
"return",
"the",
"response",
"or",
"raise",
"SearchAPIError",
".",
"Calling",
"this",
"method",
"blocks",
"the",
"program",
"until",
"the",
"response",
"is",
"returned",
"if",
"you",
"want",
"the",
"request",
"to",
"be",
"sen... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L355-L401 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/search.py | SearchAPIRequest.send_async | def send_async(self, callback, strict_validation=True):
"""Same as send() but in a non-blocking way.
Use this method if you want to send the request asynchronously so your
program can do other things while waiting for the response.
`callback` is a function (or ot... | python | def send_async(self, callback, strict_validation=True):
"""Same as send() but in a non-blocking way.
Use this method if you want to send the request asynchronously so your
program can do other things while waiting for the response.
`callback` is a function (or ot... | [
"def",
"send_async",
"(",
"self",
",",
"callback",
",",
"strict_validation",
"=",
"True",
")",
":",
"def",
"target",
"(",
")",
":",
"try",
":",
"response",
"=",
"self",
".",
"send",
"(",
"strict_validation",
")",
"callback",
"(",
"response",
"=",
"respon... | Same as send() but in a non-blocking way.
Use this method if you want to send the request asynchronously so your
program can do other things while waiting for the response.
`callback` is a function (or other callable) with the following
signature:
callb... | [
"Same",
"as",
"send",
"()",
"but",
"in",
"a",
"non",
"-",
"blocking",
"way",
".",
"Use",
"this",
"method",
"if",
"you",
"want",
"to",
"send",
"the",
"request",
"asynchronously",
"so",
"your",
"program",
"can",
"do",
"other",
"things",
"while",
"waiting",... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L403-L431 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/search.py | SearchAPIResponse.group_records | def group_records(self, key_function):
"""Return a dict with the records grouped by the key returned by
`key_function`.
`key_function` takes a record and returns the value from the record to
group by (see examples in the group_records_by_* methods below).
... | python | def group_records(self, key_function):
"""Return a dict with the records grouped by the key returned by
`key_function`.
`key_function` takes a record and returns the value from the record to
group by (see examples in the group_records_by_* methods below).
... | [
"def",
"group_records",
"(",
"self",
",",
"key_function",
")",
":",
"sorted_records",
"=",
"sorted",
"(",
"self",
".",
"records",
",",
"key",
"=",
"key_function",
")",
"grouped_records",
"=",
"itertools",
".",
"groupby",
"(",
"sorted_records",
",",
"key",
"=... | Return a dict with the records grouped by the key returned by
`key_function`.
`key_function` takes a record and returns the value from the record to
group by (see examples in the group_records_by_* methods below).
The return value is a dict, a key in this dict is... | [
"Return",
"a",
"dict",
"with",
"the",
"records",
"grouped",
"by",
"the",
"key",
"returned",
"by",
"key_function",
".",
"key_function",
"takes",
"a",
"record",
"and",
"returns",
"the",
"value",
"from",
"the",
"record",
"to",
"group",
"by",
"(",
"see",
"exam... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L517-L530 |
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... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L532-L540 |
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",
... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L542-L551 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L576-L594 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/search.py#L596-L610 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/fields.py | Field.validate_type | def validate_type(self, type_):
"""Take an str/unicode `type_` and raise a ValueError if it's not
a valid type for the object.
A valid type for a field is a value from the types_set attribute of
that field's class.
"""
if type_ is not None and... | python | def validate_type(self, type_):
"""Take an str/unicode `type_` and raise a ValueError if it's not
a valid type for the object.
A valid type for a field is a value from the types_set attribute of
that field's class.
"""
if type_ is not None and... | [
"def",
"validate_type",
"(",
"self",
",",
"type_",
")",
":",
"if",
"type_",
"is",
"not",
"None",
"and",
"type_",
"not",
"in",
"self",
".",
"types_set",
":",
"raise",
"ValueError",
"(",
"'Invalid type for %s:%s'",
"%",
"(",
"self",
".",
"__class__",
",",
... | Take an str/unicode `type_` and raise a ValueError if it's not
a valid type for the object.
A valid type for a field is a value from the types_set attribute of
that field's class. | [
"Take",
"an",
"str",
"/",
"unicode",
"type_",
"and",
"raise",
"a",
"ValueError",
"if",
"it",
"s",
"not",
"a",
"valid",
"type",
"for",
"the",
"object",
".",
"A",
"valid",
"type",
"for",
"a",
"field",
"is",
"a",
"value",
"from",
"the",
"types_set",
"at... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L75-L84 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L87-L102 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L104-L118 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L163-L169 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/fields.py | Address.display | def display(self):
"""A unicode value with the object's data, to be used for displaying
the object in your application."""
country = self.country if self.state else self.country_full
state = self.state if self.city else self.state_full
vals = (self.street, self.city, state,... | python | def display(self):
"""A unicode value with the object's data, to be used for displaying
the object in your application."""
country = self.country if self.state else self.country_full
state = self.state if self.city else self.state_full
vals = (self.street, self.city, state,... | [
"def",
"display",
"(",
"self",
")",
":",
"country",
"=",
"self",
".",
"country",
"if",
"self",
".",
"state",
"else",
"self",
".",
"country_full",
"state",
"=",
"self",
".",
"state",
"if",
"self",
".",
"city",
"else",
"self",
".",
"state_full",
"vals",
... | A unicode value with the object's data, to be used for displaying
the object in your application. | [
"A",
"unicode",
"value",
"with",
"the",
"object",
"s",
"data",
"to",
"be",
"used",
"for",
"displaying",
"the",
"object",
"in",
"your",
"application",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L217-L230 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L233-L237 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L246-L251 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/fields.py | Address.state_full | def state_full(self):
"""unicode, the full name of the object's state.
>>> address = Address(country='US', state='CO')
>>> address.state
u'CO'
>>> address.state_full
u'Colorado'
"""
if self.is_valid_state:
ret... | python | def state_full(self):
"""unicode, the full name of the object's state.
>>> address = Address(country='US', state='CO')
>>> address.state
u'CO'
>>> address.state_full
u'Colorado'
"""
if self.is_valid_state:
ret... | [
"def",
"state_full",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_valid_state",
":",
"return",
"STATES",
"[",
"self",
".",
"country",
".",
"upper",
"(",
")",
"]",
".",
"get",
"(",
"self",
".",
"state",
".",
"upper",
"(",
")",
")"
] | unicode, the full name of the object's state.
>>> address = Address(country='US', state='CO')
>>> address.state
u'CO'
>>> address.state_full
u'Colorado' | [
"unicode",
"the",
"full",
"name",
"of",
"the",
"object",
"s",
"state",
".",
">>>",
"address",
"=",
"Address",
"(",
"country",
"=",
"US",
"state",
"=",
"CO",
")",
">>>",
"address",
".",
"state",
"u",
"CO",
">>>",
"address",
".",
"state_full",
"u",
"Co... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L268-L280 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/fields.py | Phone.from_text | def from_text(text):
"""Strip `text` (unicode/str) from all non-digit chars and return a new
Phone object with the number from text.
>>> phone = Phone.from_text('(888) 777-666')
>>> phone.number
888777666
"""
number = int(filter(unicode.... | python | def from_text(text):
"""Strip `text` (unicode/str) from all non-digit chars and return a new
Phone object with the number from text.
>>> phone = Phone.from_text('(888) 777-666')
>>> phone.number
888777666
"""
number = int(filter(unicode.... | [
"def",
"from_text",
"(",
"text",
")",
":",
"number",
"=",
"int",
"(",
"filter",
"(",
"unicode",
".",
"isdigit",
",",
"unicode",
"(",
"text",
")",
")",
")",
"return",
"Phone",
"(",
"number",
"=",
"number",
")"
] | Strip `text` (unicode/str) from all non-digit chars and return a new
Phone object with the number from text.
>>> phone = Phone.from_text('(888) 777-666')
>>> phone.number
888777666 | [
"Strip",
"text",
"(",
"unicode",
"/",
"str",
")",
"from",
"all",
"non",
"-",
"digit",
"chars",
"and",
"return",
"a",
"new",
"Phone",
"object",
"with",
"the",
"number",
"from",
"text",
".",
">>>",
"phone",
"=",
"Phone",
".",
"from_text",
"(",
"(",
"88... | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L324-L334 |
i3visio/osrframework | osrframework/thirdparties/pipl_com/lib/fields.py | Phone.from_dict | def from_dict(cls, d):
"""Extend Field.from_dict, set display/display_international
attributes."""
phone = super(cls, cls).from_dict(d)
phone.display = d.get('display', u'')
phone.display_international = d.get('display_international', u'')
return phone | python | def from_dict(cls, d):
"""Extend Field.from_dict, set display/display_international
attributes."""
phone = super(cls, cls).from_dict(d)
phone.display = d.get('display', u'')
phone.display_international = d.get('display_international', u'')
return phone | [
"def",
"from_dict",
"(",
"cls",
",",
"d",
")",
":",
"phone",
"=",
"super",
"(",
"cls",
",",
"cls",
")",
".",
"from_dict",
"(",
"d",
")",
"phone",
".",
"display",
"=",
"d",
".",
"get",
"(",
"'display'",
",",
"u''",
")",
"phone",
".",
"display_inte... | Extend Field.from_dict, set display/display_international
attributes. | [
"Extend",
"Field",
".",
"from_dict",
"set",
"display",
"/",
"display_international",
"attributes",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L337-L343 |
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",
"."
] | train | https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L345-L350 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.