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
ym2011/POC-EXP
206b22d3a6b2a172359678df33bbc5b2ad04b6c3
K8/Web-Exp/sqlmap/lib/techniques/error/use.py
python
_formatPartialContent
(value)
return value
Prepares (possibly hex-encoded) partial content for safe console output
Prepares (possibly hex-encoded) partial content for safe console output
[ "Prepares", "(", "possibly", "hex", "-", "encoded", ")", "partial", "content", "for", "safe", "console", "output" ]
def _formatPartialContent(value): """ Prepares (possibly hex-encoded) partial content for safe console output """ if value and isinstance(value, basestring): try: value = hexdecode(value) except: pass finally: value = safecharencode(value) ...
[ "def", "_formatPartialContent", "(", "value", ")", ":", "if", "value", "and", "isinstance", "(", "value", ",", "basestring", ")", ":", "try", ":", "value", "=", "hexdecode", "(", "value", ")", "except", ":", "pass", "finally", ":", "value", "=", "safecha...
https://github.com/ym2011/POC-EXP/blob/206b22d3a6b2a172359678df33bbc5b2ad04b6c3/K8/Web-Exp/sqlmap/lib/techniques/error/use.py#L250-L263
microsoft/unilm
65f15af2a307ebb64cfb25adf54375b002e6fe8d
infoxlm/fairseq/examples/roberta/multiprocessing_bpe_encoder.py
python
MultiprocessingEncoder.encode_lines
(self, lines)
return ["PASS", enc_lines]
Encode a set of lines. All lines will be encoded together.
Encode a set of lines. All lines will be encoded together.
[ "Encode", "a", "set", "of", "lines", ".", "All", "lines", "will", "be", "encoded", "together", "." ]
def encode_lines(self, lines): """ Encode a set of lines. All lines will be encoded together. """ enc_lines = [] for line in lines: line = line.strip() if len(line) == 0 and not self.args.keep_empty: return ["EMPTY", None] token...
[ "def", "encode_lines", "(", "self", ",", "lines", ")", ":", "enc_lines", "=", "[", "]", "for", "line", "in", "lines", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "len", "(", "line", ")", "==", "0", "and", "not", "self", ".", "args", ...
https://github.com/microsoft/unilm/blob/65f15af2a307ebb64cfb25adf54375b002e6fe8d/infoxlm/fairseq/examples/roberta/multiprocessing_bpe_encoder.py#L107-L118
khanhnamle1994/natural-language-processing
01d450d5ac002b0156ef4cf93a07cb508c1bcdc5
assignment1/.env/lib/python2.7/site-packages/scipy/stats/stats.py
python
signaltonoise
(a, axis=0, ddof=0)
return np.where(sd == 0, 0, m/sd)
The signal-to-noise ratio of the input data. Returns the signal-to-noise ratio of `a`, here defined as the mean divided by the standard deviation. Parameters ---------- a : array_like An array_like object containing the sample data. axis : int or None, optional If axis is equal...
The signal-to-noise ratio of the input data.
[ "The", "signal", "-", "to", "-", "noise", "ratio", "of", "the", "input", "data", "." ]
def signaltonoise(a, axis=0, ddof=0): """ The signal-to-noise ratio of the input data. Returns the signal-to-noise ratio of `a`, here defined as the mean divided by the standard deviation. Parameters ---------- a : array_like An array_like object containing the sample data. axi...
[ "def", "signaltonoise", "(", "a", ",", "axis", "=", "0", ",", "ddof", "=", "0", ")", ":", "a", "=", "np", ".", "asanyarray", "(", "a", ")", "m", "=", "a", ".", "mean", "(", "axis", ")", "sd", "=", "a", ".", "std", "(", "axis", "=", "axis", ...
https://github.com/khanhnamle1994/natural-language-processing/blob/01d450d5ac002b0156ef4cf93a07cb508c1bcdc5/assignment1/.env/lib/python2.7/site-packages/scipy/stats/stats.py#L1864-L1891
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/Python-2.7.9/Lib/idlelib/configDialog.py
python
ConfigDialog.VarChanged_winHeight
(self, *params)
[]
def VarChanged_winHeight(self, *params): value = self.winHeight.get() self.AddChangedItem('main', 'EditorWindow', 'height', value)
[ "def", "VarChanged_winHeight", "(", "self", ",", "*", "params", ")", ":", "value", "=", "self", ".", "winHeight", ".", "get", "(", ")", "self", ".", "AddChangedItem", "(", "'main'", ",", "'EditorWindow'", ",", "'height'", ",", "value", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/Python-2.7.9/Lib/idlelib/configDialog.py#L593-L595
mgear-dev/mgear
06ddc26c5adb5eab07ca470c7fafa77404c8a1de
scripts/mgear/maya/shifter/component/shoulder_ms_01/guide.py
python
Guide.addParameters
(self)
Add the configurations settings
Add the configurations settings
[ "Add", "the", "configurations", "settings" ]
def addParameters(self): """Add the configurations settings""" self.pUseIndex = self.addParam("useIndex", "bool", False) self.pParentJointIndex = self.addParam( "parentJointIndex", "long", -1, None, None)
[ "def", "addParameters", "(", "self", ")", ":", "self", ".", "pUseIndex", "=", "self", ".", "addParam", "(", "\"useIndex\"", ",", "\"bool\"", ",", "False", ")", "self", ".", "pParentJointIndex", "=", "self", ".", "addParam", "(", "\"parentJointIndex\"", ",", ...
https://github.com/mgear-dev/mgear/blob/06ddc26c5adb5eab07ca470c7fafa77404c8a1de/scripts/mgear/maya/shifter/component/shoulder_ms_01/guide.py#L52-L58
GiulioRossetti/cdlib
b2c6311b99725bb2b029556f531d244a2af14a2a
cdlib/algorithms/crisp_partition.py
python
label_propagation
(g_original: object)
return NodeClustering( coms, g_original, "Label Propagation", method_parameters={"": ""} )
The Label Propagation algorithm (LPA) detects communities using network structure alone. The algorithm doesn’t require a pre-defined objective function or prior information about the communities. It works as follows: -Every node is initialized with a unique label (an identifier) -These labels propagate ...
The Label Propagation algorithm (LPA) detects communities using network structure alone. The algorithm doesn’t require a pre-defined objective function or prior information about the communities. It works as follows: -Every node is initialized with a unique label (an identifier) -These labels propagate ...
[ "The", "Label", "Propagation", "algorithm", "(", "LPA", ")", "detects", "communities", "using", "network", "structure", "alone", ".", "The", "algorithm", "doesn’t", "require", "a", "pre", "-", "defined", "objective", "function", "or", "prior", "information", "ab...
def label_propagation(g_original: object) -> NodeClustering: """ The Label Propagation algorithm (LPA) detects communities using network structure alone. The algorithm doesn’t require a pre-defined objective function or prior information about the communities. It works as follows: -Every node is ini...
[ "def", "label_propagation", "(", "g_original", ":", "object", ")", "->", "NodeClustering", ":", "g", "=", "convert_graph_formats", "(", "g_original", ",", "nx", ".", "Graph", ")", "coms", "=", "list", "(", "nx", ".", "algorithms", ".", "community", ".", "l...
https://github.com/GiulioRossetti/cdlib/blob/b2c6311b99725bb2b029556f531d244a2af14a2a/cdlib/algorithms/crisp_partition.py#L1143-L1184
huawei-noah/vega
d9f13deede7f2b584e4b1d32ffdb833856129989
vega/modules/operators/functions/pytorch_to_tf.py
python
assign_weights
(pt_state_dict, pretrained_prefix=None)
return [_var.assign(_value) for _var, _value in vars_values]
Load pytorch state_dict and assign to tensorflow model.
Load pytorch state_dict and assign to tensorflow model.
[ "Load", "pytorch", "state_dict", "and", "assign", "to", "tensorflow", "model", "." ]
def assign_weights(pt_state_dict, pretrained_prefix=None): """Load pytorch state_dict and assign to tensorflow model.""" import tensorflow as tf vars = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES) vars.pop(0) pt_state_dict = {k: v for k, v in pt_state_dict.items() if 'num_batches_tracked' not in...
[ "def", "assign_weights", "(", "pt_state_dict", ",", "pretrained_prefix", "=", "None", ")", ":", "import", "tensorflow", "as", "tf", "vars", "=", "tf", ".", "get_collection", "(", "tf", ".", "GraphKeys", ".", "GLOBAL_VARIABLES", ")", "vars", ".", "pop", "(", ...
https://github.com/huawei-noah/vega/blob/d9f13deede7f2b584e4b1d32ffdb833856129989/vega/modules/operators/functions/pytorch_to_tf.py#L60-L84
timkpaine/tributary
90acb236d96a23c0c4794fd0f2da82c66060f737
tributary/streaming/output/email.py
python
make_email
(html, from_, subject="", attachments=None)
return message
Helper function to make emails html (str): content from_ (str): address to send the email from subject (str): subject of email attachments (list) : attachments to send
Helper function to make emails
[ "Helper", "function", "to", "make", "emails" ]
def make_email(html, from_, subject="", attachments=None): """Helper function to make emails html (str): content from_ (str): address to send the email from subject (str): subject of email attachments (list) : attachments to send """ message = emails.html(charset="utf-8", subject=subject, h...
[ "def", "make_email", "(", "html", ",", "from_", ",", "subject", "=", "\"\"", ",", "attachments", "=", "None", ")", ":", "message", "=", "emails", ".", "html", "(", "charset", "=", "\"utf-8\"", ",", "subject", "=", "subject", ",", "html", "=", "html", ...
https://github.com/timkpaine/tributary/blob/90acb236d96a23c0c4794fd0f2da82c66060f737/tributary/streaming/output/email.py#L10-L61
dansanderson/picotool
d8c51e58416f8010dc8c0fba3df5f0424b5bb852
pico8/util.py
python
BaseSection.to_lines
(self)
Generates lines of ASCII-encoded hexadecimal strings. Yields: One line of a hex string.
Generates lines of ASCII-encoded hexadecimal strings.
[ "Generates", "lines", "of", "ASCII", "-", "encoded", "hexadecimal", "strings", "." ]
def to_lines(self): """Generates lines of ASCII-encoded hexadecimal strings. Yields: One line of a hex string. """ for start_i in range(0, len(self._data), self.HEX_LINE_LENGTH_BYTES): end_i = start_i + self.HEX_LINE_LENGTH_BYTES if end_i > len(self._da...
[ "def", "to_lines", "(", "self", ")", ":", "for", "start_i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "_data", ")", ",", "self", ".", "HEX_LINE_LENGTH_BYTES", ")", ":", "end_i", "=", "start_i", "+", "self", ".", "HEX_LINE_LENGTH_BYTES", "i...
https://github.com/dansanderson/picotool/blob/d8c51e58416f8010dc8c0fba3df5f0424b5bb852/pico8/util.py#L112-L123
ninja-ide/ninja-ide
87d91131bd19fdc3dcfd91eb97ad1e41c49c60c0
ninja_ide/gui/ide.py
python
IDE.change_toolsdock_visibility
(self)
Switch the tools dock visibility
Switch the tools dock visibility
[ "Switch", "the", "tools", "dock", "visibility" ]
def change_toolsdock_visibility(self): """Switch the tools dock visibility""" tools_dock = IDE.get_service("tools_dock").buttons_widget if tools_dock.isVisible(): tools_dock.hide() else: tools_dock.show()
[ "def", "change_toolsdock_visibility", "(", "self", ")", ":", "tools_dock", "=", "IDE", ".", "get_service", "(", "\"tools_dock\"", ")", ".", "buttons_widget", "if", "tools_dock", ".", "isVisible", "(", ")", ":", "tools_dock", ".", "hide", "(", ")", "else", ":...
https://github.com/ninja-ide/ninja-ide/blob/87d91131bd19fdc3dcfd91eb97ad1e41c49c60c0/ninja_ide/gui/ide.py#L455-L461
cclib/cclib
81cd4a81cc4a3bbed7016b3e417ca9bff8ad3a92
cclib/parser/qchemparser.py
python
QChem.generate_formula_histogram
(self)
return histogram
From the atomnos, generate a histogram that represents the molecular formula.
From the atomnos, generate a histogram that represents the molecular formula.
[ "From", "the", "atomnos", "generate", "a", "histogram", "that", "represents", "the", "molecular", "formula", "." ]
def generate_formula_histogram(self): """From the atomnos, generate a histogram that represents the molecular formula. """ histogram = dict() for element in self.atomelements: if element in histogram.keys(): histogram[element] += 1 else: ...
[ "def", "generate_formula_histogram", "(", "self", ")", ":", "histogram", "=", "dict", "(", ")", "for", "element", "in", "self", ".", "atomelements", ":", "if", "element", "in", "histogram", ".", "keys", "(", ")", ":", "histogram", "[", "element", "]", "+...
https://github.com/cclib/cclib/blob/81cd4a81cc4a3bbed7016b3e417ca9bff8ad3a92/cclib/parser/qchemparser.py#L412-L423
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/lib-python/3/datetime.py
python
datetime.__repr__
(self)
return s
Convert to formal string, for repr().
Convert to formal string, for repr().
[ "Convert", "to", "formal", "string", "for", "repr", "()", "." ]
def __repr__(self): """Convert to formal string, for repr().""" L = [self._year, self._month, self._day, # These are never zero self._hour, self._minute, self._second, self._microsecond] if L[-1] == 0: del L[-1] if L[-1] == 0: del L[-1] s = "...
[ "def", "__repr__", "(", "self", ")", ":", "L", "=", "[", "self", ".", "_year", ",", "self", ".", "_month", ",", "self", ".", "_day", ",", "# These are never zero", "self", ".", "_hour", ",", "self", ".", "_minute", ",", "self", ".", "_second", ",", ...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/datetime.py#L1555-L1568
Azure/azure-devops-cli-extension
11334cd55806bef0b99c3bee5a438eed71e44037
azure-devops/azext_devops/devops_sdk/v6_0/feature_management/feature_management_client.py
python
FeatureManagementClient.get_features
(self, target_contribution_id=None)
return self._deserialize('[ContributedFeature]', self._unwrap_collection(response))
GetFeatures. [Preview API] Get a list of all defined features :param str target_contribution_id: Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution. :rtype: [ContributedFeature]
GetFeatures. [Preview API] Get a list of all defined features :param str target_contribution_id: Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution. :rtype: [ContributedFeature]
[ "GetFeatures", ".", "[", "Preview", "API", "]", "Get", "a", "list", "of", "all", "defined", "features", ":", "param", "str", "target_contribution_id", ":", "Optional", "target", "contribution", ".", "If", "null", "/", "empty", "return", "all", "features", "....
def get_features(self, target_contribution_id=None): """GetFeatures. [Preview API] Get a list of all defined features :param str target_contribution_id: Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution. ...
[ "def", "get_features", "(", "self", ",", "target_contribution_id", "=", "None", ")", ":", "query_parameters", "=", "{", "}", "if", "target_contribution_id", "is", "not", "None", ":", "query_parameters", "[", "'targetContributionId'", "]", "=", "self", ".", "_ser...
https://github.com/Azure/azure-devops-cli-extension/blob/11334cd55806bef0b99c3bee5a438eed71e44037/azure-devops/azext_devops/devops_sdk/v6_0/feature_management/feature_management_client.py#L43-L56
KvasirSecurity/Kvasir
a5b3775184a8343240e1154a1f762f75df04dc0a
controllers/hosts.py
python
mass_vulndata
()
Add a vulndata to a lot of hosts TODO: This!
Add a vulndata to a lot of hosts TODO: This!
[ "Add", "a", "vulndata", "to", "a", "lot", "of", "hosts", "TODO", ":", "This!" ]
def mass_vulndata(): """ Add a vulndata to a lot of hosts TODO: This! """ host_ids = [] if request.vars.has_key('host_ids'): for z in request.vars.host_ids.split('|'): if z is not '': host_ids.append(z) form=SQLFORM.factory( Field('vulndata', 'ref...
[ "def", "mass_vulndata", "(", ")", ":", "host_ids", "=", "[", "]", "if", "request", ".", "vars", ".", "has_key", "(", "'host_ids'", ")", ":", "for", "z", "in", "request", ".", "vars", ".", "host_ids", ".", "split", "(", "'|'", ")", ":", "if", "z", ...
https://github.com/KvasirSecurity/Kvasir/blob/a5b3775184a8343240e1154a1f762f75df04dc0a/controllers/hosts.py#L746-L762
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/apps/fixtures/models.py
python
FixtureDataItem.remove_group
(self, group)
return self.remove_owner(group, 'group')
[]
def remove_group(self, group): return self.remove_owner(group, 'group')
[ "def", "remove_group", "(", "self", ",", "group", ")", ":", "return", "self", ".", "remove_owner", "(", "group", ",", "'group'", ")" ]
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/fixtures/models.py#L283-L284
Source-Python-Dev-Team/Source.Python
d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb
addons/source-python/Python3/operator.py
python
ixor
(a, b)
return a
Same as a ^= b.
Same as a ^= b.
[ "Same", "as", "a", "^", "=", "b", "." ]
def ixor(a, b): "Same as a ^= b." a ^= b return a
[ "def", "ixor", "(", "a", ",", "b", ")", ":", "a", "^=", "b", "return", "a" ]
https://github.com/Source-Python-Dev-Team/Source.Python/blob/d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb/addons/source-python/Python3/operator.py#L405-L408
HymanLiuTS/flaskTs
286648286976e85d9b9a5873632331efcafe0b21
flasky/lib/python2.7/site-packages/selenium/webdriver/common/action_chains.py
python
ActionChains.context_click
(self, on_element=None)
return self
Performs a context-click (right click) on an element. :Args: - on_element: The element to context-click. If None, clicks on current mouse position.
Performs a context-click (right click) on an element.
[ "Performs", "a", "context", "-", "click", "(", "right", "click", ")", "on", "an", "element", "." ]
def context_click(self, on_element=None): """ Performs a context-click (right click) on an element. :Args: - on_element: The element to context-click. If None, clicks on current mouse position. """ if on_element: self.move_to_element(on_element) ...
[ "def", "context_click", "(", "self", ",", "on_element", "=", "None", ")", ":", "if", "on_element", ":", "self", ".", "move_to_element", "(", "on_element", ")", "self", ".", "_actions", ".", "append", "(", "lambda", ":", "self", ".", "_driver", ".", "exec...
https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/selenium/webdriver/common/action_chains.py#L104-L116
realpython/book2-exercises
cde325eac8e6d8cff2316601c2e5b36bb46af7d0
web2py/venv/lib/python2.7/site-packages/pip/utils/__init__.py
python
ask
(message, options)
Ask the message interactively, with the given possible responses
Ask the message interactively, with the given possible responses
[ "Ask", "the", "message", "interactively", "with", "the", "given", "possible", "responses" ]
def ask(message, options): """Ask the message interactively, with the given possible responses""" while 1: if os.environ.get('PIP_NO_INPUT'): raise Exception( 'No input was expected ($PIP_NO_INPUT set); question: %s' % message ) response = ...
[ "def", "ask", "(", "message", ",", "options", ")", ":", "while", "1", ":", "if", "os", ".", "environ", ".", "get", "(", "'PIP_NO_INPUT'", ")", ":", "raise", "Exception", "(", "'No input was expected ($PIP_NO_INPUT set); question: %s'", "%", "message", ")", "re...
https://github.com/realpython/book2-exercises/blob/cde325eac8e6d8cff2316601c2e5b36bb46af7d0/web2py/venv/lib/python2.7/site-packages/pip/utils/__init__.py#L150-L166
wistbean/learn_python3_spider
73c873f4845f4385f097e5057407d03dd37a117b
stackoverflow/venv/lib/python3.6/site-packages/pymongo/message.py
python
_batched_op_msg_impl
( operation, command, docs, check_keys, ack, opts, ctx, buf)
return to_send, length
Create a batched OP_MSG write.
Create a batched OP_MSG write.
[ "Create", "a", "batched", "OP_MSG", "write", "." ]
def _batched_op_msg_impl( operation, command, docs, check_keys, ack, opts, ctx, buf): """Create a batched OP_MSG write.""" max_bson_size = ctx.max_bson_size max_write_batch_size = ctx.max_write_batch_size max_message_size = ctx.max_message_size flags = b"\x00\x00\x00\x00" if ack else b"\x02...
[ "def", "_batched_op_msg_impl", "(", "operation", ",", "command", ",", "docs", ",", "check_keys", ",", "ack", ",", "opts", ",", "ctx", ",", "buf", ")", ":", "max_bson_size", "=", "ctx", ".", "max_bson_size", "max_write_batch_size", "=", "ctx", ".", "max_write...
https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/pymongo/message.py#L1168-L1230
IJDykeman/wangTiles
7c1ee2095ebdf7f72bce07d94c6484915d5cae8b
experimental_code/tiles_3d/venv_mac/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
WorkingSet.subscribe
(self, callback, existing=True)
Invoke `callback` for all distributions If `existing=True` (default), call on all existing ones, as well.
Invoke `callback` for all distributions
[ "Invoke", "callback", "for", "all", "distributions" ]
def subscribe(self, callback, existing=True): """Invoke `callback` for all distributions If `existing=True` (default), call on all existing ones, as well. """ if callback in self.callbacks: return self.callbacks.append(callback) if not existing: ...
[ "def", "subscribe", "(", "self", ",", "callback", ",", "existing", "=", "True", ")", ":", "if", "callback", "in", "self", ".", "callbacks", ":", "return", "self", ".", "callbacks", ".", "append", "(", "callback", ")", "if", "not", "existing", ":", "ret...
https://github.com/IJDykeman/wangTiles/blob/7c1ee2095ebdf7f72bce07d94c6484915d5cae8b/experimental_code/tiles_3d/venv_mac/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L975-L987
GoogleCloudPlatform/PerfKitBenchmarker
6e3412d7d5e414b8ca30ed5eaf970cef1d919a67
perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py
python
Cleanup
(benchmark_spec)
Cleanup UnixBench on the target vm. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Cleanup UnixBench on the target vm.
[ "Cleanup", "UnixBench", "on", "the", "target", "vm", "." ]
def Cleanup(benchmark_spec): """Cleanup UnixBench on the target vm. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ pass
[ "def", "Cleanup", "(", "benchmark_spec", ")", ":", "pass" ]
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/6e3412d7d5e414b8ca30ed5eaf970cef1d919a67/perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py#L189-L196
pyansys/pymapdl
c07291fc062b359abf0e92b95a92d753a95ef3d7
ansys/mapdl/core/_commands/post1_/animation.py
python
Animation.andata
( self, delay="", ncycl="", rsltdat="", min_="", max_="", incr="", frclst="", autocont="", autocntr="", **kwargs, )
return self.run(command, **kwargs)
Displays animated graphics data for nonlinear problems. APDL Command: ANDATA Parameters ---------- delay Time delay during animation (defaults to 0.5 seconds). ncycl Number of animation cycles (defaults to 5). Available in non-UI mode only....
Displays animated graphics data for nonlinear problems.
[ "Displays", "animated", "graphics", "data", "for", "nonlinear", "problems", "." ]
def andata( self, delay="", ncycl="", rsltdat="", min_="", max_="", incr="", frclst="", autocont="", autocntr="", **kwargs, ): """Displays animated graphics data for nonlinear problems. APDL Command: ANDATA ...
[ "def", "andata", "(", "self", ",", "delay", "=", "\"\"", ",", "ncycl", "=", "\"\"", ",", "rsltdat", "=", "\"\"", ",", "min_", "=", "\"\"", ",", "max_", "=", "\"\"", ",", "incr", "=", "\"\"", ",", "frclst", "=", "\"\"", ",", "autocont", "=", "\"\"...
https://github.com/pyansys/pymapdl/blob/c07291fc062b359abf0e92b95a92d753a95ef3d7/ansys/mapdl/core/_commands/post1_/animation.py#L91-L170
rwightman/gen-efficientnet-pytorch
2d6623e956fbc9ac9c2f86ace2619e22ce7e2960
geffnet/gen_efficientnet.py
python
efficientnet_lite3
(pretrained=False, **kwargs)
return model
EfficientNet-Lite3
EfficientNet-Lite3
[ "EfficientNet", "-", "Lite3" ]
def efficientnet_lite3(pretrained=False, **kwargs): """ EfficientNet-Lite3 """ model = _gen_efficientnet_lite( 'efficientnet_lite3', channel_multiplier=1.2, depth_multiplier=1.4, pretrained=pretrained, **kwargs) return model
[ "def", "efficientnet_lite3", "(", "pretrained", "=", "False", ",", "*", "*", "kwargs", ")", ":", "model", "=", "_gen_efficientnet_lite", "(", "'efficientnet_lite3'", ",", "channel_multiplier", "=", "1.2", ",", "depth_multiplier", "=", "1.4", ",", "pretrained", "...
https://github.com/rwightman/gen-efficientnet-pytorch/blob/2d6623e956fbc9ac9c2f86ace2619e22ce7e2960/geffnet/gen_efficientnet.py#L964-L968
phonopy/phonopy
816586d0ba8177482ecf40e52f20cbdee2260d51
phonopy/harmonic/dynamical_matrix.py
python
DynamicalMatrixGL._get_c_recip_dipole_dipole
(self, q_cart, q_dir_cart)
return dd
Reciprocal part of Eq.(71) on the right hand side. This is subtracted from supercell force constants to create short-range force constants. Only once at commensurate points. This is added to interpolated short range force constants to create full force constants. Called many times.
Reciprocal part of Eq.(71) on the right hand side.
[ "Reciprocal", "part", "of", "Eq", ".", "(", "71", ")", "on", "the", "right", "hand", "side", "." ]
def _get_c_recip_dipole_dipole(self, q_cart, q_dir_cart): """Reciprocal part of Eq.(71) on the right hand side. This is subtracted from supercell force constants to create short-range force constants. Only once at commensurate points. This is added to interpolated short range force con...
[ "def", "_get_c_recip_dipole_dipole", "(", "self", ",", "q_cart", ",", "q_dir_cart", ")", ":", "import", "phonopy", ".", "_phonopy", "as", "phonoc", "pos", "=", "self", ".", "_pcell", ".", "positions", "num_atom", "=", "len", "(", "pos", ")", "volume", "=",...
https://github.com/phonopy/phonopy/blob/816586d0ba8177482ecf40e52f20cbdee2260d51/phonopy/harmonic/dynamical_matrix.py#L739-L769
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/sympy/sympy/matrices/expressions/matpow.py
python
MatPow._entry
(self, i, j)
[]
def _entry(self, i, j): if self.exp.is_Integer: # Make an explicity MatMul out of the MatPow return MatMul(*[self.base for k in range(self.exp)])._entry(i, j)
[ "def", "_entry", "(", "self", ",", "i", ",", "j", ")", ":", "if", "self", ".", "exp", ".", "is_Integer", ":", "# Make an explicity MatMul out of the MatPow", "return", "MatMul", "(", "*", "[", "self", ".", "base", "for", "k", "in", "range", "(", "self", ...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/matrices/expressions/matpow.py#L29-L32
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/vod/v20180717/vod_client.py
python
VodClient.ModifySubAppIdInfo
(self, request)
该接口用于修改子应用信息,但不允许修改主应用信息。 :param request: Request instance for ModifySubAppIdInfo. :type request: :class:`tencentcloud.vod.v20180717.models.ModifySubAppIdInfoRequest` :rtype: :class:`tencentcloud.vod.v20180717.models.ModifySubAppIdInfoResponse`
该接口用于修改子应用信息,但不允许修改主应用信息。
[ "该接口用于修改子应用信息,但不允许修改主应用信息。" ]
def ModifySubAppIdInfo(self, request): """该接口用于修改子应用信息,但不允许修改主应用信息。 :param request: Request instance for ModifySubAppIdInfo. :type request: :class:`tencentcloud.vod.v20180717.models.ModifySubAppIdInfoRequest` :rtype: :class:`tencentcloud.vod.v20180717.models.ModifySubAppIdInfoResponse` ...
[ "def", "ModifySubAppIdInfo", "(", "self", ",", "request", ")", ":", "try", ":", "params", "=", "request", ".", "_serialize", "(", ")", "body", "=", "self", ".", "call", "(", "\"ModifySubAppIdInfo\"", ",", "params", ")", "response", "=", "json", ".", "loa...
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/vod/v20180717/vod_client.py#L2864-L2889
ni/nidaqmx-python
62fc6b48cbbb330fe1bcc9aedadc86610a1269b6
nidaqmx/_task_modules/timing.py
python
Timing.samp_clk_timebase_active_edge
(self)
return Edge(val.value)
:class:`nidaqmx.constants.Edge`: Specifies on which edge to recognize a Sample Clock Timebase pulse. This property is useful primarily when the signal you use as the Sample Clock Timebase is not a periodic clock.
:class:`nidaqmx.constants.Edge`: Specifies on which edge to recognize a Sample Clock Timebase pulse. This property is useful primarily when the signal you use as the Sample Clock Timebase is not a periodic clock.
[ ":", "class", ":", "nidaqmx", ".", "constants", ".", "Edge", ":", "Specifies", "on", "which", "edge", "to", "recognize", "a", "Sample", "Clock", "Timebase", "pulse", ".", "This", "property", "is", "useful", "primarily", "when", "the", "signal", "you", "use...
def samp_clk_timebase_active_edge(self): """ :class:`nidaqmx.constants.Edge`: Specifies on which edge to recognize a Sample Clock Timebase pulse. This property is useful primarily when the signal you use as the Sample Clock Timebase is not a periodic clock. ""...
[ "def", "samp_clk_timebase_active_edge", "(", "self", ")", ":", "val", "=", "ctypes", ".", "c_int", "(", ")", "cfunc", "=", "lib_importer", ".", "windll", ".", "DAQmxGetSampClkTimebaseActiveEdge", "if", "cfunc", ".", "argtypes", "is", "None", ":", "with", "cfun...
https://github.com/ni/nidaqmx-python/blob/62fc6b48cbbb330fe1bcc9aedadc86610a1269b6/nidaqmx/_task_modules/timing.py#L1776-L1796
n0fate/chainbreaker
6f5a2c74bb922769e2f3d05f7ead6f36d2750277
pyDes.py
python
DES.__des_crypt
(self, block, crypt_type)
return self.final
Crypt the block of data through DES bit-manipulation
Crypt the block of data through DES bit-manipulation
[ "Crypt", "the", "block", "of", "data", "through", "DES", "bit", "-", "manipulation" ]
def __des_crypt(self, block, crypt_type): """Crypt the block of data through DES bit-manipulation""" block = self.__permutate(DES.__ip, block) self.L = block[:32] self.R = block[32:] # Encryption starts from Kn[1] through to Kn[16] if crypt_type == DES.ENCRYPT: ...
[ "def", "__des_crypt", "(", "self", ",", "block", ",", "crypt_type", ")", ":", "block", "=", "self", ".", "__permutate", "(", "DES", ".", "__ip", ",", "block", ")", "self", ".", "L", "=", "block", "[", ":", "32", "]", "self", ".", "R", "=", "block...
https://github.com/n0fate/chainbreaker/blob/6f5a2c74bb922769e2f3d05f7ead6f36d2750277/pyDes.py#L304-L380
khast3x/h8mail
0a371eb2e6ff786865e6608e46ee3ac5103a4dbc
h8mail/utils/run.py
python
parse_args
(args)
return parser.parse_args(args)
Seperate functions to make it easier to run tests Pass args as an array
Seperate functions to make it easier to run tests Pass args as an array
[ "Seperate", "functions", "to", "make", "it", "easier", "to", "run", "tests", "Pass", "args", "as", "an", "array" ]
def parse_args(args): """ Seperate functions to make it easier to run tests Pass args as an array """ parser = argparse.ArgumentParser( description="Email information and password lookup tool", prog="h8mail" ) parser.add_argument( "-t", "--targets", dest="use...
[ "def", "parse_args", "(", "args", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"Email information and password lookup tool\"", ",", "prog", "=", "\"h8mail\"", ")", "parser", ".", "add_argument", "(", "\"-t\"", ",", "\"--ta...
https://github.com/khast3x/h8mail/blob/0a371eb2e6ff786865e6608e46ee3ac5103a4dbc/h8mail/utils/run.py#L228-L358
CedricGuillemet/Imogen
ee417b42747ed5b46cb11b02ef0c3630000085b3
bin/Lib/platform.py
python
mac_ver
(release='', versioninfo=('', '', ''), machine='')
return release, versioninfo, machine
Get MacOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter values which default to ''. All tuple entries are strings.
Get MacOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version).
[ "Get", "MacOS", "version", "information", "and", "return", "it", "as", "tuple", "(", "release", "versioninfo", "machine", ")", "with", "versioninfo", "being", "a", "tuple", "(", "version", "dev_stage", "non_release_version", ")", "." ]
def mac_ver(release='', versioninfo=('', '', ''), machine=''): """ Get MacOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter valu...
[ "def", "mac_ver", "(", "release", "=", "''", ",", "versioninfo", "=", "(", "''", ",", "''", ",", "''", ")", ",", "machine", "=", "''", ")", ":", "# First try reading the information from an XML file which should", "# always be present", "info", "=", "_mac_ver_xml"...
https://github.com/CedricGuillemet/Imogen/blob/ee417b42747ed5b46cb11b02ef0c3630000085b3/bin/Lib/platform.py#L601-L618
openstack/cinder
23494a6d6c51451688191e1847a458f1d3cdcaa5
cinder/api/contrib/volume_actions.py
python
VolumeActionsController._begin_detaching
(self, req, id, body)
Update volume status to 'detaching'.
Update volume status to 'detaching'.
[ "Update", "volume", "status", "to", "detaching", "." ]
def _begin_detaching(self, req, id, body): """Update volume status to 'detaching'.""" context = req.environ['cinder.context'] # Not found exception will be handled at the wsgi level volume = self.volume_api.get(context, id) self.volume_api.begin_detaching(context, volume)
[ "def", "_begin_detaching", "(", "self", ",", "req", ",", "id", ",", "body", ")", ":", "context", "=", "req", ".", "environ", "[", "'cinder.context'", "]", "# Not found exception will be handled at the wsgi level", "volume", "=", "self", ".", "volume_api", ".", "...
https://github.com/openstack/cinder/blob/23494a6d6c51451688191e1847a458f1d3cdcaa5/cinder/api/contrib/volume_actions.py#L135-L141
tensorflow/ranking
94cccec8b4e71d2cc4489c61e2623522738c2924
tensorflow_ranking/python/losses_impl.py
python
SoftmaxLoss.compute
(self, labels, logits, weights, reduction, mask=None)
return tf.compat.v1.losses.compute_weighted_loss( losses, weights, reduction=reduction)
See `_RankingLoss`.
See `_RankingLoss`.
[ "See", "_RankingLoss", "." ]
def compute(self, labels, logits, weights, reduction, mask=None): """See `_RankingLoss`.""" logits = self.get_logits(logits) labels, logits = self.precompute(labels, logits, weights, mask) losses, weights = self._compute_unreduced_loss_impl(labels, logits, mask) return tf.compat.v1.losses.compute_we...
[ "def", "compute", "(", "self", ",", "labels", ",", "logits", ",", "weights", ",", "reduction", ",", "mask", "=", "None", ")", ":", "logits", "=", "self", ".", "get_logits", "(", "logits", ")", "labels", ",", "logits", "=", "self", ".", "precompute", ...
https://github.com/tensorflow/ranking/blob/94cccec8b4e71d2cc4489c61e2623522738c2924/tensorflow_ranking/python/losses_impl.py#L1021-L1027
python-provy/provy
ca3d5e96a2210daf3c1fd4b96e047efff152db14
provy/more/centos/database/mysql.py
python
MySQLRole.has_grant
(self, privileges, on, username, login_from, with_grant_option)
return False
Returns :data:`True` if the user has the specified privileges on the specified object in the given location. :param privileges: Privileges that are being verified. :type privileges: :class:`str` :param on: Database object that the user holds privileges on. :type on: :class:`str` ...
Returns :data:`True` if the user has the specified privileges on the specified object in the given location.
[ "Returns", ":", "data", ":", "True", "if", "the", "user", "has", "the", "specified", "privileges", "on", "the", "specified", "object", "in", "the", "given", "location", "." ]
def has_grant(self, privileges, on, username, login_from, with_grant_option): ''' Returns :data:`True` if the user has the specified privileges on the specified object in the given location. :param privileges: Privileges that are being verified. :type privileges: :class:`str` :p...
[ "def", "has_grant", "(", "self", ",", "privileges", ",", "on", ",", "username", ",", "login_from", ",", "with_grant_option", ")", ":", "grants", "=", "self", ".", "get_user_grants", "(", "username", ",", "login_from", ")", "grant_option_string", "=", "self", ...
https://github.com/python-provy/provy/blob/ca3d5e96a2210daf3c1fd4b96e047efff152db14/provy/more/centos/database/mysql.py#L253-L293
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1_attached_volume.py
python
V1AttachedVolume.__eq__
(self, other)
return self.to_dict() == other.to_dict()
Returns true if both objects are equal
Returns true if both objects are equal
[ "Returns", "true", "if", "both", "objects", "are", "equal" ]
def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, V1AttachedVolume): return False return self.to_dict() == other.to_dict()
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "V1AttachedVolume", ")", ":", "return", "False", "return", "self", ".", "to_dict", "(", ")", "==", "other", ".", "to_dict", "(", ")" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1_attached_volume.py#L140-L145
privacyidea/privacyidea
9490c12ddbf77a34ac935b082d09eb583dfafa2c
privacyidea/lib/policy.py
python
Match.user
(cls, g, scope, action, user_object)
return cls(g, name=None, scope=scope, realm=None, active=True, resolver=None, user=None, user_object=user_object, client=g.client_ip, action=action, adminrealm=None, time=None, sort_by_priority=True, serial=g.serial)
Match active policies with a scope, an action and a user object (which may be None). The client IP is matched implicitly. :param g: context object :param scope: the policy scope. SCOPE.ADMIN cannot be passed, ``admin`` must be used instead. :param action: the policy action ...
Match active policies with a scope, an action and a user object (which may be None). The client IP is matched implicitly.
[ "Match", "active", "policies", "with", "a", "scope", "an", "action", "and", "a", "user", "object", "(", "which", "may", "be", "None", ")", ".", "The", "client", "IP", "is", "matched", "implicitly", "." ]
def user(cls, g, scope, action, user_object): """ Match active policies with a scope, an action and a user object (which may be None). The client IP is matched implicitly. :param g: context object :param scope: the policy scope. SCOPE.ADMIN cannot be passed, ``admin`` ...
[ "def", "user", "(", "cls", ",", "g", ",", "scope", ",", "action", ",", "user_object", ")", ":", "if", "scope", "==", "SCOPE", ".", "ADMIN", ":", "raise", "MatchingError", "(", "\"Match.user cannot be used for policies with scope ADMIN\"", ")", "if", "not", "("...
https://github.com/privacyidea/privacyidea/blob/9490c12ddbf77a34ac935b082d09eb583dfafa2c/privacyidea/lib/policy.py#L2727-L2750
filerock/FileRock-Client
37214f701666e76e723595f8f9ed238a42f6eb06
filerockclient/serversession/server_session.py
python
ServerSession.connect
(self)
Make the client connect to the server.
Make the client connect to the server.
[ "Make", "the", "client", "connect", "to", "the", "server", "." ]
def connect(self): """Make the client connect to the server.""" self._input_queue.put(Command('CONNECT'), 'usercommand')
[ "def", "connect", "(", "self", ")", ":", "self", ".", "_input_queue", ".", "put", "(", "Command", "(", "'CONNECT'", ")", ",", "'usercommand'", ")" ]
https://github.com/filerock/FileRock-Client/blob/37214f701666e76e723595f8f9ed238a42f6eb06/filerockclient/serversession/server_session.py#L432-L434
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-build/python-libs/gdata/samples/authsub/secure_authsub.py
python
HealthAuthSubHelper.GetNextUrl
(self, req)
return next_url
Computes the current URL the web app is running from. Args: req: mod_python mp_request instance to build the URL from. Returns: A string representing the web app's URL.
Computes the current URL the web app is running from.
[ "Computes", "the", "current", "URL", "the", "web", "app", "is", "running", "from", "." ]
def GetNextUrl(self, req): """Computes the current URL the web app is running from. Args: req: mod_python mp_request instance to build the URL from. Returns: A string representing the web app's URL. """ if req.is_https(): next_url = 'https://' else: next_url = 'http://'...
[ "def", "GetNextUrl", "(", "self", ",", "req", ")", ":", "if", "req", ".", "is_https", "(", ")", ":", "next_url", "=", "'https://'", "else", ":", "next_url", "=", "'http://'", "next_url", "+=", "req", ".", "hostname", "+", "req", ".", "unparsed_uri", "r...
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-build/python-libs/gdata/samples/authsub/secure_authsub.py#L48-L62
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/redis/client.py
python
StrictRedis.pipeline
(self, transaction=True, shard_hint=None)
return StrictPipeline( self.connection_pool, self.response_callbacks, transaction, shard_hint)
Return a new pipeline object that can queue multiple commands for later execution. ``transaction`` indicates whether all commands should be executed atomically. Apart from making a group of operations atomic, pipelines are useful for reducing the back-and-forth overhead between the clien...
Return a new pipeline object that can queue multiple commands for later execution. ``transaction`` indicates whether all commands should be executed atomically. Apart from making a group of operations atomic, pipelines are useful for reducing the back-and-forth overhead between the clien...
[ "Return", "a", "new", "pipeline", "object", "that", "can", "queue", "multiple", "commands", "for", "later", "execution", ".", "transaction", "indicates", "whether", "all", "commands", "should", "be", "executed", "atomically", ".", "Apart", "from", "making", "a",...
def pipeline(self, transaction=True, shard_hint=None): """ Return a new pipeline object that can queue multiple commands for later execution. ``transaction`` indicates whether all commands should be executed atomically. Apart from making a group of operations atomic, pipelines ar...
[ "def", "pipeline", "(", "self", ",", "transaction", "=", "True", ",", "shard_hint", "=", "None", ")", ":", "return", "StrictPipeline", "(", "self", ".", "connection_pool", ",", "self", ".", "response_callbacks", ",", "transaction", ",", "shard_hint", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/redis/client.py#L557-L569
InQuest/omnibus
88dbf5d02f87eaa79a1cfc13d403cf854ee44c40
omnibus-cli.py
python
Console.do_quit
(self, _)
return self._STOP_AND_EXIT
Exit Omnibus shell.
Exit Omnibus shell.
[ "Exit", "Omnibus", "shell", "." ]
def do_quit(self, _): """Exit Omnibus shell.""" self._should_quit = True if self.session is not None: running('Clearing artifact cache ...') self.session.flush() warning('Closing Omnibus shell ...') return self._STOP_AND_EXIT
[ "def", "do_quit", "(", "self", ",", "_", ")", ":", "self", ".", "_should_quit", "=", "True", "if", "self", ".", "session", "is", "not", "None", ":", "running", "(", "'Clearing artifact cache ...'", ")", "self", ".", "session", ".", "flush", "(", ")", "...
https://github.com/InQuest/omnibus/blob/88dbf5d02f87eaa79a1cfc13d403cf854ee44c40/omnibus-cli.py#L119-L128
cackharot/suds-py3
1d92cc6297efee31bfd94b50b99c431505d7de21
suds/mx/typer.py
python
Typer.genprefix
(cls, node, ns)
Generate a prefix. @param node: An XML node on which the prefix will be used. @type node: L{sax.element.Element} @param ns: A namespace needing an unique prefix. @type ns: (prefix, uri) @return: The I{ns} with a new prefix.
Generate a prefix.
[ "Generate", "a", "prefix", "." ]
def genprefix(cls, node, ns): """ Generate a prefix. @param node: An XML node on which the prefix will be used. @type node: L{sax.element.Element} @param ns: A namespace needing an unique prefix. @type ns: (prefix, uri) @return: The I{ns} with a new prefix. ...
[ "def", "genprefix", "(", "cls", ",", "node", ",", "ns", ")", ":", "for", "n", "in", "range", "(", "1", ",", "1024", ")", ":", "p", "=", "'ns%d'", "%", "n", "u", "=", "node", ".", "resolvePrefix", "(", "p", ",", "default", "=", "None", ")", "i...
https://github.com/cackharot/suds-py3/blob/1d92cc6297efee31bfd94b50b99c431505d7de21/suds/mx/typer.py#L98-L112
OpenCobolIDE/OpenCobolIDE
c78d0d335378e5fe0a5e74f53c19b68b55e85388
open_cobol_ide/extlibs/pyqode/core/panels/search_and_replace.py
python
SearchAndReplacePanel._set_widget_background_color
(widget, color)
Changes the base color of a widget (background). :param widget: widget to modify :param color: the color to apply
Changes the base color of a widget (background). :param widget: widget to modify :param color: the color to apply
[ "Changes", "the", "base", "color", "of", "a", "widget", "(", "background", ")", ".", ":", "param", "widget", ":", "widget", "to", "modify", ":", "param", "color", ":", "the", "color", "to", "apply" ]
def _set_widget_background_color(widget, color): """ Changes the base color of a widget (background). :param widget: widget to modify :param color: the color to apply """ pal = widget.palette() pal.setColor(pal.Base, color) widget.setPalette(pal)
[ "def", "_set_widget_background_color", "(", "widget", ",", "color", ")", ":", "pal", "=", "widget", ".", "palette", "(", ")", "pal", ".", "setColor", "(", "pal", ".", "Base", ",", "color", ")", "widget", ".", "setPalette", "(", "pal", ")" ]
https://github.com/OpenCobolIDE/OpenCobolIDE/blob/c78d0d335378e5fe0a5e74f53c19b68b55e85388/open_cobol_ide/extlibs/pyqode/core/panels/search_and_replace.py#L336-L344
buntine/SwervinMervin
e5ae51a0e4ed62783024b7e7b096398e21b6d54a
swervin_mervin/segment.py
python
Segment.should_ignore
(self, segment)
return self.top["camera"]["z"] <= s.CAMERA_DEPTH or\ self.top["screen"]["y"] <= segment.top["screen"]["y"] or\ self.bottom["screen"]["y"] >= self.top["screen"]["y"]
Returns true if this segment will be projected behind a hill, or behind us, etc.
Returns true if this segment will be projected behind a hill, or behind us, etc.
[ "Returns", "true", "if", "this", "segment", "will", "be", "projected", "behind", "a", "hill", "or", "behind", "us", "etc", "." ]
def should_ignore(self, segment): """Returns true if this segment will be projected behind a hill, or behind us, etc.""" return self.top["camera"]["z"] <= s.CAMERA_DEPTH or\ self.top["screen"]["y"] <= segment.top["screen"]["y"] or\ self.bottom["screen"]["y"] >= self.top["sc...
[ "def", "should_ignore", "(", "self", ",", "segment", ")", ":", "return", "self", ".", "top", "[", "\"camera\"", "]", "[", "\"z\"", "]", "<=", "s", ".", "CAMERA_DEPTH", "or", "self", ".", "top", "[", "\"screen\"", "]", "[", "\"y\"", "]", "<=", "segmen...
https://github.com/buntine/SwervinMervin/blob/e5ae51a0e4ed62783024b7e7b096398e21b6d54a/swervin_mervin/segment.py#L27-L31
nschaetti/EchoTorch
cba209c49e0fda73172d2e853b85c747f9f5117e
echotorch/data/datasets/MarkovChainDataset.py
python
MarkovChainDataset.__getitem__
(self, idx)
return inputs, outputs, markov_chain
Get item :param idx: :return:
Get item :param idx: :return:
[ "Get", "item", ":", "param", "idx", ":", ":", "return", ":" ]
def __getitem__(self, idx): """ Get item :param idx: :return: """ # Generate a Markov chain with # specified length markov_chain = self._generate_markov_chain( length=self._sample_length, start_state=np.random.randint(low=0, high=se...
[ "def", "__getitem__", "(", "self", ",", "idx", ")", ":", "# Generate a Markov chain with", "# specified length", "markov_chain", "=", "self", ".", "_generate_markov_chain", "(", "length", "=", "self", ".", "_sample_length", ",", "start_state", "=", "np", ".", "ran...
https://github.com/nschaetti/EchoTorch/blob/cba209c49e0fda73172d2e853b85c747f9f5117e/echotorch/data/datasets/MarkovChainDataset.py#L117-L216
pyqt/examples
843bb982917cecb2350b5f6d7f42c9b7fb142ec1
src/pyqt-official/mainwindows/application/application.py
python
MainWindow.saveAs
(self)
return False
[]
def saveAs(self): fileName, _ = QFileDialog.getSaveFileName(self) if fileName: return self.saveFile(fileName) return False
[ "def", "saveAs", "(", "self", ")", ":", "fileName", ",", "_", "=", "QFileDialog", ".", "getSaveFileName", "(", "self", ")", "if", "fileName", ":", "return", "self", ".", "saveFile", "(", "fileName", ")", "return", "False" ]
https://github.com/pyqt/examples/blob/843bb982917cecb2350b5f6d7f42c9b7fb142ec1/src/pyqt-official/mainwindows/application/application.py#L96-L101
saltstack/salt
fae5bc757ad0f1716483ce7ae180b451545c2058
salt/ext/tornado/escape.py
python
linkify
(text, shorten=False, extra_params="", require_protocol=False, permitted_protocols=["http", "https"])
return _URL_RE.sub(make_link, text)
Converts plain text into HTML with links. For example: ``linkify("Hello http://tornadoweb.org!")`` would return ``Hello <a href="http://tornadoweb.org">http://tornadoweb.org</a>!`` Parameters: * ``shorten``: Long urls will be shortened for display. * ``extra_params``: Extra text to include in th...
Converts plain text into HTML with links.
[ "Converts", "plain", "text", "into", "HTML", "with", "links", "." ]
def linkify(text, shorten=False, extra_params="", require_protocol=False, permitted_protocols=["http", "https"]): """Converts plain text into HTML with links. For example: ``linkify("Hello http://tornadoweb.org!")`` would return ``Hello <a href="http://tornadoweb.org">http://tornadoweb.org</a>!...
[ "def", "linkify", "(", "text", ",", "shorten", "=", "False", ",", "extra_params", "=", "\"\"", ",", "require_protocol", "=", "False", ",", "permitted_protocols", "=", "[", "\"http\"", ",", "\"https\"", "]", ")", ":", "if", "extra_params", "and", "not", "ca...
https://github.com/saltstack/salt/blob/fae5bc757ad0f1716483ce7ae180b451545c2058/salt/ext/tornado/escape.py#L281-L374
nadineproject/nadine
c41c8ef7ffe18f1853029c97eecc329039b4af6c
nadine/management/commands/install_demo.py
python
Command.handle
(self, *args, **options)
[]
def handle(self, *args, **options): if settings.PRODUCTION: raise Exception('Will not install the demo on production.') self.delete_all(BillingLog) self.delete_all(Bill) self.delete_all(Transaction) self.delete_all(CoworkingDay) self.delete_all(MembershipPlan...
[ "def", "handle", "(", "self", ",", "*", "args", ",", "*", "*", "options", ")", ":", "if", "settings", ".", "PRODUCTION", ":", "raise", "Exception", "(", "'Will not install the demo on production.'", ")", "self", ".", "delete_all", "(", "BillingLog", ")", "se...
https://github.com/nadineproject/nadine/blob/c41c8ef7ffe18f1853029c97eecc329039b4af6c/nadine/management/commands/install_demo.py#L25-L61
uqfoundation/mystic
154e6302d1f2f94e8f13e88ecc5f24241cc28ac7
mystic/scripts.py
python
_get_history
(source, ids=None)
return params, costs
get params and cost from the given source source is the name of the trajectory logfile (or solver instance) if provided, ids are the list of 'run ids' to select
get params and cost from the given source
[ "get", "params", "and", "cost", "from", "the", "given", "source" ]
def _get_history(source, ids=None): """get params and cost from the given source source is the name of the trajectory logfile (or solver instance) if provided, ids are the list of 'run ids' to select """ try: # if it's a logfile, it might be multi-id from mystic.munge import read_trajectories ...
[ "def", "_get_history", "(", "source", ",", "ids", "=", "None", ")", ":", "try", ":", "# if it's a logfile, it might be multi-id", "from", "mystic", ".", "munge", "import", "read_trajectories", "step", ",", "param", ",", "cost", "=", "read_trajectories", "(", "so...
https://github.com/uqfoundation/mystic/blob/154e6302d1f2f94e8f13e88ecc5f24241cc28ac7/mystic/scripts.py#L125-L159
paulvangentcom/python_corona_simulation
a5dddd3e13d2bb768a9294d85ab27329be9a21dd
config.py
python
Configuration.set_self_isolation
(self, self_isolate_proportion=0.9, isolation_bounds = [0.02, 0.02, 0.09, 0.98], traveling_infects=False)
sets self-isolation scenario to active
sets self-isolation scenario to active
[ "sets", "self", "-", "isolation", "scenario", "to", "active" ]
def set_self_isolation(self, self_isolate_proportion=0.9, isolation_bounds = [0.02, 0.02, 0.09, 0.98], traveling_infects=False): '''sets self-isolation scenario to active''' self.self_isolate = True self.isolation_bounds = isolation_bounds ...
[ "def", "set_self_isolation", "(", "self", ",", "self_isolate_proportion", "=", "0.9", ",", "isolation_bounds", "=", "[", "0.02", ",", "0.02", ",", "0.09", ",", "0.98", "]", ",", "traveling_infects", "=", "False", ")", ":", "self", ".", "self_isolate", "=", ...
https://github.com/paulvangentcom/python_corona_simulation/blob/a5dddd3e13d2bb768a9294d85ab27329be9a21dd/config.py#L153-L168
ym2011/POC-EXP
206b22d3a6b2a172359678df33bbc5b2ad04b6c3
K8/Web-Exp/sqlmap/thirdparty/oset/_abc.py
python
MutableSet.clear
(self)
This is slow (creates N new iterators!) but effective.
This is slow (creates N new iterators!) but effective.
[ "This", "is", "slow", "(", "creates", "N", "new", "iterators!", ")", "but", "effective", "." ]
def clear(self): """This is slow (creates N new iterators!) but effective.""" try: while True: self.pop() except KeyError: pass
[ "def", "clear", "(", "self", ")", ":", "try", ":", "while", "True", ":", "self", ".", "pop", "(", ")", "except", "KeyError", ":", "pass" ]
https://github.com/ym2011/POC-EXP/blob/206b22d3a6b2a172359678df33bbc5b2ad04b6c3/K8/Web-Exp/sqlmap/thirdparty/oset/_abc.py#L373-L379
mit-han-lab/once-for-all
4f6fce3652ee4553ea811d38f32f90ac8b1bc378
ofa/utils/layers.py
python
ResNetBottleneckBlock.config
(self)
return { 'name': ResNetBottleneckBlock.__name__, 'in_channels': self.in_channels, 'out_channels': self.out_channels, 'kernel_size': self.kernel_size, 'stride': self.stride, 'expand_ratio': self.expand_ratio, 'mid_channels': self.mid_channels, 'act_func': self.act_func, 'groups': self.groups, ...
[]
def config(self): return { 'name': ResNetBottleneckBlock.__name__, 'in_channels': self.in_channels, 'out_channels': self.out_channels, 'kernel_size': self.kernel_size, 'stride': self.stride, 'expand_ratio': self.expand_ratio, 'mid_channels': self.mid_channels, 'act_func': self.act_func, 'gr...
[ "def", "config", "(", "self", ")", ":", "return", "{", "'name'", ":", "ResNetBottleneckBlock", ".", "__name__", ",", "'in_channels'", ":", "self", ".", "in_channels", ",", "'out_channels'", ":", "self", ".", "out_channels", ",", "'kernel_size'", ":", "self", ...
https://github.com/mit-han-lab/once-for-all/blob/4f6fce3652ee4553ea811d38f32f90ac8b1bc378/ofa/utils/layers.py#L632-L644
coala/coala
37af7fd5de3ed148b8096cfc80e4717fb840bf2c
coalib/results/result_actions/PrintMoreInfoAction.py
python
PrintMoreInfoAction.apply
(self, result, original_file_dict, file_diff_dict)
return file_diff_dict
Print (M)ore info
Print (M)ore info
[ "Print", "(", "M", ")", "ore", "info" ]
def apply(self, result, original_file_dict, file_diff_dict): """ Print (M)ore info """ print(result.additional_info) return file_diff_dict
[ "def", "apply", "(", "self", ",", "result", ",", "original_file_dict", ",", "file_diff_dict", ")", ":", "print", "(", "result", ".", "additional_info", ")", "return", "file_diff_dict" ]
https://github.com/coala/coala/blob/37af7fd5de3ed148b8096cfc80e4717fb840bf2c/coalib/results/result_actions/PrintMoreInfoAction.py#L19-L25
Source-Python-Dev-Team/Source.Python
d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb
addons/source-python/packages/site-packages/sphinx/writers/texinfo.py
python
TexinfoTranslator.collect_rellinks
(self)
Collect the relative links (next, previous, up) for each "node".
Collect the relative links (next, previous, up) for each "node".
[ "Collect", "the", "relative", "links", "(", "next", "previous", "up", ")", "for", "each", "node", "." ]
def collect_rellinks(self): """Collect the relative links (next, previous, up) for each "node".""" rellinks = self.rellinks node_menus = self.node_menus for id, entries in node_menus.items(): rellinks[id] = ['', '', ''] # up's for id, entries in node_menus.ite...
[ "def", "collect_rellinks", "(", "self", ")", ":", "rellinks", "=", "self", ".", "rellinks", "node_menus", "=", "self", ".", "node_menus", "for", "id", ",", "entries", "in", "node_menus", ".", "items", "(", ")", ":", "rellinks", "[", "id", "]", "=", "["...
https://github.com/Source-Python-Dev-Team/Source.Python/blob/d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb/addons/source-python/packages/site-packages/sphinx/writers/texinfo.py#L305-L331
viewfinderco/viewfinder
453845b5d64ab5b3b826c08b02546d1ca0a07c14
backend/www/auth_viewfinder.py
python
LoginResetViewfinderHandler._Finish
(cls, handler, client, user_dict, ident_dict, device_dict)
Invoked by VerifyViewfinderHandler to complete the login action.
Invoked by VerifyViewfinderHandler to complete the login action.
[ "Invoked", "by", "VerifyViewfinderHandler", "to", "complete", "the", "login", "action", "." ]
def _Finish(cls, handler, client, user_dict, ident_dict, device_dict): """Invoked by VerifyViewfinderHandler to complete the login action.""" handler._AuthUser(user_dict, ident_dict, device_dict, confirmed=True)
[ "def", "_Finish", "(", "cls", ",", "handler", ",", "client", ",", "user_dict", ",", "ident_dict", ",", "device_dict", ")", ":", "handler", ".", "_AuthUser", "(", "user_dict", ",", "ident_dict", ",", "device_dict", ",", "confirmed", "=", "True", ")" ]
https://github.com/viewfinderco/viewfinder/blob/453845b5d64ab5b3b826c08b02546d1ca0a07c14/backend/www/auth_viewfinder.py#L264-L266
mnemosyne-proj/mnemosyne
e39e364e56343437f2e485e0b06ca714de2f2d2e
mnemosyne/libmnemosyne/controllers/default_controller.py
python
DefaultController.create_new_cards
(self, fact_data, card_type, grade, tag_names, check_for_duplicates=True, save=True)
return cards
Create a new set of sister cards. If the grade is 2 or higher, we perform a initial review with that grade and move the cards into the long term retention process. For other grades, we treat the card as still unseen and keep its grade at -1. This puts the card on equal footing with ungra...
Create a new set of sister cards. If the grade is 2 or higher, we perform a initial review with that grade and move the cards into the long term retention process. For other grades, we treat the card as still unseen and keep its grade at -1. This puts the card on equal footing with ungra...
[ "Create", "a", "new", "set", "of", "sister", "cards", ".", "If", "the", "grade", "is", "2", "or", "higher", "we", "perform", "a", "initial", "review", "with", "that", "grade", "and", "move", "the", "cards", "into", "the", "long", "term", "retention", "...
def create_new_cards(self, fact_data, card_type, grade, tag_names, check_for_duplicates=True, save=True): """Create a new set of sister cards. If the grade is 2 or higher, we perform a initial review with that grade and move the cards into the long term retention proces...
[ "def", "create_new_cards", "(", "self", ",", "fact_data", ",", "card_type", ",", "grade", ",", "tag_names", ",", "check_for_duplicates", "=", "True", ",", "save", "=", "True", ")", ":", "assert", "grade", "in", "[", "-", "1", ",", "2", ",", "3", ",", ...
https://github.com/mnemosyne-proj/mnemosyne/blob/e39e364e56343437f2e485e0b06ca714de2f2d2e/mnemosyne/libmnemosyne/controllers/default_controller.py#L152-L250
Qirky/FoxDot
76318f9630bede48ff3994146ed644affa27bfa4
FoxDot/lib/Extensions/SonicPi/__init__.py
python
GenerateSonicPiData
(sonic_pi_dir)
Generate the sonic-pi json metadata from a sonic-pi source repo
Generate the sonic-pi json metadata from a sonic-pi source repo
[ "Generate", "the", "sonic", "-", "pi", "json", "metadata", "from", "a", "sonic", "-", "pi", "source", "repo" ]
def GenerateSonicPiData(sonic_pi_dir): """ Generate the sonic-pi json metadata from a sonic-pi source repo """ synthinfo = os.path.join(sonic_pi_dir, 'app/server/sonicpi/lib/sonicpi/synths/synthinfo') datastr = check_output(["ruby", RUBY_SCRIPT, synthinfo]) ref = check_outpu...
[ "def", "GenerateSonicPiData", "(", "sonic_pi_dir", ")", ":", "synthinfo", "=", "os", ".", "path", ".", "join", "(", "sonic_pi_dir", ",", "'app/server/sonicpi/lib/sonicpi/synths/synthinfo'", ")", "datastr", "=", "check_output", "(", "[", "\"ruby\"", ",", "RUBY_SCRIPT...
https://github.com/Qirky/FoxDot/blob/76318f9630bede48ff3994146ed644affa27bfa4/FoxDot/lib/Extensions/SonicPi/__init__.py#L112-L121
rdehuyss/micropython-ota-updater
be4ec89994b2ac63a006113fb5cff21aa7202204
main.py
python
connectToWifiAndUpdate
()
[]
def connectToWifiAndUpdate(): import time, machine, network, gc, app.secrets as secrets time.sleep(1) print('Memory free', gc.mem_free()) from app.ota_updater import OTAUpdater sta_if = network.WLAN(network.STA_IF) if not sta_if.isconnected(): print('connecting to network...') ...
[ "def", "connectToWifiAndUpdate", "(", ")", ":", "import", "time", ",", "machine", ",", "network", ",", "gc", ",", "app", ".", "secrets", "as", "secrets", "time", ".", "sleep", "(", "1", ")", "print", "(", "'Memory free'", ",", "gc", ".", "mem_free", "(...
https://github.com/rdehuyss/micropython-ota-updater/blob/be4ec89994b2ac63a006113fb5cff21aa7202204/main.py#L3-L24
containernet/containernet
7b2ae38d691b2ed8da2b2700b85ed03562271d01
examples/miniedit.py
python
customOvs.setSwitchIP
(self, ip)
Set management IP address
Set management IP address
[ "Set", "management", "IP", "address" ]
def setSwitchIP(self, ip): "Set management IP address" self.switchIP = ip
[ "def", "setSwitchIP", "(", "self", ",", "ip", ")", ":", "self", ".", "switchIP", "=", "ip" ]
https://github.com/containernet/containernet/blob/7b2ae38d691b2ed8da2b2700b85ed03562271d01/examples/miniedit.py#L167-L169
qutip/qutip
52d01da181a21b810c3407812c670f35fdc647e8
qutip/superop_reps.py
python
chi_to_choi
(q_oper)
return Qobj((B * q_oper * B.dag()) / q_oper.shape[0], superrep='choi')
Converts a Chi matrix to a Choi matrix. NOTE: this is only supported for qubits right now. Need to extend to Heisenberg-Weyl for other subsystem dimensions.
Converts a Chi matrix to a Choi matrix.
[ "Converts", "a", "Chi", "matrix", "to", "a", "Choi", "matrix", "." ]
def chi_to_choi(q_oper): """ Converts a Chi matrix to a Choi matrix. NOTE: this is only supported for qubits right now. Need to extend to Heisenberg-Weyl for other subsystem dimensions. """ nq = _nq(q_oper.dims) B = _pauli_basis(nq) # Force the basis change to match the dimensions of ...
[ "def", "chi_to_choi", "(", "q_oper", ")", ":", "nq", "=", "_nq", "(", "q_oper", ".", "dims", ")", "B", "=", "_pauli_basis", "(", "nq", ")", "# Force the basis change to match the dimensions of", "# the input.", "B", ".", "dims", "=", "q_oper", ".", "dims", "...
https://github.com/qutip/qutip/blob/52d01da181a21b810c3407812c670f35fdc647e8/qutip/superop_reps.py#L251-L272
ntalekt/homeassistant
8fb6da881564430a3324125ddc2bd43cb7c8680f
custom_components/monitor_docker/sensor.py
python
DockerSensor.icon
(self)
return self._var_icon
Icon to use in the frontend.
Icon to use in the frontend.
[ "Icon", "to", "use", "in", "the", "frontend", "." ]
def icon(self): """Icon to use in the frontend.""" return self._var_icon
[ "def", "icon", "(", "self", ")", ":", "return", "self", ".", "_var_icon" ]
https://github.com/ntalekt/homeassistant/blob/8fb6da881564430a3324125ddc2bd43cb7c8680f/custom_components/monitor_docker/sensor.py#L178-L180
KalleHallden/AutoTimer
2d954216700c4930baa154e28dbddc34609af7ce
env/lib/python2.7/site-packages/pip/_vendor/chardet/sjisprober.py
python
SJISProber.__init__
(self)
[]
def __init__(self): super(SJISProber, self).__init__() self.coding_sm = CodingStateMachine(SJIS_SM_MODEL) self.distribution_analyzer = SJISDistributionAnalysis() self.context_analyzer = SJISContextAnalysis() self.reset()
[ "def", "__init__", "(", "self", ")", ":", "super", "(", "SJISProber", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "coding_sm", "=", "CodingStateMachine", "(", "SJIS_SM_MODEL", ")", "self", ".", "distribution_analyzer", "=", "SJISDistributionAnaly...
https://github.com/KalleHallden/AutoTimer/blob/2d954216700c4930baa154e28dbddc34609af7ce/env/lib/python2.7/site-packages/pip/_vendor/chardet/sjisprober.py#L37-L42
citronneur/rdpy
cef16a9f64d836a3221a344ca7d571644280d829
rdpy/core/type.py
python
String.__init__
(self, value = "", readLen = None, conditional = lambda:True, optional = False, constant = False, unicode = False, until = None)
@param value: python string use for inner value @param readLen: length use to read in stream (SimpleType) if 0 read entire stream @param conditional : Callable object Read and Write operation depend on return of this function @param optional: If there is no ...
[]
def __init__(self, value = "", readLen = None, conditional = lambda:True, optional = False, constant = False, unicode = False, until = None): """ @param value: python string use for inner value @param readLen: length use to read in stream (SimpleType) if 0 read entire stream @param condi...
[ "def", "__init__", "(", "self", ",", "value", "=", "\"\"", ",", "readLen", "=", "None", ",", "conditional", "=", "lambda", ":", "True", ",", "optional", "=", "False", ",", "constant", "=", "False", ",", "unicode", "=", "False", ",", "until", "=", "No...
https://github.com/citronneur/rdpy/blob/cef16a9f64d836a3221a344ca7d571644280d829/rdpy/core/type.py#L744-L761
AutodeskRoboticsLab/Mimic
85447f0d346be66988303a6a054473d92f1ed6f4
mimic/scripts/mimic_external_axes.py
python
get_external_axis_info
(robot_name, external_axis_name)
return info
Get's all of the external axis settings for the input external axis name :param robot_name: string, name of robot :param external_axis_name: string, name of external axis :return info: dict, dictionary of input external axis setting
Get's all of the external axis settings for the input external axis name :param robot_name: string, name of robot :param external_axis_name: string, name of external axis :return info: dict, dictionary of input external axis setting
[ "Get", "s", "all", "of", "the", "external", "axis", "settings", "for", "the", "input", "external", "axis", "name", ":", "param", "robot_name", ":", "string", "name", "of", "robot", ":", "param", "external_axis_name", ":", "string", "name", "of", "external", ...
def get_external_axis_info(robot_name, external_axis_name): """ Get's all of the external axis settings for the input external axis name :param robot_name: string, name of robot :param external_axis_name: string, name of external axis :return info: dict, dictionary of input external axis setting ...
[ "def", "get_external_axis_info", "(", "robot_name", ",", "external_axis_name", ")", ":", "info", "=", "{", "}", "info", "[", "'Robot Name'", "]", "=", "robot_name", "info", "[", "'Axis Name'", "]", "=", "external_axis_name", "external_axis_path", "=", "_get_extern...
https://github.com/AutodeskRoboticsLab/Mimic/blob/85447f0d346be66988303a6a054473d92f1ed6f4/mimic/scripts/mimic_external_axes.py#L56-L85
koalalorenzo/python-digitalocean
ebea58fddf2ceea35c027bfa66f2fa9f5debfd64
digitalocean/LoadBalancer.py
python
LoadBalancer.__str__
(self)
return "%s" % (self.id)
[]
def __str__(self): return "%s" % (self.id)
[ "def", "__str__", "(", "self", ")", ":", "return", "\"%s\"", "%", "(", "self", ".", "id", ")" ]
https://github.com/koalalorenzo/python-digitalocean/blob/ebea58fddf2ceea35c027bfa66f2fa9f5debfd64/digitalocean/LoadBalancer.py#L379-L380
Jajcus/pyxmpp2
59e5fd7c8837991ac265dc6aad23a6bd256768a7
pyxmpp2/ext/muc/muccore.py
python
MucXBase.free
(self)
Unlink and free the XML node owned by `self`.
Unlink and free the XML node owned by `self`.
[ "Unlink", "and", "free", "the", "XML", "node", "owned", "by", "self", "." ]
def free(self): """ Unlink and free the XML node owned by `self`. """ if not self.borrowed: self.xmlnode.unlinkNode() self.xmlnode.freeNode() self.xmlnode=None
[ "def", "free", "(", "self", ")", ":", "if", "not", "self", ".", "borrowed", ":", "self", ".", "xmlnode", ".", "unlinkNode", "(", ")", "self", ".", "xmlnode", ".", "freeNode", "(", ")", "self", ".", "xmlnode", "=", "None" ]
https://github.com/Jajcus/pyxmpp2/blob/59e5fd7c8837991ac265dc6aad23a6bd256768a7/pyxmpp2/ext/muc/muccore.py#L105-L112
IntelPython/sdc
1ebf55c00ef38dfbd401a70b3945e352a5a38b87
sdc/utilities/utils.py
python
is_assign
(inst)
return isinstance(inst, ir.Assign)
[]
def is_assign(inst): return isinstance(inst, ir.Assign)
[ "def", "is_assign", "(", "inst", ")", ":", "return", "isinstance", "(", "inst", ",", "ir", ".", "Assign", ")" ]
https://github.com/IntelPython/sdc/blob/1ebf55c00ef38dfbd401a70b3945e352a5a38b87/sdc/utilities/utils.py#L551-L552
wakatime/legacy-python-cli
9b64548b16ab5ef16603d9a6c2620a16d0df8d46
wakatime/packages/ntlm_auth/session_security.py
python
SessionSecurity._seal_message
(self, message)
return encrypted_message
[MS-NLMP] v28.0 2016-07-14 3.4.3 Message Confidentiality Will generate an encrypted message using RC4 based on the ClientSealingKey @param message: The message to be sealed (encrypted) @return encrypted_message: The encrypted message
[MS-NLMP] v28.0 2016-07-14
[ "[", "MS", "-", "NLMP", "]", "v28", ".", "0", "2016", "-", "07", "-", "14" ]
def _seal_message(self, message): """ [MS-NLMP] v28.0 2016-07-14 3.4.3 Message Confidentiality Will generate an encrypted message using RC4 based on the ClientSealingKey @param message: The message to be sealed (encrypted) @return encrypted_message: The encrypted messag...
[ "def", "_seal_message", "(", "self", ",", "message", ")", ":", "encrypted_message", "=", "self", ".", "outgoing_handle", ".", "update", "(", "message", ")", "return", "encrypted_message" ]
https://github.com/wakatime/legacy-python-cli/blob/9b64548b16ab5ef16603d9a6c2620a16d0df8d46/wakatime/packages/ntlm_auth/session_security.py#L159-L170
Cog-Creators/Red-DiscordBot
b05933274a11fb097873ab0d1b246d37b06aa306
redbot/core/config.py
python
Config.member_from_ids
(self, guild_id: int, member_id: int)
return self._get_base_group(self.MEMBER, str(guild_id), str(member_id))
Returns a `Group` for the ids which represent a member. Parameters ---------- guild_id : int The id of the guild of the member member_id : int The id of the member Returns ------- `Group <redbot.core.config.Group>` The member'...
Returns a `Group` for the ids which represent a member.
[ "Returns", "a", "Group", "for", "the", "ids", "which", "represent", "a", "member", "." ]
def member_from_ids(self, guild_id: int, member_id: int) -> Group: """Returns a `Group` for the ids which represent a member. Parameters ---------- guild_id : int The id of the guild of the member member_id : int The id of the member Returns ...
[ "def", "member_from_ids", "(", "self", ",", "guild_id", ":", "int", ",", "member_id", ":", "int", ")", "->", "Group", ":", "return", "self", ".", "_get_base_group", "(", "self", ".", "MEMBER", ",", "str", "(", "guild_id", ")", ",", "str", "(", "member_...
https://github.com/Cog-Creators/Red-DiscordBot/blob/b05933274a11fb097873ab0d1b246d37b06aa306/redbot/core/config.py#L1078-L1094
edisonlz/fastor
342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3
base/site-packages/tencentcloud/vpc/v20170312/vpc_client.py
python
VpcClient.UnassignPrivateIpAddresses
(self, request)
本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网 IP。 * 退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网 IP。不能退还弹性网卡的主内网IP。 :param request: 调用UnassignPrivateIpAddresses所需参数的结构体。 :type request: :class:`tencentcloud.vpc.v20170312.models.UnassignPrivateIpAddressesRequest` :rtype: :class:`tencentcloud.vpc.v20170312.mode...
本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网 IP。 * 退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网 IP。不能退还弹性网卡的主内网IP。
[ "本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网", "IP。", "*", "退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网", "IP。不能退还弹性网卡的主内网IP。" ]
def UnassignPrivateIpAddresses(self, request): """本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网 IP。 * 退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网 IP。不能退还弹性网卡的主内网IP。 :param request: 调用UnassignPrivateIpAddresses所需参数的结构体。 :type request: :class:`tencentcloud.vpc.v20170312.models.UnassignPrivateIpAddressesReques...
[ "def", "UnassignPrivateIpAddresses", "(", "self", ",", "request", ")", ":", "try", ":", "params", "=", "request", ".", "_serialize", "(", ")", "body", "=", "self", ".", "call", "(", "\"UnassignPrivateIpAddresses\"", ",", "params", ")", "response", "=", "json...
https://github.com/edisonlz/fastor/blob/342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3/base/site-packages/tencentcloud/vpc/v20170312/vpc_client.py#L2516-L2542
PMEAL/OpenPNM
c9514b858d1361b2090b2f9579280cbcd476c9b0
openpnm/topotools/_topotools.py
python
stitch_pores
(network, pores1, pores2, mode='gabriel')
r""" Stitches together pores in a network with disconnected clusters Parameters ---------- network : OpenPNM Network The network to operate upon pores1 and pores2: array_like The pore indices of the disconnected clusters to be joined mode : str Dictates which tesselation...
r""" Stitches together pores in a network with disconnected clusters
[ "r", "Stitches", "together", "pores", "in", "a", "network", "with", "disconnected", "clusters" ]
def stitch_pores(network, pores1, pores2, mode='gabriel'): r""" Stitches together pores in a network with disconnected clusters Parameters ---------- network : OpenPNM Network The network to operate upon pores1 and pores2: array_like The pore indices of the disconnected clusters...
[ "def", "stitch_pores", "(", "network", ",", "pores1", ",", "pores2", ",", "mode", "=", "'gabriel'", ")", ":", "from", "openpnm", ".", "network", "import", "Delaunay", ",", "Gabriel", "pores1", "=", "network", ".", "_parse_indices", "(", "pores1", ")", "por...
https://github.com/PMEAL/OpenPNM/blob/c9514b858d1361b2090b2f9579280cbcd476c9b0/openpnm/topotools/_topotools.py#L787-L831
pyparallel/pyparallel
11e8c6072d48c8f13641925d17b147bf36ee0ba3
Lib/site-packages/pip-7.1.2-py3.3.egg/pip/utils/__init__.py
python
backup_dir
(dir, ext='.bak')
return dir + extension
Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc)
Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc)
[ "Figure", "out", "the", "name", "of", "a", "directory", "to", "back", "up", "the", "given", "dir", "to", "(", "adding", ".", "bak", ".", "bak2", "etc", ")" ]
def backup_dir(dir, ext='.bak'): """Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc)""" n = 1 extension = ext while os.path.exists(dir + extension): n += 1 extension = ext + str(n) return dir + extension
[ "def", "backup_dir", "(", "dir", ",", "ext", "=", "'.bak'", ")", ":", "n", "=", "1", "extension", "=", "ext", "while", "os", ".", "path", ".", "exists", "(", "dir", "+", "extension", ")", ":", "n", "+=", "1", "extension", "=", "ext", "+", "str", ...
https://github.com/pyparallel/pyparallel/blob/11e8c6072d48c8f13641925d17b147bf36ee0ba3/Lib/site-packages/pip-7.1.2-py3.3.egg/pip/utils/__init__.py#L120-L128
PowerScript/KatanaFramework
0f6ad90a88de865d58ec26941cb4460501e75496
lib/scapy/scapy/arch/windows/__init__.py
python
show_interfaces
(resolve_mac=True)
return ifaces.show(resolve_mac)
Print list of available network interfaces
Print list of available network interfaces
[ "Print", "list", "of", "available", "network", "interfaces" ]
def show_interfaces(resolve_mac=True): """Print list of available network interfaces""" return ifaces.show(resolve_mac)
[ "def", "show_interfaces", "(", "resolve_mac", "=", "True", ")", ":", "return", "ifaces", ".", "show", "(", "resolve_mac", ")" ]
https://github.com/PowerScript/KatanaFramework/blob/0f6ad90a88de865d58ec26941cb4460501e75496/lib/scapy/scapy/arch/windows/__init__.py#L229-L231
CvvT/dumpDex
92ab3b7e996194a06bf1dd5538a4954e8a5ee9c1
python/idaapi.py
python
handle_debug_event
(*args)
return _idaapi.handle_debug_event(*args)
handle_debug_event(ev, rqflags) -> int
handle_debug_event(ev, rqflags) -> int
[ "handle_debug_event", "(", "ev", "rqflags", ")", "-", ">", "int" ]
def handle_debug_event(*args): """ handle_debug_event(ev, rqflags) -> int """ return _idaapi.handle_debug_event(*args)
[ "def", "handle_debug_event", "(", "*", "args", ")", ":", "return", "_idaapi", ".", "handle_debug_event", "(", "*", "args", ")" ]
https://github.com/CvvT/dumpDex/blob/92ab3b7e996194a06bf1dd5538a4954e8a5ee9c1/python/idaapi.py#L3397-L3401
inkandswitch/livebook
93c8d467734787366ad084fc3566bf5cbe249c51
public/pypyjs/modules/shutil.py
python
copystat
(src, dst)
Copy all stat info (mode bits, atime, mtime, flags) from src to dst
Copy all stat info (mode bits, atime, mtime, flags) from src to dst
[ "Copy", "all", "stat", "info", "(", "mode", "bits", "atime", "mtime", "flags", ")", "from", "src", "to", "dst" ]
def copystat(src, dst): """Copy all stat info (mode bits, atime, mtime, flags) from src to dst""" st = os.stat(src) mode = stat.S_IMODE(st.st_mode) if hasattr(os, 'utime'): os.utime(dst, (st.st_atime, st.st_mtime)) if hasattr(os, 'chmod'): os.chmod(dst, mode) if hasattr(os, 'chfl...
[ "def", "copystat", "(", "src", ",", "dst", ")", ":", "st", "=", "os", ".", "stat", "(", "src", ")", "mode", "=", "stat", ".", "S_IMODE", "(", "st", ".", "st_mode", ")", "if", "hasattr", "(", "os", ",", "'utime'", ")", ":", "os", ".", "utime", ...
https://github.com/inkandswitch/livebook/blob/93c8d467734787366ad084fc3566bf5cbe249c51/public/pypyjs/modules/shutil.py#L93-L109
standardebooks/tools
f57af3c5938a9aeed9e97e82b2c130424f6033e5
se/images.py
python
_float_to_str
(float_value: float)
return "{0:.2f}".format(round(float_value, 2))
[]
def _float_to_str(float_value: float) -> str: return "{0:.2f}".format(round(float_value, 2))
[ "def", "_float_to_str", "(", "float_value", ":", "float", ")", "->", "str", ":", "return", "\"{0:.2f}\"", ".", "format", "(", "round", "(", "float_value", ",", "2", ")", ")" ]
https://github.com/standardebooks/tools/blob/f57af3c5938a9aeed9e97e82b2c130424f6033e5/se/images.py#L402-L403
cvjena/semantic-embeddings
0d4177422bafbba685fb6a0f976675864f31e09f
utils.py
python
l2norm
(x)
return K.tf.nn.l2_normalize(x, -1)
L2-normalizes a tensor along the last axis.
L2-normalizes a tensor along the last axis.
[ "L2", "-", "normalizes", "a", "tensor", "along", "the", "last", "axis", "." ]
def l2norm(x): """ L2-normalizes a tensor along the last axis. """ return K.tf.nn.l2_normalize(x, -1)
[ "def", "l2norm", "(", "x", ")", ":", "return", "K", ".", "tf", ".", "nn", ".", "l2_normalize", "(", "x", ",", "-", "1", ")" ]
https://github.com/cvjena/semantic-embeddings/blob/0d4177422bafbba685fb6a0f976675864f31e09f/utils.py#L125-L127
hyperspy/hyperspy
1ffb3fab33e607045a37f30c1463350b72617e10
hyperspy/io_plugins/sur.py
python
DigitalSurfHandler._build_general_1D_data
(self,)
Build general 1D Data objects. Currently work with spectra
Build general 1D Data objects. Currently work with spectra
[ "Build", "general", "1D", "Data", "objects", ".", "Currently", "work", "with", "spectra" ]
def _build_general_1D_data(self,): """Build general 1D Data objects. Currently work with spectra""" #Check that the object contained only one object. #Probably overkill at this point but better safe than sorry if len(self._list_sur_file_content) != 1: raise MountainsMapFileE...
[ "def", "_build_general_1D_data", "(", "self", ",", ")", ":", "#Check that the object contained only one object.", "#Probably overkill at this point but better safe than sorry", "if", "len", "(", "self", ".", "_list_sur_file_content", ")", "!=", "1", ":", "raise", "MountainsMa...
https://github.com/hyperspy/hyperspy/blob/1ffb3fab33e607045a37f30c1463350b72617e10/hyperspy/io_plugins/sur.py#L695-L714
tp4a/teleport
1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad
server/www/packages/packages-darwin/x64/tornado/auth.py
python
GoogleOAuth2Mixin._on_access_token
(self, future, response_fut)
Callback function for the exchange to the access token.
Callback function for the exchange to the access token.
[ "Callback", "function", "for", "the", "exchange", "to", "the", "access", "token", "." ]
def _on_access_token(self, future, response_fut): """Callback function for the exchange to the access token.""" try: response = response_fut.result() except Exception as e: future.set_exception(AuthError('Google auth error: %s' % str(e))) return args ...
[ "def", "_on_access_token", "(", "self", ",", "future", ",", "response_fut", ")", ":", "try", ":", "response", "=", "response_fut", ".", "result", "(", ")", "except", "Exception", "as", "e", ":", "future", ".", "set_exception", "(", "AuthError", "(", "'Goog...
https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-darwin/x64/tornado/auth.py#L982-L991
citronneur/rdpy
cef16a9f64d836a3221a344ca7d571644280d829
rdpy/protocol/rdp/rdp.py
python
RDPClientObserver.__init__
(self, controller)
@param controller: RDP controller use to interact with protocol
[]
def __init__(self, controller): """ @param controller: RDP controller use to interact with protocol """ self._controller = controller self._controller.addClientObserver(self)
[ "def", "__init__", "(", "self", ",", "controller", ")", ":", "self", ".", "_controller", "=", "controller", "self", ".", "_controller", ".", "addClientObserver", "(", "self", ")" ]
https://github.com/citronneur/rdpy/blob/cef16a9f64d836a3221a344ca7d571644280d829/rdpy/protocol/rdp/rdp.py#L635-L640
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/apps/app_manager/suite_xml/post_process/remote_requests.py
python
RemoteRequestFactory.get_smart_link_function
(self)
return f"concat('{prefix}', $domain, '{suffix}'{params})"
[]
def get_smart_link_function(self): # Returns XPath that will evaluate to a URL. # For example, return value could be # concat('https://www.cchq.org/a/', $domain, '/app/v1/123/smartlink/', '?arg1=', $arg1, '&arg2=', $arg2) # Which could evaluate to # https://www.cchq.org/a/myd...
[ "def", "get_smart_link_function", "(", "self", ")", ":", "# Returns XPath that will evaluate to a URL.", "# For example, return value could be", "# concat('https://www.cchq.org/a/', $domain, '/app/v1/123/smartlink/', '?arg1=', $arg1, '&arg2=', $arg2)", "# Which could evaluate to", "# https:/...
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/app_manager/suite_xml/post_process/remote_requests.py#L298-L313
celery/django-celery-beat
fa73034be892052893e4ef17926ef3a5d4a21ea2
django_celery_beat/utils.py
python
is_database_scheduler
(scheduler)
return ( scheduler == 'django' or issubclass(symbol_by_name(scheduler), DatabaseScheduler) )
Return true if Celery is configured to use the db scheduler.
Return true if Celery is configured to use the db scheduler.
[ "Return", "true", "if", "Celery", "is", "configured", "to", "use", "the", "db", "scheduler", "." ]
def is_database_scheduler(scheduler): """Return true if Celery is configured to use the db scheduler.""" if not scheduler: return False from kombu.utils import symbol_by_name from .schedulers import DatabaseScheduler return ( scheduler == 'django' or issubclass(symbol_by_name...
[ "def", "is_database_scheduler", "(", "scheduler", ")", ":", "if", "not", "scheduler", ":", "return", "False", "from", "kombu", ".", "utils", "import", "symbol_by_name", "from", ".", "schedulers", "import", "DatabaseScheduler", "return", "(", "scheduler", "==", "...
https://github.com/celery/django-celery-beat/blob/fa73034be892052893e4ef17926ef3a5d4a21ea2/django_celery_beat/utils.py#L39-L48
out0fmemory/GoAgent-Always-Available
c4254984fea633ce3d1893fe5901debd9f22c2a9
server/lib/google/appengine/ext/ndb/model.py
python
Model._get_property_for
(self, p, indexed=True, depth=0)
return prop
Internal helper to get the Property for a protobuf-level property.
Internal helper to get the Property for a protobuf-level property.
[ "Internal", "helper", "to", "get", "the", "Property", "for", "a", "protobuf", "-", "level", "property", "." ]
def _get_property_for(self, p, indexed=True, depth=0): """Internal helper to get the Property for a protobuf-level property.""" parts = p.name().split('.') if len(parts) <= depth: # Apparently there's an unstructured value here. # Assume it is a None written for a missing value. # (It coul...
[ "def", "_get_property_for", "(", "self", ",", "p", ",", "indexed", "=", "True", ",", "depth", "=", "0", ")", ":", "parts", "=", "p", ".", "name", "(", ")", ".", "split", "(", "'.'", ")", "if", "len", "(", "parts", ")", "<=", "depth", ":", "# Ap...
https://github.com/out0fmemory/GoAgent-Always-Available/blob/c4254984fea633ce3d1893fe5901debd9f22c2a9/server/lib/google/appengine/ext/ndb/model.py#L3231-L3246
Source-Python-Dev-Team/Source.Python
d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb
addons/source-python/packages/site-packages/pygments/formatter.py
python
Formatter.get_style_defs
(self, arg='')
return ''
Return the style definitions for the current style as a string. ``arg`` is an additional argument whose meaning depends on the formatter used. Note that ``arg`` can also be a list or tuple for some formatters like the html formatter.
Return the style definitions for the current style as a string.
[ "Return", "the", "style", "definitions", "for", "the", "current", "style", "as", "a", "string", "." ]
def get_style_defs(self, arg=''): """ Return the style definitions for the current style as a string. ``arg`` is an additional argument whose meaning depends on the formatter used. Note that ``arg`` can also be a list or tuple for some formatters like the html formatter. ...
[ "def", "get_style_defs", "(", "self", ",", "arg", "=", "''", ")", ":", "return", "''" ]
https://github.com/Source-Python-Dev-Team/Source.Python/blob/d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb/addons/source-python/packages/site-packages/pygments/formatter.py#L77-L85
reingart/pyfpdf
cb3340806c140b6e63eb4ce9d6230be84fba456e
fpdf/fpdf.py
python
FPDF.get_y
(self)
return self.y
Get y position
Get y position
[ "Get", "y", "position" ]
def get_y(self): "Get y position" return self.y
[ "def", "get_y", "(", "self", ")", ":", "return", "self", ".", "y" ]
https://github.com/reingart/pyfpdf/blob/cb3340806c140b6e63eb4ce9d6230be84fba456e/fpdf/fpdf.py#L1085-L1087
zbarge/stocklook
d40bf60566681acd1e970818450228602bb7d8a5
stocklook/crypto/gdax/order_mm.py
python
GdaxMMOrder.op_order
(self)
return self._op_order
Applies only to sell orders. Returns the opposite side of the trade. Used to calculate stop-outs and profit/loss. :return:
Applies only to sell orders. Returns the opposite side of the trade. Used to calculate stop-outs and profit/loss. :return:
[ "Applies", "only", "to", "sell", "orders", ".", "Returns", "the", "opposite", "side", "of", "the", "trade", ".", "Used", "to", "calculate", "stop", "-", "outs", "and", "profit", "/", "loss", ".", ":", "return", ":" ]
def op_order(self): """ Applies only to sell orders. Returns the opposite side of the trade. Used to calculate stop-outs and profit/loss. :return: """ return self._op_order
[ "def", "op_order", "(", "self", ")", ":", "return", "self", ".", "_op_order" ]
https://github.com/zbarge/stocklook/blob/d40bf60566681acd1e970818450228602bb7d8a5/stocklook/crypto/gdax/order_mm.py#L98-L104
carla-simulator/scenario_runner
f4d00d88eda4212a1e119515c96281a4be5c234e
srunner/scenariomanager/weather_sim.py
python
Weather.update
(self, delta_time=0)
If the weather animation is true, the new sun position is calculated w.r.t delta_time Nothing happens if animation or datetime are None. Args: delta_time (float): Time passed since self.datetime [seconds].
If the weather animation is true, the new sun position is calculated w.r.t delta_time
[ "If", "the", "weather", "animation", "is", "true", "the", "new", "sun", "position", "is", "calculated", "w", ".", "r", ".", "t", "delta_time" ]
def update(self, delta_time=0): """ If the weather animation is true, the new sun position is calculated w.r.t delta_time Nothing happens if animation or datetime are None. Args: delta_time (float): Time passed since self.datetime [seconds]. """ if not self....
[ "def", "update", "(", "self", ",", "delta_time", "=", "0", ")", ":", "if", "not", "self", ".", "animation", "or", "not", "self", ".", "datetime", ":", "return", "self", ".", "datetime", "=", "self", ".", "datetime", "+", "datetime", ".", "timedelta", ...
https://github.com/carla-simulator/scenario_runner/blob/f4d00d88eda4212a1e119515c96281a4be5c234e/srunner/scenariomanager/weather_sim.py#L71-L88
wistbean/fxxkpython
88e16d79d8dd37236ba6ecd0d0ff11d63143968c
vip/qyxuan/projects/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/urllib3/util/ssl_.py
python
assert_fingerprint
(cert, fingerprint)
Checks if given fingerprint matches the supplied certificate. :param cert: Certificate as bytes object. :param fingerprint: Fingerprint as string of hexdigits, can be interspersed by colons.
Checks if given fingerprint matches the supplied certificate.
[ "Checks", "if", "given", "fingerprint", "matches", "the", "supplied", "certificate", "." ]
def assert_fingerprint(cert, fingerprint): """ Checks if given fingerprint matches the supplied certificate. :param cert: Certificate as bytes object. :param fingerprint: Fingerprint as string of hexdigits, can be interspersed by colons. """ fingerprint = fingerprint.replace(':...
[ "def", "assert_fingerprint", "(", "cert", ",", "fingerprint", ")", ":", "fingerprint", "=", "fingerprint", ".", "replace", "(", "':'", ",", "''", ")", ".", "lower", "(", ")", "digest_length", "=", "len", "(", "fingerprint", ")", "hashfunc", "=", "HASHFUNC_...
https://github.com/wistbean/fxxkpython/blob/88e16d79d8dd37236ba6ecd0d0ff11d63143968c/vip/qyxuan/projects/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/urllib3/util/ssl_.py#L163-L187
jgagneastro/coffeegrindsize
22661ebd21831dba4cf32bfc6ba59fe3d49f879c
App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/pandas/core/arrays/base.py
python
ExtensionArray.dropna
(self)
return self[~self.isna()]
Return ExtensionArray without NA values Returns ------- valid : ExtensionArray
Return ExtensionArray without NA values
[ "Return", "ExtensionArray", "without", "NA", "values" ]
def dropna(self): """ Return ExtensionArray without NA values Returns ------- valid : ExtensionArray """ return self[~self.isna()]
[ "def", "dropna", "(", "self", ")", ":", "return", "self", "[", "~", "self", ".", "isna", "(", ")", "]" ]
https://github.com/jgagneastro/coffeegrindsize/blob/22661ebd21831dba4cf32bfc6ba59fe3d49f879c/App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/pandas/core/arrays/base.py#L473-L481
magenta/magenta
be6558f1a06984faff6d6949234f5fe9ad0ffdb5
magenta/models/rl_tuner/note_rnn_loader.py
python
NoteRNNLoader.build_graph
(self)
Constructs the portion of the graph that belongs to this model.
Constructs the portion of the graph that belongs to this model.
[ "Constructs", "the", "portion", "of", "the", "graph", "that", "belongs", "to", "this", "model", "." ]
def build_graph(self): """Constructs the portion of the graph that belongs to this model.""" tf.logging.info('Initializing melody RNN graph for scope %s', self.scope) with self.graph.as_default(): with tf.device(lambda op: ''): with tf.variable_scope(self.scope): # Make an LSTM cel...
[ "def", "build_graph", "(", "self", ")", ":", "tf", ".", "logging", ".", "info", "(", "'Initializing melody RNN graph for scope %s'", ",", "self", ".", "scope", ")", "with", "self", ".", "graph", ".", "as_default", "(", ")", ":", "with", "tf", ".", "device"...
https://github.com/magenta/magenta/blob/be6558f1a06984faff6d6949234f5fe9ad0ffdb5/magenta/models/rl_tuner/note_rnn_loader.py#L175-L260
hatRiot/zarp
2e772350a01c2aeed3f4da9685cd0cc5d6b3ecad
src/lib/scapy/fields.py
python
Emph.__eq__
(self, other)
return self.fld == other
[]
def __eq__(self, other): return self.fld == other
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "return", "self", ".", "fld", "==", "other" ]
https://github.com/hatRiot/zarp/blob/2e772350a01c2aeed3f4da9685cd0cc5d6b3ecad/src/lib/scapy/fields.py#L108-L109
hubblestack/hubble
763142474edcecdec5fd25591dc29c3536e8f969
hubblestack/modules/mount.py
python
remount
(name, device, mkmnt=False, fstype="", opts="defaults", user=None)
return mount(name, device, mkmnt, fstype, opts, user=user)
Attempt to remount a device, if the device is not already mounted, mount is called CLI Example: .. code-block:: bash salt '*' mount.remount /mnt/foo /dev/sdz1 True
Attempt to remount a device, if the device is not already mounted, mount is called
[ "Attempt", "to", "remount", "a", "device", "if", "the", "device", "is", "not", "already", "mounted", "mount", "is", "called" ]
def remount(name, device, mkmnt=False, fstype="", opts="defaults", user=None): """ Attempt to remount a device, if the device is not already mounted, mount is called CLI Example: .. code-block:: bash salt '*' mount.remount /mnt/foo /dev/sdz1 True """ force_mount = False if __g...
[ "def", "remount", "(", "name", ",", "device", ",", "mkmnt", "=", "False", ",", "fstype", "=", "\"\"", ",", "opts", "=", "\"defaults\"", ",", "user", "=", "None", ")", ":", "force_mount", "=", "False", "if", "__grains__", "[", "\"os\"", "]", "in", "["...
https://github.com/hubblestack/hubble/blob/763142474edcecdec5fd25591dc29c3536e8f969/hubblestack/modules/mount.py#L1297-L1356
gramps-project/gramps
04d4651a43eb210192f40a9f8c2bad8ee8fa3753
gramps/plugins/lib/libgedcom.py
python
GedcomParser.__event_note
(self, line, state)
@param line: The current line in GedLine format @type line: GedLine @param state: The current state @type state: CurrentState
[]
def __event_note(self, line, state): """ @param line: The current line in GedLine format @type line: GedLine @param state: The current state @type state: CurrentState """ self.__parse_note(line, state.event, state)
[ "def", "__event_note", "(", "self", ",", "line", ",", "state", ")", ":", "self", ".", "__parse_note", "(", "line", ",", "state", ".", "event", ",", "state", ")" ]
https://github.com/gramps-project/gramps/blob/04d4651a43eb210192f40a9f8c2bad8ee8fa3753/gramps/plugins/lib/libgedcom.py#L5862-L5869
deluge-torrent/deluge
2316088f5c0dd6cb044d9d4832fa7d56dcc79cdc
deluge/ui/gtk3/mainwindow.py
python
MainWindow.quit
(self, shutdown=False, restart=False)
Quits the GtkUI application. Args: shutdown (bool): Whether or not to shutdown the daemon as well. restart (bool): Whether or not to restart the application after closing.
Quits the GtkUI application.
[ "Quits", "the", "GtkUI", "application", "." ]
def quit(self, shutdown=False, restart=False): # noqa: A003 python builtin """Quits the GtkUI application. Args: shutdown (bool): Whether or not to shutdown the daemon as well. restart (bool): Whether or not to restart the application after closing. """ def qu...
[ "def", "quit", "(", "self", ",", "shutdown", "=", "False", ",", "restart", "=", "False", ")", ":", "# noqa: A003 python builtin", "def", "quit_gtkui", "(", ")", ":", "def", "stop_gtk_reactor", "(", "result", "=", "None", ")", ":", "self", ".", "restart", ...
https://github.com/deluge-torrent/deluge/blob/2316088f5c0dd6cb044d9d4832fa7d56dcc79cdc/deluge/ui/gtk3/mainwindow.py#L228-L265
TurboGears/tg2
f40a82d016d70ce560002593b4bb8f83b57f87b3
tg/util/decorators.py
python
no_warn
(f, *args, **kwargs)
return update_wrapper(_f, f)
Decorator that suppresses warnings inside the decorated function
Decorator that suppresses warnings inside the decorated function
[ "Decorator", "that", "suppresses", "warnings", "inside", "the", "decorated", "function" ]
def no_warn(f, *args, **kwargs): """Decorator that suppresses warnings inside the decorated function""" def _f(*args, **kwargs): warnings.simplefilter("ignore") f(*args, **kwargs) warnings.resetwarnings() return update_wrapper(_f, f)
[ "def", "no_warn", "(", "f", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "def", "_f", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "warnings", ".", "simplefilter", "(", "\"ignore\"", ")", "f", "(", "*", "args", ",", "*", "*", ...
https://github.com/TurboGears/tg2/blob/f40a82d016d70ce560002593b4bb8f83b57f87b3/tg/util/decorators.py#L5-L11
numba/llvmlite
aeddf447d4befc336b26bde8c46042553a13cf75
llvmlite/binding/executionengine.py
python
create_mcjit_compiler
(module, target_machine)
return ExecutionEngine(engine, module=module)
Create a MCJIT ExecutionEngine from the given *module* and *target_machine*.
Create a MCJIT ExecutionEngine from the given *module* and *target_machine*.
[ "Create", "a", "MCJIT", "ExecutionEngine", "from", "the", "given", "*", "module", "*", "and", "*", "target_machine", "*", "." ]
def create_mcjit_compiler(module, target_machine): """ Create a MCJIT ExecutionEngine from the given *module* and *target_machine*. """ with ffi.OutputString() as outerr: engine = ffi.lib.LLVMPY_CreateMCJITCompiler( module, target_machine, outerr) if not engine: ...
[ "def", "create_mcjit_compiler", "(", "module", ",", "target_machine", ")", ":", "with", "ffi", ".", "OutputString", "(", ")", "as", "outerr", ":", "engine", "=", "ffi", ".", "lib", ".", "LLVMPY_CreateMCJITCompiler", "(", "module", ",", "target_machine", ",", ...
https://github.com/numba/llvmlite/blob/aeddf447d4befc336b26bde8c46042553a13cf75/llvmlite/binding/executionengine.py#L12-L24
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/library/oc_process.py
python
OpenShiftCLI._replace
(self, fname, force=False)
return self.openshift_cmd(cmd)
replace the current object with oc replace
replace the current object with oc replace
[ "replace", "the", "current", "object", "with", "oc", "replace" ]
def _replace(self, fname, force=False): '''replace the current object with oc replace''' # We are removing the 'resourceVersion' to handle # a race condition when modifying oc objects yed = Yedit(fname) results = yed.delete('metadata.resourceVersion') if results[0]: ...
[ "def", "_replace", "(", "self", ",", "fname", ",", "force", "=", "False", ")", ":", "# We are removing the 'resourceVersion' to handle", "# a race condition when modifying oc objects", "yed", "=", "Yedit", "(", "fname", ")", "results", "=", "yed", ".", "delete", "("...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/library/oc_process.py#L933-L945
saghul/evergreen
22f22f45892f397c23c3e09e6ea1ad4c00b3add8
evergreen/locks.py
python
Barrier.n_waiting
(self)
return 0
Return the number of threads currently waiting at the barrier.
Return the number of threads currently waiting at the barrier.
[ "Return", "the", "number", "of", "threads", "currently", "waiting", "at", "the", "barrier", "." ]
def n_waiting(self): """Return the number of threads currently waiting at the barrier.""" # We don't need synchronization here since this is an ephemeral result # anyway. It returns the correct value in the steady state. if self._state == 0: return self._count return...
[ "def", "n_waiting", "(", "self", ")", ":", "# We don't need synchronization here since this is an ephemeral result", "# anyway. It returns the correct value in the steady state.", "if", "self", ".", "_state", "==", "0", ":", "return", "self", ".", "_count", "return", "0" ]
https://github.com/saghul/evergreen/blob/22f22f45892f397c23c3e09e6ea1ad4c00b3add8/evergreen/locks.py#L366-L372
jupyter/kernel_gateway
440fef1cd29c829e2141bb4c76ed5f9572b428e1
kernel_gateway/services/kernels/pool.py
python
ManagedKernelPool.release
(self, kernel_id)
Puts a kernel back into the pool of kernels available to handle requests. Parameters ---------- kernel_id : str Kernel to return to the pool
Puts a kernel back into the pool of kernels available to handle requests.
[ "Puts", "a", "kernel", "back", "into", "the", "pool", "of", "kernels", "available", "to", "handle", "requests", "." ]
def release(self, kernel_id): """Puts a kernel back into the pool of kernels available to handle requests. Parameters ---------- kernel_id : str Kernel to return to the pool """ self.kernel_pool.append(kernel_id) self.kernel_semaphore.release(...
[ "def", "release", "(", "self", ",", "kernel_id", ")", ":", "self", ".", "kernel_pool", ".", "append", "(", "kernel_id", ")", "self", ".", "kernel_semaphore", ".", "release", "(", ")" ]
https://github.com/jupyter/kernel_gateway/blob/440fef1cd29c829e2141bb4c76ed5f9572b428e1/kernel_gateway/services/kernels/pool.py#L100-L110
python/cpython
e13cdca0f5224ec4e23bdd04bb3120506964bc8b
Lib/idlelib/colorizer.py
python
ColorDelegator.recolorize_main
(self)
Evaluate text and apply colorizing tags.
Evaluate text and apply colorizing tags.
[ "Evaluate", "text", "and", "apply", "colorizing", "tags", "." ]
def recolorize_main(self): "Evaluate text and apply colorizing tags." next = "1.0" while todo_tag_range := self.tag_nextrange("TODO", next): self.tag_remove("SYNC", todo_tag_range[0], todo_tag_range[1]) sync_tag_range = self.tag_prevrange("SYNC", todo_tag_range[0]) ...
[ "def", "recolorize_main", "(", "self", ")", ":", "next", "=", "\"1.0\"", "while", "todo_tag_range", ":=", "self", ".", "tag_nextrange", "(", "\"TODO\"", ",", "next", ")", ":", "self", ".", "tag_remove", "(", "\"SYNC\"", ",", "todo_tag_range", "[", "0", "]"...
https://github.com/python/cpython/blob/e13cdca0f5224ec4e23bdd04bb3120506964bc8b/Lib/idlelib/colorizer.py#L274-L316
PowerScript/KatanaFramework
0f6ad90a88de865d58ec26941cb4460501e75496
lib/scapy/scapy/contrib/gsm_um.py
python
partialRelease
()
return packet
PARTIAL RELEASE Section 9.1.26
PARTIAL RELEASE Section 9.1.26
[ "PARTIAL", "RELEASE", "Section", "9", ".", "1", ".", "26" ]
def partialRelease(): """PARTIAL RELEASE Section 9.1.26""" a = TpPd(pd=0x6) b = MessageType(mesType=0xa) # 00001010 c = ChannelDescription() packet = a / b / c return packet
[ "def", "partialRelease", "(", ")", ":", "a", "=", "TpPd", "(", "pd", "=", "0x6", ")", "b", "=", "MessageType", "(", "mesType", "=", "0xa", ")", "# 00001010", "c", "=", "ChannelDescription", "(", ")", "packet", "=", "a", "/", "b", "/", "c", "return"...
https://github.com/PowerScript/KatanaFramework/blob/0f6ad90a88de865d58ec26941cb4460501e75496/lib/scapy/scapy/contrib/gsm_um.py#L914-L920
sfepy/sfepy
02ec7bb2ab39ee1dfe1eb4cd509f0ffb7dcc8b25
examples/diffusion/laplace_iga_interactive.py
python
create_patch
(R1, R2, C1, C2, order=2, viewpatch=False)
Create a single 2d NURBS-patch of the area between two coplanar nested circles using igakit. Parameters ---------- R1 : float Radius of the inner circle. R2 : float Radius of the outer circle. C1 : list of two floats Coordinates of the center of the inner circle given as...
Create a single 2d NURBS-patch of the area between two coplanar nested circles using igakit.
[ "Create", "a", "single", "2d", "NURBS", "-", "patch", "of", "the", "area", "between", "two", "coplanar", "nested", "circles", "using", "igakit", "." ]
def create_patch(R1, R2, C1, C2, order=2, viewpatch=False): """ Create a single 2d NURBS-patch of the area between two coplanar nested circles using igakit. Parameters ---------- R1 : float Radius of the inner circle. R2 : float Radius of the outer circle. C1 : list of t...
[ "def", "create_patch", "(", "R1", ",", "R2", ",", "C1", ",", "C2", ",", "order", "=", "2", ",", "viewpatch", "=", "False", ")", ":", "from", "sfepy", ".", "discrete", ".", "iga", ".", "domain_generators", "import", "create_from_igakit", "import", "sfepy"...
https://github.com/sfepy/sfepy/blob/02ec7bb2ab39ee1dfe1eb4cd509f0ffb7dcc8b25/examples/diffusion/laplace_iga_interactive.py#L58-L133