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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.DrawBitmap
(*args, **kwargs)
return _gdi_.DC_DrawBitmap(*args, **kwargs)
DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False) Draw a bitmap on the device context at the specified point. If *transparent* is true and the bitmap has a transparency mask, (or alpha channel on the platforms that support it) then the bitmap will be drawn transparently.
DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False)
[ "DrawBitmap", "(", "self", "Bitmap", "bmp", "int", "x", "int", "y", "bool", "useMask", "=", "False", ")" ]
def DrawBitmap(*args, **kwargs): """ DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False) Draw a bitmap on the device context at the specified point. If *transparent* is true and the bitmap has a transparency mask, (or alpha channel on the platforms that support it) th...
[ "def", "DrawBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_DrawBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L3689-L3698
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py
python
Executor.submit
(self, fn, *args, **kwargs)
Submits a callable to be executed with the given arguments. Schedules the callable to be executed as fn(*args, **kwargs) and returns a Future instance representing the execution of the callable. Returns: A Future representing the given call.
Submits a callable to be executed with the given arguments.
[ "Submits", "a", "callable", "to", "be", "executed", "with", "the", "given", "arguments", "." ]
def submit(self, fn, *args, **kwargs): """Submits a callable to be executed with the given arguments. Schedules the callable to be executed as fn(*args, **kwargs) and returns a Future instance representing the execution of the callable. Returns: A Future representing the gi...
[ "def", "submit", "(", "self", ",", "fn", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py#L511-L520
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
GridCellBoolEditor.UseStringValues
(*args, **kwargs)
return _grid.GridCellBoolEditor_UseStringValues(*args, **kwargs)
UseStringValues(String valueTrue=OneString, String valueFalse=EmptyString)
UseStringValues(String valueTrue=OneString, String valueFalse=EmptyString)
[ "UseStringValues", "(", "String", "valueTrue", "=", "OneString", "String", "valueFalse", "=", "EmptyString", ")" ]
def UseStringValues(*args, **kwargs): """UseStringValues(String valueTrue=OneString, String valueFalse=EmptyString)""" return _grid.GridCellBoolEditor_UseStringValues(*args, **kwargs)
[ "def", "UseStringValues", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellBoolEditor_UseStringValues", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L460-L462
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py2/jinja2/runtime.py
python
make_logging_undefined
(logger=None, base=None)
return LoggingUndefined
Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created. Example:: logger = logging.getLogger(__name__) LoggingUndefined = make_logging_undefined( logger=lo...
Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created.
[ "Given", "a", "logger", "object", "this", "returns", "a", "new", "undefined", "class", "that", "will", "log", "certain", "failures", ".", "It", "will", "log", "iterations", "and", "printing", ".", "If", "no", "logger", "is", "given", "a", "default", "logge...
def make_logging_undefined(logger=None, base=None): """Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created. Example:: logger = logging.getLogger(__name__) Loggi...
[ "def", "make_logging_undefined", "(", "logger", "=", "None", ",", "base", "=", "None", ")", ":", "if", "logger", "is", "None", ":", "import", "logging", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", "logger", ".", "addHandler", "(", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/runtime.py#L829-L912
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/dataclasses.py
python
fields
(class_or_instance)
return tuple(f for f in fields.values() if f._field_type is _FIELD)
Return a tuple describing the fields of this dataclass. Accepts a dataclass or an instance of one. Tuple elements are of type Field.
Return a tuple describing the fields of this dataclass.
[ "Return", "a", "tuple", "describing", "the", "fields", "of", "this", "dataclass", "." ]
def fields(class_or_instance): """Return a tuple describing the fields of this dataclass. Accepts a dataclass or an instance of one. Tuple elements are of type Field. """ # Might it be worth caching this, per class? try: fields = getattr(class_or_instance, _FIELDS) except Attribute...
[ "def", "fields", "(", "class_or_instance", ")", ":", "# Might it be worth caching this, per class?", "try", ":", "fields", "=", "getattr", "(", "class_or_instance", ",", "_FIELDS", ")", "except", "AttributeError", ":", "raise", "TypeError", "(", "'must be called with a ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/dataclasses.py#L1013-L1028
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dist.py
python
Distribution.__init__
(self, attrs=None)
Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null va...
Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null va...
[ "Construct", "a", "new", "Distribution", "instance", ":", "initialize", "all", "the", "attributes", "of", "a", "Distribution", "and", "then", "use", "attrs", "(", "a", "dictionary", "mapping", "attribute", "names", "to", "values", ")", "to", "assign", "some", ...
def __init__(self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in ...
[ "def", "__init__", "(", "self", ",", "attrs", "=", "None", ")", ":", "# Default values for our command-line options", "self", ".", "verbose", "=", "1", "self", ".", "dry_run", "=", "0", "self", ".", "help", "=", "0", "for", "attr", "in", "self", ".", "di...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dist.py#L136-L292
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/layers/python/layers/feature_column.py
python
_LazyBuilderByColumnsToTensor.get
(self, key)
return self._columns_to_tensors[key]
Gets the transformed feature column.
Gets the transformed feature column.
[ "Gets", "the", "transformed", "feature", "column", "." ]
def get(self, key): """Gets the transformed feature column.""" if key in self._columns_to_tensors: return self._columns_to_tensors[key] if isinstance(key, str): raise ValueError( "features dictionary doesn't contain key ({})".format(key)) if not isinstance(key, _FeatureColumn): ...
[ "def", "get", "(", "self", ",", "key", ")", ":", "if", "key", "in", "self", ".", "_columns_to_tensors", ":", "return", "self", ".", "_columns_to_tensors", "[", "key", "]", "if", "isinstance", "(", "key", ",", "str", ")", ":", "raise", "ValueError", "("...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column.py#L2360-L2372
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/GardenSnake/GardenSnake.py
python
p_comparison
(p)
comparison : comparison PLUS comparison | comparison MINUS comparison | comparison MULT comparison | comparison DIV comparison | comparison LT comparison | comparison EQ comparison | comparison GT comparison ...
comparison : comparison PLUS comparison | comparison MINUS comparison | comparison MULT comparison | comparison DIV comparison | comparison LT comparison | comparison EQ comparison | comparison GT comparison ...
[ "comparison", ":", "comparison", "PLUS", "comparison", "|", "comparison", "MINUS", "comparison", "|", "comparison", "MULT", "comparison", "|", "comparison", "DIV", "comparison", "|", "comparison", "LT", "comparison", "|", "comparison", "EQ", "comparison", "|", "co...
def p_comparison(p): """comparison : comparison PLUS comparison | comparison MINUS comparison | comparison MULT comparison | comparison DIV comparison | comparison LT comparison | comparison EQ comparison | c...
[ "def", "p_comparison", "(", "p", ")", ":", "if", "len", "(", "p", ")", "==", "4", ":", "p", "[", "0", "]", "=", "binary_ops", "[", "p", "[", "2", "]", "]", "(", "(", "p", "[", "1", "]", ",", "p", "[", "3", "]", ")", ")", "elif", "len", ...
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/GardenSnake/GardenSnake.py#L522-L538
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
IsDecltype
(clean_lines, linenum, column)
return False
Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is decltype() expression, False otherwise.
Check if the token ending on (linenum, column) is decltype().
[ "Check", "if", "the", "token", "ending", "on", "(", "linenum", "column", ")", "is", "decltype", "()", "." ]
def IsDecltype(clean_lines, linenum, column): """Check if the token ending on (linenum, column) is decltype(). Args: clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check. Returns: True if this token is declty...
[ "def", "IsDecltype", "(", "clean_lines", ",", "linenum", ",", "column", ")", ":", "(", "text", ",", "_", ",", "start_col", ")", "=", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "column", ")", "if", "start_col", "<", "0", ":", "retu...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L3640-L3655
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/balloontip.py
python
BalloonTip.SetTitleColour
(self, colour=None)
Sets the colour for the top title. :param `colour`: a valid :class:`Colour` instance.
Sets the colour for the top title.
[ "Sets", "the", "colour", "for", "the", "top", "title", "." ]
def SetTitleColour(self, colour=None): """ Sets the colour for the top title. :param `colour`: a valid :class:`Colour` instance. """ if colour is None: colour = wx.BLACK self._balloontitlecolour = colour
[ "def", "SetTitleColour", "(", "self", ",", "colour", "=", "None", ")", ":", "if", "colour", "is", "None", ":", "colour", "=", "wx", ".", "BLACK", "self", ".", "_balloontitlecolour", "=", "colour" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/balloontip.py#L1010-L1020
InsightSoftwareConsortium/ITK
87acfce9a93d928311c38bc371b666b515b9f19d
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/class_declaration.py
python
hierarchy_info_t.related_class
(self)
return self._related_class
reference to base or derived :class:`class <class_t>`
reference to base or derived :class:`class <class_t>`
[ "reference", "to", "base", "or", "derived", ":", "class", ":", "class", "<class_t", ">" ]
def related_class(self): """reference to base or derived :class:`class <class_t>`""" return self._related_class
[ "def", "related_class", "(", "self", ")", ":", "return", "self", ".", "_related_class" ]
https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/class_declaration.py#L97-L99
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/processpool.py
python
TransferMonitor.notify_done
(self, transfer_id)
Notify a particular transfer is complete :param transfer_id: Unique identifier for the transfer
Notify a particular transfer is complete
[ "Notify", "a", "particular", "transfer", "is", "complete" ]
def notify_done(self, transfer_id): """Notify a particular transfer is complete :param transfer_id: Unique identifier for the transfer """ self._transfer_states[transfer_id].set_done()
[ "def", "notify_done", "(", "self", ",", "transfer_id", ")", ":", "self", ".", "_transfer_states", "[", "transfer_id", "]", ".", "set_done", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/processpool.py#L599-L604
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/push/search/core/search_manager.py
python
SearchManager.HandlePingRequest
(self, request, response)
Handles ping database request. Args: request: request object. response: response object Raises: psycopg2.Error/Warning.
Handles ping database request.
[ "Handles", "ping", "database", "request", "." ]
def HandlePingRequest(self, request, response): """Handles ping database request. Args: request: request object. response: response object Raises: psycopg2.Error/Warning. """ cmd = request.GetParameter(constants.CMD) assert cmd == "Ping" # Fire off a pinq query to make su...
[ "def", "HandlePingRequest", "(", "self", ",", "request", ",", "response", ")", ":", "cmd", "=", "request", ".", "GetParameter", "(", "constants", ".", "CMD", ")", "assert", "cmd", "==", "\"Ping\"", "# Fire off a pinq query to make sure we have a valid db connection."...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/push/search/core/search_manager.py#L63-L85
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/landuse/landuse.py
python
Facilities.get_ids_building
(self, ids=None)
return ids[self.get_landusetypes().are_area[self.ids_landusetype[ids]] == False]
Returns all building type of facilities
Returns all building type of facilities
[ "Returns", "all", "building", "type", "of", "facilities" ]
def get_ids_building(self, ids=None): """Returns all building type of facilities""" # print 'get_ids_building' if ids is None: ids = self.get_ids() # debug #landusetypes = self.get_landusetypes() # for id_fac in ids[self.get_landusetypes().are_area[self.ids_l...
[ "def", "get_ids_building", "(", "self", ",", "ids", "=", "None", ")", ":", "# print 'get_ids_building'", "if", "ids", "is", "None", ":", "ids", "=", "self", ".", "get_ids", "(", ")", "# debug", "#landusetypes = self.get_landusetypes()", "# for id_fac in ids[self.ge...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/landuse/landuse.py#L1536-L1547
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBHostOS_GetLLDBPath
(*args)
return _lldb.SBHostOS_GetLLDBPath(*args)
SBHostOS_GetLLDBPath(PathType path_type) -> SBFileSpec
SBHostOS_GetLLDBPath(PathType path_type) -> SBFileSpec
[ "SBHostOS_GetLLDBPath", "(", "PathType", "path_type", ")", "-", ">", "SBFileSpec" ]
def SBHostOS_GetLLDBPath(*args): """SBHostOS_GetLLDBPath(PathType path_type) -> SBFileSpec""" return _lldb.SBHostOS_GetLLDBPath(*args)
[ "def", "SBHostOS_GetLLDBPath", "(", "*", "args", ")", ":", "return", "_lldb", ".", "SBHostOS_GetLLDBPath", "(", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5133-L5135
YannickJadoul/Parselmouth
355c4746531c948faaaf9b13b828e5afea621efd
pybind11/pybind11/setup_helpers.py
python
ParallelCompile.function
(self)
return compile_function
Builds a function object usable as distutils.ccompiler.CCompiler.compile.
Builds a function object usable as distutils.ccompiler.CCompiler.compile.
[ "Builds", "a", "function", "object", "usable", "as", "distutils", ".", "ccompiler", ".", "CCompiler", ".", "compile", "." ]
def function(self): """ Builds a function object usable as distutils.ccompiler.CCompiler.compile. """ def compile_function( compiler, sources, output_dir=None, macros=None, include_dirs=None, debug=0, ex...
[ "def", "function", "(", "self", ")", ":", "def", "compile_function", "(", "compiler", ",", "sources", ",", "output_dir", "=", "None", ",", "macros", "=", "None", ",", "include_dirs", "=", "None", ",", "debug", "=", "0", ",", "extra_preargs", "=", "None",...
https://github.com/YannickJadoul/Parselmouth/blob/355c4746531c948faaaf9b13b828e5afea621efd/pybind11/pybind11/setup_helpers.py#L372-L433
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/ast.py
python
ServerParameterClass.__init__
(self, file_name, line, column)
Construct a ServerParameterClass.
Construct a ServerParameterClass.
[ "Construct", "a", "ServerParameterClass", "." ]
def __init__(self, file_name, line, column): # type: (str, int, int) -> None """Construct a ServerParameterClass.""" self.name = None # type: str self.data = None # type: str self.override_ctor = False # type: bool self.override_set = False # type: bool supe...
[ "def", "__init__", "(", "self", ",", "file_name", ",", "line", ",", "column", ")", ":", "# type: (str, int, int) -> None", "self", ".", "name", "=", "None", "# type: str", "self", ".", "data", "=", "None", "# type: str", "self", ".", "override_ctor", "=", "F...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/ast.py#L386-L395
limbo018/DREAMPlace
146c3b9fd003d1acd52c96d9fd02e3f0a05154e4
dreamplace/PlaceObj.py
python
PlaceObj.build_weighted_average_wl
(self, params, placedb, data_collections, pin_pos_op)
return build_wirelength_op, build_update_gamma_op
@brief build the op to compute weighted average wirelength @param params parameters @param placedb placement database @param data_collections a collection of data and variables required for constructing ops @param pin_pos_op the op to compute pin locations according to cell locations
[]
def build_weighted_average_wl(self, params, placedb, data_collections, pin_pos_op): """ @brief build the op to compute weighted average wirelength @param params parameters @param placedb placement database @param data_collections a collection of ...
[ "def", "build_weighted_average_wl", "(", "self", ",", "params", ",", "placedb", ",", "data_collections", ",", "pin_pos_op", ")", ":", "# use WeightedAverageWirelength atomic", "wirelength_for_pin_op", "=", "weighted_average_wirelength", ".", "WeightedAverageWirelength", "(", ...
https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/PlaceObj.py#L438-L470
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/distutils/_shell_utils.py
python
CommandLineParser.split
(cmd)
Split a command line string into a list of arguments
Split a command line string into a list of arguments
[ "Split", "a", "command", "line", "string", "into", "a", "list", "of", "arguments" ]
def split(cmd): """ Split a command line string into a list of arguments """ raise NotImplementedError
[ "def", "split", "(", "cmd", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/_shell_utils.py#L30-L32
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-utils/modtool/templates/gr-newmod/docs/doxygen/other/doxypy.py
python
Doxypy.resetCommentSearch
(self, match)
Restarts a new comment search for a different triggering line. Closes the current commentblock and starts a new comment search.
Restarts a new comment search for a different triggering line.
[ "Restarts", "a", "new", "comment", "search", "for", "a", "different", "triggering", "line", "." ]
def resetCommentSearch(self, match): """Restarts a new comment search for a different triggering line. Closes the current commentblock and starts a new comment search. """ if args.debug: print("# CALLBACK: resetCommentSearch", file=sys.stderr) self.__closeComment() ...
[ "def", "resetCommentSearch", "(", "self", ",", "match", ")", ":", "if", "args", ".", "debug", ":", "print", "(", "\"# CALLBACK: resetCommentSearch\"", ",", "file", "=", "sys", ".", "stderr", ")", "self", ".", "__closeComment", "(", ")", "self", ".", "start...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/templates/gr-newmod/docs/doxygen/other/doxypy.py#L258-L266
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.GetGridColLabelWindow
(*args, **kwargs)
return _grid.Grid_GetGridColLabelWindow(*args, **kwargs)
GetGridColLabelWindow(self) -> Window
GetGridColLabelWindow(self) -> Window
[ "GetGridColLabelWindow", "(", "self", ")", "-", ">", "Window" ]
def GetGridColLabelWindow(*args, **kwargs): """GetGridColLabelWindow(self) -> Window""" return _grid.Grid_GetGridColLabelWindow(*args, **kwargs)
[ "def", "GetGridColLabelWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetGridColLabelWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L2141-L2143
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Log.SetComponentLevel
(*args, **kwargs)
return _misc_.Log_SetComponentLevel(*args, **kwargs)
SetComponentLevel(String component, LogLevel level)
SetComponentLevel(String component, LogLevel level)
[ "SetComponentLevel", "(", "String", "component", "LogLevel", "level", ")" ]
def SetComponentLevel(*args, **kwargs): """SetComponentLevel(String component, LogLevel level)""" return _misc_.Log_SetComponentLevel(*args, **kwargs)
[ "def", "SetComponentLevel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Log_SetComponentLevel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1481-L1483
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/networking/01-simple-connection/client.py
python
GameClientRepository.connectSuccess
(self)
Successfully connected. But we still can't really do anything until we've got the doID range.
Successfully connected. But we still can't really do anything until we've got the doID range.
[ "Successfully", "connected", ".", "But", "we", "still", "can", "t", "really", "do", "anything", "until", "we", "ve", "got", "the", "doID", "range", "." ]
def connectSuccess(self): """ Successfully connected. But we still can't really do anything until we've got the doID range. """ # Mark interest for zone 1, 2 and 3. There won't be anything in them, # it's just to display how it works for this small example. self.setInterestZon...
[ "def", "connectSuccess", "(", "self", ")", ":", "# Mark interest for zone 1, 2 and 3. There won't be anything in them,", "# it's just to display how it works for this small example.", "self", ".", "setInterestZones", "(", "[", "1", ",", "2", ",", "3", "]", ")", "# This metho...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/01-simple-connection/client.py#L87-L102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py
python
EntryPoint.parse_map
(cls, data, dist=None)
return maps
Parse a map of entry point groups
Parse a map of entry point groups
[ "Parse", "a", "map", "of", "entry", "point", "groups" ]
def parse_map(cls, data, dist=None): """Parse a map of entry point groups""" if isinstance(data, dict): data = data.items() else: data = split_sections(data) maps = {} for group, lines in data: if group is None: if not lines: ...
[ "def", "parse_map", "(", "cls", ",", "data", ",", "dist", "=", "None", ")", ":", "if", "isinstance", "(", "data", ",", "dict", ")", ":", "data", "=", "data", ".", "items", "(", ")", "else", ":", "data", "=", "split_sections", "(", "data", ")", "m...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L2539-L2555
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_AUTH_COMMAND.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPMS_AUTH_COMMAND)
Returns new TPMS_AUTH_COMMAND object constructed from its marshaled representation in the given byte buffer
Returns new TPMS_AUTH_COMMAND object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPMS_AUTH_COMMAND", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPMS_AUTH_COMMAND object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPMS_AUTH_COMMAND)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPMS_AUTH_COMMAND", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L5549-L5553
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/gen_protorpc.py
python
registry_command
(options, host, service_name=None, registry_path='/protorpc')
Generate source directory structure from remote registry service. Args: options: Parsed command line options. host: Web service host where registry service is located. May include port. service_name: Name of specific service to read. Will generate only Python files that service is dependent...
Generate source directory structure from remote registry service.
[ "Generate", "source", "directory", "structure", "from", "remote", "registry", "service", "." ]
def registry_command(options, host, service_name=None, registry_path='/protorpc'): """Generate source directory structure from remote registry service. Args: options: Parsed command line options. host: Web service host where registry service is...
[ "def", "registry_command", "(", "options", ",", "host", ",", "service_name", "=", "None", ",", "registry_path", "=", "'/protorpc'", ")", ":", "dest_dir", "=", "os", ".", "path", ".", "expanduser", "(", "options", ".", "dest_dir", ")", "url", "=", "'http://...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/gen_protorpc.py#L219-L248
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/kfac/examples/convnet.py
python
_num_gradient_tasks
(num_tasks)
return int(np.ceil(0.6 * num_tasks))
Number of tasks that will update weights.
Number of tasks that will update weights.
[ "Number", "of", "tasks", "that", "will", "update", "weights", "." ]
def _num_gradient_tasks(num_tasks): """Number of tasks that will update weights.""" if num_tasks < 3: return num_tasks return int(np.ceil(0.6 * num_tasks))
[ "def", "_num_gradient_tasks", "(", "num_tasks", ")", ":", "if", "num_tasks", "<", "3", ":", "return", "num_tasks", "return", "int", "(", "np", ".", "ceil", "(", "0.6", "*", "num_tasks", ")", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/kfac/examples/convnet.py#L247-L251
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/graph_editor/util.py
python
check_graphs
(*args)
Check that all the element in args belong to the same graph. Args: *args: a list of object with a obj.graph property. Raises: ValueError: if all the elements do not belong to the same graph.
Check that all the element in args belong to the same graph.
[ "Check", "that", "all", "the", "element", "in", "args", "belong", "to", "the", "same", "graph", "." ]
def check_graphs(*args): """Check that all the element in args belong to the same graph. Args: *args: a list of object with a obj.graph property. Raises: ValueError: if all the elements do not belong to the same graph. """ graph = None for i, sgv in enumerate(args): if graph is None and sgv.gra...
[ "def", "check_graphs", "(", "*", "args", ")", ":", "graph", "=", "None", "for", "i", ",", "sgv", "in", "enumerate", "(", "args", ")", ":", "if", "graph", "is", "None", "and", "sgv", ".", "graph", "is", "not", "None", ":", "graph", "=", "sgv", "."...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/util.py#L72-L85
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Menu.index
(self, index)
return self.tk.getint(i)
Return the index of a menu item identified by INDEX.
Return the index of a menu item identified by INDEX.
[ "Return", "the", "index", "of", "a", "menu", "item", "identified", "by", "INDEX", "." ]
def index(self, index): """Return the index of a menu item identified by INDEX.""" i = self.tk.call(self._w, 'index', index) if i == 'none': return None return self.tk.getint(i)
[ "def", "index", "(", "self", ",", "index", ")", ":", "i", "=", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'index'", ",", "index", ")", "if", "i", "==", "'none'", ":", "return", "None", "return", "self", ".", "tk", ".", "getin...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2935-L2939
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
ComboPopup.Create
(*args, **kwargs)
return _combo.ComboPopup_Create(*args, **kwargs)
Create(self, Window parent) -> bool The derived class must implement this method to create the popup control. It should be a child of the ``parent`` passed in, but other than that there is much flexibility in what the widget can be, its style, etc. Return ``True`` for success, ``False...
Create(self, Window parent) -> bool
[ "Create", "(", "self", "Window", "parent", ")", "-", ">", "bool" ]
def Create(*args, **kwargs): """ Create(self, Window parent) -> bool The derived class must implement this method to create the popup control. It should be a child of the ``parent`` passed in, but other than that there is much flexibility in what the widget can be, its ...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboPopup_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L621-L631
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/utils/git-svn/convert.py
python
do_convert
(file)
Skip all preceding mail message headers until 'From: ' is encountered. Then for each line ('From: ' header included), replace the dos style CRLF end-of-line with unix style LF end-of-line.
Skip all preceding mail message headers until 'From: ' is encountered. Then for each line ('From: ' header included), replace the dos style CRLF end-of-line with unix style LF end-of-line.
[ "Skip", "all", "preceding", "mail", "message", "headers", "until", "From", ":", "is", "encountered", ".", "Then", "for", "each", "line", "(", "From", ":", "header", "included", ")", "replace", "the", "dos", "style", "CRLF", "end", "-", "of", "-", "line",...
def do_convert(file): """Skip all preceding mail message headers until 'From: ' is encountered. Then for each line ('From: ' header included), replace the dos style CRLF end-of-line with unix style LF end-of-line. """ print "converting %s ..." % file with open(file, 'r') as f_in: conten...
[ "def", "do_convert", "(", "file", ")", ":", "print", "\"converting %s ...\"", "%", "file", "with", "open", "(", "file", ",", "'r'", ")", "as", "f_in", ":", "content", "=", "f_in", ".", "read", "(", ")", "# The new content to be written back to the same file.", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/git-svn/convert.py#L27-L58
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/json_schema_compiler/cpp_type_generator.py
python
CppTypeGenerator.GetEnumNoneValue
(self, prop)
return '%s_NONE' % prop.unix_name.upper()
Gets the enum value in the given model.Property indicating no value has been set.
Gets the enum value in the given model.Property indicating no value has been set.
[ "Gets", "the", "enum", "value", "in", "the", "given", "model", ".", "Property", "indicating", "no", "value", "has", "been", "set", "." ]
def GetEnumNoneValue(self, prop): """Gets the enum value in the given model.Property indicating no value has been set. """ return '%s_NONE' % prop.unix_name.upper()
[ "def", "GetEnumNoneValue", "(", "self", ",", "prop", ")", ":", "return", "'%s_NONE'", "%", "prop", ".", "unix_name", ".", "upper", "(", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/json_schema_compiler/cpp_type_generator.py#L89-L93
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_field_common.py
python
field
(type=PFIELD_NO_TYPE, invariant=PFIELD_NO_INVARIANT, initial=PFIELD_NO_INITIAL, mandatory=False, factory=PFIELD_NO_FACTORY, serializer=PFIELD_NO_SERIALIZER)
return field
Field specification factory for :py:class:`PRecord`. :param type: a type or iterable with types that are allowed for this field :param invariant: a function specifying an invariant that must hold for the field :param initial: value of field if not specified when instantiating the record :param mandator...
Field specification factory for :py:class:`PRecord`.
[ "Field", "specification", "factory", "for", ":", "py", ":", "class", ":", "PRecord", "." ]
def field(type=PFIELD_NO_TYPE, invariant=PFIELD_NO_INVARIANT, initial=PFIELD_NO_INITIAL, mandatory=False, factory=PFIELD_NO_FACTORY, serializer=PFIELD_NO_SERIALIZER): """ Field specification factory for :py:class:`PRecord`. :param type: a type or iterable with types that are allowed for this fiel...
[ "def", "field", "(", "type", "=", "PFIELD_NO_TYPE", ",", "invariant", "=", "PFIELD_NO_INVARIANT", ",", "initial", "=", "PFIELD_NO_INITIAL", ",", "mandatory", "=", "False", ",", "factory", "=", "PFIELD_NO_FACTORY", ",", "serializer", "=", "PFIELD_NO_SERIALIZER", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_field_common.py#L104-L137
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
grc/core/base.py
python
Element.validate
(self)
Validate this element and call validate on all children. Call this base method before adding error messages in the subclass.
Validate this element and call validate on all children. Call this base method before adding error messages in the subclass.
[ "Validate", "this", "element", "and", "call", "validate", "on", "all", "children", ".", "Call", "this", "base", "method", "before", "adding", "error", "messages", "in", "the", "subclass", "." ]
def validate(self): """ Validate this element and call validate on all children. Call this base method before adding error messages in the subclass. """ for child in self.children(): child.validate()
[ "def", "validate", "(", "self", ")", ":", "for", "child", "in", "self", ".", "children", "(", ")", ":", "child", ".", "validate", "(", ")" ]
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/base.py#L21-L27
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.GetScreenPosition
(*args, **kwargs)
return _core_.Window_GetScreenPosition(*args, **kwargs)
GetScreenPosition(self) -> Point Get the position of the window in screen coordinantes.
GetScreenPosition(self) -> Point
[ "GetScreenPosition", "(", "self", ")", "-", ">", "Point" ]
def GetScreenPosition(*args, **kwargs): """ GetScreenPosition(self) -> Point Get the position of the window in screen coordinantes. """ return _core_.Window_GetScreenPosition(*args, **kwargs)
[ "def", "GetScreenPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetScreenPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9476-L9482
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
mlir/utils/spirv/gen_spirv_dialect.py
python
update_td_opcodes
(path, instructions, filter_list)
Updates SPIRBase.td with new generated opcode cases. Arguments: - path: the path to SPIRBase.td - instructions: a list containing all SPIR-V instructions' grammar - filter_list: a list containing new opnames to add
Updates SPIRBase.td with new generated opcode cases.
[ "Updates", "SPIRBase", ".", "td", "with", "new", "generated", "opcode", "cases", "." ]
def update_td_opcodes(path, instructions, filter_list): """Updates SPIRBase.td with new generated opcode cases. Arguments: - path: the path to SPIRBase.td - instructions: a list containing all SPIR-V instructions' grammar - filter_list: a list containing new opnames to add """ with open(path, 'r')...
[ "def", "update_td_opcodes", "(", "path", ",", "instructions", ",", "filter_list", ")", ":", "with", "open", "(", "path", ",", "'r'", ")", "as", "f", ":", "content", "=", "f", ".", "read", "(", ")", "content", "=", "content", ".", "split", "(", "AUTOG...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/utils/spirv/gen_spirv_dialect.py#L532-L565
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
parserCtxt.parsePubidLiteral
(self)
return ret
parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
[ "parse", "an", "XML", "public", "literal", "[", "12", "]", "PubidLiteral", "::", "=", "PubidChar", "*", "|", "(", "PubidChar", "-", ")", "*" ]
def parsePubidLiteral(self): """parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" """ ret = libxml2mod.xmlParsePubidLiteral(self._o) return ret
[ "def", "parsePubidLiteral", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlParsePubidLiteral", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5407-L5411
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py
python
ParseLabelTensorOrDict
(labels)
Return a tensor to use for input labels to tensor_forest. The incoming targets can be a dict where keys are the string names of the columns, which we turn into a single 1-D tensor for classification or 2-D tensor for regression. Converts sparse tensors to dense ones. Args: labels: `Tensor` or `dict` of...
Return a tensor to use for input labels to tensor_forest.
[ "Return", "a", "tensor", "to", "use", "for", "input", "labels", "to", "tensor_forest", "." ]
def ParseLabelTensorOrDict(labels): """Return a tensor to use for input labels to tensor_forest. The incoming targets can be a dict where keys are the string names of the columns, which we turn into a single 1-D tensor for classification or 2-D tensor for regression. Converts sparse tensors to dense ones. ...
[ "def", "ParseLabelTensorOrDict", "(", "labels", ")", ":", "if", "isinstance", "(", "labels", ",", "dict", ")", ":", "return", "math_ops", ".", "to_float", "(", "array_ops", ".", "concat", "(", "1", ",", "[", "sparse_ops", ".", "sparse_tensor_to_dense", "(", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py#L176-L201
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/distributions/python/ops/bijector.py
python
_Bijector.name
(self)
return self._name
Returns the string name of this `Bijector`.
Returns the string name of this `Bijector`.
[ "Returns", "the", "string", "name", "of", "this", "Bijector", "." ]
def name(self): """Returns the string name of this `Bijector`.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/distributions/python/ops/bijector.py#L235-L237
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteList
(self, value_list, variable=None, prefix='', quoter=QuoteIfNecessary)
Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style.
Write a variable definition that is a list of values.
[ "Write", "a", "variable", "definition", "that", "is", "a", "list", "of", "values", "." ]
def WriteList(self, value_list, variable=None, prefix='', quoter=QuoteIfNecessary): """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ values = '' if va...
[ "def", "WriteList", "(", "self", ",", "value_list", ",", "variable", "=", "None", ",", "prefix", "=", "''", ",", "quoter", "=", "QuoteIfNecessary", ")", ":", "values", "=", "''", "if", "value_list", ":", "value_list", "=", "[", "quoter", "(", "prefix", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/make.py#L1694-L1706
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/python/caffe/classifier.py
python
Classifier.predict
(self, inputs, oversample=True)
return predictions
Predict classification probabilities of inputs. Parameters ---------- inputs : iterable of (H x W x K) input ndarrays. oversample : boolean average predictions across center, corners, and mirrors when True (default). Center-only prediction when False. Re...
Predict classification probabilities of inputs.
[ "Predict", "classification", "probabilities", "of", "inputs", "." ]
def predict(self, inputs, oversample=True): """ Predict classification probabilities of inputs. Parameters ---------- inputs : iterable of (H x W x K) input ndarrays. oversample : boolean average predictions across center, corners, and mirrors whe...
[ "def", "predict", "(", "self", ",", "inputs", ",", "oversample", "=", "True", ")", ":", "# Scale to standardize input dimensions.", "input_", "=", "np", ".", "zeros", "(", "(", "len", "(", "inputs", ")", ",", "self", ".", "image_dims", "[", "0", "]", ","...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/python/caffe/classifier.py#L47-L98
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/util/fslike/path.py
python
Path._resolve_w
(self)
return self.fsobj.resolve_w(self.parts)
Flatten the path recursively for write access. Used to cancel out some wrappers in between.
Flatten the path recursively for write access. Used to cancel out some wrappers in between.
[ "Flatten", "the", "path", "recursively", "for", "write", "access", ".", "Used", "to", "cancel", "out", "some", "wrappers", "in", "between", "." ]
def _resolve_w(self): """ Flatten the path recursively for write access. Used to cancel out some wrappers in between. """ return self.fsobj.resolve_w(self.parts)
[ "def", "_resolve_w", "(", "self", ")", ":", "return", "self", ".", "fsobj", ".", "resolve_w", "(", "self", ".", "parts", ")" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/fslike/path.py#L158-L163
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/sandbox.py
python
modifies_known_mutable
(obj, attr)
return False
This function checks if an attribute on a builtin mutable object (list, dict, set or deque) would modify it if called. It also supports the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and with Python 2.6 onwards the abstract base classes `MutableSet`, `MutableMapping`, and `MutableSe...
This function checks if an attribute on a builtin mutable object (list, dict, set or deque) would modify it if called. It also supports the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and with Python 2.6 onwards the abstract base classes `MutableSet`, `MutableMapping`, and `MutableSe...
[ "This", "function", "checks", "if", "an", "attribute", "on", "a", "builtin", "mutable", "object", "(", "list", "dict", "set", "or", "deque", ")", "would", "modify", "it", "if", "called", ".", "It", "also", "supports", "the", "user", "-", "versions", "of"...
def modifies_known_mutable(obj, attr): """This function checks if an attribute on a builtin mutable object (list, dict, set or deque) would modify it if called. It also supports the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and with Python 2.6 onwards the abstract base classes `Mut...
[ "def", "modifies_known_mutable", "(", "obj", ",", "attr", ")", ":", "for", "typespec", ",", "unsafe", "in", "_mutable_spec", ":", "if", "isinstance", "(", "obj", ",", "typespec", ")", ":", "return", "attr", "in", "unsafe", "return", "False" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/sandbox.py#L207-L232
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/key.py
python
Key.set_contents_from_stream
(self, *args, **kwargs)
Store an object using the name of the Key object as the key in cloud and the contents of the data stream pointed to by 'fp' as the contents. The stream object is not seekable and total size is not known. This has the implication that we can't specify the Content-Size and Content...
Store an object using the name of the Key object as the key in cloud and the contents of the data stream pointed to by 'fp' as the contents.
[ "Store", "an", "object", "using", "the", "name", "of", "the", "Key", "object", "as", "the", "key", "in", "cloud", "and", "the", "contents", "of", "the", "data", "stream", "pointed", "to", "by", "fp", "as", "the", "contents", "." ]
def set_contents_from_stream(self, *args, **kwargs): """ Store an object using the name of the Key object as the key in cloud and the contents of the data stream pointed to by 'fp' as the contents. The stream object is not seekable and total size is not known. This has t...
[ "def", "set_contents_from_stream", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if_generation", "=", "kwargs", ".", "pop", "(", "'if_generation'", ",", "None", ")", "if", "if_generation", "is", "not", "None", ":", "headers", "=", "k...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/key.py#L715-L777
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TNEANet.GetEdgeAttrValue
(self, *args)
return _snap.TNEANet_GetEdgeAttrValue(self, *args)
GetEdgeAttrValue(TNEANet self, int const & EId, TStrIntPrH::TIter const & EdgeHI) -> TStr Parameters: EId: int const & EdgeHI: TStrIntPrH::TIter const &
GetEdgeAttrValue(TNEANet self, int const & EId, TStrIntPrH::TIter const & EdgeHI) -> TStr
[ "GetEdgeAttrValue", "(", "TNEANet", "self", "int", "const", "&", "EId", "TStrIntPrH", "::", "TIter", "const", "&", "EdgeHI", ")", "-", ">", "TStr" ]
def GetEdgeAttrValue(self, *args): """ GetEdgeAttrValue(TNEANet self, int const & EId, TStrIntPrH::TIter const & EdgeHI) -> TStr Parameters: EId: int const & EdgeHI: TStrIntPrH::TIter const & """ return _snap.TNEANet_GetEdgeAttrValue(self, *args)
[ "def", "GetEdgeAttrValue", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TNEANet_GetEdgeAttrValue", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L22505-L22514
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/utils/reraiser_thread.py
python
ReraiserThreadGroup.Add
(self, thread)
Add a thread to the group. Args: thread: a ReraiserThread object.
Add a thread to the group.
[ "Add", "a", "thread", "to", "the", "group", "." ]
def Add(self, thread): """Add a thread to the group. Args: thread: a ReraiserThread object. """ self._threads.append(thread)
[ "def", "Add", "(", "self", ",", "thread", ")", ":", "self", ".", "_threads", ".", "append", "(", "thread", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/utils/reraiser_thread.py#L83-L89
zhaoweicai/cascade-rcnn
2252f46158ea6555868ca6fa5c221ea71d9b5e6c
scripts/cpp_lint.py
python
FileInfo.IsSource
(self)
return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
File has a source file extension.
File has a source file extension.
[ "File", "has", "a", "source", "file", "extension", "." ]
def IsSource(self): """File has a source file extension.""" return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
[ "def", "IsSource", "(", "self", ")", ":", "return", "self", ".", "Extension", "(", ")", "[", "1", ":", "]", "in", "(", "'c'", ",", "'cc'", ",", "'cpp'", ",", "'cxx'", ")" ]
https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L960-L962
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/stf/stf_parser.py
python
STFParser.p_priority
(self, p)
priority : INT_CONST_DEC
priority : INT_CONST_DEC
[ "priority", ":", "INT_CONST_DEC" ]
def p_priority(self, p): 'priority : INT_CONST_DEC' p[0] = p[1]
[ "def", "p_priority", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]" ]
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/stf/stf_parser.py#L271-L273
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/wheel.py
python
Wheel.tags
(self)
return itertools.product( self.py_version.split('.'), self.abi.split('.'), self.platform.split('.'), )
List tags (py_version, abi, platform) supported by this wheel.
List tags (py_version, abi, platform) supported by this wheel.
[ "List", "tags", "(", "py_version", "abi", "platform", ")", "supported", "by", "this", "wheel", "." ]
def tags(self): '''List tags (py_version, abi, platform) supported by this wheel.''' return itertools.product( self.py_version.split('.'), self.abi.split('.'), self.platform.split('.'), )
[ "def", "tags", "(", "self", ")", ":", "return", "itertools", ".", "product", "(", "self", ".", "py_version", ".", "split", "(", "'.'", ")", ",", "self", ".", "abi", ".", "split", "(", "'.'", ")", ",", "self", ".", "platform", ".", "split", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/wheel.py#L66-L72
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/distributions/bernoulli.py
python
Bernoulli._mode
(self)
return math_ops.cast(self.probs > 0.5, self.dtype)
Returns `1` if `prob > 0.5` and `0` otherwise.
Returns `1` if `prob > 0.5` and `0` otherwise.
[ "Returns", "1", "if", "prob", ">", "0", ".", "5", "and", "0", "otherwise", "." ]
def _mode(self): """Returns `1` if `prob > 0.5` and `0` otherwise.""" return math_ops.cast(self.probs > 0.5, self.dtype)
[ "def", "_mode", "(", "self", ")", ":", "return", "math_ops", ".", "cast", "(", "self", ".", "probs", ">", "0.5", ",", "self", ".", "dtype", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/distributions/bernoulli.py#L163-L165
alexgkendall/caffe-posenet
62aafbd7c45df91acdba14f5d1406d8295c2bc6f
scripts/cpp_lint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/scripts/cpp_lint.py#L4757-L4767
zufuliu/notepad2
680bb88661147936c7ae062da1dae4231486d3c1
scintilla/scripts/FileGenerator.py
python
UpdateFileFromLines
(path, lines, lineEndToUse)
Join the lines with the lineEndToUse then update file if the result is different.
Join the lines with the lineEndToUse then update file if the result is different.
[ "Join", "the", "lines", "with", "the", "lineEndToUse", "then", "update", "file", "if", "the", "result", "is", "different", "." ]
def UpdateFileFromLines(path, lines, lineEndToUse): """Join the lines with the lineEndToUse then update file if the result is different. """ contents = lineEndToUse.join(lines) + lineEndToUse UpdateFile(path, contents)
[ "def", "UpdateFileFromLines", "(", "path", ",", "lines", ",", "lineEndToUse", ")", ":", "contents", "=", "lineEndToUse", ".", "join", "(", "lines", ")", "+", "lineEndToUse", "UpdateFile", "(", "path", ",", "contents", ")" ]
https://github.com/zufuliu/notepad2/blob/680bb88661147936c7ae062da1dae4231486d3c1/scintilla/scripts/FileGenerator.py#L199-L203
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.__deepcopy__
(self, memo)
return SArray(_proxy=self.__proxy__)
Returns a deep copy of the sarray. As the data in an SArray is immutable, this is identical to __copy__.
Returns a deep copy of the sarray. As the data in an SArray is immutable, this is identical to __copy__.
[ "Returns", "a", "deep", "copy", "of", "the", "sarray", ".", "As", "the", "data", "in", "an", "SArray", "is", "immutable", "this", "is", "identical", "to", "__copy__", "." ]
def __deepcopy__(self, memo): """ Returns a deep copy of the sarray. As the data in an SArray is immutable, this is identical to __copy__. """ return SArray(_proxy=self.__proxy__)
[ "def", "__deepcopy__", "(", "self", ",", "memo", ")", ":", "return", "SArray", "(", "_proxy", "=", "self", ".", "__proxy__", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L4655-L4660
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/model_utils.py
python
_check_predict_features
(features)
Raises errors if features are not suitable for prediction.
Raises errors if features are not suitable for prediction.
[ "Raises", "errors", "if", "features", "are", "not", "suitable", "for", "prediction", "." ]
def _check_predict_features(features): """Raises errors if features are not suitable for prediction.""" if feature_keys.PredictionFeatures.TIMES not in features: raise ValueError("Expected a '{}' feature for prediction.".format( feature_keys.PredictionFeatures.TIMES)) if feature_keys.PredictionFeature...
[ "def", "_check_predict_features", "(", "features", ")", ":", "if", "feature_keys", ".", "PredictionFeatures", ".", "TIMES", "not", "in", "features", ":", "raise", "ValueError", "(", "\"Expected a '{}' feature for prediction.\"", ".", "format", "(", "feature_keys", "."...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/model_utils.py#L74-L94
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/base_layer_utils.py
python
is_in_keras_graph
()
return call_context().in_keras_graph
Returns if currently executing inside of a Keras graph.
Returns if currently executing inside of a Keras graph.
[ "Returns", "if", "currently", "executing", "inside", "of", "a", "Keras", "graph", "." ]
def is_in_keras_graph(): """Returns if currently executing inside of a Keras graph.""" return call_context().in_keras_graph
[ "def", "is_in_keras_graph", "(", ")", ":", "return", "call_context", "(", ")", ".", "in_keras_graph" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/base_layer_utils.py#L333-L335
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBUnixSignals.SetShouldNotify
(self, *args)
return _lldb.SBUnixSignals_SetShouldNotify(self, *args)
SetShouldNotify(self, int32_t signo, bool value) -> bool
SetShouldNotify(self, int32_t signo, bool value) -> bool
[ "SetShouldNotify", "(", "self", "int32_t", "signo", "bool", "value", ")", "-", ">", "bool" ]
def SetShouldNotify(self, *args): """SetShouldNotify(self, int32_t signo, bool value) -> bool""" return _lldb.SBUnixSignals_SetShouldNotify(self, *args)
[ "def", "SetShouldNotify", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBUnixSignals_SetShouldNotify", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L12749-L12751
flexflow/FlexFlow
581fad8ba8d10a16a3102ee2b406b0319586df24
python/flexflow/core/flexflow_cffi.py
python
FFModel.sigmoid
(self, input, name=None)
return Tensor(handle, owner_op_type=OpType.SIGMOID)
Sigmoid activation function, :math:`sigmoid(x) = 1 / (1 + exp(-x))`. :param input: the input Tensor. :type input: Tensor :param name: the name of the layer. Default is None. :type name: string :returns: Tensor -- the output tensor.
Sigmoid activation function, :math:`sigmoid(x) = 1 / (1 + exp(-x))`. :param input: the input Tensor. :type input: Tensor :param name: the name of the layer. Default is None. :type name: string
[ "Sigmoid", "activation", "function", ":", "math", ":", "sigmoid", "(", "x", ")", "=", "1", "/", "(", "1", "+", "exp", "(", "-", "x", "))", ".", ":", "param", "input", ":", "the", "input", "Tensor", ".", ":", "type", "input", ":", "Tensor", ":", ...
def sigmoid(self, input, name=None): """Sigmoid activation function, :math:`sigmoid(x) = 1 / (1 + exp(-x))`. :param input: the input Tensor. :type input: Tensor :param name: the name of the layer. Default is None. :type name: string :returns: Tensor -- the output te...
[ "def", "sigmoid", "(", "self", ",", "input", ",", "name", "=", "None", ")", ":", "c_name", "=", "get_c_name", "(", "name", ")", "handle", "=", "ffc", ".", "flexflow_model_add_sigmoid", "(", "self", ".", "handle", ",", "input", ".", "handle", ",", "c_na...
https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/python/flexflow/core/flexflow_cffi.py#L1557-L1571
christinaa/LLVM-VideoCore4
7773c3c9e5d22b785d4b96ed0acea37c8aa9c183
utils/llvm-build/llvmbuild/configutil.py
python
configure_file
(input_path, output_path, substitutions)
return True
configure_file(input_path, output_path, substitutions) -> bool Given an input and output path, "configure" the file at the given input path by replacing variables in the file with those given in the substitutions list. Returns true if the output file was written. The substitutions list should be given...
configure_file(input_path, output_path, substitutions) -> bool
[ "configure_file", "(", "input_path", "output_path", "substitutions", ")", "-", ">", "bool" ]
def configure_file(input_path, output_path, substitutions): """configure_file(input_path, output_path, substitutions) -> bool Given an input and output path, "configure" the file at the given input path by replacing variables in the file with those given in the substitutions list. Returns true if the o...
[ "def", "configure_file", "(", "input_path", ",", "output_path", ",", "substitutions", ")", ":", "# Read in the input data.", "f", "=", "open", "(", "input_path", ",", "\"rb\"", ")", "try", ":", "data", "=", "f", ".", "read", "(", ")", "finally", ":", "f", ...
https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/utils/llvm-build/llvmbuild/configutil.py#L8-L66
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ssl.py
python
SSLObject.shared_ciphers
(self)
return self._sslobj.shared_ciphers()
Return a list of ciphers shared by the client during the handshake or None if this is not a valid server connection.
Return a list of ciphers shared by the client during the handshake or None if this is not a valid server connection.
[ "Return", "a", "list", "of", "ciphers", "shared", "by", "the", "client", "during", "the", "handshake", "or", "None", "if", "this", "is", "not", "a", "valid", "server", "connection", "." ]
def shared_ciphers(self): """Return a list of ciphers shared by the client during the handshake or None if this is not a valid server connection. """ return self._sslobj.shared_ciphers()
[ "def", "shared_ciphers", "(", "self", ")", ":", "return", "self", ".", "_sslobj", ".", "shared_ciphers", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ssl.py#L945-L949
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/linter/runner.py
python
LintRunner.run
(self, cmd)
return True
Check the specified cmd succeeds.
Check the specified cmd succeeds.
[ "Check", "the", "specified", "cmd", "succeeds", "." ]
def run(self, cmd): # type: (List[str]) -> bool """Check the specified cmd succeeds.""" logging.debug(str(cmd)) try: subprocess.check_output(cmd).decode('utf-8') except subprocess.CalledProcessError as cpe: self._safe_print("CMD [%s] failed:\n%s" % (' '....
[ "def", "run", "(", "self", ",", "cmd", ")", ":", "# type: (List[str]) -> bool", "logging", ".", "debug", "(", "str", "(", "cmd", ")", ")", "try", ":", "subprocess", ".", "check_output", "(", "cmd", ")", ".", "decode", "(", "'utf-8'", ")", "except", "su...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/runner.py#L227-L239
logcabin/logcabin
ee6c55ae9744b82b451becd9707d26c7c1b6bbfb
scripts/cpplint.py
python
RemoveMultiLineComments
(filename, lines, error)
Removes multiline (c-style) comments from lines.
Removes multiline (c-style) comments from lines.
[ "Removes", "multiline", "(", "c", "-", "style", ")", "comments", "from", "lines", "." ]
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" count = 0 lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd...
[ "def", "RemoveMultiLineComments", "(", "filename", ",", "lines", ",", "error", ")", ":", "count", "=", "0", "lineix", "=", "0", "while", "lineix", "<", "len", "(", "lines", ")", ":", "lineix_begin", "=", "FindNextMultiLineCommentStart", "(", "lines", ",", ...
https://github.com/logcabin/logcabin/blob/ee6c55ae9744b82b451becd9707d26c7c1b6bbfb/scripts/cpplint.py#L838-L857
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_util.py
python
_is_import_binding
(node, name, package=None)
return None
Will reuturn node if node will import name, or node will import * from package. None is returned otherwise. See test cases for examples.
Will reuturn node if node will import name, or node will import * from package. None is returned otherwise. See test cases for examples.
[ "Will", "reuturn", "node", "if", "node", "will", "import", "name", "or", "node", "will", "import", "*", "from", "package", ".", "None", "is", "returned", "otherwise", ".", "See", "test", "cases", "for", "examples", "." ]
def _is_import_binding(node, name, package=None): """ Will reuturn node if node will import name, or node will import * from package. None is returned otherwise. See test cases for examples. """ if node.type == syms.import_name and not package: imp = node.children[1] if imp.typ...
[ "def", "_is_import_binding", "(", "node", ",", "name", ",", "package", "=", "None", ")", ":", "if", "node", ".", "type", "==", "syms", ".", "import_name", "and", "not", "package", ":", "imp", "=", "node", ".", "children", "[", "1", "]", "if", "imp", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_util.py#L393-L432
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/algorithms.py
python
diff
(arr, n, axis=0)
return out_arr
difference of n between self, analogous to s-s.shift(n) Parameters ---------- arr : ndarray n : int number of periods axis : int axis to shift on Returns ------- shifted
difference of n between self, analogous to s-s.shift(n)
[ "difference", "of", "n", "between", "self", "analogous", "to", "s", "-", "s", ".", "shift", "(", "n", ")" ]
def diff(arr, n, axis=0): """ difference of n between self, analogous to s-s.shift(n) Parameters ---------- arr : ndarray n : int number of periods axis : int axis to shift on Returns ------- shifted """ n = int(n) na = np.nan dtype = arr.d...
[ "def", "diff", "(", "arr", ",", "n", ",", "axis", "=", "0", ")", ":", "n", "=", "int", "(", "n", ")", "na", "=", "np", ".", "nan", "dtype", "=", "arr", ".", "dtype", "is_timedelta", "=", "False", "if", "needs_i8_conversion", "(", "arr", ")", ":...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/algorithms.py#L1747-L1826
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/directnotify/Logger.py
python
Logger.__getTimeStamp
(self)
return "%02d:%02d:%02d:%02d: " % (days, hours, minutes, seconds)
Return the offset between current time and log file startTime
Return the offset between current time and log file startTime
[ "Return", "the", "offset", "between", "current", "time", "and", "log", "file", "startTime" ]
def __getTimeStamp(self): """ Return the offset between current time and log file startTime """ t = time.time() dt = t - self.__startTime days, dt = divmod(dt, 86400) hours, dt = divmod(dt, 3600) minutes, dt = divmod(dt, 60) seconds = int(math.ceil...
[ "def", "__getTimeStamp", "(", "self", ")", ":", "t", "=", "time", ".", "time", "(", ")", "dt", "=", "t", "-", "self", ".", "__startTime", "days", ",", "dt", "=", "divmod", "(", "dt", ",", "86400", ")", "hours", ",", "dt", "=", "divmod", "(", "d...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directnotify/Logger.py#L66-L76
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_instrument.py
python
ISISInstrument.on_load_sample
(self, ws_name, beamcentre, isSample)
return centre_shift
It will be called just after loading the workspace for sample and can It configures the instrument for the specific run of the workspace for handle historical changes in the instrument. It centralizes the detector bank to the beamcentre (tuple of two values)
It will be called just after loading the workspace for sample and can
[ "It", "will", "be", "called", "just", "after", "loading", "the", "workspace", "for", "sample", "and", "can" ]
def on_load_sample(self, ws_name, beamcentre, isSample): """It will be called just after loading the workspace for sample and can It configures the instrument for the specific run of the workspace for handle historical changes in the instrument. It centralizes the detector bank to the beamcent...
[ "def", "on_load_sample", "(", "self", ",", "ws_name", ",", "beamcentre", ",", "isSample", ")", ":", "ws_ref", "=", "mtd", "[", "str", "(", "ws_name", ")", "]", "try", ":", "run_num", "=", "LARMOR", ".", "get_run_number_from_workspace_reference", "(", "ws_ref...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_instrument.py#L767-L794
crosslife/OpenBird
9e0198a1a2295f03fa1e8676e216e22c9c7d380b
cocos2d/tools/bindings-generator/clang/cindex.py
python
CompilationDatabase.getCompileCommands
(self, filename)
return conf.lib.clang_CompilationDatabase_getCompileCommands(self, filename)
Get an iterable object providing all the CompileCommands available to build filename. Returns None if filename is not found in the database.
Get an iterable object providing all the CompileCommands available to build filename. Returns None if filename is not found in the database.
[ "Get", "an", "iterable", "object", "providing", "all", "the", "CompileCommands", "available", "to", "build", "filename", ".", "Returns", "None", "if", "filename", "is", "not", "found", "in", "the", "database", "." ]
def getCompileCommands(self, filename): """ Get an iterable object providing all the CompileCommands available to build filename. Returns None if filename is not found in the database. """ return conf.lib.clang_CompilationDatabase_getCompileCommands(self, ...
[ "def", "getCompileCommands", "(", "self", ",", "filename", ")", ":", "return", "conf", ".", "lib", ".", "clang_CompilationDatabase_getCompileCommands", "(", "self", ",", "filename", ")" ]
https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L2641-L2647
jts/nanopolish
181549b682ffe99c1bbf1a410ee2806614a08445
scripts/reestimate_polya_emissions.py
python
make_segmentation_dict
(segmentations_tsv_path)
return segments
Load a segmentations TSV file. Rows of `segmentations_tsv_path` look like this: tag read_id: pos: L_0 A_0: P_0: P_1: RR: P(A)L: AL: polya-segmentation fc06... 161684804 47.0 1851.0 8354.0 11424.0 73.76 75.18 35.23 Note that this function only takes the f...
Load a segmentations TSV file. Rows of `segmentations_tsv_path` look like this:
[ "Load", "a", "segmentations", "TSV", "file", ".", "Rows", "of", "segmentations_tsv_path", "look", "like", "this", ":" ]
def make_segmentation_dict(segmentations_tsv_path): """ Load a segmentations TSV file. Rows of `segmentations_tsv_path` look like this: tag read_id: pos: L_0 A_0: P_0: P_1: RR: P(A)L: AL: polya-segmentation fc06... 161684804 47.0 1851.0 8354.0 11424.0 73...
[ "def", "make_segmentation_dict", "(", "segmentations_tsv_path", ")", ":", "segments", "=", "{", "}", "# loop thru TSV and update the list of segmentations:", "with", "open", "(", "segmentations_tsv_path", ",", "'r'", ")", "as", "f", ":", "headers", "=", "[", "'tag'", ...
https://github.com/jts/nanopolish/blob/181549b682ffe99c1bbf1a410ee2806614a08445/scripts/reestimate_polya_emissions.py#L104-L126
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/ops.py
python
roi_pool
(x, boxes, boxes_num, output_size, spatial_scale=1.0, name=None)
This operator implements the roi_pooling layer. Region of interest pooling (also known as RoI pooling) is to perform max pooling on inputs of nonuniform sizes to obtain fixed-size feature maps (e.g. 7*7). The operator has three steps: 1. Dividing each region proposal into equal-sized sections with output_size(h...
This operator implements the roi_pooling layer. Region of interest pooling (also known as RoI pooling) is to perform max pooling on inputs of nonuniform sizes to obtain fixed-size feature maps (e.g. 7*7). The operator has three steps: 1. Dividing each region proposal into equal-sized sections with output_size(h...
[ "This", "operator", "implements", "the", "roi_pooling", "layer", ".", "Region", "of", "interest", "pooling", "(", "also", "known", "as", "RoI", "pooling", ")", "is", "to", "perform", "max", "pooling", "on", "inputs", "of", "nonuniform", "sizes", "to", "obtai...
def roi_pool(x, boxes, boxes_num, output_size, spatial_scale=1.0, name=None): """ This operator implements the roi_pooling layer. Region of interest pooling (also known as RoI pooling) is to perform max pooling on inputs of nonuniform sizes to obtain fixed-size feature maps (e.g. 7*7). The operator has ...
[ "def", "roi_pool", "(", "x", ",", "boxes", ",", "boxes_num", ",", "output_size", ",", "spatial_scale", "=", "1.0", ",", "name", "=", "None", ")", ":", "check_type", "(", "output_size", ",", "'output_size'", ",", "(", "int", ",", "tuple", ")", ",", "'ro...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/ops.py#L1022-L1096
v8mips/v8mips
f0c9cc0bbfd461c7f516799d9a58e9a7395f737e
PRESUBMIT.py
python
_CheckChangeLogFlag
(input_api, output_api)
return results
Checks usage of LOG= flag in the commit message.
Checks usage of LOG= flag in the commit message.
[ "Checks", "usage", "of", "LOG", "=", "flag", "in", "the", "commit", "message", "." ]
def _CheckChangeLogFlag(input_api, output_api): """Checks usage of LOG= flag in the commit message.""" results = [] if input_api.change.BUG and not 'LOG' in input_api.change.tags: results.append(output_api.PresubmitError( 'An issue reference (BUG=) requires a change log flag (LOG=). ' 'Use LOG...
[ "def", "_CheckChangeLogFlag", "(", "input_api", ",", "output_api", ")", ":", "results", "=", "[", "]", "if", "input_api", ".", "change", ".", "BUG", "and", "not", "'LOG'", "in", "input_api", ".", "change", ".", "tags", ":", "results", ".", "append", "(",...
https://github.com/v8mips/v8mips/blob/f0c9cc0bbfd461c7f516799d9a58e9a7395f737e/PRESUBMIT.py#L210-L218
sc0ty/subsync
be5390d00ff475b6543eb0140c7e65b34317d95b
subsync/synchro/controller.py
python
SyncController.validateTask
(self, task, *, interactive=False)
Check if task is properly defined. Parameters ---------- task: SyncTask Task to validate. interactive: bool, optional For interactive synchronization `out` will not be vaildated. Raises ------ Error Invalid task. KeyEr...
Check if task is properly defined.
[ "Check", "if", "task", "is", "properly", "defined", "." ]
def validateTask(self, task, *, interactive=False): """Check if task is properly defined. Parameters ---------- task: SyncTask Task to validate. interactive: bool, optional For interactive synchronization `out` will not be vaildated. Raises ...
[ "def", "validateTask", "(", "self", ",", "task", ",", "*", ",", "interactive", "=", "False", ")", ":", "sub", ",", "ref", ",", "out", "=", "task", ".", "sub", ",", "task", ".", "ref", ",", "task", ".", "out", "if", "sub", "is", "None", "or", "n...
https://github.com/sc0ty/subsync/blob/be5390d00ff475b6543eb0140c7e65b34317d95b/subsync/synchro/controller.py#L286-L311
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Spinbox.scan
(self, *args)
return self._getints( self.tk.call((self._w, 'scan') + args)) or ()
Internal function.
Internal function.
[ "Internal", "function", "." ]
def scan(self, *args): """Internal function.""" return self._getints( self.tk.call((self._w, 'scan') + args)) or ()
[ "def", "scan", "(", "self", ",", "*", "args", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'scan'", ")", "+", "args", ")", ")", "or", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L3544-L3547
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/nodes.py
python
Node.set_environment
(self, environment)
return self
Set the environment for all nodes.
Set the environment for all nodes.
[ "Set", "the", "environment", "for", "all", "nodes", "." ]
def set_environment(self, environment): """Set the environment for all nodes.""" todo = deque([self]) while todo: node = todo.popleft() node.environment = environment todo.extend(node.iter_child_nodes()) return self
[ "def", "set_environment", "(", "self", ",", "environment", ")", ":", "todo", "=", "deque", "(", "[", "self", "]", ")", "while", "todo", ":", "node", "=", "todo", ".", "popleft", "(", ")", "node", ".", "environment", "=", "environment", "todo", ".", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/nodes.py#L219-L226
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/logging/__init__.py
python
FileHandler.close
(self)
Closes the stream.
Closes the stream.
[ "Closes", "the", "stream", "." ]
def close(self): """ Closes the stream. """ self.acquire() try: try: if self.stream: try: self.flush() finally: stream = self.stream self.st...
[ "def", "close", "(", "self", ")", ":", "self", ".", "acquire", "(", ")", "try", ":", "try", ":", "if", "self", ".", "stream", ":", "try", ":", "self", ".", "flush", "(", ")", "finally", ":", "stream", "=", "self", ".", "stream", "self", ".", "s...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/__init__.py#L922-L942
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/EditorWindow.py
python
HelpDialog.display
(self, parent, near=None)
Display the help dialog. parent - parent widget for the help window near - a Toplevel widget (e.g. EditorWindow or PyShell) to use as a reference for placing the help window
Display the help dialog.
[ "Display", "the", "help", "dialog", "." ]
def display(self, parent, near=None): """ Display the help dialog. parent - parent widget for the help window near - a Toplevel widget (e.g. EditorWindow or PyShell) to use as a reference for placing the help window """ if self.dlg is None: ...
[ "def", "display", "(", "self", ",", "parent", ",", "near", "=", "None", ")", ":", "if", "self", ".", "dlg", "is", "None", ":", "self", ".", "show_dialog", "(", "parent", ")", "if", "near", ":", "self", ".", "nearwindow", "(", "near", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/EditorWindow.py#L75-L86
niwinz/phantompy
ae25ddb6791e13cb7c35126971c410030ee5dfda
phantompy/webelements.py
python
WebElement.append_after
(self, element)
Same as :py:meth:`~.append` but appends outside the current dom element.
Same as :py:meth:`~.append` but appends outside the current dom element.
[ "Same", "as", ":", "py", ":", "meth", ":", "~", ".", "append", "but", "appends", "outside", "the", "current", "dom", "element", "." ]
def append_after(self, element): """ Same as :py:meth:`~.append` but appends outside the current dom element. """ if isinstance(element, util.string_type): lib.ph_webelement_append_html_after(self.ptr, util.force_bytes(element)) elif isinstance(element, WebEl...
[ "def", "append_after", "(", "self", ",", "element", ")", ":", "if", "isinstance", "(", "element", ",", "util", ".", "string_type", ")", ":", "lib", ".", "ph_webelement_append_html_after", "(", "self", ".", "ptr", ",", "util", ".", "force_bytes", "(", "elem...
https://github.com/niwinz/phantompy/blob/ae25ddb6791e13cb7c35126971c410030ee5dfda/phantompy/webelements.py#L202-L213
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
third_party/gpus/find_cuda_config.py
python
_get_header_version
(path, name)
return ""
Returns preprocessor defines in C header file.
Returns preprocessor defines in C header file.
[ "Returns", "preprocessor", "defines", "in", "C", "header", "file", "." ]
def _get_header_version(path, name): """Returns preprocessor defines in C header file.""" for line in io.open(path, "r", encoding="utf-8").readlines(): match = re.match("#define %s +(\d+)" % name, line) if match: return match.group(1) return ""
[ "def", "_get_header_version", "(", "path", ",", "name", ")", ":", "for", "line", "in", "io", ".", "open", "(", "path", ",", "\"r\"", ",", "encoding", "=", "\"utf-8\"", ")", ".", "readlines", "(", ")", ":", "match", "=", "re", ".", "match", "(", "\"...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/third_party/gpus/find_cuda_config.py#L121-L127
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/kernelized_utils.py
python
_to_matrix
(u)
return u
If input tensor is a vector (i.e., has rank 1), converts it to matrix.
If input tensor is a vector (i.e., has rank 1), converts it to matrix.
[ "If", "input", "tensor", "is", "a", "vector", "(", "i", ".", "e", ".", "has", "rank", "1", ")", "converts", "it", "to", "matrix", "." ]
def _to_matrix(u): """If input tensor is a vector (i.e., has rank 1), converts it to matrix.""" u_rank = len(u.shape) if u_rank not in [1, 2]: raise ValueError('The input tensor should have rank 1 or 2. Given rank: {}' .format(u_rank)) if u_rank == 1: return array_ops.expand_dims(u,...
[ "def", "_to_matrix", "(", "u", ")", ":", "u_rank", "=", "len", "(", "u", ".", "shape", ")", "if", "u_rank", "not", "in", "[", "1", ",", "2", "]", ":", "raise", "ValueError", "(", "'The input tensor should have rank 1 or 2. Given rank: {}'", ".", "format", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/kernelized_utils.py#L25-L33
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/codelite.py
python
codelite_generator.execute
(self)
Entry point
Entry point
[ "Entry", "point" ]
def execute(self): """ Entry point """ self.restore() if not self.all_envs: self.load_envs() self.recurse([self.run_dir]) # user initialization self.init() ...
[ "def", "execute", "(", "self", ")", ":", "self", ".", "restore", "(", ")", "if", "not", "self", ".", "all_envs", ":", "self", ".", "load_envs", "(", ")", "self", ".", "recurse", "(", "[", "self", ".", "run_dir", "]", ")", "# user initialization", "se...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/codelite.py#L710-L724
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py
python
TarInfo.__init__
(self, name="")
Construct a TarInfo object. name is the optional name of the member.
Construct a TarInfo object. name is the optional name of the member.
[ "Construct", "a", "TarInfo", "object", ".", "name", "is", "the", "optional", "name", "of", "the", "member", "." ]
def __init__(self, name=""): """Construct a TarInfo object. name is the optional name of the member. """ self.name = name # member name self.mode = 0o644 # file permissions self.uid = 0 # user id self.gid = 0 # group id ...
[ "def", "__init__", "(", "self", ",", "name", "=", "\"\"", ")", ":", "self", ".", "name", "=", "name", "# member name", "self", ".", "mode", "=", "0o644", "# file permissions", "self", ".", "uid", "=", "0", "# user id", "self", ".", "gid", "=", "0", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py#L739-L761
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/sysinfo/sysinfo.py
python
SysInfo.get_platform_machine
(self)
return self._platform_machine
Returns the platform machine architecture.
Returns the platform machine architecture.
[ "Returns", "the", "platform", "machine", "architecture", "." ]
def get_platform_machine(self): """Returns the platform machine architecture.""" return self._platform_machine
[ "def", "get_platform_machine", "(", "self", ")", ":", "return", "self", ".", "_platform_machine" ]
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/sysinfo/sysinfo.py#L76-L78
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/_exceptions.py
python
SAXParseException.__str__
(self)
return "%s:%s:%s: %s" % (sysid, linenum, colnum, self._msg)
Create a string representation of the exception.
Create a string representation of the exception.
[ "Create", "a", "string", "representation", "of", "the", "exception", "." ]
def __str__(self): "Create a string representation of the exception." sysid = self.getSystemId() if sysid is None: sysid = "<unknown>" linenum = self.getLineNumber() if linenum is None: linenum = "?" colnum = self.getColumnNumber() if colnu...
[ "def", "__str__", "(", "self", ")", ":", "sysid", "=", "self", ".", "getSystemId", "(", ")", "if", "sysid", "is", "None", ":", "sysid", "=", "\"<unknown>\"", "linenum", "=", "self", ".", "getLineNumber", "(", ")", "if", "linenum", "is", "None", ":", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/_exceptions.py#L89-L100
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py
python
TarFile.getmember
(self, name)
return tarinfo
Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version.
Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version.
[ "Return", "a", "TarInfo", "object", "for", "member", "name", ".", "If", "name", "can", "not", "be", "found", "in", "the", "archive", "KeyError", "is", "raised", ".", "If", "a", "member", "occurs", "more", "than", "once", "in", "the", "archive", "its", ...
def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. """ tarinfo...
[ "def", "getmember", "(", "self", ",", "name", ")", ":", "tarinfo", "=", "self", ".", "_getmember", "(", "name", ")", "if", "tarinfo", "is", "None", ":", "raise", "KeyError", "(", "\"filename %r not found\"", "%", "name", ")", "return", "tarinfo" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tarfile.py#L1746-L1755
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py
python
Calendar.monthdatescalendar
(self, year, month)
return [ dates[i:i+7] for i in range(0, len(dates), 7) ]
Return a matrix (list of lists) representing a month's calendar. Each row represents a week; week entries are datetime.date values.
Return a matrix (list of lists) representing a month's calendar. Each row represents a week; week entries are datetime.date values.
[ "Return", "a", "matrix", "(", "list", "of", "lists", ")", "representing", "a", "month", "s", "calendar", ".", "Each", "row", "represents", "a", "week", ";", "week", "entries", "are", "datetime", ".", "date", "values", "." ]
def monthdatescalendar(self, year, month): """ Return a matrix (list of lists) representing a month's calendar. Each row represents a week; week entries are datetime.date values. """ dates = list(self.itermonthdates(year, month)) return [ dates[i:i+7] for i in range(0, le...
[ "def", "monthdatescalendar", "(", "self", ",", "year", ",", "month", ")", ":", "dates", "=", "list", "(", "self", ".", "itermonthdates", "(", "year", ",", "month", ")", ")", "return", "[", "dates", "[", "i", ":", "i", "+", "7", "]", "for", "i", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py#L194-L200
Salensoft/thu-cst-cracker
f7f6b4de460aaac6da3d776ab28d9175e8b32ae2
大三上/软件工程/hw/2015/Homework/作业2 - 代码风格/01_code_style/my_posixpath.py
python
normcase
(s)
return s
Normalize case of pathname. Has no effect under Posix
Normalize case of pathname. Has no effect under Posix
[ "Normalize", "case", "of", "pathname", ".", "Has", "no", "effect", "under", "Posix" ]
def normcase(s): """Normalize case of pathname. Has no effect under Posix""" return s
[ "def", "normcase", "(", "s", ")", ":", "return", "s" ]
https://github.com/Salensoft/thu-cst-cracker/blob/f7f6b4de460aaac6da3d776ab28d9175e8b32ae2/大三上/软件工程/hw/2015/Homework/作业2 - 代码风格/01_code_style/my_posixpath.py#L55-L57
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/inputs/outputs.py
python
InputProperties.check
(self)
Checks for optional parameters.
Checks for optional parameters.
[ "Checks", "for", "optional", "parameters", "." ]
def check(self): """Checks for optional parameters.""" super(InputProperties,self).check() if self.stride.fetch() < 0: raise ValueError("The stride length for the properties file output must be positive.")
[ "def", "check", "(", "self", ")", ":", "super", "(", "InputProperties", ",", "self", ")", ".", "check", "(", ")", "if", "self", ".", "stride", ".", "fetch", "(", ")", "<", "0", ":", "raise", "ValueError", "(", "\"The stride length for the properties file o...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/outputs.py#L82-L87
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/caffe-mnc/python/caffe/io.py
python
Transformer.preprocess
(self, in_, data)
return caffe_in
Format input for Caffe: - convert to single - resize to input dimensions (preserving number of channels) - transpose dimensions to K x H x W - reorder channels (for instance color to BGR) - scale raw input (e.g. from [0, 1] to [0, 255] for ImageNet models) - subtract mean...
Format input for Caffe: - convert to single - resize to input dimensions (preserving number of channels) - transpose dimensions to K x H x W - reorder channels (for instance color to BGR) - scale raw input (e.g. from [0, 1] to [0, 255] for ImageNet models) - subtract mean...
[ "Format", "input", "for", "Caffe", ":", "-", "convert", "to", "single", "-", "resize", "to", "input", "dimensions", "(", "preserving", "number", "of", "channels", ")", "-", "transpose", "dimensions", "to", "K", "x", "H", "x", "W", "-", "reorder", "channe...
def preprocess(self, in_, data): """ Format input for Caffe: - convert to single - resize to input dimensions (preserving number of channels) - transpose dimensions to K x H x W - reorder channels (for instance color to BGR) - scale raw input (e.g. from [0, 1] to ...
[ "def", "preprocess", "(", "self", ",", "in_", ",", "data", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "caffe_in", "=", "data", ".", "astype", "(", "np", ".", "float32", ",", "copy", "=", "False", ")", "transpose", "=", "self", ".", "t...
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/python/caffe/io.py#L121-L161
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/websocket.py
python
WebSocketHandler.ping_interval
(self)
return self.settings.get("websocket_ping_interval", None)
The interval for websocket keep-alive pings. Set websocket_ping_interval = 0 to disable pings.
The interval for websocket keep-alive pings.
[ "The", "interval", "for", "websocket", "keep", "-", "alive", "pings", "." ]
def ping_interval(self) -> Optional[float]: """The interval for websocket keep-alive pings. Set websocket_ping_interval = 0 to disable pings. """ return self.settings.get("websocket_ping_interval", None)
[ "def", "ping_interval", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "return", "self", ".", "settings", ".", "get", "(", "\"websocket_ping_interval\"", ",", "None", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/websocket.py#L284-L289
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_deploy.py
python
cli_test
(ctx, config)
ceph-deploy cli to exercise most commonly use cli's and ensure all commands works and also startup the init system.
ceph-deploy cli to exercise most commonly use cli's and ensure all commands works and also startup the init system.
[ "ceph", "-", "deploy", "cli", "to", "exercise", "most", "commonly", "use", "cli", "s", "and", "ensure", "all", "commands", "works", "and", "also", "startup", "the", "init", "system", "." ]
def cli_test(ctx, config): """ ceph-deploy cli to exercise most commonly use cli's and ensure all commands works and also startup the init system. """ log.info('Ceph-deploy Test') if config is None: config = {} test_branch = '' conf_dir = teuthology.get_testdir(ctx) + "/cdtest...
[ "def", "cli_test", "(", "ctx", ",", "config", ")", ":", "log", ".", "info", "(", "'Ceph-deploy Test'", ")", "if", "config", "is", "None", ":", "config", "=", "{", "}", "test_branch", "=", "''", "conf_dir", "=", "teuthology", ".", "get_testdir", "(", "c...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_deploy.py#L567-L701
widelands/widelands
e9f047d46a23d81312237d52eabf7d74e8de52d6
utils/make_spritemap.py
python
build_frame_group_regions
(frames)
return (float(cost) / len(frames), newframes)
Given a list of frame, identify variable subregions and split frames into blits accordingly. Return (avgcost, list of list of ((x, y), pic, pc_pic))
Given a list of frame, identify variable subregions and split frames into blits accordingly.
[ "Given", "a", "list", "of", "frame", "identify", "variable", "subregions", "and", "split", "frames", "into", "blits", "accordingly", "." ]
def build_frame_group_regions(frames): """Given a list of frame, identify variable subregions and split frames into blits accordingly. Return (avgcost, list of list of ((x, y), pic, pc_pic)) """ pc = frames[0].pc_pic is not None regions = [] if len(frames) > 1: # Find the regions t...
[ "def", "build_frame_group_regions", "(", "frames", ")", ":", "pc", "=", "frames", "[", "0", "]", ".", "pc_pic", "is", "not", "None", "regions", "=", "[", "]", "if", "len", "(", "frames", ")", ">", "1", ":", "# Find the regions that are not equal over all fra...
https://github.com/widelands/widelands/blob/e9f047d46a23d81312237d52eabf7d74e8de52d6/utils/make_spritemap.py#L306-L367
Project-OSRM/osrm-backend
f2e284623e25b5570dd2a5e6985abcb3790fd348
third_party/flatbuffers/python/flatbuffers/table.py
python
Table.Vector
(self, off)
return x
Vector retrieves the start of data of the vector whose offset is stored at "off" in this object.
Vector retrieves the start of data of the vector whose offset is stored at "off" in this object.
[ "Vector", "retrieves", "the", "start", "of", "data", "of", "the", "vector", "whose", "offset", "is", "stored", "at", "off", "in", "this", "object", "." ]
def Vector(self, off): """Vector retrieves the start of data of the vector whose offset is stored at "off" in this object.""" N.enforce_number(off, N.UOffsetTFlags) off += self.Pos x = off + self.Get(N.UOffsetTFlags, off) # data starts after metadata containing the ve...
[ "def", "Vector", "(", "self", ",", "off", ")", ":", "N", ".", "enforce_number", "(", "off", ",", "N", ".", "UOffsetTFlags", ")", "off", "+=", "self", ".", "Pos", "x", "=", "off", "+", "self", ".", "Get", "(", "N", ".", "UOffsetTFlags", ",", "off"...
https://github.com/Project-OSRM/osrm-backend/blob/f2e284623e25b5570dd2a5e6985abcb3790fd348/third_party/flatbuffers/python/flatbuffers/table.py#L66-L75
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/tools/scan-build-py/lib/libscanbuild/intercept.py
python
is_preload_disabled
(platform)
Library-based interposition will fail silently if SIP is enabled, so this should be detected. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csrutil status' contains 'System Integrity...
Library-based interposition will fail silently if SIP is enabled, so this should be detected. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csrutil status' contains 'System Integrity...
[ "Library", "-", "based", "interposition", "will", "fail", "silently", "if", "SIP", "is", "enabled", "so", "this", "should", "be", "detected", ".", "You", "can", "detect", "whether", "SIP", "is", "enabled", "on", "Darwin", "by", "checking", "whether", "(", ...
def is_preload_disabled(platform): """ Library-based interposition will fail silently if SIP is enabled, so this should be detected. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csr...
[ "def", "is_preload_disabled", "(", "platform", ")", ":", "if", "platform", "in", "WRAPPER_ONLY_PLATFORMS", ":", "return", "True", "elif", "platform", "==", "'darwin'", ":", "command", "=", "[", "'csrutil'", ",", "'status'", "]", "pattern", "=", "re", ".", "c...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libscanbuild/intercept.py#L226-L246
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextFileHandler.SaveStream
(*args, **kwargs)
return _richtext.RichTextFileHandler_SaveStream(*args, **kwargs)
SaveStream(self, RichTextBuffer buffer, wxOutputStream stream) -> bool
SaveStream(self, RichTextBuffer buffer, wxOutputStream stream) -> bool
[ "SaveStream", "(", "self", "RichTextBuffer", "buffer", "wxOutputStream", "stream", ")", "-", ">", "bool" ]
def SaveStream(*args, **kwargs): """SaveStream(self, RichTextBuffer buffer, wxOutputStream stream) -> bool""" return _richtext.RichTextFileHandler_SaveStream(*args, **kwargs)
[ "def", "SaveStream", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextFileHandler_SaveStream", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2756-L2758
facebookincubator/katran
192eb988c398afc673620254097defb7035d669e
build/fbcode_builder/getdeps/manifest.py
python
ManifestParser.is_first_party_project
(self)
return self.shipit_project is not None
returns true if this is an FB first-party project
returns true if this is an FB first-party project
[ "returns", "true", "if", "this", "is", "an", "FB", "first", "-", "party", "project" ]
def is_first_party_project(self): """returns true if this is an FB first-party project""" return self.shipit_project is not None
[ "def", "is_first_party_project", "(", "self", ")", ":", "return", "self", ".", "shipit_project", "is", "not", "None" ]
https://github.com/facebookincubator/katran/blob/192eb988c398afc673620254097defb7035d669e/build/fbcode_builder/getdeps/manifest.py#L355-L357
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/mem/qos/QoSMemSinkInterface.py
python
QoSMemSinkInterface.controller
(self)
return controller
Instantiate the memory controller and bind it to the current interface.
Instantiate the memory controller and bind it to the current interface.
[ "Instantiate", "the", "memory", "controller", "and", "bind", "it", "to", "the", "current", "interface", "." ]
def controller(self): """ Instantiate the memory controller and bind it to the current interface. """ controller = QoSMemSinkCtrl() controller.interface = self return controller
[ "def", "controller", "(", "self", ")", ":", "controller", "=", "QoSMemSinkCtrl", "(", ")", "controller", ".", "interface", "=", "self", "return", "controller" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/qos/QoSMemSinkInterface.py#L43-L50
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py
python
_Parse._parse_policy_autovec
(self, has_baseline, final_targets, extra_flags)
return has_baseline, final_targets, extra_flags
skip features that has no auto-vectorized support by compiler
skip features that has no auto-vectorized support by compiler
[ "skip", "features", "that", "has", "no", "auto", "-", "vectorized", "support", "by", "compiler" ]
def _parse_policy_autovec(self, has_baseline, final_targets, extra_flags): """skip features that has no auto-vectorized support by compiler""" skipped = [] for tar in final_targets[:]: if isinstance(tar, str): can = self.feature_can_autovec(tar) else: # mu...
[ "def", "_parse_policy_autovec", "(", "self", ",", "has_baseline", ",", "final_targets", ",", "extra_flags", ")", ":", "skipped", "=", "[", "]", "for", "tar", "in", "final_targets", "[", ":", "]", ":", "if", "isinstance", "(", "tar", ",", "str", ")", ":",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py#L2099-L2117
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py
python
Response.links
(self)
return l
Returns the parsed header links of the response, if any.
Returns the parsed header links of the response, if any.
[ "Returns", "the", "parsed", "header", "links", "of", "the", "response", "if", "any", "." ]
def links(self): """Returns the parsed header links of the response, if any.""" header = self.headers.get('link') # l = MultiDict() l = {} if header: links = parse_header_links(header) for link in links: key = link.get('rel') or link.ge...
[ "def", "links", "(", "self", ")", ":", "header", "=", "self", ".", "headers", ".", "get", "(", "'link'", ")", "# l = MultiDict()", "l", "=", "{", "}", "if", "header", ":", "links", "=", "parse_header_links", "(", "header", ")", "for", "link", "in", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py#L901-L916
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/tablez.py
python
TablesHandler.on_table_cell_key_press
(self, widget, event, path, model, col_num)
return False
Catches Table Cell key presses
Catches Table Cell key presses
[ "Catches", "Table", "Cell", "key", "presses" ]
def on_table_cell_key_press(self, widget, event, path, model, col_num): """Catches Table Cell key presses""" keyname = gtk.gdk.keyval_name(event.keyval) if event.state & gtk.gdk.SHIFT_MASK: pass elif event.state & gtk.gdk.MOD1_MASK: pass elif event.state &...
[ "def", "on_table_cell_key_press", "(", "self", ",", "widget", ",", "event", ",", "path", ",", "model", ",", "col_num", ")", ":", "keyname", "=", "gtk", ".", "gdk", ".", "keyval_name", "(", "event", ".", "keyval", ")", "if", "event", ".", "state", "&", ...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/tablez.py#L403-L460
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/utils/vector.py
python
Vector2D.__truediv__
(self, other)
Divide the vector to another.
Divide the vector to another.
[ "Divide", "the", "vector", "to", "another", "." ]
def __truediv__(self, other): """Divide the vector to another.""" if isinstance(other, Vector2D): # Dot product return self.x / other.x + self.y / other.y elif isinstance(other, float): # Scalar product return Vector2D(self.x / other, self.y / ot...
[ "def", "__truediv__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "Vector2D", ")", ":", "# Dot product", "return", "self", ".", "x", "/", "other", ".", "x", "+", "self", ".", "y", "/", "other", ".", "y", "elif", "is...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/utils/vector.py#L63-L72
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftmake/make_line.py
python
make_line
(first_param, last_param=None)
return obj
makeLine(first_param, p2) Creates a line from 2 points or from a given object. Parameters ---------- first_param : Base.Vector -> First point of the line (if p2 is None) Part.LineSegment -> Line is created from the given Linesegment Shape -> Line is created from the give S...
makeLine(first_param, p2) Creates a line from 2 points or from a given object.
[ "makeLine", "(", "first_param", "p2", ")", "Creates", "a", "line", "from", "2", "points", "or", "from", "a", "given", "object", "." ]
def make_line(first_param, last_param=None): """makeLine(first_param, p2) Creates a line from 2 points or from a given object. Parameters ---------- first_param : Base.Vector -> First point of the line (if p2 is None) Part.LineSegment -> Line is created from the given Linesegm...
[ "def", "make_line", "(", "first_param", ",", "last_param", "=", "None", ")", ":", "if", "last_param", ":", "p1", "=", "first_param", "p2", "=", "last_param", "else", ":", "if", "hasattr", "(", "first_param", ",", "\"StartPoint\"", ")", "and", "hasattr", "(...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftmake/make_line.py#L34-L67
QMCPACK/qmcpack
d0948ab455e38364458740cc8e2239600a14c5cd
nexus/lib/grid_functions.py
python
ParallelotopeGrid.initialize_local
(self, axes = None, shape = None, cells = None, dr = None, corner = None, center = None, centered = False, ...
(`Internal API`) Initialize the parallelotope grid points and set the origin if not provided.
(`Internal API`) Initialize the parallelotope grid points and set the origin if not provided.
[ "(", "Internal", "API", ")", "Initialize", "the", "parallelotope", "grid", "points", "and", "set", "the", "origin", "if", "not", "provided", "." ]
def initialize_local(self, axes = None, shape = None, cells = None, dr = None, corner = None, center = None, centered = False...
[ "def", "initialize_local", "(", "self", ",", "axes", "=", "None", ",", "shape", "=", "None", ",", "cells", "=", "None", ",", "dr", "=", "None", ",", "corner", "=", "None", ",", "center", "=", "None", ",", "centered", "=", "False", ",", "*", "*", ...
https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/nexus/lib/grid_functions.py#L2221-L2271