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
spack/spack
675210bd8bd1c5d32ad1cc83d898fb43b569ed74
lib/spack/external/jinja2/utils.py
python
LRUCache.__len__
(self)
return len(self._mapping)
Return the current size of the cache.
Return the current size of the cache.
[ "Return", "the", "current", "size", "of", "the", "cache", "." ]
def __len__(self): """Return the current size of the cache.""" return len(self._mapping)
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_mapping", ")" ]
https://github.com/spack/spack/blob/675210bd8bd1c5d32ad1cc83d898fb43b569ed74/lib/spack/external/jinja2/utils.py#L413-L415
F8LEFT/DecLLVM
d38e45e3d0dd35634adae1d0cf7f96f3bd96e74c
python/idaapi.py
python
py_get_call_idc_func
(*args)
return _idaapi.py_get_call_idc_func(*args)
py_get_call_idc_func() -> size_t
py_get_call_idc_func() -> size_t
[ "py_get_call_idc_func", "()", "-", ">", "size_t" ]
def py_get_call_idc_func(*args): """ py_get_call_idc_func() -> size_t """ return _idaapi.py_get_call_idc_func(*args)
[ "def", "py_get_call_idc_func", "(", "*", "args", ")", ":", "return", "_idaapi", ".", "py_get_call_idc_func", "(", "*", "args", ")" ]
https://github.com/F8LEFT/DecLLVM/blob/d38e45e3d0dd35634adae1d0cf7f96f3bd96e74c/python/idaapi.py#L26352-L26356
nlloyd/SubliminalCollaborator
5c619e17ddbe8acb9eea8996ec038169ddcd50a1
libs/twisted/words/protocols/msn.py
python
SwitchboardClient.gotSendRequest
(self, fileName, fileSize, iCookie, message)
called when a contact is trying to send us a file. To accept or reject this transfer see the fileInvitationReply method. @param fileName: the name of the file @param fileSize: the size of the file @param iCookie: the invitation cookie, used so the client can ...
called when a contact is trying to send us a file. To accept or reject this transfer see the fileInvitationReply method.
[ "called", "when", "a", "contact", "is", "trying", "to", "send", "us", "a", "file", ".", "To", "accept", "or", "reject", "this", "transfer", "see", "the", "fileInvitationReply", "method", "." ]
def gotSendRequest(self, fileName, fileSize, iCookie, message): """ called when a contact is trying to send us a file. To accept or reject this transfer see the fileInvitationReply method. @param fileName: the name of the file @param fileSize: the size of the file ...
[ "def", "gotSendRequest", "(", "self", ",", "fileName", ",", "fileSize", ",", "iCookie", ",", "message", ")", ":", "pass" ]
https://github.com/nlloyd/SubliminalCollaborator/blob/5c619e17ddbe8acb9eea8996ec038169ddcd50a1/libs/twisted/words/protocols/msn.py#L1941-L1954
git-cola/git-cola
b48b8028e0c3baf47faf7b074b9773737358163d
cola/cmds.py
python
AbortMerge.action
(self)
return status, out, err
[]
def action(self): status, out, err = gitcmds.abort_merge(self.context) self.model.update_file_status() return status, out, err
[ "def", "action", "(", "self", ")", ":", "status", ",", "out", ",", "err", "=", "gitcmds", ".", "abort_merge", "(", "self", ".", "context", ")", "self", ".", "model", ".", "update_file_status", "(", ")", "return", "status", ",", "out", ",", "err" ]
https://github.com/git-cola/git-cola/blob/b48b8028e0c3baf47faf7b074b9773737358163d/cola/cmds.py#L145-L148
SoCo/SoCo
e83fef84d2645d05265dbd574598518655a9c125
soco/discovery.py
python
scan_network_get_by_name
(name, household_id=None, **network_scan_kwargs)
return matching_zone
Convenience function to use `scan_network` to find a zone by its name. Note that if there are multiple zones with the same name, then only one of the zones will be returned. Optionally, the search can be constrained to a specific household. Args: name (str): The name of the zone to find. ...
Convenience function to use `scan_network` to find a zone by its name.
[ "Convenience", "function", "to", "use", "scan_network", "to", "find", "a", "zone", "by", "its", "name", "." ]
def scan_network_get_by_name(name, household_id=None, **network_scan_kwargs): """Convenience function to use `scan_network` to find a zone by its name. Note that if there are multiple zones with the same name, then only one of the zones will be returned. Optionally, the search can be constrained to...
[ "def", "scan_network_get_by_name", "(", "name", ",", "household_id", "=", "None", ",", "*", "*", "network_scan_kwargs", ")", ":", "# multi_household must be set to True", "network_scan_kwargs", "[", "\"multi_household\"", "]", "=", "True", "zones", "=", "scan_network", ...
https://github.com/SoCo/SoCo/blob/e83fef84d2645d05265dbd574598518655a9c125/soco/discovery.py#L469-L507
bikalims/bika.lims
35e4bbdb5a3912cae0b5eb13e51097c8b0486349
bika/lims/jsonapi/interfaces.py
python
ICatalog.get_indexes
()
get all indexes managed by this catalog
get all indexes managed by this catalog
[ "get", "all", "indexes", "managed", "by", "this", "catalog" ]
def get_indexes(): """ get all indexes managed by this catalog """
[ "def", "get_indexes", "(", ")", ":" ]
https://github.com/bikalims/bika.lims/blob/35e4bbdb5a3912cae0b5eb13e51097c8b0486349/bika/lims/jsonapi/interfaces.py#L65-L67
SamSchott/maestral
a32653bac7b5a76cb326d4fd5a4fb2c11f19a2fc
src/maestral/database.py
python
SyncEvent.is_added
(self)
return self.change_type == ChangeType.Added
Returns True for added items
Returns True for added items
[ "Returns", "True", "for", "added", "items" ]
def is_added(self) -> bool: """Returns True for added items""" return self.change_type == ChangeType.Added
[ "def", "is_added", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "change_type", "==", "ChangeType", ".", "Added" ]
https://github.com/SamSchott/maestral/blob/a32653bac7b5a76cb326d4fd5a4fb2c11f19a2fc/src/maestral/database.py#L244-L246
cannatag/ldap3
040e09fe37cf06801960d494dfadf0a6ed94e38f
ldap3/strategy/base.py
python
BaseStrategy.decode_control
(control)
return control_type, {'description': Oids.get(control_type, ''), 'criticality': criticality, 'value': control_value}
decode control, return a 2-element tuple where the first element is the control oid and the second element is a dictionary with description (from Oids), criticality and decoded control value
decode control, return a 2-element tuple where the first element is the control oid and the second element is a dictionary with description (from Oids), criticality and decoded control value
[ "decode", "control", "return", "a", "2", "-", "element", "tuple", "where", "the", "first", "element", "is", "the", "control", "oid", "and", "the", "second", "element", "is", "a", "dictionary", "with", "description", "(", "from", "Oids", ")", "criticality", ...
def decode_control(control): """ decode control, return a 2-element tuple where the first element is the control oid and the second element is a dictionary with description (from Oids), criticality and decoded control value """ control_type = str(control['controlType']) c...
[ "def", "decode_control", "(", "control", ")", ":", "control_type", "=", "str", "(", "control", "[", "'controlType'", "]", ")", "criticality", "=", "bool", "(", "control", "[", "'criticality'", "]", ")", "control_value", "=", "bytes", "(", "control", "[", "...
https://github.com/cannatag/ldap3/blob/040e09fe37cf06801960d494dfadf0a6ed94e38f/ldap3/strategy/base.py#L575-L602
hexway/apple_bleee
1f8022959be660b561e6004b808dd93fa252bc90
opendrop2/zeroconf.py
python
DNSText.write
(self, out)
Used in constructing an outgoing packet
Used in constructing an outgoing packet
[ "Used", "in", "constructing", "an", "outgoing", "packet" ]
def write(self, out): """Used in constructing an outgoing packet""" out.write_string(self.text)
[ "def", "write", "(", "self", ",", "out", ")", ":", "out", ".", "write_string", "(", "self", ".", "text", ")" ]
https://github.com/hexway/apple_bleee/blob/1f8022959be660b561e6004b808dd93fa252bc90/opendrop2/zeroconf.py#L570-L572
aws-quickstart/quickstart-redhat-openshift
2b87dd38b72e7e4c439a606c5a9ea458d72da612
functions/source/KeyGen/asn1crypto/core.py
python
ObjectIdentifier.dotted
(self)
return self._dotted
:return: A unicode string of the object identifier in dotted notation, thus ignoring any mapped value
:return: A unicode string of the object identifier in dotted notation, thus ignoring any mapped value
[ ":", "return", ":", "A", "unicode", "string", "of", "the", "object", "identifier", "in", "dotted", "notation", "thus", "ignoring", "any", "mapped", "value" ]
def dotted(self): """ :return: A unicode string of the object identifier in dotted notation, thus ignoring any mapped value """ if self._dotted is None: output = [] part = 0 for byte in self.contents: if _PY2: ...
[ "def", "dotted", "(", "self", ")", ":", "if", "self", ".", "_dotted", "is", "None", ":", "output", "=", "[", "]", "part", "=", "0", "for", "byte", "in", "self", ".", "contents", ":", "if", "_PY2", ":", "byte", "=", "ord", "(", "byte", ")", "par...
https://github.com/aws-quickstart/quickstart-redhat-openshift/blob/2b87dd38b72e7e4c439a606c5a9ea458d72da612/functions/source/KeyGen/asn1crypto/core.py#L2891-L2917
pykaldi/pykaldi
b4e7a15a31286e57c01259edfda54d113b5ceb0e
kaldi/alignment.py
python
Aligner.to_word_alignment
(self, best_path, word_boundary_info)
return list(map(mapper, zip(*word_alignment)))
Converts best alignment path to word-level alignment. Args: best_path (CompactLattice): Best alignment path. word_boundary_info (WordBoundaryInfo): Word boundary information. Returns: List[Tuple[int,int,int]]: A list of triplets representing, for each wo...
Converts best alignment path to word-level alignment.
[ "Converts", "best", "alignment", "path", "to", "word", "-", "level", "alignment", "." ]
def to_word_alignment(self, best_path, word_boundary_info): """Converts best alignment path to word-level alignment. Args: best_path (CompactLattice): Best alignment path. word_boundary_info (WordBoundaryInfo): Word boundary information. Returns: List[Tuple[...
[ "def", "to_word_alignment", "(", "self", ",", "best_path", ",", "word_boundary_info", ")", ":", "success", ",", "best_path", "=", "_lat_align", ".", "word_align_lattice", "(", "best_path", ",", "self", ".", "transition_model", ",", "word_boundary_info", ",", "0", ...
https://github.com/pykaldi/pykaldi/blob/b4e7a15a31286e57c01259edfda54d113b5ceb0e/kaldi/alignment.py#L260-L282
hasegaw/IkaLog
bd476da541fcc296f792d4db76a6b9174c4777ad
ikalog/outputs/videorecorder.py
python
OBS.refresh_ui
(self)
[]
def refresh_ui(self): self._internal_update = True self.checkEnable.SetValue(self.enabled) self.checkAutoRenameEnable.SetValue(self.auto_rename_enabled) if not self.control_obs is None: self.editControlOBS.SetValue(self.control_obs) else: self.editControl...
[ "def", "refresh_ui", "(", "self", ")", ":", "self", ".", "_internal_update", "=", "True", "self", ".", "checkEnable", ".", "SetValue", "(", "self", ".", "enabled", ")", "self", ".", "checkAutoRenameEnable", ".", "SetValue", "(", "self", ".", "auto_rename_ena...
https://github.com/hasegaw/IkaLog/blob/bd476da541fcc296f792d4db76a6b9174c4777ad/ikalog/outputs/videorecorder.py#L48-L61
cisco/mindmeld
809c36112e9ea8019fe29d54d136ca14eb4fd8db
examples/custom_action/example_server/swagger_server/controllers/default_controller.py
python
invoke_action
(body)
return responder
Invoke an action This API accepts the serialized MindMeld Request and Responder and returns a serialized Responder :param body: :type body: dict | bytes :rtype: Responder
Invoke an action
[ "Invoke", "an", "action" ]
def invoke_action(body): """Invoke an action This API accepts the serialized MindMeld Request and Responder and returns a serialized Responder :param body: :type body: dict | bytes :rtype: Responder """ directives = [] if connexion.request.is_json: data = Data.from_dict(body) ...
[ "def", "invoke_action", "(", "body", ")", ":", "directives", "=", "[", "]", "if", "connexion", ".", "request", ".", "is_json", ":", "data", "=", "Data", ".", "from_dict", "(", "body", ")", "msg", "=", "\"Invoking {action} on custom server.\"", ".", "format",...
https://github.com/cisco/mindmeld/blob/809c36112e9ea8019fe29d54d136ca14eb4fd8db/examples/custom_action/example_server/swagger_server/controllers/default_controller.py#L8-L27
meduza-corp/interstellar
40a801ccd7856491726f5a126621d9318cabe2e1
gsutil/third_party/boto/boto/swf/layer1.py
python
Layer1.deprecate_workflow_type
(self, domain, workflow_name, workflow_version)
return self.json_request('DeprecateWorkflowType', { 'domain': domain, 'workflowType': {'name': workflow_name, 'version': workflow_version}, })
Deprecates the specified workflow type. After a workflow type has been deprecated, you cannot create new executions of that type. Executions that were started before the type was deprecated will continue to run. A deprecated workflow type may still be used when calling visibility actions...
Deprecates the specified workflow type. After a workflow type has been deprecated, you cannot create new executions of that type. Executions that were started before the type was deprecated will continue to run. A deprecated workflow type may still be used when calling visibility actions...
[ "Deprecates", "the", "specified", "workflow", "type", ".", "After", "a", "workflow", "type", "has", "been", "deprecated", "you", "cannot", "create", "new", "executions", "of", "that", "type", ".", "Executions", "that", "were", "started", "before", "the", "type...
def deprecate_workflow_type(self, domain, workflow_name, workflow_version): """ Deprecates the specified workflow type. After a workflow type has been deprecated, you cannot create new executions of that type. Executions that were started before the type was deprecated will conti...
[ "def", "deprecate_workflow_type", "(", "self", ",", "domain", ",", "workflow_name", ",", "workflow_version", ")", ":", "return", "self", ".", "json_request", "(", "'DeprecateWorkflowType'", ",", "{", "'domain'", ":", "domain", ",", "'workflowType'", ":", "{", "'...
https://github.com/meduza-corp/interstellar/blob/40a801ccd7856491726f5a126621d9318cabe2e1/gsutil/third_party/boto/boto/swf/layer1.py#L769-L794
ynhacler/RedKindle
7c970920dc840f869e38cbda480d630cc2e7b200
rq2/local.py
python
Local.__call__
(self, proxy)
return LocalProxy(self, proxy)
Create a proxy for a name.
Create a proxy for a name.
[ "Create", "a", "proxy", "for", "a", "name", "." ]
def __call__(self, proxy): """Create a proxy for a name.""" return LocalProxy(self, proxy)
[ "def", "__call__", "(", "self", ",", "proxy", ")", ":", "return", "LocalProxy", "(", "self", ",", "proxy", ")" ]
https://github.com/ynhacler/RedKindle/blob/7c970920dc840f869e38cbda480d630cc2e7b200/rq2/local.py#L59-L61
dreamworksanimation/usdmanager
dfd0825300c45d3bba25a585bfd0785d5bc50cb0
usdmanager/__init__.py
python
TabWidget.__init__
(self, parent=None)
Create and initialize the tab widget. :Parameters: parent : `UsdMngrWindow` Main window
Create and initialize the tab widget. :Parameters: parent : `UsdMngrWindow` Main window
[ "Create", "and", "initialize", "the", "tab", "widget", ".", ":", "Parameters", ":", "parent", ":", "UsdMngrWindow", "Main", "window" ]
def __init__(self, parent=None): """ Create and initialize the tab widget. :Parameters: parent : `UsdMngrWindow` Main window """ super(TabWidget, self).__init__(parent) self.tabBar = TabBar(self) self.tabBar.tabMoveRequested.connect(se...
[ "def", "__init__", "(", "self", ",", "parent", "=", "None", ")", ":", "super", "(", "TabWidget", ",", "self", ")", ".", "__init__", "(", "parent", ")", "self", ".", "tabBar", "=", "TabBar", "(", "self", ")", "self", ".", "tabBar", ".", "tabMoveReques...
https://github.com/dreamworksanimation/usdmanager/blob/dfd0825300c45d3bba25a585bfd0785d5bc50cb0/usdmanager/__init__.py#L3954-L3964
rembo10/headphones
b3199605be1ebc83a7a8feab6b1e99b64014187c
lib/beets/ui/commands.py
python
penalty_string
(distance, limit=None)
Returns a colorized string that indicates all the penalties applied to a distance object.
Returns a colorized string that indicates all the penalties applied to a distance object.
[ "Returns", "a", "colorized", "string", "that", "indicates", "all", "the", "penalties", "applied", "to", "a", "distance", "object", "." ]
def penalty_string(distance, limit=None): """Returns a colorized string that indicates all the penalties applied to a distance object. """ penalties = [] for key in distance.keys(): key = key.replace('album_', '') key = key.replace('track_', '') key = key.replace('_', ' ') ...
[ "def", "penalty_string", "(", "distance", ",", "limit", "=", "None", ")", ":", "penalties", "=", "[", "]", "for", "key", "in", "distance", ".", "keys", "(", ")", ":", "key", "=", "key", ".", "replace", "(", "'album_'", ",", "''", ")", "key", "=", ...
https://github.com/rembo10/headphones/blob/b3199605be1ebc83a7a8feab6b1e99b64014187c/lib/beets/ui/commands.py#L194-L207
PINTO0309/PINTO_model_zoo
2924acda7a7d541d8712efd7cc4fd1c61ef5bddd
011_mobilenetv2/02_mobilenet_v2_0.5_224/01_float32/01_freeze_the_saved_model_v1.py
python
convert_graph_def_to_saved_model
(export_dir, graph_filepath, input_name, outputs)
[]
def convert_graph_def_to_saved_model(export_dir, graph_filepath, input_name, outputs): graph_def = get_graph_def_from_file(graph_filepath) with tf.compat.v1.Session(graph=tf.Graph()) as session: tf.import_graph_def(graph_def, name='') tf.compat.v1.saved_model.simple_save( session, export_dir...
[ "def", "convert_graph_def_to_saved_model", "(", "export_dir", ",", "graph_filepath", ",", "input_name", ",", "outputs", ")", ":", "graph_def", "=", "get_graph_def_from_file", "(", "graph_filepath", ")", "with", "tf", ".", "compat", ".", "v1", ".", "Session", "(", ...
https://github.com/PINTO0309/PINTO_model_zoo/blob/2924acda7a7d541d8712efd7cc4fd1c61ef5bddd/011_mobilenetv2/02_mobilenet_v2_0.5_224/01_float32/01_freeze_the_saved_model_v1.py#L15-L26
nerdvegas/rez
d392c65bf63b4bca8106f938cec49144ba54e770
src/rez/vendor/pika/adapters/select_connection.py
python
IOLoop.start
(self)
[API] Start the main poller loop. It will loop until requested to exit. See `IOLoop.stop`.
[API] Start the main poller loop. It will loop until requested to exit. See `IOLoop.stop`.
[ "[", "API", "]", "Start", "the", "main", "poller", "loop", ".", "It", "will", "loop", "until", "requested", "to", "exit", ".", "See", "IOLoop", ".", "stop", "." ]
def start(self): """[API] Start the main poller loop. It will loop until requested to exit. See `IOLoop.stop`. """ self._poller.start()
[ "def", "start", "(", "self", ")", ":", "self", ".", "_poller", ".", "start", "(", ")" ]
https://github.com/nerdvegas/rez/blob/d392c65bf63b4bca8106f938cec49144ba54e770/src/rez/vendor/pika/adapters/select_connection.py#L541-L546
tp4a/teleport
1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad
server/www/packages/packages-linux/x64/pymysql/_auth.py
python
caching_sha2_password_auth
(conn, pkt)
[]
def caching_sha2_password_auth(conn, pkt): # No password fast path if not conn.password: return _roundtrip(conn, b'') if pkt.is_auth_switch_request(): # Try from fast auth if DEBUG: print("caching sha2: Trying fast path") conn.salt = pkt.read_all() scramb...
[ "def", "caching_sha2_password_auth", "(", "conn", ",", "pkt", ")", ":", "# No password fast path", "if", "not", "conn", ".", "password", ":", "return", "_roundtrip", "(", "conn", ",", "b''", ")", "if", "pkt", ".", "is_auth_switch_request", "(", ")", ":", "# ...
https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-linux/x64/pymysql/_auth.py#L208-L265
buke/GreenOdoo
3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df
runtime/python/lib/python2.7/random.py
python
Random.betavariate
(self, alpha, beta)
Beta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1.
Beta distribution.
[ "Beta", "distribution", "." ]
def betavariate(self, alpha, beta): """Beta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1. """ # This version due to Janne Sinkkonen, and matches all the std # texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta...
[ "def", "betavariate", "(", "self", ",", "alpha", ",", "beta", ")", ":", "# This version due to Janne Sinkkonen, and matches all the std", "# texts (e.g., Knuth Vol 2 Ed 3 pg 134 \"the beta distribution\").", "y", "=", "self", ".", "gammavariate", "(", "alpha", ",", "1.", ")...
https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/random.py#L609-L623
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/rings/padics/factory.py
python
QpCR
(p, prec = None, *args, **kwds)
return Qp(p, prec, 'capped-rel', *args, **kwds)
r""" A shortcut function to create capped relative `p`-adic fields. Same functionality as ``Qp``. See documentation for ``Qp`` for a description of the input parameters. EXAMPLES:: sage: QpCR(5, 40) 5-adic Field with capped relative precision 40
r""" A shortcut function to create capped relative `p`-adic fields.
[ "r", "A", "shortcut", "function", "to", "create", "capped", "relative", "p", "-", "adic", "fields", "." ]
def QpCR(p, prec = None, *args, **kwds): r""" A shortcut function to create capped relative `p`-adic fields. Same functionality as ``Qp``. See documentation for ``Qp`` for a description of the input parameters. EXAMPLES:: sage: QpCR(5, 40) 5-adic Field with capped relative precis...
[ "def", "QpCR", "(", "p", ",", "prec", "=", "None", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "return", "Qp", "(", "p", ",", "prec", ",", "'capped-rel'", ",", "*", "args", ",", "*", "*", "kwds", ")" ]
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/padics/factory.py#L1367-L1379
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-modules/twisted/twisted/protocols/amp.py
python
Command.responder
(cls, methodfunc)
return methodfunc
Declare a method to be a responder for a particular command. This is a decorator. Use like so:: class MyCommand(Command): arguments = [('a', ...), ('b', ...)] class MyProto(AMP): def myFunMethod(self, a, b): ... ...
Declare a method to be a responder for a particular command.
[ "Declare", "a", "method", "to", "be", "a", "responder", "for", "a", "particular", "command", "." ]
def responder(cls, methodfunc): """ Declare a method to be a responder for a particular command. This is a decorator. Use like so:: class MyCommand(Command): arguments = [('a', ...), ('b', ...)] class MyProto(AMP): def myFunMeth...
[ "def", "responder", "(", "cls", ",", "methodfunc", ")", ":", "CommandLocator", ".", "_currentClassCommands", ".", "append", "(", "(", "cls", ",", "methodfunc", ")", ")", "return", "methodfunc" ]
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-modules/twisted/twisted/protocols/amp.py#L1648-L1680
ilius/pyglossary
d599b3beda3ae17642af5debd83bb991148e6425
pyglossary/plugins/ebook_kobo.py
python
Writer.open
(self, filename: str)
[]
def open(self, filename: str) -> None: self._filename = filename
[ "def", "open", "(", "self", ",", "filename", ":", "str", ")", "->", "None", ":", "self", ".", "_filename", "=", "filename" ]
https://github.com/ilius/pyglossary/blob/d599b3beda3ae17642af5debd83bb991148e6425/pyglossary/plugins/ebook_kobo.py#L231-L232
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/graphs/graph_plot.py
python
GraphPlot.__init__
(self, graph, options)
Return a ``GraphPlot`` object, which stores all the parameters needed for plotting (Di)Graphs. A ``GraphPlot`` has a plot and show function, as well as some functions to set parameters for vertices and edges. This constructor assumes default options are set. Defaults are shown in the ...
Return a ``GraphPlot`` object, which stores all the parameters needed for plotting (Di)Graphs.
[ "Return", "a", "GraphPlot", "object", "which", "stores", "all", "the", "parameters", "needed", "for", "plotting", "(", "Di", ")", "Graphs", "." ]
def __init__(self, graph, options): """ Return a ``GraphPlot`` object, which stores all the parameters needed for plotting (Di)Graphs. A ``GraphPlot`` has a plot and show function, as well as some functions to set parameters for vertices and edges. This constructor assumes ...
[ "def", "__init__", "(", "self", ",", "graph", ",", "options", ")", ":", "# Setting the default values if needed", "for", "k", ",", "value", "in", "DEFAULT_PLOT_OPTIONS", ".", "items", "(", ")", ":", "if", "k", "not", "in", "options", ":", "options", "[", "...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/graphs/graph_plot.py#L263-L311
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/min/gzip.py
python
GzipFile.closed
(self)
return self.fileobj is None
[]
def closed(self): return self.fileobj is None
[ "def", "closed", "(", "self", ")", ":", "return", "self", ".", "fileobj", "is", "None" ]
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/min/gzip.py#L324-L325
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
examples/research_projects/movement-pruning/emmental/modeling_bert_masked.py
python
BertEncoder.__init__
(self, config)
[]
def __init__(self, config): super().__init__() self.output_attentions = config.output_attentions self.output_hidden_states = config.output_hidden_states self.layer = nn.ModuleList([BertLayer(config) for _ in range(config.num_hidden_layers)])
[ "def", "__init__", "(", "self", ",", "config", ")", ":", "super", "(", ")", ".", "__init__", "(", ")", "self", ".", "output_attentions", "=", "config", ".", "output_attentions", "self", ".", "output_hidden_states", "=", "config", ".", "output_hidden_states", ...
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/examples/research_projects/movement-pruning/emmental/modeling_bert_masked.py#L325-L329
UniShared/videonotes
803cdd97b90823fb17f50dd55999aa7d1fec6c3a
lib/apiclient/http.py
python
MediaIoBaseUpload.chunksize
(self)
return self._chunksize
Chunk size for resumable uploads. Returns: Chunk size in bytes.
Chunk size for resumable uploads.
[ "Chunk", "size", "for", "resumable", "uploads", "." ]
def chunksize(self): """Chunk size for resumable uploads. Returns: Chunk size in bytes. """ return self._chunksize
[ "def", "chunksize", "(", "self", ")", ":", "return", "self", ".", "_chunksize" ]
https://github.com/UniShared/videonotes/blob/803cdd97b90823fb17f50dd55999aa7d1fec6c3a/lib/apiclient/http.py#L306-L312
pypa/pipenv
b21baade71a86ab3ee1429f71fbc14d4f95fb75d
pipenv/vendor/funcsigs/__init__.py
python
Parameter.__str__
(self)
return formatted
[]
def __str__(self): kind = self.kind formatted = self._name if kind == _POSITIONAL_ONLY: if formatted is None: formatted = '' formatted = '<{0}>'.format(formatted) # Add annotation and default value if self._annotation is not _empty: ...
[ "def", "__str__", "(", "self", ")", ":", "kind", "=", "self", ".", "kind", "formatted", "=", "self", ".", "_name", "if", "kind", "==", "_POSITIONAL_ONLY", ":", "if", "formatted", "is", "None", ":", "formatted", "=", "''", "formatted", "=", "'<{0}>'", "...
https://github.com/pypa/pipenv/blob/b21baade71a86ab3ee1429f71fbc14d4f95fb75d/pipenv/vendor/funcsigs/__init__.py#L315-L337
oracle/graalpython
577e02da9755d916056184ec441c26e00b70145c
graalpython/lib-python/3/xml/dom/minidom.py
python
Identified._get_systemId
(self)
return self.systemId
[]
def _get_systemId(self): return self.systemId
[ "def", "_get_systemId", "(", "self", ")", ":", "return", "self", ".", "systemId" ]
https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/xml/dom/minidom.py#L1279-L1280
python-acoustics/python-acoustics
af72e7f88003f0bba06934ea38c98e8993c4a6c6
acoustics/standards/iso_9613_1_1993.py
python
relaxation_frequency_oxygen
(pressure, h, reference_pressure=REFERENCE_PRESSURE)
return pressure / reference_pressure * (24.0 + 4.04 * 10.0**4.0 * h * (0.02 + h) / (0.391 + h))
Relaxation frequency of oxygen :math:`f_{r,O}`. :param pressure: Ambient pressure :math:`p_a` :param reference_pressure: Reference pressure :math:`p_r` :param h: Molar concentration of water vapour :math:`h` The relaxation frequency of oxygen is calculated using .. math:: f_{r,O} = \\frac{p_a}{p_...
Relaxation frequency of oxygen :math:`f_{r,O}`.
[ "Relaxation", "frequency", "of", "oxygen", ":", "math", ":", "f_", "{", "r", "O", "}", "." ]
def relaxation_frequency_oxygen(pressure, h, reference_pressure=REFERENCE_PRESSURE): """ Relaxation frequency of oxygen :math:`f_{r,O}`. :param pressure: Ambient pressure :math:`p_a` :param reference_pressure: Reference pressure :math:`p_r` :param h: Molar concentration of water vapour :math:`h` ...
[ "def", "relaxation_frequency_oxygen", "(", "pressure", ",", "h", ",", "reference_pressure", "=", "REFERENCE_PRESSURE", ")", ":", "return", "pressure", "/", "reference_pressure", "*", "(", "24.0", "+", "4.04", "*", "10.0", "**", "4.0", "*", "h", "*", "(", "0....
https://github.com/python-acoustics/python-acoustics/blob/af72e7f88003f0bba06934ea38c98e8993c4a6c6/acoustics/standards/iso_9613_1_1993.py#L85-L98
django/channels_redis
fe27f1a83a87bf61a9245188c8825ddfa30119fa
channels_redis/core.py
python
RedisChannelLayer._clean_receive_backup
(self, index, channel)
Pop the oldest message off the channel backup queue. The result isn't interesting as it was already processed.
Pop the oldest message off the channel backup queue. The result isn't interesting as it was already processed.
[ "Pop", "the", "oldest", "message", "off", "the", "channel", "backup", "queue", ".", "The", "result", "isn", "t", "interesting", "as", "it", "was", "already", "processed", "." ]
async def _clean_receive_backup(self, index, channel): """ Pop the oldest message off the channel backup queue. The result isn't interesting as it was already processed. """ async with self.connection(index) as connection: await connection.zpopmin(self._backup_channel...
[ "async", "def", "_clean_receive_backup", "(", "self", ",", "index", ",", "channel", ")", ":", "async", "with", "self", ".", "connection", "(", "index", ")", "as", "connection", ":", "await", "connection", ".", "zpopmin", "(", "self", ".", "_backup_channel_na...
https://github.com/django/channels_redis/blob/fe27f1a83a87bf61a9245188c8825ddfa30119fa/channels_redis/core.py#L395-L401
NVIDIA/DeepLearningExamples
589604d49e016cd9ef4525f7abcc9c7b826cfc5e
TensorFlow/Detection/SSD/models/research/slim/nets/nasnet/nasnet.py
python
_imagenet_stem
(inputs, hparams, stem_cell, current_step=None)
return net, cell_outputs
Stem used for models trained on ImageNet.
Stem used for models trained on ImageNet.
[ "Stem", "used", "for", "models", "trained", "on", "ImageNet", "." ]
def _imagenet_stem(inputs, hparams, stem_cell, current_step=None): """Stem used for models trained on ImageNet.""" num_stem_cells = 2 # 149 x 149 x 32 num_stem_filters = int(32 * hparams.stem_multiplier) net = slim.conv2d( inputs, num_stem_filters, [3, 3], stride=2, scope='conv0', padding='VALID'...
[ "def", "_imagenet_stem", "(", "inputs", ",", "hparams", ",", "stem_cell", ",", "current_step", "=", "None", ")", ":", "num_stem_cells", "=", "2", "# 149 x 149 x 32", "num_stem_filters", "=", "int", "(", "32", "*", "hparams", ".", "stem_multiplier", ")", "net",...
https://github.com/NVIDIA/DeepLearningExamples/blob/589604d49e016cd9ef4525f7abcc9c7b826cfc5e/TensorFlow/Detection/SSD/models/research/slim/nets/nasnet/nasnet.py#L252-L277
tp4a/teleport
1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad
server/www/packages/packages-linux/x64/mako/util.py
python
LRUCache.values
(self)
return [i.value for i in dict.values(self)]
[]
def values(self): return [i.value for i in dict.values(self)]
[ "def", "values", "(", "self", ")", ":", "return", "[", "i", ".", "value", "for", "i", "in", "dict", ".", "values", "(", "self", ")", "]" ]
https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-linux/x64/mako/util.py#L200-L201
Nuitka/Nuitka
39262276993757fa4e299f497654065600453fc9
nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Node/Python.py
python
Value.get_text_contents
(self)
return contents
By the assumption that the node.built_value is a deterministic product of the sources, the contents of a Value are the concatenation of all the contents of its sources. As the value need not be built when get_contents() is called, we cannot use the actual node.built_value.
By the assumption that the node.built_value is a deterministic product of the sources, the contents of a Value are the concatenation of all the contents of its sources. As the value need not be built when get_contents() is called, we cannot use the actual node.built_value.
[ "By", "the", "assumption", "that", "the", "node", ".", "built_value", "is", "a", "deterministic", "product", "of", "the", "sources", "the", "contents", "of", "a", "Value", "are", "the", "concatenation", "of", "all", "the", "contents", "of", "its", "sources",...
def get_text_contents(self): """By the assumption that the node.built_value is a deterministic product of the sources, the contents of a Value are the concatenation of all the contents of its sources. As the value need not be built when get_contents() is called, we cannot use th...
[ "def", "get_text_contents", "(", "self", ")", ":", "###TODO: something reasonable about universal newlines", "contents", "=", "str", "(", "self", ".", "value", ")", "for", "kid", "in", "self", ".", "children", "(", "None", ")", ":", "contents", "=", "contents", ...
https://github.com/Nuitka/Nuitka/blob/39262276993757fa4e299f497654065600453fc9/nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Node/Python.py#L91-L101
IronLanguages/ironpython2
51fdedeeda15727717fb8268a805f71b06c0b9f1
Src/StdLib/Lib/site-packages/win32/lib/regutil.py
python
BuildDefaultPythonKey
()
return "Software\\Python\\PythonCore\\" + sys.winver
Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process to get the registry key currently in use.
Builds a string containing the path to the current registry key.
[ "Builds", "a", "string", "containing", "the", "path", "to", "the", "current", "registry", "key", "." ]
def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process to get the registry key currently in use. """ return "Software\\Python\\Pyt...
[ "def", "BuildDefaultPythonKey", "(", ")", ":", "return", "\"Software\\\\Python\\\\PythonCore\\\\\"", "+", "sys", ".", "winver" ]
https://github.com/IronLanguages/ironpython2/blob/51fdedeeda15727717fb8268a805f71b06c0b9f1/Src/StdLib/Lib/site-packages/win32/lib/regutil.py#L43-L51
oilshell/oil
94388e7d44a9ad879b12615f6203b38596b5a2d3
Python-2.7.13/Lib/sunau.py
python
Au_read.getparams
(self)
return self.getnchannels(), self.getsampwidth(), \ self.getframerate(), self.getnframes(), \ self.getcomptype(), self.getcompname()
[]
def getparams(self): return self.getnchannels(), self.getsampwidth(), \ self.getframerate(), self.getnframes(), \ self.getcomptype(), self.getcompname()
[ "def", "getparams", "(", "self", ")", ":", "return", "self", ".", "getnchannels", "(", ")", ",", "self", ".", "getsampwidth", "(", ")", ",", "self", ".", "getframerate", "(", ")", ",", "self", ".", "getnframes", "(", ")", ",", "self", ".", "getcompty...
https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/Python-2.7.13/Lib/sunau.py#L246-L249
CastagnaIT/plugin.video.netflix
5cf5fa436eb9956576c0f62aa31a4c7d6c5b8a4a
resources/lib/navigation/keymaps.py
python
_is_library_ops_allowed
()
return allow_lib_operations
Check if library operations are allowed
Check if library operations are allowed
[ "Check", "if", "library", "operations", "are", "allowed" ]
def _is_library_ops_allowed(): """Check if library operations are allowed""" allow_lib_operations = True lib_auto_upd_mode = G.ADDON.getSettingInt('lib_auto_upd_mode') if lib_auto_upd_mode == 0: return False is_lib_sync_with_mylist = (G.ADDON.getSettingBool('lib_sync_mylist') and ...
[ "def", "_is_library_ops_allowed", "(", ")", ":", "allow_lib_operations", "=", "True", "lib_auto_upd_mode", "=", "G", ".", "ADDON", ".", "getSettingInt", "(", "'lib_auto_upd_mode'", ")", "if", "lib_auto_upd_mode", "==", "0", ":", "return", "False", "is_lib_sync_with_...
https://github.com/CastagnaIT/plugin.video.netflix/blob/5cf5fa436eb9956576c0f62aa31a4c7d6c5b8a4a/resources/lib/navigation/keymaps.py#L101-L116
Abjad/abjad
d0646dfbe83db3dc5ab268f76a0950712b87b7fd
abjad/metricmodulation.py
python
MetricModulation.__hash__
(self)
return hash(self.__class__.__name__ + str(self))
Hashes metric modulation.
Hashes metric modulation.
[ "Hashes", "metric", "modulation", "." ]
def __hash__(self) -> int: """ Hashes metric modulation. """ return hash(self.__class__.__name__ + str(self))
[ "def", "__hash__", "(", "self", ")", "->", "int", ":", "return", "hash", "(", "self", ".", "__class__", ".", "__name__", "+", "str", "(", "self", ")", ")" ]
https://github.com/Abjad/abjad/blob/d0646dfbe83db3dc5ab268f76a0950712b87b7fd/abjad/metricmodulation.py#L436-L440
ShadowXZT/pytorch_RFCN
0e532444263938aa4d000113dc6aac2e72b4b925
faster_rcnn/roi_data_layer/layer.py
python
RoIDataLayer._get_next_minibatch_inds
(self)
return db_inds
Return the roidb indices for the next minibatch.
Return the roidb indices for the next minibatch.
[ "Return", "the", "roidb", "indices", "for", "the", "next", "minibatch", "." ]
def _get_next_minibatch_inds(self): """Return the roidb indices for the next minibatch.""" if cfg.TRAIN.HAS_RPN: if self._cur + cfg.TRAIN.IMS_PER_BATCH >= len(self._roidb): self._shuffle_roidb_inds() db_inds = self._perm[self._cur:self._cur + cfg.TRAIN.I...
[ "def", "_get_next_minibatch_inds", "(", "self", ")", ":", "if", "cfg", ".", "TRAIN", ".", "HAS_RPN", ":", "if", "self", ".", "_cur", "+", "cfg", ".", "TRAIN", ".", "IMS_PER_BATCH", ">=", "len", "(", "self", ".", "_roidb", ")", ":", "self", ".", "_shu...
https://github.com/ShadowXZT/pytorch_RFCN/blob/0e532444263938aa4d000113dc6aac2e72b4b925/faster_rcnn/roi_data_layer/layer.py#L36-L60
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py
python
kahane_simplify
(expression)
return t
r""" This function cancels contracted elements in a product of four dimensional gamma matrices, resulting in an expression equal to the given one, without the contracted gamma matrices. Parameters ========== `expression` the tensor expression containing the gamma matrices to simplify. ...
r""" This function cancels contracted elements in a product of four dimensional gamma matrices, resulting in an expression equal to the given one, without the contracted gamma matrices.
[ "r", "This", "function", "cancels", "contracted", "elements", "in", "a", "product", "of", "four", "dimensional", "gamma", "matrices", "resulting", "in", "an", "expression", "equal", "to", "the", "given", "one", "without", "the", "contracted", "gamma", "matrices"...
def kahane_simplify(expression): r""" This function cancels contracted elements in a product of four dimensional gamma matrices, resulting in an expression equal to the given one, without the contracted gamma matrices. Parameters ========== `expression` the tensor expression containing ...
[ "def", "kahane_simplify", "(", "expression", ")", ":", "if", "isinstance", "(", "expression", ",", "Mul", ")", ":", "return", "expression", "if", "isinstance", "(", "expression", ",", "TensAdd", ")", ":", "return", "TensAdd", "(", "*", "[", "kahane_simplify"...
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py#L335-L717
JiYou/openstack
8607dd488bde0905044b303eb6e52bdea6806923
packages/source/ceilometer/ceilometer/openstack/common/rpc/impl_qpid.py
python
FanoutPublisher.__init__
(self, conf, session, topic)
init a 'fanout' publisher.
init a 'fanout' publisher.
[ "init", "a", "fanout", "publisher", "." ]
def __init__(self, conf, session, topic): """init a 'fanout' publisher. """ super(FanoutPublisher, self).__init__( session, "%s_fanout" % topic, {"type": "fanout"})
[ "def", "__init__", "(", "self", ",", "conf", ",", "session", ",", "topic", ")", ":", "super", "(", "FanoutPublisher", ",", "self", ")", ".", "__init__", "(", "session", ",", "\"%s_fanout\"", "%", "topic", ",", "{", "\"type\"", ":", "\"fanout\"", "}", "...
https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/ceilometer/ceilometer/openstack/common/rpc/impl_qpid.py#L303-L308
kootenpv/yagmail
8eb3a057fe284499efb8433880a4f5ffc1e168a9
yagmail/message.py
python
prepare_contents
(contents, encoding)
return has_included_images, mime_objects
[]
def prepare_contents(contents, encoding): mime_objects = [] has_included_images = False if contents is not None: unnamed_attachment_id = 1 for is_marked_up, content in contents: if isinstance(content, io.IOBase): if not hasattr(content, 'name'): ...
[ "def", "prepare_contents", "(", "contents", ",", "encoding", ")", ":", "mime_objects", "=", "[", "]", "has_included_images", "=", "False", "if", "contents", "is", "not", "None", ":", "unnamed_attachment_id", "=", "1", "for", "is_marked_up", ",", "content", "in...
https://github.com/kootenpv/yagmail/blob/8eb3a057fe284499efb8433880a4f5ffc1e168a9/yagmail/message.py#L152-L167
Fizzadar/pyinfra
ff0913d6a172966760b63fe59e55dff9ea852e0d
pyinfra/facts/server.py
python
Groups.process
(output)
return groups
[]
def process(output): groups = [] for line in output: if ':' in line: groups.append(line.split(':')[0]) return groups
[ "def", "process", "(", "output", ")", ":", "groups", "=", "[", "]", "for", "line", "in", "output", ":", "if", "':'", "in", "line", ":", "groups", ".", "append", "(", "line", ".", "split", "(", "':'", ")", "[", "0", "]", ")", "return", "groups" ]
https://github.com/Fizzadar/pyinfra/blob/ff0913d6a172966760b63fe59e55dff9ea852e0d/pyinfra/facts/server.py#L337-L344
triaquae/triaquae
bbabf736b3ba56a0c6498e7f04e16c13b8b8f2b9
TriAquae/models/django/contrib/gis/geos/geometry.py
python
GEOSGeometry.set_srid
(self, srid)
Sets the SRID for the geometry.
Sets the SRID for the geometry.
[ "Sets", "the", "SRID", "for", "the", "geometry", "." ]
def set_srid(self, srid): "Sets the SRID for the geometry." capi.geos_set_srid(self.ptr, srid)
[ "def", "set_srid", "(", "self", ",", "srid", ")", ":", "capi", ".", "geos_set_srid", "(", "self", ".", "ptr", ",", "srid", ")" ]
https://github.com/triaquae/triaquae/blob/bbabf736b3ba56a0c6498e7f04e16c13b8b8f2b9/TriAquae/models/django/contrib/gis/geos/geometry.py#L366-L368
Yam-cn/pyalgotrade-cn
d8ba00e9a2bb609e3e925db17a9a97929c57f672
pyalgotrade/strategy/__init__.py
python
BaseStrategy.onEnterCanceled
(self, position)
Override (optional) to get notified when the order submitted to enter a position was canceled. The default implementation is empty. :param position: A position returned by any of the enterLongXXX or enterShortXXX methods. :type position: :class:`pyalgotrade.strategy.position.Position`.
Override (optional) to get notified when the order submitted to enter a position was canceled. The default implementation is empty.
[ "Override", "(", "optional", ")", "to", "get", "notified", "when", "the", "order", "submitted", "to", "enter", "a", "position", "was", "canceled", ".", "The", "default", "implementation", "is", "empty", "." ]
def onEnterCanceled(self, position): """Override (optional) to get notified when the order submitted to enter a position was canceled. The default implementation is empty. :param position: A position returned by any of the enterLongXXX or enterShortXXX methods. :type position: :class:`pyalgotra...
[ "def", "onEnterCanceled", "(", "self", ",", "position", ")", ":", "pass" ]
https://github.com/Yam-cn/pyalgotrade-cn/blob/d8ba00e9a2bb609e3e925db17a9a97929c57f672/pyalgotrade/strategy/__init__.py#L411-L417
openstack/ceilometer
9325ae36dc9066073b79fdfbe4757b14536679c7
ceilometer/polling/discovery/localnode.py
python
LocalNodeDiscovery.discover
(self, manager, param=None)
return ['local_host']
Return local node as resource.
Return local node as resource.
[ "Return", "local", "node", "as", "resource", "." ]
def discover(self, manager, param=None): """Return local node as resource.""" return ['local_host']
[ "def", "discover", "(", "self", ",", "manager", ",", "param", "=", "None", ")", ":", "return", "[", "'local_host'", "]" ]
https://github.com/openstack/ceilometer/blob/9325ae36dc9066073b79fdfbe4757b14536679c7/ceilometer/polling/discovery/localnode.py#L19-L21
pnprog/goreviewpartner
cbcc486cd4c51fb6fc3bc0a1eab61ff34298dadf
mss/darwin.py
python
cgfloat
()
return ctypes.c_double if sys.maxsize > 2 ** 32 else ctypes.c_float
Get the appropriate value for a float.
Get the appropriate value for a float.
[ "Get", "the", "appropriate", "value", "for", "a", "float", "." ]
def cgfloat(): # type: () -> Any """ Get the appropriate value for a float. """ return ctypes.c_double if sys.maxsize > 2 ** 32 else ctypes.c_float
[ "def", "cgfloat", "(", ")", ":", "# type: () -> Any", "return", "ctypes", ".", "c_double", "if", "sys", ".", "maxsize", ">", "2", "**", "32", "else", "ctypes", ".", "c_float" ]
https://github.com/pnprog/goreviewpartner/blob/cbcc486cd4c51fb6fc3bc0a1eab61ff34298dadf/mss/darwin.py#L22-L26
pwnieexpress/pwn_plug_sources
1a23324f5dc2c3de20f9c810269b6a29b2758cad
src/metagoofil/hachoir_parser/image/bmp.py
python
ImagePixels.createFields
(self)
[]
def createFields(self): for y in xrange(self._height-1, -1, -1): yield ImageLine(self, "line[%u]" % y, self._width, self._pixel) size = (self.size - self.current_size) // 8 if size: yield NullBytes(self, "padding", size)
[ "def", "createFields", "(", "self", ")", ":", "for", "y", "in", "xrange", "(", "self", ".", "_height", "-", "1", ",", "-", "1", ",", "-", "1", ")", ":", "yield", "ImageLine", "(", "self", ",", "\"line[%u]\"", "%", "y", ",", "self", ".", "_width",...
https://github.com/pwnieexpress/pwn_plug_sources/blob/1a23324f5dc2c3de20f9c810269b6a29b2758cad/src/metagoofil/hachoir_parser/image/bmp.py#L45-L50
Neuraxio/Neuraxle
c5627e663ef6d50736bc6a01110afa626fffec07
neuraxle/plotting.py
python
TrialMetricsPlottingObserver.on_next
(self, value: Tuple[HyperparamsRepository, Trial])
Plot updated trial metric results. :param value: hyperparams_repository, trial :return:
Plot updated trial metric results.
[ "Plot", "updated", "trial", "metric", "results", "." ]
def on_next(self, value: Tuple[HyperparamsRepository, Trial]): """ Plot updated trial metric results. :param value: hyperparams_repository, trial :return: """ # TODO : Rename function to something more meaningful like on_save_trial repo, trial = value if ...
[ "def", "on_next", "(", "self", ",", "value", ":", "Tuple", "[", "HyperparamsRepository", ",", "Trial", "]", ")", ":", "# TODO : Rename function to something more meaningful like on_save_trial", "repo", ",", "trial", "=", "value", "if", "not", "self", ".", "plot_tria...
https://github.com/Neuraxio/Neuraxle/blob/c5627e663ef6d50736bc6a01110afa626fffec07/neuraxle/plotting.py#L172-L184
pfnet/pytorch-pfn-extras
b7ced31c1e78a0527c36d745ca091ec270da49e3
pytorch_pfn_extras/training/_manager_protocol.py
python
ExtensionsManagerProtocol.elapsed_time
(self)
[]
def elapsed_time(self) -> float: ...
[ "def", "elapsed_time", "(", "self", ")", "->", "float", ":", "..." ]
https://github.com/pfnet/pytorch-pfn-extras/blob/b7ced31c1e78a0527c36d745ca091ec270da49e3/pytorch_pfn_extras/training/_manager_protocol.py#L44-L45
number5/cloud-init
19948dbaf40309355e1a2dbef116efb0ce66245c
cloudinit/sources/DataSourceOpenStack.py
python
detect_openstack
(accept_oracle=False)
return False
Return True when a potential OpenStack platform is detected.
Return True when a potential OpenStack platform is detected.
[ "Return", "True", "when", "a", "potential", "OpenStack", "platform", "is", "detected", "." ]
def detect_openstack(accept_oracle=False): """Return True when a potential OpenStack platform is detected.""" if not util.is_x86(): return True # Non-Intel cpus don't properly report dmi product names product_name = dmi.read_dmi_data("system-product-name") if product_name in VALID_DMI_PRODUCT_N...
[ "def", "detect_openstack", "(", "accept_oracle", "=", "False", ")", ":", "if", "not", "util", ".", "is_x86", "(", ")", ":", "return", "True", "# Non-Intel cpus don't properly report dmi product names", "product_name", "=", "dmi", ".", "read_dmi_data", "(", "\"system...
https://github.com/number5/cloud-init/blob/19948dbaf40309355e1a2dbef116efb0ce66245c/cloudinit/sources/DataSourceOpenStack.py#L260-L273
sybrenstuvel/flickrapi
4de81d85dcdd73e4e1d19b112a0ff93feb0d10f7
flickrapi/xmlnode.py
python
XMLNode.__init__
(self)
Construct an empty XML node.
Construct an empty XML node.
[ "Construct", "an", "empty", "XML", "node", "." ]
def __init__(self): """Construct an empty XML node.""" self.name = "" self.text = "" self.attrib = {} self.xml = None
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "name", "=", "\"\"", "self", ".", "text", "=", "\"\"", "self", ".", "attrib", "=", "{", "}", "self", ".", "xml", "=", "None" ]
https://github.com/sybrenstuvel/flickrapi/blob/4de81d85dcdd73e4e1d19b112a0ff93feb0d10f7/flickrapi/xmlnode.py#L16-L21
NVIDIA/DeepLearningExamples
589604d49e016cd9ef4525f7abcc9c7b826cfc5e
TensorFlow2/Classification/ConvNets/efficientnet/utils/augment.py
python
level_to_arg
(cutout_const: float, translate_const: float)
return args
Creates a dict mapping image operation names to their arguments.
Creates a dict mapping image operation names to their arguments.
[ "Creates", "a", "dict", "mapping", "image", "operation", "names", "to", "their", "arguments", "." ]
def level_to_arg(cutout_const: float, translate_const: float): """Creates a dict mapping image operation names to their arguments.""" no_arg = lambda level: () posterize_arg = lambda level: _mult_to_arg(level, 4) solarize_arg = lambda level: _mult_to_arg(level, 256) solarize_add_arg = lambda level: _mult_to_...
[ "def", "level_to_arg", "(", "cutout_const", ":", "float", ",", "translate_const", ":", "float", ")", ":", "no_arg", "=", "lambda", "level", ":", "(", ")", "posterize_arg", "=", "lambda", "level", ":", "_mult_to_arg", "(", "level", ",", "4", ")", "solarize_...
https://github.com/NVIDIA/DeepLearningExamples/blob/589604d49e016cd9ef4525f7abcc9c7b826cfc5e/TensorFlow2/Classification/ConvNets/efficientnet/utils/augment.py#L680-L708
hubblestack/hubble
763142474edcecdec5fd25591dc29c3536e8f969
hubblestack/comparators/number.py
python
_match
(result_to_compare, expected_result)
compare a number
compare a number
[ "compare", "a", "number" ]
def _match(result_to_compare, expected_result): """ compare a number """ if isinstance(expected_result, int): return result_to_compare == expected_result result_to_compare = int(result_to_compare) # got string having some comparison operators expected_result_value = expected_result....
[ "def", "_match", "(", "result_to_compare", ",", "expected_result", ")", ":", "if", "isinstance", "(", "expected_result", ",", "int", ")", ":", "return", "result_to_compare", "==", "expected_result", "result_to_compare", "=", "int", "(", "result_to_compare", ")", "...
https://github.com/hubblestack/hubble/blob/763142474edcecdec5fd25591dc29c3536e8f969/hubblestack/comparators/number.py#L94-L118
AIworx-Labs/chocolate
0ba4f6f0130eab851d32d5534241c8cac3f6666e
chocolate/sample/grid.py
python
Grid._next
(self, token=None)
Sample the next point on the grid and add it to the database with loss set to :data:`None`. Returns: A tuple containing a unique token and a vector of length equal to the number of parameters. Raises: StopIteration: When the grid is exhausted.
Sample the next point on the grid and add it to the database with loss set to :data:`None`.
[ "Sample", "the", "next", "point", "on", "the", "grid", "and", "add", "it", "to", "the", "database", "with", "loss", "set", "to", ":", "data", ":", "None", "." ]
def _next(self, token=None): """Sample the next point on the grid and add it to the database with loss set to :data:`None`. Returns: A tuple containing a unique token and a vector of length equal to the number of parameters. Raises: StopIteration: Wh...
[ "def", "_next", "(", "self", ",", "token", "=", "None", ")", ":", "i", "=", "self", ".", "conn", ".", "count_results", "(", ")", "if", "i", "<", "len", "(", "self", ".", "grid", ")", ":", "token", "=", "token", "or", "{", "}", "token", ".", "...
https://github.com/AIworx-Labs/chocolate/blob/0ba4f6f0130eab851d32d5534241c8cac3f6666e/chocolate/sample/grid.py#L69-L96
paramiko/paramiko
88f35a537428e430f7f26eee8026715e357b55d6
paramiko/ssh_gss.py
python
_SSH_GSSAPI_NEW.ssh_get_mic
(self, session_id, gss_kex=False)
return mic_token
Create the MIC token for a SSH2 message. :param str session_id: The SSH session ID :param bool gss_kex: Generate the MIC for GSS-API Key Exchange or not :return: gssapi-with-mic: Returns the MIC token from GSS-API for the message we created with ``_ssh_build_mi...
Create the MIC token for a SSH2 message.
[ "Create", "the", "MIC", "token", "for", "a", "SSH2", "message", "." ]
def ssh_get_mic(self, session_id, gss_kex=False): """ Create the MIC token for a SSH2 message. :param str session_id: The SSH session ID :param bool gss_kex: Generate the MIC for GSS-API Key Exchange or not :return: gssapi-with-mic: Returns the MIC token from GS...
[ "def", "ssh_get_mic", "(", "self", ",", "session_id", ",", "gss_kex", "=", "False", ")", ":", "self", ".", "_session_id", "=", "session_id", "if", "not", "gss_kex", ":", "mic_field", "=", "self", ".", "_ssh_build_mic", "(", "self", ".", "_session_id", ",",...
https://github.com/paramiko/paramiko/blob/88f35a537428e430f7f26eee8026715e357b55d6/paramiko/ssh_gss.py#L500-L526
iocage/iocage
e94863d4c54f02523fb09e62e48be7db9ac92eda
iocage_lib/ioc_start.py
python
IOCStart.check_aliases
(self, ip_addrs, mode='4')
return ','.join(new_ips)
Check if the alias already exists for given IP's, otherwise add default interface to the ips and return the new list
Check if the alias already exists for given IP's, otherwise add default interface to the ips and return the new list
[ "Check", "if", "the", "alias", "already", "exists", "for", "given", "IP", "s", "otherwise", "add", "default", "interface", "to", "the", "ips", "and", "return", "the", "new", "list" ]
def check_aliases(self, ip_addrs, mode='4'): """ Check if the alias already exists for given IP's, otherwise add default interface to the ips and return the new list """ inet_mode = netifaces.AF_INET if mode == '4' else netifaces.AF_INET6 gws = netifaces.gateways() ...
[ "def", "check_aliases", "(", "self", ",", "ip_addrs", ",", "mode", "=", "'4'", ")", ":", "inet_mode", "=", "netifaces", ".", "AF_INET", "if", "mode", "==", "'4'", "else", "netifaces", ".", "AF_INET6", "gws", "=", "netifaces", ".", "gateways", "(", ")", ...
https://github.com/iocage/iocage/blob/e94863d4c54f02523fb09e62e48be7db9ac92eda/iocage_lib/ioc_start.py#L1000-L1036
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/compressor/offline/jinja2.py
python
flatten_context
(context)
return context
[]
def flatten_context(context): if hasattr(context, 'dicts'): context_dict = {} for d in context.dicts: context_dict.update(d) return context_dict return context
[ "def", "flatten_context", "(", "context", ")", ":", "if", "hasattr", "(", "context", ",", "'dicts'", ")", ":", "context_dict", "=", "{", "}", "for", "d", "in", "context", ".", "dicts", ":", "context_dict", ".", "update", "(", "d", ")", "return", "conte...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/compressor/offline/jinja2.py#L13-L22
Nuitka/Nuitka
39262276993757fa4e299f497654065600453fc9
nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/Main.py
python
_load_site_scons_dir
(topdir, site_dir_name=None)
Load the site_scons dir under topdir. Prepends site_scons to sys.path, imports site_scons/site_init.py, and prepends site_scons/site_tools to default toolpath.
Load the site_scons dir under topdir. Prepends site_scons to sys.path, imports site_scons/site_init.py, and prepends site_scons/site_tools to default toolpath.
[ "Load", "the", "site_scons", "dir", "under", "topdir", ".", "Prepends", "site_scons", "to", "sys", ".", "path", "imports", "site_scons", "/", "site_init", ".", "py", "and", "prepends", "site_scons", "/", "site_tools", "to", "default", "toolpath", "." ]
def _load_site_scons_dir(topdir, site_dir_name=None): """Load the site_scons dir under topdir. Prepends site_scons to sys.path, imports site_scons/site_init.py, and prepends site_scons/site_tools to default toolpath.""" if site_dir_name: err_if_not_found = True # user specified: err if mis...
[ "def", "_load_site_scons_dir", "(", "topdir", ",", "site_dir_name", "=", "None", ")", ":", "if", "site_dir_name", ":", "err_if_not_found", "=", "True", "# user specified: err if missing", "else", ":", "site_dir_name", "=", "\"site_scons\"", "err_if_not_found", "=", "F...
https://github.com/Nuitka/Nuitka/blob/39262276993757fa4e299f497654065600453fc9/nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Script/Main.py#L700-L773
zake7749/Chatbot
209d8b9fc68958e21bf9cae262727c2629527efd
Chatbot/chatbot.py
python
Chatbot.getDomainResponse
(self, domain=None)
return response
Generate a response to user's speech. Please note that this response is *pre-defined in the json file*, is not the result return by sub_module.
Generate a response to user's speech. Please note that this response is *pre-defined in the json file*, is not the result return by sub_module.
[ "Generate", "a", "response", "to", "user", "s", "speech", ".", "Please", "note", "that", "this", "response", "is", "*", "pre", "-", "defined", "in", "the", "json", "file", "*", "is", "not", "the", "result", "return", "by", "sub_module", "." ]
def getDomainResponse(self, domain=None): """ Generate a response to user's speech. Please note that this response is *pre-defined in the json file*, is not the result return by sub_module. """ if domain is None: domain = self.speech_domain response ...
[ "def", "getDomainResponse", "(", "self", ",", "domain", "=", "None", ")", ":", "if", "domain", "is", "None", ":", "domain", "=", "self", ".", "speech_domain", "response", "=", "self", ".", "console", ".", "get_response", "(", "domain", ")", "return", "re...
https://github.com/zake7749/Chatbot/blob/209d8b9fc68958e21bf9cae262727c2629527efd/Chatbot/chatbot.py#L210-L221
ospalh/anki-addons
4ece13423bd541e29d9b40ebe26ca0999a6962b1
quick_replay.py
python
play_with_mplayer
(files)
Play files with mplayer. This is the piece-de-resistance of the add-on. We take the file names in files an throw them at mplayer, without using the audio queue. We don't do the file name fixing, either.. The point of this is to play it quickly. There have been a few additions so presumably it works...
Play files with mplayer.
[ "Play", "files", "with", "mplayer", "." ]
def play_with_mplayer(files): """ Play files with mplayer. This is the piece-de-resistance of the add-on. We take the file names in files an throw them at mplayer, without using the audio queue. We don't do the file name fixing, either.. The point of this is to play it quickly. There have been ...
[ "def", "play_with_mplayer", "(", "files", ")", ":", "tmp_play_list", "=", "copy", ".", "copy", "(", "command_list", ")", "+", "files", "if", "isWin", ":", "subprocess", ".", "Popen", "(", "tmp_play_list", ",", "shell", "=", "False", ",", "stdin", "=", "s...
https://github.com/ospalh/anki-addons/blob/4ece13423bd541e29d9b40ebe26ca0999a6962b1/quick_replay.py#L51-L74
learningequality/ka-lite
571918ea668013dcf022286ea85eff1c5333fb8b
kalite/packages/bundled/django/template/defaultfilters.py
python
striptags
(value)
return strip_tags(value)
Strips all [X]HTML tags.
Strips all [X]HTML tags.
[ "Strips", "all", "[", "X", "]", "HTML", "tags", "." ]
def striptags(value): """Strips all [X]HTML tags.""" return strip_tags(value)
[ "def", "striptags", "(", "value", ")", ":", "return", "strip_tags", "(", "value", ")" ]
https://github.com/learningequality/ka-lite/blob/571918ea668013dcf022286ea85eff1c5333fb8b/kalite/packages/bundled/django/template/defaultfilters.py#L476-L478
IronLanguages/ironpython2
51fdedeeda15727717fb8268a805f71b06c0b9f1
Src/StdLib/repackage/setuptools/setuptools/dist.py
python
Distribution._try_str
(val)
return val
On Python 2, much of distutils relies on string values being of type 'str' (bytes) and not unicode text. If the value can be safely encoded to bytes using the default encoding, prefer that. Why the default encoding? Because that value can be implicitly decoded back to text if needed. ...
On Python 2, much of distutils relies on string values being of type 'str' (bytes) and not unicode text. If the value can be safely encoded to bytes using the default encoding, prefer that.
[ "On", "Python", "2", "much", "of", "distutils", "relies", "on", "string", "values", "being", "of", "type", "str", "(", "bytes", ")", "and", "not", "unicode", "text", ".", "If", "the", "value", "can", "be", "safely", "encoded", "to", "bytes", "using", "...
def _try_str(val): """ On Python 2, much of distutils relies on string values being of type 'str' (bytes) and not unicode text. If the value can be safely encoded to bytes using the default encoding, prefer that. Why the default encoding? Because that value can be implicitly ...
[ "def", "_try_str", "(", "val", ")", ":", "if", "six", ".", "PY3", ":", "return", "val", "try", ":", "return", "val", ".", "encode", "(", ")", "except", "UnicodeEncodeError", ":", "pass", "return", "val" ]
https://github.com/IronLanguages/ironpython2/blob/51fdedeeda15727717fb8268a805f71b06c0b9f1/Src/StdLib/repackage/setuptools/setuptools/dist.py#L626-L643
pwnieexpress/pwn_plug_sources
1a23324f5dc2c3de20f9c810269b6a29b2758cad
src/voiper/sulley/impacket/structure.py
python
Structure.__len__
(self)
return len(self.getData())
[]
def __len__(self): # XXX: improve return len(self.getData())
[ "def", "__len__", "(", "self", ")", ":", "# XXX: improve", "return", "len", "(", "self", ".", "getData", "(", ")", ")" ]
https://github.com/pwnieexpress/pwn_plug_sources/blob/1a23324f5dc2c3de20f9c810269b6a29b2758cad/src/voiper/sulley/impacket/structure.py#L165-L167
golismero/golismero
7d605b937e241f51c1ca4f47b20f755eeefb9d76
thirdparty_libs/dns/tokenizer.py
python
Tokenizer.get_uint32
(self)
return value
Read the next token and interpret it as a 32-bit unsigned integer. @raises dns.exception.SyntaxError: @rtype: int
Read the next token and interpret it as a 32-bit unsigned integer.
[ "Read", "the", "next", "token", "and", "interpret", "it", "as", "a", "32", "-", "bit", "unsigned", "integer", "." ]
def get_uint32(self): """Read the next token and interpret it as a 32-bit unsigned integer. @raises dns.exception.SyntaxError: @rtype: int """ token = self.get().unescape() if not token.is_identifier(): raise dns.exception.SyntaxError('expecting an i...
[ "def", "get_uint32", "(", "self", ")", ":", "token", "=", "self", ".", "get", "(", ")", ".", "unescape", "(", ")", "if", "not", "token", ".", "is_identifier", "(", ")", ":", "raise", "dns", ".", "exception", ".", "SyntaxError", "(", "'expecting an iden...
https://github.com/golismero/golismero/blob/7d605b937e241f51c1ca4f47b20f755eeefb9d76/thirdparty_libs/dns/tokenizer.py#L477-L493
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/utils/dummy_pt_objects.py
python
VisionEncoderDecoderModel.__init__
(self, *args, **kwargs)
[]
def __init__(self, *args, **kwargs): requires_backends(self, ["torch"])
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "requires_backends", "(", "self", ",", "[", "\"torch\"", "]", ")" ]
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/utils/dummy_pt_objects.py#L4992-L4993
facelessuser/BracketHighlighter
223ffd4ceafd58686503e3328934c039e959a88c
bh_wrapping.py
python
WrapBrackets.wrap_style
(self, value)
Choose insert style for wrapping.
Choose insert style for wrapping.
[ "Choose", "insert", "style", "for", "wrapping", "." ]
def wrap_style(self, value): """Choose insert style for wrapping.""" if value < 0: return style = [] self.brackets = self._brackets[value] for s in VALID_INSERT_STYLES: if s[0] in self._insert[value]: self._style.append(s[0]) ...
[ "def", "wrap_style", "(", "self", ",", "value", ")", ":", "if", "value", "<", "0", ":", "return", "style", "=", "[", "]", "self", ".", "brackets", "=", "self", ".", "_brackets", "[", "value", "]", "for", "s", "in", "VALID_INSERT_STYLES", ":", "if", ...
https://github.com/facelessuser/BracketHighlighter/blob/223ffd4ceafd58686503e3328934c039e959a88c/bh_wrapping.py#L268-L292
openhatch/oh-mainline
ce29352a034e1223141dcc2f317030bbc3359a51
vendor/packages/twisted/twisted/spread/flavors.py
python
Viewable.jellyFor
(self, jellier)
return ViewPoint(jellier.invoker.serializingPerspective, self).jellyFor(jellier)
Serialize a L{ViewPoint} for me and the perspective of the given broker.
Serialize a L{ViewPoint} for me and the perspective of the given broker.
[ "Serialize", "a", "L", "{", "ViewPoint", "}", "for", "me", "and", "the", "perspective", "of", "the", "given", "broker", "." ]
def jellyFor(self, jellier): """Serialize a L{ViewPoint} for me and the perspective of the given broker. """ return ViewPoint(jellier.invoker.serializingPerspective, self).jellyFor(jellier)
[ "def", "jellyFor", "(", "self", ",", "jellier", ")", ":", "return", "ViewPoint", "(", "jellier", ".", "invoker", ".", "serializingPerspective", ",", "self", ")", ".", "jellyFor", "(", "jellier", ")" ]
https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/twisted/twisted/spread/flavors.py#L230-L233
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/min/encodings/cp1254.py
python
IncrementalEncoder.encode
(self, input, final=False)
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
[]
def encode(self, input, final=False): return codecs.charmap_encode(input,self.errors,encoding_table)[0]
[ "def", "encode", "(", "self", ",", "input", ",", "final", "=", "False", ")", ":", "return", "codecs", ".", "charmap_encode", "(", "input", ",", "self", ".", "errors", ",", "encoding_table", ")", "[", "0", "]" ]
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/min/encodings/cp1254.py#L18-L19
androguard/androguard
8d091cbb309c0c50bf239f805cc1e0931b8dcddc
androguard/core/analysis/auto.py
python
DefaultAndroAnalysis.create_arsc
(self, log, fileraw)
return axml.ARSCParser(fileraw)
This method is called in order to create a new ARSC object :param log: an object which corresponds to a unique app :param fileraw: the raw arsc (a string) :rtype: an :class:`~androguard.core.bytecodes.axml.ARSCParser` object
This method is called in order to create a new ARSC object
[ "This", "method", "is", "called", "in", "order", "to", "create", "a", "new", "ARSC", "object" ]
def create_arsc(self, log, fileraw): """ This method is called in order to create a new ARSC object :param log: an object which corresponds to a unique app :param fileraw: the raw arsc (a string) :rtype: an :class:`~androguard.core.bytecodes.axml.ARSCParser` object """ ...
[ "def", "create_arsc", "(", "self", ",", "log", ",", "fileraw", ")", ":", "return", "axml", ".", "ARSCParser", "(", "fileraw", ")" ]
https://github.com/androguard/androguard/blob/8d091cbb309c0c50bf239f805cc1e0931b8dcddc/androguard/core/analysis/auto.py#L248-L257
hanc00l/some_pocsuite
259b07a326dd7b585058ef10f4f089824cd4daab
PocsuiteV2/weblogic-ssrf_all_ssrf.py
python
TestPOC._attack
(self)
return self._verify()
[]
def _attack(self): return self._verify()
[ "def", "_attack", "(", "self", ")", ":", "return", "self", ".", "_verify", "(", ")" ]
https://github.com/hanc00l/some_pocsuite/blob/259b07a326dd7b585058ef10f4f089824cd4daab/PocsuiteV2/weblogic-ssrf_all_ssrf.py#L92-L93
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/library/oc_pvc.py
python
OpenShiftCLI._evacuate
(self, node=None, selector=None, pod_selector=None, dry_run=False, grace_period=None, force=False)
return self.openshift_cmd(cmd, oadm=True, output=True, output_type='raw')
perform oadm manage-node evacuate
perform oadm manage-node evacuate
[ "perform", "oadm", "manage", "-", "node", "evacuate" ]
def _evacuate(self, node=None, selector=None, pod_selector=None, dry_run=False, grace_period=None, force=False): ''' perform oadm manage-node evacuate ''' cmd = ['manage-node'] if node: cmd.extend(node) else: cmd.append('--selector={}'.format(selector)) i...
[ "def", "_evacuate", "(", "self", ",", "node", "=", "None", ",", "selector", "=", "None", ",", "pod_selector", "=", "None", ",", "dry_run", "=", "False", ",", "grace_period", "=", "None", ",", "force", "=", "False", ")", ":", "cmd", "=", "[", "'manage...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/library/oc_pvc.py#L1067-L1089
stephenhky/PyShortTextCategorization
4fa46a148a3eeb923885a7d70c789e988554f758
shorttext/utils/dtm.py
python
load_DocumentTermMatrix
(filename, compact=True)
return dtm
Load presaved Document-Term Matrix (DTM). Given the file name (if `compact` is `True`) or the prefix (if `compact` is `False`), return the document-term matrix. :param filename: file name or prefix :param compact: whether it is a compact model. (Default: `True`) :return: document-term matrix :...
Load presaved Document-Term Matrix (DTM).
[ "Load", "presaved", "Document", "-", "Term", "Matrix", "(", "DTM", ")", "." ]
def load_DocumentTermMatrix(filename, compact=True): """ Load presaved Document-Term Matrix (DTM). Given the file name (if `compact` is `True`) or the prefix (if `compact` is `False`), return the document-term matrix. :param filename: file name or prefix :param compact: whether it is a compact mod...
[ "def", "load_DocumentTermMatrix", "(", "filename", ",", "compact", "=", "True", ")", ":", "dtm", "=", "DocumentTermMatrix", "(", "[", "[", "]", "]", ")", "if", "compact", ":", "dtm", ".", "load_compact_model", "(", "filename", ")", "else", ":", "dtm", "....
https://github.com/stephenhky/PyShortTextCategorization/blob/4fa46a148a3eeb923885a7d70c789e988554f758/shorttext/utils/dtm.py#L186-L204
mandarjoshi90/coref
bd04f2e19b9dcc0b8bba848a335e4af3be50741c
bert/run_pretraining.py
python
_decode_record
(record, name_to_features)
return example
Decodes a record to a TensorFlow example.
Decodes a record to a TensorFlow example.
[ "Decodes", "a", "record", "to", "a", "TensorFlow", "example", "." ]
def _decode_record(record, name_to_features): """Decodes a record to a TensorFlow example.""" example = tf.parse_single_example(record, name_to_features) # tf.Example only supports tf.int64, but the TPU only supports tf.int32. # So cast all int64 to int32. for name in list(example.keys()): t = example[na...
[ "def", "_decode_record", "(", "record", ",", "name_to_features", ")", ":", "example", "=", "tf", ".", "parse_single_example", "(", "record", ",", "name_to_features", ")", "# tf.Example only supports tf.int64, but the TPU only supports tf.int32.", "# So cast all int64 to int32."...
https://github.com/mandarjoshi90/coref/blob/bd04f2e19b9dcc0b8bba848a335e4af3be50741c/bert/run_pretraining.py#L390-L402
DeepLabCut/DeepLabCut
1dd14c54729ae0d8e66ca495aa5baeb83502e1c7
deeplabcut/pose_estimation_tensorflow/nnets/utils.py
python
drop_connect
(inputs, is_training, drop_connect_rate)
return output
Apply drop connect.
Apply drop connect.
[ "Apply", "drop", "connect", "." ]
def drop_connect(inputs, is_training, drop_connect_rate): """Apply drop connect.""" if not is_training: return inputs # Compute keep_prob # TODO(tanmingxing): add support for training progress. keep_prob = 1.0 - drop_connect_rate # Compute drop_connect tensor batch_size = tf.shape(...
[ "def", "drop_connect", "(", "inputs", ",", "is_training", ",", "drop_connect_rate", ")", ":", "if", "not", "is_training", ":", "return", "inputs", "# Compute keep_prob", "# TODO(tanmingxing): add support for training progress.", "keep_prob", "=", "1.0", "-", "drop_connect...
https://github.com/DeepLabCut/DeepLabCut/blob/1dd14c54729ae0d8e66ca495aa5baeb83502e1c7/deeplabcut/pose_estimation_tensorflow/nnets/utils.py#L225-L240
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/soupsieve/css_match.py
python
SoupSieve.__init__
( self, pattern: str, selectors: ct.SelectorList, namespaces: Optional[ct.Namespaces], custom: Optional[ct.CustomSelectors], flags: int )
Initialize.
Initialize.
[ "Initialize", "." ]
def __init__( self, pattern: str, selectors: ct.SelectorList, namespaces: Optional[ct.Namespaces], custom: Optional[ct.CustomSelectors], flags: int ): """Initialize.""" super().__init__( pattern=pattern, selectors=selectors, ...
[ "def", "__init__", "(", "self", ",", "pattern", ":", "str", ",", "selectors", ":", "ct", ".", "SelectorList", ",", "namespaces", ":", "Optional", "[", "ct", ".", "Namespaces", "]", ",", "custom", ":", "Optional", "[", "ct", ".", "CustomSelectors", "]", ...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/soupsieve/css_match.py#L1509-L1525
as-ideas/headliner
2f98e1765c95d1f47f8376d1bd69d93d1869ad59
headliner/callbacks/evaluation_callback.py
python
EvaluationCallback.__init__
(self, summarizer: Summarizer, scorers: Dict[str, Callable[[Dict], float]], val_data: Iterable[Tuple[str, str]], print_num_examples=5)
Initializes the Callback. Args: summarizer: Summarizer that predicts over the validation data. scorers: Dictionary of {scorer_name: scorer}, where each scorer maps a prediction to a score. val_data: Raw validation data to predict on. print_num_examples: Number of...
Initializes the Callback.
[ "Initializes", "the", "Callback", "." ]
def __init__(self, summarizer: Summarizer, scorers: Dict[str, Callable[[Dict], float]], val_data: Iterable[Tuple[str, str]], print_num_examples=5) -> None: """ Initializes the Callback. Args: summarizer: Summarizer ...
[ "def", "__init__", "(", "self", ",", "summarizer", ":", "Summarizer", ",", "scorers", ":", "Dict", "[", "str", ",", "Callable", "[", "[", "Dict", "]", ",", "float", "]", "]", ",", "val_data", ":", "Iterable", "[", "Tuple", "[", "str", ",", "str", "...
https://github.com/as-ideas/headliner/blob/2f98e1765c95d1f47f8376d1bd69d93d1869ad59/headliner/callbacks/evaluation_callback.py#L14-L34
microsoft/ptvsd
99c8513921021d2cc7cd82e132b65c644c256768
src/ptvsd/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py
python
_ThreadContainer.find_threads_by_name
(self, name, bExactMatch = True)
return found_threads
Find threads by name, using different search methods. @type name: str, None @param name: Name to look for. Use C{None} to find nameless threads. @type bExactMatch: bool @param bExactMatch: C{True} if the name must be B{exactly} as given, C{False} if the name can be ...
Find threads by name, using different search methods.
[ "Find", "threads", "by", "name", "using", "different", "search", "methods", "." ]
def find_threads_by_name(self, name, bExactMatch = True): """ Find threads by name, using different search methods. @type name: str, None @param name: Name to look for. Use C{None} to find nameless threads. @type bExactMatch: bool @param bExactMatch: C{True} if the na...
[ "def", "find_threads_by_name", "(", "self", ",", "name", ",", "bExactMatch", "=", "True", ")", ":", "found_threads", "=", "list", "(", ")", "# Find threads with no name.", "if", "name", "is", "None", ":", "for", "aThread", "in", "self", ".", "iter_threads", ...
https://github.com/microsoft/ptvsd/blob/99c8513921021d2cc7cd82e132b65c644c256768/src/ptvsd/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py#L1835-L1873
smokeleeteveryday/CTF_WRITEUPS
4683f0d41c92c4ed407cc3dd3b1760c68a05943f
2016/DEFCONCTF/reversing/step/solution/crack_step.py
python
selfmod_decoder
(rip_address)
return
[]
def selfmod_decoder(rip_address): if ((rip_address > 0x400935) and (rip_address <= 0x40103D)): idaapi.patch_byte(rip_address, idaapi.get_byte(rip_address) ^ (rip_address & 0xFF)) return
[ "def", "selfmod_decoder", "(", "rip_address", ")", ":", "if", "(", "(", "rip_address", ">", "0x400935", ")", "and", "(", "rip_address", "<=", "0x40103D", ")", ")", ":", "idaapi", ".", "patch_byte", "(", "rip_address", ",", "idaapi", ".", "get_byte", "(", ...
https://github.com/smokeleeteveryday/CTF_WRITEUPS/blob/4683f0d41c92c4ed407cc3dd3b1760c68a05943f/2016/DEFCONCTF/reversing/step/solution/crack_step.py#L20-L23
HymanLiuTS/flaskTs
286648286976e85d9b9a5873632331efcafe0b21
flasky/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py
python
LegacyMetadata.write
(self, filepath, skip_unknown=False)
Write the metadata fields to filepath.
Write the metadata fields to filepath.
[ "Write", "the", "metadata", "fields", "to", "filepath", "." ]
def write(self, filepath, skip_unknown=False): """Write the metadata fields to filepath.""" fp = codecs.open(filepath, 'w', encoding='utf-8') try: self.write_file(fp, skip_unknown) finally: fp.close()
[ "def", "write", "(", "self", ",", "filepath", ",", "skip_unknown", "=", "False", ")", ":", "fp", "=", "codecs", ".", "open", "(", "filepath", ",", "'w'", ",", "encoding", "=", "'utf-8'", ")", "try", ":", "self", ".", "write_file", "(", "fp", ",", "...
https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py#L360-L366
crytic/slither
168492ad899e074724b97f99cfa4d4f25934a8e5
slither/core/cfg/node.py
python
Node.node_id
(self)
return self._node_id
Unique node id.
Unique node id.
[ "Unique", "node", "id", "." ]
def node_id(self) -> int: """Unique node id.""" return self._node_id
[ "def", "node_id", "(", "self", ")", "->", "int", ":", "return", "self", ".", "_node_id" ]
https://github.com/crytic/slither/blob/168492ad899e074724b97f99cfa4d4f25934a8e5/slither/core/cfg/node.py#L245-L247
google/grr
8ad8a4d2c5a93c92729206b7771af19d92d4f915
grr/server/grr_response_server/flows/general/transfer.py
python
MultiGetFileLogic.End
(self, responses)
[]
def End(self, responses): # There are some files still in flight. if self.state.pending_hashes or self.state.pending_files: self._CheckHashesWithFileStore() self._FetchFileContent() if not self.outstanding_requests: super().End(responses)
[ "def", "End", "(", "self", ",", "responses", ")", ":", "# There are some files still in flight.", "if", "self", ".", "state", ".", "pending_hashes", "or", "self", ".", "state", ".", "pending_files", ":", "self", ".", "_CheckHashesWithFileStore", "(", ")", "self"...
https://github.com/google/grr/blob/8ad8a4d2c5a93c92729206b7771af19d92d4f915/grr/server/grr_response_server/flows/general/transfer.py#L792-L799
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/celery/platforms.py
python
_setgroups_hack
(groups)
[]
def _setgroups_hack(groups): # :fun:`setgroups` may have a platform-dependent limit, # and it's not always possible to know in advance what this limit # is, so we use this ugly hack stolen from glibc. groups = groups[:] while 1: try: return os.setgroups(groups) except Va...
[ "def", "_setgroups_hack", "(", "groups", ")", ":", "# :fun:`setgroups` may have a platform-dependent limit,", "# and it's not always possible to know in advance what this limit", "# is, so we use this ugly hack stolen from glibc.", "groups", "=", "groups", "[", ":", "]", "while", "1"...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/celery/platforms.py#L455-L471
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
ansible/roles/lib_oa_openshift/src/class/oc_adm_csr.py
python
OCcsr.get_csr_request
(self, request)
return self._run(['openssl', 'req', '-noout', '-text'], base64.b64decode(request))[1]
base64 decode the request object and call openssl to determine the subject and specifically the CN: from the request Output: (0, '... Subject: O=system:nodes, CN=system:node:ip-172-31-54-54.ec2.internal ...')
base64 decode the request object and call openssl to determine the subject and specifically the CN: from the request
[ "base64", "decode", "the", "request", "object", "and", "call", "openssl", "to", "determine", "the", "subject", "and", "specifically", "the", "CN", ":", "from", "the", "request" ]
def get_csr_request(self, request): '''base64 decode the request object and call openssl to determine the subject and specifically the CN: from the request Output: (0, '... Subject: O=system:nodes, CN=system:node:ip-172-31-54-54.ec2.internal ...'...
[ "def", "get_csr_request", "(", "self", ",", "request", ")", ":", "import", "base64", "return", "self", ".", "_run", "(", "[", "'openssl'", ",", "'req'", ",", "'-noout'", ",", "'-text'", "]", ",", "base64", ".", "b64decode", "(", "request", ")", ")", "[...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/ansible/roles/lib_oa_openshift/src/class/oc_adm_csr.py#L73-L83
graycatlabs/PyBBIO
0d46115059ed7ec0c17afb6dd7ed2f507b4f2b8a
bbio/libraries/BBIOServer/bbio_server.py
python
Page.add_heading
(self, text)
Add a heading to the current position in the page.
Add a heading to the current position in the page.
[ "Add", "a", "heading", "to", "the", "current", "position", "in", "the", "page", "." ]
def add_heading(self, text): """ Add a heading to the current position in the page. """ self.html += '<div class="heading">%s</div>\n' % (text)
[ "def", "add_heading", "(", "self", ",", "text", ")", ":", "self", ".", "html", "+=", "'<div class=\"heading\">%s</div>\\n'", "%", "(", "text", ")" ]
https://github.com/graycatlabs/PyBBIO/blob/0d46115059ed7ec0c17afb6dd7ed2f507b4f2b8a/bbio/libraries/BBIOServer/bbio_server.py#L206-L208
ninja-ide/ninja-ide
87d91131bd19fdc3dcfd91eb97ad1e41c49c60c0
ninja_ide/core/template_registry/bundled_project_types.py
python
PythonProject.create_layout
(self)
Create set of folders and files required for a basic python project
Create set of folders and files required for a basic python project
[ "Create", "set", "of", "folders", "and", "files", "required", "for", "a", "basic", "python", "project" ]
def create_layout(self): """ Create set of folders and files required for a basic python project """ full_path = os.path.expanduser(self.path) split_path = full_path.split(os.path.sep) full_path = "" for each_folder in split_path: if each_folder: ...
[ "def", "create_layout", "(", "self", ")", ":", "full_path", "=", "os", ".", "path", ".", "expanduser", "(", "self", ".", "path", ")", "split_path", "=", "full_path", ".", "split", "(", "os", ".", "path", ".", "sep", ")", "full_path", "=", "\"\"", "fo...
https://github.com/ninja-ide/ninja-ide/blob/87d91131bd19fdc3dcfd91eb97ad1e41c49c60c0/ninja_ide/core/template_registry/bundled_project_types.py#L63-L91
leapcode/bitmask_client
d2fe20df24fc6eaf146fa5ce1e847de6ab515688
src/leap/bitmask/_version.py
python
git_get_keywords
(versionfile_abs)
return keywords
Extract version information from the given file.
Extract version information from the given file.
[ "Extract", "version", "information", "from", "the", "given", "file", "." ]
def git_get_keywords(versionfile_abs): """Extract version information from the given file.""" # the code embedded in _version.py can just fetch the value of these # keywords. When used from setup.py, we don't want to import _version.py, # so we do it with a regexp instead. This function is not used from...
[ "def", "git_get_keywords", "(", "versionfile_abs", ")", ":", "# the code embedded in _version.py can just fetch the value of these", "# keywords. When used from setup.py, we don't want to import _version.py,", "# so we do it with a regexp instead. This function is not used from", "# _version.py.",...
https://github.com/leapcode/bitmask_client/blob/d2fe20df24fc6eaf146fa5ce1e847de6ab515688/src/leap/bitmask/_version.py#L120-L141
ipython/ipython
c0abea7a6dfe52c1f74c9d0387d4accadba7cc14
IPython/core/magic.py
python
compress_dhist
(dh)
return newhead + tail
Compress a directory history into a new one with at most 20 entries. Return a new list made from the first and last 10 elements of dhist after removal of duplicates.
Compress a directory history into a new one with at most 20 entries.
[ "Compress", "a", "directory", "history", "into", "a", "new", "one", "with", "at", "most", "20", "entries", "." ]
def compress_dhist(dh): """Compress a directory history into a new one with at most 20 entries. Return a new list made from the first and last 10 elements of dhist after removal of duplicates. """ head, tail = dh[:-10], dh[-10:] newhead = [] done = set() for h in head: if h in ...
[ "def", "compress_dhist", "(", "dh", ")", ":", "head", ",", "tail", "=", "dh", "[", ":", "-", "10", "]", ",", "dh", "[", "-", "10", ":", "]", "newhead", "=", "[", "]", "done", "=", "set", "(", ")", "for", "h", "in", "head", ":", "if", "h", ...
https://github.com/ipython/ipython/blob/c0abea7a6dfe52c1f74c9d0387d4accadba7cc14/IPython/core/magic.py#L57-L73
openstack/cinder
23494a6d6c51451688191e1847a458f1d3cdcaa5
cinder/volume/drivers/macrosan/devop_client.py
python
Client.snapshot_resource_exists
(self, lun_name)
return self.send_request(method='get', url='/snapshot_resource', data=data)
Whether the snapshot resource exists.
Whether the snapshot resource exists.
[ "Whether", "the", "snapshot", "resource", "exists", "." ]
def snapshot_resource_exists(self, lun_name): """Whether the snapshot resource exists.""" data = { 'lun_name': lun_name } return self.send_request(method='get', url='/snapshot_resource', data=data)
[ "def", "snapshot_resource_exists", "(", "self", ",", "lun_name", ")", ":", "data", "=", "{", "'lun_name'", ":", "lun_name", "}", "return", "self", ".", "send_request", "(", "method", "=", "'get'", ",", "url", "=", "'/snapshot_resource'", ",", "data", "=", ...
https://github.com/openstack/cinder/blob/23494a6d6c51451688191e1847a458f1d3cdcaa5/cinder/volume/drivers/macrosan/devop_client.py#L142-L148
ahmetcemturan/SFACT
7576e29ba72b33e5058049b77b7b558875542747
skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py
python
DimensionSkein.addLinearMoveExtrusionDistanceLine
(self, extrusionDistance)
Get the extrusion distance string from the extrusion distance.
Get the extrusion distance string from the extrusion distance.
[ "Get", "the", "extrusion", "distance", "string", "from", "the", "extrusion", "distance", "." ]
def addLinearMoveExtrusionDistanceLine(self, extrusionDistance): 'Get the extrusion distance string from the extrusion distance.' # The lines that are inserted before extrusion starts if self.repository.extruderRetractionSpeed.value != 0.0: retractionString = self.getExtrusionDistanceStringFromExtrusionDistance...
[ "def", "addLinearMoveExtrusionDistanceLine", "(", "self", ",", "extrusionDistance", ")", ":", "#\t\tThe lines that are inserted before extrusion starts", "if", "self", ".", "repository", ".", "extruderRetractionSpeed", ".", "value", "!=", "0.0", ":", "retractionString", "="...
https://github.com/ahmetcemturan/SFACT/blob/7576e29ba72b33e5058049b77b7b558875542747/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py#L207-L213
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
ansible/roles/lib_openshift_3.2/library/oc_version.py
python
Yedit.delete
(self, path)
return (True, self.yaml_dict)
remove path from a dict
remove path from a dict
[ "remove", "path", "from", "a", "dict" ]
def delete(self, path): ''' remove path from a dict''' try: entry = Yedit.get_entry(self.yaml_dict, path, self.separator) except KeyError as _: entry = None if entry == None: return (False, self.yaml_dict) result = Yedit.remove_entry(self.ya...
[ "def", "delete", "(", "self", ",", "path", ")", ":", "try", ":", "entry", "=", "Yedit", ".", "get_entry", "(", "self", ".", "yaml_dict", ",", "path", ",", "self", ".", "separator", ")", "except", "KeyError", "as", "_", ":", "entry", "=", "None", "i...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/ansible/roles/lib_openshift_3.2/library/oc_version.py#L759-L773
earthgecko/skyline
12754424de72593e29eb21009fb1ae3f07f3abff
skyline/panorama/panorama.py
python
Panorama.determine_db_id
(self, table, key, value)
return False
Get the id of something from the database and create a new entry if it does not exist :param table: table name :param key: key name :param value: value name :type table: str :type key: str :type value: str :return: int or boolean
Get the id of something from the database and create a new entry if it does not exist
[ "Get", "the", "id", "of", "something", "from", "the", "database", "and", "create", "a", "new", "entry", "if", "it", "does", "not", "exist" ]
def determine_db_id(self, table, key, value): """ Get the id of something from the database and create a new entry if it does not exist :param table: table name :param key: key name :param value: value name :type table: str :type key: str :type va...
[ "def", "determine_db_id", "(", "self", ",", "table", ",", "key", ",", "value", ")", ":", "determined_id", "=", "None", "query", "=", "'select id FROM %s WHERE %s=\\'%s\\''", "%", "(", "table", ",", "key", ",", "value", ")", "# nosec", "results", "=", "None",...
https://github.com/earthgecko/skyline/blob/12754424de72593e29eb21009fb1ae3f07f3abff/skyline/panorama/panorama.py#L905-L993
horazont/aioxmpp
c701e6399c90a6bb9bec0349018a03bd7b644cde
aioxmpp/avatar/service.py
python
AbstractAvatarDescriptor.nbytes
(self)
return self._nbytes
The size of the avatar image data in bytes.
The size of the avatar image data in bytes.
[ "The", "size", "of", "the", "avatar", "image", "data", "in", "bytes", "." ]
def nbytes(self): """ The size of the avatar image data in bytes. """ return self._nbytes
[ "def", "nbytes", "(", "self", ")", ":", "return", "self", ".", "_nbytes" ]
https://github.com/horazont/aioxmpp/blob/c701e6399c90a6bb9bec0349018a03bd7b644cde/aioxmpp/avatar/service.py#L331-L335
webpy/webpy
62245f7da4aab8f8607c192b98d5ef93873f995b
web/utils.py
python
_strips
(direction, text, remove)
return text
[]
def _strips(direction, text, remove): if isinstance(remove, iters): for subr in remove: text = _strips(direction, text, subr) return text if direction == "l": if text.startswith(remove): return text[len(remove) :] elif direction == "r": if text.endswi...
[ "def", "_strips", "(", "direction", ",", "text", ",", "remove", ")", ":", "if", "isinstance", "(", "remove", ",", "iters", ")", ":", "for", "subr", "in", "remove", ":", "text", "=", "_strips", "(", "direction", ",", "text", ",", "subr", ")", "return"...
https://github.com/webpy/webpy/blob/62245f7da4aab8f8607c192b98d5ef93873f995b/web/utils.py#L307-L321
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1beta1_overhead.py
python
V1beta1Overhead.pod_fixed
(self)
return self._pod_fixed
Gets the pod_fixed of this V1beta1Overhead. # noqa: E501 PodFixed represents the fixed resource overhead associated with running a pod. # noqa: E501 :return: The pod_fixed of this V1beta1Overhead. # noqa: E501 :rtype: dict(str, str)
Gets the pod_fixed of this V1beta1Overhead. # noqa: E501
[ "Gets", "the", "pod_fixed", "of", "this", "V1beta1Overhead", ".", "#", "noqa", ":", "E501" ]
def pod_fixed(self): """Gets the pod_fixed of this V1beta1Overhead. # noqa: E501 PodFixed represents the fixed resource overhead associated with running a pod. # noqa: E501 :return: The pod_fixed of this V1beta1Overhead. # noqa: E501 :rtype: dict(str, str) """ return...
[ "def", "pod_fixed", "(", "self", ")", ":", "return", "self", ".", "_pod_fixed" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1beta1_overhead.py#L56-L64
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py
python
instrument
(name)
return do
[]
def instrument(name): def do(self, *args, **kwargs): return getattr(self.registry(), name)(*args, **kwargs) return do
[ "def", "instrument", "(", "name", ")", ":", "def", "do", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "getattr", "(", "self", ".", "registry", "(", ")", ",", "name", ")", "(", "*", "args", ",", "*", "*", "kwargs",...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py#L151-L154
itailang/SampleNet
442459abc54f9e14f0966a169a094a98febd32eb
registration/models/pcrnet.py
python
PointNetFeatures.__init__
(self, bottleneck_size=1024, input_shape="bcn")
[]
def __init__(self, bottleneck_size=1024, input_shape="bcn"): super().__init__() if input_shape not in ["bcn", "bnc"]: raise ValueError( "allowed shape are 'bcn' (batch * channels * num_in_points), 'bnc' " ) self.input_shape = input_shape self.conv...
[ "def", "__init__", "(", "self", ",", "bottleneck_size", "=", "1024", ",", "input_shape", "=", "\"bcn\"", ")", ":", "super", "(", ")", ".", "__init__", "(", ")", "if", "input_shape", "not", "in", "[", "\"bcn\"", ",", "\"bnc\"", "]", ":", "raise", "Value...
https://github.com/itailang/SampleNet/blob/442459abc54f9e14f0966a169a094a98febd32eb/registration/models/pcrnet.py#L9-L21
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/lib-python/3/copyreg.py
python
remove_extension
(module, name, code)
Unregister an extension code. For testing only.
Unregister an extension code. For testing only.
[ "Unregister", "an", "extension", "code", ".", "For", "testing", "only", "." ]
def remove_extension(module, name, code): """Unregister an extension code. For testing only.""" key = (module, name) if (_extension_registry.get(key) != code or _inverted_registry.get(code) != key): raise ValueError("key %s is not registered with code %s" % (key, co...
[ "def", "remove_extension", "(", "module", ",", "name", ",", "code", ")", ":", "key", "=", "(", "module", ",", "name", ")", "if", "(", "_extension_registry", ".", "get", "(", "key", ")", "!=", "code", "or", "_inverted_registry", ".", "get", "(", "code",...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/copyreg.py#L170-L180
openstack/openstacksdk
58384268487fa854f21c470b101641ab382c9897
openstack/baremetal_introspection/v1/_proxy.py
python
Proxy.get_introspection
(self, introspection)
return self._get(_introspect.Introspection, introspection)
Get a specific introspection. :param introspection: The value can be the name or ID of an introspection (matching bare metal node name or ID) or an :class:`~.introspection.Introspection` instance. :returns: :class:`~.introspection.Introspection` instance. :raises: :class...
Get a specific introspection.
[ "Get", "a", "specific", "introspection", "." ]
def get_introspection(self, introspection): """Get a specific introspection. :param introspection: The value can be the name or ID of an introspection (matching bare metal node name or ID) or an :class:`~.introspection.Introspection` instance. :returns: :class:`~.introsp...
[ "def", "get_introspection", "(", "self", ",", "introspection", ")", ":", "return", "self", ".", "_get", "(", "_introspect", ".", "Introspection", ",", "introspection", ")" ]
https://github.com/openstack/openstacksdk/blob/58384268487fa854f21c470b101641ab382c9897/openstack/baremetal_introspection/v1/_proxy.py#L77-L87