nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/schemes/elliptic_curves/ell_rational_field.py
python
EllipticCurve_rational_field.is_p_integral
(self, p)
return bool(misc.mul([x.valuation(p) >= 0 for x in self.ainvs()]))
r""" Return ``True`` if this elliptic curve has `p`-integral coefficients. INPUT: - ``p`` -- a prime integer EXAMPLES:: sage: E = EllipticCurve(QQ,[1,1]); E Elliptic Curve defined by y^2 = x^3 + x + 1 over Rational Field sage: E.is_p_integr...
r""" Return ``True`` if this elliptic curve has `p`-integral coefficients.
[ "r", "Return", "True", "if", "this", "elliptic", "curve", "has", "p", "-", "integral", "coefficients", "." ]
def is_p_integral(self, p): r""" Return ``True`` if this elliptic curve has `p`-integral coefficients. INPUT: - ``p`` -- a prime integer EXAMPLES:: sage: E = EllipticCurve(QQ,[1,1]); E Elliptic Curve defined by y^2 = x^3 + x + 1 over Rational F...
[ "def", "is_p_integral", "(", "self", ",", "p", ")", ":", "if", "not", "arith", ".", "is_prime", "(", "p", ")", ":", "raise", "ArithmeticError", "(", "\"p must be prime\"", ")", "if", "self", ".", "is_integral", "(", ")", ":", "return", "True", "return", ...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/schemes/elliptic_curves/ell_rational_field.py#L357-L383
custom-components/alexa_media_player
45406d2fe39bb11848df4679d5d313fc19bad772
custom_components/alexa_media/light.py
python
async_unload_entry
(hass, entry)
return True
Unload a config entry.
Unload a config entry.
[ "Unload", "a", "config", "entry", "." ]
async def async_unload_entry(hass, entry) -> bool: """Unload a config entry.""" account = entry.data[CONF_EMAIL] account_dict = hass.data[DATA_ALEXAMEDIA]["accounts"][account] _LOGGER.debug("Attempting to unload lights") for light in account_dict["entities"]["light"]: await light.async_remov...
[ "async", "def", "async_unload_entry", "(", "hass", ",", "entry", ")", "->", "bool", ":", "account", "=", "entry", ".", "data", "[", "CONF_EMAIL", "]", "account_dict", "=", "hass", ".", "data", "[", "DATA_ALEXAMEDIA", "]", "[", "\"accounts\"", "]", "[", "...
https://github.com/custom-components/alexa_media_player/blob/45406d2fe39bb11848df4679d5d313fc19bad772/custom_components/alexa_media/light.py#L120-L127
psychopy/psychopy
01b674094f38d0e0bd51c45a6f66f671d7041696
psychopy/visual/bufferimage.py
python
BufferImageStim.setFlipVert
(self, newVal=True, log=None)
Usually you can use 'stim.attribute = value' syntax instead, but use this method if you need to suppress the log message.
Usually you can use 'stim.attribute = value' syntax instead, but use this method if you need to suppress the log message.
[ "Usually", "you", "can", "use", "stim", ".", "attribute", "=", "value", "syntax", "instead", "but", "use", "this", "method", "if", "you", "need", "to", "suppress", "the", "log", "message", "." ]
def setFlipVert(self, newVal=True, log=None): """Usually you can use 'stim.attribute = value' syntax instead, but use this method if you need to suppress the log message. """ setAttribute(self, 'flipVert', newVal, log)
[ "def", "setFlipVert", "(", "self", ",", "newVal", "=", "True", ",", "log", "=", "None", ")", ":", "setAttribute", "(", "self", ",", "'flipVert'", ",", "newVal", ",", "log", ")" ]
https://github.com/psychopy/psychopy/blob/01b674094f38d0e0bd51c45a6f66f671d7041696/psychopy/visual/bufferimage.py#L201-L205
amonapp/amon
61ae3575ad98ec4854ea87c213aa8dfbb29a0199
amon/utils/dates.py
python
dateformatcharts_local
(value, tz='UTC',format="%d.%m.%Y-%H:%M")
return result
[]
def dateformatcharts_local(value, tz='UTC',format="%d.%m.%Y-%H:%M"): result = None try: value = utc_unixtime_to_localtime(value, tz=tz) except: value = None if value: result = dateformat(value, format) return result
[ "def", "dateformatcharts_local", "(", "value", ",", "tz", "=", "'UTC'", ",", "format", "=", "\"%d.%m.%Y-%H:%M\"", ")", ":", "result", "=", "None", "try", ":", "value", "=", "utc_unixtime_to_localtime", "(", "value", ",", "tz", "=", "tz", ")", "except", ":"...
https://github.com/amonapp/amon/blob/61ae3575ad98ec4854ea87c213aa8dfbb29a0199/amon/utils/dates.py#L172-L183
joxeankoret/pyew
8eb3e49a9bf57c0787fa79ecae0671129ef3f2e8
envi/registers.py
python
RegisterContext.setProgramCounter
(self, value)
Set the value of the program counter for this register contex.
Set the value of the program counter for this register contex.
[ "Set", "the", "value", "of", "the", "program", "counter", "for", "this", "register", "contex", "." ]
def setProgramCounter(self, value): """ Set the value of the program counter for this register contex. """ self.setRegister(self._rctx_pcindex, value)
[ "def", "setProgramCounter", "(", "self", ",", "value", ")", ":", "self", ".", "setRegister", "(", "self", ".", "_rctx_pcindex", ",", "value", ")" ]
https://github.com/joxeankoret/pyew/blob/8eb3e49a9bf57c0787fa79ecae0671129ef3f2e8/envi/registers.py#L185-L190
eventlet/eventlet
955be1c7227a6df0daa537ebb8aed0cfa174d2e5
eventlet/green/http/client.py
python
HTTPConnection.getresponse
(self)
Get the response from the server. If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by the response_class variable. If a request has not been sent or if a previous response has not be handled, ResponseNotReady i...
Get the response from the server.
[ "Get", "the", "response", "from", "the", "server", "." ]
def getresponse(self): """Get the response from the server. If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by the response_class variable. If a request has not been sent or if a previous response has ...
[ "def", "getresponse", "(", "self", ")", ":", "# if a prior response has been completed, then forget about it.", "if", "self", ".", "__response", "and", "self", ".", "__response", ".", "isclosed", "(", ")", ":", "self", ".", "__response", "=", "None", "# if a prior r...
https://github.com/eventlet/eventlet/blob/955be1c7227a6df0daa537ebb8aed0cfa174d2e5/eventlet/green/http/client.py#L1382-L1443
Kronuz/esprima-python
809cb6e257b1d3d5b0d23f2bca7976e21f02fc3d
esprima/scanner.py
python
Scanner.octalToDecimal
(self, ch)
return Octal(octal, code)
[]
def octalToDecimal(self, ch): # \0 is not octal escape sequence octal = ch != '0' code = octalValue(ch) if not self.eof() and Character.isOctalDigit(self.source[self.index]): octal = True code = code * 8 + octalValue(self.source[self.index]) self.inde...
[ "def", "octalToDecimal", "(", "self", ",", "ch", ")", ":", "# \\0 is not octal escape sequence", "octal", "=", "ch", "!=", "'0'", "code", "=", "octalValue", "(", "ch", ")", "if", "not", "self", ".", "eof", "(", ")", "and", "Character", ".", "isOctalDigit",...
https://github.com/Kronuz/esprima-python/blob/809cb6e257b1d3d5b0d23f2bca7976e21f02fc3d/esprima/scanner.py#L484-L500
largelymfs/topical_word_embeddings
1ae3d15d0afcd3fcd39cc81eec4ad9463413a9f6
TWE-2/gensim/corpora/hashdictionary.py
python
HashDictionary.keys
(self)
return range(len(self))
Return a list of all token ids.
Return a list of all token ids.
[ "Return", "a", "list", "of", "all", "token", "ids", "." ]
def keys(self): """Return a list of all token ids.""" return range(len(self))
[ "def", "keys", "(", "self", ")", ":", "return", "range", "(", "len", "(", "self", ")", ")" ]
https://github.com/largelymfs/topical_word_embeddings/blob/1ae3d15d0afcd3fcd39cc81eec4ad9463413a9f6/TWE-2/gensim/corpora/hashdictionary.py#L104-L106
HymanLiuTS/flaskTs
286648286976e85d9b9a5873632331efcafe0b21
flasky/lib/python2.7/site-packages/sqlalchemy/orm/instrumentation.py
python
InstrumentationFactory._locate_extended_factory
(self, class_)
return None, None
Overridden by a subclass to do an extended lookup.
Overridden by a subclass to do an extended lookup.
[ "Overridden", "by", "a", "subclass", "to", "do", "an", "extended", "lookup", "." ]
def _locate_extended_factory(self, class_): """Overridden by a subclass to do an extended lookup.""" return None, None
[ "def", "_locate_extended_factory", "(", "self", ",", "class_", ")", ":", "return", "None", ",", "None" ]
https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/sqlalchemy/orm/instrumentation.py#L425-L427
ifwe/digsby
f5fe00244744aa131e07f09348d10563f3d8fa99
digsby/src/msn/oim.py
python
OIM.__init__
(self, acct, m_tag)
http://msnpiki.msnfanatic.com/index.php/MSNP13:Offline_IM * T: Unknown, but has so far only been set to 11. * S: Unknown, but has so far only been set to 6. * RT: The date/time stamp for when the message was received by the server. This stamp can be used to sort the message in t...
http://msnpiki.msnfanatic.com/index.php/MSNP13:Offline_IM
[ "http", ":", "//", "msnpiki", ".", "msnfanatic", ".", "com", "/", "index", ".", "php", "/", "MSNP13", ":", "Offline_IM" ]
def __init__(self, acct, m_tag): ''' http://msnpiki.msnfanatic.com/index.php/MSNP13:Offline_IM * T: Unknown, but has so far only been set to 11. * S: Unknown, but has so far only been set to 6. * RT: The date/time stamp for when the message was received by the server. ...
[ "def", "__init__", "(", "self", ",", "acct", ",", "m_tag", ")", ":", "self", ".", "acct", "=", "acct", "self", ".", "size", "=", "int", "(", "str", "(", "m_tag", ".", "SZ", ")", ")", "self", ".", "email", "=", "str", "(", "m_tag", ".", "E", "...
https://github.com/ifwe/digsby/blob/f5fe00244744aa131e07f09348d10563f3d8fa99/digsby/src/msn/oim.py#L121-L190
operatorequals/covertutils
2d1eae695f8a4ace12331ce3dc31125eb3d308df
covertutils/datamanipulation/stegoinjector.py
python
StegoInjector.guessTemplate
( self, pkt )
return winner[-1]
This method tries to guess the used template of a data packet by computing similarity of all templates against it. :param str pkt: The data packet whose template is guessed. :rtype: str :return: A tuple containing the template name that matches best with the given packets and the similarity ratio.
This method tries to guess the used template of a data packet by computing similarity of all templates against it.
[ "This", "method", "tries", "to", "guess", "the", "used", "template", "of", "a", "data", "packet", "by", "computing", "similarity", "of", "all", "templates", "against", "it", "." ]
def guessTemplate( self, pkt ) : """ This method tries to guess the used template of a data packet by computing similarity of all templates against it. :param str pkt: The data packet whose template is guessed. :rtype: str :return: A tuple containing the template name that matches best with the given packets and the...
[ "def", "guessTemplate", "(", "self", ",", "pkt", ")", ":", "ret", "=", "[", "]", "for", "template", "in", "self", ".", "__packets", ".", "keys", "(", ")", ":", "cap", "=", "self", ".", "getCapacity", "(", "template", ")", "payload", "=", "\"\\x00\"",...
https://github.com/operatorequals/covertutils/blob/2d1eae695f8a4ace12331ce3dc31125eb3d308df/covertutils/datamanipulation/stegoinjector.py#L512-L540
microsoft/nni
31f11f51249660930824e888af0d4e022823285c
nni/tools/nnictl/config_schema.py
python
setType
(key, valueType)
return And(valueType, error=SCHEMA_TYPE_ERROR % (key, valueType.__name__))
check key type
check key type
[ "check", "key", "type" ]
def setType(key, valueType): '''check key type''' return And(valueType, error=SCHEMA_TYPE_ERROR % (key, valueType.__name__))
[ "def", "setType", "(", "key", ",", "valueType", ")", ":", "return", "And", "(", "valueType", ",", "error", "=", "SCHEMA_TYPE_ERROR", "%", "(", "key", ",", "valueType", ".", "__name__", ")", ")" ]
https://github.com/microsoft/nni/blob/31f11f51249660930824e888af0d4e022823285c/nni/tools/nnictl/config_schema.py#L19-L21
zuoxingdong/mazelab
236eef5f7c41b86bb784f506fe1a2e0700a2e48f
mazelab/maze.py
python
BaseMaze.size
(self)
r"""Returns a pair of (height, width).
r"""Returns a pair of (height, width).
[ "r", "Returns", "a", "pair", "of", "(", "height", "width", ")", "." ]
def size(self): r"""Returns a pair of (height, width). """ pass
[ "def", "size", "(", "self", ")", ":", "pass" ]
https://github.com/zuoxingdong/mazelab/blob/236eef5f7c41b86bb784f506fe1a2e0700a2e48f/mazelab/maze.py#L21-L23
mete0r/pyhwp
c0ba652ea53e9c29a4f672491863d64cded2db5b
src/hwp5/binmodel/tagid53_para_line_seg.py
python
ParaLineSeg.attributes
(cls)
표 57 문단의 레이아웃
표 57 문단의 레이아웃
[ "표", "57", "문단의", "레이아웃" ]
def attributes(cls): ''' 표 57 문단의 레이아웃 ''' yield dict(name='linesegs', type=X_ARRAY(LineSeg, ref_parent_member('linesegs')))
[ "def", "attributes", "(", "cls", ")", ":", "yield", "dict", "(", "name", "=", "'linesegs'", ",", "type", "=", "X_ARRAY", "(", "LineSeg", ",", "ref_parent_member", "(", "'linesegs'", ")", ")", ")" ]
https://github.com/mete0r/pyhwp/blob/c0ba652ea53e9c29a4f672491863d64cded2db5b/src/hwp5/binmodel/tagid53_para_line_seg.py#L66-L69
realpython/book2-exercises
cde325eac8e6d8cff2316601c2e5b36bb46af7d0
web2py/venv/lib/python2.7/site-packages/pip/utils/ui.py
python
InterruptibleMixin.finish
(self)
Restore the original SIGINT handler after finishing. This should happen regardless of whether the progress display finishes normally, or gets interrupted.
Restore the original SIGINT handler after finishing.
[ "Restore", "the", "original", "SIGINT", "handler", "after", "finishing", "." ]
def finish(self): """ Restore the original SIGINT handler after finishing. This should happen regardless of whether the progress display finishes normally, or gets interrupted. """ super(InterruptibleMixin, self).finish() signal(SIGINT, self.original_handler)
[ "def", "finish", "(", "self", ")", ":", "super", "(", "InterruptibleMixin", ",", "self", ")", ".", "finish", "(", ")", "signal", "(", "SIGINT", ",", "self", ".", "original_handler", ")" ]
https://github.com/realpython/book2-exercises/blob/cde325eac8e6d8cff2316601c2e5b36bb46af7d0/web2py/venv/lib/python2.7/site-packages/pip/utils/ui.py#L94-L102
hildogjr/KiCost
227f246d8c0f5dab145390d15c94ee2c3d6c790c
kicost/edas/__init__.py
python
get_part_groups
(eda, in_file, ignore_fields, variant, distributors)
return eda_class.get_part_groups(eda, in_file, ignore_fields, variant, distributors)
Get the parts for a file using the indicated EDA
Get the parts for a file using the indicated EDA
[ "Get", "the", "parts", "for", "a", "file", "using", "the", "indicated", "EDA" ]
def get_part_groups(eda, in_file, ignore_fields, variant, distributors): ''' Get the parts for a file using the indicated EDA ''' return eda_class.get_part_groups(eda, in_file, ignore_fields, variant, distributors)
[ "def", "get_part_groups", "(", "eda", ",", "in_file", ",", "ignore_fields", ",", "variant", ",", "distributors", ")", ":", "return", "eda_class", ".", "get_part_groups", "(", "eda", ",", "in_file", ",", "ignore_fields", ",", "variant", ",", "distributors", ")"...
https://github.com/hildogjr/KiCost/blob/227f246d8c0f5dab145390d15c94ee2c3d6c790c/kicost/edas/__init__.py#L47-L49
SCons/scons
309f0234d1d9cc76955818be47c5c722f577dac6
SCons/Memoize.py
python
CountDictCall
(keyfunc)
return decorator
Decorator for counting memoizer hits/misses while accessing dictionary values with a key-generating function. Like CountMethodCall above, it wraps the given method fn and uses a CountDict object to keep track of the caching statistics. The dict-key function keyfunc has to get pas...
Decorator for counting memoizer hits/misses while accessing dictionary values with a key-generating function. Like CountMethodCall above, it wraps the given method fn and uses a CountDict object to keep track of the caching statistics. The dict-key function keyfunc has to get pas...
[ "Decorator", "for", "counting", "memoizer", "hits", "/", "misses", "while", "accessing", "dictionary", "values", "with", "a", "key", "-", "generating", "function", ".", "Like", "CountMethodCall", "above", "it", "wraps", "the", "given", "method", "fn", "and", "...
def CountDictCall(keyfunc): """ Decorator for counting memoizer hits/misses while accessing dictionary values with a key-generating function. Like CountMethodCall above, it wraps the given method fn and uses a CountDict object to keep track of the caching statistics. The dict-key fun...
[ "def", "CountDictCall", "(", "keyfunc", ")", ":", "def", "decorator", "(", "fn", ")", ":", "if", "use_memoizer", ":", "def", "wrapper", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "global", "CounterList", "key", "=", "self", "."...
https://github.com/SCons/scons/blob/309f0234d1d9cc76955818be47c5c722f577dac6/SCons/Memoize.py#L213-L236
vivisect/vivisect
37b0b655d8dedfcf322e86b0f144b096e48d547e
vtrace/util.py
python
TraceManager.fireLocalNotifiers
(self, event, trace)
Deliver a local event to the DistributedNotifier managing the traces. (used to locally bump notifiers)
Deliver a local event to the DistributedNotifier managing the traces. (used to locally bump notifiers)
[ "Deliver", "a", "local", "event", "to", "the", "DistributedNotifier", "managing", "the", "traces", ".", "(", "used", "to", "locally", "bump", "notifiers", ")" ]
def fireLocalNotifiers(self, event, trace): """ Deliver a local event to the DistributedNotifier managing the traces. (used to locally bump notifiers) """ self.dnotif.notify(event, trace)
[ "def", "fireLocalNotifiers", "(", "self", ",", "event", ",", "trace", ")", ":", "self", ".", "dnotif", ".", "notify", "(", "event", ",", "trace", ")" ]
https://github.com/vivisect/vivisect/blob/37b0b655d8dedfcf322e86b0f144b096e48d547e/vtrace/util.py#L73-L78
Calysto/calysto_scheme
15bf81987870bcae1264e5a0a06feb9a8ee12b8b
calysto_scheme/src/Scheme.py
python
make_cont4
(*args)
return List(symbol_continuation4, *args)
[]
def make_cont4(*args): return List(symbol_continuation4, *args)
[ "def", "make_cont4", "(", "*", "args", ")", ":", "return", "List", "(", "symbol_continuation4", ",", "*", "args", ")" ]
https://github.com/Calysto/calysto_scheme/blob/15bf81987870bcae1264e5a0a06feb9a8ee12b8b/calysto_scheme/src/Scheme.py#L515-L516
driving-behavior/DBNet
c32ad78afb9f83e354eae7eb6793dbeef7e83bac
train_demo.py
python
train_one_epoch
(sess, ops, train_writer, data_input)
ops: dict mapping from string to tf ops
ops: dict mapping from string to tf ops
[ "ops", ":", "dict", "mapping", "from", "string", "to", "tf", "ops" ]
def train_one_epoch(sess, ops, train_writer, data_input): """ ops: dict mapping from string to tf ops """ is_training = True num_batches = data_input.num_train // BATCH_SIZE loss_sum = 0 acc_a_sum = 0 acc_s_sum = 0 for batch_idx in range(num_batches): if "io" in MODEL_FILE: ...
[ "def", "train_one_epoch", "(", "sess", ",", "ops", ",", "train_writer", ",", "data_input", ")", ":", "is_training", "=", "True", "num_batches", "=", "data_input", ".", "num_train", "//", "BATCH_SIZE", "loss_sum", "=", "0", "acc_a_sum", "=", "0", "acc_s_sum", ...
https://github.com/driving-behavior/DBNet/blob/c32ad78afb9f83e354eae7eb6793dbeef7e83bac/train_demo.py#L178-L216
seveas/git-spindle
322afc25e9ecd3a4d2cf083d728e8ef2484fab45
lib/gitspindle/github.py
python
GitHub.issues
(self, opts)
[<repo>] [--parent] [<filter>...] List issues in a repository
[<repo>] [--parent] [<filter>...] List issues in a repository
[ "[", "<repo", ">", "]", "[", "--", "parent", "]", "[", "<filter", ">", "...", "]", "List", "issues", "in", "a", "repository" ]
def issues(self, opts): """[<repo>] [--parent] [<filter>...] List issues in a repository""" if opts['<repo>'] and '=' in opts['<repo>']: opts['<filter>'].insert(0, opts['<repo>']) opts['<repo>'] = None if (not opts['<repo>'] and not self.in_repo) or opts['<repo...
[ "def", "issues", "(", "self", ",", "opts", ")", ":", "if", "opts", "[", "'<repo>'", "]", "and", "'='", "in", "opts", "[", "'<repo>'", "]", ":", "opts", "[", "'<filter>'", "]", ".", "insert", "(", "0", ",", "opts", "[", "'<repo>'", "]", ")", "opts...
https://github.com/seveas/git-spindle/blob/322afc25e9ecd3a4d2cf083d728e8ef2484fab45/lib/gitspindle/github.py#L790-L819
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/plugins/attack/db/sqlmap/lib/utils/api.py
python
task_delete
(taskid)
Delete own task ID
Delete own task ID
[ "Delete", "own", "task", "ID" ]
def task_delete(taskid): """ Delete own task ID """ if taskid in DataStore.tasks: DataStore.tasks.pop(taskid) logger.debug("[%s] Deleted task" % taskid) return jsonize({"success": True}) else: logger.warning("[%s] Invalid task ID provided to task_delete()" % taskid) ...
[ "def", "task_delete", "(", "taskid", ")", ":", "if", "taskid", "in", "DataStore", ".", "tasks", ":", "DataStore", ".", "tasks", ".", "pop", "(", "taskid", ")", "logger", ".", "debug", "(", "\"[%s] Deleted task\"", "%", "taskid", ")", "return", "jsonize", ...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/plugins/attack/db/sqlmap/lib/utils/api.py#L383-L394
tflearn/tflearn
db5176773299b67a2a75c5889fb2aba7fd0fea8a
tflearn/layers/recurrent.py
python
_linear
(args, output_size, bias, bias_start=0.0, weights_init=None, trainable=True, restore=True, reuse=False, scope=None)
return res + bias_term
Linear map: sum_i(args[i] * W[i]), where W[i] is a variable. Arguments: args: a 2D Tensor or a list of 2D, batch x n, Tensors. output_size: int, second dimension of W[i]. bias: boolean, whether to add a bias term or not. bias_start: starting value to initialize the bias; 0 by defaul...
Linear map: sum_i(args[i] * W[i]), where W[i] is a variable.
[ "Linear", "map", ":", "sum_i", "(", "args", "[", "i", "]", "*", "W", "[", "i", "]", ")", "where", "W", "[", "i", "]", "is", "a", "variable", "." ]
def _linear(args, output_size, bias, bias_start=0.0, weights_init=None, trainable=True, restore=True, reuse=False, scope=None): """Linear map: sum_i(args[i] * W[i]), where W[i] is a variable. Arguments: args: a 2D Tensor or a list of 2D, batch x n, Tensors. output_size: int, second ...
[ "def", "_linear", "(", "args", ",", "output_size", ",", "bias", ",", "bias_start", "=", "0.0", ",", "weights_init", "=", "None", ",", "trainable", "=", "True", ",", "restore", "=", "True", ",", "reuse", "=", "False", ",", "scope", "=", "None", ")", "...
https://github.com/tflearn/tflearn/blob/db5176773299b67a2a75c5889fb2aba7fd0fea8a/tflearn/layers/recurrent.py#L698-L749
zachwill/flask-engine
7c8ad4bfe36382a8c9286d873ec7b785715832a4
libs/flask/blueprints.py
python
Blueprint.before_request
(self, f)
return f
Like :meth:`Flask.before_request` but for a blueprint. This function is only executed before each request that is handled by a function of that blueprint.
Like :meth:`Flask.before_request` but for a blueprint. This function is only executed before each request that is handled by a function of that blueprint.
[ "Like", ":", "meth", ":", "Flask", ".", "before_request", "but", "for", "a", "blueprint", ".", "This", "function", "is", "only", "executed", "before", "each", "request", "that", "is", "handled", "by", "a", "function", "of", "that", "blueprint", "." ]
def before_request(self, f): """Like :meth:`Flask.before_request` but for a blueprint. This function is only executed before each request that is handled by a function of that blueprint. """ self.record_once(lambda s: s.app.before_request_funcs .setdefault(self.name,...
[ "def", "before_request", "(", "self", ",", "f", ")", ":", "self", ".", "record_once", "(", "lambda", "s", ":", "s", ".", "app", ".", "before_request_funcs", ".", "setdefault", "(", "self", ".", "name", ",", "[", "]", ")", ".", "append", "(", "f", "...
https://github.com/zachwill/flask-engine/blob/7c8ad4bfe36382a8c9286d873ec7b785715832a4/libs/flask/blueprints.py#L212-L219
vulscanteam/vulscan
787397e267c4e6469522ee0abe55b3e98f968d4a
pocsuite/thirdparty/requests/adapters.py
python
HTTPAdapter.add_headers
(self, request, **kwargs)
Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. This should not be called from user code, and is only exposed for use when subclassing the ...
Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
[ "Add", "any", "headers", "needed", "by", "the", "connection", ".", "As", "of", "v2", ".", "0", "this", "does", "nothing", "by", "default", "but", "is", "left", "for", "overriding", "by", "users", "that", "subclass", "the", ":", "class", ":", "HTTPAdapter...
def add_headers(self, request, **kwargs): """Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. This should not be called from user code, and is on...
[ "def", "add_headers", "(", "self", ",", "request", ",", "*", "*", "kwargs", ")", ":", "pass" ]
https://github.com/vulscanteam/vulscan/blob/787397e267c4e6469522ee0abe55b3e98f968d4a/pocsuite/thirdparty/requests/adapters.py#L287-L299
AppScale/gts
46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9
AppServer/lib/yaml-3.10/yaml/__init__.py
python
safe_dump_all
(documents, stream=None, **kwds)
return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.
Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.
[ "Serialize", "a", "sequence", "of", "Python", "objects", "into", "a", "YAML", "stream", ".", "Produce", "only", "basic", "YAML", "tags", ".", "If", "stream", "is", "None", "return", "the", "produced", "string", "instead", "." ]
def safe_dump_all(documents, stream=None, **kwds): """ Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead. """ return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
[ "def", "safe_dump_all", "(", "documents", ",", "stream", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "dump_all", "(", "documents", ",", "stream", ",", "Dumper", "=", "SafeDumper", ",", "*", "*", "kwds", ")" ]
https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/yaml-3.10/yaml/__init__.py#L204-L210
shiweibsw/Translation-Tools
2fbbf902364e557fa7017f9a74a8797b7440c077
venv/Lib/site-packages/pip-9.0.3-py3.6.egg/pip/_vendor/pkg_resources/__init__.py
python
ResourceManager.postprocess
(self, tempname, filename)
Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully extracting a compressed resource. They must NOT c...
Perform any platform-specific postprocessing of `tempname`
[ "Perform", "any", "platform", "-", "specific", "postprocessing", "of", "tempname" ]
def postprocess(self, tempname, filename): """Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully ...
[ "def", "postprocess", "(", "self", ",", "tempname", ",", "filename", ")", ":", "if", "os", ".", "name", "==", "'posix'", ":", "# Make the resource executable", "mode", "=", "(", "(", "os", ".", "stat", "(", "tempname", ")", ".", "st_mode", ")", "|", "0...
https://github.com/shiweibsw/Translation-Tools/blob/2fbbf902364e557fa7017f9a74a8797b7440c077/venv/Lib/site-packages/pip-9.0.3-py3.6.egg/pip/_vendor/pkg_resources/__init__.py#L1301-L1319
bookwyrm-social/bookwyrm
0c2537e27a2cdbc0136880dfbbf170d5fec72986
bookwyrm/thumbnail_generation.py
python
Strategy.on_source_saved
(self, file)
What happens on source saved
What happens on source saved
[ "What", "happens", "on", "source", "saved" ]
def on_source_saved(self, file): # pylint: disable=no-self-use """What happens on source saved""" file.generate()
[ "def", "on_source_saved", "(", "self", ",", "file", ")", ":", "# pylint: disable=no-self-use", "file", ".", "generate", "(", ")" ]
https://github.com/bookwyrm-social/bookwyrm/blob/0c2537e27a2cdbc0136880dfbbf170d5fec72986/bookwyrm/thumbnail_generation.py#L10-L12
oxwhirl/smac
456d133f40030e60f27bc7a85d2c5bdf96f6ad56
smac/env/multiagentenv.py
python
MultiAgentEnv.get_avail_agent_actions
(self, agent_id)
Returns the available actions for agent_id.
Returns the available actions for agent_id.
[ "Returns", "the", "available", "actions", "for", "agent_id", "." ]
def get_avail_agent_actions(self, agent_id): """Returns the available actions for agent_id.""" raise NotImplementedError
[ "def", "get_avail_agent_actions", "(", "self", ",", "agent_id", ")", ":", "raise", "NotImplementedError" ]
https://github.com/oxwhirl/smac/blob/456d133f40030e60f27bc7a85d2c5bdf96f6ad56/smac/env/multiagentenv.py#L35-L37
Allianzcortex/MusicRecommenderSystem
cfd51d851baaa1d5b32d45c03e4c3ef043e919f0
forum/forms.py
python
CreateForm.clean_content
(self)
return self.cleaned_data.get('content')
content = self.cleaned_data.get('content') for str in settings.LAW_RESERVED: if content.find(str): raise forms.ValidationError(u'Illegal content')
content = self.cleaned_data.get('content') for str in settings.LAW_RESERVED: if content.find(str): raise forms.ValidationError(u'Illegal content')
[ "content", "=", "self", ".", "cleaned_data", ".", "get", "(", "content", ")", "for", "str", "in", "settings", ".", "LAW_RESERVED", ":", "if", "content", ".", "find", "(", "str", ")", ":", "raise", "forms", ".", "ValidationError", "(", "u", "Illegal", "...
def clean_content(self): ''' content = self.cleaned_data.get('content') for str in settings.LAW_RESERVED: if content.find(str): raise forms.ValidationError(u'Illegal content') ''' return self.cleaned_data.get('content')
[ "def", "clean_content", "(", "self", ")", ":", "return", "self", ".", "cleaned_data", ".", "get", "(", "'content'", ")" ]
https://github.com/Allianzcortex/MusicRecommenderSystem/blob/cfd51d851baaa1d5b32d45c03e4c3ef043e919f0/forum/forms.py#L32-L39
taokong/RON
c62d0edbf6bfe4913d044693463bed199687cdb8
lib/pycocotools/cocoeval.py
python
COCOeval.summarize
(self)
Compute and display summary metrics for evaluation results. Note this functin can *only* be applied on the default parameter setting
Compute and display summary metrics for evaluation results. Note this functin can *only* be applied on the default parameter setting
[ "Compute", "and", "display", "summary", "metrics", "for", "evaluation", "results", ".", "Note", "this", "functin", "can", "*", "only", "*", "be", "applied", "on", "the", "default", "parameter", "setting" ]
def summarize(self): ''' Compute and display summary metrics for evaluation results. Note this functin can *only* be applied on the default parameter setting ''' def _summarize( ap=1, iouThr=None, areaRng='all', maxDets=100 ): p = self.params iStr =...
[ "def", "summarize", "(", "self", ")", ":", "def", "_summarize", "(", "ap", "=", "1", ",", "iouThr", "=", "None", ",", "areaRng", "=", "'all'", ",", "maxDets", "=", "100", ")", ":", "p", "=", "self", ".", "params", "iStr", "=", "' {:<18} {} @[ IoU={:<...
https://github.com/taokong/RON/blob/c62d0edbf6bfe4913d044693463bed199687cdb8/lib/pycocotools/cocoeval.py#L376-L426
suurjaak/Skyperious
6a4f264dbac8d326c2fa8aeb5483dbca987860bf
skyperious/skypedata.py
python
SkypeDatabase.make_title_col
(self, table="conversations", alias=None)
return "CASE %s ELSE '#' || %s.id END" % (result.strip(), alias or table)
Returns SQL expression for selecting chat/contact/account title.
Returns SQL expression for selecting chat/contact/account title.
[ "Returns", "SQL", "expression", "for", "selecting", "chat", "/", "contact", "/", "account", "title", "." ]
def make_title_col(self, table="conversations", alias=None): """Returns SQL expression for selecting chat/contact/account title.""" PREFS = ["given_displayname", "fullname", "displayname", "meta_topic", "liveid_membername", "skypename", "pstnnumber", "identity"] DEFS = {"chats":...
[ "def", "make_title_col", "(", "self", ",", "table", "=", "\"conversations\"", ",", "alias", "=", "None", ")", ":", "PREFS", "=", "[", "\"given_displayname\"", ",", "\"fullname\"", ",", "\"displayname\"", ",", "\"meta_topic\"", ",", "\"liveid_membername\"", ",", ...
https://github.com/suurjaak/Skyperious/blob/6a4f264dbac8d326c2fa8aeb5483dbca987860bf/skyperious/skypedata.py#L223-L236
quantumlib/OpenFermion
6187085f2a7707012b68370b625acaeed547e62b
src/openfermion/transforms/repconversions/qubit_tapering_from_stabilizer.py
python
StabilizerError.__init__
(self, message)
Throw custom errors connected to stabilizers. Args: message(str): custome error message string.
Throw custom errors connected to stabilizers.
[ "Throw", "custom", "errors", "connected", "to", "stabilizers", "." ]
def __init__(self, message): """ Throw custom errors connected to stabilizers. Args: message(str): custome error message string. """ Exception.__init__(self, message)
[ "def", "__init__", "(", "self", ",", "message", ")", ":", "Exception", ".", "__init__", "(", "self", ",", "message", ")" ]
https://github.com/quantumlib/OpenFermion/blob/6187085f2a7707012b68370b625acaeed547e62b/src/openfermion/transforms/repconversions/qubit_tapering_from_stabilizer.py#L24-L31
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/plugins/attack/db/sqlmap/lib/parse/configfile.py
python
configFileProxy
(section, option, datatype)
Parse configuration file and save settings into the configuration advanced dictionary.
Parse configuration file and save settings into the configuration advanced dictionary.
[ "Parse", "configuration", "file", "and", "save", "settings", "into", "the", "configuration", "advanced", "dictionary", "." ]
def configFileProxy(section, option, datatype): """ Parse configuration file and save settings into the configuration advanced dictionary. """ global config if config.has_option(section, option): try: if datatype == OPTION_TYPE.BOOLEAN: value = config.getboo...
[ "def", "configFileProxy", "(", "section", ",", "option", ",", "datatype", ")", ":", "global", "config", "if", "config", ".", "has_option", "(", "section", ",", "option", ")", ":", "try", ":", "if", "datatype", "==", "OPTION_TYPE", ".", "BOOLEAN", ":", "v...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/plugins/attack/db/sqlmap/lib/parse/configfile.py#L24-L55
tensorflow/graphics
86997957324bfbdd85848daae989b4c02588faa0
tensorflow_graphics/projects/points_to_3Dobjects/utils/logger.py
python
Logger.record_scalar
(self, name, scalar, step)
[]
def record_scalar(self, name, scalar, step): tf.summary.scalar(name, scalar, step) if name in self.xmanager: step = step.numpy() if isinstance(step, tf.Tensor) else step self.xmanager[name].create_measurement( objective_value=float(scalar), step=int(step))
[ "def", "record_scalar", "(", "self", ",", "name", ",", "scalar", ",", "step", ")", ":", "tf", ".", "summary", ".", "scalar", "(", "name", ",", "scalar", ",", "step", ")", "if", "name", "in", "self", ".", "xmanager", ":", "step", "=", "step", ".", ...
https://github.com/tensorflow/graphics/blob/86997957324bfbdd85848daae989b4c02588faa0/tensorflow_graphics/projects/points_to_3Dobjects/utils/logger.py#L45-L50
angr/angr
4b04d56ace135018083d36d9083805be8146688b
angr/analyses/reassembler.py
python
Data.__repr__
(self)
return "<DataItem %s@%#08x, %d bytes>" % (self.sort, self.addr, self.size)
[]
def __repr__(self): return "<DataItem %s@%#08x, %d bytes>" % (self.sort, self.addr, self.size)
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"<DataItem %s@%#08x, %d bytes>\"", "%", "(", "self", ".", "sort", ",", "self", ".", "addr", ",", "self", ".", "size", ")" ]
https://github.com/angr/angr/blob/4b04d56ace135018083d36d9083805be8146688b/angr/analyses/reassembler.py#L1205-L1206
trakt/Plex-Trakt-Scrobbler
aeb0bfbe62fad4b06c164f1b95581da7f35dce0b
Trakttv.bundle/Contents/Libraries/Shared/requests/models.py
python
Response.links
(self)
return l
Returns the parsed header links of the response, if any.
Returns the parsed header links of the response, if any.
[ "Returns", "the", "parsed", "header", "links", "of", "the", "response", "if", "any", "." ]
def links(self): """Returns the parsed header links of the response, if any.""" header = self.headers.get('link') # l = MultiDict() l = {} if header: links = parse_header_links(header) for link in links: key = link.get('rel') or link.ge...
[ "def", "links", "(", "self", ")", ":", "header", "=", "self", ".", "headers", ".", "get", "(", "'link'", ")", "# l = MultiDict()", "l", "=", "{", "}", "if", "header", ":", "links", "=", "parse_header_links", "(", "header", ")", "for", "link", "in", "...
https://github.com/trakt/Plex-Trakt-Scrobbler/blob/aeb0bfbe62fad4b06c164f1b95581da7f35dce0b/Trakttv.bundle/Contents/Libraries/Shared/requests/models.py#L853-L868
openstack/ceilometer
9325ae36dc9066073b79fdfbe4757b14536679c7
ceilometer/pipeline/base.py
python
Sink.flush
()
Flush data after all events have been injected to pipeline.
Flush data after all events have been injected to pipeline.
[ "Flush", "data", "after", "all", "events", "have", "been", "injected", "to", "pipeline", "." ]
def flush(): """Flush data after all events have been injected to pipeline."""
[ "def", "flush", "(", ")", ":" ]
https://github.com/openstack/ceilometer/blob/9325ae36dc9066073b79fdfbe4757b14536679c7/ceilometer/pipeline/base.py#L134-L135
jkkummerfeld/text2sql-data
2905ab815b4893d99ea061a20fb55860ecb1f92e
systems/sequence-to-sequence/seq2seq/metrics/rouge.py
python
rouge_l_summary_level
(evaluated_sentences, reference_sentences)
return _f_p_r_lcs(union_lcs_sum_across_all_references, m, n)
Computes ROUGE-L (summary level) of two text collections of sentences. http://research.microsoft.com/en-us/um/people/cyl/download/papers/ rouge-working-note-v1.3.1.pdf Calculated according to: R_lcs = SUM(1, u)[LCS<union>(r_i,C)]/m P_lcs = SUM(1, u)[LCS<union>(r_i,C)]/n F_lcs = ((1 + beta^2)*R_lcs*P_lcs) /...
Computes ROUGE-L (summary level) of two text collections of sentences. http://research.microsoft.com/en-us/um/people/cyl/download/papers/ rouge-working-note-v1.3.1.pdf
[ "Computes", "ROUGE", "-", "L", "(", "summary", "level", ")", "of", "two", "text", "collections", "of", "sentences", ".", "http", ":", "//", "research", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "um", "/", "people", "/", "cyl", "/", "...
def rouge_l_summary_level(evaluated_sentences, reference_sentences): """ Computes ROUGE-L (summary level) of two text collections of sentences. http://research.microsoft.com/en-us/um/people/cyl/download/papers/ rouge-working-note-v1.3.1.pdf Calculated according to: R_lcs = SUM(1, u)[LCS<union>(r_i,C)]/m ...
[ "def", "rouge_l_summary_level", "(", "evaluated_sentences", ",", "reference_sentences", ")", ":", "if", "len", "(", "evaluated_sentences", ")", "<=", "0", "or", "len", "(", "reference_sentences", ")", "<=", "0", ":", "raise", "ValueError", "(", "\"Collections must...
https://github.com/jkkummerfeld/text2sql-data/blob/2905ab815b4893d99ea061a20fb55860ecb1f92e/systems/sequence-to-sequence/seq2seq/metrics/rouge.py#L283-L324
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/tkinter/ttk.py
python
_format_optdict
(optdict, script=False, ignore=None)
return _flatten(opts)
Formats optdict to a tuple to pass it to tk.call. E.g. (script=False): {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns: ('-foreground', 'blue', '-padding', '1 2 3 4')
Formats optdict to a tuple to pass it to tk.call.
[ "Formats", "optdict", "to", "a", "tuple", "to", "pass", "it", "to", "tk", ".", "call", "." ]
def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. E.g. (script=False): {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns: ('-foreground', 'blue', '-padding', '1 2 3 4')""" opts = [] for opt, value in optdict.items(): ...
[ "def", "_format_optdict", "(", "optdict", ",", "script", "=", "False", ",", "ignore", "=", "None", ")", ":", "opts", "=", "[", "]", "for", "opt", ",", "value", "in", "optdict", ".", "items", "(", ")", ":", "if", "not", "ignore", "or", "opt", "not",...
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/tkinter/ttk.py#L61-L75
AcidWeb/CurseBreaker
1a8cb60f4db0cc8b7e0702441e1adc0f1829003e
CurseBreaker.py
python
TUI.motd_parser
(self)
[]
def motd_parser(self): payload = requests.get('https://storage.googleapis.com/cursebreaker/motd', headers=HEADERS, timeout=5) if payload.status_code == 200: self.console.print(Panel(payload.content.decode('UTF-8'), title='MOTD', border_style='red')) self.console.print('')
[ "def", "motd_parser", "(", "self", ")", ":", "payload", "=", "requests", ".", "get", "(", "'https://storage.googleapis.com/cursebreaker/motd'", ",", "headers", "=", "HEADERS", ",", "timeout", "=", "5", ")", "if", "payload", ".", "status_code", "==", "200", ":"...
https://github.com/AcidWeb/CurseBreaker/blob/1a8cb60f4db0cc8b7e0702441e1adc0f1829003e/CurseBreaker.py#L273-L277
vita-epfl/monoloco
f5e82c48e8ee5af352f2c9b1690050f4e02fc1b6
monoloco/eval/eval_kitti.py
python
EvalKitti.summary_table
(self, all_methods)
Tabulate table for ALP and ALE metrics
Tabulate table for ALP and ALE metrics
[ "Tabulate", "table", "for", "ALP", "and", "ALE", "metrics" ]
def summary_table(self, all_methods): """Tabulate table for ALP and ALE metrics""" alp = [[str(100 * average(self.errors[key][perc]))[:5] for perc in ['<0.5m', '<1m', '<2m']] for key in all_methods] ale = [[str(round(self.dic_stats['test'][key][clst]['mean'], 2))...
[ "def", "summary_table", "(", "self", ",", "all_methods", ")", ":", "alp", "=", "[", "[", "str", "(", "100", "*", "average", "(", "self", ".", "errors", "[", "key", "]", "[", "perc", "]", ")", ")", "[", ":", "5", "]", "for", "perc", "in", "[", ...
https://github.com/vita-epfl/monoloco/blob/f5e82c48e8ee5af352f2c9b1690050f4e02fc1b6/monoloco/eval/eval_kitti.py#L363-L377
out0fmemory/GoAgent-Always-Available
c4254984fea633ce3d1893fe5901debd9f22c2a9
server/lib/google/appengine/tools/bulkloader.py
python
ExportProgressThread.WorkFinished
(self)
Write the contents of the result database.
Write the contents of the result database.
[ "Write", "the", "contents", "of", "the", "result", "database", "." ]
def WorkFinished(self): """Write the contents of the result database.""" self.exporter.output_entities(self.result_db.AllEntities())
[ "def", "WorkFinished", "(", "self", ")", ":", "self", ".", "exporter", ".", "output_entities", "(", "self", ".", "result_db", ".", "AllEntities", "(", ")", ")" ]
https://github.com/out0fmemory/GoAgent-Always-Available/blob/c4254984fea633ce3d1893fe5901debd9f22c2a9/server/lib/google/appengine/tools/bulkloader.py#L2469-L2471
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1_subject_rules_review_status.py
python
V1SubjectRulesReviewStatus.non_resource_rules
(self)
return self._non_resource_rules
Gets the non_resource_rules of this V1SubjectRulesReviewStatus. # noqa: E501 NonResourceRules is the list of actions the subject is allowed to perform on non-resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete. # noqa: E501 :return: The non_resource_rul...
Gets the non_resource_rules of this V1SubjectRulesReviewStatus. # noqa: E501
[ "Gets", "the", "non_resource_rules", "of", "this", "V1SubjectRulesReviewStatus", ".", "#", "noqa", ":", "E501" ]
def non_resource_rules(self): """Gets the non_resource_rules of this V1SubjectRulesReviewStatus. # noqa: E501 NonResourceRules is the list of actions the subject is allowed to perform on non-resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete. # noqa: E5...
[ "def", "non_resource_rules", "(", "self", ")", ":", "return", "self", ".", "_non_resource_rules" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1_subject_rules_review_status.py#L116-L124
securityclippy/elasticintel
aa08d3e9f5ab1c000128e95161139ce97ff0e334
ingest_feed_lambda/pandas/core/missing.py
python
_akima_interpolate
(xi, yi, x, der=0, axis=0)
Convenience function for akima interpolation. xi and yi are arrays of values used to approximate some function f, with ``yi = f(xi)``. See `Akima1DInterpolator` for details. Parameters ---------- xi : array_like A sorted list of x-coordinates, of length N. yi : array_like ...
Convenience function for akima interpolation. xi and yi are arrays of values used to approximate some function f, with ``yi = f(xi)``.
[ "Convenience", "function", "for", "akima", "interpolation", ".", "xi", "and", "yi", "are", "arrays", "of", "values", "used", "to", "approximate", "some", "function", "f", "with", "yi", "=", "f", "(", "xi", ")", "." ]
def _akima_interpolate(xi, yi, x, der=0, axis=0): """ Convenience function for akima interpolation. xi and yi are arrays of values used to approximate some function f, with ``yi = f(xi)``. See `Akima1DInterpolator` for details. Parameters ---------- xi : array_like A sorted lis...
[ "def", "_akima_interpolate", "(", "xi", ",", "yi", ",", "x", ",", "der", "=", "0", ",", "axis", "=", "0", ")", ":", "from", "scipy", "import", "interpolate", "try", ":", "P", "=", "interpolate", ".", "Akima1DInterpolator", "(", "xi", ",", "yi", ",", ...
https://github.com/securityclippy/elasticintel/blob/aa08d3e9f5ab1c000128e95161139ce97ff0e334/ingest_feed_lambda/pandas/core/missing.py#L366-L413
yt-project/yt
dc7b24f9b266703db4c843e329c6c8644d47b824
yt/frontends/gadget/data_structures.py
python
GadgetBinaryHeader.__init__
(self, filename, header_spec)
[]
def __init__(self, filename, header_spec): self.filename = filename if isinstance(header_spec, str): header_spec = [header_spec] self.spec = [ GadgetDataset._setup_binary_spec(hs, gadget_header_specs) for hs in header_spec ]
[ "def", "__init__", "(", "self", ",", "filename", ",", "header_spec", ")", ":", "self", ".", "filename", "=", "filename", "if", "isinstance", "(", "header_spec", ",", "str", ")", ":", "header_spec", "=", "[", "header_spec", "]", "self", ".", "spec", "=", ...
https://github.com/yt-project/yt/blob/dc7b24f9b266703db4c843e329c6c8644d47b824/yt/frontends/gadget/data_structures.py#L48-L55
openstack/heat
ea6633c35b04bb49c4a2858edc9df0a82d039478
heat/engine/resource.py
python
Resource.action_handler_task
(self, action, args=None, action_prefix=None)
A task to call the Resource subclass's handler methods for action. Calls the handle_<ACTION>() method for the given action and then calls the check_<ACTION>_complete() method with the result in a loop until it returns True. If the methods are not provided, the call is omitted. Any args...
A task to call the Resource subclass's handler methods for action.
[ "A", "task", "to", "call", "the", "Resource", "subclass", "s", "handler", "methods", "for", "action", "." ]
def action_handler_task(self, action, args=None, action_prefix=None): """A task to call the Resource subclass's handler methods for action. Calls the handle_<ACTION>() method for the given action and then calls the check_<ACTION>_complete() method with the result in a loop until it retu...
[ "def", "action_handler_task", "(", "self", ",", "action", ",", "args", "=", "None", ",", "action_prefix", "=", "None", ")", ":", "args", "=", "args", "or", "[", "]", "handler_action", "=", "action", ".", "lower", "(", ")", "check", "=", "getattr", "(",...
https://github.com/openstack/heat/blob/ea6633c35b04bb49c4a2858edc9df0a82d039478/heat/engine/resource.py#L948-L1004
wucng/TensorExpand
4ea58f64f5c5082b278229b799c9f679536510b7
TensorExpand/Object detection/RFCN/RFCN-tensorflow/BoxInceptionResnet.py
python
BoxInceptionResnet.getVariables
(self, includeFeatures=False)
[]
def getVariables(self, includeFeatures=False): if includeFeatures: return tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=self.scope.name) else: vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=self.scope.name+"/Box/") vars += self.googleNet.getTrainableVars() print("Training ...
[ "def", "getVariables", "(", "self", ",", "includeFeatures", "=", "False", ")", ":", "if", "includeFeatures", ":", "return", "tf", ".", "get_collection", "(", "tf", ".", "GraphKeys", ".", "TRAINABLE_VARIABLES", ",", "scope", "=", "self", ".", "scope", ".", ...
https://github.com/wucng/TensorExpand/blob/4ea58f64f5c5082b278229b799c9f679536510b7/TensorExpand/Object detection/RFCN/RFCN-tensorflow/BoxInceptionResnet.py#L67-L75
minio/minio-py
b3ba3bf99fe6b9ff2b28855550d6ab5345c134e3
minio/signer.py
python
_get_signing_key
(secret_key, date, region, service_name)
return _hmac_hash(date_region_service_key, b"aws4_request")
Get signing key.
Get signing key.
[ "Get", "signing", "key", "." ]
def _get_signing_key(secret_key, date, region, service_name): """Get signing key.""" date_key = _hmac_hash( ("AWS4" + secret_key).encode(), time.to_signer_date(date).encode(), ) date_region_key = _hmac_hash(date_key, region.encode()) date_region_service_key = _hmac_hash( dat...
[ "def", "_get_signing_key", "(", "secret_key", ",", "date", ",", "region", ",", "service_name", ")", ":", "date_key", "=", "_hmac_hash", "(", "(", "\"AWS4\"", "+", "secret_key", ")", ".", "encode", "(", ")", ",", "time", ".", "to_signer_date", "(", "date", ...
https://github.com/minio/minio-py/blob/b3ba3bf99fe6b9ff2b28855550d6ab5345c134e3/minio/signer.py#L121-L132
NVIDIA/NeMo
5b0c0b4dec12d87d3cd960846de4105309ce938e
tools/ctc_segmentation/scripts/get_metrics_and_filter.py
python
_calculate
(line: dict, edge_len: int)
return line
Calculates metrics for every entry on manifest.json. Args: line - line of manifest.json (dict) edge_len - number of characters for edge Character Error Rate (CER) calculations Returns: line - line of manifest.json (dict) with the following metrics added: WER - word error rate ...
Calculates metrics for every entry on manifest.json.
[ "Calculates", "metrics", "for", "every", "entry", "on", "manifest", ".", "json", "." ]
def _calculate(line: dict, edge_len: int): """ Calculates metrics for every entry on manifest.json. Args: line - line of manifest.json (dict) edge_len - number of characters for edge Character Error Rate (CER) calculations Returns: line - line of manifest.json (dict) with the f...
[ "def", "_calculate", "(", "line", ":", "dict", ",", "edge_len", ":", "int", ")", ":", "eps", "=", "1e-9", "text", "=", "line", "[", "\"text\"", "]", ".", "split", "(", ")", "pred_text", "=", "line", "[", "\"pred_text\"", "]", ".", "split", "(", ")"...
https://github.com/NVIDIA/NeMo/blob/5b0c0b4dec12d87d3cd960846de4105309ce938e/tools/ctc_segmentation/scripts/get_metrics_and_filter.py#L61-L93
deepgram/kur
fd0c120e50815c1e5be64e5dde964dcd47234556
kur/model/hooks/plot_hook.py
python
PlotHook.get_name
(cls)
return 'plot'
Returns the name of the hook.
Returns the name of the hook.
[ "Returns", "the", "name", "of", "the", "hook", "." ]
def get_name(cls): """ Returns the name of the hook. """ return 'plot'
[ "def", "get_name", "(", "cls", ")", ":", "return", "'plot'" ]
https://github.com/deepgram/kur/blob/fd0c120e50815c1e5be64e5dde964dcd47234556/kur/model/hooks/plot_hook.py#L64-L67
tav/pylibs
3c16b843681f54130ee6a022275289cadb2f2a69
genshi/template/eval.py
python
Suite.execute
(self, data)
Execute the suite in the given data dictionary. :param data: a mapping containing the data to execute in
Execute the suite in the given data dictionary. :param data: a mapping containing the data to execute in
[ "Execute", "the", "suite", "in", "the", "given", "data", "dictionary", ".", ":", "param", "data", ":", "a", "mapping", "containing", "the", "data", "to", "execute", "in" ]
def execute(self, data): """Execute the suite in the given data dictionary. :param data: a mapping containing the data to execute in """ __traceback_hide__ = 'before_and_this' _globals = self._globals(data) exec self.code in _globals, data
[ "def", "execute", "(", "self", ",", "data", ")", ":", "__traceback_hide__", "=", "'before_and_this'", "_globals", "=", "self", ".", "_globals", "(", "data", ")", "exec", "self", ".", "code", "in", "_globals", ",", "data" ]
https://github.com/tav/pylibs/blob/3c16b843681f54130ee6a022275289cadb2f2a69/genshi/template/eval.py#L192-L199
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/boto/storage_uri.py
python
StorageUri.connect
(self, access_key_id=None, secret_access_key=None, **kwargs)
return self.connection
Opens a connection to appropriate provider, depending on provider portion of URI. Requires Credentials defined in boto config file (see boto/pyami/config.py). @type storage_uri: StorageUri @param storage_uri: StorageUri specifying a bucket or a bucket+object @rtype: L{AWSAuthConn...
Opens a connection to appropriate provider, depending on provider portion of URI. Requires Credentials defined in boto config file (see boto/pyami/config.py).
[ "Opens", "a", "connection", "to", "appropriate", "provider", "depending", "on", "provider", "portion", "of", "URI", ".", "Requires", "Credentials", "defined", "in", "boto", "config", "file", "(", "see", "boto", "/", "pyami", "/", "config", ".", "py", ")", ...
def connect(self, access_key_id=None, secret_access_key=None, **kwargs): """ Opens a connection to appropriate provider, depending on provider portion of URI. Requires Credentials defined in boto config file (see boto/pyami/config.py). @type storage_uri: StorageUri @param...
[ "def", "connect", "(", "self", ",", "access_key_id", "=", "None", ",", "secret_access_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "connection_args", "=", "dict", "(", "self", ".", "connection_args", "or", "(", ")", ")", "if", "(", "hasattr", ...
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/boto/storage_uri.py#L93-L149
PAGalaxyLab/vxhunter
5984b985963e2e370b536a239771110865d44ef0
serial_debuger/vx_base_debugger.py
python
VxSerialBaseDebuger.init_debugger
(self, over_write_address)
Initialize Debuger, inject debug shellcode to target memory. :param over_write_address: Memory address to store debug shellcode :return: True if succeed
Initialize Debuger, inject debug shellcode to target memory.
[ "Initialize", "Debuger", "inject", "debug", "shellcode", "to", "target", "memory", "." ]
def init_debugger(self, over_write_address): """Initialize Debuger, inject debug shellcode to target memory. :param over_write_address: Memory address to store debug shellcode :return: True if succeed """ self.not_implemented('init_debugger')
[ "def", "init_debugger", "(", "self", ",", "over_write_address", ")", ":", "self", ".", "not_implemented", "(", "'init_debugger'", ")" ]
https://github.com/PAGalaxyLab/vxhunter/blob/5984b985963e2e370b536a239771110865d44ef0/serial_debuger/vx_base_debugger.py#L99-L106
tensorflow/federated
5a60a032360087b8f4c7fcfd97ed1c0131c3eac3
tensorflow_federated/python/analytics/heavy_hitters/iblt/hyperedge_hashers.py
python
CoupledHyperEdgeHasher.get_hash_indices_tf
(self, data_strings)
return sparse_indices
Returns Tensor containing hash-position of `(input string, repetition)`. Args: data_strings: A `tf.Tensor` of strings. Returns: A `tf.Tensor` of shape `(input_length, repetitions, 3)` containing value `i` at index `(i, r, 0)`, value `r` at index `(i, r, 1)` and the hash-index of the `i...
Returns Tensor containing hash-position of `(input string, repetition)`.
[ "Returns", "Tensor", "containing", "hash", "-", "position", "of", "(", "input", "string", "repetition", ")", "." ]
def get_hash_indices_tf(self, data_strings): """Returns Tensor containing hash-position of `(input string, repetition)`. Args: data_strings: A `tf.Tensor` of strings. Returns: A `tf.Tensor` of shape `(input_length, repetitions, 3)` containing value `i` at index `(i, r, 0)`, value `r` at ...
[ "def", "get_hash_indices_tf", "(", "self", ",", "data_strings", ")", ":", "positions", "=", "self", ".", "_hash_to_float_tf", "(", "data_strings", ",", "(", "0.5", ",", "self", ".", "_rescale_factor", "+", "0.5", ")", ")", "hash_indices", "=", "[", "]", "f...
https://github.com/tensorflow/federated/blob/5a60a032360087b8f4c7fcfd97ed1c0131c3eac3/tensorflow_federated/python/analytics/heavy_hitters/iblt/hyperedge_hashers.py#L257-L279
deepchem/deepchem
054eb4b2b082e3df8e1a8e77f36a52137ae6e375
deepchem/molnet/load_function/hppb_datasets.py
python
load_hppb
( featurizer: Union[dc.feat.Featurizer, str] = 'ECFP', splitter: Union[dc.splits.Splitter, str, None] = 'scaffold', transformers: List[Union[TransformerGenerator, str]] = ['log'], reload: bool = True, data_dir: Optional[str] = None, save_dir: Optional[str] = None, **kwargs )
return loader.load_dataset('hppb', reload)
Loads the thermodynamic solubility datasets. Parameters ---------- featurizer: Featurizer or str the featurizer to use for processing the data. Alternatively you can pass one of the names from dc.molnet.featurizers as a shortcut. splitter: Splitter or str the splitter to use for splitting the data...
Loads the thermodynamic solubility datasets.
[ "Loads", "the", "thermodynamic", "solubility", "datasets", "." ]
def load_hppb( featurizer: Union[dc.feat.Featurizer, str] = 'ECFP', splitter: Union[dc.splits.Splitter, str, None] = 'scaffold', transformers: List[Union[TransformerGenerator, str]] = ['log'], reload: bool = True, data_dir: Optional[str] = None, save_dir: Optional[str] = None, **kwargs ) -> ...
[ "def", "load_hppb", "(", "featurizer", ":", "Union", "[", "dc", ".", "feat", ".", "Featurizer", ",", "str", "]", "=", "'ECFP'", ",", "splitter", ":", "Union", "[", "dc", ".", "splits", ".", "Splitter", ",", "str", ",", "None", "]", "=", "'scaffold'",...
https://github.com/deepchem/deepchem/blob/054eb4b2b082e3df8e1a8e77f36a52137ae6e375/deepchem/molnet/load_function/hppb_datasets.py#L28-L63
LoRexxar/Kunlun-M
06a68cf308f3d38be223d1d891465abcac9db88a
core/engine.py
python
Core.__init__
(self, target_directory, vulnerability_result, single_rule, project_name, white_list, test=False, index=0, files=None, languages=None, tamper_name=None, is_unconfirm=False)
Initialize :param: target_directory: :param: vulnerability_result: :param single_rule: rule class :param project_name: project name :param white_list: white-list :param test: is test :param index: vulnerability index :param files: core file list :p...
Initialize :param: target_directory: :param: vulnerability_result: :param single_rule: rule class :param project_name: project name :param white_list: white-list :param test: is test :param index: vulnerability index :param files: core file list :p...
[ "Initialize", ":", "param", ":", "target_directory", ":", ":", "param", ":", "vulnerability_result", ":", ":", "param", "single_rule", ":", "rule", "class", ":", "param", "project_name", ":", "project", "name", ":", "param", "white_list", ":", "white", "-", ...
def __init__(self, target_directory, vulnerability_result, single_rule, project_name, white_list, test=False, index=0, files=None, languages=None, tamper_name=None, is_unconfirm=False): """ Initialize :param: target_directory: :param: vulnerability_result: :param...
[ "def", "__init__", "(", "self", ",", "target_directory", ",", "vulnerability_result", ",", "single_rule", ",", "project_name", ",", "white_list", ",", "test", "=", "False", ",", "index", "=", "0", ",", "files", "=", "None", ",", "languages", "=", "None", "...
https://github.com/LoRexxar/Kunlun-M/blob/06a68cf308f3d38be223d1d891465abcac9db88a/core/engine.py#L620-L687
asanakoy/deeppose_tf
ed11cc619f44bf2e144f8d09fdf03f316e73e348
scripts/dataset.py
python
PoseDataset.apply_cropping
(self, image, joints, bbox, bbox_extension_range=None, shift=None)
return image, joints, bbox, bbox_origin
Randomly enlarge the bounding box of joints and randomly shift the box. Crop using the resultant bounding box.
Randomly enlarge the bounding box of joints and randomly shift the box. Crop using the resultant bounding box.
[ "Randomly", "enlarge", "the", "bounding", "box", "of", "joints", "and", "randomly", "shift", "the", "box", ".", "Crop", "using", "the", "resultant", "bounding", "box", "." ]
def apply_cropping(self, image, joints, bbox, bbox_extension_range=None, shift=None): """ Randomly enlarge the bounding box of joints and randomly shift the box. Crop using the resultant bounding box. """ x, y, w, h = bbox if bbox_extension_range is not None: ...
[ "def", "apply_cropping", "(", "self", ",", "image", ",", "joints", ",", "bbox", ",", "bbox_extension_range", "=", "None", ",", "shift", "=", "None", ")", ":", "x", ",", "y", ",", "w", ",", "h", "=", "bbox", "if", "bbox_extension_range", "is", "not", ...
https://github.com/asanakoy/deeppose_tf/blob/ed11cc619f44bf2e144f8d09fdf03f316e73e348/scripts/dataset.py#L191-L246
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1beta1_mutating_webhook.py
python
V1beta1MutatingWebhook.timeout_seconds
(self)
return self._timeout_seconds
Gets the timeout_seconds of this V1beta1MutatingWebhook. # noqa: E501 TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 30 secon...
Gets the timeout_seconds of this V1beta1MutatingWebhook. # noqa: E501
[ "Gets", "the", "timeout_seconds", "of", "this", "V1beta1MutatingWebhook", ".", "#", "noqa", ":", "E501" ]
def timeout_seconds(self): """Gets the timeout_seconds of this V1beta1MutatingWebhook. # noqa: E501 TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between...
[ "def", "timeout_seconds", "(", "self", ")", ":", "return", "self", ".", "_timeout_seconds" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1beta1_mutating_webhook.py#L332-L340
lsbardel/python-stdnet
78db5320bdedc3f28c5e4f38cda13a4469e35db7
stdnet/apps/columnts/models.py
python
ColumnTS._merge
(self, *series, **kwargs)
[]
def _merge(self, *series, **kwargs): fields = kwargs.get('fields') or () self.backend_structure().merge(series, fields)
[ "def", "_merge", "(", "self", ",", "*", "series", ",", "*", "*", "kwargs", ")", ":", "fields", "=", "kwargs", ".", "get", "(", "'fields'", ")", "or", "(", ")", "self", ".", "backend_structure", "(", ")", ".", "merge", "(", "series", ",", "fields", ...
https://github.com/lsbardel/python-stdnet/blob/78db5320bdedc3f28c5e4f38cda13a4469e35db7/stdnet/apps/columnts/models.py#L227-L229
endgameinc/eql
688964d807b50ec7b309c453366dca0179778f73
eql/ast.py
python
BaseNode.iter_slots
(self)
Enumerate over all of the slots and their values.
Enumerate over all of the slots and their values.
[ "Enumerate", "over", "all", "of", "the", "slots", "and", "their", "values", "." ]
def iter_slots(self): # type: () -> list """Enumerate over all of the slots and their values.""" for key in self.__slots__: yield key, getattr(self, key, None)
[ "def", "iter_slots", "(", "self", ")", ":", "# type: () -> list", "for", "key", "in", "self", ".", "__slots__", ":", "yield", "key", ",", "getattr", "(", "self", ",", "key", ",", "None", ")" ]
https://github.com/endgameinc/eql/blob/688964d807b50ec7b309c453366dca0179778f73/eql/ast.py#L78-L82
nvaccess/nvda
20d5a25dced4da34338197f0ef6546270ebca5d0
source/brailleDisplayDrivers/handyTech.py
python
_allSubclasses
(cls)
return cls.__subclasses__() + [g for s in cls.__subclasses__() for g in _allSubclasses(s)]
List all direct and indirect subclasses of cls This function calls itself recursively to return all subclasses of cls. @param cls: the base class to list subclasses of @type cls: class @rtype: [class]
List all direct and indirect subclasses of cls
[ "List", "all", "direct", "and", "indirect", "subclasses", "of", "cls" ]
def _allSubclasses(cls): """List all direct and indirect subclasses of cls This function calls itself recursively to return all subclasses of cls. @param cls: the base class to list subclasses of @type cls: class @rtype: [class] """ return cls.__subclasses__() + [g for s in cls.__subclasses__() for g in _all...
[ "def", "_allSubclasses", "(", "cls", ")", ":", "return", "cls", ".", "__subclasses__", "(", ")", "+", "[", "g", "for", "s", "in", "cls", ".", "__subclasses__", "(", ")", "for", "g", "in", "_allSubclasses", "(", "s", ")", "]" ]
https://github.com/nvaccess/nvda/blob/20d5a25dced4da34338197f0ef6546270ebca5d0/source/brailleDisplayDrivers/handyTech.py#L527-L537
buke/GreenOdoo
3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df
runtime/common/lib/python2.7/site-packages/libxml2.py
python
outputBuffer.write
(self, len, buf)
return ret
Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.
Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.
[ "Write", "the", "content", "of", "the", "array", "in", "the", "output", "I", "/", "O", "buffer", "This", "routine", "handle", "the", "I18N", "transcoding", "from", "internal", "UTF", "-", "8", "The", "buffer", "is", "lossless", "i", ".", "e", ".", "wil...
def write(self, len, buf): """Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes. """ ret = libxml2mod.xmlOutputBufferWrite(self._...
[ "def", "write", "(", "self", ",", "len", ",", "buf", ")", ":", "ret", "=", "libxml2mod", ".", "xmlOutputBufferWrite", "(", "self", ".", "_o", ",", "len", ",", "buf", ")", "return", "ret" ]
https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/common/lib/python2.7/site-packages/libxml2.py#L6041-L6047
naftaliharris/tauthon
5587ceec329b75f7caf6d65a036db61ac1bae214
Lib/mimetools.py
python
encode
(input, output, encoding)
Encode common content-transfer-encodings (base64, quopri, uuencode).
Encode common content-transfer-encodings (base64, quopri, uuencode).
[ "Encode", "common", "content", "-", "transfer", "-", "encodings", "(", "base64", "quopri", "uuencode", ")", "." ]
def encode(input, output, encoding): """Encode common content-transfer-encodings (base64, quopri, uuencode).""" if encoding == 'base64': import base64 return base64.encode(input, output) if encoding == 'quoted-printable': import quopri return quopri.encode(input, output, 0) ...
[ "def", "encode", "(", "input", ",", "output", ",", "encoding", ")", ":", "if", "encoding", "==", "'base64'", ":", "import", "base64", "return", "base64", ".", "encode", "(", "input", ",", "output", ")", "if", "encoding", "==", "'quoted-printable'", ":", ...
https://github.com/naftaliharris/tauthon/blob/5587ceec329b75f7caf6d65a036db61ac1bae214/Lib/mimetools.py#L176-L193
IronLanguages/main
a949455434b1fda8c783289e897e78a9a0caabb5
External.LCA_RESTRICTED/Languages/IronPython/27/Lib/logging/handlers.py
python
SocketHandler.createSocket
(self)
Try to create a socket, using an exponential backoff with a max retry time. Thanks to Robert Olson for the original patch (SF #815911) which has been slightly refactored.
Try to create a socket, using an exponential backoff with a max retry time. Thanks to Robert Olson for the original patch (SF #815911) which has been slightly refactored.
[ "Try", "to", "create", "a", "socket", "using", "an", "exponential", "backoff", "with", "a", "max", "retry", "time", ".", "Thanks", "to", "Robert", "Olson", "for", "the", "original", "patch", "(", "SF", "#815911", ")", "which", "has", "been", "slightly", ...
def createSocket(self): """ Try to create a socket, using an exponential backoff with a max retry time. Thanks to Robert Olson for the original patch (SF #815911) which has been slightly refactored. """ now = time.time() # Either retryTime is None, in which case t...
[ "def", "createSocket", "(", "self", ")", ":", "now", "=", "time", ".", "time", "(", ")", "# Either retryTime is None, in which case this", "# is the first time back after a disconnect, or", "# we've waited long enough.", "if", "self", ".", "retryTime", "is", "None", ":", ...
https://github.com/IronLanguages/main/blob/a949455434b1fda8c783289e897e78a9a0caabb5/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/logging/handlers.py#L477-L503
coderholic/pyradio
cd3ee2d6b369fedfd009371a59aca23ab39b020f
pyradio/window_stack.py
python
Window_Stack.operation_mode
(self)
return self._dq[-1][0]
[]
def operation_mode(self): return self._dq[-1][0]
[ "def", "operation_mode", "(", "self", ")", ":", "return", "self", ".", "_dq", "[", "-", "1", "]", "[", "0", "]" ]
https://github.com/coderholic/pyradio/blob/cd3ee2d6b369fedfd009371a59aca23ab39b020f/pyradio/window_stack.py#L316-L317
django-compressor/django-compressor
6a6bae8e590913e06f6b32587ab793fe18b3b767
compressor/base.py
python
Compressor.filter_output
(self, content)
return self.filter(content, self.cached_filters, method=METHOD_OUTPUT)
Passes the concatenated content to the 'output' methods of the compressor filters.
Passes the concatenated content to the 'output' methods of the compressor filters.
[ "Passes", "the", "concatenated", "content", "to", "the", "output", "methods", "of", "the", "compressor", "filters", "." ]
def filter_output(self, content): """ Passes the concatenated content to the 'output' methods of the compressor filters. """ return self.filter(content, self.cached_filters, method=METHOD_OUTPUT)
[ "def", "filter_output", "(", "self", ",", "content", ")", ":", "return", "self", ".", "filter", "(", "content", ",", "self", ".", "cached_filters", ",", "method", "=", "METHOD_OUTPUT", ")" ]
https://github.com/django-compressor/django-compressor/blob/6a6bae8e590913e06f6b32587ab793fe18b3b767/compressor/base.py#L250-L255
google/coursebuilder-core
08f809db3226d9269e30d5edd0edd33bd22041f4
coursebuilder/models/courses.py
python
CourseModel12.get_assessment_content
(self, unit)
return self._get_assessment_as_dict( self.get_assessment_filename(unit.unit_id))
Returns the schema for an assessment as a Python dict.
Returns the schema for an assessment as a Python dict.
[ "Returns", "the", "schema", "for", "an", "assessment", "as", "a", "Python", "dict", "." ]
def get_assessment_content(self, unit): """Returns the schema for an assessment as a Python dict.""" return self._get_assessment_as_dict( self.get_assessment_filename(unit.unit_id))
[ "def", "get_assessment_content", "(", "self", ",", "unit", ")", ":", "return", "self", ".", "_get_assessment_as_dict", "(", "self", ".", "get_assessment_filename", "(", "unit", ".", "unit_id", ")", ")" ]
https://github.com/google/coursebuilder-core/blob/08f809db3226d9269e30d5edd0edd33bd22041f4/coursebuilder/models/courses.py#L820-L823
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/core/ui/gui/tabs/exploit/utils.py
python
TextDialogConsumer.__init__
(self, title, tabnames=(), icon=None)
[]
def __init__(self, title, tabnames=(), icon=None): entries.TextDialog.__init__(self, title, tabnames, icon) MessageConsumer.__init__(self)
[ "def", "__init__", "(", "self", ",", "title", ",", "tabnames", "=", "(", ")", ",", "icon", "=", "None", ")", ":", "entries", ".", "TextDialog", ".", "__init__", "(", "self", ",", "title", ",", "tabnames", ",", "icon", ")", "MessageConsumer", ".", "__...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/core/ui/gui/tabs/exploit/utils.py#L40-L42
chribsen/simple-machine-learning-examples
dc94e52a4cebdc8bb959ff88b81ff8cfeca25022
venv/lib/python2.7/site-packages/scipy/signal/signaltools.py
python
medfilt
(volume, kernel_size=None)
return sigtools._order_filterND(volume, domain, order)
Perform a median filter on an N-dimensional array. Apply a median filter to the input array using a local window-size given by `kernel_size`. Parameters ---------- volume : array_like An N-dimensional input array. kernel_size : array_like, optional A scalar or an N-length list ...
Perform a median filter on an N-dimensional array.
[ "Perform", "a", "median", "filter", "on", "an", "N", "-", "dimensional", "array", "." ]
def medfilt(volume, kernel_size=None): """ Perform a median filter on an N-dimensional array. Apply a median filter to the input array using a local window-size given by `kernel_size`. Parameters ---------- volume : array_like An N-dimensional input array. kernel_size : array_l...
[ "def", "medfilt", "(", "volume", ",", "kernel_size", "=", "None", ")", ":", "volume", "=", "atleast_1d", "(", "volume", ")", "if", "kernel_size", "is", "None", ":", "kernel_size", "=", "[", "3", "]", "*", "volume", ".", "ndim", "kernel_size", "=", "asa...
https://github.com/chribsen/simple-machine-learning-examples/blob/dc94e52a4cebdc8bb959ff88b81ff8cfeca25022/venv/lib/python2.7/site-packages/scipy/signal/signaltools.py#L529-L568
boto/boto
b2a6f08122b2f1b89888d2848e730893595cd001
boto/opsworks/layer1.py
python
OpsWorksConnection.associate_elastic_ip
(self, elastic_ip, instance_id=None)
return self.make_request(action='AssociateElasticIp', body=json.dumps(params))
Associates one of the stack's registered Elastic IP addresses with a specified instance. The address must first be registered with the stack by calling RegisterElasticIp. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must ...
Associates one of the stack's registered Elastic IP addresses with a specified instance. The address must first be registered with the stack by calling RegisterElasticIp. For more information, see `Resource Management`_.
[ "Associates", "one", "of", "the", "stack", "s", "registered", "Elastic", "IP", "addresses", "with", "a", "specified", "instance", ".", "The", "address", "must", "first", "be", "registered", "with", "the", "stack", "by", "calling", "RegisterElasticIp", ".", "Fo...
def associate_elastic_ip(self, elastic_ip, instance_id=None): """ Associates one of the stack's registered Elastic IP addresses with a specified instance. The address must first be registered with the stack by calling RegisterElasticIp. For more information, see `Resource Managem...
[ "def", "associate_elastic_ip", "(", "self", ",", "elastic_ip", ",", "instance_id", "=", "None", ")", ":", "params", "=", "{", "'ElasticIp'", ":", "elastic_ip", ",", "}", "if", "instance_id", "is", "not", "None", ":", "params", "[", "'InstanceId'", "]", "="...
https://github.com/boto/boto/blob/b2a6f08122b2f1b89888d2848e730893595cd001/boto/opsworks/layer1.py#L162-L186
YoSmudge/dnsyo
4734e36d712fefeb9a8ff22dfba678e382dde6cf
dnsyo/updater.py
python
update.__init__
(self, lookup, summaryFile, outputFile)
Create an instance of the updater Gets passed a pre-configured L{dnsyo.lookup} object @param lookup: Instance of a L{dnsyo.lookup} @param summaryFile: Location of file to write update summary to @param outputFile: Target list to write results to @type looku...
Create an instance of the updater
[ "Create", "an", "instance", "of", "the", "updater" ]
def __init__(self, lookup, summaryFile, outputFile): """ Create an instance of the updater Gets passed a pre-configured L{dnsyo.lookup} object @param lookup: Instance of a L{dnsyo.lookup} @param summaryFile: Location of file to write update summary to @para...
[ "def", "__init__", "(", "self", ",", "lookup", ",", "summaryFile", ",", "outputFile", ")", ":", "self", ".", "lookup", "=", "lookup", "self", ".", "sourceServers", "=", "self", ".", "lookup", ".", "prepareList", "(", "noSample", "=", "True", ")", "self",...
https://github.com/YoSmudge/dnsyo/blob/4734e36d712fefeb9a8ff22dfba678e382dde6cf/dnsyo/updater.py#L66-L111
ailabx/ailabx
4a8c701a3604bbc34157167224588041944ac1a2
codes/qlib-main/examples/benchmarks/TFT/libs/hyperparam_opt.py
python
HyperparamOptManager.get_best_params
(self)
return self._get_params_from_name(optimal_name)
Returns the optimal hyperparameters thus far.
Returns the optimal hyperparameters thus far.
[ "Returns", "the", "optimal", "hyperparameters", "thus", "far", "." ]
def get_best_params(self): """Returns the optimal hyperparameters thus far.""" optimal_name = self.optimal_name return self._get_params_from_name(optimal_name)
[ "def", "get_best_params", "(", "self", ")", ":", "optimal_name", "=", "self", ".", "optimal_name", "return", "self", ".", "_get_params_from_name", "(", "optimal_name", ")" ]
https://github.com/ailabx/ailabx/blob/4a8c701a3604bbc34157167224588041944ac1a2/codes/qlib-main/examples/benchmarks/TFT/libs/hyperparam_opt.py#L118-L123
shuup/shuup
25f78cfe370109b9885b903e503faac295c7b7f2
shuup/notify/base.py
python
ScriptItem.get_value
(self, context, binding_name)
return binding.get_value(context, bind_data)
Get the actual value of a binding from the given script context. :param context: Script Context :type context: shuup.notify.script.Context :param binding_name: Binding name. :type binding_name: str :return: The variable value
Get the actual value of a binding from the given script context.
[ "Get", "the", "actual", "value", "of", "a", "binding", "from", "the", "given", "script", "context", "." ]
def get_value(self, context, binding_name): """ Get the actual value of a binding from the given script context. :param context: Script Context :type context: shuup.notify.script.Context :param binding_name: Binding name. :type binding_name: str :return: The vari...
[ "def", "get_value", "(", "self", ",", "context", ",", "binding_name", ")", ":", "binding", "=", "self", ".", "bindings", "[", "binding_name", "]", "bind_data", "=", "self", ".", "data", ".", "get", "(", "binding_name", ")", "return", "binding", ".", "get...
https://github.com/shuup/shuup/blob/25f78cfe370109b9885b903e503faac295c7b7f2/shuup/notify/base.py#L215-L227
fluentpython/notebooks
0f6e1e8d1686743dacd9281df7c5b5921812010a
attic/sequences/metro_areas.py
python
load
()
return metro_areas
[]
def load(): metro_areas = [] with open(FILENAME, encoding='utf-8') as text: for line in text: if line.startswith('#'): continue # Country Name Rank Population Yr_change % Area(km2) Pop/km2 country, name, _, pop, pop_change, _, area, _ = line.split('\t'...
[ "def", "load", "(", ")", ":", "metro_areas", "=", "[", "]", "with", "open", "(", "FILENAME", ",", "encoding", "=", "'utf-8'", ")", "as", "text", ":", "for", "line", "in", "text", ":", "if", "line", ".", "startswith", "(", "'#'", ")", ":", "continue...
https://github.com/fluentpython/notebooks/blob/0f6e1e8d1686743dacd9281df7c5b5921812010a/attic/sequences/metro_areas.py#L19-L31
NervanaSystems/neon
8c3fb8a93b4a89303467b25817c60536542d08bd
neon/backends/autodiff.py
python
GradUtil.is_invalid
(grad_op_tree, be)
Test if the result of grad_op_tree contains Nan, inf, -inf, or abnormally large or small numbers. Only for debug purpose. Arguments: grad_op_tree (OpTreeNode or Tensor): The tensor or op-tree to test. be (Backend): The backend to be used. Returns: bool: Whet...
Test if the result of grad_op_tree contains Nan, inf, -inf, or abnormally large or small numbers. Only for debug purpose.
[ "Test", "if", "the", "result", "of", "grad_op_tree", "contains", "Nan", "inf", "-", "inf", "or", "abnormally", "large", "or", "small", "numbers", ".", "Only", "for", "debug", "purpose", "." ]
def is_invalid(grad_op_tree, be): """ Test if the result of grad_op_tree contains Nan, inf, -inf, or abnormally large or small numbers. Only for debug purpose. Arguments: grad_op_tree (OpTreeNode or Tensor): The tensor or op-tree to test. be (Backend): The backen...
[ "def", "is_invalid", "(", "grad_op_tree", ",", "be", ")", ":", "grad_op_tree_val", "=", "be", ".", "empty", "(", "grad_op_tree", ".", "shape", ")", "grad_op_tree_val", "[", ":", "]", "=", "grad_op_tree", "grad_op_tree_val_np", "=", "grad_op_tree_val", ".", "ge...
https://github.com/NervanaSystems/neon/blob/8c3fb8a93b4a89303467b25817c60536542d08bd/neon/backends/autodiff.py#L121-L141
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/http/cookiejar.py
python
DefaultCookiePolicy.set_blocked_domains
(self, blocked_domains)
Set the sequence of blocked domains.
Set the sequence of blocked domains.
[ "Set", "the", "sequence", "of", "blocked", "domains", "." ]
def set_blocked_domains(self, blocked_domains): """Set the sequence of blocked domains.""" self._blocked_domains = tuple(blocked_domains)
[ "def", "set_blocked_domains", "(", "self", ",", "blocked_domains", ")", ":", "self", ".", "_blocked_domains", "=", "tuple", "(", "blocked_domains", ")" ]
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/http/cookiejar.py#L906-L908
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/gunicorn-19.9.0/docs/sitemap_gen.py
python
FilePathGenerator.GenerateURL
(self, instance, root_url)
return URL.Canonicalize(retval)
Generates iterations, but as a URL instead of a path.
Generates iterations, but as a URL instead of a path.
[ "Generates", "iterations", "but", "as", "a", "URL", "instead", "of", "a", "path", "." ]
def GenerateURL(self, instance, root_url): """ Generates iterations, but as a URL instead of a path. """ prefix = root_url + self._prefix retval = None if type(instance) == types.IntType: if instance: retval = '%s%d%s' % (prefix, instance, self._suffix) else: retval = prefix ...
[ "def", "GenerateURL", "(", "self", ",", "instance", ",", "root_url", ")", ":", "prefix", "=", "root_url", "+", "self", ".", "_prefix", "retval", "=", "None", "if", "type", "(", "instance", ")", "==", "types", ".", "IntType", ":", "if", "instance", ":",...
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/gunicorn-19.9.0/docs/sitemap_gen.py#L1612-L1623
moinwiki/moin
568f223231aadecbd3b21a701ec02271f8d8021d
src/moin/storage/middleware/indexing.py
python
IndexingMiddleware.rebuild
(self, tmp=False, procs=1, limitmb=256)
Add all items/revisions from the backends of this wiki to the index (which is expected to have no items/revisions from this wiki yet). Note: index might be shared by multiple wikis, so it is: create, rebuild wiki1, rebuild wiki2, ... create (tmp), rebuild wiki1, rebuild wiki...
Add all items/revisions from the backends of this wiki to the index (which is expected to have no items/revisions from this wiki yet).
[ "Add", "all", "items", "/", "revisions", "from", "the", "backends", "of", "this", "wiki", "to", "the", "index", "(", "which", "is", "expected", "to", "have", "no", "items", "/", "revisions", "from", "this", "wiki", "yet", ")", "." ]
def rebuild(self, tmp=False, procs=1, limitmb=256): """ Add all items/revisions from the backends of this wiki to the index (which is expected to have no items/revisions from this wiki yet). Note: index might be shared by multiple wikis, so it is: create, rebuild wiki1, re...
[ "def", "rebuild", "(", "self", ",", "tmp", "=", "False", ",", "procs", "=", "1", ",", "limitmb", "=", "256", ")", ":", "storage", "=", "self", ".", "get_storage", "(", "tmp", ")", "index", "=", "storage", ".", "open_index", "(", "ALL_REVS", ")", "t...
https://github.com/moinwiki/moin/blob/568f223231aadecbd3b21a701ec02271f8d8021d/src/moin/storage/middleware/indexing.py#L653-L678
smart-mobile-software/gitstack
d9fee8f414f202143eb6e620529e8e5539a2af56
python/Lib/distutils/archive_util.py
python
make_archive
(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None)
return filename
Create an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "tar", "ztar", or "gztar". 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir int...
Create an archive file (eg. zip or tar).
[ "Create", "an", "archive", "file", "(", "eg", ".", "zip", "or", "tar", ")", "." ]
def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None): """Create an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "ta...
[ "def", "make_archive", "(", "base_name", ",", "format", ",", "root_dir", "=", "None", ",", "base_dir", "=", "None", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ",", "owner", "=", "None", ",", "group", "=", "None", ")", ":", "save_cwd", "=", ...
https://github.com/smart-mobile-software/gitstack/blob/d9fee8f414f202143eb6e620529e8e5539a2af56/python/Lib/distutils/archive_util.py#L193-L243
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/docutils-0.14/docutils/parsers/rst/states.py
python
RFC2822List.rfc2822
(self, match, context, next_state)
return [], 'RFC2822List', []
RFC2822-style field list item.
RFC2822-style field list item.
[ "RFC2822", "-", "style", "field", "list", "item", "." ]
def rfc2822(self, match, context, next_state): """RFC2822-style field list item.""" field, blank_finish = self.rfc2822_field(match) self.parent += field self.blank_finish = blank_finish return [], 'RFC2822List', []
[ "def", "rfc2822", "(", "self", ",", "match", ",", "context", ",", "next_state", ")", ":", "field", ",", "blank_finish", "=", "self", ".", "rfc2822_field", "(", "match", ")", "self", ".", "parent", "+=", "field", "self", ".", "blank_finish", "=", "blank_f...
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/docutils-0.14/docutils/parsers/rst/states.py#L2579-L2584
inkandswitch/livebook
93c8d467734787366ad084fc3566bf5cbe249c51
public/pypyjs/modules/_md5.py
python
MD5Type.digest
(self)
return digest
Terminate the message-digest computation and return digest. Return the digest of the strings passed to the update() method so far. This is a 16-byte string which may contain non-ASCII characters, including null bytes.
Terminate the message-digest computation and return digest.
[ "Terminate", "the", "message", "-", "digest", "computation", "and", "return", "digest", "." ]
def digest(self): """Terminate the message-digest computation and return digest. Return the digest of the strings passed to the update() method so far. This is a 16-byte string which may contain non-ASCII characters, including null bytes. """ A = self.A B = self...
[ "def", "digest", "(", "self", ")", ":", "A", "=", "self", ".", "A", "B", "=", "self", ".", "B", "C", "=", "self", ".", "C", "D", "=", "self", ".", "D", "input", "=", "[", "]", "+", "self", ".", "input", "count", "=", "[", "]", "+", "self"...
https://github.com/inkandswitch/livebook/blob/93c8d467734787366ad084fc3566bf5cbe249c51/public/pypyjs/modules/_md5.py#L297-L337
ArangoDB-Community/pyArango
57eba567b32c5c8d57b4322599e4a32cbd68d025
pyArango/connection.py
python
Connection.resetSession
(self, username=None, password=None, verify=True)
resets the session
resets the session
[ "resets", "the", "session" ]
def resetSession(self, username=None, password=None, verify=True): """resets the session""" self.disconnectSession() if self.use_grequests: from .gevent_session import AikidoSession_GRequests self.session = AikidoSession_GRequests( username, password, self...
[ "def", "resetSession", "(", "self", ",", "username", "=", "None", ",", "password", "=", "None", ",", "verify", "=", "True", ")", ":", "self", ".", "disconnectSession", "(", ")", "if", "self", ".", "use_grequests", ":", "from", ".", "gevent_session", "imp...
https://github.com/ArangoDB-Community/pyArango/blob/57eba567b32c5c8d57b4322599e4a32cbd68d025/pyArango/connection.py#L263-L284
etetoolkit/ete
2b207357dc2a40ccad7bfd8f54964472c72e4726
ete3/nexml/_nexml.py
python
RNAChar.build
(self, node)
[]
def build(self, node): self.buildAttributes(node, node.attrib, []) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_)
[ "def", "build", "(", "self", ",", "node", ")", ":", "self", ".", "buildAttributes", "(", "node", ",", "node", ".", "attrib", ",", "[", "]", ")", "for", "child", "in", "node", ":", "nodeName_", "=", "Tag_pattern_", ".", "match", "(", "child", ".", "...
https://github.com/etetoolkit/ete/blob/2b207357dc2a40ccad7bfd8f54964472c72e4726/ete3/nexml/_nexml.py#L8977-L8981
bjmayor/hacker
e3ce2ad74839c2733b27dac6c0f495e0743e1866
venv/lib/python3.5/site-packages/setuptools/__init__.py
python
PackageFinder.find
(cls, where='.', exclude=(), include=('*',))
return list(cls._find_packages_iter( convert_path(where), cls._build_filter('ez_setup', '*__pycache__', *exclude), cls._build_filter(*include)))
Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of ...
Return a list all Python packages found within directory 'where'
[ "Return", "a", "list", "all", "Python", "packages", "found", "within", "directory", "where" ]
def find(cls, where='.', exclude=(), include=('*',)): """Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the ap...
[ "def", "find", "(", "cls", ",", "where", "=", "'.'", ",", "exclude", "=", "(", ")", ",", "include", "=", "(", "'*'", ",", ")", ")", ":", "return", "list", "(", "cls", ".", "_find_packages_iter", "(", "convert_path", "(", "where", ")", ",", "cls", ...
https://github.com/bjmayor/hacker/blob/e3ce2ad74839c2733b27dac6c0f495e0743e1866/venv/lib/python3.5/site-packages/setuptools/__init__.py#L40-L60
ni/nidaqmx-python
62fc6b48cbbb330fe1bcc9aedadc86610a1269b6
nidaqmx/_task_modules/channels/ai_channel.py
python
AIChannel.ai_velocity_units
(self)
[]
def ai_velocity_units(self): cfunc = lib_importer.windll.DAQmxResetAIVelocityUnits if cfunc.argtypes is None: with cfunc.arglock: if cfunc.argtypes is None: cfunc.argtypes = [ lib_importer.task_handle, ctypes_byte_str] erro...
[ "def", "ai_velocity_units", "(", "self", ")", ":", "cfunc", "=", "lib_importer", ".", "windll", ".", "DAQmxResetAIVelocityUnits", "if", "cfunc", ".", "argtypes", "is", "None", ":", "with", "cfunc", ".", "arglock", ":", "if", "cfunc", ".", "argtypes", "is", ...
https://github.com/ni/nidaqmx-python/blob/62fc6b48cbbb330fe1bcc9aedadc86610a1269b6/nidaqmx/_task_modules/channels/ai_channel.py#L8159-L8169
mcedit/mcedit
8dcbd4fc52fde73049a229ab5da2c1420a872fa6
png.py
python
Test.testExtraPixels
(self)
Test file that contains too many pixels.
Test file that contains too many pixels.
[ "Test", "file", "that", "contains", "too", "many", "pixels", "." ]
def testExtraPixels(self): """Test file that contains too many pixels.""" def eachchunk(chunk): if chunk[0] != 'IDAT': return chunk data = chunk[1].decode('zip') data += '\x00garbage' data = data.encode('zip') chunk = (chunk[0]...
[ "def", "testExtraPixels", "(", "self", ")", ":", "def", "eachchunk", "(", "chunk", ")", ":", "if", "chunk", "[", "0", "]", "!=", "'IDAT'", ":", "return", "chunk", "data", "=", "chunk", "[", "1", "]", ".", "decode", "(", "'zip'", ")", "data", "+=", ...
https://github.com/mcedit/mcedit/blob/8dcbd4fc52fde73049a229ab5da2c1420a872fa6/png.py#L2407-L2418
apple/ccs-calendarserver
13c706b985fb728b9aab42dc0fef85aae21921c3
txdav/caldav/datastore/scheduling/cuaddress.py
python
InvalidCalendarUser.__init__
(self, cuaddr, record=None)
[]
def __init__(self, cuaddr, record=None): self.cuaddr = cuaddr self.record = record
[ "def", "__init__", "(", "self", ",", "cuaddr", ",", "record", "=", "None", ")", ":", "self", ".", "cuaddr", "=", "cuaddr", "self", ".", "record", "=", "record" ]
https://github.com/apple/ccs-calendarserver/blob/13c706b985fb728b9aab42dc0fef85aae21921c3/txdav/caldav/datastore/scheduling/cuaddress.py#L175-L177
feliam/pysymemu
ad02e52122099d537372eb4d11fd5024b8a3857f
cpu.py
python
Cpu.XGETBV
(cpu)
XGETBV instruction. Reads the contents of the extended cont register (XCR) specified in the ECX register into registers EDX:EAX. Implemented only for ECX = 0. @param cpu: current CPU.
XGETBV instruction. Reads the contents of the extended cont register (XCR) specified in the ECX register into registers EDX:EAX. Implemented only for ECX = 0.
[ "XGETBV", "instruction", ".", "Reads", "the", "contents", "of", "the", "extended", "cont", "register", "(", "XCR", ")", "specified", "in", "the", "ECX", "register", "into", "registers", "EDX", ":", "EAX", ".", "Implemented", "only", "for", "ECX", "=", "0",...
def XGETBV(cpu): ''' XGETBV instruction. Reads the contents of the extended cont register (XCR) specified in the ECX register into registers EDX:EAX. Implemented only for ECX = 0. @param cpu: current CPU. ''' assert cpu.ECX == 0, 'Only implemen...
[ "def", "XGETBV", "(", "cpu", ")", ":", "assert", "cpu", ".", "ECX", "==", "0", ",", "'Only implemented for ECX = 0'", "cpu", ".", "EAX", "=", "0x7", "cpu", ".", "EDX", "=", "0x0" ]
https://github.com/feliam/pysymemu/blob/ad02e52122099d537372eb4d11fd5024b8a3857f/cpu.py#L1080-L1091
istresearch/scrapy-cluster
01861c2dca1563aab740417d315cc4ebf9b73f72
crawler/crawling/log_retry_middleware.py
python
LogRetryMiddleware._increment_504_stat
(self, request)
Increments the 504 stat counters @param request: The scrapy request in the spider
Increments the 504 stat counters
[ "Increments", "the", "504", "stat", "counters" ]
def _increment_504_stat(self, request): ''' Increments the 504 stat counters @param request: The scrapy request in the spider ''' for key in self.stats_dict: if key == 'lifetime': unique = request.url + str(time.time()) self.stats_dict...
[ "def", "_increment_504_stat", "(", "self", ",", "request", ")", ":", "for", "key", "in", "self", ".", "stats_dict", ":", "if", "key", "==", "'lifetime'", ":", "unique", "=", "request", ".", "url", "+", "str", "(", "time", ".", "time", "(", ")", ")", ...
https://github.com/istresearch/scrapy-cluster/blob/01861c2dca1563aab740417d315cc4ebf9b73f72/crawler/crawling/log_retry_middleware.py#L153-L165
makerbot/ReplicatorG
d6f2b07785a5a5f1e172fb87cb4303b17c575d5d
skein_engines/skeinforge-35/fabmetheus_utilities/geometry/creation/gear.py
python
getGearPaths
(derivation, pitchRadius, teeth, toothProfile)
return [getGearProfileCylinder(teeth, toothProfile)]
Get gear paths.
Get gear paths.
[ "Get", "gear", "paths", "." ]
def getGearPaths(derivation, pitchRadius, teeth, toothProfile): 'Get gear paths.' if teeth < 0: return getGearProfileAnnulus(derivation, pitchRadius, teeth, toothProfile) if teeth == 0: return [getGearProfileRack(derivation, toothProfile)] return [getGearProfileCylinder(teeth, toothProfile)]
[ "def", "getGearPaths", "(", "derivation", ",", "pitchRadius", ",", "teeth", ",", "toothProfile", ")", ":", "if", "teeth", "<", "0", ":", "return", "getGearProfileAnnulus", "(", "derivation", ",", "pitchRadius", ",", "teeth", ",", "toothProfile", ")", "if", "...
https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-35/fabmetheus_utilities/geometry/creation/gear.py#L173-L179
marinho/geraldo
868ebdce67176d9b6205cddc92476f642c783fff
site/newsite/site-geraldo/django/utils/_decimal.py
python
Decimal.__int__
(self)
return int(sign + s)
Converts self to an int, truncating if necessary.
Converts self to an int, truncating if necessary.
[ "Converts", "self", "to", "an", "int", "truncating", "if", "necessary", "." ]
def __int__(self): """Converts self to an int, truncating if necessary.""" if self._is_special: if self._isnan(): context = getcontext() return context._raise_error(InvalidContext) elif self._isinfinity(): raise OverflowError, "Cann...
[ "def", "__int__", "(", "self", ")", ":", "if", "self", ".", "_is_special", ":", "if", "self", ".", "_isnan", "(", ")", ":", "context", "=", "getcontext", "(", ")", "return", "context", ".", "_raise_error", "(", "InvalidContext", ")", "elif", "self", "....
https://github.com/marinho/geraldo/blob/868ebdce67176d9b6205cddc92476f642c783fff/site/newsite/site-geraldo/django/utils/_decimal.py#L1449-L1464
google/grr
8ad8a4d2c5a93c92729206b7771af19d92d4f915
grr/server/grr_response_server/flows/general/transfer.py
python
MultiGetFile.GetProgress
(self)
return MultiGetFileProgress( num_pending_hashes=len(self.state.pending_hashes), num_pending_files=len(self.state.pending_files), num_skipped=self.state.files_skipped, num_collected=self.state.files_fetched, num_failed=self.state.files_failed, pathspecs_progress=self.state...
[]
def GetProgress(self) -> MultiGetFileProgress: return MultiGetFileProgress( num_pending_hashes=len(self.state.pending_hashes), num_pending_files=len(self.state.pending_files), num_skipped=self.state.files_skipped, num_collected=self.state.files_fetched, num_failed=self.state....
[ "def", "GetProgress", "(", "self", ")", "->", "MultiGetFileProgress", ":", "return", "MultiGetFileProgress", "(", "num_pending_hashes", "=", "len", "(", "self", ".", "state", ".", "pending_hashes", ")", ",", "num_pending_files", "=", "len", "(", "self", ".", "...
https://github.com/google/grr/blob/8ad8a4d2c5a93c92729206b7771af19d92d4f915/grr/server/grr_response_server/flows/general/transfer.py#L831-L838
shivam5992/textstat
b3d588d68341a1a413d358e38814fcb70e33778f
textstat/textstat.py
python
textstatistics.szigriszt_pazos
(self, text: str)
return self._legacy_round(s_p, 2)
Szigriszt Pazos readability score (1992) https://legible.es/blog/perspicuidad-szigriszt-pazos/
Szigriszt Pazos readability score (1992) https://legible.es/blog/perspicuidad-szigriszt-pazos/
[ "Szigriszt", "Pazos", "readability", "score", "(", "1992", ")", "https", ":", "//", "legible", ".", "es", "/", "blog", "/", "perspicuidad", "-", "szigriszt", "-", "pazos", "/" ]
def szigriszt_pazos(self, text: str) -> float: ''' Szigriszt Pazos readability score (1992) https://legible.es/blog/perspicuidad-szigriszt-pazos/ ''' syllables = self.syllable_count(text) total_words = self.lexicon_count(text) total_sentences = self.sentence_count...
[ "def", "szigriszt_pazos", "(", "self", ",", "text", ":", "str", ")", "->", "float", ":", "syllables", "=", "self", ".", "syllable_count", "(", "text", ")", "total_words", "=", "self", ".", "lexicon_count", "(", "text", ")", "total_sentences", "=", "self", ...
https://github.com/shivam5992/textstat/blob/b3d588d68341a1a413d358e38814fcb70e33778f/textstat/textstat.py#L1297-L1313
pwnieexpress/raspberry_pwn
86f80e781cfb9f130a21a7ff41ef3d5c0340f287
src/pexpect-2.3/pexpect.py
python
spawn.read
(self, size = -1)
return self.before
This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediate...
This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediate...
[ "This", "reads", "at", "most", "size", "bytes", "from", "the", "file", "(", "less", "if", "the", "read", "hits", "EOF", "before", "obtaining", "size", "bytes", ")", ".", "If", "the", "size", "argument", "is", "negative", "or", "omitted", "read", "all", ...
def read (self, size = -1): # File-like object. """This reads at most "size" bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empt...
[ "def", "read", "(", "self", ",", "size", "=", "-", "1", ")", ":", "# File-like object.", "if", "size", "==", "0", ":", "return", "''", "if", "size", "<", "0", ":", "self", ".", "expect", "(", "self", ".", "delimiter", ")", "# delimiter default is EOF",...
https://github.com/pwnieexpress/raspberry_pwn/blob/86f80e781cfb9f130a21a7ff41ef3d5c0340f287/src/pexpect-2.3/pexpect.py#L847-L872
1040003585/WebScrapingWithPython
a770fa5b03894076c8c9539b1ffff34424ffc016
1.网络爬虫简介/1.4.4link_crawler4_UltimateVersion_zhihu.py
python
link_crawler
(seed_url, link_regex=None, delay=5, max_depth=-1, max_urls=-1, headers=None, user_agent='wswp', proxy=None, num_retries=1)
Crawl from the given seed URL following links matched by link_regex
Crawl from the given seed URL following links matched by link_regex
[ "Crawl", "from", "the", "given", "seed", "URL", "following", "links", "matched", "by", "link_regex" ]
def link_crawler(seed_url, link_regex=None, delay=5, max_depth=-1, max_urls=-1, headers=None, user_agent='wswp', proxy=None, num_retries=1): """Crawl from the given seed URL following links matched by link_regex """ # the queue of URL's that still need to be crawled crawl_queue = Queue.deque([seed_url])...
[ "def", "link_crawler", "(", "seed_url", ",", "link_regex", "=", "None", ",", "delay", "=", "5", ",", "max_depth", "=", "-", "1", ",", "max_urls", "=", "-", "1", ",", "headers", "=", "None", ",", "user_agent", "=", "'wswp'", ",", "proxy", "=", "None",...
https://github.com/1040003585/WebScrapingWithPython/blob/a770fa5b03894076c8c9539b1ffff34424ffc016/1.网络爬虫简介/1.4.4link_crawler4_UltimateVersion_zhihu.py#L12-L58
deepgully/me
f7ad65edc2fe435310c6676bc2e322cfe5d4c8f0
libs/sqlalchemy/dialects/mysql/oursql.py
python
_oursqlBIT.result_processor
(self, dialect, coltype)
return None
oursql already converts mysql bits, so.
oursql already converts mysql bits, so.
[ "oursql", "already", "converts", "mysql", "bits", "so", "." ]
def result_processor(self, dialect, coltype): """oursql already converts mysql bits, so.""" return None
[ "def", "result_processor", "(", "self", ",", "dialect", ",", "coltype", ")", ":", "return", "None" ]
https://github.com/deepgully/me/blob/f7ad65edc2fe435310c6676bc2e322cfe5d4c8f0/libs/sqlalchemy/dialects/mysql/oursql.py#L43-L46
wrye-bash/wrye-bash
d495c47cfdb44475befa523438a40c4419cb386f
Mopy/bash/basher/mods_links.py
python
_Mods_LoadListData.getItemList
(self)
return sorted(self.loadListDict, key=lambda a: a.lower())
Returns load list keys in alpha order.
Returns load list keys in alpha order.
[ "Returns", "load", "list", "keys", "in", "alpha", "order", "." ]
def getItemList(self): """Returns load list keys in alpha order.""" return sorted(self.loadListDict, key=lambda a: a.lower())
[ "def", "getItemList", "(", "self", ")", ":", "return", "sorted", "(", "self", ".", "loadListDict", ",", "key", "=", "lambda", "a", ":", "a", ".", "lower", "(", ")", ")" ]
https://github.com/wrye-bash/wrye-bash/blob/d495c47cfdb44475befa523438a40c4419cb386f/Mopy/bash/basher/mods_links.py#L58-L60
pjkundert/cpppo
4c217b6c06b88bede3888cc5ea2731f271a95086
server/enip/pccc.py
python
PCCC_ANC_120e.produce
( cls, data )
return cls.parser.produce( data )
[]
def produce( cls, data ): return cls.parser.produce( data )
[ "def", "produce", "(", "cls", ",", "data", ")", ":", "return", "cls", ".", "parser", ".", "produce", "(", "data", ")" ]
https://github.com/pjkundert/cpppo/blob/4c217b6c06b88bede3888cc5ea2731f271a95086/server/enip/pccc.py#L332-L333
StyraHem/ShellyForHASS
902c04ab25b0a7667718eeef53bb6ad43614fe2f
custom_components/shelly/block.py
python
ShellyBlock.extra_state_attributes
(self)
return attrs
Show state attributes in HASS
Show state attributes in HASS
[ "Show", "state", "attributes", "in", "HASS" ]
def extra_state_attributes(self): """Show state attributes in HASS""" attrs = {'shelly_type': self._block.type_name(), 'shelly_id': self._block.id, 'ip_address': self._block.ip_addr } room = self._block.room_name() if room: a...
[ "def", "extra_state_attributes", "(", "self", ")", ":", "attrs", "=", "{", "'shelly_type'", ":", "self", ".", "_block", ".", "type_name", "(", ")", ",", "'shelly_id'", ":", "self", ".", "_block", ".", "id", ",", "'ip_address'", ":", "self", ".", "_block"...
https://github.com/StyraHem/ShellyForHASS/blob/902c04ab25b0a7667718eeef53bb6ad43614fe2f/custom_components/shelly/block.py#L76-L95