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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Wm.wm_frame | (self) | return self.tk.call('wm', 'frame', self._w) | Return identifier for decorative frame of this widget if present. | Return identifier for decorative frame of this widget if present. | [
"Return",
"identifier",
"for",
"decorative",
"frame",
"of",
"this",
"widget",
"if",
"present",
"."
] | def wm_frame(self):
"""Return identifier for decorative frame of this widget if present."""
return self.tk.call('wm', 'frame', self._w) | [
"def",
"wm_frame",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'frame'",
",",
"self",
".",
"_w",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1587-L1589 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | parseMemory | (buffer, size) | return xmlDoc(_obj=ret) | parse an XML in-memory block and build a tree. | parse an XML in-memory block and build a tree. | [
"parse",
"an",
"XML",
"in",
"-",
"memory",
"block",
"and",
"build",
"a",
"tree",
"."
] | def parseMemory(buffer, size):
"""parse an XML in-memory block and build a tree. """
ret = libxml2mod.xmlParseMemory(buffer, size)
if ret is None:raise parserError('xmlParseMemory() failed')
return xmlDoc(_obj=ret) | [
"def",
"parseMemory",
"(",
"buffer",
",",
"size",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlParseMemory",
"(",
"buffer",
",",
"size",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"parserError",
"(",
"'xmlParseMemory() failed'",
")",
"return",
"xmlDoc",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1346-L1350 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/internal/well_known_types.py | python | Duration.ToTimedelta | (self) | return timedelta(
seconds=self.seconds, microseconds=_RoundTowardZero(
self.nanos, _NANOS_PER_MICROSECOND)) | Converts Duration to timedelta. | Converts Duration to timedelta. | [
"Converts",
"Duration",
"to",
"timedelta",
"."
] | def ToTimedelta(self):
"""Converts Duration to timedelta."""
return timedelta(
seconds=self.seconds, microseconds=_RoundTowardZero(
self.nanos, _NANOS_PER_MICROSECOND)) | [
"def",
"ToTimedelta",
"(",
"self",
")",
":",
"return",
"timedelta",
"(",
"seconds",
"=",
"self",
".",
"seconds",
",",
"microseconds",
"=",
"_RoundTowardZero",
"(",
"self",
".",
"nanos",
",",
"_NANOS_PER_MICROSECOND",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L341-L345 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/utils/outdated.py | python | pip_version_check | (session) | Check for an update for pip.
Limit the frequency of checks to once per week. State is stored either in
the active virtualenv or in the user's USER_CACHE_DIR keyed off the prefix
of the pip script path. | Check for an update for pip. | [
"Check",
"for",
"an",
"update",
"for",
"pip",
"."
] | def pip_version_check(session):
"""Check for an update for pip.
Limit the frequency of checks to once per week. State is stored either in
the active virtualenv or in the user's USER_CACHE_DIR keyed off the prefix
of the pip script path.
"""
import pip # imported here to prevent circular import... | [
"def",
"pip_version_check",
"(",
"session",
")",
":",
"import",
"pip",
"# imported here to prevent circular imports",
"pypi_version",
"=",
"None",
"try",
":",
"state",
"=",
"load_selfcheck_statefile",
"(",
")",
"current_time",
"=",
"datetime",
".",
"datetime",
".",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/utils/outdated.py#L95-L153 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/column/timedelta.py | python | TimeDeltaColumn.nanoseconds | (self) | return (
self
% cudf.Scalar(
np.timedelta64(_numpy_to_pandas_conversion["us"], "ns")
)
) // cudf.Scalar(
np.timedelta64(_numpy_to_pandas_conversion["ns"], "ns")
) | Return the number of nanoseconds (n), where 0 <= n < 1 microsecond.
Returns
-------
NumericalColumn | Return the number of nanoseconds (n), where 0 <= n < 1 microsecond. | [
"Return",
"the",
"number",
"of",
"nanoseconds",
"(",
"n",
")",
"where",
"0",
"<",
"=",
"n",
"<",
"1",
"microsecond",
"."
] | def nanoseconds(self) -> "cudf.core.column.NumericalColumn":
"""
Return the number of nanoseconds (n), where 0 <= n < 1 microsecond.
Returns
-------
NumericalColumn
"""
# This property must return the number of nanoseconds (>= 0 and
# less than 1 microsec... | [
"def",
"nanoseconds",
"(",
"self",
")",
"->",
"\"cudf.core.column.NumericalColumn\"",
":",
"# This property must return the number of nanoseconds (>= 0 and",
"# less than 1 microsecond) for each element, hence first performing",
"# mod operation to remove the number of microseconds and then",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/timedelta.py#L555-L576 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetBundleSharedSupportFolderPath | (self) | Returns the qualified path to the bundle's shared support folder. E.g,
Chromium.app/Contents/SharedSupport. Only valid for bundles. | Returns the qualified path to the bundle's shared support folder. E.g,
Chromium.app/Contents/SharedSupport. Only valid for bundles. | [
"Returns",
"the",
"qualified",
"path",
"to",
"the",
"bundle",
"s",
"shared",
"support",
"folder",
".",
"E",
".",
"g",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"SharedSupport",
".",
"Only",
"valid",
"for",
"bundles",
"."
] | def GetBundleSharedSupportFolderPath(self):
"""Returns the qualified path to the bundle's shared support folder. E.g,
Chromium.app/Contents/SharedSupport. Only valid for bundles."""
assert self._IsBundle()
if self.spec['type'] == 'shared_library':
return self.GetBundleResourceFolder()
else:
... | [
"def",
"GetBundleSharedSupportFolderPath",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_IsBundle",
"(",
")",
"if",
"self",
".",
"spec",
"[",
"'type'",
"]",
"==",
"'shared_library'",
":",
"return",
"self",
".",
"GetBundleResourceFolder",
"(",
")",
"else",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcode_emulation.py#L347-L355 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/utils/metrics_utils.py | python | is_evenly_distributed_thresholds | (thresholds) | return np.allclose(thresholds, even_thresholds, atol=backend.epsilon()) | Check if the thresholds list is evenly distributed.
We could leverage evenly distributed thresholds to use less memory when
calculate metrcis like AUC where each individual threshold need to be
evaluted.
Args:
thresholds: A python list or tuple, or 1D numpy array whose value is ranged
in [0, 1].
... | Check if the thresholds list is evenly distributed. | [
"Check",
"if",
"the",
"thresholds",
"list",
"is",
"evenly",
"distributed",
"."
] | def is_evenly_distributed_thresholds(thresholds):
"""Check if the thresholds list is evenly distributed.
We could leverage evenly distributed thresholds to use less memory when
calculate metrcis like AUC where each individual threshold need to be
evaluted.
Args:
thresholds: A python list or tuple, or 1D... | [
"def",
"is_evenly_distributed_thresholds",
"(",
"thresholds",
")",
":",
"# Check the list value and see if it is evenly distributed.",
"num_thresholds",
"=",
"len",
"(",
"thresholds",
")",
"if",
"num_thresholds",
"<",
"3",
":",
"return",
"False",
"even_thresholds",
"=",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/utils/metrics_utils.py#L482-L502 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.PageDown | (*args, **kwargs) | return _richtext.RichTextCtrl_PageDown(*args, **kwargs) | PageDown(self, int noPages=1, int flags=0) -> bool
Move n pages down | PageDown(self, int noPages=1, int flags=0) -> bool | [
"PageDown",
"(",
"self",
"int",
"noPages",
"=",
"1",
"int",
"flags",
"=",
"0",
")",
"-",
">",
"bool"
] | def PageDown(*args, **kwargs):
"""
PageDown(self, int noPages=1, int flags=0) -> bool
Move n pages down
"""
return _richtext.RichTextCtrl_PageDown(*args, **kwargs) | [
"def",
"PageDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_PageDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3808-L3814 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/message.py | python | Message.del_param | (self, param, header='content-type', requote=True) | Remove the given parameter completely from the Content-Type header.
The header will be re-written in place without the parameter or its
value. All values will be quoted as necessary unless requote is
False. Optional header specifies an alternative to the Content-Type
header. | Remove the given parameter completely from the Content-Type header. | [
"Remove",
"the",
"given",
"parameter",
"completely",
"from",
"the",
"Content",
"-",
"Type",
"header",
"."
] | def del_param(self, param, header='content-type', requote=True):
"""Remove the given parameter completely from the Content-Type header.
The header will be re-written in place without the parameter or its
value. All values will be quoted as necessary unless requote is
False. Optional he... | [
"def",
"del_param",
"(",
"self",
",",
"param",
",",
"header",
"=",
"'content-type'",
",",
"requote",
"=",
"True",
")",
":",
"if",
"header",
"not",
"in",
"self",
":",
"return",
"new_ctype",
"=",
"''",
"for",
"p",
",",
"v",
"in",
"self",
".",
"get_para... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/message.py#L619-L639 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/input/vt100_parser.py | python | Vt100Parser._start_parser | (self) | Start the parser coroutine. | Start the parser coroutine. | [
"Start",
"the",
"parser",
"coroutine",
"."
] | def _start_parser(self) -> None:
"""
Start the parser coroutine.
"""
self._input_parser = self._input_parser_generator()
self._input_parser.send(None) | [
"def",
"_start_parser",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_input_parser",
"=",
"self",
".",
"_input_parser_generator",
"(",
")",
"self",
".",
"_input_parser",
".",
"send",
"(",
"None",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/input/vt100_parser.py#L94-L99 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/ceph.py | python | assign_devs | (roles, devs) | return dict(zip(roles, devs)) | Create a dictionary of devs indexed by roles
:param roles: List of roles
:param devs: Corresponding list of devices.
:returns: Dictionary of devs indexed by roles. | Create a dictionary of devs indexed by roles | [
"Create",
"a",
"dictionary",
"of",
"devs",
"indexed",
"by",
"roles"
] | def assign_devs(roles, devs):
"""
Create a dictionary of devs indexed by roles
:param roles: List of roles
:param devs: Corresponding list of devices.
:returns: Dictionary of devs indexed by roles.
"""
return dict(zip(roles, devs)) | [
"def",
"assign_devs",
"(",
"roles",
",",
"devs",
")",
":",
"return",
"dict",
"(",
"zip",
"(",
"roles",
",",
"devs",
")",
")"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph.py#L300-L308 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/httplib.py | python | HTTPConnection.send | (self, data) | Send `data' to the server. | Send `data' to the server. | [
"Send",
"data",
"to",
"the",
"server",
"."
] | def send(self, data):
"""Send `data' to the server."""
if self.sock is None:
if self.auto_open:
self.connect()
else:
raise NotConnected()
if self.debuglevel > 0:
print "send:", repr(data)
blocksize = 8192
if has... | [
"def",
"send",
"(",
"self",
",",
"data",
")",
":",
"if",
"self",
".",
"sock",
"is",
"None",
":",
"if",
"self",
".",
"auto_open",
":",
"self",
".",
"connect",
"(",
")",
"else",
":",
"raise",
"NotConnected",
"(",
")",
"if",
"self",
".",
"debuglevel",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/httplib.py#L840-L858 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/njoy.py | python | Njoy99.makefp | (self, eaf=0) | Creates a PENDF, GENDF, and DRAGLIB file for a single fission
product.
Parameters
----------
eaf : int
If eaf is 1, simplified processing is performed to be compatible
with the EAF nuclear library. | Creates a PENDF, GENDF, and DRAGLIB file for a single fission
product. | [
"Creates",
"a",
"PENDF",
"GENDF",
"and",
"DRAGLIB",
"file",
"for",
"a",
"single",
"fission",
"product",
"."
] | def makefp(self, eaf=0):
"""Creates a PENDF, GENDF, and DRAGLIB file for a single fission
product.
Parameters
----------
eaf : int
If eaf is 1, simplified processing is performed to be compatible
with the EAF nuclear library.
"""
self.sc... | [
"def",
"makefp",
"(",
"self",
",",
"eaf",
"=",
"0",
")",
":",
"self",
".",
"scattering_law",
"=",
"None",
"self",
".",
"fission",
"=",
"None",
"self",
".",
"dilutions",
"=",
"None",
"keeplegendre",
"=",
"self",
".",
"legendre",
"self",
".",
"legendre",... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/njoy.py#L555-L575 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/sensing.py | python | visible | (camera : Union[SimRobotSensor,GLViewport], object, full=True, robot=None) | return visible(camera,object.getBB(),full,robot) | Tests whether the given object is visible in a SimRobotSensor or a
GLViewport.
If you are doing this multiple times, first convert to GLViewport.
Args:
camera (SimRobotSensor or GLViewport): the camera.
object: a 3-vector, a (center,radius) pair indicating a sphere, an
axis-al... | Tests whether the given object is visible in a SimRobotSensor or a
GLViewport. | [
"Tests",
"whether",
"the",
"given",
"object",
"is",
"visible",
"in",
"a",
"SimRobotSensor",
"or",
"a",
"GLViewport",
"."
] | def visible(camera : Union[SimRobotSensor,GLViewport], object, full=True, robot=None) -> bool:
"""Tests whether the given object is visible in a SimRobotSensor or a
GLViewport.
If you are doing this multiple times, first convert to GLViewport.
Args:
camera (SimRobotSensor or GLViewport): the ... | [
"def",
"visible",
"(",
"camera",
":",
"Union",
"[",
"SimRobotSensor",
",",
"GLViewport",
"]",
",",
"object",
",",
"full",
"=",
"True",
",",
"robot",
"=",
"None",
")",
"->",
"bool",
":",
"if",
"isinstance",
"(",
"camera",
",",
"SimRobotSensor",
")",
":"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/sensing.py#L889-L985 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosgraph/src/rosgraph/xmlrpc.py | python | XmlRpcNode._run | (self) | Main processing thread body.
:raises: :exc:`socket.error` If server cannot bind | Main processing thread body.
:raises: :exc:`socket.error` If server cannot bind | [
"Main",
"processing",
"thread",
"body",
".",
":",
"raises",
":",
":",
"exc",
":",
"socket",
".",
"error",
"If",
"server",
"cannot",
"bind"
] | def _run(self):
"""
Main processing thread body.
:raises: :exc:`socket.error` If server cannot bind
"""
self._run_init()
while not self.is_shutdown:
try:
self.server.serve_forever()
except (IOError, select.error) as e:
... | [
"def",
"_run",
"(",
"self",
")",
":",
"self",
".",
"_run_init",
"(",
")",
"while",
"not",
"self",
".",
"is_shutdown",
":",
"try",
":",
"self",
".",
"server",
".",
"serve_forever",
"(",
")",
"except",
"(",
"IOError",
",",
"select",
".",
"error",
")",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosgraph/src/rosgraph/xmlrpc.py#L278-L296 | ||
ChenglongChen/kaggle-CrowdFlower | a72eabb2e53c308c345905eff79c3c8e3a389239 | Code/Feat/ngram.py | python | getUnigram | (words) | return words | Input: a list of words, e.g., ['I', 'am', 'Denny']
Output: a list of unigram | Input: a list of words, e.g., ['I', 'am', 'Denny']
Output: a list of unigram | [
"Input",
":",
"a",
"list",
"of",
"words",
"e",
".",
"g",
".",
"[",
"I",
"am",
"Denny",
"]",
"Output",
":",
"a",
"list",
"of",
"unigram"
] | def getUnigram(words):
"""
Input: a list of words, e.g., ['I', 'am', 'Denny']
Output: a list of unigram
"""
assert type(words) == list
return words | [
"def",
"getUnigram",
"(",
"words",
")",
":",
"assert",
"type",
"(",
"words",
")",
"==",
"list",
"return",
"words"
] | https://github.com/ChenglongChen/kaggle-CrowdFlower/blob/a72eabb2e53c308c345905eff79c3c8e3a389239/Code/Feat/ngram.py#L18-L24 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | lib/layers/generate_anchors.py | python | _whctrs | (anchor) | return w, h, x_ctr, y_ctr | Return width, height, x center, and y center for an anchor (window). | Return width, height, x center, and y center for an anchor (window). | [
"Return",
"width",
"height",
"x",
"center",
"and",
"y",
"center",
"for",
"an",
"anchor",
"(",
"window",
")",
"."
] | def _whctrs(anchor):
"""
Return width, height, x center, and y center for an anchor (window).
"""
w = anchor[2] - anchor[0] + 1
h = anchor[3] - anchor[1] + 1
x_ctr = anchor[0] + 0.5 * (w - 1)
y_ctr = anchor[1] + 0.5 * (h - 1)
return w, h, x_ctr, y_ctr | [
"def",
"_whctrs",
"(",
"anchor",
")",
":",
"w",
"=",
"anchor",
"[",
"2",
"]",
"-",
"anchor",
"[",
"0",
"]",
"+",
"1",
"h",
"=",
"anchor",
"[",
"3",
"]",
"-",
"anchor",
"[",
"1",
"]",
"+",
"1",
"x_ctr",
"=",
"anchor",
"[",
"0",
"]",
"+",
"... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/lib/layers/generate_anchors.py#L29-L38 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | LimitsProcessor.process | (self, contents, index) | Process the limits for an element. | Process the limits for an element. | [
"Process",
"the",
"limits",
"for",
"an",
"element",
"."
] | def process(self, contents, index):
"Process the limits for an element."
if Options.simplemath:
return
if self.checklimits(contents, index):
self.modifylimits(contents, index)
if self.checkscript(contents, index) and self.checkscript(contents, index + 1):
self.modifyscripts(contents, i... | [
"def",
"process",
"(",
"self",
",",
"contents",
",",
"index",
")",
":",
"if",
"Options",
".",
"simplemath",
":",
"return",
"if",
"self",
".",
"checklimits",
"(",
"contents",
",",
"index",
")",
":",
"self",
".",
"modifylimits",
"(",
"contents",
",",
"in... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L4668-L4675 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/numeric.py | python | UInt64Index.inferred_type | (self) | return "integer" | Always 'integer' for ``UInt64Index`` | Always 'integer' for ``UInt64Index`` | [
"Always",
"integer",
"for",
"UInt64Index"
] | def inferred_type(self) -> str:
"""
Always 'integer' for ``UInt64Index``
"""
return "integer" | [
"def",
"inferred_type",
"(",
"self",
")",
"->",
"str",
":",
"return",
"\"integer\""
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/numeric.py#L307-L311 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/update.py | python | Update.replace | (self, name, *args) | Replace records. The first argument is always a name. The other
arguments can be:
- rdataset...
- ttl, rdata...
- ttl, rdtype, string...
Note that if you want to replace the entire node, you should do
a delete of the name followed by one or m... | Replace records. The first argument is always a name. The other
arguments can be: | [
"Replace",
"records",
".",
"The",
"first",
"argument",
"is",
"always",
"a",
"name",
".",
"The",
"other",
"arguments",
"can",
"be",
":"
] | def replace(self, name, *args):
"""Replace records. The first argument is always a name. The other
arguments can be:
- rdataset...
- ttl, rdata...
- ttl, rdtype, string...
Note that if you want to replace the entire node, you should do
... | [
"def",
"replace",
"(",
"self",
",",
"name",
",",
"*",
"args",
")",
":",
"self",
".",
"_add",
"(",
"True",
",",
"self",
".",
"authority",
",",
"name",
",",
"*",
"args",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/update.py#L165-L178 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/ragged/ragged_array_ops.py | python | reverse | (tensor: ragged_tensor.Ragged, axis, name=None) | Reverses a RaggedTensor along the specified axes.
#### Example:
>>> data = tf.ragged.constant([
... [[1, 2], [3, 4]], [[5, 6]], [[7, 8], [9, 10], [11, 12]]])
>>> tf.reverse(data, axis=[0, 2])
<tf.RaggedTensor [[[8, 7], [10, 9], [12, 11]], [[6, 5]], [[2, 1], [4, 3]]]>
Args:
tensor: A 'RaggedTensor' ... | Reverses a RaggedTensor along the specified axes. | [
"Reverses",
"a",
"RaggedTensor",
"along",
"the",
"specified",
"axes",
"."
] | def reverse(tensor: ragged_tensor.Ragged, axis, name=None):
"""Reverses a RaggedTensor along the specified axes.
#### Example:
>>> data = tf.ragged.constant([
... [[1, 2], [3, 4]], [[5, 6]], [[7, 8], [9, 10], [11, 12]]])
>>> tf.reverse(data, axis=[0, 2])
<tf.RaggedTensor [[[8, 7], [10, 9], [12, 11]], [[... | [
"def",
"reverse",
"(",
"tensor",
":",
"ragged_tensor",
".",
"Ragged",
",",
"axis",
",",
"name",
"=",
"None",
")",
":",
"type_error_msg",
"=",
"(",
"'`axis` must be a list of int or a constant tensor'",
"'when reversing axes in a ragged tensor'",
")",
"with",
"ops",
".... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_array_ops.py#L676-L724 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextPrinting.SetRichTextBufferPrinting | (*args, **kwargs) | return _richtext.RichTextPrinting_SetRichTextBufferPrinting(*args, **kwargs) | SetRichTextBufferPrinting(self, RichTextBuffer buf) | SetRichTextBufferPrinting(self, RichTextBuffer buf) | [
"SetRichTextBufferPrinting",
"(",
"self",
"RichTextBuffer",
"buf",
")"
] | def SetRichTextBufferPrinting(*args, **kwargs):
"""SetRichTextBufferPrinting(self, RichTextBuffer buf)"""
return _richtext.RichTextPrinting_SetRichTextBufferPrinting(*args, **kwargs) | [
"def",
"SetRichTextBufferPrinting",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrinting_SetRichTextBufferPrinting",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4572-L4574 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/path-with-maximum-probability.py | python | Solution.maxProbability | (self, n, edges, succProb, start, end) | return result[end] | :type n: int
:type edges: List[List[int]]
:type succProb: List[float]
:type start: int
:type end: int
:rtype: float | :type n: int
:type edges: List[List[int]]
:type succProb: List[float]
:type start: int
:type end: int
:rtype: float | [
":",
"type",
"n",
":",
"int",
":",
"type",
"edges",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"type",
"succProb",
":",
"List",
"[",
"float",
"]",
":",
"type",
"start",
":",
"int",
":",
"type",
"end",
":",
"int",
":",
"rtype",
":",
"float... | def maxProbability(self, n, edges, succProb, start, end):
"""
:type n: int
:type edges: List[List[int]]
:type succProb: List[float]
:type start: int
:type end: int
:rtype: float
"""
adj = collections.defaultdict(list)
for (u, v), p in itert... | [
"def",
"maxProbability",
"(",
"self",
",",
"n",
",",
"edges",
",",
"succProb",
",",
"start",
",",
"end",
")",
":",
"adj",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"for",
"(",
"u",
",",
"v",
")",
",",
"p",
"in",
"itertools",
".",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/path-with-maximum-probability.py#L11-L39 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/core/serde/cloudpickle.py | python | CloudPickler.save_xrange | (self, obj) | Save an xrange object in python 2.5
Python 2.6 supports this natively | Save an xrange object in python 2.5
Python 2.6 supports this natively | [
"Save",
"an",
"xrange",
"object",
"in",
"python",
"2",
".",
"5",
"Python",
"2",
".",
"6",
"supports",
"this",
"natively"
] | def save_xrange(self, obj):
"""Save an xrange object in python 2.5
Python 2.6 supports this natively
"""
range_params = xrange_params(obj)
self.save_reduce(_build_xrange,range_params) | [
"def",
"save_xrange",
"(",
"self",
",",
"obj",
")",
":",
"range_params",
"=",
"xrange_params",
"(",
"obj",
")",
"self",
".",
"save_reduce",
"(",
"_build_xrange",
",",
"range_params",
")"
] | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/core/serde/cloudpickle.py#L659-L664 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py | python | BasicFittingModel._do_single_fit | (self, parameters: dict) | return function, fit_status, chi_squared | Does a single fit and returns the fit function, status and chi squared. Adds the results to the ADS. | Does a single fit and returns the fit function, status and chi squared. Adds the results to the ADS. | [
"Does",
"a",
"single",
"fit",
"and",
"returns",
"the",
"fit",
"function",
"status",
"and",
"chi",
"squared",
".",
"Adds",
"the",
"results",
"to",
"the",
"ADS",
"."
] | def _do_single_fit(self, parameters: dict) -> tuple:
"""Does a single fit and returns the fit function, status and chi squared. Adds the results to the ADS."""
output_workspace, parameter_table, function, fit_status, chi_squared, covariance_matrix = \
self._do_single_fit_and_return_workspace... | [
"def",
"_do_single_fit",
"(",
"self",
",",
"parameters",
":",
"dict",
")",
"->",
"tuple",
":",
"output_workspace",
",",
"parameter_table",
",",
"function",
",",
"fit_status",
",",
"chi_squared",
",",
"covariance_matrix",
"=",
"self",
".",
"_do_single_fit_and_retur... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py#L673-L680 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/utils/EnumGenerator.py | python | open_file | (name, type) | return fp | Open the file for writing | Open the file for writing | [
"Open",
"the",
"file",
"for",
"writing"
] | def open_file(name, type):
"""
Open the file for writing
"""
filename = name + "EnumAc." + type
fp = open(filename, "w")
if fp is None:
print("Could not open file %s" % filename)
sys.exit(-1)
return fp | [
"def",
"open_file",
"(",
"name",
",",
"type",
")",
":",
"filename",
"=",
"name",
"+",
"\"EnumAc.\"",
"+",
"type",
"fp",
"=",
"open",
"(",
"filename",
",",
"\"w\"",
")",
"if",
"fp",
"is",
"None",
":",
"print",
"(",
"\"Could not open file %s\"",
"%",
"fi... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/EnumGenerator.py#L27-L37 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.Blit | (*args, **kwargs) | return _gdi_.DC_Blit(*args, **kwargs) | Blit(self, int xdest, int ydest, int width, int height, DC source,
int xsrc, int ysrc, int rop=COPY, bool useMask=False,
int xsrcMask=-1, int ysrcMask=-1) -> bool
Copy from a source DC to this DC. Parameters specify the destination
coordinates, size of area to copy, source DC... | Blit(self, int xdest, int ydest, int width, int height, DC source,
int xsrc, int ysrc, int rop=COPY, bool useMask=False,
int xsrcMask=-1, int ysrcMask=-1) -> bool | [
"Blit",
"(",
"self",
"int",
"xdest",
"int",
"ydest",
"int",
"width",
"int",
"height",
"DC",
"source",
"int",
"xsrc",
"int",
"ysrc",
"int",
"rop",
"=",
"COPY",
"bool",
"useMask",
"=",
"False",
"int",
"xsrcMask",
"=",
"-",
"1",
"int",
"ysrcMask",
"=",
... | def Blit(*args, **kwargs):
"""
Blit(self, int xdest, int ydest, int width, int height, DC source,
int xsrc, int ysrc, int rop=COPY, bool useMask=False,
int xsrcMask=-1, int ysrcMask=-1) -> bool
Copy from a source DC to this DC. Parameters specify the destination
... | [
"def",
"Blit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_Blit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3771-L3782 | |
i42output/neoGFX | 529857e006466271f9775e1a77882c3919e1c3e1 | 3rdparty/harfbuzz/harfbuzz-3.2.0/src/gen-tag-table.py | python | BCP47Parser._get_name_piece | (self, subtag) | return self.names[subtag].split ('\n')[0] + self.scopes.get (subtag, '') | Return the first name of a subtag plus its scope suffix.
Args:
subtag (str): A BCP 47 subtag.
Returns:
The name form of ``subtag``. | Return the first name of a subtag plus its scope suffix. | [
"Return",
"the",
"first",
"name",
"of",
"a",
"subtag",
"plus",
"its",
"scope",
"suffix",
"."
] | def _get_name_piece (self, subtag):
"""Return the first name of a subtag plus its scope suffix.
Args:
subtag (str): A BCP 47 subtag.
Returns:
The name form of ``subtag``.
"""
return self.names[subtag].split ('\n')[0] + self.scopes.get (subtag, '') | [
"def",
"_get_name_piece",
"(",
"self",
",",
"subtag",
")",
":",
"return",
"self",
".",
"names",
"[",
"subtag",
"]",
".",
"split",
"(",
"'\\n'",
")",
"[",
"0",
"]",
"+",
"self",
".",
"scopes",
".",
"get",
"(",
"subtag",
",",
"''",
")"
] | https://github.com/i42output/neoGFX/blob/529857e006466271f9775e1a77882c3919e1c3e1/3rdparty/harfbuzz/harfbuzz-3.2.0/src/gen-tag-table.py#L629-L638 | |
yuxng/DA-RNN | 77fbb50b4272514588a10a9f90b7d5f8d46974fb | lib/datasets/shapenet_scene.py | python | shapenet_scene._get_default_path | (self) | return os.path.join(datasets.ROOT_DIR, 'data', 'ShapeNetScene') | Return the default path where KITTI is expected to be installed. | Return the default path where KITTI is expected to be installed. | [
"Return",
"the",
"default",
"path",
"where",
"KITTI",
"is",
"expected",
"to",
"be",
"installed",
"."
] | def _get_default_path(self):
"""
Return the default path where KITTI is expected to be installed.
"""
return os.path.join(datasets.ROOT_DIR, 'data', 'ShapeNetScene') | [
"def",
"_get_default_path",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"datasets",
".",
"ROOT_DIR",
",",
"'data'",
",",
"'ShapeNetScene'",
")"
] | https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/datasets/shapenet_scene.py#L111-L115 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/image_ops_impl.py | python | _ssim_helper | (x, y, reducer, max_val, compensation=1.0, k1=0.01, k2=0.03) | return luminance, cs | r"""Helper function for computing SSIM.
SSIM estimates covariances with weighted sums. The default parameters
use a biased estimate of the covariance:
Suppose `reducer` is a weighted sum, then the mean estimators are
\mu_x = \sum_i w_i x_i,
\mu_y = \sum_i w_i y_i,
where w_i's are the weighted-sum weig... | r"""Helper function for computing SSIM. | [
"r",
"Helper",
"function",
"for",
"computing",
"SSIM",
"."
] | def _ssim_helper(x, y, reducer, max_val, compensation=1.0, k1=0.01, k2=0.03):
r"""Helper function for computing SSIM.
SSIM estimates covariances with weighted sums. The default parameters
use a biased estimate of the covariance:
Suppose `reducer` is a weighted sum, then the mean estimators are
\mu_x = \su... | [
"def",
"_ssim_helper",
"(",
"x",
",",
"y",
",",
"reducer",
",",
"max_val",
",",
"compensation",
"=",
"1.0",
",",
"k1",
"=",
"0.01",
",",
"k2",
"=",
"0.03",
")",
":",
"c1",
"=",
"(",
"k1",
"*",
"max_val",
")",
"**",
"2",
"c2",
"=",
"(",
"k2",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L4102-L4157 | |
tzutalin/dlib-android | 989627cb7fe81cd1d41d73434b0e91ce1dd2683f | tools/lint/cpplint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time matching parentheses.
Ideally we would want to index all o... | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time matching parentheses.
Ideally we would want to index all o... | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
".",
"If",
"lines",
"[",
"linenum",
"]",
"[",
"pos",
"]",
"points",
"to",
"a",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds... | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
TODO(unknown): cpplint spends a fair bit of time matchin... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"(",
"line",
"[",
"pos",
"]",
"not",
"in",
"'({[<'",
")",
"or",
"Match",
"(",
"r'<[<=]'",
",",
"... | https://github.com/tzutalin/dlib-android/blob/989627cb7fe81cd1d41d73434b0e91ce1dd2683f/tools/lint/cpplint.py#L1484-L1521 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/robotparser.py | python | RobotFileParser.parse | (self, lines) | parse the input lines from a robots.txt file.
We allow that a user-agent: line is not preceded by
one or more blank lines. | parse the input lines from a robots.txt file.
We allow that a user-agent: line is not preceded by
one or more blank lines. | [
"parse",
"the",
"input",
"lines",
"from",
"a",
"robots",
".",
"txt",
"file",
".",
"We",
"allow",
"that",
"a",
"user",
"-",
"agent",
":",
"line",
"is",
"not",
"preceded",
"by",
"one",
"or",
"more",
"blank",
"lines",
"."
] | def parse(self, lines):
"""parse the input lines from a robots.txt file.
We allow that a user-agent: line is not preceded by
one or more blank lines."""
# states:
# 0: start state
# 1: saw user-agent line
# 2: saw an allow or disallow line
stat... | [
"def",
"parse",
"(",
"self",
",",
"lines",
")",
":",
"# states:",
"# 0: start state",
"# 1: saw user-agent line",
"# 2: saw an allow or disallow line",
"state",
"=",
"0",
"linenumber",
"=",
"0",
"entry",
"=",
"Entry",
"(",
")",
"for",
"line",
"in",
"lines",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/robotparser.py#L77-L125 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/compiler.py | python | Frame.inner | (self, isolated=False) | return Frame(self.eval_ctx, self) | Return an inner frame. | Return an inner frame. | [
"Return",
"an",
"inner",
"frame",
"."
] | def inner(self, isolated=False):
"""Return an inner frame."""
if isolated:
return Frame(self.eval_ctx, level=self.symbols.level + 1)
return Frame(self.eval_ctx, self) | [
"def",
"inner",
"(",
"self",
",",
"isolated",
"=",
"False",
")",
":",
"if",
"isolated",
":",
"return",
"Frame",
"(",
"self",
".",
"eval_ctx",
",",
"level",
"=",
"self",
".",
"symbols",
".",
"level",
"+",
"1",
")",
"return",
"Frame",
"(",
"self",
".... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/compiler.py#L172-L176 | |
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | scripts/cpp_lint.py | python | CheckSpacing | (filename, clean_lines, linenum, nesting_state, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't star... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want to check inside C++11",
... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L2643-L2988 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/lite/experiment/HPC-generator/generator.py | python | print_line | (line) | return "\"".join(result) | Convert line to a python string
:param line:
:return: | Convert line to a python string
:param line:
:return: | [
"Convert",
"line",
"to",
"a",
"python",
"string",
":",
"param",
"line",
":",
":",
"return",
":"
] | def print_line(line):
"""
Convert line to a python string
:param line:
:return:
"""
global python_indent
global generate_code_indent
if line.strip()[0] == "}" or line.strip()[0] == ")":
python_indent = -1
split_str = line.split("@")
if line.strip()[0] != "@" and len(split... | [
"def",
"print_line",
"(",
"line",
")",
":",
"global",
"python_indent",
"global",
"generate_code_indent",
"if",
"line",
".",
"strip",
"(",
")",
"[",
"0",
"]",
"==",
"\"}\"",
"or",
"line",
".",
"strip",
"(",
")",
"[",
"0",
"]",
"==",
"\")\"",
":",
"pyt... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/lite/experiment/HPC-generator/generator.py#L57-L101 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/plugdlg.py | python | PluginDialog.OnDestroy | (self, evt) | Cleanup message handlers on delete | Cleanup message handlers on delete | [
"Cleanup",
"message",
"handlers",
"on",
"delete"
] | def OnDestroy(self, evt):
"""Cleanup message handlers on delete"""
if evt.GetId() == self.GetId():
ed_msg.Unsubscribe(self.OnThemeChange)
evt.Skip() | [
"def",
"OnDestroy",
"(",
"self",
",",
"evt",
")",
":",
"if",
"evt",
".",
"GetId",
"(",
")",
"==",
"self",
".",
"GetId",
"(",
")",
":",
"ed_msg",
".",
"Unsubscribe",
"(",
"self",
".",
"OnThemeChange",
")",
"evt",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugdlg.py#L147-L151 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/simple.py | python | GetScalarBar | (ctf, view=None) | return sb | Returns the scalar bar for color transfer function in the given view.
If view is None, the active view will be used, if possible.
This will either return an existing scalar bar or create a new one. | Returns the scalar bar for color transfer function in the given view.
If view is None, the active view will be used, if possible.
This will either return an existing scalar bar or create a new one. | [
"Returns",
"the",
"scalar",
"bar",
"for",
"color",
"transfer",
"function",
"in",
"the",
"given",
"view",
".",
"If",
"view",
"is",
"None",
"the",
"active",
"view",
"will",
"be",
"used",
"if",
"possible",
".",
"This",
"will",
"either",
"return",
"an",
"exi... | def GetScalarBar(ctf, view=None):
"""Returns the scalar bar for color transfer function in the given view.
If view is None, the active view will be used, if possible.
This will either return an existing scalar bar or create a new one."""
view = view if view else active_objects.view
if not view:
... | [
"def",
"GetScalarBar",
"(",
"ctf",
",",
"view",
"=",
"None",
")",
":",
"view",
"=",
"view",
"if",
"view",
"else",
"active_objects",
".",
"view",
"if",
"not",
"view",
":",
"raise",
"ValueError",
"(",
"\"'view' argument cannot be None when no active view is present\... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/simple.py#L1805-L1815 | |
sofa-framework/sofa | 70628e35a44fcc258cf8250109b5e4eba8c5abe9 | applications/plugins/PSL/python/pslloader.py | python | SetPath | (newpath) | This context manager is setting & restoring the current path.
This is very practical to insure that all the processing is done
where the file is located. | This context manager is setting & restoring the current path.
This is very practical to insure that all the processing is done
where the file is located. | [
"This",
"context",
"manager",
"is",
"setting",
"&",
"restoring",
"the",
"current",
"path",
".",
"This",
"is",
"very",
"practical",
"to",
"insure",
"that",
"all",
"the",
"processing",
"is",
"done",
"where",
"the",
"file",
"is",
"located",
"."
] | def SetPath(newpath):
'''This context manager is setting & restoring the current path.
This is very practical to insure that all the processing is done
where the file is located.
'''
curdir= os.getcwd()
os.chdir(newpath)
try: yield
finally: os.chdir(curdir) | [
"def",
"SetPath",
"(",
"newpath",
")",
":",
"curdir",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"newpath",
")",
"try",
":",
"yield",
"finally",
":",
"os",
".",
"chdir",
"(",
"curdir",
")"
] | https://github.com/sofa-framework/sofa/blob/70628e35a44fcc258cf8250109b5e4eba8c5abe9/applications/plugins/PSL/python/pslloader.py#L43-L51 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/toolbar.py | python | RibbonToolBar.GetToolByPos | (self, pos) | return None | Returns a pointer to the tool opaque structure by `pos` or ``None`` if
no corresponding tool is found.
:param `pos`: zero-based position of the tool to retrieve.
:returns: An instance of :class:`RibbonToolBarToolBase` if the tool was found,
``None`` if it was not found.
.. ve... | Returns a pointer to the tool opaque structure by `pos` or ``None`` if
no corresponding tool is found. | [
"Returns",
"a",
"pointer",
"to",
"the",
"tool",
"opaque",
"structure",
"by",
"pos",
"or",
"None",
"if",
"no",
"corresponding",
"tool",
"is",
"found",
"."
] | def GetToolByPos(self, pos):
"""
Returns a pointer to the tool opaque structure by `pos` or ``None`` if
no corresponding tool is found.
:param `pos`: zero-based position of the tool to retrieve.
:returns: An instance of :class:`RibbonToolBarToolBase` if the tool was found,
... | [
"def",
"GetToolByPos",
"(",
"self",
",",
"pos",
")",
":",
"for",
"group",
"in",
"self",
".",
"_groups",
":",
"tool_count",
"=",
"len",
"(",
"group",
".",
"tools",
")",
"if",
"pos",
"<",
"tool_count",
":",
"return",
"group",
".",
"tools",
"[",
"pos",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/toolbar.py#L574-L596 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchMaterial.py | python | makeMaterial | (name="Material",color=None,transparency=None) | return obj | makeMaterial(name): makes an Material object | makeMaterial(name): makes an Material object | [
"makeMaterial",
"(",
"name",
")",
":",
"makes",
"an",
"Material",
"object"
] | def makeMaterial(name="Material",color=None,transparency=None):
'''makeMaterial(name): makes an Material object'''
if not FreeCAD.ActiveDocument:
FreeCAD.Console.PrintError("No active document. Aborting\n")
return
obj = FreeCAD.ActiveDocument.addObject("App::MaterialObjectPython","Material"... | [
"def",
"makeMaterial",
"(",
"name",
"=",
"\"Material\"",
",",
"color",
"=",
"None",
",",
"transparency",
"=",
"None",
")",
":",
"if",
"not",
"FreeCAD",
".",
"ActiveDocument",
":",
"FreeCAD",
".",
"Console",
".",
"PrintError",
"(",
"\"No active document. Aborti... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchMaterial.py#L48-L66 | |
bumptop/BumpTop | 466d23597a07ae738f4265262fa01087fc6e257c | trunk/win/Source/bin/jinja2/filters.py | python | do_indent | (s, width=4, indentfirst=False) | return rv | Return a copy of the passed string, each line indented by
4 spaces. The first line is not indented. If you want to
change the number of spaces or indent the first line too
you can pass additional parameters to the filter:
.. sourcecode:: jinja
{{ mytext|indent(2, true) }}
indent by... | Return a copy of the passed string, each line indented by
4 spaces. The first line is not indented. If you want to
change the number of spaces or indent the first line too
you can pass additional parameters to the filter: | [
"Return",
"a",
"copy",
"of",
"the",
"passed",
"string",
"each",
"line",
"indented",
"by",
"4",
"spaces",
".",
"The",
"first",
"line",
"is",
"not",
"indented",
".",
"If",
"you",
"want",
"to",
"change",
"the",
"number",
"of",
"spaces",
"or",
"indent",
"t... | def do_indent(s, width=4, indentfirst=False):
"""Return a copy of the passed string, each line indented by
4 spaces. The first line is not indented. If you want to
change the number of spaces or indent the first line too
you can pass additional parameters to the filter:
.. sourcecode:: jinja
... | [
"def",
"do_indent",
"(",
"s",
",",
"width",
"=",
"4",
",",
"indentfirst",
"=",
"False",
")",
":",
"indention",
"=",
"u' '",
"*",
"width",
"rv",
"=",
"(",
"u'\\n'",
"+",
"indention",
")",
".",
"join",
"(",
"s",
".",
"splitlines",
"(",
")",
")",
"i... | https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/filters.py#L331-L346 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBModuleSpec.SetObjectName | (self, name) | return _lldb.SBModuleSpec_SetObjectName(self, name) | SetObjectName(SBModuleSpec self, char const * name) | SetObjectName(SBModuleSpec self, char const * name) | [
"SetObjectName",
"(",
"SBModuleSpec",
"self",
"char",
"const",
"*",
"name",
")"
] | def SetObjectName(self, name):
"""SetObjectName(SBModuleSpec self, char const * name)"""
return _lldb.SBModuleSpec_SetObjectName(self, name) | [
"def",
"SetObjectName",
"(",
"self",
",",
"name",
")",
":",
"return",
"_lldb",
".",
"SBModuleSpec_SetObjectName",
"(",
"self",
",",
"name",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L7810-L7812 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | safe_version | (version) | Convert an arbitrary string to a standard version string | Convert an arbitrary string to a standard version string | [
"Convert",
"an",
"arbitrary",
"string",
"to",
"a",
"standard",
"version",
"string"
] | def safe_version(version):
"""
Convert an arbitrary string to a standard version string
"""
try:
# normalize the version
return str(packaging.version.Version(version))
except packaging.version.InvalidVersion:
version = version.replace(' ', '.')
return re.sub('[^A-Za-z... | [
"def",
"safe_version",
"(",
"version",
")",
":",
"try",
":",
"# normalize the version",
"return",
"str",
"(",
"packaging",
".",
"version",
".",
"Version",
"(",
"version",
")",
")",
"except",
"packaging",
".",
"version",
".",
"InvalidVersion",
":",
"version",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L1325-L1334 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextObject.AdjustAvailableSpace | (*args, **kwargs) | return _richtext.RichTextObject_AdjustAvailableSpace(*args, **kwargs) | AdjustAvailableSpace(DC dc, RichTextBuffer buffer, RichTextAttr parentAttr,
RichTextAttr childAttr, Rect availableParentSpace,
Rect availableContainerSpace) -> Rect | AdjustAvailableSpace(DC dc, RichTextBuffer buffer, RichTextAttr parentAttr,
RichTextAttr childAttr, Rect availableParentSpace,
Rect availableContainerSpace) -> Rect | [
"AdjustAvailableSpace",
"(",
"DC",
"dc",
"RichTextBuffer",
"buffer",
"RichTextAttr",
"parentAttr",
"RichTextAttr",
"childAttr",
"Rect",
"availableParentSpace",
"Rect",
"availableContainerSpace",
")",
"-",
">",
"Rect"
] | def AdjustAvailableSpace(*args, **kwargs):
"""
AdjustAvailableSpace(DC dc, RichTextBuffer buffer, RichTextAttr parentAttr,
RichTextAttr childAttr, Rect availableParentSpace,
Rect availableContainerSpace) -> Rect
"""
return _richtext.RichTextObject_AdjustAvailabl... | [
"def",
"AdjustAvailableSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_AdjustAvailableSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1442-L1448 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/graphy/graphy/common.py | python | BaseChart.GetDependentAxis | (self) | return self.left | Return this chart's main dependent axis (often 'left', but
horizontal bar-charts use 'bottom'). | Return this chart's main dependent axis (often 'left', but
horizontal bar-charts use 'bottom'). | [
"Return",
"this",
"chart",
"s",
"main",
"dependent",
"axis",
"(",
"often",
"left",
"but",
"horizontal",
"bar",
"-",
"charts",
"use",
"bottom",
")",
"."
] | def GetDependentAxis(self):
"""Return this chart's main dependent axis (often 'left', but
horizontal bar-charts use 'bottom').
"""
return self.left | [
"def",
"GetDependentAxis",
"(",
"self",
")",
":",
"return",
"self",
".",
"left"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/graphy/graphy/common.py#L282-L286 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.py | python | Decimal.compare_total_mag | (self, other) | return s.compare_total(o) | Compares self to other using abstract repr., ignoring sign.
Like compare_total, but with operand's sign ignored and assumed to be 0. | Compares self to other using abstract repr., ignoring sign. | [
"Compares",
"self",
"to",
"other",
"using",
"abstract",
"repr",
".",
"ignoring",
"sign",
"."
] | def compare_total_mag(self, other):
"""Compares self to other using abstract repr., ignoring sign.
Like compare_total, but with operand's sign ignored and assumed to be 0.
"""
other = _convert_other(other, raiseit=True)
s = self.copy_abs()
o = other.copy_abs()
r... | [
"def",
"compare_total_mag",
"(",
"self",
",",
"other",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"s",
"=",
"self",
".",
"copy_abs",
"(",
")",
"o",
"=",
"other",
".",
"copy_abs",
"(",
")",
"return",
"s",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L2749-L2758 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Compiler/Code.py | python | UtilityCode.wrap_c_strings | (self, impl) | return impl | Replace CSTRING('''xyz''') by a C compatible string | Replace CSTRING('''xyz''') by a C compatible string | [
"Replace",
"CSTRING",
"(",
"xyz",
")",
"by",
"a",
"C",
"compatible",
"string"
] | def wrap_c_strings(self, impl):
"""Replace CSTRING('''xyz''') by a C compatible string
"""
if 'CSTRING(' not in impl:
return impl
def split_string(matchobj):
content = matchobj.group(1).replace('"', '\042')
return ''.join(
'"%s\\n"\n' ... | [
"def",
"wrap_c_strings",
"(",
"self",
",",
"impl",
")",
":",
"if",
"'CSTRING('",
"not",
"in",
"impl",
":",
"return",
"impl",
"def",
"split_string",
"(",
"matchobj",
")",
":",
"content",
"=",
"matchobj",
".",
"group",
"(",
"1",
")",
".",
"replace",
"(",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/Code.py#L575-L589 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py | python | ShareableList._get_packing_format | (self, position) | return fmt_as_str | Gets the packing format for a single value stored in the list. | Gets the packing format for a single value stored in the list. | [
"Gets",
"the",
"packing",
"format",
"for",
"a",
"single",
"value",
"stored",
"in",
"the",
"list",
"."
] | def _get_packing_format(self, position):
"Gets the packing format for a single value stored in the list."
position = position if position >= 0 else position + self._list_len
if (position >= self._list_len) or (self._list_len < 0):
raise IndexError("Requested position out of range.")
... | [
"def",
"_get_packing_format",
"(",
"self",
",",
"position",
")",
":",
"position",
"=",
"position",
"if",
"position",
">=",
"0",
"else",
"position",
"+",
"self",
".",
"_list_len",
"if",
"(",
"position",
">=",
"self",
".",
"_list_len",
")",
"or",
"(",
"sel... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py#L369-L383 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/view_audio.py | python | AudioDemo.clear_output | (self) | remove some of the Output based a the timeout callback | remove some of the Output based a the timeout callback | [
"remove",
"some",
"of",
"the",
"Output",
"based",
"a",
"the",
"timeout",
"callback"
] | def clear_output(self):
""" remove some of the Output based a the timeout callback """
self.output_text.delete(1.0, 2.0) | [
"def",
"clear_output",
"(",
"self",
")",
":",
"self",
".",
"output_text",
".",
"delete",
"(",
"1.0",
",",
"2.0",
")"
] | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/view_audio.py#L373-L375 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/pylib/results/json_results.py | python | GenerateJsonTestResultFormatFile | (test_run_result, interrupted, file_path,
**kwargs) | Write |test_run_result| to JSON.
This uses the official Chromium Test Results Format.
Args:
test_run_result: a base_test_result.TestRunResults object.
interrupted: True if tests were interrupted, e.g. timeout listing tests
file_path: The path to the JSON file to write. | Write |test_run_result| to JSON. | [
"Write",
"|test_run_result|",
"to",
"JSON",
"."
] | def GenerateJsonTestResultFormatFile(test_run_result, interrupted, file_path,
**kwargs):
"""Write |test_run_result| to JSON.
This uses the official Chromium Test Results Format.
Args:
test_run_result: a base_test_result.TestRunResults object.
interrupted: True if tes... | [
"def",
"GenerateJsonTestResultFormatFile",
"(",
"test_run_result",
",",
"interrupted",
",",
"file_path",
",",
"*",
"*",
"kwargs",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"'w'",
")",
"as",
"json_result_file",
":",
"json_result_file",
".",
"write",
"(",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/results/json_results.py#L197-L213 | ||
tuttleofx/TuttleOFX | 36fc4cae15092a84ea8c29b9c6658c7cabfadb6e | applications/sam/common/samDoUtils.py | python | SplitCmdNode.getArgument | (self, name) | return (None, None) | If not found, returns (None, None) | If not found, returns (None, None) | [
"If",
"not",
"found",
"returns",
"(",
"None",
"None",
")"
] | def getArgument(self, name):
"""
If not found, returns (None, None)
"""
for argName, argvalue in self._arguments:
if argName == name:
return (argName, argvalue)
return (None, None) | [
"def",
"getArgument",
"(",
"self",
",",
"name",
")",
":",
"for",
"argName",
",",
"argvalue",
"in",
"self",
".",
"_arguments",
":",
"if",
"argName",
"==",
"name",
":",
"return",
"(",
"argName",
",",
"argvalue",
")",
"return",
"(",
"None",
",",
"None",
... | https://github.com/tuttleofx/TuttleOFX/blob/36fc4cae15092a84ea8c29b9c6658c7cabfadb6e/applications/sam/common/samDoUtils.py#L292-L299 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/uu.py | python | decode | (in_file, out_file=None, mode=None, quiet=False) | Decode uuencoded file | Decode uuencoded file | [
"Decode",
"uuencoded",
"file"
] | def decode(in_file, out_file=None, mode=None, quiet=False):
"""Decode uuencoded file"""
#
# Open the input file, if needed.
#
opened_files = []
if in_file == '-':
in_file = sys.stdin.buffer
elif isinstance(in_file, str):
in_file = open(in_file, 'rb')
opened_files.appe... | [
"def",
"decode",
"(",
"in_file",
",",
"out_file",
"=",
"None",
",",
"mode",
"=",
"None",
",",
"quiet",
"=",
"False",
")",
":",
"#",
"# Open the input file, if needed.",
"#",
"opened_files",
"=",
"[",
"]",
"if",
"in_file",
"==",
"'-'",
":",
"in_file",
"="... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/uu.py#L100-L165 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/linalg/linalg_impl.py | python | matrix_exponential | (input, name=None) | r"""Computes the matrix exponential of one or more square matrices.
$$exp(A) = \sum_{n=0}^\infty A^n/n!$$
The exponential is computed using a combination of the scaling and squaring
method and the Pade approximation. Details can be found in:
Nicholas J. Higham, "The scaling and squaring method for the matrix
... | r"""Computes the matrix exponential of one or more square matrices. | [
"r",
"Computes",
"the",
"matrix",
"exponential",
"of",
"one",
"or",
"more",
"square",
"matrices",
"."
] | def matrix_exponential(input, name=None): # pylint: disable=redefined-builtin
r"""Computes the matrix exponential of one or more square matrices.
$$exp(A) = \sum_{n=0}^\infty A^n/n!$$
The exponential is computed using a combination of the scaling and squaring
method and the Pade approximation. Details can be... | [
"def",
"matrix_exponential",
"(",
"input",
",",
"name",
"=",
"None",
")",
":",
"# pylint: disable=redefined-builtin",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"'matrix_exponential'",
",",
"[",
"input",
"]",
")",
":",
"matrix",
"=",
"ops",
".",
"co... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/linalg_impl.py#L231-L344 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/ValidationKit/common/utils.py | python | getTimePrefixAndIsoTimestamp | () | return (sTsPrf, sTsIso) | Returns current UTC as log prefix and iso timestamp. | Returns current UTC as log prefix and iso timestamp. | [
"Returns",
"current",
"UTC",
"as",
"log",
"prefix",
"and",
"iso",
"timestamp",
"."
] | def getTimePrefixAndIsoTimestamp():
"""
Returns current UTC as log prefix and iso timestamp.
"""
try:
oNow = datetime.datetime.utcnow();
sTsPrf = '%02u:%02u:%02u.%06u' % (oNow.hour, oNow.minute, oNow.second, oNow.microsecond);
sTsIso = formatIsoTimestamp(oNow);
except:
... | [
"def",
"getTimePrefixAndIsoTimestamp",
"(",
")",
":",
"try",
":",
"oNow",
"=",
"datetime",
".",
"datetime",
".",
"utcnow",
"(",
")",
"sTsPrf",
"=",
"'%02u:%02u:%02u.%06u'",
"%",
"(",
"oNow",
".",
"hour",
",",
"oNow",
".",
"minute",
",",
"oNow",
".",
"sec... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L1306-L1316 | |
AXErunners/axe | 53f14e8112ab6370b96e1e78d2858dabc886bba4 | contrib/devtools/security-check.py | python | get_PE_dll_characteristics | (executable) | return (arch,bits) | Get PE DllCharacteristics bits.
Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'
and bits is the DllCharacteristics value. | Get PE DllCharacteristics bits.
Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'
and bits is the DllCharacteristics value. | [
"Get",
"PE",
"DllCharacteristics",
"bits",
".",
"Returns",
"a",
"tuple",
"(",
"arch",
"bits",
")",
"where",
"arch",
"is",
"i386",
":",
"x86",
"-",
"64",
"or",
"i386",
"and",
"bits",
"is",
"the",
"DllCharacteristics",
"value",
"."
] | def get_PE_dll_characteristics(executable):
'''
Get PE DllCharacteristics bits.
Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'
and bits is the DllCharacteristics value.
'''
p = subprocess.Popen([OBJDUMP_CMD, '-x', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, s... | [
"def",
"get_PE_dll_characteristics",
"(",
"executable",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"OBJDUMP_CMD",
",",
"'-x'",
",",
"executable",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIP... | https://github.com/AXErunners/axe/blob/53f14e8112ab6370b96e1e78d2858dabc886bba4/contrib/devtools/security-check.py#L118-L136 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenu.OnChar | (self, key) | return processed | Handles key events for :class:`FlatMenu`.
:param `key`: the keyboard key integer code. | Handles key events for :class:`FlatMenu`. | [
"Handles",
"key",
"events",
"for",
":",
"class",
":",
"FlatMenu",
"."
] | def OnChar(self, key):
"""
Handles key events for :class:`FlatMenu`.
:param `key`: the keyboard key integer code.
"""
processed = True
if key == wx.WXK_ESCAPE:
if self._parentMenu:
self._parentMenu.CloseSubMenu(-1)
else:... | [
"def",
"OnChar",
"(",
"self",
",",
"key",
")",
":",
"processed",
"=",
"True",
"if",
"key",
"==",
"wx",
".",
"WXK_ESCAPE",
":",
"if",
"self",
".",
"_parentMenu",
":",
"self",
".",
"_parentMenu",
".",
"CloseSubMenu",
"(",
"-",
"1",
")",
"else",
":",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L5846-L5979 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/util/ssl_.py | python | ssl_wrap_socket | (
sock,
keyfile=None,
certfile=None,
cert_reqs=None,
ca_certs=None,
server_hostname=None,
ssl_version=None,
ciphers=None,
ssl_context=None,
ca_cert_dir=None,
key_password=None,
) | return context.wrap_socket(sock) | All arguments except for server_hostname, ssl_context, and ca_cert_dir have
the same meaning as they do when using :func:`ssl.wrap_socket`.
:param server_hostname:
When SNI is supported, the expected hostname of the certificate
:param ssl_context:
A pre-made :class:`SSLContext` object. If n... | All arguments except for server_hostname, ssl_context, and ca_cert_dir have
the same meaning as they do when using :func:`ssl.wrap_socket`. | [
"All",
"arguments",
"except",
"for",
"server_hostname",
"ssl_context",
"and",
"ca_cert_dir",
"have",
"the",
"same",
"meaning",
"as",
"they",
"do",
"when",
"using",
":",
"func",
":",
"ssl",
".",
"wrap_socket",
"."
] | def ssl_wrap_socket(
sock,
keyfile=None,
certfile=None,
cert_reqs=None,
ca_certs=None,
server_hostname=None,
ssl_version=None,
ciphers=None,
ssl_context=None,
ca_cert_dir=None,
key_password=None,
):
"""
All arguments except for server_hostname, ssl_context, and ca_cer... | [
"def",
"ssl_wrap_socket",
"(",
"sock",
",",
"keyfile",
"=",
"None",
",",
"certfile",
"=",
"None",
",",
"cert_reqs",
"=",
"None",
",",
"ca_certs",
"=",
"None",
",",
"server_hostname",
"=",
"None",
",",
"ssl_version",
"=",
"None",
",",
"ciphers",
"=",
"Non... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/util/ssl_.py#L296-L383 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/command/build_py.py | python | build_py.find_data_files | (self, package, src_dir) | return self.exclude_data_files(package, src_dir, files) | Return filenames for package's data files in 'src_dir | Return filenames for package's data files in 'src_dir | [
"Return",
"filenames",
"for",
"package",
"s",
"data",
"files",
"in",
"src_dir"
] | def find_data_files(self, package, src_dir):
"""Return filenames for package's data files in 'src_dir'"""
patterns = self._get_platform_patterns(
self.package_data,
package,
src_dir,
)
globs_expanded = map(glob, patterns)
# flatten the expanded... | [
"def",
"find_data_files",
"(",
"self",
",",
"package",
",",
"src_dir",
")",
":",
"patterns",
"=",
"self",
".",
"_get_platform_patterns",
"(",
"self",
".",
"package_data",
",",
"package",
",",
"src_dir",
",",
")",
"globs_expanded",
"=",
"map",
"(",
"glob",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/command/build_py.py#L99-L114 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/aoc/genie_effect.py | python | GenieEffectBundle.__init__ | (self, bundle_id, effects, full_data_set, members=None) | Creates a new Genie effect bundle.
:param bundle_id: The index of the effect in the .dat file's effect
block. (the index is referenced as tech_effect_id by techs)
:param effects: Effects of the bundle as list of GenieEffectObject.
:param full_data_set: GenieObjectConta... | Creates a new Genie effect bundle. | [
"Creates",
"a",
"new",
"Genie",
"effect",
"bundle",
"."
] | def __init__(self, bundle_id, effects, full_data_set, members=None):
"""
Creates a new Genie effect bundle.
:param bundle_id: The index of the effect in the .dat file's effect
block. (the index is referenced as tech_effect_id by techs)
:param effects: Effects o... | [
"def",
"__init__",
"(",
"self",
",",
"bundle_id",
",",
"effects",
",",
"full_data_set",
",",
"members",
"=",
"None",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"bundle_id",
",",
"members",
"=",
"members",
")",
"self",
".",
"effects",
"=",
"effe... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_effect.py#L52-L75 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/buildbot/bb_device_steps.py | python | RebootDevices | () | Reboot all attached and online devices. | Reboot all attached and online devices. | [
"Reboot",
"all",
"attached",
"and",
"online",
"devices",
"."
] | def RebootDevices():
"""Reboot all attached and online devices."""
# Early return here to avoid presubmit dependence on adb,
# which might not exist in this checkout.
if bb_utils.TESTING:
return
devices = android_commands.GetAttachedDevices(emulator=False)
print 'Rebooting: %s' % devices
if devices:
... | [
"def",
"RebootDevices",
"(",
")",
":",
"# Early return here to avoid presubmit dependence on adb,",
"# which might not exist in this checkout.",
"if",
"bb_utils",
".",
"TESTING",
":",
"return",
"devices",
"=",
"android_commands",
".",
"GetAttachedDevices",
"(",
"emulator",
"=... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/buildbot/bb_device_steps.py#L110-L129 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py | python | CCompiler.has_function | (self, funcname, includes=None, include_dirs=None,
libraries=None, library_dirs=None) | return True | Return a boolean indicating whether funcname is supported on
the current platform. The optional arguments can be used to
augment the compilation environment. | Return a boolean indicating whether funcname is supported on
the current platform. The optional arguments can be used to
augment the compilation environment. | [
"Return",
"a",
"boolean",
"indicating",
"whether",
"funcname",
"is",
"supported",
"on",
"the",
"current",
"platform",
".",
"The",
"optional",
"arguments",
"can",
"be",
"used",
"to",
"augment",
"the",
"compilation",
"environment",
"."
] | def has_function(self, funcname, includes=None, include_dirs=None,
libraries=None, library_dirs=None):
"""Return a boolean indicating whether funcname is supported on
the current platform. The optional arguments can be used to
augment the compilation environment.
""... | [
"def",
"has_function",
"(",
"self",
",",
"funcname",
",",
"includes",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"libraries",
"=",
"None",
",",
"library_dirs",
"=",
"None",
")",
":",
"# this can't be included at module scope because it tries to",
"# import ... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py#L726-L768 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py | python | print_directory | () | Dump the current directory as HTML. | Dump the current directory as HTML. | [
"Dump",
"the",
"current",
"directory",
"as",
"HTML",
"."
] | def print_directory():
"""Dump the current directory as HTML."""
print()
print("<H3>Current Working Directory:</H3>")
try:
pwd = os.getcwd()
except OSError as msg:
print("OSError:", html.escape(str(msg)))
else:
print(html.escape(pwd))
print() | [
"def",
"print_directory",
"(",
")",
":",
"print",
"(",
")",
"print",
"(",
"\"<H3>Current Working Directory:</H3>\"",
")",
"try",
":",
"pwd",
"=",
"os",
".",
"getcwd",
"(",
")",
"except",
"OSError",
"as",
"msg",
":",
"print",
"(",
"\"OSError:\"",
",",
"html... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py#L939-L949 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | MaskedArray.all | (self, axis=None, out=None) | return out | Check if all of the elements of `a` are true.
Performs a :func:`logical_and` over the given axis and returns the result.
Masked values are considered as True during computation.
For convenience, the output array is masked where ALL the values along the
current axis are masked: if the output would have ... | Check if all of the elements of `a` are true. | [
"Check",
"if",
"all",
"of",
"the",
"elements",
"of",
"a",
"are",
"true",
"."
] | def all(self, axis=None, out=None):
"""
Check if all of the elements of `a` are true.
Performs a :func:`logical_and` over the given axis and returns the result.
Masked values are considered as True during computation.
For convenience, the output array is masked where ALL the values along the
... | [
"def",
"all",
"(",
"self",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"mask",
"=",
"_check_mask_axis",
"(",
"self",
".",
"_mask",
",",
"axis",
")",
"if",
"out",
"is",
"None",
":",
"d",
"=",
"self",
".",
"filled",
"(",
"True",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L4237-L4281 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/pydoc.py | python | getdoc | (object) | return result and re.sub('^ *\n', '', rstrip(result)) or '' | Get the doc string or comments for an object. | Get the doc string or comments for an object. | [
"Get",
"the",
"doc",
"string",
"or",
"comments",
"for",
"an",
"object",
"."
] | def getdoc(object):
"""Get the doc string or comments for an object."""
result = inspect.getdoc(object) or inspect.getcomments(object)
result = _encode(result)
return result and re.sub('^ *\n', '', rstrip(result)) or '' | [
"def",
"getdoc",
"(",
"object",
")",
":",
"result",
"=",
"inspect",
".",
"getdoc",
"(",
"object",
")",
"or",
"inspect",
".",
"getcomments",
"(",
"object",
")",
"result",
"=",
"_encode",
"(",
"result",
")",
"return",
"result",
"and",
"re",
".",
"sub",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pydoc.py#L82-L86 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | CertifyCreationResponse.__init__ | (self, certifyInfo = None, signature = None) | This command is used to prove the association between an object and
its creation data. The TPM will validate that the ticket was produced by
the TPM and that the ticket validates the association between a loaded
public area and the provided hash of the creation data (creationHash).
Attr... | This command is used to prove the association between an object and
its creation data. The TPM will validate that the ticket was produced by
the TPM and that the ticket validates the association between a loaded
public area and the provided hash of the creation data (creationHash). | [
"This",
"command",
"is",
"used",
"to",
"prove",
"the",
"association",
"between",
"an",
"object",
"and",
"its",
"creation",
"data",
".",
"The",
"TPM",
"will",
"validate",
"that",
"the",
"ticket",
"was",
"produced",
"by",
"the",
"TPM",
"and",
"that",
"the",
... | def __init__(self, certifyInfo = None, signature = None):
""" This command is used to prove the association between an object and
its creation data. The TPM will validate that the ticket was produced by
the TPM and that the ticket validates the association between a loaded
public area an... | [
"def",
"__init__",
"(",
"self",
",",
"certifyInfo",
"=",
"None",
",",
"signature",
"=",
"None",
")",
":",
"self",
".",
"certifyInfo",
"=",
"certifyInfo",
"self",
".",
"signature",
"=",
"signature"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L12586-L12601 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/concurrent/futures/thread.py | python | __init__ | (self, max_workers=None, thread_name_prefix='',
initializer=None, initargs=()) | Initializes a new ThreadPoolExecutor instance.
Args:
max_workers: The maximum number of threads that can be used to
execute the given calls.
thread_name_prefix: An optional name prefix to give our threads.
initializer: A callable used to initialize worker thr... | Initializes a new ThreadPoolExecutor instance. | [
"Initializes",
"a",
"new",
"ThreadPoolExecutor",
"instance",
"."
] | def __init__(self, max_workers=None, thread_name_prefix='',
initializer=None, initargs=()):
"""Initializes a new ThreadPoolExecutor instance.
Args:
max_workers: The maximum number of threads that can be used to
execute the given calls.
thread_nam... | [
"def",
"__init__",
"(",
"self",
",",
"max_workers",
"=",
"None",
",",
"thread_name_prefix",
"=",
"''",
",",
"initializer",
"=",
"None",
",",
"initargs",
"=",
"(",
")",
")",
":",
"if",
"max_workers",
"is",
"None",
":",
"# ThreadPoolExecutor is often used to:",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/concurrent/futures/thread.py#L123-L159 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/runtime.py | python | Context.get | (self, key, default=None) | Returns an item from the template context, if it doesn't exist
`default` is returned. | Returns an item from the template context, if it doesn't exist
`default` is returned. | [
"Returns",
"an",
"item",
"from",
"the",
"template",
"context",
"if",
"it",
"doesn",
"t",
"exist",
"default",
"is",
"returned",
"."
] | def get(self, key, default=None):
"""Returns an item from the template context, if it doesn't exist
`default` is returned.
"""
try:
return self[key]
except KeyError:
return default | [
"def",
"get",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
"[",
"key",
"]",
"except",
"KeyError",
":",
"return",
"default"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/runtime.py#L137-L144 | ||
johmathe/shotdetect | 1ecf93a695c96fd7601a41ab5834f1117b9d7d50 | tools/cpplint.py | python | CheckSpacingForFunctionCall | (filename, line, linenum, error) | Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for the correctness of various spacing around function calls. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"around",
"function",
"calls",
"."
] | def CheckSpacingForFunctionCall(filename, line, linenum, error):
"""Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any ... | [
"def",
"CheckSpacingForFunctionCall",
"(",
"filename",
",",
"line",
",",
"linenum",
",",
"error",
")",
":",
"# Since function calls often occur inside if/for/while/switch",
"# expressions - which have their own, more liberal conventions - we",
"# first see if we should be looking inside ... | https://github.com/johmathe/shotdetect/blob/1ecf93a695c96fd7601a41ab5834f1117b9d7d50/tools/cpplint.py#L1488-L1551 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/rpc.py | python | SocketIO.handle_EOF | (self) | action taken upon link being closed by peer | action taken upon link being closed by peer | [
"action",
"taken",
"upon",
"link",
"being",
"closed",
"by",
"peer"
] | def handle_EOF(self):
"action taken upon link being closed by peer"
self.EOFhook()
self.debug("handle_EOF")
for key in self.cvars:
cv = self.cvars[key]
cv.acquire()
self.responses[key] = ('EOF', None)
cv.notify()
cv.release()
... | [
"def",
"handle_EOF",
"(",
"self",
")",
":",
"self",
".",
"EOFhook",
"(",
")",
"self",
".",
"debug",
"(",
"\"handle_EOF\"",
")",
"for",
"key",
"in",
"self",
".",
"cvars",
":",
"cv",
"=",
"self",
".",
"cvars",
"[",
"key",
"]",
"cv",
".",
"acquire",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/rpc.py#L471-L482 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/parser.py | python | Parser.is_tuple_end | (self, extra_end_rules=None) | return False | Are we at the end of a tuple? | Are we at the end of a tuple? | [
"Are",
"we",
"at",
"the",
"end",
"of",
"a",
"tuple?"
] | def is_tuple_end(self, extra_end_rules=None):
"""Are we at the end of a tuple?"""
if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):
return True
elif extra_end_rules is not None:
return self.stream.current.test_any(extra_end_rules)
return Fals... | [
"def",
"is_tuple_end",
"(",
"self",
",",
"extra_end_rules",
"=",
"None",
")",
":",
"if",
"self",
".",
"stream",
".",
"current",
".",
"type",
"in",
"(",
"'variable_end'",
",",
"'block_end'",
",",
"'rparen'",
")",
":",
"return",
"True",
"elif",
"extra_end_ru... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/parser.py#L98-L104 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/uniform.py | python | Uniform.prob | (self, x, name="prob") | The PDF of observations in `x` under these Uniform distribution(s).
Args:
x: tensor of dtype `dtype`, must be broadcastable with `a` and `b`.
name: The name to give this op.
Returns:
prob: tensor of dtype `dtype`, the prob values of `x`. If `x` is `nan`,
will return `nan`. | The PDF of observations in `x` under these Uniform distribution(s). | [
"The",
"PDF",
"of",
"observations",
"in",
"x",
"under",
"these",
"Uniform",
"distribution",
"(",
"s",
")",
"."
] | def prob(self, x, name="prob"):
"""The PDF of observations in `x` under these Uniform distribution(s).
Args:
x: tensor of dtype `dtype`, must be broadcastable with `a` and `b`.
name: The name to give this op.
Returns:
prob: tensor of dtype `dtype`, the prob values of `x`. If `x` is `nan`... | [
"def",
"prob",
"(",
"self",
",",
"x",
",",
"name",
"=",
"\"prob\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"name",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"self",
".",
"a",
",",
"self",
".",
"b",
",",
"x",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/uniform.py#L142-L166 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pycc/platform.py | python | Toolchain.get_python_include_dirs | (self) | return list(self._py_include_dirs) + self._math_info['include_dirs'] | Get the include directories necessary to compile against the Python
and Numpy C APIs. | Get the include directories necessary to compile against the Python
and Numpy C APIs. | [
"Get",
"the",
"include",
"directories",
"necessary",
"to",
"compile",
"against",
"the",
"Python",
"and",
"Numpy",
"C",
"APIs",
"."
] | def get_python_include_dirs(self):
"""
Get the include directories necessary to compile against the Python
and Numpy C APIs.
"""
return list(self._py_include_dirs) + self._math_info['include_dirs'] | [
"def",
"get_python_include_dirs",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"_py_include_dirs",
")",
"+",
"self",
".",
"_math_info",
"[",
"'include_dirs'",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pycc/platform.py#L179-L184 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/RefinePowderDiffProfileSeq.py | python | RefineProfileParameters.calculate | (self, startx, endx) | return | Do Le bail calculation | Do Le bail calculation | [
"Do",
"Le",
"bail",
"calculation"
] | def calculate(self, startx, endx):
""" Do Le bail calculation
"""
if (self._inputIsSetup and self._outputIsSetup) is False:
raise NotImplementedError("Either input or output is not setup: inputIsStepUp = %s, outputIsSetup = %s" %
(str(self._input... | [
"def",
"calculate",
"(",
"self",
",",
"startx",
",",
"endx",
")",
":",
"if",
"(",
"self",
".",
"_inputIsSetup",
"and",
"self",
".",
"_outputIsSetup",
")",
"is",
"False",
":",
"raise",
"NotImplementedError",
"(",
"\"Either input or output is not setup: inputIsStepU... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/RefinePowderDiffProfileSeq.py#L831-L859 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert-gpu/tensorrt-inference-server/src/clients/python/__init__.py | python | ServerHealthContext.get_last_request_id | (self) | return self._last_request_id | Get the request ID of the most recent is_ready() or is_live()
request.
Returns
-------
int
The request ID, or None if a request has not yet been made
or if the last request was not successful. | Get the request ID of the most recent is_ready() or is_live()
request. | [
"Get",
"the",
"request",
"ID",
"of",
"the",
"most",
"recent",
"is_ready",
"()",
"or",
"is_live",
"()",
"request",
"."
] | def get_last_request_id(self):
"""Get the request ID of the most recent is_ready() or is_live()
request.
Returns
-------
int
The request ID, or None if a request has not yet been made
or if the last request was not successful.
"""
return ... | [
"def",
"get_last_request_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_last_request_id"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/tensorrt-inference-server/src/clients/python/__init__.py#L383-L394 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/metrics/_plot/roc_curve.py | python | RocCurveDisplay.plot | (self, ax=None, name=None, **kwargs) | return self | Plot visualization
Extra keyword arguments will be passed to matplotlib's ``plot``.
Parameters
----------
ax : matplotlib axes, default=None
Axes object to plot on. If `None`, a new figure and axes is
created.
name : str, default=None
Name o... | Plot visualization | [
"Plot",
"visualization"
] | def plot(self, ax=None, name=None, **kwargs):
"""Plot visualization
Extra keyword arguments will be passed to matplotlib's ``plot``.
Parameters
----------
ax : matplotlib axes, default=None
Axes object to plot on. If `None`, a new figure and axes is
crea... | [
"def",
"plot",
"(",
"self",
",",
"ax",
"=",
"None",
",",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"check_matplotlib_support",
"(",
"'RocCurveDisplay.plot'",
")",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"if",
"ax",
"is",
"None",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/metrics/_plot/roc_curve.py#L63-L103 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/models/Port.py | python | Port.get_direction | (self) | return self.__direction | Return the direction for port. | Return the direction for port. | [
"Return",
"the",
"direction",
"for",
"port",
"."
] | def get_direction(self):
"""
Return the direction for port.
"""
return self.__direction | [
"def",
"get_direction",
"(",
"self",
")",
":",
"return",
"self",
".",
"__direction"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/models/Port.py#L159-L163 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/altgraph/altgraph/Graph.py | python | Graph.add_node | (self, node, node_data=None) | Adds a new node to the graph. Arbitrary data can be attached to the
node via the node_data parameter. Adding the same node twice will be
silently ignored.
The node must be a hashable value. | Adds a new node to the graph. Arbitrary data can be attached to the
node via the node_data parameter. Adding the same node twice will be
silently ignored. | [
"Adds",
"a",
"new",
"node",
"to",
"the",
"graph",
".",
"Arbitrary",
"data",
"can",
"be",
"attached",
"to",
"the",
"node",
"via",
"the",
"node_data",
"parameter",
".",
"Adding",
"the",
"same",
"node",
"twice",
"will",
"be",
"silently",
"ignored",
"."
] | def add_node(self, node, node_data=None):
"""
Adds a new node to the graph. Arbitrary data can be attached to the
node via the node_data parameter. Adding the same node twice will be
silently ignored.
The node must be a hashable value.
"""
#
# the nodes... | [
"def",
"add_node",
"(",
"self",
",",
"node",
",",
"node_data",
"=",
"None",
")",
":",
"#",
"# the nodes will contain tuples that will store incoming edges,",
"# outgoing edges and data",
"#",
"# index 0 -> incoming edges",
"# index 1 -> outgoing edges",
"if",
"node",
"in",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/altgraph/altgraph/Graph.py#L64-L84 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | row_stack | (arrays) | return _api_internal.vstack(*arrays) | r"""Stack arrays in sequence vertically (row wise).
This is equivalent to concatenation along the first axis after 1-D arrays
of shape `(N,)` have been reshaped to `(1,N)`. Rebuilds arrays divided by
`vsplit`.
This function makes most sense for arrays with up to 3 dimensions. For
instance, for pixel... | r"""Stack arrays in sequence vertically (row wise).
This is equivalent to concatenation along the first axis after 1-D arrays
of shape `(N,)` have been reshaped to `(1,N)`. Rebuilds arrays divided by
`vsplit`.
This function makes most sense for arrays with up to 3 dimensions. For
instance, for pixel... | [
"r",
"Stack",
"arrays",
"in",
"sequence",
"vertically",
"(",
"row",
"wise",
")",
".",
"This",
"is",
"equivalent",
"to",
"concatenation",
"along",
"the",
"first",
"axis",
"after",
"1",
"-",
"D",
"arrays",
"of",
"shape",
"(",
"N",
")",
"have",
"been",
"r... | def row_stack(arrays):
r"""Stack arrays in sequence vertically (row wise).
This is equivalent to concatenation along the first axis after 1-D arrays
of shape `(N,)` have been reshaped to `(1,N)`. Rebuilds arrays divided by
`vsplit`.
This function makes most sense for arrays with up to 3 dimensions. ... | [
"def",
"row_stack",
"(",
"arrays",
")",
":",
"def",
"get_list",
"(",
"arrays",
")",
":",
"if",
"not",
"hasattr",
"(",
"arrays",
",",
"'__getitem__'",
")",
"and",
"hasattr",
"(",
"arrays",
",",
"'__iter__'",
")",
":",
"raise",
"ValueError",
"(",
"\"expect... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L4797-L4838 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/messagedisplay.py | python | MessageDisplay.ReadSettingSafely | (self,qsettings,key,default,type) | Reads a value from qsettings, returning the default if the value is missing or the type is wrong
:param qsettings: the qsettings object
:param key: the key to read
:param default: the default value
:param type: the type to check the returned value for
:return: The value from qset... | Reads a value from qsettings, returning the default if the value is missing or the type is wrong
:param qsettings: the qsettings object
:param key: the key to read
:param default: the default value
:param type: the type to check the returned value for
:return: The value from qset... | [
"Reads",
"a",
"value",
"from",
"qsettings",
"returning",
"the",
"default",
"if",
"the",
"value",
"is",
"missing",
"or",
"the",
"type",
"is",
"wrong",
":",
"param",
"qsettings",
":",
"the",
"qsettings",
"object",
":",
"param",
"key",
":",
"the",
"key",
"t... | def ReadSettingSafely(self,qsettings,key,default,type):
"""
Reads a value from qsettings, returning the default if the value is missing or the type is wrong
:param qsettings: the qsettings object
:param key: the key to read
:param default: the default value
:param type: t... | [
"def",
"ReadSettingSafely",
"(",
"self",
",",
"qsettings",
",",
"key",
",",
"default",
",",
"type",
")",
":",
"try",
":",
"settingValue",
"=",
"qsettings",
".",
"value",
"(",
"key",
",",
"default",
")",
"return",
"settingValue",
"if",
"isinstance",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/messagedisplay.py#L49-L62 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py | python | DocumentStructure.delete_section | (self, name) | Delete a section | Delete a section | [
"Delete",
"a",
"section"
] | def delete_section(self, name):
"""Delete a section"""
del self._structure[name] | [
"def",
"delete_section",
"(",
"self",
",",
"name",
")",
":",
"del",
"self",
".",
"_structure",
"[",
"name",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py#L189-L191 | ||
vector-of-bool/dds | b35d87245e8174506df780fd9fe112d89351a85b | tools/dds_ci/main.py | python | parse_argv | (argv: Sequence[str]) | return make_argparser().parse_args(argv) | Parse the given dds-ci command-line argument list | Parse the given dds-ci command-line argument list | [
"Parse",
"the",
"given",
"dds",
"-",
"ci",
"command",
"-",
"line",
"argument",
"list"
] | def parse_argv(argv: Sequence[str]) -> CommandArguments:
"""Parse the given dds-ci command-line argument list"""
return make_argparser().parse_args(argv) | [
"def",
"parse_argv",
"(",
"argv",
":",
"Sequence",
"[",
"str",
"]",
")",
"->",
"CommandArguments",
":",
"return",
"make_argparser",
"(",
")",
".",
"parse_args",
"(",
"argv",
")"
] | https://github.com/vector-of-bool/dds/blob/b35d87245e8174506df780fd9fe112d89351a85b/tools/dds_ci/main.py#L71-L73 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/genericpath.py | python | _splitext | (p, sep, altsep, extsep) | return p, p[:0] | Split the extension from a pathname.
Extension is everything from the last dot to the end, ignoring
leading dots. Returns "(root, ext)"; ext may be empty. | Split the extension from a pathname. | [
"Split",
"the",
"extension",
"from",
"a",
"pathname",
"."
] | def _splitext(p, sep, altsep, extsep):
"""Split the extension from a pathname.
Extension is everything from the last dot to the end, ignoring
leading dots. Returns "(root, ext)"; ext may be empty."""
# NOTE: This code must work for text and bytes strings.
sepIndex = p.rfind(sep)
if altsep:
... | [
"def",
"_splitext",
"(",
"p",
",",
"sep",
",",
"altsep",
",",
"extsep",
")",
":",
"# NOTE: This code must work for text and bytes strings.",
"sepIndex",
"=",
"p",
".",
"rfind",
"(",
"sep",
")",
"if",
"altsep",
":",
"altsepIndex",
"=",
"p",
".",
"rfind",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/genericpath.py#L121-L142 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | GDALBuildVRTOptions.__init__ | (self, *args) | r"""__init__(GDALBuildVRTOptions self, char ** options) -> GDALBuildVRTOptions | r"""__init__(GDALBuildVRTOptions self, char ** options) -> GDALBuildVRTOptions | [
"r",
"__init__",
"(",
"GDALBuildVRTOptions",
"self",
"char",
"**",
"options",
")",
"-",
">",
"GDALBuildVRTOptions"
] | def __init__(self, *args):
r"""__init__(GDALBuildVRTOptions self, char ** options) -> GDALBuildVRTOptions"""
_gdal.GDALBuildVRTOptions_swiginit(self, _gdal.new_GDALBuildVRTOptions(*args)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"_gdal",
".",
"GDALBuildVRTOptions_swiginit",
"(",
"self",
",",
"_gdal",
".",
"new_GDALBuildVRTOptions",
"(",
"*",
"args",
")",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L4339-L4341 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/rlmain.py | python | Readline.clear_history | (self) | Clear readline history | Clear readline history | [
"Clear",
"readline",
"history"
] | def clear_history(self):
'''Clear readline history'''
self._history.clear_history() | [
"def",
"clear_history",
"(",
"self",
")",
":",
"self",
".",
"_history",
".",
"clear_history",
"(",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/rlmain.py#L174-L176 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | MultiDimInfoOptions | (options=None, detailed=False, array=None, arrayoptions=None, limit=None, as_text=False) | return GDALMultiDimInfoOptions(new_options), as_text | Create a MultiDimInfoOptions() object that can be passed to gdal.MultiDimInfo()
options can be be an array of strings, a string or let empty and filled from other keywords. | Create a MultiDimInfoOptions() object that can be passed to gdal.MultiDimInfo()
options can be be an array of strings, a string or let empty and filled from other keywords. | [
"Create",
"a",
"MultiDimInfoOptions",
"()",
"object",
"that",
"can",
"be",
"passed",
"to",
"gdal",
".",
"MultiDimInfo",
"()",
"options",
"can",
"be",
"be",
"an",
"array",
"of",
"strings",
"a",
"string",
"or",
"let",
"empty",
"and",
"filled",
"from",
"other... | def MultiDimInfoOptions(options=None, detailed=False, array=None, arrayoptions=None, limit=None, as_text=False):
""" Create a MultiDimInfoOptions() object that can be passed to gdal.MultiDimInfo()
options can be be an array of strings, a string or let empty and filled from other keywords."""
options = ... | [
"def",
"MultiDimInfoOptions",
"(",
"options",
"=",
"None",
",",
"detailed",
"=",
"False",
",",
"array",
"=",
"None",
",",
"arrayoptions",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"as_text",
"=",
"False",
")",
":",
"options",
"=",
"[",
"]",
"if",
... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L251-L271 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | model_zoo/models/python/common.py | python | bindir | () | return b | Returns the directory that contains the lbann executable. This may be
specified on the command line via the --bindir=<string> option; else,
returns the relative directory: '../../..build/<hostname()>.llnl.gov/model_zoo | Returns the directory that contains the lbann executable. This may be
specified on the command line via the --bindir=<string> option; else,
returns the relative directory: '../../..build/<hostname()>.llnl.gov/model_zoo | [
"Returns",
"the",
"directory",
"that",
"contains",
"the",
"lbann",
"executable",
".",
"This",
"may",
"be",
"specified",
"on",
"the",
"command",
"line",
"via",
"the",
"--",
"bindir",
"=",
"<string",
">",
"option",
";",
"else",
"returns",
"the",
"relative",
... | def bindir() :
'''Returns the directory that contains the lbann executable. This may be
specified on the command line via the --bindir=<string> option; else,
returns the relative directory: '../../..build/<hostname()>.llnl.gov/model_zoo
'''
b = '../../../build/' + hostname() + '.llnl.gov/model_zoo'
fo... | [
"def",
"bindir",
"(",
")",
":",
"b",
"=",
"'../../../build/'",
"+",
"hostname",
"(",
")",
"+",
"'.llnl.gov/model_zoo'",
"for",
"n",
"in",
"sys",
".",
"argv",
":",
"if",
"n",
".",
"find",
"(",
"'--bindir='",
")",
"!=",
"-",
"1",
":",
"t",
"=",
"n",
... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/model_zoo/models/python/common.py#L57-L67 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/internal/encoder.py | python | _TagSize | (field_number) | return _VarintSize(wire_format.PackTag(field_number, 0)) | Returns the number of bytes required to serialize a tag with this field
number. | Returns the number of bytes required to serialize a tag with this field
number. | [
"Returns",
"the",
"number",
"of",
"bytes",
"required",
"to",
"serialize",
"a",
"tag",
"with",
"this",
"field",
"number",
"."
] | def _TagSize(field_number):
"""Returns the number of bytes required to serialize a tag with this field
number."""
# Just pass in type 0, since the type won't affect the tag+type size.
return _VarintSize(wire_format.PackTag(field_number, 0)) | [
"def",
"_TagSize",
"(",
"field_number",
")",
":",
"# Just pass in type 0, since the type won't affect the tag+type size.",
"return",
"_VarintSize",
"(",
"wire_format",
".",
"PackTag",
"(",
"field_number",
",",
"0",
")",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/internal/encoder.py#L108-L112 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | build/plugins/pybuild.py | python | onpy_srcs | (unit, *args) | @usage PY_SRCS({| CYTHON_C} { | TOP_LEVEL | NAMESPACE ns} Files...)
PY_SRCS() - is rule to build extended versions of Python interpreters and containing all application code in its executable file. It can be used to collect only the executables but not shared libraries, and, in particular, not to collect the m... | @usage PY_SRCS({| CYTHON_C} { | TOP_LEVEL | NAMESPACE ns} Files...) | [
"@usage",
"PY_SRCS",
"(",
"{",
"|",
"CYTHON_C",
"}",
"{",
"|",
"TOP_LEVEL",
"|",
"NAMESPACE",
"ns",
"}",
"Files",
"...",
")"
] | def onpy_srcs(unit, *args):
"""
@usage PY_SRCS({| CYTHON_C} { | TOP_LEVEL | NAMESPACE ns} Files...)
PY_SRCS() - is rule to build extended versions of Python interpreters and containing all application code in its executable file. It can be used to collect only the executables but not shared librari... | [
"def",
"onpy_srcs",
"(",
"unit",
",",
"*",
"args",
")",
":",
"# Each file arg must either be a path, or \"${...}/buildpath=modname\", where",
"# \"${...}/buildpath\" part will be used as a file source in a future macro,",
"# and \"modname\" will be used as a module name.",
"upath",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/plugins/pybuild.py#L171-L522 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.SelectAll | (*args, **kwargs) | return _grid.Grid_SelectAll(*args, **kwargs) | SelectAll(self) | SelectAll(self) | [
"SelectAll",
"(",
"self",
")"
] | def SelectAll(*args, **kwargs):
"""SelectAll(self)"""
return _grid.Grid_SelectAll(*args, **kwargs) | [
"def",
"SelectAll",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_SelectAll",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L2041-L2043 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/fromnumeric.py | python | sort | (a, axis=-1, kind='quicksort', order=None) | return a | Return a sorted copy of an array.
Parameters
----------
a : array_like
Array to be sorted.
axis : int or None, optional
Axis along which to sort. If None, the array is flattened before
sorting. The default is -1, which sorts along the last axis.
kind : {'quicksort', 'mergeso... | Return a sorted copy of an array. | [
"Return",
"a",
"sorted",
"copy",
"of",
"an",
"array",
"."
] | def sort(a, axis=-1, kind='quicksort', order=None):
"""
Return a sorted copy of an array.
Parameters
----------
a : array_like
Array to be sorted.
axis : int or None, optional
Axis along which to sort. If None, the array is flattened before
sorting. The default is -1, wh... | [
"def",
"sort",
"(",
"a",
",",
"axis",
"=",
"-",
"1",
",",
"kind",
"=",
"'quicksort'",
",",
"order",
"=",
"None",
")",
":",
"if",
"axis",
"is",
"None",
":",
"# flatten returns (1, N) for np.matrix, so always use the last axis",
"a",
"=",
"asanyarray",
"(",
"a... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/fromnumeric.py#L816-L935 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Simulator.fakeSimulate | (self, t: float) | return _robotsim.Simulator_fakeSimulate(self, t) | r"""
Advances a faked simulation by time t, and updates the world model from the
faked simulation state.
Args:
t (float) | r"""
Advances a faked simulation by time t, and updates the world model from the
faked simulation state. | [
"r",
"Advances",
"a",
"faked",
"simulation",
"by",
"time",
"t",
"and",
"updates",
"the",
"world",
"model",
"from",
"the",
"faked",
"simulation",
"state",
"."
] | def fakeSimulate(self, t: float) ->None:
r"""
Advances a faked simulation by time t, and updates the world model from the
faked simulation state.
Args:
t (float)
"""
return _robotsim.Simulator_fakeSimulate(self, t) | [
"def",
"fakeSimulate",
"(",
"self",
",",
"t",
":",
"float",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"Simulator_fakeSimulate",
"(",
"self",
",",
"t",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7854-L7862 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.get_tokens | (self) | return TokenGroup.get_tokens(self._tu, self.extent) | Obtain Token instances formulating that compose this Cursor.
This is a generator for Token instances. It returns all tokens which
occupy the extent this cursor occupies. | Obtain Token instances formulating that compose this Cursor. | [
"Obtain",
"Token",
"instances",
"formulating",
"that",
"compose",
"this",
"Cursor",
"."
] | def get_tokens(self):
"""Obtain Token instances formulating that compose this Cursor.
This is a generator for Token instances. It returns all tokens which
occupy the extent this cursor occupies.
"""
return TokenGroup.get_tokens(self._tu, self.extent) | [
"def",
"get_tokens",
"(",
"self",
")",
":",
"return",
"TokenGroup",
".",
"get_tokens",
"(",
"self",
".",
"_tu",
",",
"self",
".",
"extent",
")"
] | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L1471-L1477 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/__init__.py | python | Node.has_explicit_builder | (self) | Return whether this Node has an explicit builder
This allows an internal Builder created by SCons to be marked
non-explicit, so that it can be overridden by an explicit
builder that the user supplies (the canonical example being
directories). | Return whether this Node has an explicit builder | [
"Return",
"whether",
"this",
"Node",
"has",
"an",
"explicit",
"builder"
] | def has_explicit_builder(self):
"""Return whether this Node has an explicit builder
This allows an internal Builder created by SCons to be marked
non-explicit, so that it can be overridden by an explicit
builder that the user supplies (the canonical example being
directories).""... | [
"def",
"has_explicit_builder",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"is_explicit",
"except",
"AttributeError",
":",
"self",
".",
"is_explicit",
"=",
"None",
"return",
"self",
".",
"is_explicit"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/__init__.py#L904-L915 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/io_ops.py | python | _RestoreShape | (op) | return [tensor_shape.unknown_shape()] | Shape function for Restore op. | Shape function for Restore op. | [
"Shape",
"function",
"for",
"Restore",
"op",
"."
] | def _RestoreShape(op):
"""Shape function for Restore op."""
# Validate input shapes.
unused_file_pattern = op.inputs[0].get_shape().merge_with(
tensor_shape.scalar())
unused_tensor_name = op.inputs[1].get_shape().merge_with(
tensor_shape.scalar())
return [tensor_shape.unknown_shape()] | [
"def",
"_RestoreShape",
"(",
"op",
")",
":",
"# Validate input shapes.",
"unused_file_pattern",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"merge_with",
"(",
"tensor_shape",
".",
"scalar",
"(",
")",
")",
"unused_tensor_name",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/io_ops.py#L207-L214 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewListCtrl.SetItemData | (*args, **kwargs) | return _dataview.DataViewListCtrl_SetItemData(*args, **kwargs) | SetItemData(self, DataViewItem item, UIntPtr data) | SetItemData(self, DataViewItem item, UIntPtr data) | [
"SetItemData",
"(",
"self",
"DataViewItem",
"item",
"UIntPtr",
"data",
")"
] | def SetItemData(*args, **kwargs):
"""SetItemData(self, DataViewItem item, UIntPtr data)"""
return _dataview.DataViewListCtrl_SetItemData(*args, **kwargs) | [
"def",
"SetItemData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_SetItemData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L2200-L2202 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/gradients_impl.py | python | gradients | (ys,
xs,
grad_ys=None,
name="gradients",
colocate_gradients_with_ops=False,
gate_gradients=False,
aggregation_method=None,
stop_gradients=None) | return [_GetGrad(grads, x) for x in xs] | Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`.
`ys` and `xs` are each a `Tensor` or a list of tensors. `grad_ys`
is a list of `Tensor`, holding the gradients received by the
`ys`. The list must be the same length as `ys`.
`gradients()` adds ops to the graph to output the derivatives of `ys`... | Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`. | [
"Constructs",
"symbolic",
"derivatives",
"of",
"sum",
"of",
"ys",
"w",
".",
"r",
".",
"t",
".",
"x",
"in",
"xs",
"."
] | def gradients(ys,
xs,
grad_ys=None,
name="gradients",
colocate_gradients_with_ops=False,
gate_gradients=False,
aggregation_method=None,
stop_gradients=None):
"""Constructs symbolic derivatives of sum of `ys` w.r.t. x in ... | [
"def",
"gradients",
"(",
"ys",
",",
"xs",
",",
"grad_ys",
"=",
"None",
",",
"name",
"=",
"\"gradients\"",
",",
"colocate_gradients_with_ops",
"=",
"False",
",",
"gate_gradients",
"=",
"False",
",",
"aggregation_method",
"=",
"None",
",",
"stop_gradients",
"=",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/gradients_impl.py#L396-L640 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/collector.py | python | Collector.tracer_name | (self) | return self._trace_class.__name__ | Return the class name of the tracer we're using. | Return the class name of the tracer we're using. | [
"Return",
"the",
"class",
"name",
"of",
"the",
"tracer",
"we",
"re",
"using",
"."
] | def tracer_name(self):
"""Return the class name of the tracer we're using."""
return self._trace_class.__name__ | [
"def",
"tracer_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_trace_class",
".",
"__name__"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/collector.py#L139-L141 | |
turtlecoin/turtlecoin | 02ee0f0551f4552e7d2fd48df23f4b4ff84f4dd8 | external/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py | python | Cache.access | (self, trace_record) | Access a trace record. The simulator calls this function to access a
trace record. | Access a trace record. The simulator calls this function to access a
trace record. | [
"Access",
"a",
"trace",
"record",
".",
"The",
"simulator",
"calls",
"this",
"function",
"to",
"access",
"a",
"trace",
"record",
"."
] | def access(self, trace_record):
"""
Access a trace record. The simulator calls this function to access a
trace record.
"""
assert self.used_size <= self.cache_size
if (
self.enable_cache_row_key > 0
and trace_record.caller == 1
and trac... | [
"def",
"access",
"(",
"self",
",",
"trace_record",
")",
":",
"assert",
"self",
".",
"used_size",
"<=",
"self",
".",
"cache_size",
"if",
"(",
"self",
".",
"enable_cache_row_key",
">",
"0",
"and",
"trace_record",
".",
"caller",
"==",
"1",
"and",
"trace_recor... | https://github.com/turtlecoin/turtlecoin/blob/02ee0f0551f4552e7d2fd48df23f4b4ff84f4dd8/external/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py#L724-L748 | ||
emsec/hal | 58d15b895723b8527302b740582613b82cb9aa80 | tools/skywater_to_liberty.py | python | convert_latch_block | (lib_json_data) | return "latch (\"IQ\", \"IQ_N\") {{\n{}}}\n".format(indent_block(latch_inner)) | Generate a string in liberty format that represents a latch block of a certain cell,
contained in a .lib.json file.
:param lib_json_data: json data of a .lib.json file
:returns: The latch block string. Empty string if no latch information were found. | Generate a string in liberty format that represents a latch block of a certain cell,
contained in a .lib.json file. | [
"Generate",
"a",
"string",
"in",
"liberty",
"format",
"that",
"represents",
"a",
"latch",
"block",
"of",
"a",
"certain",
"cell",
"contained",
"in",
"a",
".",
"lib",
".",
"json",
"file",
"."
] | def convert_latch_block(lib_json_data):
"""
Generate a string in liberty format that represents a latch block of a certain cell,
contained in a .lib.json file.
:param lib_json_data: json data of a .lib.json file
:returns: The latch block string. Empty string if no latch information were found.
... | [
"def",
"convert_latch_block",
"(",
"lib_json_data",
")",
":",
"if",
"lib_json_data",
"is",
"None",
":",
"return",
"\"\"",
"if",
"not",
"(",
"\"latch,IQ,IQ_N\"",
"in",
"lib_json_data",
")",
":",
"return",
"\"\"",
"latch_data",
"=",
"lib_json_data",
"[",
"\"latch,... | https://github.com/emsec/hal/blob/58d15b895723b8527302b740582613b82cb9aa80/tools/skywater_to_liberty.py#L76-L98 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/superplot/presenter.py | python | SuperplotPresenter.on_del_button_clicked | (self, ws_name=None) | Triggered when the del button is pressed. This function removes the
selected workspace from the selection list. | Triggered when the del button is pressed. This function removes the
selected workspace from the selection list. | [
"Triggered",
"when",
"the",
"del",
"button",
"is",
"pressed",
".",
"This",
"function",
"removes",
"the",
"selected",
"workspace",
"from",
"the",
"selection",
"list",
"."
] | def on_del_button_clicked(self, ws_name=None):
"""
Triggered when the del button is pressed. This function removes the
selected workspace from the selection list.
"""
selection = self._view.get_selection()
if ws_name is None:
selected_workspaces = selection.co... | [
"def",
"on_del_button_clicked",
"(",
"self",
",",
"ws_name",
"=",
"None",
")",
":",
"selection",
"=",
"self",
".",
"_view",
".",
"get_selection",
"(",
")",
"if",
"ws_name",
"is",
"None",
":",
"selected_workspaces",
"=",
"selection",
".",
"copy",
"(",
")",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/superplot/presenter.py#L266-L287 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.