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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/internal/type_checkers.py | python | GetTypeChecker | (cpp_type, field_type) | return _VALUE_CHECKERS[cpp_type] | Returns a type checker for a message field of the specified types.
Args:
cpp_type: C++ type of the field (see descriptor.py).
field_type: Protocol message field type (see descriptor.py).
Returns:
An instance of TypeChecker which can be used to verify the types
of values assigned to a field of the ... | Returns a type checker for a message field of the specified types. | [
"Returns",
"a",
"type",
"checker",
"for",
"a",
"message",
"field",
"of",
"the",
"specified",
"types",
"."
] | def GetTypeChecker(cpp_type, field_type):
"""Returns a type checker for a message field of the specified types.
Args:
cpp_type: C++ type of the field (see descriptor.py).
field_type: Protocol message field type (see descriptor.py).
Returns:
An instance of TypeChecker which can be used to verify the ... | [
"def",
"GetTypeChecker",
"(",
"cpp_type",
",",
"field_type",
")",
":",
"if",
"(",
"cpp_type",
"==",
"_FieldDescriptor",
".",
"CPPTYPE_STRING",
"and",
"field_type",
"==",
"_FieldDescriptor",
".",
"TYPE_STRING",
")",
":",
"return",
"UnicodeValueChecker",
"(",
")",
... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/type_checkers.py#L56-L70 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saved_model/serialized_attributes.py | python | SerializedAttributes.new | (obj) | Returns a new SerializedAttribute object. | Returns a new SerializedAttribute object. | [
"Returns",
"a",
"new",
"SerializedAttribute",
"object",
"."
] | def new(obj):
"""Returns a new SerializedAttribute object."""
if isinstance(obj, training_lib.Model):
return ModelAttributes()
elif isinstance(obj, metrics.Metric):
return MetricAttributes()
elif isinstance(obj, recurrent.RNN):
return RNNAttributes()
elif isinstance(obj, base_layer... | [
"def",
"new",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"training_lib",
".",
"Model",
")",
":",
"return",
"ModelAttributes",
"(",
")",
"elif",
"isinstance",
"(",
"obj",
",",
"metrics",
".",
"Metric",
")",
":",
"return",
"MetricAttributes... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model/serialized_attributes.py#L140-L152 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/computation/engines.py | python | AbstractEngine._evaluate | (self) | Return an evaluated expression.
Parameters
----------
env : Scope
The local and global environment in which to evaluate an
expression.
Notes
-----
Must be implemented by subclasses. | Return an evaluated expression. | [
"Return",
"an",
"evaluated",
"expression",
"."
] | def _evaluate(self):
"""Return an evaluated expression.
Parameters
----------
env : Scope
The local and global environment in which to evaluate an
expression.
Notes
-----
Must be implemented by subclasses.
"""
pass | [
"def",
"_evaluate",
"(",
"self",
")",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/computation/engines.py#L85-L98 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/simplejson/encoder.py | python | encode_basestring | (s, _PY3=PY3, _q=u('"')) | return _q + ESCAPE.sub(replace, s) + _q | Return a JSON representation of a Python string | Return a JSON representation of a Python string | [
"Return",
"a",
"JSON",
"representation",
"of",
"a",
"Python",
"string"
] | def encode_basestring(s, _PY3=PY3, _q=u('"')):
"""Return a JSON representation of a Python string
"""
if _PY3:
if isinstance(s, binary_type):
s = s.decode('utf-8')
else:
if isinstance(s, str) and HAS_UTF8.search(s) is not None:
s = s.decode('utf-8')
def repla... | [
"def",
"encode_basestring",
"(",
"s",
",",
"_PY3",
"=",
"PY3",
",",
"_q",
"=",
"u",
"(",
"'\"'",
")",
")",
":",
"if",
"_PY3",
":",
"if",
"isinstance",
"(",
"s",
",",
"binary_type",
")",
":",
"s",
"=",
"s",
".",
"decode",
"(",
"'utf-8'",
")",
"e... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/simplejson/encoder.py#L41-L53 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/roles.py | python | role | (role_name, language_module, lineno, reporter) | Locate and return a role function from its language-dependent name, along
with a list of system messages. If the role is not found in the current
language, check English. Return a 2-tuple: role function (``None`` if the
named role cannot be found) and a list of system messages. | Locate and return a role function from its language-dependent name, along
with a list of system messages. If the role is not found in the current
language, check English. Return a 2-tuple: role function (``None`` if the
named role cannot be found) and a list of system messages. | [
"Locate",
"and",
"return",
"a",
"role",
"function",
"from",
"its",
"language",
"-",
"dependent",
"name",
"along",
"with",
"a",
"list",
"of",
"system",
"messages",
".",
"If",
"the",
"role",
"is",
"not",
"found",
"in",
"the",
"current",
"language",
"check",
... | def role(role_name, language_module, lineno, reporter):
"""
Locate and return a role function from its language-dependent name, along
with a list of system messages. If the role is not found in the current
language, check English. Return a 2-tuple: role function (``None`` if the
named role cannot ... | [
"def",
"role",
"(",
"role_name",
",",
"language_module",
",",
"lineno",
",",
"reporter",
")",
":",
"normname",
"=",
"role_name",
".",
"lower",
"(",
")",
"messages",
"=",
"[",
"]",
"msg_text",
"=",
"[",
"]",
"if",
"normname",
"in",
"_roles",
":",
"retur... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/roles.py#L94-L144 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Loss.py | python | CenterLoss.rate | (self) | return self._internal.get_rate() | Gets the convergence rate multiplier. | Gets the convergence rate multiplier. | [
"Gets",
"the",
"convergence",
"rate",
"multiplier",
"."
] | def rate(self):
"""Gets the convergence rate multiplier.
"""
return self._internal.get_rate() | [
"def",
"rate",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_rate",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Loss.py#L647-L650 | |
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/street_network/street_network.py | python | AbstractStreetNetworkService.record_call | (self, status, **kwargs) | status can be in: ok, failure | status can be in: ok, failure | [
"status",
"can",
"be",
"in",
":",
"ok",
"failure"
] | def record_call(self, status, **kwargs):
"""
status can be in: ok, failure
"""
params = {'streetnetwork_id': six.text_type(self.sn_system_id), 'status': status}
params.update(kwargs)
new_relic.record_custom_event('streetnetwork', params) | [
"def",
"record_call",
"(",
"self",
",",
"status",
",",
"*",
"*",
"kwargs",
")",
":",
"params",
"=",
"{",
"'streetnetwork_id'",
":",
"six",
".",
"text_type",
"(",
"self",
".",
"sn_system_id",
")",
",",
"'status'",
":",
"status",
"}",
"params",
".",
"upd... | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/street_network/street_network.py#L148-L154 | ||
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/mox.py | python | MultipleTimesGroup.IsSatisfied | (self) | return False | Return True if all methods in this group are called at least once. | Return True if all methods in this group are called at least once. | [
"Return",
"True",
"if",
"all",
"methods",
"in",
"this",
"group",
"are",
"called",
"at",
"least",
"once",
"."
] | def IsSatisfied(self):
"""Return True if all methods in this group are called at least once."""
# NOTE(psycho): We can't use the simple set difference here because we want
# to match different parameters which are considered the same e.g. IsA(str)
# and some string. This solution is O(n^2) but n should ... | [
"def",
"IsSatisfied",
"(",
"self",
")",
":",
"# NOTE(psycho): We can't use the simple set difference here because we want",
"# to match different parameters which are considered the same e.g. IsA(str)",
"# and some string. This solution is O(n^2) but n should be small.",
"tmp",
"=",
"self",
... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/mox.py#L1318-L1331 | |
UbiquityRobotics/fiducials | 1ae8a13d56fafa436aca181da451c1bf808a288c | fiducial_slam/scripts/standard_fit.py | python | function | (x, C, N) | return np.dot(x-Ck, Nk) * -1.0 / Nu + Cu | Calculate an orthogonal projection of the points on the standard
Args:
x: (n-1) x m dimensional matrix
C: n dimensional vector whicn indicate the centroid of the standard
N: n dimensional vector which indicate the normal vector of the standard
Returns:
m dimensional vector whic... | Calculate an orthogonal projection of the points on the standard | [
"Calculate",
"an",
"orthogonal",
"projection",
"of",
"the",
"points",
"on",
"the",
"standard"
] | def function(x, C, N):
"""
Calculate an orthogonal projection of the points on the standard
Args:
x: (n-1) x m dimensional matrix
C: n dimensional vector whicn indicate the centroid of the standard
N: n dimensional vector which indicate the normal vector of the standard
Returns... | [
"def",
"function",
"(",
"x",
",",
"C",
",",
"N",
")",
":",
"Ck",
"=",
"C",
"[",
"0",
":",
"-",
"1",
"]",
"# centroid for known parameters",
"Nk",
"=",
"N",
"[",
"0",
":",
"-",
"1",
"]",
"# normal for known parmeters",
"Cu",
"=",
"C",
"[",
"-",
"1... | https://github.com/UbiquityRobotics/fiducials/blob/1ae8a13d56fafa436aca181da451c1bf808a288c/fiducial_slam/scripts/standard_fit.py#L89-L106 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/_cppyy_generator.py | python | CppyyGenerator._get_access_specifier | (self, member) | return False | In principle, we just want member.access_specifier.name.lower(), except that we need to handle:
Q_SIGNALS:|signals:
which are converted by the preprocessor...so read the original text.
:param member: The access_specifier.
:return: | In principle, we just want member.access_specifier.name.lower(), except that we need to handle: | [
"In",
"principle",
"we",
"just",
"want",
"member",
".",
"access_specifier",
".",
"name",
".",
"lower",
"()",
"except",
"that",
"we",
"need",
"to",
"handle",
":"
] | def _get_access_specifier(self, member):
"""
In principle, we just want member.access_specifier.name.lower(), except that we need to handle:
Q_SIGNALS:|signals:
which are converted by the preprocessor...so read the original text.
:param member: The access_sp... | [
"def",
"_get_access_specifier",
"(",
"self",
",",
"member",
")",
":",
"access_specifier_text",
"=",
"self",
".",
"source_processor",
".",
"unpreprocessed",
"(",
"member",
".",
"extent",
")",
"if",
"access_specifier_text",
"in",
"(",
"Q_SIGNALS",
"+",
"\":\"",
",... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/_cppyy_generator.py#L393-L407 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py | python | MH.get_string | (self, key) | Return a string representation or raise a KeyError. | Return a string representation or raise a KeyError. | [
"Return",
"a",
"string",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_string(self, key):
"""Return a string representation or raise a KeyError."""
try:
if self._locked:
f = open(os.path.join(self._path, str(key)), 'r+')
else:
f = open(os.path.join(self._path, str(key)), 'r')
except IOError, e:
... | [
"def",
"get_string",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"if",
"self",
".",
"_locked",
":",
"f",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"str",
"(",
"key",
")",
")",
",",
"'r+'",
")",
"else... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L1021-L1042 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/utils/check_cfc/check_cfc.py | python | get_output_file | (args) | return None | Return the output file specified by this command or None if not
specified. | Return the output file specified by this command or None if not
specified. | [
"Return",
"the",
"output",
"file",
"specified",
"by",
"this",
"command",
"or",
"None",
"if",
"not",
"specified",
"."
] | def get_output_file(args):
"""Return the output file specified by this command or None if not
specified."""
grabnext = False
for arg in args:
if grabnext:
return arg
if arg == '-o':
# Specified as a separate arg
grabnext = True
elif arg.startsw... | [
"def",
"get_output_file",
"(",
"args",
")",
":",
"grabnext",
"=",
"False",
"for",
"arg",
"in",
"args",
":",
"if",
"grabnext",
":",
"return",
"arg",
"if",
"arg",
"==",
"'-o'",
":",
"# Specified as a separate arg",
"grabnext",
"=",
"True",
"elif",
"arg",
"."... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/utils/check_cfc/check_cfc.py#L130-L145 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/sets.py | python | BaseSet.issuperset | (self, other) | return True | Report whether this set contains another set. | Report whether this set contains another set. | [
"Report",
"whether",
"this",
"set",
"contains",
"another",
"set",
"."
] | def issuperset(self, other):
"""Report whether this set contains another set."""
self._binary_sanity_check(other)
if len(self) < len(other): # Fast check for obvious cases
return False
for elt in ifilterfalse(self._data.__contains__, other):
return False
... | [
"def",
"issuperset",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"_binary_sanity_check",
"(",
"other",
")",
"if",
"len",
"(",
"self",
")",
"<",
"len",
"(",
"other",
")",
":",
"# Fast check for obvious cases",
"return",
"False",
"for",
"elt",
"in",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/sets.py#L298-L305 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Sizer.ComputeFittingWindowSize | (*args, **kwargs) | return _core_.Sizer_ComputeFittingWindowSize(*args, **kwargs) | ComputeFittingWindowSize(self, Window window) -> Size
Like `ComputeFittingClientSize`, but converts the result into *window*
size.
The returned value is suitable for passing to `wx.Window.SetSize` or
`wx.Window.SetMinSize`. | ComputeFittingWindowSize(self, Window window) -> Size | [
"ComputeFittingWindowSize",
"(",
"self",
"Window",
"window",
")",
"-",
">",
"Size"
] | def ComputeFittingWindowSize(*args, **kwargs):
"""
ComputeFittingWindowSize(self, Window window) -> Size
Like `ComputeFittingClientSize`, but converts the result into *window*
size.
The returned value is suitable for passing to `wx.Window.SetSize` or
`wx.Window.SetMinSi... | [
"def",
"ComputeFittingWindowSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_ComputeFittingWindowSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L14863-L14874 | |
mamedev/mame | 02cd26d37ee11191f3e311e19e805d872cb1e3a4 | 3rdparty/portmidi/pm_python/pyportmidi/midi.py | python | Input.poll | (self) | returns true if there's data, or false if not.
Input.poll(): return Bool
raises a MidiException on error. | returns true if there's data, or false if not.
Input.poll(): return Bool | [
"returns",
"true",
"if",
"there",
"s",
"data",
"or",
"false",
"if",
"not",
".",
"Input",
".",
"poll",
"()",
":",
"return",
"Bool"
] | def poll(self):
"""returns true if there's data, or false if not.
Input.poll(): return Bool
raises a MidiException on error.
"""
_check_init()
self._check_open()
r = self._input.Poll()
if r == _pypm.TRUE:
return True
elif r == _pypm.F... | [
"def",
"poll",
"(",
"self",
")",
":",
"_check_init",
"(",
")",
"self",
".",
"_check_open",
"(",
")",
"r",
"=",
"self",
".",
"_input",
".",
"Poll",
"(",
")",
"if",
"r",
"==",
"_pypm",
".",
"TRUE",
":",
"return",
"True",
"elif",
"r",
"==",
"_pypm",... | https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/3rdparty/portmidi/pm_python/pyportmidi/midi.py#L284-L300 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCompileUnit.FindLineEntryIndex | (self, *args) | return _lldb.SBCompileUnit_FindLineEntryIndex(self, *args) | FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec) -> uint32_t
FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec, bool exact) -> uint32_t | FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec) -> uint32_t
FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec, bool exact) -> uint32_t | [
"FindLineEntryIndex",
"(",
"SBCompileUnit",
"self",
"uint32_t",
"start_idx",
"uint32_t",
"line",
"SBFileSpec",
"inline_file_spec",
")",
"-",
">",
"uint32_t",
"FindLineEntryIndex",
"(",
"SBCompileUnit",
"self",
"uint32_t",
"start_idx",
"uint32_t",
"line",
"SBFileSpec",
"... | def FindLineEntryIndex(self, *args):
"""
FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec) -> uint32_t
FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec, bool exact) -> uint32_t
"""
... | [
"def",
"FindLineEntryIndex",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBCompileUnit_FindLineEntryIndex",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3180-L3185 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/resources/list_unused_grit_header.py | python | ShouldScanFile | (filename) | return file_extension in extensions | Return if the filename has one of the extensions below. | Return if the filename has one of the extensions below. | [
"Return",
"if",
"the",
"filename",
"has",
"one",
"of",
"the",
"extensions",
"below",
"."
] | def ShouldScanFile(filename):
"""Return if the filename has one of the extensions below."""
extensions = ['.cc', '.cpp', '.h', '.mm']
file_extension = os.path.splitext(filename)[1]
return file_extension in extensions | [
"def",
"ShouldScanFile",
"(",
"filename",
")",
":",
"extensions",
"=",
"[",
"'.cc'",
",",
"'.cpp'",
",",
"'.h'",
",",
"'.mm'",
"]",
"file_extension",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"[",
"1",
"]",
"return",
"file_extension"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/resources/list_unused_grit_header.py#L150-L154 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/crcmod_osx/crcmod/crcmod.py | python | Crc.digest | (self) | return ''.join(lst) | Return the current CRC value as a string of bytes. The length of
this string is specified in the digest_size attribute. | Return the current CRC value as a string of bytes. The length of
this string is specified in the digest_size attribute. | [
"Return",
"the",
"current",
"CRC",
"value",
"as",
"a",
"string",
"of",
"bytes",
".",
"The",
"length",
"of",
"this",
"string",
"is",
"specified",
"in",
"the",
"digest_size",
"attribute",
"."
] | def digest(self):
'''Return the current CRC value as a string of bytes. The length of
this string is specified in the digest_size attribute.
'''
n = self.digest_size
crc = self.crcValue
lst = []
while n > 0:
lst.append(chr(crc & 0xFF))
crc... | [
"def",
"digest",
"(",
"self",
")",
":",
"n",
"=",
"self",
".",
"digest_size",
"crc",
"=",
"self",
".",
"crcValue",
"lst",
"=",
"[",
"]",
"while",
"n",
">",
"0",
":",
"lst",
".",
"append",
"(",
"chr",
"(",
"crc",
"&",
"0xFF",
")",
")",
"crc",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/crcmod_osx/crcmod/crcmod.py#L153-L165 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/trace.py | python | CoverageResults.update | (self, other) | Merge in the data from another CoverageResults | Merge in the data from another CoverageResults | [
"Merge",
"in",
"the",
"data",
"from",
"another",
"CoverageResults"
] | def update(self, other):
"""Merge in the data from another CoverageResults"""
counts = self.counts
calledfuncs = self.calledfuncs
callers = self.callers
other_counts = other.counts
other_calledfuncs = other.calledfuncs
other_callers = other.callers
for ke... | [
"def",
"update",
"(",
"self",
",",
"other",
")",
":",
"counts",
"=",
"self",
".",
"counts",
"calledfuncs",
"=",
"self",
".",
"calledfuncs",
"callers",
"=",
"self",
".",
"callers",
"other_counts",
"=",
"other",
".",
"counts",
"other_calledfuncs",
"=",
"othe... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/trace.py#L248-L264 | ||
NervanaSystems/ngraph | f677a119765ca30636cf407009dabd118664951f | python/src/ngraph/ops.py | python | logical_and | (
left_node: NodeInput,
right_node: NodeInput,
auto_broadcast: str = "NUMPY",
name: Optional[str] = None,
) | return _get_node_factory().create(
"LogicalAnd", [left_node, right_node], {"auto_broadcast": auto_broadcast.upper()}
) | Return node which perform logical and operation on input nodes element-wise.
:param left_node: The first input node providing data.
:param right_node: The second input node providing data.
:param auto_broadcast: The type of broadcasting that specifies mapping of input tensor axes
... | Return node which perform logical and operation on input nodes element-wise. | [
"Return",
"node",
"which",
"perform",
"logical",
"and",
"operation",
"on",
"input",
"nodes",
"element",
"-",
"wise",
"."
] | def logical_and(
left_node: NodeInput,
right_node: NodeInput,
auto_broadcast: str = "NUMPY",
name: Optional[str] = None,
) -> Node:
"""Return node which perform logical and operation on input nodes element-wise.
:param left_node: The first input node providing data.
:param right_node: The s... | [
"def",
"logical_and",
"(",
"left_node",
":",
"NodeInput",
",",
"right_node",
":",
"NodeInput",
",",
"auto_broadcast",
":",
"str",
"=",
"\"NUMPY\"",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
"->",
"Node",
":",
"return",
"_get_n... | https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L1276-L1293 | |
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/hpmc/pair/user.py | python | CPPPotentialBase._wrap_gpu_code | (self, code) | return cpp_function | Convert the provided code into a device function with the expected \
signature.
Args:
code (`str`): Body of the C++ function | Convert the provided code into a device function with the expected \
signature. | [
"Convert",
"the",
"provided",
"code",
"into",
"a",
"device",
"function",
"with",
"the",
"expected",
"\\",
"signature",
"."
] | def _wrap_gpu_code(self, code):
"""Convert the provided code into a device function with the expected \
signature.
Args:
code (`str`): Body of the C++ function
"""
param_array_suffix = {True: '_isotropic', False: ''}[self._is_union]
constituent_str = ... | [
"def",
"_wrap_gpu_code",
"(",
"self",
",",
"code",
")",
":",
"param_array_suffix",
"=",
"{",
"True",
":",
"'_isotropic'",
",",
"False",
":",
"''",
"}",
"[",
"self",
".",
"_is_union",
"]",
"constituent_str",
"=",
"'__device__ float *param_array_constituent;'",
"c... | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/pair/user.py#L137-L178 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-time.py | python | SConsTimer.subst_variables | (self, command, dictionary) | return (action, string, args) | Substitutes (via the format operator) the values in the specified
dictionary into the specified command.
The command can be an (action, string) tuple. In all cases, we
perform substitution on strings and don't worry if something isn't
a string. (It's probably a Python function to be e... | Substitutes (via the format operator) the values in the specified
dictionary into the specified command. | [
"Substitutes",
"(",
"via",
"the",
"format",
"operator",
")",
"the",
"values",
"in",
"the",
"specified",
"dictionary",
"into",
"the",
"specified",
"command",
"."
] | def subst_variables(self, command, dictionary):
"""
Substitutes (via the format operator) the values in the specified
dictionary into the specified command.
The command can be an (action, string) tuple. In all cases, we
perform substitution on strings and don't worry if somethi... | [
"def",
"subst_variables",
"(",
"self",
",",
"command",
",",
"dictionary",
")",
":",
"try",
":",
"command",
"+",
"''",
"except",
"TypeError",
":",
"action",
"=",
"command",
"[",
"0",
"]",
"string",
"=",
"command",
"[",
"1",
"]",
"args",
"=",
"command",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-time.py#L374-L395 | |
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetLibFlags | (self, config, gyp_to_build_path) | return libflags | Returns the flags that need to be added to lib commands. | Returns the flags that need to be added to lib commands. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"lib",
"commands",
"."
] | def GetLibFlags(self, config, gyp_to_build_path):
"""Returns the flags that need to be added to lib commands."""
config = self._TargetConfig(config)
libflags = []
lib = self._GetWrapper(self, self.msvs_settings[config],
'VCLibrarianTool', append=libflags)
libflags.extend(se... | [
"def",
"GetLibFlags",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"libflags",
"=",
"[",
"]",
"lib",
"=",
"self",
".",
"_GetWrapper",
"(",
"self",
",",
"self",
".",
"ms... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/msvs_emulation.py#L513-L525 | |
google/sandboxed-api | 7004d59150c9fbfaa3e5fd1872affffd1ab14fe8 | oss-internship-2020/libuv/generator/wrapper_generator.py | python | read_file | (filename: str) | return str(file.read()) | Returns contents of filename as a string.
Args:
filename: The name of the file to read
Returns:
The contents of the file as a string. | Returns contents of filename as a string. | [
"Returns",
"contents",
"of",
"filename",
"as",
"a",
"string",
"."
] | def read_file(filename: str) -> str:
"""Returns contents of filename as a string.
Args:
filename: The name of the file to read
Returns:
The contents of the file as a string.
"""
file = open(filename, "r")
return str(file.read()) | [
"def",
"read_file",
"(",
"filename",
":",
"str",
")",
"->",
"str",
":",
"file",
"=",
"open",
"(",
"filename",
",",
"\"r\"",
")",
"return",
"str",
"(",
"file",
".",
"read",
"(",
")",
")"
] | https://github.com/google/sandboxed-api/blob/7004d59150c9fbfaa3e5fd1872affffd1ab14fe8/oss-internship-2020/libuv/generator/wrapper_generator.py#L149-L160 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xmlDoc.saveFormatFileTo | (self, buf, encoding, format) | return ret | Dump an XML document to an I/O buffer. Warning ! This call
xmlOutputBufferClose() on buf which is not available after
this call. | Dump an XML document to an I/O buffer. Warning ! This call
xmlOutputBufferClose() on buf which is not available after
this call. | [
"Dump",
"an",
"XML",
"document",
"to",
"an",
"I",
"/",
"O",
"buffer",
".",
"Warning",
"!",
"This",
"call",
"xmlOutputBufferClose",
"()",
"on",
"buf",
"which",
"is",
"not",
"available",
"after",
"this",
"call",
"."
] | def saveFormatFileTo(self, buf, encoding, format):
"""Dump an XML document to an I/O buffer. Warning ! This call
xmlOutputBufferClose() on buf which is not available after
this call. """
if buf is None: buf__o = None
else: buf__o = buf._o
ret = libxml2mod.xmlSaveForm... | [
"def",
"saveFormatFileTo",
"(",
"self",
",",
"buf",
",",
"encoding",
",",
"format",
")",
":",
"if",
"buf",
"is",
"None",
":",
"buf__o",
"=",
"None",
"else",
":",
"buf__o",
"=",
"buf",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlSaveFormatFileTo",
"("... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4454-L4461 | |
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | scripts/cpp_lint.py | python | CheckVlogArguments | (filename, clean_lines, linenum, error) | Checks that VLOG() is only used for defining a logging level.
For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
VLOG(FATAL) are not.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | Checks that VLOG() is only used for defining a logging level. | [
"Checks",
"that",
"VLOG",
"()",
"is",
"only",
"used",
"for",
"defining",
"a",
"logging",
"level",
"."
] | def CheckVlogArguments(filename, clean_lines, linenum, error):
"""Checks that VLOG() is only used for defining a logging level.
For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
VLOG(FATAL) are not.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines i... | [
"def",
"CheckVlogArguments",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"Search",
"(",
"r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'",
",",
"line",
")",
... | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/scripts/cpp_lint.py#L1708-L1724 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py | python | Mailbox.pop | (self, key, default=None) | return result | Delete the keyed message and return it, or default. | Delete the keyed message and return it, or default. | [
"Delete",
"the",
"keyed",
"message",
"and",
"return",
"it",
"or",
"default",
"."
] | def pop(self, key, default=None):
"""Delete the keyed message and return it, or default."""
try:
result = self[key]
except KeyError:
return default
self.discard(key)
return result | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"result",
"=",
"self",
"[",
"key",
"]",
"except",
"KeyError",
":",
"return",
"default",
"self",
".",
"discard",
"(",
"key",
")",
"return",
"result"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L151-L158 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py | python | Set.clear | (self) | Remove all elements from this set. | Remove all elements from this set. | [
"Remove",
"all",
"elements",
"from",
"this",
"set",
"."
] | def clear(self):
"""Remove all elements from this set."""
self._data.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"_data",
".",
"clear",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L493-L495 | ||
gabyx/ApproxMVBB | 838f3ff7690a938f1e4199a5f41b6feefc32a603 | example/kdTreeFiltering/python/Tools/Transformations/Transformations.py | python | random_rotation_matrix | (rand=None) | return quaternion_matrix(random_quaternion(rand)) | Return uniform random rotation matrix.
rand: array like
Three independent random variables that are uniformly distributed
between 0 and 1 for each returned quaternion.
>>> R = random_rotation_matrix()
>>> numpy.allclose(numpy.dot(R.T, R), numpy.identity(4))
True | Return uniform random rotation matrix. | [
"Return",
"uniform",
"random",
"rotation",
"matrix",
"."
] | def random_rotation_matrix(rand=None):
"""Return uniform random rotation matrix.
rand: array like
Three independent random variables that are uniformly distributed
between 0 and 1 for each returned quaternion.
>>> R = random_rotation_matrix()
>>> numpy.allclose(numpy.dot(R.T, R), numpy... | [
"def",
"random_rotation_matrix",
"(",
"rand",
"=",
"None",
")",
":",
"return",
"quaternion_matrix",
"(",
"random_quaternion",
"(",
"rand",
")",
")"
] | https://github.com/gabyx/ApproxMVBB/blob/838f3ff7690a938f1e4199a5f41b6feefc32a603/example/kdTreeFiltering/python/Tools/Transformations/Transformations.py#L1486-L1498 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ntpath.py | python | isabs | (s) | return s != '' and s[:1] in '/\\' | Test whether a path is absolute | Test whether a path is absolute | [
"Test",
"whether",
"a",
"path",
"is",
"absolute"
] | def isabs(s):
"""Test whether a path is absolute"""
s = splitdrive(s)[1]
return s != '' and s[:1] in '/\\' | [
"def",
"isabs",
"(",
"s",
")",
":",
"s",
"=",
"splitdrive",
"(",
"s",
")",
"[",
"1",
"]",
"return",
"s",
"!=",
"''",
"and",
"s",
"[",
":",
"1",
"]",
"in",
"'/\\\\'"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ntpath.py#L55-L58 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | BookCtrlBase.SetPageSize | (*args, **kwargs) | return _core_.BookCtrlBase_SetPageSize(*args, **kwargs) | SetPageSize(self, Size size) | SetPageSize(self, Size size) | [
"SetPageSize",
"(",
"self",
"Size",
"size",
")"
] | def SetPageSize(*args, **kwargs):
"""SetPageSize(self, Size size)"""
return _core_.BookCtrlBase_SetPageSize(*args, **kwargs) | [
"def",
"SetPageSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_SetPageSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13570-L13572 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/thrift/server/TProcessPoolServer.py | python | TProcessPoolServer.serve | (self) | Start workers and put into queue | Start workers and put into queue | [
"Start",
"workers",
"and",
"put",
"into",
"queue"
] | def serve(self):
"""Start workers and put into queue"""
# this is a shared state that can tell the workers to exit when False
self.isRunning.value = True
# first bind and listen to the port
self.serverTransport.listen()
# fork the children
for i in range(self.nu... | [
"def",
"serve",
"(",
"self",
")",
":",
"# this is a shared state that can tell the workers to exit when False",
"self",
".",
"isRunning",
".",
"value",
"=",
"True",
"# first bind and listen to the port",
"self",
".",
"serverTransport",
".",
"listen",
"(",
")",
"# fork the... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/thrift/server/TProcessPoolServer.py#L88-L117 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/SConf.py | python | SetCacheMode | (mode) | Set the Configure cache mode. mode must be one of "auto", "force",
or "cache". | Set the Configure cache mode. mode must be one of "auto", "force",
or "cache". | [
"Set",
"the",
"Configure",
"cache",
"mode",
".",
"mode",
"must",
"be",
"one",
"of",
"auto",
"force",
"or",
"cache",
"."
] | def SetCacheMode(mode):
"""Set the Configure cache mode. mode must be one of "auto", "force",
or "cache"."""
global cache_mode
if mode == "auto":
cache_mode = AUTO
elif mode == "force":
cache_mode = FORCE
elif mode == "cache":
cache_mode = CACHE
else:
raise Va... | [
"def",
"SetCacheMode",
"(",
"mode",
")",
":",
"global",
"cache_mode",
"if",
"mode",
"==",
"\"auto\"",
":",
"cache_mode",
"=",
"AUTO",
"elif",
"mode",
"==",
"\"force\"",
":",
"cache_mode",
"=",
"FORCE",
"elif",
"mode",
"==",
"\"cache\"",
":",
"cache_mode",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/SConf.py#L76-L87 | ||
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | CursorKind.is_reference | (self) | return conf.lib.clang_isReference(self) | Test if this is a reference kind. | Test if this is a reference kind. | [
"Test",
"if",
"this",
"is",
"a",
"reference",
"kind",
"."
] | def is_reference(self):
"""Test if this is a reference kind."""
return conf.lib.clang_isReference(self) | [
"def",
"is_reference",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isReference",
"(",
"self",
")"
] | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L580-L582 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/_parameterized.py | python | _IsSingletonList | (testcases) | return len(testcases) == 1 and not isinstance(testcases[0], tuple) | True iff testcases contains only a single non-tuple element. | True iff testcases contains only a single non-tuple element. | [
"True",
"iff",
"testcases",
"contains",
"only",
"a",
"single",
"non",
"-",
"tuple",
"element",
"."
] | def _IsSingletonList(testcases):
"""True iff testcases contains only a single non-tuple element."""
return len(testcases) == 1 and not isinstance(testcases[0], tuple) | [
"def",
"_IsSingletonList",
"(",
"testcases",
")",
":",
"return",
"len",
"(",
"testcases",
")",
"==",
"1",
"and",
"not",
"isinstance",
"(",
"testcases",
"[",
"0",
"]",
",",
"tuple",
")"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/_parameterized.py#L256-L258 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/process.py | python | current_process | () | return _current_process | Return process object representing the current process | Return process object representing the current process | [
"Return",
"process",
"object",
"representing",
"the",
"current",
"process"
] | def current_process():
'''
Return process object representing the current process
'''
return _current_process | [
"def",
"current_process",
"(",
")",
":",
"return",
"_current_process"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/process.py#L36-L40 | |
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | examples/pycaffe/tools.py | python | SimpleTransformer.preprocess | (self, im) | return im | preprocess() emulate the pre-processing occurring in the vgg16 caffe
prototxt. | preprocess() emulate the pre-processing occurring in the vgg16 caffe
prototxt. | [
"preprocess",
"()",
"emulate",
"the",
"pre",
"-",
"processing",
"occurring",
"in",
"the",
"vgg16",
"caffe",
"prototxt",
"."
] | def preprocess(self, im):
"""
preprocess() emulate the pre-processing occurring in the vgg16 caffe
prototxt.
"""
im = np.float32(im)
im = im[:, :, ::-1] # change to BGR
im -= self.mean
im *= self.scale
im = im.transpose((2, 0, 1))
return... | [
"def",
"preprocess",
"(",
"self",
",",
"im",
")",
":",
"im",
"=",
"np",
".",
"float32",
"(",
"im",
")",
"im",
"=",
"im",
"[",
":",
",",
":",
",",
":",
":",
"-",
"1",
"]",
"# change to BGR",
"im",
"-=",
"self",
".",
"mean",
"im",
"*=",
"self",... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/examples/pycaffe/tools.py#L27-L39 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextEvent.SetModifiers | (*args, **kwargs) | return _stc.StyledTextEvent_SetModifiers(*args, **kwargs) | SetModifiers(self, int m) | SetModifiers(self, int m) | [
"SetModifiers",
"(",
"self",
"int",
"m",
")"
] | def SetModifiers(*args, **kwargs):
"""SetModifiers(self, int m)"""
return _stc.StyledTextEvent_SetModifiers(*args, **kwargs) | [
"def",
"SetModifiers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_SetModifiers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L7034-L7036 | |
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _FunctionState.check | (self, error, line_number) | Report if too many lines in function body.
Args:
error: The function to call with any errors found.
line_number: The number of the line to check. | Report if too many lines in function body. | [
"Report",
"if",
"too",
"many",
"lines",
"in",
"function",
"body",
"."
] | def check(self, error, line_number):
"""Report if too many lines in function body.
Args:
error: The function to call with any errors found.
line_number: The number of the line to check.
"""
if match(r'T(EST|est)', self.current_function):
base_trigger = se... | [
"def",
"check",
"(",
"self",
",",
"error",
",",
"line_number",
")",
":",
"if",
"match",
"(",
"r'T(EST|est)'",
",",
"self",
".",
"current_function",
")",
":",
"base_trigger",
"=",
"self",
".",
"_TEST_TRIGGER",
"else",
":",
"base_trigger",
"=",
"self",
".",
... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L576-L598 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSNew.py | python | MSVSSolution.__init__ | (self, path, version, entries=None, variants=None,
websiteProperties=True) | Initializes the solution.
Args:
path: Path to solution file.
version: Format version to emit.
entries: List of entries in solution. May contain Folder or Project
objects. May be None, if the folder is empty.
variants: List of build variant strings. If none, a default list will
... | Initializes the solution. | [
"Initializes",
"the",
"solution",
"."
] | def __init__(self, path, version, entries=None, variants=None,
websiteProperties=True):
"""Initializes the solution.
Args:
path: Path to solution file.
version: Format version to emit.
entries: List of entries in solution. May contain Folder or Project
objects. May ... | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"version",
",",
"entries",
"=",
"None",
",",
"variants",
"=",
"None",
",",
"websiteProperties",
"=",
"True",
")",
":",
"self",
".",
"path",
"=",
"path",
"self",
".",
"websiteProperties",
"=",
"websiteProp... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSNew.py#L178-L213 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | MaskedArray.__rsub__ | (self, other) | return subtract(other, self) | Subtract self from other, and return a new masked array. | Subtract self from other, and return a new masked array. | [
"Subtract",
"self",
"from",
"other",
"and",
"return",
"a",
"new",
"masked",
"array",
"."
] | def __rsub__(self, other):
"""
Subtract self from other, and return a new masked array.
"""
return subtract(other, self) | [
"def",
"__rsub__",
"(",
"self",
",",
"other",
")",
":",
"return",
"subtract",
"(",
"other",
",",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L4087-L4092 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | Search | (pattern, s) | return _regexp_compile_cache[pattern].search(s) | Searches the string for the pattern, caching the compiled regexp. | Searches the string for the pattern, caching the compiled regexp. | [
"Searches",
"the",
"string",
"for",
"the",
"pattern",
"caching",
"the",
"compiled",
"regexp",
"."
] | def Search(pattern, s):
"""Searches the string for the pattern, caching the compiled regexp."""
if not pattern in _regexp_compile_cache:
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
return _regexp_compile_cache[pattern].search(s) | [
"def",
"Search",
"(",
"pattern",
",",
"s",
")",
":",
"if",
"not",
"pattern",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_cache",
"[",
"pat... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L419-L423 | |
NASA-SW-VnV/ikos | 71325dfb94737332542caa708d7537752021522d | analyzer/python/ikos/stats.py | python | get | (key) | return _statistics.get(key) | Gets a value from statistics table | Gets a value from statistics table | [
"Gets",
"a",
"value",
"from",
"statistics",
"table"
] | def get(key):
''' Gets a value from statistics table '''
return _statistics.get(key) | [
"def",
"get",
"(",
"key",
")",
":",
"return",
"_statistics",
".",
"get",
"(",
"key",
")"
] | https://github.com/NASA-SW-VnV/ikos/blob/71325dfb94737332542caa708d7537752021522d/analyzer/python/ikos/stats.py#L99-L101 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | GetInvParticipRat | (*args) | return _snap.GetInvParticipRat(*args) | GetInvParticipRat(PUNGraph const & Graph, int MaxEigVecs, int TimeLimit, TFltPrV & EigValIprV)
Parameters:
Graph: PUNGraph const &
MaxEigVecs: int
TimeLimit: int
EigValIprV: TFltPrV & | GetInvParticipRat(PUNGraph const & Graph, int MaxEigVecs, int TimeLimit, TFltPrV & EigValIprV) | [
"GetInvParticipRat",
"(",
"PUNGraph",
"const",
"&",
"Graph",
"int",
"MaxEigVecs",
"int",
"TimeLimit",
"TFltPrV",
"&",
"EigValIprV",
")"
] | def GetInvParticipRat(*args):
"""
GetInvParticipRat(PUNGraph const & Graph, int MaxEigVecs, int TimeLimit, TFltPrV & EigValIprV)
Parameters:
Graph: PUNGraph const &
MaxEigVecs: int
TimeLimit: int
EigValIprV: TFltPrV &
"""
return _snap.GetInvParticipRat(*args) | [
"def",
"GetInvParticipRat",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"GetInvParticipRat",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5618-L5629 | |
nlohmann/json | eb2182414749825be086c825edb5229e5c28503d | third_party/cpplint/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... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | 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 match... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"(",
"line",
"[",
"pos",
"]",
"not",
"in",
"'({[<'",
")",
"or",
"Match",
"(",
"r'<[<=]'",
",",
"... | https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L2074-L2115 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/rnn/word_lm/module.py | python | CustomStatefulModule.get_loss | (self) | return self._module.get_outputs(merge_multi_context=False)[-1] | Gets the output loss of the previous forward computation. | Gets the output loss of the previous forward computation. | [
"Gets",
"the",
"output",
"loss",
"of",
"the",
"previous",
"forward",
"computation",
"."
] | def get_loss(self):
"""Gets the output loss of the previous forward computation.
"""
return self._module.get_outputs(merge_multi_context=False)[-1] | [
"def",
"get_loss",
"(",
"self",
")",
":",
"return",
"self",
".",
"_module",
".",
"get_outputs",
"(",
"merge_multi_context",
"=",
"False",
")",
"[",
"-",
"1",
"]"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/rnn/word_lm/module.py#L131-L134 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/format/policy_templates/writers/adm_writer.py | python | IndentedStringBuilder.AddLines | (self, other) | Appends the content of another |IndentedStringBuilder| to |self.lines|.
Indentation of the added lines will be the sum of |self.indent| and
their original indentation.
Args:
other: The buffer from which lines are copied. | Appends the content of another |IndentedStringBuilder| to |self.lines|.
Indentation of the added lines will be the sum of |self.indent| and
their original indentation. | [
"Appends",
"the",
"content",
"of",
"another",
"|IndentedStringBuilder|",
"to",
"|self",
".",
"lines|",
".",
"Indentation",
"of",
"the",
"added",
"lines",
"will",
"be",
"the",
"sum",
"of",
"|self",
".",
"indent|",
"and",
"their",
"original",
"indentation",
"."
... | def AddLines(self, other):
'''Appends the content of another |IndentedStringBuilder| to |self.lines|.
Indentation of the added lines will be the sum of |self.indent| and
their original indentation.
Args:
other: The buffer from which lines are copied.
'''
for line in other.lines:
sel... | [
"def",
"AddLines",
"(",
"self",
",",
"other",
")",
":",
"for",
"line",
"in",
"other",
".",
"lines",
":",
"self",
".",
"AddLine",
"(",
"line",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/adm_writer.py#L47-L56 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/range.py | python | RangeIndex.__len__ | (self) | return len(self._range) | return the length of the RangeIndex | return the length of the RangeIndex | [
"return",
"the",
"length",
"of",
"the",
"RangeIndex"
] | def __len__(self) -> int:
"""
return the length of the RangeIndex
"""
return len(self._range) | [
"def",
"__len__",
"(",
"self",
")",
"->",
"int",
":",
"return",
"len",
"(",
"self",
".",
"_range",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/range.py#L675-L679 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | mlir/utils/spirv/gen_spirv_dialect.py | python | extract_td_op_info | (op_def) | return {
# Prefix with 'Op' to make it consistent with SPIR-V spec
'opname': 'Op{}'.format(opname),
'inst_category': inst_category,
'category_args': category_args,
'traits': traits,
'description': description,
'arguments': args,
'results': results,
'extras': extras
... | Extracts potentially manually specified sections in op's definition.
Arguments: - A string containing the op's TableGen definition
Returns:
- A dict containing potential manually specified sections | Extracts potentially manually specified sections in op's definition. | [
"Extracts",
"potentially",
"manually",
"specified",
"sections",
"in",
"op",
"s",
"definition",
"."
] | def extract_td_op_info(op_def):
"""Extracts potentially manually specified sections in op's definition.
Arguments: - A string containing the op's TableGen definition
Returns:
- A dict containing potential manually specified sections
"""
# Get opname
opname = [o[8:-2] for o in re.findall('def SPV_\w+Op... | [
"def",
"extract_td_op_info",
"(",
"op_def",
")",
":",
"# Get opname",
"opname",
"=",
"[",
"o",
"[",
"8",
":",
"-",
"2",
"]",
"for",
"o",
"in",
"re",
".",
"findall",
"(",
"'def SPV_\\w+Op'",
",",
"op_def",
")",
"]",
"assert",
"len",
"(",
"opname",
")"... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/mlir/utils/spirv/gen_spirv_dialect.py#L867-L920 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/math_ops.py | python | reduce_max | (input_tensor, axis=None, keepdims=False, name=None) | return reduce_max_with_dims(input_tensor, axis, keepdims, name,
_ReductionDims(input_tensor, axis)) | Computes `tf.math.maximum` of elements across dimensions of a tensor.
This is the reduction operation for the elementwise `tf.math.maximum` op.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each
of the entries in `axis`, whic... | Computes `tf.math.maximum` of elements across dimensions of a tensor. | [
"Computes",
"tf",
".",
"math",
".",
"maximum",
"of",
"elements",
"across",
"dimensions",
"of",
"a",
"tensor",
"."
] | def reduce_max(input_tensor, axis=None, keepdims=False, name=None):
"""Computes `tf.math.maximum` of elements across dimensions of a tensor.
This is the reduction operation for the elementwise `tf.math.maximum` op.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keepdims` is true, the ran... | [
"def",
"reduce_max",
"(",
"input_tensor",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"return",
"reduce_max_with_dims",
"(",
"input_tensor",
",",
"axis",
",",
"keepdims",
",",
"name",
",",
"_ReductionDims",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_ops.py#L3060-L3105 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-automation/autothreadharness/runner.py | python | list_devices | (names=None, continue_from=None, **kwargs) | List devices in settings file and print versions | List devices in settings file and print versions | [
"List",
"devices",
"in",
"settings",
"file",
"and",
"print",
"versions"
] | def list_devices(names=None, continue_from=None, **kwargs):
"""List devices in settings file and print versions"""
if not names:
names = [device for device, _type in settings.GOLDEN_DEVICES if _type == 'OpenThread']
if continue_from:
continue_from = names.index(continue_from)
else:
... | [
"def",
"list_devices",
"(",
"names",
"=",
"None",
",",
"continue_from",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"names",
":",
"names",
"=",
"[",
"device",
"for",
"device",
",",
"_type",
"in",
"settings",
".",
"GOLDEN_DEVICES",
"if"... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-automation/autothreadharness/runner.py#L157-L173 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBQueue.GetNumRunningItems | (self) | return _lldb.SBQueue_GetNumRunningItems(self) | GetNumRunningItems(SBQueue self) -> uint32_t | GetNumRunningItems(SBQueue self) -> uint32_t | [
"GetNumRunningItems",
"(",
"SBQueue",
"self",
")",
"-",
">",
"uint32_t"
] | def GetNumRunningItems(self):
"""GetNumRunningItems(SBQueue self) -> uint32_t"""
return _lldb.SBQueue_GetNumRunningItems(self) | [
"def",
"GetNumRunningItems",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBQueue_GetNumRunningItems",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9126-L9128 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/report.py | python | parse_bug_html | (filename) | Parse out the bug information from HTML output. | Parse out the bug information from HTML output. | [
"Parse",
"out",
"the",
"bug",
"information",
"from",
"HTML",
"output",
"."
] | def parse_bug_html(filename):
""" Parse out the bug information from HTML output. """
patterns = [re.compile(r'<!-- BUGTYPE (?P<bug_type>.*) -->$'),
re.compile(r'<!-- BUGFILE (?P<bug_file>.*) -->$'),
re.compile(r'<!-- BUGPATHLENGTH (?P<bug_path_length>.*) -->$'),
... | [
"def",
"parse_bug_html",
"(",
"filename",
")",
":",
"patterns",
"=",
"[",
"re",
".",
"compile",
"(",
"r'<!-- BUGTYPE (?P<bug_type>.*) -->$'",
")",
",",
"re",
".",
"compile",
"(",
"r'<!-- BUGFILE (?P<bug_file>.*) -->$'",
")",
",",
"re",
".",
"compile",
"(",
"r'<!... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/report.py#L301-L336 | ||
brave/brave-core | ceaa3de4735789d355b6fa80c21d4709e2c1d0e8 | tools/posix/generate_breakpad_symbols.py | python | mkdir_p | (path) | Simulates mkdir -p. | Simulates mkdir -p. | [
"Simulates",
"mkdir",
"-",
"p",
"."
] | def mkdir_p(path):
"""Simulates mkdir -p."""
try:
os.makedirs(path)
except OSError as e:
if e.errno == errno.EEXIST and os.path.isdir(path):
pass
else: raise | [
"def",
"mkdir_p",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"path",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"EEXIST",
"and",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
... | https://github.com/brave/brave-core/blob/ceaa3de4735789d355b6fa80c21d4709e2c1d0e8/tools/posix/generate_breakpad_symbols.py#L171-L178 | ||
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/buildtools/checkdeps/graphdeps.py | python | DepsGrapher._DumpDependenciesImpl | (self, deps, out) | Computes nodes' and edges' properties for the dependency graph |deps| and
carries out the actual dumping to a file/pipe |out|. | Computes nodes' and edges' properties for the dependency graph |deps| and
carries out the actual dumping to a file/pipe |out|. | [
"Computes",
"nodes",
"and",
"edges",
"properties",
"for",
"the",
"dependency",
"graph",
"|deps|",
"and",
"carries",
"out",
"the",
"actual",
"dumping",
"to",
"a",
"file",
"/",
"pipe",
"|out|",
"."
] | def _DumpDependenciesImpl(self, deps, out):
"""Computes nodes' and edges' properties for the dependency graph |deps| and
carries out the actual dumping to a file/pipe |out|."""
deps_graph = dict()
deps_srcs = set()
# Pre-initialize the graph with src->(dst, allow) pairs.
for (allow, src, dst) i... | [
"def",
"_DumpDependenciesImpl",
"(",
"self",
",",
"deps",
",",
"out",
")",
":",
"deps_graph",
"=",
"dict",
"(",
")",
"deps_srcs",
"=",
"set",
"(",
")",
"# Pre-initialize the graph with src->(dst, allow) pairs.",
"for",
"(",
"allow",
",",
"src",
",",
"dst",
")"... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/buildtools/checkdeps/graphdeps.py#L139-L252 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dist.py | python | Distribution.get_command_packages | (self) | return pkgs | Return a list of packages from which commands are loaded. | Return a list of packages from which commands are loaded. | [
"Return",
"a",
"list",
"of",
"packages",
"from",
"which",
"commands",
"are",
"loaded",
"."
] | def get_command_packages(self):
"""Return a list of packages from which commands are loaded."""
pkgs = self.command_packages
if not isinstance(pkgs, list):
if pkgs is None:
pkgs = ''
pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != '']
... | [
"def",
"get_command_packages",
"(",
"self",
")",
":",
"pkgs",
"=",
"self",
".",
"command_packages",
"if",
"not",
"isinstance",
"(",
"pkgs",
",",
"list",
")",
":",
"if",
"pkgs",
"is",
"None",
":",
"pkgs",
"=",
"''",
"pkgs",
"=",
"[",
"pkg",
".",
"stri... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dist.py#L795-L805 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/parallel_for/pfor.py | python | RegisterPFor.__init__ | (self, op_type) | Creates an object to register a converter for op with type `op_type`. | Creates an object to register a converter for op with type `op_type`. | [
"Creates",
"an",
"object",
"to",
"register",
"a",
"converter",
"for",
"op",
"with",
"type",
"op_type",
"."
] | def __init__(self, op_type):
"""Creates an object to register a converter for op with type `op_type`."""
self.op_type = op_type | [
"def",
"__init__",
"(",
"self",
",",
"op_type",
")",
":",
"self",
".",
"op_type",
"=",
"op_type"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/parallel_for/pfor.py#L987-L989 | ||
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L881-L883 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBValue.GetObjectDescription | (self) | return _lldb.SBValue_GetObjectDescription(self) | GetObjectDescription(SBValue self) -> char const * | GetObjectDescription(SBValue self) -> char const * | [
"GetObjectDescription",
"(",
"SBValue",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def GetObjectDescription(self):
"""GetObjectDescription(SBValue self) -> char const *"""
return _lldb.SBValue_GetObjectDescription(self) | [
"def",
"GetObjectDescription",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBValue_GetObjectDescription",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14269-L14271 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/calendar.py | python | CalendarCtrlBase.PySetLowerDateLimit | (self, date) | takes datetime.datetime or datetime.date object | takes datetime.datetime or datetime.date object | [
"takes",
"datetime",
".",
"datetime",
"or",
"datetime",
".",
"date",
"object"
] | def PySetLowerDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetLowerDateLimit(_pydate2wxdate(date)) | [
"def",
"PySetLowerDateLimit",
"(",
"self",
",",
"date",
")",
":",
"self",
".",
"SetLowerDateLimit",
"(",
"_pydate2wxdate",
"(",
"date",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L451-L453 | ||
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | python/caffe/net_spec.py | python | Top.to_proto | (self) | return to_proto(self) | Generate a NetParameter that contains all layers needed to compute
this top. | Generate a NetParameter that contains all layers needed to compute
this top. | [
"Generate",
"a",
"NetParameter",
"that",
"contains",
"all",
"layers",
"needed",
"to",
"compute",
"this",
"top",
"."
] | def to_proto(self):
"""Generate a NetParameter that contains all layers needed to compute
this top."""
return to_proto(self) | [
"def",
"to_proto",
"(",
"self",
")",
":",
"return",
"to_proto",
"(",
"self",
")"
] | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/python/caffe/net_spec.py#L86-L90 | |
baoboa/pyqt5 | 11d5f43bc6f213d9d60272f3954a0048569cfc7c | pyuic/uic/__init__.py | python | compileUiDir | (dir, recurse=False, map=None, **compileUi_args) | compileUiDir(dir, recurse=False, map=None, **compileUi_args)
Creates Python modules from Qt Designer .ui files in a directory or
directory tree.
dir is the name of the directory to scan for files whose name ends with
'.ui'. By default the generated Python module is created in the same
directory e... | compileUiDir(dir, recurse=False, map=None, **compileUi_args) | [
"compileUiDir",
"(",
"dir",
"recurse",
"=",
"False",
"map",
"=",
"None",
"**",
"compileUi_args",
")"
] | def compileUiDir(dir, recurse=False, map=None, **compileUi_args):
"""compileUiDir(dir, recurse=False, map=None, **compileUi_args)
Creates Python modules from Qt Designer .ui files in a directory or
directory tree.
dir is the name of the directory to scan for files whose name ends with
'.ui'. By d... | [
"def",
"compileUiDir",
"(",
"dir",
",",
"recurse",
"=",
"False",
",",
"map",
"=",
"None",
",",
"*",
"*",
"compileUi_args",
")",
":",
"import",
"os",
"# Compile a single .ui file.",
"def",
"compile_ui",
"(",
"ui_dir",
",",
"ui_file",
")",
":",
"# Ignore if it... | https://github.com/baoboa/pyqt5/blob/11d5f43bc6f213d9d60272f3954a0048569cfc7c/pyuic/uic/__init__.py#L69-L128 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/confusing-number-ii.py | python | Solution.confusingNumberII | (self, n) | return totalCount(n) - validCountInLessLength(n) - validCountInFullLength(n) | :type n: int
:rtype: int | :type n: int
:rtype: int | [
":",
"type",
"n",
":",
"int",
":",
"rtype",
":",
"int"
] | def confusingNumberII(self, n):
"""
:type n: int
:rtype: int
"""
lookup = {"0":"0", "1":"1", "6":"9", "8":"8", "9":"6"}
centers = {"0":"0", "1":"1", "8":"8"}
def totalCount(n): # count all numbers in the pattern of [01689]{1,len(n)} in the range of [1, n]
... | [
"def",
"confusingNumberII",
"(",
"self",
",",
"n",
")",
":",
"lookup",
"=",
"{",
"\"0\"",
":",
"\"0\"",
",",
"\"1\"",
":",
"\"1\"",
",",
"\"6\"",
":",
"\"9\"",
",",
"\"8\"",
":",
"\"8\"",
",",
"\"9\"",
":",
"\"6\"",
"}",
"centers",
"=",
"{",
"\"0\"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/confusing-number-ii.py#L5-L64 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/mox.py | python | Mox.__init__ | (self) | Initialize a new Mox. | Initialize a new Mox. | [
"Initialize",
"a",
"new",
"Mox",
"."
] | def __init__(self):
"""Initialize a new Mox."""
self._mock_objects = []
self.stubs = stubout.StubOutForTesting() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_mock_objects",
"=",
"[",
"]",
"self",
".",
"stubs",
"=",
"stubout",
".",
"StubOutForTesting",
"(",
")"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/mox.py#L158-L162 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/fields.py | python | guess_content_type | (filename, default="application/octet-stream") | return default | Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Content-Type" can be guessed, default to `default`. | Guess the "Content-Type" of a file. | [
"Guess",
"the",
"Content",
"-",
"Type",
"of",
"a",
"file",
"."
] | def guess_content_type(filename, default="application/octet-stream"):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Content-Type" can be guessed, default to `default`.
"""
if fi... | [
"def",
"guess_content_type",
"(",
"filename",
",",
"default",
"=",
"\"application/octet-stream\"",
")",
":",
"if",
"filename",
":",
"return",
"mimetypes",
".",
"guess_type",
"(",
"filename",
")",
"[",
"0",
"]",
"or",
"default",
"return",
"default"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/fields.py#L10-L21 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/builder_impl.py | python | _add_asset_to_collection | (asset_filename, asset_tensor) | Builds an asset proto and adds it to the asset collection of the graph.
Args:
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to populate the tensor info of the
asset proto. | Builds an asset proto and adds it to the asset collection of the graph. | [
"Builds",
"an",
"asset",
"proto",
"and",
"adds",
"it",
"to",
"the",
"asset",
"collection",
"of",
"the",
"graph",
"."
] | def _add_asset_to_collection(asset_filename, asset_tensor):
"""Builds an asset proto and adds it to the asset collection of the graph.
Args:
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to populate the tensor info of the
asset proto.
"""
asset_proto... | [
"def",
"_add_asset_to_collection",
"(",
"asset_filename",
",",
"asset_tensor",
")",
":",
"asset_proto",
"=",
"meta_graph_pb2",
".",
"AssetFileDef",
"(",
")",
"asset_proto",
".",
"filename",
"=",
"asset_filename",
"asset_proto",
".",
"tensor_info",
".",
"name",
"=",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/builder_impl.py#L777-L791 | ||
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/generators.py | python | construct | (project, name, target_type, prop_set, sources, top_level=False) | return result | Attempts to create target of 'target-type' with 'properties'
from 'sources'. The 'sources' are treated as a collection of
*possible* ingridients -- i.e. it is not required to consume
them all. If 'multiple' is true, the rule is allowed to return
several targets of 'target-type'.
... | Attempts to create target of 'target-type' with 'properties'
from 'sources'. The 'sources' are treated as a collection of
*possible* ingridients -- i.e. it is not required to consume
them all. If 'multiple' is true, the rule is allowed to return
several targets of 'target-type'. | [
"Attempts",
"to",
"create",
"target",
"of",
"target",
"-",
"type",
"with",
"properties",
"from",
"sources",
".",
"The",
"sources",
"are",
"treated",
"as",
"a",
"collection",
"of",
"*",
"possible",
"*",
"ingridients",
"--",
"i",
".",
"e",
".",
"it",
"is",... | def construct (project, name, target_type, prop_set, sources, top_level=False):
""" Attempts to create target of 'target-type' with 'properties'
from 'sources'. The 'sources' are treated as a collection of
*possible* ingridients -- i.e. it is not required to consume
them all. If 'multiple' i... | [
"def",
"construct",
"(",
"project",
",",
"name",
",",
"target_type",
",",
"prop_set",
",",
"sources",
",",
"top_level",
"=",
"False",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/generators.py#L1146-L1201 | |
Yijunmaverick/GenerativeFaceCompletion | f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2 | scripts/cpp_lint.py | python | CheckPosixThreading | (filename, clean_lines, linenum, error) | Checks for calls to thread-unsafe functions.
Much code has been originally written without consideration of
multi-threading. Also, engineers are relying on their old experience;
they have learned posix before threading extensions were added. These
tests guide the engineers to use thread-safe functions (when us... | Checks for calls to thread-unsafe functions. | [
"Checks",
"for",
"calls",
"to",
"thread",
"-",
"unsafe",
"functions",
"."
] | def CheckPosixThreading(filename, clean_lines, linenum, error):
"""Checks for calls to thread-unsafe functions.
Much code has been originally written without consideration of
multi-threading. Also, engineers are relying on their old experience;
they have learned posix before threading extensions were added. Th... | [
"def",
"CheckPosixThreading",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"single_thread_function",
",",
"multithread_safe_function",
"in",
"threading_list",
":... | https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/scripts/cpp_lint.py#L1681-L1705 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/cpplint.py | python | _IncludeState.ResetSection | (self, directive) | Reset section checking for preprocessor directive.
Args:
directive: preprocessor directive (e.g. "if", "else"). | Reset section checking for preprocessor directive. | [
"Reset",
"section",
"checking",
"for",
"preprocessor",
"directive",
"."
] | def ResetSection(self, directive):
"""Reset section checking for preprocessor directive.
Args:
directive: preprocessor directive (e.g. "if", "else").
"""
# The name of the current section.
self._section = self._INITIAL_SECTION
# The path of last found header.
self._last_header = ''
... | [
"def",
"ResetSection",
"(",
"self",
",",
"directive",
")",
":",
"# The name of the current section.",
"self",
".",
"_section",
"=",
"self",
".",
"_INITIAL_SECTION",
"# The path of last found header.",
"self",
".",
"_last_header",
"=",
"''",
"# Update list of includes. No... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L869-L885 | ||
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Iface.check_table_consistency | (self, session, table_id) | Parameters:
- session
- table_id | Parameters:
- session
- table_id | [
"Parameters",
":",
"-",
"session",
"-",
"table_id"
] | def check_table_consistency(self, session, table_id):
"""
Parameters:
- session
- table_id
"""
pass | [
"def",
"check_table_consistency",
"(",
"self",
",",
"session",
",",
"table_id",
")",
":",
"pass"
] | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L763-L770 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/glob.py | python | glob | (pathname, recursive=False) | return list(iglob(pathname, recursive=recursive)) | Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
If recursive is true, the pattern '**' will match any files ... | Return a list of paths matching a pathname pattern. | [
"Return",
"a",
"list",
"of",
"paths",
"matching",
"a",
"pathname",
"pattern",
"."
] | def glob(pathname, recursive=False):
"""Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
If recursive is ... | [
"def",
"glob",
"(",
"pathname",
",",
"recursive",
"=",
"False",
")",
":",
"return",
"list",
"(",
"iglob",
"(",
"pathname",
",",
"recursive",
"=",
"recursive",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/glob.py#L16-L27 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | llvm/utils/benchmark/mingw.py | python | main | () | Invoked when the script is run directly by the python interpreter | Invoked when the script is run directly by the python interpreter | [
"Invoked",
"when",
"the",
"script",
"is",
"run",
"directly",
"by",
"the",
"python",
"interpreter"
] | def main():
'''
Invoked when the script is run directly by the python interpreter
'''
parser = argparse.ArgumentParser(
description = 'Downloads a specific version of MinGW',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument('--location',
help... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Downloads a specific version of MinGW'",
",",
"formatter_class",
"=",
"argparse",
".",
"ArgumentDefaultsHelpFormatter",
")",
"parser",
".",
"add_argument",
"(",
... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/utils/benchmark/mingw.py#L261-L307 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/default_gradient.py | python | get_zeros_dtype | (t) | return t.dtype | Return the dtype for the default gradient for a Tensor. | Return the dtype for the default gradient for a Tensor. | [
"Return",
"the",
"dtype",
"for",
"the",
"default",
"gradient",
"for",
"a",
"Tensor",
"."
] | def get_zeros_dtype(t):
"""Return the dtype for the default gradient for a Tensor."""
if t.dtype == dtypes.resource:
handle_data = resource_variable_ops.get_eager_safe_handle_data(t)
if (handle_data is None or not handle_data.is_set or
len(handle_data.shape_and_type) != 1):
# TODO(srbs): Ideal... | [
"def",
"get_zeros_dtype",
"(",
"t",
")",
":",
"if",
"t",
".",
"dtype",
"==",
"dtypes",
".",
"resource",
":",
"handle_data",
"=",
"resource_variable_ops",
".",
"get_eager_safe_handle_data",
"(",
"t",
")",
"if",
"(",
"handle_data",
"is",
"None",
"or",
"not",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/default_gradient.py#L26-L37 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/wrap_function.py | python | _filter_returned_ops | (fn) | return wrap_and_filter_returned_ops, returned_ops | Filtering out any ops returned by function.
Args:
fn: a function
Returns:
A tuple of (
Wrapped function that returns `None` in place of any ops,
dict that maps the index in the flat output structure to the returned op
) | Filtering out any ops returned by function. | [
"Filtering",
"out",
"any",
"ops",
"returned",
"by",
"function",
"."
] | def _filter_returned_ops(fn):
"""Filtering out any ops returned by function.
Args:
fn: a function
Returns:
A tuple of (
Wrapped function that returns `None` in place of any ops,
dict that maps the index in the flat output structure to the returned op
)
"""
returned_ops = {}
def wr... | [
"def",
"_filter_returned_ops",
"(",
"fn",
")",
":",
"returned_ops",
"=",
"{",
"}",
"def",
"wrap_and_filter_returned_ops",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"outputs",
"=",
"fn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"flat_o... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/wrap_function.py#L364-L388 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeFloat | (self) | return result | Consumes an floating point number.
Returns:
The number parsed.
Raises:
ParseError: If a floating point number couldn't be consumed. | Consumes an floating point number. | [
"Consumes",
"an",
"floating",
"point",
"number",
"."
] | def ConsumeFloat(self):
"""Consumes an floating point number.
Returns:
The number parsed.
Raises:
ParseError: If a floating point number couldn't be consumed.
"""
try:
result = ParseFloat(self.token)
except ValueError, e:
raise self._ParseError(str(e))
self.NextToke... | [
"def",
"ConsumeFloat",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"ParseFloat",
"(",
"self",
".",
"token",
")",
"except",
"ValueError",
",",
"e",
":",
"raise",
"self",
".",
"_ParseError",
"(",
"str",
"(",
"e",
")",
")",
"self",
".",
"NextToken... | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/text_format.py#L625-L639 | |
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | thrift/lib/py/util/__init__.py | python | __map_to_dict | (amap, type_args, defaults: bool=False) | return dict(zip(keys, values)) | Given a python dictionary, potentially containing Thrift Structs, convert it
into a dict
:param amap: a map
:param defaults: return default values
:return: Dict | Given a python dictionary, potentially containing Thrift Structs, convert it
into a dict
:param amap: a map
:param defaults: return default values
:return: Dict | [
"Given",
"a",
"python",
"dictionary",
"potentially",
"containing",
"Thrift",
"Structs",
"convert",
"it",
"into",
"a",
"dict",
":",
"param",
"amap",
":",
"a",
"map",
":",
"param",
"defaults",
":",
"return",
"default",
"values",
":",
"return",
":",
"Dict"
] | def __map_to_dict(amap, type_args, defaults: bool=False):
"""
Given a python dictionary, potentially containing Thrift Structs, convert it
into a dict
:param amap: a map
:param defaults: return default values
:return: Dict
"""
if not amap:
return amap
keys, values = zip(*ama... | [
"def",
"__map_to_dict",
"(",
"amap",
",",
"type_args",
",",
"defaults",
":",
"bool",
"=",
"False",
")",
":",
"if",
"not",
"amap",
":",
"return",
"amap",
"keys",
",",
"values",
"=",
"zip",
"(",
"*",
"amap",
".",
"items",
"(",
")",
")",
"keys",
"=",
... | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/util/__init__.py#L177-L193 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/elemwise.py | python | cos | (x) | return _elwise(x, mode=Elemwise.Mode.COS) | r"""Element-wise `cosine`.
Examples:
.. testcode::
import numpy as np
from megengine import tensor
import megengine.functional as F
x = tensor(np.arange(0, 6, dtype=np.float32).reshape(2, 3))
out = F.cos(x)
print(out.numpy().round(d... | r"""Element-wise `cosine`. | [
"r",
"Element",
"-",
"wise",
"cosine",
"."
] | def cos(x):
r"""Element-wise `cosine`.
Examples:
.. testcode::
import numpy as np
from megengine import tensor
import megengine.functional as F
x = tensor(np.arange(0, 6, dtype=np.float32).reshape(2, 3))
out = F.cos(x)
print(out... | [
"def",
"cos",
"(",
"x",
")",
":",
"return",
"_elwise",
"(",
"x",
",",
"mode",
"=",
"Elemwise",
".",
"Mode",
".",
"COS",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L315-L337 | |
CGRU/cgru | 1881a4128530e3d31ac6c25314c18314fc50c2c7 | afanasy/python/af.py | python | Block.setHostsMask | (self, value) | Missing DocString
:param value:
:return: | Missing DocString | [
"Missing",
"DocString"
] | def setHostsMask(self, value):
"""Missing DocString
:param value:
:return:
"""
if checkRegExp(value):
self.data["hosts_mask"] = value | [
"def",
"setHostsMask",
"(",
"self",
",",
"value",
")",
":",
"if",
"checkRegExp",
"(",
"value",
")",
":",
"self",
".",
"data",
"[",
"\"hosts_mask\"",
"]",
"=",
"value"
] | https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/afanasy/python/af.py#L451-L458 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | PNEANet.IntAttrValueEI | (self, *args) | return _snap.PNEANet_IntAttrValueEI(self, *args) | IntAttrValueEI(PNEANet self, TInt EId, TIntV Values)
Parameters:
EId: TInt const &
Values: TIntV &
IntAttrValueEI(PNEANet self, TInt EId, TStrIntPrH::TIter EdgeHI, TIntV Values)
Parameters:
EId: TInt const &
EdgeHI: TStrIntPrH::TIter
... | IntAttrValueEI(PNEANet self, TInt EId, TIntV Values) | [
"IntAttrValueEI",
"(",
"PNEANet",
"self",
"TInt",
"EId",
"TIntV",
"Values",
")"
] | def IntAttrValueEI(self, *args):
"""
IntAttrValueEI(PNEANet self, TInt EId, TIntV Values)
Parameters:
EId: TInt const &
Values: TIntV &
IntAttrValueEI(PNEANet self, TInt EId, TStrIntPrH::TIter EdgeHI, TIntV Values)
Parameters:
EId: TInt cons... | [
"def",
"IntAttrValueEI",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"PNEANet_IntAttrValueEI",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L23524-L23540 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/bindings/python/clang/cindex.py | python | Token.location | (self) | return conf.lib.clang_getTokenLocation(self._tu, self) | The SourceLocation this Token occurs at. | The SourceLocation this Token occurs at. | [
"The",
"SourceLocation",
"this",
"Token",
"occurs",
"at",
"."
] | def location(self):
"""The SourceLocation this Token occurs at."""
return conf.lib.clang_getTokenLocation(self._tu, self) | [
"def",
"location",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTokenLocation",
"(",
"self",
".",
"_tu",
",",
"self",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L3300-L3302 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.py | python | Decimal.__rmod__ | (self, other, context=None) | return other.__mod__(self, context=context) | Swaps self/other and returns __mod__. | Swaps self/other and returns __mod__. | [
"Swaps",
"self",
"/",
"other",
"and",
"returns",
"__mod__",
"."
] | def __rmod__(self, other, context=None):
"""Swaps self/other and returns __mod__."""
other = _convert_other(other)
if other is NotImplemented:
return other
return other.__mod__(self, context=context) | [
"def",
"__rmod__",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
")",
"if",
"other",
"is",
"NotImplemented",
":",
"return",
"other",
"return",
"other",
".",
"__mod__",
"(",
"self",
",",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L1390-L1395 | |
apache/parquet-cpp | 642da055adf009652689b20e68a198cffb857651 | build-support/cpplint.py | python | FileInfo.IsSource | (self) | return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
"in",
"(",
"'c'",
",",
"'cc'",
",",
"'cpp'",
",",
"'cxx'",
")"
] | https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L1059-L1061 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/linear_model/base.py | python | LinearRegression.residues_ | (self) | return self._residues | Get the residues of the fitted model. | Get the residues of the fitted model. | [
"Get",
"the",
"residues",
"of",
"the",
"fitted",
"model",
"."
] | def residues_(self):
"""Get the residues of the fitted model."""
return self._residues | [
"def",
"residues_",
"(",
"self",
")",
":",
"return",
"self",
".",
"_residues"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/base.py#L483-L485 | |
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | python/caffe/detector.py | python | Detector.configure_crop | (self, context_pad) | Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding.
Parameters
----------
context_pad : amount of context for cropping. | Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding. | [
"Configure",
"crop",
"dimensions",
"and",
"amount",
"of",
"context",
"for",
"cropping",
".",
"If",
"context",
"is",
"included",
"make",
"the",
"special",
"input",
"mean",
"for",
"context",
"padding",
"."
] | def configure_crop(self, context_pad):
"""
Configure crop dimensions and amount of context for cropping.
If context is included, make the special input mean for context padding.
Parameters
----------
context_pad : amount of context for cropping.
"""
# cro... | [
"def",
"configure_crop",
"(",
"self",
",",
"context_pad",
")",
":",
"# crop dimensions",
"in_",
"=",
"self",
".",
"inputs",
"[",
"0",
"]",
"tpose",
"=",
"self",
".",
"transformer",
".",
"transpose",
"[",
"in_",
"]",
"inv_tpose",
"=",
"[",
"tpose",
"[",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/python/caffe/detector.py#L181-L216 | ||
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/ast.py | python | TheoryUnparsedTerm | (location: Location, elements: Sequence[AST]) | return AST(p_ast[0]) | Construct an AST node of type `ASTType.TheoryUnparsedTerm`. | Construct an AST node of type `ASTType.TheoryUnparsedTerm`. | [
"Construct",
"an",
"AST",
"node",
"of",
"type",
"ASTType",
".",
"TheoryUnparsedTerm",
"."
] | def TheoryUnparsedTerm(location: Location, elements: Sequence[AST]) -> AST:
'''
Construct an AST node of type `ASTType.TheoryUnparsedTerm`.
'''
p_ast = _ffi.new('clingo_ast_t**')
c_location = _c_location(location)
_handle_error(_lib.clingo_ast_build(
_lib.clingo_ast_type_theory_unparsed_... | [
"def",
"TheoryUnparsedTerm",
"(",
"location",
":",
"Location",
",",
"elements",
":",
"Sequence",
"[",
"AST",
"]",
")",
"->",
"AST",
":",
"p_ast",
"=",
"_ffi",
".",
"new",
"(",
"'clingo_ast_t**'",
")",
"c_location",
"=",
"_c_location",
"(",
"location",
")",... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/ast.py#L1566-L1577 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_draft2sketch.py | python | Draft2Sketch.proceed | (self) | Proceed with the command if one object was selected. | Proceed with the command if one object was selected. | [
"Proceed",
"with",
"the",
"command",
"if",
"one",
"object",
"was",
"selected",
"."
] | def proceed(self):
"""Proceed with the command if one object was selected."""
sel = Gui.Selection.getSelection()
allSketches = True
allDraft = True
Gui.addModule("Draft")
for obj in sel:
if obj.isDerivedFrom("Sketcher::SketchObject"):
allDraft ... | [
"def",
"proceed",
"(",
"self",
")",
":",
"sel",
"=",
"Gui",
".",
"Selection",
".",
"getSelection",
"(",
")",
"allSketches",
"=",
"True",
"allDraft",
"=",
"True",
"Gui",
".",
"addModule",
"(",
"\"Draft\"",
")",
"for",
"obj",
"in",
"sel",
":",
"if",
"o... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_draft2sketch.py#L73-L145 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/debugger.py | python | Tracer.__init__ | (self, colors=None) | DEPRECATED
Create a local debugger instance.
Parameters
----------
colors : str, optional
The name of the color scheme to use, it must be one of IPython's
valid color schemes. If not given, the function will default to
the current IPython scheme wh... | DEPRECATED | [
"DEPRECATED"
] | def __init__(self, colors=None):
"""
DEPRECATED
Create a local debugger instance.
Parameters
----------
colors : str, optional
The name of the color scheme to use, it must be one of IPython's
valid color schemes. If not given, the function will... | [
"def",
"__init__",
"(",
"self",
",",
"colors",
"=",
"None",
")",
":",
"warnings",
".",
"warn",
"(",
"\"`Tracer` is deprecated since version 5.1, directly use \"",
"\"`IPython.core.debugger.Pdb.set_trace()`\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/debugger.py#L102-L167 | ||
yue/yue | 619d62c191b13c51c01be451dc48917c34a5aefc | building/tools/cpplint.py | python | _SetQuiet | (quiet) | return _cpplint_state.SetQuiet(quiet) | Set the module's quiet status, and return previous setting. | Set the module's quiet status, and return previous setting. | [
"Set",
"the",
"module",
"s",
"quiet",
"status",
"and",
"return",
"previous",
"setting",
"."
] | def _SetQuiet(quiet):
"""Set the module's quiet status, and return previous setting."""
return _cpplint_state.SetQuiet(quiet) | [
"def",
"_SetQuiet",
"(",
"quiet",
")",
":",
"return",
"_cpplint_state",
".",
"SetQuiet",
"(",
"quiet",
")"
] | https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L970-L972 | |
facebook/watchman | 0917460c71b000b96be9b9575d77f06f2f6053bb | watchman/python/pywatchman/__init__.py | python | Transport.write | (self, buf) | write some data | write some data | [
"write",
"some",
"data"
] | def write(self, buf):
"""write some data"""
raise NotImplementedError() | [
"def",
"write",
"(",
"self",
",",
"buf",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/facebook/watchman/blob/0917460c71b000b96be9b9575d77f06f2f6053bb/watchman/python/pywatchman/__init__.py#L220-L222 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | IsStockID | (*args, **kwargs) | return _misc_.IsStockID(*args, **kwargs) | IsStockID(int id) -> bool | IsStockID(int id) -> bool | [
"IsStockID",
"(",
"int",
"id",
")",
"-",
">",
"bool"
] | def IsStockID(*args, **kwargs):
"""IsStockID(int id) -> bool"""
return _misc_.IsStockID(*args, **kwargs) | [
"def",
"IsStockID",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"IsStockID",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L294-L296 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/dateutil/parser.py | python | parser.parse | (self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs) | Parse the date/time string into a :class:`datetime.datetime` object.
:param timestr:
Any date/time string using the supported formats.
:param default:
The default datetime object, if this is a datetime object and not
``None``, elements specified in ``timestr`` repla... | Parse the date/time string into a :class:`datetime.datetime` object. | [
"Parse",
"the",
"date",
"/",
"time",
"string",
"into",
"a",
":",
"class",
":",
"datetime",
".",
"datetime",
"object",
"."
] | def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):
"""
Parse the date/time string into a :class:`datetime.datetime` object.
:param timestr:
Any date/time string using the supported formats.
:param default:
The default datetime object... | [
"def",
"parse",
"(",
"self",
",",
"timestr",
",",
"default",
"=",
"None",
",",
"ignoretz",
"=",
"False",
",",
"tzinfos",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"default",
"is",
"None",
":",
"default",
"=",
"datetime",
".",
"datetime",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/dateutil/parser.py#L489-L615 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py | python | QueueBase.queue_ref | (self) | return self._queue_ref | The underlying queue reference. | The underlying queue reference. | [
"The",
"underlying",
"queue",
"reference",
"."
] | def queue_ref(self):
"""The underlying queue reference."""
return self._queue_ref | [
"def",
"queue_ref",
"(",
"self",
")",
":",
"return",
"self",
".",
"_queue_ref"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L196-L198 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/helper.py | python | vec2tuple | (x) | return (x.x, x.y, x.z) | Converts a VECTOR3D to a Tuple | Converts a VECTOR3D to a Tuple | [
"Converts",
"a",
"VECTOR3D",
"to",
"a",
"Tuple"
] | def vec2tuple(x):
""" Converts a VECTOR3D to a Tuple """
return (x.x, x.y, x.z) | [
"def",
"vec2tuple",
"(",
"x",
")",
":",
"return",
"(",
"x",
".",
"x",
",",
"x",
".",
"y",
",",
"x",
".",
"z",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/helper.py#L55-L57 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/eager/execution_callbacks.py | python | inf_nan_callback | (op_type,
op_name,
attrs,
inputs,
outputs,
check_inf=True,
check_nan=True,
action=_DEFAULT_CALLBACK_ACTION) | An execution callback that checks for `inf`s and `nan`s in output tensors.
This callback can be used with `tfe.add_execute_callback` to check for invalid
numeric values. E.g.,
```python
tfe.add_execute_callback(tfe.inf_nan_callback)
```
Args:
op_type: Name of the TFE operation type (e.g., `MatMul`).
... | An execution callback that checks for `inf`s and `nan`s in output tensors. | [
"An",
"execution",
"callback",
"that",
"checks",
"for",
"inf",
"s",
"and",
"nan",
"s",
"in",
"output",
"tensors",
"."
] | def inf_nan_callback(op_type,
op_name,
attrs,
inputs,
outputs,
check_inf=True,
check_nan=True,
action=_DEFAULT_CALLBACK_ACTION):
"""An execution callback that checks for `... | [
"def",
"inf_nan_callback",
"(",
"op_type",
",",
"op_name",
",",
"attrs",
",",
"inputs",
",",
"outputs",
",",
"check_inf",
"=",
"True",
",",
"check_nan",
"=",
"True",
",",
"action",
"=",
"_DEFAULT_CALLBACK_ACTION",
")",
":",
"del",
"attrs",
",",
"inputs",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/execution_callbacks.py#L105-L185 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py | python | PBXGroup.TakeOverOnlyChild | (self, recurse=False) | If this PBXGroup has only one child and it's also a PBXGroup, take
it over by making all of its children this object's children.
This function will continue to take over only children when those children
are groups. If there are three PBXGroups representing a, b, and c, with
c inside b and b inside a,... | If this PBXGroup has only one child and it's also a PBXGroup, take
it over by making all of its children this object's children. | [
"If",
"this",
"PBXGroup",
"has",
"only",
"one",
"child",
"and",
"it",
"s",
"also",
"a",
"PBXGroup",
"take",
"it",
"over",
"by",
"making",
"all",
"of",
"its",
"children",
"this",
"object",
"s",
"children",
"."
] | def TakeOverOnlyChild(self, recurse=False):
"""If this PBXGroup has only one child and it's also a PBXGroup, take
it over by making all of its children this object's children.
This function will continue to take over only children when those children
are groups. If there are three PBXGroups representi... | [
"def",
"TakeOverOnlyChild",
"(",
"self",
",",
"recurse",
"=",
"False",
")",
":",
"# At this stage, check that child class types are PBXGroup exactly,",
"# instead of using isinstance. The only subclass of PBXGroup,",
"# PBXVariantGroup, should not participate in reparenting in the same way:... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py#L1334-L1402 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiManager.Snap | (self) | Snaps the main frame to specified position on the screen.
:see: :meth:`SnapToScreen` | Snaps the main frame to specified position on the screen. | [
"Snaps",
"the",
"main",
"frame",
"to",
"specified",
"position",
"on",
"the",
"screen",
"."
] | def Snap(self):
"""
Snaps the main frame to specified position on the screen.
:see: :meth:`SnapToScreen`
"""
snap, hAlign, vAlign, monitor = self._is_docked
if not snap:
return
managed_window = self.GetManagedWindow()
snap_pos = self.GetSnap... | [
"def",
"Snap",
"(",
"self",
")",
":",
"snap",
",",
"hAlign",
",",
"vAlign",
",",
"monitor",
"=",
"self",
".",
"_is_docked",
"if",
"not",
"snap",
":",
"return",
"managed_window",
"=",
"self",
".",
"GetManagedWindow",
"(",
")",
"snap_pos",
"=",
"self",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L10413-L10430 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_py_abc.py | python | ABCMeta._dump_registry | (cls, file=None) | Debug helper to print the ABC registry. | Debug helper to print the ABC registry. | [
"Debug",
"helper",
"to",
"print",
"the",
"ABC",
"registry",
"."
] | def _dump_registry(cls, file=None):
"""Debug helper to print the ABC registry."""
print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
print(f"Inv. counter: {get_cache_token()}", file=file)
for name in cls.__dict__:
if name.startswith("_abc_"):
valu... | [
"def",
"_dump_registry",
"(",
"cls",
",",
"file",
"=",
"None",
")",
":",
"print",
"(",
"f\"Class: {cls.__module__}.{cls.__qualname__}\"",
",",
"file",
"=",
"file",
")",
"print",
"(",
"f\"Inv. counter: {get_cache_token()}\"",
",",
"file",
"=",
"file",
")",
"for",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_py_abc.py#L72-L81 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py | python | JitEngine.add_global_mapping | (self, gv, addr) | return self._ee.add_global_mapping(gv, addr) | Override ExecutionEngine.add_global_mapping
to keep info about defined symbols. | Override ExecutionEngine.add_global_mapping
to keep info about defined symbols. | [
"Override",
"ExecutionEngine",
".",
"add_global_mapping",
"to",
"keep",
"info",
"about",
"defined",
"symbols",
"."
] | def add_global_mapping(self, gv, addr):
"""Override ExecutionEngine.add_global_mapping
to keep info about defined symbols.
"""
self._defined_symbols.add(gv.name)
return self._ee.add_global_mapping(gv, addr) | [
"def",
"add_global_mapping",
"(",
"self",
",",
"gv",
",",
"addr",
")",
":",
"self",
".",
"_defined_symbols",
".",
"add",
"(",
"gv",
".",
"name",
")",
"return",
"self",
".",
"_ee",
".",
"add_global_mapping",
"(",
"gv",
",",
"addr",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py#L601-L606 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/tools/grokdump.py | python | InspectionShell.do_list | (self, smth) | List all available memory regions. | List all available memory regions. | [
"List",
"all",
"available",
"memory",
"regions",
"."
] | def do_list(self, smth):
"""
List all available memory regions.
"""
def print_region(reader, start, size, location):
print(" %s - %s (%d bytes)" % (reader.FormatIntPtr(start),
reader.FormatIntPtr(start + size),
size))
... | [
"def",
"do_list",
"(",
"self",
",",
"smth",
")",
":",
"def",
"print_region",
"(",
"reader",
",",
"start",
",",
"size",
",",
"location",
")",
":",
"print",
"(",
"\" %s - %s (%d bytes)\"",
"%",
"(",
"reader",
".",
"FormatIntPtr",
"(",
"start",
")",
",",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/tools/grokdump.py#L3674-L3683 | ||
lmb-freiburg/flownet2 | b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc | scripts/cpp_lint.py | python | Search | (pattern, s) | return _regexp_compile_cache[pattern].search(s) | Searches the string for the pattern, caching the compiled regexp. | Searches the string for the pattern, caching the compiled regexp. | [
"Searches",
"the",
"string",
"for",
"the",
"pattern",
"caching",
"the",
"compiled",
"regexp",
"."
] | def Search(pattern, s):
"""Searches the string for the pattern, caching the compiled regexp."""
if pattern not in _regexp_compile_cache:
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
return _regexp_compile_cache[pattern].search(s) | [
"def",
"Search",
"(",
"pattern",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_cache",
"[",
"pat... | https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L543-L547 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.