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
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
components/policy/tools/syntax_check_policy_template_json.py
python
PolicyTemplateChecker._CheckPolicyIDs
(self, policy_ids)
Checks a set of policy_ids to make sure it contains a continuous range of entries (i.e. no holes). Holes would not be a technical problem, but we want to ensure that nobody accidentally omits IDs.
Checks a set of policy_ids to make sure it contains a continuous range of entries (i.e. no holes). Holes would not be a technical problem, but we want to ensure that nobody accidentally omits IDs.
[ "Checks", "a", "set", "of", "policy_ids", "to", "make", "sure", "it", "contains", "a", "continuous", "range", "of", "entries", "(", "i", ".", "e", ".", "no", "holes", ")", ".", "Holes", "would", "not", "be", "a", "technical", "problem", "but", "we", ...
def _CheckPolicyIDs(self, policy_ids): ''' Checks a set of policy_ids to make sure it contains a continuous range of entries (i.e. no holes). Holes would not be a technical problem, but we want to ensure that nobody accidentally omits IDs. ''' for i in range(len(policy_ids)): if (i + 1...
[ "def", "_CheckPolicyIDs", "(", "self", ",", "policy_ids", ")", ":", "for", "i", "in", "range", "(", "len", "(", "policy_ids", ")", ")", ":", "if", "(", "i", "+", "1", ")", "not", "in", "policy_ids", ":", "self", ".", "_Error", "(", "'No policy with i...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/components/policy/tools/syntax_check_policy_template_json.py#L136-L145
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/linalg/decomp.py
python
eigvalsh_tridiagonal
(d, e, select='a', select_range=None, check_finite=True, tol=0., lapack_driver='auto')
return eigh_tridiagonal( d, e, eigvals_only=True, select=select, select_range=select_range, check_finite=check_finite, tol=tol, lapack_driver=lapack_driver)
Solve eigenvalue problem for a real symmetric tridiagonal matrix. Find eigenvalues `w` of ``a``:: a v[:,i] = w[i] v[:,i] v.H v = identity For a real symmetric matrix ``a`` with diagonal elements `d` and off-diagonal elements `e`. Parameters ---------- d : ndarray, shape (n...
Solve eigenvalue problem for a real symmetric tridiagonal matrix.
[ "Solve", "eigenvalue", "problem", "for", "a", "real", "symmetric", "tridiagonal", "matrix", "." ]
def eigvalsh_tridiagonal(d, e, select='a', select_range=None, check_finite=True, tol=0., lapack_driver='auto'): """ Solve eigenvalue problem for a real symmetric tridiagonal matrix. Find eigenvalues `w` of ``a``:: a v[:,i] = w[i] v[:,i] v.H v = identity For...
[ "def", "eigvalsh_tridiagonal", "(", "d", ",", "e", ",", "select", "=", "'a'", ",", "select_range", "=", "None", ",", "check_finite", "=", "True", ",", "tol", "=", "0.", ",", "lapack_driver", "=", "'auto'", ")", ":", "return", "eigh_tridiagonal", "(", "d"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/decomp.py#L956-L1033
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/ui/gui.py
python
GUI.arrow_field
(self, direction, radius=1, color=0xffffff, bound=0.5, **kwargs)
Draw a field of arrows on canvas. Args: direction (np.array): The pattern and direction of the field of arrows. color (Union[int, np.array], optional): The color or colors of arrows. Default is 0xFFFFFF. bound (Number, optional): The boundary of the field. De...
Draw a field of arrows on canvas.
[ "Draw", "a", "field", "of", "arrows", "on", "canvas", "." ]
def arrow_field(self, direction, radius=1, color=0xffffff, bound=0.5, **kwargs): """Draw a field of arrows on canvas. Args: direction (np.array): The pattern and direction of the field of arr...
[ "def", "arrow_field", "(", "self", ",", "direction", ",", "radius", "=", "1", ",", "color", "=", "0xffffff", ",", "bound", "=", "0.5", ",", "*", "*", "kwargs", ")", ":", "assert", "len", "(", "direction", ".", "shape", ")", "==", "3", "assert", "di...
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/ui/gui.py#L648-L669
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PropertyGrid.GetMarginColour
(*args, **kwargs)
return _propgrid.PropertyGrid_GetMarginColour(*args, **kwargs)
GetMarginColour(self) -> Colour
GetMarginColour(self) -> Colour
[ "GetMarginColour", "(", "self", ")", "-", ">", "Colour" ]
def GetMarginColour(*args, **kwargs): """GetMarginColour(self) -> Colour""" return _propgrid.PropertyGrid_GetMarginColour(*args, **kwargs)
[ "def", "GetMarginColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GetMarginColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2106-L2108
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/gather/chrome_scaled_image.py
python
_MakeBraceGlob
(strings)
Given ['foo', 'bar'], return '{foo,bar}', for error reporting.
Given ['foo', 'bar'], return '{foo,bar}', for error reporting.
[ "Given", "[", "foo", "bar", "]", "return", "{", "foo", "bar", "}", "for", "error", "reporting", "." ]
def _MakeBraceGlob(strings): '''Given ['foo', 'bar'], return '{foo,bar}', for error reporting. ''' if len(strings) == 1: return strings[0] else: return '{' + ','.join(strings) + '}'
[ "def", "_MakeBraceGlob", "(", "strings", ")", ":", "if", "len", "(", "strings", ")", "==", "1", ":", "return", "strings", "[", "0", "]", "else", ":", "return", "'{'", "+", "','", ".", "join", "(", "strings", ")", "+", "'}'" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/gather/chrome_scaled_image.py#L77-L83
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_view.py
python
GeneralFittingView.set_slot_for_simultaneous_fit_by_specifier_changed
(self, slot)
Connect the slot for the fit specifier combo box being changed.
Connect the slot for the fit specifier combo box being changed.
[ "Connect", "the", "slot", "for", "the", "fit", "specifier", "combo", "box", "being", "changed", "." ]
def set_slot_for_simultaneous_fit_by_specifier_changed(self, slot) -> None: """Connect the slot for the fit specifier combo box being changed.""" self.general_fitting_options.set_slot_for_simultaneous_fit_by_specifier_changed(slot)
[ "def", "set_slot_for_simultaneous_fit_by_specifier_changed", "(", "self", ",", "slot", ")", "->", "None", ":", "self", ".", "general_fitting_options", ".", "set_slot_for_simultaneous_fit_by_specifier_changed", "(", "slot", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_view.py#L38-L40
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBSourceManager.DisplaySourceLinesWithLineNumbers
(self, *args)
return _lldb.SBSourceManager_DisplaySourceLinesWithLineNumbers(self, *args)
DisplaySourceLinesWithLineNumbers(self, SBFileSpec file, uint32_t line, uint32_t context_before, uint32_t context_after, str current_line_cstr, SBStream s) -> size_t
DisplaySourceLinesWithLineNumbers(self, SBFileSpec file, uint32_t line, uint32_t context_before, uint32_t context_after, str current_line_cstr, SBStream s) -> size_t
[ "DisplaySourceLinesWithLineNumbers", "(", "self", "SBFileSpec", "file", "uint32_t", "line", "uint32_t", "context_before", "uint32_t", "context_after", "str", "current_line_cstr", "SBStream", "s", ")", "-", ">", "size_t" ]
def DisplaySourceLinesWithLineNumbers(self, *args): """ DisplaySourceLinesWithLineNumbers(self, SBFileSpec file, uint32_t line, uint32_t context_before, uint32_t context_after, str current_line_cstr, SBStream s) -> size_t """ return _lldb.SBSourceManager_Display...
[ "def", "DisplaySourceLinesWithLineNumbers", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBSourceManager_DisplaySourceLinesWithLineNumbers", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7855-L7861
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.AdjustIncludeDirs
(self, include_dirs, config)
return [self.ConvertVSMacros(p, config=config) for p in includes]
Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.
Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.
[ "Updates", "include_dirs", "to", "expand", "VS", "specific", "paths", "and", "adds", "the", "system", "include", "dirs", "used", "for", "platform", "SDK", "and", "similar", "." ]
def AdjustIncludeDirs(self, include_dirs, config): """Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" config = self._TargetConfig(config) includes = include_dirs + self.msvs_system_include_dirs[config] includes.extend(self._Set...
[ "def", "AdjustIncludeDirs", "(", "self", ",", "include_dirs", ",", "config", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "includes", "=", "include_dirs", "+", "self", ".", "msvs_system_include_dirs", "[", "config", "]", "includes...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/msvs_emulation.py#L332-L339
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/protobuf/python/google/protobuf/internal/python_message.py
python
_AddSlots
(message_descriptor, dictionary)
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry.
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type.
[ "Adds", "a", "__slots__", "entry", "to", "dictionary", "containing", "the", "names", "of", "all", "valid", "attributes", "for", "this", "message", "type", "." ]
def _AddSlots(message_descriptor, dictionary): """Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry. ...
[ "def", "_AddSlots", "(", "message_descriptor", ",", "dictionary", ")", ":", "dictionary", "[", "'__slots__'", "]", "=", "[", "'_cached_byte_size'", ",", "'_cached_byte_size_dirty'", ",", "'_fields'", ",", "'_unknown_fields'", ",", "'_is_present_in_parent'", ",", "'_li...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/internal/python_message.py#L164-L179
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L1130-L1142
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/devil/devil/android/sdk/adb_wrapper.py
python
AdbWrapper.Pull
(self, remote, local, timeout=60 * 5, retries=DEFAULT_RETRIES)
Pulls a file from the device to the host. Args: remote: Path on the device filesystem. local: Path on the host filesystem. timeout: (optional) Timeout per try in seconds. retries: (optional) Number of retries to attempt.
Pulls a file from the device to the host.
[ "Pulls", "a", "file", "from", "the", "device", "to", "the", "host", "." ]
def Pull(self, remote, local, timeout=60 * 5, retries=DEFAULT_RETRIES): """Pulls a file from the device to the host. Args: remote: Path on the device filesystem. local: Path on the host filesystem. timeout: (optional) Timeout per try in seconds. retries: (optional) Number of retries to ...
[ "def", "Pull", "(", "self", ",", "remote", ",", "local", ",", "timeout", "=", "60", "*", "5", ",", "retries", "=", "DEFAULT_RETRIES", ")", ":", "cmd", "=", "[", "'pull'", ",", "remote", ",", "local", "]", "self", ".", "_RunDeviceAdbCmd", "(", "cmd", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/sdk/adb_wrapper.py#L437-L452
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/json_format.py
python
_ListValueMessageToJsonObject
(message, unused_including_default=False)
return [_ValueMessageToJsonObject(value) for value in message.values]
Converts ListValue message according to Proto3 JSON Specification.
Converts ListValue message according to Proto3 JSON Specification.
[ "Converts", "ListValue", "message", "according", "to", "Proto3", "JSON", "Specification", "." ]
def _ListValueMessageToJsonObject(message, unused_including_default=False): """Converts ListValue message according to Proto3 JSON Specification.""" return [_ValueMessageToJsonObject(value) for value in message.values]
[ "def", "_ListValueMessageToJsonObject", "(", "message", ",", "unused_including_default", "=", "False", ")", ":", "return", "[", "_ValueMessageToJsonObject", "(", "value", ")", "for", "value", "in", "message", ".", "values", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/json_format.py#L265-L268
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
tutorials/roofit/rf401_importttreethx.py
python
makeTTree
()
return tree
Create ROOT ROOT.TTree filled with a Gaussian distribution in x and a uniform distribution in y.
Create ROOT ROOT.TTree filled with a Gaussian distribution in x and a uniform distribution in y.
[ "Create", "ROOT", "ROOT", ".", "TTree", "filled", "with", "a", "Gaussian", "distribution", "in", "x", "and", "a", "uniform", "distribution", "in", "y", "." ]
def makeTTree(): """Create ROOT ROOT.TTree filled with a Gaussian distribution in x and a uniform distribution in y.""" tree = ROOT.TTree("tree", "tree") px = array("d", [0]) py = array("d", [0]) pz = array("d", [0]) pi = array("i", [0]) tree.Branch("x", px, "x/D") tree.Branch("y", py, ...
[ "def", "makeTTree", "(", ")", ":", "tree", "=", "ROOT", ".", "TTree", "(", "\"tree\"", ",", "\"tree\"", ")", "px", "=", "array", "(", "\"d\"", ",", "[", "0", "]", ")", "py", "=", "array", "(", "\"d\"", ",", "[", "0", "]", ")", "pz", "=", "arr...
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/tutorials/roofit/rf401_importttreethx.py#L30-L49
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/third_party/abseil-cpp/create_lts.py
python
ReplaceStringsInFile
(filename, replacement_dict)
Performs textual replacements in a file. Rewrites filename with the keys in replacement_dict replaced with their values. This function assumes the file can fit in memory. Args: filename: the filename to perform the replacement on replacement_dict: a dictionary of key strings to be replaced with their ...
Performs textual replacements in a file.
[ "Performs", "textual", "replacements", "in", "a", "file", "." ]
def ReplaceStringsInFile(filename, replacement_dict): """Performs textual replacements in a file. Rewrites filename with the keys in replacement_dict replaced with their values. This function assumes the file can fit in memory. Args: filename: the filename to perform the replacement on replacement_dic...
[ "def", "ReplaceStringsInFile", "(", "filename", ",", "replacement_dict", ")", ":", "f", "=", "open", "(", "filename", ",", "'r'", ")", "content", "=", "f", ".", "read", "(", ")", "f", ".", "close", "(", ")", "for", "key", ",", "value", "in", "replace...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/abseil-cpp/create_lts.py#L24-L50
assimp/assimp
97c7e084c2f7f8c9355ea42f73605890481bddc5
port/PyAssimp/scripts/transformations.py
python
Arcball.matrix
(self)
return quaternion_matrix(self._qnow)
Return homogeneous rotation matrix.
Return homogeneous rotation matrix.
[ "Return", "homogeneous", "rotation", "matrix", "." ]
def matrix(self): """Return homogeneous rotation matrix.""" return quaternion_matrix(self._qnow)
[ "def", "matrix", "(", "self", ")", ":", "return", "quaternion_matrix", "(", "self", ".", "_qnow", ")" ]
https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/transformations.py#L1467-L1469
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlPrintout.CleanUpStatics
(*args, **kwargs)
return _html.HtmlPrintout_CleanUpStatics(*args, **kwargs)
CleanUpStatics()
CleanUpStatics()
[ "CleanUpStatics", "()" ]
def CleanUpStatics(*args, **kwargs): """CleanUpStatics()""" return _html.HtmlPrintout_CleanUpStatics(*args, **kwargs)
[ "def", "CleanUpStatics", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlPrintout_CleanUpStatics", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1312-L1314
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/generate_stubs/generate_stubs.py
python
PosixStubWriter.WriteImplementationContents
(self, namespace, outfile)
Given a file handle, write out the stub definitions for this module. Args: namespace: The namespace these functions should be in. outfile: The file handle to populate.
Given a file handle, write out the stub definitions for this module.
[ "Given", "a", "file", "handle", "write", "out", "the", "stub", "definitions", "for", "this", "module", "." ]
def WriteImplementationContents(self, namespace, outfile): """Given a file handle, write out the stub definitions for this module. Args: namespace: The namespace these functions should be in. outfile: The file handle to populate. """ outfile.write(IMPLEMENTATION_CONTENTS_C_START) self.W...
[ "def", "WriteImplementationContents", "(", "self", ",", "namespace", ",", "outfile", ")", ":", "outfile", ".", "write", "(", "IMPLEMENTATION_CONTENTS_C_START", ")", "self", ".", "WriteFunctionPointers", "(", "outfile", ")", "self", ".", "WriteStubFunctions", "(", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/generate_stubs/generate_stubs.py#L765-L779
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/functional/elemwise.py
python
acosh
(x)
return log(x + (x ** 2 - 1) ** 0.5)
r"""Element-wise `inverse hyperbolic cosine`.
r"""Element-wise `inverse hyperbolic cosine`.
[ "r", "Element", "-", "wise", "inverse", "hyperbolic", "cosine", "." ]
def acosh(x): r"""Element-wise `inverse hyperbolic cosine`.""" return log(x + (x ** 2 - 1) ** 0.5)
[ "def", "acosh", "(", "x", ")", ":", "return", "log", "(", "x", "+", "(", "x", "**", "2", "-", "1", ")", "**", "0.5", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L391-L393
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/m5/ext/pyfdt/pyfdt.py
python
FdtPropertyBytes.dtb_represent
(self, string_store, pos=0, version=17)
return (blob, string_store, pos)
Get blob representation
Get blob representation
[ "Get", "blob", "representation" ]
def dtb_represent(self, string_store, pos=0, version=17): """Get blob representation""" # print "%x:%s" % (pos, self) strpos = string_store.find(self.name+'\0') if strpos < 0: strpos = len(string_store) string_store += self.name+'\0' blob = pack('>III', FD...
[ "def", "dtb_represent", "(", "self", ",", "string_store", ",", "pos", "=", "0", ",", "version", "=", "17", ")", ":", "# print \"%x:%s\" % (pos, self)", "strpos", "=", "string_store", ".", "find", "(", "self", ".", "name", "+", "'\\0'", ")", "if", "strpos",...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/ext/pyfdt/pyfdt.py#L350-L362
nginnever/zogminer
3c2bc925c833d57c758872e747d5d51fd7185611
share/qt/extract_strings_qt.py
python
parse_po
(text)
return messages
Parse 'po' format produced by xgettext. Return a list of (msgid,msgstr) tuples.
Parse 'po' format produced by xgettext. Return a list of (msgid,msgstr) tuples.
[ "Parse", "po", "format", "produced", "by", "xgettext", ".", "Return", "a", "list", "of", "(", "msgid", "msgstr", ")", "tuples", "." ]
def parse_po(text): """ Parse 'po' format produced by xgettext. Return a list of (msgid,msgstr) tuples. """ messages = [] msgid = [] msgstr = [] in_msgid = False in_msgstr = False for line in text.split('\n'): line = line.rstrip('\r') if line.startswith('msgid ')...
[ "def", "parse_po", "(", "text", ")", ":", "messages", "=", "[", "]", "msgid", "=", "[", "]", "msgstr", "=", "[", "]", "in_msgid", "=", "False", "in_msgstr", "=", "False", "for", "line", "in", "text", ".", "split", "(", "'\\n'", ")", ":", "line", ...
https://github.com/nginnever/zogminer/blob/3c2bc925c833d57c758872e747d5d51fd7185611/share/qt/extract_strings_qt.py#L15-L49
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/base.py
python
IndexOpsMixin._reduce
( self, op, name, axis=0, skipna=True, numeric_only=None, filter_type=None, **kwds )
return func(skipna=skipna, **kwds)
perform the reduction type operation if we can
perform the reduction type operation if we can
[ "perform", "the", "reduction", "type", "operation", "if", "we", "can" ]
def _reduce( self, op, name, axis=0, skipna=True, numeric_only=None, filter_type=None, **kwds ): """ perform the reduction type operation if we can """ func = getattr(self, name, None) if func is None: raise TypeError( f"{type(self).__name__} cannot perfor...
[ "def", "_reduce", "(", "self", ",", "op", ",", "name", ",", "axis", "=", "0", ",", "skipna", "=", "True", ",", "numeric_only", "=", "None", ",", "filter_type", "=", "None", ",", "*", "*", "kwds", ")", ":", "func", "=", "getattr", "(", "self", ","...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/base.py#L1053-L1062
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/nn_impl.py
python
nce_loss
(weights, biases, labels, inputs, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=False, partition_strategy="mod", name="nce_loss")
return _sum_rows(sampled_losses)
Computes and returns the noise-contrastive estimation training loss. See [Noise-contrastive estimation: A new estimation principle for unnormalized statistical models](http://www.jmlr.org/proceedings/papers/v9/gutmann10a/gutmann10a.pdf). Also see our [Candidate Sampling Algorithms Reference](https://www.tens...
Computes and returns the noise-contrastive estimation training loss.
[ "Computes", "and", "returns", "the", "noise", "-", "contrastive", "estimation", "training", "loss", "." ]
def nce_loss(weights, biases, labels, inputs, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=False, partition_strategy="mod", name="nce_loss"): """Comput...
[ "def", "nce_loss", "(", "weights", ",", "biases", ",", "labels", ",", "inputs", ",", "num_sampled", ",", "num_classes", ",", "num_true", "=", "1", ",", "sampled_values", "=", "None", ",", "remove_accidental_hits", "=", "False", ",", "partition_strategy", "=", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/nn_impl.py#L1051-L1156
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/signal/ltisys.py
python
dlti.output
(self, u, t, x0=None)
return dlsim(self, u, t, x0=x0)
Return the response of the discrete-time system to input `u`. See `dlsim` for details.
Return the response of the discrete-time system to input `u`. See `dlsim` for details.
[ "Return", "the", "response", "of", "the", "discrete", "-", "time", "system", "to", "input", "u", ".", "See", "dlsim", "for", "details", "." ]
def output(self, u, t, x0=None): """ Return the response of the discrete-time system to input `u`. See `dlsim` for details. """ return dlsim(self, u, t, x0=x0)
[ "def", "output", "(", "self", ",", "u", ",", "t", ",", "x0", "=", "None", ")", ":", "return", "dlsim", "(", "self", ",", "u", ",", "t", ",", "x0", "=", "x0", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L603-L608
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
pythonCleanupParser
()
Cleanup function for the XML library. It tries to reclaim all parsing related global memory allocated for the library processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the library but one should call xmlCleanupParser() only when...
Cleanup function for the XML library. It tries to reclaim all parsing related global memory allocated for the library processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the library but one should call xmlCleanupParser() only when...
[ "Cleanup", "function", "for", "the", "XML", "library", ".", "It", "tries", "to", "reclaim", "all", "parsing", "related", "global", "memory", "allocated", "for", "the", "library", "processing", ".", "It", "doesn", "t", "deallocate", "any", "document", "related"...
def pythonCleanupParser(): """Cleanup function for the XML library. It tries to reclaim all parsing related global memory allocated for the library processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the library but one should call ...
[ "def", "pythonCleanupParser", "(", ")", ":", "libxml2mod", ".", "xmlPythonCleanupParser", "(", ")" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L1558-L1566
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/third_party/jinja2/sandbox.py
python
SandboxedEnvironment.unsafe_undefined
(self, obj, attribute)
return self.undefined('access to attribute %r of %r ' 'object is unsafe.' % ( attribute, obj.__class__.__name__ ), name=attribute, obj=obj, exc=SecurityError)
Return an undefined object for unsafe attributes.
Return an undefined object for unsafe attributes.
[ "Return", "an", "undefined", "object", "for", "unsafe", "attributes", "." ]
def unsafe_undefined(self, obj, attribute): """Return an undefined object for unsafe attributes.""" return self.undefined('access to attribute %r of %r ' 'object is unsafe.' % ( attribute, obj.__class__.__name__ ), name=attribute, obj=obj, ex...
[ "def", "unsafe_undefined", "(", "self", ",", "obj", ",", "attribute", ")", ":", "return", "self", ".", "undefined", "(", "'access to attribute %r of %r '", "'object is unsafe.'", "%", "(", "attribute", ",", "obj", ".", "__class__", ".", "__name__", ")", ",", "...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/sandbox.py#L341-L347
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/ssl_support.py
python
find_ca_bundle
()
return ( get_win_certfile() or next(extant_cert_paths, None) or _certifi_where() )
Return an existing CA bundle path, or None
Return an existing CA bundle path, or None
[ "Return", "an", "existing", "CA", "bundle", "path", "or", "None" ]
def find_ca_bundle(): """Return an existing CA bundle path, or None""" extant_cert_paths = filter(os.path.isfile, cert_paths) return ( get_win_certfile() or next(extant_cert_paths, None) or _certifi_where() )
[ "def", "find_ca_bundle", "(", ")", ":", "extant_cert_paths", "=", "filter", "(", "os", ".", "path", ".", "isfile", ",", "cert_paths", ")", "return", "(", "get_win_certfile", "(", ")", "or", "next", "(", "extant_cert_paths", ",", "None", ")", "or", "_certif...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/ssl_support.py#L246-L253
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/bots/bluechip_bridge.py
python
BlueChipBridgeBot.step
(self, state)
Returns an action for the given state.
Returns an action for the given state.
[ "Returns", "an", "action", "for", "the", "given", "state", "." ]
def step(self, state): """Returns an action for the given state.""" # Bring the external bot up-to-date. self.inform_state(state) # If we're on a new trick, tell the bot it is its turn. if self.is_play_phase and self.cards_played % 4 == 0: self._controller.send_line(_PLAYER_TO_LEAD.format(sea...
[ "def", "step", "(", "self", ",", "state", ")", ":", "# Bring the external bot up-to-date.", "self", ".", "inform_state", "(", "state", ")", "# If we're on a new trick, tell the bot it is its turn.", "if", "self", ".", "is_play_phase", "and", "self", ".", "cards_played",...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/bots/bluechip_bridge.py#L323-L344
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect.__iadd__
(*args, **kwargs)
return _core_.Rect___iadd__(*args, **kwargs)
__iadd__(self, Rect rect) -> Rect Add the properties of rect to this rectangle, updating this rectangle.
__iadd__(self, Rect rect) -> Rect
[ "__iadd__", "(", "self", "Rect", "rect", ")", "-", ">", "Rect" ]
def __iadd__(*args, **kwargs): """ __iadd__(self, Rect rect) -> Rect Add the properties of rect to this rectangle, updating this rectangle. """ return _core_.Rect___iadd__(*args, **kwargs)
[ "def", "__iadd__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect___iadd__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1493-L1499
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/Paste/paste/wsgiwrappers.py
python
WSGIRequest.urlvars
(self)
Return any variables matched in the URL (e.g., ``wsgiorg.routing_args``).
Return any variables matched in the URL (e.g., ``wsgiorg.routing_args``).
[ "Return", "any", "variables", "matched", "in", "the", "URL", "(", "e", ".", "g", ".", "wsgiorg", ".", "routing_args", ")", "." ]
def urlvars(self): """ Return any variables matched in the URL (e.g., ``wsgiorg.routing_args``). """ if 'paste.urlvars' in self.environ: return self.environ['paste.urlvars'] elif 'wsgiorg.routing_args' in self.environ: return self.environ['wsgiorg....
[ "def", "urlvars", "(", "self", ")", ":", "if", "'paste.urlvars'", "in", "self", ".", "environ", ":", "return", "self", ".", "environ", "[", "'paste.urlvars'", "]", "elif", "'wsgiorg.routing_args'", "in", "self", ".", "environ", ":", "return", "self", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/wsgiwrappers.py#L135-L145
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/asn1.py
python
DerSequence.decode
(self, der_encoded, strict=False, nr_elements=None, only_ints_expected=False)
return result
Decode a complete DER SEQUENCE, and re-initializes this object with it. Args: der_encoded (byte string): A complete SEQUENCE DER element. nr_elements (None or integer or list of integers): The number of members ...
Decode a complete DER SEQUENCE, and re-initializes this object with it.
[ "Decode", "a", "complete", "DER", "SEQUENCE", "and", "re", "-", "initializes", "this", "object", "with", "it", "." ]
def decode(self, der_encoded, strict=False, nr_elements=None, only_ints_expected=False): """Decode a complete DER SEQUENCE, and re-initializes this object with it. Args: der_encoded (byte string): A complete SEQUENCE DER element. ...
[ "def", "decode", "(", "self", ",", "der_encoded", ",", "strict", "=", "False", ",", "nr_elements", "=", "None", ",", "only_ints_expected", "=", "False", ")", ":", "self", ".", "_nr_elements", "=", "nr_elements", "result", "=", "DerObject", ".", "decode", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/asn1.py#L480-L507
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pathlib2/pathlib2/__init__.py
python
Path.is_char_device
(self)
Whether this path is a character device.
Whether this path is a character device.
[ "Whether", "this", "path", "is", "a", "character", "device", "." ]
def is_char_device(self): """ Whether this path is a character device. """ try: return S_ISCHR(self.stat().st_mode) except OSError as e: if not _ignore_error(e): raise # Path doesn't exist or is a broken symlink # (s...
[ "def", "is_char_device", "(", "self", ")", ":", "try", ":", "return", "S_ISCHR", "(", "self", ".", "stat", "(", ")", ".", "st_mode", ")", "except", "OSError", "as", "e", ":", "if", "not", "_ignore_error", "(", "e", ")", ":", "raise", "# Path doesn't ex...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pathlib2/pathlib2/__init__.py#L1737-L1751
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
tools/shared.py
python
print_compiler_stage
(cmd)
Emulate the '-v' of clang/gcc by printing the name of the sub-command before executing it.
Emulate the '-v' of clang/gcc by printing the name of the sub-command before executing it.
[ "Emulate", "the", "-", "v", "of", "clang", "/", "gcc", "by", "printing", "the", "name", "of", "the", "sub", "-", "command", "before", "executing", "it", "." ]
def print_compiler_stage(cmd): """Emulate the '-v' of clang/gcc by printing the name of the sub-command before executing it.""" if PRINT_STAGES: print(' "%s" %s' % (cmd[0], shlex_join(cmd[1:])), file=sys.stderr) sys.stderr.flush()
[ "def", "print_compiler_stage", "(", "cmd", ")", ":", "if", "PRINT_STAGES", ":", "print", "(", "' \"%s\" %s'", "%", "(", "cmd", "[", "0", "]", ",", "shlex_join", "(", "cmd", "[", "1", ":", "]", ")", ")", ",", "file", "=", "sys", ".", "stderr", ")", ...
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/tools/shared.py#L540-L545
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/viewer/pv/show3d.py
python
Show3D._signalHandler
(self, sig, frame=None)
Stop the GUI on CTRL-C, but not the script it was called from. from: https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python
Stop the GUI on CTRL-C, but not the script it was called from. from: https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python
[ "Stop", "the", "GUI", "on", "CTRL", "-", "C", "but", "not", "the", "script", "it", "was", "called", "from", ".", "from", ":", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "1112343", "/", "how", "-", "do", "-", "i", "-", ...
def _signalHandler(self, sig, frame=None): """ Stop the GUI on CTRL-C, but not the script it was called from. from: https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python """ sys.stderr.write('\r') self._app.quit()
[ "def", "_signalHandler", "(", "self", ",", "sig", ",", "frame", "=", "None", ")", ":", "sys", ".", "stderr", ".", "write", "(", "'\\r'", ")", "self", ".", "_app", ".", "quit", "(", ")" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/viewer/pv/show3d.py#L58-L64
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/gluon/probability/distributions/distribution.py
python
Distribution.sample_n
(self, size)
r""" Generate samples of (n + parameter_shape) from the distribution.
r""" Generate samples of (n + parameter_shape) from the distribution.
[ "r", "Generate", "samples", "of", "(", "n", "+", "parameter_shape", ")", "from", "the", "distribution", "." ]
def sample_n(self, size): r""" Generate samples of (n + parameter_shape) from the distribution. """ raise NotImplementedError
[ "def", "sample_n", "(", "self", ",", "size", ")", ":", "raise", "NotImplementedError" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/probability/distributions/distribution.py#L96-L100
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/rsa/rsa/_version133.py
python
gen_pubpriv_keys
(nbits)
return ( {'e': e, 'n': p*q}, {'d': d, 'p': p, 'q': q} )
Generates public and private keys, and returns them as (pub, priv). The public key consists of a dict {e: ..., , n: ....). The private key consists of a dict {d: ...., p: ...., q: ....).
Generates public and private keys, and returns them as (pub, priv).
[ "Generates", "public", "and", "private", "keys", "and", "returns", "them", "as", "(", "pub", "priv", ")", "." ]
def gen_pubpriv_keys(nbits): """Generates public and private keys, and returns them as (pub, priv). The public key consists of a dict {e: ..., , n: ....). The private key consists of a dict {d: ...., p: ...., q: ....). """ (p, q, e, d) = gen_keys(nbits) return ( {'e': e, 'n': p*q}, {'...
[ "def", "gen_pubpriv_keys", "(", "nbits", ")", ":", "(", "p", ",", "q", ",", "e", ",", "d", ")", "=", "gen_keys", "(", "nbits", ")", "return", "(", "{", "'e'", ":", "e", ",", "'n'", ":", "p", "*", "q", "}", ",", "{", "'d'", ":", "d", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/_version133.py#L317-L327
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__eq__
(self, other)
return other == self._values
Compares the current instance with another one.
Compares the current instance with another one.
[ "Compares", "the", "current", "instance", "with", "another", "one", "." ]
def __eq__(self, other): """Compares the current instance with another one.""" if self is other: return True # Special case for the same type which should be common and fast. if isinstance(other, self.__class__): return other._values == self._values # We are presumably comparing against ...
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "self", "is", "other", ":", "return", "True", "# Special case for the same type which should be common and fast.", "if", "isinstance", "(", "other", ",", "self", ".", "__class__", ")", ":", "return", "o...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/containers.py#L170-L178
kismetwireless/kismet
a7c0dc270c960fb1f58bd9cec4601c201885fd4e
capture_sdr_rtl433/KismetCaptureRtl433/kismetexternal/__init__.py
python
Datasource.parse_definition
(definition)
return source, options
Parse a Kismet definition into a (source, optionsmap) tuple :param definition: Kismet source definition :return: (source, options{} dictionary) as tuple
Parse a Kismet definition into a (source, optionsmap) tuple
[ "Parse", "a", "Kismet", "definition", "into", "a", "(", "source", "optionsmap", ")", "tuple" ]
def parse_definition(definition): """ Parse a Kismet definition into a (source, optionsmap) tuple :param definition: Kismet source definition :return: (source, options{} dictionary) as tuple """ options = {} colon = definition.find(':') if colon == -1:...
[ "def", "parse_definition", "(", "definition", ")", ":", "options", "=", "{", "}", "colon", "=", "definition", ".", "find", "(", "':'", ")", "if", "colon", "==", "-", "1", ":", "return", "definition", ",", "{", "}", "source", "=", "definition", "[", "...
https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_sdr_rtl433/KismetCaptureRtl433/kismetexternal/__init__.py#L817-L864
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Font.Strikethrough
(*args, **kwargs)
return _gdi_.Font_Strikethrough(*args, **kwargs)
Strikethrough(self) -> Font
Strikethrough(self) -> Font
[ "Strikethrough", "(", "self", ")", "-", ">", "Font" ]
def Strikethrough(*args, **kwargs): """Strikethrough(self) -> Font""" return _gdi_.Font_Strikethrough(*args, **kwargs)
[ "def", "Strikethrough", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Font_Strikethrough", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2577-L2579
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/iwd/GUIINV.py
python
RefreshInventoryWindow
(Window)
return
Partial redraw without resetting TopIndex.
Partial redraw without resetting TopIndex.
[ "Partial", "redraw", "without", "resetting", "TopIndex", "." ]
def RefreshInventoryWindow (Window): """Partial redraw without resetting TopIndex.""" pc = GemRB.GameGetSelectedPCSingle () # name Label = Window.GetControl (0x10000032) Label.SetText (GemRB.GetPlayerName (pc, 0)) # portrait Button = Window.GetControl (50) Color1 = GemRB.GetPlayerStat (pc, IE_METAL_COLOR) C...
[ "def", "RefreshInventoryWindow", "(", "Window", ")", ":", "pc", "=", "GemRB", ".", "GameGetSelectedPCSingle", "(", ")", "# name", "Label", "=", "Window", ".", "GetControl", "(", "0x10000032", ")", "Label", ".", "SetText", "(", "GemRB", ".", "GetPlayerName", ...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/iwd/GUIINV.py#L132-L248
shuyo/ldig
27599a23a24fb4b95e57213aa942b4c94fe1104a
ldig.py
python
ldig.init
(self, temp_path, corpus_list, lbff, ngram_bound)
Extract features from corpus and generate TRIE(DoubleArray) data - load corpus - generate temporary file for maxsubst - generate double array and save it - parameter: lbff = lower bound of feature frequency
Extract features from corpus and generate TRIE(DoubleArray) data - load corpus - generate temporary file for maxsubst - generate double array and save it - parameter: lbff = lower bound of feature frequency
[ "Extract", "features", "from", "corpus", "and", "generate", "TRIE", "(", "DoubleArray", ")", "data", "-", "load", "corpus", "-", "generate", "temporary", "file", "for", "maxsubst", "-", "generate", "double", "array", "and", "save", "it", "-", "parameter", ":...
def init(self, temp_path, corpus_list, lbff, ngram_bound): """ Extract features from corpus and generate TRIE(DoubleArray) data - load corpus - generate temporary file for maxsubst - generate double array and save it - parameter: lbff = lower bound of feature frequency ...
[ "def", "init", "(", "self", ",", "temp_path", ",", "corpus_list", ",", "lbff", ",", "ngram_bound", ")", ":", "labels", "=", "[", "]", "with", "codecs", ".", "open", "(", "temp_path", ",", "'wb'", ",", "'utf-8'", ")", "as", "f", ":", "for", "file", ...
https://github.com/shuyo/ldig/blob/27599a23a24fb4b95e57213aa942b4c94fe1104a/ldig.py#L47-L103
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/fx/prepare.py
python
get_target_activation_dtype_for_node
( node: Node, qconfig: QConfigAny, inputs_seen_counter: int, outputs_seen_counter: int, input_quantized_idxs: List[int], output_quantized_idxs: List[int], qhandler: Optional[QuantizeHandler], modules: Dict[str, torch.nn.Module], cache_for_no_tensor_check: Dict[Node, bool], )
Returns the expected dtype of the input and output of this node after convert. If the value is not None, it represents the dtype of the Tensor. If the value is None, it means the value is not a Tensor. Note: this is for activations only, weight dtypes are not handled here. TODO(future PR, if needed): ...
Returns the expected dtype of the input and output of this node after convert. If the value is not None, it represents the dtype of the Tensor. If the value is None, it means the value is not a Tensor.
[ "Returns", "the", "expected", "dtype", "of", "the", "input", "and", "output", "of", "this", "node", "after", "convert", ".", "If", "the", "value", "is", "not", "None", "it", "represents", "the", "dtype", "of", "the", "Tensor", ".", "If", "the", "value", ...
def get_target_activation_dtype_for_node( node: Node, qconfig: QConfigAny, inputs_seen_counter: int, outputs_seen_counter: int, input_quantized_idxs: List[int], output_quantized_idxs: List[int], qhandler: Optional[QuantizeHandler], modules: Dict[str, torch.nn.Module], cache_for_no_te...
[ "def", "get_target_activation_dtype_for_node", "(", "node", ":", "Node", ",", "qconfig", ":", "QConfigAny", ",", "inputs_seen_counter", ":", "int", ",", "outputs_seen_counter", ":", "int", ",", "input_quantized_idxs", ":", "List", "[", "int", "]", ",", "output_qua...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/fx/prepare.py#L264-L358
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/adidas_utils/helpers/simplex.py
python
euclidean_projection_onto_simplex
(y, eps=1e-3, subset=True)
return x
O(n log n) Euclidean projection of y onto the simplex. Args: y: np.array eps: float, ensure x remains at least eps / dim away from facets of simplex subset: bool, whether to project onto a subset of the simplex defined by eps Returns: np.array, y projected onto the simplex
O(n log n) Euclidean projection of y onto the simplex.
[ "O", "(", "n", "log", "n", ")", "Euclidean", "projection", "of", "y", "onto", "the", "simplex", "." ]
def euclidean_projection_onto_simplex(y, eps=1e-3, subset=True): """O(n log n) Euclidean projection of y onto the simplex. Args: y: np.array eps: float, ensure x remains at least eps / dim away from facets of simplex subset: bool, whether to project onto a subset of the simplex defined by eps Returns...
[ "def", "euclidean_projection_onto_simplex", "(", "y", ",", "eps", "=", "1e-3", ",", "subset", "=", "True", ")", ":", "if", "np", ".", "all", "(", "y", ">=", "0.", ")", "and", "np", ".", "abs", "(", "np", ".", "sum", "(", "y", ")", "-", "1.", ")...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/helpers/simplex.py#L62-L93
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/io/matlab/mio4.py
python
VarReader4.read_sub_array
(self, hdr, copy=True)
return arr
Mat4 read using header `hdr` dtype and dims Parameters ---------- hdr : object object with attributes ``dtype``, ``dims``. dtype is assumed to be the correct endianness copy : bool, optional copies array before return if True (default True) (...
Mat4 read using header `hdr` dtype and dims
[ "Mat4", "read", "using", "header", "hdr", "dtype", "and", "dims" ]
def read_sub_array(self, hdr, copy=True): ''' Mat4 read using header `hdr` dtype and dims Parameters ---------- hdr : object object with attributes ``dtype``, ``dims``. dtype is assumed to be the correct endianness copy : bool, optional copies a...
[ "def", "read_sub_array", "(", "self", ",", "hdr", ",", "copy", "=", "True", ")", ":", "dt", "=", "hdr", ".", "dtype", "dims", "=", "hdr", ".", "dims", "num_bytes", "=", "dt", ".", "itemsize", "for", "d", "in", "dims", ":", "num_bytes", "*=", "d", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/io/matlab/mio4.py#L151-L185
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py
python
BaseCPUCodegen.target_data
(self)
return self._target_data
The LLVM "target data" object for this codegen instance.
The LLVM "target data" object for this codegen instance.
[ "The", "LLVM", "target", "data", "object", "for", "this", "codegen", "instance", "." ]
def target_data(self): """ The LLVM "target data" object for this codegen instance. """ return self._target_data
[ "def", "target_data", "(", "self", ")", ":", "return", "self", ".", "_target_data" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py#L660-L664
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathCommands.py
python
findShape
(shape, subname=None, subtype=None)
return ret
To find a higher order shape containing the subshape with subname. E.g. to find the wire containing 'Edge1' in shape, findShape(shape,'Edge1','Wires')
To find a higher order shape containing the subshape with subname. E.g. to find the wire containing 'Edge1' in shape, findShape(shape,'Edge1','Wires')
[ "To", "find", "a", "higher", "order", "shape", "containing", "the", "subshape", "with", "subname", ".", "E", ".", "g", ".", "to", "find", "the", "wire", "containing", "Edge1", "in", "shape", "findShape", "(", "shape", "Edge1", "Wires", ")" ]
def findShape(shape, subname=None, subtype=None): """To find a higher order shape containing the subshape with subname. E.g. to find the wire containing 'Edge1' in shape, findShape(shape,'Edge1','Wires') """ if not subname: return shape ret = shape.getElement(subname) if not subt...
[ "def", "findShape", "(", "shape", ",", "subname", "=", "None", ",", "subtype", "=", "None", ")", ":", "if", "not", "subname", ":", "return", "shape", "ret", "=", "shape", ".", "getElement", "(", "subname", ")", "if", "not", "subtype", "or", "not", "r...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathCommands.py#L224-L246
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewListCtrl.GetTextValue
(*args, **kwargs)
return _dataview.DataViewListCtrl_GetTextValue(*args, **kwargs)
GetTextValue(self, unsigned int row, unsigned int col) -> String
GetTextValue(self, unsigned int row, unsigned int col) -> String
[ "GetTextValue", "(", "self", "unsigned", "int", "row", "unsigned", "int", "col", ")", "-", ">", "String" ]
def GetTextValue(*args, **kwargs): """GetTextValue(self, unsigned int row, unsigned int col) -> String""" return _dataview.DataViewListCtrl_GetTextValue(*args, **kwargs)
[ "def", "GetTextValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewListCtrl_GetTextValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2188-L2190
QMCPACK/qmcpack
d0948ab455e38364458740cc8e2239600a14c5cd
utils/afqmctools/afqmctools/hamiltonian/mol.py
python
write_hamil_mol
(scf_data, hamil_file, chol_cut, verbose=True, cas=None, ortho_ao=False, nelec=None, real_chol=False, df=False, dense=False)
Write QMCPACK hamiltonian from pyscf scf calculation on mol object.
Write QMCPACK hamiltonian from pyscf scf calculation on mol object.
[ "Write", "QMCPACK", "hamiltonian", "from", "pyscf", "scf", "calculation", "on", "mol", "object", "." ]
def write_hamil_mol(scf_data, hamil_file, chol_cut, verbose=True, cas=None, ortho_ao=False, nelec=None, real_chol=False, df=False, dense=False): """Write QMCPACK hamiltonian from pyscf scf calculation on mol object. """ hcore, c...
[ "def", "write_hamil_mol", "(", "scf_data", ",", "hamil_file", ",", "chol_cut", ",", "verbose", "=", "True", ",", "cas", "=", "None", ",", "ortho_ao", "=", "False", ",", "nelec", "=", "None", ",", "real_chol", "=", "False", ",", "df", "=", "False", ",",...
https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/afqmctools/hamiltonian/mol.py#L20-L45
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/build/feature.py
python
get
(name)
return __all_features[name]
Return the Feature instance for the specified name. Throws if no feature by such name exists
Return the Feature instance for the specified name.
[ "Return", "the", "Feature", "instance", "for", "the", "specified", "name", "." ]
def get(name): """Return the Feature instance for the specified name. Throws if no feature by such name exists """ assert isinstance(name, basestring) return __all_features[name]
[ "def", "get", "(", "name", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "return", "__all_features", "[", "name", "]" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/feature.py#L125-L131
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/MSVSSettings.py
python
_ValidateSettings
(validators, settings, stderr)
Validates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. Args: validators: A dictionary of tools and their validators. settings: A dictionary. The key is the tool name. The values are themselves dictionaries of setti...
Validates that the settings are valid for MSBuild or MSVS.
[ "Validates", "that", "the", "settings", "are", "valid", "for", "MSBuild", "or", "MSVS", "." ]
def _ValidateSettings(validators, settings, stderr): """Validates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. Args: validators: A dictionary of tools and their validators. settings: A dictionary. The key is the tool name. ...
[ "def", "_ValidateSettings", "(", "validators", ",", "settings", ",", "stderr", ")", ":", "for", "tool_name", "in", "settings", ":", "if", "tool_name", "in", "validators", ":", "tool_validators", "=", "validators", "[", "tool_name", "]", "for", "setting", ",", ...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/MSVSSettings.py#L464-L489
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py3/pygments/lexers/graphics.py
python
PovrayLexer.analyse_text
(text)
return result
POVRAY is similar to JSON/C, but the combination of camera and light_source is probably not very likely elsewhere. HLSL or GLSL are similar (GLSL even has #version), but they miss #declare, and light_source/camera are not keywords anywhere else -- it's fair to assume though that any POVR...
POVRAY is similar to JSON/C, but the combination of camera and light_source is probably not very likely elsewhere. HLSL or GLSL are similar (GLSL even has #version), but they miss #declare, and light_source/camera are not keywords anywhere else -- it's fair to assume though that any POVR...
[ "POVRAY", "is", "similar", "to", "JSON", "/", "C", "but", "the", "combination", "of", "camera", "and", "light_source", "is", "probably", "not", "very", "likely", "elsewhere", ".", "HLSL", "or", "GLSL", "are", "similar", "(", "GLSL", "even", "has", "#versio...
def analyse_text(text): """POVRAY is similar to JSON/C, but the combination of camera and light_source is probably not very likely elsewhere. HLSL or GLSL are similar (GLSL even has #version), but they miss #declare, and light_source/camera are not keywords anywhere else -- it's fair ...
[ "def", "analyse_text", "(", "text", ")", ":", "result", "=", "0", "if", "'#version'", "in", "text", ":", "result", "+=", "0.05", "if", "'#declare'", "in", "text", ":", "result", "+=", "0.05", "if", "'camera'", "in", "text", ":", "result", "+=", "0.05",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/lexers/graphics.py#L782-L799
twtygqyy/caffe-augmentation
c76600d247e5132fa5bd89d87bb5df458341fa84
scripts/cpp_lint.py
python
CheckCStyleCast
(filename, linenum, line, raw_line, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw line of code to check, with comments. cast_type: The string for the C++ cast to recommend. This is eith...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "linenum", ",", "line", ",", "raw_line", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "match", "=", "Search", "(", "pattern", ",", "line", ")", "if", "not", "match", ":", "return", "False", "...
https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/scripts/cpp_lint.py#L4251-L4342
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/transform_impls/aggregate.py
python
aggregate
(ptype, zero, aggregate_fn, combine_fn, *side_inputs, **kargs)
return pobject.PObject(non_partial_node, ptype.pipeline())
Implementation of transforms.aggregate()
Implementation of transforms.aggregate()
[ "Implementation", "of", "transforms", ".", "aggregate", "()" ]
def aggregate(ptype, zero, aggregate_fn, combine_fn, *side_inputs, **kargs): """ Implementation of transforms.aggregate() """ if utils.is_infinite(ptype): raise ValueError("aggregate not supported infinite PType") objector = kargs.get('serde', ptype.pipeline().default_objector()) scale...
[ "def", "aggregate", "(", "ptype", ",", "zero", ",", "aggregate_fn", ",", "combine_fn", ",", "*", "side_inputs", ",", "*", "*", "kargs", ")", ":", "if", "utils", ".", "is_infinite", "(", "ptype", ")", ":", "raise", "ValueError", "(", "\"aggregate not suppor...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/transform_impls/aggregate.py#L30-L73
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py
python
_MuxHandshaker.__init__
(self, request, dispatcher, send_quota, receive_quota)
Constructs an instance. Args: request: _LogicalRequest instance. dispatcher: Dispatcher instance (dispatch.Dispatcher). send_quota: Initial send quota. receive_quota: Initial receive quota.
Constructs an instance. Args: request: _LogicalRequest instance. dispatcher: Dispatcher instance (dispatch.Dispatcher). send_quota: Initial send quota. receive_quota: Initial receive quota.
[ "Constructs", "an", "instance", ".", "Args", ":", "request", ":", "_LogicalRequest", "instance", ".", "dispatcher", ":", "Dispatcher", "instance", "(", "dispatch", ".", "Dispatcher", ")", ".", "send_quota", ":", "Initial", "send", "quota", ".", "receive_quota", ...
def __init__(self, request, dispatcher, send_quota, receive_quota): """Constructs an instance. Args: request: _LogicalRequest instance. dispatcher: Dispatcher instance (dispatch.Dispatcher). send_quota: Initial send quota. receive_quota: Initial receive qu...
[ "def", "__init__", "(", "self", ",", "request", ",", "dispatcher", ",", "send_quota", ",", "receive_quota", ")", ":", "hybi", ".", "Handshaker", ".", "__init__", "(", "self", ",", "request", ",", "dispatcher", ")", "self", ".", "_send_quota", "=", "send_qu...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py#L1293-L1315
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
utils/lui/lldbutil.py
python
get_symbol_names
(thread)
return [GetSymbol(i) for i in range(thread.GetNumFrames())]
Returns a sequence of symbols for this thread.
Returns a sequence of symbols for this thread.
[ "Returns", "a", "sequence", "of", "symbols", "for", "this", "thread", "." ]
def get_symbol_names(thread): """ Returns a sequence of symbols for this thread. """ def GetSymbol(i): return thread.GetFrameAtIndex(i).GetSymbol().GetName() return [GetSymbol(i) for i in range(thread.GetNumFrames())]
[ "def", "get_symbol_names", "(", "thread", ")", ":", "def", "GetSymbol", "(", "i", ")", ":", "return", "thread", ".", "GetFrameAtIndex", "(", "i", ")", ".", "GetSymbol", "(", ")", ".", "GetName", "(", ")", "return", "[", "GetSymbol", "(", "i", ")", "f...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/lui/lldbutil.py#L714-L721
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py
python
_format_mapdict
(mapdict, script=False)
return _flatten(opts)
Formats mapdict to pass it to tk.call. E.g. (script=False): {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} returns: ('-expand', '{active selected} grey focus {1, 2, 3, 4}')
Formats mapdict to pass it to tk.call.
[ "Formats", "mapdict", "to", "pass", "it", "to", "tk", ".", "call", "." ]
def _format_mapdict(mapdict, script=False): """Formats mapdict to pass it to tk.call. E.g. (script=False): {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} returns: ('-expand', '{active selected} grey focus {1, 2, 3, 4}')""" opts = [] for opt, value in mapdict....
[ "def", "_format_mapdict", "(", "mapdict", ",", "script", "=", "False", ")", ":", "opts", "=", "[", "]", "for", "opt", ",", "value", "in", "mapdict", ".", "items", "(", ")", ":", "opts", ".", "extend", "(", "(", "\"-%s\"", "%", "opt", ",", "_format_...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py#L100-L115
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py
python
AppendableTable.write_data
(self, chunksize: Optional[int], dropna: bool = False)
we form the data into a 2-d including indexes,values,mask write chunk-by-chunk
we form the data into a 2-d including indexes,values,mask write chunk-by-chunk
[ "we", "form", "the", "data", "into", "a", "2", "-", "d", "including", "indexes", "values", "mask", "write", "chunk", "-", "by", "-", "chunk" ]
def write_data(self, chunksize: Optional[int], dropna: bool = False): """ we form the data into a 2-d including indexes,values,mask write chunk-by-chunk """ names = self.dtype.names nrows = self.nrows_expected # if dropna==True, then drop ALL nan rows masks = [] ...
[ "def", "write_data", "(", "self", ",", "chunksize", ":", "Optional", "[", "int", "]", ",", "dropna", ":", "bool", "=", "False", ")", ":", "names", "=", "self", ".", "dtype", ".", "names", "nrows", "=", "self", ".", "nrows_expected", "# if dropna==True, t...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L4175-L4234
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/command.py
python
InitializeMultiprocessingVariables
()
Initializes module-level variables that will be inherited by subprocesses. On Windows, a multiprocessing.Manager object should only be created within an "if __name__ == '__main__':" block. This function must be called, otherwise every command that calls Command.Apply will fail.
Initializes module-level variables that will be inherited by subprocesses.
[ "Initializes", "module", "-", "level", "variables", "that", "will", "be", "inherited", "by", "subprocesses", "." ]
def InitializeMultiprocessingVariables(): """Initializes module-level variables that will be inherited by subprocesses. On Windows, a multiprocessing.Manager object should only be created within an "if __name__ == '__main__':" block. This function must be called, otherwise every command that calls Command.Appl...
[ "def", "InitializeMultiprocessingVariables", "(", ")", ":", "# This list of global variables must exactly match the above list of", "# declarations.", "# pylint: disable=global-variable-undefined", "global", "manager", ",", "consumer_pools", ",", "task_queues", ",", "caller_id_lock", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/command.py#L194-L258
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_6_0_0.py
python
MiroInterpreter.do_items
(self, line)
items -- Lists the items in the feed/playlist/tab selected.
items -- Lists the items in the feed/playlist/tab selected.
[ "items", "--", "Lists", "the", "items", "in", "the", "feed", "/", "playlist", "/", "tab", "selected", "." ]
def do_items(self, line): """items -- Lists the items in the feed/playlist/tab selected.""" if self.selection_type is None: print "Error: No tab/feed/playlist selected." return elif self.selection_type == 'feed': feed = self.tab view = feed.items ...
[ "def", "do_items", "(", "self", ",", "line", ")", ":", "if", "self", ".", "selection_type", "is", "None", ":", "print", "\"Error: No tab/feed/playlist selected.\"", "return", "elif", "self", ".", "selection_type", "==", "'feed'", ":", "feed", "=", "self", ".",...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_6_0_0.py#L606-L629
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
PyDataViewCustomRenderer.GetTextExtent
(*args, **kwargs)
return _dataview.PyDataViewCustomRenderer_GetTextExtent(*args, **kwargs)
GetTextExtent(self, String str) -> Size
GetTextExtent(self, String str) -> Size
[ "GetTextExtent", "(", "self", "String", "str", ")", "-", ">", "Size" ]
def GetTextExtent(*args, **kwargs): """GetTextExtent(self, String str) -> Size""" return _dataview.PyDataViewCustomRenderer_GetTextExtent(*args, **kwargs)
[ "def", "GetTextExtent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "PyDataViewCustomRenderer_GetTextExtent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1505-L1507
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathProfile.py
python
ObjectProfile._getOffsetArea
(self, obj, fcShape, isHole)
return PathUtils.getOffsetArea( fcShape, offset, plane=fcShape, tolerance=tolerance )
Get an offset area for a shape. Wrapper around PathUtils.getOffsetArea.
Get an offset area for a shape. Wrapper around PathUtils.getOffsetArea.
[ "Get", "an", "offset", "area", "for", "a", "shape", ".", "Wrapper", "around", "PathUtils", ".", "getOffsetArea", "." ]
def _getOffsetArea(self, obj, fcShape, isHole): """Get an offset area for a shape. Wrapper around PathUtils.getOffsetArea.""" PathLog.debug("_getOffsetArea()") JOB = PathUtils.findParentJob(obj) tolerance = JOB.GeometryTolerance.Value offset = self.ofstRadius if...
[ "def", "_getOffsetArea", "(", "self", ",", "obj", ",", "fcShape", ",", "isHole", ")", ":", "PathLog", ".", "debug", "(", "\"_getOffsetArea()\"", ")", "JOB", "=", "PathUtils", ".", "findParentJob", "(", "obj", ")", "tolerance", "=", "JOB", ".", "GeometryTol...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathProfile.py#L1032-L1046
openweave/openweave-core
11ceb6b7efd39fe05de7f79229247a5774d56766
src/tools/factory-prov-tool/WeaveTLV.py
python
TLVWriter.putFloat
(self, tag, val)
Write a value as a TLV float with the specified TLV tag.
Write a value as a TLV float with the specified TLV tag.
[ "Write", "a", "value", "as", "a", "TLV", "float", "with", "the", "specified", "TLV", "tag", "." ]
def putFloat(self, tag, val): '''Write a value as a TLV float with the specified TLV tag.''' val = struct.pack('d', val) controlAndTag = self._encodeControlAndTag(TLVType_FloatingPointNumber, tag, lenOfLenOrVal=len(val)) self._encoding.extend(controlAndTag) self._encoding.extend(...
[ "def", "putFloat", "(", "self", ",", "tag", ",", "val", ")", ":", "val", "=", "struct", ".", "pack", "(", "'d'", ",", "val", ")", "controlAndTag", "=", "self", ".", "_encodeControlAndTag", "(", "TLVType_FloatingPointNumber", ",", "tag", ",", "lenOfLenOrVal...
https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/tools/factory-prov-tool/WeaveTLV.py#L186-L191
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/text_format.py
python
_Tokenizer._ConsumeSingleByteString
(self)
return result
Consume one token of a string literal. String literals (whether bytes or text) can come in multiple adjacent tokens which are automatically concatenated, like in C or Python. This method only consumes one token.
Consume one token of a string literal.
[ "Consume", "one", "token", "of", "a", "string", "literal", "." ]
def _ConsumeSingleByteString(self): """Consume one token of a string literal. String literals (whether bytes or text) can come in multiple adjacent tokens which are automatically concatenated, like in C or Python. This method only consumes one token. """ text = self.token if len(text) < 1 ...
[ "def", "_ConsumeSingleByteString", "(", "self", ")", ":", "text", "=", "self", ".", "token", "if", "len", "(", "text", ")", "<", "1", "or", "text", "[", "0", "]", "not", "in", "(", "'\\''", ",", "'\"'", ")", ":", "raise", "self", ".", "_ParseError"...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/text_format.py#L560-L579
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py
python
HighPage.var_changed_custom_name
(self, *params)
Process new custom theme selection. If a new custom theme is selected, add the name to the changed_items and apply the theme to the sample.
Process new custom theme selection.
[ "Process", "new", "custom", "theme", "selection", "." ]
def var_changed_custom_name(self, *params): """Process new custom theme selection. If a new custom theme is selected, add the name to the changed_items and apply the theme to the sample. """ value = self.custom_name.get() if value != '- no custom themes -': c...
[ "def", "var_changed_custom_name", "(", "self", ",", "*", "params", ")", ":", "value", "=", "self", ".", "custom_name", ".", "get", "(", ")", "if", "value", "!=", "'- no custom themes -'", ":", "changes", ".", "add_option", "(", "'main'", ",", "'Theme'", ",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L1020-L1029
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/idl_parser/idl_parser.py
python
IDLParser.p_StaticMemberRest
(self, p)
StaticMemberRest : ReadOnly AttributeRest | ReturnType OperationRest
StaticMemberRest : ReadOnly AttributeRest | ReturnType OperationRest
[ "StaticMemberRest", ":", "ReadOnly", "AttributeRest", "|", "ReturnType", "OperationRest" ]
def p_StaticMemberRest(self, p): """StaticMemberRest : ReadOnly AttributeRest | ReturnType OperationRest""" if len(p) == 2: p[0] = p[1] else: p[2].AddChildren(p[1]) p[0] = p[2]
[ "def", "p_StaticMemberRest", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", "==", "2", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "else", ":", "p", "[", "2", "]", ".", "AddChildren", "(", "p", "[", "1", "]", ")", "p",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/idl_parser/idl_parser.py#L572-L579
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSNew.py
python
MSVSProject.__init__
(self, path, name = None, dependencies = None, guid = None, spec = None, build_file = None, config_platform_overrides = None, fixpath_prefix = None)
Initializes the project. Args: path: Absolute path to the project file. name: Name of project. If None, the name will be the same as the base name of the project file. dependencies: List of other Project objects this project is dependent upon, if not None. guid: GUID to...
Initializes the project.
[ "Initializes", "the", "project", "." ]
def __init__(self, path, name = None, dependencies = None, guid = None, spec = None, build_file = None, config_platform_overrides = None, fixpath_prefix = None): """Initializes the project. Args: path: Absolute path to the project file. name: Name of project. If None,...
[ "def", "__init__", "(", "self", ",", "path", ",", "name", "=", "None", ",", "dependencies", "=", "None", ",", "guid", "=", "None", ",", "spec", "=", "None", ",", "build_file", "=", "None", ",", "config_platform_overrides", "=", "None", ",", "fixpath_pref...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSNew.py#L112-L147
isl-org/Open3D
79aec3ddde6a571ce2f28e4096477e52ec465244
python/open3d/visualization/tensorboard_plugin/util.py
python
Open3DPluginDataReader.read_geometry
(self, run, tag, step, batch_idx, step_to_idx)
return geometry, data_bbox_proto
Geometry reader from msgpack files.
Geometry reader from msgpack files.
[ "Geometry", "reader", "from", "msgpack", "files", "." ]
def read_geometry(self, run, tag, step, batch_idx, step_to_idx): """Geometry reader from msgpack files.""" idx = step_to_idx[step] metadata_proto = plugin_data_pb2.Open3DPluginData() run_tensor_events = self.tensor_events(run) metadata_proto.ParseFromString( run_tenso...
[ "def", "read_geometry", "(", "self", ",", "run", ",", "tag", ",", "step", ",", "batch_idx", ",", "step_to_idx", ")", ":", "idx", "=", "step_to_idx", "[", "step", "]", "metadata_proto", "=", "plugin_data_pb2", ".", "Open3DPluginData", "(", ")", "run_tensor_ev...
https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/python/open3d/visualization/tensorboard_plugin/util.py#L319-L393
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/tools/pretty_gyp.py
python
split_double_braces
(input)
return output
Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (e.g. closing braces make a nice diago...
Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below.
[ "Masks", "out", "the", "quotes", "and", "comments", "and", "then", "splits", "appropriate", "lines", "(", "lines", "that", "matche", "the", "double_", "*", "_brace", "re", "s", "above", ")", "before", "indenting", "them", "below", "." ]
def split_double_braces(input): """Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (e....
[ "def", "split_double_braces", "(", "input", ")", ":", "double_open_brace_re", "=", "re", ".", "compile", "(", "r'(.*?[\\[\\{\\(,])(\\s*)([\\[\\{\\(])'", ")", "double_close_brace_re", "=", "re", ".", "compile", "(", "r'(.*?[\\]\\}\\)],?)(\\s*)([\\]\\}\\)])'", ")", "masked_...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/tools/pretty_gyp.py#L64-L82
OGRECave/ogre
d2cae7220c21e9cf6cc5a00b35c351c38914bcf0
Tools/Wings3DExporter/mesh.py
python
Mesh.submeshize
(self)
create submeshes
create submeshes
[ "create", "submeshes" ]
def submeshize(self): "create submeshes" print "creating submeshes..." temp = {} for t in self.tri_materials: temp[t] = 1 trimats = temp.keys() self.subs = [] for mat in trimats: submesh = SubMesh() submesh.material = mat submesh.mat_data = self.materials[mat] if self.shared_geometry: ...
[ "def", "submeshize", "(", "self", ")", ":", "print", "\"creating submeshes...\"", "temp", "=", "{", "}", "for", "t", "in", "self", ".", "tri_materials", ":", "temp", "[", "t", "]", "=", "1", "trimats", "=", "temp", ".", "keys", "(", ")", "self", ".",...
https://github.com/OGRECave/ogre/blob/d2cae7220c21e9cf6cc5a00b35c351c38914bcf0/Tools/Wings3DExporter/mesh.py#L356-L392
sonyxperiadev/WebGL
0299b38196f78c6d5f74bcf6fa312a3daee6de60
Tools/Scripts/webkitpy/style/checker.py
python
CheckerDispatcher._file_extension
(self, file_path)
return os.path.splitext(file_path)[1].lstrip(".")
Return the file extension without the leading dot.
Return the file extension without the leading dot.
[ "Return", "the", "file", "extension", "without", "the", "leading", "dot", "." ]
def _file_extension(self, file_path): """Return the file extension without the leading dot.""" return os.path.splitext(file_path)[1].lstrip(".")
[ "def", "_file_extension", "(", "self", ",", "file_path", ")", ":", "return", "os", ".", "path", ".", "splitext", "(", "file_path", ")", "[", "1", "]", ".", "lstrip", "(", "\".\"", ")" ]
https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checker.py#L435-L437
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pipes.py
python
Template.clone
(self)
return t
t.clone() returns a new pipeline template with identical initial state as the current one.
t.clone() returns a new pipeline template with identical initial state as the current one.
[ "t", ".", "clone", "()", "returns", "a", "new", "pipeline", "template", "with", "identical", "initial", "state", "as", "the", "current", "one", "." ]
def clone(self): """t.clone() returns a new pipeline template with identical initial state as the current one.""" t = Template() t.steps = self.steps[:] t.debugging = self.debugging return t
[ "def", "clone", "(", "self", ")", ":", "t", "=", "Template", "(", ")", "t", ".", "steps", "=", "self", ".", "steps", "[", ":", "]", "t", ".", "debugging", "=", "self", ".", "debugging", "return", "t" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pipes.py#L96-L102
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/frontend/reader.py
python
MozbuildSandbox.add_android_eclipse_project_helper
(self, name)
return data
Add an Android Eclipse project target.
Add an Android Eclipse project target.
[ "Add", "an", "Android", "Eclipse", "project", "target", "." ]
def add_android_eclipse_project_helper(self, name): """Add an Android Eclipse project target.""" if not name: raise Exception('Android Eclipse project cannot be registered without a name') if name in self['ANDROID_ECLIPSE_PROJECT_TARGETS']: raise Exception('Android Eclip...
[ "def", "add_android_eclipse_project_helper", "(", "self", ",", "name", ")", ":", "if", "not", "name", ":", "raise", "Exception", "(", "'Android Eclipse project cannot be registered without a name'", ")", "if", "name", "in", "self", "[", "'ANDROID_ECLIPSE_PROJECT_TARGETS'"...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/frontend/reader.py#L224-L234
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/packaging/utils.py
python
canonicalize_version
(version)
return "".join(parts)
This is very similar to Version.__str__, but has one subtle differences with the way it handles the release segment.
This is very similar to Version.__str__, but has one subtle differences with the way it handles the release segment.
[ "This", "is", "very", "similar", "to", "Version", ".", "__str__", "but", "has", "one", "subtle", "differences", "with", "the", "way", "it", "handles", "the", "release", "segment", "." ]
def canonicalize_version(version): """ This is very similar to Version.__str__, but has one subtle differences with the way it handles the release segment. """ try: version = Version(version) except InvalidVersion: # Legacy versions cannot be normalized return version ...
[ "def", "canonicalize_version", "(", "version", ")", ":", "try", ":", "version", "=", "Version", "(", "version", ")", "except", "InvalidVersion", ":", "# Legacy versions cannot be normalized", "return", "version", "parts", "=", "[", "]", "# Epoch", "if", "version",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/packaging/utils.py#L19-L57
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/recordio.py
python
MXRecordIO._check_pid
(self, allow_reset=False)
Check process id to ensure integrity, reset if in new process.
Check process id to ensure integrity, reset if in new process.
[ "Check", "process", "id", "to", "ensure", "integrity", "reset", "if", "in", "new", "process", "." ]
def _check_pid(self, allow_reset=False): """Check process id to ensure integrity, reset if in new process.""" # pylint: disable=not-callable # It's bug from pylint(astroid). See https://github.com/PyCQA/pylint/issues/1699 if not self.pid == current_process().pid: if allow_res...
[ "def", "_check_pid", "(", "self", ",", "allow_reset", "=", "False", ")", ":", "# pylint: disable=not-callable", "# It's bug from pylint(astroid). See https://github.com/PyCQA/pylint/issues/1699", "if", "not", "self", ".", "pid", "==", "current_process", "(", ")", ".", "pi...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/recordio.py#L117-L125
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/setup_multiversion/setup_multiversion.py
python
SetupMultiversion.download_and_extract_from_urls
(self, urls, bin_suffix, install_dir)
Download and extract values indicated in `urls`.
Download and extract values indicated in `urls`.
[ "Download", "and", "extract", "values", "indicated", "in", "urls", "." ]
def download_and_extract_from_urls(self, urls, bin_suffix, install_dir): """Download and extract values indicated in `urls`.""" artifacts_url = urls.get("Artifacts", "") if self.download_artifacts else None binaries_url = urls.get("Binaries", "") if self.download_binaries else None pytho...
[ "def", "download_and_extract_from_urls", "(", "self", ",", "urls", ",", "bin_suffix", ",", "install_dir", ")", ":", "artifacts_url", "=", "urls", ".", "get", "(", "\"Artifacts\"", ",", "\"\"", ")", "if", "self", ".", "download_artifacts", "else", "None", "bina...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/setup_multiversion/setup_multiversion.py#L239-L271
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
Indigo.loadReaction
(self, string)
return self.IndigoObject( self, self._checkResult( Indigo._lib.indigoLoadReactionFromString( string.encode(ENCODE_ENCODING) ) ), )
Loads reaction from string. Format will be automatically recognized. Args: string (str): reaction format Returns: IndigoObject: reaction object Raises: IndigoException: Exception if structure format is incorrect
Loads reaction from string. Format will be automatically recognized.
[ "Loads", "reaction", "from", "string", ".", "Format", "will", "be", "automatically", "recognized", "." ]
def loadReaction(self, string): """Loads reaction from string. Format will be automatically recognized. Args: string (str): reaction format Returns: IndigoObject: reaction object Raises: IndigoException: Exception if structure format is incorrect ...
[ "def", "loadReaction", "(", "self", ",", "string", ")", ":", "self", ".", "_setSessionId", "(", ")", "return", "self", ".", "IndigoObject", "(", "self", ",", "self", ".", "_checkResult", "(", "Indigo", ".", "_lib", ".", "indigoLoadReactionFromString", "(", ...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L5656-L5676
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
dom/bindings/mozwebidlcodegen/__init__.py
python
WebIDLCodegenManager.generate_build_files
(self)
return result
Generate files required for the build. This function is in charge of generating all the .h/.cpp files derived from input .webidl files. Please note that there are build actions required to produce .webidl files and these build actions are explicitly not captured here: this function assu...
Generate files required for the build.
[ "Generate", "files", "required", "for", "the", "build", "." ]
def generate_build_files(self): """Generate files required for the build. This function is in charge of generating all the .h/.cpp files derived from input .webidl files. Please note that there are build actions required to produce .webidl files and these build actions are expli...
[ "def", "generate_build_files", "(", "self", ")", ":", "# Despite #1 above, we assume the build system is smart enough to not", "# invoke us if nothing has changed. Therefore, any invocation means", "# something has changed. And, if anything has changed, we need to", "# parse the WebIDL.", "self"...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/mozwebidlcodegen/__init__.py#L208-L297
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/pydoc.py
python
importfile
(path)
return module
Import a Python source file or compiled file given its path.
Import a Python source file or compiled file given its path.
[ "Import", "a", "Python", "source", "file", "or", "compiled", "file", "given", "its", "path", "." ]
def importfile(path): """Import a Python source file or compiled file given its path.""" magic = imp.get_magic() file = open(path, 'r') if file.read(len(magic)) == magic: kind = imp.PY_COMPILED else: kind = imp.PY_SOURCE file.close() filename = os.path.basename(path) name...
[ "def", "importfile", "(", "path", ")", ":", "magic", "=", "imp", ".", "get_magic", "(", ")", "file", "=", "open", "(", "path", ",", "'r'", ")", "if", "file", ".", "read", "(", "len", "(", "magic", ")", ")", "==", "magic", ":", "kind", "=", "imp...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pydoc.py#L281-L298
InteractiveComputerGraphics/PositionBasedDynamics
136469f03f7869666d907ea8d27872b098715f4a
extern/pybind/pybind11/setup_helpers.py
python
ParallelCompile.function
(self)
return compile_function
Builds a function object usable as distutils.ccompiler.CCompiler.compile.
Builds a function object usable as distutils.ccompiler.CCompiler.compile.
[ "Builds", "a", "function", "object", "usable", "as", "distutils", ".", "ccompiler", ".", "CCompiler", ".", "compile", "." ]
def function(self): """ Builds a function object usable as distutils.ccompiler.CCompiler.compile. """ def compile_function( compiler, sources, output_dir=None, macros=None, include_dirs=None, debug=0, ex...
[ "def", "function", "(", "self", ")", ":", "def", "compile_function", "(", "compiler", ",", "sources", ",", "output_dir", "=", "None", ",", "macros", "=", "None", ",", "include_dirs", "=", "None", ",", "debug", "=", "0", ",", "extra_preargs", "=", "None",...
https://github.com/InteractiveComputerGraphics/PositionBasedDynamics/blob/136469f03f7869666d907ea8d27872b098715f4a/extern/pybind/pybind11/setup_helpers.py#L328-L387
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
TopLevelWindow.SetIcons
(*args, **kwargs)
return _windows_.TopLevelWindow_SetIcons(*args, **kwargs)
SetIcons(self, wxIconBundle icons)
SetIcons(self, wxIconBundle icons)
[ "SetIcons", "(", "self", "wxIconBundle", "icons", ")" ]
def SetIcons(*args, **kwargs): """SetIcons(self, wxIconBundle icons)""" return _windows_.TopLevelWindow_SetIcons(*args, **kwargs)
[ "def", "SetIcons", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "TopLevelWindow_SetIcons", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L437-L439
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/expressions/expression.py
python
Expression.sign
(self)
return sign_str
str: The sign of the expression.
str: The sign of the expression.
[ "str", ":", "The", "sign", "of", "the", "expression", "." ]
def sign(self) -> str: """str: The sign of the expression. """ if self.is_zero(): sign_str = s.ZERO elif self.is_nonneg(): sign_str = s.NONNEG elif self.is_nonpos(): sign_str = s.NONPOS else: sign_str = s.UNKNOWN ret...
[ "def", "sign", "(", "self", ")", "->", "str", ":", "if", "self", ".", "is_zero", "(", ")", ":", "sign_str", "=", "s", ".", "ZERO", "elif", "self", ".", "is_nonneg", "(", ")", ":", "sign_str", "=", "s", ".", "NONNEG", "elif", "self", ".", "is_nonp...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/expression.py#L334-L345
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/tools/run_perf.py
python
RunnableConfig.ProcessOutput
(self, output, result_tracker, count)
Processes test run output and updates result tracker. Args: output: Output object from the test run. result_tracker: ResultTracker object to be updated. count: Index of the test run (used for better logging).
Processes test run output and updates result tracker.
[ "Processes", "test", "run", "output", "and", "updates", "result", "tracker", "." ]
def ProcessOutput(self, output, result_tracker, count): """Processes test run output and updates result tracker. Args: output: Output object from the test run. result_tracker: ResultTracker object to be updated. count: Index of the test run (used for better logging). """ if self.resul...
[ "def", "ProcessOutput", "(", "self", ",", "output", ",", "result_tracker", ",", "count", ")", ":", "if", "self", ".", "results_processor", ":", "output", "=", "RunResultsProcessor", "(", "self", ".", "results_processor", ",", "output", ",", "count", ")", "re...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/run_perf.py#L485-L514
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py
python
Environment.best_match
( self, req, working_set, installer=None, replace_conflicting=False)
return self.obtain(req, installer)
Find distribution best matching `req` and usable on `working_set` This calls the ``find(req)`` method of the `working_set` to see if a suitable distribution is already active. (This may raise ``VersionConflict`` if an unsuitable version of the project is already active in the specified...
Find distribution best matching `req` and usable on `working_set`
[ "Find", "distribution", "best", "matching", "req", "and", "usable", "on", "working_set" ]
def best_match( self, req, working_set, installer=None, replace_conflicting=False): """Find distribution best matching `req` and usable on `working_set` This calls the ``find(req)`` method of the `working_set` to see if a suitable distribution is already active. (This may raise ...
[ "def", "best_match", "(", "self", ",", "req", ",", "working_set", ",", "installer", "=", "None", ",", "replace_conflicting", "=", "False", ")", ":", "try", ":", "dist", "=", "working_set", ".", "find", "(", "req", ")", "except", "VersionConflict", ":", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L1040-L1066
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/os.py
python
removedirs
(name)
removedirs(name) Super-rmdir; remove a leaf directory and all empty intermediate ones. Works like rmdir except that, if the leaf directory is successfully removed, directories corresponding to rightmost path segments will be pruned away until either the whole path is consumed or an error occurs. ...
removedirs(name)
[ "removedirs", "(", "name", ")" ]
def removedirs(name): """removedirs(name) Super-rmdir; remove a leaf directory and all empty intermediate ones. Works like rmdir except that, if the leaf directory is successfully removed, directories corresponding to rightmost path segments will be pruned away until either the whole path is c...
[ "def", "removedirs", "(", "name", ")", ":", "rmdir", "(", "name", ")", "head", ",", "tail", "=", "path", ".", "split", "(", "name", ")", "if", "not", "tail", ":", "head", ",", "tail", "=", "path", ".", "split", "(", "head", ")", "while", "head", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/os.py#L230-L250
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/win/toolchain/toolchain.py
python
Download
(url, local_path)
Download a large-ish binary file and print some status information while doing so.
Download a large-ish binary file and print some status information while doing so.
[ "Download", "a", "large", "-", "ish", "binary", "file", "and", "print", "some", "status", "information", "while", "doing", "so", "." ]
def Download(url, local_path): """Download a large-ish binary file and print some status information while doing so.""" sys.stdout.write('Downloading %s...\n' % url) req = urllib2.urlopen(url) content_length = int(req.headers.get('Content-Length', 0)) bytes_read = 0 terminator = '\r' if sys.stdout.isatty(...
[ "def", "Download", "(", "url", ",", "local_path", ")", ":", "sys", ".", "stdout", ".", "write", "(", "'Downloading %s...\\n'", "%", "url", ")", "req", "=", "urllib2", ".", "urlopen", "(", "url", ")", "content_length", "=", "int", "(", "req", ".", "head...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/win/toolchain/toolchain.py#L57-L76
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py
python
DependencyGraph.add_edge
(self, x, y, label=None)
Add an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`...
Add an edge from distribution *x* to distribution *y* with the given *label*.
[ "Add", "an", "edge", "from", "distribution", "*", "x", "*", "to", "distribution", "*", "y", "*", "with", "the", "given", "*", "label", "*", "." ]
def add_edge(self, x, y, label=None): """Add an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.In...
[ "def", "add_edge", "(", "self", ",", "x", ",", "y", ",", "label", "=", "None", ")", ":", "self", ".", "adjacency_list", "[", "x", "]", ".", "append", "(", "(", "y", ",", "label", ")", ")", "# multiple edges are allowed, so be careful", "if", "x", "not"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L1112-L1125
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/metrics_utils.py
python
update_state_wrapper
(update_state_fn)
return tf_decorator.make_decorator(update_state_fn, decorated)
Decorator to wrap metric `update_state()` with `add_update()`. Args: update_state_fn: function that accumulates metric statistics. Returns: Decorated function that wraps `update_state_fn()` with `add_update()`.
Decorator to wrap metric `update_state()` with `add_update()`.
[ "Decorator", "to", "wrap", "metric", "update_state", "()", "with", "add_update", "()", "." ]
def update_state_wrapper(update_state_fn): """Decorator to wrap metric `update_state()` with `add_update()`. Args: update_state_fn: function that accumulates metric statistics. Returns: Decorated function that wraps `update_state_fn()` with `add_update()`. """ def decorated(metric_obj, *args, **kwa...
[ "def", "update_state_wrapper", "(", "update_state_fn", ")", ":", "def", "decorated", "(", "metric_obj", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Decorated function with `add_update()`.\"\"\"", "with", "tf_utils", ".", "graph_context_for_symbolic_tenso...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/metrics_utils.py#L61-L80
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_book.py
python
EdBaseBook.SetPageBitmap
(self, pg, bmp)
Set a tabs bitmap @param pg: page index @param bmp: Bitmap @note: no action if user prefs have turned off bmp
Set a tabs bitmap @param pg: page index @param bmp: Bitmap @note: no action if user prefs have turned off bmp
[ "Set", "a", "tabs", "bitmap", "@param", "pg", ":", "page", "index", "@param", "bmp", ":", "Bitmap", "@note", ":", "no", "action", "if", "user", "prefs", "have", "turned", "off", "bmp" ]
def SetPageBitmap(self, pg, bmp): """Set a tabs bitmap @param pg: page index @param bmp: Bitmap @note: no action if user prefs have turned off bmp """ if not self.UseIcons(): bmp = wx.NullBitmap super(EdBaseBook, self).SetPageBitmap(pg, bmp)
[ "def", "SetPageBitmap", "(", "self", ",", "pg", ",", "bmp", ")", ":", "if", "not", "self", ".", "UseIcons", "(", ")", ":", "bmp", "=", "wx", ".", "NullBitmap", "super", "(", "EdBaseBook", ",", "self", ")", ".", "SetPageBitmap", "(", "pg", ",", "bmp...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_book.py#L78-L87
wy1iu/LargeMargin_Softmax_Loss
c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec
scripts/cpp_lint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/scripts/cpp_lint.py#L930-L942
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/gdc.py
python
configure
(conf)
Configuration for gdc
Configuration for gdc
[ "Configuration", "for", "gdc" ]
def configure(conf): """ Configuration for gdc """ conf.find_gdc() conf.load('ar') conf.load('d') conf.common_flags_gdc() conf.d_platform_flags()
[ "def", "configure", "(", "conf", ")", ":", "conf", ".", "find_gdc", "(", ")", "conf", ".", "load", "(", "'ar'", ")", "conf", ".", "load", "(", "'d'", ")", "conf", ".", "common_flags_gdc", "(", ")", "conf", ".", "d_platform_flags", "(", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/gdc.py#L51-L59
NVIDIA-Merlin/HugeCTR
b596bcc44e14bb0c62c4f7e9c0b55301d94f2154
sparse_operation_kit/sparse_operation_kit/kit_lib.py
python
in_tensorflow2
()
return using_tf2
This function will tell whether the installed TensorFlow is 2.x
This function will tell whether the installed TensorFlow is 2.x
[ "This", "function", "will", "tell", "whether", "the", "installed", "TensorFlow", "is", "2", ".", "x" ]
def in_tensorflow2(): """ This function will tell whether the installed TensorFlow is 2.x """ return using_tf2
[ "def", "in_tensorflow2", "(", ")", ":", "return", "using_tf2" ]
https://github.com/NVIDIA-Merlin/HugeCTR/blob/b596bcc44e14bb0c62c4f7e9c0b55301d94f2154/sparse_operation_kit/sparse_operation_kit/kit_lib.py#L32-L36
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBBreakpointLocation.GetID
(self)
return _lldb.SBBreakpointLocation_GetID(self)
GetID(SBBreakpointLocation self) -> lldb::break_id_t
GetID(SBBreakpointLocation self) -> lldb::break_id_t
[ "GetID", "(", "SBBreakpointLocation", "self", ")", "-", ">", "lldb", "::", "break_id_t" ]
def GetID(self): """GetID(SBBreakpointLocation self) -> lldb::break_id_t""" return _lldb.SBBreakpointLocation_GetID(self)
[ "def", "GetID", "(", "self", ")", ":", "return", "_lldb", ".", "SBBreakpointLocation_GetID", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1964-L1966
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/ccroot.py
python
apply_vnum
(self)
Enforce version numbering on shared libraries. The valid version numbers must have at most two dots:: def build(bld): bld.shlib(source='a.c', target='foo', vnum='14.15.16') In this example, ``libfoo.so`` is installed as ``libfoo.so.1.2.3``, and the following symbolic links are created: * ``libfoo.so → libfo...
Enforce version numbering on shared libraries. The valid version numbers must have at most two dots::
[ "Enforce", "version", "numbering", "on", "shared", "libraries", ".", "The", "valid", "version", "numbers", "must", "have", "at", "most", "two", "dots", "::" ]
def apply_vnum(self): """ Enforce version numbering on shared libraries. The valid version numbers must have at most two dots:: def build(bld): bld.shlib(source='a.c', target='foo', vnum='14.15.16') In this example, ``libfoo.so`` is installed as ``libfoo.so.1.2.3``, and the following symbolic links are create...
[ "def", "apply_vnum", "(", "self", ")", ":", "if", "not", "getattr", "(", "self", ",", "'vnum'", ",", "''", ")", "or", "os", ".", "name", "!=", "'posix'", "or", "self", ".", "env", ".", "DEST_BINFMT", "not", "in", "(", "'elf'", ",", "'mac-o'", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/ccroot.py#L550-L612
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/locale_tool.py
python
_IsGritInputFile
(input_file)
return input_file.endswith('.grd')
Returns True iff this is a GRIT input file.
Returns True iff this is a GRIT input file.
[ "Returns", "True", "iff", "this", "is", "a", "GRIT", "input", "file", "." ]
def _IsGritInputFile(input_file): """Returns True iff this is a GRIT input file.""" return input_file.endswith('.grd')
[ "def", "_IsGritInputFile", "(", "input_file", ")", ":", "return", "input_file", ".", "endswith", "(", "'.grd'", ")" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/locale_tool.py#L486-L488
3drobotics/ardupilot-solo
05a123b002c11dccc905d4d7703a38e5f36ee723
mk/PX4/Tools/gencpp/src/gencpp/__init__.py
python
is_fixed_length
(spec, msg_context, includepath)
return True
Returns whether or not the message is fixed-length @param spec: The message spec @type spec: genmsg.msgs.MsgSpec @param package: The package of the @type package: str
Returns whether or not the message is fixed-length
[ "Returns", "whether", "or", "not", "the", "message", "is", "fixed", "-", "length" ]
def is_fixed_length(spec, msg_context, includepath): """ Returns whether or not the message is fixed-length @param spec: The message spec @type spec: genmsg.msgs.MsgSpec @param package: The package of the @type package: str """ types = [] for field in spec.parsed_fields(): i...
[ "def", "is_fixed_length", "(", "spec", ",", "msg_context", ",", "includepath", ")", ":", "types", "=", "[", "]", "for", "field", "in", "spec", ".", "parsed_fields", "(", ")", ":", "if", "(", "field", ".", "is_array", "and", "field", ".", "array_len", "...
https://github.com/3drobotics/ardupilot-solo/blob/05a123b002c11dccc905d4d7703a38e5f36ee723/mk/PX4/Tools/gencpp/src/gencpp/__init__.py#L128-L156
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py
python
_GetMSBuildPropertyGroup
(spec, label, properties)
return [group]
Returns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. label: An optional label for the PropertyGroup. properties: The dictionary to be converted. The key is the name of the property. The value is itself a dictionary; its key is the value and ...
Returns a PropertyGroup definition for the specified properties.
[ "Returns", "a", "PropertyGroup", "definition", "for", "the", "specified", "properties", "." ]
def _GetMSBuildPropertyGroup(spec, label, properties): """Returns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. label: An optional label for the PropertyGroup. properties: The dictionary to be converted. The key is the name of the property. ...
[ "def", "_GetMSBuildPropertyGroup", "(", "spec", ",", "label", ",", "properties", ")", ":", "group", "=", "[", "'PropertyGroup'", "]", "if", "label", ":", "group", ".", "append", "(", "{", "'Label'", ":", "label", "}", ")", "num_configurations", "=", "len",...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py#L2696-L2743
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py
python
get_subj_alt_name
(peer_cert)
return names
Given an PyOpenSSL certificate, provides all the subject alternative names.
Given an PyOpenSSL certificate, provides all the subject alternative names.
[ "Given", "an", "PyOpenSSL", "certificate", "provides", "all", "the", "subject", "alternative", "names", "." ]
def get_subj_alt_name(peer_cert): """ Given an PyOpenSSL certificate, provides all the subject alternative names. """ # Pass the cert to cryptography, which has much better APIs for this. if hasattr(peer_cert, "to_cryptography"): cert = peer_cert.to_cryptography() else: # This is...
[ "def", "get_subj_alt_name", "(", "peer_cert", ")", ":", "# Pass the cert to cryptography, which has much better APIs for this.", "if", "hasattr", "(", "peer_cert", ",", "\"to_cryptography\"", ")", ":", "cert", "=", "peer_cert", ".", "to_cryptography", "(", ")", "else", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py#L212-L263
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/io/ros.py
python
to_JointTrajectory
(klampt_traj,indices='auto',link_joint_names=None)
Returns a ROS JointTrajectory message for a Klamp't Trajectory or RobotTrajectory. Args: klampt_traj (Trajectory or RobotTrajectory): the trajectory indices (str or list of ints): the indices to send (only valid with RobotTrajectory) link_joint_names (list of str, optional): if given, t...
Returns a ROS JointTrajectory message for a Klamp't Trajectory or RobotTrajectory.
[ "Returns", "a", "ROS", "JointTrajectory", "message", "for", "a", "Klamp", "t", "Trajectory", "or", "RobotTrajectory", "." ]
def to_JointTrajectory(klampt_traj,indices='auto',link_joint_names=None): """Returns a ROS JointTrajectory message for a Klamp't Trajectory or RobotTrajectory. Args: klampt_traj (Trajectory or RobotTrajectory): the trajectory indices (str or list of ints): the indices to send (only valid wi...
[ "def", "to_JointTrajectory", "(", "klampt_traj", ",", "indices", "=", "'auto'", ",", "link_joint_names", "=", "None", ")", ":", "from", "trajectory_msgs", ".", "msg", "import", "JointTrajectoryPoint", "res", "=", "JointTrajectory", "(", ")", "if", "len", "(", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/ros.py#L279-L323
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/_version.py
python
git_versions_from_keywords
(keywords, tag_prefix, verbose)
return { "version": "0+unknown", "full-revisionid": keywords["full"].strip(), "dirty": False, "error": "no suitable tags", "date": None, }
Get version information from git keywords.
Get version information from git keywords.
[ "Get", "version", "information", "from", "git", "keywords", "." ]
def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" if not keywords: raise NotThisMethod("no keywords at all, weird") date = keywords.get("date") if date is not None: # git-2.2.0 added "%cI", which expands to an ISO-8601 -compli...
[ "def", "git_versions_from_keywords", "(", "keywords", ",", "tag_prefix", ",", "verbose", ")", ":", "if", "not", "keywords", ":", "raise", "NotThisMethod", "(", "\"no keywords at all, weird\"", ")", "date", "=", "keywords", ".", "get", "(", "\"date\"", ")", "if",...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/_version.py#L173-L231
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/tz/tz.py
python
tzfile._set_tzdata
(self, tzobj)
Set the time zone data of this object from a _tzfile object
Set the time zone data of this object from a _tzfile object
[ "Set", "the", "time", "zone", "data", "of", "this", "object", "from", "a", "_tzfile", "object" ]
def _set_tzdata(self, tzobj): """ Set the time zone data of this object from a _tzfile object """ # Copy the relevant attributes over as private attributes for attr in _tzfile.attrs: setattr(self, '_' + attr, getattr(tzobj, attr))
[ "def", "_set_tzdata", "(", "self", ",", "tzobj", ")", ":", "# Copy the relevant attributes over as private attributes", "for", "attr", "in", "_tzfile", ".", "attrs", ":", "setattr", "(", "self", ",", "'_'", "+", "attr", ",", "getattr", "(", "tzobj", ",", "attr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/dateutil/tz/tz.py#L482-L486
ucsb-seclab/difuze
bb59a12ff87ad5ae45d9c60e349891bf80d72877
helper_scripts/components/parse_headers.py
python
ParseHeaders.get_name
(self)
return "ParseHeaders"
get component name. :return: Str
get component name. :return: Str
[ "get", "component", "name", ".", ":", "return", ":", "Str" ]
def get_name(self): """ get component name. :return: Str """ return "ParseHeaders"
[ "def", "get_name", "(", "self", ")", ":", "return", "\"ParseHeaders\"" ]
https://github.com/ucsb-seclab/difuze/blob/bb59a12ff87ad5ae45d9c60e349891bf80d72877/helper_scripts/components/parse_headers.py#L76-L81