nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/operator.py | python | imatmul | (a, b) | return a | Same as a @= b. | Same as a | [
"Same",
"as",
"a"
] | def imatmul(a, b):
"Same as a @= b."
a @= b
return a | [
"def",
"imatmul",
"(",
"a",
",",
"b",
")",
":",
"a",
"@=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/operator.py#L375-L378 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | libcxx/utils/gdb/libcxx/printers.py | python | StdStringPrinter._get_short_size | (self, short_field, short_size) | Short size depends on both endianness and a compile-time define. | Short size depends on both endianness and a compile-time define. | [
"Short",
"size",
"depends",
"on",
"both",
"endianness",
"and",
"a",
"compile",
"-",
"time",
"define",
"."
] | def _get_short_size(self, short_field, short_size):
"""Short size depends on both endianness and a compile-time define."""
# If the padding field is present after all this indirection, then string
# was compiled with _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT defined.
field = short_field.type.... | [
"def",
"_get_short_size",
"(",
"self",
",",
"short_field",
",",
"short_size",
")",
":",
"# If the padding field is present after all this indirection, then string",
"# was compiled with _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT defined.",
"field",
"=",
"short_field",
".",
"type",
".",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/libcxx/utils/gdb/libcxx/printers.py#L195-L213 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | VersionInfo.ToString | (*args, **kwargs) | return _core_.VersionInfo_ToString(*args, **kwargs) | ToString(self) -> String | ToString(self) -> String | [
"ToString",
"(",
"self",
")",
"-",
">",
"String"
] | def ToString(*args, **kwargs):
"""ToString(self) -> String"""
return _core_.VersionInfo_ToString(*args, **kwargs) | [
"def",
"ToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"VersionInfo_ToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L16581-L16583 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/third_party/Python/module/pexpect-2.4/screen.py | python | screen.crlf | (self) | This advances the cursor with CRLF properties.
The cursor will line wrap and the screen may scroll. | This advances the cursor with CRLF properties.
The cursor will line wrap and the screen may scroll. | [
"This",
"advances",
"the",
"cursor",
"with",
"CRLF",
"properties",
".",
"The",
"cursor",
"will",
"line",
"wrap",
"and",
"the",
"screen",
"may",
"scroll",
"."
] | def crlf(self):
"""This advances the cursor with CRLF properties.
The cursor will line wrap and the screen may scroll.
"""
self.cr()
self.lf() | [
"def",
"crlf",
"(",
"self",
")",
":",
"self",
".",
"cr",
"(",
")",
"self",
".",
"lf",
"(",
")"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/screen.py#L117-L123 | ||
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/enumerations/enumeratedclasses.py | python | EnumeratedClass.string | (self) | return self.string_ | Return the string identifying this enumeration. | Return the string identifying this enumeration. | [
"Return",
"the",
"string",
"identifying",
"this",
"enumeration",
"."
] | def string(self):
"""Return the string identifying this enumeration."""
return self.string_ | [
"def",
"string",
"(",
"self",
")",
":",
"return",
"self",
".",
"string_"
] | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/enumerations/enumeratedclasses.py#L39-L41 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/nntplib.py | python | NNTP._putline | (self, line) | Internal: send one line to the server, appending CRLF.
The `line` must be a bytes-like object. | Internal: send one line to the server, appending CRLF.
The `line` must be a bytes-like object. | [
"Internal",
":",
"send",
"one",
"line",
"to",
"the",
"server",
"appending",
"CRLF",
".",
"The",
"line",
"must",
"be",
"a",
"bytes",
"-",
"like",
"object",
"."
] | def _putline(self, line):
"""Internal: send one line to the server, appending CRLF.
The `line` must be a bytes-like object."""
sys.audit("nntplib.putline", self, line)
line = line + _CRLF
if self.debugging > 1: print('*put*', repr(line))
self.file.write(line)
self... | [
"def",
"_putline",
"(",
"self",
",",
"line",
")",
":",
"sys",
".",
"audit",
"(",
"\"nntplib.putline\"",
",",
"self",
",",
"line",
")",
"line",
"=",
"line",
"+",
"_CRLF",
"if",
"self",
".",
"debugging",
">",
"1",
":",
"print",
"(",
"'*put*'",
",",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/nntplib.py#L441-L448 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/gui/DirectFrame.py | python | DirectFrame.__reinitComponent | (self, name, component_class, states, **kwargs) | Recreates the given component using the given keyword args. | Recreates the given component using the given keyword args. | [
"Recreates",
"the",
"given",
"component",
"using",
"the",
"given",
"keyword",
"args",
"."
] | def __reinitComponent(self, name, component_class, states, **kwargs):
"""Recreates the given component using the given keyword args."""
assert name in ("geom", "image", "text")
# constants should be local to or default arguments of constructors
for c in range(self['numStates']):
... | [
"def",
"__reinitComponent",
"(",
"self",
",",
"name",
",",
"component_class",
",",
"states",
",",
"*",
"*",
"kwargs",
")",
":",
"assert",
"name",
"in",
"(",
"\"geom\"",
",",
"\"image\"",
",",
"\"text\"",
")",
"# constants should be local to or default arguments of... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/gui/DirectFrame.py#L60-L91 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/difflib.py | python | get_close_matches | (word, possibilities, n=3, cutoff=0.6) | return [x for score, x in result] | Use SequenceMatcher to return list of the best "good enough" matches.
word is a sequence for which close matches are desired (typically a
string).
possibilities is a list of sequences against which to match word
(typically a list of strings).
Optional arg n (default 3) is the maximum number of cl... | Use SequenceMatcher to return list of the best "good enough" matches. | [
"Use",
"SequenceMatcher",
"to",
"return",
"list",
"of",
"the",
"best",
"good",
"enough",
"matches",
"."
] | def get_close_matches(word, possibilities, n=3, cutoff=0.6):
"""Use SequenceMatcher to return list of the best "good enough" matches.
word is a sequence for which close matches are desired (typically a
string).
possibilities is a list of sequences against which to match word
(typically a list of s... | [
"def",
"get_close_matches",
"(",
"word",
",",
"possibilities",
",",
"n",
"=",
"3",
",",
"cutoff",
"=",
"0.6",
")",
":",
"if",
"not",
"n",
">",
"0",
":",
"raise",
"ValueError",
"(",
"\"n must be > 0: %r\"",
"%",
"(",
"n",
",",
")",
")",
"if",
"not",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/difflib.py#L704-L750 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/bandit/data_containers.py | python | HistoricalData.json_payload | (self) | return {'arms_sampled': json_arms_sampled} | Construct a json serializeable and MOE REST recognizeable dictionary of the historical data. | Construct a json serializeable and MOE REST recognizeable dictionary of the historical data. | [
"Construct",
"a",
"json",
"serializeable",
"and",
"MOE",
"REST",
"recognizeable",
"dictionary",
"of",
"the",
"historical",
"data",
"."
] | def json_payload(self):
"""Construct a json serializeable and MOE REST recognizeable dictionary of the historical data."""
json_arms_sampled = {}
for name, arm in self._arms_sampled.iteritems():
json_arms_sampled[name] = arm.json_payload()
return {'arms_sampled': json_arms_sa... | [
"def",
"json_payload",
"(",
"self",
")",
":",
"json_arms_sampled",
"=",
"{",
"}",
"for",
"name",
",",
"arm",
"in",
"self",
".",
"_arms_sampled",
".",
"iteritems",
"(",
")",
":",
"json_arms_sampled",
"[",
"name",
"]",
"=",
"arm",
".",
"json_payload",
"(",... | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/bandit/data_containers.py#L202-L207 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/handlers.py | python | BaseHandler.run | (self, application) | Invoke the application | Invoke the application | [
"Invoke",
"the",
"application"
] | def run(self, application):
"""Invoke the application"""
# Note to self: don't move the close()! Asynchronous servers shouldn't
# call close() from finish_response(), so if you close() anywhere but
# the double-error branch here, you'll break asynchronous servers by
# prematurel... | [
"def",
"run",
"(",
"self",
",",
"application",
")",
":",
"# Note to self: don't move the close()! Asynchronous servers shouldn't",
"# call close() from finish_response(), so if you close() anywhere but",
"# the double-error branch here, you'll break asynchronous servers by",
"# prematurely cl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/handlers.py#L128-L149 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py | python | _format_optdict | (optdict, script=False, ignore=None) | return _flatten(opts) | Formats optdict to a tuple to pass it to tk.call.
E.g. (script=False):
{'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
('-foreground', 'blue', '-padding', '1 2 3 4') | Formats optdict to a tuple to pass it to tk.call. | [
"Formats",
"optdict",
"to",
"a",
"tuple",
"to",
"pass",
"it",
"to",
"tk",
".",
"call",
"."
] | def _format_optdict(optdict, script=False, ignore=None):
"""Formats optdict to a tuple to pass it to tk.call.
E.g. (script=False):
{'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
('-foreground', 'blue', '-padding', '1 2 3 4')"""
opts = []
for opt, value in optdict.items():
... | [
"def",
"_format_optdict",
"(",
"optdict",
",",
"script",
"=",
"False",
",",
"ignore",
"=",
"None",
")",
":",
"opts",
"=",
"[",
"]",
"for",
"opt",
",",
"value",
"in",
"optdict",
".",
"items",
"(",
")",
":",
"if",
"not",
"ignore",
"or",
"opt",
"not",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py#L61-L75 | |
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/python/caffe/detector.py | python | Detector.configure_crop | (self, context_pad) | Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding.
Parameters
----------
context_pad : amount of context for cropping. | Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding. | [
"Configure",
"crop",
"dimensions",
"and",
"amount",
"of",
"context",
"for",
"cropping",
".",
"If",
"context",
"is",
"included",
"make",
"the",
"special",
"input",
"mean",
"for",
"context",
"padding",
"."
] | def configure_crop(self, context_pad):
"""
Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding.
Parameters
----------
context_pad : amount of context for cropping.
"""
# cro... | [
"def",
"configure_crop",
"(",
"self",
",",
"context_pad",
")",
":",
"# crop dimensions",
"in_",
"=",
"self",
".",
"inputs",
"[",
"0",
"]",
"tpose",
"=",
"self",
".",
"transformer",
".",
"transpose",
"[",
"in_",
"]",
"inv_tpose",
"=",
"[",
"tpose",
"[",
... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/python/caffe/detector.py#L181-L216 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/xcode_ninja.py | python | _TargetFromSpec | (old_spec, params) | return ninja_target | Create fake target for xcode-ninja wrapper. | Create fake target for xcode-ninja wrapper. | [
"Create",
"fake",
"target",
"for",
"xcode",
"-",
"ninja",
"wrapper",
"."
] | def _TargetFromSpec(old_spec, params):
""" Create fake target for xcode-ninja wrapper. """
# Determine ninja top level build dir (e.g. /path/to/out).
ninja_toplevel = None
jobs = 0
if params:
options = params['options']
ninja_toplevel = \
os.path.join(options.toplevel_dir,
... | [
"def",
"_TargetFromSpec",
"(",
"old_spec",
",",
"params",
")",
":",
"# Determine ninja top level build dir (e.g. /path/to/out).",
"ninja_toplevel",
"=",
"None",
"jobs",
"=",
"0",
"if",
"params",
":",
"options",
"=",
"params",
"[",
"'options'",
"]",
"ninja_toplevel",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcode_ninja.py#L56-L129 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | NLP/parser.py | python | dobj_dependence | (row) | dependence type is direct obj, predicate is a verb and object is a noun
:param row: (('dog', 'NN'), 'case', ('over', 'IN'))
:return: True or False | dependence type is direct obj, predicate is a verb and object is a noun
:param row: (('dog', 'NN'), 'case', ('over', 'IN'))
:return: True or False | [
"dependence",
"type",
"is",
"direct",
"obj",
"predicate",
"is",
"a",
"verb",
"and",
"object",
"is",
"a",
"noun",
":",
"param",
"row",
":",
"((",
"dog",
"NN",
")",
"case",
"(",
"over",
"IN",
"))",
":",
"return",
":",
"True",
"or",
"False"
] | def dobj_dependence(row):
"""
dependence type is direct obj, predicate is a verb and object is a noun
:param row: (('dog', 'NN'), 'case', ('over', 'IN'))
:return: True or False
"""
if row[1] == "dobj" and "V" in row[0][1] and "NN" in row[2][1]:
print(row)
return True
else:
... | [
"def",
"dobj_dependence",
"(",
"row",
")",
":",
"if",
"row",
"[",
"1",
"]",
"==",
"\"dobj\"",
"and",
"\"V\"",
"in",
"row",
"[",
"0",
"]",
"[",
"1",
"]",
"and",
"\"NN\"",
"in",
"row",
"[",
"2",
"]",
"[",
"1",
"]",
":",
"print",
"(",
"row",
")"... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/NLP/parser.py#L58-L68 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Sizer.ComputeFittingClientSize | (*args, **kwargs) | return _core_.Sizer_ComputeFittingClientSize(*args, **kwargs) | ComputeFittingClientSize(self, Window window) -> Size
Computes client area size for ``window`` so that it matches the
sizer's minimal size. Unlike `GetMinSize`, this method accounts for
other constraints imposed on ``window``, namely display's size
(returned size will never be too large... | ComputeFittingClientSize(self, Window window) -> Size | [
"ComputeFittingClientSize",
"(",
"self",
"Window",
"window",
")",
"-",
">",
"Size"
] | def ComputeFittingClientSize(*args, **kwargs):
"""
ComputeFittingClientSize(self, Window window) -> Size
Computes client area size for ``window`` so that it matches the
sizer's minimal size. Unlike `GetMinSize`, this method accounts for
other constraints imposed on ``window``, n... | [
"def",
"ComputeFittingClientSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_ComputeFittingClientSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L14848-L14861 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/examples/python/diagnose_unwind.py | python | diagnose_unwind | (debugger, command, result, dict) | Gather diagnostic information to help debug incorrect unwind (backtrace)
behavior in lldb. When there is a backtrace that doesn't look
correct, run this command with the correct thread selected and a
large amount of diagnostic information will be printed, it is likely
to be helpful when reporting the problem. | Gather diagnostic information to help debug incorrect unwind (backtrace)
behavior in lldb. When there is a backtrace that doesn't look
correct, run this command with the correct thread selected and a
large amount of diagnostic information will be printed, it is likely
to be helpful when reporting the problem. | [
"Gather",
"diagnostic",
"information",
"to",
"help",
"debug",
"incorrect",
"unwind",
"(",
"backtrace",
")",
"behavior",
"in",
"lldb",
".",
"When",
"there",
"is",
"a",
"backtrace",
"that",
"doesn",
"t",
"look",
"correct",
"run",
"this",
"command",
"with",
"th... | def diagnose_unwind(debugger, command, result, dict):
"""
Gather diagnostic information to help debug incorrect unwind (backtrace)
behavior in lldb. When there is a backtrace that doesn't look
correct, run this command with the correct thread selected and a
large amount of diagnostic information will be pr... | [
"def",
"diagnose_unwind",
"(",
"debugger",
",",
"command",
",",
"result",
",",
"dict",
")",
":",
"command_args",
"=",
"shlex",
".",
"split",
"(",
"command",
")",
"parser",
"=",
"create_diagnose_unwind_options",
"(",
")",
"try",
":",
"(",
"options",
",",
"a... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/examples/python/diagnose_unwind.py#L147-L298 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/tpu/python/tpu/tpu_function.py | python | check_function_argument_count | (func, input_arity, infeed_queue) | return None | Validate the number of input arguments to a tpu function.
Args:
func: the Python function that will be called to generate the body
of a TPUFunction.
input_arity: the number of explicit arguments supplied by the
caller.
infeed_queue: if not None, the infeed queue that will supply
additio... | Validate the number of input arguments to a tpu function. | [
"Validate",
"the",
"number",
"of",
"input",
"arguments",
"to",
"a",
"tpu",
"function",
"."
] | def check_function_argument_count(func, input_arity, infeed_queue):
"""Validate the number of input arguments to a tpu function.
Args:
func: the Python function that will be called to generate the body
of a TPUFunction.
input_arity: the number of explicit arguments supplied by the
caller.
i... | [
"def",
"check_function_argument_count",
"(",
"func",
",",
"input_arity",
",",
"infeed_queue",
")",
":",
"def",
"format_error",
"(",
"complaint",
",",
"quantity",
")",
":",
"return",
"\"%s %d argument%s\"",
"%",
"(",
"complaint",
",",
"quantity",
",",
"\"\"",
"if... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/tpu/python/tpu/tpu_function.py#L62-L105 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | FWCore/ParameterSet/python/Config.py | python | Process.extend | (self,other,items=()) | Look in other and find types that we can use | Look in other and find types that we can use | [
"Look",
"in",
"other",
"and",
"find",
"types",
"that",
"we",
"can",
"use"
] | def extend(self,other,items=()):
"""Look in other and find types that we can use"""
# enable explicit check to avoid overwriting of existing objects
self.__dict__['_Process__InExtendCall'] = True
seqs = dict()
tasksToAttach = dict()
mods = []
for name in dir(othe... | [
"def",
"extend",
"(",
"self",
",",
"other",
",",
"items",
"=",
"(",
")",
")",
":",
"# enable explicit check to avoid overwriting of existing objects",
"self",
".",
"__dict__",
"[",
"'_Process__InExtendCall'",
"]",
"=",
"True",
"seqs",
"=",
"dict",
"(",
")",
"tas... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Config.py#L715-L767 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/internal/charmm/topologyobjects.py | python | _CmapGrid.transpose | (self) | return self._transpose | Returns the transpose of the grid | Returns the transpose of the grid | [
"Returns",
"the",
"transpose",
"of",
"the",
"grid"
] | def transpose(self):
""" Returns the transpose of the grid """
try:
return self._transpose
except AttributeError:
pass
_transpose = []
size = len(self._data)
for i in range(self.resolution):
piece = [self[j] for j in range(i, size, self... | [
"def",
"transpose",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_transpose",
"except",
"AttributeError",
":",
"pass",
"_transpose",
"=",
"[",
"]",
"size",
"=",
"len",
"(",
"self",
".",
"_data",
")",
"for",
"i",
"in",
"range",
"(",
"sel... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/internal/charmm/topologyobjects.py#L1176-L1188 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/clang/cindex.py | python | TranslationUnit.get_extent | (self, filename, locations) | return SourceRange.from_locations(start_location, end_location) | Obtain a SourceRange from this translation unit.
The bounds of the SourceRange must ultimately be defined by a start and
end SourceLocation. For the locations argument, you can pass:
- 2 SourceLocation instances in a 2-tuple or list.
- 2 int file offsets via a 2-tuple or list.
... | Obtain a SourceRange from this translation unit. | [
"Obtain",
"a",
"SourceRange",
"from",
"this",
"translation",
"unit",
"."
] | def get_extent(self, filename, locations):
"""Obtain a SourceRange from this translation unit.
The bounds of the SourceRange must ultimately be defined by a start and
end SourceLocation. For the locations argument, you can pass:
- 2 SourceLocation instances in a 2-tuple or list.
... | [
"def",
"get_extent",
"(",
"self",
",",
"filename",
",",
"locations",
")",
":",
"f",
"=",
"self",
".",
"get_file",
"(",
"filename",
")",
"if",
"len",
"(",
"locations",
")",
"<",
"2",
":",
"raise",
"Exception",
"(",
"'Must pass object with at least 2 elements'... | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L2311-L2349 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | libcxx/utils/libcxx/util.py | python | killProcessAndChildren | (pid) | This function kills a process with ``pid`` and all its
running children (recursively). It is currently implemented
using the psutil module which provides a simple platform
neutral implementation.
TODO: Reimplement this without using psutil so we can
remove our dependency on it. | This function kills a process with ``pid`` and all its
running children (recursively). It is currently implemented
using the psutil module which provides a simple platform
neutral implementation. | [
"This",
"function",
"kills",
"a",
"process",
"with",
"pid",
"and",
"all",
"its",
"running",
"children",
"(",
"recursively",
")",
".",
"It",
"is",
"currently",
"implemented",
"using",
"the",
"psutil",
"module",
"which",
"provides",
"a",
"simple",
"platform",
... | def killProcessAndChildren(pid):
"""
This function kills a process with ``pid`` and all its
running children (recursively). It is currently implemented
using the psutil module which provides a simple platform
neutral implementation.
TODO: Reimplement this without using psutil so we can
... | [
"def",
"killProcessAndChildren",
"(",
"pid",
")",
":",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"'AIX'",
":",
"subprocess",
".",
"call",
"(",
"'kill -kill $(ps -o pid= -L{})'",
".",
"format",
"(",
"pid",
")",
",",
"shell",
"=",
"True",
")",
"else",... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/libcxx/utils/libcxx/util.py#L246-L276 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py | python | rshift | (a, b) | return a >> b | Same as a >> b. | Same as a >> b. | [
"Same",
"as",
"a",
">>",
"b",
"."
] | def rshift(a, b):
"Same as a >> b."
return a >> b | [
"def",
"rshift",
"(",
"a",
",",
"b",
")",
":",
"return",
"a",
">>",
"b"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py#L128-L130 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | python | VimPane.prepare | (self, method='new') | check window is OK, if not then create | check window is OK, if not then create | [
"check",
"window",
"is",
"OK",
"if",
"not",
"then",
"create"
] | def prepare(self, method='new'):
""" check window is OK, if not then create """
if not self.isPrepared():
self.create(method) | [
"def",
"prepare",
"(",
"self",
",",
"method",
"=",
"'new'",
")",
":",
"if",
"not",
"self",
".",
"isPrepared",
"(",
")",
":",
"self",
".",
"create",
"(",
"method",
")"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L260-L263 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans.py | python | KMeansClustering.predict | (self, x, batch_size=None) | return super(KMeansClustering, self).predict(
x=x, batch_size=batch_size)[KMeansClustering.CLUSTER_IDX] | Predict cluster id for each element in x.
Args:
x: 2-D matrix or iterator.
batch_size: size to use for batching up x for querying the model.
Returns:
Array with same number of rows as x, containing cluster ids. | Predict cluster id for each element in x. | [
"Predict",
"cluster",
"id",
"for",
"each",
"element",
"in",
"x",
"."
] | def predict(self, x, batch_size=None):
"""Predict cluster id for each element in x.
Args:
x: 2-D matrix or iterator.
batch_size: size to use for batching up x for querying the model.
Returns:
Array with same number of rows as x, containing cluster ids.
"""
return super(KMeansClus... | [
"def",
"predict",
"(",
"self",
",",
"x",
",",
"batch_size",
"=",
"None",
")",
":",
"return",
"super",
"(",
"KMeansClustering",
",",
"self",
")",
".",
"predict",
"(",
"x",
"=",
"x",
",",
"batch_size",
"=",
"batch_size",
")",
"[",
"KMeansClustering",
"."... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans.py#L170-L181 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibar.py | python | AuiToolBar.GetLabelSize | (self, label) | return GetLabelSize(dc, label, self._tool_orientation != AUI_TBTOOL_HORIZONTAL) | Returns the standard size of a toolbar item.
:param string `label`: a test label. | Returns the standard size of a toolbar item. | [
"Returns",
"the",
"standard",
"size",
"of",
"a",
"toolbar",
"item",
"."
] | def GetLabelSize(self, label):
"""
Returns the standard size of a toolbar item.
:param string `label`: a test label.
"""
dc = wx.ClientDC(self)
dc.SetFont(self._font)
return GetLabelSize(dc, label, self._tool_orientation != AUI_TBTOOL_HORIZONTAL) | [
"def",
"GetLabelSize",
"(",
"self",
",",
"label",
")",
":",
"dc",
"=",
"wx",
".",
"ClientDC",
"(",
"self",
")",
"dc",
".",
"SetFont",
"(",
"self",
".",
"_font",
")",
"return",
"GetLabelSize",
"(",
"dc",
",",
"label",
",",
"self",
".",
"_tool_orientat... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L3211-L3221 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/cephadm/services/cephadmservice.py | python | CephadmService.purge | (self, service_name: str) | Called to carry out any purge tasks following service removal | Called to carry out any purge tasks following service removal | [
"Called",
"to",
"carry",
"out",
"any",
"purge",
"tasks",
"following",
"service",
"removal"
] | def purge(self, service_name: str) -> None:
"""Called to carry out any purge tasks following service removal"""
logger.debug(f'Purge called for {self.TYPE} - no action taken') | [
"def",
"purge",
"(",
"self",
",",
"service_name",
":",
"str",
")",
"->",
"None",
":",
"logger",
".",
"debug",
"(",
"f'Purge called for {self.TYPE} - no action taken'",
")"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/cephadm/services/cephadmservice.py#L423-L425 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/cef_parser.py | python | obj_class.get_attrib | (self, name) | return None | Return the first or only value for specified attribute. | Return the first or only value for specified attribute. | [
"Return",
"the",
"first",
"or",
"only",
"value",
"for",
"specified",
"attribute",
"."
] | def get_attrib(self, name):
""" Return the first or only value for specified attribute. """
if name in self.attribs:
if isinstance(self.attribs[name], list):
# the value is a list
return self.attribs[name][0]
else:
# the value is a string
return self.attribs[name]
... | [
"def",
"get_attrib",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"in",
"self",
".",
"attribs",
":",
"if",
"isinstance",
"(",
"self",
".",
"attribs",
"[",
"name",
"]",
",",
"list",
")",
":",
"# the value is a list",
"return",
"self",
".",
"attribs... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L976-L985 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/graph.py | python | DirectedGraph.Edges | (self) | return self._edges | Returns the set of edges of this graph. | Returns the set of edges of this graph. | [
"Returns",
"the",
"set",
"of",
"edges",
"of",
"this",
"graph",
"."
] | def Edges(self):
"""Returns the set of edges of this graph."""
return self._edges | [
"def",
"Edges",
"(",
"self",
")",
":",
"return",
"self",
".",
"_edges"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/graph.py#L98-L100 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ipaddress.py | python | _find_address_range | (addresses) | Find a sequence of sorted deduplicated IPv#Address.
Args:
addresses: a list of IPv#Address objects.
Yields:
A tuple containing the first and last IP addresses in the sequence. | Find a sequence of sorted deduplicated IPv#Address. | [
"Find",
"a",
"sequence",
"of",
"sorted",
"deduplicated",
"IPv#Address",
"."
] | def _find_address_range(addresses):
"""Find a sequence of sorted deduplicated IPv#Address.
Args:
addresses: a list of IPv#Address objects.
Yields:
A tuple containing the first and last IP addresses in the sequence.
"""
it = iter(addresses)
first = last = next(it)
for ip in... | [
"def",
"_find_address_range",
"(",
"addresses",
")",
":",
"it",
"=",
"iter",
"(",
"addresses",
")",
"first",
"=",
"last",
"=",
"next",
"(",
"it",
")",
"for",
"ip",
"in",
"it",
":",
"if",
"ip",
".",
"_ip",
"!=",
"last",
".",
"_ip",
"+",
"1",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ipaddress.py#L166-L183 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/latex.py | python | TableBuilderAbstract.env_body | (self) | Environment body. | Environment body. | [
"Environment",
"body",
"."
] | def env_body(self) -> str:
"""Environment body.""" | [
"def",
"env_body",
"(",
"self",
")",
"->",
"str",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/latex.py#L388-L389 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/closure_compiler/compile2.py | python | Checker._log_debug | (self, msg, error=False) | Logs |msg| to stdout if --verbose/-v is passed when invoking this script.
Args:
msg: A debug message to log. | Logs |msg| to stdout if --verbose/-v is passed when invoking this script. | [
"Logs",
"|msg|",
"to",
"stdout",
"if",
"--",
"verbose",
"/",
"-",
"v",
"is",
"passed",
"when",
"invoking",
"this",
"script",
"."
] | def _log_debug(self, msg, error=False):
"""Logs |msg| to stdout if --verbose/-v is passed when invoking this script.
Args:
msg: A debug message to log.
"""
if self._verbose:
print "(INFO) %s" % msg | [
"def",
"_log_debug",
"(",
"self",
",",
"msg",
",",
"error",
"=",
"False",
")",
":",
"if",
"self",
".",
"_verbose",
":",
"print",
"\"(INFO) %s\"",
"%",
"msg"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/closure_compiler/compile2.py#L62-L69 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/mgr/dashboard/helper.py | python | DashboardTestCase.create_user | (cls, username, password, roles=None,
force_password=True, cmd_args=None) | :param username: The name of the user.
:type username: str
:param password: The password.
:type password: str
:param roles: A list of roles.
:type roles: list
:param force_password: Force the use of the specified password. This
will bypass the password complexit... | :param username: The name of the user.
:type username: str
:param password: The password.
:type password: str
:param roles: A list of roles.
:type roles: list
:param force_password: Force the use of the specified password. This
will bypass the password complexit... | [
":",
"param",
"username",
":",
"The",
"name",
"of",
"the",
"user",
".",
":",
"type",
"username",
":",
"str",
":",
"param",
"password",
":",
"The",
"password",
".",
":",
"type",
"password",
":",
"str",
":",
"param",
"roles",
":",
"A",
"list",
"of",
... | def create_user(cls, username, password, roles=None,
force_password=True, cmd_args=None):
# pylint: disable=too-many-arguments
"""
:param username: The name of the user.
:type username: str
:param password: The password.
:type password: str
:pa... | [
"def",
"create_user",
"(",
"cls",
",",
"username",
",",
"password",
",",
"roles",
"=",
"None",
",",
"force_password",
"=",
"True",
",",
"cmd_args",
"=",
"None",
")",
":",
"# pylint: disable=too-many-arguments",
"try",
":",
"cls",
".",
"_ceph_cmd",
"(",
"[",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/mgr/dashboard/helper.py#L93-L145 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/hashing.py | python | hash | (obj, hash_name='md5', coerce_mmap=False) | return hasher.hash(obj) | Quick calculation of a hash to identify uniquely Python objects
containing numpy arrays.
Parameters
-----------
hash_name: 'md5' or 'sha1'
Hashing algorithm used. sha1 is supposedly safer, but md5 is
faster.
coerce_mmap: boolean
Make no diffe... | Quick calculation of a hash to identify uniquely Python objects
containing numpy arrays. | [
"Quick",
"calculation",
"of",
"a",
"hash",
"to",
"identify",
"uniquely",
"Python",
"objects",
"containing",
"numpy",
"arrays",
"."
] | def hash(obj, hash_name='md5', coerce_mmap=False):
""" Quick calculation of a hash to identify uniquely Python objects
containing numpy arrays.
Parameters
-----------
hash_name: 'md5' or 'sha1'
Hashing algorithm used. sha1 is supposedly safer, but md5 is
fas... | [
"def",
"hash",
"(",
"obj",
",",
"hash_name",
"=",
"'md5'",
",",
"coerce_mmap",
"=",
"False",
")",
":",
"valid_hash_names",
"=",
"(",
"'md5'",
",",
"'sha1'",
")",
"if",
"hash_name",
"not",
"in",
"valid_hash_names",
":",
"raise",
"ValueError",
"(",
"\"Valid ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/hashing.py#L244-L266 | |
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | scripts/cpp_lint.py | python | _CppLintState.SetVerboseLevel | (self, level) | return last_verbose_level | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def SetVerboseLevel(self, level):
"""Sets the module's verbosity, and returns the previous setting."""
last_verbose_level = self.verbose_level
self.verbose_level = level
return last_verbose_level | [
"def",
"SetVerboseLevel",
"(",
"self",
",",
"level",
")",
":",
"last_verbose_level",
"=",
"self",
".",
"verbose_level",
"self",
".",
"verbose_level",
"=",
"level",
"return",
"last_verbose_level"
] | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/scripts/cpp_lint.py#L707-L711 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | BucketPointerArgument.GetLogArg | (self) | return "static_cast<const void*>(%s)" % self.name | Overridden from Argument. | Overridden from Argument. | [
"Overridden",
"from",
"Argument",
"."
] | def GetLogArg(self):
"""Overridden from Argument."""
return "static_cast<const void*>(%s)" % self.name | [
"def",
"GetLogArg",
"(",
"self",
")",
":",
"return",
"\"static_cast<const void*>(%s)\"",
"%",
"self",
".",
"name"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L6134-L6136 | |
nasa/meshNetwork | ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c | python/mesh/generic/slipMsg_li1.py | python | SLIPmsg_Li1.decodeSLIPmsgContents | (self, byteList, pos) | Helper function to strip special SLIP bytes from identified SLIP message.
Args:
byteList: Raw serial data array.
pos: Array position of start of SLIP message in raw serial data. | Helper function to strip special SLIP bytes from identified SLIP message. | [
"Helper",
"function",
"to",
"strip",
"special",
"SLIP",
"bytes",
"from",
"identified",
"SLIP",
"message",
"."
] | def decodeSLIPmsgContents(self, byteList, pos):
"""Helper function to strip special SLIP bytes from identified SLIP message.
Args:
byteList: Raw serial data array.
pos: Array position of start of SLIP message in raw serial data.
"""
while pos < len(byteList) and... | [
"def",
"decodeSLIPmsgContents",
"(",
"self",
",",
"byteList",
",",
"pos",
")",
":",
"while",
"pos",
"<",
"len",
"(",
"byteList",
")",
"and",
"len",
"(",
"self",
".",
"msg",
")",
"<",
"self",
".",
"msgMaxLength",
":",
"byte",
"=",
"byteList",
"[",
"po... | https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/slipMsg_li1.py#L70-L107 | ||
fastmachinelearning/hls4ml | 58d761006250deed721d85fefea91201708f2165 | hls4ml/model/graph.py | python | ModelGraph.compile | (self) | Compile the generated project and link the library into current environment.
Users should call this function if they want to use `predict` functionality for simulation. | Compile the generated project and link the library into current environment. | [
"Compile",
"the",
"generated",
"project",
"and",
"link",
"the",
"library",
"into",
"current",
"environment",
"."
] | def compile(self):
"""Compile the generated project and link the library into current environment.
Users should call this function if they want to use `predict` functionality for simulation.
"""
self.write()
lib_name = self.config.backend.compile(self)
if self._top_func... | [
"def",
"compile",
"(",
"self",
")",
":",
"self",
".",
"write",
"(",
")",
"lib_name",
"=",
"self",
".",
"config",
".",
"backend",
".",
"compile",
"(",
"self",
")",
"if",
"self",
".",
"_top_function_lib",
"is",
"not",
"None",
":",
"if",
"platform",
"."... | https://github.com/fastmachinelearning/hls4ml/blob/58d761006250deed721d85fefea91201708f2165/hls4ml/model/graph.py#L561-L579 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.GetPrintMagnification | (*args, **kwargs) | return _stc.StyledTextCtrl_GetPrintMagnification(*args, **kwargs) | GetPrintMagnification(self) -> int
Returns the print magnification. | GetPrintMagnification(self) -> int | [
"GetPrintMagnification",
"(",
"self",
")",
"-",
">",
"int"
] | def GetPrintMagnification(*args, **kwargs):
"""
GetPrintMagnification(self) -> int
Returns the print magnification.
"""
return _stc.StyledTextCtrl_GetPrintMagnification(*args, **kwargs) | [
"def",
"GetPrintMagnification",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetPrintMagnification",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3472-L3478 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/utils.py | python | invoke_progress_callbacks | (callbacks, bytes_transferred) | Calls all progress callbacks
:param callbacks: A list of progress callbacks to invoke
:param bytes_transferred: The number of bytes transferred. This is passed
to the callbacks. If no bytes were transferred the callbacks will not
be invoked because no progress was achieved. It is also possible
... | Calls all progress callbacks | [
"Calls",
"all",
"progress",
"callbacks"
] | def invoke_progress_callbacks(callbacks, bytes_transferred):
"""Calls all progress callbacks
:param callbacks: A list of progress callbacks to invoke
:param bytes_transferred: The number of bytes transferred. This is passed
to the callbacks. If no bytes were transferred the callbacks will not
... | [
"def",
"invoke_progress_callbacks",
"(",
"callbacks",
",",
"bytes_transferred",
")",
":",
"# Only invoke the callbacks if bytes were actually transferred.",
"if",
"bytes_transferred",
":",
"for",
"callback",
"in",
"callbacks",
":",
"callback",
"(",
"bytes_transferred",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/utils.py#L128-L141 | ||
bumptop/BumpTop | 466d23597a07ae738f4265262fa01087fc6e257c | trunk/win/Source/bin/jinja2/filters.py | python | do_random | (environment, seq) | Return a random item from the sequence. | Return a random item from the sequence. | [
"Return",
"a",
"random",
"item",
"from",
"the",
"sequence",
"."
] | def do_random(environment, seq):
"""Return a random item from the sequence."""
try:
return choice(seq)
except IndexError:
return environment.undefined('No random item, sequence was empty.') | [
"def",
"do_random",
"(",
"environment",
",",
"seq",
")",
":",
"try",
":",
"return",
"choice",
"(",
"seq",
")",
"except",
"IndexError",
":",
"return",
"environment",
".",
"undefined",
"(",
"'No random item, sequence was empty.'",
")"
] | https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/filters.py#L277-L282 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/backend.py | python | ctc_batch_cost | (y_true, y_pred, input_length, label_length) | return array_ops.expand_dims(
ctc.ctc_loss(
inputs=y_pred, labels=sparse_labels, sequence_length=input_length), 1) | Runs CTC loss algorithm on each batch element.
Args:
y_true: tensor `(samples, max_string_length)`
containing the truth labels.
y_pred: tensor `(samples, time_steps, num_categories)`
containing the prediction, or output of the softmax.
input_length: tensor `(samples, 1)` contain... | Runs CTC loss algorithm on each batch element. | [
"Runs",
"CTC",
"loss",
"algorithm",
"on",
"each",
"batch",
"element",
"."
] | def ctc_batch_cost(y_true, y_pred, input_length, label_length):
"""Runs CTC loss algorithm on each batch element.
Args:
y_true: tensor `(samples, max_string_length)`
containing the truth labels.
y_pred: tensor `(samples, time_steps, num_categories)`
containing the prediction, or out... | [
"def",
"ctc_batch_cost",
"(",
"y_true",
",",
"y_pred",
",",
"input_length",
",",
"label_length",
")",
":",
"label_length",
"=",
"math_ops",
".",
"cast",
"(",
"array_ops",
".",
"squeeze",
"(",
"label_length",
",",
"axis",
"=",
"-",
"1",
")",
",",
"dtypes_mo... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L6241-L6269 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/not_in_impl.py | python | _tensor_not_in_tuple | (x, y) | return not compile_utils.tensor_in_sequence(x, y) | Determine if a tensor not in a tuple.
Args:
x: Tensor
y: Tuple
Returns:
bool, if x not in y return true, x in y return false. | Determine if a tensor not in a tuple. | [
"Determine",
"if",
"a",
"tensor",
"not",
"in",
"a",
"tuple",
"."
] | def _tensor_not_in_tuple(x, y):
"""
Determine if a tensor not in a tuple.
Args:
x: Tensor
y: Tuple
Returns:
bool, if x not in y return true, x in y return false.
"""
return not compile_utils.tensor_in_sequence(x, y) | [
"def",
"_tensor_not_in_tuple",
"(",
"x",
",",
"y",
")",
":",
"return",
"not",
"compile_utils",
".",
"tensor_in_sequence",
"(",
"x",
",",
"y",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/not_in_impl.py#L121-L132 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/recipes/perf_skottietrace.py | python | parse_trace | (trace_json, lottie_filename, api) | return output | parse_trace parses the specified trace JSON.
Parses the trace JSON and calculates the time of a single frame. Frame time is
considered the same as seek time + render time.
Note: The first seek is ignored because it is a constructor call.
A dictionary is returned that has the following structure:
{
'fram... | parse_trace parses the specified trace JSON. | [
"parse_trace",
"parses",
"the",
"specified",
"trace",
"JSON",
"."
] | def parse_trace(trace_json, lottie_filename, api):
"""parse_trace parses the specified trace JSON.
Parses the trace JSON and calculates the time of a single frame. Frame time is
considered the same as seek time + render time.
Note: The first seek is ignored because it is a constructor call.
A dictionary is ... | [
"def",
"parse_trace",
"(",
"trace_json",
",",
"lottie_filename",
",",
"api",
")",
":",
"step_result",
"=",
"api",
".",
"run",
"(",
"api",
".",
"python",
".",
"inline",
",",
"'parse %s trace'",
"%",
"lottie_filename",
",",
"program",
"=",
"\"\"\"\n import json... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipes/perf_skottietrace.py#L143-L216 | |
dartsim/dart | 495c82120c836005f2d136d4a50c8cc997fb879b | tools/cpplint.py | python | FileInfo.NoExtension | (self) | return '/'.join(self.Split()[0:2]) | File has no source file extension. | File has no source file extension. | [
"File",
"has",
"no",
"source",
"file",
"extension",
"."
] | def NoExtension(self):
"""File has no source file extension."""
return '/'.join(self.Split()[0:2]) | [
"def",
"NoExtension",
"(",
"self",
")",
":",
"return",
"'/'",
".",
"join",
"(",
"self",
".",
"Split",
"(",
")",
"[",
"0",
":",
"2",
"]",
")"
] | https://github.com/dartsim/dart/blob/495c82120c836005f2d136d4a50c8cc997fb879b/tools/cpplint.py#L929-L931 | |
jbehley/point_labeler | bf22e6f255fe5c9f01979d2d670d0ac543ae6460 | scripts/io_utils.py | python | write_labels | (filename, labels) | write labels in given file. | write labels in given file. | [
"write",
"labels",
"in",
"given",
"file",
"."
] | def write_labels(filename, labels):
""" write labels in given file. """
arr = [struct.pack('<I', label) for label in labels]
contents = bytes()
for a in arr:
contents += a
with open(filename, "bw") as f:
f.write(contents) | [
"def",
"write_labels",
"(",
"filename",
",",
"labels",
")",
":",
"arr",
"=",
"[",
"struct",
".",
"pack",
"(",
"'<I'",
",",
"label",
")",
"for",
"label",
"in",
"labels",
"]",
"contents",
"=",
"bytes",
"(",
")",
"for",
"a",
"in",
"arr",
":",
"content... | https://github.com/jbehley/point_labeler/blob/bf22e6f255fe5c9f01979d2d670d0ac543ae6460/scripts/io_utils.py#L20-L28 | ||
google/clif | cab24d6a105609a65c95a36a1712ae3c20c7b5df | clif/python/proto.py | python | _CppName | (desc) | return '::'+desc.fqname.replace('.', '::') | Return the fully qualified C++ name of the entity in |desc|. | Return the fully qualified C++ name of the entity in |desc|. | [
"Return",
"the",
"fully",
"qualified",
"C",
"++",
"name",
"of",
"the",
"entity",
"in",
"|desc|",
"."
] | def _CppName(desc):
"""Return the fully qualified C++ name of the entity in |desc|."""
return '::'+desc.fqname.replace('.', '::') | [
"def",
"_CppName",
"(",
"desc",
")",
":",
"return",
"'::'",
"+",
"desc",
".",
"fqname",
".",
"replace",
"(",
"'.'",
",",
"'::'",
")"
] | https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/proto.py#L60-L62 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py | python | Calendar.itermonthdays | (self, year, month) | Like itermonthdates(), but will yield day numbers. For days outside
the specified month the day number is 0. | Like itermonthdates(), but will yield day numbers. For days outside
the specified month the day number is 0. | [
"Like",
"itermonthdates",
"()",
"but",
"will",
"yield",
"day",
"numbers",
".",
"For",
"days",
"outside",
"the",
"specified",
"month",
"the",
"day",
"number",
"is",
"0",
"."
] | def itermonthdays(self, year, month):
"""
Like itermonthdates(), but will yield day numbers. For days outside
the specified month the day number is 0.
"""
for date in self.itermonthdates(year, month):
if date.month != month:
yield 0
else:
... | [
"def",
"itermonthdays",
"(",
"self",
",",
"year",
",",
"month",
")",
":",
"for",
"date",
"in",
"self",
".",
"itermonthdates",
"(",
"year",
",",
"month",
")",
":",
"if",
"date",
".",
"month",
"!=",
"month",
":",
"yield",
"0",
"else",
":",
"yield",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py#L183-L192 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/git_util.py | python | get_url | (path = '.') | Returns the origin url for the specified path. | Returns the origin url for the specified path. | [
"Returns",
"the",
"origin",
"url",
"for",
"the",
"specified",
"path",
"."
] | def get_url(path = '.'):
""" Returns the origin url for the specified path. """
if is_ue_fork(path):
return read_ue_fork_file(path)['url']
else:
cmd = "%s config --get remote.origin.url" % git_exe
result = exec_cmd(cmd, path)
if result['out'] != '':
return result['out'].strip()
return 'U... | [
"def",
"get_url",
"(",
"path",
"=",
"'.'",
")",
":",
"if",
"is_ue_fork",
"(",
"path",
")",
":",
"return",
"read_ue_fork_file",
"(",
"path",
")",
"[",
"'url'",
"]",
"else",
":",
"cmd",
"=",
"\"%s config --get remote.origin.url\"",
"%",
"git_exe",
"result",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/git_util.py#L46-L55 | ||
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/SU2/util/ordered_dict.py | python | OrderedDict.__delitem__ | (self, key, dict_delitem=dict.__delitem__) | od.__delitem__(y) <==> del od[y] | od.__delitem__(y) <==> del od[y] | [
"od",
".",
"__delitem__",
"(",
"y",
")",
"<",
"==",
">",
"del",
"od",
"[",
"y",
"]"
] | def __delitem__(self, key, dict_delitem=dict.__delitem__):
'od.__delitem__(y) <==> del od[y]'
# Deleting an existing item uses self.__map to find the link which is
# then removed by updating the links in the predecessor and successor nodes.
dict_delitem(self, key)
link_prev, link... | [
"def",
"__delitem__",
"(",
"self",
",",
"key",
",",
"dict_delitem",
"=",
"dict",
".",
"__delitem__",
")",
":",
"# Deleting an existing item uses self.__map to find the link which is",
"# then removed by updating the links in the predecessor and successor nodes.",
"dict_delitem",
"(... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/util/ordered_dict.py#L60-L67 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | python | InsertLargePdbShims | (target_list, target_dicts, vars) | return (target_list, target_dicts) | Insert a shim target that forces the linker to use 4KB pagesize PDBs.
This is a workaround for targets with PDBs greater than 1GB in size, the
limit for the 1KB pagesize PDBs created by the linker by default.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of targe... | Insert a shim target that forces the linker to use 4KB pagesize PDBs. | [
"Insert",
"a",
"shim",
"target",
"that",
"forces",
"the",
"linker",
"to",
"use",
"4KB",
"pagesize",
"PDBs",
"."
] | def InsertLargePdbShims(target_list, target_dicts, vars):
"""Insert a shim target that forces the linker to use 4KB pagesize PDBs.
This is a workaround for targets with PDBs greater than 1GB in size, the
limit for the 1KB pagesize PDBs created by the linker by default.
Arguments:
target_list: List of targ... | [
"def",
"InsertLargePdbShims",
"(",
"target_list",
",",
"target_dicts",
",",
"vars",
")",
":",
"# Determine which targets need shimming.",
"targets_to_shim",
"=",
"[",
"]",
"for",
"t",
"in",
"target_dicts",
":",
"target_dict",
"=",
"target_dicts",
"[",
"t",
"]",
"#... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py#L168-L270 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xpathParserContext.xpathModValues | (self) | Implement the mod operation on XPath objects: @arg1 / @arg2
The numeric operators convert their operands to numbers as
if by calling the number function. | Implement the mod operation on XPath objects: | [
"Implement",
"the",
"mod",
"operation",
"on",
"XPath",
"objects",
":"
] | def xpathModValues(self):
"""Implement the mod operation on XPath objects: @arg1 / @arg2
The numeric operators convert their operands to numbers as
if by calling the number function. """
libxml2mod.xmlXPathModValues(self._o) | [
"def",
"xpathModValues",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlXPathModValues",
"(",
"self",
".",
"_o",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L6787-L6791 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/utils/check_cfc/check_cfc.py | python | replace_output_file | (args, new_name) | return args | Replaces the specified name of an output file with the specified name.
Assumes that the output file name is specified in the command line args. | Replaces the specified name of an output file with the specified name.
Assumes that the output file name is specified in the command line args. | [
"Replaces",
"the",
"specified",
"name",
"of",
"an",
"output",
"file",
"with",
"the",
"specified",
"name",
".",
"Assumes",
"that",
"the",
"output",
"file",
"name",
"is",
"specified",
"in",
"the",
"command",
"line",
"args",
"."
] | def replace_output_file(args, new_name):
"""Replaces the specified name of an output file with the specified name.
Assumes that the output file name is specified in the command line args."""
replaceidx = None
attached = False
for idx, val in enumerate(args):
if val == '-o':
repla... | [
"def",
"replace_output_file",
"(",
"args",
",",
"new_name",
")",
":",
"replaceidx",
"=",
"None",
"attached",
"=",
"False",
"for",
"idx",
",",
"val",
"in",
"enumerate",
"(",
"args",
")",
":",
"if",
"val",
"==",
"'-o'",
":",
"replaceidx",
"=",
"idx",
"+"... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/utils/check_cfc/check_cfc.py#L151-L170 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiNotebook.GetPage | (*args, **kwargs) | return _aui.AuiNotebook_GetPage(*args, **kwargs) | GetPage(self, size_t pageIdx) -> Window | GetPage(self, size_t pageIdx) -> Window | [
"GetPage",
"(",
"self",
"size_t",
"pageIdx",
")",
"-",
">",
"Window"
] | def GetPage(*args, **kwargs):
"""GetPage(self, size_t pageIdx) -> Window"""
return _aui.AuiNotebook_GetPage(*args, **kwargs) | [
"def",
"GetPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiNotebook_GetPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1321-L1323 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Canvas.tag_bind | (self, tagOrId, sequence=None, func=None, add=None) | return self._bind((self._w, 'bind', tagOrId),
sequence, func, add) | Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.
An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the previous function. See bind for the return value. | Bind to all items with TAGORID at event SEQUENCE a call to function FUNC. | [
"Bind",
"to",
"all",
"items",
"with",
"TAGORID",
"at",
"event",
"SEQUENCE",
"a",
"call",
"to",
"function",
"FUNC",
"."
] | def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
"""Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.
An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the... | [
"def",
"tag_bind",
"(",
"self",
",",
"tagOrId",
",",
"sequence",
"=",
"None",
",",
"func",
"=",
"None",
",",
"add",
"=",
"None",
")",
":",
"return",
"self",
".",
"_bind",
"(",
"(",
"self",
".",
"_w",
",",
"'bind'",
",",
"tagOrId",
")",
",",
"sequ... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2217-L2224 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py | python | Videos.getVideos | (self, dir_dict, dictionaries) | return dictionaries | Parse a list made of categories and retrieve video meta data
return a dictionary of directory names and categories video meta data | Parse a list made of categories and retrieve video meta data
return a dictionary of directory names and categories video meta data | [
"Parse",
"a",
"list",
"made",
"of",
"categories",
"and",
"retrieve",
"video",
"meta",
"data",
"return",
"a",
"dictionary",
"of",
"directory",
"names",
"and",
"categories",
"video",
"meta",
"data"
] | def getVideos(self, dir_dict, dictionaries):
'''Parse a list made of categories and retrieve video meta data
return a dictionary of directory names and categories video meta data
'''
for sets in dir_dict:
if not isinstance(sets[1], list):
if sets[0] != '': # A... | [
"def",
"getVideos",
"(",
"self",
",",
"dir_dict",
",",
"dictionaries",
")",
":",
"for",
"sets",
"in",
"dir_dict",
":",
"if",
"not",
"isinstance",
"(",
"sets",
"[",
"1",
"]",
",",
"list",
")",
":",
"if",
"sets",
"[",
"0",
"]",
"!=",
"''",
":",
"# ... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py#L681-L709 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/math_grad.py | python | _AddNGrad | (op, grad) | return [grad] * len(op.inputs) | Copies the gradient to all inputs. | Copies the gradient to all inputs. | [
"Copies",
"the",
"gradient",
"to",
"all",
"inputs",
"."
] | def _AddNGrad(op, grad):
"""Copies the gradient to all inputs."""
# Not broadcasting.
return [grad] * len(op.inputs) | [
"def",
"_AddNGrad",
"(",
"op",
",",
"grad",
")",
":",
"# Not broadcasting.",
"return",
"[",
"grad",
"]",
"*",
"len",
"(",
"op",
".",
"inputs",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_grad.py#L697-L700 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.addProduct | (self, molecule) | return self.dispatcher._checkResult(
Indigo._lib.indigoAddProduct(self.id, molecule.id)
) | Reaction method adds the given molecule copy to products
Args:
molecule (IndigoObject): molecule to be added
Returns:
int: 1 if the molecule was added correctly | Reaction method adds the given molecule copy to products | [
"Reaction",
"method",
"adds",
"the",
"given",
"molecule",
"copy",
"to",
"products"
] | def addProduct(self, molecule):
"""Reaction method adds the given molecule copy to products
Args:
molecule (IndigoObject): molecule to be added
Returns:
int: 1 if the molecule was added correctly
"""
self.dispatcher._setSessionId()
return self.di... | [
"def",
"addProduct",
"(",
"self",
",",
"molecule",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoAddProduct",
"(",
"self",
".",
"id",
... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L393-L405 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap.py | python | _resolve_name | (name, package, level) | return '{}.{}'.format(base, name) if name else base | Resolve a relative module name to an absolute one. | Resolve a relative module name to an absolute one. | [
"Resolve",
"a",
"relative",
"module",
"name",
"to",
"an",
"absolute",
"one",
"."
] | def _resolve_name(name, package, level):
"""Resolve a relative module name to an absolute one."""
bits = package.rsplit('.', level - 1)
if len(bits) < level:
raise ValueError('attempted relative import beyond top-level package')
base = bits[0]
return '{}.{}'.format(base, name) if name else b... | [
"def",
"_resolve_name",
"(",
"name",
",",
"package",
",",
"level",
")",
":",
"bits",
"=",
"package",
".",
"rsplit",
"(",
"'.'",
",",
"level",
"-",
"1",
")",
"if",
"len",
"(",
"bits",
")",
"<",
"level",
":",
"raise",
"ValueError",
"(",
"'attempted rel... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap.py#L864-L870 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | SimRobotSensor.setSetting | (self, name, val) | return _robotsim.SimRobotSensor_setSetting(self, name, val) | setSetting(SimRobotSensor self, std::string const & name, std::string const & val)
Sets the value of the named setting (you will need to manually cast an
int/float/etc to a str) | setSetting(SimRobotSensor self, std::string const & name, std::string const & val) | [
"setSetting",
"(",
"SimRobotSensor",
"self",
"std",
"::",
"string",
"const",
"&",
"name",
"std",
"::",
"string",
"const",
"&",
"val",
")"
] | def setSetting(self, name, val):
"""
setSetting(SimRobotSensor self, std::string const & name, std::string const & val)
Sets the value of the named setting (you will need to manually cast an
int/float/etc to a str)
"""
return _robotsim.SimRobotSensor_setSetting(self... | [
"def",
"setSetting",
"(",
"self",
",",
"name",
",",
"val",
")",
":",
"return",
"_robotsim",
".",
"SimRobotSensor_setSetting",
"(",
"self",
",",
"name",
",",
"val",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7268-L7278 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/PyShell.py | python | ModifiedInterpreter.showsyntaxerror | (self, filename=None) | Extend base class method: Add Colorizing
Color the offending position instead of printing it and pointing at it
with a caret. | Extend base class method: Add Colorizing | [
"Extend",
"base",
"class",
"method",
":",
"Add",
"Colorizing"
] | def showsyntaxerror(self, filename=None):
"""Extend base class method: Add Colorizing
Color the offending position instead of printing it and pointing at it
with a caret.
"""
text = self.tkconsole.text
stuff = self.unpackerror()
if stuff:
msg, lineno... | [
"def",
"showsyntaxerror",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"text",
"=",
"self",
".",
"tkconsole",
".",
"text",
"stuff",
"=",
"self",
".",
"unpackerror",
"(",
")",
"if",
"stuff",
":",
"msg",
",",
"lineno",
",",
"offset",
",",
"line... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/PyShell.py#L679-L705 | ||
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | panreas_hnn/hed-globalweight/scripts/cpp_lint.py | python | CheckMakePairUsesDeduction | (filename, clean_lines, linenum, error) | Check that make_pair's template arguments are deduced.
G++ 4.6 in C++0x mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linen... | Check that make_pair's template arguments are deduced. | [
"Check",
"that",
"make_pair",
"s",
"template",
"arguments",
"are",
"deduced",
"."
] | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
"""Check that make_pair's template arguments are deduced.
G++ 4.6 in C++0x mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current fi... | [
"def",
"CheckMakePairUsesDeduction",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"_RE_PATTERN_EXPLICIT_MAKEPAIR",
".",
"search",
"(",
"line",
")",
"i... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/scripts/cpp_lint.py#L4579-L4597 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | libcxx/utils/libcxx/util.py | python | executeCommand | (command, cwd=None, env=None, input=None, timeout=0) | return out, err, exitCode | Execute command ``command`` (list of arguments or string)
with
* working directory ``cwd`` (str), use None to use the current
working directory
* environment ``env`` (dict), use None for none
* Input to the command ``input`` (str), use string to pass
no input.
... | Execute command ``command`` (list of arguments or string)
with
* working directory ``cwd`` (str), use None to use the current
working directory
* environment ``env`` (dict), use None for none
* Input to the command ``input`` (str), use string to pass
no input.
... | [
"Execute",
"command",
"command",
"(",
"list",
"of",
"arguments",
"or",
"string",
")",
"with",
"*",
"working",
"directory",
"cwd",
"(",
"str",
")",
"use",
"None",
"to",
"use",
"the",
"current",
"working",
"directory",
"*",
"environment",
"env",
"(",
"dict",... | def executeCommand(command, cwd=None, env=None, input=None, timeout=0):
"""
Execute command ``command`` (list of arguments or string)
with
* working directory ``cwd`` (str), use None to use the current
working directory
* environment ``env`` (dict), use None for none
... | [
"def",
"executeCommand",
"(",
"command",
",",
"cwd",
"=",
"None",
",",
"env",
"=",
"None",
",",
"input",
"=",
"None",
",",
"timeout",
"=",
"0",
")",
":",
"if",
"input",
"is",
"not",
"None",
":",
"input",
"=",
"to_bytes",
"(",
"input",
")",
"p",
"... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/libcxx/utils/libcxx/util.py#L178-L240 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGrid.GetCellTextColour | (*args, **kwargs) | return _propgrid.PropertyGrid_GetCellTextColour(*args, **kwargs) | GetCellTextColour(self) -> Colour | GetCellTextColour(self) -> Colour | [
"GetCellTextColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetCellTextColour(*args, **kwargs):
"""GetCellTextColour(self) -> Colour"""
return _propgrid.PropertyGrid_GetCellTextColour(*args, **kwargs) | [
"def",
"GetCellTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GetCellTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2067-L2069 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/server.py | python | CGIHTTPRequestHandler.is_cgi | (self) | return False | Test whether self.path corresponds to a CGI script.
Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.
If any exception is raised, the caller should assume that
self.path was rejected as ... | Test whether self.path corresponds to a CGI script. | [
"Test",
"whether",
"self",
".",
"path",
"corresponds",
"to",
"a",
"CGI",
"script",
"."
] | def is_cgi(self):
"""Test whether self.path corresponds to a CGI script.
Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.
If any exception is raised, the caller should assume that
... | [
"def",
"is_cgi",
"(",
"self",
")",
":",
"collapsed_path",
"=",
"_url_collapse_path",
"(",
"self",
".",
"path",
")",
"dir_sep",
"=",
"collapsed_path",
".",
"find",
"(",
"'/'",
",",
"1",
")",
"head",
",",
"tail",
"=",
"collapsed_path",
"[",
":",
"dir_sep",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/server.py#L992-L1013 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/generator/msvs.py | python | _GetGuidOfProject | (proj_path, spec) | return guid | Get the guid for the project.
Arguments:
proj_path: Path of the vcproj or vcxproj file to generate.
spec: The target dictionary containing the properties of the target.
Returns:
the guid.
Raises:
ValueError: if the specified GUID is invalid. | Get the guid for the project. | [
"Get",
"the",
"guid",
"for",
"the",
"project",
"."
] | def _GetGuidOfProject(proj_path, spec):
"""Get the guid for the project.
Arguments:
proj_path: Path of the vcproj or vcxproj file to generate.
spec: The target dictionary containing the properties of the target.
Returns:
the guid.
Raises:
ValueError: if the specified GUID is invalid.
"""
# ... | [
"def",
"_GetGuidOfProject",
"(",
"proj_path",
",",
"spec",
")",
":",
"# Pluck out the default configuration.",
"default_config",
"=",
"_GetDefaultConfiguration",
"(",
"spec",
")",
"# Decide the guid of the project.",
"guid",
"=",
"default_config",
".",
"get",
"(",
"'msvs_... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/msvs.py#L910-L931 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/stats.py | python | hmean | (a, axis=0, dtype=None) | Calculate the harmonic mean along the specified axis.
That is: n / (1/x1 + 1/x2 + ... + 1/xn)
Parameters
----------
a : array_like
Input array, masked array or object that can be converted to an array.
axis : int or None, optional
Axis along which the harmonic mean is computed. De... | Calculate the harmonic mean along the specified axis. | [
"Calculate",
"the",
"harmonic",
"mean",
"along",
"the",
"specified",
"axis",
"."
] | def hmean(a, axis=0, dtype=None):
"""
Calculate the harmonic mean along the specified axis.
That is: n / (1/x1 + 1/x2 + ... + 1/xn)
Parameters
----------
a : array_like
Input array, masked array or object that can be converted to an array.
axis : int or None, optional
Axis... | [
"def",
"hmean",
"(",
"a",
",",
"axis",
"=",
"0",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"a",
",",
"np",
".",
"ndarray",
")",
":",
"a",
"=",
"np",
".",
"array",
"(",
"a",
",",
"dtype",
"=",
"dtype",
")",
"if",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/stats.py#L320-L383 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/beautifulsoup4/bs4/dammit.py | python | EncodingDetector.encodings | (self) | Yield a number of encodings that might work for this markup. | Yield a number of encodings that might work for this markup. | [
"Yield",
"a",
"number",
"of",
"encodings",
"that",
"might",
"work",
"for",
"this",
"markup",
"."
] | def encodings(self):
"""Yield a number of encodings that might work for this markup."""
tried = set()
for e in self.override_encodings:
if self._usable(e, tried):
yield e
# Did the document originally start with a byte-order mark
# that indicated its ... | [
"def",
"encodings",
"(",
"self",
")",
":",
"tried",
"=",
"set",
"(",
")",
"for",
"e",
"in",
"self",
".",
"override_encodings",
":",
"if",
"self",
".",
"_usable",
"(",
"e",
",",
"tried",
")",
":",
"yield",
"e",
"# Did the document originally start with a by... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/beautifulsoup4/bs4/dammit.py#L233-L263 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/driver.py | python | MemoryPointer.allow_access_to | (self, *agents) | Grant access to given *agents*.
Upon return, only the listed-agents and the owner agent have direct
access to this pointer. | Grant access to given *agents*.
Upon return, only the listed-agents and the owner agent have direct
access to this pointer. | [
"Grant",
"access",
"to",
"given",
"*",
"agents",
"*",
".",
"Upon",
"return",
"only",
"the",
"listed",
"-",
"agents",
"and",
"the",
"owner",
"agent",
"have",
"direct",
"access",
"to",
"this",
"pointer",
"."
] | def allow_access_to(self, *agents):
"""
Grant access to given *agents*.
Upon return, only the listed-agents and the owner agent have direct
access to this pointer.
"""
ct = len(agents)
if ct == 0:
return
agent_array = (ct * drvapi.hsa_agent_t)(... | [
"def",
"allow_access_to",
"(",
"self",
",",
"*",
"agents",
")",
":",
"ct",
"=",
"len",
"(",
"agents",
")",
"if",
"ct",
"==",
"0",
":",
"return",
"agent_array",
"=",
"(",
"ct",
"*",
"drvapi",
".",
"hsa_agent_t",
")",
"(",
"*",
"[",
"a",
".",
"_id"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/driver.py#L1117-L1128 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/framework/foundation/stream.py | python | Consumer.consume | (self, value) | Accepts a value.
Args:
value: Any value accepted by this Consumer. | Accepts a value. | [
"Accepts",
"a",
"value",
"."
] | def consume(self, value):
"""Accepts a value.
Args:
value: Any value accepted by this Consumer.
"""
raise NotImplementedError() | [
"def",
"consume",
"(",
"self",
",",
"value",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/framework/foundation/stream.py#L25-L31 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/nanfunctions.py | python | nanstd | (a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue) | return std | Compute the standard deviation along the specified axis, while
ignoring NaNs.
Returns the standard deviation, a measure of the spread of a
distribution, of the non-NaN array elements. The standard deviation is
computed for the flattened array by default, otherwise over the
specified axis.
For ... | Compute the standard deviation along the specified axis, while
ignoring NaNs. | [
"Compute",
"the",
"standard",
"deviation",
"along",
"the",
"specified",
"axis",
"while",
"ignoring",
"NaNs",
"."
] | def nanstd(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue):
"""
Compute the standard deviation along the specified axis, while
ignoring NaNs.
Returns the standard deviation, a measure of the spread of a
distribution, of the non-NaN array elements. The standard deviation is
com... | [
"def",
"nanstd",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"out",
"=",
"None",
",",
"ddof",
"=",
"0",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
")",
":",
"var",
"=",
"nanvar",
"(",
"a",
",",
"axis",
"=",
"axis",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/nanfunctions.py#L1572-L1672 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | Diagnostic.format | (self, options=None) | return conf.lib.clang_formatDiagnostic(self, options) | Format this diagnostic for display. The options argument takes
Diagnostic.Display* flags, which can be combined using bitwise OR. If
the options argument is not provided, the default display options will
be used. | Format this diagnostic for display. The options argument takes
Diagnostic.Display* flags, which can be combined using bitwise OR. If
the options argument is not provided, the default display options will
be used. | [
"Format",
"this",
"diagnostic",
"for",
"display",
".",
"The",
"options",
"argument",
"takes",
"Diagnostic",
".",
"Display",
"*",
"flags",
"which",
"can",
"be",
"combined",
"using",
"bitwise",
"OR",
".",
"If",
"the",
"options",
"argument",
"is",
"not",
"provi... | def format(self, options=None):
"""
Format this diagnostic for display. The options argument takes
Diagnostic.Display* flags, which can be combined using bitwise OR. If
the options argument is not provided, the default display options will
be used.
"""
if options ... | [
"def",
"format",
"(",
"self",
",",
"options",
"=",
"None",
")",
":",
"if",
"options",
"is",
"None",
":",
"options",
"=",
"conf",
".",
"lib",
".",
"clang_defaultDiagnosticDisplayOptions",
"(",
")",
"if",
"options",
"&",
"~",
"Diagnostic",
".",
"_FormatOptio... | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L467-L478 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.NormalizeIncludePaths | (self, include_paths) | return normalized | Normalize include_paths.
Convert absolute paths to relative to the Android top directory.
Args:
include_paths: A list of unprocessed include paths.
Returns:
A list of normalized include paths. | Normalize include_paths.
Convert absolute paths to relative to the Android top directory. | [
"Normalize",
"include_paths",
".",
"Convert",
"absolute",
"paths",
"to",
"relative",
"to",
"the",
"Android",
"top",
"directory",
"."
] | def NormalizeIncludePaths(self, include_paths):
""" Normalize include_paths.
Convert absolute paths to relative to the Android top directory.
Args:
include_paths: A list of unprocessed include paths.
Returns:
A list of normalized include paths.
"""
normalized = []
for path in in... | [
"def",
"NormalizeIncludePaths",
"(",
"self",
",",
"include_paths",
")",
":",
"normalized",
"=",
"[",
"]",
"for",
"path",
"in",
"include_paths",
":",
"if",
"path",
"[",
"0",
"]",
"==",
"'/'",
":",
"path",
"=",
"gyp",
".",
"common",
".",
"RelativePath",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L690-L704 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/perf/profile_creators/update_remote_extensions.py | python | _UpdateExtensionsInCloud | (local_extensions_dir, extensions_csv, remote_dir) | Updates set of extensions in Cloud Storage from a CSV of extension ids.
From well-formatted CSV file containing some set of extensions
(extensions_csv), download them, compress into archive, and update
the remote extension archive under REMOTE_DIR in CHROME-PARTNER-TELEMETRY
bucket. This script expects 2nd col... | Updates set of extensions in Cloud Storage from a CSV of extension ids. | [
"Updates",
"set",
"of",
"extensions",
"in",
"Cloud",
"Storage",
"from",
"a",
"CSV",
"of",
"extension",
"ids",
"."
] | def _UpdateExtensionsInCloud(local_extensions_dir, extensions_csv, remote_dir):
"""Updates set of extensions in Cloud Storage from a CSV of extension ids.
From well-formatted CSV file containing some set of extensions
(extensions_csv), download them, compress into archive, and update
the remote extension archi... | [
"def",
"_UpdateExtensionsInCloud",
"(",
"local_extensions_dir",
",",
"extensions_csv",
",",
"remote_dir",
")",
":",
"# Download CRX to temp files and compress into archive",
"zip_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"local_extensions_dir",
",",
"ZIP_NAME",
")"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/profile_creators/update_remote_extensions.py#L61-L123 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/configuration.py | python | Configuration.get_environ_vars | (self) | Returns a generator with all environmental vars with prefix PIP_ | Returns a generator with all environmental vars with prefix PIP_ | [
"Returns",
"a",
"generator",
"with",
"all",
"environmental",
"vars",
"with",
"prefix",
"PIP_"
] | def get_environ_vars(self):
# type: () -> Iterable[Tuple[str, str]]
"""Returns a generator with all environmental vars with prefix PIP_"""
for key, val in os.environ.items():
if key.startswith("PIP_"):
name = key[4:].lower()
if name not in ENV_NAMES_IG... | [
"def",
"get_environ_vars",
"(",
"self",
")",
":",
"# type: () -> Iterable[Tuple[str, str]]",
"for",
"key",
",",
"val",
"in",
"os",
".",
"environ",
".",
"items",
"(",
")",
":",
"if",
"key",
".",
"startswith",
"(",
"\"PIP_\"",
")",
":",
"name",
"=",
"key",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/configuration.py#L337-L344 | ||
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/python_message.py | python | _AddSlots | (message_descriptor, dictionary) | Adds a __slots__ entry to dictionary, containing the names of all valid
attributes for this message type.
Args:
message_descriptor: A Descriptor instance describing this message type.
dictionary: Class dictionary to which we'll add a '__slots__' entry. | Adds a __slots__ entry to dictionary, containing the names of all valid
attributes for this message type. | [
"Adds",
"a",
"__slots__",
"entry",
"to",
"dictionary",
"containing",
"the",
"names",
"of",
"all",
"valid",
"attributes",
"for",
"this",
"message",
"type",
"."
] | def _AddSlots(message_descriptor, dictionary):
"""Adds a __slots__ entry to dictionary, containing the names of all valid
attributes for this message type.
Args:
message_descriptor: A Descriptor instance describing this message type.
dictionary: Class dictionary to which we'll add a '__slots__' entry.
... | [
"def",
"_AddSlots",
"(",
"message_descriptor",
",",
"dictionary",
")",
":",
"dictionary",
"[",
"'__slots__'",
"]",
"=",
"[",
"'_cached_byte_size'",
",",
"'_cached_byte_size_dirty'",
",",
"'_fields'",
",",
"'_is_present_in_parent'",
",",
"'_listener'",
",",
"'_listener... | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/python_message.py#L156-L170 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/imperative/imperative_graph.py | python | ImperativeGraph.run_pending_inits | (self, session) | Runs the pending variable initializations using `session`. | Runs the pending variable initializations using `session`. | [
"Runs",
"the",
"pending",
"variable",
"initializations",
"using",
"session",
"."
] | def run_pending_inits(self, session):
"""Runs the pending variable initializations using `session`."""
while self._init_ops:
session.run(self._init_ops.pop(0)) | [
"def",
"run_pending_inits",
"(",
"self",
",",
"session",
")",
":",
"while",
"self",
".",
"_init_ops",
":",
"session",
".",
"run",
"(",
"self",
".",
"_init_ops",
".",
"pop",
"(",
"0",
")",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/imperative/imperative_graph.py#L184-L187 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | python | get_path_names | () | return _SCHEMES.options('posix_prefix') | Return a tuple containing the paths names. | Return a tuple containing the paths names. | [
"Return",
"a",
"tuple",
"containing",
"the",
"paths",
"names",
"."
] | def get_path_names():
"""Return a tuple containing the paths names."""
# xxx see if we want a static list
return _SCHEMES.options('posix_prefix') | [
"def",
"get_path_names",
"(",
")",
":",
"# xxx see if we want a static list",
"return",
"_SCHEMES",
".",
"options",
"(",
"'posix_prefix'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py#L434-L437 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/prepare_binding_Python.py | python | SwigSettings.output_out_of_date | (self) | return False | Returns whether the output file is out of date.
Compares output file time to all the input files.
@return True if any of the input files are newer than
the output file, or if the output file doesn't exist;
False otherwise. | Returns whether the output file is out of date. | [
"Returns",
"whether",
"the",
"output",
"file",
"is",
"out",
"of",
"date",
"."
] | def output_out_of_date(self):
"""Returns whether the output file is out of date.
Compares output file time to all the input files.
@return True if any of the input files are newer than
the output file, or if the output file doesn't exist;
False otherwise.
"""
if... | [
"def",
"output_out_of_date",
"(",
"self",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"output_file",
")",
":",
"logging",
".",
"info",
"(",
"\"will generate, missing binding output file\"",
")",
"return",
"True",
"output_mtime",
... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/prepare_binding_Python.py#L67-L104 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/rnn_cell.py | python | GRUCell.__call__ | (self, inputs, state, scope=None) | return new_h, new_h | Gated recurrent unit (GRU) with nunits cells. | Gated recurrent unit (GRU) with nunits cells. | [
"Gated",
"recurrent",
"unit",
"(",
"GRU",
")",
"with",
"nunits",
"cells",
"."
] | def __call__(self, inputs, state, scope=None):
"""Gated recurrent unit (GRU) with nunits cells."""
with vs.variable_scope(scope or type(self).__name__): # "GRUCell"
with vs.variable_scope("Gates"): # Reset gate and update gate.
# We start with bias of 1.0 to not reset and not update.
r, ... | [
"def",
"__call__",
"(",
"self",
",",
"inputs",
",",
"state",
",",
"scope",
"=",
"None",
")",
":",
"with",
"vs",
".",
"variable_scope",
"(",
"scope",
"or",
"type",
"(",
"self",
")",
".",
"__name__",
")",
":",
"# \"GRUCell\"",
"with",
"vs",
".",
"varia... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/rnn_cell.py#L220-L232 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/random_grad.py | python | _RandomGammaGrad | (op, grad) | Returns the gradient of a Gamma sample w.r.t. alpha.
The gradient is computed using implicit differentiation, see
"Implicit Reparameterization Gradients" (https://arxiv.org/abs/1805.08498).
Args:
op: A `RandomGamma` operation. We assume that the inputs to the operation
are `shape` and `alpha` tensors,... | Returns the gradient of a Gamma sample w.r.t. alpha. | [
"Returns",
"the",
"gradient",
"of",
"a",
"Gamma",
"sample",
"w",
".",
"r",
".",
"t",
".",
"alpha",
"."
] | def _RandomGammaGrad(op, grad): # pylint: disable=invalid-name
"""Returns the gradient of a Gamma sample w.r.t. alpha.
The gradient is computed using implicit differentiation, see
"Implicit Reparameterization Gradients" (https://arxiv.org/abs/1805.08498).
Args:
op: A `RandomGamma` operation. We assume th... | [
"def",
"_RandomGammaGrad",
"(",
"op",
",",
"grad",
")",
":",
"# pylint: disable=invalid-name",
"shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"alpha",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
"sample",
"=",
"op",
".",
"outputs",
"[",
"0",
"]",
"wi... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/random_grad.py#L36-L65 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Utils.py | python | skip_bom | (f) | Read past a BOM at the beginning of a source file.
This could be added to the scanner, but it's *substantially* easier
to keep it at this level. | Read past a BOM at the beginning of a source file.
This could be added to the scanner, but it's *substantially* easier
to keep it at this level. | [
"Read",
"past",
"a",
"BOM",
"at",
"the",
"beginning",
"of",
"a",
"source",
"file",
".",
"This",
"could",
"be",
"added",
"to",
"the",
"scanner",
"but",
"it",
"s",
"*",
"substantially",
"*",
"easier",
"to",
"keep",
"it",
"at",
"this",
"level",
"."
] | def skip_bom(f):
"""
Read past a BOM at the beginning of a source file.
This could be added to the scanner, but it's *substantially* easier
to keep it at this level.
"""
if f.read(1) != u'\uFEFF':
f.seek(0) | [
"def",
"skip_bom",
"(",
"f",
")",
":",
"if",
"f",
".",
"read",
"(",
"1",
")",
"!=",
"u'\\uFEFF'",
":",
"f",
".",
"seek",
"(",
"0",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Utils.py#L219-L226 | ||
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/internal/enum_type_wrapper.py | python | EnumTypeWrapper.Name | (self, number) | Returns a string containing the name of an enum value. | Returns a string containing the name of an enum value. | [
"Returns",
"a",
"string",
"containing",
"the",
"name",
"of",
"an",
"enum",
"value",
"."
] | def Name(self, number):
"""Returns a string containing the name of an enum value."""
if number in self._enum_type.values_by_number:
return self._enum_type.values_by_number[number].name
raise ValueError('Enum %s has no name defined for value %d' % (
self._enum_type.name, number)) | [
"def",
"Name",
"(",
"self",
",",
"number",
")",
":",
"if",
"number",
"in",
"self",
".",
"_enum_type",
".",
"values_by_number",
":",
"return",
"self",
".",
"_enum_type",
".",
"values_by_number",
"[",
"number",
"]",
".",
"name",
"raise",
"ValueError",
"(",
... | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/internal/enum_type_wrapper.py#L51-L56 | ||
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/ai_manager/module/index_advisor/uninstall.py | python | UnInstaller._get_install_info | () | Get installed information from record file.
install time | install version | install path | Get installed information from record file.
install time | install version | install path | [
"Get",
"installed",
"information",
"from",
"record",
"file",
".",
"install",
"time",
"|",
"install",
"version",
"|",
"install",
"path"
] | def _get_install_info():
"""
Get installed information from record file.
install time | install version | install path
"""
install_time, install_version, install_path = '', '', ''
if not os.path.isfile(VERSION_RECORD_FILE_INDEX_ADVISOR):
raise Exception(
... | [
"def",
"_get_install_info",
"(",
")",
":",
"install_time",
",",
"install_version",
",",
"install_path",
"=",
"''",
",",
"''",
",",
"''",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"VERSION_RECORD_FILE_INDEX_ADVISOR",
")",
":",
"raise",
"Exception",
... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_manager/module/index_advisor/uninstall.py#L35-L54 | ||
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/scripts/cpp_lint.py | python | FindNextMatchingAngleBracket | (clean_lines, linenum, init_suffix) | return True | Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a matching bracket exists. | Find the corresponding > to close a template. | [
"Find",
"the",
"corresponding",
">",
"to",
"close",
"a",
"template",
"."
] | def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix):
"""Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a ... | [
"def",
"FindNextMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_suffix",
")",
":",
"line",
"=",
"init_suffix",
"nesting_stack",
"=",
"[",
"'<'",
"]",
"while",
"True",
":",
"# Find the next operator that can tell us whether < is used as an",
"# openin... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L2447-L2513 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextObject.FindPosition | (*args, **kwargs) | return _richtext.RichTextObject_FindPosition(*args, **kwargs) | FindPosition(self, DC dc, RichTextDrawingContext context, long index,
Point OUTPUT, int OUTPUT, bool forceLineStart) -> bool | FindPosition(self, DC dc, RichTextDrawingContext context, long index,
Point OUTPUT, int OUTPUT, bool forceLineStart) -> bool | [
"FindPosition",
"(",
"self",
"DC",
"dc",
"RichTextDrawingContext",
"context",
"long",
"index",
"Point",
"OUTPUT",
"int",
"OUTPUT",
"bool",
"forceLineStart",
")",
"-",
">",
"bool"
] | def FindPosition(*args, **kwargs):
"""
FindPosition(self, DC dc, RichTextDrawingContext context, long index,
Point OUTPUT, int OUTPUT, bool forceLineStart) -> bool
"""
return _richtext.RichTextObject_FindPosition(*args, **kwargs) | [
"def",
"FindPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_FindPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1187-L1192 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/lib2to3/pgen2/tokenize.py | python | generate_tokens | (readline) | The generate_tokens() generator requires one argument, readline, which
must be a callable object which provides the same interface as the
readline() method of built-in file objects. Each call to the function
should return one line of input as a string. Alternately, readline
can be a callable function t... | The generate_tokens() generator requires one argument, readline, which
must be a callable object which provides the same interface as the
readline() method of built-in file objects. Each call to the function
should return one line of input as a string. Alternately, readline
can be a callable function t... | [
"The",
"generate_tokens",
"()",
"generator",
"requires",
"one",
"argument",
"readline",
"which",
"must",
"be",
"a",
"callable",
"object",
"which",
"provides",
"the",
"same",
"interface",
"as",
"the",
"readline",
"()",
"method",
"of",
"built",
"-",
"in",
"file"... | def generate_tokens(readline):
"""
The generate_tokens() generator requires one argument, readline, which
must be a callable object which provides the same interface as the
readline() method of built-in file objects. Each call to the function
should return one line of input as a string. Alternately... | [
"def",
"generate_tokens",
"(",
"readline",
")",
":",
"lnum",
"=",
"parenlev",
"=",
"continued",
"=",
"0",
"contstr",
",",
"needcont",
"=",
"''",
",",
"0",
"contline",
"=",
"None",
"indents",
"=",
"[",
"0",
"]",
"# 'stashed' and 'async_*' are used for async/awa... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/lib2to3/pgen2/tokenize.py#L335-L559 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py | python | ParserElement.matches | (self, testString, parseAll=True) | Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match
- parseAll - (default=C{True}) - flag to pass to C{L{par... | Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match
- parseAll - (default=C{True}) - flag to pass to C{L{par... | [
"Method",
"for",
"quick",
"testing",
"of",
"a",
"parser",
"against",
"a",
"test",
"string",
".",
"Good",
"for",
"simple",
"inline",
"microtests",
"of",
"sub",
"expressions",
"while",
"building",
"up",
"larger",
"parser",
".",
"Parameters",
":",
"-",
"testStr... | def matches(self, testString, parseAll=True):
"""
Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match... | [
"def",
"matches",
"(",
"self",
",",
"testString",
",",
"parseAll",
"=",
"True",
")",
":",
"try",
":",
"self",
".",
"parseString",
"(",
"_ustr",
"(",
"testString",
")",
",",
"parseAll",
"=",
"parseAll",
")",
"return",
"True",
"except",
"ParseBaseException",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py#L2213-L2230 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/credentials.py | python | AssumeRoleCredentialFetcher._create_client | (self) | return self._client_creator(
'sts',
aws_access_key_id=frozen_credentials.access_key,
aws_secret_access_key=frozen_credentials.secret_key,
aws_session_token=frozen_credentials.token,
) | Create an STS client using the source credentials. | Create an STS client using the source credentials. | [
"Create",
"an",
"STS",
"client",
"using",
"the",
"source",
"credentials",
"."
] | def _create_client(self):
"""Create an STS client using the source credentials."""
frozen_credentials = self._source_credentials.get_frozen_credentials()
return self._client_creator(
'sts',
aws_access_key_id=frozen_credentials.access_key,
aws_secret_access_key... | [
"def",
"_create_client",
"(",
"self",
")",
":",
"frozen_credentials",
"=",
"self",
".",
"_source_credentials",
".",
"get_frozen_credentials",
"(",
")",
"return",
"self",
".",
"_client_creator",
"(",
"'sts'",
",",
"aws_access_key_id",
"=",
"frozen_credentials",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/credentials.py#L806-L814 | |
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/pysixd/transform.py | python | Arcball.next | (self, acceleration=0.0) | Continue rotation in direction of last drag. | Continue rotation in direction of last drag. | [
"Continue",
"rotation",
"in",
"direction",
"of",
"last",
"drag",
"."
] | def next(self, acceleration=0.0):
"""Continue rotation in direction of last drag."""
q = quaternion_slerp(self._qpre, self._qnow, 2.0+acceleration, False)
self._qpre, self._qnow = self._qnow, q | [
"def",
"next",
"(",
"self",
",",
"acceleration",
"=",
"0.0",
")",
":",
"q",
"=",
"quaternion_slerp",
"(",
"self",
".",
"_qpre",
",",
"self",
".",
"_qnow",
",",
"2.0",
"+",
"acceleration",
",",
"False",
")",
"self",
".",
"_qpre",
",",
"self",
".",
"... | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/pysixd/transform.py#L1607-L1610 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/shutil.py | python | copyfileobj | (fsrc, fdst, length=16*1024) | copy data from file-like object fsrc to file-like object fdst | copy data from file-like object fsrc to file-like object fdst | [
"copy",
"data",
"from",
"file",
"-",
"like",
"object",
"fsrc",
"to",
"file",
"-",
"like",
"object",
"fdst"
] | def copyfileobj(fsrc, fdst, length=16*1024):
"""copy data from file-like object fsrc to file-like object fdst"""
while 1:
buf = fsrc.read(length)
if not buf:
break
fdst.write(buf) | [
"def",
"copyfileobj",
"(",
"fsrc",
",",
"fdst",
",",
"length",
"=",
"16",
"*",
"1024",
")",
":",
"while",
"1",
":",
"buf",
"=",
"fsrc",
".",
"read",
"(",
"length",
")",
"if",
"not",
"buf",
":",
"break",
"fdst",
".",
"write",
"(",
"buf",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/shutil.py#L60-L66 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | command | (command_name=None, doc=None) | return callable | A decorator function that registers an LLDB command line
command that is bound to the function it is attached to. | A decorator function that registers an LLDB command line
command that is bound to the function it is attached to. | [
"A",
"decorator",
"function",
"that",
"registers",
"an",
"LLDB",
"command",
"line",
"command",
"that",
"is",
"bound",
"to",
"the",
"function",
"it",
"is",
"attached",
"to",
"."
] | def command(command_name=None, doc=None):
import lldb
"""A decorator function that registers an LLDB command line
command that is bound to the function it is attached to."""
def callable(function):
"""Registers an lldb command for the decorated function."""
command = "command script ... | [
"def",
"command",
"(",
"command_name",
"=",
"None",
",",
"doc",
"=",
"None",
")",
":",
"import",
"lldb",
"def",
"callable",
"(",
"function",
")",
":",
"\"\"\"Registers an lldb command for the decorated function.\"\"\"",
"command",
"=",
"\"command script add -f %s.%s %s\... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L15389-L15401 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/sandbox.py | python | AbstractSandbox._remap_output | (self, operation, path) | return self._validate_path(path) | Called for path outputs | Called for path outputs | [
"Called",
"for",
"path",
"outputs"
] | def _remap_output(self, operation, path):
"""Called for path outputs"""
return self._validate_path(path) | [
"def",
"_remap_output",
"(",
"self",
",",
"operation",
",",
"path",
")",
":",
"return",
"self",
".",
"_validate_path",
"(",
"path",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/sandbox.py#L364-L366 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer._render_node_traceback | (self, node_name) | return debugger_cli_common.rich_text_lines_from_rich_line_list(lines) | Render traceback of a node's creation in Python, if available.
Args:
node_name: (str) name of the node.
Returns:
A RichTextLines object containing the stack trace of the node's
construction. | Render traceback of a node's creation in Python, if available. | [
"Render",
"traceback",
"of",
"a",
"node",
"s",
"creation",
"in",
"Python",
"if",
"available",
"."
] | def _render_node_traceback(self, node_name):
"""Render traceback of a node's creation in Python, if available.
Args:
node_name: (str) name of the node.
Returns:
A RichTextLines object containing the stack trace of the node's
construction.
"""
lines = [RL(""), RL(""), RL("Traceba... | [
"def",
"_render_node_traceback",
"(",
"self",
",",
"node_name",
")",
":",
"lines",
"=",
"[",
"RL",
"(",
"\"\"",
")",
",",
"RL",
"(",
"\"\"",
")",
",",
"RL",
"(",
"\"Traceback of node construction:\"",
",",
"\"bold\"",
")",
"]",
"try",
":",
"node_stack",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py#L839-L872 | |
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | panreas_hnn/hed-globalweight/scripts/cpp_lint.py | python | FileInfo.Extension | (self) | return self.Split()[2] | File extension - text following the final period. | File extension - text following the final period. | [
"File",
"extension",
"-",
"text",
"following",
"the",
"final",
"period",
"."
] | def Extension(self):
"""File extension - text following the final period."""
return self.Split()[2] | [
"def",
"Extension",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"2",
"]"
] | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/scripts/cpp_lint.py#L948-L950 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/util/file_util.py | python | intra_s3_copy_model | (s3_src_path, s3_dest_path, is_dir=False, aws_credentials = {}) | copy model from a source s3 path to the target s3 path. set 'is_dir' to True if you plan
to copy the directory. set 'is_dir' to False if you only plan to copy a single file.
the default value for 'is_dir' is False. | copy model from a source s3 path to the target s3 path. set 'is_dir' to True if you plan
to copy the directory. set 'is_dir' to False if you only plan to copy a single file.
the default value for 'is_dir' is False. | [
"copy",
"model",
"from",
"a",
"source",
"s3",
"path",
"to",
"the",
"target",
"s3",
"path",
".",
"set",
"is_dir",
"to",
"True",
"if",
"you",
"plan",
"to",
"copy",
"the",
"directory",
".",
"set",
"is_dir",
"to",
"False",
"if",
"you",
"only",
"plan",
"t... | def intra_s3_copy_model(s3_src_path, s3_dest_path, is_dir=False, aws_credentials = {}):
'''
copy model from a source s3 path to the target s3 path. set 'is_dir' to True if you plan
to copy the directory. set 'is_dir' to False if you only plan to copy a single file.
the default value for 'is_dir' is Fals... | [
"def",
"intra_s3_copy_model",
"(",
"s3_src_path",
",",
"s3_dest_path",
",",
"is_dir",
"=",
"False",
",",
"aws_credentials",
"=",
"{",
"}",
")",
":",
"assert",
"(",
"is_s3_path",
"(",
"s3_src_path",
")",
"and",
"is_s3_path",
"(",
"s3_dest_path",
")",
")",
"# ... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/util/file_util.py#L649-L676 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parse/standard_method.py | python | flatten | (x, order='C') | return F.reshape(F.transpose(x, new_order), (-1,)) | r"""
Return a copy of the tensor collapsed into one dimension.
Args:
order (str, optional): Can choose between 'C' and 'F'. 'C' means to
flatten in row-major (C-style) order. 'F' means to flatten in column-major
(Fortran-style) order. Only 'C' and 'F' are supported. Default: 'C'... | r"""
Return a copy of the tensor collapsed into one dimension. | [
"r",
"Return",
"a",
"copy",
"of",
"the",
"tensor",
"collapsed",
"into",
"one",
"dimension",
"."
] | def flatten(x, order='C'):
r"""
Return a copy of the tensor collapsed into one dimension.
Args:
order (str, optional): Can choose between 'C' and 'F'. 'C' means to
flatten in row-major (C-style) order. 'F' means to flatten in column-major
(Fortran-style) order. Only 'C' and ... | [
"def",
"flatten",
"(",
"x",
",",
"order",
"=",
"'C'",
")",
":",
"order",
"=",
"check_flatten_order_const",
"(",
"order",
")",
"if",
"order",
"==",
"'C'",
":",
"return",
"F",
".",
"reshape",
"(",
"x",
",",
"(",
"-",
"1",
",",
")",
")",
"perm",
"="... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L320-L353 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ToolBarBase.AddLabelTool | (self, id, label, bitmap,
bmpDisabled = wx.NullBitmap,
kind = wx.ITEM_NORMAL,
shortHelp = '', longHelp = '',
clientData = None) | return self.DoAddTool(id, label, bitmap, bmpDisabled, kind,
shortHelp, longHelp, clientData) | The full AddTool() function.
If bmpDisabled is wx.NullBitmap, a shadowed version of the normal bitmap
is created and used as the disabled image. | The full AddTool() function. | [
"The",
"full",
"AddTool",
"()",
"function",
"."
] | def AddLabelTool(self, id, label, bitmap,
bmpDisabled = wx.NullBitmap,
kind = wx.ITEM_NORMAL,
shortHelp = '', longHelp = '',
clientData = None):
'''
The full AddTool() function.
If bmpDisabled is wx.NullBitmap, ... | [
"def",
"AddLabelTool",
"(",
"self",
",",
"id",
",",
"label",
",",
"bitmap",
",",
"bmpDisabled",
"=",
"wx",
".",
"NullBitmap",
",",
"kind",
"=",
"wx",
".",
"ITEM_NORMAL",
",",
"shortHelp",
"=",
"''",
",",
"longHelp",
"=",
"''",
",",
"clientData",
"=",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3674-L3686 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/examples/tutorials/mnist/fully_connected_feed.py | python | do_eval | (sess,
eval_correct,
images_placeholder,
labels_placeholder,
data_set) | Runs one evaluation against the full epoch of data.
Args:
sess: The session in which the model has been trained.
eval_correct: The Tensor that returns the number of correct predictions.
images_placeholder: The images placeholder.
labels_placeholder: The labels placeholder.
data_set: The set of im... | Runs one evaluation against the full epoch of data. | [
"Runs",
"one",
"evaluation",
"against",
"the",
"full",
"epoch",
"of",
"data",
"."
] | def do_eval(sess,
eval_correct,
images_placeholder,
labels_placeholder,
data_set):
"""Runs one evaluation against the full epoch of data.
Args:
sess: The session in which the model has been trained.
eval_correct: The Tensor that returns the number of correct ... | [
"def",
"do_eval",
"(",
"sess",
",",
"eval_correct",
",",
"images_placeholder",
",",
"labels_placeholder",
",",
"data_set",
")",
":",
"# And run one epoch of eval.",
"true_count",
"=",
"0",
"# Counts the number of correct predictions.",
"steps_per_epoch",
"=",
"data_set",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/examples/tutorials/mnist/fully_connected_feed.py#L86-L112 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/layer/rnns.py | python | _check_is_tuple | (param_name, input_data, cls_name) | Internal function, used to check whether the input data is Tensor. | Internal function, used to check whether the input data is Tensor. | [
"Internal",
"function",
"used",
"to",
"check",
"whether",
"the",
"input",
"data",
"is",
"Tensor",
"."
] | def _check_is_tuple(param_name, input_data, cls_name):
"""Internal function, used to check whether the input data is Tensor."""
if input_data is not None and not isinstance(P.typeof(input_data), mstype.Tuple):
raise TypeError(f"For '{cls_name}', the '{param_name}' should be '{mstype.Tuple}', "
... | [
"def",
"_check_is_tuple",
"(",
"param_name",
",",
"input_data",
",",
"cls_name",
")",
":",
"if",
"input_data",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"P",
".",
"typeof",
"(",
"input_data",
")",
",",
"mstype",
".",
"Tuple",
")",
":",
"raise... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/rnns.py#L69-L73 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2.py | python | Response._get_status_message | (self) | return self.status.split(' ', 1)[1] | The response status message, as a string. | The response status message, as a string. | [
"The",
"response",
"status",
"message",
"as",
"a",
"string",
"."
] | def _get_status_message(self):
"""The response status message, as a string."""
return self.status.split(' ', 1)[1] | [
"def",
"_get_status_message",
"(",
"self",
")",
":",
"return",
"self",
".",
"status",
".",
"split",
"(",
"' '",
",",
"1",
")",
"[",
"1",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L427-L429 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.