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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/setuptools/pkg_resources.py | python | EntryPoint.parse | (cls, src, dist=None) | Parse a single entry point from string `src`
Entry point syntax follows the form::
name = some.module:some.attr [extra1, extra2]
The entry name and module name are required, but the ``:attrs`` and
``[extras]`` parts are optional | Parse a single entry point from string `src` | [
"Parse",
"a",
"single",
"entry",
"point",
"from",
"string",
"src"
] | def parse(cls, src, dist=None):
"""Parse a single entry point from string `src`
Entry point syntax follows the form::
name = some.module:some.attr [extra1, extra2]
The entry name and module name are required, but the ``:attrs`` and
``[extras]`` parts are optional
"... | [
"def",
"parse",
"(",
"cls",
",",
"src",
",",
"dist",
"=",
"None",
")",
":",
"try",
":",
"attrs",
"=",
"extras",
"=",
"(",
")",
"name",
",",
"value",
"=",
"src",
".",
"split",
"(",
"'='",
",",
"1",
")",
"if",
"'['",
"in",
"value",
":",
"value"... | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L2170-L2199 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/doxy2swig.py | python | shift | (txt, indent = ' ', prepend = '') | return ret | Return a list corresponding to the lines of text in the `txt` list
indented by `indent`. Prepend instead the string given in `prepend` to the
beginning of the first line. Note that if len(prepend) > len(indent), then
`prepend` will be truncated (doing better is tricky!). This preserves a
special '' ent... | Return a list corresponding to the lines of text in the `txt` list
indented by `indent`. Prepend instead the string given in `prepend` to the
beginning of the first line. Note that if len(prepend) > len(indent), then
`prepend` will be truncated (doing better is tricky!). This preserves a
special '' ent... | [
"Return",
"a",
"list",
"corresponding",
"to",
"the",
"lines",
"of",
"text",
"in",
"the",
"txt",
"list",
"indented",
"by",
"indent",
".",
"Prepend",
"instead",
"the",
"string",
"given",
"in",
"prepend",
"to",
"the",
"beginning",
"of",
"the",
"first",
"line"... | def shift(txt, indent = ' ', prepend = ''):
"""Return a list corresponding to the lines of text in the `txt` list
indented by `indent`. Prepend instead the string given in `prepend` to the
beginning of the first line. Note that if len(prepend) > len(indent), then
`prepend` will be truncated (doing be... | [
"def",
"shift",
"(",
"txt",
",",
"indent",
"=",
"' '",
",",
"prepend",
"=",
"''",
")",
":",
"if",
"type",
"(",
"indent",
")",
"is",
"int",
":",
"indent",
"=",
"indent",
"*",
"' '",
"special_end",
"=",
"txt",
"[",
"-",
"1",
":",
"]",
"==",
"[... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/doxy2swig.py#L75-L97 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/utils/ConfigManager.py | python | ConfigManager.__init__ | (self) | Constructor. | Constructor. | [
"Constructor",
"."
] | def __init__(self):
"""
Constructor.
"""
configparser.ConfigParser.__init__(self)
self.__prop = dict()
self._setProps()
# Now look for an ac.ini file within
# first the current directory and then
# the users $HOME directory. If not found
#... | [
"def",
"__init__",
"(",
"self",
")",
":",
"configparser",
".",
"ConfigParser",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"__prop",
"=",
"dict",
"(",
")",
"self",
".",
"_setProps",
"(",
")",
"# Now look for an ac.ini file within",
"# first the current direc... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/ConfigManager.py#L38-L57 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/data/transform/vision/functional.py | python | to_gray | (image) | return cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | r"""Change BGR format image's color space to gray.
Args:
image: input BGR format image, with `(H, W, C)` shape.
Returns:
gray format image, with `(H, W, C)` shape. | r"""Change BGR format image's color space to gray. | [
"r",
"Change",
"BGR",
"format",
"image",
"s",
"color",
"space",
"to",
"gray",
"."
] | def to_gray(image):
r"""Change BGR format image's color space to gray.
Args:
image: input BGR format image, with `(H, W, C)` shape.
Returns:
gray format image, with `(H, W, C)` shape.
"""
return cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | [
"def",
"to_gray",
"(",
"image",
")",
":",
"return",
"cv2",
".",
"cvtColor",
"(",
"image",
",",
"cv2",
".",
"COLOR_BGR2GRAY",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/data/transform/vision/functional.py#L35-L44 | |
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | python/caffe/draw.py | python | get_layer_label | (layer, rankdir) | return node_label | Define node label based on layer type.
Parameters
----------
layer : ?
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
Returns
-------
string :
A label for the current layer | Define node label based on layer type. | [
"Define",
"node",
"label",
"based",
"on",
"layer",
"type",
"."
] | def get_layer_label(layer, rankdir):
"""Define node label based on layer type.
Parameters
----------
layer : ?
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
Returns
-------
string :
A label for the current layer
"""
if rankdir in ('TB', 'BT'):
... | [
"def",
"get_layer_label",
"(",
"layer",
",",
"rankdir",
")",
":",
"if",
"rankdir",
"in",
"(",
"'TB'",
",",
"'BT'",
")",
":",
"# If graph orientation is vertical, horizontal space is free and",
"# vertical space is not; separate words with spaces",
"separator",
"=",
"' '",
... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/python/caffe/draw.py#L62-L114 | |
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/assembly_graph_copy_depth.py | python | assign_copy_depths_where_needed | (graph, segment_numbers, new_depths, error_margin) | return success | For the given segments, this function assigns the corresponding copy depths, scaled to fit
the segment. If a segment already has copy depths, it is skipped (i.e. this function only
write new copy depths, doesn't overwrite existing ones).
It will only create copy depths if doing so is within the allowed err... | For the given segments, this function assigns the corresponding copy depths, scaled to fit
the segment. If a segment already has copy depths, it is skipped (i.e. this function only
write new copy depths, doesn't overwrite existing ones).
It will only create copy depths if doing so is within the allowed err... | [
"For",
"the",
"given",
"segments",
"this",
"function",
"assigns",
"the",
"corresponding",
"copy",
"depths",
"scaled",
"to",
"fit",
"the",
"segment",
".",
"If",
"a",
"segment",
"already",
"has",
"copy",
"depths",
"it",
"is",
"skipped",
"(",
"i",
".",
"e",
... | def assign_copy_depths_where_needed(graph, segment_numbers, new_depths, error_margin):
"""
For the given segments, this function assigns the corresponding copy depths, scaled to fit
the segment. If a segment already has copy depths, it is skipped (i.e. this function only
write new copy depths, doesn't ... | [
"def",
"assign_copy_depths_where_needed",
"(",
"graph",
",",
"segment_numbers",
",",
"new_depths",
",",
"error_margin",
")",
":",
"success",
"=",
"False",
"for",
"i",
",",
"num",
"in",
"enumerate",
"(",
"segment_numbers",
")",
":",
"if",
"num",
"not",
"in",
... | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph_copy_depth.py#L405-L419 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | GenericDirCtrl.DoResize | (*args, **kwargs) | return _controls_.GenericDirCtrl_DoResize(*args, **kwargs) | DoResize(self) | DoResize(self) | [
"DoResize",
"(",
"self",
")"
] | def DoResize(*args, **kwargs):
"""DoResize(self)"""
return _controls_.GenericDirCtrl_DoResize(*args, **kwargs) | [
"def",
"DoResize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"GenericDirCtrl_DoResize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5765-L5767 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/codeunit.py | python | CodeUnit.source_file | (self) | Return an open file for reading the source of the code unit. | Return an open file for reading the source of the code unit. | [
"Return",
"an",
"open",
"file",
"for",
"reading",
"the",
"source",
"of",
"the",
"code",
"unit",
"."
] | def source_file(self):
"""Return an open file for reading the source of the code unit."""
if os.path.exists(self.filename):
# A regular text file: open it.
return open_source(self.filename)
# Maybe it's in a zip file?
source = self.file_locator.get_zip_data(self.... | [
"def",
"source_file",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"filename",
")",
":",
"# A regular text file: open it.",
"return",
"open_source",
"(",
"self",
".",
"filename",
")",
"# Maybe it's in a zip file?",
"source",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/codeunit.py#L103-L117 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGArrayEditorDialog.GetTextCtrlValidator | (*args, **kwargs) | return _propgrid.PGArrayEditorDialog_GetTextCtrlValidator(*args, **kwargs) | GetTextCtrlValidator(self) -> Validator | GetTextCtrlValidator(self) -> Validator | [
"GetTextCtrlValidator",
"(",
"self",
")",
"-",
">",
"Validator"
] | def GetTextCtrlValidator(*args, **kwargs):
"""GetTextCtrlValidator(self) -> Validator"""
return _propgrid.PGArrayEditorDialog_GetTextCtrlValidator(*args, **kwargs) | [
"def",
"GetTextCtrlValidator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGArrayEditorDialog_GetTextCtrlValidator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3198-L3200 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/__init__.py | python | Pipe | (duplex=True) | return Pipe(duplex) | Returns two connection object connected by a pipe | Returns two connection object connected by a pipe | [
"Returns",
"two",
"connection",
"object",
"connected",
"by",
"a",
"pipe"
] | def Pipe(duplex=True):
'''
Returns two connection object connected by a pipe
'''
from multiprocessing.connection import Pipe
return Pipe(duplex) | [
"def",
"Pipe",
"(",
"duplex",
"=",
"True",
")",
":",
"from",
"multiprocessing",
".",
"connection",
"import",
"Pipe",
"return",
"Pipe",
"(",
"duplex",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/__init__.py#L102-L107 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/config/fonts.py | python | is_ubuntu | () | Return True if we're running an Ubuntu distro else return False | Return True if we're running an Ubuntu distro else return False | [
"Return",
"True",
"if",
"we",
"re",
"running",
"an",
"Ubuntu",
"distro",
"else",
"return",
"False"
] | def is_ubuntu() -> bool:
"""Return True if we're running an Ubuntu distro else return False"""
# platform.linux_distribution doesn't exist in Python 3.5
if sys.platform.startswith('linux') and osp.isfile('/etc/lsb-release'):
with open('/etc/lsb-release') as handle:
release_info = handle.... | [
"def",
"is_ubuntu",
"(",
")",
"->",
"bool",
":",
"# platform.linux_distribution doesn't exist in Python 3.5",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
"and",
"osp",
".",
"isfile",
"(",
"'/etc/lsb-release'",
")",
":",
"with",
"open",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/config/fonts.py#L21-L29 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | is_sparse | (v,threshold='auto') | return (nnz < threshold) | Returns true if v is a sparse array, with #nonzeros(v) < threshold(shape(v)).
Args:
v (Expression): the array
threshold (optional): either 'auto', a constant, or a function of a
shape. If threshold=auto, the threshold is sqrt(product(shape)) | Returns true if v is a sparse array, with #nonzeros(v) < threshold(shape(v)). | [
"Returns",
"true",
"if",
"v",
"is",
"a",
"sparse",
"array",
"with",
"#nonzeros",
"(",
"v",
")",
"<",
"threshold",
"(",
"shape",
"(",
"v",
"))",
"."
] | def is_sparse(v,threshold='auto'):
"""Returns true if v is a sparse array, with #nonzeros(v) < threshold(shape(v)).
Args:
v (Expression): the array
threshold (optional): either 'auto', a constant, or a function of a
shape. If threshold=auto, the threshold is sqrt(product(shape))... | [
"def",
"is_sparse",
"(",
"v",
",",
"threshold",
"=",
"'auto'",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"ConstantExpression",
")",
":",
"v",
"=",
"v",
".",
"value",
"if",
"isinstance",
"(",
"v",
",",
"Expression",
")",
":",
"raise",
"ValueError",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L4517-L4535 | |
baidu/AnyQ | d94d450d2aaa5f7ed73424b10aa4539835b97527 | tools/simnet/train/tf/losses/simnet_loss.py | python | SoftmaxWithLoss.ops | (self, pred, label) | return tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=pred,
labels=label)) | operation | operation | [
"operation"
] | def ops(self, pred, label):
"""
operation
"""
return tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=pred,
labels=label)) | [
"def",
"ops",
"(",
"self",
",",
"pred",
",",
"label",
")",
":",
"return",
"tf",
".",
"reduce_mean",
"(",
"tf",
".",
"nn",
".",
"softmax_cross_entropy_with_logits",
"(",
"logits",
"=",
"pred",
",",
"labels",
"=",
"label",
")",
")"
] | https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/train/tf/losses/simnet_loss.py#L73-L78 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/prettytable.py | python | PrettyTable._get_float_format | (self) | return self._float_format | Controls formatting of floating point data
Arguments:
float_format - floating point format string | Controls formatting of floating point data
Arguments: | [
"Controls",
"formatting",
"of",
"floating",
"point",
"data",
"Arguments",
":"
] | def _get_float_format(self):
"""Controls formatting of floating point data
Arguments:
float_format - floating point format string"""
return self._float_format | [
"def",
"_get_float_format",
"(",
"self",
")",
":",
"return",
"self",
".",
"_float_format"
] | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/prettytable.py#L605-L610 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/_continuous_distns.py | python | norm_gen.fit | (self, data, **kwds) | return loc, scale | %(super)s
This function (norm_gen.fit) uses explicit formulas for the maximum
likelihood estimation of the parameters, so the `optimizer` argument
is ignored. | %(super)s
This function (norm_gen.fit) uses explicit formulas for the maximum
likelihood estimation of the parameters, so the `optimizer` argument
is ignored. | [
"%",
"(",
"super",
")",
"s",
"This",
"function",
"(",
"norm_gen",
".",
"fit",
")",
"uses",
"explicit",
"formulas",
"for",
"the",
"maximum",
"likelihood",
"estimation",
"of",
"the",
"parameters",
"so",
"the",
"optimizer",
"argument",
"is",
"ignored",
"."
] | def fit(self, data, **kwds):
"""%(super)s
This function (norm_gen.fit) uses explicit formulas for the maximum
likelihood estimation of the parameters, so the `optimizer` argument
is ignored.
"""
floc = kwds.get('floc', None)
fscale = kwds.get('fscale', None)
... | [
"def",
"fit",
"(",
"self",
",",
"data",
",",
"*",
"*",
"kwds",
")",
":",
"floc",
"=",
"kwds",
".",
"get",
"(",
"'floc'",
",",
"None",
")",
"fscale",
"=",
"kwds",
".",
"get",
"(",
"'fscale'",
",",
"None",
")",
"if",
"floc",
"is",
"not",
"None",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_continuous_distns.py#L160-L188 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | analyzer_params | (args) | return prefix_with('-Xclang', result) | A group of command line arguments can mapped to command
line arguments of the analyzer. This method generates those. | A group of command line arguments can mapped to command
line arguments of the analyzer. This method generates those. | [
"A",
"group",
"of",
"command",
"line",
"arguments",
"can",
"mapped",
"to",
"command",
"line",
"arguments",
"of",
"the",
"analyzer",
".",
"This",
"method",
"generates",
"those",
"."
] | def analyzer_params(args):
""" A group of command line arguments can mapped to command
line arguments of the analyzer. This method generates those. """
result = []
if args.store_model:
result.append('-analyzer-store={0}'.format(args.store_model))
if args.constraints_model:
result.a... | [
"def",
"analyzer_params",
"(",
"args",
")",
":",
"result",
"=",
"[",
"]",
"if",
"args",
".",
"store_model",
":",
"result",
".",
"append",
"(",
"'-analyzer-store={0}'",
".",
"format",
"(",
"args",
".",
"store_model",
")",
")",
"if",
"args",
".",
"constrai... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/analyze.py#L366-L400 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Job.py | python | Jobs.were_interrupted | (self) | return self.job.interrupted() | Returns whether the jobs were interrupted by a signal. | Returns whether the jobs were interrupted by a signal. | [
"Returns",
"whether",
"the",
"jobs",
"were",
"interrupted",
"by",
"a",
"signal",
"."
] | def were_interrupted(self):
"""Returns whether the jobs were interrupted by a signal."""
return self.job.interrupted() | [
"def",
"were_interrupted",
"(",
"self",
")",
":",
"return",
"self",
".",
"job",
".",
"interrupted",
"(",
")"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Job.py#L112-L114 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/firefighter/update/common/buildbot/builder.py | python | Builder.current_builds | (self) | return self._current_builds | Set of build numbers currently building.
There may be multiple entries if there are multiple build slaves. | Set of build numbers currently building. | [
"Set",
"of",
"build",
"numbers",
"currently",
"building",
"."
] | def current_builds(self):
"""Set of build numbers currently building.
There may be multiple entries if there are multiple build slaves.
"""
return self._current_builds | [
"def",
"current_builds",
"(",
"self",
")",
":",
"return",
"self",
".",
"_current_builds"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/firefighter/update/common/buildbot/builder.py#L70-L75 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/runtime.py | python | Context.resolve | (self, key) | return rv | Looks up a variable like `__getitem__` or `get` but returns an
:class:`Undefined` object with the name of the name looked up. | Looks up a variable like `__getitem__` or `get` but returns an
:class:`Undefined` object with the name of the name looked up. | [
"Looks",
"up",
"a",
"variable",
"like",
"__getitem__",
"or",
"get",
"but",
"returns",
"an",
":",
"class",
":",
"Undefined",
"object",
"with",
"the",
"name",
"of",
"the",
"name",
"looked",
"up",
"."
] | def resolve(self, key):
"""Looks up a variable like `__getitem__` or `get` but returns an
:class:`Undefined` object with the name of the name looked up.
"""
if self._legacy_resolve_mode:
rv = resolve_or_missing(self, key)
else:
rv = self.resolve_or_missing... | [
"def",
"resolve",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"_legacy_resolve_mode",
":",
"rv",
"=",
"resolve_or_missing",
"(",
"self",
",",
"key",
")",
"else",
":",
"rv",
"=",
"self",
".",
"resolve_or_missing",
"(",
"key",
")",
"if",
"rv",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/runtime.py#L196-L206 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/kvstore.py | python | KVStore.push | (self, key, value, priority=0) | Pushes a single or a sequence of key-value pairs into the store.
This function returns immediately after adding an operator to the engine.
The actual operation is executed asynchronously. If there are consecutive
pushes to the same key, there is no guarantee on the serialization of pushes.
... | Pushes a single or a sequence of key-value pairs into the store. | [
"Pushes",
"a",
"single",
"or",
"a",
"sequence",
"of",
"key",
"-",
"value",
"pairs",
"into",
"the",
"store",
"."
] | def push(self, key, value, priority=0):
""" Pushes a single or a sequence of key-value pairs into the store.
This function returns immediately after adding an operator to the engine.
The actual operation is executed asynchronously. If there are consecutive
pushes to the same key, there ... | [
"def",
"push",
"(",
"self",
",",
"key",
",",
"value",
",",
"priority",
"=",
"0",
")",
":",
"ckeys",
",",
"cvals",
",",
"use_str_keys",
"=",
"_ctype_key_value",
"(",
"key",
",",
"value",
")",
"if",
"use_str_keys",
":",
"check_call",
"(",
"_LIB",
".",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/kvstore.py#L160-L237 | ||
gv22ga/dlib-face-recognition-android | 42d6305cbd85833f2b85bb79b70ab9ab004153c9 | tools/lint/cpplint.py | python | NestingState.InTemplateArgumentList | (self, clean_lines, linenum, pos) | return False | Check if current position is inside template argument list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
pos: position just after the suspected template argument.
Returns:
True if (linenum, pos) is inside template arguments. | Check if current position is inside template argument list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
pos: position just after the suspected template argument.
Returns:
True if (linenum, pos) is inside template arguments. | [
"Check",
"if",
"current",
"position",
"is",
"inside",
"template",
"argument",
"list",
".",
"Args",
":",
"clean_lines",
":",
"A",
"CleansedLines",
"instance",
"containing",
"the",
"file",
".",
"linenum",
":",
"The",
"number",
"of",
"the",
"line",
"to",
"check... | def InTemplateArgumentList(self, clean_lines, linenum, pos):
"""Check if current position is inside template argument list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
pos: position just after the suspected template argument.
R... | [
"def",
"InTemplateArgumentList",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"while",
"linenum",
"<",
"clean_lines",
".",
"NumLines",
"(",
")",
":",
"# Find the earliest character that might indicate a template argument",
"line",
"=",
"clean... | https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L2250-L2299 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saving_utils.py | python | model_metadata | (model, include_optimizer=True, require_config=True) | return metadata | Returns a dictionary containing the model metadata. | Returns a dictionary containing the model metadata. | [
"Returns",
"a",
"dictionary",
"containing",
"the",
"model",
"metadata",
"."
] | def model_metadata(model, include_optimizer=True, require_config=True):
"""Returns a dictionary containing the model metadata."""
from tensorflow.python.keras import __version__ as keras_version # pylint: disable=g-import-not-at-top
from tensorflow.python.keras.optimizer_v2 import optimizer_v2 # pylint: disable... | [
"def",
"model_metadata",
"(",
"model",
",",
"include_optimizer",
"=",
"True",
",",
"require_config",
"=",
"True",
")",
":",
"from",
"tensorflow",
".",
"python",
".",
"keras",
"import",
"__version__",
"as",
"keras_version",
"# pylint: disable=g-import-not-at-top",
"f... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saving_utils.py#L143-L189 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_utils/gazebo_world_parser.py | python | is_float | (text) | Tests if the specified string represents a float number.
Args:
text(str): text to check
Returns:
: bool -- True if the text can be parsed to a float, False if not. | Tests if the specified string represents a float number.
Args:
text(str): text to check
Returns:
: bool -- True if the text can be parsed to a float, False if not. | [
"Tests",
"if",
"the",
"specified",
"string",
"represents",
"a",
"float",
"number",
".",
"Args",
":",
"text",
"(",
"str",
")",
":",
"text",
"to",
"check",
"Returns",
":",
":",
"bool",
"--",
"True",
"if",
"the",
"text",
"can",
"be",
"parsed",
"to",
"a"... | def is_float(text):
"""Tests if the specified string represents a float number.
Args:
text(str): text to check
Returns:
: bool -- True if the text can be parsed to a float, False if not.
"""
try:
float(text)
return True
except (ValueError, TypeError):
return F... | [
"def",
"is_float",
"(",
"text",
")",
":",
"try",
":",
"float",
"(",
"text",
")",
"return",
"True",
"except",
"(",
"ValueError",
",",
"TypeError",
")",
":",
"return",
"False"
] | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_utils/gazebo_world_parser.py#L38-L49 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py | python | Index.__array_wrap__ | (self, result, context=None) | return Index(result, **attrs) | Gets called after a ufunc. | Gets called after a ufunc. | [
"Gets",
"called",
"after",
"a",
"ufunc",
"."
] | def __array_wrap__(self, result, context=None):
"""
Gets called after a ufunc.
"""
result = lib.item_from_zerodim(result)
if is_bool_dtype(result) or lib.is_scalar(result) or np.ndim(result) > 1:
return result
attrs = self._get_attributes_dict()
retur... | [
"def",
"__array_wrap__",
"(",
"self",
",",
"result",
",",
"context",
"=",
"None",
")",
":",
"result",
"=",
"lib",
".",
"item_from_zerodim",
"(",
"result",
")",
"if",
"is_bool_dtype",
"(",
"result",
")",
"or",
"lib",
".",
"is_scalar",
"(",
"result",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L627-L636 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintscoordentry.py | python | CartesianEntry.print_in_input_format_cfour | (self) | return " %17s %17s %17s\n" % (xstr, ystr, zstr) | Prints the updated geometry, in the format provided by the user.
This, for Cfour, not different from regular version. | Prints the updated geometry, in the format provided by the user.
This, for Cfour, not different from regular version. | [
"Prints",
"the",
"updated",
"geometry",
"in",
"the",
"format",
"provided",
"by",
"the",
"user",
".",
"This",
"for",
"Cfour",
"not",
"different",
"from",
"regular",
"version",
"."
] | def print_in_input_format_cfour(self):
"""Prints the updated geometry, in the format provided by the user.
This, for Cfour, not different from regular version.
"""
xstr = self.x.variable_to_string(12)
ystr = self.y.variable_to_string(12)
zstr = self.z.variable_to_string(... | [
"def",
"print_in_input_format_cfour",
"(",
"self",
")",
":",
"xstr",
"=",
"self",
".",
"x",
".",
"variable_to_string",
"(",
"12",
")",
"ystr",
"=",
"self",
".",
"y",
".",
"variable_to_string",
"(",
"12",
")",
"zstr",
"=",
"self",
".",
"z",
".",
"variab... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintscoordentry.py#L429-L437 | |
NervanaSystems/ngraph | f677a119765ca30636cf407009dabd118664951f | doc/sphinx/ngraph_theme/__init__.py | python | get_html_theme_path | () | return cur_dir | Return list of HTML theme paths. | Return list of HTML theme paths. | [
"Return",
"list",
"of",
"HTML",
"theme",
"paths",
"."
] | def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
return cur_dir | [
"def",
"get_html_theme_path",
"(",
")",
":",
"cur_dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
")",
")",
"return",
"cur_dir"
] | https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/doc/sphinx/ngraph_theme/__init__.py#L14-L17 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py | python | MultiDict.first | (self, key, default=missing) | Get the first value with a given key
:param key: The key to lookup
:param default: The default to return if key is
not found (throws if nothing is
specified) | Get the first value with a given key | [
"Get",
"the",
"first",
"value",
"with",
"a",
"given",
"key"
] | def first(self, key, default=missing):
"""Get the first value with a given key
:param key: The key to lookup
:param default: The default to return if key is
not found (throws if nothing is
specified)
"""
if key in self and dict.__g... | [
"def",
"first",
"(",
"self",
",",
"key",
",",
"default",
"=",
"missing",
")",
":",
"if",
"key",
"in",
"self",
"and",
"dict",
".",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"return",
"dict",
".",
"__getitem__",
"(",
"self",
",",
"key",
")",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py#L484-L496 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListItemAttr.GetFont | (*args, **kwargs) | return _controls_.ListItemAttr_GetFont(*args, **kwargs) | GetFont(self) -> Font | GetFont(self) -> Font | [
"GetFont",
"(",
"self",
")",
"-",
">",
"Font"
] | def GetFont(*args, **kwargs):
"""GetFont(self) -> Font"""
return _controls_.ListItemAttr_GetFont(*args, **kwargs) | [
"def",
"GetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItemAttr_GetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4122-L4124 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/support.py | python | bookmarks_handle | (dad) | return True | Handle the Bookmarks List | Handle the Bookmarks List | [
"Handle",
"the",
"Bookmarks",
"List"
] | def bookmarks_handle(dad):
"""Handle the Bookmarks List"""
dialog = gtk.Dialog(title=_("Handle the Bookmarks List"),
parent=dad.window,
flags=gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT) )
... | [
"def",
"bookmarks_handle",
"(",
"dad",
")",
":",
"dialog",
"=",
"gtk",
".",
"Dialog",
"(",
"title",
"=",
"_",
"(",
"\"Handle the Bookmarks List\"",
")",
",",
"parent",
"=",
"dad",
".",
"window",
",",
"flags",
"=",
"gtk",
".",
"DIALOG_MODAL",
"|",
"gtk",
... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/support.py#L1988-L2105 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/input/casteploader.py | python | CASTEPLoader._parse_block_header | (self, header_match, block_count) | return weight, q_vector | Parses the header of a block of frequencies and intensities
:param header_match: the regex match to the header
:param block_count: the count of blocks found so far
:returns: weight for this block of values | Parses the header of a block of frequencies and intensities | [
"Parses",
"the",
"header",
"of",
"a",
"block",
"of",
"frequencies",
"and",
"intensities"
] | def _parse_block_header(self, header_match, block_count):
"""
Parses the header of a block of frequencies and intensities
:param header_match: the regex match to the header
:param block_count: the count of blocks found so far
:returns: weight for this block of values
"""... | [
"def",
"_parse_block_header",
"(",
"self",
",",
"header_match",
",",
"block_count",
")",
":",
"# Found header block at start of frequencies",
"if",
"self",
".",
"_sum_rule",
"and",
"block_count",
"==",
"0",
":",
"q1",
",",
"q2",
",",
"q3",
",",
"weight",
",",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/input/casteploader.py#L34-L50 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/path.py | python | DPH5Path.is_file | (self) | return isinstance(self.root[self.name], h5py.Dataset) | Check if self is file. | Check if self is file. | [
"Check",
"if",
"self",
"is",
"file",
"."
] | def is_file(self) -> bool:
"""Check if self is file."""
if self.name not in self._keys:
return False
return isinstance(self.root[self.name], h5py.Dataset) | [
"def",
"is_file",
"(",
"self",
")",
"->",
"bool",
":",
"if",
"self",
".",
"name",
"not",
"in",
"self",
".",
"_keys",
":",
"return",
"False",
"return",
"isinstance",
"(",
"self",
".",
"root",
"[",
"self",
".",
"name",
"]",
",",
"h5py",
".",
"Dataset... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/path.py#L308-L312 | |
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/maya/scripts/walter.py | python | Walter.invertFrozen | (self, origin) | return self.details.invertFrozen(origin) | Inverse the freeze flag of the stand-in object. This flag cleans up the
sub-nodes and merges them together depending on the connected
transformations. Frozen sub-objects are much faster if they contain lots
of children.
:param str origin: The stand-in object. | Inverse the freeze flag of the stand-in object. This flag cleans up the
sub-nodes and merges them together depending on the connected
transformations. Frozen sub-objects are much faster if they contain lots
of children. | [
"Inverse",
"the",
"freeze",
"flag",
"of",
"the",
"stand",
"-",
"in",
"object",
".",
"This",
"flag",
"cleans",
"up",
"the",
"sub",
"-",
"nodes",
"and",
"merges",
"them",
"together",
"depending",
"on",
"the",
"connected",
"transformations",
".",
"Frozen",
"s... | def invertFrozen(self, origin):
"""
Inverse the freeze flag of the stand-in object. This flag cleans up the
sub-nodes and merges them together depending on the connected
transformations. Frozen sub-objects are much faster if they contain lots
of children.
:param str orig... | [
"def",
"invertFrozen",
"(",
"self",
",",
"origin",
")",
":",
"return",
"self",
".",
"details",
".",
"invertFrozen",
"(",
"origin",
")"
] | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walter.py#L485-L494 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Logs.py | python | warn | (*k, **kw) | Wrap logging.warn | Wrap logging.warn | [
"Wrap",
"logging",
".",
"warn"
] | def warn(*k, **kw):
"""
Wrap logging.warn
"""
global log
log.warn(*k, **kw) | [
"def",
"warn",
"(",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"global",
"log",
"log",
".",
"warn",
"(",
"*",
"k",
",",
"*",
"*",
"kw",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Logs.py#L249-L254 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/statistics.py | python | NormalDist.__pos__ | (x1) | return NormalDist(x1._mu, x1._sigma) | Return a copy of the instance. | Return a copy of the instance. | [
"Return",
"a",
"copy",
"of",
"the",
"instance",
"."
] | def __pos__(x1):
"Return a copy of the instance."
return NormalDist(x1._mu, x1._sigma) | [
"def",
"__pos__",
"(",
"x1",
")",
":",
"return",
"NormalDist",
"(",
"x1",
".",
"_mu",
",",
"x1",
".",
"_sigma",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/statistics.py#L1093-L1095 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | NativeFontInfo.SetPixelSize | (*args, **kwargs) | return _gdi_.NativeFontInfo_SetPixelSize(*args, **kwargs) | SetPixelSize(self, Size pixelSize) | SetPixelSize(self, Size pixelSize) | [
"SetPixelSize",
"(",
"self",
"Size",
"pixelSize",
")"
] | def SetPixelSize(*args, **kwargs):
"""SetPixelSize(self, Size pixelSize)"""
return _gdi_.NativeFontInfo_SetPixelSize(*args, **kwargs) | [
"def",
"SetPixelSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo_SetPixelSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2006-L2008 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel.calculate_node_field | (self, expression) | Store a node field calculated from the given expression.
The expression may include the following variables:
* 'time' to refer to the current time
* global variables (by name)
* node fields (by name)
* model coordinates ('X', 'Y', and 'Z')
Example:
>>> model.cal... | Store a node field calculated from the given expression. | [
"Store",
"a",
"node",
"field",
"calculated",
"from",
"the",
"given",
"expression",
"."
] | def calculate_node_field(self, expression):
"""
Store a node field calculated from the given expression.
The expression may include the following variables:
* 'time' to refer to the current time
* global variables (by name)
* node fields (by name)
* model coordin... | [
"def",
"calculate_node_field",
"(",
"self",
",",
"expression",
")",
":",
"if",
"'='",
"not",
"in",
"expression",
":",
"self",
".",
"_error",
"(",
"'Invalid expression'",
",",
"'A \"=\" sign must be present in the expression but '",
"'was not found.\\n\\nExpression: %s'",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L2263-L2315 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiDockingGuideWindow.DrawArrow | (self, dc) | Draws the docking guide arrow icon (not used if the docking guide images are ok).
:param `dc`: a :class:`DC` device context object. | Draws the docking guide arrow icon (not used if the docking guide images are ok). | [
"Draws",
"the",
"docking",
"guide",
"arrow",
"icon",
"(",
"not",
"used",
"if",
"the",
"docking",
"guide",
"images",
"are",
"ok",
")",
"."
] | def DrawArrow(self, dc):
"""
Draws the docking guide arrow icon (not used if the docking guide images are ok).
:param `dc`: a :class:`DC` device context object.
"""
rect = self.GetClientRect()
point = wx.Point()
point.x = (rect.GetLeft() + rect.GetRight()) / 2
... | [
"def",
"DrawArrow",
"(",
"self",
",",
"dc",
")",
":",
"rect",
"=",
"self",
".",
"GetClientRect",
"(",
")",
"point",
"=",
"wx",
".",
"Point",
"(",
")",
"point",
".",
"x",
"=",
"(",
"rect",
".",
"GetLeft",
"(",
")",
"+",
"rect",
".",
"GetRight",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L2112-L2152 | ||
zhaoweicai/mscnn | 534bcac5710a579d60827f192035f7eef6d8c585 | python/caffe/io.py | python | Transformer.set_input_scale | (self, in_, scale) | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign this scale factor
scale : scale coefficient | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE. | [
"Set",
"the",
"scale",
"of",
"preprocessed",
"inputs",
"s",
".",
"t",
".",
"the",
"blob",
"=",
"blob",
"*",
"scale",
".",
"N",
".",
"B",
".",
"input_scale",
"is",
"done",
"AFTER",
"mean",
"subtraction",
"and",
"other",
"preprocessing",
"while",
"raw_scal... | def set_input_scale(self, in_, scale):
"""
Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign... | [
"def",
"set_input_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"input_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/python/caffe/io.py#L262-L274 | ||
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | build/fbcode_builder/getdeps/load.py | python | load_project | (build_opts, project_name) | return LOADER.load_project(build_opts, project_name) | given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it | given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it | [
"given",
"the",
"name",
"of",
"a",
"project",
"or",
"a",
"path",
"to",
"a",
"manifest",
"file",
"load",
"up",
"the",
"ManifestParser",
"instance",
"for",
"it",
"and",
"return",
"it"
] | def load_project(build_opts, project_name):
"""given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it"""
return LOADER.load_project(build_opts, project_name) | [
"def",
"load_project",
"(",
"build_opts",
",",
"project_name",
")",
":",
"return",
"LOADER",
".",
"load_project",
"(",
"build_opts",
",",
"project_name",
")"
] | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/build/fbcode_builder/getdeps/load.py#L103-L106 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/examples/custom_ops_doc/simple_hash_table/simple_hash_table.py | python | SimpleHashTable._create_resource | (self) | return table_ref | Create the resource tensor handle.
`_create_resource` is an override of a method in base class
`TrackableResource` that is required for SavedModel support. It can be
called by the `resource_handle` property defined by `TrackableResource`.
Returns:
A tensor handle to the lookup table. | Create the resource tensor handle. | [
"Create",
"the",
"resource",
"tensor",
"handle",
"."
] | def _create_resource(self):
"""Create the resource tensor handle.
`_create_resource` is an override of a method in base class
`TrackableResource` that is required for SavedModel support. It can be
called by the `resource_handle` property defined by `TrackableResource`.
Returns:
A tensor hand... | [
"def",
"_create_resource",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_default_value",
".",
"get_shape",
"(",
")",
".",
"ndims",
"==",
"0",
"table_ref",
"=",
"gen_simple_hash_table_op",
".",
"examples_simple_hash_table_create",
"(",
"key_dtype",
"=",
"self",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/examples/custom_ops_doc/simple_hash_table/simple_hash_table.py#L84-L108 | |
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_SO3Command.py | python | SO3Command.serialize | (self, buff) | serialize message into buffer
:param buff: buffer, ``StringIO`` | serialize message into buffer
:param buff: buffer, ``StringIO`` | [
"serialize",
"message",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO"
] | def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
_x = self.header.frame_id
length = len(_x)
if python3 or type(_x) ==... | [
"def",
"serialize",
"(",
"self",
",",
"buff",
")",
":",
"try",
":",
"_x",
"=",
"self",
"buff",
".",
"write",
"(",
"_struct_3I",
".",
"pack",
"(",
"_x",
".",
"header",
".",
"seq",
",",
"_x",
".",
"header",
".",
"stamp",
".",
"secs",
",",
"_x",
"... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_SO3Command.py#L111-L138 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/tokenutil.py | python | InsertTokenAfter | (new_token, token) | Insert new_token after token.
Args:
new_token: A token to be added to the stream
token: A token already in the stream | Insert new_token after token. | [
"Insert",
"new_token",
"after",
"token",
"."
] | def InsertTokenAfter(new_token, token):
"""Insert new_token after token.
Args:
new_token: A token to be added to the stream
token: A token already in the stream
"""
new_token.previous = token
new_token.next = token.next
new_token.metadata = copy.copy(token.metadata)
if token.IsCode():
new_t... | [
"def",
"InsertTokenAfter",
"(",
"new_token",
",",
"token",
")",
":",
"new_token",
".",
"previous",
"=",
"token",
"new_token",
".",
"next",
"=",
"token",
".",
"next",
"new_token",
".",
"metadata",
"=",
"copy",
".",
"copy",
"(",
"token",
".",
"metadata",
"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/tokenutil.py#L241-L275 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/graphviz/py3/graphviz/files.py | python | File._view | (self, filepath, format, quiet) | Start the right viewer based on file format and platform. | Start the right viewer based on file format and platform. | [
"Start",
"the",
"right",
"viewer",
"based",
"on",
"file",
"format",
"and",
"platform",
"."
] | def _view(self, filepath, format, quiet):
"""Start the right viewer based on file format and platform."""
methodnames = [
f'_view_{format}_{backend.PLATFORM}',
f'_view_{backend.PLATFORM}',
]
for name in methodnames:
view_method = getattr(self, name, No... | [
"def",
"_view",
"(",
"self",
",",
"filepath",
",",
"format",
",",
"quiet",
")",
":",
"methodnames",
"=",
"[",
"f'_view_{format}_{backend.PLATFORM}'",
",",
"f'_view_{backend.PLATFORM}'",
",",
"]",
"for",
"name",
"in",
"methodnames",
":",
"view_method",
"=",
"geta... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/graphviz/py3/graphviz/files.py#L281-L295 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/idl_parser/idl_ppapi_lexer.py | python | IDLPPAPILexer.t_LSHIFT | (self, t) | return t | r'<< | r'<< | [
"r",
"<<"
] | def t_LSHIFT(self, t):
r'<<'
return t | [
"def",
"t_LSHIFT",
"(",
"self",
",",
"t",
")",
":",
"return",
"t"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/idl_parser/idl_ppapi_lexer.py#L30-L32 | |
nodejs/nan | 8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62 | cpplint.py | python | ProcessConfigOverrides | (filename) | return True | Loads the configuration files and processes the config overrides.
Args:
filename: The name of the file being processed by the linter.
Returns:
False if the current |filename| should not be processed further. | Loads the configuration files and processes the config overrides. | [
"Loads",
"the",
"configuration",
"files",
"and",
"processes",
"the",
"config",
"overrides",
"."
] | def ProcessConfigOverrides(filename):
""" Loads the configuration files and processes the config overrides.
Args:
filename: The name of the file being processed by the linter.
Returns:
False if the current |filename| should not be processed further.
"""
abs_filename = os.path.abspath(filename)
cf... | [
"def",
"ProcessConfigOverrides",
"(",
"filename",
")",
":",
"abs_filename",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"filename",
")",
"cfg_filters",
"=",
"[",
"]",
"keep_looking",
"=",
"True",
"while",
"keep_looking",
":",
"abs_path",
",",
"base_name",
"... | https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L6232-L6316 | |
tkn-tub/ns3-gym | 19bfe0a583e641142609939a090a09dfc63a095f | src/visualizer/visualizer/ipython_view.py | python | ConsoleView.onKeyPressExtend | (self, event) | !
For some reason we can't extend onKeyPress directly (bug #500900).
@param event key press
@return none | !
For some reason we can't extend onKeyPress directly (bug #500900). | [
"!",
"For",
"some",
"reason",
"we",
"can",
"t",
"extend",
"onKeyPress",
"directly",
"(",
"bug",
"#500900",
")",
"."
] | def onKeyPressExtend(self, event):
"""!
For some reason we can't extend onKeyPress directly (bug #500900).
@param event key press
@return none
"""
pass | [
"def",
"onKeyPressExtend",
"(",
"self",
",",
"event",
")",
":",
"pass"
] | https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/src/visualizer/visualizer/ipython_view.py#L556-L562 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/jedi/jedi/api.py | python | defined_names | (source, path=None, encoding='utf-8') | return api_classes._defined_names(parser.module) | Get all definitions in `source` sorted by its position.
This functions can be used for listing functions, classes and
data defined in a file. This can be useful if you want to list
them in "sidebar". Each element in the returned list also has
`defined_names` method which can be used to get sub-defini... | Get all definitions in `source` sorted by its position. | [
"Get",
"all",
"definitions",
"in",
"source",
"sorted",
"by",
"its",
"position",
"."
] | def defined_names(source, path=None, encoding='utf-8'):
"""
Get all definitions in `source` sorted by its position.
This functions can be used for listing functions, classes and
data defined in a file. This can be useful if you want to list
them in "sidebar". Each element in the returned list als... | [
"def",
"defined_names",
"(",
"source",
",",
"path",
"=",
"None",
",",
"encoding",
"=",
"'utf-8'",
")",
":",
"parser",
"=",
"Parser",
"(",
"modules",
".",
"source_to_unicode",
"(",
"source",
",",
"encoding",
")",
",",
"module_path",
"=",
"path",
",",
")",... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/api.py#L661-L677 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/ndlstm/python/lstm2d.py | python | reduce_to_sequence | (images, num_filters_out, scope=None) | Reduce an image to a sequence by scanning an LSTM vertically.
Args:
images: (num_images, height, width, depth) tensor
num_filters_out: output layer depth
scope: optional scope name
Returns:
A (width, num_images, num_filters_out) sequence. | Reduce an image to a sequence by scanning an LSTM vertically. | [
"Reduce",
"an",
"image",
"to",
"a",
"sequence",
"by",
"scanning",
"an",
"LSTM",
"vertically",
"."
] | def reduce_to_sequence(images, num_filters_out, scope=None):
"""Reduce an image to a sequence by scanning an LSTM vertically.
Args:
images: (num_images, height, width, depth) tensor
num_filters_out: output layer depth
scope: optional scope name
Returns:
A (width, num_images, num_filters_out) seq... | [
"def",
"reduce_to_sequence",
"(",
"images",
",",
"num_filters_out",
",",
"scope",
"=",
"None",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"scope",
",",
"\"ReduceToSequence\"",
",",
"[",
"images",
"]",
")",
":",
"batch_size",
",",
"height",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/ndlstm/python/lstm2d.py#L167-L185 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/moosesqa/LogHelper.py | python | LogHelper.modes | (self) | return self.__modes | Return the dict of logger keys and associated mode | Return the dict of logger keys and associated mode | [
"Return",
"the",
"dict",
"of",
"logger",
"keys",
"and",
"associated",
"mode"
] | def modes(self):
"""Return the dict of logger keys and associated mode"""
return self.__modes | [
"def",
"modes",
"(",
"self",
")",
":",
"return",
"self",
".",
"__modes"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/moosesqa/LogHelper.py#L23-L25 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/traveltime/modelling.py | python | TravelTimeDijkstraModelling.createJacobian | (self, par) | return self._core.createJacobian(par) | Create Jacobian (way matrix). | Create Jacobian (way matrix). | [
"Create",
"Jacobian",
"(",
"way",
"matrix",
")",
"."
] | def createJacobian(self, par):
"""Create Jacobian (way matrix)."""
if not self.mesh():
pg.critical("no mesh")
return self._core.createJacobian(par) | [
"def",
"createJacobian",
"(",
"self",
",",
"par",
")",
":",
"if",
"not",
"self",
".",
"mesh",
"(",
")",
":",
"pg",
".",
"critical",
"(",
"\"no mesh\"",
")",
"return",
"self",
".",
"_core",
".",
"createJacobian",
"(",
"par",
")"
] | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/traveltime/modelling.py#L79-L84 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/dist.py | python | Distribution._set_metadata_defaults | (self, attrs) | Fill-in missing metadata fields not supported by distutils.
Some fields may have been set by other tools (e.g. pbr).
Those fields (vars(self.metadata)) take precedence to
supplied attrs. | Fill-in missing metadata fields not supported by distutils.
Some fields may have been set by other tools (e.g. pbr).
Those fields (vars(self.metadata)) take precedence to
supplied attrs. | [
"Fill",
"-",
"in",
"missing",
"metadata",
"fields",
"not",
"supported",
"by",
"distutils",
".",
"Some",
"fields",
"may",
"have",
"been",
"set",
"by",
"other",
"tools",
"(",
"e",
".",
"g",
".",
"pbr",
")",
".",
"Those",
"fields",
"(",
"vars",
"(",
"se... | def _set_metadata_defaults(self, attrs):
"""
Fill-in missing metadata fields not supported by distutils.
Some fields may have been set by other tools (e.g. pbr).
Those fields (vars(self.metadata)) take precedence to
supplied attrs.
"""
for option, default in self.... | [
"def",
"_set_metadata_defaults",
"(",
"self",
",",
"attrs",
")",
":",
"for",
"option",
",",
"default",
"in",
"self",
".",
"_DISTUTILS_UNSUPPORTED_METADATA",
".",
"items",
"(",
")",
":",
"vars",
"(",
"self",
".",
"metadata",
")",
".",
"setdefault",
"(",
"op... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/dist.py#L475-L483 | ||
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | hasher-matcher-actioner/hmalib/metrics/query.py | python | get_count_with_graph | (
names: t.List[str], time_period: MetricTimePeriod
) | return result | Given a time period and a set of metric names, gets the sum of the metric
over the period and a graphable list of timestamps and values.
The graph data always contains the start and end time stamps with None values
to make graphing easier. | Given a time period and a set of metric names, gets the sum of the metric
over the period and a graphable list of timestamps and values. | [
"Given",
"a",
"time",
"period",
"and",
"a",
"set",
"of",
"metric",
"names",
"gets",
"the",
"sum",
"of",
"the",
"metric",
"over",
"the",
"period",
"and",
"a",
"graphable",
"list",
"of",
"timestamps",
"and",
"values",
"."
] | def get_count_with_graph(
names: t.List[str], time_period: MetricTimePeriod
) -> t.Dict[str, CountMetricWithGraph]:
"""
Given a time period and a set of metric names, gets the sum of the metric
over the period and a graphable list of timestamps and values.
The graph data always contains the start a... | [
"def",
"get_count_with_graph",
"(",
"names",
":",
"t",
".",
"List",
"[",
"str",
"]",
",",
"time_period",
":",
"MetricTimePeriod",
")",
"->",
"t",
".",
"Dict",
"[",
"str",
",",
"CountMetricWithGraph",
"]",
":",
"result",
"=",
"{",
"}",
"start_time",
"=",
... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/metrics/query.py#L87-L128 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | StandardPaths.GetUserConfigDir | (*args, **kwargs) | return _misc_.StandardPaths_GetUserConfigDir(*args, **kwargs) | GetUserConfigDir(self) -> String
Return the directory for the user config files: $HOME under Unix,
'c:/Documents and Settings/username' under Windows, and
~/Library/Preferences under Mac
Only use this if you have a single file to put there, otherwise
`GetUserDataDi... | GetUserConfigDir(self) -> String | [
"GetUserConfigDir",
"(",
"self",
")",
"-",
">",
"String"
] | def GetUserConfigDir(*args, **kwargs):
"""
GetUserConfigDir(self) -> String
Return the directory for the user config files: $HOME under Unix,
'c:/Documents and Settings/username' under Windows, and
~/Library/Preferences under Mac
Only use this if you have a... | [
"def",
"GetUserConfigDir",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StandardPaths_GetUserConfigDir",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L6319-L6330 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/find_ell.py | python | get_ell_root | () | return root_dir | find the root of the ELL git repo | find the root of the ELL git repo | [
"find",
"the",
"root",
"of",
"the",
"ELL",
"git",
"repo"
] | def get_ell_root():
""" find the root of the ELL git repo """
expected_dir = "external"
root_dir = __this_file_directory
while not os.path.isdir(os.path.join(root_dir, expected_dir)):
parent = os.path.dirname(root_dir)
if parent == root_dir:
break
root_dir = parent
... | [
"def",
"get_ell_root",
"(",
")",
":",
"expected_dir",
"=",
"\"external\"",
"root_dir",
"=",
"__this_file_directory",
"while",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"os",
".",
"path",
".",
"join",
"(",
"root_dir",
",",
"expected_dir",
")",
")",
":",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/find_ell.py#L16-L25 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/scopedef.py | python | scopedef_t.class_ | (
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None) | return (
self._find_single(
self._impl_matchers[scopedef_t.class_],
name=name,
function=function,
decl_type=self._impl_decl_types[
scopedef_t.class_],
header_dir=header_dir,
header_file=header... | returns reference to class declaration, that is matched defined
criteria | returns reference to class declaration, that is matched defined
criteria | [
"returns",
"reference",
"to",
"class",
"declaration",
"that",
"is",
"matched",
"defined",
"criteria"
] | def class_(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to class declaration, that is matched defined
criteria"""
return (
self._find_single(
... | [
"def",
"class_",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
")",
":",
"return",
"(",
"self",
".",
"_find_single",
"(",
"self",
"... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/scopedef.py#L536-L555 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/telnetlib.py | python | Telnet.set_option_negotiation_callback | (self, callback) | Provide a callback function called after each receipt of a telnet option. | Provide a callback function called after each receipt of a telnet option. | [
"Provide",
"a",
"callback",
"function",
"called",
"after",
"each",
"receipt",
"of",
"a",
"telnet",
"option",
"."
] | def set_option_negotiation_callback(self, callback):
"""Provide a callback function called after each receipt of a telnet option."""
self.option_callback = callback | [
"def",
"set_option_negotiation_callback",
"(",
"self",
",",
"callback",
")",
":",
"self",
".",
"option_callback",
"=",
"callback"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/telnetlib.py#L410-L412 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/evaluate/helpers.py | python | get_module_names | (module, all_scopes) | return names | Returns a dictionary with name parts as keys and their call paths as
values. | Returns a dictionary with name parts as keys and their call paths as
values. | [
"Returns",
"a",
"dictionary",
"with",
"name",
"parts",
"as",
"keys",
"and",
"their",
"call",
"paths",
"as",
"values",
"."
] | def get_module_names(module, all_scopes):
"""
Returns a dictionary with name parts as keys and their call paths as
values.
"""
names = chain.from_iterable(module.get_used_names().values())
if not all_scopes:
# We have to filter all the names that don't have the module as a
# pare... | [
"def",
"get_module_names",
"(",
"module",
",",
"all_scopes",
")",
":",
"names",
"=",
"chain",
".",
"from_iterable",
"(",
"module",
".",
"get_used_names",
"(",
")",
".",
"values",
"(",
")",
")",
"if",
"not",
"all_scopes",
":",
"# We have to filter all the names... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/helpers.py#L164-L176 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/skia/tools/skp/webpages_playback.py | python | SkPicturePlayback._IsChromiumPageSet | (self, page_set) | return page_set.startswith(self._chrome_page_sets_path) | Returns true if the specified page set is a Chromium page set. | Returns true if the specified page set is a Chromium page set. | [
"Returns",
"true",
"if",
"the",
"specified",
"page",
"set",
"is",
"a",
"Chromium",
"page",
"set",
"."
] | def _IsChromiumPageSet(self, page_set):
"""Returns true if the specified page set is a Chromium page set."""
return page_set.startswith(self._chrome_page_sets_path) | [
"def",
"_IsChromiumPageSet",
"(",
"self",
",",
"page_set",
")",
":",
"return",
"page_set",
".",
"startswith",
"(",
"self",
".",
"_chrome_page_sets_path",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/skp/webpages_playback.py#L196-L198 | |
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/vm/theano/tensor/basic.py | python | ones | (shape, dtype=None) | return output | Initialize a tensor with ones.
If dtype is ``None``, use ``config.floatX``.
Parameters
----------
shape : tuple or list
The shape of Tensor.
dtype : str or None
The data type of Tensor.
Returns
-------
Tensor
The initialized tensor. | Initialize a tensor with ones. | [
"Initialize",
"a",
"tensor",
"with",
"ones",
"."
] | def ones(shape, dtype=None):
"""Initialize a tensor with ones.
If dtype is ``None``, use ``config.floatX``.
Parameters
----------
shape : tuple or list
The shape of Tensor.
dtype : str or None
The data type of Tensor.
Returns
-------
Tensor
The initialized ... | [
"def",
"ones",
"(",
"shape",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"dtype",
"is",
"None",
":",
"dtype",
"=",
"config",
".",
"floatX",
"else",
":",
"if",
"dtype",
"not",
"in",
"_DATA_TYPES",
".",
"keys",
"(",
")",
":",
"raise",
"TypeError",
"("... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/theano/tensor/basic.py#L150-L175 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/imaplib.py | python | IMAP4.delete | (self, mailbox) | return self._simple_command('DELETE', mailbox) | Delete old mailbox.
(typ, [data]) = <instance>.delete(mailbox) | Delete old mailbox. | [
"Delete",
"old",
"mailbox",
"."
] | def delete(self, mailbox):
"""Delete old mailbox.
(typ, [data]) = <instance>.delete(mailbox)
"""
return self._simple_command('DELETE', mailbox) | [
"def",
"delete",
"(",
"self",
",",
"mailbox",
")",
":",
"return",
"self",
".",
"_simple_command",
"(",
"'DELETE'",
",",
"mailbox",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/imaplib.py#L483-L488 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/bindings/python/clang/cindex.py | python | TranslationUnit.get_tokens | (self, locations=None, extent=None) | return TokenGroup.get_tokens(self, extent) | Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both are defined,
behavior is undefined. | Obtain tokens in this translation unit. | [
"Obtain",
"tokens",
"in",
"this",
"translation",
"unit",
"."
] | def get_tokens(self, locations=None, extent=None):
"""Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both... | [
"def",
"get_tokens",
"(",
"self",
",",
"locations",
"=",
"None",
",",
"extent",
"=",
"None",
")",
":",
"if",
"locations",
"is",
"not",
"None",
":",
"extent",
"=",
"SourceRange",
"(",
"start",
"=",
"locations",
"[",
"0",
"]",
",",
"end",
"=",
"locatio... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L3076-L3087 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/Crypto/Protocol/AllOrNothing.py | python | AllOrNothing.undigest | (self, blocks) | return text[:-padbytes] | undigest(blocks : [string]) : string
Perform the reverse package transformation on a list of message
blocks. Note that the ciphermodule used for both transformations
must be the same. blocks is a list of strings of bit length
equal to the ciphermodule's block_size. | undigest(blocks : [string]) : string | [
"undigest",
"(",
"blocks",
":",
"[",
"string",
"]",
")",
":",
"string"
] | def undigest(self, blocks):
"""undigest(blocks : [string]) : string
Perform the reverse package transformation on a list of message
blocks. Note that the ciphermodule used for both transformations
must be the same. blocks is a list of strings of bit length
equal to the cipherm... | [
"def",
"undigest",
"(",
"self",
",",
"blocks",
")",
":",
"# better have at least 2 blocks, for the padbytes package and the hash",
"# block accumulator",
"if",
"len",
"(",
"blocks",
")",
"<",
"2",
":",
"raise",
"ValueError",
",",
"\"List must be at least length 2.\"",
"# ... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/Crypto/Protocol/AllOrNothing.py#L145-L197 | |
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/python/caffe/detector.py | python | Detector.detect_windows | (self, images_windows) | return detections | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Take
images_windows: (image filename, window list) iterable.
context_crop: size of context border to crop in pixels.
Give
detections: list of {file... | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"given",
"images",
"and",
"windows",
".",
"Windows",
"are",
"extracted",
"then",
"warped",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_windows(self, images_windows):
"""
Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Take
images_windows: (image filename, window list) iterable.
context_crop: size of context border to c... | [
"def",
"detect_windows",
"(",
"self",
",",
"images_windows",
")",
":",
"# Extract windows.",
"window_inputs",
"=",
"[",
"]",
"for",
"image_fname",
",",
"windows",
"in",
"images_windows",
":",
"image",
"=",
"caffe",
".",
"io",
".",
"load_image",
"(",
"image_fna... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/python/caffe/detector.py#L55-L92 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/gyp/generate_v14_compatible_resources.py | python | AssertNotDeprecatedAttribute | (name, value, filename) | Raises an exception if the given attribute is deprecated. | Raises an exception if the given attribute is deprecated. | [
"Raises",
"an",
"exception",
"if",
"the",
"given",
"attribute",
"is",
"deprecated",
"."
] | def AssertNotDeprecatedAttribute(name, value, filename):
"""Raises an exception if the given attribute is deprecated."""
msg = None
if name in ATTRIBUTES_TO_MAP_REVERSED:
msg = '{0} should use {1} instead of {2}'.format(filename,
ATTRIBUTES_TO_MAP_REVERSED[name], name)
elif name in GRAVITY_ATTRIBUTE... | [
"def",
"AssertNotDeprecatedAttribute",
"(",
"name",
",",
"value",
",",
"filename",
")",
":",
"msg",
"=",
"None",
"if",
"name",
"in",
"ATTRIBUTES_TO_MAP_REVERSED",
":",
"msg",
"=",
"'{0} should use {1} instead of {2}'",
".",
"format",
"(",
"filename",
",",
"ATTRIBU... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/gyp/generate_v14_compatible_resources.py#L68-L83 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/cached/genk-timing.py | python | TimingScriptGenerator.writeTimingCall | (self, filename, numFuncs, funcsCalled, totalCalls) | Echo some comments and invoke both versions of toy | Echo some comments and invoke both versions of toy | [
"Echo",
"some",
"comments",
"and",
"invoke",
"both",
"versions",
"of",
"toy"
] | def writeTimingCall(self, filename, numFuncs, funcsCalled, totalCalls):
"""Echo some comments and invoke both versions of toy"""
rootname = filename
if '.' in filename:
rootname = filename[:filename.rfind('.')]
self.shfile.write("echo \"%s: Calls %d of %d functions, %d total\... | [
"def",
"writeTimingCall",
"(",
"self",
",",
"filename",
",",
"numFuncs",
",",
"funcsCalled",
",",
"totalCalls",
")",
":",
"rootname",
"=",
"filename",
"if",
"'.'",
"in",
"filename",
":",
"rootname",
"=",
"filename",
"[",
":",
"filename",
".",
"rfind",
"(",... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/cached/genk-timing.py#L13-L30 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.close | (self, force=True) | This closes the connection with the child application. Note that
calling close() more than once is valid. This emulates standard Python
behavior with files. Set force to True if you want to make sure that
the child is terminated (SIGKILL is sent if the child ignores SIGHUP
and SIGINT). | This closes the connection with the child application. Note that
calling close() more than once is valid. This emulates standard Python
behavior with files. Set force to True if you want to make sure that
the child is terminated (SIGKILL is sent if the child ignores SIGHUP
and SIGINT). | [
"This",
"closes",
"the",
"connection",
"with",
"the",
"child",
"application",
".",
"Note",
"that",
"calling",
"close",
"()",
"more",
"than",
"once",
"is",
"valid",
".",
"This",
"emulates",
"standard",
"Python",
"behavior",
"with",
"files",
".",
"Set",
"force... | def close(self, force=True):
'''This closes the connection with the child application. Note that
calling close() more than once is valid. This emulates standard Python
behavior with files. Set force to True if you want to make sure that
the child is terminated (SIGKILL is sent if the chi... | [
"def",
"close",
"(",
"self",
",",
"force",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"closed",
":",
"self",
".",
"flush",
"(",
")",
"self",
".",
"fileobj",
".",
"close",
"(",
")",
"# Closes the file descriptor",
"# Give kernel time to update process s... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L387-L402 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/rpn/generate.py | python | imdb_proposals | (net, imdb) | return imdb_boxes | Generate RPN proposals on all images in an imdb. | Generate RPN proposals on all images in an imdb. | [
"Generate",
"RPN",
"proposals",
"on",
"all",
"images",
"in",
"an",
"imdb",
"."
] | def imdb_proposals(net, imdb):
"""Generate RPN proposals on all images in an imdb."""
_t = Timer()
imdb_boxes = [[] for _ in xrange(imdb.num_images)]
for i in xrange(imdb.num_images):
im = cv2.imread(imdb.image_path_at(i))
_t.tic()
imdb_boxes[i], scores = im_proposals(net, im)
... | [
"def",
"imdb_proposals",
"(",
"net",
",",
"imdb",
")",
":",
"_t",
"=",
"Timer",
"(",
")",
"imdb_boxes",
"=",
"[",
"[",
"]",
"for",
"_",
"in",
"xrange",
"(",
"imdb",
".",
"num_images",
")",
"]",
"for",
"i",
"in",
"xrange",
"(",
"imdb",
".",
"num_i... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/rpn/generate.py#L103-L121 | |
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppocr/utils/e2e_utils/visual.py | python | resize_image | (im, max_side_len=512) | return im, (ratio_h, ratio_w) | resize image to a size multiple of max_stride which is required by the network
:param im: the resized image
:param max_side_len: limit of max image size to avoid out of memory in gpu
:return: the resized image and the resize ratio | resize image to a size multiple of max_stride which is required by the network
:param im: the resized image
:param max_side_len: limit of max image size to avoid out of memory in gpu
:return: the resized image and the resize ratio | [
"resize",
"image",
"to",
"a",
"size",
"multiple",
"of",
"max_stride",
"which",
"is",
"required",
"by",
"the",
"network",
":",
"param",
"im",
":",
"the",
"resized",
"image",
":",
"param",
"max_side_len",
":",
"limit",
"of",
"max",
"image",
"size",
"to",
"... | def resize_image(im, max_side_len=512):
"""
resize image to a size multiple of max_stride which is required by the network
:param im: the resized image
:param max_side_len: limit of max image size to avoid out of memory in gpu
:return: the resized image and the resize ratio
"""
h, w, _ = im.... | [
"def",
"resize_image",
"(",
"im",
",",
"max_side_len",
"=",
"512",
")",
":",
"h",
",",
"w",
",",
"_",
"=",
"im",
".",
"shape",
"resize_w",
"=",
"w",
"resize_h",
"=",
"h",
"if",
"resize_h",
">",
"resize_w",
":",
"ratio",
"=",
"float",
"(",
"max_side... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/utils/e2e_utils/visual.py#L19-L46 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TChA.IsSuffix | (self, *args) | return _snap.TChA_IsSuffix(self, *args) | IsSuffix(TChA self, char const * CStr) -> bool
Parameters:
CStr: char const *
IsSuffix(TChA self, TStr Str) -> bool
Parameters:
Str: TStr const &
IsSuffix(TChA self, TChA Str) -> bool
Parameters:
Str: TChA const & | IsSuffix(TChA self, char const * CStr) -> bool | [
"IsSuffix",
"(",
"TChA",
"self",
"char",
"const",
"*",
"CStr",
")",
"-",
">",
"bool"
] | def IsSuffix(self, *args):
"""
IsSuffix(TChA self, char const * CStr) -> bool
Parameters:
CStr: char const *
IsSuffix(TChA self, TStr Str) -> bool
Parameters:
Str: TStr const &
IsSuffix(TChA self, TChA Str) -> bool
Parameters:
... | [
"def",
"IsSuffix",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TChA_IsSuffix",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L8943-L8961 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/decrypt-string-from-alphabet-to-integer-mapping.py | python | Solution.freqAlphabets | (self, s) | return "".join(result) | :type s: str
:rtype: str | :type s: str
:rtype: str | [
":",
"type",
"s",
":",
"str",
":",
"rtype",
":",
"str"
] | def freqAlphabets(self, s):
"""
:type s: str
:rtype: str
"""
def alpha(num):
return chr(ord('a') + int(num)-1)
i = 0
result = []
while i < len(s):
if i+2 < len(s) and s[i+2] == '#':
result.append(alpha(s[i:i+2]))
... | [
"def",
"freqAlphabets",
"(",
"self",
",",
"s",
")",
":",
"def",
"alpha",
"(",
"num",
")",
":",
"return",
"chr",
"(",
"ord",
"(",
"'a'",
")",
"+",
"int",
"(",
"num",
")",
"-",
"1",
")",
"i",
"=",
"0",
"result",
"=",
"[",
"]",
"while",
"i",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/decrypt-string-from-alphabet-to-integer-mapping.py#L6-L23 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/ndarray.py | python | Volume.conform | (self, shape=None, voxsize=1.0, orientation='LIA', interp_method='linear',
dtype=None, smooth_sigma=0) | return conformed | Conforms image to a specific shape, type, resolution, and orientation. | Conforms image to a specific shape, type, resolution, and orientation. | [
"Conforms",
"image",
"to",
"a",
"specific",
"shape",
"type",
"resolution",
"and",
"orientation",
"."
] | def conform(self, shape=None, voxsize=1.0, orientation='LIA', interp_method='linear',
dtype=None, smooth_sigma=0):
"""
Conforms image to a specific shape, type, resolution, and orientation.
"""
conformed = self.reorient(orientation)
conformed = conformed.reslice(... | [
"def",
"conform",
"(",
"self",
",",
"shape",
"=",
"None",
",",
"voxsize",
"=",
"1.0",
",",
"orientation",
"=",
"'LIA'",
",",
"interp_method",
"=",
"'linear'",
",",
"dtype",
"=",
"None",
",",
"smooth_sigma",
"=",
"0",
")",
":",
"conformed",
"=",
"self",... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/ndarray.py#L505-L517 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintspointgrp.py | python | SymRep.sigma_xz | (self) | Set equal to reflection in xz plane | Set equal to reflection in xz plane | [
"Set",
"equal",
"to",
"reflection",
"in",
"xz",
"plane"
] | def sigma_xz(self):
"""Set equal to reflection in xz plane
"""
self.unit()
if self.n == 2 or self.n == 3 or self.n == 4:
self.d[1][1] = -1.0
if self.n == 4:
self.d[2][2] = -1.0
elif self.n == 5:
self.d[2][2] = -1.0
... | [
"def",
"sigma_xz",
"(",
"self",
")",
":",
"self",
".",
"unit",
"(",
")",
"if",
"self",
".",
"n",
"==",
"2",
"or",
"self",
".",
"n",
"==",
"3",
"or",
"self",
".",
"n",
"==",
"4",
":",
"self",
".",
"d",
"[",
"1",
"]",
"[",
"1",
"]",
"=",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintspointgrp.py#L505-L516 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | tools/autograd/gen_inplace_or_view_type.py | python | emit_view_lambda | (f: NativeFunction, unpacked_bindings: List[Binding]) | return SETUP_REPLAY_VIEW_IF_NOT_SUPPORT_AS_STRIDED_OR_VIEW_WITH_METADATA_CHANGE.substitute(
is_view_with_metadata_change=is_view_with_metadata_change,
replay_view_func=replay_view_func) | Generate an additional lambda function to recover views in backward when as_strided is not supported.
See Note [View + Inplace update for base tensor] and [View + Inplace update for view tensor] for more details. | Generate an additional lambda function to recover views in backward when as_strided is not supported.
See Note [View + Inplace update for base tensor] and [View + Inplace update for view tensor] for more details. | [
"Generate",
"an",
"additional",
"lambda",
"function",
"to",
"recover",
"views",
"in",
"backward",
"when",
"as_strided",
"is",
"not",
"supported",
".",
"See",
"Note",
"[",
"View",
"+",
"Inplace",
"update",
"for",
"base",
"tensor",
"]",
"and",
"[",
"View",
"... | def emit_view_lambda(f: NativeFunction, unpacked_bindings: List[Binding]) -> str:
""" Generate an additional lambda function to recover views in backward when as_strided is not supported.
See Note [View + Inplace update for base tensor] and [View + Inplace update for view tensor] for more details."""
input_... | [
"def",
"emit_view_lambda",
"(",
"f",
":",
"NativeFunction",
",",
"unpacked_bindings",
":",
"List",
"[",
"Binding",
"]",
")",
"->",
"str",
":",
"input_base",
"=",
"'input_base'",
"replay_view_func",
"=",
"''",
"updated_unpacked_args",
":",
"List",
"[",
"str",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/autograd/gen_inplace_or_view_type.py#L235-L281 | |
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/framework/interfaces/face/face.py | python | GenericStub.event_unary_stream | (self,
group,
method,
request,
receiver,
abortion_callback,
timeout,
metadata=None,
protocol_options=Non... | Event-driven invocation of a unary-request-stream-response method.
Args:
group: The group identifier of the RPC.
method: The method identifier of the RPC.
request: The request value for the RPC.
receiver: A ResponseReceiver to be passed the response data of the RPC.
abortion_callback:... | Event-driven invocation of a unary-request-stream-response method. | [
"Event",
"-",
"driven",
"invocation",
"of",
"a",
"unary",
"-",
"request",
"-",
"stream",
"-",
"response",
"method",
"."
] | def event_unary_stream(self,
group,
method,
request,
receiver,
abortion_callback,
timeout,
metadata=None,
... | [
"def",
"event_unary_stream",
"(",
"self",
",",
"group",
",",
"method",
",",
"request",
",",
"receiver",
",",
"abortion_callback",
",",
"timeout",
",",
"metadata",
"=",
"None",
",",
"protocol_options",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/framework/interfaces/face/face.py#L898-L924 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/util.py | python | humanbool | (name, value) | Determine human boolean value
:Parameters:
`name` : ``str``
The config key (used for error message)
`value` : ``str``
The config value
:Return: The boolean value
:Rtype: ``bool``
:Exceptions:
- `ValueError` : The value could not be recognized | Determine human boolean value | [
"Determine",
"human",
"boolean",
"value"
] | def humanbool(name, value):
"""
Determine human boolean value
:Parameters:
`name` : ``str``
The config key (used for error message)
`value` : ``str``
The config value
:Return: The boolean value
:Rtype: ``bool``
:Exceptions:
- `ValueError` : The value could n... | [
"def",
"humanbool",
"(",
"name",
",",
"value",
")",
":",
"try",
":",
"return",
"_util",
".",
"strtobool",
"(",
"str",
"(",
"value",
")",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"or",
"'no'",
")",
"except",
"ValueError",
":",
"raise",
"Value... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/util.py#L43-L63 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py | python | GmmAlgorithm._define_log_prob_operation | (self, shard_id, shard) | Probability per example in a class.
Updates a matrix with dimension num_examples X num_classes.
Args:
shard_id: id of the current shard.
shard: current data shard, 1 X num_examples X dimensions. | Probability per example in a class. | [
"Probability",
"per",
"example",
"in",
"a",
"class",
"."
] | def _define_log_prob_operation(self, shard_id, shard):
"""Probability per example in a class.
Updates a matrix with dimension num_examples X num_classes.
Args:
shard_id: id of the current shard.
shard: current data shard, 1 X num_examples X dimensions.
"""
# TODO(xavigonzalvo): Use the... | [
"def",
"_define_log_prob_operation",
"(",
"self",
",",
"shard_id",
",",
"shard",
")",
":",
"# TODO(xavigonzalvo): Use the pdf defined in",
"# third_party/tensorflow/contrib/distributions/python/ops/gaussian.py",
"if",
"self",
".",
"_covariance_type",
"==",
"FULL_COVARIANCE",
":",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L265-L280 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | RendererNative.DrawTitleBarBitmap | (*args, **kwargs) | return _gdi_.RendererNative_DrawTitleBarBitmap(*args, **kwargs) | DrawTitleBarBitmap(self, Window win, DC dc, Rect rect, int button, int flags=0)
Draw one of the standard title bar buttons.
This is currently implemented only for MSW and OS X (for the close
button only) because there is no way to render standard title bar
buttons under the other platf... | DrawTitleBarBitmap(self, Window win, DC dc, Rect rect, int button, int flags=0) | [
"DrawTitleBarBitmap",
"(",
"self",
"Window",
"win",
"DC",
"dc",
"Rect",
"rect",
"int",
"button",
"int",
"flags",
"=",
"0",
")"
] | def DrawTitleBarBitmap(*args, **kwargs):
"""
DrawTitleBarBitmap(self, Window win, DC dc, Rect rect, int button, int flags=0)
Draw one of the standard title bar buttons.
This is currently implemented only for MSW and OS X (for the close
button only) because there is no way to re... | [
"def",
"DrawTitleBarBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"RendererNative_DrawTitleBarBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L7611-L7623 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/ChannelVisitor.py | python | ChannelVisitor.DictHeaderVisit | (self, obj) | Defined to generate header for channel python class. | Defined to generate header for channel python class. | [
"Defined",
"to",
"generate",
"header",
"for",
"channel",
"python",
"class",
"."
] | def DictHeaderVisit(self, obj):
"""
Defined to generate header for channel python class.
"""
inst = 0
for id in obj.get_ids():
c = ChannelHeader.ChannelHeader()
d = datetime.datetime.now()
c.date = d.strftime("%A, %d %B %Y")
c.user ... | [
"def",
"DictHeaderVisit",
"(",
"self",
",",
"obj",
")",
":",
"inst",
"=",
"0",
"for",
"id",
"in",
"obj",
".",
"get_ids",
"(",
")",
":",
"c",
"=",
"ChannelHeader",
".",
"ChannelHeader",
"(",
")",
"d",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/ChannelVisitor.py#L118-L130 | ||
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | tools/python/maps_generator/generator/settings.py | python | get_config_path | (config_path: AnyStr) | return config_path if config_var is None else config_var | It tries to get an opt_config value.
If doesn't get the value a function returns config_path. | It tries to get an opt_config value.
If doesn't get the value a function returns config_path. | [
"It",
"tries",
"to",
"get",
"an",
"opt_config",
"value",
".",
"If",
"doesn",
"t",
"get",
"the",
"value",
"a",
"function",
"returns",
"config_path",
"."
] | def get_config_path(config_path: AnyStr):
"""
It tries to get an opt_config value.
If doesn't get the value a function returns config_path.
"""
argv = sys.argv
indexes = (-1, -1)
for i, opt in enumerate(argv):
if opt.startswith(f"{opt_config}="):
indexes = (i, i + 1)
... | [
"def",
"get_config_path",
"(",
"config_path",
":",
"AnyStr",
")",
":",
"argv",
"=",
"sys",
".",
"argv",
"indexes",
"=",
"(",
"-",
"1",
",",
"-",
"1",
")",
"for",
"i",
",",
"opt",
"in",
"enumerate",
"(",
"argv",
")",
":",
"if",
"opt",
".",
"starts... | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/maps_generator/generator/settings.py#L22-L40 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributions/transforms.py | python | Transform.sign | (self) | Returns the sign of the determinant of the Jacobian, if applicable.
In general this only makes sense for bijective transforms. | Returns the sign of the determinant of the Jacobian, if applicable.
In general this only makes sense for bijective transforms. | [
"Returns",
"the",
"sign",
"of",
"the",
"determinant",
"of",
"the",
"Jacobian",
"if",
"applicable",
".",
"In",
"general",
"this",
"only",
"makes",
"sense",
"for",
"bijective",
"transforms",
"."
] | def sign(self):
"""
Returns the sign of the determinant of the Jacobian, if applicable.
In general this only makes sense for bijective transforms.
"""
raise NotImplementedError | [
"def",
"sign",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributions/transforms.py#L118-L123 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Wm.wm_transient | (self, master=None) | return self.tk.call('wm', 'transient', self._w, master) | Instruct the window manager that this widget is transient
with regard to widget MASTER. | Instruct the window manager that this widget is transient
with regard to widget MASTER. | [
"Instruct",
"the",
"window",
"manager",
"that",
"this",
"widget",
"is",
"transient",
"with",
"regard",
"to",
"widget",
"MASTER",
"."
] | def wm_transient(self, master=None):
"""Instruct the window manager that this widget is transient
with regard to widget MASTER."""
return self.tk.call('wm', 'transient', self._w, master) | [
"def",
"wm_transient",
"(",
"self",
",",
"master",
"=",
"None",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'transient'",
",",
"self",
".",
"_w",
",",
"master",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1709-L1712 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mach/mach/config.py | python | ConfigSettings.register_provider | (self, provider) | Register a ConfigProvider with this settings interface. | Register a ConfigProvider with this settings interface. | [
"Register",
"a",
"ConfigProvider",
"with",
"this",
"settings",
"interface",
"."
] | def register_provider(self, provider):
"""Register a ConfigProvider with this settings interface."""
if self._finalized:
raise Exception('Providers cannot be registered after finalized.')
provider.register_settings()
for section_name, settings in provider.config_settings.i... | [
"def",
"register_provider",
"(",
"self",
",",
"provider",
")",
":",
"if",
"self",
".",
"_finalized",
":",
"raise",
"Exception",
"(",
"'Providers cannot be registered after finalized.'",
")",
"provider",
".",
"register_settings",
"(",
")",
"for",
"section_name",
",",... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mach/mach/config.py#L406-L424 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | DC._DrawEllipseList | (*args, **kwargs) | return _gdi_.DC__DrawEllipseList(*args, **kwargs) | _DrawEllipseList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject | _DrawEllipseList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject | [
"_DrawEllipseList",
"(",
"self",
"PyObject",
"pyCoords",
"PyObject",
"pyPens",
"PyObject",
"pyBrushes",
")",
"-",
">",
"PyObject"
] | def _DrawEllipseList(*args, **kwargs):
"""_DrawEllipseList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
return _gdi_.DC__DrawEllipseList(*args, **kwargs) | [
"def",
"_DrawEllipseList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC__DrawEllipseList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L4749-L4751 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextEvent.SetToken | (*args, **kwargs) | return _stc.StyledTextEvent_SetToken(*args, **kwargs) | SetToken(self, int val) | SetToken(self, int val) | [
"SetToken",
"(",
"self",
"int",
"val",
")"
] | def SetToken(*args, **kwargs):
"""SetToken(self, int val)"""
return _stc.StyledTextEvent_SetToken(*args, **kwargs) | [
"def",
"SetToken",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_SetToken",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L7094-L7096 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/common/extensions/docs/build/directory.py | python | Sample._uses_popup | (self) | return has_b_popup or has_p_popup | Returns true if the extension defines a popup on a page or browser
action. | Returns true if the extension defines a popup on a page or browser
action. | [
"Returns",
"true",
"if",
"the",
"extension",
"defines",
"a",
"popup",
"on",
"a",
"page",
"or",
"browser",
"action",
"."
] | def _uses_popup(self):
""" Returns true if the extension defines a popup on a page or browser
action. """
has_b_popup = (self._uses_browser_action() and
self._manifest['browser_action'].has_key('popup'))
has_p_popup = (self._uses_page_action() and
self._manifest['pa... | [
"def",
"_uses_popup",
"(",
"self",
")",
":",
"has_b_popup",
"=",
"(",
"self",
".",
"_uses_browser_action",
"(",
")",
"and",
"self",
".",
"_manifest",
"[",
"'browser_action'",
"]",
".",
"has_key",
"(",
"'popup'",
")",
")",
"has_p_popup",
"=",
"(",
"self",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/docs/build/directory.py#L747-L754 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/tseries/offsets.py | python | _CustomBusinessMonth.month_roll | (self) | return roll_func | Define default roll function to be called in apply method. | Define default roll function to be called in apply method. | [
"Define",
"default",
"roll",
"function",
"to",
"be",
"called",
"in",
"apply",
"method",
"."
] | def month_roll(self):
"""
Define default roll function to be called in apply method.
"""
if self._prefix.endswith('S'):
# MonthBegin
roll_func = self.m_offset.rollback
else:
# MonthEnd
roll_func = self.m_offset.rollforward
r... | [
"def",
"month_roll",
"(",
"self",
")",
":",
"if",
"self",
".",
"_prefix",
".",
"endswith",
"(",
"'S'",
")",
":",
"# MonthBegin",
"roll_func",
"=",
"self",
".",
"m_offset",
".",
"rollback",
"else",
":",
"# MonthEnd",
"roll_func",
"=",
"self",
".",
"m_offs... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/tseries/offsets.py#L1030-L1040 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html2.py | python | WebViewEvent.__init__ | (self, *args, **kwargs) | __init__(self, EventType type, int id, String href, String target) -> WebViewEvent | __init__(self, EventType type, int id, String href, String target) -> WebViewEvent | [
"__init__",
"(",
"self",
"EventType",
"type",
"int",
"id",
"String",
"href",
"String",
"target",
")",
"-",
">",
"WebViewEvent"
] | def __init__(self, *args, **kwargs):
"""__init__(self, EventType type, int id, String href, String target) -> WebViewEvent"""
_html2.WebViewEvent_swiginit(self,_html2.new_WebViewEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html2",
".",
"WebViewEvent_swiginit",
"(",
"self",
",",
"_html2",
".",
"new_WebViewEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html2.py#L355-L357 | ||
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py | python | GtkVTKRenderWindowInteractor.OnButtonDown | (self, wid, event) | Mouse button pressed. | Mouse button pressed. | [
"Mouse",
"button",
"pressed",
"."
] | def OnButtonDown(self, wid, event):
"""Mouse button pressed."""
m = self.get_pointer()
ctrl, shift = self._GetCtrlShift(event)
self._Iren.SetEventInformationFlipY(m[0], m[1], ctrl, shift,
chr(0), 0, None)
button = event.button
i... | [
"def",
"OnButtonDown",
"(",
"self",
",",
"wid",
",",
"event",
")",
":",
"m",
"=",
"self",
".",
"get_pointer",
"(",
")",
"ctrl",
",",
"shift",
"=",
"self",
".",
"_GetCtrlShift",
"(",
"event",
")",
"self",
".",
"_Iren",
".",
"SetEventInformationFlipY",
"... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py#L150-L167 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.GetShell32Version | (*args, **kwargs) | return _core_.PyApp_GetShell32Version(*args, **kwargs) | GetShell32Version() -> int
Returns 400, 470, 471, etc. for shell32.dll 4.00, 4.70, 4.71 or 0 if
it wasn't found at all. Raises an exception on non-Windows platforms. | GetShell32Version() -> int | [
"GetShell32Version",
"()",
"-",
">",
"int"
] | def GetShell32Version(*args, **kwargs):
"""
GetShell32Version() -> int
Returns 400, 470, 471, etc. for shell32.dll 4.00, 4.70, 4.71 or 0 if
it wasn't found at all. Raises an exception on non-Windows platforms.
"""
return _core_.PyApp_GetShell32Version(*args, **kwargs) | [
"def",
"GetShell32Version",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetShell32Version",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8208-L8215 | |
PaddlePaddle/Anakin | 5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730 | tools/external_converter_v2/parser/logger.py | python | logger.log_to_everywhere | (self, no_color_msg, full_msg) | log to stdout and file | log to stdout and file | [
"log",
"to",
"stdout",
"and",
"file"
] | def log_to_everywhere(self, no_color_msg, full_msg):
"""
log to stdout and file
"""
filename = logger.LogToPath + logger.FileName
size_in_bytes = os.stat(filename).st_size
size_in_GB = size_in_bytes * 1.0 / (1024 * 1024 * 1024)
logger.lock.acquire()
if siz... | [
"def",
"log_to_everywhere",
"(",
"self",
",",
"no_color_msg",
",",
"full_msg",
")",
":",
"filename",
"=",
"logger",
".",
"LogToPath",
"+",
"logger",
".",
"FileName",
"size_in_bytes",
"=",
"os",
".",
"stat",
"(",
"filename",
")",
".",
"st_size",
"size_in_GB",... | https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/logger.py#L145-L162 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyApp.SetMacExitMenuItemId | (*args, **kwargs) | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | SetMacExitMenuItemId(long val) | SetMacExitMenuItemId(long val) | [
"SetMacExitMenuItemId",
"(",
"long",
"val",
")"
] | def SetMacExitMenuItemId(*args, **kwargs):
"""SetMacExitMenuItemId(long val)"""
return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | [
"def",
"SetMacExitMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_SetMacExitMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L8180-L8182 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/common/tokenizer.py | python | Tokenizer.__TokenizeLine | (self, line) | Tokenizes the given line.
Args:
line: The contents of the line. | Tokenizes the given line. | [
"Tokenizes",
"the",
"given",
"line",
"."
] | def __TokenizeLine(self, line):
"""Tokenizes the given line.
Args:
line: The contents of the line.
"""
string = line.rstrip('\n\r\f')
line_number = self.__line_number
self.__start_index = 0
if not string:
self.__AddToken(self._CreateToken('', Type.BLANK_LINE, line, line_number)... | [
"def",
"__TokenizeLine",
"(",
"self",
",",
"line",
")",
":",
"string",
"=",
"line",
".",
"rstrip",
"(",
"'\\n\\r\\f'",
")",
"line_number",
"=",
"self",
".",
"__line_number",
"self",
".",
"__start_index",
"=",
"0",
"if",
"not",
"string",
":",
"self",
".",... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/common/tokenizer.py#L95-L147 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/util/resource_utils.py | python | GetRTxtStringResourceNames | (r_txt_path) | return sorted({
entry.name
for entry in _ParseTextSymbolsFile(r_txt_path)
if entry.resource_type == 'string'
}) | Parse an R.txt file and the list of its string resource names. | Parse an R.txt file and the list of its string resource names. | [
"Parse",
"an",
"R",
".",
"txt",
"file",
"and",
"the",
"list",
"of",
"its",
"string",
"resource",
"names",
"."
] | def GetRTxtStringResourceNames(r_txt_path):
"""Parse an R.txt file and the list of its string resource names."""
return sorted({
entry.name
for entry in _ParseTextSymbolsFile(r_txt_path)
if entry.resource_type == 'string'
}) | [
"def",
"GetRTxtStringResourceNames",
"(",
"r_txt_path",
")",
":",
"return",
"sorted",
"(",
"{",
"entry",
".",
"name",
"for",
"entry",
"in",
"_ParseTextSymbolsFile",
"(",
"r_txt_path",
")",
"if",
"entry",
".",
"resource_type",
"==",
"'string'",
"}",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/util/resource_utils.py#L389-L395 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextXMLHandler.__init__ | (self, *args, **kwargs) | __init__(self, String name=XmlName, String ext=XmlExt, int type=RICHTEXT_TYPE_XML) -> RichTextXMLHandler | __init__(self, String name=XmlName, String ext=XmlExt, int type=RICHTEXT_TYPE_XML) -> RichTextXMLHandler | [
"__init__",
"(",
"self",
"String",
"name",
"=",
"XmlName",
"String",
"ext",
"=",
"XmlExt",
"int",
"type",
"=",
"RICHTEXT_TYPE_XML",
")",
"-",
">",
"RichTextXMLHandler"
] | def __init__(self, *args, **kwargs):
"""__init__(self, String name=XmlName, String ext=XmlExt, int type=RICHTEXT_TYPE_XML) -> RichTextXMLHandler"""
_richtext.RichTextXMLHandler_swiginit(self,_richtext.new_RichTextXMLHandler(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_richtext",
".",
"RichTextXMLHandler_swiginit",
"(",
"self",
",",
"_richtext",
".",
"new_RichTextXMLHandler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4432-L4434 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.winfo_vrooty | (self) | return getint(
self.tk.call('winfo', 'vrooty', self._w)) | Return the y offset of the virtual root relative to the root
window of the screen of this widget. | Return the y offset of the virtual root relative to the root
window of the screen of this widget. | [
"Return",
"the",
"y",
"offset",
"of",
"the",
"virtual",
"root",
"relative",
"to",
"the",
"root",
"window",
"of",
"the",
"screen",
"of",
"this",
"widget",
"."
] | def winfo_vrooty(self):
"""Return the y offset of the virtual root relative to the root
window of the screen of this widget."""
return getint(
self.tk.call('winfo', 'vrooty', self._w)) | [
"def",
"winfo_vrooty",
"(",
"self",
")",
":",
"return",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'vrooty'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1008-L1012 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/context.py | python | BaseContext.load_additional_registries | (self) | Load target-specific registries. Can be overridden by subclasses. | Load target-specific registries. Can be overridden by subclasses. | [
"Load",
"target",
"-",
"specific",
"registries",
".",
"Can",
"be",
"overridden",
"by",
"subclasses",
"."
] | def load_additional_registries(self):
"""
Load target-specific registries. Can be overridden by subclasses.
""" | [
"def",
"load_additional_registries",
"(",
"self",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/context.py#L405-L408 | ||
lawy623/SVS | b7c7ae367c82a4797ff4a896a2ff304f02e7f724 | caffe/scripts/cpp_lint.py | python | _NestingState.UpdatePreprocessor | (self, line) | Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the following assumptions (good enough for most... | Update preprocessor stack. | [
"Update",
"preprocessor",
"stack",
"."
] | def UpdatePreprocessor(self, line):
"""Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the ... | [
"def",
"UpdatePreprocessor",
"(",
"self",
",",
"line",
")",
":",
"if",
"Match",
"(",
"r'^\\s*#\\s*(if|ifdef|ifndef)\\b'",
",",
"line",
")",
":",
"# Beginning of #if block, save the nesting stack here. The saved",
"# stack will allow us to restore the parsing state in the #else cas... | https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L1948-L2002 | ||
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | src/freetype/tools/docmaker/content.py | python | ContentProcessor.process_content | ( self, content ) | return self.markups | Process a block content and return a list of DocMarkup objects
corresponding to it. | Process a block content and return a list of DocMarkup objects
corresponding to it. | [
"Process",
"a",
"block",
"content",
"and",
"return",
"a",
"list",
"of",
"DocMarkup",
"objects",
"corresponding",
"to",
"it",
"."
] | def process_content( self, content ):
"""Process a block content and return a list of DocMarkup objects
corresponding to it."""
markup = None
markup_lines = []
first = 1
margin = -1
in_code = 0
for line in content:
if in_cod... | [
"def",
"process_content",
"(",
"self",
",",
"content",
")",
":",
"markup",
"=",
"None",
"markup_lines",
"=",
"[",
"]",
"first",
"=",
"1",
"margin",
"=",
"-",
"1",
"in_code",
"=",
"0",
"for",
"line",
"in",
"content",
":",
"if",
"in_code",
":",
"m",
... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/src/freetype/tools/docmaker/content.py#L449-L495 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | wutils.py | python | get_run_program | (program_string, command_template=None) | return program_name, execvec | Return the program name and argv of the process that would be executed by
run_program(program_string, command_template). | Return the program name and argv of the process that would be executed by
run_program(program_string, command_template). | [
"Return",
"the",
"program",
"name",
"and",
"argv",
"of",
"the",
"process",
"that",
"would",
"be",
"executed",
"by",
"run_program",
"(",
"program_string",
"command_template",
")",
"."
] | def get_run_program(program_string, command_template=None):
"""
Return the program name and argv of the process that would be executed by
run_program(program_string, command_template).
"""
#print "get_run_program_argv(program_string=%r, command_template=%r)" % (program_string, command_template)
... | [
"def",
"get_run_program",
"(",
"program_string",
",",
"command_template",
"=",
"None",
")",
":",
"#print \"get_run_program_argv(program_string=%r, command_template=%r)\" % (program_string, command_template)",
"env",
"=",
"bld",
".",
"env",
"if",
"command_template",
"in",
"(",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/wutils.py#L169-L221 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/build/generators.py | python | Generator.source_types | (self) | return self.source_types_ | Returns the list of target type the generator accepts. | Returns the list of target type the generator accepts. | [
"Returns",
"the",
"list",
"of",
"target",
"type",
"the",
"generator",
"accepts",
"."
] | def source_types (self):
""" Returns the list of target type the generator accepts.
"""
return self.source_types_ | [
"def",
"source_types",
"(",
"self",
")",
":",
"return",
"self",
".",
"source_types_"
] | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/generators.py#L281-L284 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.