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
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/workunit.py
python
_spawn_on_all_clients
(ctx, refspec, tests, env, basedir, subdir, timeout=None, cleanup=True)
Make a scratch directory for each client in the cluster, and then for each test spawn _run_tests() for each role. See run_tests() for parameter documentation.
Make a scratch directory for each client in the cluster, and then for each test spawn _run_tests() for each role.
[ "Make", "a", "scratch", "directory", "for", "each", "client", "in", "the", "cluster", "and", "then", "for", "each", "test", "spawn", "_run_tests", "()", "for", "each", "role", "." ]
def _spawn_on_all_clients(ctx, refspec, tests, env, basedir, subdir, timeout=None, cleanup=True): """ Make a scratch directory for each client in the cluster, and then for each test spawn _run_tests() for each role. See run_tests() for parameter documentation. """ is_client = misc.is_type('clie...
[ "def", "_spawn_on_all_clients", "(", "ctx", ",", "refspec", ",", "tests", ",", "env", ",", "basedir", ",", "subdir", ",", "timeout", "=", "None", ",", "cleanup", "=", "True", ")", ":", "is_client", "=", "misc", ".", "is_type", "(", "'client'", ")", "cl...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/workunit.py#L276-L303
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/jpsro.py
python
_qp_ce
( payoff, a_mats, e_vecs, assume_full_support=False, action_repeats=None, solver_kwargs=None, min_epsilon=False)
return dist, meta
Returns the correlated equilibrium with maximum Gini impurity. Args: payoff: A [NUM_PLAYER, NUM_ACT_0, NUM_ACT_1, ...] shape payoff tensor. a_mats: A [NUM_CON, PROD(A)] shape gain tensor. e_vecs: Epsilon vector. assume_full_support: Whether to ignore beta values. action_repeats: Vector of action ...
Returns the correlated equilibrium with maximum Gini impurity.
[ "Returns", "the", "correlated", "equilibrium", "with", "maximum", "Gini", "impurity", "." ]
def _qp_ce( payoff, a_mats, e_vecs, assume_full_support=False, action_repeats=None, solver_kwargs=None, min_epsilon=False): """Returns the correlated equilibrium with maximum Gini impurity. Args: payoff: A [NUM_PLAYER, NUM_ACT_0, NUM_ACT_1, ...] shape payoff tensor. a_mats: A [N...
[ "def", "_qp_ce", "(", "payoff", ",", "a_mats", ",", "e_vecs", ",", "assume_full_support", "=", "False", ",", "action_repeats", "=", "None", ",", "solver_kwargs", "=", "None", ",", "min_epsilon", "=", "False", ")", ":", "num_players", "=", "payoff", ".", "s...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/jpsro.py#L599-L694
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/weakref.py
python
finalize.peek
(self)
If alive then return (obj, func, args, kwargs); otherwise return None
If alive then return (obj, func, args, kwargs); otherwise return None
[ "If", "alive", "then", "return", "(", "obj", "func", "args", "kwargs", ")", ";", "otherwise", "return", "None" ]
def peek(self): """If alive then return (obj, func, args, kwargs); otherwise return None""" info = self._registry.get(self) obj = info and info.weakref() if obj is not None: return (obj, info.func, info.args, info.kwargs or {})
[ "def", "peek", "(", "self", ")", ":", "info", "=", "self", ".", "_registry", ".", "get", "(", "self", ")", "obj", "=", "info", "and", "info", ".", "weakref", "(", ")", "if", "obj", "is", "not", "None", ":", "return", "(", "obj", ",", "info", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/weakref.py#L582-L588
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/tools/docs/parser.py
python
_ClassPageInfo.doc
(self)
return self._doc
Returns a `_DocstringInfo` created from the object's docstring.
Returns a `_DocstringInfo` created from the object's docstring.
[ "Returns", "a", "_DocstringInfo", "created", "from", "the", "object", "s", "docstring", "." ]
def doc(self): """Returns a `_DocstringInfo` created from the object's docstring.""" return self._doc
[ "def", "doc", "(", "self", ")", ":", "return", "self", ".", "_doc" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/parser.py#L923-L925
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/python-common/ceph/deployment/drive_group.py
python
DriveGroupSpec._from_json_impl
(cls, json_drive_group)
return super(DriveGroupSpec, cls)._from_json_impl(args)
Initialize 'Drive group' structure :param json_drive_group: A valid json string with a Drive Group specification
Initialize 'Drive group' structure
[ "Initialize", "Drive", "group", "structure" ]
def _from_json_impl(cls, json_drive_group): # type: (dict) -> DriveGroupSpec """ Initialize 'Drive group' structure :param json_drive_group: A valid json string with a Drive Group specification """ args: Dict[str, Any] = json_drive_group.copy() # l...
[ "def", "_from_json_impl", "(", "cls", ",", "json_drive_group", ")", ":", "# type: (dict) -> DriveGroupSpec", "args", ":", "Dict", "[", "str", ",", "Any", "]", "=", "json_drive_group", ".", "copy", "(", ")", "# legacy json (pre Octopus)", "if", "'host_pattern'", "i...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/python-common/ceph/deployment/drive_group.py#L243-L265
Illumina/strelka
d7377443b62319f7c7bd70c241c4b2df3459e29a
src/python/lib/estimateHardware.py
python
getNodeHyperthreadCoreCount
()
return cpuCount
return the number of hyperthread (or 'logical') cores on this host linux logic taken from R Kelley's function in IsisWorkflow
return the number of hyperthread (or 'logical') cores on this host
[ "return", "the", "number", "of", "hyperthread", "(", "or", "logical", ")", "cores", "on", "this", "host" ]
def getNodeHyperthreadCoreCount(): """ return the number of hyperthread (or 'logical') cores on this host linux logic taken from R Kelley's function in IsisWorkflow """ cpuCount = 0 import platform if platform.system().find("Linux") > -1: cname="/proc/cpuinfo" if not os.p...
[ "def", "getNodeHyperthreadCoreCount", "(", ")", ":", "cpuCount", "=", "0", "import", "platform", "if", "platform", ".", "system", "(", ")", ".", "find", "(", "\"Linux\"", ")", ">", "-", "1", ":", "cname", "=", "\"/proc/cpuinfo\"", "if", "not", "os", ".",...
https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/estimateHardware.py#L84-L118
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewIndexListModel.IsEnabledByRow
(*args, **kwargs)
return _dataview.DataViewIndexListModel_IsEnabledByRow(*args, **kwargs)
IsEnabledByRow(self, unsigned int row, unsigned int col) -> bool
IsEnabledByRow(self, unsigned int row, unsigned int col) -> bool
[ "IsEnabledByRow", "(", "self", "unsigned", "int", "row", "unsigned", "int", "col", ")", "-", ">", "bool" ]
def IsEnabledByRow(*args, **kwargs): """IsEnabledByRow(self, unsigned int row, unsigned int col) -> bool""" return _dataview.DataViewIndexListModel_IsEnabledByRow(*args, **kwargs)
[ "def", "IsEnabledByRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewIndexListModel_IsEnabledByRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L825-L827
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py
python
parse229
(resp, peer)
return host, port
Parse the '229' response for an EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.
Parse the '229' response for an EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.
[ "Parse", "the", "229", "response", "for", "an", "EPSV", "request", ".", "Raises", "error_proto", "if", "it", "does", "not", "contain", "(", "|||port|", ")", "Return", "(", "host", ".", "addr", ".", "as", ".", "numbers", "port#", ")", "tuple", "." ]
def parse229(resp, peer): '''Parse the '229' response for an EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] != '229': raise error_reply(resp) left = resp.find('(') if left < 0: raise error_proto(resp) ...
[ "def", "parse229", "(", "resp", ",", "peer", ")", ":", "if", "resp", "[", ":", "3", "]", "!=", "'229'", ":", "raise", "error_reply", "(", "resp", ")", "left", "=", "resp", ".", "find", "(", "'('", ")", "if", "left", "<", "0", ":", "raise", "err...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py#L859-L878
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/constraint_solver/samples/vrp_with_time_limit.py
python
print_solution
(manager, routing, solution)
Prints solution on console.
Prints solution on console.
[ "Prints", "solution", "on", "console", "." ]
def print_solution(manager, routing, solution): """Prints solution on console.""" print(f'Objective: {solution.ObjectiveValue()}') max_route_distance = 0 for vehicle_id in range(manager.GetNumberOfVehicles()): index = routing.Start(vehicle_id) plan_output = 'Route for vehicle {}:\n'.form...
[ "def", "print_solution", "(", "manager", ",", "routing", ",", "solution", ")", ":", "print", "(", "f'Objective: {solution.ObjectiveValue()}'", ")", "max_route_distance", "=", "0", "for", "vehicle_id", "in", "range", "(", "manager", ".", "GetNumberOfVehicles", "(", ...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/vrp_with_time_limit.py#L24-L42
WagicProject/wagic
8e551bb287668c285a41206cf10f1a3197887ca2
projects/mtg/tools/build/lib/pyjavaproperties-0.6/pyjavaproperties.py
python
Properties.setProperty
(self, key, value)
Set the property for the given key
Set the property for the given key
[ "Set", "the", "property", "for", "the", "given", "key" ]
def setProperty(self, key, value): """ Set the property for the given key """ if type(key) is str and type(value) is str: self.processPair(key, value) else: raise TypeError,'both key and value should be strings!'
[ "def", "setProperty", "(", "self", ",", "key", ",", "value", ")", ":", "if", "type", "(", "key", ")", "is", "str", "and", "type", "(", "value", ")", "is", "str", ":", "self", ".", "processPair", "(", "key", ",", "value", ")", "else", ":", "raise"...
https://github.com/WagicProject/wagic/blob/8e551bb287668c285a41206cf10f1a3197887ca2/projects/mtg/tools/build/lib/pyjavaproperties-0.6/pyjavaproperties.py#L254-L260
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/serial/serialutil.py
python
to_bytes
(seq)
convert a sequence to a bytes type
convert a sequence to a bytes type
[ "convert", "a", "sequence", "to", "a", "bytes", "type" ]
def to_bytes(seq): """convert a sequence to a bytes type""" if isinstance(seq, bytes): return seq elif isinstance(seq, bytearray): return bytes(seq) elif isinstance(seq, memoryview): return seq.tobytes() elif isinstance(seq, unicode): raise TypeError('unicode strings ...
[ "def", "to_bytes", "(", "seq", ")", ":", "if", "isinstance", "(", "seq", ",", "bytes", ")", ":", "return", "seq", "elif", "isinstance", "(", "seq", ",", "bytearray", ")", ":", "return", "bytes", "(", "seq", ")", "elif", "isinstance", "(", "seq", ",",...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/serialutil.py#L54-L66
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/state_management.py
python
ChainingStateManager.initialize_graph
(self, model, input_statistics=None)
Adds required operations to the graph.
Adds required operations to the graph.
[ "Adds", "required", "operations", "to", "the", "graph", "." ]
def initialize_graph(self, model, input_statistics=None): """Adds required operations to the graph.""" super(ChainingStateManager, self).initialize_graph( model=model, input_statistics=input_statistics) self._start_state = model.get_start_state() self._cached_states = math_utils.TupleOfTensorsLo...
[ "def", "initialize_graph", "(", "self", ",", "model", ",", "input_statistics", "=", "None", ")", ":", "super", "(", "ChainingStateManager", ",", "self", ")", ".", "initialize_graph", "(", "model", "=", "model", ",", "input_statistics", "=", "input_statistics", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/state_management.py#L143-L153
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/PortCppVisitor.py
python
PortCppVisitor.initFilesVisit
(self, obj)
Defined to generate files for generated code products. @param args: the instance of the concrete element to operation on.
Defined to generate files for generated code products.
[ "Defined", "to", "generate", "files", "for", "generated", "code", "products", "." ]
def initFilesVisit(self, obj): """ Defined to generate files for generated code products. @param args: the instance of the concrete element to operation on. """ # Build filename here... if self.__config.get("port", "XMLDefaultFileName") == "True": filename = o...
[ "def", "initFilesVisit", "(", "self", ",", "obj", ")", ":", "# Build filename here...", "if", "self", ".", "__config", ".", "get", "(", "\"port\"", ",", "\"XMLDefaultFileName\"", ")", "==", "\"True\"", ":", "filename", "=", "obj", ".", "get_type", "(", ")", ...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/PortCppVisitor.py#L163-L200
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/formats/style_render.py
python
_parse_latex_css_conversion
(styles: CSSList)
return latex_styles
Convert CSS (attribute,value) pairs to equivalent LaTeX (command,options) pairs. Ignore conversion if tagged with `--latex` option, skipped if no conversion found.
Convert CSS (attribute,value) pairs to equivalent LaTeX (command,options) pairs.
[ "Convert", "CSS", "(", "attribute", "value", ")", "pairs", "to", "equivalent", "LaTeX", "(", "command", "options", ")", "pairs", "." ]
def _parse_latex_css_conversion(styles: CSSList) -> CSSList: """ Convert CSS (attribute,value) pairs to equivalent LaTeX (command,options) pairs. Ignore conversion if tagged with `--latex` option, skipped if no conversion found. """ def font_weight(value, arg): if value == "bold" or value ...
[ "def", "_parse_latex_css_conversion", "(", "styles", ":", "CSSList", ")", "->", "CSSList", ":", "def", "font_weight", "(", "value", ",", "arg", ")", ":", "if", "value", "==", "\"bold\"", "or", "value", "==", "\"bolder\"", ":", "return", "\"bfseries\"", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/style_render.py#L1377-L1450
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlNode.isText
(self)
return ret
Is this node a Text node ?
Is this node a Text node ?
[ "Is", "this", "node", "a", "Text", "node", "?" ]
def isText(self): """Is this node a Text node ? """ ret = libxml2mod.xmlNodeIsText(self._o) return ret
[ "def", "isText", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlNodeIsText", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L3299-L3302
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/ar.py
python
configure
(conf)
Finds the ar program and sets the default flags in ``conf.env.ARFLAGS``
Finds the ar program and sets the default flags in ``conf.env.ARFLAGS``
[ "Finds", "the", "ar", "program", "and", "sets", "the", "default", "flags", "in", "conf", ".", "env", ".", "ARFLAGS" ]
def configure(conf): """Finds the ar program and sets the default flags in ``conf.env.ARFLAGS``""" conf.find_program('ar', var='AR') conf.add_os_flags('ARFLAGS') if not conf.env.ARFLAGS: conf.env.ARFLAGS = ['rcs']
[ "def", "configure", "(", "conf", ")", ":", "conf", ".", "find_program", "(", "'ar'", ",", "var", "=", "'AR'", ")", "conf", ".", "add_os_flags", "(", "'ARFLAGS'", ")", "if", "not", "conf", ".", "env", ".", "ARFLAGS", ":", "conf", ".", "env", ".", "A...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/ar.py#L18-L23
nlohmann/json
eb2182414749825be086c825edb5229e5c28503d
third_party/cpplint/cpplint.py
python
_FilterExcludedFiles
(fnames)
return [f for f in fnames if not any(e for e in exclude_paths if _IsParentOrSame(e, os.path.abspath(f)))]
Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
[ "Filters", "out", "files", "listed", "in", "the", "--", "exclude", "command", "line", "switch", ".", "File", "paths", "in", "the", "switch", "are", "evaluated", "relative", "to", "the", "current", "working", "directory" ]
def _FilterExcludedFiles(fnames): """Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory """ exclude_paths = [os.path.abspath(f) for f in _excludes] # because globbing does not work recursively, exclude all subpath of ...
[ "def", "_FilterExcludedFiles", "(", "fnames", ")", ":", "exclude_paths", "=", "[", "os", ".", "path", ".", "abspath", "(", "f", ")", "for", "f", "in", "_excludes", "]", "# because globbing does not work recursively, exclude all subpath of all excluded entries", "return"...
https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L6848-L6856
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__delslice__
(self, start, stop)
Deletes the subset of items from between the specified indices.
Deletes the subset of items from between the specified indices.
[ "Deletes", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __delslice__(self, start, stop): """Deletes the subset of items from between the specified indices.""" del self._values[start:stop] self._message_listener.Modified()
[ "def", "__delslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "del", "self", ".", "_values", "[", "start", ":", "stop", "]", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py#L166-L169
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PropertyGrid.GetVerticalSpacing
(*args, **kwargs)
return _propgrid.PropertyGrid_GetVerticalSpacing(*args, **kwargs)
GetVerticalSpacing(self) -> int
GetVerticalSpacing(self) -> int
[ "GetVerticalSpacing", "(", "self", ")", "-", ">", "int" ]
def GetVerticalSpacing(*args, **kwargs): """GetVerticalSpacing(self) -> int""" return _propgrid.PropertyGrid_GetVerticalSpacing(*args, **kwargs)
[ "def", "GetVerticalSpacing", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GetVerticalSpacing", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2150-L2152
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
bindings/python/topsort.py
python
topsort_levels_core
(num_parents, children)
Topologically sort a bunch of interdependent items based on dependency. This returns a generator. Turn this into a an iterator using the iter built-in function. (if you iterate over the iterator, each element gets generated when it is asked for, rather than generating the whole list up-front.) Eac...
Topologically sort a bunch of interdependent items based on dependency.
[ "Topologically", "sort", "a", "bunch", "of", "interdependent", "items", "based", "on", "dependency", "." ]
def topsort_levels_core(num_parents, children): """Topologically sort a bunch of interdependent items based on dependency. This returns a generator. Turn this into a an iterator using the iter built-in function. (if you iterate over the iterator, each element gets generated when it is asked for, ra...
[ "def", "topsort_levels_core", "(", "num_parents", ",", "children", ")", ":", "while", "1", ":", "# Suck up everything without a predecessor.", "level_parents", "=", "[", "x", "for", "x", "in", "num_parents", ".", "keys", "(", ")", "if", "num_parents", "[", "x", ...
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/bindings/python/topsort.py#L174-L232
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
_get_concat_variable
(name, shape, dtype, num_shards)
return concat_variable
Get a sharded variable concatenated into one tensor.
Get a sharded variable concatenated into one tensor.
[ "Get", "a", "sharded", "variable", "concatenated", "into", "one", "tensor", "." ]
def _get_concat_variable(name, shape, dtype, num_shards): """Get a sharded variable concatenated into one tensor.""" sharded_variable = _get_sharded_variable(name, shape, dtype, num_shards) if len(sharded_variable) == 1: return sharded_variable[0] concat_name = name + "/concat" concat_full_name = vs.get_...
[ "def", "_get_concat_variable", "(", "name", ",", "shape", ",", "dtype", ",", "num_shards", ")", ":", "sharded_variable", "=", "_get_sharded_variable", "(", "name", ",", "shape", ",", "dtype", ",", "num_shards", ")", "if", "len", "(", "sharded_variable", ")", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L42-L57
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
TextBoxAttr.GetFlags
(*args, **kwargs)
return _richtext.TextBoxAttr_GetFlags(*args, **kwargs)
GetFlags(self) -> int
GetFlags(self) -> int
[ "GetFlags", "(", "self", ")", "-", ">", "int" ]
def GetFlags(*args, **kwargs): """GetFlags(self) -> int""" return _richtext.TextBoxAttr_GetFlags(*args, **kwargs)
[ "def", "GetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextBoxAttr_GetFlags", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L560-L562
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/models.py
python
RequestEncodingMixin._encode_files
(files, data)
return body, content_type
Build the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tuples (filename, fileobj), 3-tuples (filenam...
Build the body for a multipart/form-data request.
[ "Build", "the", "body", "for", "a", "multipart", "/", "form", "-", "data", "request", "." ]
def _encode_files(files, data): """Build the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tu...
[ "def", "_encode_files", "(", "files", ",", "data", ")", ":", "if", "(", "not", "files", ")", ":", "raise", "ValueError", "(", "\"Files must be provided.\"", ")", "elif", "isinstance", "(", "data", ",", "basestring", ")", ":", "raise", "ValueError", "(", "\...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/models.py#L110-L171
nmslib/nmslib
5acedb651c277af8d99fa75def9f8b2590bd9512
benchmark/data_utils.py
python
load_dense
(file_name_pref)
return np.load(file_name_pref + NP_SUFF)
A wrapper for loading dense vectors. :param file_name_pref: input file name prefix (without npy) :return: dense numpy array
A wrapper for loading dense vectors.
[ "A", "wrapper", "for", "loading", "dense", "vectors", "." ]
def load_dense(file_name_pref): """A wrapper for loading dense vectors. :param file_name_pref: input file name prefix (without npy) :return: dense numpy array """ return np.load(file_name_pref + NP_SUFF)
[ "def", "load_dense", "(", "file_name_pref", ")", ":", "return", "np", ".", "load", "(", "file_name_pref", "+", "NP_SUFF", ")" ]
https://github.com/nmslib/nmslib/blob/5acedb651c277af8d99fa75def9f8b2590bd9512/benchmark/data_utils.py#L47-L53
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/_cptree.py
python
Tree.graft
(self, wsgi_callable, script_name="")
Mount a wsgi callable at the given script_name.
Mount a wsgi callable at the given script_name.
[ "Mount", "a", "wsgi", "callable", "at", "the", "given", "script_name", "." ]
def graft(self, wsgi_callable, script_name=""): """Mount a wsgi callable at the given script_name.""" # Next line both 1) strips trailing slash and 2) maps "/" -> "". script_name = script_name.rstrip("/") self.apps[script_name] = wsgi_callable
[ "def", "graft", "(", "self", ",", "wsgi_callable", ",", "script_name", "=", "\"\"", ")", ":", "# Next line both 1) strips trailing slash and 2) maps \"/\" -> \"\".", "script_name", "=", "script_name", ".", "rstrip", "(", "\"/\"", ")", "self", ".", "apps", "[", "scri...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cptree.py#L224-L228
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/mailbox.py
python
MHMessage.get_sequences
(self)
return self._sequences[:]
Return a list of sequences that include the message.
Return a list of sequences that include the message.
[ "Return", "a", "list", "of", "sequences", "that", "include", "the", "message", "." ]
def get_sequences(self): """Return a list of sequences that include the message.""" return self._sequences[:]
[ "def", "get_sequences", "(", "self", ")", ":", "return", "self", ".", "_sequences", "[", ":", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L1711-L1713
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/probability/distribution/_utils/utils.py
python
check_greater_equal_zero
(value, name)
Check if the given Tensor is greater zero. Args: value (Tensor, Parameter): value to be checked. name (str) : name of the value. Raises: ValueError: if the input value is less than zero.
Check if the given Tensor is greater zero.
[ "Check", "if", "the", "given", "Tensor", "is", "greater", "zero", "." ]
def check_greater_equal_zero(value, name): """ Check if the given Tensor is greater zero. Args: value (Tensor, Parameter): value to be checked. name (str) : name of the value. Raises: ValueError: if the input value is less than zero. """ if isinstance(value, Parameter)...
[ "def", "check_greater_equal_zero", "(", "value", ",", "name", ")", ":", "if", "isinstance", "(", "value", ",", "Parameter", ")", ":", "if", "not", "isinstance", "(", "value", ".", "data", ",", "Tensor", ")", ":", "return", "value", "=", "value", ".", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/_utils/utils.py#L74-L92
twhui/LiteFlowNet
00925aebf2db9ac50f4b1666f718688b10dd10d1
python/caffe/coord_map.py
python
coord_map_from_to
(top_from, top_to)
Determine the coordinate mapping betweeen a top (from) and a top (to). Walk the graph to find a common ancestor while composing the coord maps for from and to until they meet. As a last step the from map is inverted.
Determine the coordinate mapping betweeen a top (from) and a top (to). Walk the graph to find a common ancestor while composing the coord maps for from and to until they meet. As a last step the from map is inverted.
[ "Determine", "the", "coordinate", "mapping", "betweeen", "a", "top", "(", "from", ")", "and", "a", "top", "(", "to", ")", ".", "Walk", "the", "graph", "to", "find", "a", "common", "ancestor", "while", "composing", "the", "coord", "maps", "for", "from", ...
def coord_map_from_to(top_from, top_to): """ Determine the coordinate mapping betweeen a top (from) and a top (to). Walk the graph to find a common ancestor while composing the coord maps for from and to until they meet. As a last step the from map is inverted. """ # We need to find a common anc...
[ "def", "coord_map_from_to", "(", "top_from", ",", "top_to", ")", ":", "# We need to find a common ancestor of top_from and top_to.", "# We'll assume that all ancestors are equivalent here (otherwise the graph", "# is an inconsistent state (which we could improve this to check for)).", "# For n...
https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/python/caffe/coord_map.py#L115-L169
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py
python
Style.element_options
(self, elementname)
return tuple(o.lstrip('-') for o in self.tk.splitlist( self.tk.call(self._name, "element", "options", elementname)))
Return the list of elementname's options.
Return the list of elementname's options.
[ "Return", "the", "list", "of", "elementname", "s", "options", "." ]
def element_options(self, elementname): """Return the list of elementname's options.""" return tuple(o.lstrip('-') for o in self.tk.splitlist( self.tk.call(self._name, "element", "options", elementname)))
[ "def", "element_options", "(", "self", ",", "elementname", ")", ":", "return", "tuple", "(", "o", ".", "lstrip", "(", "'-'", ")", "for", "o", "in", "self", ".", "tk", ".", "splitlist", "(", "self", ".", "tk", ".", "call", "(", "self", ".", "_name",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py#L477-L480
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/mailbox.py
python
MaildirMessage.add_flag
(self, flag)
Set the given flag(s) without changing others.
Set the given flag(s) without changing others.
[ "Set", "the", "given", "flag", "(", "s", ")", "without", "changing", "others", "." ]
def add_flag(self, flag): """Set the given flag(s) without changing others.""" self.set_flags(''.join(set(self.get_flags()) | set(flag)))
[ "def", "add_flag", "(", "self", ",", "flag", ")", ":", "self", ".", "set_flags", "(", "''", ".", "join", "(", "set", "(", "self", ".", "get_flags", "(", ")", ")", "|", "set", "(", "flag", ")", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L1560-L1562
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/communicator.py
python
Communicator.walltime
(self)
return self.cpp_mpi_conf.getWalltime()
Wall clock time since creating the `Communicator` [seconds]. `walltime` returns the same value on each rank in the current partition.
Wall clock time since creating the `Communicator` [seconds].
[ "Wall", "clock", "time", "since", "creating", "the", "Communicator", "[", "seconds", "]", "." ]
def walltime(self): """Wall clock time since creating the `Communicator` [seconds]. `walltime` returns the same value on each rank in the current partition. """ return self.cpp_mpi_conf.getWalltime()
[ "def", "walltime", "(", "self", ")", ":", "return", "self", ".", "cpp_mpi_conf", ".", "getWalltime", "(", ")" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/communicator.py#L185-L190
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
GraphicsContext.PushState
(*args, **kwargs)
return _gdi_.GraphicsContext_PushState(*args, **kwargs)
PushState(self) Push the current state of the context, (ie the transformation matrix) on a stack
PushState(self)
[ "PushState", "(", "self", ")" ]
def PushState(*args, **kwargs): """ PushState(self) Push the current state of the context, (ie the transformation matrix) on a stack """ return _gdi_.GraphicsContext_PushState(*args, **kwargs)
[ "def", "PushState", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsContext_PushState", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6137-L6144
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/statistics.py
python
_sum
(data, start=0)
return (T, total, count)
_sum(data [, start]) -> (type, sum, count) Return a high-precision sum of the given numeric data as a fraction, together with the type to be converted to and the count of items. If optional argument ``start`` is given, it is added to the total. If ``data`` is empty, ``start`` (defaulting to 0) is retu...
_sum(data [, start]) -> (type, sum, count)
[ "_sum", "(", "data", "[", "start", "]", ")", "-", ">", "(", "type", "sum", "count", ")" ]
def _sum(data, start=0): """_sum(data [, start]) -> (type, sum, count) Return a high-precision sum of the given numeric data as a fraction, together with the type to be converted to and the count of items. If optional argument ``start`` is given, it is added to the total. If ``data`` is empty, ``s...
[ "def", "_sum", "(", "data", ",", "start", "=", "0", ")", ":", "count", "=", "0", "n", ",", "d", "=", "_exact_ratio", "(", "start", ")", "partials", "=", "{", "d", ":", "n", "}", "partials_get", "=", "partials", ".", "get", "T", "=", "_coerce", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/statistics.py#L104-L159
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/wiredtiger/src/docs/tools/doxypy.py
python
Doxypy.makeCommentBlock
(self)
return l
Indents the current comment block with respect to the current indentation level. @returns a list of indented comment lines
Indents the current comment block with respect to the current indentation level.
[ "Indents", "the", "current", "comment", "block", "with", "respect", "to", "the", "current", "indentation", "level", "." ]
def makeCommentBlock(self): """Indents the current comment block with respect to the current indentation level. @returns a list of indented comment lines """ doxyStart = "##" commentLines = self.comment commentLines = map(lambda x: "%s# %s" % (self.indent, x), commentLines) l = [self.indent + doxyStar...
[ "def", "makeCommentBlock", "(", "self", ")", ":", "doxyStart", "=", "\"##\"", "commentLines", "=", "self", ".", "comment", "commentLines", "=", "map", "(", "lambda", "x", ":", "\"%s# %s\"", "%", "(", "self", ".", "indent", ",", "x", ")", ",", "commentLin...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/wiredtiger/src/docs/tools/doxypy.py#L324-L337
geemaple/leetcode
68bc5032e1ee52c22ef2f2e608053484c487af54
leetcode/324.wiggle-sort-ii.py
python
Solution.wiggleSort
(self, nums)
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
[ ":", "type", "nums", ":", "List", "[", "int", "]", ":", "rtype", ":", "void", "Do", "not", "return", "anything", "modify", "nums", "in", "-", "place", "instead", "." ]
def wiggleSort(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ arr = sorted(nums) for i in range(1, len(nums), 2): nums[i] = arr.pop() for i in range(0, len(nums), 2): ...
[ "def", "wiggleSort", "(", "self", ",", "nums", ")", ":", "arr", "=", "sorted", "(", "nums", ")", "for", "i", "in", "range", "(", "1", ",", "len", "(", "nums", ")", ",", "2", ")", ":", "nums", "[", "i", "]", "=", "arr", ".", "pop", "(", ")",...
https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/324.wiggle-sort-ii.py#L2-L13
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
SashLayoutWindow.GetOrientation
(*args, **kwargs)
return _windows_.SashLayoutWindow_GetOrientation(*args, **kwargs)
GetOrientation(self) -> int
GetOrientation(self) -> int
[ "GetOrientation", "(", "self", ")", "-", ">", "int" ]
def GetOrientation(*args, **kwargs): """GetOrientation(self) -> int""" return _windows_.SashLayoutWindow_GetOrientation(*args, **kwargs)
[ "def", "GetOrientation", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "SashLayoutWindow_GetOrientation", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L2059-L2061
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/ipaddress.py
python
_BaseV4._ip_int_from_string
(self, ip_str)
Turn the given IP string into an integer for comparison. Args: ip_str: A string, the IP ip_str. Returns: The IP ip_str as an integer. Raises: AddressValueError: if ip_str isn't a valid IPv4 Address.
Turn the given IP string into an integer for comparison.
[ "Turn", "the", "given", "IP", "string", "into", "an", "integer", "for", "comparison", "." ]
def _ip_int_from_string(self, ip_str): """Turn the given IP string into an integer for comparison. Args: ip_str: A string, the IP ip_str. Returns: The IP ip_str as an integer. Raises: AddressValueError: if ip_str isn't a valid IPv4 Address. ...
[ "def", "_ip_int_from_string", "(", "self", ",", "ip_str", ")", ":", "if", "not", "ip_str", ":", "raise", "AddressValueError", "(", "'Address cannot be empty'", ")", "octets", "=", "ip_str", ".", "split", "(", "'.'", ")", "if", "len", "(", "octets", ")", "!...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L1102-L1126
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/operations/prepare.py
python
get_file_url
( link, # type: Link download_dir=None, # type: Optional[str] hashes=None # type: Optional[Hashes] )
return File(from_path, None)
Get file and optionally check its hash.
Get file and optionally check its hash.
[ "Get", "file", "and", "optionally", "check", "its", "hash", "." ]
def get_file_url( link, # type: Link download_dir=None, # type: Optional[str] hashes=None # type: Optional[Hashes] ): # type: (...) -> File """Get file and optionally check its hash. """ # If a download dir is specified, is the file already there and valid? already_downloaded...
[ "def", "get_file_url", "(", "link", ",", "# type: Link", "download_dir", "=", "None", ",", "# type: Optional[str]", "hashes", "=", "None", "# type: Optional[Hashes]", ")", ":", "# type: (...) -> File", "# If a download dir is specified, is the file already there and valid?", "a...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/operations/prepare.py#L333-L387
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/utils/lui/lldbutil.py
python
get_registers
(frame, kind)
return None
Returns the registers given the frame and the kind of registers desired. Returns None if there's no such kind.
Returns the registers given the frame and the kind of registers desired.
[ "Returns", "the", "registers", "given", "the", "frame", "and", "the", "kind", "of", "registers", "desired", "." ]
def get_registers(frame, kind): """Returns the registers given the frame and the kind of registers desired. Returns None if there's no such kind. """ registerSet = frame.GetRegisters() # Return type of SBValueList. for value in registerSet: if kind.lower() in value.GetName().lower(): ...
[ "def", "get_registers", "(", "frame", ",", "kind", ")", ":", "registerSet", "=", "frame", ".", "GetRegisters", "(", ")", "# Return type of SBValueList.", "for", "value", "in", "registerSet", ":", "if", "kind", ".", "lower", "(", ")", "in", "value", ".", "G...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/lui/lldbutil.py#L900-L910
google/usd_from_gltf
6d288cce8b68744494a226574ae1d7ba6a9c46eb
tools/ufgbatch/ufgbatch.py
python
parse_args
()
Parse command-line arguments.
Parse command-line arguments.
[ "Parse", "command", "-", "line", "arguments", "." ]
def parse_args(): """Parse command-line arguments.""" try: parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument( 'csv', nargs='+', type=argparse.FileType('r'), help='Task CSV file path...
[ "def", "parse_args", "(", ")", ":", "try", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "__doc__", ",", "formatter_class", "=", "argparse", ".", "RawDescriptionHelpFormatter", ")", "parser", ".", "add_argument", "(", "'csv'", ...
https://github.com/google/usd_from_gltf/blob/6d288cce8b68744494a226574ae1d7ba6a9c46eb/tools/ufgbatch/ufgbatch.py#L89-L147
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py
python
CudnnParamsFormatConverterGRU._tf_to_cudnn_weights
(self, layer, *tf_weights)
return w_i, w_r, w_h, r_i, r_r, r_h
r"""Reverse the operations in StitchWeights().
r"""Reverse the operations in StitchWeights().
[ "r", "Reverse", "the", "operations", "in", "StitchWeights", "()", "." ]
def _tf_to_cudnn_weights(self, layer, *tf_weights): r"""Reverse the operations in StitchWeights().""" input_size = self._input_size num_units = self._num_units if layer == 0: input_weight_width = input_size else: input_weight_width = num_units if self._direction == CUDNN_RNN_BIDIRE...
[ "def", "_tf_to_cudnn_weights", "(", "self", ",", "layer", ",", "*", "tf_weights", ")", ":", "input_size", "=", "self", ".", "_input_size", "num_units", "=", "self", ".", "_num_units", "if", "layer", "==", "0", ":", "input_weight_width", "=", "input_size", "e...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L603-L623
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
TreeEvent.SetPoint
(*args, **kwargs)
return _controls_.TreeEvent_SetPoint(*args, **kwargs)
SetPoint(self, Point pt)
SetPoint(self, Point pt)
[ "SetPoint", "(", "self", "Point", "pt", ")" ]
def SetPoint(*args, **kwargs): """SetPoint(self, Point pt)""" return _controls_.TreeEvent_SetPoint(*args, **kwargs)
[ "def", "SetPoint", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeEvent_SetPoint", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L5128-L5130
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/handlers.py
python
MapperWorkerCallbackHandler.handle
(self)
Handle request. This method has to be careful to pass the same ShardState instance to its subroutines calls if the calls mutate or read from ShardState. Note especially that Context instance caches and updates the ShardState instance. Returns: Set HTTP status code and always returns None.
Handle request.
[ "Handle", "request", "." ]
def handle(self): """Handle request. This method has to be careful to pass the same ShardState instance to its subroutines calls if the calls mutate or read from ShardState. Note especially that Context instance caches and updates the ShardState instance. Returns: Set HTTP status code an...
[ "def", "handle", "(", "self", ")", ":", "# Reconstruct basic states.", "self", ".", "_start_time", "=", "self", ".", "_time", "(", ")", "shard_id", "=", "self", ".", "request", ".", "headers", "[", "util", ".", "_MR_SHARD_ID_TASK_HEADER", "]", "mr_id", "=", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/handlers.py#L419-L526
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/ultratb.py
python
TBTools.stb2text
(self, stb)
return '\n'.join(stb)
Convert a structured traceback (a list) to a string.
Convert a structured traceback (a list) to a string.
[ "Convert", "a", "structured", "traceback", "(", "a", "list", ")", "to", "a", "string", "." ]
def stb2text(self, stb): """Convert a structured traceback (a list) to a string.""" return '\n'.join(stb)
[ "def", "stb2text", "(", "self", ",", "stb", ")", ":", "return", "'\\n'", ".", "join", "(", "stb", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/ultratb.py#L557-L559
mapsme/omim
1892903b63f2c85b16ed4966d21fe76aba06b9ba
tools/python/stylesheet/webcolors/webcolors.py
python
whatever_to_rgb
(string)
Converts CSS3 color or a hex into rgb triplet; hash of string if fails.
Converts CSS3 color or a hex into rgb triplet; hash of string if fails.
[ "Converts", "CSS3", "color", "or", "a", "hex", "into", "rgb", "triplet", ";", "hash", "of", "string", "if", "fails", "." ]
def whatever_to_rgb(string): """ Converts CSS3 color or a hex into rgb triplet; hash of string if fails. """ string = string.strip().lower() try: return name_to_rgb(string) except ValueError: try: return hex_to_rgb(string) except ValueError: try: ...
[ "def", "whatever_to_rgb", "(", "string", ")", ":", "string", "=", "string", ".", "strip", "(", ")", ".", "lower", "(", ")", "try", ":", "return", "name_to_rgb", "(", "string", ")", "except", "ValueError", ":", "try", ":", "return", "hex_to_rgb", "(", "...
https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/stylesheet/webcolors/webcolors.py#L846-L861
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_simulation.py
python
SimulationDomain.getStopStartingVehiclesNumber
(self)
return self._getUniversal(tc.VAR_STOP_STARTING_VEHICLES_NUMBER)
getStopStartingVehiclesNumber() -> integer .
getStopStartingVehiclesNumber() -> integer
[ "getStopStartingVehiclesNumber", "()", "-", ">", "integer" ]
def getStopStartingVehiclesNumber(self): """getStopStartingVehiclesNumber() -> integer . """ return self._getUniversal(tc.VAR_STOP_STARTING_VEHICLES_NUMBER)
[ "def", "getStopStartingVehiclesNumber", "(", "self", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_STOP_STARTING_VEHICLES_NUMBER", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_simulation.py#L387-L392
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/ai_server/agent/db_source.py
python
TaskHandler.__init__
(self, interval, function, *args, **kwargs)
:param interval: int, execute interval for task, unit is 'second'. :param function: function object for task :param args: list parameters :param kwargs: dict parameters
:param interval: int, execute interval for task, unit is 'second'. :param function: function object for task :param args: list parameters :param kwargs: dict parameters
[ ":", "param", "interval", ":", "int", "execute", "interval", "for", "task", "unit", "is", "second", ".", ":", "param", "function", ":", "function", "object", "for", "task", ":", "param", "args", ":", "list", "parameters", ":", "param", "kwargs", ":", "di...
def __init__(self, interval, function, *args, **kwargs): """ :param interval: int, execute interval for task, unit is 'second'. :param function: function object for task :param args: list parameters :param kwargs: dict parameters """ threading.Thread.__init__(self...
[ "def", "__init__", "(", "self", ",", "interval", ",", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "threading", ".", "Thread", ".", "__init__", "(", "self", ")", "self", ".", "_function", "=", "function", "self", ".", "_interval", ...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_server/agent/db_source.py#L27-L42
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/ordered_dict.py
python
OrderedDict.values
(self)
return [self[key] for key in self]
od.values() -> list of values in od
od.values() -> list of values in od
[ "od", ".", "values", "()", "-", ">", "list", "of", "values", "in", "od" ]
def values(self): 'od.values() -> list of values in od' return [self[key] for key in self]
[ "def", "values", "(", "self", ")", ":", "return", "[", "self", "[", "key", "]", "for", "key", "in", "self", "]" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/ordered_dict.py#L147-L149
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
vendor/pybind11/tools/clang/cindex.py
python
CursorKind.is_reference
(self)
return conf.lib.clang_isReference(self)
Test if this is a reference kind.
Test if this is a reference kind.
[ "Test", "if", "this", "is", "a", "reference", "kind", "." ]
def is_reference(self): """Test if this is a reference kind.""" return conf.lib.clang_isReference(self)
[ "def", "is_reference", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isReference", "(", "self", ")" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/vendor/pybind11/tools/clang/cindex.py#L580-L582
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py
python
virtualenv_no_global
()
return False
Returns a boolean, whether running in venv with no system site-packages.
Returns a boolean, whether running in venv with no system site-packages.
[ "Returns", "a", "boolean", "whether", "running", "in", "venv", "with", "no", "system", "site", "-", "packages", "." ]
def virtualenv_no_global(): # type: () -> bool """Returns a boolean, whether running in venv with no system site-packages. """ # PEP 405 compliance needs to be checked first since virtualenv >=20 would # return True for both checks, but is only able to use the PEP 405 config. if _running_u...
[ "def", "virtualenv_no_global", "(", ")", ":", "# type: () -> bool", "# PEP 405 compliance needs to be checked first since virtualenv >=20 would", "# return True for both checks, but is only able to use the PEP 405 config.", "if", "_running_under_venv", "(", ")", ":", "return", "_no_globa...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py#L207-L231
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/seqan/dddoc/core.py
python
transformDddocEntry
(entry)
return []
Performs the text container node transformations. Returns list of entries to add if any.
Performs the text container node transformations.
[ "Performs", "the", "text", "container", "node", "transformations", "." ]
def transformDddocEntry(entry): """Performs the text container node transformations. Returns list of entries to add if any. """ for path in TEXT_CONTAINER_PATHS: if _pathsMatch(path, entry.path) and entry.content: # Is text container. new_entry = copy.deepcopy(entry) ne...
[ "def", "transformDddocEntry", "(", "entry", ")", ":", "for", "path", "in", "TEXT_CONTAINER_PATHS", ":", "if", "_pathsMatch", "(", "path", ",", "entry", ".", "path", ")", "and", "entry", ".", "content", ":", "# Is text container.", "new_entry", "=", "copy", "...
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dddoc/core.py#L134-L156
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/forkserver.py
python
ForkServer.set_forkserver_preload
(self, modules_names)
Set list of module names to try to load in forkserver process.
Set list of module names to try to load in forkserver process.
[ "Set", "list", "of", "module", "names", "to", "try", "to", "load", "in", "forkserver", "process", "." ]
def set_forkserver_preload(self, modules_names): '''Set list of module names to try to load in forkserver process.''' if not all(type(mod) is str for mod in self._preload_modules): raise TypeError('module_names must be a list of strings') self._preload_modules = modules_names
[ "def", "set_forkserver_preload", "(", "self", ",", "modules_names", ")", ":", "if", "not", "all", "(", "type", "(", "mod", ")", "is", "str", "for", "mod", "in", "self", ".", "_preload_modules", ")", ":", "raise", "TypeError", "(", "'module_names must be a li...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/forkserver.py#L61-L65
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/index_tricks.py
python
fill_diagonal
(a, val, wrap=False)
Fill the main diagonal of the given array of any dimensionality. For an array `a` with ``a.ndim >= 2``, the diagonal is the list of locations with indices ``a[i, ..., i]`` all identical. This function modifies the input array in-place, it does not return a value. Parameters ---------- a : arra...
Fill the main diagonal of the given array of any dimensionality.
[ "Fill", "the", "main", "diagonal", "of", "the", "given", "array", "of", "any", "dimensionality", "." ]
def fill_diagonal(a, val, wrap=False): """Fill the main diagonal of the given array of any dimensionality. For an array `a` with ``a.ndim >= 2``, the diagonal is the list of locations with indices ``a[i, ..., i]`` all identical. This function modifies the input array in-place, it does not return a valu...
[ "def", "fill_diagonal", "(", "a", ",", "val", ",", "wrap", "=", "False", ")", ":", "if", "a", ".", "ndim", "<", "2", ":", "raise", "ValueError", "(", "\"array must be at least 2-d\"", ")", "end", "=", "None", "if", "a", ".", "ndim", "==", "2", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/index_tricks.py#L779-L909
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/timeline/memory_dump_event.py
python
ProcessMemoryDumpEvent.GetMemoryBucket
(self, path)
return self._buckets[path]
Return the MemoryBucket associated with a category path. An empty bucket will be created if the path does not already exist. path: A string with path in the classification tree, e.g. '/Android/Java runtime/Cache'. Note: no trailing slash, except for the root path '/'.
Return the MemoryBucket associated with a category path.
[ "Return", "the", "MemoryBucket", "associated", "with", "a", "category", "path", "." ]
def GetMemoryBucket(self, path): """Return the MemoryBucket associated with a category path. An empty bucket will be created if the path does not already exist. path: A string with path in the classification tree, e.g. '/Android/Java runtime/Cache'. Note: no trailing slash, except for the ...
[ "def", "GetMemoryBucket", "(", "self", ",", "path", ")", ":", "if", "not", "path", "in", "self", ".", "_buckets", ":", "self", ".", "_buckets", "[", "path", "]", "=", "MemoryBucket", "(", ")", "return", "self", ".", "_buckets", "[", "path", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/timeline/memory_dump_event.py#L233-L244
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/StructuralMechanicsApplication/python_scripts/sprism_process.py
python
SPRISMProcess.ExecuteInitializeSolutionStep
(self)
This method is executed in order to initialize the current step Keyword arguments: self -- It signifies an instance of a class.
This method is executed in order to initialize the current step
[ "This", "method", "is", "executed", "in", "order", "to", "initialize", "the", "current", "step" ]
def ExecuteInitializeSolutionStep(self): """ This method is executed in order to initialize the current step Keyword arguments: self -- It signifies an instance of a class. """ # We compute the neighbours if we have remeshed the problem if self.main_model_part.Is(KM.MODI...
[ "def", "ExecuteInitializeSolutionStep", "(", "self", ")", ":", "# We compute the neighbours if we have remeshed the problem", "if", "self", ".", "main_model_part", ".", "Is", "(", "KM", ".", "MODIFIED", ")", ":", "self", ".", "sprism_neighbour_search", ".", "Execute", ...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/StructuralMechanicsApplication/python_scripts/sprism_process.py#L88-L96
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
Indigo.convertToArray
(self, iteratable)
Converts iterable object to array Args: iteratable (IndigoObject): iterable object Raises: IndigoException: if object is not iterable Returns: IndigoObject: array of objects
Converts iterable object to array
[ "Converts", "iterable", "object", "to", "array" ]
def convertToArray(self, iteratable): """Converts iterable object to array Args: iteratable (IndigoObject): iterable object Raises: IndigoException: if object is not iterable Returns: IndigoObject: array of objects """ if isinstance(...
[ "def", "convertToArray", "(", "self", ",", "iteratable", ")", ":", "if", "isinstance", "(", "iteratable", ",", "IndigoObject", ")", ":", "return", "iteratable", "try", ":", "some_object_iterator", "=", "iter", "(", "iteratable", ")", "res", "=", "self", ".",...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L5393-L5416
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_SafeTable.py
python
handler
(event, context)
return custom_resource_response.success_response(table_response.output, table_response.table_name)
Entry point for the Custom::SafeTable resource handler.
Entry point for the Custom::SafeTable resource handler.
[ "Entry", "point", "for", "the", "Custom", "::", "SafeTable", "resource", "handler", "." ]
def handler(event, context): """Entry point for the Custom::SafeTable resource handler.""" stack_id = event['StackId'] dynamodb = aws_utils.ClientWrapper(boto3.client('dynamodb')) wait_for_account_tables() request_type = event['RequestType'] table_name = get_table_name(event) if request_ty...
[ "def", "handler", "(", "event", ",", "context", ")", ":", "stack_id", "=", "event", "[", "'StackId'", "]", "dynamodb", "=", "aws_utils", ".", "ClientWrapper", "(", "boto3", ".", "client", "(", "'dynamodb'", ")", ")", "wait_for_account_tables", "(", ")", "r...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_SafeTable.py#L42-L115
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
applications/selfsupervised/resnet.py
python
ResNet152.__init__
(self, zero_init_residual=True, bn_statistics_group_size=1, name=None, width=1)
Initialize ResNet-152. Args: zero_init_residual (bool, optional): Whether to initialize the final batch normalization in residual branches with zeros. bn_statistics_group_size (str, optional): Group size for aggregating batch normalization...
Initialize ResNet-152.
[ "Initialize", "ResNet", "-", "152", "." ]
def __init__(self, zero_init_residual=True, bn_statistics_group_size=1, name=None, width=1): """Initialize ResNet-152. Args: zero_init_residual (bool, optional): Whether to initialize the final batch normali...
[ "def", "__init__", "(", "self", ",", "zero_init_residual", "=", "True", ",", "bn_statistics_group_size", "=", "1", ",", "name", "=", "None", ",", "width", "=", "1", ")", ":", "ResNet152", ".", "global_count", "+=", "1", "if", "name", "is", "None", ":", ...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/selfsupervised/resnet.py#L474-L498
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py
python
ParserElement.split
(self, instring, maxsplit=_MAX_INT, includeSeparators=False)
Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split res...
[]
def split(self, instring, maxsplit=_MAX_INT, includeSeparators=False): """ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (de...
[ "def", "split", "(", "self", ",", "instring", ",", "maxsplit", "=", "_MAX_INT", ",", "includeSeparators", "=", "False", ")", ":", "splits", "=", "0", "last", "=", "0", "for", "t", ",", "s", ",", "e", "in", "self", ".", "scanString", "(", "instring", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L3597-L3637
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/robotparser.py
python
RobotFileParser.parse
(self, lines)
parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.
parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.
[ "parse", "the", "input", "lines", "from", "a", "robots", ".", "txt", "file", ".", "We", "allow", "that", "a", "user", "-", "agent", ":", "line", "is", "not", "preceded", "by", "one", "or", "more", "blank", "lines", "." ]
def parse(self, lines): """parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" # states: # 0: start state # 1: saw user-agent line # 2: saw an allow or disallow line stat...
[ "def", "parse", "(", "self", ",", "lines", ")", ":", "# states:", "# 0: start state", "# 1: saw user-agent line", "# 2: saw an allow or disallow line", "state", "=", "0", "linenumber", "=", "0", "entry", "=", "Entry", "(", ")", "for", "line", "in", "lines", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/robotparser.py#L77-L125
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/modulefinder.py
python
ModuleFinder.any_missing_maybe
(self)
return missing, maybe
Return two lists, one with modules that are certainly missing and one with modules that *may* be missing. The latter names could either be submodules *or* just global names in the package. The reason it can't always be determined is that it's impossible to tell which names are imported ...
Return two lists, one with modules that are certainly missing and one with modules that *may* be missing. The latter names could either be submodules *or* just global names in the package.
[ "Return", "two", "lists", "one", "with", "modules", "that", "are", "certainly", "missing", "and", "one", "with", "modules", "that", "*", "may", "*", "be", "missing", ".", "The", "latter", "names", "could", "either", "be", "submodules", "*", "or", "*", "j...
def any_missing_maybe(self): """Return two lists, one with modules that are certainly missing and one with modules that *may* be missing. The latter names could either be submodules *or* just global names in the package. The reason it can't always be determined is that it's impossible t...
[ "def", "any_missing_maybe", "(", "self", ")", ":", "missing", "=", "[", "]", "maybe", "=", "[", "]", "for", "name", "in", "self", ".", "badmodules", ":", "if", "name", "in", "self", ".", "excludes", ":", "continue", "i", "=", "name", ".", "rfind", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/modulefinder.py#L534-L578
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/logging/jasper_logger.py
python
JasperHandler.emit
(self, record)
Emit a record to the jasper logging backend.
Emit a record to the jasper logging backend.
[ "Emit", "a", "record", "to", "the", "jasper", "logging", "backend", "." ]
def emit(self, record): """Emit a record to the jasper logging backend.""" record = self.format(record) log_format = self.pb.LoggingPayloadFormat.Value("FORMATSTRING") log_data = self.pb.LoggingPayloadData() log_data.msg = record logging_payload = self.pb.LoggingPayload(...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "record", "=", "self", ".", "format", "(", "record", ")", "log_format", "=", "self", ".", "pb", ".", "LoggingPayloadFormat", ".", "Value", "(", "\"FORMATSTRING\"", ")", "log_data", "=", "self", ".", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/jasper_logger.py#L86-L102
rizinorg/cutter
1b271a0ae8799f99c84c336a88d8c24729e4de63
docs/apidoc.py
python
write_file
(name, text, destdir)
Write the output file for module/package <name>.
Write the output file for module/package <name>.
[ "Write", "the", "output", "file", "for", "module", "/", "package", "<name", ">", "." ]
def write_file(name, text, destdir): """Write the output file for module/package <name>.""" fname = os.path.join(destdir, '%s.%s' % (name, 'rst')) if not os.path.exists(os.path.dirname(fname)): try: os.makedirs(os.path.dirname(fname)) except OSError as exc: # Guard against race...
[ "def", "write_file", "(", "name", ",", "text", ",", "destdir", ")", ":", "fname", "=", "os", ".", "path", ".", "join", "(", "destdir", ",", "'%s.%s'", "%", "(", "name", ",", "'rst'", ")", ")", "if", "not", "os", ".", "path", ".", "exists", "(", ...
https://github.com/rizinorg/cutter/blob/1b271a0ae8799f99c84c336a88d8c24729e4de63/docs/apidoc.py#L11-L31
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryengine/BinaryUnpacker.py
python
BinaryUnpacker.get
(self, varType, sz=0, endianness=LITTLEENDIAN)
First argument is the data-type: UINT32, VAR_INT, etc. If BINARY_CHUNK, need to supply a number of bytes to read, as well
First argument is the data-type: UINT32, VAR_INT, etc. If BINARY_CHUNK, need to supply a number of bytes to read, as well
[ "First", "argument", "is", "the", "data", "-", "type", ":", "UINT32", "VAR_INT", "etc", ".", "If", "BINARY_CHUNK", "need", "to", "supply", "a", "number", "of", "bytes", "to", "read", "as", "well" ]
def get(self, varType, sz=0, endianness=LITTLEENDIAN): """ First argument is the data-type: UINT32, VAR_INT, etc. If BINARY_CHUNK, need to supply a number of bytes to read, as well """ def sizeCheck(sz): if self.getRemainingSize()<sz: raise UnpackerError E = en...
[ "def", "get", "(", "self", ",", "varType", ",", "sz", "=", "0", ",", "endianness", "=", "LITTLEENDIAN", ")", ":", "def", "sizeCheck", "(", "sz", ")", ":", "if", "self", ".", "getRemainingSize", "(", ")", "<", "sz", ":", "raise", "UnpackerError", "E",...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/BinaryUnpacker.py#L54-L128
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py
python
easy_install.installation_report
(self, req, dist, what="Installed")
return msg % locals()
Helpful installation message for display to package users
Helpful installation message for display to package users
[ "Helpful", "installation", "message", "for", "display", "to", "package", "users" ]
def installation_report(self, req, dist, what="Installed"): """Helpful installation message for display to package users""" msg = "\n%(what)s %(eggloc)s%(extras)s" if self.multi_version and not self.no_report: msg += '\n' + self.__mv_warning if self.install_dir not in map...
[ "def", "installation_report", "(", "self", ",", "req", ",", "dist", ",", "what", "=", "\"Installed\"", ")", ":", "msg", "=", "\"\\n%(what)s %(eggloc)s%(extras)s\"", "if", "self", ".", "multi_version", "and", "not", "self", ".", "no_report", ":", "msg", "+=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py#L1111-L1123
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.spawn
( cls, argv, cwd=None, env=None, echo=True, preexec_fn=None, dimensions=(24, 80))
return inst
Start the given command in a child process in a pseudo terminal. This does all the fork/exec type of stuff for a pty, and returns an instance of PtyProcess. If preexec_fn is supplied, it will be called with no arguments in the child process before exec-ing the specified command. ...
Start the given command in a child process in a pseudo terminal.
[ "Start", "the", "given", "command", "in", "a", "child", "process", "in", "a", "pseudo", "terminal", "." ]
def spawn( cls, argv, cwd=None, env=None, echo=True, preexec_fn=None, dimensions=(24, 80)): '''Start the given command in a child process in a pseudo terminal. This does all the fork/exec type of stuff for a pty, and returns an instance of PtyProcess. If preexec...
[ "def", "spawn", "(", "cls", ",", "argv", ",", "cwd", "=", "None", ",", "env", "=", "None", ",", "echo", "=", "True", ",", "preexec_fn", "=", "None", ",", "dimensions", "=", "(", "24", ",", "80", ")", ")", ":", "# Note that it is difficult for this meth...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L179-L338
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Wm.wm_iconposition
(self, x=None, y=None)
return self._getints(self.tk.call( 'wm', 'iconposition', self._w, x, y))
Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.
Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.
[ "Set", "the", "position", "of", "the", "icon", "of", "this", "widget", "to", "X", "and", "Y", ".", "Return", "a", "tuple", "of", "the", "current", "values", "of", "X", "and", "X", "if", "None", "is", "given", "." ]
def wm_iconposition(self, x=None, y=None): """Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.""" return self._getints(self.tk.call( 'wm', 'iconposition', self._w, x, y))
[ "def", "wm_iconposition", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "'wm'", ",", "'iconposition'", ",", "self", ".", "_w", ",", "x", ",", "y",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L1640-L1644
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/distutils/ccompiler.py
python
CCompiler.set_library_dirs
(self, dirs)
Set the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default.
Set the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default.
[ "Set", "the", "list", "of", "library", "search", "directories", "to", "dirs", "(", "a", "list", "of", "strings", ")", ".", "This", "does", "not", "affect", "any", "standard", "library", "search", "path", "that", "the", "linker", "may", "search", "by", "d...
def set_library_dirs(self, dirs): """Set the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default. """ self.library_dirs = dirs[:]
[ "def", "set_library_dirs", "(", "self", ",", "dirs", ")", ":", "self", ".", "library_dirs", "=", "dirs", "[", ":", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/distutils/ccompiler.py#L286-L291
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
FWCore/ParameterSet/python/Types.py
python
EDAlias.allProducts
()
return VPSet(PSet(type = string('*')))
A helper to specify that all products of a module are to be aliased for. Example usage: process.someAlias = cms.EDAlias( aliasForModuleLabel = cms.EDAlias.allProducts() )
A helper to specify that all products of a module are to be aliased for. Example usage: process.someAlias = cms.EDAlias( aliasForModuleLabel = cms.EDAlias.allProducts() )
[ "A", "helper", "to", "specify", "that", "all", "products", "of", "a", "module", "are", "to", "be", "aliased", "for", ".", "Example", "usage", ":", "process", ".", "someAlias", "=", "cms", ".", "EDAlias", "(", "aliasForModuleLabel", "=", "cms", ".", "EDAl...
def allProducts(): """A helper to specify that all products of a module are to be aliased for. Example usage: process.someAlias = cms.EDAlias( aliasForModuleLabel = cms.EDAlias.allProducts() ) """ return VPSet(PSet(type = string('*')))
[ "def", "allProducts", "(", ")", ":", "return", "VPSet", "(", "PSet", "(", "type", "=", "string", "(", "'*'", ")", ")", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Types.py#L1402-L1408
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/msg/_RouteNetwork.py
python
RouteNetwork.deserialize_numpy
(self, str, numpy)
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", "using", "numpy", "for", "array", "types", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str", ":", "param", "numpy", ":", "numpy", "python", ...
def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: if self.header is None: self.header = std_msgs.msg.H...
[ "def", "deserialize_numpy", "(", "self", ",", "str", ",", "numpy", ")", ":", "try", ":", "if", "self", ".", "header", "is", "None", ":", "self", ".", "header", "=", "std_msgs", ".", "msg", ".", "Header", "(", ")", "if", "self", ".", "id", "is", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/msg/_RouteNetwork.py#L583-L735
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathGetPoint.py
python
TaskPanel.updatePoint
(self, usePoint = True)
updatePoint() ... internal function - do not call.
updatePoint() ... internal function - do not call.
[ "updatePoint", "()", "...", "internal", "function", "-", "do", "not", "call", "." ]
def updatePoint(self, usePoint = True): '''updatePoint() ... internal function - do not call.''' if usePoint and self.point: self.pt = self.point else: x = FreeCAD.Units.Quantity(self.formPoint.globalX.text()).Value y = FreeCAD.Units.Quantity(self.formPoint.gl...
[ "def", "updatePoint", "(", "self", ",", "usePoint", "=", "True", ")", ":", "if", "usePoint", "and", "self", ".", "point", ":", "self", ".", "pt", "=", "self", ".", "point", "else", ":", "x", "=", "FreeCAD", ".", "Units", ".", "Quantity", "(", "self...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathGetPoint.py#L231-L239
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
exodus.num_info_records
(self)
return int(self.__ex_inquire_int(ex_inquiry_map('EX_INQ_INFO')))
get the number of info records >>> num_info_recs = exo.num_info_records() Returns ------- num_info_recs : int
get the number of info records
[ "get", "the", "number", "of", "info", "records" ]
def num_info_records(self): """ get the number of info records >>> num_info_recs = exo.num_info_records() Returns ------- num_info_recs : int """ return int(self.__ex_inquire_int(ex_inquiry_map('EX_INQ_INFO')))
[ "def", "num_info_records", "(", "self", ")", ":", "return", "int", "(", "self", ".", "__ex_inquire_int", "(", "ex_inquiry_map", "(", "'EX_INQ_INFO'", ")", ")", ")" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L992-L1002
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/cs.py
python
debug_cs
(self)
The C# targets may create .mdb or .pdb files:: def build(bld): bld(features='cs', source='My.cs', bintype='library', gen='my.dll', csdebug='full') # csdebug is a value in (True, 'full', 'pdbonly')
The C# targets may create .mdb or .pdb files::
[ "The", "C#", "targets", "may", "create", ".", "mdb", "or", ".", "pdb", "files", "::" ]
def debug_cs(self): """ The C# targets may create .mdb or .pdb files:: def build(bld): bld(features='cs', source='My.cs', bintype='library', gen='my.dll', csdebug='full') # csdebug is a value in (True, 'full', 'pdbonly') """ csdebug = getattr(self, 'csdebug', self.env.CSDEBUG) if not csdebug: return n...
[ "def", "debug_cs", "(", "self", ")", ":", "csdebug", "=", "getattr", "(", "self", ",", "'csdebug'", ",", "self", ".", "env", ".", "CSDEBUG", ")", "if", "not", "csdebug", ":", "return", "node", "=", "self", ".", "cs_task", ".", "outputs", "[", "0", ...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/cs.py#L88-L117
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Part/BOPTools/__init__.py
python
importAll
()
importAll(): imports all modules of BOPTools package
importAll(): imports all modules of BOPTools package
[ "importAll", "()", ":", "imports", "all", "modules", "of", "BOPTools", "package" ]
def importAll(): "importAll(): imports all modules of BOPTools package" from . import GeneralFuseResult from . import JoinAPI from . import JoinFeatures from . import ShapeMerge from . import Utils from . import SplitAPI from . import SplitFeatures
[ "def", "importAll", "(", ")", ":", "from", ".", "import", "GeneralFuseResult", "from", ".", "import", "JoinAPI", "from", ".", "import", "JoinFeatures", "from", ".", "import", "ShapeMerge", "from", ".", "import", "Utils", "from", ".", "import", "SplitAPI", "f...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Part/BOPTools/__init__.py#L42-L50
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/diffraction/diffraction_run_setup.py
python
RunSetupWidget._disablebkgdcorr_clicked
(self)
return
Handling event if disable empty run check box is clicked
Handling event if disable empty run check box is clicked
[ "Handling", "event", "if", "disable", "empty", "run", "check", "box", "is", "clicked" ]
def _disablebkgdcorr_clicked(self): """ Handling event if disable empty run check box is clicked """ if self._content.disablebkgdcorr_chkbox.isChecked() is True: self._content.emptyrun_edit.setEnabled(False) self._content.emptyrun_edit.setText("") #self._conte...
[ "def", "_disablebkgdcorr_clicked", "(", "self", ")", ":", "if", "self", ".", "_content", ".", "disablebkgdcorr_chkbox", ".", "isChecked", "(", ")", "is", "True", ":", "self", ".", "_content", ".", "emptyrun_edit", ".", "setEnabled", "(", "False", ")", "self"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/diffraction/diffraction_run_setup.py#L454-L464
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/uiautomator/setup.py
python
Setup
(test_options)
return (TestRunnerFactory, tests)
Runs uiautomator tests on connected device(s). Args: test_options: A UIAutomatorOptions object. Returns: A tuple of (TestRunnerFactory, tests).
Runs uiautomator tests on connected device(s).
[ "Runs", "uiautomator", "tests", "on", "connected", "device", "(", "s", ")", "." ]
def Setup(test_options): """Runs uiautomator tests on connected device(s). Args: test_options: A UIAutomatorOptions object. Returns: A tuple of (TestRunnerFactory, tests). """ test_pkg = test_package.TestPackage(test_options.uiautomator_jar, test_options.uiautom...
[ "def", "Setup", "(", "test_options", ")", ":", "test_pkg", "=", "test_package", ".", "TestPackage", "(", "test_options", ".", "uiautomator_jar", ",", "test_options", ".", "uiautomator_info_jar", ")", "tests", "=", "test_pkg", ".", "GetAllMatchingTests", "(", "test...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/uiautomator/setup.py#L13-L35
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/_msvccompiler.py
python
_find_exe
(exe, paths=None)
return exe
Return path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, ju...
Return path to an MSVC executable program.
[ "Return", "path", "to", "an", "MSVC", "executable", "program", "." ]
def _find_exe(exe, paths=None): """Return path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is kn...
[ "def", "_find_exe", "(", "exe", ",", "paths", "=", "None", ")", ":", "if", "not", "paths", ":", "paths", "=", "os", ".", "getenv", "(", "'path'", ")", ".", "split", "(", "os", ".", "pathsep", ")", "for", "p", "in", "paths", ":", "fn", "=", "os"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/_msvccompiler.py#L140-L155
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
_check_shape
(shape, key)
return shape
Returns shape if it's valid, raises error otherwise.
Returns shape if it's valid, raises error otherwise.
[ "Returns", "shape", "if", "it", "s", "valid", "raises", "error", "otherwise", "." ]
def _check_shape(shape, key): """Returns shape if it's valid, raises error otherwise.""" assert shape is not None if not nest.is_sequence(shape): shape = [shape] shape = tuple(shape) for dimension in shape: if not isinstance(dimension, int): raise TypeError('shape dimensions must be integer. ' ...
[ "def", "_check_shape", "(", "shape", ",", "key", ")", ":", "assert", "shape", "is", "not", "None", "if", "not", "nest", ".", "is_sequence", "(", "shape", ")", ":", "shape", "=", "[", "shape", "]", "shape", "=", "tuple", "(", "shape", ")", "for", "d...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L3439-L3452
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py
python
EnvironmentInfo.FSharp
(self)
return [self.si.FSharpInstallDir]
Microsoft Visual F#. Return ------ list of str paths
Microsoft Visual F#.
[ "Microsoft", "Visual", "F#", "." ]
def FSharp(self): """ Microsoft Visual F#. Return ------ list of str paths """ if 11.0 > self.vs_ver > 12.0: return [] return [self.si.FSharpInstallDir]
[ "def", "FSharp", "(", "self", ")", ":", "if", "11.0", ">", "self", ".", "vs_ver", ">", "12.0", ":", "return", "[", "]", "return", "[", "self", ".", "si", ".", "FSharpInstallDir", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L1671-L1683
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
compiler-rt/lib/asan/scripts/asan_symbolize.py
python
AsanSymbolizerPlugInProxy._filter_single_value
(self, function_name, input_value)
return new_value
Helper for filter style plugin functions.
Helper for filter style plugin functions.
[ "Helper", "for", "filter", "style", "plugin", "functions", "." ]
def _filter_single_value(self, function_name, input_value): """ Helper for filter style plugin functions. """ new_value = input_value for plugin in self._plugins: result = getattr(plugin, function_name)(new_value) if result is None: return None new_value = result retu...
[ "def", "_filter_single_value", "(", "self", ",", "function_name", ",", "input_value", ")", ":", "new_value", "=", "input_value", "for", "plugin", "in", "self", ".", "_plugins", ":", "result", "=", "getattr", "(", "plugin", ",", "function_name", ")", "(", "ne...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/compiler-rt/lib/asan/scripts/asan_symbolize.py#L613-L623
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/feature_selection/_mutual_info.py
python
mutual_info_regression
(X, y, discrete_features='auto', n_neighbors=3, copy=True, random_state=None)
return _estimate_mi(X, y, discrete_features, False, n_neighbors, copy, random_state)
Estimate mutual information for a continuous target variable. Mutual information (MI) [1]_ between two random variables is a non-negative value, which measures the dependency between the variables. It is equal to zero if and only if two random variables are independent, and higher values mean higher de...
Estimate mutual information for a continuous target variable.
[ "Estimate", "mutual", "information", "for", "a", "continuous", "target", "variable", "." ]
def mutual_info_regression(X, y, discrete_features='auto', n_neighbors=3, copy=True, random_state=None): """Estimate mutual information for a continuous target variable. Mutual information (MI) [1]_ between two random variables is a non-negative value, which measures the dependen...
[ "def", "mutual_info_regression", "(", "X", ",", "y", ",", "discrete_features", "=", "'auto'", ",", "n_neighbors", "=", "3", ",", "copy", "=", "True", ",", "random_state", "=", "None", ")", ":", "return", "_estimate_mi", "(", "X", ",", "y", ",", "discrete...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_selection/_mutual_info.py#L295-L371
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/affine/hstack.py
python
Hstack.graph_implementation
( self, arg_objs, shape: Tuple[int, ...], data=None )
return (lu.hstack(arg_objs, shape), [])
Stack the expressions horizontally. Parameters ---------- arg_objs : list LinExpr for each argument. shape : tuple The shape of the resulting expression. data : Additional data required by the atom. Returns ------- tup...
Stack the expressions horizontally.
[ "Stack", "the", "expressions", "horizontally", "." ]
def graph_implementation( self, arg_objs, shape: Tuple[int, ...], data=None ) -> Tuple[lo.LinOp, List[Constraint]]: """Stack the expressions horizontally. Parameters ---------- arg_objs : list LinExpr for each argument. shape : tuple The shape...
[ "def", "graph_implementation", "(", "self", ",", "arg_objs", ",", "shape", ":", "Tuple", "[", "int", ",", "...", "]", ",", "data", "=", "None", ")", "->", "Tuple", "[", "lo", ".", "LinOp", ",", "List", "[", "Constraint", "]", "]", ":", "return", "(...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/hstack.py#L74-L93
deeplearningais/CUV
4e920ad1304af9de3e5f755cc2e9c5c96e06c324
examples/rbm/datasets.py
python
DataSet.subtract_variable_mean
(self)
subtract mean from each variable
subtract mean from each variable
[ "subtract", "mean", "from", "each", "variable" ]
def subtract_variable_mean(self): """ subtract mean from each variable """ self.mean = self.data.mean(axis=1) self.data -= self.mean[:,np.newaxis] if "test_data" in self.__dict__: self.test_data -= self.mean[:,np.newaxis]
[ "def", "subtract_variable_mean", "(", "self", ")", ":", "self", ".", "mean", "=", "self", ".", "data", ".", "mean", "(", "axis", "=", "1", ")", "self", ".", "data", "-=", "self", ".", "mean", "[", ":", ",", "np", ".", "newaxis", "]", "if", "\"tes...
https://github.com/deeplearningais/CUV/blob/4e920ad1304af9de3e5f755cc2e9c5c96e06c324/examples/rbm/datasets.py#L74-L79
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/masked/numctrl.py
python
NumCtrl._LostFocus
(self)
return True
On loss of focus, if limitOnFieldChange is set, ensure value conforms to limits.
On loss of focus, if limitOnFieldChange is set, ensure value conforms to limits.
[ "On", "loss", "of", "focus", "if", "limitOnFieldChange", "is", "set", "ensure", "value", "conforms", "to", "limits", "." ]
def _LostFocus(self): """ On loss of focus, if limitOnFieldChange is set, ensure value conforms to limits. """ ## dbg('NumCtrl::_LostFocus', indent=1) if self._limitOnFieldChange: ## dbg("limiting on loss of focus") value = self.GetValue() if sel...
[ "def", "_LostFocus", "(", "self", ")", ":", "## dbg('NumCtrl::_LostFocus', indent=1)", "if", "self", ".", "_limitOnFieldChange", ":", "## dbg(\"limiting on loss of focus\")", "value", "=", "self", ".", "GetValue", "(", ")", "if", "self", ".", "_min", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/numctrl.py#L973-L991
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/dual_quaternion.py
python
DualQuaternion.__mul__
(self, right)
return DualQuaternion(self.real_q * right.real_q, self.real_q * right.inf_q + self.inf_q * right.real_q)
dual quaternion multiplication
dual quaternion multiplication
[ "dual", "quaternion", "multiplication" ]
def __mul__(self, right): """ dual quaternion multiplication """ return DualQuaternion(self.real_q * right.real_q, self.real_q * right.inf_q + self.inf_q * right.real_q)
[ "def", "__mul__", "(", "self", ",", "right", ")", ":", "return", "DualQuaternion", "(", "self", ".", "real_q", "*", "right", ".", "real_q", ",", "self", ".", "real_q", "*", "right", ".", "inf_q", "+", "self", ".", "inf_q", "*", "right", ".", "real_q"...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/dual_quaternion.py#L16-L20
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Variables/BoolVariable.py
python
BoolVariable
(key, help, default)
return (key, '%s (yes|no)' % help, default, _validator, _text2bool)
The input parameters describe a boolean option, thus they are returned with the correct converter and validator appended. The 'help' text will by appended by '(yes|no) to show the valid valued. The result is usable for input to opts.Add().
The input parameters describe a boolean option, thus they are returned with the correct converter and validator appended. The 'help' text will by appended by '(yes|no) to show the valid valued. The result is usable for input to opts.Add().
[ "The", "input", "parameters", "describe", "a", "boolean", "option", "thus", "they", "are", "returned", "with", "the", "correct", "converter", "and", "validator", "appended", ".", "The", "help", "text", "will", "by", "appended", "by", "(", "yes|no", ")", "to"...
def BoolVariable(key, help, default): """ The input parameters describe a boolean option, thus they are returned with the correct converter and validator appended. The 'help' text will by appended by '(yes|no) to show the valid valued. The result is usable for input to opts.Add(). """ return...
[ "def", "BoolVariable", "(", "key", ",", "help", ",", "default", ")", ":", "return", "(", "key", ",", "'%s (yes|no)'", "%", "help", ",", "default", ",", "_validator", ",", "_text2bool", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Variables/BoolVariable.py#L75-L83
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDynamicContent/AWS/resource-manager-code/content_manifest.py
python
_create_upload_info
(context, file, parent, do_signing)
return upload_info
Gather the upload info for writing to the staging settings table later Arguments context -- context to use file -- file that has been uploaded to s3 parent -- parent of the uploaded file do_signing -- Whether to add file signatures to the content table for client side verificati...
Gather the upload info for writing to the staging settings table later Arguments context -- context to use file -- file that has been uploaded to s3 parent -- parent of the uploaded file do_signing -- Whether to add file signatures to the content table for client side verificati...
[ "Gather", "the", "upload", "info", "for", "writing", "to", "the", "staging", "settings", "table", "later", "Arguments", "context", "--", "context", "to", "use", "file", "--", "file", "that", "has", "been", "uploaded", "to", "s3", "parent", "--", "parent", ...
def _create_upload_info(context, file, parent, do_signing): """ Gather the upload info for writing to the staging settings table later Arguments context -- context to use file -- file that has been uploaded to s3 parent -- parent of the uploaded file do_signing -- Whether to...
[ "def", "_create_upload_info", "(", "context", ",", "file", ",", "parent", ",", "do_signing", ")", ":", "upload_info", "=", "{", "}", "if", "do_signing", ":", "signature", "=", "signing", ".", "get_file_signature", "(", "context", ",", "_get_path_for_file_entry",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDynamicContent/AWS/resource-manager-code/content_manifest.py#L1217-L1235
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py
python
DocFlag.HasType
(self)
return self.flag_type in self.HAS_TYPE
Returns whether this flag should have a type annotation.
Returns whether this flag should have a type annotation.
[ "Returns", "whether", "this", "flag", "should", "have", "a", "type", "annotation", "." ]
def HasType(self): """Returns whether this flag should have a type annotation.""" return self.flag_type in self.HAS_TYPE
[ "def", "HasType", "(", "self", ")", ":", "return", "self", ".", "flag_type", "in", "self", ".", "HAS_TYPE" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L299-L301
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/__init__.py
python
putintopackageroot
(target, source, env, pkgroot, honor_install_location=1)
return (target, new_source)
Uses the CopyAs builder to copy all source files to the directory given in pkgroot. If honor_install_location is set and the copied source file has an PACKAGING_INSTALL_LOCATION attribute, the PACKAGING_INSTALL_LOCATION is used as the new name of the source file under pkgroot. The source file will...
Uses the CopyAs builder to copy all source files to the directory given in pkgroot.
[ "Uses", "the", "CopyAs", "builder", "to", "copy", "all", "source", "files", "to", "the", "directory", "given", "in", "pkgroot", "." ]
def putintopackageroot(target, source, env, pkgroot, honor_install_location=1): """ Uses the CopyAs builder to copy all source files to the directory given in pkgroot. If honor_install_location is set and the copied source file has an PACKAGING_INSTALL_LOCATION attribute, the PACKAGING_INSTALL_LOCATION...
[ "def", "putintopackageroot", "(", "target", ",", "source", ",", "env", ",", "pkgroot", ",", "honor_install_location", "=", "1", ")", ":", "# make sure the packageroot is a Dir object.", "if", "SCons", ".", "Util", ".", "is_String", "(", "pkgroot", ")", ":", "pkg...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/__init__.py#L252-L287
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py
python
Locator.get_project
(self, name)
return result
For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top.
For a given project, get a dictionary mapping available versions to Distribution instances.
[ "For", "a", "given", "project", "get", "a", "dictionary", "mapping", "available", "versions", "to", "Distribution", "instances", "." ]
def get_project(self, name): """ For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. """ if self._cache is None: # pragma: no cover ...
[ "def", "get_project", "(", "self", ",", "name", ")", ":", "if", "self", ".", "_cache", "is", "None", ":", "# pragma: no cover", "result", "=", "self", ".", "_get_project", "(", "name", ")", "elif", "name", "in", "self", ".", "_cache", ":", "result", "=...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L171-L186
balint256/gr-baz
937834ce3520b730277328d8e0cdebb3f2b1aafc
docs/doxygen/doxyxml/base.py
python
Base._get_dict_members
(self, cat=None)
return self._dict_members[cat]
For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None.
For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None.
[ "For", "given", "category", "a", "dictionary", "is", "returned", "mapping", "member", "names", "to", "members", "of", "that", "category", ".", "For", "names", "that", "are", "duplicated", "the", "name", "is", "mapped", "to", "None", "." ]
def _get_dict_members(self, cat=None): """ For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None. """ self.confirm_no_error() if cat not in self._dict_members: ...
[ "def", "_get_dict_members", "(", "self", ",", "cat", "=", "None", ")", ":", "self", ".", "confirm_no_error", "(", ")", "if", "cat", "not", "in", "self", ".", "_dict_members", ":", "new_dict", "=", "{", "}", "for", "mem", "in", "self", ".", "in_category...
https://github.com/balint256/gr-baz/blob/937834ce3520b730277328d8e0cdebb3f2b1aafc/docs/doxygen/doxyxml/base.py#L122-L137
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pprint.py
python
pformat
(object, indent=1, width=80, depth=None)
return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)
Format a Python object into a pretty-printed representation.
Format a Python object into a pretty-printed representation.
[ "Format", "a", "Python", "object", "into", "a", "pretty", "-", "printed", "representation", "." ]
def pformat(object, indent=1, width=80, depth=None): """Format a Python object into a pretty-printed representation.""" return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)
[ "def", "pformat", "(", "object", ",", "indent", "=", "1", ",", "width", "=", "80", ",", "depth", "=", "None", ")", ":", "return", "PrettyPrinter", "(", "indent", "=", "indent", ",", "width", "=", "width", ",", "depth", "=", "depth", ")", ".", "pfor...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pprint.py#L61-L63
commaai/openpilot
4416c21b1e738ab7d04147c5ae52b5135e0cdb40
pyextra/acados_template/acados_ocp.py
python
AcadosOcpConstraints.idxbu
(self)
return self.__idxbu
Indices of bounds on u (defines :math:`J_{bu}`) at shooting nodes (0 to N-1). Can be set by using :py:attr:`Jbu`. Type: :code:`np.ndarray`; default: :code:`np.array([])`
Indices of bounds on u (defines :math:`J_{bu}`) at shooting nodes (0 to N-1). Can be set by using :py:attr:`Jbu`. Type: :code:`np.ndarray`; default: :code:`np.array([])`
[ "Indices", "of", "bounds", "on", "u", "(", "defines", ":", "math", ":", "J_", "{", "bu", "}", ")", "at", "shooting", "nodes", "(", "0", "to", "N", "-", "1", ")", ".", "Can", "be", "set", "by", "using", ":", "py", ":", "attr", ":", "Jbu", ".",...
def idxbu(self): """Indices of bounds on u (defines :math:`J_{bu}`) at shooting nodes (0 to N-1). Can be set by using :py:attr:`Jbu`. Type: :code:`np.ndarray`; default: :code:`np.array([])` """ return self.__idxbu
[ "def", "idxbu", "(", "self", ")", ":", "return", "self", ".", "__idxbu" ]
https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L1167-L1172
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/vis/ipython/widgets.py
python
KlamptWidget.setWorld
(self,world)
Resets the world to a new WorldModel object.
Resets the world to a new WorldModel object.
[ "Resets", "the", "world", "to", "a", "new", "WorldModel", "object", "." ]
def setWorld(self,world): """Resets the world to a new WorldModel object. """ self.world = world self._extras = dict() self._aggregating_rpc = 0 self._rpc_calls = [] s = ThreeJSGetScene(self.world) self.scene = json.loads(s)
[ "def", "setWorld", "(", "self", ",", "world", ")", ":", "self", ".", "world", "=", "world", "self", ".", "_extras", "=", "dict", "(", ")", "self", ".", "_aggregating_rpc", "=", "0", "self", ".", "_rpc_calls", "=", "[", "]", "s", "=", "ThreeJSGetScene...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/ipython/widgets.py#L104-L111
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibar.py
python
AuiToolBar.SetToolSeparation
(self, separation)
Sets the separator size for the toolbar. :param integer `separation`: the separator size in pixels.
Sets the separator size for the toolbar.
[ "Sets", "the", "separator", "size", "for", "the", "toolbar", "." ]
def SetToolSeparation(self, separation): """ Sets the separator size for the toolbar. :param integer `separation`: the separator size in pixels. """ if self._art: self._art.SetElementSize(AUI_TBART_SEPARATOR_SIZE, separation)
[ "def", "SetToolSeparation", "(", "self", ",", "separation", ")", ":", "if", "self", ".", "_art", ":", "self", ".", "_art", ".", "SetElementSize", "(", "AUI_TBART_SEPARATOR_SIZE", ",", "separation", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L2263-L2271
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/train/serialization.py
python
_exec_save
(ckpt_file_name, data_list, enc_key=None, enc_mode="AES-GCM")
Execute the process of saving checkpoint into file.
Execute the process of saving checkpoint into file.
[ "Execute", "the", "process", "of", "saving", "checkpoint", "into", "file", "." ]
def _exec_save(ckpt_file_name, data_list, enc_key=None, enc_mode="AES-GCM"): """Execute the process of saving checkpoint into file.""" try: with _ckpt_mutex: if os.path.exists(ckpt_file_name): os.chmod(ckpt_file_name, stat.S_IWUSR) os.remove(ckpt_file_name) ...
[ "def", "_exec_save", "(", "ckpt_file_name", ",", "data_list", ",", "enc_key", "=", "None", ",", "enc_mode", "=", "\"AES-GCM\"", ")", ":", "try", ":", "with", "_ckpt_mutex", ":", "if", "os", ".", "path", ".", "exists", "(", "ckpt_file_name", ")", ":", "os...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/serialization.py#L158-L208
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
ColourPropertyValue.Init
(*args, **kwargs)
return _propgrid.ColourPropertyValue_Init(*args, **kwargs)
Init(self, int type, Colour colour)
Init(self, int type, Colour colour)
[ "Init", "(", "self", "int", "type", "Colour", "colour", ")" ]
def Init(*args, **kwargs): """Init(self, int type, Colour colour)""" return _propgrid.ColourPropertyValue_Init(*args, **kwargs)
[ "def", "Init", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "ColourPropertyValue_Init", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3270-L3272
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py
python
MultiDict.__getitem__
(self, key)
return self.first(key)
Get the first value with a given key
Get the first value with a given key
[ "Get", "the", "first", "value", "with", "a", "given", "key" ]
def __getitem__(self, key): """Get the first value with a given key""" #TODO: should this instead be the last value? return self.first(key)
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "#TODO: should this instead be the last value?", "return", "self", ".", "first", "(", "key", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py#L479-L482
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/google/protobuf/service.py
python
RpcController.NotifyOnCancel
(self, callback)
Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has already been canceled when NotifyOnCancel()...
Sets a callback to invoke on cancel.
[ "Sets", "a", "callback", "to", "invoke", "on", "cancel", "." ]
def NotifyOnCancel(self, callback): """Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has ...
[ "def", "NotifyOnCancel", "(", "self", ",", "callback", ")", ":", "raise", "NotImplementedError" ]
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/service.py#L183-L194
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/actor/Actor.py
python
Actor.stopJoint
(self, partName, jointName, lodName="lodRoot")
stopJoint(self, string, string, key="lodRoot") Stops the joint from animating external nodes. If the joint is animating a transform on a node, this will permanently stop it. However, this does not affect vertex animations.
stopJoint(self, string, string, key="lodRoot") Stops the joint from animating external nodes. If the joint is animating a transform on a node, this will permanently stop it. However, this does not affect vertex animations.
[ "stopJoint", "(", "self", "string", "string", "key", "=", "lodRoot", ")", "Stops", "the", "joint", "from", "animating", "external", "nodes", ".", "If", "the", "joint", "is", "animating", "a", "transform", "on", "a", "node", "this", "will", "permanently", "...
def stopJoint(self, partName, jointName, lodName="lodRoot"): """stopJoint(self, string, string, key="lodRoot") Stops the joint from animating external nodes. If the joint is animating a transform on a node, this will permanently stop it. However, this does not affect vertex animations....
[ "def", "stopJoint", "(", "self", ",", "partName", ",", "jointName", ",", "lodName", "=", "\"lodRoot\"", ")", ":", "partBundleDict", "=", "self", ".", "__partBundleDict", ".", "get", "(", "lodName", ")", "if", "not", "partBundleDict", ":", "Actor", ".", "no...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L1113-L1139