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
s9xie/DSN
065e49898d239f5c96be558616b2556eabc50351
scripts/cpp_lint.py
python
RemoveMultiLineCommentsFromRange
(lines, begin, end)
Clears a range of lines for multi-line comments.
Clears a range of lines for multi-line comments.
[ "Clears", "a", "range", "of", "lines", "for", "multi", "-", "line", "comments", "." ]
def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '// dummy'
[ "def", "RemoveMultiLineCommentsFromRange", "(", "lines", ",", "begin", ",", "end", ")", ":", "# Having // dummy comments makes the lines non-empty, so we will not get", "# unnecessary blank line warnings later in the code.", "for", "i", "in", "range", "(", "begin", ",", "end", ...
https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L1138-L1143
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
CheckCommaSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing near commas and semicolons. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for horizontal spacing near commas and semicolons.
[ "Checks", "for", "horizontal", "spacing", "near", "commas", "and", "semicolons", "." ]
def CheckCommaSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing near commas and semicolons. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call w...
[ "def", "CheckCommaSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "raw", "=", "clean_lines", ".", "lines_without_raw_strings", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# You should always have a space af...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L3280-L3313
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/LmbrSetup/Linux/archiver.py
python
_build_3rdparty_sources_map
(config_file_path, source_root, destination_root)
return sources
Return a map of absolute path to relative paths of all 3rd party dependencies
Return a map of absolute path to relative paths of all 3rd party dependencies
[ "Return", "a", "map", "of", "absolute", "path", "to", "relative", "paths", "of", "all", "3rd", "party", "dependencies" ]
def _build_3rdparty_sources_map(config_file_path, source_root, destination_root): ''' Return a map of absolute path to relative paths of all 3rd party dependencies ''' def _is_interesting(sdk_node, symlink_node): ''' Returns true if the input json node from config file needs to be consid...
[ "def", "_build_3rdparty_sources_map", "(", "config_file_path", ",", "source_root", ",", "destination_root", ")", ":", "def", "_is_interesting", "(", "sdk_node", ",", "symlink_node", ")", ":", "'''\n Returns true if the input json node from config file needs to be considere...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/LmbrSetup/Linux/archiver.py#L237-L278
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/__init__.py
python
node
(path, type = None)
return res
Create or get a BaseNode. path -- path to the node file. type -- optional type of the node. The returned node is determined as follow: * If a node exists for the given path, it is returned. * If the type is given, a node of that type is constructed with the path as argument. * If the path as a known e...
Create or get a BaseNode.
[ "Create", "or", "get", "a", "BaseNode", "." ]
def node(path, type = None): """Create or get a BaseNode. path -- path to the node file. type -- optional type of the node. The returned node is determined as follow: * If a node exists for the given path, it is returned. * If the type is given, a node of that type is constructed with the path as argu...
[ "def", "node", "(", "path", ",", "type", "=", "None", ")", ":", "if", "not", "isinstance", "(", "path", ",", "Path", ")", ":", "path", "=", "Path", "(", "path", ")", "d", "=", "Drake", ".", "current", "res", "=", "d", ".", "nodes", ".", "get", ...
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L1764-L1801
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
OwnerDrawnComboBox.Create
(*args, **kwargs)
return _combo.OwnerDrawnComboBox_Create(*args, **kwargs)
Create(self, Window parent, int id=-1, String value=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, wxArrayString choices=wxPyEmptyStringArray, long style=0, Validator validator=DefaultValidator, String name=ComboBoxNameStr) -> bool Create the ...
Create(self, Window parent, int id=-1, String value=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, wxArrayString choices=wxPyEmptyStringArray, long style=0, Validator validator=DefaultValidator, String name=ComboBoxNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "String", "value", "=", "EmptyString", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "wxArrayString", "choices", "=", "wxPyEmptyStringArray", "long", "style", ...
def Create(*args, **kwargs): """ Create(self, Window parent, int id=-1, String value=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, wxArrayString choices=wxPyEmptyStringArray, long style=0, Validator validator=DefaultValidator, String n...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "OwnerDrawnComboBox_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L837-L847
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/req/req_set.py
python
RequirementSet.add_requirement
( self, install_req, # type: InstallRequirement parent_req_name=None, # type: Optional[str] extras_requested=None # type: Optional[Iterable[str]] )
return [existing_req], existing_req
Add install_req as a requirement to install. :param parent_req_name: The name of the requirement that needed this added. The name is used because when multiple unnamed requirements resolve to the same name, we could otherwise end up with dependency links that point outs...
Add install_req as a requirement to install.
[ "Add", "install_req", "as", "a", "requirement", "to", "install", "." ]
def add_requirement( self, install_req, # type: InstallRequirement parent_req_name=None, # type: Optional[str] extras_requested=None # type: Optional[Iterable[str]] ): # type: (...) -> Tuple[List[InstallRequirement], Optional[InstallRequirement]] """Add inst...
[ "def", "add_requirement", "(", "self", ",", "install_req", ",", "# type: InstallRequirement", "parent_req_name", "=", "None", ",", "# type: Optional[str]", "extras_requested", "=", "None", "# type: Optional[Iterable[str]]", ")", ":", "# type: (...) -> Tuple[List[InstallRequirem...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/req/req_set.py#L131-L357
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MuonAlignmentAlgorithms/scripts/alignmentValidation.py
python
createCanvasToIDList
(fname="canvas2id_list.js")
return list(set_ids)
Writes out a canvas-2-ids list include for the browser. Write out only those canvases which have existing filename.png plots. Returns: list of unique IDs that have existing filename.png plots.
Writes out a canvas-2-ids list include for the browser. Write out only those canvases which have existing filename.png plots. Returns: list of unique IDs that have existing filename.png plots.
[ "Writes", "out", "a", "canvas", "-", "2", "-", "ids", "list", "include", "for", "the", "browser", ".", "Write", "out", "only", "those", "canvases", "which", "have", "existing", "filename", ".", "png", "plots", ".", "Returns", ":", "list", "of", "unique",...
def createCanvasToIDList(fname="canvas2id_list.js"): '''Writes out a canvas-2-ids list include for the browser. Write out only those canvases which have existing filename.png plots. Returns: list of unique IDs that have existing filename.png plots. ''' CANVAS2ID_LIST = [] ID_LIST = [] ...
[ "def", "createCanvasToIDList", "(", "fname", "=", "\"canvas2id_list.js\"", ")", ":", "CANVAS2ID_LIST", "=", "[", "]", "ID_LIST", "=", "[", "]", "for", "scope", "in", "CANVASES_LIST_TEMPLATE", ":", "if", "len", "(", "scope", ")", ">", "2", ":", "for", "canv...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignmentAlgorithms/scripts/alignmentValidation.py#L882-L909
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ListCtrl.GetItemTextColour
(*args, **kwargs)
return _controls_.ListCtrl_GetItemTextColour(*args, **kwargs)
GetItemTextColour(self, long item) -> Colour
GetItemTextColour(self, long item) -> Colour
[ "GetItemTextColour", "(", "self", "long", "item", ")", "-", ">", "Colour" ]
def GetItemTextColour(*args, **kwargs): """GetItemTextColour(self, long item) -> Colour""" return _controls_.ListCtrl_GetItemTextColour(*args, **kwargs)
[ "def", "GetItemTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_GetItemTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4740-L4742
MhLiao/TextBoxes_plusplus
39d4898de1504c53a2ed3d67966a57b3595836d0
scripts/cpp_lint.py
python
CheckForBadCharacters
(filename, lines, error)
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
Logs an error for each line containing bad characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ",", "'reada...
https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/scripts/cpp_lint.py#L1483-L1505
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
catboost/python-package/catboost/core.py
python
CatBoostClassifier.predict
(self, data, prediction_type='Class', ntree_start=0, ntree_end=0, thread_count=-1, verbose=None, task_type="CPU")
return self._predict(data, prediction_type, ntree_start, ntree_end, thread_count, verbose, 'predict', task_type)
Predict with data. Parameters ---------- data : catboost.Pool or list of features or list of lists or numpy.ndarray or pandas.DataFrame or pandas.Series or catboost.FeaturesData Data to apply model on. If data is a simple list (not list of lists) or a one...
Predict with data.
[ "Predict", "with", "data", "." ]
def predict(self, data, prediction_type='Class', ntree_start=0, ntree_end=0, thread_count=-1, verbose=None, task_type="CPU"): """ Predict with data. Parameters ---------- data : catboost.Pool or list of features or list of lists or numpy.ndarray or pandas.DataFrame or pandas.Ser...
[ "def", "predict", "(", "self", ",", "data", ",", "prediction_type", "=", "'Class'", ",", "ntree_start", "=", "0", ",", "ntree_end", "=", "0", ",", "thread_count", "=", "-", "1", ",", "verbose", "=", "None", ",", "task_type", "=", "\"CPU\"", ")", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/core.py#L4926-L4977
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/buildtime_helpers/win_tool.py
python
WinTool.ExecActionWrapper
(self, arch, rspfile, *dir)
return subprocess.call(args, shell=True, env=env, cwd=dir)
Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.
Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.
[ "Runs", "an", "action", "command", "line", "from", "a", "response", "file", "using", "the", "environment", "for", "|arch|", ".", "If", "|dir|", "is", "supplied", "use", "that", "as", "the", "working", "directory", "." ]
def ExecActionWrapper(self, arch, rspfile, *dir): """Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.""" env = self._GetEnv(arch) # TODO(scottmg): This is a temporary hack to get some specific variables # thro...
[ "def", "ExecActionWrapper", "(", "self", ",", "arch", ",", "rspfile", ",", "*", "dir", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "# TODO(scottmg): This is a temporary hack to get some specific variables", "# through to actions that are set after gyp-...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/buildtime_helpers/win_tool.py#L281-L292
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py
python
Proxy.get
(self)
return self._subject
Retrieve the entire wrapped object
Retrieve the entire wrapped object
[ "Retrieve", "the", "entire", "wrapped", "object" ]
def get(self): """Retrieve the entire wrapped object""" return self._subject
[ "def", "get", "(", "self", ")", ":", "return", "self", ".", "_subject" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py#L526-L528
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cppclean/cpp/ast.py
python
ASTBuilder.get_name
(self, seq=None)
return tokens, next_token
Returns ([tokens], next_token_info).
Returns ([tokens], next_token_info).
[ "Returns", "(", "[", "tokens", "]", "next_token_info", ")", "." ]
def get_name(self, seq=None): """Returns ([tokens], next_token_info).""" get_next_token = self._get_next_token if seq is not None: it = iter(seq) get_next_token = lambda: next(it) next_token = get_next_token() tokens = [] last_token_was_name = Fals...
[ "def", "get_name", "(", "self", ",", "seq", "=", "None", ")", ":", "get_next_token", "=", "self", ".", "_get_next_token", "if", "seq", "is", "not", "None", ":", "it", "=", "iter", "(", "seq", ")", "get_next_token", "=", "lambda", ":", "next", "(", "i...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cppclean/cpp/ast.py#L944-L968
interpretml/interpret
29466bffc04505fe4f836a83fcfebfd313ac8454
python/interpret-core/interpret/visual/interactive.py
python
set_show_addr
(addr)
Set a (ip, port) for inline visualizations and dashboard. Has side effects stated below. Side effect: restarts the app runner for 'show' method. Args: addr: (ip, port) tuple as address to assign show method to. Returns: None.
Set a (ip, port) for inline visualizations and dashboard. Has side effects stated below. Side effect: restarts the app runner for 'show' method.
[ "Set", "a", "(", "ip", "port", ")", "for", "inline", "visualizations", "and", "dashboard", ".", "Has", "side", "effects", "stated", "below", ".", "Side", "effect", ":", "restarts", "the", "app", "runner", "for", "show", "method", "." ]
def set_show_addr(addr): """ Set a (ip, port) for inline visualizations and dashboard. Has side effects stated below. Side effect: restarts the app runner for 'show' method. Args: addr: (ip, port) tuple as address to assign show method to. Returns: None. """ addr = (addr[0], int...
[ "def", "set_show_addr", "(", "addr", ")", ":", "addr", "=", "(", "addr", "[", "0", "]", ",", "int", "(", "addr", "[", "1", "]", ")", ")", "init_show_server", "(", "addr", ")" ]
https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/visual/interactive.py#L40-L50
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/chebyshev.py
python
Chebyshev.interpolate
(cls, func, deg, domain=None, args=())
return cls(coef, domain=domain)
Interpolate a function at the Chebyshev points of the first kind. Returns the series that interpolates `func` at the Chebyshev points of the first kind scaled and shifted to the `domain`. The resulting series tends to a minmax approximation of `func` when the function is continuous in t...
Interpolate a function at the Chebyshev points of the first kind.
[ "Interpolate", "a", "function", "at", "the", "Chebyshev", "points", "of", "the", "first", "kind", "." ]
def interpolate(cls, func, deg, domain=None, args=()): """Interpolate a function at the Chebyshev points of the first kind. Returns the series that interpolates `func` at the Chebyshev points of the first kind scaled and shifted to the `domain`. The resulting series tends to a minmax ap...
[ "def", "interpolate", "(", "cls", ",", "func", ",", "deg", ",", "domain", "=", "None", ",", "args", "=", "(", ")", ")", ":", "if", "domain", "is", "None", ":", "domain", "=", "cls", ".", "domain", "xfunc", "=", "lambda", "x", ":", "func", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/chebyshev.py#L2030-L2069
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/decoder.py
python
MessageDecoder
(field_number, is_repeated, is_packed, key, new_default)
Returns a decoder for a message field.
Returns a decoder for a message field.
[ "Returns", "a", "decoder", "for", "a", "message", "field", "." ]
def MessageDecoder(field_number, is_repeated, is_packed, key, new_default): """Returns a decoder for a message field.""" local_DecodeVarint = _DecodeVarint assert not is_packed if is_repeated: tag_bytes = encoder.TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED...
[ "def", "MessageDecoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ",", "key", ",", "new_default", ")", ":", "local_DecodeVarint", "=", "_DecodeVarint", "assert", "not", "is_packed", "if", "is_repeated", ":", "tag_bytes", "=", "encoder", ".", "T...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/decoder.py#L591-L638
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/turtle.py
python
TPen.fillcolor
(self, *args)
Return or set the fillcolor. Arguments: Four input formats are allowed: - fillcolor() Return the current fillcolor as color specification string, possibly in hex-number format (see example). May be used as input to another color/pencolor/fillcolor call. ...
Return or set the fillcolor.
[ "Return", "or", "set", "the", "fillcolor", "." ]
def fillcolor(self, *args): """ Return or set the fillcolor. Arguments: Four input formats are allowed: - fillcolor() Return the current fillcolor as color specification string, possibly in hex-number format (see example). May be used as input to an...
[ "def", "fillcolor", "(", "self", ",", "*", "args", ")", ":", "if", "args", ":", "color", "=", "self", ".", "_colorstr", "(", "args", ")", "if", "color", "==", "self", ".", "_fillcolor", ":", "return", "self", ".", "pen", "(", "fillcolor", "=", "col...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/turtle.py#L2174-L2208
BSVino/DoubleAction
c550b168a3e919926c198c30240f506538b92e75
mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeUint32
(self)
return result
Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed.
Consumes an unsigned 32bit integer number.
[ "Consumes", "an", "unsigned", "32bit", "integer", "number", "." ]
def ConsumeUint32(self): """Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed. """ try: result = self._ParseInteger(self.token, is_signed=False, is_long=False) except ValueError, e: ...
[ "def", "ConsumeUint32", "(", "self", ")", ":", "try", ":", "result", "=", "self", ".", "_ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "False", ",", "is_long", "=", "False", ")", "except", "ValueError", ",", "e", ":", "raise", "self"...
https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py#L426-L440
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_utils.py
python
raise_error_unsupported_scenario
(message, layer_type, layer_name)
Raise an error if an scenario is not supported.
Raise an error if an scenario is not supported.
[ "Raise", "an", "error", "if", "an", "scenario", "is", "not", "supported", "." ]
def raise_error_unsupported_scenario(message, layer_type, layer_name): """ Raise an error if an scenario is not supported. """ raise RuntimeError( "Unsupported scenario '%s' in layer %s(%s)" % (message, layer_type, layer_name) )
[ "def", "raise_error_unsupported_scenario", "(", "message", ",", "layer_type", ",", "layer_name", ")", ":", "raise", "RuntimeError", "(", "\"Unsupported scenario '%s' in layer %s(%s)\"", "%", "(", "message", ",", "layer_type", ",", "layer_name", ")", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_utils.py#L28-L34
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
Slider.GetMax
(*args, **kwargs)
return _controls_.Slider_GetMax(*args, **kwargs)
GetMax(self) -> int
GetMax(self) -> int
[ "GetMax", "(", "self", ")", "-", ">", "int" ]
def GetMax(*args, **kwargs): """GetMax(self) -> int""" return _controls_.Slider_GetMax(*args, **kwargs)
[ "def", "GetMax", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Slider_GetMax", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2860-L2862
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetPerTargetSetting
(self, setting, default=None)
return result
Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.
Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.
[ "Tries", "to", "get", "xcode_settings", ".", "setting", "from", "spec", ".", "Assumes", "that", "the", "setting", "has", "the", "same", "value", "in", "all", "configurations", "and", "throws", "otherwise", "." ]
def GetPerTargetSetting(self, setting, default=None): """Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.""" is_first_pass = True result = None for configname in sorted(self.xcode_settings.keys()): if is_f...
[ "def", "GetPerTargetSetting", "(", "self", ",", "setting", ",", "default", "=", "None", ")", ":", "is_first_pass", "=", "True", "result", "=", "None", "for", "configname", "in", "sorted", "(", "self", ".", "xcode_settings", ".", "keys", "(", ")", ")", ":...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/xcode_emulation.py#L716-L731
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/site.py
python
check_enableusersite
()
return True
Check if user site directory is safe for inclusion The function tests for the command line flag (including environment var), process uid/gid equal to effective uid/gid. None: Disabled for security reasons False: Disabled by user (command line option) True: Safe and enabled
Check if user site directory is safe for inclusion
[ "Check", "if", "user", "site", "directory", "is", "safe", "for", "inclusion" ]
def check_enableusersite(): """Check if user site directory is safe for inclusion The function tests for the command line flag (including environment var), process uid/gid equal to effective uid/gid. None: Disabled for security reasons False: Disabled by user (command line option) True: Safe a...
[ "def", "check_enableusersite", "(", ")", ":", "if", "sys", ".", "flags", ".", "no_user_site", ":", "return", "False", "if", "hasattr", "(", "os", ",", "\"getuid\"", ")", "and", "hasattr", "(", "os", ",", "\"geteuid\"", ")", ":", "# check process uid == effec...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/site.py#L191-L213
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/libs/metaparse/tools/benchmark/benchmark.py
python
compiler_info
(compiler)
return compiler
Determine the name + version of the compiler
Determine the name + version of the compiler
[ "Determine", "the", "name", "+", "version", "of", "the", "compiler" ]
def compiler_info(compiler): """Determine the name + version of the compiler""" (out, err) = subprocess.Popen( ['/bin/sh', '-c', '{0} -v'.format(compiler)], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE ).communicate('') gcc_clang = re.compile('(g...
[ "def", "compiler_info", "(", "compiler", ")", ":", "(", "out", ",", "err", ")", "=", "subprocess", ".", "Popen", "(", "[", "'/bin/sh'", ",", "'-c'", ",", "'{0} -v'", ".", "format", "(", "compiler", ")", "]", ",", "stdin", "=", "subprocess", ".", "PIP...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/libs/metaparse/tools/benchmark/benchmark.py#L76-L92
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/io/idl.py
python
_read_bytes
(f, n)
return f.read(n)
Read the next `n` bytes
Read the next `n` bytes
[ "Read", "the", "next", "n", "bytes" ]
def _read_bytes(f, n): '''Read the next `n` bytes''' return f.read(n)
[ "def", "_read_bytes", "(", "f", ",", "n", ")", ":", "return", "f", ".", "read", "(", "n", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/idl.py#L93-L95
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/bindings/python/clang/cindex.py
python
Type.get_align
(self)
return conf.lib.clang_Type_getAlignOf(self)
Retrieve the alignment of the record.
Retrieve the alignment of the record.
[ "Retrieve", "the", "alignment", "of", "the", "record", "." ]
def get_align(self): """ Retrieve the alignment of the record. """ return conf.lib.clang_Type_getAlignOf(self)
[ "def", "get_align", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_Type_getAlignOf", "(", "self", ")" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L2378-L2382
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py
python
Locator.locate
(self, requirement, prereleases=False)
return result
Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to ...
[]
def locate(self, requirement, prereleases=False): """ Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: ...
[ "def", "locate", "(", "self", ",", "requirement", ",", "prereleases", "=", "False", ")", ":", "result", "=", "None", "r", "=", "parse_requirement", "(", "requirement", ")", "if", "r", "is", "None", ":", "# pragma: no cover", "raise", "DistlibException", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py#L701-L815
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/slim/python/slim/queues.py
python
QueueRunners
(session)
Creates a context manager that handles starting and stopping queue runners. Args: session: the currently running session. Yields: a context in which queues are run. Raises: NestedQueueRunnerError: if a QueueRunners context is nested within another.
Creates a context manager that handles starting and stopping queue runners.
[ "Creates", "a", "context", "manager", "that", "handles", "starting", "and", "stopping", "queue", "runners", "." ]
def QueueRunners(session): """Creates a context manager that handles starting and stopping queue runners. Args: session: the currently running session. Yields: a context in which queues are run. Raises: NestedQueueRunnerError: if a QueueRunners context is nested within another. """ if not _qu...
[ "def", "QueueRunners", "(", "session", ")", ":", "if", "not", "_queue_runner_lock", ".", "acquire", "(", "False", ")", ":", "raise", "NestedQueueRunnerError", "(", "'QueueRunners cannot be nested'", ")", "coord", "=", "coordinator", ".", "Coordinator", "(", ")", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/slim/python/slim/queues.py#L44-L71
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/openvino/runtime/utils/node_factory.py
python
NodeFactory._normalize_attr_name_setter
(cls, attr_name: str)
return cls._normalize_attr_name(attr_name, "set_")
Normalize attribute name to be suitable for setter function name. :param attr_name: The attribute name to normalize :return: The appropriate setter function name.
Normalize attribute name to be suitable for setter function name.
[ "Normalize", "attribute", "name", "to", "be", "suitable", "for", "setter", "function", "name", "." ]
def _normalize_attr_name_setter(cls, attr_name: str) -> str: """Normalize attribute name to be suitable for setter function name. :param attr_name: The attribute name to normalize :return: The appropriate setter function name. """ return cls._normalize_attr_name(attr_na...
[ "def", "_normalize_attr_name_setter", "(", "cls", ",", "attr_name", ":", "str", ")", "->", "str", ":", "return", "cls", ".", "_normalize_attr_name", "(", "attr_name", ",", "\"set_\"", ")" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/openvino/runtime/utils/node_factory.py#L132-L139
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/hooks.py
python
BaseEventHooks._verify_accept_kwargs
(self, func)
Verifies a callable accepts kwargs :type func: callable :param func: A callable object. :returns: True, if ``func`` accepts kwargs, otherwise False.
Verifies a callable accepts kwargs
[ "Verifies", "a", "callable", "accepts", "kwargs" ]
def _verify_accept_kwargs(self, func): """Verifies a callable accepts kwargs :type func: callable :param func: A callable object. :returns: True, if ``func`` accepts kwargs, otherwise False. """ try: if not accepts_kwargs(func): raise ValueE...
[ "def", "_verify_accept_kwargs", "(", "self", ",", "func", ")", ":", "try", ":", "if", "not", "accepts_kwargs", "(", "func", ")", ":", "raise", "ValueError", "(", "\"Event handler %s must accept keyword \"", "\"arguments (**kwargs)\"", "%", "func", ")", "except", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/hooks.py#L149-L163
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/attrs/attr/_make.py
python
_add_repr
(cls, ns=None, attrs=None)
return cls
Add a repr method to *cls*.
Add a repr method to *cls*.
[ "Add", "a", "repr", "method", "to", "*", "cls", "*", "." ]
def _add_repr(cls, ns=None, attrs=None): """ Add a repr method to *cls*. """ if attrs is None: attrs = cls.__attrs_attrs__ cls.__repr__ = _make_repr(attrs, ns) return cls
[ "def", "_add_repr", "(", "cls", ",", "ns", "=", "None", ",", "attrs", "=", "None", ")", ":", "if", "attrs", "is", "None", ":", "attrs", "=", "cls", ".", "__attrs_attrs__", "cls", ".", "__repr__", "=", "_make_repr", "(", "attrs", ",", "ns", ")", "re...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/_make.py#L1906-L1914
tum-vision/fusenet
a1451be2971b348a01b0f525c2a3a7a0e215a591
python/caffe/io.py
python
array_to_datum
(arr, label=None)
return datum
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
[ "Converts", "a", "3", "-", "dimensional", "array", "to", "datum", ".", "If", "the", "array", "has", "dtype", "uint8", "the", "output", "data", "will", "be", "encoded", "as", "a", "string", ".", "Otherwise", "the", "output", "data", "will", "be", "stored"...
def array_to_datum(arr, label=None): """Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format. """ if arr.ndim != 3: raise ValueError('Incorrect array shape.') datum = ...
[ "def", "array_to_datum", "(", "arr", ",", "label", "=", "None", ")", ":", "if", "arr", ".", "ndim", "!=", "3", ":", "raise", "ValueError", "(", "'Incorrect array shape.'", ")", "datum", "=", "caffe_pb2", ".", "Datum", "(", ")", "datum", ".", "channels", ...
https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/python/caffe/io.py#L66-L81
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Misc._register
(self, func, subst=None, needcleanup=1)
return name
Return a newly created Tcl function. If this function is called, the Python function FUNC will be executed. An optional function SUBST can be given which will be executed before FUNC.
Return a newly created Tcl function. If this function is called, the Python function FUNC will be executed. An optional function SUBST can be given which will be executed before FUNC.
[ "Return", "a", "newly", "created", "Tcl", "function", ".", "If", "this", "function", "is", "called", "the", "Python", "function", "FUNC", "will", "be", "executed", ".", "An", "optional", "function", "SUBST", "can", "be", "given", "which", "will", "be", "ex...
def _register(self, func, subst=None, needcleanup=1): """Return a newly created Tcl function. If this function is called, the Python function FUNC will be executed. An optional function SUBST can be given which will be executed before FUNC.""" f = CallWrapper(func, subst, self)._...
[ "def", "_register", "(", "self", ",", "func", ",", "subst", "=", "None", ",", "needcleanup", "=", "1", ")", ":", "f", "=", "CallWrapper", "(", "func", ",", "subst", ",", "self", ")", ".", "__call__", "name", "=", "repr", "(", "id", "(", "f", ")",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1357-L1377
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/msvs_emulation.py
python
ExpandMacros
(string, expansions)
return string
Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv for the canonical way to retrieve a suitable dict.
Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv for the canonical way to retrieve a suitable dict.
[ "Expand", "$", "(", "Variable", ")", "per", "expansions", "dict", ".", "See", "MsvsSettings", ".", "GetVSMacroEnv", "for", "the", "canonical", "way", "to", "retrieve", "a", "suitable", "dict", "." ]
def ExpandMacros(string, expansions): """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv for the canonical way to retrieve a suitable dict.""" if '$' in string: for old, new in expansions.items(): assert '$(' not in new, new string = string.replace(old, new) return string
[ "def", "ExpandMacros", "(", "string", ",", "expansions", ")", ":", "if", "'$'", "in", "string", ":", "for", "old", ",", "new", "in", "expansions", ".", "items", "(", ")", ":", "assert", "'$('", "not", "in", "new", ",", "new", "string", "=", "string",...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/msvs_emulation.py#L859-L866
libornovax/master_thesis_code
6eca474ed3cae673afde010caef338cf7349f839
caffe/python/caffe/io.py
python
array_to_datum
(arr, label=None)
return datum
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format.
[ "Converts", "a", "3", "-", "dimensional", "array", "to", "datum", ".", "If", "the", "array", "has", "dtype", "uint8", "the", "output", "data", "will", "be", "encoded", "as", "a", "string", ".", "Otherwise", "the", "output", "data", "will", "be", "stored"...
def array_to_datum(arr, label=None): """Converts a 3-dimensional array to datum. If the array has dtype uint8, the output data will be encoded as a string. Otherwise, the output data will be stored in float format. """ if arr.ndim != 3: raise ValueError('Incorrect array shape.') datum = ...
[ "def", "array_to_datum", "(", "arr", ",", "label", "=", "None", ")", ":", "if", "arr", ".", "ndim", "!=", "3", ":", "raise", "ValueError", "(", "'Incorrect array shape.'", ")", "datum", "=", "caffe_pb2", ".", "Datum", "(", ")", "datum", ".", "channels", ...
https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/caffe/python/caffe/io.py#L66-L81
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
python-threatexchange/threatexchange/api.py
python
ThreatExchangeAPI.get_threat_descriptors
(self, ids, **kwargs)
return descriptors
Looks up all metadata for given IDs.
Looks up all metadata for given IDs.
[ "Looks", "up", "all", "metadata", "for", "given", "IDs", "." ]
def get_threat_descriptors(self, ids, **kwargs): """ Looks up all metadata for given IDs. """ verbose = kwargs.get("verbose", False) showURLs = kwargs.get("showURLs", False) includeIndicatorInOutput = kwargs.get("includeIndicatorInOutput", True) default_fields = ...
[ "def", "get_threat_descriptors", "(", "self", ",", "ids", ",", "*", "*", "kwargs", ")", ":", "verbose", "=", "kwargs", ".", "get", "(", "\"verbose\"", ",", "False", ")", "showURLs", "=", "kwargs", ".", "get", "(", "\"showURLs\"", ",", "False", ")", "in...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/api.py#L192-L274
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/caffe-mnc/tools/extra/extract_seconds.py
python
get_start_time
(line_iterable, year)
return start_datetime
Find start time from group of lines
Find start time from group of lines
[ "Find", "start", "time", "from", "group", "of", "lines" ]
def get_start_time(line_iterable, year): """Find start time from group of lines """ start_datetime = None for line in line_iterable: line = line.strip() if line.find('Solving') != -1: start_datetime = extract_datetime_from_line(line, year) break return start_...
[ "def", "get_start_time", "(", "line_iterable", ",", "year", ")", ":", "start_datetime", "=", "None", "for", "line", "in", "line_iterable", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "line", ".", "find", "(", "'Solving'", ")", "!=", "-", "1...
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/tools/extra/extract_seconds.py#L31-L41
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextEvent.GetToken
(*args, **kwargs)
return _stc.StyledTextEvent_GetToken(*args, **kwargs)
GetToken(self) -> int
GetToken(self) -> int
[ "GetToken", "(", "self", ")", "-", ">", "int" ]
def GetToken(*args, **kwargs): """GetToken(self) -> int""" return _stc.StyledTextEvent_GetToken(*args, **kwargs)
[ "def", "GetToken", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_GetToken", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L7190-L7192
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/mount.py
python
CephFSMount.kill_background
(self, p)
For a process that was returned by one of the _background member functions, kill it hard.
For a process that was returned by one of the _background member functions, kill it hard.
[ "For", "a", "process", "that", "was", "returned", "by", "one", "of", "the", "_background", "member", "functions", "kill", "it", "hard", "." ]
def kill_background(self, p): """ For a process that was returned by one of the _background member functions, kill it hard. """ self._kill_background(p) self.background_procs.remove(p)
[ "def", "kill_background", "(", "self", ",", "p", ")", ":", "self", ".", "_kill_background", "(", "p", ")", "self", ".", "background_procs", ".", "remove", "(", "p", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/mount.py#L1128-L1134
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py
python
NeuralNetworkBuilder.add_elementwise
(self, name, input_names, output_name, mode, alpha=None)
return spec_layer
Add an element-wise operation layer to the model. Refer to the specification (NeuralNetwork.proto) for more details. Parameters ---------- name: str The name of this layer. input_names: list of str A list of input blob names of this layer. The input blobs...
Add an element-wise operation layer to the model. Refer to the specification (NeuralNetwork.proto) for more details.
[ "Add", "an", "element", "-", "wise", "operation", "layer", "to", "the", "model", ".", "Refer", "to", "the", "specification", "(", "NeuralNetwork", ".", "proto", ")", "for", "more", "details", "." ]
def add_elementwise(self, name, input_names, output_name, mode, alpha=None): """ Add an element-wise operation layer to the model. Refer to the specification (NeuralNetwork.proto) for more details. Parameters ---------- name: str The name of this layer. ...
[ "def", "add_elementwise", "(", "self", ",", "name", ",", "input_names", ",", "output_name", ",", "mode", ",", "alpha", "=", "None", ")", ":", "input_names", "=", "input_names", "if", "isinstance", "(", "input_names", ",", "list", ")", "else", "[", "input_n...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L1712-L1776
libocca/occa
83b48a6d87a22fb55ae79412206d1dc3b14811fb
scripts/docs/api_docgen/xml_utils.py
python
get_node_attributes
(node: Any, query: Optional[str]=None)
return {}
Get the attributes as a dict
Get the attributes as a dict
[ "Get", "the", "attributes", "as", "a", "dict" ]
def get_node_attributes(node: Any, query: Optional[str]=None): ''' Get the attributes as a dict ''' found_node = node if query is not None: found_node = node.find(query) if found_node is not None: return dict(found_node.attrib) return {}
[ "def", "get_node_attributes", "(", "node", ":", "Any", ",", "query", ":", "Optional", "[", "str", "]", "=", "None", ")", ":", "found_node", "=", "node", "if", "query", "is", "not", "None", ":", "found_node", "=", "node", ".", "find", "(", "query", ")...
https://github.com/libocca/occa/blob/83b48a6d87a22fb55ae79412206d1dc3b14811fb/scripts/docs/api_docgen/xml_utils.py#L51-L62
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/setobj.py
python
_SetPayload.ptr
(self)
return self._ptr
A pointer to the start of the NRT-allocated area.
A pointer to the start of the NRT-allocated area.
[ "A", "pointer", "to", "the", "start", "of", "the", "NRT", "-", "allocated", "area", "." ]
def ptr(self): """ A pointer to the start of the NRT-allocated area. """ return self._ptr
[ "def", "ptr", "(", "self", ")", ":", "return", "self", ".", "_ptr" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/setobj.py#L157-L161
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py
python
Laplace.get_batch_shape
(self)
return self._batch_shape
`TensorShape` available at graph construction time. Same meaning as `batch_shape`. May be only partially defined. Returns: batch shape
`TensorShape` available at graph construction time.
[ "TensorShape", "available", "at", "graph", "construction", "time", "." ]
def get_batch_shape(self): """`TensorShape` available at graph construction time. Same meaning as `batch_shape`. May be only partially defined. Returns: batch shape """ return self._batch_shape
[ "def", "get_batch_shape", "(", "self", ")", ":", "return", "self", ".", "_batch_shape" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py#L128-L136
goldeneye-source/ges-code
2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d
thirdparty/protobuf-2.3.0/python/mox.py
python
Mox.ReplayAll
(self)
Set all mock objects to replay mode.
Set all mock objects to replay mode.
[ "Set", "all", "mock", "objects", "to", "replay", "mode", "." ]
def ReplayAll(self): """Set all mock objects to replay mode.""" for mock_obj in self._mock_objects: mock_obj._Replay()
[ "def", "ReplayAll", "(", "self", ")", ":", "for", "mock_obj", "in", "self", ".", "_mock_objects", ":", "mock_obj", ".", "_Replay", "(", ")" ]
https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/mox.py#L189-L193
s9xie/hed
94fb22f10cbfec8d84fbc0642b224022014b6bd6
scripts/cpp_lint.py
python
IsErrorSuppressedByNolint
(category, linenum)
return (linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set()))
Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: bool, True iff the error...
Returns true if the specified error category is suppressed on this line.
[ "Returns", "true", "if", "the", "specified", "error", "category", "is", "suppressed", "on", "this", "line", "." ]
def IsErrorSuppressedByNolint(category, linenum): """Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the curre...
[ "def", "IsErrorSuppressedByNolint", "(", "category", ",", "linenum", ")", ":", "return", "(", "linenum", "in", "_error_suppressions", ".", "get", "(", "category", ",", "set", "(", ")", ")", "or", "linenum", "in", "_error_suppressions", ".", "get", "(", "None...
https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L500-L513
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/sax/handler.py
python
ContentHandler.setDocumentLocator
(self, locator)
Called by the parser to give the application a locator for locating the origin of document events. SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before ...
Called by the parser to give the application a locator for locating the origin of document events.
[ "Called", "by", "the", "parser", "to", "give", "the", "application", "a", "locator", "for", "locating", "the", "origin", "of", "document", "events", "." ]
def setDocumentLocator(self, locator): """Called by the parser to give the application a locator for locating the origin of document events. SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the...
[ "def", "setDocumentLocator", "(", "self", ",", "locator", ")", ":", "self", ".", "_locator", "=", "locator" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/sax/handler.py#L57-L78
moflow/moflow
2dfb27c799c90c6caf1477508eca3eec616ef7d2
bap/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.Consume
(self, token)
Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed.
Consumes a piece of text.
[ "Consumes", "a", "piece", "of", "text", "." ]
def Consume(self, token): """Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed. """ if not self.TryConsume(token): raise self._ParseError('Expected "%s".' % token)
[ "def", "Consume", "(", "self", ",", "token", ")", ":", "if", "not", "self", ".", "TryConsume", "(", "token", ")", ":", "raise", "self", ".", "_ParseError", "(", "'Expected \"%s\".'", "%", "token", ")" ]
https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py#L368-L378
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/_peak_finding.py
python
_arg_x_as_expected
(value)
return value
Ensure argument `x` is a 1D C-contiguous array of dtype('float64'). Used in `find_peaks`, `peak_prominences` and `peak_widths` to make `x` compatible with the signature of the wrapped Cython functions. Returns ------- value : ndarray A one-dimensional C-contiguous array with dtype('float64...
Ensure argument `x` is a 1D C-contiguous array of dtype('float64').
[ "Ensure", "argument", "x", "is", "a", "1D", "C", "-", "contiguous", "array", "of", "dtype", "(", "float64", ")", "." ]
def _arg_x_as_expected(value): """Ensure argument `x` is a 1D C-contiguous array of dtype('float64'). Used in `find_peaks`, `peak_prominences` and `peak_widths` to make `x` compatible with the signature of the wrapped Cython functions. Returns ------- value : ndarray A one-dimensional ...
[ "def", "_arg_x_as_expected", "(", "value", ")", ":", "value", "=", "np", ".", "asarray", "(", "value", ",", "order", "=", "'C'", ",", "dtype", "=", "np", ".", "float64", ")", "if", "value", ".", "ndim", "!=", "1", ":", "raise", "ValueError", "(", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/_peak_finding.py#L253-L267
mongodb/mongo-cxx-driver
eb86512b05be20d2f51d53ba9b860c709e0799b3
etc/clang_format.py
python
_lint_files
(clang_format, files)
Lint a list of files with clang-format
Lint a list of files with clang-format
[ "Lint", "a", "list", "of", "files", "with", "clang", "-", "format" ]
def _lint_files(clang_format, files): """Lint a list of files with clang-format """ clang_format = ClangFormat(clang_format, _get_build_dir()) lint_clean = parallel_process([os.path.abspath(f) for f in files], clang_format.lint) if not lint_clean: print("ERROR: Code Style does not match co...
[ "def", "_lint_files", "(", "clang_format", ",", "files", ")", ":", "clang_format", "=", "ClangFormat", "(", "clang_format", ",", "_get_build_dir", "(", ")", ")", "lint_clean", "=", "parallel_process", "(", "[", "os", ".", "path", ".", "abspath", "(", "f", ...
https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/clang_format.py#L659-L668
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
qtdefines.py
python
bmp_binary
(header, pixels)
return header_str + pixels
It takes a header (based on default_bmp_header), the pixel data (from structs, as produced by get_color and row_padding), and writes it to filename
It takes a header (based on default_bmp_header), the pixel data (from structs, as produced by get_color and row_padding), and writes it to filename
[ "It", "takes", "a", "header", "(", "based", "on", "default_bmp_header", ")", "the", "pixel", "data", "(", "from", "structs", "as", "produced", "by", "get_color", "and", "row_padding", ")", "and", "writes", "it", "to", "filename" ]
def bmp_binary(header, pixels): '''It takes a header (based on default_bmp_header), the pixel data (from structs, as produced by get_color and row_padding), and writes it to filename''' header_str = "" header_str += struct.pack('<B', header['mn1']) header_str += struct.pack('<B', header['mn2']) he...
[ "def", "bmp_binary", "(", "header", ",", "pixels", ")", ":", "header_str", "=", "\"\"", "header_str", "+=", "struct", ".", "pack", "(", "'<B'", ",", "header", "[", "'mn1'", "]", ")", "header_str", "+=", "struct", ".", "pack", "(", "'<B'", ",", "header"...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/qtdefines.py#L901-L923
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/displayhook.py
python
DisplayHook.write_format_data
(self, format_dict, md_dict=None)
Write the format data dict to the frontend. This default version of this method simply writes the plain text representation of the object to ``sys.stdout``. Subclasses should override this method to send the entire `format_dict` to the frontends. Parameters ---------- ...
Write the format data dict to the frontend.
[ "Write", "the", "format", "data", "dict", "to", "the", "frontend", "." ]
def write_format_data(self, format_dict, md_dict=None) -> None: """Write the format data dict to the frontend. This default version of this method simply writes the plain text representation of the object to ``sys.stdout``. Subclasses should override this method to send the entire `form...
[ "def", "write_format_data", "(", "self", ",", "format_dict", ",", "md_dict", "=", "None", ")", "->", "None", ":", "if", "'text/plain'", "not", "in", "format_dict", ":", "# nothing to do", "return", "# We want to print because we want to always make sure we have a", "# n...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/displayhook.py#L156-L195
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py
python
PosixSerial.setBreak
(self, level=1)
Set break: Controls TXD. When active, no transmitting is possible.
Set break: Controls TXD. When active, no transmitting is possible.
[ "Set", "break", ":", "Controls", "TXD", ".", "When", "active", "no", "transmitting", "is", "possible", "." ]
def setBreak(self, level=1): """Set break: Controls TXD. When active, no transmitting is possible.""" if self.fd is None: raise portNotOpenError if level: fcntl.ioctl(self.fd, TIOCSBRK) else: fcntl.ioctl(self.fd, TIOCCBRK)
[ "def", "setBreak", "(", "self", ",", "level", "=", "1", ")", ":", "if", "self", ".", "fd", "is", "None", ":", "raise", "portNotOpenError", "if", "level", ":", "fcntl", ".", "ioctl", "(", "self", ".", "fd", ",", "TIOCSBRK", ")", "else", ":", "fcntl"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py#L542-L548
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_uninstall.py
python
compress_for_rename
(paths)
return set(map(case_map.__getitem__, remaining)) | wildcards
Returns a set containing the paths that need to be renamed. This set may include directories when the original sequence of paths included every file on disk.
Returns a set containing the paths that need to be renamed.
[ "Returns", "a", "set", "containing", "the", "paths", "that", "need", "to", "be", "renamed", "." ]
def compress_for_rename(paths): """Returns a set containing the paths that need to be renamed. This set may include directories when the original sequence of paths included every file on disk. """ case_map = dict((os.path.normcase(p), p) for p in paths) remaining = set(case_map) unchecked =...
[ "def", "compress_for_rename", "(", "paths", ")", ":", "case_map", "=", "dict", "(", "(", "os", ".", "path", ".", "normcase", "(", "p", ")", ",", "p", ")", "for", "p", "in", "paths", ")", "remaining", "=", "set", "(", "case_map", ")", "unchecked", "...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_uninstall.py#L99-L134
google-ar/WebARonTango
e86965d2cbc652156b480e0fcf77c716745578cd
chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py
python
Function.ParseArgs
(self, arg_string)
return args
Parses a function arg string.
Parses a function arg string.
[ "Parses", "a", "function", "arg", "string", "." ]
def ParseArgs(self, arg_string): """Parses a function arg string.""" args = [] parts = arg_string.split(',') for arg_string in parts: arg = CreateArg(arg_string) if arg: args.append(arg) return args
[ "def", "ParseArgs", "(", "self", ",", "arg_string", ")", ":", "args", "=", "[", "]", "parts", "=", "arg_string", ".", "split", "(", "','", ")", "for", "arg_string", "in", "parts", ":", "arg", "=", "CreateArg", "(", "arg_string", ")", "if", "arg", ":"...
https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9263-L9271
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/sessions.py
python
SessionRedirectMixin.rebuild_method
(self, prepared_request, response)
When being redirected we may want to change the method of the request based on certain specs or browser behavior.
When being redirected we may want to change the method of the request based on certain specs or browser behavior.
[ "When", "being", "redirected", "we", "may", "want", "to", "change", "the", "method", "of", "the", "request", "based", "on", "certain", "specs", "or", "browser", "behavior", "." ]
def rebuild_method(self, prepared_request, response): """When being redirected we may want to change the method of the request based on certain specs or browser behavior. """ method = prepared_request.method # https://tools.ietf.org/html/rfc7231#section-6.4.4 if response...
[ "def", "rebuild_method", "(", "self", ",", "prepared_request", ",", "response", ")", ":", "method", "=", "prepared_request", ".", "method", "# https://tools.ietf.org/html/rfc7231#section-6.4.4", "if", "response", ".", "status_code", "==", "codes", ".", "see_other", "a...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/sessions.py#L314-L334
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
TypeHandler.WriteImmediateFormatTest
(self, func, file)
Writes a format test for an immediate version of a command.
Writes a format test for an immediate version of a command.
[ "Writes", "a", "format", "test", "for", "an", "immediate", "version", "of", "a", "command", "." ]
def WriteImmediateFormatTest(self, func, file): """Writes a format test for an immediate version of a command.""" pass
[ "def", "WriteImmediateFormatTest", "(", "self", ",", "func", ",", "file", ")", ":", "pass" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L2807-L2809
baidu/tera
dbcd28af792d879d961bf9fc7eb60de81b437646
src/sdk/python/TeraSdk.py
python
RowMutation.Destroy
(self)
销毁这个mutation,释放底层资源,以后不得再使用这个对象
销毁这个mutation,释放底层资源,以后不得再使用这个对象
[ "销毁这个mutation,释放底层资源,以后不得再使用这个对象" ]
def Destroy(self): """ 销毁这个mutation,释放底层资源,以后不得再使用这个对象 """ lib.tera_row_mutation_destroy(self.mutation)
[ "def", "Destroy", "(", "self", ")", ":", "lib", ".", "tera_row_mutation_destroy", "(", "self", ".", "mutation", ")" ]
https://github.com/baidu/tera/blob/dbcd28af792d879d961bf9fc7eb60de81b437646/src/sdk/python/TeraSdk.py#L414-L418
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeUint32
(self)
return result
Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed.
Consumes an unsigned 32bit integer number.
[ "Consumes", "an", "unsigned", "32bit", "integer", "number", "." ]
def ConsumeUint32(self): """Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed. """ try: result = self._ParseInteger(self.token, is_signed=False, is_long=False) except ValueError, e: ...
[ "def", "ConsumeUint32", "(", "self", ")", ":", "try", ":", "result", "=", "self", ".", "_ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "False", ",", "is_long", "=", "False", ")", "except", "ValueError", ",", "e", ":", "raise", "self"...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/text_format.py#L439-L453
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py
python
IRBuilder.xor
(self, lhs, rhs, name='')
Bitwise integer XOR: name = lhs ^ rhs
Bitwise integer XOR: name = lhs ^ rhs
[ "Bitwise", "integer", "XOR", ":", "name", "=", "lhs", "^", "rhs" ]
def xor(self, lhs, rhs, name=''): """ Bitwise integer XOR: name = lhs ^ rhs """
[ "def", "xor", "(", "self", ",", "lhs", ",", "rhs", ",", "name", "=", "''", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L458-L462
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/crywaflib/mscv_helper.py
python
get_msvc_versions
(conf, target, arch, verbose)
return sdks, msvcs
Requests from cache all the installed MSVC and WinSDK that support the given target/arch tuple Returns two dictionaries of key (version) and value (installation) The type of the returned installation is the same as returned from get_winsdk_for_target() and get_msvc_for_target_arch()
Requests from cache all the installed MSVC and WinSDK that support the given target/arch tuple Returns two dictionaries of key (version) and value (installation) The type of the returned installation is the same as returned from get_winsdk_for_target() and get_msvc_for_target_arch()
[ "Requests", "from", "cache", "all", "the", "installed", "MSVC", "and", "WinSDK", "that", "support", "the", "given", "target", "/", "arch", "tuple", "Returns", "two", "dictionaries", "of", "key", "(", "version", ")", "and", "value", "(", "installation", ")", ...
def get_msvc_versions(conf, target, arch, verbose): """ Requests from cache all the installed MSVC and WinSDK that support the given target/arch tuple Returns two dictionaries of key (version) and value (installation) The type of the returned installation is the same as returned from get_winsdk_for_target() and get...
[ "def", "get_msvc_versions", "(", "conf", ",", "target", ",", "arch", ",", "verbose", ")", ":", "# Configuration", "verbose", "=", "conf", ".", "is_option_true", "(", "'auto_detect_verbose'", ")", "min_version", "=", "float", "(", "conf", ".", "options", ".", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/mscv_helper.py#L1020-L1083
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/tensor_array_ops.py
python
TensorArray.gather
(self, indices, name=None)
return value
Return selected values in the TensorArray as a packed `Tensor`. All of selected values must have been written and their shapes must all match. Args: indices: A `1-D` `Tensor` taking values in `[0, max_value)`. If the `TensorArray` is not dynamic, `max_value=size()`. name: A name for t...
Return selected values in the TensorArray as a packed `Tensor`.
[ "Return", "selected", "values", "in", "the", "TensorArray", "as", "a", "packed", "Tensor", "." ]
def gather(self, indices, name=None): """Return selected values in the TensorArray as a packed `Tensor`. All of selected values must have been written and their shapes must all match. Args: indices: A `1-D` `Tensor` taking values in `[0, max_value)`. If the `TensorArray` is not dynamic,...
[ "def", "gather", "(", "self", ",", "indices", ",", "name", "=", "None", ")", ":", "if", "self", ".", "_element_shape", ":", "element_shape", "=", "self", ".", "_element_shape", "[", "0", "]", "else", ":", "element_shape", "=", "tensor_shape", ".", "Tenso...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/tensor_array_ops.py#L337-L364
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/gemmlowp/meta/generators/gemm_MxNxK.py
python
GenerateGemmSwitch2
(emitter, output_type, aligned, m_mod)
Second level of main switch, choose optimized version on cols leftover.
Second level of main switch, choose optimized version on cols leftover.
[ "Second", "level", "of", "main", "switch", "choose", "optimized", "version", "on", "cols", "leftover", "." ]
def GenerateGemmSwitch2(emitter, output_type, aligned, m_mod): """Second level of main switch, choose optimized version on cols leftover.""" emitter.EmitSwitch('n % 3') for n_mod in range(0, 3): emitter.EmitCase(n_mod) emitter.PushIndent() GenerateGemmSwitch3(emitter, output_type, aligned, m_mod, n_m...
[ "def", "GenerateGemmSwitch2", "(", "emitter", ",", "output_type", ",", "aligned", ",", "m_mod", ")", ":", "emitter", ".", "EmitSwitch", "(", "'n % 3'", ")", "for", "n_mod", "in", "range", "(", "0", ",", "3", ")", ":", "emitter", ".", "EmitCase", "(", "...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/gemmlowp/meta/generators/gemm_MxNxK.py#L259-L270
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/html.py
python
HtmlDCRenderer.GetTotalHeight
(*args, **kwargs)
return _html.HtmlDCRenderer_GetTotalHeight(*args, **kwargs)
GetTotalHeight(self) -> int
GetTotalHeight(self) -> int
[ "GetTotalHeight", "(", "self", ")", "-", ">", "int" ]
def GetTotalHeight(*args, **kwargs): """GetTotalHeight(self) -> int""" return _html.HtmlDCRenderer_GetTotalHeight(*args, **kwargs)
[ "def", "GetTotalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlDCRenderer_GetTotalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L1259-L1261
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCtrl.GetAdjustedCaretPosition
(*args, **kwargs)
return _richtext.RichTextCtrl_GetAdjustedCaretPosition(*args, **kwargs)
GetAdjustedCaretPosition(self, long caretPos) -> long
GetAdjustedCaretPosition(self, long caretPos) -> long
[ "GetAdjustedCaretPosition", "(", "self", "long", "caretPos", ")", "-", ">", "long" ]
def GetAdjustedCaretPosition(*args, **kwargs): """GetAdjustedCaretPosition(self, long caretPos) -> long""" return _richtext.RichTextCtrl_GetAdjustedCaretPosition(*args, **kwargs)
[ "def", "GetAdjustedCaretPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_GetAdjustedCaretPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4076-L4078
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
utils/lui/lldbutil.py
python
get_registers
(frame, kind)
return None
Returns the registers given the frame and the kind of registers desired. Returns None if there's no such kind.
Returns the registers given the frame and the kind of registers desired.
[ "Returns", "the", "registers", "given", "the", "frame", "and", "the", "kind", "of", "registers", "desired", "." ]
def get_registers(frame, kind): """Returns the registers given the frame and the kind of registers desired. Returns None if there's no such kind. """ registerSet = frame.GetRegisters() # Return type of SBValueList. for value in registerSet: if kind.lower() in value.GetName().lower(): ...
[ "def", "get_registers", "(", "frame", ",", "kind", ")", ":", "registerSet", "=", "frame", ".", "GetRegisters", "(", ")", "# Return type of SBValueList.", "for", "value", "in", "registerSet", ":", "if", "kind", ".", "lower", "(", ")", "in", "value", ".", "G...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/lui/lldbutil.py#L901-L911
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/threading.py
python
Thread.ident
(self)
return self.__ident
Thread identifier of this thread or None if it has not been started. This is a nonzero integer. See the thread.get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
Thread identifier of this thread or None if it has not been started.
[ "Thread", "identifier", "of", "this", "thread", "or", "None", "if", "it", "has", "not", "been", "started", "." ]
def ident(self): """Thread identifier of this thread or None if it has not been started. This is a nonzero integer. See the thread.get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the threa...
[ "def", "ident", "(", "self", ")", ":", "assert", "self", ".", "__initialized", ",", "\"Thread.__init__() not called\"", "return", "self", ".", "__ident" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/threading.py#L982-L991
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site.py
python
setBEGINLIBPATH
()
The OS/2 EMX port has optional extension modules that do double duty as DLLs (and must use the .DLL file extension) for other extensions. The library search path needs to be amended so these will be found during module import. Use BEGINLIBPATH so that these are at the start of the library search path.
The OS/2 EMX port has optional extension modules that do double duty as DLLs (and must use the .DLL file extension) for other extensions. The library search path needs to be amended so these will be found during module import. Use BEGINLIBPATH so that these are at the start of the library search path.
[ "The", "OS", "/", "2", "EMX", "port", "has", "optional", "extension", "modules", "that", "do", "double", "duty", "as", "DLLs", "(", "and", "must", "use", "the", ".", "DLL", "file", "extension", ")", "for", "other", "extensions", ".", "The", "library", ...
def setBEGINLIBPATH(): """The OS/2 EMX port has optional extension modules that do double duty as DLLs (and must use the .DLL file extension) for other extensions. The library search path needs to be amended so these will be found during module import. Use BEGINLIBPATH so that these are at the start ...
[ "def", "setBEGINLIBPATH", "(", ")", ":", "dllpath", "=", "os", ".", "path", ".", "join", "(", "sys", ".", "prefix", ",", "\"Lib\"", ",", "\"lib-dynload\"", ")", "libpath", "=", "os", ".", "environ", "[", "'BEGINLIBPATH'", "]", ".", "split", "(", "';'",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site.py#L317-L331
stack-of-tasks/pinocchio
593d4d43fded997bb9aa2421f4e55294dbd233c4
bindings/python/pinocchio/visualize/gepetto_visualizer.py
python
GepettoVisualizer.getViewerNodeName
(self, geometry_object, geometry_type)
Return the name of the geometry object inside the viewer
Return the name of the geometry object inside the viewer
[ "Return", "the", "name", "of", "the", "geometry", "object", "inside", "the", "viewer" ]
def getViewerNodeName(self, geometry_object, geometry_type): """Return the name of the geometry object inside the viewer""" if geometry_type is pin.GeometryType.VISUAL: return self.viewerVisualGroupName + '/' + geometry_object.name elif geometry_type is pin.GeometryType.COLLISION: ...
[ "def", "getViewerNodeName", "(", "self", ",", "geometry_object", ",", "geometry_type", ")", ":", "if", "geometry_type", "is", "pin", ".", "GeometryType", ".", "VISUAL", ":", "return", "self", ".", "viewerVisualGroupName", "+", "'/'", "+", "geometry_object", ".",...
https://github.com/stack-of-tasks/pinocchio/blob/593d4d43fded997bb9aa2421f4e55294dbd233c4/bindings/python/pinocchio/visualize/gepetto_visualizer.py#L18-L23
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/cpu/real_div.py
python
_real_div_cpu
()
return
RealDiv cpu register
RealDiv cpu register
[ "RealDiv", "cpu", "register" ]
def _real_div_cpu(): """RealDiv cpu register""" return
[ "def", "_real_div_cpu", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/cpu/real_div.py#L31-L33
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/util/dispatch.py
python
_make_signature_checker
(api_signature, signature)
return _api_dispatcher.PySignatureChecker(checkers)
Builds a PySignatureChecker for the given type signature. Args: api_signature: The `inspect.Signature` of the API whose signature is being checked. signature: Dictionary mapping parameter names to type annotations. Returns: A `PySignatureChecker`.
Builds a PySignatureChecker for the given type signature.
[ "Builds", "a", "PySignatureChecker", "for", "the", "given", "type", "signature", "." ]
def _make_signature_checker(api_signature, signature): """Builds a PySignatureChecker for the given type signature. Args: api_signature: The `inspect.Signature` of the API whose signature is being checked. signature: Dictionary mapping parameter names to type annotations. Returns: A `PySignatu...
[ "def", "_make_signature_checker", "(", "api_signature", ",", "signature", ")", ":", "if", "not", "(", "isinstance", "(", "signature", ",", "dict", ")", "and", "all", "(", "isinstance", "(", "k", ",", "(", "str", ",", "int", ")", ")", "for", "k", "in", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/dispatch.py#L600-L639
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/generators/idl_parser.py
python
IDLParser.p_value
(self, p)
value : FLOAT | HEX | INT | OCT | STRING
value : FLOAT | HEX | INT | OCT | STRING
[ "value", ":", "FLOAT", "|", "HEX", "|", "INT", "|", "OCT", "|", "STRING" ]
def p_value(self, p): """value : FLOAT | HEX | INT | OCT | STRING""" p[0] = p[1] if self.parse_debug: DumpReduction('value', p)
[ "def", "p_value", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "if", "self", ".", "parse_debug", ":", "DumpReduction", "(", "'value'", ",", "p", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L482-L489
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
GmmAlgorithm._define_log_prob_operation
(self, shard_id, shard)
Probability per example in a class. Updates a matrix with dimension num_examples X num_classes. Args: shard_id: id of the current shard. shard: current data shard, 1 X num_examples X dimensions.
Probability per example in a class.
[ "Probability", "per", "example", "in", "a", "class", "." ]
def _define_log_prob_operation(self, shard_id, shard): """Probability per example in a class. Updates a matrix with dimension num_examples X num_classes. Args: shard_id: id of the current shard. shard: current data shard, 1 X num_examples X dimensions. """ # TODO(xavigonzalvo): Use the...
[ "def", "_define_log_prob_operation", "(", "self", ",", "shard_id", ",", "shard", ")", ":", "# TODO(xavigonzalvo): Use the pdf defined in", "# third_party/tensorflow/contrib/distributions/python/ops/gaussian.py", "if", "self", ".", "_covariance_type", "==", "FULL_COVARIANCE", ":",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L265-L280
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
uCSIsCatZl
(code)
return ret
Check whether the character is part of Zl UCS Category
Check whether the character is part of Zl UCS Category
[ "Check", "whether", "the", "character", "is", "part", "of", "Zl", "UCS", "Category" ]
def uCSIsCatZl(code): """Check whether the character is part of Zl UCS Category """ ret = libxml2mod.xmlUCSIsCatZl(code) return ret
[ "def", "uCSIsCatZl", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCatZl", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1623-L1626
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/tensor_format.py
python
HighlightOptions.__init__
(self, criterion, description=None, font_attr=DEFAULT_TENSOR_ELEMENT_HIGHLIGHT_FONT_ATTR)
Constructor of HighlightOptions. Args: criterion: (callable) A callable of the following signature: def to_highlight(X): # Args: # X: The tensor to highlight elements in. # # Returns: # (boolean ndarray) A boolean ndarray of the same shape as X ...
Constructor of HighlightOptions.
[ "Constructor", "of", "HighlightOptions", "." ]
def __init__(self, criterion, description=None, font_attr=DEFAULT_TENSOR_ELEMENT_HIGHLIGHT_FONT_ATTR): """Constructor of HighlightOptions. Args: criterion: (callable) A callable of the following signature: def to_highlight(X): # Args: ...
[ "def", "__init__", "(", "self", ",", "criterion", ",", "description", "=", "None", ",", "font_attr", "=", "DEFAULT_TENSOR_ELEMENT_HIGHLIGHT_FONT_ATTR", ")", ":", "self", ".", "criterion", "=", "criterion", "self", ".", "description", "=", "description", "self", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/tensor_format.py#L43-L69
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/relu_v2.py
python
_relu_v2_tbe
()
return
ReluV2 TBE register
ReluV2 TBE register
[ "ReluV2", "TBE", "register" ]
def _relu_v2_tbe(): """ReluV2 TBE register""" return
[ "def", "_relu_v2_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/relu_v2.py#L38-L40
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
TextAttrBorders.IsValid
(*args, **kwargs)
return _richtext.TextAttrBorders_IsValid(*args, **kwargs)
IsValid(self) -> bool
IsValid(self) -> bool
[ "IsValid", "(", "self", ")", "-", ">", "bool" ]
def IsValid(*args, **kwargs): """IsValid(self) -> bool""" return _richtext.TextAttrBorders_IsValid(*args, **kwargs)
[ "def", "IsValid", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextAttrBorders_IsValid", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L480-L482
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/activations.py
python
tanh
(x)
return nn.tanh(x)
Hyperbolic tangent activation function. For example: >>> a = tf.constant([-3.0,-1.0, 0.0,1.0,3.0], dtype = tf.float32) >>> b = tf.keras.activations.tanh(a) >>> b.numpy() array([-0.9950547, -0.7615942, 0., 0.7615942, 0.9950547], dtype=float32) Args: x: Input tensor. Returns: Tensor of sa...
Hyperbolic tangent activation function.
[ "Hyperbolic", "tangent", "activation", "function", "." ]
def tanh(x): """Hyperbolic tangent activation function. For example: >>> a = tf.constant([-3.0,-1.0, 0.0,1.0,3.0], dtype = tf.float32) >>> b = tf.keras.activations.tanh(a) >>> b.numpy() array([-0.9950547, -0.7615942, 0., 0.7615942, 0.9950547], dtype=float32) Args: x: Input tensor. Returns: ...
[ "def", "tanh", "(", "x", ")", ":", "return", "nn", ".", "tanh", "(", "x", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/activations.py#L357-L374
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/powercycle/save_diagnostics/__init__.py
python
TarEC2Artifacts.execute
(self)
:return: None.
:return: None.
[ ":", "return", ":", "None", "." ]
def execute(self) -> None: """:return: None.""" if "ec2_ssh_failure" in self.expansions: return tar_cmd = "tar" if "tar" not in self.expansions else self.expansions["tar"] ec2_artifacts = powercycle_constants.LOG_PATH # On test success, we only archive mongod.log. ...
[ "def", "execute", "(", "self", ")", "->", "None", ":", "if", "\"ec2_ssh_failure\"", "in", "self", ".", "expansions", ":", "return", "tar_cmd", "=", "\"tar\"", "if", "\"tar\"", "not", "in", "self", ".", "expansions", "else", "self", ".", "expansions", "[", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/powercycle/save_diagnostics/__init__.py#L13-L28
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/io/serialcontroller.py
python
JsonClient.sendMessage
(self,msg)
Call this to send an outgoing message
Call this to send an outgoing message
[ "Call", "this", "to", "send", "an", "outgoing", "message" ]
def sendMessage(self,msg): """Call this to send an outgoing message""" smsg = json.dumps(msg) #print("JSON message:",smsg) self.buffer = self.buffer + packStrlen(smsg) + smsg
[ "def", "sendMessage", "(", "self", ",", "msg", ")", ":", "smsg", "=", "json", ".", "dumps", "(", "msg", ")", "#print(\"JSON message:\",smsg)", "self", ".", "buffer", "=", "self", ".", "buffer", "+", "packStrlen", "(", "smsg", ")", "+", "smsg" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/io/serialcontroller.py#L101-L105
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
MH.close
(self)
Flush and close the mailbox.
Flush and close the mailbox.
[ "Flush", "and", "close", "the", "mailbox", "." ]
def close(self): """Flush and close the mailbox.""" if self._locked: self.unlock()
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_locked", ":", "self", ".", "unlock", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1108-L1111
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
BitmapFromIcon
(*args, **kwargs)
return val
BitmapFromIcon(Icon icon) -> Bitmap Create a new bitmap from a `wx.Icon` object.
BitmapFromIcon(Icon icon) -> Bitmap
[ "BitmapFromIcon", "(", "Icon", "icon", ")", "-", ">", "Bitmap" ]
def BitmapFromIcon(*args, **kwargs): """ BitmapFromIcon(Icon icon) -> Bitmap Create a new bitmap from a `wx.Icon` object. """ val = _gdi_.new_BitmapFromIcon(*args, **kwargs) return val
[ "def", "BitmapFromIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_gdi_", ".", "new_BitmapFromIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L865-L872
INK-USC/USC-DS-RelationExtraction
eebcfa7fd2eda5bba92f3ef8158797cdf91e6981
code/Classifier/PLSVM.py
python
PLSVM.fit
(self, train_x, train_y)
:param train_x: list of list :param train_y: list of list :return:
:param train_x: list of list :param train_y: list of list :return:
[ ":", "param", "train_x", ":", "list", "of", "list", ":", "param", "train_y", ":", "list", "of", "list", ":", "return", ":" ]
def fit(self, train_x, train_y): """ :param train_x: list of list :param train_y: list of list :return: """ m = len(train_y) batch = int(math.ceil(m/self._batch_size)) for t in xrange(1, self._max_iter): eta_t = 1.0/(self._lambda_reg*t) ...
[ "def", "fit", "(", "self", ",", "train_x", ",", "train_y", ")", ":", "m", "=", "len", "(", "train_y", ")", "batch", "=", "int", "(", "math", ".", "ceil", "(", "m", "/", "self", ".", "_batch_size", ")", ")", "for", "t", "in", "xrange", "(", "1",...
https://github.com/INK-USC/USC-DS-RelationExtraction/blob/eebcfa7fd2eda5bba92f3ef8158797cdf91e6981/code/Classifier/PLSVM.py#L24-L50
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftobjects/pointarray.py
python
PointArray.linkSetup
(self, obj)
Set up the object as a link object.
Set up the object as a link object.
[ "Set", "up", "the", "object", "as", "a", "link", "object", "." ]
def linkSetup(self, obj): """Set up the object as a link object.""" super(PointArray, self).linkSetup(obj) obj.configLinkProperty(ElementCount='Count')
[ "def", "linkSetup", "(", "self", ",", "obj", ")", ":", "super", "(", "PointArray", ",", "self", ")", ".", "linkSetup", "(", "obj", ")", "obj", ".", "configLinkProperty", "(", "ElementCount", "=", "'Count'", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/pointarray.py#L68-L71
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py
python
Decimal._ln_exp_bound
(self)
return e + len(str(10**-e - c)) - 1
Compute a lower bound for the adjusted exponent of self.ln(). In other words, compute r such that self.ln() >= 10**r. Assumes that self is finite and positive and that self != 1.
Compute a lower bound for the adjusted exponent of self.ln(). In other words, compute r such that self.ln() >= 10**r. Assumes that self is finite and positive and that self != 1.
[ "Compute", "a", "lower", "bound", "for", "the", "adjusted", "exponent", "of", "self", ".", "ln", "()", ".", "In", "other", "words", "compute", "r", "such", "that", "self", ".", "ln", "()", ">", "=", "10", "**", "r", ".", "Assumes", "that", "self", ...
def _ln_exp_bound(self): """Compute a lower bound for the adjusted exponent of self.ln(). In other words, compute r such that self.ln() >= 10**r. Assumes that self is finite and positive and that self != 1. """ # for 0.1 <= x <= 10 we use the inequalities 1-1/x <= ln(x) <= x-1 ...
[ "def", "_ln_exp_bound", "(", "self", ")", ":", "# for 0.1 <= x <= 10 we use the inequalities 1-1/x <= ln(x) <= x-1", "adj", "=", "self", ".", "_exp", "+", "len", "(", "self", ".", "_int", ")", "-", "1", "if", "adj", ">=", "1", ":", "# argument >= 10; we use 23/10 ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L3063-L3085
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
Simulator.inContact
(self, aid, bid)
return _robotsim.Simulator_inContact(self, aid, bid)
inContact(Simulator self, int aid, int bid) -> bool Returns true if the objects (indexes returned by object.getID()) are in contact on the current time step. You can set bid=-1 to tell if object `a` is in contact with any object.
inContact(Simulator self, int aid, int bid) -> bool
[ "inContact", "(", "Simulator", "self", "int", "aid", "int", "bid", ")", "-", ">", "bool" ]
def inContact(self, aid, bid): """ inContact(Simulator self, int aid, int bid) -> bool Returns true if the objects (indexes returned by object.getID()) are in contact on the current time step. You can set bid=-1 to tell if object `a` is in contact with any object. "...
[ "def", "inContact", "(", "self", ",", "aid", ",", "bid", ")", ":", "return", "_robotsim", ".", "Simulator_inContact", "(", "self", ",", "aid", ",", "bid", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L8381-L8392
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchComponent.py
python
Component.getSiblings
(self,obj)
return siblings
Find objects that have the same Base object, and type. Look to base object, and find other objects that are based off this base object. If these objects are the same type, return them. Parameters ---------- obj: <App::FeaturePython> The component object. Re...
Find objects that have the same Base object, and type.
[ "Find", "objects", "that", "have", "the", "same", "Base", "object", "and", "type", "." ]
def getSiblings(self,obj): """Find objects that have the same Base object, and type. Look to base object, and find other objects that are based off this base object. If these objects are the same type, return them. Parameters ---------- obj: <App::FeaturePython> ...
[ "def", "getSiblings", "(", "self", ",", "obj", ")", ":", "if", "not", "hasattr", "(", "obj", ",", "\"Base\"", ")", ":", "return", "[", "]", "if", "not", "obj", ".", "Base", ":", "return", "[", "]", "siblings", "=", "[", "]", "for", "o", "in", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchComponent.py#L442-L471
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
cpp/build-support/cpplint.py
python
IsBlockInNameSpace
(nesting_state, is_forward_declaration)
return (len(nesting_state.stack) > 1 and nesting_state.stack[-1].check_namespace_indentation and isinstance(nesting_state.stack[-2], _NamespaceInfo))
Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new block is directly in a namespace.
Checks that the new block is directly in a namespace.
[ "Checks", "that", "the", "new", "block", "is", "directly", "in", "a", "namespace", "." ]
def IsBlockInNameSpace(nesting_state, is_forward_declaration): """Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new b...
[ "def", "IsBlockInNameSpace", "(", "nesting_state", ",", "is_forward_declaration", ")", ":", "if", "is_forward_declaration", ":", "return", "len", "(", "nesting_state", ".", "stack", ")", ">=", "1", "and", "(", "isinstance", "(", "nesting_state", ".", "stack", "[...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L5880-L5896
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.__init__
(self, *args, **kwds)
Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.
Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.
[ "Initialize", "an", "ordered", "dictionary", ".", "Signature", "is", "the", "same", "as", "for", "regular", "dictionaries", "but", "keyword", "arguments", "are", "not", "recommended", "because", "their", "insertion", "order", "is", "arbitrary", "." ]
def __init__(self, *args, **kwds): '''Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. ''' if len(args) > 1: raise TypeError('expected at most 1...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "if", "len", "(", "args", ")", ">", "1", ":", "raise", "TypeError", "(", "'expected at most 1 arguments, got %d'", "%", "len", "(", "args", ")", ")", "try", ":", "self...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/ordered_dict.py#L55-L69
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/optimizer/sr/api.py
python
_SR
( qgt=None, solver=None, *, diag_shift: float = 0.01, solver_restart: bool = False, **kwargs, )
return SR( partial(qgt, diag_shift=diag_shift, **kwargs), solver=solver, solver_restart=solver_restart, )
Construct the structure holding the parameters for using the Stochastic Reconfiguration/Natural gradient method. Depending on the arguments, an implementation is chosen. For details on all possible kwargs check the specific SR implementations in the documentation. You can also construct one of tho...
Construct the structure holding the parameters for using the Stochastic Reconfiguration/Natural gradient method.
[ "Construct", "the", "structure", "holding", "the", "parameters", "for", "using", "the", "Stochastic", "Reconfiguration", "/", "Natural", "gradient", "method", "." ]
def _SR( qgt=None, solver=None, *, diag_shift: float = 0.01, solver_restart: bool = False, **kwargs, ): """ Construct the structure holding the parameters for using the Stochastic Reconfiguration/Natural gradient method. Depending on the arguments, an implementation is chosen. F...
[ "def", "_SR", "(", "qgt", "=", "None", ",", "solver", "=", "None", ",", "*", ",", "diag_shift", ":", "float", "=", "0.01", ",", "solver_restart", ":", "bool", "=", "False", ",", "*", "*", "kwargs", ",", ")", ":", "if", "solver", "is", "None", ":"...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/optimizer/sr/api.py#L139-L182
yun-liu/RCF
91bfb054ad04187dbbe21e539e165ad9bd3ff00b
scripts/cpp_lint.py
python
_NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L2172-L2191
pristineio/webrtc-mirror
7a5bcdffaab90a05bc1146b2b1ea71c004e54d71
tools_webrtc/valgrind/common.py
python
RunSubprocess
(proc, timeout=0)
return result
Runs a subprocess, until it finishes or |timeout| is exceeded and the process is killed with taskkill. A |timeout| <= 0 means no timeout. Args: proc: list of process components (exe + args) timeout: how long to wait before killing, <= 0 means wait forever
Runs a subprocess, until it finishes or |timeout| is exceeded and the process is killed with taskkill. A |timeout| <= 0 means no timeout.
[ "Runs", "a", "subprocess", "until", "it", "finishes", "or", "|timeout|", "is", "exceeded", "and", "the", "process", "is", "killed", "with", "taskkill", ".", "A", "|timeout|", "<", "=", "0", "means", "no", "timeout", "." ]
def RunSubprocess(proc, timeout=0): """ Runs a subprocess, until it finishes or |timeout| is exceeded and the process is killed with taskkill. A |timeout| <= 0 means no timeout. Args: proc: list of process components (exe + args) timeout: how long to wait before killing, <= 0 means wait forever """ ...
[ "def", "RunSubprocess", "(", "proc", ",", "timeout", "=", "0", ")", ":", "logging", ".", "info", "(", "\"running %s, timeout %d sec\"", "%", "(", "\" \"", ".", "join", "(", "proc", ")", ",", "timeout", ")", ")", "sys", ".", "stdout", ".", "flush", "(",...
https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/valgrind/common.py#L32-L100
flexflow/FlexFlow
581fad8ba8d10a16a3102ee2b406b0319586df24
examples/python/keras/candle_uno/generic_utils.py
python
Progbar.update
(self, current, values=[], force=False)
Parameters ------------ current : int index of current step values : list of tuples (name, value_for_last_step). The progress bar will display averages for these values. force : boolean force visual progress update
Parameters ------------ current : int index of current step values : list of tuples (name, value_for_last_step). The progress bar will display averages for these values. force : boolean force visual progress update
[ "Parameters", "------------", "current", ":", "int", "index", "of", "current", "step", "values", ":", "list", "of", "tuples", "(", "name", "value_for_last_step", ")", ".", "The", "progress", "bar", "will", "display", "averages", "for", "these", "values", ".", ...
def update(self, current, values=[], force=False): """ Parameters ------------ current : int index of current step values : list of tuples (name, value_for_last_step). The progress bar will display averages for these values. ...
[ "def", "update", "(", "self", ",", "current", ",", "values", "=", "[", "]", ",", "force", "=", "False", ")", ":", "for", "k", ",", "v", "in", "values", ":", "if", "k", "not", "in", "self", ".", "sum_values", ":", "self", ".", "sum_values", "[", ...
https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/examples/python/keras/candle_uno/generic_utils.py#L99-L187
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_MapFeature.py
python
MapFeature.serialize
(self, buff)
serialize message into buffer :param buff: buffer, ``StringIO``
serialize message into buffer :param buff: buffer, ``StringIO``
[ "serialize", "message", "into", "buffer", ":", "param", "buff", ":", "buffer", "StringIO" ]
def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self.id.uuid # - if encoded as a list instead, serialize as bytes instead of string if type(_x) in [list, tuple]: buff.write(_struct_16B.pack(*_x)) else: ...
[ "def", "serialize", "(", "self", ",", "buff", ")", ":", "try", ":", "_x", "=", "self", ".", "id", ".", "uuid", "# - if encoded as a list instead, serialize as bytes instead of string", "if", "type", "(", "_x", ")", "in", "[", "list", ",", "tuple", "]", ":", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_MapFeature.py#L84-L127
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/perf/metrics/speedindex.py
python
SpeedIndexMetric.Stop
(self, _, tab)
Stop timeline recording.
Stop timeline recording.
[ "Stop", "timeline", "recording", "." ]
def Stop(self, _, tab): """Stop timeline recording.""" assert self._impl, 'Must call Start() before Stop()' assert self.IsFinished(tab), 'Must wait for IsFinished() before Stop()' self._impl.Stop(tab)
[ "def", "Stop", "(", "self", ",", "_", ",", "tab", ")", ":", "assert", "self", ".", "_impl", ",", "'Must call Start() before Stop()'", "assert", "self", ".", "IsFinished", "(", "tab", ")", ",", "'Must wait for IsFinished() before Stop()'", "self", ".", "_impl", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/metrics/speedindex.py#L48-L52
quantOS-org/DataCore
e2ef9bd2c22ee9e2845675b6435a14fa607f3551
mdlink/deps/windows/protobuf-2.5.0/python/mox.py
python
UnorderedGroup.AddMethod
(self, mock_method)
Add a method to this group. Args: mock_method: A mock method to be added to this group.
Add a method to this group.
[ "Add", "a", "method", "to", "this", "group", "." ]
def AddMethod(self, mock_method): """Add a method to this group. Args: mock_method: A mock method to be added to this group. """ self._methods.append(mock_method)
[ "def", "AddMethod", "(", "self", ",", "mock_method", ")", ":", "self", ".", "_methods", ".", "append", "(", "mock_method", ")" ]
https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/mox.py#L1214-L1221
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/ndimage/morphology.py
python
grey_erosion
(input, size=None, footprint=None, structure=None, output=None, mode="reflect", cval=0.0, origin=0)
return filters._min_or_max_filter(input, size, footprint, structure, output, mode, cval, origin, 1)
Calculate a greyscale erosion, using either a structuring element, or a footprint corresponding to a flat structuring element. Grayscale erosion is a mathematical morphology operation. For the simple case of a full and flat structuring element, it can be viewed as a minimum filter over a sliding window...
Calculate a greyscale erosion, using either a structuring element, or a footprint corresponding to a flat structuring element.
[ "Calculate", "a", "greyscale", "erosion", "using", "either", "a", "structuring", "element", "or", "a", "footprint", "corresponding", "to", "a", "flat", "structuring", "element", "." ]
def grey_erosion(input, size=None, footprint=None, structure=None, output=None, mode="reflect", cval=0.0, origin=0): """ Calculate a greyscale erosion, using either a structuring element, or a footprint corresponding to a flat structuring element. Grayscale erosion is a mathematical mo...
[ "def", "grey_erosion", "(", "input", ",", "size", "=", "None", ",", "footprint", "=", "None", ",", "structure", "=", "None", ",", "output", "=", "None", ",", "mode", "=", "\"reflect\"", ",", "cval", "=", "0.0", ",", "origin", "=", "0", ")", ":", "i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/ndimage/morphology.py#L1103-L1210
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/split_benchmark.py
python
SplitBenchmark._run_graph
(self, device, output_shape, variable, num_outputs, axis)
Run the graph and print its execution time. Args: device: string, the device to run on. output_shape: shape of each output tensors. variable: whether or not the output shape should be fixed num_outputs: the number of outputs to split the input into axis: axis to be split Returns:...
Run the graph and print its execution time.
[ "Run", "the", "graph", "and", "print", "its", "execution", "time", "." ]
def _run_graph(self, device, output_shape, variable, num_outputs, axis): """Run the graph and print its execution time. Args: device: string, the device to run on. output_shape: shape of each output tensors. variable: whether or not the output shape should be fixed num_outputs: the numb...
[ "def", "_run_graph", "(", "self", ",", "device", ",", "output_shape", ",", "variable", ",", "num_outputs", ",", "axis", ")", ":", "graph", "=", "ops", ".", "Graph", "(", ")", "with", "graph", ".", "as_default", "(", ")", ":", "if", "not", "variable", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/split_benchmark.py#L58-L107
blackberry/Boost
fc90c3fde129c62565c023f091eddc4a7ed9902b
tools/regression/xsl_reports/email_maintainers.py
python
Report.getPlatform
(self, name)
Retrieve the platform with the given name.
Retrieve the platform with the given name.
[ "Retrieve", "the", "platform", "with", "the", "given", "name", "." ]
def getPlatform(self, name): """ Retrieve the platform with the given name. """ if self.platforms.has_key(name): return self.platforms[name] else: self.platforms[name] = Platform(name) return self.platforms[name]
[ "def", "getPlatform", "(", "self", ",", "name", ")", ":", "if", "self", ".", "platforms", ".", "has_key", "(", "name", ")", ":", "return", "self", ".", "platforms", "[", "name", "]", "else", ":", "self", ".", "platforms", "[", "name", "]", "=", "Pl...
https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/regression/xsl_reports/email_maintainers.py#L287-L295
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/core/additions/validitycheck.py
python
CheckFactory.register
(self, type, *args, **kwargs)
return dec
Implements a decorator for registering Python based checks. :param type: check type, e.g. QgsAbstractValidityCheck.TypeLayoutCheck
Implements a decorator for registering Python based checks.
[ "Implements", "a", "decorator", "for", "registering", "Python", "based", "checks", "." ]
def register(self, type, *args, **kwargs): """ Implements a decorator for registering Python based checks. :param type: check type, e.g. QgsAbstractValidityCheck.TypeLayoutCheck """ def dec(f): check = CheckWrapper(check_type=type, check_func=f) self.che...
[ "def", "register", "(", "self", ",", "type", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "def", "dec", "(", "f", ")", ":", "check", "=", "CheckWrapper", "(", "check_type", "=", "type", ",", "check_func", "=", "f", ")", "self", ".", "chec...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/core/additions/validitycheck.py#L44-L56
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py
python
git_diff_to_svn_diff
(line)
return line
Converts a git formatted diff line to a svn formatted line. Args: line: A string representing a line of the diff.
Converts a git formatted diff line to a svn formatted line.
[ "Converts", "a", "git", "formatted", "diff", "line", "to", "a", "svn", "formatted", "line", "." ]
def git_diff_to_svn_diff(line): """Converts a git formatted diff line to a svn formatted line. Args: line: A string representing a line of the diff. """ for pattern, conversion in conversion_patterns: matched = pattern.match(line) if matched: return conversion(matched)...
[ "def", "git_diff_to_svn_diff", "(", "line", ")", ":", "for", "pattern", ",", "conversion", "in", "conversion_patterns", ":", "matched", "=", "pattern", ".", "match", "(", "line", ")", "if", "matched", ":", "return", "conversion", "(", "matched", ")", "return...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py#L49-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py
python
eig
(a)
return w.astype(result_t, copy=False), wrap(vt)
Compute the eigenvalues and right eigenvectors of a square array. Parameters ---------- a : (..., M, M) array Matrices for which the eigenvalues and right eigenvectors will be computed Returns ------- w : (..., M) array The eigenvalues, each repeated according to its mu...
Compute the eigenvalues and right eigenvectors of a square array.
[ "Compute", "the", "eigenvalues", "and", "right", "eigenvectors", "of", "a", "square", "array", "." ]
def eig(a): """ Compute the eigenvalues and right eigenvectors of a square array. Parameters ---------- a : (..., M, M) array Matrices for which the eigenvalues and right eigenvectors will be computed Returns ------- w : (..., M) array The eigenvalues, each repe...
[ "def", "eig", "(", "a", ")", ":", "a", ",", "wrap", "=", "_makearray", "(", "a", ")", "_assert_stacked_2d", "(", "a", ")", "_assert_stacked_square", "(", "a", ")", "_assert_finite", "(", "a", ")", "t", ",", "result_t", "=", "_commonType", "(", "a", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py#L1173-L1311