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
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Email.is_valid_email
def is_valid_email(self): """A bool value that indicates whether the address is a valid email address. Note that the check is done be matching to the regular expression at Email.re_email which is very basic and far from covering end-cases... """ ...
python
def is_valid_email(self): """A bool value that indicates whether the address is a valid email address. Note that the check is done be matching to the regular expression at Email.re_email which is very basic and far from covering end-cases... """ ...
[ "def", "is_valid_email", "(", "self", ")", ":", "return", "bool", "(", "self", ".", "address", "and", "Email", ".", "re_email", ".", "match", "(", "self", ".", "address", ")", ")" ]
A bool value that indicates whether the address is a valid email address. Note that the check is done be matching to the regular expression at Email.re_email which is very basic and far from covering end-cases...
[ "A", "bool", "value", "that", "indicates", "whether", "the", "address", "is", "a", "valid", "email", "address", ".", "Note", "that", "the", "check", "is", "done", "be", "matching", "to", "the", "regular", "expression", "at", "Email", ".", "re_email", "whic...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L383-L391
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Job.display
def display(self): """A unicode value with the object's data, to be used for displaying the object in your application.""" if self.title and self.organization: disp = self.title + u' at ' + self.organization else: disp = self.title or self.organization or N...
python
def display(self): """A unicode value with the object's data, to be used for displaying the object in your application.""" if self.title and self.organization: disp = self.title + u' at ' + self.organization else: disp = self.title or self.organization or N...
[ "def", "display", "(", "self", ")", ":", "if", "self", ".", "title", "and", "self", ".", "organization", ":", "disp", "=", "self", ".", "title", "+", "u' at '", "+", "self", ".", "organization", "else", ":", "disp", "=", "self", ".", "title", "or", ...
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#L453-L470
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Education.display
def display(self): """A unicode value with the object's data, to be used for displaying the object in your application.""" if self.degree and self.school: disp = self.degree + u' from ' + self.school else: disp = self.degree or self.school or None ...
python
def display(self): """A unicode value with the object's data, to be used for displaying the object in your application.""" if self.degree and self.school: disp = self.degree + u' from ' + self.school else: disp = self.degree or self.school or None ...
[ "def", "display", "(", "self", ")", ":", "if", "self", ".", "degree", "and", "self", ".", "school", ":", "disp", "=", "self", ".", "degree", "+", "u' from '", "+", "self", ".", "school", "else", ":", "disp", "=", "self", ".", "degree", "or", "self"...
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#L497-L506
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.age
def age(self): """int, the estimated age of the person. Note that A DOB object is based on a date-range and the exact date is usually unknown so for age calculation the the middle of the range is assumed to be the real date-of-birth. """ if se...
python
def age(self): """int, the estimated age of the person. Note that A DOB object is based on a date-range and the exact date is usually unknown so for age calculation the the middle of the range is assumed to be the real date-of-birth. """ if se...
[ "def", "age", "(", "self", ")", ":", "if", "self", ".", "date_range", "is", "None", ":", "return", "dob", "=", "self", ".", "date_range", ".", "middle", "today", "=", "datetime", ".", "date", ".", "today", "(", ")", "if", "(", "today", ".", "month"...
int, the estimated age of the person. Note that A DOB object is based on a date-range and the exact date is usually unknown so for age calculation the the middle of the range is assumed to be the real date-of-birth.
[ "int", "the", "estimated", "age", "of", "the", "person", ".", "Note", "that", "A", "DOB", "object", "is", "based", "on", "a", "date", "-", "range", "and", "the", "exact", "date", "is", "usually", "unknown", "so", "for", "age", "calculation", "the", "th...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L619-L634
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.age_range
def age_range(self): """A tuple of two ints - the minimum and maximum age of the person.""" if self.date_range is None: return None, None start_date = DateRange(self.date_range.start, self.date_range.start) end_date = DateRange(self.date_range.end, self.date_range.end) ...
python
def age_range(self): """A tuple of two ints - the minimum and maximum age of the person.""" if self.date_range is None: return None, None start_date = DateRange(self.date_range.start, self.date_range.start) end_date = DateRange(self.date_range.end, self.date_range.end) ...
[ "def", "age_range", "(", "self", ")", ":", "if", "self", ".", "date_range", "is", "None", ":", "return", "None", ",", "None", "start_date", "=", "DateRange", "(", "self", ".", "date_range", ".", "start", ",", "self", ".", "date_range", ".", "start", ")...
A tuple of two ints - the minimum and maximum age of the person.
[ "A", "tuple", "of", "two", "ints", "-", "the", "minimum", "and", "maximum", "age", "of", "the", "person", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L637-L645
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.from_birth_year
def from_birth_year(birth_year): """Take a person's birth year (int) and return a new DOB object suitable for him.""" if birth_year <= 0: raise ValueError('birth_year must be positive') date_range = DateRange.from_years_range(birth_year, birth_year) return DOB(...
python
def from_birth_year(birth_year): """Take a person's birth year (int) and return a new DOB object suitable for him.""" if birth_year <= 0: raise ValueError('birth_year must be positive') date_range = DateRange.from_years_range(birth_year, birth_year) return DOB(...
[ "def", "from_birth_year", "(", "birth_year", ")", ":", "if", "birth_year", "<=", "0", ":", "raise", "ValueError", "(", "'birth_year must be positive'", ")", "date_range", "=", "DateRange", ".", "from_years_range", "(", "birth_year", ",", "birth_year", ")", "return...
Take a person's birth year (int) and return a new DOB object suitable for him.
[ "Take", "a", "person", "s", "birth", "year", "(", "int", ")", "and", "return", "a", "new", "DOB", "object", "suitable", "for", "him", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L648-L654
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.from_birth_date
def from_birth_date(birth_date): """Take a person's birth date (datetime.date) and return a new DOB object suitable for him.""" if birth_date > datetime.date.today(): raise ValueError('birth_date can\'t be in the future') date_range = DateRange(birth_date, birth_date) ...
python
def from_birth_date(birth_date): """Take a person's birth date (datetime.date) and return a new DOB object suitable for him.""" if birth_date > datetime.date.today(): raise ValueError('birth_date can\'t be in the future') date_range = DateRange(birth_date, birth_date) ...
[ "def", "from_birth_date", "(", "birth_date", ")", ":", "if", "birth_date", ">", "datetime", ".", "date", ".", "today", "(", ")", ":", "raise", "ValueError", "(", "'birth_date can\\'t be in the future'", ")", "date_range", "=", "DateRange", "(", "birth_date", ","...
Take a person's birth date (datetime.date) and return a new DOB object suitable for him.
[ "Take", "a", "person", "s", "birth", "date", "(", "datetime", ".", "date", ")", "and", "return", "a", "new", "DOB", "object", "suitable", "for", "him", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L657-L663
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DOB.from_age_range
def from_age_range(start_age, end_age): """Take a person's minimal and maximal age and return a new DOB object suitable for him.""" if start_age < 0 or end_age < 0: raise ValueError('start_age and end_age can\'t be negative') if start_age > end_age: ...
python
def from_age_range(start_age, end_age): """Take a person's minimal and maximal age and return a new DOB object suitable for him.""" if start_age < 0 or end_age < 0: raise ValueError('start_age and end_age can\'t be negative') if start_age > end_age: ...
[ "def", "from_age_range", "(", "start_age", ",", "end_age", ")", ":", "if", "start_age", "<", "0", "or", "end_age", "<", "0", ":", "raise", "ValueError", "(", "'start_age and end_age can\\'t be negative'", ")", "if", "start_age", ">", "end_age", ":", "start_age",...
Take a person's minimal and maximal age and return a new DOB object suitable for him.
[ "Take", "a", "person", "s", "minimal", "and", "maximal", "age", "and", "return", "a", "new", "DOB", "object", "suitable", "for", "him", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L672-L695
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
Relationship.from_dict
def from_dict(cls, d): """Extend Field.from_dict and also load the name from the dict.""" relationship = super(cls, cls).from_dict(d) if relationship.name is not None: relationship.name = Name.from_dict(relationship.name) return relationship
python
def from_dict(cls, d): """Extend Field.from_dict and also load the name from the dict.""" relationship = super(cls, cls).from_dict(d) if relationship.name is not None: relationship.name = Name.from_dict(relationship.name) return relationship
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "relationship", "=", "super", "(", "cls", ",", "cls", ")", ".", "from_dict", "(", "d", ")", "if", "relationship", ".", "name", "is", "not", "None", ":", "relationship", ".", "name", "=", "Name", "...
Extend Field.from_dict and also load the name from the dict.
[ "Extend", "Field", ".", "from_dict", "and", "also", "load", "the", "name", "from", "the", "dict", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L762-L767
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DateRange.from_years_range
def from_years_range(start_year, end_year): """Transform a range of years (two ints) to a DateRange object.""" start = datetime.date(start_year, 1 , 1) end = datetime.date(end_year, 12 , 31) return DateRange(start, end)
python
def from_years_range(start_year, end_year): """Transform a range of years (two ints) to a DateRange object.""" start = datetime.date(start_year, 1 , 1) end = datetime.date(end_year, 12 , 31) return DateRange(start, end)
[ "def", "from_years_range", "(", "start_year", ",", "end_year", ")", ":", "start", "=", "datetime", ".", "date", "(", "start_year", ",", "1", ",", "1", ")", "end", "=", "datetime", ".", "date", "(", "end_year", ",", "12", ",", "31", ")", "return", "Da...
Transform a range of years (two ints) to a DateRange object.
[ "Transform", "a", "range", "of", "years", "(", "two", "ints", ")", "to", "a", "DateRange", "object", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L847-L851
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DateRange.from_dict
def from_dict(d): """Transform the dict to a DateRange object.""" start = d.get('start') end = d.get('end') if not (start and end): raise ValueError('DateRange must have both start and end') start = str_to_date(start) end = str_to_date(end) ret...
python
def from_dict(d): """Transform the dict to a DateRange object.""" start = d.get('start') end = d.get('end') if not (start and end): raise ValueError('DateRange must have both start and end') start = str_to_date(start) end = str_to_date(end) ret...
[ "def", "from_dict", "(", "d", ")", ":", "start", "=", "d", ".", "get", "(", "'start'", ")", "end", "=", "d", ".", "get", "(", "'end'", ")", "if", "not", "(", "start", "and", "end", ")", ":", "raise", "ValueError", "(", "'DateRange must have both star...
Transform the dict to a DateRange object.
[ "Transform", "the", "dict", "to", "a", "DateRange", "object", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L854-L862
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/fields.py
DateRange.to_dict
def to_dict(self): """Transform the date-range to a dict.""" d = {} d['start'] = date_to_str(self.start) d['end'] = date_to_str(self.end) return d
python
def to_dict(self): """Transform the date-range to a dict.""" d = {} d['start'] = date_to_str(self.start) d['end'] = date_to_str(self.end) return d
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "d", "[", "'start'", "]", "=", "date_to_str", "(", "self", ".", "start", ")", "d", "[", "'end'", "]", "=", "date_to_str", "(", "self", ".", "end", ")", "return", "d" ]
Transform the date-range to a dict.
[ "Transform", "the", "date", "-", "range", "to", "a", "dict", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/fields.py#L864-L869
i3visio/osrframework
osrframework/patterns/uri.py
URI.getAttributes
def getAttributes(self, foundExp): ''' Method to extract additional attributes from a given expression (i. e.: domains and ports from URL and so on). This method may be overwritten in certain child classes. :param found_exp: expression to be processed. :return: The outpu...
python
def getAttributes(self, foundExp): ''' Method to extract additional attributes from a given expression (i. e.: domains and ports from URL and so on). This method may be overwritten in certain child classes. :param found_exp: expression to be processed. :return: The outpu...
[ "def", "getAttributes", "(", "self", ",", "foundExp", ")", ":", "# Defining a dictionary", "attributes", "=", "[", "]", "protocolRegExp", "=", "\"((?:https?|s?ftp|file))://\"", "foundProtocol", "=", "re", ".", "findall", "(", "protocolRegExp", ",", "foundExp", ")", ...
Method to extract additional attributes from a given expression (i. e.: domains and ports from URL and so on). This method may be overwritten in certain child classes. :param found_exp: expression to be processed. :return: The output format will be like: [{"type" : "i3visio....
[ "Method", "to", "extract", "additional", "attributes", "from", "a", "given", "expression", "(", "i", ".", "e", ".", ":", "domains", "and", "ports", "from", "URL", "and", "so", "on", ")", ".", "This", "method", "may", "be", "overwritten", "in", "certain",...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/patterns/uri.py#L44-L90
i3visio/osrframework
osrframework/patterns/email.py
Email.getAttributes
def getAttributes(self, found = None): ''' Method to extract additional attributes from a given expression (i. e.: domains and ports from URL and so on). This method may be overwritten in certain child classes. :param found: expression to be processed. :return: The outpu...
python
def getAttributes(self, found = None): ''' Method to extract additional attributes from a given expression (i. e.: domains and ports from URL and so on). This method may be overwritten in certain child classes. :param found: expression to be processed. :return: The outpu...
[ "def", "getAttributes", "(", "self", ",", "found", "=", "None", ")", ":", "# List of attributes", "results", "=", "[", "]", "if", "not", "'@'", "in", "found", ":", "# character may be '@' or '.'", "for", "character", "in", "self", ".", "substitutionValues", "....
Method to extract additional attributes from a given expression (i. e.: domains and ports from URL and so on). This method may be overwritten in certain child classes. :param found: expression to be processed. :return: The output format will be like: [{"type" : "i3visio.emai...
[ "Method", "to", "extract", "additional", "attributes", "from", "a", "given", "expression", "(", "i", ".", "e", ".", ":", "domains", "and", "ports", "from", "URL", "and", "so", "on", ")", ".", "This", "method", "may", "be", "overwritten", "in", "certain",...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/patterns/email.py#L51-L89
i3visio/osrframework
osrframework/patterns/email.py
Email.getEntityType
def getEntityType(self, found = None): ''' Method to recover the value of the entity in case it may vary. :param found: The expression to be analysed. :return: The entity type returned will be an s'i3visio.email' for foo@bar.com and an 'i3visio.text' for foo[at]bar[dot]...
python
def getEntityType(self, found = None): ''' Method to recover the value of the entity in case it may vary. :param found: The expression to be analysed. :return: The entity type returned will be an s'i3visio.email' for foo@bar.com and an 'i3visio.text' for foo[at]bar[dot]...
[ "def", "getEntityType", "(", "self", ",", "found", "=", "None", ")", ":", "# character may be '@' or '.'", "for", "character", "in", "self", ".", "substitutionValues", ".", "keys", "(", ")", ":", "for", "value", "in", "self", ".", "substitutionValues", "[", ...
Method to recover the value of the entity in case it may vary. :param found: The expression to be analysed. :return: The entity type returned will be an s'i3visio.email' for foo@bar.com and an 'i3visio.text' for foo[at]bar[dot]com.
[ "Method", "to", "recover", "the", "value", "of", "the", "entity", "in", "case", "it", "may", "vary", ".", ":", "param", "found", ":", "The", "expression", "to", "be", "analysed", ".", ":", "return", ":", "The", "entity", "type", "returned", "will", "be...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/patterns/email.py#L91-L103
i3visio/osrframework
osrframework/enumeration.py
enumerateURL
def enumerateURL(urlDict, outputFolder, startIndex= 0, maxErrors = 100): """ Function that performs the enumeration itself. """ for i, url in enumerate(urlDict.keys()): # Grabbing domain name: domain = re.findall("://(.*)/", url)[0] # Defining the starting index ...
python
def enumerateURL(urlDict, outputFolder, startIndex= 0, maxErrors = 100): """ Function that performs the enumeration itself. """ for i, url in enumerate(urlDict.keys()): # Grabbing domain name: domain = re.findall("://(.*)/", url)[0] # Defining the starting index ...
[ "def", "enumerateURL", "(", "urlDict", ",", "outputFolder", ",", "startIndex", "=", "0", ",", "maxErrors", "=", "100", ")", ":", "for", "i", ",", "url", "in", "enumerate", "(", "urlDict", ".", "keys", "(", ")", ")", ":", "# Grabbing domain name:\r", "dom...
Function that performs the enumeration itself.
[ "Function", "that", "performs", "the", "enumeration", "itself", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/enumeration.py#L36-L78
i3visio/osrframework
osrframework/enumeration.py
main
def main(params=None): """ Main loop for the enumeration Args: ----- params: A list with the parameters as grabbed by the terminal. It is None when this is called by an entry_point. """ # Grabbing the parser parser = getParser() if params != None: ...
python
def main(params=None): """ Main loop for the enumeration Args: ----- params: A list with the parameters as grabbed by the terminal. It is None when this is called by an entry_point. """ # Grabbing the parser parser = getParser() if params != None: ...
[ "def", "main", "(", "params", "=", "None", ")", ":", "# Grabbing the parser\r", "parser", "=", "getParser", "(", ")", "if", "params", "!=", "None", ":", "args", "=", "parser", ".", "parse_args", "(", "params", ")", "else", ":", "args", "=", "parser", "...
Main loop for the enumeration Args: ----- params: A list with the parameters as grabbed by the terminal. It is None when this is called by an entry_point.
[ "Main", "loop", "for", "the", "enumeration", "Args", ":", "-----", "params", ":", "A", "list", "with", "the", "parameters", "as", "grabbed", "by", "the", "terminal", ".", "It", "is", "None", "when", "this", "is", "called", "by", "an", "entry_point", "." ...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/enumeration.py#L105-L151
i3visio/osrframework
osrframework/wrappers/twitter.py
Twitter.do_usufy
def do_usufy(self, query, **kwargs): """ Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be app...
python
def do_usufy(self, query, **kwargs): """ Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be app...
[ "def", "do_usufy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "# Trying to interact with the API Wrapper", "try", ":", "self", ".", "wrapperAPI", "=", "TwitterAPIWrapper", "(", ")", "results", "=", "self", ".", "wrapperAPI", ".", "get_user",...
Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be appended.
[ "Verifying", "a", "usufy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/wrappers/twitter.py#L131-L162
i3visio/osrframework
osrframework/wrappers/twitter.py
Twitter.do_searchfy
def do_searchfy(self, query, **kwargs): """ Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be ...
python
def do_searchfy(self, query, **kwargs): """ Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be ...
[ "def", "do_searchfy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "# Trying to interact with the API Wrapper", "try", ":", "results", "=", "self", ".", "wrapperAPI", ".", "search_users", "(", "query", ")", "# Manually appending the URL", "for", ...
Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be appended.
[ "Verifying", "a", "usufy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/wrappers/twitter.py#L164-L193
i3visio/osrframework
osrframework/utils/config_credentials.py
returnListOfCreds
def returnListOfCreds(): ''' :return: A list of tuples containing in the first the name of the platform, as read from the accounts.cfg file in the application folder. E. g.: listCreds.append(("<platform>", "<username>", "<password>")) ''' listCreds = [] # If ...
python
def returnListOfCreds(): ''' :return: A list of tuples containing in the first the name of the platform, as read from the accounts.cfg file in the application folder. E. g.: listCreds.append(("<platform>", "<username>", "<password>")) ''' listCreds = [] # If ...
[ "def", "returnListOfCreds", "(", ")", ":", "listCreds", "=", "[", "]", "# If a accounts.cfg has not been found, creating it by copying from default", "configPath", "=", "os", ".", "path", ".", "join", "(", "configuration", ".", "getConfigPath", "(", ")", "[", "\"appPa...
:return: A list of tuples containing in the first the name of the platform, as read from the accounts.cfg file in the application folder. E. g.: listCreds.append(("<platform>", "<username>", "<password>"))
[ ":", "return", ":", "A", "list", "of", "tuples", "containing", "in", "the", "first", "the", "name", "of", "the", "platform", "as", "read", "from", "the", "accounts", ".", "cfg", "file", "in", "the", "application", "folder", ".", "E", ".", "g", ".", "...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/config_credentials.py#L29-L80
i3visio/osrframework
osrframework/thirdparties/infobel_com/processing.py
extractFieldsFromResult
def extractFieldsFromResult(data): ''' Method that parses Infobel textual information to return a series of attributes. :return: a list of i3visio-like objects. ''' entities = [] # Defining the objects to extract fieldsRegExp = {} fieldsRegExp["i3visio.full...
python
def extractFieldsFromResult(data): ''' Method that parses Infobel textual information to return a series of attributes. :return: a list of i3visio-like objects. ''' entities = [] # Defining the objects to extract fieldsRegExp = {} fieldsRegExp["i3visio.full...
[ "def", "extractFieldsFromResult", "(", "data", ")", ":", "entities", "=", "[", "]", "# Defining the objects to extract", "fieldsRegExp", "=", "{", "}", "fieldsRegExp", "[", "\"i3visio.fullname\"", "]", "=", "\"<span class=\\\"fn\\\">([^<]*)</span>\"", "fieldsRegExp", "[",...
Method that parses Infobel textual information to return a series of attributes. :return: a list of i3visio-like objects.
[ "Method", "that", "parses", "Infobel", "textual", "information", "to", "return", "a", "series", "of", "attributes", ".", ":", "return", ":", "a", "list", "of", "i3visio", "-", "like", "objects", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/infobel_com/processing.py#L28-L56
i3visio/osrframework
osrframework/thirdparties/infobel_com/processing.py
getResults
def getResults(uri): ''' Method that recovers the text for each result in infobel.com :param uri: Infobel uri :return: A list of textual information to be processed ''' # Using i3visio browser to avoid certain issues... i3Browser = browser.Browser() data...
python
def getResults(uri): ''' Method that recovers the text for each result in infobel.com :param uri: Infobel uri :return: A list of textual information to be processed ''' # Using i3visio browser to avoid certain issues... i3Browser = browser.Browser() data...
[ "def", "getResults", "(", "uri", ")", ":", "# Using i3visio browser to avoid certain issues...", "i3Browser", "=", "browser", ".", "Browser", "(", ")", "data", "=", "i3Browser", ".", "recoverURL", "(", "uri", ")", "# Strings to be searched", "regExp", "=", "\"<!-- R...
Method that recovers the text for each result in infobel.com :param uri: Infobel uri :return: A list of textual information to be processed
[ "Method", "that", "recovers", "the", "text", "for", "each", "result", "in", "infobel", ".", "com", ":", "param", "uri", ":", "Infobel", "uri", ":", "return", ":", "A", "list", "of", "textual", "information", "to", "be", "processed" ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/infobel_com/processing.py#L58-L76
i3visio/osrframework
osrframework/thirdparties/haveibeenpwned_com/hibp.py
checkIfEmailWasHacked
def checkIfEmailWasHacked(email=None, sleepSeconds=1): """ Method that checks if the given email is stored in the HIBP website. This function automatically waits a second to avoid problems with the API rate limit. An example of the json received: ``` [{"Title":"Adobe","Name":"Adobe","Domain...
python
def checkIfEmailWasHacked(email=None, sleepSeconds=1): """ Method that checks if the given email is stored in the HIBP website. This function automatically waits a second to avoid problems with the API rate limit. An example of the json received: ``` [{"Title":"Adobe","Name":"Adobe","Domain...
[ "def", "checkIfEmailWasHacked", "(", "email", "=", "None", ",", "sleepSeconds", "=", "1", ")", ":", "# Sleeping just a little bit", "time", ".", "sleep", "(", "sleepSeconds", ")", "print", "(", "\"\\t[*] Bypassing Cloudflare Restriction...\"", ")", "ua", "=", "'osrf...
Method that checks if the given email is stored in the HIBP website. This function automatically waits a second to avoid problems with the API rate limit. An example of the json received: ``` [{"Title":"Adobe","Name":"Adobe","Domain":"adobe.com","BreachDate":"2013-10-4","AddedDate":"2013-12-04T00:1...
[ "Method", "that", "checks", "if", "the", "given", "email", "is", "stored", "in", "the", "HIBP", "website", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/haveibeenpwned_com/hibp.py#L30-L124
i3visio/osrframework
osrframework/thirdparties/pipl_com/checkInfo.py
checkInfo
def checkInfo(email=None, username=None, api_key=None): ''' Method that checks if the given hash is stored in the pipl.com website. :param email: queries to be launched. :param api_key: api_key to be used in pipl.com. If not provided, the API key will be searched in the config_api_keys.py...
python
def checkInfo(email=None, username=None, api_key=None): ''' Method that checks if the given hash is stored in the pipl.com website. :param email: queries to be launched. :param api_key: api_key to be used in pipl.com. If not provided, the API key will be searched in the config_api_keys.py...
[ "def", "checkInfo", "(", "email", "=", "None", ",", "username", "=", "None", ",", "api_key", "=", "None", ")", ":", "# This is for i3visio", "if", "api_key", "==", "None", ":", "#api_key = raw_input(\"Insert the API KEY here:\\t\")", "allKeys", "=", "config_api_keys...
Method that checks if the given hash is stored in the pipl.com website. :param email: queries to be launched. :param api_key: api_key to be used in pipl.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python structure for the Json received. It ha...
[ "Method", "that", "checks", "if", "the", "given", "hash", "is", "stored", "in", "the", "pipl", ".", "com", "website", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/checkInfo.py#L30-L65
i3visio/osrframework
osrframework/thirdparties/pipl_com/checkInfo.py
launchRequest
def launchRequest(request): ''' Method to launch a given request. :param request: The request object. :return: A dictionary containinf the results of the person and a list of dicts containing the references for the record. ''' person = {} records = [] ...
python
def launchRequest(request): ''' Method to launch a given request. :param request: The request object. :return: A dictionary containinf the results of the person and a list of dicts containing the references for the record. ''' person = {} records = [] ...
[ "def", "launchRequest", "(", "request", ")", ":", "person", "=", "{", "}", "records", "=", "[", "]", "try", ":", "response", "=", "request", ".", "send", "(", ")", "# Trying to recover a person object. This is a dict:", "try", ":", "person", "=", "(", "respo...
Method to launch a given request. :param request: The request object. :return: A dictionary containinf the results of the person and a list of dicts containing the references for the record.
[ "Method", "to", "launch", "a", "given", "request", ".", ":", "param", "request", ":", "The", "request", "object", ".", ":", "return", ":", "A", "dictionary", "containinf", "the", "results", "of", "the", "person", "and", "a", "list", "of", "dicts", "conta...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/checkInfo.py#L68-L95
i3visio/osrframework
osrframework/utils/logger.py
setupLogger
def setupLogger(loggerName="osrframework", logFolder="./logs", verbosity=0): """ Returns the logger to be used for the whole app. This method may be invoked if required by the launcher to update the verbosity syntax. :param loggerName: Name of the package or app that is going to use this lo...
python
def setupLogger(loggerName="osrframework", logFolder="./logs", verbosity=0): """ Returns the logger to be used for the whole app. This method may be invoked if required by the launcher to update the verbosity syntax. :param loggerName: Name of the package or app that is going to use this lo...
[ "def", "setupLogger", "(", "loggerName", "=", "\"osrframework\"", ",", "logFolder", "=", "\"./logs\"", ",", "verbosity", "=", "0", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "loggerName", ")", "# create a logging format", "loginFormat", "=", "'%(...
Returns the logger to be used for the whole app. This method may be invoked if required by the launcher to update the verbosity syntax. :param loggerName: Name of the package or app that is going to use this logger. :param logFolder: Path to the folder where the information will be logged. ...
[ "Returns", "the", "logger", "to", "be", "used", "for", "the", "whole", "app", ".", "This", "method", "may", "be", "invoked", "if", "required", "by", "the", "launcher", "to", "update", "the", "verbosity", "syntax", ".", ":", "param", "loggerName", ":", "N...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/logger.py#L25-L75
i3visio/osrframework
osrframework/wrappers/pending/linkedin.py
Linkedin.do_mailfy
def do_mailfy(self, query): """ 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 an equivalent array. Args: ----- query: The element to be searched....
python
def do_mailfy(self, query): """ 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 an equivalent array. Args: ----- query: The element to be searched....
[ "def", "do_mailfy", "(", "self", ",", "query", ")", ":", "from", "bs4", "import", "BeautifulSoup", "#LINKEDIN-------------------------------------------------", "r", "=", "br", ".", "open", "(", "'https://www.linkedin.com/'", ")", "br", ".", "select_form", "(", "nr"...
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 an equivalent array. Args: ----- query: The element to be searched. Return: ------- A ...
[ "Verifying", "a", "mailfy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/wrappers/pending/linkedin.py#L116-L200
i3visio/osrframework
osrframework/searchengines/google.py
get_page
def get_page(url): """ Request the given URL and return the response page, using the cookie jar. @type url: str @param url: URL to retrieve. @rtype: str @return: Web page retrieved for the given URL. @raise IOError: An exception is raised on error. @raise urllib2.URLError...
python
def get_page(url): """ Request the given URL and return the response page, using the cookie jar. @type url: str @param url: URL to retrieve. @rtype: str @return: Web page retrieved for the given URL. @raise IOError: An exception is raised on error. @raise urllib2.URLError...
[ "def", "get_page", "(", "url", ")", ":", "request", "=", "Request", "(", "url", ")", "request", ".", "add_header", "(", "'User-Agent'", ",", "'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)'", ")", "cookie_jar", ".", "add_cookie_header", "(", "request", ")", "...
Request the given URL and return the response page, using the cookie jar. @type url: str @param url: URL to retrieve. @rtype: str @return: Web page retrieved for the given URL. @raise IOError: An exception is raised on error. @raise urllib2.URLError: An exception is raised on error...
[ "Request", "the", "given", "URL", "and", "return", "the", "response", "page", "using", "the", "cookie", "jar", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/searchengines/google.py#L62-L85
i3visio/osrframework
osrframework/searchengines/google.py
search
def search(query, tld='com', lang='en', num=10, start=0, stop=None, pause=2.0, only_standard=False): """ Search the given query string using Google. @type query: str @param query: Query string. Must NOT be url-encoded. @type tld: str @param tld: Top level domain. @...
python
def search(query, tld='com', lang='en', num=10, start=0, stop=None, pause=2.0, only_standard=False): """ Search the given query string using Google. @type query: str @param query: Query string. Must NOT be url-encoded. @type tld: str @param tld: Top level domain. @...
[ "def", "search", "(", "query", ",", "tld", "=", "'com'", ",", "lang", "=", "'en'", ",", "num", "=", "10", ",", "start", "=", "0", ",", "stop", "=", "None", ",", "pause", "=", "2.0", ",", "only_standard", "=", "False", ")", ":", "# Lazy import of Be...
Search the given query string using Google. @type query: str @param query: Query string. Must NOT be url-encoded. @type tld: str @param tld: Top level domain. @type lang: str @param lang: Languaje. @type num: int @param num: Number of results per page. @type s...
[ "Search", "the", "given", "query", "string", "using", "Google", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/searchengines/google.py#L114-L234
i3visio/osrframework
osrframework/searchengines/google.py
processSearch
def processSearch(query, tld='com', lang='en', num=10, start=0, stop=50, pause=2.0, only_standard=False): ''' Method that recovers the URI for a search returning an i3visio-compliant json object. :return: A json-like object. ''' uriList = search(query, tld=tld, lang=lang...
python
def processSearch(query, tld='com', lang='en', num=10, start=0, stop=50, pause=2.0, only_standard=False): ''' Method that recovers the URI for a search returning an i3visio-compliant json object. :return: A json-like object. ''' uriList = search(query, tld=tld, lang=lang...
[ "def", "processSearch", "(", "query", ",", "tld", "=", "'com'", ",", "lang", "=", "'en'", ",", "num", "=", "10", ",", "start", "=", "0", ",", "stop", "=", "50", ",", "pause", "=", "2.0", ",", "only_standard", "=", "False", ")", ":", "uriList", "=...
Method that recovers the URI for a search returning an i3visio-compliant json object. :return: A json-like object.
[ "Method", "that", "recovers", "the", "URI", "for", "a", "search", "returning", "an", "i3visio", "-", "compliant", "json", "object", ".", ":", "return", ":", "A", "json", "-", "like", "object", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/searchengines/google.py#L237-L257
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.add_fields
def add_fields(self, fields): """Add the fields to their corresponding container. `fields` is an iterable of field objects from osrframework.thirdparties.pipl_com.lib.fields. """ for field in fields: cls = field.__class__ try: con...
python
def add_fields(self, fields): """Add the fields to their corresponding container. `fields` is an iterable of field objects from osrframework.thirdparties.pipl_com.lib.fields. """ for field in fields: cls = field.__class__ try: con...
[ "def", "add_fields", "(", "self", ",", "fields", ")", ":", "for", "field", "in", "fields", ":", "cls", "=", "field", ".", "__class__", "try", ":", "container", "=", "FieldsContainer", ".", "class_container", "[", "cls", "]", "except", "KeyError", ":", "r...
Add the fields to their corresponding container. `fields` is an iterable of field objects from osrframework.thirdparties.pipl_com.lib.fields.
[ "Add", "the", "fields", "to", "their", "corresponding", "container", ".", "fields", "is", "an", "iterable", "of", "field", "objects", "from", "osrframework", ".", "thirdparties", ".", "pipl_com", ".", "lib", ".", "fields", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L48-L60
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.all_fields
def all_fields(self): """A list with all the fields contained in this object.""" return [field for container in FieldsContainer.class_container.values() for field in getattr(self, container)]
python
def all_fields(self): """A list with all the fields contained in this object.""" return [field for container in FieldsContainer.class_container.values() for field in getattr(self, container)]
[ "def", "all_fields", "(", "self", ")", ":", "return", "[", "field", "for", "container", "in", "FieldsContainer", ".", "class_container", ".", "values", "(", ")", "for", "field", "in", "getattr", "(", "self", ",", "container", ")", "]" ]
A list with all the fields contained in this object.
[ "A", "list", "with", "all", "the", "fields", "contained", "in", "this", "object", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L63-L67
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.fields_from_dict
def fields_from_dict(d): """Load the fields from the dict, return a list with all the fields.""" class_container = FieldsContainer.class_container fields = [field_cls.from_dict(field_dict) for field_cls, container in class_container.iteritems() for field_dict...
python
def fields_from_dict(d): """Load the fields from the dict, return a list with all the fields.""" class_container = FieldsContainer.class_container fields = [field_cls.from_dict(field_dict) for field_cls, container in class_container.iteritems() for field_dict...
[ "def", "fields_from_dict", "(", "d", ")", ":", "class_container", "=", "FieldsContainer", ".", "class_container", "fields", "=", "[", "field_cls", ".", "from_dict", "(", "field_dict", ")", "for", "field_cls", ",", "container", "in", "class_container", ".", "iter...
Load the fields from the dict, return a list with all the fields.
[ "Load", "the", "fields", "from", "the", "dict", "return", "a", "list", "with", "all", "the", "fields", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L70-L76
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
FieldsContainer.fields_to_dict
def fields_to_dict(self): """Transform the object to a dict and return the dict.""" d = {} for container in FieldsContainer.class_container.values(): fields = getattr(self, container) if fields: d[container] = [field.to_dict() for field in fields] ...
python
def fields_to_dict(self): """Transform the object to a dict and return the dict.""" d = {} for container in FieldsContainer.class_container.values(): fields = getattr(self, container) if fields: d[container] = [field.to_dict() for field in fields] ...
[ "def", "fields_to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "for", "container", "in", "FieldsContainer", ".", "class_container", ".", "values", "(", ")", ":", "fields", "=", "getattr", "(", "self", ",", "container", ")", "if", "fields", ":", "d...
Transform the object to a dict and return the dict.
[ "Transform", "the", "object", "to", "a", "dict", "and", "return", "the", "dict", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L78-L85
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Record.from_dict
def from_dict(d): """Transform the dict to a record object and return the record.""" query_params_match = d.get('@query_params_match') query_person_match = d.get('@query_person_match') valid_since = d.get('@valid_since') if valid_since: valid_since = str_to_datetime(v...
python
def from_dict(d): """Transform the dict to a record object and return the record.""" query_params_match = d.get('@query_params_match') query_person_match = d.get('@query_person_match') valid_since = d.get('@valid_since') if valid_since: valid_since = str_to_datetime(v...
[ "def", "from_dict", "(", "d", ")", ":", "query_params_match", "=", "d", ".", "get", "(", "'@query_params_match'", ")", "query_person_match", "=", "d", ".", "get", "(", "'@query_person_match'", ")", "valid_since", "=", "d", ".", "get", "(", "'@valid_since'", ...
Transform the dict to a record object and return the record.
[ "Transform", "the", "dict", "to", "a", "record", "object", "and", "return", "the", "record", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L145-L157
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Record.to_dict
def to_dict(self): """Return a dict representation of the record.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.query_person_match is not None: d['@query_person_match'] = self.query_person_match ...
python
def to_dict(self): """Return a dict representation of the record.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.query_person_match is not None: d['@query_person_match'] = self.query_person_match ...
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "if", "self", ".", "query_params_match", "is", "not", "None", ":", "d", "[", "'@query_params_match'", "]", "=", "self", ".", "query_params_match", "if", "self", ".", "query_person_match", "is", ...
Return a dict representation of the record.
[ "Return", "a", "dict", "representation", "of", "the", "record", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L159-L171
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.is_searchable
def is_searchable(self): """A bool value that indicates whether the person has enough data and can be sent as a query to the API.""" filter_func = lambda field: field.is_searchable return bool(filter(filter_func, self.names) or filter(filter_func, self.emails) or ...
python
def is_searchable(self): """A bool value that indicates whether the person has enough data and can be sent as a query to the API.""" filter_func = lambda field: field.is_searchable return bool(filter(filter_func, self.names) or filter(filter_func, self.emails) or ...
[ "def", "is_searchable", "(", "self", ")", ":", "filter_func", "=", "lambda", "field", ":", "field", ".", "is_searchable", "return", "bool", "(", "filter", "(", "filter_func", ",", "self", ".", "names", ")", "or", "filter", "(", "filter_func", ",", "self", ...
A bool value that indicates whether the person has enough data and can be sent as a query to the API.
[ "A", "bool", "value", "that", "indicates", "whether", "the", "person", "has", "enough", "data", "and", "can", "be", "sent", "as", "a", "query", "to", "the", "API", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L222-L229
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.unsearchable_fields
def unsearchable_fields(self): """A list of all the fields that can't be searched by. For example: names/usernames that are too short, emails that are invalid etc. """ filter_func = lambda field: not field.is_searchable return filter(filter_func, self.n...
python
def unsearchable_fields(self): """A list of all the fields that can't be searched by. For example: names/usernames that are too short, emails that are invalid etc. """ filter_func = lambda field: not field.is_searchable return filter(filter_func, self.n...
[ "def", "unsearchable_fields", "(", "self", ")", ":", "filter_func", "=", "lambda", "field", ":", "not", "field", ".", "is_searchable", "return", "filter", "(", "filter_func", ",", "self", ".", "names", ")", "+", "filter", "(", "filter_func", ",", "self", "...
A list of all the fields that can't be searched by. For example: names/usernames that are too short, emails that are invalid etc.
[ "A", "list", "of", "all", "the", "fields", "that", "can", "t", "be", "searched", "by", ".", "For", "example", ":", "names", "/", "usernames", "that", "are", "too", "short", "emails", "that", "are", "invalid", "etc", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L232-L245
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.from_dict
def from_dict(d): """Transform the dict to a person object and return the person.""" query_params_match = d.get('@query_params_match') sources = [Source.from_dict(source) for source in d.get('sources', [])] fields = Person.fields_from_dict(d) return Person(fields=fields, sources=...
python
def from_dict(d): """Transform the dict to a person object and return the person.""" query_params_match = d.get('@query_params_match') sources = [Source.from_dict(source) for source in d.get('sources', [])] fields = Person.fields_from_dict(d) return Person(fields=fields, sources=...
[ "def", "from_dict", "(", "d", ")", ":", "query_params_match", "=", "d", ".", "get", "(", "'@query_params_match'", ")", "sources", "=", "[", "Source", ".", "from_dict", "(", "source", ")", "for", "source", "in", "d", ".", "get", "(", "'sources'", ",", "...
Transform the dict to a person object and return the person.
[ "Transform", "the", "dict", "to", "a", "person", "object", "and", "return", "the", "person", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L248-L254
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/containers.py
Person.to_dict
def to_dict(self): """Return a dict representation of the person.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.sources: d['sources'] = [source.to_dict() for source in self.sources] d.update(se...
python
def to_dict(self): """Return a dict representation of the person.""" d = {} if self.query_params_match is not None: d['@query_params_match'] = self.query_params_match if self.sources: d['sources'] = [source.to_dict() for source in self.sources] d.update(se...
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "{", "}", "if", "self", ".", "query_params_match", "is", "not", "None", ":", "d", "[", "'@query_params_match'", "]", "=", "self", ".", "query_params_match", "if", "self", ".", "sources", ":", "d", "[",...
Return a dict representation of the person.
[ "Return", "a", "dict", "representation", "of", "the", "person", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/containers.py#L256-L264
i3visio/osrframework
osrframework/phonefy.py
processPhoneList
def processPhoneList(platformNames=[], numbers=[], excludePlatformNames=[]): """ Method to perform searchs on a series of numbers. Args: ----- platformNames: List of names of the platforms. numbers: List of numbers to be queried. excludePlatformNames: A list of platforms not to ...
python
def processPhoneList(platformNames=[], numbers=[], excludePlatformNames=[]): """ Method to perform searchs on a series of numbers. Args: ----- platformNames: List of names of the platforms. numbers: List of numbers to be queried. excludePlatformNames: A list of platforms not to ...
[ "def", "processPhoneList", "(", "platformNames", "=", "[", "]", ",", "numbers", "=", "[", "]", ",", "excludePlatformNames", "=", "[", "]", ")", ":", "# Grabbing the <Platform> objects", "platforms", "=", "platform_selection", ".", "getPlatformsByName", "(", "platf...
Method to perform searchs on a series of numbers. Args: ----- platformNames: List of names of the platforms. numbers: List of numbers to be queried. excludePlatformNames: A list of platforms not to be searched. Return: ------- A list of verified emails.
[ "Method", "to", "perform", "searchs", "on", "a", "series", "of", "numbers", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/phonefy.py#L37-L61
i3visio/osrframework
osrframework/utils/platforms.py
Platform.createURL
def createURL(self, word, mode="phonefy"): """ Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried. """ ...
python
def createURL(self, word, mode="phonefy"): """ Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried. """ ...
[ "def", "createURL", "(", "self", ",", "word", ",", "mode", "=", "\"phonefy\"", ")", ":", "try", ":", "return", "self", ".", "modes", "[", "mode", "]", "[", "\"url\"", "]", ".", "format", "(", "placeholder", "=", "urllib", ".", "pathname2url", "(", "w...
Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried.
[ "Method", "to", "create", "the", "URL", "replacing", "the", "word", "in", "the", "appropriate", "URL", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L86-L112
i3visio/osrframework
osrframework/utils/platforms.py
Platform.launchQueryForMode
def launchQueryForMode(self, query=None, mode=None): """ Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing...
python
def launchQueryForMode(self, query=None, mode=None): """ Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing...
[ "def", "launchQueryForMode", "(", "self", ",", "query", "=", "None", ",", "mode", "=", "None", ")", ":", "# Creating the query URL for that mode", "qURL", "=", "self", ".", "createURL", "(", "word", "=", "query", ",", "mode", "=", "mode", ")", "i3Browser", ...
Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing the recovered data or None.
[ "Method", "that", "launches", "an", "i3Browser", "to", "collect", "data", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L115-L144
i3visio/osrframework
osrframework/utils/platforms.py
Platform.getInfo
def getInfo(self, query=None, process=False, mode="phonefy", qURI=None): """ Method that checks the presence of a given query and recovers the first list of complains. Args: ----- query: Query to verify. process: Calling the processing function. mode:...
python
def getInfo(self, query=None, process=False, mode="phonefy", qURI=None): """ Method that checks the presence of a given query and recovers the first list of complains. Args: ----- query: Query to verify. process: Calling the processing function. mode:...
[ "def", "getInfo", "(", "self", ",", "query", "=", "None", ",", "process", "=", "False", ",", "mode", "=", "\"phonefy\"", ",", "qURI", "=", "None", ")", ":", "results", "=", "[", "]", "data", "=", "\"\"", "if", "self", ".", "_modeIsValid", "(", "mod...
Method that checks the presence of a given query and recovers the first list of complains. Args: ----- query: Query to verify. process: Calling the processing function. mode: Mode to be executed. qURI: A query to be checked. Return: -----...
[ "Method", "that", "checks", "the", "presence", "of", "a", "given", "query", "and", "recovers", "the", "first", "list", "of", "complains", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L147-L178
i3visio/osrframework
osrframework/utils/platforms.py
Platform._modeIsValid
def _modeIsValid(self, mode): """ Verification of whether the mode is a correct option to be used. Args: ----- mode: Mode to be executed. Return: ------- True if the mode exists in the three main folders. """ try: # Su...
python
def _modeIsValid(self, mode): """ Verification of whether the mode is a correct option to be used. Args: ----- mode: Mode to be executed. Return: ------- True if the mode exists in the three main folders. """ try: # Su...
[ "def", "_modeIsValid", "(", "self", ",", "mode", ")", ":", "try", ":", "# Suport for version 2 of wrappers", "return", "mode", "in", "self", ".", "modes", ".", "keys", "(", ")", "except", "AttributeError", "as", "e", ":", "# Legacy for mantaining old wrappers", ...
Verification of whether the mode is a correct option to be used. Args: ----- mode: Mode to be executed. Return: ------- True if the mode exists in the three main folders.
[ "Verification", "of", "whether", "the", "mode", "is", "a", "correct", "option", "to", "be", "used", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L181-L201
i3visio/osrframework
osrframework/utils/platforms.py
Platform._getAuthenticated
def _getAuthenticated(self, browser, url): """ Getting authenticated. This method may be overwritten. TODO: update to version 2 of the wrappers. Args: ----- browser: The browser in which the user will be authenticated. url: The URL to get authen...
python
def _getAuthenticated(self, browser, url): """ Getting authenticated. This method may be overwritten. TODO: update to version 2 of the wrappers. Args: ----- browser: The browser in which the user will be authenticated. url: The URL to get authen...
[ "def", "_getAuthenticated", "(", "self", ",", "browser", ",", "url", ")", ":", "# check if we have creds", "try", ":", "if", "len", "(", "self", ".", "creds", ")", ">", "0", ":", "# TODO: in choosing a cred there is an uneeded nesting of arrays", "c", "=", "random...
Getting authenticated. This method may be overwritten. TODO: update to version 2 of the wrappers. Args: ----- browser: The browser in which the user will be authenticated. url: The URL to get authenticated in. Return: ------- True o...
[ "Getting", "authenticated", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L234-L267
i3visio/osrframework
osrframework/utils/platforms.py
Platform._isValidQuery
def _isValidQuery(self, query, mode="phonefy"): """ Method to verify if a given query is processable by the platform. The system looks for the forbidden characters in self.Forbidden list. Args: ----- query: The query to be launched. mode: To be chosen am...
python
def _isValidQuery(self, query, mode="phonefy"): """ Method to verify if a given query is processable by the platform. The system looks for the forbidden characters in self.Forbidden list. Args: ----- query: The query to be launched. mode: To be chosen am...
[ "def", "_isValidQuery", "(", "self", ",", "query", ",", "mode", "=", "\"phonefy\"", ")", ":", "try", ":", "# Suport for version 2 of wrappers", "validator", "=", "self", ".", "modes", "[", "mode", "]", ".", "get", "(", "\"query_validator\"", ")", "if", "vali...
Method to verify if a given query is processable by the platform. The system looks for the forbidden characters in self.Forbidden list. Args: ----- query: The query to be launched. mode: To be chosen amongst mailfy, phonefy, usufy, searchfy. Return: ----...
[ "Method", "to", "verify", "if", "a", "given", "query", "is", "processable", "by", "the", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L270-L301
i3visio/osrframework
osrframework/utils/platforms.py
Platform._somethingFound
def _somethingFound(self, data, mode="phonefy"): """ Verifying if something was found. Args: ----- data: Data where the self.notFoundText will be searched. mode: Mode to be executed. Return: ------- True if exists. """ ...
python
def _somethingFound(self, data, mode="phonefy"): """ Verifying if something was found. Args: ----- data: Data where the self.notFoundText will be searched. mode: Mode to be executed. Return: ------- True if exists. """ ...
[ "def", "_somethingFound", "(", "self", ",", "data", ",", "mode", "=", "\"phonefy\"", ")", ":", "if", "data", ":", "try", ":", "for", "text", "in", "self", ".", "notFoundText", "[", "mode", "]", ":", "if", "text", "in", "data", ":", "return", "False",...
Verifying if something was found. Args: ----- data: Data where the self.notFoundText will be searched. mode: Mode to be executed. Return: ------- True if exists.
[ "Verifying", "if", "something", "was", "found", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L304-L331
i3visio/osrframework
osrframework/utils/platforms.py
Platform.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", "=", "{", "}", ")", ":", "data", "=", "self", ".", "launchQueryForMode", "(", "query", "=", "query", ",", "mode", "=", "\"mailfy\"", ")", "if", "self", ".", "_somethingFound", "(", "data"...
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/utils/platforms.py#L338-L357
i3visio/osrframework
osrframework/utils/platforms.py
Platform.do_mailfy
def do_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 an equivalent array. Args: ----- query: The element to be...
python
def do_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 an equivalent array. Args: ----- query: The element to be...
[ "def", "do_mailfy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "check_mailfy", "(", "query", ",", "kwargs", ")", ":", "expandedEntities", "=", "general", ".", "expandEntitiesFromEmail", "(", "query", ")", "r", "=", ...
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 an equivalent array. Args: ----- query: The element to be searched. Return: ------- A ...
[ "Verifying", "a", "mailfy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L359-L416
i3visio/osrframework
osrframework/utils/platforms.py
Platform.check_searchfy
def check_searchfy(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 ele...
python
def check_searchfy(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 ele...
[ "def", "check_searchfy", "(", "self", ",", "query", ",", "kwargs", "=", "{", "}", ")", ":", "data", "=", "self", ".", "launchQueryForMode", "(", "query", "=", "query", ",", "mode", "=", "\"searchfy\"", ")", "if", "self", ".", "_somethingFound", "(", "d...
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/utils/platforms.py#L418-L437
i3visio/osrframework
osrframework/utils/platforms.py
Platform.do_searchfy
def do_searchfy(self, query, **kwargs): """ Verifying a searchfy query in this platform. This might be redefined in any class inheriting from Platform. Performing additional procesing may be possible by iterating the requested profiles to extract more entities from the URI woul...
python
def do_searchfy(self, query, **kwargs): """ Verifying a searchfy query in this platform. This might be redefined in any class inheriting from Platform. Performing additional procesing may be possible by iterating the requested profiles to extract more entities from the URI woul...
[ "def", "do_searchfy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "results", "=", "[", "]", "print", "(", "\"[*] Launching search using the {} module...\"", ".", "format", "(", "self", ".", "__class__", ".", "__name__", ")", ")", "test", ...
Verifying a searchfy query in this platform. This might be redefined in any class inheriting from Platform. Performing additional procesing may be possible by iterating the requested profiles to extract more entities from the URI would be slow. Sample code may be: if kwargs["proce...
[ "Verifying", "a", "searchfy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L439-L517
i3visio/osrframework
osrframework/utils/platforms.py
Platform.check_phonefy
def check_phonefy(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 elem...
python
def check_phonefy(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 elem...
[ "def", "check_phonefy", "(", "self", ",", "query", ",", "kwargs", "=", "{", "}", ")", ":", "data", "=", "self", ".", "launchQueryForMode", "(", "query", "=", "query", ",", "mode", "=", "\"phonefy\"", ")", "if", "self", ".", "_somethingFound", "(", "dat...
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/utils/platforms.py#L520-L539
i3visio/osrframework
osrframework/utils/platforms.py
Platform.do_phonefy
def do_phonefy(self, query, **kwargs): """ Verifying a phonefy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be...
python
def do_phonefy(self, query, **kwargs): """ Verifying a phonefy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be...
[ "def", "do_phonefy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "results", "=", "[", "]", "test", "=", "self", ".", "check_phonefy", "(", "query", ",", "kwargs", ")", "if", "test", ":", "r", "=", "{", "\"type\"", ":", "\"i3visio....
Verifying a phonefy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be appended.
[ "Verifying", "a", "phonefy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L541-L587
i3visio/osrframework
osrframework/utils/platforms.py
Platform.check_usufy
def check_usufy(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 element to ...
python
def check_usufy(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 element to ...
[ "def", "check_usufy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "data", "=", "self", ".", "launchQueryForMode", "(", "query", "=", "query", ",", "mode", "=", "\"usufy\"", ")", "if", "self", ".", "_somethingFound", "(", "data", ",", ...
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 parameter...
[ "Verifying", "a", "mailfy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L653-L672
i3visio/osrframework
osrframework/utils/platforms.py
Platform.do_usufy
def do_usufy(self, query, **kwargs): """ Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be app...
python
def do_usufy(self, query, **kwargs): """ Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be app...
[ "def", "do_usufy", "(", "self", ",", "query", ",", "*", "*", "kwargs", ")", ":", "results", "=", "[", "]", "test", "=", "self", ".", "check_usufy", "(", "query", ",", "*", "*", "kwargs", ")", "if", "test", ":", "r", "=", "{", "\"type\"", ":", "...
Verifying a usufy query in this platform. This might be redefined in any class inheriting from Platform. Args: ----- query: The element to be searched. Return: ------- A list of elements to be appended.
[ "Verifying", "a", "usufy", "query", "in", "this", "platform", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L674-L721
i3visio/osrframework
osrframework/utils/platforms.py
Platform.process_usufy
def process_usufy(self, data): """ Method to process and extract the entities of a usufy Args: ----- data: The information from which the info will be extracted. Return: ------- A list of the entities found. """ mode ...
python
def process_usufy(self, data): """ Method to process and extract the entities of a usufy Args: ----- data: The information from which the info will be extracted. Return: ------- A list of the entities found. """ mode ...
[ "def", "process_usufy", "(", "self", ",", "data", ")", ":", "mode", "=", "\"usufy\"", "info", "=", "[", "]", "try", ":", "# v2", "verifier", "=", "self", ".", "modes", ".", "get", "(", "mode", ",", "{", "}", ")", ".", "get", "(", "\"extra_fields\""...
Method to process and extract the entities of a usufy Args: ----- data: The information from which the info will be extracted. Return: ------- A list of the entities found.
[ "Method", "to", "process", "and", "extract", "the", "entities", "of", "a", "usufy" ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platforms.py#L723-L783
i3visio/osrframework
osrframework/utils/regexp_selection.py
getAllRegexp
def getAllRegexp(): ''' Method that recovers ALL the list of <RegexpObject> classes to be processed.... :return: Returns a list [] of <RegexpObject> classes. ''' listAll = [] ############################################################################ ##########################...
python
def getAllRegexp(): ''' Method that recovers ALL the list of <RegexpObject> classes to be processed.... :return: Returns a list [] of <RegexpObject> classes. ''' listAll = [] ############################################################################ ##########################...
[ "def", "getAllRegexp", "(", ")", ":", "listAll", "=", "[", "]", "############################################################################", "############################################################################", "# -------------------------------------------------------------------...
Method that recovers ALL the list of <RegexpObject> classes to be processed.... :return: Returns a list [] of <RegexpObject> classes.
[ "Method", "that", "recovers", "ALL", "the", "list", "of", "<RegexpObject", ">", "classes", "to", "be", "processed", "...." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/regexp_selection.py#L34-L134
i3visio/osrframework
osrframework/thirdparties/md5crack_com/checkIfHashIsCracked.py
checkIfHashIsCracked
def checkIfHashIsCracked(hash=None, api_key=None): ''' Method that checks if the given hash is stored in the md5crack.com website. :param hash: hash to verify. :param api_key: api_key to be used in md5crack.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python s...
python
def checkIfHashIsCracked(hash=None, api_key=None): ''' Method that checks if the given hash is stored in the md5crack.com website. :param hash: hash to verify. :param api_key: api_key to be used in md5crack.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python s...
[ "def", "checkIfHashIsCracked", "(", "hash", "=", "None", ",", "api_key", "=", "None", ")", ":", "# This is for i3visio", "if", "api_key", "==", "None", ":", "#api_key = raw_input(\"Insert the API KEY here:\\t\")", "allKeys", "=", "config_api_keys", ".", "returnListOfAPI...
Method that checks if the given hash is stored in the md5crack.com website. :param hash: hash to verify. :param api_key: api_key to be used in md5crack.com. If not provided, the API key will be searched in the config_api_keys.py file. :return: Python structure for the Json received. It has the following struct...
[ "Method", "that", "checks", "if", "the", "given", "hash", "is", "stored", "in", "the", "md5crack", ".", "com", "website", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/md5crack_com/checkIfHashIsCracked.py#L27-L63
i3visio/osrframework
osrframework/wrappers/spoj.py
Spoj.somethingFound
def somethingFound(self,data,mode="phonefy"): ''' Verifying if something was found. Note that this method needed to be rewritten as in Spoj we need to look for a text which APPEARS instead of looking for a text that does NOT appear. :param data: Data where the self.notFo...
python
def somethingFound(self,data,mode="phonefy"): ''' Verifying if something was found. Note that this method needed to be rewritten as in Spoj we need to look for a text which APPEARS instead of looking for a text that does NOT appear. :param data: Data where the self.notFo...
[ "def", "somethingFound", "(", "self", ",", "data", ",", "mode", "=", "\"phonefy\"", ")", ":", "#try:", "for", "text", "in", "self", ".", "notFoundText", "[", "mode", "]", ":", "if", "text", "in", "data", ":", "# This is the change with regards to the standard ...
Verifying if something was found. Note that this method needed to be rewritten as in Spoj we need to look for a text which APPEARS instead of looking for a text that does NOT appear. :param data: Data where the self.notFoundText will be searched. :param mode: Mode to be execut...
[ "Verifying", "if", "something", "was", "found", ".", "Note", "that", "this", "method", "needed", "to", "be", "rewritten", "as", "in", "Spoj", "we", "need", "to", "look", "for", "a", "text", "which", "APPEARS", "instead", "of", "looking", "for", "a", "tex...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/wrappers/spoj.py#L116-L130
i3visio/osrframework
osrframework/utils/benchmark.py
doBenchmark
def doBenchmark(plats): ''' Perform the benchmark... ''' logger = logging.getLogger("osrframework.utils") # defining the results dict res = {} # args args = [] #for p in plats: # args.append( (str(p),) ) # selecting the number of tries to be performed tries = [1, 4, 8 ,16, 24, 32, 40, 48, 56, 64] ...
python
def doBenchmark(plats): ''' Perform the benchmark... ''' logger = logging.getLogger("osrframework.utils") # defining the results dict res = {} # args args = [] #for p in plats: # args.append( (str(p),) ) # selecting the number of tries to be performed tries = [1, 4, 8 ,16, 24, 32, 40, 48, 56, 64] ...
[ "def", "doBenchmark", "(", "plats", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "\"osrframework.utils\"", ")", "# defining the results dict", "res", "=", "{", "}", "# args", "args", "=", "[", "]", "#for p in plats:", "#\targs.append( (str(p),) )", "...
Perform the benchmark...
[ "Perform", "the", "benchmark", "..." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/benchmark.py#L55-L90
i3visio/osrframework
osrframework/utils/configuration.py
changePermissionsRecursively
def changePermissionsRecursively(path, uid, gid): """ Function to recursively change the user id and group id. It sets 700 permissions. """ os.chown(path, uid, gid) for item in os.listdir(path): itempath = os.path.join(path, item) if os.path.isfile(itempath): # Setti...
python
def changePermissionsRecursively(path, uid, gid): """ Function to recursively change the user id and group id. It sets 700 permissions. """ os.chown(path, uid, gid) for item in os.listdir(path): itempath = os.path.join(path, item) if os.path.isfile(itempath): # Setti...
[ "def", "changePermissionsRecursively", "(", "path", ",", "uid", ",", "gid", ")", ":", "os", ".", "chown", "(", "path", ",", "uid", ",", "gid", ")", "for", "item", "in", "os", ".", "listdir", "(", "path", ")", ":", "itempath", "=", "os", ".", "path"...
Function to recursively change the user id and group id. It sets 700 permissions.
[ "Function", "to", "recursively", "change", "the", "user", "id", "and", "group", "id", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/configuration.py#L33-L63
i3visio/osrframework
osrframework/utils/configuration.py
getConfigPath
def getConfigPath(configFileName = None): """ Auxiliar function to get the configuration paths depending on the system Args: ----- configFileName: TODO. Returns: -------- A dictionary with the following keys: appPath, appPathDefaults, appPathTransforms, appPathPlugi...
python
def getConfigPath(configFileName = None): """ Auxiliar function to get the configuration paths depending on the system Args: ----- configFileName: TODO. Returns: -------- A dictionary with the following keys: appPath, appPathDefaults, appPathTransforms, appPathPlugi...
[ "def", "getConfigPath", "(", "configFileName", "=", "None", ")", ":", "paths", "=", "{", "}", "applicationPath", "=", "\"./\"", "# Returning the path of the configuration folder", "if", "sys", ".", "platform", "==", "'win32'", ":", "applicationPath", "=", "os", "....
Auxiliar function to get the configuration paths depending on the system Args: ----- configFileName: TODO. Returns: -------- A dictionary with the following keys: appPath, appPathDefaults, appPathTransforms, appPathPlugins, appPathPatterns, appPathPatterns.
[ "Auxiliar", "function", "to", "get", "the", "configuration", "paths", "depending", "on", "the", "system" ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/configuration.py#L66-L103
i3visio/osrframework
osrframework/utils/configuration.py
returnListOfConfigurationValues
def returnListOfConfigurationValues(util): """ Method that recovers the configuration information about each program TODO: Grab the default file from the package data instead of storing it in the main folder. Args: ----- util: Any of the utils that are contained in the framework: domai...
python
def returnListOfConfigurationValues(util): """ Method that recovers the configuration information about each program TODO: Grab the default file from the package data instead of storing it in the main folder. Args: ----- util: Any of the utils that are contained in the framework: domai...
[ "def", "returnListOfConfigurationValues", "(", "util", ")", ":", "VALUES", "=", "{", "}", "# If a api_keys.cfg has not been found, creating it by copying from default", "configPath", "=", "os", ".", "path", ".", "join", "(", "getConfigPath", "(", ")", "[", "\"appPath\""...
Method that recovers the configuration information about each program TODO: Grab the default file from the package data instead of storing it in the main folder. Args: ----- util: Any of the utils that are contained in the framework: domainfy, entify, mailfy, phonefy, searchfy, usu...
[ "Method", "that", "recovers", "the", "configuration", "information", "about", "each", "program" ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/configuration.py#L106-L195
i3visio/osrframework
osrframework/thirdparties/blockchain_info/getBitcoinAddressDetails.py
getBitcoinAddressDetails
def getBitcoinAddressDetails(address=None): ''' Method that checks the presence of a Bitcoin Address in blockchain.info: { "total_sent": 41301084, "total_received": 52195147, "final_balance": 10894063, "address": "1APKyS2TEdFMjXjJfMCgavFtoWuv2QNXTw", "hash160": "66f21efc754af07e87913db46bf24d...
python
def getBitcoinAddressDetails(address=None): ''' Method that checks the presence of a Bitcoin Address in blockchain.info: { "total_sent": 41301084, "total_received": 52195147, "final_balance": 10894063, "address": "1APKyS2TEdFMjXjJfMCgavFtoWuv2QNXTw", "hash160": "66f21efc754af07e87913db46bf24d...
[ "def", "getBitcoinAddressDetails", "(", "address", "=", "None", ")", ":", "try", ":", "apiURL", "=", "\"https://blockchain.info/rawaddr/\"", "+", "str", "(", "address", ")", "# Accessing the HIBP API", "data", "=", "urllib2", ".", "urlopen", "(", "apiURL", ")", ...
Method that checks the presence of a Bitcoin Address in blockchain.info: { "total_sent": 41301084, "total_received": 52195147, "final_balance": 10894063, "address": "1APKyS2TEdFMjXjJfMCgavFtoWuv2QNXTw", "hash160": "66f21efc754af07e87913db46bf24df2eb0d5075", ... } :param address: Bitcoin address ...
[ "Method", "that", "checks", "the", "presence", "of", "a", "Bitcoin", "Address", "in", "blockchain", ".", "info", ":", "{", "total_sent", ":", "41301084", "total_received", ":", "52195147", "final_balance", ":", "10894063", "address", ":", "1APKyS2TEdFMjXjJfMCgavFt...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/blockchain_info/getBitcoinAddressDetails.py#L26-L53
i3visio/osrframework
osrframework/searchfy.py
performSearch
def performSearch(platformNames=[], queries=[], process=False, excludePlatformNames=[]): """ Method to perform the search itself on the different platforms. Args: ----- platforms: List of <Platform> objects. queries: List of queries to be performed. process: Whether to process a...
python
def performSearch(platformNames=[], queries=[], process=False, excludePlatformNames=[]): """ Method to perform the search itself on the different platforms. Args: ----- platforms: List of <Platform> objects. queries: List of queries to be performed. process: Whether to process a...
[ "def", "performSearch", "(", "platformNames", "=", "[", "]", ",", "queries", "=", "[", "]", ",", "process", "=", "False", ",", "excludePlatformNames", "=", "[", "]", ")", ":", "# Grabbing the <Platform> objects", "platforms", "=", "platform_selection", ".", "g...
Method to perform the search itself on the different platforms. Args: ----- platforms: List of <Platform> objects. queries: List of queries to be performed. process: Whether to process all the profiles... SLOW! Returns: -------- A list with the entities collected.
[ "Method", "to", "perform", "the", "search", "itself", "on", "the", "different", "platforms", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/searchfy.py#L37-L60
i3visio/osrframework
osrframework/searchfy.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", "results", "=", "[", "]"...
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/searchfy.py#L98-L187
i3visio/osrframework
osrframework/utils/platform_selection.py
getAllPlatformNames
def getAllPlatformNames(mode): """Method that defines the whole list of available parameters. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. Return values: Returns a list [] of strings for the platform objects. """ # Recov...
python
def getAllPlatformNames(mode): """Method that defines the whole list of available parameters. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. Return values: Returns a list [] of strings for the platform objects. """ # Recov...
[ "def", "getAllPlatformNames", "(", "mode", ")", ":", "# Recovering all the possible platforms installed", "platOptions", "=", "[", "]", "if", "mode", "in", "[", "\"phonefy\"", ",", "\"usufy\"", ",", "\"searchfy\"", ",", "\"mailfy\"", "]", ":", "allPlatforms", "=", ...
Method that defines the whole list of available parameters. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. Return values: Returns a list [] of strings for the platform objects.
[ "Method", "that", "defines", "the", "whole", "list", "of", "available", "parameters", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platform_selection.py#L35-L62
i3visio/osrframework
osrframework/utils/platform_selection.py
getPlatformsByName
def getPlatformsByName(platformNames=['all'], mode=None, tags=[], excludePlatformNames=[]): """Method that recovers the names of the <Platforms> in a given list. :param platformNames: List of strings containing the possible platforms. :param mode: The mode of the search. The following can be ...
python
def getPlatformsByName(platformNames=['all'], mode=None, tags=[], excludePlatformNames=[]): """Method that recovers the names of the <Platforms> in a given list. :param platformNames: List of strings containing the possible platforms. :param mode: The mode of the search. The following can be ...
[ "def", "getPlatformsByName", "(", "platformNames", "=", "[", "'all'", "]", ",", "mode", "=", "None", ",", "tags", "=", "[", "]", ",", "excludePlatformNames", "=", "[", "]", ")", ":", "allPlatformsList", "=", "getAllPlatformObjects", "(", "mode", ")", "plat...
Method that recovers the names of the <Platforms> in a given list. :param platformNames: List of strings containing the possible platforms. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. :param tags: Just in case the method to select...
[ "Method", "that", "recovers", "the", "names", "of", "the", "<Platforms", ">", "in", "a", "given", "list", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platform_selection.py#L65-L113
i3visio/osrframework
osrframework/utils/platform_selection.py
getAllPlatformNamesByTag
def getAllPlatformNamesByTag (mode = None): """Returns the platforms in the framework grouped by tags. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. """ tags = {} allPlatformsList = getAllPlatformObjects(mode) # Iterating the list of...
python
def getAllPlatformNamesByTag (mode = None): """Returns the platforms in the framework grouped by tags. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. """ tags = {} allPlatformsList = getAllPlatformObjects(mode) # Iterating the list of...
[ "def", "getAllPlatformNamesByTag", "(", "mode", "=", "None", ")", ":", "tags", "=", "{", "}", "allPlatformsList", "=", "getAllPlatformObjects", "(", "mode", ")", "# Iterating the list of platforms to collect the tags", "for", "plat", "in", "allPlatformsList", ":", "# ...
Returns the platforms in the framework grouped by tags. :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"].
[ "Returns", "the", "platforms", "in", "the", "framework", "grouped", "by", "tags", ".", ":", "param", "mode", ":", "The", "mode", "of", "the", "search", ".", "The", "following", "can", "be", "chosen", ":", "[", "phonefy", "usufy", "searchfy", "]", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platform_selection.py#L115-L132
i3visio/osrframework
osrframework/utils/platform_selection.py
getAllPlatformObjects
def getAllPlatformObjects(mode = None): """Method that recovers ALL the list of <Platform> classes to be processed.... :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. :return: Returns a list [] of <Platform> objects. """ listAll = ...
python
def getAllPlatformObjects(mode = None): """Method that recovers ALL the list of <Platform> classes to be processed.... :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. :return: Returns a list [] of <Platform> objects. """ listAll = ...
[ "def", "getAllPlatformObjects", "(", "mode", "=", "None", ")", ":", "listAll", "=", "[", "]", "############################################################################", "############################################################################", "# -------------------------------...
Method that recovers ALL the list of <Platform> classes to be processed.... :param mode: The mode of the search. The following can be chosen: ["phonefy", "usufy", "searchfy"]. :return: Returns a list [] of <Platform> objects.
[ "Method", "that", "recovers", "ALL", "the", "list", "of", "<Platform", ">", "classes", "to", "be", "processed", "...." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/platform_selection.py#L135-L257
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/utils.py
Serializable.from_json
def from_json(cls, json_str): """Deserialize the object from a JSON string.""" d = json.loads(json_str) return cls.from_dict(d)
python
def from_json(cls, json_str): """Deserialize the object from a JSON string.""" d = json.loads(json_str) return cls.from_dict(d)
[ "def", "from_json", "(", "cls", ",", "json_str", ")", ":", "d", "=", "json", ".", "loads", "(", "json_str", ")", "return", "cls", ".", "from_dict", "(", "d", ")" ]
Deserialize the object from a JSON string.
[ "Deserialize", "the", "object", "from", "a", "JSON", "string", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/utils.py#L33-L36
i3visio/osrframework
osrframework/checkfy.py
createEmails
def createEmails(nicks=None, nicksFile=None): """ Method that globally permits to generate the emails to be checked. Args: ----- nicks: List of aliases. nicksFile: The filepath to the aliases file. Returns: -------- list: list of emails to be checked. """ candid...
python
def createEmails(nicks=None, nicksFile=None): """ Method that globally permits to generate the emails to be checked. Args: ----- nicks: List of aliases. nicksFile: The filepath to the aliases file. Returns: -------- list: list of emails to be checked. """ candid...
[ "def", "createEmails", "(", "nicks", "=", "None", ",", "nicksFile", "=", "None", ")", ":", "candidate_emails", "=", "set", "(", ")", "if", "nicks", "!=", "None", ":", "for", "n", "in", "nicks", ":", "for", "e", "in", "email_providers", ".", "domains", ...
Method that globally permits to generate the emails to be checked. Args: ----- nicks: List of aliases. nicksFile: The filepath to the aliases file. Returns: -------- list: list of emails to be checked.
[ "Method", "that", "globally", "permits", "to", "generate", "the", "emails", "to", "be", "checked", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/checkfy.py#L39-L63
i3visio/osrframework
osrframework/checkfy.py
verifyEmails
def verifyEmails(emails=[], regExpPattern="^.+$"): """ Method to perform the mail verification process. Arguments --------- emails: List of emails to verify. regExpPattern: Pattern that should match. Returns ------- list: A list containing the results that match. ""...
python
def verifyEmails(emails=[], regExpPattern="^.+$"): """ Method to perform the mail verification process. Arguments --------- emails: List of emails to verify. regExpPattern: Pattern that should match. Returns ------- list: A list containing the results that match. ""...
[ "def", "verifyEmails", "(", "emails", "=", "[", "]", ",", "regExpPattern", "=", "\"^.+$\"", ")", ":", "emailsMatched", "=", "set", "(", ")", "for", "i", ",", "e", "in", "enumerate", "(", "emails", ")", ":", "if", "re", ".", "match", "(", "regExpPatte...
Method to perform the mail verification process. Arguments --------- emails: List of emails to verify. regExpPattern: Pattern that should match. Returns ------- list: A list containing the results that match.
[ "Method", "to", "perform", "the", "mail", "verification", "process", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/checkfy.py#L66-L87
i3visio/osrframework
osrframework/checkfy.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/checkfy.py#L122-L219
i3visio/osrframework
osrframework/thirdparties/pipl_com/lib/thumbnail.py
generate_thumbnail_url
def generate_thumbnail_url(image_url, height, width, favicon_domain=None, zoom_face=True, api_key=None): """Take an image URL and generate a thumbnail URL for that image. Args: image_url -- unicode (or utf8 encoded str), URL of the image you want to th...
python
def generate_thumbnail_url(image_url, height, width, favicon_domain=None, zoom_face=True, api_key=None): """Take an image URL and generate a thumbnail URL for that image. Args: image_url -- unicode (or utf8 encoded str), URL of the image you want to th...
[ "def", "generate_thumbnail_url", "(", "image_url", ",", "height", ",", "width", ",", "favicon_domain", "=", "None", ",", "zoom_face", "=", "True", ",", "api_key", "=", "None", ")", ":", "if", "not", "(", "api_key", "or", "default_api_key", ")", ":", "raise...
Take an image URL and generate a thumbnail URL for that image. Args: image_url -- unicode (or utf8 encoded str), URL of the image you want to thumbnail. height -- int, requested thumbnail height in pixels, maximum 500. width -- int, requested thumbnail width in pixels, max...
[ "Take", "an", "image", "URL", "and", "generate", "a", "thumbnail", "URL", "for", "that", "image", ".", "Args", ":", "image_url", "--", "unicode", "(", "or", "utf8", "encoded", "str", ")", "URL", "of", "the", "image", "you", "want", "to", "thumbnail", "...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/pipl_com/lib/thumbnail.py#L37-L100
i3visio/osrframework
osrframework/thirdparties/resolvethem_com/processing.py
checkIPFromAlias
def checkIPFromAlias(alias=None): ''' Method that checks if the given alias is currently connected to Skype and returns its IP address. :param alias: Alias to be searched. :return: Python structure for the Json received. It has the following structure: { "type": "i3visio.ip", ...
python
def checkIPFromAlias(alias=None): ''' Method that checks if the given alias is currently connected to Skype and returns its IP address. :param alias: Alias to be searched. :return: Python structure for the Json received. It has the following structure: { "type": "i3visio.ip", ...
[ "def", "checkIPFromAlias", "(", "alias", "=", "None", ")", ":", "headers", "=", "{", "\"Content-type\"", ":", "\"text/html\"", ",", "\"Accept\"", ":", "\"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\"", ",", "\"Accept-Encoding\"", ":", "\" gzip, deflate\"...
Method that checks if the given alias is currently connected to Skype and returns its IP address. :param alias: Alias to be searched. :return: Python structure for the Json received. It has the following structure: { "type": "i3visio.ip", "value": "1.1.1.1", "at...
[ "Method", "that", "checks", "if", "the", "given", "alias", "is", "currently", "connected", "to", "Skype", "and", "returns", "its", "IP", "address", "." ]
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/thirdparties/resolvethem_com/processing.py#L26-L65
i3visio/osrframework
osrframework/utils/credentials.py
getCredentials
def getCredentials(): ''' Recovering the credentials from a file with the following structure: :return: A dictionary with the following struture: { "platform1": [C1<Credential>, C2<Credential>], "platform2": [C3<Credential>]} ''' logger = logging.getLogger("osrframework...
python
def getCredentials(): ''' Recovering the credentials from a file with the following structure: :return: A dictionary with the following struture: { "platform1": [C1<Credential>, C2<Credential>], "platform2": [C3<Credential>]} ''' logger = logging.getLogger("osrframework...
[ "def", "getCredentials", "(", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "\"osrframework.utils\"", ")", "# Dictionary of lists:", "# {'Twitter': {cred1, cred2, ...}}", "creds", "=", "{", "}", "try", ":", "credsTuples", "=", "c_creds", ".", "retur...
Recovering the credentials from a file with the following structure: :return: A dictionary with the following struture: { "platform1": [C1<Credential>, C2<Credential>], "platform2": [C3<Credential>]}
[ "Recovering", "the", "credentials", "from", "a", "file", "with", "the", "following", "structure", ":", ":", "return", ":", "A", "dictionary", "with", "the", "following", "struture", ":", "{", "platform1", ":", "[", "C1<Credential", ">", "C2<Credential", ">", ...
train
https://github.com/i3visio/osrframework/blob/83437f4c14c9c08cb80a896bd9834c77f6567871/osrframework/utils/credentials.py#L40-L69
i3visio/osrframework
osrframework/wrappers/instagram.py
Instagram.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", "re", "import", "requests", "s", "=", "requests", ".", "Session", "(", ")", "# Getting the first response to grab the csrf_token", "r1", "=", "s", ".", "get",...
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/instagram.py#L117-L152
jrief/djangocms-cascade
cmsplugin_cascade/sharable/forms.py
SelectSharedGlossary._enrich_link
def _enrich_link(self, glossary): """ Enrich the dict glossary['link'] with an identifier onto the model """ try: Model = apps.get_model(*glossary['link']['model'].split('.')) obj = Model.objects.get(pk=glossary['link']['pk']) glossary['link'].update(i...
python
def _enrich_link(self, glossary): """ Enrich the dict glossary['link'] with an identifier onto the model """ try: Model = apps.get_model(*glossary['link']['model'].split('.')) obj = Model.objects.get(pk=glossary['link']['pk']) glossary['link'].update(i...
[ "def", "_enrich_link", "(", "self", ",", "glossary", ")", ":", "try", ":", "Model", "=", "apps", ".", "get_model", "(", "*", "glossary", "[", "'link'", "]", "[", "'model'", "]", ".", "split", "(", "'.'", ")", ")", "obj", "=", "Model", ".", "objects...
Enrich the dict glossary['link'] with an identifier onto the model
[ "Enrich", "the", "dict", "glossary", "[", "link", "]", "with", "an", "identifier", "onto", "the", "model" ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/sharable/forms.py#L58-L67
jrief/djangocms-cascade
cmsplugin_cascade/sharable/forms.py
SharableGlossaryMixin.get_form
def get_form(self, request, obj=None, **kwargs): """ Extend the form for the given plugin with the form SharableCascadeForm """ Form = type(str('ExtSharableForm'), (SharableCascadeForm, kwargs.pop('form', self.form)), {}) Form.base_fields['shared_glossary'].limit_choices_to = dic...
python
def get_form(self, request, obj=None, **kwargs): """ Extend the form for the given plugin with the form SharableCascadeForm """ Form = type(str('ExtSharableForm'), (SharableCascadeForm, kwargs.pop('form', self.form)), {}) Form.base_fields['shared_glossary'].limit_choices_to = dic...
[ "def", "get_form", "(", "self", ",", "request", ",", "obj", "=", "None", ",", "*", "*", "kwargs", ")", ":", "Form", "=", "type", "(", "str", "(", "'ExtSharableForm'", ")", ",", "(", "SharableCascadeForm", ",", "kwargs", ".", "pop", "(", "'form'", ","...
Extend the form for the given plugin with the form SharableCascadeForm
[ "Extend", "the", "form", "for", "the", "given", "plugin", "with", "the", "form", "SharableCascadeForm" ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/sharable/forms.py#L122-L129
jrief/djangocms-cascade
cmsplugin_cascade/bootstrap4/picture.py
get_picture_elements
def get_picture_elements(instance): """ Create a context, used to render a <picture> together with all its ``<source>`` elements: It returns a list of HTML elements, each containing the information to render a ``<source>`` element. The purpose of this HTML entity is to display images with art direct...
python
def get_picture_elements(instance): """ Create a context, used to render a <picture> together with all its ``<source>`` elements: It returns a list of HTML elements, each containing the information to render a ``<source>`` element. The purpose of this HTML entity is to display images with art direct...
[ "def", "get_picture_elements", "(", "instance", ")", ":", "if", "hasattr", "(", "instance", ",", "'image'", ")", "and", "hasattr", "(", "instance", ".", "image", ",", "'exif'", ")", ":", "aspect_ratio", "=", "compute_aspect_ratio", "(", "instance", ".", "ima...
Create a context, used to render a <picture> together with all its ``<source>`` elements: It returns a list of HTML elements, each containing the information to render a ``<source>`` element. The purpose of this HTML entity is to display images with art directions. For normal images use the ``<img>`` el...
[ "Create", "a", "context", "used", "to", "render", "a", "<picture", ">", "together", "with", "all", "its", "<source", ">", "elements", ":", "It", "returns", "a", "list", "of", "HTML", "elements", "each", "containing", "the", "information", "to", "render", "...
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/bootstrap4/picture.py#L133-L197
jrief/djangocms-cascade
cmsplugin_cascade/bootstrap4/grid.py
Bootstrap4Column.get_min_max_bounds
def get_min_max_bounds(self): """ Return a dict of min- and max-values for the given column. This is required to estimate the bounds of images. """ bound = Bound(999999.0, 0.0) for bp in Breakpoint: bound.extend(self.get_bound(bp)) return {'min': bound...
python
def get_min_max_bounds(self): """ Return a dict of min- and max-values for the given column. This is required to estimate the bounds of images. """ bound = Bound(999999.0, 0.0) for bp in Breakpoint: bound.extend(self.get_bound(bp)) return {'min': bound...
[ "def", "get_min_max_bounds", "(", "self", ")", ":", "bound", "=", "Bound", "(", "999999.0", ",", "0.0", ")", "for", "bp", "in", "Breakpoint", ":", "bound", ".", "extend", "(", "self", ".", "get_bound", "(", "bp", ")", ")", "return", "{", "'min'", ":"...
Return a dict of min- and max-values for the given column. This is required to estimate the bounds of images.
[ "Return", "a", "dict", "of", "min", "-", "and", "max", "-", "values", "for", "the", "given", "column", ".", "This", "is", "required", "to", "estimate", "the", "bounds", "of", "images", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/bootstrap4/grid.py#L306-L314
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
create_proxy_model
def create_proxy_model(name, model_mixins, base_model, attrs=None, module=None): """ Create a Django Proxy Model on the fly, to be used by any Cascade Plugin. """ from django.apps import apps class Meta: proxy = True app_label = 'cmsplugin_cascade' name = str(name + 'Model') ...
python
def create_proxy_model(name, model_mixins, base_model, attrs=None, module=None): """ Create a Django Proxy Model on the fly, to be used by any Cascade Plugin. """ from django.apps import apps class Meta: proxy = True app_label = 'cmsplugin_cascade' name = str(name + 'Model') ...
[ "def", "create_proxy_model", "(", "name", ",", "model_mixins", ",", "base_model", ",", "attrs", "=", "None", ",", "module", "=", "None", ")", ":", "from", "django", ".", "apps", "import", "apps", "class", "Meta", ":", "proxy", "=", "True", "app_label", "...
Create a Django Proxy Model on the fly, to be used by any Cascade Plugin.
[ "Create", "a", "Django", "Proxy", "Model", "on", "the", "fly", "to", "be", "used", "by", "any", "Cascade", "Plugin", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L35-L53
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase._get_parent_classes_transparent
def _get_parent_classes_transparent(cls, slot, page, instance=None): """ Return all parent classes including those marked as "transparent". """ parent_classes = super(CascadePluginBase, cls).get_parent_classes(slot, page, instance) if parent_classes is None: if cls.ge...
python
def _get_parent_classes_transparent(cls, slot, page, instance=None): """ Return all parent classes including those marked as "transparent". """ parent_classes = super(CascadePluginBase, cls).get_parent_classes(slot, page, instance) if parent_classes is None: if cls.ge...
[ "def", "_get_parent_classes_transparent", "(", "cls", ",", "slot", ",", "page", ",", "instance", "=", "None", ")", ":", "parent_classes", "=", "super", "(", "CascadePluginBase", ",", "cls", ")", ".", "get_parent_classes", "(", "slot", ",", "page", ",", "inst...
Return all parent classes including those marked as "transparent".
[ "Return", "all", "parent", "classes", "including", "those", "marked", "as", "transparent", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L282-L295
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase.extend_children
def extend_children(self, parent, wanted_children, child_class, child_glossary=None): """ Extend the number of children so that the parent object contains wanted children. No child will be removed if wanted_children is smaller than the current number of children. """ from cms.api...
python
def extend_children(self, parent, wanted_children, child_class, child_glossary=None): """ Extend the number of children so that the parent object contains wanted children. No child will be removed if wanted_children is smaller than the current number of children. """ from cms.api...
[ "def", "extend_children", "(", "self", ",", "parent", ",", "wanted_children", ",", "child_class", ",", "child_glossary", "=", "None", ")", ":", "from", "cms", ".", "api", "import", "add_plugin", "current_children", "=", "parent", ".", "get_num_children", "(", ...
Extend the number of children so that the parent object contains wanted children. No child will be removed if wanted_children is smaller than the current number of children.
[ "Extend", "the", "number", "of", "children", "so", "that", "the", "parent", "object", "contains", "wanted", "children", ".", "No", "child", "will", "be", "removed", "if", "wanted_children", "is", "smaller", "than", "the", "current", "number", "of", "children",...
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L360-L371
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase.get_form
def get_form(self, request, obj=None, **kwargs): """ Build the form used for changing the model. """ widgets = kwargs.pop('widgets', {}) labels = kwargs.pop('labels', {}) glossary_fields = kwargs.pop('glossary_fields', self.glossary_fields) widgets.update(glossary...
python
def get_form(self, request, obj=None, **kwargs): """ Build the form used for changing the model. """ widgets = kwargs.pop('widgets', {}) labels = kwargs.pop('labels', {}) glossary_fields = kwargs.pop('glossary_fields', self.glossary_fields) widgets.update(glossary...
[ "def", "get_form", "(", "self", ",", "request", ",", "obj", "=", "None", ",", "*", "*", "kwargs", ")", ":", "widgets", "=", "kwargs", ".", "pop", "(", "'widgets'", ",", "{", "}", ")", "labels", "=", "kwargs", ".", "pop", "(", "'labels'", ",", "{"...
Build the form used for changing the model.
[ "Build", "the", "form", "used", "for", "changing", "the", "model", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L373-L392
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase.get_parent_instance
def get_parent_instance(self, request=None, obj=None): """ Get the parent model instance corresponding to this plugin. When adding a new plugin, the parent might not be available. Therefore as fallback, pass in the request object. """ try: parent_id = obj.parent_id ...
python
def get_parent_instance(self, request=None, obj=None): """ Get the parent model instance corresponding to this plugin. When adding a new plugin, the parent might not be available. Therefore as fallback, pass in the request object. """ try: parent_id = obj.parent_id ...
[ "def", "get_parent_instance", "(", "self", ",", "request", "=", "None", ",", "obj", "=", "None", ")", ":", "try", ":", "parent_id", "=", "obj", ".", "parent_id", "except", "AttributeError", ":", "try", ":", "# TODO: self.parent presumably is not used anymore in CM...
Get the parent model instance corresponding to this plugin. When adding a new plugin, the parent might not be available. Therefore as fallback, pass in the request object.
[ "Get", "the", "parent", "model", "instance", "corresponding", "to", "this", "plugin", ".", "When", "adding", "a", "new", "plugin", "the", "parent", "might", "not", "be", "available", ".", "Therefore", "as", "fallback", "pass", "in", "the", "request", "object...
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L403-L432
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase.get_previous_instance
def get_previous_instance(self, obj): """ Return the previous plugin instance for the given object. This differs from `obj.get_prev_sibling()` which returns an unsorted sibling. """ ordered_siblings = obj.get_siblings().filter(placeholder=obj.placeholder).order_by('position') ...
python
def get_previous_instance(self, obj): """ Return the previous plugin instance for the given object. This differs from `obj.get_prev_sibling()` which returns an unsorted sibling. """ ordered_siblings = obj.get_siblings().filter(placeholder=obj.placeholder).order_by('position') ...
[ "def", "get_previous_instance", "(", "self", ",", "obj", ")", ":", "ordered_siblings", "=", "obj", ".", "get_siblings", "(", ")", ".", "filter", "(", "placeholder", "=", "obj", ".", "placeholder", ")", ".", "order_by", "(", "'position'", ")", "pos", "=", ...
Return the previous plugin instance for the given object. This differs from `obj.get_prev_sibling()` which returns an unsorted sibling.
[ "Return", "the", "previous", "plugin", "instance", "for", "the", "given", "object", ".", "This", "differs", "from", "obj", ".", "get_prev_sibling", "()", "which", "returns", "an", "unsorted", "sibling", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L434-L443
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase.get_next_instance
def get_next_instance(self, obj): """ Return the next plugin instance for the given object. This differs from `obj.get_next_sibling()` which returns an unsorted sibling. """ ordered_siblings = obj.get_siblings().filter(placeholder=obj.placeholder).order_by('position') pos...
python
def get_next_instance(self, obj): """ Return the next plugin instance for the given object. This differs from `obj.get_next_sibling()` which returns an unsorted sibling. """ ordered_siblings = obj.get_siblings().filter(placeholder=obj.placeholder).order_by('position') pos...
[ "def", "get_next_instance", "(", "self", ",", "obj", ")", ":", "ordered_siblings", "=", "obj", ".", "get_siblings", "(", ")", ".", "filter", "(", "placeholder", "=", "obj", ".", "placeholder", ")", ".", "order_by", "(", "'position'", ")", "pos", "=", "li...
Return the next plugin instance for the given object. This differs from `obj.get_next_sibling()` which returns an unsorted sibling.
[ "Return", "the", "next", "plugin", "instance", "for", "the", "given", "object", ".", "This", "differs", "from", "obj", ".", "get_next_sibling", "()", "which", "returns", "an", "unsorted", "sibling", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L445-L454
jrief/djangocms-cascade
cmsplugin_cascade/plugin_base.py
CascadePluginBase.in_edit_mode
def in_edit_mode(self, request, placeholder): """ Returns True, if the plugin is in "edit mode". """ toolbar = getattr(request, 'toolbar', None) edit_mode = getattr(toolbar, 'edit_mode', False) and getattr(placeholder, 'is_editable', True) if edit_mode: edit_m...
python
def in_edit_mode(self, request, placeholder): """ Returns True, if the plugin is in "edit mode". """ toolbar = getattr(request, 'toolbar', None) edit_mode = getattr(toolbar, 'edit_mode', False) and getattr(placeholder, 'is_editable', True) if edit_mode: edit_m...
[ "def", "in_edit_mode", "(", "self", ",", "request", ",", "placeholder", ")", ":", "toolbar", "=", "getattr", "(", "request", ",", "'toolbar'", ",", "None", ")", "edit_mode", "=", "getattr", "(", "toolbar", ",", "'edit_mode'", ",", "False", ")", "and", "g...
Returns True, if the plugin is in "edit mode".
[ "Returns", "True", "if", "the", "plugin", "is", "in", "edit", "mode", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/plugin_base.py#L480-L488
jrief/djangocms-cascade
cmsplugin_cascade/bootstrap4/image.py
get_image_tags
def get_image_tags(instance): """ Create a context returning the tags to render an <img ...> element with ``sizes``, ``srcset``, a fallback ``src`` and if required inline styles. """ if hasattr(instance, 'image') and hasattr(instance.image, 'exif'): aspect_ratio = compute_aspect_ratio(instan...
python
def get_image_tags(instance): """ Create a context returning the tags to render an <img ...> element with ``sizes``, ``srcset``, a fallback ``src`` and if required inline styles. """ if hasattr(instance, 'image') and hasattr(instance.image, 'exif'): aspect_ratio = compute_aspect_ratio(instan...
[ "def", "get_image_tags", "(", "instance", ")", ":", "if", "hasattr", "(", "instance", ",", "'image'", ")", "and", "hasattr", "(", "instance", ".", "image", ",", "'exif'", ")", ":", "aspect_ratio", "=", "compute_aspect_ratio", "(", "instance", ".", "image", ...
Create a context returning the tags to render an <img ...> element with ``sizes``, ``srcset``, a fallback ``src`` and if required inline styles.
[ "Create", "a", "context", "returning", "the", "tags", "to", "render", "an", "<img", "...", ">", "element", "with", "sizes", "srcset", "a", "fallback", "src", "and", "if", "required", "inline", "styles", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/bootstrap4/image.py#L163-L228
jrief/djangocms-cascade
cmsplugin_cascade/segmentation/cms_plugins.py
SegmentPlugin._get_previous_open_tag
def _get_previous_open_tag(self, obj): """ Return the open tag of the previous sibling """ prev_instance = self.get_previous_instance(obj) if prev_instance and prev_instance.plugin_type == self.__class__.__name__: return prev_instance.glossary.get('open_tag')
python
def _get_previous_open_tag(self, obj): """ Return the open tag of the previous sibling """ prev_instance = self.get_previous_instance(obj) if prev_instance and prev_instance.plugin_type == self.__class__.__name__: return prev_instance.glossary.get('open_tag')
[ "def", "_get_previous_open_tag", "(", "self", ",", "obj", ")", ":", "prev_instance", "=", "self", ".", "get_previous_instance", "(", "obj", ")", "if", "prev_instance", "and", "prev_instance", ".", "plugin_type", "==", "self", ".", "__class__", ".", "__name__", ...
Return the open tag of the previous sibling
[ "Return", "the", "open", "tag", "of", "the", "previous", "sibling" ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/segmentation/cms_plugins.py#L170-L176
jrief/djangocms-cascade
cmsplugin_cascade/generic/mixins.py
SectionForm.check_unique_element_id
def check_unique_element_id(cls, instance, element_id): """ Check for uniqueness of the given element_id for the current page. Return None if instance is not yet associated with a page. """ try: element_ids = instance.placeholder.page.cascadepage.glossary.get('element...
python
def check_unique_element_id(cls, instance, element_id): """ Check for uniqueness of the given element_id for the current page. Return None if instance is not yet associated with a page. """ try: element_ids = instance.placeholder.page.cascadepage.glossary.get('element...
[ "def", "check_unique_element_id", "(", "cls", ",", "instance", ",", "element_id", ")", ":", "try", ":", "element_ids", "=", "instance", ".", "placeholder", ".", "page", ".", "cascadepage", ".", "glossary", ".", "get", "(", "'element_ids'", ",", "{", "}", "...
Check for uniqueness of the given element_id for the current page. Return None if instance is not yet associated with a page.
[ "Check", "for", "uniqueness", "of", "the", "given", "element_id", "for", "the", "current", "page", ".", "Return", "None", "if", "instance", "is", "not", "yet", "associated", "with", "a", "page", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/generic/mixins.py#L20-L34
jrief/djangocms-cascade
cmsplugin_cascade/utils.py
remove_duplicates
def remove_duplicates(lst): """ Emulate what a Python ``set()`` does, but keeping the element's order. """ dset = set() return [l for l in lst if l not in dset and not dset.add(l)]
python
def remove_duplicates(lst): """ Emulate what a Python ``set()`` does, but keeping the element's order. """ dset = set() return [l for l in lst if l not in dset and not dset.add(l)]
[ "def", "remove_duplicates", "(", "lst", ")", ":", "dset", "=", "set", "(", ")", "return", "[", "l", "for", "l", "in", "lst", "if", "l", "not", "in", "dset", "and", "not", "dset", ".", "add", "(", "l", ")", "]" ]
Emulate what a Python ``set()`` does, but keeping the element's order.
[ "Emulate", "what", "a", "Python", "set", "()", "does", "but", "keeping", "the", "element", "s", "order", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/utils.py#L8-L13
jrief/djangocms-cascade
cmsplugin_cascade/utils.py
rectify_partial_form_field
def rectify_partial_form_field(base_field, partial_form_fields): """ In base_field reset the attributes label and help_text, since they are overriden by the partial field. Additionally, from the list, or list of lists of partial_form_fields append the bound validator methods to the given base field. ...
python
def rectify_partial_form_field(base_field, partial_form_fields): """ In base_field reset the attributes label and help_text, since they are overriden by the partial field. Additionally, from the list, or list of lists of partial_form_fields append the bound validator methods to the given base field. ...
[ "def", "rectify_partial_form_field", "(", "base_field", ",", "partial_form_fields", ")", ":", "base_field", ".", "label", "=", "''", "base_field", ".", "help_text", "=", "''", "for", "fieldset", "in", "partial_form_fields", ":", "if", "not", "isinstance", "(", "...
In base_field reset the attributes label and help_text, since they are overriden by the partial field. Additionally, from the list, or list of lists of partial_form_fields append the bound validator methods to the given base field.
[ "In", "base_field", "reset", "the", "attributes", "label", "and", "help_text", "since", "they", "are", "overriden", "by", "the", "partial", "field", ".", "Additionally", "from", "the", "list", "or", "list", "of", "lists", "of", "partial_form_fields", "append", ...
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/utils.py#L16-L28
jrief/djangocms-cascade
cmsplugin_cascade/utils.py
validate_link
def validate_link(link_data): """ Check if the given model exists, otherwise raise a Validation error """ from django.apps import apps try: Model = apps.get_model(*link_data['model'].split('.')) Model.objects.get(pk=link_data['pk']) except Model.DoesNotExist: raise Valid...
python
def validate_link(link_data): """ Check if the given model exists, otherwise raise a Validation error """ from django.apps import apps try: Model = apps.get_model(*link_data['model'].split('.')) Model.objects.get(pk=link_data['pk']) except Model.DoesNotExist: raise Valid...
[ "def", "validate_link", "(", "link_data", ")", ":", "from", "django", ".", "apps", "import", "apps", "try", ":", "Model", "=", "apps", ".", "get_model", "(", "*", "link_data", "[", "'model'", "]", ".", "split", "(", "'.'", ")", ")", "Model", ".", "ob...
Check if the given model exists, otherwise raise a Validation error
[ "Check", "if", "the", "given", "model", "exists", "otherwise", "raise", "a", "Validation", "error" ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/utils.py#L30-L40
jrief/djangocms-cascade
cmsplugin_cascade/utils.py
parse_responsive_length
def parse_responsive_length(responsive_length): """ Takes a string containing a length definition in pixels or percent and parses it to obtain a computational length. It returns a tuple where the first element is the length in pixels and the second element is its length in percent divided by 100. No...
python
def parse_responsive_length(responsive_length): """ Takes a string containing a length definition in pixels or percent and parses it to obtain a computational length. It returns a tuple where the first element is the length in pixels and the second element is its length in percent divided by 100. No...
[ "def", "parse_responsive_length", "(", "responsive_length", ")", ":", "responsive_length", "=", "responsive_length", ".", "strip", "(", ")", "if", "responsive_length", ".", "endswith", "(", "'px'", ")", ":", "return", "(", "int", "(", "responsive_length", ".", "...
Takes a string containing a length definition in pixels or percent and parses it to obtain a computational length. It returns a tuple where the first element is the length in pixels and the second element is its length in percent divided by 100. Note that one of both returned elements is None.
[ "Takes", "a", "string", "containing", "a", "length", "definition", "in", "pixels", "or", "percent", "and", "parses", "it", "to", "obtain", "a", "computational", "length", ".", "It", "returns", "a", "tuple", "where", "the", "first", "element", "is", "the", ...
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/utils.py#L71-L83
jrief/djangocms-cascade
cmsplugin_cascade/mixins.py
CascadePluginMixin.get_css_classes
def get_css_classes(cls, instance): """ Returns a list of CSS classes to be added as class="..." to the current HTML tag. """ css_classes = [] if hasattr(cls, 'default_css_class'): css_classes.append(cls.default_css_class) for attr in getattr(cls, 'default_css...
python
def get_css_classes(cls, instance): """ Returns a list of CSS classes to be added as class="..." to the current HTML tag. """ css_classes = [] if hasattr(cls, 'default_css_class'): css_classes.append(cls.default_css_class) for attr in getattr(cls, 'default_css...
[ "def", "get_css_classes", "(", "cls", ",", "instance", ")", ":", "css_classes", "=", "[", "]", "if", "hasattr", "(", "cls", ",", "'default_css_class'", ")", ":", "css_classes", ".", "append", "(", "cls", ".", "default_css_class", ")", "for", "attr", "in", ...
Returns a list of CSS classes to be added as class="..." to the current HTML tag.
[ "Returns", "a", "list", "of", "CSS", "classes", "to", "be", "added", "as", "class", "=", "...", "to", "the", "current", "HTML", "tag", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/mixins.py#L27-L40
jrief/djangocms-cascade
cmsplugin_cascade/mixins.py
CascadePluginMixin.get_inline_styles
def get_inline_styles(cls, instance): """ Returns a dictionary of CSS attributes to be added as style="..." to the current HTML tag. """ inline_styles = getattr(cls, 'default_inline_styles', {}) css_style = instance.glossary.get('inline_styles') if css_style: ...
python
def get_inline_styles(cls, instance): """ Returns a dictionary of CSS attributes to be added as style="..." to the current HTML tag. """ inline_styles = getattr(cls, 'default_inline_styles', {}) css_style = instance.glossary.get('inline_styles') if css_style: ...
[ "def", "get_inline_styles", "(", "cls", ",", "instance", ")", ":", "inline_styles", "=", "getattr", "(", "cls", ",", "'default_inline_styles'", ",", "{", "}", ")", "css_style", "=", "instance", ".", "glossary", ".", "get", "(", "'inline_styles'", ")", "if", ...
Returns a dictionary of CSS attributes to be added as style="..." to the current HTML tag.
[ "Returns", "a", "dictionary", "of", "CSS", "attributes", "to", "be", "added", "as", "style", "=", "...", "to", "the", "current", "HTML", "tag", "." ]
train
https://github.com/jrief/djangocms-cascade/blob/58996f990c4068e5d50f0db6030a5c0e06b682e5/cmsplugin_cascade/mixins.py#L43-L51