repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
joke2k/faker | faker/providers/geo/__init__.py | Provider.location_on_land | def location_on_land(self, coords_only=False):
"""Returns a random tuple specifying a coordinate set guaranteed to exist on land.
Format is `(latitude, longitude, place name, two-letter country code, timezone)`
Pass `coords_only` to return coordinates without metadata.
"""
place ... | python | def location_on_land(self, coords_only=False):
"""Returns a random tuple specifying a coordinate set guaranteed to exist on land.
Format is `(latitude, longitude, place name, two-letter country code, timezone)`
Pass `coords_only` to return coordinates without metadata.
"""
place ... | [
"def",
"location_on_land",
"(",
"self",
",",
"coords_only",
"=",
"False",
")",
":",
"place",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"land_coords",
")",
"return",
"(",
"place",
"[",
"0",
"]",
",",
"place",
"[",
"1",
"]",
")",
"if",
"coo... | Returns a random tuple specifying a coordinate set guaranteed to exist on land.
Format is `(latitude, longitude, place name, two-letter country code, timezone)`
Pass `coords_only` to return coordinates without metadata. | [
"Returns",
"a",
"random",
"tuple",
"specifying",
"a",
"coordinate",
"set",
"guaranteed",
"to",
"exist",
"on",
"land",
".",
"Format",
"is",
"(",
"latitude",
"longitude",
"place",
"name",
"two",
"-",
"letter",
"country",
"code",
"timezone",
")",
"Pass",
"coord... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/geo/__init__.py#L1011-L1017 | train | Returns a random tuple specifying a coordinate set guaranteed to exist on land. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/pl_PL/__init__.py | checksum | def checksum(digits):
"""
Calculates and returns a control digit for given list of digits basing on PESEL standard.
"""
weights_for_check_digit = [9, 7, 3, 1, 9, 7, 3, 1, 9, 7]
check_digit = 0
for i in range(0, 10):
check_digit += weights_for_check_digit[i] * digits[i]
check_digit ... | python | def checksum(digits):
"""
Calculates and returns a control digit for given list of digits basing on PESEL standard.
"""
weights_for_check_digit = [9, 7, 3, 1, 9, 7, 3, 1, 9, 7]
check_digit = 0
for i in range(0, 10):
check_digit += weights_for_check_digit[i] * digits[i]
check_digit ... | [
"def",
"checksum",
"(",
"digits",
")",
":",
"weights_for_check_digit",
"=",
"[",
"9",
",",
"7",
",",
"3",
",",
"1",
",",
"9",
",",
"7",
",",
"3",
",",
"1",
",",
"9",
",",
"7",
"]",
"check_digit",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"0",... | Calculates and returns a control digit for given list of digits basing on PESEL standard. | [
"Calculates",
"and",
"returns",
"a",
"control",
"digit",
"for",
"given",
"list",
"of",
"digits",
"basing",
"on",
"PESEL",
"standard",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/pl_PL/__init__.py#L7-L19 | train | Calculates and returns a control digit for given list of digits based on PESEL standard. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/pl_PL/__init__.py | calculate_month | def calculate_month(birth_date):
"""
Calculates and returns a month number basing on PESEL standard.
"""
year = int(birth_date.strftime('%Y'))
month = int(birth_date.strftime('%m')) + ((int(year / 100) - 14) % 5) * 20
return month | python | def calculate_month(birth_date):
"""
Calculates and returns a month number basing on PESEL standard.
"""
year = int(birth_date.strftime('%Y'))
month = int(birth_date.strftime('%m')) + ((int(year / 100) - 14) % 5) * 20
return month | [
"def",
"calculate_month",
"(",
"birth_date",
")",
":",
"year",
"=",
"int",
"(",
"birth_date",
".",
"strftime",
"(",
"'%Y'",
")",
")",
"month",
"=",
"int",
"(",
"birth_date",
".",
"strftime",
"(",
"'%m'",
")",
")",
"+",
"(",
"(",
"int",
"(",
"year",
... | Calculates and returns a month number basing on PESEL standard. | [
"Calculates",
"and",
"returns",
"a",
"month",
"number",
"basing",
"on",
"PESEL",
"standard",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/pl_PL/__init__.py#L22-L29 | train | Calculates and returns a month number based on PESEL standard. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/pl_PL/__init__.py | Provider.ssn | def ssn(self):
"""
Returns 11 character Polish national identity code (Public Electronic Census System,
Polish: Powszechny Elektroniczny System Ewidencji Ludności - PESEL).
It has the form YYMMDDZZZXQ, where YYMMDD is the date of birth (with century
encoded in month field), ZZZ ... | python | def ssn(self):
"""
Returns 11 character Polish national identity code (Public Electronic Census System,
Polish: Powszechny Elektroniczny System Ewidencji Ludności - PESEL).
It has the form YYMMDDZZZXQ, where YYMMDD is the date of birth (with century
encoded in month field), ZZZ ... | [
"def",
"ssn",
"(",
"self",
")",
":",
"birth_date",
"=",
"self",
".",
"generator",
".",
"date_time",
"(",
")",
"year_without_century",
"=",
"int",
"(",
"birth_date",
".",
"strftime",
"(",
"'%y'",
")",
")",
"month",
"=",
"calculate_month",
"(",
"birth_date",... | Returns 11 character Polish national identity code (Public Electronic Census System,
Polish: Powszechny Elektroniczny System Ewidencji Ludności - PESEL).
It has the form YYMMDDZZZXQ, where YYMMDD is the date of birth (with century
encoded in month field), ZZZ is the personal identification numb... | [
"Returns",
"11",
"character",
"Polish",
"national",
"identity",
"code",
"(",
"Public",
"Electronic",
"Census",
"System",
"Polish",
":",
"Powszechny",
"Elektroniczny",
"System",
"Ewidencji",
"Ludności",
"-",
"PESEL",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/pl_PL/__init__.py#L34-L64 | train | Returns 11 character Polish national identity code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/fr_CH/__init__.py | Provider.ssn | def ssn(self):
"""
Returns a 13 digits Swiss SSN named AHV (German) or
AVS (French and Italian)
See: http://www.bsv.admin.ch/themen/ahv/00011/02185/
"""
def _checksum(digits):
evensum = sum(digits[:-1:2])
oddsum ... | python | def ssn(self):
"""
Returns a 13 digits Swiss SSN named AHV (German) or
AVS (French and Italian)
See: http://www.bsv.admin.ch/themen/ahv/00011/02185/
"""
def _checksum(digits):
evensum = sum(digits[:-1:2])
oddsum ... | [
"def",
"ssn",
"(",
"self",
")",
":",
"def",
"_checksum",
"(",
"digits",
")",
":",
"evensum",
"=",
"sum",
"(",
"digits",
"[",
":",
"-",
"1",
":",
"2",
"]",
")",
"oddsum",
"=",
"sum",
"(",
"digits",
"[",
"1",
":",
":",
"2",
"]",
")",
"return",
... | Returns a 13 digits Swiss SSN named AHV (German) or
AVS (French and Italian)
See: http://www.bsv.admin.ch/themen/ahv/00011/02185/ | [
"Returns",
"a",
"13",
"digits",
"Swiss",
"SSN",
"named",
"AHV",
"(",
"German",
")",
"or",
"AVS",
"(",
"French",
"and",
"Italian",
")",
"See",
":",
"http",
":",
"//",
"www",
".",
"bsv",
".",
"admin",
".",
"ch",
"/",
"themen",
"/",
"ahv",
"/",
"000... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/fr_CH/__init__.py#L10-L33 | train | Returns a 13 digits Swiss SSN named AHV or AVS and French and Italian | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/fr_CH/__init__.py | Provider.vat_id | def vat_id(self):
"""
:return: Swiss UID number
"""
def _checksum(digits):
code = ['8', '6', '4', '2', '3', '5', '9', '7']
remainder = 11-(sum(map(lambda x, y: int(x) * int(y), code, digits)) % 11)
if remainder == 10:
return 0
... | python | def vat_id(self):
"""
:return: Swiss UID number
"""
def _checksum(digits):
code = ['8', '6', '4', '2', '3', '5', '9', '7']
remainder = 11-(sum(map(lambda x, y: int(x) * int(y), code, digits)) % 11)
if remainder == 10:
return 0
... | [
"def",
"vat_id",
"(",
"self",
")",
":",
"def",
"_checksum",
"(",
"digits",
")",
":",
"code",
"=",
"[",
"'8'",
",",
"'6'",
",",
"'4'",
",",
"'2'",
",",
"'3'",
",",
"'5'",
",",
"'9'",
",",
"'7'",
"]",
"remainder",
"=",
"11",
"-",
"(",
"sum",
"(... | :return: Swiss UID number | [
":",
"return",
":",
"Swiss",
"UID",
"number"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/fr_CH/__init__.py#L35-L49 | train | Returns Swiss UID number of the VAT in the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_int | def random_int(self, min=0, max=9999, step=1):
"""
Returns a random integer between two values.
:param min: lower bound value (inclusive; default=0)
:param max: upper bound value (inclusive; default=9999)
:param step: range step (default=1)
:returns: random integer betwe... | python | def random_int(self, min=0, max=9999, step=1):
"""
Returns a random integer between two values.
:param min: lower bound value (inclusive; default=0)
:param max: upper bound value (inclusive; default=9999)
:param step: range step (default=1)
:returns: random integer betwe... | [
"def",
"random_int",
"(",
"self",
",",
"min",
"=",
"0",
",",
"max",
"=",
"9999",
",",
"step",
"=",
"1",
")",
":",
"return",
"self",
".",
"generator",
".",
"random",
".",
"randrange",
"(",
"min",
",",
"max",
"+",
"1",
",",
"step",
")"
] | Returns a random integer between two values.
:param min: lower bound value (inclusive; default=0)
:param max: upper bound value (inclusive; default=9999)
:param step: range step (default=1)
:returns: random integer between min and max | [
"Returns",
"a",
"random",
"integer",
"between",
"two",
"values",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L96-L105 | train | Returns a random integer between two values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_digit_or_empty | def random_digit_or_empty(self):
"""
Returns a random digit/number
between 0 and 9 or an empty string.
"""
if self.generator.random.randint(0, 1):
return self.generator.random.randint(0, 9)
else:
return '' | python | def random_digit_or_empty(self):
"""
Returns a random digit/number
between 0 and 9 or an empty string.
"""
if self.generator.random.randint(0, 1):
return self.generator.random.randint(0, 9)
else:
return '' | [
"def",
"random_digit_or_empty",
"(",
"self",
")",
":",
"if",
"self",
".",
"generator",
".",
"random",
".",
"randint",
"(",
"0",
",",
"1",
")",
":",
"return",
"self",
".",
"generator",
".",
"random",
".",
"randint",
"(",
"0",
",",
"9",
")",
"else",
... | Returns a random digit/number
between 0 and 9 or an empty string. | [
"Returns",
"a",
"random",
"digit",
"/",
"number",
"between",
"0",
"and",
"9",
"or",
"an",
"empty",
"string",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L121-L129 | train | Returns a random digit or an empty string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_digit_not_null_or_empty | def random_digit_not_null_or_empty(self):
"""
Returns a random non-zero digit/number
between 1 and 9 or and empty string.
"""
if self.generator.random.randint(0, 1):
return self.generator.random.randint(1, 9)
else:
return '' | python | def random_digit_not_null_or_empty(self):
"""
Returns a random non-zero digit/number
between 1 and 9 or and empty string.
"""
if self.generator.random.randint(0, 1):
return self.generator.random.randint(1, 9)
else:
return '' | [
"def",
"random_digit_not_null_or_empty",
"(",
"self",
")",
":",
"if",
"self",
".",
"generator",
".",
"random",
".",
"randint",
"(",
"0",
",",
"1",
")",
":",
"return",
"self",
".",
"generator",
".",
"random",
".",
"randint",
"(",
"1",
",",
"9",
")",
"... | Returns a random non-zero digit/number
between 1 and 9 or and empty string. | [
"Returns",
"a",
"random",
"non",
"-",
"zero",
"digit",
"/",
"number",
"between",
"1",
"and",
"9",
"or",
"and",
"empty",
"string",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L131-L139 | train | Returns a random non - zero digit or an empty string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_number | def random_number(self, digits=None, fix_len=False):
"""
Returns a random number with 1 digit (default, when digits==None),
a random number with 0 to given number of digits, or a random number
with given number to given number of digits (when ``fix_len==True``).
:param digits: m... | python | def random_number(self, digits=None, fix_len=False):
"""
Returns a random number with 1 digit (default, when digits==None),
a random number with 0 to given number of digits, or a random number
with given number to given number of digits (when ``fix_len==True``).
:param digits: m... | [
"def",
"random_number",
"(",
"self",
",",
"digits",
"=",
"None",
",",
"fix_len",
"=",
"False",
")",
":",
"if",
"digits",
"is",
"None",
":",
"digits",
"=",
"self",
".",
"random_digit",
"(",
")",
"if",
"fix_len",
":",
"return",
"self",
".",
"generator",
... | Returns a random number with 1 digit (default, when digits==None),
a random number with 0 to given number of digits, or a random number
with given number to given number of digits (when ``fix_len==True``).
:param digits: maximum number of digits
:param fix_len: should the number have f... | [
"Returns",
"a",
"random",
"number",
"with",
"1",
"digit",
"(",
"default",
"when",
"digits",
"==",
"None",
")",
"a",
"random",
"number",
"with",
"0",
"to",
"given",
"number",
"of",
"digits",
"or",
"a",
"random",
"number",
"with",
"given",
"number",
"to",
... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L141-L158 | train | Returns a random number with 1 digit or fixed length number | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_letter | def random_letter(self):
"""Returns a random letter (between a-z and A-Z)."""
return self.generator.random.choice(
getattr(string, 'letters', string.ascii_letters)) | python | def random_letter(self):
"""Returns a random letter (between a-z and A-Z)."""
return self.generator.random.choice(
getattr(string, 'letters', string.ascii_letters)) | [
"def",
"random_letter",
"(",
"self",
")",
":",
"return",
"self",
".",
"generator",
".",
"random",
".",
"choice",
"(",
"getattr",
"(",
"string",
",",
"'letters'",
",",
"string",
".",
"ascii_letters",
")",
")"
] | Returns a random letter (between a-z and A-Z). | [
"Returns",
"a",
"random",
"letter",
"(",
"between",
"a",
"-",
"z",
"and",
"A",
"-",
"Z",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L160-L163 | train | Returns a random letter between a - z and A - Z. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_letters | def random_letters(self, length=16):
"""Returns a random letter (between a-z and A-Z)."""
return self.random_choices(
getattr(string, 'letters', string.ascii_letters),
length=length,
) | python | def random_letters(self, length=16):
"""Returns a random letter (between a-z and A-Z)."""
return self.random_choices(
getattr(string, 'letters', string.ascii_letters),
length=length,
) | [
"def",
"random_letters",
"(",
"self",
",",
"length",
"=",
"16",
")",
":",
"return",
"self",
".",
"random_choices",
"(",
"getattr",
"(",
"string",
",",
"'letters'",
",",
"string",
".",
"ascii_letters",
")",
",",
"length",
"=",
"length",
",",
")"
] | Returns a random letter (between a-z and A-Z). | [
"Returns",
"a",
"random",
"letter",
"(",
"between",
"a",
"-",
"z",
"and",
"A",
"-",
"Z",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L165-L170 | train | Returns a random letter between a - z and A - Z. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_choices | def random_choices(self, elements=('a', 'b', 'c'), length=None):
"""
Returns a list of random, non-unique elements from a passed object.
If `elements` is a dictionary, the value will be used as
a weighting element. For example::
random_element({"{{variable_1}}": 0.5, "{{var... | python | def random_choices(self, elements=('a', 'b', 'c'), length=None):
"""
Returns a list of random, non-unique elements from a passed object.
If `elements` is a dictionary, the value will be used as
a weighting element. For example::
random_element({"{{variable_1}}": 0.5, "{{var... | [
"def",
"random_choices",
"(",
"self",
",",
"elements",
"=",
"(",
"'a'",
",",
"'b'",
",",
"'c'",
")",
",",
"length",
"=",
"None",
")",
":",
"return",
"self",
".",
"random_elements",
"(",
"elements",
",",
"length",
",",
"unique",
"=",
"False",
")"
] | Returns a list of random, non-unique elements from a passed object.
If `elements` is a dictionary, the value will be used as
a weighting element. For example::
random_element({"{{variable_1}}": 0.5, "{{variable_2}}": 0.2, "{{variable_3}}": 0.2, "{{variable_4}}": 0.1})
will have th... | [
"Returns",
"a",
"list",
"of",
"random",
"non",
"-",
"unique",
"elements",
"from",
"a",
"passed",
"object",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L207-L223 | train | Returns a list of random non - unique elements from a passed object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.random_sample | def random_sample(self, elements=('a', 'b', 'c'), length=None):
"""
Returns a list of random unique elements for the specified length.
Multiple occurrences of the same value increase its probability to be in the output.
"""
return self.random_elements(elements, length, unique=Tru... | python | def random_sample(self, elements=('a', 'b', 'c'), length=None):
"""
Returns a list of random unique elements for the specified length.
Multiple occurrences of the same value increase its probability to be in the output.
"""
return self.random_elements(elements, length, unique=Tru... | [
"def",
"random_sample",
"(",
"self",
",",
"elements",
"=",
"(",
"'a'",
",",
"'b'",
",",
"'c'",
")",
",",
"length",
"=",
"None",
")",
":",
"return",
"self",
".",
"random_elements",
"(",
"elements",
",",
"length",
",",
"unique",
"=",
"True",
")"
] | Returns a list of random unique elements for the specified length.
Multiple occurrences of the same value increase its probability to be in the output. | [
"Returns",
"a",
"list",
"of",
"random",
"unique",
"elements",
"for",
"the",
"specified",
"length",
".",
"Multiple",
"occurrences",
"of",
"the",
"same",
"value",
"increase",
"its",
"probability",
"to",
"be",
"in",
"the",
"output",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L243-L248 | train | Returns a list of random unique elements for the specified length. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.randomize_nb_elements | def randomize_nb_elements(
self,
number=10,
le=False,
ge=False,
min=None,
max=None):
"""
Returns a random value near number.
:param number: value to which the result must be near
:param le: result must be lower or e... | python | def randomize_nb_elements(
self,
number=10,
le=False,
ge=False,
min=None,
max=None):
"""
Returns a random value near number.
:param number: value to which the result must be near
:param le: result must be lower or e... | [
"def",
"randomize_nb_elements",
"(",
"self",
",",
"number",
"=",
"10",
",",
"le",
"=",
"False",
",",
"ge",
"=",
"False",
",",
"min",
"=",
"None",
",",
"max",
"=",
"None",
")",
":",
"if",
"le",
"and",
"ge",
":",
"return",
"number",
"_min",
"=",
"1... | Returns a random value near number.
:param number: value to which the result must be near
:param le: result must be lower or equal to number
:param ge: result must be greater or equal to number
:returns: a random int near number | [
"Returns",
"a",
"random",
"value",
"near",
"number",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L250-L274 | train | Returns a random value near number. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.numerify | def numerify(self, text='###'):
"""
Replaces all placeholders in given text with randomized values,
replacing: all hash sign ('#') occurrences with a random digit
(from 0 to 9); all percentage sign ('%') occurrences with a
random non-zero digit (from 1 to 9); all exclamation mark... | python | def numerify(self, text='###'):
"""
Replaces all placeholders in given text with randomized values,
replacing: all hash sign ('#') occurrences with a random digit
(from 0 to 9); all percentage sign ('%') occurrences with a
random non-zero digit (from 1 to 9); all exclamation mark... | [
"def",
"numerify",
"(",
"self",
",",
"text",
"=",
"'###'",
")",
":",
"text",
"=",
"_re_hash",
".",
"sub",
"(",
"lambda",
"x",
":",
"str",
"(",
"self",
".",
"random_digit",
"(",
")",
")",
",",
"text",
")",
"text",
"=",
"_re_perc",
".",
"sub",
"(",... | Replaces all placeholders in given text with randomized values,
replacing: all hash sign ('#') occurrences with a random digit
(from 0 to 9); all percentage sign ('%') occurrences with a
random non-zero digit (from 1 to 9); all exclamation mark ('!')
occurrences with a random digit (from... | [
"Replaces",
"all",
"placeholders",
"in",
"given",
"text",
"with",
"randomized",
"values",
"replacing",
":",
"all",
"hash",
"sign",
"(",
"#",
")",
"occurrences",
"with",
"a",
"random",
"digit",
"(",
"from",
"0",
"to",
"9",
")",
";",
"all",
"percentage",
"... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L276-L301 | train | Replaces all placeholders in given text with randomized values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.lexify | def lexify(self, text='????', letters=string.ascii_letters):
"""
Replaces all question mark ('?') occurrences with a random letter.
:param text: string to be parsed
:param letters: a set of letters to choose from.
:returns: string with all letter placeholders filled in
"... | python | def lexify(self, text='????', letters=string.ascii_letters):
"""
Replaces all question mark ('?') occurrences with a random letter.
:param text: string to be parsed
:param letters: a set of letters to choose from.
:returns: string with all letter placeholders filled in
"... | [
"def",
"lexify",
"(",
"self",
",",
"text",
"=",
"'????'",
",",
"letters",
"=",
"string",
".",
"ascii_letters",
")",
":",
"return",
"_re_qm",
".",
"sub",
"(",
"lambda",
"x",
":",
"self",
".",
"random_element",
"(",
"letters",
")",
",",
"text",
")"
] | Replaces all question mark ('?') occurrences with a random letter.
:param text: string to be parsed
:param letters: a set of letters to choose from.
:returns: string with all letter placeholders filled in | [
"Replaces",
"all",
"question",
"mark",
"(",
"?",
")",
"occurrences",
"with",
"a",
"random",
"letter",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L303-L311 | train | Replaces all question mark occurrences with a random letter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.bothify | def bothify(self, text='## ??', letters=string.ascii_letters):
"""
Replaces all placeholders with random numbers and letters.
:param text: string to be parsed
:returns: string with all numerical and letter placeholders filled in
"""
return self.lexify(self.numerify(text)... | python | def bothify(self, text='## ??', letters=string.ascii_letters):
"""
Replaces all placeholders with random numbers and letters.
:param text: string to be parsed
:returns: string with all numerical and letter placeholders filled in
"""
return self.lexify(self.numerify(text)... | [
"def",
"bothify",
"(",
"self",
",",
"text",
"=",
"'## ??'",
",",
"letters",
"=",
"string",
".",
"ascii_letters",
")",
":",
"return",
"self",
".",
"lexify",
"(",
"self",
".",
"numerify",
"(",
"text",
")",
",",
"letters",
"=",
"letters",
")"
] | Replaces all placeholders with random numbers and letters.
:param text: string to be parsed
:returns: string with all numerical and letter placeholders filled in | [
"Replaces",
"all",
"placeholders",
"with",
"random",
"numbers",
"and",
"letters",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L313-L320 | train | Replaces all placeholders with random numbers and letters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/__init__.py | BaseProvider.hexify | def hexify(self, text='^^^^', upper=False):
"""
Replaces all circumflex ('^') occurrences with a random
hexadecimal character.
:param text: string to be parsed
:param upper: Format as uppercase hexadecimal
:returns: string with all letter placeholders filled in
"... | python | def hexify(self, text='^^^^', upper=False):
"""
Replaces all circumflex ('^') occurrences with a random
hexadecimal character.
:param text: string to be parsed
:param upper: Format as uppercase hexadecimal
:returns: string with all letter placeholders filled in
"... | [
"def",
"hexify",
"(",
"self",
",",
"text",
"=",
"'^^^^'",
",",
"upper",
"=",
"False",
")",
":",
"letters",
"=",
"string",
".",
"hexdigits",
"[",
":",
"-",
"6",
"]",
"if",
"upper",
":",
"letters",
"=",
"letters",
".",
"upper",
"(",
")",
"return",
... | Replaces all circumflex ('^') occurrences with a random
hexadecimal character.
:param text: string to be parsed
:param upper: Format as uppercase hexadecimal
:returns: string with all letter placeholders filled in | [
"Replaces",
"all",
"circumflex",
"(",
"^",
")",
"occurrences",
"with",
"a",
"random",
"hexadecimal",
"character",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/__init__.py#L322-L334 | train | Replaces all circumflex ('^') occurrences with a random hexadecimal character. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/no_NO/__init__.py | checksum | def checksum(digits, scale):
"""
Calculate checksum of Norwegian personal identity code.
Checksum is calculated with "Module 11" method using a scale.
The digits of the personal code are multiplied by the corresponding
number in the scale and summed;
if remainder of module 11 of the sum is less... | python | def checksum(digits, scale):
"""
Calculate checksum of Norwegian personal identity code.
Checksum is calculated with "Module 11" method using a scale.
The digits of the personal code are multiplied by the corresponding
number in the scale and summed;
if remainder of module 11 of the sum is less... | [
"def",
"checksum",
"(",
"digits",
",",
"scale",
")",
":",
"chk_nbr",
"=",
"11",
"-",
"(",
"sum",
"(",
"map",
"(",
"operator",
".",
"mul",
",",
"digits",
",",
"scale",
")",
")",
"%",
"11",
")",
"if",
"chk_nbr",
"==",
"11",
":",
"return",
"0",
"r... | Calculate checksum of Norwegian personal identity code.
Checksum is calculated with "Module 11" method using a scale.
The digits of the personal code are multiplied by the corresponding
number in the scale and summed;
if remainder of module 11 of the sum is less than 10, checksum is the
remainder.
... | [
"Calculate",
"checksum",
"of",
"Norwegian",
"personal",
"identity",
"code",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/no_NO/__init__.py#L9-L25 | train | Calculate the checksum of Norwegian personal identity code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/no_NO/__init__.py | Provider.ssn | def ssn(self, dob=None, gender=None):
"""
Returns 11 character Norwegian personal identity code (Fødselsnummer).
A Norwegian personal identity code consists of 11 digits, without any
whitespace or other delimiters. The form is DDMMYYIIICC, where III is
a serial number separating... | python | def ssn(self, dob=None, gender=None):
"""
Returns 11 character Norwegian personal identity code (Fødselsnummer).
A Norwegian personal identity code consists of 11 digits, without any
whitespace or other delimiters. The form is DDMMYYIIICC, where III is
a serial number separating... | [
"def",
"ssn",
"(",
"self",
",",
"dob",
"=",
"None",
",",
"gender",
"=",
"None",
")",
":",
"if",
"dob",
":",
"birthday",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"dob",
",",
"'%Y%m%d'",
")",
"else",
":",
"age",
"=",
"datetime",
".",
... | Returns 11 character Norwegian personal identity code (Fødselsnummer).
A Norwegian personal identity code consists of 11 digits, without any
whitespace or other delimiters. The form is DDMMYYIIICC, where III is
a serial number separating persons born oh the same date with different
inte... | [
"Returns",
"11",
"character",
"Norwegian",
"personal",
"identity",
"code",
"(",
"Fødselsnummer",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/no_NO/__init__.py#L32-L83 | train | Returns a 11 character Norwegian personal identity code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/es_ES/__init__.py | Provider.nie | def nie(self):
"""
https://es.wikipedia.org/wiki/N%C3%BAmero_de_identidad_de_extranjero
:return: a random Spanish NIE
"""
first_chr = random.randrange(0, 3)
doi_body = str(random.randrange(0, 10000000)).zfill(7)
control = self._calculate_control_doi(str(first_chr... | python | def nie(self):
"""
https://es.wikipedia.org/wiki/N%C3%BAmero_de_identidad_de_extranjero
:return: a random Spanish NIE
"""
first_chr = random.randrange(0, 3)
doi_body = str(random.randrange(0, 10000000)).zfill(7)
control = self._calculate_control_doi(str(first_chr... | [
"def",
"nie",
"(",
"self",
")",
":",
"first_chr",
"=",
"random",
".",
"randrange",
"(",
"0",
",",
"3",
")",
"doi_body",
"=",
"str",
"(",
"random",
".",
"randrange",
"(",
"0",
",",
"10000000",
")",
")",
".",
"zfill",
"(",
"7",
")",
"control",
"=",... | https://es.wikipedia.org/wiki/N%C3%BAmero_de_identidad_de_extranjero
:return: a random Spanish NIE | [
"https",
":",
"//",
"es",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"N%C3%BAmero_de_identidad_de_extranjero",
":",
"return",
":",
"a",
"random",
"Spanish",
"NIE"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/es_ES/__init__.py#L26-L35 | train | a random Spanish NIE | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/es_ES/__init__.py | Provider.nif | def nif(self):
"""
https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal
:return: NIF
"""
nie_body = str(random.randrange(0, 100000000)) # generate a number of a maximum of 8 characters long
return nie_body.zfill(8) + self._calculate_control_doi(nie_bo... | python | def nif(self):
"""
https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal
:return: NIF
"""
nie_body = str(random.randrange(0, 100000000)) # generate a number of a maximum of 8 characters long
return nie_body.zfill(8) + self._calculate_control_doi(nie_bo... | [
"def",
"nif",
"(",
"self",
")",
":",
"nie_body",
"=",
"str",
"(",
"random",
".",
"randrange",
"(",
"0",
",",
"100000000",
")",
")",
"# generate a number of a maximum of 8 characters long",
"return",
"nie_body",
".",
"zfill",
"(",
"8",
")",
"+",
"self",
".",
... | https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal
:return: NIF | [
"https",
":",
"//",
"es",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"N%C3%BAmero_de_identificaci%C3%B3n_fiscal",
":",
"return",
":",
"NIF"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/es_ES/__init__.py#L37-L44 | train | Generate a random NIF control DOI. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/es_ES/__init__.py | Provider.cif | def cif(self):
"""
https://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
:return: a random Spanish CIF
"""
first_chr = random.choice('ABCDEFGHJNPQRSUVW')
doi_body = str(random.randrange(0, 10000000)).zfill(7)
cif = first_chr + doi_body
r... | python | def cif(self):
"""
https://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
:return: a random Spanish CIF
"""
first_chr = random.choice('ABCDEFGHJNPQRSUVW')
doi_body = str(random.randrange(0, 10000000)).zfill(7)
cif = first_chr + doi_body
r... | [
"def",
"cif",
"(",
"self",
")",
":",
"first_chr",
"=",
"random",
".",
"choice",
"(",
"'ABCDEFGHJNPQRSUVW'",
")",
"doi_body",
"=",
"str",
"(",
"random",
".",
"randrange",
"(",
"0",
",",
"10000000",
")",
")",
".",
"zfill",
"(",
"7",
")",
"cif",
"=",
... | https://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
:return: a random Spanish CIF | [
"https",
":",
"//",
"es",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"C%C3%B3digo_de_identificaci%C3%B3n_fiscal",
":",
"return",
":",
"a",
"random",
"Spanish",
"CIF"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/es_ES/__init__.py#L46-L55 | train | Generate a random Spanish CIF. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/es_ES/__init__.py | Provider.doi | def doi(self):
"""
https://es.wikipedia.org/wiki/Identificador_de_objeto_digital
:return: a random Spanish CIF or NIE or NIF
"""
return random.choice([self.cif, self.nie, self.nif])() | python | def doi(self):
"""
https://es.wikipedia.org/wiki/Identificador_de_objeto_digital
:return: a random Spanish CIF or NIE or NIF
"""
return random.choice([self.cif, self.nie, self.nif])() | [
"def",
"doi",
"(",
"self",
")",
":",
"return",
"random",
".",
"choice",
"(",
"[",
"self",
".",
"cif",
",",
"self",
".",
"nie",
",",
"self",
".",
"nif",
"]",
")",
"(",
")"
] | https://es.wikipedia.org/wiki/Identificador_de_objeto_digital
:return: a random Spanish CIF or NIE or NIF | [
"https",
":",
"//",
"es",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Identificador_de_objeto_digital",
":",
"return",
":",
"a",
"random",
"Spanish",
"CIF",
"or",
"NIE",
"or",
"NIF"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/es_ES/__init__.py#L57-L63 | train | Returns a random Spanish CIF or NIE or NIFVersion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/es_ES/__init__.py | Provider._calculate_control_cif | def _calculate_control_cif(cls, cif):
"""
Calculate the letter that corresponds to the end of a CIF
:param cif: calculated value so far needing a control character
:return: CIF control character
Code was converted from the minified js of: https://generadordni.es/
"""
... | python | def _calculate_control_cif(cls, cif):
"""
Calculate the letter that corresponds to the end of a CIF
:param cif: calculated value so far needing a control character
:return: CIF control character
Code was converted from the minified js of: https://generadordni.es/
"""
... | [
"def",
"_calculate_control_cif",
"(",
"cls",
",",
"cif",
")",
":",
"sum_",
"=",
"0",
"first_chr",
",",
"cif_value",
"=",
"cif",
"[",
"0",
"]",
",",
"cif",
"[",
"1",
":",
"]",
"for",
"index",
",",
"char",
"in",
"enumerate",
"(",
"cif_value",
")",
":... | Calculate the letter that corresponds to the end of a CIF
:param cif: calculated value so far needing a control character
:return: CIF control character
Code was converted from the minified js of: https://generadordni.es/ | [
"Calculate",
"the",
"letter",
"that",
"corresponds",
"to",
"the",
"end",
"of",
"a",
"CIF",
":",
"param",
"cif",
":",
"calculated",
"value",
"so",
"far",
"needing",
"a",
"control",
"character",
":",
"return",
":",
"CIF",
"control",
"character"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/es_ES/__init__.py#L77-L107 | train | Calculates the letter that corresponds to the end of a CIF and returns the control character that corresponds to the end of a CIF. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/fi_FI/__init__.py | Provider.ssn | def ssn(self, min_age=0, max_age=105, artificial=False):
"""
Returns 11 character Finnish personal identity code (Henkilötunnus,
HETU, Swedish: Personbeteckning). This function assigns random
gender to person.
HETU consists of eleven characters of the form DDMMYYCZZZQ, where
... | python | def ssn(self, min_age=0, max_age=105, artificial=False):
"""
Returns 11 character Finnish personal identity code (Henkilötunnus,
HETU, Swedish: Personbeteckning). This function assigns random
gender to person.
HETU consists of eleven characters of the form DDMMYYCZZZQ, where
... | [
"def",
"ssn",
"(",
"self",
",",
"min_age",
"=",
"0",
",",
"max_age",
"=",
"105",
",",
"artificial",
"=",
"False",
")",
":",
"def",
"_checksum",
"(",
"hetu",
")",
":",
"checksum_characters",
"=",
"\"0123456789ABCDEFHJKLMNPRSTUVWXY\"",
"return",
"checksum_charac... | Returns 11 character Finnish personal identity code (Henkilötunnus,
HETU, Swedish: Personbeteckning). This function assigns random
gender to person.
HETU consists of eleven characters of the form DDMMYYCZZZQ, where
DDMMYY is the date of birth, C the century sign, ZZZ the individual
... | [
"Returns",
"11",
"character",
"Finnish",
"personal",
"identity",
"code",
"(",
"Henkilötunnus",
"HETU",
"Swedish",
":",
"Personbeteckning",
")",
".",
"This",
"function",
"assigns",
"random",
"gender",
"to",
"person",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/fi_FI/__init__.py#L10-L41 | train | Generate a random 11 character Finnish personal identity code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/fi_FI/__init__.py | Provider._get_century_code | def _get_century_code(year):
"""Returns the century code for a given year"""
if 2000 <= year < 3000:
separator = 'A'
elif 1900 <= year < 2000:
separator = '-'
elif 1800 <= year < 1900:
separator = '+'
else:
raise ValueError('Finnish... | python | def _get_century_code(year):
"""Returns the century code for a given year"""
if 2000 <= year < 3000:
separator = 'A'
elif 1900 <= year < 2000:
separator = '-'
elif 1800 <= year < 1900:
separator = '+'
else:
raise ValueError('Finnish... | [
"def",
"_get_century_code",
"(",
"year",
")",
":",
"if",
"2000",
"<=",
"year",
"<",
"3000",
":",
"separator",
"=",
"'A'",
"elif",
"1900",
"<=",
"year",
"<",
"2000",
":",
"separator",
"=",
"'-'",
"elif",
"1800",
"<=",
"year",
"<",
"1900",
":",
"separa... | Returns the century code for a given year | [
"Returns",
"the",
"century",
"code",
"for",
"a",
"given",
"year"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/fi_FI/__init__.py#L44-L54 | train | Returns the century code for a given year | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/sv_SE/__init__.py | Provider.ssn | def ssn(self, min_age=18, max_age=90):
"""
Returns a 10 digit Swedish SSN, "Personnummer".
It consists of 10 digits in the form YYMMDD-SSGQ, where
YYMMDD is the date of birth, SSS is a serial number
and Q is a control character (Luhn checksum).
http://en.wikipedia.org/w... | python | def ssn(self, min_age=18, max_age=90):
"""
Returns a 10 digit Swedish SSN, "Personnummer".
It consists of 10 digits in the form YYMMDD-SSGQ, where
YYMMDD is the date of birth, SSS is a serial number
and Q is a control character (Luhn checksum).
http://en.wikipedia.org/w... | [
"def",
"ssn",
"(",
"self",
",",
"min_age",
"=",
"18",
",",
"max_age",
"=",
"90",
")",
":",
"def",
"_luhn_checksum",
"(",
"number",
")",
":",
"def",
"digits_of",
"(",
"n",
")",
":",
"return",
"[",
"int",
"(",
"d",
")",
"for",
"d",
"in",
"str",
"... | Returns a 10 digit Swedish SSN, "Personnummer".
It consists of 10 digits in the form YYMMDD-SSGQ, where
YYMMDD is the date of birth, SSS is a serial number
and Q is a control character (Luhn checksum).
http://en.wikipedia.org/wiki/Personal_identity_number_(Sweden) | [
"Returns",
"a",
"10",
"digit",
"Swedish",
"SSN",
"Personnummer",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/sv_SE/__init__.py#L10-L44 | train | Returns a 10 digit Swedish SSN and Personnummer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/profile/__init__.py | Provider.simple_profile | def simple_profile(self, sex=None):
"""
Generates a basic profile with personal informations
"""
SEX = ["F", "M"]
if sex not in SEX:
sex = self.random_element(SEX)
if sex == 'F':
name = self.generator.name_female()
elif sex == 'M':
... | python | def simple_profile(self, sex=None):
"""
Generates a basic profile with personal informations
"""
SEX = ["F", "M"]
if sex not in SEX:
sex = self.random_element(SEX)
if sex == 'F':
name = self.generator.name_female()
elif sex == 'M':
... | [
"def",
"simple_profile",
"(",
"self",
",",
"sex",
"=",
"None",
")",
":",
"SEX",
"=",
"[",
"\"F\"",
",",
"\"M\"",
"]",
"if",
"sex",
"not",
"in",
"SEX",
":",
"sex",
"=",
"self",
".",
"random_element",
"(",
"SEX",
")",
"if",
"sex",
"==",
"'F'",
":",... | Generates a basic profile with personal informations | [
"Generates",
"a",
"basic",
"profile",
"with",
"personal",
"informations"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/profile/__init__.py#L13-L31 | train | Generates a basic profile with personal informations | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/profile/__init__.py | Provider.profile | def profile(self, fields=None, sex=None):
"""
Generates a complete profile.
If "fields" is not empty, only the fields in the list will be returned
"""
if fields is None:
fields = []
d = {
"job": self.generator.job(),
"company": self.ge... | python | def profile(self, fields=None, sex=None):
"""
Generates a complete profile.
If "fields" is not empty, only the fields in the list will be returned
"""
if fields is None:
fields = []
d = {
"job": self.generator.job(),
"company": self.ge... | [
"def",
"profile",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"sex",
"=",
"None",
")",
":",
"if",
"fields",
"is",
"None",
":",
"fields",
"=",
"[",
"]",
"d",
"=",
"{",
"\"job\"",
":",
"self",
".",
"generator",
".",
"job",
"(",
")",
",",
"\"com... | Generates a complete profile.
If "fields" is not empty, only the fields in the list will be returned | [
"Generates",
"a",
"complete",
"profile",
".",
"If",
"fields",
"is",
"not",
"empty",
"only",
"the",
"fields",
"in",
"the",
"list",
"will",
"be",
"returned"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/profile/__init__.py#L33-L56 | train | Generates a complete profile. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/person/__init__.py | Provider.name | def name(self):
"""
:example 'John Doe'
"""
pattern = self.random_element(self.formats)
return self.generator.parse(pattern) | python | def name(self):
"""
:example 'John Doe'
"""
pattern = self.random_element(self.formats)
return self.generator.parse(pattern) | [
"def",
"name",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 'John Doe' | [
":",
"example",
"John",
"Doe"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/person/__init__.py#L16-L21 | train | Get a random name for the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/utils/datetime_safe.py | new_datetime | def new_datetime(d):
"""
Generate a safe datetime from a datetime.date or datetime.datetime object.
"""
kw = [d.year, d.month, d.day]
if isinstance(d, real_datetime):
kw.extend([d.hour, d.minute, d.second, d.microsecond, d.tzinfo])
return datetime(*kw) | python | def new_datetime(d):
"""
Generate a safe datetime from a datetime.date or datetime.datetime object.
"""
kw = [d.year, d.month, d.day]
if isinstance(d, real_datetime):
kw.extend([d.hour, d.minute, d.second, d.microsecond, d.tzinfo])
return datetime(*kw) | [
"def",
"new_datetime",
"(",
"d",
")",
":",
"kw",
"=",
"[",
"d",
".",
"year",
",",
"d",
".",
"month",
",",
"d",
".",
"day",
"]",
"if",
"isinstance",
"(",
"d",
",",
"real_datetime",
")",
":",
"kw",
".",
"extend",
"(",
"[",
"d",
".",
"hour",
","... | Generate a safe datetime from a datetime.date or datetime.datetime object. | [
"Generate",
"a",
"safe",
"datetime",
"from",
"a",
"datetime",
".",
"date",
"or",
"datetime",
".",
"datetime",
"object",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/utils/datetime_safe.py#L44-L51 | train | Generate a safe datetime from a datetime. date or datetime. datetime object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/company/__init__.py | Provider.company | def company(self):
"""
:example 'Acme Ltd'
"""
pattern = self.random_element(self.formats)
return self.generator.parse(pattern) | python | def company(self):
"""
:example 'Acme Ltd'
"""
pattern = self.random_element(self.formats)
return self.generator.parse(pattern) | [
"def",
"company",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 'Acme Ltd' | [
":",
"example",
"Acme",
"Ltd"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/__init__.py#L497-L502 | train | A company name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/company/__init__.py | Provider.catch_phrase | def catch_phrase(self):
"""
:example 'Robust full-range hub'
"""
result = []
for word_list in self.catch_phrase_words:
result.append(self.random_element(word_list))
return " ".join(result) | python | def catch_phrase(self):
"""
:example 'Robust full-range hub'
"""
result = []
for word_list in self.catch_phrase_words:
result.append(self.random_element(word_list))
return " ".join(result) | [
"def",
"catch_phrase",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"for",
"word_list",
"in",
"self",
".",
"catch_phrase_words",
":",
"result",
".",
"append",
"(",
"self",
".",
"random_element",
"(",
"word_list",
")",
")",
"return",
"\" \"",
".",
"joi... | :example 'Robust full-range hub' | [
":",
"example",
"Robust",
"full",
"-",
"range",
"hub"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/__init__.py#L510-L518 | train | Generate catch phrase | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/company/__init__.py | Provider.bs | def bs(self):
"""
:example 'integrate extensible convergence'
"""
result = []
for word_list in self.bsWords:
result.append(self.random_element(word_list))
return " ".join(result) | python | def bs(self):
"""
:example 'integrate extensible convergence'
"""
result = []
for word_list in self.bsWords:
result.append(self.random_element(word_list))
return " ".join(result) | [
"def",
"bs",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"for",
"word_list",
"in",
"self",
".",
"bsWords",
":",
"result",
".",
"append",
"(",
"self",
".",
"random_element",
"(",
"word_list",
")",
")",
"return",
"\" \"",
".",
"join",
"(",
"result"... | :example 'integrate extensible convergence' | [
":",
"example",
"integrate",
"extensible",
"convergence"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/__init__.py#L520-L528 | train | example integral extensible convergence | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/file/__init__.py | Provider.mime_type | def mime_type(self, category=None):
"""
:param category: application|audio|image|message|model|multipart|text|video
"""
category = category if category else self.random_element(
list(self.mime_types.keys()))
return self.random_element(self.mime_types[category]) | python | def mime_type(self, category=None):
"""
:param category: application|audio|image|message|model|multipart|text|video
"""
category = category if category else self.random_element(
list(self.mime_types.keys()))
return self.random_element(self.mime_types[category]) | [
"def",
"mime_type",
"(",
"self",
",",
"category",
"=",
"None",
")",
":",
"category",
"=",
"category",
"if",
"category",
"else",
"self",
".",
"random_element",
"(",
"list",
"(",
"self",
".",
"mime_types",
".",
"keys",
"(",
")",
")",
")",
"return",
"self... | :param category: application|audio|image|message|model|multipart|text|video | [
":",
"param",
"category",
":",
"application|audio|image|message|model|multipart|text|video"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/file/__init__.py#L205-L211 | train | returns a random mime type | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/file/__init__.py | Provider.file_name | def file_name(self, category=None, extension=None):
"""
:param category: audio|image|office|text|video
:param extension: file extension
"""
extension = extension if extension else self.file_extension(category)
filename = self.generator.word()
return '{0}.{1}'.form... | python | def file_name(self, category=None, extension=None):
"""
:param category: audio|image|office|text|video
:param extension: file extension
"""
extension = extension if extension else self.file_extension(category)
filename = self.generator.word()
return '{0}.{1}'.form... | [
"def",
"file_name",
"(",
"self",
",",
"category",
"=",
"None",
",",
"extension",
"=",
"None",
")",
":",
"extension",
"=",
"extension",
"if",
"extension",
"else",
"self",
".",
"file_extension",
"(",
"category",
")",
"filename",
"=",
"self",
".",
"generator"... | :param category: audio|image|office|text|video
:param extension: file extension | [
":",
"param",
"category",
":",
"audio|image|office|text|video",
":",
"param",
"extension",
":",
"file",
"extension"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/file/__init__.py#L213-L220 | train | returns a unique filename for the current locale | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/file/__init__.py | Provider.file_extension | def file_extension(self, category=None):
"""
:param category: audio|image|office|text|video
"""
category = category if category else self.random_element(
list(self.file_extensions.keys()))
return self.random_element(self.file_extensions[category]) | python | def file_extension(self, category=None):
"""
:param category: audio|image|office|text|video
"""
category = category if category else self.random_element(
list(self.file_extensions.keys()))
return self.random_element(self.file_extensions[category]) | [
"def",
"file_extension",
"(",
"self",
",",
"category",
"=",
"None",
")",
":",
"category",
"=",
"category",
"if",
"category",
"else",
"self",
".",
"random_element",
"(",
"list",
"(",
"self",
".",
"file_extensions",
".",
"keys",
"(",
")",
")",
")",
"return... | :param category: audio|image|office|text|video | [
":",
"param",
"category",
":",
"audio|image|office|text|video"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/file/__init__.py#L222-L228 | train | returns a random file extension | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/file/__init__.py | Provider.file_path | def file_path(self, depth=1, category=None, extension=None):
"""
:param category: audio|image|office|text|video
:param extension: file extension
:param depth: depth of the file (depth >= 0)
"""
file = self.file_name(category, extension)
path = "/{0}".format(file)
... | python | def file_path(self, depth=1, category=None, extension=None):
"""
:param category: audio|image|office|text|video
:param extension: file extension
:param depth: depth of the file (depth >= 0)
"""
file = self.file_name(category, extension)
path = "/{0}".format(file)
... | [
"def",
"file_path",
"(",
"self",
",",
"depth",
"=",
"1",
",",
"category",
"=",
"None",
",",
"extension",
"=",
"None",
")",
":",
"file",
"=",
"self",
".",
"file_name",
"(",
"category",
",",
"extension",
")",
"path",
"=",
"\"/{0}\"",
".",
"format",
"("... | :param category: audio|image|office|text|video
:param extension: file extension
:param depth: depth of the file (depth >= 0) | [
":",
"param",
"category",
":",
"audio|image|office|text|video",
":",
"param",
"extension",
":",
"file",
"extension",
":",
"param",
"depth",
":",
"depth",
"of",
"the",
"file",
"(",
"depth",
">",
"=",
"0",
")"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/file/__init__.py#L230-L240 | train | returns the path to the file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/file/__init__.py | Provider.unix_device | def unix_device(self, prefix=None):
"""
:param prefix: sd|vd|xvd
"""
prefix = prefix or self.random_element(self.unix_device_prefixes)
suffix = self.random_element(string.ascii_lowercase)
path = '/dev/%s%s' % (prefix, suffix)
return path | python | def unix_device(self, prefix=None):
"""
:param prefix: sd|vd|xvd
"""
prefix = prefix or self.random_element(self.unix_device_prefixes)
suffix = self.random_element(string.ascii_lowercase)
path = '/dev/%s%s' % (prefix, suffix)
return path | [
"def",
"unix_device",
"(",
"self",
",",
"prefix",
"=",
"None",
")",
":",
"prefix",
"=",
"prefix",
"or",
"self",
".",
"random_element",
"(",
"self",
".",
"unix_device_prefixes",
")",
"suffix",
"=",
"self",
".",
"random_element",
"(",
"string",
".",
"ascii_l... | :param prefix: sd|vd|xvd | [
":",
"param",
"prefix",
":",
"sd|vd|xvd"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/file/__init__.py#L242-L249 | train | returns a random unix device path | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/file/__init__.py | Provider.unix_partition | def unix_partition(self, prefix=None):
"""
:param prefix: sd|vd|xvd
"""
path = self.unix_device(prefix=prefix)
path += str(self.random_digit())
return path | python | def unix_partition(self, prefix=None):
"""
:param prefix: sd|vd|xvd
"""
path = self.unix_device(prefix=prefix)
path += str(self.random_digit())
return path | [
"def",
"unix_partition",
"(",
"self",
",",
"prefix",
"=",
"None",
")",
":",
"path",
"=",
"self",
".",
"unix_device",
"(",
"prefix",
"=",
"prefix",
")",
"path",
"+=",
"str",
"(",
"self",
".",
"random_digit",
"(",
")",
")",
"return",
"path"
] | :param prefix: sd|vd|xvd | [
":",
"param",
"prefix",
":",
"sd|vd|xvd"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/file/__init__.py#L251-L257 | train | returns a random unix partition of the system | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/en_US/__init__.py | Provider.itin | def itin(self):
"""Generate a random United States Individual Taxpayer Identification Number (ITIN).
An United States Individual Taxpayer Identification Number
(ITIN) is a tax processing number issued by the Internal
Revenue Service. It is a nine-digit number that always begins
... | python | def itin(self):
"""Generate a random United States Individual Taxpayer Identification Number (ITIN).
An United States Individual Taxpayer Identification Number
(ITIN) is a tax processing number issued by the Internal
Revenue Service. It is a nine-digit number that always begins
... | [
"def",
"itin",
"(",
"self",
")",
":",
"area",
"=",
"self",
".",
"random_int",
"(",
"min",
"=",
"900",
",",
"max",
"=",
"999",
")",
"serial",
"=",
"self",
".",
"random_int",
"(",
"min",
"=",
"0",
",",
"max",
"=",
"9999",
")",
"# The group number mus... | Generate a random United States Individual Taxpayer Identification Number (ITIN).
An United States Individual Taxpayer Identification Number
(ITIN) is a tax processing number issued by the Internal
Revenue Service. It is a nine-digit number that always begins
with the number 9 and has a... | [
"Generate",
"a",
"random",
"United",
"States",
"Individual",
"Taxpayer",
"Identification",
"Number",
"(",
"ITIN",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/en_US/__init__.py#L13-L33 | train | Generate a random United States Individual Taxpayer Identification Number ( ITIN. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/en_US/__init__.py | Provider.ein | def ein(self):
"""Generate a random United States Employer Identification Number (EIN).
An United States An Employer Identification Number (EIN) is
also known as a Federal Tax Identification Number, and is
used to identify a business entity. EINs follow a format of a
two-dig... | python | def ein(self):
"""Generate a random United States Employer Identification Number (EIN).
An United States An Employer Identification Number (EIN) is
also known as a Federal Tax Identification Number, and is
used to identify a business entity. EINs follow a format of a
two-dig... | [
"def",
"ein",
"(",
"self",
")",
":",
"# Only certain EIN Prefix values are assigned:",
"#",
"# https://www.irs.gov/businesses/small-businesses-self-employed/how-eins-are-assigned-and-valid-ein-prefixes",
"ein_prefix_choices",
"=",
"[",
"'01'",
",",
"'02'",
",",
"'03'",
",",
"'04'... | Generate a random United States Employer Identification Number (EIN).
An United States An Employer Identification Number (EIN) is
also known as a Federal Tax Identification Number, and is
used to identify a business entity. EINs follow a format of a
two-digit prefix followed by a hy... | [
"Generate",
"a",
"random",
"United",
"States",
"Employer",
"Identification",
"Number",
"(",
"EIN",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/en_US/__init__.py#L35-L140 | train | Generate a random United States Employer Identification Number and is
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/en_US/__init__.py | Provider.ssn | def ssn(self, taxpayer_identification_number_type=SSN_TYPE):
""" Generate a random United States Taxpayer Identification Number of the specified type.
If no type is specified, a US SSN is returned.
"""
if taxpayer_identification_number_type == self.ITIN_TYPE:
return self.it... | python | def ssn(self, taxpayer_identification_number_type=SSN_TYPE):
""" Generate a random United States Taxpayer Identification Number of the specified type.
If no type is specified, a US SSN is returned.
"""
if taxpayer_identification_number_type == self.ITIN_TYPE:
return self.it... | [
"def",
"ssn",
"(",
"self",
",",
"taxpayer_identification_number_type",
"=",
"SSN_TYPE",
")",
":",
"if",
"taxpayer_identification_number_type",
"==",
"self",
".",
"ITIN_TYPE",
":",
"return",
"self",
".",
"itin",
"(",
")",
"elif",
"taxpayer_identification_number_type",
... | Generate a random United States Taxpayer Identification Number of the specified type.
If no type is specified, a US SSN is returned. | [
"Generate",
"a",
"random",
"United",
"States",
"Taxpayer",
"Identification",
"Number",
"of",
"the",
"specified",
"type",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/en_US/__init__.py#L142-L169 | train | Generates a random US SSN from the specified type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/company/pt_BR/__init__.py | Provider.catch_phrase | def catch_phrase(self):
"""
:example 'a segurança de evoluir sem preocupação'
"""
pattern = self.random_element(self.catch_phrase_formats)
catch_phrase = self.generator.parse(pattern)
catch_phrase = catch_phrase[0].upper() + catch_phrase[1:]
return catch_phrase | python | def catch_phrase(self):
"""
:example 'a segurança de evoluir sem preocupação'
"""
pattern = self.random_element(self.catch_phrase_formats)
catch_phrase = self.generator.parse(pattern)
catch_phrase = catch_phrase[0].upper() + catch_phrase[1:]
return catch_phrase | [
"def",
"catch_phrase",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"catch_phrase_formats",
")",
"catch_phrase",
"=",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")",
"catch_phrase",
"=",
"catch_phrase",
... | :example 'a segurança de evoluir sem preocupação' | [
":",
"example",
"a",
"segurança",
"de",
"evoluir",
"sem",
"preocupação"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pt_BR/__init__.py#L92-L99 | train | example a segurança de evoluir sem preocupação | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/company/fr_CH/__init__.py | Provider.ide | def ide(self):
"""
Generates a IDE number (9 digits).
http://www.bfs.admin.ch/bfs/portal/fr/index/themen/00/05/blank/03/02.html
"""
def _checksum(digits):
factors = (5, 4, 3, 2, 7, 6, 5, 4)
sum_ = 0
for i in range(len(digits)):
... | python | def ide(self):
"""
Generates a IDE number (9 digits).
http://www.bfs.admin.ch/bfs/portal/fr/index/themen/00/05/blank/03/02.html
"""
def _checksum(digits):
factors = (5, 4, 3, 2, 7, 6, 5, 4)
sum_ = 0
for i in range(len(digits)):
... | [
"def",
"ide",
"(",
"self",
")",
":",
"def",
"_checksum",
"(",
"digits",
")",
":",
"factors",
"=",
"(",
"5",
",",
"4",
",",
"3",
",",
"2",
",",
"7",
",",
"6",
",",
"5",
",",
"4",
")",
"sum_",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len"... | Generates a IDE number (9 digits).
http://www.bfs.admin.ch/bfs/portal/fr/index/themen/00/05/blank/03/02.html | [
"Generates",
"a",
"IDE",
"number",
"(",
"9",
"digits",
")",
".",
"http",
":",
"//",
"www",
".",
"bfs",
".",
"admin",
".",
"ch",
"/",
"bfs",
"/",
"portal",
"/",
"fr",
"/",
"index",
"/",
"themen",
"/",
"00",
"/",
"05",
"/",
"blank",
"/",
"03",
... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/fr_CH/__init__.py#L9-L36 | train | Generate a random IDE number. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.unix_time | def unix_time(self, end_datetime=None, start_datetime=None):
"""
Get a timestamp between January 1, 1970 and now, unless passed
explicit start_datetime or end_datetime values.
:example 1061306726
"""
start_datetime = self._parse_start_datetime(start_datetime)
end_... | python | def unix_time(self, end_datetime=None, start_datetime=None):
"""
Get a timestamp between January 1, 1970 and now, unless passed
explicit start_datetime or end_datetime values.
:example 1061306726
"""
start_datetime = self._parse_start_datetime(start_datetime)
end_... | [
"def",
"unix_time",
"(",
"self",
",",
"end_datetime",
"=",
"None",
",",
"start_datetime",
"=",
"None",
")",
":",
"start_datetime",
"=",
"self",
".",
"_parse_start_datetime",
"(",
"start_datetime",
")",
"end_datetime",
"=",
"self",
".",
"_parse_end_datetime",
"("... | Get a timestamp between January 1, 1970 and now, unless passed
explicit start_datetime or end_datetime values.
:example 1061306726 | [
"Get",
"a",
"timestamp",
"between",
"January",
"1",
"1970",
"and",
"now",
"unless",
"passed",
"explicit",
"start_datetime",
"or",
"end_datetime",
"values",
".",
":",
"example",
"1061306726"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1368-L1376 | train | Get a random unix time between start_datetime and end_datetime. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.time_delta | def time_delta(self, end_datetime=None):
"""
Get a timedelta object
"""
start_datetime = self._parse_start_datetime('now')
end_datetime = self._parse_end_datetime(end_datetime)
seconds = end_datetime - start_datetime
ts = self.generator.random.randint(*sorted([0,... | python | def time_delta(self, end_datetime=None):
"""
Get a timedelta object
"""
start_datetime = self._parse_start_datetime('now')
end_datetime = self._parse_end_datetime(end_datetime)
seconds = end_datetime - start_datetime
ts = self.generator.random.randint(*sorted([0,... | [
"def",
"time_delta",
"(",
"self",
",",
"end_datetime",
"=",
"None",
")",
":",
"start_datetime",
"=",
"self",
".",
"_parse_start_datetime",
"(",
"'now'",
")",
"end_datetime",
"=",
"self",
".",
"_parse_end_datetime",
"(",
"end_datetime",
")",
"seconds",
"=",
"en... | Get a timedelta object | [
"Get",
"a",
"timedelta",
"object"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1378-L1387 | train | Get a timedelta object that is the time delta between start_datetime and end_datetime | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time | def date_time(self, tzinfo=None, end_datetime=None):
"""
Get a datetime object for a date between January 1, 1970 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2005-08-16 20:39:21')
:return datetime
"""
# NOTE: On windows... | python | def date_time(self, tzinfo=None, end_datetime=None):
"""
Get a datetime object for a date between January 1, 1970 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2005-08-16 20:39:21')
:return datetime
"""
# NOTE: On windows... | [
"def",
"date_time",
"(",
"self",
",",
"tzinfo",
"=",
"None",
",",
"end_datetime",
"=",
"None",
")",
":",
"# NOTE: On windows, the lowest value you can get from windows is 86400",
"# on the first day. Known python issue:",
"# https://bugs.python.org/issue30684",
"return"... | Get a datetime object for a date between January 1, 1970 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2005-08-16 20:39:21')
:return datetime | [
"Get",
"a",
"datetime",
"object",
"for",
"a",
"date",
"between",
"January",
"1",
"1970",
"and",
"now",
":",
"param",
"tzinfo",
":",
"timezone",
"instance",
"of",
"datetime",
".",
"tzinfo",
"subclass",
":",
"example",
"DateTime",
"(",
"2005",
"-",
"08",
"... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1389-L1400 | train | Get a datetime object for a date between January 1 1970 and now
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_ad | def date_time_ad(self, tzinfo=None, end_datetime=None, start_datetime=None):
"""
Get a datetime object for a date between January 1, 001 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1265-03-22 21:15:52')
:return datetime
"""
... | python | def date_time_ad(self, tzinfo=None, end_datetime=None, start_datetime=None):
"""
Get a datetime object for a date between January 1, 001 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1265-03-22 21:15:52')
:return datetime
"""
... | [
"def",
"date_time_ad",
"(",
"self",
",",
"tzinfo",
"=",
"None",
",",
"end_datetime",
"=",
"None",
",",
"start_datetime",
"=",
"None",
")",
":",
"# 1970-01-01 00:00:00 UTC minus 62135596800 seconds is",
"# 0001-01-01 00:00:00 UTC. Since _parse_end_datetime() is used",
"# else... | Get a datetime object for a date between January 1, 001 and now
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1265-03-22 21:15:52')
:return datetime | [
"Get",
"a",
"datetime",
"object",
"for",
"a",
"date",
"between",
"January",
"1",
"001",
"and",
"now",
":",
"param",
"tzinfo",
":",
"timezone",
"instance",
"of",
"datetime",
".",
"tzinfo",
"subclass",
":",
"example",
"DateTime",
"(",
"1265",
"-",
"03",
"-... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1402-L1427 | train | Get a datetime object for a date between January 1 001 and now. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.iso8601 | def iso8601(self, tzinfo=None, end_datetime=None):
"""
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example '2003-10-21T16:05:52+0000'
"""
return self.date_time(tzinfo, end_datetime=end_datetime).isoformat() | python | def iso8601(self, tzinfo=None, end_datetime=None):
"""
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example '2003-10-21T16:05:52+0000'
"""
return self.date_time(tzinfo, end_datetime=end_datetime).isoformat() | [
"def",
"iso8601",
"(",
"self",
",",
"tzinfo",
"=",
"None",
",",
"end_datetime",
"=",
"None",
")",
":",
"return",
"self",
".",
"date_time",
"(",
"tzinfo",
",",
"end_datetime",
"=",
"end_datetime",
")",
".",
"isoformat",
"(",
")"
] | :param tzinfo: timezone, instance of datetime.tzinfo subclass
:example '2003-10-21T16:05:52+0000' | [
":",
"param",
"tzinfo",
":",
"timezone",
"instance",
"of",
"datetime",
".",
"tzinfo",
"subclass",
":",
"example",
"2003",
"-",
"10",
"-",
"21T16",
":",
"05",
":",
"52",
"+",
"0000"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1429-L1434 | train | returns ISO 8601 string for the current time | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date | def date(self, pattern='%Y-%m-%d', end_datetime=None):
"""
Get a date string between January 1, 1970 and now
:param pattern format
:example '2008-11-27'
"""
return self.date_time(end_datetime=end_datetime).strftime(pattern) | python | def date(self, pattern='%Y-%m-%d', end_datetime=None):
"""
Get a date string between January 1, 1970 and now
:param pattern format
:example '2008-11-27'
"""
return self.date_time(end_datetime=end_datetime).strftime(pattern) | [
"def",
"date",
"(",
"self",
",",
"pattern",
"=",
"'%Y-%m-%d'",
",",
"end_datetime",
"=",
"None",
")",
":",
"return",
"self",
".",
"date_time",
"(",
"end_datetime",
"=",
"end_datetime",
")",
".",
"strftime",
"(",
"pattern",
")"
] | Get a date string between January 1, 1970 and now
:param pattern format
:example '2008-11-27' | [
"Get",
"a",
"date",
"string",
"between",
"January",
"1",
"1970",
"and",
"now",
":",
"param",
"pattern",
"format",
":",
"example",
"2008",
"-",
"11",
"-",
"27"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1436-L1442 | train | Get a date string between January 1 and 1970 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.time | def time(self, pattern='%H:%M:%S', end_datetime=None):
"""
Get a time string (24h format by default)
:param pattern format
:example '15:02:34'
"""
return self.date_time(
end_datetime=end_datetime).time().strftime(pattern) | python | def time(self, pattern='%H:%M:%S', end_datetime=None):
"""
Get a time string (24h format by default)
:param pattern format
:example '15:02:34'
"""
return self.date_time(
end_datetime=end_datetime).time().strftime(pattern) | [
"def",
"time",
"(",
"self",
",",
"pattern",
"=",
"'%H:%M:%S'",
",",
"end_datetime",
"=",
"None",
")",
":",
"return",
"self",
".",
"date_time",
"(",
"end_datetime",
"=",
"end_datetime",
")",
".",
"time",
"(",
")",
".",
"strftime",
"(",
"pattern",
")"
] | Get a time string (24h format by default)
:param pattern format
:example '15:02:34' | [
"Get",
"a",
"time",
"string",
"(",
"24h",
"format",
"by",
"default",
")",
":",
"param",
"pattern",
"format",
":",
"example",
"15",
":",
"02",
":",
"34"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1451-L1458 | train | Get a time string by default | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_between | def date_time_between(self, start_date='-30y', end_date='now', tzinfo=None):
"""
Get a DateTime object based on a random date between two given dates.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to 30 years ago
:param end_date Defaults ... | python | def date_time_between(self, start_date='-30y', end_date='now', tzinfo=None):
"""
Get a DateTime object based on a random date between two given dates.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to 30 years ago
:param end_date Defaults ... | [
"def",
"date_time_between",
"(",
"self",
",",
"start_date",
"=",
"'-30y'",
",",
"end_date",
"=",
"'now'",
",",
"tzinfo",
"=",
"None",
")",
":",
"start_date",
"=",
"self",
".",
"_parse_date_time",
"(",
"start_date",
",",
"tzinfo",
"=",
"tzinfo",
")",
"end_d... | Get a DateTime object based on a random date between two given dates.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to 30 years ago
:param end_date Defaults to "now"
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example D... | [
"Get",
"a",
"DateTime",
"object",
"based",
"on",
"a",
"random",
"date",
"between",
"two",
"given",
"dates",
".",
"Accepts",
"date",
"strings",
"that",
"can",
"be",
"recognized",
"by",
"strtotime",
"()",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1550-L1572 | train | Get a DateTime object based on a random date between two given dates. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_between | def date_between(self, start_date='-30y', end_date='today'):
"""
Get a Date object based on a random date between two given dates.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to 30 years ago
:param end_date Defaults to "today"
:... | python | def date_between(self, start_date='-30y', end_date='today'):
"""
Get a Date object based on a random date between two given dates.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to 30 years ago
:param end_date Defaults to "today"
:... | [
"def",
"date_between",
"(",
"self",
",",
"start_date",
"=",
"'-30y'",
",",
"end_date",
"=",
"'today'",
")",
":",
"start_date",
"=",
"self",
".",
"_parse_date",
"(",
"start_date",
")",
"end_date",
"=",
"self",
".",
"_parse_date",
"(",
"end_date",
")",
"retu... | Get a Date object based on a random date between two given dates.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to 30 years ago
:param end_date Defaults to "today"
:example Date('1999-02-02')
:return Date | [
"Get",
"a",
"Date",
"object",
"based",
"on",
"a",
"random",
"date",
"between",
"two",
"given",
"dates",
".",
"Accepts",
"date",
"strings",
"that",
"can",
"be",
"recognized",
"by",
"strtotime",
"()",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1574-L1587 | train | Returns a Date object based on a random date between two given dates. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.future_datetime | def future_datetime(self, end_date='+30d', tzinfo=None):
"""
Get a DateTime object based on a random date between 1 second form now
and a given date.
Accepts date strings that can be recognized by strtotime().
:param end_date Defaults to "+30d"
:param tzinfo: timezone, i... | python | def future_datetime(self, end_date='+30d', tzinfo=None):
"""
Get a DateTime object based on a random date between 1 second form now
and a given date.
Accepts date strings that can be recognized by strtotime().
:param end_date Defaults to "+30d"
:param tzinfo: timezone, i... | [
"def",
"future_datetime",
"(",
"self",
",",
"end_date",
"=",
"'+30d'",
",",
"tzinfo",
"=",
"None",
")",
":",
"return",
"self",
".",
"date_time_between",
"(",
"start_date",
"=",
"'+1s'",
",",
"end_date",
"=",
"end_date",
",",
"tzinfo",
"=",
"tzinfo",
",",
... | Get a DateTime object based on a random date between 1 second form now
and a given date.
Accepts date strings that can be recognized by strtotime().
:param end_date Defaults to "+30d"
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1999-02-02 11:... | [
"Get",
"a",
"DateTime",
"object",
"based",
"on",
"a",
"random",
"date",
"between",
"1",
"second",
"form",
"now",
"and",
"a",
"given",
"date",
".",
"Accepts",
"date",
"strings",
"that",
"can",
"be",
"recognized",
"by",
"strtotime",
"()",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1589-L1602 | train | Get a DateTime object based on a random date between 1 second form now
and a given date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.past_datetime | def past_datetime(self, start_date='-30d', tzinfo=None):
"""
Get a DateTime object based on a random date between a given date and 1
second ago.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to "-30d"
:param tzinfo: timezone, inst... | python | def past_datetime(self, start_date='-30d', tzinfo=None):
"""
Get a DateTime object based on a random date between a given date and 1
second ago.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to "-30d"
:param tzinfo: timezone, inst... | [
"def",
"past_datetime",
"(",
"self",
",",
"start_date",
"=",
"'-30d'",
",",
"tzinfo",
"=",
"None",
")",
":",
"return",
"self",
".",
"date_time_between",
"(",
"start_date",
"=",
"start_date",
",",
"end_date",
"=",
"'-1s'",
",",
"tzinfo",
"=",
"tzinfo",
",",... | Get a DateTime object based on a random date between a given date and 1
second ago.
Accepts date strings that can be recognized by strtotime().
:param start_date Defaults to "-30d"
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1999-02-02 11:42:... | [
"Get",
"a",
"DateTime",
"object",
"based",
"on",
"a",
"random",
"date",
"between",
"a",
"given",
"date",
"and",
"1",
"second",
"ago",
".",
"Accepts",
"date",
"strings",
"that",
"can",
"be",
"recognized",
"by",
"strtotime",
"()",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1617-L1630 | train | Get a DateTime object based on a random date between start_date and end_date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_between_dates | def date_time_between_dates(
self,
datetime_start=None,
datetime_end=None,
tzinfo=None):
"""
Takes two DateTime objects and returns a random datetime between the two
given datetimes.
Accepts DateTime objects.
:param datetime_start:... | python | def date_time_between_dates(
self,
datetime_start=None,
datetime_end=None,
tzinfo=None):
"""
Takes two DateTime objects and returns a random datetime between the two
given datetimes.
Accepts DateTime objects.
:param datetime_start:... | [
"def",
"date_time_between_dates",
"(",
"self",
",",
"datetime_start",
"=",
"None",
",",
"datetime_end",
"=",
"None",
",",
"tzinfo",
"=",
"None",
")",
":",
"if",
"datetime_start",
"is",
"None",
":",
"datetime_start",
"=",
"datetime",
".",
"now",
"(",
"tzinfo"... | Takes two DateTime objects and returns a random datetime between the two
given datetimes.
Accepts DateTime objects.
:param datetime_start: DateTime
:param datetime_end: DateTime
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('1999-02-02 1... | [
"Takes",
"two",
"DateTime",
"objects",
"and",
"returns",
"a",
"random",
"datetime",
"between",
"the",
"two",
"given",
"datetimes",
".",
"Accepts",
"DateTime",
"objects",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1645-L1682 | train | Returns a random datetime between the two datetimes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_this_century | def date_time_this_century(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the current century.
:param before_now: include days in current century before today
:param after_now: include days in current... | python | def date_time_this_century(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the current century.
:param before_now: include days in current century before today
:param after_now: include days in current... | [
"def",
"date_time_this_century",
"(",
"self",
",",
"before_now",
"=",
"True",
",",
"after_now",
"=",
"False",
",",
"tzinfo",
"=",
"None",
")",
":",
"now",
"=",
"datetime",
".",
"now",
"(",
"tzinfo",
")",
"this_century_start",
"=",
"datetime",
"(",
"now",
... | Gets a DateTime object for the current century.
:param before_now: include days in current century before today
:param after_now: include days in current century after today
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2012-04-04 11:02:02')
:r... | [
"Gets",
"a",
"DateTime",
"object",
"for",
"the",
"current",
"century",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1695-L1723 | train | Gets a DateTime object for the current century. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_this_decade | def date_time_this_decade(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the decade year.
:param before_now: include days in current decade before today
:param after_now: include days in current decad... | python | def date_time_this_decade(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the decade year.
:param before_now: include days in current decade before today
:param after_now: include days in current decad... | [
"def",
"date_time_this_decade",
"(",
"self",
",",
"before_now",
"=",
"True",
",",
"after_now",
"=",
"False",
",",
"tzinfo",
"=",
"None",
")",
":",
"now",
"=",
"datetime",
".",
"now",
"(",
"tzinfo",
")",
"this_decade_start",
"=",
"datetime",
"(",
"now",
"... | Gets a DateTime object for the decade year.
:param before_now: include days in current decade before today
:param after_now: include days in current decade after today
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2012-04-04 11:02:02')
:return ... | [
"Gets",
"a",
"DateTime",
"object",
"for",
"the",
"decade",
"year",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1725-L1753 | train | Gets a DateTime object for the current decade year. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_this_year | def date_time_this_year(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the current year.
:param before_now: include days in current year before today
:param after_now: include days in current year aft... | python | def date_time_this_year(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the current year.
:param before_now: include days in current year before today
:param after_now: include days in current year aft... | [
"def",
"date_time_this_year",
"(",
"self",
",",
"before_now",
"=",
"True",
",",
"after_now",
"=",
"False",
",",
"tzinfo",
"=",
"None",
")",
":",
"now",
"=",
"datetime",
".",
"now",
"(",
"tzinfo",
")",
"this_year_start",
"=",
"now",
".",
"replace",
"(",
... | Gets a DateTime object for the current year.
:param before_now: include days in current year before today
:param after_now: include days in current year after today
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2012-04-04 11:02:02')
:return Dat... | [
"Gets",
"a",
"DateTime",
"object",
"for",
"the",
"current",
"year",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1755-L1782 | train | Gets a DateTime object for the current year. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_time_this_month | def date_time_this_month(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the current month.
:param before_now: include days in current month before today
:param after_now: include days in current month... | python | def date_time_this_month(
self,
before_now=True,
after_now=False,
tzinfo=None):
"""
Gets a DateTime object for the current month.
:param before_now: include days in current month before today
:param after_now: include days in current month... | [
"def",
"date_time_this_month",
"(",
"self",
",",
"before_now",
"=",
"True",
",",
"after_now",
"=",
"False",
",",
"tzinfo",
"=",
"None",
")",
":",
"now",
"=",
"datetime",
".",
"now",
"(",
"tzinfo",
")",
"this_month_start",
"=",
"now",
".",
"replace",
"(",... | Gets a DateTime object for the current month.
:param before_now: include days in current month before today
:param after_now: include days in current month after today
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2012-04-04 11:02:02')
:return ... | [
"Gets",
"a",
"DateTime",
"object",
"for",
"the",
"current",
"month",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1784-L1812 | train | Gets a DateTime object for the current month. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_this_century | def date_this_century(self, before_today=True, after_today=False):
"""
Gets a Date object for the current century.
:param before_today: include days in current century before today
:param after_today: include days in current century after today
:example Date('2012-04-04')
... | python | def date_this_century(self, before_today=True, after_today=False):
"""
Gets a Date object for the current century.
:param before_today: include days in current century before today
:param after_today: include days in current century after today
:example Date('2012-04-04')
... | [
"def",
"date_this_century",
"(",
"self",
",",
"before_today",
"=",
"True",
",",
"after_today",
"=",
"False",
")",
":",
"today",
"=",
"date",
".",
"today",
"(",
")",
"this_century_start",
"=",
"date",
"(",
"today",
".",
"year",
"-",
"(",
"today",
".",
"... | Gets a Date object for the current century.
:param before_today: include days in current century before today
:param after_today: include days in current century after today
:example Date('2012-04-04')
:return Date | [
"Gets",
"a",
"Date",
"object",
"for",
"the",
"current",
"century",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1814-L1835 | train | Gets a Date object for the current century. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_this_decade | def date_this_decade(self, before_today=True, after_today=False):
"""
Gets a Date object for the decade year.
:param before_today: include days in current decade before today
:param after_today: include days in current decade after today
:example Date('2012-04-04')
:retu... | python | def date_this_decade(self, before_today=True, after_today=False):
"""
Gets a Date object for the decade year.
:param before_today: include days in current decade before today
:param after_today: include days in current decade after today
:example Date('2012-04-04')
:retu... | [
"def",
"date_this_decade",
"(",
"self",
",",
"before_today",
"=",
"True",
",",
"after_today",
"=",
"False",
")",
":",
"today",
"=",
"date",
".",
"today",
"(",
")",
"this_decade_start",
"=",
"date",
"(",
"today",
".",
"year",
"-",
"(",
"today",
".",
"ye... | Gets a Date object for the decade year.
:param before_today: include days in current decade before today
:param after_today: include days in current decade after today
:example Date('2012-04-04')
:return Date | [
"Gets",
"a",
"Date",
"object",
"for",
"the",
"decade",
"year",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1837-L1857 | train | Gets a Date object for the decade year. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_this_year | def date_this_year(self, before_today=True, after_today=False):
"""
Gets a Date object for the current year.
:param before_today: include days in current year before today
:param after_today: include days in current year after today
:example Date('2012-04-04')
:return Da... | python | def date_this_year(self, before_today=True, after_today=False):
"""
Gets a Date object for the current year.
:param before_today: include days in current year before today
:param after_today: include days in current year after today
:example Date('2012-04-04')
:return Da... | [
"def",
"date_this_year",
"(",
"self",
",",
"before_today",
"=",
"True",
",",
"after_today",
"=",
"False",
")",
":",
"today",
"=",
"date",
".",
"today",
"(",
")",
"this_year_start",
"=",
"today",
".",
"replace",
"(",
"month",
"=",
"1",
",",
"day",
"=",
... | Gets a Date object for the current year.
:param before_today: include days in current year before today
:param after_today: include days in current year after today
:example Date('2012-04-04')
:return Date | [
"Gets",
"a",
"Date",
"object",
"for",
"the",
"current",
"year",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1859-L1879 | train | Gets a Date object for the current year. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_this_month | def date_this_month(self, before_today=True, after_today=False):
"""
Gets a Date object for the current month.
:param before_today: include days in current month before today
:param after_today: include days in current month after today
:param tzinfo: timezone, instance of datet... | python | def date_this_month(self, before_today=True, after_today=False):
"""
Gets a Date object for the current month.
:param before_today: include days in current month before today
:param after_today: include days in current month after today
:param tzinfo: timezone, instance of datet... | [
"def",
"date_this_month",
"(",
"self",
",",
"before_today",
"=",
"True",
",",
"after_today",
"=",
"False",
")",
":",
"today",
"=",
"date",
".",
"today",
"(",
")",
"this_month_start",
"=",
"today",
".",
"replace",
"(",
"day",
"=",
"1",
")",
"next_month_st... | Gets a Date object for the current month.
:param before_today: include days in current month before today
:param after_today: include days in current month after today
:param tzinfo: timezone, instance of datetime.tzinfo subclass
:example DateTime('2012-04-04 11:02:02')
:return ... | [
"Gets",
"a",
"Date",
"object",
"for",
"the",
"current",
"month",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1881-L1903 | train | Gets a Date object for the current month. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.time_series | def time_series(
self,
start_date='-30d',
end_date='now',
precision=None,
distrib=None,
tzinfo=None):
"""
Returns a generator yielding tuples of ``(<datetime>, <value>)``.
The data points will start at ``start_date``, and b... | python | def time_series(
self,
start_date='-30d',
end_date='now',
precision=None,
distrib=None,
tzinfo=None):
"""
Returns a generator yielding tuples of ``(<datetime>, <value>)``.
The data points will start at ``start_date``, and b... | [
"def",
"time_series",
"(",
"self",
",",
"start_date",
"=",
"'-30d'",
",",
"end_date",
"=",
"'now'",
",",
"precision",
"=",
"None",
",",
"distrib",
"=",
"None",
",",
"tzinfo",
"=",
"None",
")",
":",
"start_date",
"=",
"self",
".",
"_parse_date_time",
"(",... | Returns a generator yielding tuples of ``(<datetime>, <value>)``.
The data points will start at ``start_date``, and be at every time interval specified by
``precision``.
``distrib`` is a callable that accepts ``<datetime>`` and returns ``<value>`` | [
"Returns",
"a",
"generator",
"yielding",
"tuples",
"of",
"(",
"<datetime",
">",
"<value",
">",
")",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1905-L1941 | train | Returns a generator yielding tuples of datetime and value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/date_time/__init__.py | Provider.date_of_birth | def date_of_birth(self, tzinfo=None, minimum_age=0, maximum_age=115):
"""
Generate a random date of birth represented as a Date object,
constrained by optional miminimum_age and maximum_age
parameters.
:param tzinfo Defaults to None.
:param minimum_age Defaults to 0.
... | python | def date_of_birth(self, tzinfo=None, minimum_age=0, maximum_age=115):
"""
Generate a random date of birth represented as a Date object,
constrained by optional miminimum_age and maximum_age
parameters.
:param tzinfo Defaults to None.
:param minimum_age Defaults to 0.
... | [
"def",
"date_of_birth",
"(",
"self",
",",
"tzinfo",
"=",
"None",
",",
"minimum_age",
"=",
"0",
",",
"maximum_age",
"=",
"115",
")",
":",
"if",
"not",
"isinstance",
"(",
"minimum_age",
",",
"int",
")",
":",
"raise",
"TypeError",
"(",
"\"minimum_age must be ... | Generate a random date of birth represented as a Date object,
constrained by optional miminimum_age and maximum_age
parameters.
:param tzinfo Defaults to None.
:param minimum_age Defaults to 0.
:param maximum_age Defaults to 115.
:example Date('1979-02-02')
:ret... | [
"Generate",
"a",
"random",
"date",
"of",
"birth",
"represented",
"as",
"a",
"Date",
"object",
"constrained",
"by",
"optional",
"miminimum_age",
"and",
"maximum_age",
"parameters",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/date_time/__init__.py#L1971-L2010 | train | Generate a random date of birth. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/utils/datasets.py | add_dicts | def add_dicts(*args):
"""
Adds two or more dicts together. Common keys will have their values added.
For example::
>>> t1 = {'a':1, 'b':2}
>>> t2 = {'b':1, 'c':3}
>>> t3 = {'d':4}
>>> add_dicts(t1, t2, t3)
{'a': 1, 'c': 3, 'b': 3, 'd': 4}
"""
counters = [... | python | def add_dicts(*args):
"""
Adds two or more dicts together. Common keys will have their values added.
For example::
>>> t1 = {'a':1, 'b':2}
>>> t2 = {'b':1, 'c':3}
>>> t3 = {'d':4}
>>> add_dicts(t1, t2, t3)
{'a': 1, 'c': 3, 'b': 3, 'd': 4}
"""
counters = [... | [
"def",
"add_dicts",
"(",
"*",
"args",
")",
":",
"counters",
"=",
"[",
"Counter",
"(",
"arg",
")",
"for",
"arg",
"in",
"args",
"]",
"return",
"dict",
"(",
"reduce",
"(",
"operator",
".",
"add",
",",
"counters",
")",
")"
] | Adds two or more dicts together. Common keys will have their values added.
For example::
>>> t1 = {'a':1, 'b':2}
>>> t2 = {'b':1, 'c':3}
>>> t3 = {'d':4}
>>> add_dicts(t1, t2, t3)
{'a': 1, 'c': 3, 'b': 3, 'd': 4} | [
"Adds",
"two",
"or",
"more",
"dicts",
"together",
".",
"Common",
"keys",
"will",
"have",
"their",
"values",
"added",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/utils/datasets.py#L8-L24 | train | Adds two or more dicts together. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/credit_card/__init__.py | Provider.credit_card_provider | def credit_card_provider(self, card_type=None):
""" Returns the provider's name of the credit card. """
if card_type is None:
card_type = self.random_element(self.credit_card_types.keys())
return self._credit_card_type(card_type).name | python | def credit_card_provider(self, card_type=None):
""" Returns the provider's name of the credit card. """
if card_type is None:
card_type = self.random_element(self.credit_card_types.keys())
return self._credit_card_type(card_type).name | [
"def",
"credit_card_provider",
"(",
"self",
",",
"card_type",
"=",
"None",
")",
":",
"if",
"card_type",
"is",
"None",
":",
"card_type",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"credit_card_types",
".",
"keys",
"(",
")",
")",
"return",
"self",... | Returns the provider's name of the credit card. | [
"Returns",
"the",
"provider",
"s",
"name",
"of",
"the",
"credit",
"card",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/credit_card/__init__.py#L61-L65 | train | Returns the provider s name of the credit card. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/credit_card/__init__.py | Provider.credit_card_number | def credit_card_number(self, card_type=None):
""" Returns a valid credit card number. """
card = self._credit_card_type(card_type)
prefix = self.random_element(card.prefixes)
number = self._generate_number(self.numerify(prefix), card.length)
return number | python | def credit_card_number(self, card_type=None):
""" Returns a valid credit card number. """
card = self._credit_card_type(card_type)
prefix = self.random_element(card.prefixes)
number = self._generate_number(self.numerify(prefix), card.length)
return number | [
"def",
"credit_card_number",
"(",
"self",
",",
"card_type",
"=",
"None",
")",
":",
"card",
"=",
"self",
".",
"_credit_card_type",
"(",
"card_type",
")",
"prefix",
"=",
"self",
".",
"random_element",
"(",
"card",
".",
"prefixes",
")",
"number",
"=",
"self",... | Returns a valid credit card number. | [
"Returns",
"a",
"valid",
"credit",
"card",
"number",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/credit_card/__init__.py#L67-L72 | train | Returns a valid credit card number. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/credit_card/__init__.py | Provider.credit_card_security_code | def credit_card_security_code(self, card_type=None):
""" Returns a security code string. """
sec_len = self._credit_card_type(card_type).security_code_length
return self.numerify('#' * sec_len) | python | def credit_card_security_code(self, card_type=None):
""" Returns a security code string. """
sec_len = self._credit_card_type(card_type).security_code_length
return self.numerify('#' * sec_len) | [
"def",
"credit_card_security_code",
"(",
"self",
",",
"card_type",
"=",
"None",
")",
":",
"sec_len",
"=",
"self",
".",
"_credit_card_type",
"(",
"card_type",
")",
".",
"security_code_length",
"return",
"self",
".",
"numerify",
"(",
"'#'",
"*",
"sec_len",
")"
] | Returns a security code string. | [
"Returns",
"a",
"security",
"code",
"string",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/credit_card/__init__.py#L96-L99 | train | Returns a security code string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/credit_card/__init__.py | Provider._credit_card_type | def _credit_card_type(self, card_type=None):
""" Returns a random credit card type instance. """
if card_type is None:
card_type = self.random_element(self.credit_card_types.keys())
elif isinstance(card_type, CreditCard):
return card_type
return self.credit_card_t... | python | def _credit_card_type(self, card_type=None):
""" Returns a random credit card type instance. """
if card_type is None:
card_type = self.random_element(self.credit_card_types.keys())
elif isinstance(card_type, CreditCard):
return card_type
return self.credit_card_t... | [
"def",
"_credit_card_type",
"(",
"self",
",",
"card_type",
"=",
"None",
")",
":",
"if",
"card_type",
"is",
"None",
":",
"card_type",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"credit_card_types",
".",
"keys",
"(",
")",
")",
"elif",
"isinstance"... | Returns a random credit card type instance. | [
"Returns",
"a",
"random",
"credit",
"card",
"type",
"instance",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/credit_card/__init__.py#L101-L107 | train | Returns a random credit card type instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/credit_card/__init__.py | Provider._generate_number | def _generate_number(self, prefix, length):
"""
'prefix' is the start of the CC number as a string, any number of digits.
'length' is the length of the CC number to generate. Typically 13 or 16
"""
number = prefix
# Generate random char digits
number += '#' * (len... | python | def _generate_number(self, prefix, length):
"""
'prefix' is the start of the CC number as a string, any number of digits.
'length' is the length of the CC number to generate. Typically 13 or 16
"""
number = prefix
# Generate random char digits
number += '#' * (len... | [
"def",
"_generate_number",
"(",
"self",
",",
"prefix",
",",
"length",
")",
":",
"number",
"=",
"prefix",
"# Generate random char digits",
"number",
"+=",
"'#'",
"*",
"(",
"length",
"-",
"len",
"(",
"prefix",
")",
"-",
"1",
")",
"number",
"=",
"self",
"."... | 'prefix' is the start of the CC number as a string, any number of digits.
'length' is the length of the CC number to generate. Typically 13 or 16 | [
"prefix",
"is",
"the",
"start",
"of",
"the",
"CC",
"number",
"as",
"a",
"string",
"any",
"number",
"of",
"digits",
".",
"length",
"is",
"the",
"length",
"of",
"the",
"CC",
"number",
"to",
"generate",
".",
"Typically",
"13",
"or",
"16"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/credit_card/__init__.py#L109-L130 | train | Generate a random CC number. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/company/fi_FI/__init__.py | Provider.company_business_id | def company_business_id(self):
"""
Returns Finnish company Business Identity Code (y-tunnus).
Format is 8 digits - e.g. FI99999999,[8] last digit is a check
digit utilizing MOD 11-2. The first digit is zero for some old
organizations. This function provides current codes starting... | python | def company_business_id(self):
"""
Returns Finnish company Business Identity Code (y-tunnus).
Format is 8 digits - e.g. FI99999999,[8] last digit is a check
digit utilizing MOD 11-2. The first digit is zero for some old
organizations. This function provides current codes starting... | [
"def",
"company_business_id",
"(",
"self",
")",
":",
"def",
"calculate_checksum",
"(",
"number",
")",
":",
"\"\"\"Calculate the checksum using mod 11,2 method\"\"\"",
"factors",
"=",
"[",
"7",
",",
"9",
",",
"10",
",",
"5",
",",
"8",
",",
"4",
",",
"2",
"]",... | Returns Finnish company Business Identity Code (y-tunnus).
Format is 8 digits - e.g. FI99999999,[8] last digit is a check
digit utilizing MOD 11-2. The first digit is zero for some old
organizations. This function provides current codes starting with
non-zero. | [
"Returns",
"Finnish",
"company",
"Business",
"Identity",
"Code",
"(",
"y",
"-",
"tunnus",
")",
".",
"Format",
"is",
"8",
"digits",
"-",
"e",
".",
"g",
".",
"FI99999999",
"[",
"8",
"]",
"last",
"digit",
"is",
"a",
"check",
"digit",
"utilizing",
"MOD",
... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/fi_FI/__init__.py#L17-L39 | train | Returns a string that is used to identify the company business identity code for the current company. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/nl_BE/__init__.py | Provider.ssn | def ssn(self):
"""
Returns a 11 digits Belgian SSN called "rijksregisternummer" as a string
The first 6 digits represent the birthdate with (in order) year, month and day.
The second group of 3 digits is represents a sequence number (order of birth).
It is even for women and odd... | python | def ssn(self):
"""
Returns a 11 digits Belgian SSN called "rijksregisternummer" as a string
The first 6 digits represent the birthdate with (in order) year, month and day.
The second group of 3 digits is represents a sequence number (order of birth).
It is even for women and odd... | [
"def",
"ssn",
"(",
"self",
")",
":",
"# see http://nl.wikipedia.org/wiki/Burgerservicenummer (in Dutch)",
"def",
"_checksum",
"(",
"digits",
")",
":",
"res",
"=",
"97",
"-",
"(",
"digits",
"%",
"97",
")",
"return",
"res",
"# Generate a date (random)",
"mydate",
"=... | Returns a 11 digits Belgian SSN called "rijksregisternummer" as a string
The first 6 digits represent the birthdate with (in order) year, month and day.
The second group of 3 digits is represents a sequence number (order of birth).
It is even for women and odd for men.
For men the range... | [
"Returns",
"a",
"11",
"digits",
"Belgian",
"SSN",
"called",
"rijksregisternummer",
"as",
"a",
"string"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/nl_BE/__init__.py#L14-L58 | train | Generate a 11 digits Belgian SSN called rjksregisternummer | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.land_address | def land_address(self):
"""
:example 세종특별자치시 어진동 507
"""
pattern = self.random_element(self.land_address_formats)
return self.generator.parse(pattern) | python | def land_address(self):
"""
:example 세종특별자치시 어진동 507
"""
pattern = self.random_element(self.land_address_formats)
return self.generator.parse(pattern) | [
"def",
"land_address",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"land_address_formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 세종특별자치시 어진동 507 | [
":",
"example",
"세종특별자치시",
"어진동",
"507"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L274-L279 | train | A random land address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.road_address | def road_address(self):
"""
:example 세종특별자치시 도움5로 19 (어진동)
"""
pattern = self.random_element(self.road_address_formats)
return self.generator.parse(pattern) | python | def road_address(self):
"""
:example 세종특별자치시 도움5로 19 (어진동)
"""
pattern = self.random_element(self.road_address_formats)
return self.generator.parse(pattern) | [
"def",
"road_address",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"road_address_formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 세종특별자치시 도움5로 19 (어진동) | [
":",
"example",
"세종특별자치시",
"도움5로",
"19",
"(",
"어진동",
")"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L287-L292 | train | example 세종특별자치시 도맄동 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.address_detail | def address_detail(self):
"""
:example 가나아파트 가동 102호
"""
pattern = self.bothify(self.random_element(
self.address_detail_formats))
return self.generator.parse(pattern) | python | def address_detail(self):
"""
:example 가나아파트 가동 102호
"""
pattern = self.bothify(self.random_element(
self.address_detail_formats))
return self.generator.parse(pattern) | [
"def",
"address_detail",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"bothify",
"(",
"self",
".",
"random_element",
"(",
"self",
".",
"address_detail_formats",
")",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 가나아파트 가동 102호 | [
":",
"example",
"가나아파트",
"가동",
"102호"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L294-L300 | train | example 가나아파트 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.road | def road(self):
"""
:example 도움5로
"""
pattern = self.random_element(self.road_formats)
return self.generator.parse(pattern) | python | def road(self):
"""
:example 도움5로
"""
pattern = self.random_element(self.road_formats)
return self.generator.parse(pattern) | [
"def",
"road",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"road_formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 도움5로 | [
":",
"example",
"도움5로"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L302-L307 | train | 도움5로 반환 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.city | def city(self):
"""
:example 고양시
"""
pattern = self.random_element(self.cities)
return self.generator.parse(pattern) | python | def city(self):
"""
:example 고양시
"""
pattern = self.random_element(self.cities)
return self.generator.parse(pattern) | [
"def",
"city",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"cities",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 고양시 | [
":",
"example",
"고양시"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L333-L338 | train | example 고양시 입니다. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.town | def town(self):
"""
:example 가나동
"""
pattern = self.random_element(self.town_formats)
return self.generator.parse(pattern) | python | def town(self):
"""
:example 가나동
"""
pattern = self.random_element(self.town_formats)
return self.generator.parse(pattern) | [
"def",
"town",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"town_formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 가나동 | [
":",
"example",
"가나동"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L346-L351 | train | town 밀나동 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/address/ko_KR/__init__.py | Provider.building_name | def building_name(self):
"""
:example 김구아파트
"""
pattern = self.random_element(self.building_name_formats)
return self.generator.parse(pattern) | python | def building_name(self):
"""
:example 김구아파트
"""
pattern = self.random_element(self.building_name_formats)
return self.generator.parse(pattern) | [
"def",
"building_name",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"building_name_formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | :example 김구아파트 | [
":",
"example",
"김구아파트"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ko_KR/__init__.py#L359-L364 | train | example 김구아파트
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/ssn/en_CA/__init__.py | checksum | def checksum(sin):
"""
Determine validity of a Canadian Social Insurance Number.
Validation is performed using a modified Luhn Algorithm. To check
the Every second digit of the SIN is doubled and the result is
summed. If the result is a multiple of ten, the Social Insurance
Number is considere... | python | def checksum(sin):
"""
Determine validity of a Canadian Social Insurance Number.
Validation is performed using a modified Luhn Algorithm. To check
the Every second digit of the SIN is doubled and the result is
summed. If the result is a multiple of ten, the Social Insurance
Number is considere... | [
"def",
"checksum",
"(",
"sin",
")",
":",
"# Remove spaces and create a list of digits.",
"checksumCollection",
"=",
"list",
"(",
"sin",
".",
"replace",
"(",
"' '",
",",
"''",
")",
")",
"checksumCollection",
"=",
"[",
"int",
"(",
"i",
")",
"for",
"i",
"in",
... | Determine validity of a Canadian Social Insurance Number.
Validation is performed using a modified Luhn Algorithm. To check
the Every second digit of the SIN is doubled and the result is
summed. If the result is a multiple of ten, the Social Insurance
Number is considered valid.
https://en.wikipe... | [
"Determine",
"validity",
"of",
"a",
"Canadian",
"Social",
"Insurance",
"Number",
".",
"Validation",
"is",
"performed",
"using",
"a",
"modified",
"Luhn",
"Algorithm",
".",
"To",
"check",
"the",
"Every",
"second",
"digit",
"of",
"the",
"SIN",
"is",
"doubled",
... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/en_CA/__init__.py#L6-L41 | train | Calculates the checksum of a Canadian Social Insurance Number. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.hostname | def hostname(self, levels=1):
"""
Produce a hostname with specified number of subdomain levels.
>>> hostname()
db-01.nichols-phillips.com
>>> hostname(0)
laptop-56
>>> hostname(2)
web-12.williamson-hopkins.jackson.com
"""
if levels < 1:
... | python | def hostname(self, levels=1):
"""
Produce a hostname with specified number of subdomain levels.
>>> hostname()
db-01.nichols-phillips.com
>>> hostname(0)
laptop-56
>>> hostname(2)
web-12.williamson-hopkins.jackson.com
"""
if levels < 1:
... | [
"def",
"hostname",
"(",
"self",
",",
"levels",
"=",
"1",
")",
":",
"if",
"levels",
"<",
"1",
":",
"return",
"self",
".",
"random_element",
"(",
"self",
".",
"hostname_prefixes",
")",
"+",
"'-'",
"+",
"self",
".",
"numerify",
"(",
"'##'",
")",
"return... | Produce a hostname with specified number of subdomain levels.
>>> hostname()
db-01.nichols-phillips.com
>>> hostname(0)
laptop-56
>>> hostname(2)
web-12.williamson-hopkins.jackson.com | [
"Produce",
"a",
"hostname",
"with",
"specified",
"number",
"of",
"subdomain",
"levels",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L192-L205 | train | Produce a hostname with specified number of subdomain levels. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.domain_name | def domain_name(self, levels=1):
"""
Produce an Internet domain name with the specified number of
subdomain levels.
>>> domain_name()
nichols-phillips.com
>>> domain_name(2)
williamson-hopkins.jackson.com
"""
if levels < 1:
raise Value... | python | def domain_name(self, levels=1):
"""
Produce an Internet domain name with the specified number of
subdomain levels.
>>> domain_name()
nichols-phillips.com
>>> domain_name(2)
williamson-hopkins.jackson.com
"""
if levels < 1:
raise Value... | [
"def",
"domain_name",
"(",
"self",
",",
"levels",
"=",
"1",
")",
":",
"if",
"levels",
"<",
"1",
":",
"raise",
"ValueError",
"(",
"\"levels must be greater than or equal to 1\"",
")",
"if",
"levels",
"==",
"1",
":",
"return",
"self",
".",
"domain_word",
"(",
... | Produce an Internet domain name with the specified number of
subdomain levels.
>>> domain_name()
nichols-phillips.com
>>> domain_name(2)
williamson-hopkins.jackson.com | [
"Produce",
"an",
"Internet",
"domain",
"name",
"with",
"the",
"specified",
"number",
"of",
"subdomain",
"levels",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L208-L223 | train | Produce an Internet domain name with the specified number of subdomain levels. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.url | def url(self, schemes=None):
"""
:param schemes: a list of strings to use as schemes, one will chosen randomly.
If None, it will generate http and https urls.
Passing an empty list will result in schemeless url generation like "://domain.com".
:returns: a random url string.
... | python | def url(self, schemes=None):
"""
:param schemes: a list of strings to use as schemes, one will chosen randomly.
If None, it will generate http and https urls.
Passing an empty list will result in schemeless url generation like "://domain.com".
:returns: a random url string.
... | [
"def",
"url",
"(",
"self",
",",
"schemes",
"=",
"None",
")",
":",
"if",
"schemes",
"is",
"None",
":",
"schemes",
"=",
"[",
"'http'",
",",
"'https'",
"]",
"pattern",
"=",
"'{}://{}'",
".",
"format",
"(",
"self",
".",
"random_element",
"(",
"schemes",
... | :param schemes: a list of strings to use as schemes, one will chosen randomly.
If None, it will generate http and https urls.
Passing an empty list will result in schemeless url generation like "://domain.com".
:returns: a random url string. | [
":",
"param",
"schemes",
":",
"a",
"list",
"of",
"strings",
"to",
"use",
"as",
"schemes",
"one",
"will",
"chosen",
"randomly",
".",
"If",
"None",
"it",
"will",
"generate",
"http",
"and",
"https",
"urls",
".",
"Passing",
"an",
"empty",
"list",
"will",
"... | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L236-L252 | train | Generate a random url string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider._random_ipv4_address_from_subnet | def _random_ipv4_address_from_subnet(self, subnet, network=False):
"""
Produces a random IPv4 address or network with a valid CIDR
from within a given subnet.
:param subnet: IPv4Network to choose from within
:param network: Return a network address, and not an IP address
... | python | def _random_ipv4_address_from_subnet(self, subnet, network=False):
"""
Produces a random IPv4 address or network with a valid CIDR
from within a given subnet.
:param subnet: IPv4Network to choose from within
:param network: Return a network address, and not an IP address
... | [
"def",
"_random_ipv4_address_from_subnet",
"(",
"self",
",",
"subnet",
",",
"network",
"=",
"False",
")",
":",
"address",
"=",
"str",
"(",
"subnet",
"[",
"self",
".",
"generator",
".",
"random",
".",
"randint",
"(",
"0",
",",
"subnet",
".",
"num_addresses"... | Produces a random IPv4 address or network with a valid CIDR
from within a given subnet.
:param subnet: IPv4Network to choose from within
:param network: Return a network address, and not an IP address | [
"Produces",
"a",
"random",
"IPv4",
"address",
"or",
"network",
"with",
"a",
"valid",
"CIDR",
"from",
"within",
"a",
"given",
"subnet",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L254-L275 | train | Generates a random IPv4 address or network with a valid CIDR
from within a given subnet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider._exclude_ipv4_networks | def _exclude_ipv4_networks(self, networks, networks_to_exclude):
"""
Exclude the list of networks from another list of networks
and return a flat list of new networks.
:param networks: List of IPv4 networks to exclude from
:param networks_to_exclude: List of IPv4 networks to exc... | python | def _exclude_ipv4_networks(self, networks, networks_to_exclude):
"""
Exclude the list of networks from another list of networks
and return a flat list of new networks.
:param networks: List of IPv4 networks to exclude from
:param networks_to_exclude: List of IPv4 networks to exc... | [
"def",
"_exclude_ipv4_networks",
"(",
"self",
",",
"networks",
",",
"networks_to_exclude",
")",
":",
"for",
"network_to_exclude",
"in",
"networks_to_exclude",
":",
"def",
"_exclude_ipv4_network",
"(",
"network",
")",
":",
"\"\"\"\n Exclude a single network fr... | Exclude the list of networks from another list of networks
and return a flat list of new networks.
:param networks: List of IPv4 networks to exclude from
:param networks_to_exclude: List of IPv4 networks to exclude
:returns: Flat list of IPv4 networks | [
"Exclude",
"the",
"list",
"of",
"networks",
"from",
"another",
"list",
"of",
"networks",
"and",
"return",
"a",
"flat",
"list",
"of",
"new",
"networks",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L277-L318 | train | Returns a list of IPv4 networks from another list of networks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.ipv4 | def ipv4(self, network=False, address_class=None, private=None):
"""
Produce a random IPv4 address or network with a valid CIDR.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:param private: Public or private
:returns: IPv4
... | python | def ipv4(self, network=False, address_class=None, private=None):
"""
Produce a random IPv4 address or network with a valid CIDR.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:param private: Public or private
:returns: IPv4
... | [
"def",
"ipv4",
"(",
"self",
",",
"network",
"=",
"False",
",",
"address_class",
"=",
"None",
",",
"private",
"=",
"None",
")",
":",
"if",
"private",
"is",
"True",
":",
"return",
"self",
".",
"ipv4_private",
"(",
"address_class",
"=",
"address_class",
","... | Produce a random IPv4 address or network with a valid CIDR.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:param private: Public or private
:returns: IPv4 | [
"Produce",
"a",
"random",
"IPv4",
"address",
"or",
"network",
"with",
"a",
"valid",
"CIDR",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L328-L361 | train | Produce a random IPv4 address or network with a valid CIDR. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.ipv4_private | def ipv4_private(self, network=False, address_class=None):
"""
Returns a private IPv4.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:returns: Private IPv4
"""
# compute private networks from given class
supernet = ... | python | def ipv4_private(self, network=False, address_class=None):
"""
Returns a private IPv4.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:returns: Private IPv4
"""
# compute private networks from given class
supernet = ... | [
"def",
"ipv4_private",
"(",
"self",
",",
"network",
"=",
"False",
",",
"address_class",
"=",
"None",
")",
":",
"# compute private networks from given class",
"supernet",
"=",
"_IPv4Constants",
".",
"_network_classes",
"[",
"address_class",
"or",
"self",
".",
"ipv4_n... | Returns a private IPv4.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:returns: Private IPv4 | [
"Returns",
"a",
"private",
"IPv4",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L363-L390 | train | Returns a private IPv4. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.ipv4_public | def ipv4_public(self, network=False, address_class=None):
"""
Returns a public IPv4 excluding private blocks.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:returns: Public IPv4
"""
# compute public networks
public_... | python | def ipv4_public(self, network=False, address_class=None):
"""
Returns a public IPv4 excluding private blocks.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:returns: Public IPv4
"""
# compute public networks
public_... | [
"def",
"ipv4_public",
"(",
"self",
",",
"network",
"=",
"False",
",",
"address_class",
"=",
"None",
")",
":",
"# compute public networks",
"public_networks",
"=",
"[",
"_IPv4Constants",
".",
"_network_classes",
"[",
"address_class",
"or",
"self",
".",
"ipv4_networ... | Returns a public IPv4 excluding private blocks.
:param network: Network address
:param address_class: IPv4 address class (a, b, or c)
:returns: Public IPv4 | [
"Returns",
"a",
"public",
"IPv4",
"excluding",
"private",
"blocks",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L392-L415 | train | Returns a public IPv4 excluding private blocks. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.ipv6 | def ipv6(self, network=False):
"""Produce a random IPv6 address or network with a valid CIDR"""
address = str(ip_address(self.generator.random.randint(
2 ** IPV4LENGTH, (2 ** IPV6LENGTH) - 1)))
if network:
address += '/' + str(self.generator.random.randint(0, IPV6LENGTH))... | python | def ipv6(self, network=False):
"""Produce a random IPv6 address or network with a valid CIDR"""
address = str(ip_address(self.generator.random.randint(
2 ** IPV4LENGTH, (2 ** IPV6LENGTH) - 1)))
if network:
address += '/' + str(self.generator.random.randint(0, IPV6LENGTH))... | [
"def",
"ipv6",
"(",
"self",
",",
"network",
"=",
"False",
")",
":",
"address",
"=",
"str",
"(",
"ip_address",
"(",
"self",
".",
"generator",
".",
"random",
".",
"randint",
"(",
"2",
"**",
"IPV4LENGTH",
",",
"(",
"2",
"**",
"IPV6LENGTH",
")",
"-",
"... | Produce a random IPv6 address or network with a valid CIDR | [
"Produce",
"a",
"random",
"IPv6",
"address",
"or",
"network",
"with",
"a",
"valid",
"CIDR"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L417-L424 | train | Produce a random IPv6 address or network with a valid CIDR | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/providers/internet/__init__.py | Provider.image_url | def image_url(self, width=None, height=None):
"""
Returns URL to placeholder image
Example: http://placehold.it/640x480
"""
width_ = width or self.random_int(max=1024)
height_ = height or self.random_int(max=1024)
placeholder_url = self.random_element(self.image_p... | python | def image_url(self, width=None, height=None):
"""
Returns URL to placeholder image
Example: http://placehold.it/640x480
"""
width_ = width or self.random_int(max=1024)
height_ = height or self.random_int(max=1024)
placeholder_url = self.random_element(self.image_p... | [
"def",
"image_url",
"(",
"self",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
")",
":",
"width_",
"=",
"width",
"or",
"self",
".",
"random_int",
"(",
"max",
"=",
"1024",
")",
"height_",
"=",
"height",
"or",
"self",
".",
"random_int",
"(",
... | Returns URL to placeholder image
Example: http://placehold.it/640x480 | [
"Returns",
"URL",
"to",
"placeholder",
"image",
"Example",
":",
"http",
":",
"//",
"placehold",
".",
"it",
"/",
"640x480"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/__init__.py#L453-L461 | train | Returns a random URL to the image of the given size. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/generator.py | Generator.seed_instance | def seed_instance(self, seed=None):
"""Calls random.seed"""
if self.__random == random:
# create per-instance random obj when first time seed_instance() is
# called
self.__random = random_module.Random()
self.__random.seed(seed)
return self | python | def seed_instance(self, seed=None):
"""Calls random.seed"""
if self.__random == random:
# create per-instance random obj when first time seed_instance() is
# called
self.__random = random_module.Random()
self.__random.seed(seed)
return self | [
"def",
"seed_instance",
"(",
"self",
",",
"seed",
"=",
"None",
")",
":",
"if",
"self",
".",
"__random",
"==",
"random",
":",
"# create per-instance random obj when first time seed_instance() is",
"# called",
"self",
".",
"__random",
"=",
"random_module",
".",
"Rando... | Calls random.seed | [
"Calls",
"random",
".",
"seed"
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/generator.py#L61-L68 | train | Calls random. seed | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
joke2k/faker | faker/generator.py | Generator.format | def format(self, formatter, *args, **kwargs):
"""
This is a secure way to make a fake from another Provider.
"""
# TODO: data export?
return self.get_formatter(formatter)(*args, **kwargs) | python | def format(self, formatter, *args, **kwargs):
"""
This is a secure way to make a fake from another Provider.
"""
# TODO: data export?
return self.get_formatter(formatter)(*args, **kwargs) | [
"def",
"format",
"(",
"self",
",",
"formatter",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# TODO: data export?",
"return",
"self",
".",
"get_formatter",
"(",
"formatter",
")",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | This is a secure way to make a fake from another Provider. | [
"This",
"is",
"a",
"secure",
"way",
"to",
"make",
"a",
"fake",
"from",
"another",
"Provider",
"."
] | 965824b61132e52d92d1a6ce470396dbbe01c96c | https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/generator.py#L74-L79 | train | Format a log entry using the given formatter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
angr/angr | angr/slicer.py | SimSlicer._alias_analysis | def _alias_analysis(self, mock_sp=True, mock_bp=True):
"""
Perform a forward execution and perform alias analysis. Note that this analysis is fast, light-weight, and by no
means complete. For instance, most arithmetic operations are not supported.
- Depending on user settings, stack poi... | python | def _alias_analysis(self, mock_sp=True, mock_bp=True):
"""
Perform a forward execution and perform alias analysis. Note that this analysis is fast, light-weight, and by no
means complete. For instance, most arithmetic operations are not supported.
- Depending on user settings, stack poi... | [
"def",
"_alias_analysis",
"(",
"self",
",",
"mock_sp",
"=",
"True",
",",
"mock_bp",
"=",
"True",
")",
":",
"state",
"=",
"SimLightState",
"(",
"regs",
"=",
"{",
"self",
".",
"_arch",
".",
"sp_offset",
":",
"self",
".",
"_arch",
".",
"initial_sp",
",",
... | Perform a forward execution and perform alias analysis. Note that this analysis is fast, light-weight, and by no
means complete. For instance, most arithmetic operations are not supported.
- Depending on user settings, stack pointer and stack base pointer will be mocked and propagated to individual
... | [
"Perform",
"a",
"forward",
"execution",
"and",
"perform",
"alias",
"analysis",
".",
"Note",
"that",
"this",
"analysis",
"is",
"fast",
"light",
"-",
"weight",
"and",
"by",
"no",
"means",
"complete",
".",
"For",
"instance",
"most",
"arithmetic",
"operations",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/slicer.py#L56-L82 | train | Perform a forward execution and perform alias analysis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
angr/angr | angr/slicer.py | SimSlicer._slice | def _slice(self):
"""
Slice it!
"""
regs = set(self._target_regs)
tmps = set(self._target_tmps)
stack_offsets = set(self._target_stack_offsets)
state = SimLightState(regs=regs, temps=tmps, stack_offsets=stack_offsets)
for stmt_idx, stmt in reversed(list... | python | def _slice(self):
"""
Slice it!
"""
regs = set(self._target_regs)
tmps = set(self._target_tmps)
stack_offsets = set(self._target_stack_offsets)
state = SimLightState(regs=regs, temps=tmps, stack_offsets=stack_offsets)
for stmt_idx, stmt in reversed(list... | [
"def",
"_slice",
"(",
"self",
")",
":",
"regs",
"=",
"set",
"(",
"self",
".",
"_target_regs",
")",
"tmps",
"=",
"set",
"(",
"self",
".",
"_target_tmps",
")",
"stack_offsets",
"=",
"set",
"(",
"self",
".",
"_target_stack_offsets",
")",
"state",
"=",
"Si... | Slice it! | [
"Slice",
"it!"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/slicer.py#L176-L199 | train | Slice the internal state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
angr/angr | angr/simos/linux.py | SimLinux.prepare_function_symbol | def prepare_function_symbol(self, symbol_name, basic_addr=None):
"""
Prepare the address space with the data necessary to perform relocations pointing to the given symbol.
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation ... | python | def prepare_function_symbol(self, symbol_name, basic_addr=None):
"""
Prepare the address space with the data necessary to perform relocations pointing to the given symbol.
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation ... | [
"def",
"prepare_function_symbol",
"(",
"self",
",",
"symbol_name",
",",
"basic_addr",
"=",
"None",
")",
":",
"if",
"self",
".",
"project",
".",
"loader",
".",
"main_object",
".",
"is_ppc64_abiv1",
":",
"if",
"basic_addr",
"is",
"not",
"None",
":",
"pointer",... | Prepare the address space with the data necessary to perform relocations pointing to the given symbol.
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation target. | [
"Prepare",
"the",
"address",
"space",
"with",
"the",
"data",
"necessary",
"to",
"perform",
"relocations",
"pointing",
"to",
"the",
"given",
"symbol",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/linux.py#L326-L346 | train | Prepares the address space with the data necessary to perform relocations pointing to the given symbol. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.