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
saltstack/salt
salt/returners/postgres_local_cache.py
get_load
def get_load(jid): ''' Return the load data that marks a specified jid ''' jid = _escape_jid(jid) conn = _get_conn() if conn is None: return None cur = conn.cursor() sql = '''SELECT jid, tgt_type, cmd, tgt, kwargs, ret, username, arg,''' \ ''' fun FROM jids WHERE jid = ...
python
def get_load(jid): ''' Return the load data that marks a specified jid ''' jid = _escape_jid(jid) conn = _get_conn() if conn is None: return None cur = conn.cursor() sql = '''SELECT jid, tgt_type, cmd, tgt, kwargs, ret, username, arg,''' \ ''' fun FROM jids WHERE jid = ...
[ "def", "get_load", "(", "jid", ")", ":", "jid", "=", "_escape_jid", "(", "jid", ")", "conn", "=", "_get_conn", "(", ")", "if", "conn", "is", "None", ":", "return", "None", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''SELECT jid, tgt_t...
Return the load data that marks a specified jid
[ "Return", "the", "load", "data", "that", "marks", "a", "specified", "jid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/postgres_local_cache.py#L343-L359
train
Return the load data that marks a specified jid
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...
saltstack/salt
salt/returners/postgres_local_cache.py
get_jid
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' jid = _escape_jid(jid) conn = _get_conn() if conn is None: return None cur = conn.cursor() sql = '''SELECT id, return FROM salt_returns WHERE jid = %s''' cur.execute(sql, (jid,))...
python
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' jid = _escape_jid(jid) conn = _get_conn() if conn is None: return None cur = conn.cursor() sql = '''SELECT id, return FROM salt_returns WHERE jid = %s''' cur.execute(sql, (jid,))...
[ "def", "get_jid", "(", "jid", ")", ":", "jid", "=", "_escape_jid", "(", "jid", ")", "conn", "=", "_get_conn", "(", ")", "if", "conn", "is", "None", ":", "return", "None", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''SELECT id, return ...
Return the information returned when the specified job id was executed
[ "Return", "the", "information", "returned", "when", "the", "specified", "job", "id", "was", "executed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/postgres_local_cache.py#L362-L385
train
Return the information returned when the specified job id was executed
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...
saltstack/salt
salt/returners/postgres_local_cache.py
get_jids
def get_jids(): ''' Return a list of all job ids For master job cache this also formats the output and returns a string ''' conn = _get_conn() cur = conn.cursor() sql = '''SELECT ''' \ '''jid, tgt_type, cmd, tgt, kwargs, ret, username, arg, fun ''' \ '''FROM jids''' i...
python
def get_jids(): ''' Return a list of all job ids For master job cache this also formats the output and returns a string ''' conn = _get_conn() cur = conn.cursor() sql = '''SELECT ''' \ '''jid, tgt_type, cmd, tgt, kwargs, ret, username, arg, fun ''' \ '''FROM jids''' i...
[ "def", "get_jids", "(", ")", ":", "conn", "=", "_get_conn", "(", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "sql", "=", "'''SELECT '''", "'''jid, tgt_type, cmd, tgt, kwargs, ret, username, arg, fun '''", "'''FROM jids'''", "if", "__opts__", "[", "'keep_jobs'"...
Return a list of all job ids For master job cache this also formats the output and returns a string
[ "Return", "a", "list", "of", "all", "job", "ids", "For", "master", "job", "cache", "this", "also", "formats", "the", "output", "and", "returns", "a", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/postgres_local_cache.py#L388-L412
train
Return a list of all job ids For master job cache this also formats the output and returns a string For master job cache this also formats the output and returns a 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...
saltstack/salt
salt/modules/aix_shadow.py
login_failures
def login_failures(user): ''' Query for all accounts which have 3 or more login failures. CLI Example: .. code-block:: bash salt <minion_id> shadow.login_failures ALL ''' cmd = 'lsuser -a unsuccessful_login_count {0}'.format(user) cmd += " | grep -E 'unsuccessful_login_count=([3...
python
def login_failures(user): ''' Query for all accounts which have 3 or more login failures. CLI Example: .. code-block:: bash salt <minion_id> shadow.login_failures ALL ''' cmd = 'lsuser -a unsuccessful_login_count {0}'.format(user) cmd += " | grep -E 'unsuccessful_login_count=([3...
[ "def", "login_failures", "(", "user", ")", ":", "cmd", "=", "'lsuser -a unsuccessful_login_count {0}'", ".", "format", "(", "user", ")", "cmd", "+=", "\" | grep -E 'unsuccessful_login_count=([3-9]|[0-9][0-9]+)'\"", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(",...
Query for all accounts which have 3 or more login failures. CLI Example: .. code-block:: bash salt <minion_id> shadow.login_failures ALL
[ "Query", "for", "all", "accounts", "which", "have", "3", "or", "more", "login", "failures", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_shadow.py#L32-L54
train
Query for all accounts which have 3 or more login failures.
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...
saltstack/salt
salt/modules/aix_shadow.py
unlock
def unlock(user): ''' Unlock user for locked account CLI Example: .. code-block:: bash salt <minion_id> shadow.unlock user ''' cmd = 'chuser account_locked=false {0} | ' \ 'chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s {0}'.format(user) ret = __salt_...
python
def unlock(user): ''' Unlock user for locked account CLI Example: .. code-block:: bash salt <minion_id> shadow.unlock user ''' cmd = 'chuser account_locked=false {0} | ' \ 'chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s {0}'.format(user) ret = __salt_...
[ "def", "unlock", "(", "user", ")", ":", "cmd", "=", "'chuser account_locked=false {0} | '", "'chsec -f /etc/security/lastlog -a \"unsuccessful_login_count=0\" -s {0}'", ".", "format", "(", "user", ")", "ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", ...
Unlock user for locked account CLI Example: .. code-block:: bash salt <minion_id> shadow.unlock user
[ "Unlock", "user", "for", "locked", "account" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_shadow.py#L81-L96
train
Unlock user for locked account
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...
saltstack/salt
salt/states/opsgenie.py
create_alert
def create_alert(name=None, api_key=None, reason=None, action_type="Create"): ''' Create an alert in OpsGenie. Example usage with Salt's requisites and other global state arguments could be found above. Required Parameters: api_key It's the API Key you've copied while adding integration in...
python
def create_alert(name=None, api_key=None, reason=None, action_type="Create"): ''' Create an alert in OpsGenie. Example usage with Salt's requisites and other global state arguments could be found above. Required Parameters: api_key It's the API Key you've copied while adding integration in...
[ "def", "create_alert", "(", "name", "=", "None", ",", "api_key", "=", "None", ",", "reason", "=", "None", ",", "action_type", "=", "\"Create\"", ")", ":", "_", ",", "_", ",", "_", ",", "values", "=", "inspect", ".", "getargvalues", "(", "inspect", "....
Create an alert in OpsGenie. Example usage with Salt's requisites and other global state arguments could be found above. Required Parameters: api_key It's the API Key you've copied while adding integration in OpsGenie. reason It will be used as alert's default message in OpsGenie. ...
[ "Create", "an", "alert", "in", "OpsGenie", ".", "Example", "usage", "with", "Salt", "s", "requisites", "and", "other", "global", "state", "arguments", "could", "be", "found", "above", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/opsgenie.py#L46-L119
train
Create an alert in OpsGenie.
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...
saltstack/salt
salt/states/opsgenie.py
close_alert
def close_alert(name=None, api_key=None, reason="Conditions are met.", action_type="Close"): ''' Close an alert in OpsGenie. It's a wrapper function for create_alert. Example usage with Salt's requisites and other global state arguments could be found above. Required Parameters: ...
python
def close_alert(name=None, api_key=None, reason="Conditions are met.", action_type="Close"): ''' Close an alert in OpsGenie. It's a wrapper function for create_alert. Example usage with Salt's requisites and other global state arguments could be found above. Required Parameters: ...
[ "def", "close_alert", "(", "name", "=", "None", ",", "api_key", "=", "None", ",", "reason", "=", "\"Conditions are met.\"", ",", "action_type", "=", "\"Close\"", ")", ":", "if", "name", "is", "None", ":", "raise", "salt", ".", "exceptions", ".", "SaltInvoc...
Close an alert in OpsGenie. It's a wrapper function for create_alert. Example usage with Salt's requisites and other global state arguments could be found above. Required Parameters: name It will be used as alert's alias. If you want to use the close functionality you must provide name...
[ "Close", "an", "alert", "in", "OpsGenie", ".", "It", "s", "a", "wrapper", "function", "for", "create_alert", ".", "Example", "usage", "with", "Salt", "s", "requisites", "and", "other", "global", "state", "arguments", "could", "be", "found", "above", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/opsgenie.py#L122-L153
train
This function closes an alert in OpsGenie. It returns a new alert with the given name and API Key.
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...
saltstack/salt
salt/states/probes.py
_expand_probes
def _expand_probes(probes, defaults): ''' Updates the probes dictionary with different levels of default values. ''' expected_probes = {} for probe_name, probe_test in six.iteritems(probes): if probe_name not in expected_probes.keys(): expected_probes[probe_name] = {} ...
python
def _expand_probes(probes, defaults): ''' Updates the probes dictionary with different levels of default values. ''' expected_probes = {} for probe_name, probe_test in six.iteritems(probes): if probe_name not in expected_probes.keys(): expected_probes[probe_name] = {} ...
[ "def", "_expand_probes", "(", "probes", ",", "defaults", ")", ":", "expected_probes", "=", "{", "}", "for", "probe_name", ",", "probe_test", "in", "six", ".", "iteritems", "(", "probes", ")", ":", "if", "probe_name", "not", "in", "expected_probes", ".", "k...
Updates the probes dictionary with different levels of default values.
[ "Updates", "the", "probes", "dictionary", "with", "different", "levels", "of", "default", "values", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/probes.py#L84-L105
train
Expand the probes dictionary with different levels of default 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...
saltstack/salt
salt/states/probes.py
_clean_probes
def _clean_probes(probes): ''' Will remove empty and useless values from the probes dictionary. ''' probes = _ordered_dict_to_dict(probes) # make sure we are working only with dict-type probes_copy = deepcopy(probes) for probe_name, probe_tests in six.iteritems(probes_copy): if not pr...
python
def _clean_probes(probes): ''' Will remove empty and useless values from the probes dictionary. ''' probes = _ordered_dict_to_dict(probes) # make sure we are working only with dict-type probes_copy = deepcopy(probes) for probe_name, probe_tests in six.iteritems(probes_copy): if not pr...
[ "def", "_clean_probes", "(", "probes", ")", ":", "probes", "=", "_ordered_dict_to_dict", "(", "probes", ")", "# make sure we are working only with dict-type", "probes_copy", "=", "deepcopy", "(", "probes", ")", "for", "probe_name", ",", "probe_tests", "in", "six", "...
Will remove empty and useless values from the probes dictionary.
[ "Will", "remove", "empty", "and", "useless", "values", "from", "the", "probes", "dictionary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/probes.py#L108-L126
train
Clean up the probes dictionary.
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...
saltstack/salt
salt/states/probes.py
_compare_probes
def _compare_probes(configured_probes, expected_probes): ''' Compares configured probes on the device with the expected configuration and returns the differences. ''' new_probes = {} update_probes = {} remove_probes = {} # noth configured => configure with expected probes if not confi...
python
def _compare_probes(configured_probes, expected_probes): ''' Compares configured probes on the device with the expected configuration and returns the differences. ''' new_probes = {} update_probes = {} remove_probes = {} # noth configured => configure with expected probes if not confi...
[ "def", "_compare_probes", "(", "configured_probes", ",", "expected_probes", ")", ":", "new_probes", "=", "{", "}", "update_probes", "=", "{", "}", "remove_probes", "=", "{", "}", "# noth configured => configure with expected probes", "if", "not", "configured_probes", ...
Compares configured probes on the device with the expected configuration and returns the differences.
[ "Compares", "configured", "probes", "on", "the", "device", "with", "the", "expected", "configuration", "and", "returns", "the", "differences", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/probes.py#L129-L201
train
Compares the probes on the device with the expected probes on the device and returns the differences.
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...
saltstack/salt
salt/states/probes.py
managed
def managed(name, probes, defaults=None): ''' Ensure the networks device is configured as specified in the state SLS file. Probes not specified will be removed, while probes not confiured as expected will trigger config updates. :param probes: Defines the probes as expected to be configured on the ...
python
def managed(name, probes, defaults=None): ''' Ensure the networks device is configured as specified in the state SLS file. Probes not specified will be removed, while probes not confiured as expected will trigger config updates. :param probes: Defines the probes as expected to be configured on the ...
[ "def", "managed", "(", "name", ",", "probes", ",", "defaults", "=", "None", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "result", "=", "True", "comment", "=", "''", "rpm_probes_config", "=", "_retrieve_rpm_probes", "(", ")", "# retrieves the RPM ...
Ensure the networks device is configured as specified in the state SLS file. Probes not specified will be removed, while probes not confiured as expected will trigger config updates. :param probes: Defines the probes as expected to be configured on the device. In order to ease the configuration and av...
[ "Ensure", "the", "networks", "device", "is", "configured", "as", "specified", "in", "the", "state", "SLS", "file", ".", "Probes", "not", "specified", "will", "be", "removed", "while", "probes", "not", "confiured", "as", "expected", "will", "trigger", "config",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/probes.py#L252-L454
train
This function is used to configure the state SLS file for a given logical interface.
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...
saltstack/salt
salt/returners/smtp_return.py
returner
def returner(ret): ''' Send an email with the data ''' _options = _get_options(ret) from_addr = _options.get('from') to_addrs = _options.get('to').split(',') host = _options.get('host') port = _options.get('port') user = _options.get('username') passwd = _options.get('password')...
python
def returner(ret): ''' Send an email with the data ''' _options = _get_options(ret) from_addr = _options.get('from') to_addrs = _options.get('to').split(',') host = _options.get('host') port = _options.get('port') user = _options.get('username') passwd = _options.get('password')...
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "from_addr", "=", "_options", ".", "get", "(", "'from'", ")", "to_addrs", "=", "_options", ".", "get", "(", "'to'", ")", ".", "split", "(", "','", ")", "host",...
Send an email with the data
[ "Send", "an", "email", "with", "the", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/smtp_return.py#L163-L260
train
Send an email with the data
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...
saltstack/salt
salt/returners/smtp_return.py
event_return
def event_return(events): ''' Return event data via SMTP ''' for event in events: ret = event.get('data', False) if ret: returner(ret)
python
def event_return(events): ''' Return event data via SMTP ''' for event in events: ret = event.get('data', False) if ret: returner(ret)
[ "def", "event_return", "(", "events", ")", ":", "for", "event", "in", "events", ":", "ret", "=", "event", ".", "get", "(", "'data'", ",", "False", ")", "if", "ret", ":", "returner", "(", "ret", ")" ]
Return event data via SMTP
[ "Return", "event", "data", "via", "SMTP" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/smtp_return.py#L270-L279
train
Return event data via SMTP
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...
saltstack/salt
salt/modules/incron.py
_render_tab
def _render_tab(lst): ''' Takes a tab list structure and renders it to a list for applying it to a file ''' ret = [] for pre in lst['pre']: ret.append('{0}\n'.format(pre)) for cron in lst['crons']: ret.append('{0} {1} {2} {3}\n'.format(cron['path'], ...
python
def _render_tab(lst): ''' Takes a tab list structure and renders it to a list for applying it to a file ''' ret = [] for pre in lst['pre']: ret.append('{0}\n'.format(pre)) for cron in lst['crons']: ret.append('{0} {1} {2} {3}\n'.format(cron['path'], ...
[ "def", "_render_tab", "(", "lst", ")", ":", "ret", "=", "[", "]", "for", "pre", "in", "lst", "[", "'pre'", "]", ":", "ret", ".", "append", "(", "'{0}\\n'", ".", "format", "(", "pre", ")", ")", "for", "cron", "in", "lst", "[", "'crons'", "]", ":...
Takes a tab list structure and renders it to a list for applying it to a file
[ "Takes", "a", "tab", "list", "structure", "and", "renders", "it", "to", "a", "list", "for", "applying", "it", "to", "a", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L47-L62
train
Takes a tab list structure and renders it to a list for applying it to a 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...
saltstack/salt
salt/modules/incron.py
write_incron_file
def write_incron_file(user, path): ''' Writes the contents of a file to a user's incrontab CLI Example: .. code-block:: bash salt '*' incron.write_incron_file root /tmp/new_incron ''' return __salt__['cmd.retcode'](_get_incron_cmdstr(path), runas=user, python_shell=False) == 0
python
def write_incron_file(user, path): ''' Writes the contents of a file to a user's incrontab CLI Example: .. code-block:: bash salt '*' incron.write_incron_file root /tmp/new_incron ''' return __salt__['cmd.retcode'](_get_incron_cmdstr(path), runas=user, python_shell=False) == 0
[ "def", "write_incron_file", "(", "user", ",", "path", ")", ":", "return", "__salt__", "[", "'cmd.retcode'", "]", "(", "_get_incron_cmdstr", "(", "path", ")", ",", "runas", "=", "user", ",", "python_shell", "=", "False", ")", "==", "0" ]
Writes the contents of a file to a user's incrontab CLI Example: .. code-block:: bash salt '*' incron.write_incron_file root /tmp/new_incron
[ "Writes", "the", "contents", "of", "a", "file", "to", "a", "user", "s", "incrontab" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L72-L82
train
Writes the contents of a file to a user s incrontab CLI 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...
saltstack/salt
salt/modules/incron.py
write_incron_file_verbose
def write_incron_file_verbose(user, path): ''' Writes the contents of a file to a user's incrontab and return error message on error CLI Example: .. code-block:: bash salt '*' incron.write_incron_file_verbose root /tmp/new_incron ''' return __salt__['cmd.run_all'](_get_incron_cmdstr(p...
python
def write_incron_file_verbose(user, path): ''' Writes the contents of a file to a user's incrontab and return error message on error CLI Example: .. code-block:: bash salt '*' incron.write_incron_file_verbose root /tmp/new_incron ''' return __salt__['cmd.run_all'](_get_incron_cmdstr(p...
[ "def", "write_incron_file_verbose", "(", "user", ",", "path", ")", ":", "return", "__salt__", "[", "'cmd.run_all'", "]", "(", "_get_incron_cmdstr", "(", "path", ")", ",", "runas", "=", "user", ",", "python_shell", "=", "False", ")" ]
Writes the contents of a file to a user's incrontab and return error message on error CLI Example: .. code-block:: bash salt '*' incron.write_incron_file_verbose root /tmp/new_incron
[ "Writes", "the", "contents", "of", "a", "file", "to", "a", "user", "s", "incrontab", "and", "return", "error", "message", "on", "error" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L85-L95
train
Writes the contents of a file to a user s incrontab and returns error message on error
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...
saltstack/salt
salt/modules/incron.py
_write_incron_lines
def _write_incron_lines(user, lines): ''' Takes a list of lines to be committed to a user's incrontab and writes it ''' if user == 'system': ret = {} ret['retcode'] = _write_file(_INCRON_SYSTEM_TAB, 'salt', ''.join(lines)) return ret else: path = salt.utils.files.mkst...
python
def _write_incron_lines(user, lines): ''' Takes a list of lines to be committed to a user's incrontab and writes it ''' if user == 'system': ret = {} ret['retcode'] = _write_file(_INCRON_SYSTEM_TAB, 'salt', ''.join(lines)) return ret else: path = salt.utils.files.mkst...
[ "def", "_write_incron_lines", "(", "user", ",", "lines", ")", ":", "if", "user", "==", "'system'", ":", "ret", "=", "{", "}", "ret", "[", "'retcode'", "]", "=", "_write_file", "(", "_INCRON_SYSTEM_TAB", ",", "'salt'", ",", "''", ".", "join", "(", "line...
Takes a list of lines to be committed to a user's incrontab and writes it
[ "Takes", "a", "list", "of", "lines", "to", "be", "committed", "to", "a", "user", "s", "incrontab", "and", "writes", "it" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L98-L114
train
Writes a list of lines to a user s incrontab and returns the path to the new incrontab
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...
saltstack/salt
salt/modules/incron.py
_write_file
def _write_file(folder, filename, data): ''' Writes a file to disk ''' path = os.path.join(folder, filename) if not os.path.exists(folder): msg = '{0} cannot be written. {1} does not exist'.format(filename, folder) log.error(msg) raise AttributeError(six.text_type(msg)) w...
python
def _write_file(folder, filename, data): ''' Writes a file to disk ''' path = os.path.join(folder, filename) if not os.path.exists(folder): msg = '{0} cannot be written. {1} does not exist'.format(filename, folder) log.error(msg) raise AttributeError(six.text_type(msg)) w...
[ "def", "_write_file", "(", "folder", ",", "filename", ",", "data", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "folder", ",", "filename", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "folder", ")", ":", "msg", "=", "'{...
Writes a file to disk
[ "Writes", "a", "file", "to", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L117-L129
train
Writes a file to disk
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...
saltstack/salt
salt/modules/incron.py
_read_file
def _read_file(folder, filename): ''' Reads and returns the contents of a file ''' path = os.path.join(folder, filename) try: with salt.utils.files.fopen(path, 'rb') as contents: return salt.utils.data.decode(contents.readlines()) except (OSError, IOError): return ''
python
def _read_file(folder, filename): ''' Reads and returns the contents of a file ''' path = os.path.join(folder, filename) try: with salt.utils.files.fopen(path, 'rb') as contents: return salt.utils.data.decode(contents.readlines()) except (OSError, IOError): return ''
[ "def", "_read_file", "(", "folder", ",", "filename", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "folder", ",", "filename", ")", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'rb'", ")", ...
Reads and returns the contents of a file
[ "Reads", "and", "returns", "the", "contents", "of", "a", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L132-L141
train
Reads and returns the contents of a 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...
saltstack/salt
salt/modules/incron.py
raw_incron
def raw_incron(user): ''' Return the contents of the user's incrontab CLI Example: .. code-block:: bash salt '*' incron.raw_incron root ''' if __grains__['os_family'] == 'Solaris': cmd = 'incrontab -l {0}'.format(user) else: cmd = 'incrontab -l -u {0}'.format(user)...
python
def raw_incron(user): ''' Return the contents of the user's incrontab CLI Example: .. code-block:: bash salt '*' incron.raw_incron root ''' if __grains__['os_family'] == 'Solaris': cmd = 'incrontab -l {0}'.format(user) else: cmd = 'incrontab -l -u {0}'.format(user)...
[ "def", "raw_incron", "(", "user", ")", ":", "if", "__grains__", "[", "'os_family'", "]", "==", "'Solaris'", ":", "cmd", "=", "'incrontab -l {0}'", ".", "format", "(", "user", ")", "else", ":", "cmd", "=", "'incrontab -l -u {0}'", ".", "format", "(", "user"...
Return the contents of the user's incrontab CLI Example: .. code-block:: bash salt '*' incron.raw_incron root
[ "Return", "the", "contents", "of", "the", "user", "s", "incrontab" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L159-L173
train
Return the contents of the user s incrontab CLI Example : incrontab
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...
saltstack/salt
salt/modules/incron.py
list_tab
def list_tab(user): ''' Return the contents of the specified user's incrontab CLI Example: .. code-block:: bash salt '*' incron.list_tab root ''' if user == 'system': data = raw_system_incron() else: data = raw_incron(user) log.debug('incron user data %s', ...
python
def list_tab(user): ''' Return the contents of the specified user's incrontab CLI Example: .. code-block:: bash salt '*' incron.list_tab root ''' if user == 'system': data = raw_system_incron() else: data = raw_incron(user) log.debug('incron user data %s', ...
[ "def", "list_tab", "(", "user", ")", ":", "if", "user", "==", "'system'", ":", "data", "=", "raw_system_incron", "(", ")", "else", ":", "data", "=", "raw_incron", "(", "user", ")", "log", ".", "debug", "(", "'incron user data %s'", ",", "data", ")", "r...
Return the contents of the specified user's incrontab CLI Example: .. code-block:: bash salt '*' incron.list_tab root
[ "Return", "the", "contents", "of", "the", "specified", "user", "s", "incrontab" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L176-L214
train
Return the contents of the specified user s incrontab CLI Example : bash WorkItem salt '*' incrontab WorkItem. list_tab user
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...
saltstack/salt
salt/modules/incron.py
set_job
def set_job(user, path, mask, cmd): ''' Sets an incron job up for a specified user. CLI Example: .. code-block:: bash salt '*' incron.set_job root '/root' 'IN_MODIFY' 'echo "$$ $@ $# $% $&"' ''' # Scrub the types mask = six.text_type(mask).upper() # Check for valid mask types...
python
def set_job(user, path, mask, cmd): ''' Sets an incron job up for a specified user. CLI Example: .. code-block:: bash salt '*' incron.set_job root '/root' 'IN_MODIFY' 'echo "$$ $@ $# $% $&"' ''' # Scrub the types mask = six.text_type(mask).upper() # Check for valid mask types...
[ "def", "set_job", "(", "user", ",", "path", ",", "mask", ",", "cmd", ")", ":", "# Scrub the types", "mask", "=", "six", ".", "text_type", "(", "mask", ")", ".", "upper", "(", ")", "# Check for valid mask types", "for", "item", "in", "mask", ".", "split",...
Sets an incron job up for a specified user. CLI Example: .. code-block:: bash salt '*' incron.set_job root '/root' 'IN_MODIFY' 'echo "$$ $@ $# $% $&"'
[ "Sets", "an", "incron", "job", "up", "for", "a", "specified", "user", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L221-L276
train
Sets an incron job up for a user.
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...
saltstack/salt
salt/modules/incron.py
rm_job
def rm_job(user, path, mask, cmd): ''' Remove a incron job for a specified user. If any of the day/time params are specified, the job will only be removed if the specified params match. CLI Example: .. code-block:: bash salt '*' incron.rm_job root /path ...
python
def rm_job(user, path, mask, cmd): ''' Remove a incron job for a specified user. If any of the day/time params are specified, the job will only be removed if the specified params match. CLI Example: .. code-block:: bash salt '*' incron.rm_job root /path ...
[ "def", "rm_job", "(", "user", ",", "path", ",", "mask", ",", "cmd", ")", ":", "# Scrub the types", "mask", "=", "six", ".", "text_type", "(", "mask", ")", ".", "upper", "(", ")", "# Check for valid mask types", "for", "item", "in", "mask", ".", "split", ...
Remove a incron job for a specified user. If any of the day/time params are specified, the job will only be removed if the specified params match. CLI Example: .. code-block:: bash salt '*' incron.rm_job root /path
[ "Remove", "a", "incron", "job", "for", "a", "specified", "user", ".", "If", "any", "of", "the", "day", "/", "time", "params", "are", "specified", "the", "job", "will", "only", "be", "removed", "if", "the", "specified", "params", "match", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/incron.py#L279-L320
train
Remove a incron job for a specified user.
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...
saltstack/salt
salt/engines/ircbot.py
start
def start(nick, host, port=6667, username=None, password=None, channels=None, use_ssl=False, use_sasl=False, char='!', allow_hosts=False, allow_nicks=False, disable_query=True): ''' IRC Bot for interacting with salt. nick Nickname of the connected Bot. host irc server (exampl...
python
def start(nick, host, port=6667, username=None, password=None, channels=None, use_ssl=False, use_sasl=False, char='!', allow_hosts=False, allow_nicks=False, disable_query=True): ''' IRC Bot for interacting with salt. nick Nickname of the connected Bot. host irc server (exampl...
[ "def", "start", "(", "nick", ",", "host", ",", "port", "=", "6667", ",", "username", "=", "None", ",", "password", "=", "None", ",", "channels", "=", "None", ",", "use_ssl", "=", "False", ",", "use_sasl", "=", "False", ",", "char", "=", "'!'", ",",...
IRC Bot for interacting with salt. nick Nickname of the connected Bot. host irc server (example - chat.freenode.net). port irc port. Default: 6667 password password for authenticating. If not provided, user will not authenticate on the irc server. channels ...
[ "IRC", "Bot", "for", "interacting", "with", "salt", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/ircbot.py#L225-L285
train
Start a new bot with the given parameters.
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...
saltstack/salt
salt/modules/suse_apache.py
check_mod_enabled
def check_mod_enabled(mod): ''' Checks to see if the specific apache mod is enabled. This will only be functional on operating systems that support `a2enmod -l` to list the enabled mods. CLI Example: .. code-block:: bash salt '*' apache.check_mod_enabled status ''' if mod.end...
python
def check_mod_enabled(mod): ''' Checks to see if the specific apache mod is enabled. This will only be functional on operating systems that support `a2enmod -l` to list the enabled mods. CLI Example: .. code-block:: bash salt '*' apache.check_mod_enabled status ''' if mod.end...
[ "def", "check_mod_enabled", "(", "mod", ")", ":", "if", "mod", ".", "endswith", "(", "'.load'", ")", "or", "mod", ".", "endswith", "(", "'.conf'", ")", ":", "mod_name", "=", "mod", "[", ":", "-", "5", "]", "else", ":", "mod_name", "=", "mod", "cmd"...
Checks to see if the specific apache mod is enabled. This will only be functional on operating systems that support `a2enmod -l` to list the enabled mods. CLI Example: .. code-block:: bash salt '*' apache.check_mod_enabled status
[ "Checks", "to", "see", "if", "the", "specific", "apache", "mod", "is", "enabled", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/suse_apache.py#L31-L55
train
Checks to see if apache mod is enabled.
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...
saltstack/salt
salt/modules/boto_kms.py
create_alias
def create_alias(alias_name, target_key_id, region=None, key=None, keyid=None, profile=None): ''' Create a display name for a key. CLI example:: salt myminion boto_kms.create_alias 'alias/mykey' key_id ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profi...
python
def create_alias(alias_name, target_key_id, region=None, key=None, keyid=None, profile=None): ''' Create a display name for a key. CLI example:: salt myminion boto_kms.create_alias 'alias/mykey' key_id ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profi...
[ "def", "create_alias", "(", "alias_name", ",", "target_key_id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", ...
Create a display name for a key. CLI example:: salt myminion boto_kms.create_alias 'alias/mykey' key_id
[ "Create", "a", "display", "name", "for", "a", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L80-L98
train
Create an alias for a key.
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...
saltstack/salt
salt/modules/boto_kms.py
create_grant
def create_grant(key_id, grantee_principal, retiring_principal=None, operations=None, constraints=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Adds a grant to a key to specify who can access the key and under what conditions. CLI examp...
python
def create_grant(key_id, grantee_principal, retiring_principal=None, operations=None, constraints=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Adds a grant to a key to specify who can access the key and under what conditions. CLI examp...
[ "def", "create_grant", "(", "key_id", ",", "grantee_principal", ",", "retiring_principal", "=", "None", ",", "operations", "=", "None", ",", "constraints", "=", "None", ",", "grant_tokens", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ...
Adds a grant to a key to specify who can access the key and under what conditions. CLI example:: salt myminion boto_kms.create_grant 'alias/mykey' 'arn:aws:iam::1111111:/role/myrole' operations='["Encrypt","Decrypt"]'
[ "Adds", "a", "grant", "to", "a", "key", "to", "specify", "who", "can", "access", "the", "key", "and", "under", "what", "conditions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L101-L128
train
Creates a grant for a key.
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...
saltstack/salt
salt/modules/boto_kms.py
create_key
def create_key(policy=None, description=None, key_usage=None, region=None, key=None, keyid=None, profile=None): ''' Creates a master key. CLI example:: salt myminion boto_kms.create_key '{"Statement":...}' "My master key" ''' conn = _get_conn(region=region, key=key, keyid=ke...
python
def create_key(policy=None, description=None, key_usage=None, region=None, key=None, keyid=None, profile=None): ''' Creates a master key. CLI example:: salt myminion boto_kms.create_key '{"Statement":...}' "My master key" ''' conn = _get_conn(region=region, key=key, keyid=ke...
[ "def", "create_key", "(", "policy", "=", "None", ",", "description", "=", "None", ",", "key_usage", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_g...
Creates a master key. CLI example:: salt myminion boto_kms.create_key '{"Statement":...}' "My master key"
[ "Creates", "a", "master", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L131-L153
train
Create a master key.
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...
saltstack/salt
salt/modules/boto_kms.py
decrypt
def decrypt(ciphertext_blob, encryption_context=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Decrypt ciphertext. CLI example:: salt myminion boto_kms.decrypt encrypted_ciphertext ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile...
python
def decrypt(ciphertext_blob, encryption_context=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Decrypt ciphertext. CLI example:: salt myminion boto_kms.decrypt encrypted_ciphertext ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile...
[ "def", "decrypt", "(", "ciphertext_blob", ",", "encryption_context", "=", "None", ",", "grant_tokens", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_ge...
Decrypt ciphertext. CLI example:: salt myminion boto_kms.decrypt encrypted_ciphertext
[ "Decrypt", "ciphertext", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L156-L177
train
Decrypt ciphertext.
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...
saltstack/salt
salt/modules/boto_kms.py
key_exists
def key_exists(key_id, region=None, key=None, keyid=None, profile=None): ''' Check for the existence of a key. CLI example:: salt myminion boto_kms.key_exists 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) r = {} try: key = conn.de...
python
def key_exists(key_id, region=None, key=None, keyid=None, profile=None): ''' Check for the existence of a key. CLI example:: salt myminion boto_kms.key_exists 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) r = {} try: key = conn.de...
[ "def", "key_exists", "(", "key_id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid",...
Check for the existence of a key. CLI example:: salt myminion boto_kms.key_exists 'alias/mykey'
[ "Check", "for", "the", "existence", "of", "a", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L180-L200
train
Check for the existence of a key.
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...
saltstack/salt
salt/modules/boto_kms.py
_get_key_id
def _get_key_id(alias, region=None, key=None, keyid=None, profile=None): ''' From an alias, get a key_id. ''' key_metadata = describe_key( alias, region, key, keyid, profile )['key_metadata'] return key_metadata['KeyId']
python
def _get_key_id(alias, region=None, key=None, keyid=None, profile=None): ''' From an alias, get a key_id. ''' key_metadata = describe_key( alias, region, key, keyid, profile )['key_metadata'] return key_metadata['KeyId']
[ "def", "_get_key_id", "(", "alias", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "key_metadata", "=", "describe_key", "(", "alias", ",", "region", ",", "key", ",", "keyid", ","...
From an alias, get a key_id.
[ "From", "an", "alias", "get", "a", "key_id", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L203-L210
train
Get a key_id from an alias get a key_id.
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...
saltstack/salt
salt/modules/boto_kms.py
disable_key
def disable_key(key_id, region=None, key=None, keyid=None, profile=None): ''' Mark key as disabled. CLI example:: salt myminion boto_kms.disable_key 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) r = {} try: key = conn.disable_key(...
python
def disable_key(key_id, region=None, key=None, keyid=None, profile=None): ''' Mark key as disabled. CLI example:: salt myminion boto_kms.disable_key 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) r = {} try: key = conn.disable_key(...
[ "def", "disable_key", "(", "key_id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid"...
Mark key as disabled. CLI example:: salt myminion boto_kms.disable_key 'alias/mykey'
[ "Mark", "key", "as", "disabled", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L233-L250
train
Mark a key as disabled.
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...
saltstack/salt
salt/modules/boto_kms.py
encrypt
def encrypt(key_id, plaintext, encryption_context=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Encrypt plaintext into cipher text using specified key. CLI example:: salt myminion boto_kms.encrypt 'alias/mykey' 'myplaindata' '{"aws:username":"myuser"}' ...
python
def encrypt(key_id, plaintext, encryption_context=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Encrypt plaintext into cipher text using specified key. CLI example:: salt myminion boto_kms.encrypt 'alias/mykey' 'myplaindata' '{"aws:username":"myuser"}' ...
[ "def", "encrypt", "(", "key_id", ",", "plaintext", ",", "encryption_context", "=", "None", ",", "grant_tokens", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", ...
Encrypt plaintext into cipher text using specified key. CLI example:: salt myminion boto_kms.encrypt 'alias/mykey' 'myplaindata' '{"aws:username":"myuser"}'
[ "Encrypt", "plaintext", "into", "cipher", "text", "using", "specified", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L315-L337
train
Encrypt plaintext into cipher text using specified key.
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...
saltstack/salt
salt/modules/boto_kms.py
generate_data_key
def generate_data_key(key_id, encryption_context=None, number_of_bytes=None, key_spec=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Generate a secure data key. CLI example:: salt myminion boto_kms.generate_data_key 'alias...
python
def generate_data_key(key_id, encryption_context=None, number_of_bytes=None, key_spec=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Generate a secure data key. CLI example:: salt myminion boto_kms.generate_data_key 'alias...
[ "def", "generate_data_key", "(", "key_id", ",", "encryption_context", "=", "None", ",", "number_of_bytes", "=", "None", ",", "key_spec", "=", "None", ",", "grant_tokens", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", ...
Generate a secure data key. CLI example:: salt myminion boto_kms.generate_data_key 'alias/mykey' number_of_bytes=1024 key_spec=AES_128
[ "Generate", "a", "secure", "data", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L340-L364
train
Generate a secure data key.
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...
saltstack/salt
salt/modules/boto_kms.py
generate_random
def generate_random(number_of_bytes=None, region=None, key=None, keyid=None, profile=None): ''' Generate a random string. CLI example:: salt myminion boto_kms.generate_random number_of_bytes=1024 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)...
python
def generate_random(number_of_bytes=None, region=None, key=None, keyid=None, profile=None): ''' Generate a random string. CLI example:: salt myminion boto_kms.generate_random number_of_bytes=1024 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)...
[ "def", "generate_random", "(", "number_of_bytes", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", ...
Generate a random string. CLI example:: salt myminion boto_kms.generate_random number_of_bytes=1024
[ "Generate", "a", "random", "string", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L395-L412
train
Generate a random 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...
saltstack/salt
salt/modules/boto_kms.py
get_key_policy
def get_key_policy(key_id, policy_name, region=None, key=None, keyid=None, profile=None): ''' Get the policy for the specified key. CLI example:: salt myminion boto_kms.get_key_policy 'alias/mykey' mypolicy ''' conn = _get_conn(region=region, key=key, keyid=keyid, profil...
python
def get_key_policy(key_id, policy_name, region=None, key=None, keyid=None, profile=None): ''' Get the policy for the specified key. CLI example:: salt myminion boto_kms.get_key_policy 'alias/mykey' mypolicy ''' conn = _get_conn(region=region, key=key, keyid=keyid, profil...
[ "def", "get_key_policy", "(", "key_id", ",", "policy_name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "="...
Get the policy for the specified key. CLI example:: salt myminion boto_kms.get_key_policy 'alias/mykey' mypolicy
[ "Get", "the", "policy", "for", "the", "specified", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L415-L435
train
Get the key policy for the specified key.
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...
saltstack/salt
salt/modules/boto_kms.py
get_key_rotation_status
def get_key_rotation_status(key_id, region=None, key=None, keyid=None, profile=None): ''' Get status of whether or not key rotation is enabled for a key. CLI example:: salt myminion boto_kms.get_key_rotation_status 'alias/mykey' ''' conn = _get_conn(region=regio...
python
def get_key_rotation_status(key_id, region=None, key=None, keyid=None, profile=None): ''' Get status of whether or not key rotation is enabled for a key. CLI example:: salt myminion boto_kms.get_key_rotation_status 'alias/mykey' ''' conn = _get_conn(region=regio...
[ "def", "get_key_rotation_status", "(", "key_id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",...
Get status of whether or not key rotation is enabled for a key. CLI example:: salt myminion boto_kms.get_key_rotation_status 'alias/mykey'
[ "Get", "status", "of", "whether", "or", "not", "key", "rotation", "is", "enabled", "for", "a", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L438-L455
train
Get status of whether or not key rotation is enabled for a key.
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...
saltstack/salt
salt/modules/boto_kms.py
list_grants
def list_grants(key_id, limit=None, marker=None, region=None, key=None, keyid=None, profile=None): ''' List grants for the specified key. CLI example:: salt myminion boto_kms.list_grants 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile...
python
def list_grants(key_id, limit=None, marker=None, region=None, key=None, keyid=None, profile=None): ''' List grants for the specified key. CLI example:: salt myminion boto_kms.list_grants 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile...
[ "def", "list_grants", "(", "key_id", ",", "limit", "=", "None", ",", "marker", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "regio...
List grants for the specified key. CLI example:: salt myminion boto_kms.list_grants 'alias/mykey'
[ "List", "grants", "for", "the", "specified", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L458-L490
train
List all grants for the specified key.
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...
saltstack/salt
salt/modules/boto_kms.py
list_key_policies
def list_key_policies(key_id, limit=None, marker=None, region=None, key=None, keyid=None, profile=None): ''' List key_policies for the specified key. CLI example:: salt myminion boto_kms.list_key_policies 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyi...
python
def list_key_policies(key_id, limit=None, marker=None, region=None, key=None, keyid=None, profile=None): ''' List key_policies for the specified key. CLI example:: salt myminion boto_kms.list_key_policies 'alias/mykey' ''' conn = _get_conn(region=region, key=key, keyi...
[ "def", "list_key_policies", "(", "key_id", ",", "limit", "=", "None", ",", "marker", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", ...
List key_policies for the specified key. CLI example:: salt myminion boto_kms.list_key_policies 'alias/mykey'
[ "List", "key_policies", "for", "the", "specified", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L493-L517
train
List key_policies for the specified key.
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...
saltstack/salt
salt/modules/boto_kms.py
put_key_policy
def put_key_policy(key_id, policy_name, policy, region=None, key=None, keyid=None, profile=None): ''' Attach a key policy to the specified key. CLI example:: salt myminion boto_kms.put_key_policy 'alias/mykey' default '{"Statement":...}' ''' conn = _get_conn(region=regio...
python
def put_key_policy(key_id, policy_name, policy, region=None, key=None, keyid=None, profile=None): ''' Attach a key policy to the specified key. CLI example:: salt myminion boto_kms.put_key_policy 'alias/mykey' default '{"Statement":...}' ''' conn = _get_conn(region=regio...
[ "def", "put_key_policy", "(", "key_id", ",", "policy_name", ",", "policy", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ...
Attach a key policy to the specified key. CLI example:: salt myminion boto_kms.put_key_policy 'alias/mykey' default '{"Statement":...}'
[ "Attach", "a", "key", "policy", "to", "the", "specified", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L520-L538
train
Attach a key policy to the specified key.
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...
saltstack/salt
salt/modules/boto_kms.py
re_encrypt
def re_encrypt(ciphertext_blob, destination_key_id, source_encryption_context=None, destination_encryption_context=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Reencrypt encrypted data with a new master key. CLI example:: ...
python
def re_encrypt(ciphertext_blob, destination_key_id, source_encryption_context=None, destination_encryption_context=None, grant_tokens=None, region=None, key=None, keyid=None, profile=None): ''' Reencrypt encrypted data with a new master key. CLI example:: ...
[ "def", "re_encrypt", "(", "ciphertext_blob", ",", "destination_key_id", ",", "source_encryption_context", "=", "None", ",", "destination_encryption_context", "=", "None", ",", "grant_tokens", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", ...
Reencrypt encrypted data with a new master key. CLI example:: salt myminion boto_kms.re_encrypt 'encrypted_data' 'alias/mynewkey' default '{"Statement":...}'
[ "Reencrypt", "encrypted", "data", "with", "a", "new", "master", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L541-L568
train
Reencrypt encrypted data with a new master key.
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...
saltstack/salt
salt/modules/boto_kms.py
revoke_grant
def revoke_grant(key_id, grant_id, region=None, key=None, keyid=None, profile=None): ''' Revoke a grant from a key. CLI example:: salt myminion boto_kms.revoke_grant 'alias/mykey' 8u89hf-j09j... ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
python
def revoke_grant(key_id, grant_id, region=None, key=None, keyid=None, profile=None): ''' Revoke a grant from a key. CLI example:: salt myminion boto_kms.revoke_grant 'alias/mykey' 8u89hf-j09j... ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
[ "def", "revoke_grant", "(", "key_id", ",", "grant_id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "...
Revoke a grant from a key. CLI example:: salt myminion boto_kms.revoke_grant 'alias/mykey' 8u89hf-j09j...
[ "Revoke", "a", "grant", "from", "a", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_kms.py#L571-L591
train
Revoke a grant from a key.
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...
saltstack/salt
salt/utils/debug.py
_makepretty
def _makepretty(printout, stack): ''' Pretty print the stack trace and environment information for debugging those hard to reproduce user problems. :) ''' printout.write('======== Salt Debug Stack Trace =========\n') traceback.print_stack(stack, file=printout) printout.write('==============...
python
def _makepretty(printout, stack): ''' Pretty print the stack trace and environment information for debugging those hard to reproduce user problems. :) ''' printout.write('======== Salt Debug Stack Trace =========\n') traceback.print_stack(stack, file=printout) printout.write('==============...
[ "def", "_makepretty", "(", "printout", ",", "stack", ")", ":", "printout", ".", "write", "(", "'======== Salt Debug Stack Trace =========\\n'", ")", "traceback", ".", "print_stack", "(", "stack", ",", "file", "=", "printout", ")", "printout", ".", "write", "(", ...
Pretty print the stack trace and environment information for debugging those hard to reproduce user problems. :)
[ "Pretty", "print", "the", "stack", "trace", "and", "environment", "information", "for", "debugging", "those", "hard", "to", "reproduce", "user", "problems", ".", ":", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/debug.py#L21-L28
train
Print the stack trace and environment information to the given printout.
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...
saltstack/salt
salt/utils/debug.py
_handle_sigusr2
def _handle_sigusr2(sig, stack): ''' Signal handler for SIGUSR2, only available on Unix-like systems ''' try: import yappi except ImportError: return if yappi.is_running(): yappi.stop() filename = 'callgrind.salt-{0}-{1}'.format(int(time.time()), os.getpid()) ...
python
def _handle_sigusr2(sig, stack): ''' Signal handler for SIGUSR2, only available on Unix-like systems ''' try: import yappi except ImportError: return if yappi.is_running(): yappi.stop() filename = 'callgrind.salt-{0}-{1}'.format(int(time.time()), os.getpid()) ...
[ "def", "_handle_sigusr2", "(", "sig", ",", "stack", ")", ":", "try", ":", "import", "yappi", "except", "ImportError", ":", "return", "if", "yappi", ".", "is_running", "(", ")", ":", "yappi", ".", "stop", "(", ")", "filename", "=", "'callgrind.salt-{0}-{1}'...
Signal handler for SIGUSR2, only available on Unix-like systems
[ "Signal", "handler", "for", "SIGUSR2", "only", "available", "on", "Unix", "-", "like", "systems" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/debug.py#L47-L66
train
Signal handler for SIGUSR2 only available on Unix - like systems
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...
saltstack/salt
salt/utils/debug.py
enable_sig_handler
def enable_sig_handler(signal_name, handler): ''' Add signal handler for signal name if it exists on given platform ''' if hasattr(signal, signal_name): signal.signal(getattr(signal, signal_name), handler)
python
def enable_sig_handler(signal_name, handler): ''' Add signal handler for signal name if it exists on given platform ''' if hasattr(signal, signal_name): signal.signal(getattr(signal, signal_name), handler)
[ "def", "enable_sig_handler", "(", "signal_name", ",", "handler", ")", ":", "if", "hasattr", "(", "signal", ",", "signal_name", ")", ":", "signal", ".", "signal", "(", "getattr", "(", "signal", ",", "signal_name", ")", ",", "handler", ")" ]
Add signal handler for signal name if it exists on given platform
[ "Add", "signal", "handler", "for", "signal", "name", "if", "it", "exists", "on", "given", "platform" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/debug.py#L69-L74
train
Enable signal handler for given signal name on given platform
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...
saltstack/salt
salt/utils/debug.py
caller_name
def caller_name(skip=2, include_lineno=False): ''' Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exce...
python
def caller_name(skip=2, include_lineno=False): ''' Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exce...
[ "def", "caller_name", "(", "skip", "=", "2", ",", "include_lineno", "=", "False", ")", ":", "stack", "=", "inspect", ".", "stack", "(", ")", "start", "=", "0", "+", "skip", "if", "len", "(", "stack", ")", "<", "start", "+", "1", ":", "return", "'...
Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exceed stack height Source: https://gist.github.com/techto...
[ "Get", "a", "name", "of", "a", "caller", "in", "the", "format", "module", ".", "class", ".", "method" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/debug.py#L102-L143
train
Get a name of a caller in the format module. class. method. caller.
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...
saltstack/salt
salt/states/nxos_upgrade.py
image_running
def image_running(name, system_image, kickstart_image=None, issu=True, **kwargs): ''' Ensure the NX-OS system image is running on the device. name Name of the salt state task system_image Name of the system image file on bootflash: kickstart_image Name of the kickstart ima...
python
def image_running(name, system_image, kickstart_image=None, issu=True, **kwargs): ''' Ensure the NX-OS system image is running on the device. name Name of the salt state task system_image Name of the system image file on bootflash: kickstart_image Name of the kickstart ima...
[ "def", "image_running", "(", "name", ",", "system_image", ",", "kickstart_image", "=", "None", ",", "issu", "=", "True", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", ...
Ensure the NX-OS system image is running on the device. name Name of the salt state task system_image Name of the system image file on bootflash: kickstart_image Name of the kickstart image file on bootflash: This is not needed if the system_image is a combined system and ...
[ "Ensure", "the", "NX", "-", "OS", "system", "image", "is", "running", "on", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/nxos_upgrade.py#L41-L107
train
Ensure the NX - OS system image is running on the device.
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...
saltstack/salt
salt/ext/vsan/vsanapiutils.py
WaitForTasks
def WaitForTasks(tasks, si): """ Given the service instance si and tasks, it returns after all the tasks are complete """ pc = si.content.propertyCollector taskList = [str(task) for task in tasks] # Create filter objSpecs = [vmodl.query.PropertyCollector.ObjectSpec(obj=task) ...
python
def WaitForTasks(tasks, si): """ Given the service instance si and tasks, it returns after all the tasks are complete """ pc = si.content.propertyCollector taskList = [str(task) for task in tasks] # Create filter objSpecs = [vmodl.query.PropertyCollector.ObjectSpec(obj=task) ...
[ "def", "WaitForTasks", "(", "tasks", ",", "si", ")", ":", "pc", "=", "si", ".", "content", ".", "propertyCollector", "taskList", "=", "[", "str", "(", "task", ")", "for", "task", "in", "tasks", "]", "# Create filter", "objSpecs", "=", "[", "vmodl", "."...
Given the service instance si and tasks, it returns after all the tasks are complete
[ "Given", "the", "service", "instance", "si", "and", "tasks", "it", "returns", "after", "all", "the", "tasks", "are", "complete" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/ext/vsan/vsanapiutils.py#L116-L165
train
This function waits for the tasks to complete.
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/it_IT/__init__.py
checksum
def checksum(value): """ Calculates the checksum char used for the 16th char. Author: Vincenzo Palazzo """ return chr(65 + sum(CHECKSUM_TABLE[index % 2][ALPHANUMERICS_DICT[char]] for index, char in enumerate(value)) % 26)
python
def checksum(value): """ Calculates the checksum char used for the 16th char. Author: Vincenzo Palazzo """ return chr(65 + sum(CHECKSUM_TABLE[index % 2][ALPHANUMERICS_DICT[char]] for index, char in enumerate(value)) % 26)
[ "def", "checksum", "(", "value", ")", ":", "return", "chr", "(", "65", "+", "sum", "(", "CHECKSUM_TABLE", "[", "index", "%", "2", "]", "[", "ALPHANUMERICS_DICT", "[", "char", "]", "]", "for", "index", ",", "char", "in", "enumerate", "(", "value", ")"...
Calculates the checksum char used for the 16th char. Author: Vincenzo Palazzo
[ "Calculates", "the", "checksum", "char", "used", "for", "the", "16th", "char", ".", "Author", ":", "Vincenzo", "Palazzo" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/it_IT/__init__.py#L18-L24
train
Calculates the checksum char used for the 16th char in the 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/misc/__init__.py
Provider.binary
def binary(self, length=(1 * 1024 * 1024)): """ Returns random binary blob. Default blob size is 1 Mb. """ blob = [self.generator.random.randrange(256) for _ in range(length)] return bytes(blob) if sys.version_info[0] >= 3 else bytearray(blob)
python
def binary(self, length=(1 * 1024 * 1024)): """ Returns random binary blob. Default blob size is 1 Mb. """ blob = [self.generator.random.randrange(256) for _ in range(length)] return bytes(blob) if sys.version_info[0] >= 3 else bytearray(blob)
[ "def", "binary", "(", "self", ",", "length", "=", "(", "1", "*", "1024", "*", "1024", ")", ")", ":", "blob", "=", "[", "self", ".", "generator", ".", "random", ".", "randrange", "(", "256", ")", "for", "_", "in", "range", "(", "length", ")", "]...
Returns random binary blob. Default blob size is 1 Mb.
[ "Returns", "random", "binary", "blob", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/misc/__init__.py#L23-L29
train
Returns a random binary blob.
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/misc/__init__.py
Provider.md5
def md5(self, raw_output=False): """ Calculates the md5 hash of a given string :example 'cfcd208495d565ef66e7dff9f98764da' """ res = hashlib.md5(str(self.generator.random.random()).encode('utf-8')) if raw_output: return res.digest() return res.hexdiges...
python
def md5(self, raw_output=False): """ Calculates the md5 hash of a given string :example 'cfcd208495d565ef66e7dff9f98764da' """ res = hashlib.md5(str(self.generator.random.random()).encode('utf-8')) if raw_output: return res.digest() return res.hexdiges...
[ "def", "md5", "(", "self", ",", "raw_output", "=", "False", ")", ":", "res", "=", "hashlib", ".", "md5", "(", "str", "(", "self", ".", "generator", ".", "random", ".", "random", "(", ")", ")", ".", "encode", "(", "'utf-8'", ")", ")", "if", "raw_o...
Calculates the md5 hash of a given string :example 'cfcd208495d565ef66e7dff9f98764da'
[ "Calculates", "the", "md5", "hash", "of", "a", "given", "string", ":", "example", "cfcd208495d565ef66e7dff9f98764da" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/misc/__init__.py#L31-L39
train
Calculates the md5 hash of a given 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/misc/__init__.py
Provider.uuid4
def uuid4(self, cast_to=str): """ Generates a random UUID4 string. :param cast_to: Specify what type the UUID should be cast to. Default is `str` :type cast_to: callable """ # Based on http://stackoverflow.com/q/41186818 return cast_to(uuid.UUID(int=self.generator...
python
def uuid4(self, cast_to=str): """ Generates a random UUID4 string. :param cast_to: Specify what type the UUID should be cast to. Default is `str` :type cast_to: callable """ # Based on http://stackoverflow.com/q/41186818 return cast_to(uuid.UUID(int=self.generator...
[ "def", "uuid4", "(", "self", ",", "cast_to", "=", "str", ")", ":", "# Based on http://stackoverflow.com/q/41186818", "return", "cast_to", "(", "uuid", ".", "UUID", "(", "int", "=", "self", ".", "generator", ".", "random", ".", "getrandbits", "(", "128", ")",...
Generates a random UUID4 string. :param cast_to: Specify what type the UUID should be cast to. Default is `str` :type cast_to: callable
[ "Generates", "a", "random", "UUID4", "string", ".", ":", "param", "cast_to", ":", "Specify", "what", "type", "the", "UUID", "should", "be", "cast", "to", ".", "Default", "is", "str", ":", "type", "cast_to", ":", "callable" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/misc/__init__.py#L62-L69
train
Generates a random UUID4 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/misc/__init__.py
Provider.password
def password( self, length=10, special_chars=True, digits=True, upper_case=True, lower_case=True): """ Generates a random password. @param length: Integer. Length of a password @param special_chars: Boolean. Whether ...
python
def password( self, length=10, special_chars=True, digits=True, upper_case=True, lower_case=True): """ Generates a random password. @param length: Integer. Length of a password @param special_chars: Boolean. Whether ...
[ "def", "password", "(", "self", ",", "length", "=", "10", ",", "special_chars", "=", "True", ",", "digits", "=", "True", ",", "upper_case", "=", "True", ",", "lower_case", "=", "True", ")", ":", "choices", "=", "\"\"", "required_tokens", "=", "[", "]",...
Generates a random password. @param length: Integer. Length of a password @param special_chars: Boolean. Whether to use special characters !@#$%^&*()_+ @param digits: Boolean. Whether to use digits @param upper_case: Boolean. Whether to use upper letters @param lower_case: Boolea...
[ "Generates", "a", "random", "password", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/misc/__init__.py#L71-L121
train
Generates a random password.
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/pl_PL/__init__.py
checksum_identity_card_number
def checksum_identity_card_number(characters): """ Calculates and returns a control digit for given list of characters basing on Identity Card Number standards. """ weights_for_check_digit = [7, 3, 1, 0, 7, 3, 1, 7, 3] check_digit = 0 for i in range(3): check_digit += weights_for_check_...
python
def checksum_identity_card_number(characters): """ Calculates and returns a control digit for given list of characters basing on Identity Card Number standards. """ weights_for_check_digit = [7, 3, 1, 0, 7, 3, 1, 7, 3] check_digit = 0 for i in range(3): check_digit += weights_for_check_...
[ "def", "checksum_identity_card_number", "(", "characters", ")", ":", "weights_for_check_digit", "=", "[", "7", ",", "3", ",", "1", ",", "0", ",", "7", ",", "3", ",", "1", ",", "7", ",", "3", "]", "check_digit", "=", "0", "for", "i", "in", "range", ...
Calculates and returns a control digit for given list of characters basing on Identity Card Number standards.
[ "Calculates", "and", "returns", "a", "control", "digit", "for", "given", "list", "of", "characters", "basing", "on", "Identity", "Card", "Number", "standards", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/person/pl_PL/__init__.py#L6-L21
train
Calculates and returns a control digit for given list of characters basing on Identity Card Number standards.
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/pl_PL/__init__.py
Provider.identity_card_number
def identity_card_number(self): """ Returns 9 character Polish Identity Card Number, Polish: Numer Dowodu Osobistego. The card number consists of 3 letters followed by 6 digits (for example, ABA300000), of which the first digit (at position 3) is the check digit. https:...
python
def identity_card_number(self): """ Returns 9 character Polish Identity Card Number, Polish: Numer Dowodu Osobistego. The card number consists of 3 letters followed by 6 digits (for example, ABA300000), of which the first digit (at position 3) is the check digit. https:...
[ "def", "identity_card_number", "(", "self", ")", ":", "identity", "=", "[", "]", "for", "_", "in", "range", "(", "3", ")", ":", "identity", ".", "append", "(", "self", ".", "random_letter", "(", ")", ".", "upper", "(", ")", ")", "# it will be overwritt...
Returns 9 character Polish Identity Card Number, Polish: Numer Dowodu Osobistego. The card number consists of 3 letters followed by 6 digits (for example, ABA300000), of which the first digit (at position 3) is the check digit. https://en.wikipedia.org/wiki/Polish_identity_card
[ "Returns", "9", "character", "Polish", "Identity", "Card", "Number", "Polish", ":", "Numer", "Dowodu", "Osobistego", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/person/pl_PL/__init__.py#L681-L704
train
Returns 9 character Polish Identity 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/cli.py
execute_from_command_line
def execute_from_command_line(argv=None): """A simple method that runs a Command.""" if sys.stdout.encoding is None: print('please set python env PYTHONIOENCODING=UTF-8, example: ' 'export PYTHONIOENCODING=UTF-8, when writing to stdout', file=sys.stderr) exit(1) ...
python
def execute_from_command_line(argv=None): """A simple method that runs a Command.""" if sys.stdout.encoding is None: print('please set python env PYTHONIOENCODING=UTF-8, example: ' 'export PYTHONIOENCODING=UTF-8, when writing to stdout', file=sys.stderr) exit(1) ...
[ "def", "execute_from_command_line", "(", "argv", "=", "None", ")", ":", "if", "sys", ".", "stdout", ".", "encoding", "is", "None", ":", "print", "(", "'please set python env PYTHONIOENCODING=UTF-8, example: '", "'export PYTHONIOENCODING=UTF-8, when writing to stdout'", ",",...
A simple method that runs a Command.
[ "A", "simple", "method", "that", "runs", "a", "Command", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/cli.py#L267-L276
train
A simple method that runs a Command.
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/cli.py
Command.execute
def execute(self): """ Given the command-line arguments, this creates a parser appropriate to that command, and runs it. """ # retrieve default language from system environment default_locale = os.environ.get('LANG', 'en_US').split('.')[0] if default_locale not i...
python
def execute(self): """ Given the command-line arguments, this creates a parser appropriate to that command, and runs it. """ # retrieve default language from system environment default_locale = os.environ.get('LANG', 'en_US').split('.')[0] if default_locale not i...
[ "def", "execute", "(", "self", ")", ":", "# retrieve default language from system environment", "default_locale", "=", "os", ".", "environ", ".", "get", "(", "'LANG'", ",", "'en_US'", ")", ".", "split", "(", "'.'", ")", "[", "0", "]", "if", "default_locale", ...
Given the command-line arguments, this creates a parser appropriate to that command, and runs it.
[ "Given", "the", "command", "-", "line", "arguments", "this", "creates", "a", "parser", "appropriate", "to", "that", "command", "and", "runs", "it", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/cli.py#L127-L264
train
This function creates a parser appropriate to the command - line arguments and runs it.
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/isbn/isbn.py
ISBN13._check_digit
def _check_digit(self): """ Calculate the check digit for ISBN-13. See https://en.wikipedia.org/wiki/International_Standard_Book_Number for calculation. """ weights = (1 if x % 2 == 0 else 3 for x in range(12)) body = ''.join([self.ean, self.group, self.registrant, ...
python
def _check_digit(self): """ Calculate the check digit for ISBN-13. See https://en.wikipedia.org/wiki/International_Standard_Book_Number for calculation. """ weights = (1 if x % 2 == 0 else 3 for x in range(12)) body = ''.join([self.ean, self.group, self.registrant, ...
[ "def", "_check_digit", "(", "self", ")", ":", "weights", "=", "(", "1", "if", "x", "%", "2", "==", "0", "else", "3", "for", "x", "in", "range", "(", "12", ")", ")", "body", "=", "''", ".", "join", "(", "[", "self", ".", "ean", ",", "self", ...
Calculate the check digit for ISBN-13. See https://en.wikipedia.org/wiki/International_Standard_Book_Number for calculation.
[ "Calculate", "the", "check", "digit", "for", "ISBN", "-", "13", ".", "See", "https", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "International_Standard_Book_Number", "for", "calculation", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/isbn/isbn.py#L25-L36
train
Calculate the check digit for ISBN - 13.
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_FR/__init__.py
Provider._is_catch_phrase_valid
def _is_catch_phrase_valid(self, catch_phrase): """ Validates a french catch phrase. :param catch_phrase: The catch phrase to validate. """ for word in self.words_which_should_not_appear_twice: # Fastest way to check if a piece of word does not appear twice. ...
python
def _is_catch_phrase_valid(self, catch_phrase): """ Validates a french catch phrase. :param catch_phrase: The catch phrase to validate. """ for word in self.words_which_should_not_appear_twice: # Fastest way to check if a piece of word does not appear twice. ...
[ "def", "_is_catch_phrase_valid", "(", "self", ",", "catch_phrase", ")", ":", "for", "word", "in", "self", ".", "words_which_should_not_appear_twice", ":", "# Fastest way to check if a piece of word does not appear twice.", "begin_pos", "=", "catch_phrase", ".", "find", "(",...
Validates a french catch phrase. :param catch_phrase: The catch phrase to validate.
[ "Validates", "a", "french", "catch", "phrase", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/fr_FR/__init__.py#L97-L111
train
Checks if a catch phrase is valid.
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_FR/__init__.py
Provider.siret
def siret(self, max_sequential_digits=2): """ Generates a siret number (14 digits). It is in fact the result of the concatenation of a siren number (9 digits), a sequential number (4 digits) and a control number (1 digit) concatenation. If $max_sequential_digits is invalid, it is...
python
def siret(self, max_sequential_digits=2): """ Generates a siret number (14 digits). It is in fact the result of the concatenation of a siren number (9 digits), a sequential number (4 digits) and a control number (1 digit) concatenation. If $max_sequential_digits is invalid, it is...
[ "def", "siret", "(", "self", ",", "max_sequential_digits", "=", "2", ")", ":", "if", "max_sequential_digits", ">", "4", "or", "max_sequential_digits", "<=", "0", ":", "max_sequential_digits", "=", "2", "sequential_number", "=", "str", "(", "self", ".", "random...
Generates a siret number (14 digits). It is in fact the result of the concatenation of a siren number (9 digits), a sequential number (4 digits) and a control number (1 digit) concatenation. If $max_sequential_digits is invalid, it is set to 2. :param max_sequential_digits The maximum nu...
[ "Generates", "a", "siret", "number", "(", "14", "digits", ")", ".", "It", "is", "in", "fact", "the", "result", "of", "the", "concatenation", "of", "a", "siren", "number", "(", "9", "digits", ")", "a", "sequential", "number", "(", "4", "digits", ")", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/fr_FR/__init__.py#L119-L132
train
Generates a random siret 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/el_GR/__init__.py
remove_accents
def remove_accents(value): """ Remove accents from characters in the given string. """ search = 'ΆΈΉΊΌΎΏάέήίόύώΪϊΐϋΰ' replace = 'ΑΕΗΙΟΥΩαεηιουωΙιιυυ' def replace_accented_character(match): matched = match.group(0) if matched in search: return replace[search.find(matc...
python
def remove_accents(value): """ Remove accents from characters in the given string. """ search = 'ΆΈΉΊΌΎΏάέήίόύώΪϊΐϋΰ' replace = 'ΑΕΗΙΟΥΩαεηιουωΙιιυυ' def replace_accented_character(match): matched = match.group(0) if matched in search: return replace[search.find(matc...
[ "def", "remove_accents", "(", "value", ")", ":", "search", "=", "'ΆΈΉΊΌΎΏάέήίόύώΪϊΐϋΰ'", "replace", "=", "'ΑΕΗΙΟΥΩαεηιουωΙιιυυ'", "def", "replace_accented_character", "(", "match", ")", ":", "matched", "=", "match", ".", "group", "(", "0", ")", "if", "matched", ...
Remove accents from characters in the given string.
[ "Remove", "accents", "from", "characters", "in", "the", "given", "string", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/el_GR/__init__.py#L32-L45
train
Removes accents from characters in the given 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/el_GR/__init__.py
latinize
def latinize(value): """ Converts (transliterates) greek letters to latin equivalents. """ def replace_double_character(match): search = ('Θ Χ Ψ ' 'θ χ ψ ' 'ΟΥ ΑΥ ΕΥ ' 'Ου Αυ Ευ ' 'ου αυ ευ').split() replace = ('TH C...
python
def latinize(value): """ Converts (transliterates) greek letters to latin equivalents. """ def replace_double_character(match): search = ('Θ Χ Ψ ' 'θ χ ψ ' 'ΟΥ ΑΥ ΕΥ ' 'Ου Αυ Ευ ' 'ου αυ ευ').split() replace = ('TH C...
[ "def", "latinize", "(", "value", ")", ":", "def", "replace_double_character", "(", "match", ")", ":", "search", "=", "(", "'Θ Χ Ψ '", "'θ χ ψ '", "'ΟΥ ΑΥ ΕΥ '", "'Ου Αυ Ευ '", "'ου αυ ευ').spli", "t", "(", ")", "", "", "replace", "=", "(", "'TH CH PS '", "'t...
Converts (transliterates) greek letters to latin equivalents.
[ "Converts", "(", "transliterates", ")", "greek", "letters", "to", "latin", "equivalents", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/internet/el_GR/__init__.py#L48-L80
train
Converts greek letters to latin equivalents.
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/he_IL/__init__.py
Provider.ssn
def ssn(self): """ Returns an Israeli identity number, known as Teudat Zehut ("tz"). https://en.wikipedia.org/wiki/Israeli_identity_card """ newID = str(self.generator.random.randrange(111111, 99999999)) newID = newID.zfill(8) theSum = 0 indexRange = [0,...
python
def ssn(self): """ Returns an Israeli identity number, known as Teudat Zehut ("tz"). https://en.wikipedia.org/wiki/Israeli_identity_card """ newID = str(self.generator.random.randrange(111111, 99999999)) newID = newID.zfill(8) theSum = 0 indexRange = [0,...
[ "def", "ssn", "(", "self", ")", ":", "newID", "=", "str", "(", "self", ".", "generator", ".", "random", ".", "randrange", "(", "111111", ",", "99999999", ")", ")", "newID", "=", "newID", ".", "zfill", "(", "8", ")", "theSum", "=", "0", "indexRange"...
Returns an Israeli identity number, known as Teudat Zehut ("tz"). https://en.wikipedia.org/wiki/Israeli_identity_card
[ "Returns", "an", "Israeli", "identity", "number", "known", "as", "Teudat", "Zehut", "(", "tz", ")", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/he_IL/__init__.py#L9-L32
train
Returns an Israeli identity 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/lorem/__init__.py
Provider.words
def words(self, nb=3, ext_word_list=None, unique=False): """ :returns: An array of random words. for example: ['Lorem', 'ipsum', 'dolor'] Keyword arguments: :param nb: how many words to return :param ext_word_list: a list of words you would like to have instead of 'L...
python
def words(self, nb=3, ext_word_list=None, unique=False): """ :returns: An array of random words. for example: ['Lorem', 'ipsum', 'dolor'] Keyword arguments: :param nb: how many words to return :param ext_word_list: a list of words you would like to have instead of 'L...
[ "def", "words", "(", "self", ",", "nb", "=", "3", ",", "ext_word_list", "=", "None", ",", "unique", "=", "False", ")", ":", "word_list", "=", "ext_word_list", "if", "ext_word_list", "else", "self", ".", "word_list", "if", "unique", ":", "return", "self",...
:returns: An array of random words. for example: ['Lorem', 'ipsum', 'dolor'] Keyword arguments: :param nb: how many words to return :param ext_word_list: a list of words you would like to have instead of 'Lorem ipsum' :param unique: If True, the returned word list will conta...
[ ":", "returns", ":", "An", "array", "of", "random", "words", ".", "for", "example", ":", "[", "Lorem", "ipsum", "dolor", "]" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/lorem/__init__.py#L28-L43
train
Returns an array of random words. for example Lorem ipsum dolor
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/lorem/__init__.py
Provider.sentence
def sentence(self, nb_words=6, variable_nb_words=True, ext_word_list=None): """ Generate a random sentence :example 'Lorem ipsum dolor sit amet.' :param nb_words: around how many words the sentence should contain :param variable_nb_words: set to false if you want exactly ``nb`` ...
python
def sentence(self, nb_words=6, variable_nb_words=True, ext_word_list=None): """ Generate a random sentence :example 'Lorem ipsum dolor sit amet.' :param nb_words: around how many words the sentence should contain :param variable_nb_words: set to false if you want exactly ``nb`` ...
[ "def", "sentence", "(", "self", ",", "nb_words", "=", "6", ",", "variable_nb_words", "=", "True", ",", "ext_word_list", "=", "None", ")", ":", "if", "nb_words", "<=", "0", ":", "return", "''", "if", "variable_nb_words", ":", "nb_words", "=", "self", ".",...
Generate a random sentence :example 'Lorem ipsum dolor sit amet.' :param nb_words: around how many words the sentence should contain :param variable_nb_words: set to false if you want exactly ``nb`` words returned, otherwise the result may include a number of words of ``...
[ "Generate", "a", "random", "sentence", ":", "example", "Lorem", "ipsum", "dolor", "sit", "amet", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/lorem/__init__.py#L56-L79
train
Generates a random sentence of nb_words words.
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/lorem/__init__.py
Provider.sentences
def sentences(self, nb=3, ext_word_list=None): """ Generate an array of sentences :example ['Lorem ipsum dolor sit amet.', 'Consectetur adipisicing eli.'] Keyword arguments: :param nb: how many sentences to return :param ext_word_list: a list of words you would like to h...
python
def sentences(self, nb=3, ext_word_list=None): """ Generate an array of sentences :example ['Lorem ipsum dolor sit amet.', 'Consectetur adipisicing eli.'] Keyword arguments: :param nb: how many sentences to return :param ext_word_list: a list of words you would like to h...
[ "def", "sentences", "(", "self", ",", "nb", "=", "3", ",", "ext_word_list", "=", "None", ")", ":", "return", "[", "self", ".", "sentence", "(", "ext_word_list", "=", "ext_word_list", ")", "for", "_", "in", "range", "(", "0", ",", "nb", ")", "]" ]
Generate an array of sentences :example ['Lorem ipsum dolor sit amet.', 'Consectetur adipisicing eli.'] Keyword arguments: :param nb: how many sentences to return :param ext_word_list: a list of words you would like to have instead of 'Lorem ipsum'. :rtype: list
[ "Generate", "an", "array", "of", "sentences", ":", "example", "[", "Lorem", "ipsum", "dolor", "sit", "amet", ".", "Consectetur", "adipisicing", "eli", ".", "]" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/lorem/__init__.py#L81-L94
train
Generates an array of sentences from the base class.
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/lorem/__init__.py
Provider.paragraph
def paragraph( self, nb_sentences=3, variable_nb_sentences=True, ext_word_list=None): """ :returns: A single paragraph. For example: 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.' ...
python
def paragraph( self, nb_sentences=3, variable_nb_sentences=True, ext_word_list=None): """ :returns: A single paragraph. For example: 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.' ...
[ "def", "paragraph", "(", "self", ",", "nb_sentences", "=", "3", ",", "variable_nb_sentences", "=", "True", ",", "ext_word_list", "=", "None", ")", ":", "if", "nb_sentences", "<=", "0", ":", "return", "''", "if", "variable_nb_sentences", ":", "nb_sentences", ...
:returns: A single paragraph. For example: 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.' Keyword arguments: :param nb_sentences: around how many sentences the paragraph should contain :param variable_nb_sentences: set to false ...
[ ":", "returns", ":", "A", "single", "paragraph", ".", "For", "example", ":", "Sapiente", "sunt", "omnis", ".", "Ut", "pariatur", "ad", "autem", "ducimus", "et", ".", "Voluptas", "rem", "voluptas", "sint", "modi", "dolorem", "amet", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/lorem/__init__.py#L96-L125
train
Returns a single paragraph. For example a paragraph is Sapiente sunt omnis. Ut pariatur ad autem ducimus et Voluptas rem voluptas modi dolorem amet.
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/lorem/__init__.py
Provider.paragraphs
def paragraphs(self, nb=3, ext_word_list=None): """ Generate an array of paragraphs :example [paragraph1, paragraph2, paragraph3] :param nb: how many paragraphs to return :param ext_word_list: a list of words you would like to have instead of 'Lorem ipsum'. :...
python
def paragraphs(self, nb=3, ext_word_list=None): """ Generate an array of paragraphs :example [paragraph1, paragraph2, paragraph3] :param nb: how many paragraphs to return :param ext_word_list: a list of words you would like to have instead of 'Lorem ipsum'. :...
[ "def", "paragraphs", "(", "self", ",", "nb", "=", "3", ",", "ext_word_list", "=", "None", ")", ":", "return", "[", "self", ".", "paragraph", "(", "ext_word_list", "=", "ext_word_list", ")", "for", "_", "in", "range", "(", "0", ",", "nb", ")", "]" ]
Generate an array of paragraphs :example [paragraph1, paragraph2, paragraph3] :param nb: how many paragraphs to return :param ext_word_list: a list of words you would like to have instead of 'Lorem ipsum'. :rtype: list
[ "Generate", "an", "array", "of", "paragraphs", ":", "example", "[", "paragraph1", "paragraph2", "paragraph3", "]", ":", "param", "nb", ":", "how", "many", "paragraphs", "to", "return", ":", "param", "ext_word_list", ":", "a", "list", "of", "words", "you", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/lorem/__init__.py#L127-L139
train
Generate an array of paragraphs containing nb paragraphs.
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/lorem/__init__.py
Provider.text
def text(self, max_nb_chars=200, ext_word_list=None): """ Generate a text string. Depending on the ``max_nb_chars, returns a string made of words, sentences, or paragraphs. :example 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.' ...
python
def text(self, max_nb_chars=200, ext_word_list=None): """ Generate a text string. Depending on the ``max_nb_chars, returns a string made of words, sentences, or paragraphs. :example 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.' ...
[ "def", "text", "(", "self", ",", "max_nb_chars", "=", "200", ",", "ext_word_list", "=", "None", ")", ":", "text", "=", "[", "]", "if", "max_nb_chars", "<", "5", ":", "raise", "ValueError", "(", "'text() can only generate text of at least 5 characters'", ")", "...
Generate a text string. Depending on the ``max_nb_chars, returns a string made of words, sentences, or paragraphs. :example 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.' Keyword arguments: :param max_nb_chars: Maximum number of cha...
[ "Generate", "a", "text", "string", ".", "Depending", "on", "the", "max_nb_chars", "returns", "a", "string", "made", "of", "words", "sentences", "or", "paragraphs", ".", ":", "example", "Sapiente", "sunt", "omnis", ".", "Ut", "pariatur", "ad", "autem", "ducim...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/lorem/__init__.py#L141-L198
train
Generates a text string of the current language.
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/__init__.py
Provider.city
def city(self): """ :example 'Sashabury' """ pattern = self.random_element(self.city_formats) return self.generator.parse(pattern)
python
def city(self): """ :example 'Sashabury' """ pattern = self.random_element(self.city_formats) return self.generator.parse(pattern)
[ "def", "city", "(", "self", ")", ":", "pattern", "=", "self", ".", "random_element", "(", "self", ".", "city_formats", ")", "return", "self", ".", "generator", ".", "parse", "(", "pattern", ")" ]
:example 'Sashabury'
[ ":", "example", "Sashabury" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/__init__.py#L45-L50
train
returns a random city 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/address/__init__.py
Provider.street_name
def street_name(self): """ :example 'Crist Parks' """ pattern = self.random_element(self.street_name_formats) return self.generator.parse(pattern)
python
def street_name(self): """ :example 'Crist Parks' """ pattern = self.random_element(self.street_name_formats) return self.generator.parse(pattern)
[ "def", "street_name", "(", "self", ")", ":", "pattern", "=", "self", ".", "random_element", "(", "self", ".", "street_name_formats", ")", "return", "self", ".", "generator", ".", "parse", "(", "pattern", ")" ]
:example 'Crist Parks'
[ ":", "example", "Crist", "Parks" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/__init__.py#L52-L57
train
returns random street 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/address/__init__.py
Provider.street_address
def street_address(self): """ :example '791 Crist Parks' """ pattern = self.random_element(self.street_address_formats) return self.generator.parse(pattern)
python
def street_address(self): """ :example '791 Crist Parks' """ pattern = self.random_element(self.street_address_formats) return self.generator.parse(pattern)
[ "def", "street_address", "(", "self", ")", ":", "pattern", "=", "self", ".", "random_element", "(", "self", ".", "street_address_formats", ")", "return", "self", ".", "generator", ".", "parse", "(", "pattern", ")" ]
:example '791 Crist Parks'
[ ":", "example", "791", "Crist", "Parks" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/__init__.py#L59-L64
train
returns random street 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/__init__.py
Provider.address
def address(self): """ :example '791 Crist Parks, Sashabury, IL 86039-9874' """ pattern = self.random_element(self.address_formats) return self.generator.parse(pattern)
python
def address(self): """ :example '791 Crist Parks, Sashabury, IL 86039-9874' """ pattern = self.random_element(self.address_formats) return self.generator.parse(pattern)
[ "def", "address", "(", "self", ")", ":", "pattern", "=", "self", ".", "random_element", "(", "self", ".", "address_formats", ")", "return", "self", ".", "generator", ".", "parse", "(", "pattern", ")" ]
:example '791 Crist Parks, Sashabury, IL 86039-9874'
[ ":", "example", "791", "Crist", "Parks", "Sashabury", "IL", "86039", "-", "9874" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/__init__.py#L72-L77
train
get a random 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/utils/text.py
slugify
def slugify(value, allow_dots=False, allow_unicode=False): """ Converts to lowercase, removes non-word characters (alphanumerics and underscores) and converts spaces to hyphens. Also strips leading and trailing whitespace. Modified to optionally allow dots. Adapted from Django 1.9 """ if al...
python
def slugify(value, allow_dots=False, allow_unicode=False): """ Converts to lowercase, removes non-word characters (alphanumerics and underscores) and converts spaces to hyphens. Also strips leading and trailing whitespace. Modified to optionally allow dots. Adapted from Django 1.9 """ if al...
[ "def", "slugify", "(", "value", ",", "allow_dots", "=", "False", ",", "allow_unicode", "=", "False", ")", ":", "if", "allow_dots", ":", "pattern", "=", "_re_pattern_allow_dots", "else", ":", "pattern", "=", "_re_pattern", "value", "=", "six", ".", "text_type...
Converts to lowercase, removes non-word characters (alphanumerics and underscores) and converts spaces to hyphens. Also strips leading and trailing whitespace. Modified to optionally allow dots. Adapted from Django 1.9
[ "Converts", "to", "lowercase", "removes", "non", "-", "word", "characters", "(", "alphanumerics", "and", "underscores", ")", "and", "converts", "spaces", "to", "hyphens", ".", "Also", "strips", "leading", "and", "trailing", "whitespace", ".", "Modified", "to", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/utils/text.py#L14-L35
train
Converts to lowercase removes non - word characters underscores and hyphens and converts spaces to hyphens.
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/ja_JP/__init__.py
Provider.ban
def ban(self): """ :example '3番' """ return "%d番" % self.generator.random.randint(1, 27)
python
def ban(self): """ :example '3番' """ return "%d番" % self.generator.random.randint(1, 27)
[ "def", "ban", "(", "self", ")", ":", "return", "\"%d番\" %", "s", "lf.g", "e", "nerator.r", "a", "ndom.r", "a", "ndint(1", ",", " ", "2", ")", "" ]
:example '3番'
[ ":", "example", "3番" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ja_JP/__init__.py#L332-L336
train
A ban method that returns a random 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/address/ja_JP/__init__.py
Provider.postcode
def postcode(self): """ :example '101-1212' """ return "%03d-%04d" % (self.generator.random.randint(0, 999), self.generator.random.randint(0, 9999))
python
def postcode(self): """ :example '101-1212' """ return "%03d-%04d" % (self.generator.random.randint(0, 999), self.generator.random.randint(0, 9999))
[ "def", "postcode", "(", "self", ")", ":", "return", "\"%03d-%04d\"", "%", "(", "self", ".", "generator", ".", "random", ".", "randint", "(", "0", ",", "999", ")", ",", "self", ".", "generator", ".", "random", ".", "randint", "(", "0", ",", "9999", ...
:example '101-1212'
[ ":", "example", "101", "-", "1212" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/ja_JP/__init__.py#L350-L355
train
postcode for the nationale
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/en_CA/__init__.py
Provider.postcode
def postcode(self): """ Replaces all question mark ('?') occurrences with a random letter from postal_code_formats then passes result to numerify to insert numbers """ temp = re.sub(r'\?', lambda x: self.postal_code_letter(), se...
python
def postcode(self): """ Replaces all question mark ('?') occurrences with a random letter from postal_code_formats then passes result to numerify to insert numbers """ temp = re.sub(r'\?', lambda x: self.postal_code_letter(), se...
[ "def", "postcode", "(", "self", ")", ":", "temp", "=", "re", ".", "sub", "(", "r'\\?'", ",", "lambda", "x", ":", "self", ".", "postal_code_letter", "(", ")", ",", "self", ".", "random_element", "(", "self", ".", "postal_code_formats", ")", ")", "return...
Replaces all question mark ('?') occurrences with a random letter from postal_code_formats then passes result to numerify to insert numbers
[ "Replaces", "all", "question", "mark", "(", "?", ")", "occurrences", "with", "a", "random", "letter", "from", "postal_code_formats", "then", "passes", "result", "to", "numerify", "to", "insert", "numbers" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/en_CA/__init__.py#L319-L328
train
Returns a random string from the postal_code_formats and replaces all question marks with a random letter and passes result to numerify to insert numbers
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/pl_PL/__init__.py
regon_checksum
def regon_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on REGON standard. """ weights_for_check_digit = [8, 9, 2, 3, 4, 5, 6, 7] check_digit = 0 for i in range(0, 8): check_digit += weights_for_check_digit[i] * digits[i] check_digit %...
python
def regon_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on REGON standard. """ weights_for_check_digit = [8, 9, 2, 3, 4, 5, 6, 7] check_digit = 0 for i in range(0, 8): check_digit += weights_for_check_digit[i] * digits[i] check_digit %...
[ "def", "regon_checksum", "(", "digits", ")", ":", "weights_for_check_digit", "=", "[", "8", ",", "9", ",", "2", ",", "3", ",", "4", ",", "5", ",", "6", ",", "7", "]", "check_digit", "=", "0", "for", "i", "in", "range", "(", "0", ",", "8", ")", ...
Calculates and returns a control digit for given list of digits basing on REGON standard.
[ "Calculates", "and", "returns", "a", "control", "digit", "for", "given", "list", "of", "digits", "basing", "on", "REGON", "standard", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pl_PL/__init__.py#L6-L21
train
Calculates and returns a control digit for given list of digits based on REGON 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/company/pl_PL/__init__.py
local_regon_checksum
def local_regon_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on local REGON standard. """ weights_for_check_digit = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8] check_digit = 0 for i in range(0, 13): check_digit += weights_for_check_digit[i] * ...
python
def local_regon_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on local REGON standard. """ weights_for_check_digit = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8] check_digit = 0 for i in range(0, 13): check_digit += weights_for_check_digit[i] * ...
[ "def", "local_regon_checksum", "(", "digits", ")", ":", "weights_for_check_digit", "=", "[", "2", ",", "4", ",", "8", ",", "5", ",", "0", ",", "9", ",", "7", ",", "3", ",", "6", ",", "1", ",", "2", ",", "4", ",", "8", "]", "check_digit", "=", ...
Calculates and returns a control digit for given list of digits basing on local REGON standard.
[ "Calculates", "and", "returns", "a", "control", "digit", "for", "given", "list", "of", "digits", "basing", "on", "local", "REGON", "standard", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pl_PL/__init__.py#L24-L39
train
Calculates and returns a control digit for given list of digits based on local REGON 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/company/pl_PL/__init__.py
company_vat_checksum
def company_vat_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on NIP standard. """ weights_for_check_digit = [6, 5, 7, 2, 3, 4, 5, 6, 7] check_digit = 0 for i in range(0, 9): check_digit += weights_for_check_digit[i] * digits[i] check_...
python
def company_vat_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on NIP standard. """ weights_for_check_digit = [6, 5, 7, 2, 3, 4, 5, 6, 7] check_digit = 0 for i in range(0, 9): check_digit += weights_for_check_digit[i] * digits[i] check_...
[ "def", "company_vat_checksum", "(", "digits", ")", ":", "weights_for_check_digit", "=", "[", "6", ",", "5", ",", "7", ",", "2", ",", "3", ",", "4", ",", "5", ",", "6", ",", "7", "]", "check_digit", "=", "0", "for", "i", "in", "range", "(", "0", ...
Calculates and returns a control digit for given list of digits basing on NIP standard.
[ "Calculates", "and", "returns", "a", "control", "digit", "for", "given", "list", "of", "digits", "basing", "on", "NIP", "standard", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pl_PL/__init__.py#L42-L54
train
Calculates and returns a control digit for given list of digits based on NIP 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/company/pl_PL/__init__.py
Provider.regon
def regon(self): """ Returns 9 character Polish National Business Registry Number, Polish: Rejestr Gospodarki Narodowej - REGON. https://pl.wikipedia.org/wiki/REGON """ voivodeship_number = self.random_int(0, 49) * 2 + 1 regon_digits = [int(voivodeship_number / 1...
python
def regon(self): """ Returns 9 character Polish National Business Registry Number, Polish: Rejestr Gospodarki Narodowej - REGON. https://pl.wikipedia.org/wiki/REGON """ voivodeship_number = self.random_int(0, 49) * 2 + 1 regon_digits = [int(voivodeship_number / 1...
[ "def", "regon", "(", "self", ")", ":", "voivodeship_number", "=", "self", ".", "random_int", "(", "0", ",", "49", ")", "*", "2", "+", "1", "regon_digits", "=", "[", "int", "(", "voivodeship_number", "/", "10", ")", ",", "voivodeship_number", "%", "10",...
Returns 9 character Polish National Business Registry Number, Polish: Rejestr Gospodarki Narodowej - REGON. https://pl.wikipedia.org/wiki/REGON
[ "Returns", "9", "character", "Polish", "National", "Business", "Registry", "Number", "Polish", ":", "Rejestr", "Gospodarki", "Narodowej", "-", "REGON", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pl_PL/__init__.py#L77-L92
train
Returns 9 character Polish National Business Registry 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/pl_PL/__init__.py
Provider.local_regon
def local_regon(self): """ Returns 14 character Polish National Business Registry Number, local entity number. https://pl.wikipedia.org/wiki/REGON """ regon_digits = [int(digit) for digit in list(self.regon())] for _ in range(4): regon_digits.append(...
python
def local_regon(self): """ Returns 14 character Polish National Business Registry Number, local entity number. https://pl.wikipedia.org/wiki/REGON """ regon_digits = [int(digit) for digit in list(self.regon())] for _ in range(4): regon_digits.append(...
[ "def", "local_regon", "(", "self", ")", ":", "regon_digits", "=", "[", "int", "(", "digit", ")", "for", "digit", "in", "list", "(", "self", ".", "regon", "(", ")", ")", "]", "for", "_", "in", "range", "(", "4", ")", ":", "regon_digits", ".", "app...
Returns 14 character Polish National Business Registry Number, local entity number. https://pl.wikipedia.org/wiki/REGON
[ "Returns", "14", "character", "Polish", "National", "Business", "Registry", "Number", "local", "entity", "number", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pl_PL/__init__.py#L94-L108
train
Returns 14 character Polish National Business Registry Number local entity 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/pl_PL/__init__.py
Provider.company_vat
def company_vat(self): """ Returns 10 character tax identification number, Polish: Numer identyfikacji podatkowej. https://pl.wikipedia.org/wiki/NIP """ vat_digits = [] for _ in range(3): vat_digits.append(self.random_digit_not_null()) for _...
python
def company_vat(self): """ Returns 10 character tax identification number, Polish: Numer identyfikacji podatkowej. https://pl.wikipedia.org/wiki/NIP """ vat_digits = [] for _ in range(3): vat_digits.append(self.random_digit_not_null()) for _...
[ "def", "company_vat", "(", "self", ")", ":", "vat_digits", "=", "[", "]", "for", "_", "in", "range", "(", "3", ")", ":", "vat_digits", ".", "append", "(", "self", ".", "random_digit_not_null", "(", ")", ")", "for", "_", "in", "range", "(", "6", ")"...
Returns 10 character tax identification number, Polish: Numer identyfikacji podatkowej. https://pl.wikipedia.org/wiki/NIP
[ "Returns", "10", "character", "tax", "identification", "number", "Polish", ":", "Numer", "identyfikacji", "podatkowej", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/company/pl_PL/__init__.py#L110-L134
train
Returns 10 character tax identification 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/ssn/pt_BR/__init__.py
checksum
def checksum(digits): """ Returns the checksum of CPF digits. References to the algorithm: https://pt.wikipedia.org/wiki/Cadastro_de_pessoas_f%C3%ADsicas#Algoritmo https://metacpan.org/source/MAMAWE/Algorithm-CheckDigits-v1.3.0/lib/Algorithm/CheckDigits/M11_004.pm """ s = 0 p = len(digit...
python
def checksum(digits): """ Returns the checksum of CPF digits. References to the algorithm: https://pt.wikipedia.org/wiki/Cadastro_de_pessoas_f%C3%ADsicas#Algoritmo https://metacpan.org/source/MAMAWE/Algorithm-CheckDigits-v1.3.0/lib/Algorithm/CheckDigits/M11_004.pm """ s = 0 p = len(digit...
[ "def", "checksum", "(", "digits", ")", ":", "s", "=", "0", "p", "=", "len", "(", "digits", ")", "+", "1", "for", "i", "in", "range", "(", "0", ",", "len", "(", "digits", ")", ")", ":", "s", "+=", "digits", "[", "i", "]", "*", "p", "p", "-...
Returns the checksum of CPF digits. References to the algorithm: https://pt.wikipedia.org/wiki/Cadastro_de_pessoas_f%C3%ADsicas#Algoritmo https://metacpan.org/source/MAMAWE/Algorithm-CheckDigits-v1.3.0/lib/Algorithm/CheckDigits/M11_004.pm
[ "Returns", "the", "checksum", "of", "CPF", "digits", ".", "References", "to", "the", "algorithm", ":", "https", ":", "//", "pt", ".", "wikipedia", ".", "org", "/", "wiki", "/", "Cadastro_de_pessoas_f%C3%ADsicas#Algoritmo", "https", ":", "//", "metacpan", ".", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/pt_BR/__init__.py#L8-L25
train
Returns the checksum of CPF digits.
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/pt_BR/__init__.py
Provider.rg
def rg(self): """ Brazilian RG, return plain numbers. Check: https://www.ngmatematica.com/2014/02/como-determinar-o-digito-verificador-do.html """ digits = self.generator.random.sample(range(0, 9), 8) checksum = sum(i * digits[i - 2] for i in range(2, 10)) last_...
python
def rg(self): """ Brazilian RG, return plain numbers. Check: https://www.ngmatematica.com/2014/02/como-determinar-o-digito-verificador-do.html """ digits = self.generator.random.sample(range(0, 9), 8) checksum = sum(i * digits[i - 2] for i in range(2, 10)) last_...
[ "def", "rg", "(", "self", ")", ":", "digits", "=", "self", ".", "generator", ".", "random", ".", "sample", "(", "range", "(", "0", ",", "9", ")", ",", "8", ")", "checksum", "=", "sum", "(", "i", "*", "digits", "[", "i", "-", "2", "]", "for", ...
Brazilian RG, return plain numbers. Check: https://www.ngmatematica.com/2014/02/como-determinar-o-digito-verificador-do.html
[ "Brazilian", "RG", "return", "plain", "numbers", ".", "Check", ":", "https", ":", "//", "www", ".", "ngmatematica", ".", "com", "/", "2014", "/", "02", "/", "como", "-", "determinar", "-", "o", "-", "digito", "-", "verificador", "-", "do", ".", "html...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/pt_BR/__init__.py#L49-L66
train
Brazilian RG returns plain numbers.
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/isbn/__init__.py
Provider._body
def _body(self): """ Generate the information required to create an ISBN-10 or ISBN-13. """ ean = self.random_element(RULES.keys()) reg_group = self.random_element(RULES[ean].keys()) # Given the chosen ean/group, decide how long the # registrant/publication str...
python
def _body(self): """ Generate the information required to create an ISBN-10 or ISBN-13. """ ean = self.random_element(RULES.keys()) reg_group = self.random_element(RULES[ean].keys()) # Given the chosen ean/group, decide how long the # registrant/publication str...
[ "def", "_body", "(", "self", ")", ":", "ean", "=", "self", ".", "random_element", "(", "RULES", ".", "keys", "(", ")", ")", "reg_group", "=", "self", ".", "random_element", "(", "RULES", "[", "ean", "]", ".", "keys", "(", ")", ")", "# Given the chose...
Generate the information required to create an ISBN-10 or ISBN-13.
[ "Generate", "the", "information", "required", "to", "create", "an", "ISBN", "-", "10", "or", "ISBN", "-", "13", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/isbn/__init__.py#L23-L42
train
Generate the information required to create an ISBN - 10 or ISBN - 13 or ISO - 1 or ISO - 1 or ISO - 1 or ISO - 1 or ISO - 1 or ISO - 1 or ISO - 1.
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/isbn/__init__.py
Provider._registrant_publication
def _registrant_publication(reg_pub, rules): """ Separate the registration from the publication in a given string. :param reg_pub: A string of digits representing a registration and publication. :param rules: A list of RegistrantRules which designate where to sepa...
python
def _registrant_publication(reg_pub, rules): """ Separate the registration from the publication in a given string. :param reg_pub: A string of digits representing a registration and publication. :param rules: A list of RegistrantRules which designate where to sepa...
[ "def", "_registrant_publication", "(", "reg_pub", ",", "rules", ")", ":", "for", "rule", "in", "rules", ":", "if", "rule", ".", "min", "<=", "reg_pub", "<=", "rule", ".", "max", ":", "reg_len", "=", "rule", ".", "registrant_length", "break", "else", ":",...
Separate the registration from the publication in a given string. :param reg_pub: A string of digits representing a registration and publication. :param rules: A list of RegistrantRules which designate where to separate the values in the string. :returns: A (regis...
[ "Separate", "the", "registration", "from", "the", "publication", "in", "a", "given", "string", ".", ":", "param", "reg_pub", ":", "A", "string", "of", "digits", "representing", "a", "registration", "and", "publication", ".", ":", "param", "rules", ":", "A", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/isbn/__init__.py#L45-L62
train
Separate the registration from the publication in a given 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/ssn/uk_UA/__init__.py
Provider.ssn
def ssn(self): """ Ukrainian "Реєстраційний номер облікової картки платника податків" also known as "Ідентифікаційний номер фізичної особи". """ digits = [] # Number of days between 1899-12-31 and a birth date for digit in str((self.generator.date_object() - ...
python
def ssn(self): """ Ukrainian "Реєстраційний номер облікової картки платника податків" also known as "Ідентифікаційний номер фізичної особи". """ digits = [] # Number of days between 1899-12-31 and a birth date for digit in str((self.generator.date_object() - ...
[ "def", "ssn", "(", "self", ")", ":", "digits", "=", "[", "]", "# Number of days between 1899-12-31 and a birth date", "for", "digit", "in", "str", "(", "(", "self", ".", "generator", ".", "date_object", "(", ")", "-", "date", "(", "1899", ",", "12", ",", ...
Ukrainian "Реєстраційний номер облікової картки платника податків" also known as "Ідентифікаційний номер фізичної особи".
[ "Ukrainian", "Реєстраційний", "номер", "облікової", "картки", "платника", "податків", "also", "known", "as", "Ідентифікаційний", "номер", "фізичної", "особи", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/uk_UA/__init__.py#L10-L32
train
Generate a random S - N 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/address/en_US/__init__.py
Provider.state_abbr
def state_abbr(self, include_territories=True): """ :returns: A random state or territory abbreviation. :param include_territories: If True, territories will be included. If False, only states will be returned. """ if include_territories: self.random_elem...
python
def state_abbr(self, include_territories=True): """ :returns: A random state or territory abbreviation. :param include_territories: If True, territories will be included. If False, only states will be returned. """ if include_territories: self.random_elem...
[ "def", "state_abbr", "(", "self", ",", "include_territories", "=", "True", ")", ":", "if", "include_territories", ":", "self", ".", "random_element", "(", "self", ".", "states_and_territories_abbr", ")", "return", "self", ".", "random_element", "(", "self", ".",...
:returns: A random state or territory abbreviation. :param include_territories: If True, territories will be included. If False, only states will be returned.
[ ":", "returns", ":", "A", "random", "state", "or", "territory", "abbreviation", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/en_US/__init__.py#L358-L367
train
Returns a random state or territory abbreviation.
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/python/__init__.py
Provider.pystr
def pystr(self, min_chars=None, max_chars=20): """ Generates a random string of upper and lowercase letters. :type min_chars: int :type max_chars: int :return: String. Random of random length between min and max characters. """ if min_chars is None: re...
python
def pystr(self, min_chars=None, max_chars=20): """ Generates a random string of upper and lowercase letters. :type min_chars: int :type max_chars: int :return: String. Random of random length between min and max characters. """ if min_chars is None: re...
[ "def", "pystr", "(", "self", ",", "min_chars", "=", "None", ",", "max_chars", "=", "20", ")", ":", "if", "min_chars", "is", "None", ":", "return", "\"\"", ".", "join", "(", "self", ".", "random_letters", "(", "length", "=", "max_chars", ")", ")", "el...
Generates a random string of upper and lowercase letters. :type min_chars: int :type max_chars: int :return: String. Random of random length between min and max characters.
[ "Generates", "a", "random", "string", "of", "upper", "and", "lowercase", "letters", ".", ":", "type", "min_chars", ":", "int", ":", "type", "max_chars", ":", "int", ":", "return", ":", "String", ".", "Random", "of", "random", "length", "between", "min", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/python/__init__.py#L17-L33
train
Generates a random string of upper and lowercase 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/python/__init__.py
Provider.pydict
def pydict(self, nb_elements=10, variable_nb_elements=True, *value_types): """ Returns a dictionary. :nb_elements: number of elements for dictionary :variable_nb_elements: is use variable number of elements for dictionary :value_types: type of dictionary values """ ...
python
def pydict(self, nb_elements=10, variable_nb_elements=True, *value_types): """ Returns a dictionary. :nb_elements: number of elements for dictionary :variable_nb_elements: is use variable number of elements for dictionary :value_types: type of dictionary values """ ...
[ "def", "pydict", "(", "self", ",", "nb_elements", "=", "10", ",", "variable_nb_elements", "=", "True", ",", "*", "value_types", ")", ":", "if", "variable_nb_elements", ":", "nb_elements", "=", "self", ".", "randomize_nb_elements", "(", "nb_elements", ",", "min...
Returns a dictionary. :nb_elements: number of elements for dictionary :variable_nb_elements: is use variable number of elements for dictionary :value_types: type of dictionary values
[ "Returns", "a", "dictionary", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/python/__init__.py#L141-L155
train
Returns a dictionary of the n elements of the class.
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/en_GB/__init__.py
Provider.postcode
def postcode(self): """ See http://web.archive.org/web/20090930140939/http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm """ postcode = '' pattern = self.random_element(self.postcode_formats) for placeholder in pattern: postcode += s...
python
def postcode(self): """ See http://web.archive.org/web/20090930140939/http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm """ postcode = '' pattern = self.random_element(self.postcode_formats) for placeholder in pattern: postcode += s...
[ "def", "postcode", "(", "self", ")", ":", "postcode", "=", "''", "pattern", "=", "self", ".", "random_element", "(", "self", ".", "postcode_formats", ")", "for", "placeholder", "in", "pattern", ":", "postcode", "+=", "self", ".", "random_element", "(", "se...
See http://web.archive.org/web/20090930140939/http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm
[ "See", "http", ":", "//", "web", ".", "archive", ".", "org", "/", "web", "/", "20090930140939", "/", "http", ":", "//", "www", ".", "govtalk", ".", "gov", ".", "uk", "/", "gdsc", "/", "html", "/", "noframes", "/", "PostCode", "-", "2", "-", "1", ...
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/en_GB/__init__.py#L317-L326
train
Generate a random postcode from the set of available postcodes.
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/hu_HU/__init__.py
Provider.ssn
def ssn(self, dob=None, gender=None): """ Generates Hungarian SSN equivalent (személyazonosító szám or, colloquially, személyi szám) :param dob: date of birth as a "YYMMDD" string - this determines the checksum regime and is also encoded in the személyazonosító szám. :type d...
python
def ssn(self, dob=None, gender=None): """ Generates Hungarian SSN equivalent (személyazonosító szám or, colloquially, személyi szám) :param dob: date of birth as a "YYMMDD" string - this determines the checksum regime and is also encoded in the személyazonosító szám. :type d...
[ "def", "ssn", "(", "self", ",", "dob", "=", "None", ",", "gender", "=", "None", ")", ":", "# Hungarian SSNs consist of 11 decimal characters, of the following", "# schema:", "#", "# M EEHHNN SSSK", "# ↑ ↑ ↑ ↑", "# gender bday ser check digit", "#", "#", ...
Generates Hungarian SSN equivalent (személyazonosító szám or, colloquially, személyi szám) :param dob: date of birth as a "YYMMDD" string - this determines the checksum regime and is also encoded in the személyazonosító szám. :type dob: str :param gender: gender of the person - "F" ...
[ "Generates", "Hungarian", "SSN", "equivalent", "(", "személyazonosító", "szám", "or", "colloquially", "személyi", "szám", ")" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/hu_HU/__init__.py#L16-L130
train
Generates Hungarian SSN equivalent for the given date and gender.
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/hy_AM/__init__.py
Provider.postcode_in_state
def postcode_in_state(self, state_abbr=None): """ :example '4703' """ if state_abbr is None: state_abbr = self.random_element(self.states_abbr) if state_abbr in self.states_abbr: postcode = "%d" % (self.generator.random.randint( ...
python
def postcode_in_state(self, state_abbr=None): """ :example '4703' """ if state_abbr is None: state_abbr = self.random_element(self.states_abbr) if state_abbr in self.states_abbr: postcode = "%d" % (self.generator.random.randint( ...
[ "def", "postcode_in_state", "(", "self", ",", "state_abbr", "=", "None", ")", ":", "if", "state_abbr", "is", "None", ":", "state_abbr", "=", "self", ".", "random_element", "(", "self", ".", "states_abbr", ")", "if", "state_abbr", "in", "self", ".", "states...
:example '4703'
[ ":", "example", "4703" ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/address/hy_AM/__init__.py#L622-L640
train
returns a random postcode in the 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...
joke2k/faker
faker/providers/ssn/nl_NL/__init__.py
Provider.ssn
def ssn(self): """ Returns a 9 digits Dutch SSN called "burgerservicenummer (BSN)". the Dutch "burgerservicenummer (BSN)" needs to pass the "11-proef", which is a check digit approach; this function essentially reverses the checksum steps to create a random valid BSN (which is 9...
python
def ssn(self): """ Returns a 9 digits Dutch SSN called "burgerservicenummer (BSN)". the Dutch "burgerservicenummer (BSN)" needs to pass the "11-proef", which is a check digit approach; this function essentially reverses the checksum steps to create a random valid BSN (which is 9...
[ "def", "ssn", "(", "self", ")", ":", "# see http://nl.wikipedia.org/wiki/Burgerservicenummer (in Dutch)", "def", "_checksum", "(", "digits", ")", ":", "factors", "=", "(", "9", ",", "8", ",", "7", ",", "6", ",", "5", ",", "4", ",", "3", ",", "2", ",", ...
Returns a 9 digits Dutch SSN called "burgerservicenummer (BSN)". the Dutch "burgerservicenummer (BSN)" needs to pass the "11-proef", which is a check digit approach; this function essentially reverses the checksum steps to create a random valid BSN (which is 9 digits).
[ "Returns", "a", "9", "digits", "Dutch", "SSN", "called", "burgerservicenummer", "(", "BSN", ")", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/nl_NL/__init__.py#L9-L39
train
Returns a 9 digits Dutch SSN called burgerservicenummer ( BSN ).
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/hr_HR/__init__.py
checksum
def checksum(digits): """ Calculate and return control digit for given list of digits based on ISO7064, MOD 11,10 standard. """ remainder = 10 for digit in digits: remainder = (remainder + digit) % 10 if remainder == 0: remainder = 10 remainder = (remainder * ...
python
def checksum(digits): """ Calculate and return control digit for given list of digits based on ISO7064, MOD 11,10 standard. """ remainder = 10 for digit in digits: remainder = (remainder + digit) % 10 if remainder == 0: remainder = 10 remainder = (remainder * ...
[ "def", "checksum", "(", "digits", ")", ":", "remainder", "=", "10", "for", "digit", "in", "digits", ":", "remainder", "=", "(", "remainder", "+", "digit", ")", "%", "10", "if", "remainder", "==", "0", ":", "remainder", "=", "10", "remainder", "=", "(...
Calculate and return control digit for given list of digits based on ISO7064, MOD 11,10 standard.
[ "Calculate", "and", "return", "control", "digit", "for", "given", "list", "of", "digits", "based", "on", "ISO7064", "MOD", "11", "10", "standard", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/hr_HR/__init__.py#L7-L22
train
Calculate and return control digit for given list of digits based on ISO7064 MOD 11 10 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/et_EE/__init__.py
checksum
def checksum(digits): """Calculate checksum of Estonian personal identity code. Checksum is calculated with "Modulo 11" method using level I or II scale: Level I scale: 1 2 3 4 5 6 7 8 9 1 Level II scale: 3 4 5 6 7 8 9 1 2 3 The digits of the personal code are multiplied by level I scale and summe...
python
def checksum(digits): """Calculate checksum of Estonian personal identity code. Checksum is calculated with "Modulo 11" method using level I or II scale: Level I scale: 1 2 3 4 5 6 7 8 9 1 Level II scale: 3 4 5 6 7 8 9 1 2 3 The digits of the personal code are multiplied by level I scale and summe...
[ "def", "checksum", "(", "digits", ")", ":", "sum_mod11", "=", "sum", "(", "map", "(", "operator", ".", "mul", ",", "digits", ",", "Provider", ".", "scale1", ")", ")", "%", "11", "if", "sum_mod11", "<", "10", ":", "return", "sum_mod11", "sum_mod11", "...
Calculate checksum of Estonian personal identity code. Checksum is calculated with "Modulo 11" method using level I or II scale: Level I scale: 1 2 3 4 5 6 7 8 9 1 Level II scale: 3 4 5 6 7 8 9 1 2 3 The digits of the personal code are multiplied by level I scale and summed; if remainder of modulo...
[ "Calculate", "checksum", "of", "Estonian", "personal", "identity", "code", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/et_EE/__init__.py#L9-L28
train
Calculate the checksum of Estonian 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/et_EE/__init__.py
Provider.ssn
def ssn(self, min_age=16, max_age=90): """ Returns 11 character Estonian personal identity code (isikukood, IK). Age of person is between 16 and 90 years, based on local computer date. This function assigns random sex to person. An Estonian Personal identification code consists ...
python
def ssn(self, min_age=16, max_age=90): """ Returns 11 character Estonian personal identity code (isikukood, IK). Age of person is between 16 and 90 years, based on local computer date. This function assigns random sex to person. An Estonian Personal identification code consists ...
[ "def", "ssn", "(", "self", ",", "min_age", "=", "16", ",", "max_age", "=", "90", ")", ":", "age", "=", "datetime", ".", "timedelta", "(", "days", "=", "self", ".", "generator", ".", "random", ".", "randrange", "(", "min_age", "*", "365", ",", "max_...
Returns 11 character Estonian personal identity code (isikukood, IK). Age of person is between 16 and 90 years, based on local computer date. This function assigns random sex to person. An Estonian Personal identification code consists of 11 digits, generally given without any whitespac...
[ "Returns", "11", "character", "Estonian", "personal", "identity", "code", "(", "isikukood", "IK", ")", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/ssn/et_EE/__init__.py#L35-L64
train
Generate a random SSS 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/geo/__init__.py
Provider.coordinate
def coordinate(self, center=None, radius=0.001): """ Optionally center the coord and pick a point within radius. """ if center is None: return Decimal(str(self.generator.random.randint(-180000000, 180000000) / 1000000.0)).quantize( Decimal(".000001"), ...
python
def coordinate(self, center=None, radius=0.001): """ Optionally center the coord and pick a point within radius. """ if center is None: return Decimal(str(self.generator.random.randint(-180000000, 180000000) / 1000000.0)).quantize( Decimal(".000001"), ...
[ "def", "coordinate", "(", "self", ",", "center", "=", "None", ",", "radius", "=", "0.001", ")", ":", "if", "center", "is", "None", ":", "return", "Decimal", "(", "str", "(", "self", ".", "generator", ".", "random", ".", "randint", "(", "-", "18000000...
Optionally center the coord and pick a point within radius.
[ "Optionally", "center", "the", "coord", "and", "pick", "a", "point", "within", "radius", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/geo/__init__.py#L978-L990
train
Return a random coordinate of the class.
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/geo/__init__.py
Provider.local_latlng
def local_latlng(self, country_code='US', coords_only=False): """Returns a location known to exist on land in a country specified by `country_code`. Defaults to 'en_US'. See the `land_coords` list for available locations/countries. """ results = [loc for loc in self.land_coords if loc[3]...
python
def local_latlng(self, country_code='US', coords_only=False): """Returns a location known to exist on land in a country specified by `country_code`. Defaults to 'en_US'. See the `land_coords` list for available locations/countries. """ results = [loc for loc in self.land_coords if loc[3]...
[ "def", "local_latlng", "(", "self", ",", "country_code", "=", "'US'", ",", "coords_only", "=", "False", ")", ":", "results", "=", "[", "loc", "for", "loc", "in", "self", ".", "land_coords", "if", "loc", "[", "3", "]", "==", "country_code", "]", "if", ...
Returns a location known to exist on land in a country specified by `country_code`. Defaults to 'en_US'. See the `land_coords` list for available locations/countries.
[ "Returns", "a", "location", "known", "to", "exist", "on", "land", "in", "a", "country", "specified", "by", "country_code", ".", "Defaults", "to", "en_US", ".", "See", "the", "land_coords", "list", "for", "available", "locations", "/", "countries", "." ]
965824b61132e52d92d1a6ce470396dbbe01c96c
https://github.com/joke2k/faker/blob/965824b61132e52d92d1a6ce470396dbbe01c96c/faker/providers/geo/__init__.py#L1002-L1009
train
Returns a random latlng from the list of locations known to exist on land in a country specified by country_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...