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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/npytypes.py
python
ArrayCTypes.can_convert_to
(self, typingctx, other)
Convert this type to the corresponding pointer type. This allows passing a array.ctypes object to a C function taking a raw pointer. Note that in pure Python, the array.ctypes object can only be passed to a ctypes function accepting a c_void_p, not a typed pointer.
Convert this type to the corresponding pointer type. This allows passing a array.ctypes object to a C function taking a raw pointer.
[ "Convert", "this", "type", "to", "the", "corresponding", "pointer", "type", ".", "This", "allows", "passing", "a", "array", ".", "ctypes", "object", "to", "a", "C", "function", "taking", "a", "raw", "pointer", "." ]
def can_convert_to(self, typingctx, other): """ Convert this type to the corresponding pointer type. This allows passing a array.ctypes object to a C function taking a raw pointer. Note that in pure Python, the array.ctypes object can only be passed to a ctypes function ...
[ "def", "can_convert_to", "(", "self", ",", "typingctx", ",", "other", ")", ":", "from", ".", "import", "CPointer", ",", "voidptr", "# XXX what about readonly", "if", "isinstance", "(", "other", ",", "CPointer", ")", "and", "other", ".", "dtype", "==", "self"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/npytypes.py#L486-L501
MegaGlest/megaglest-source
e3af470288a3c9cc179f63b5a1eb414a669e3772
mk/windoze/symbolstore.py
python
SourceIndex
(fileStream, outputPath, vcs_root)
return result
Takes a list of files, writes info to a data block in a .stream file
Takes a list of files, writes info to a data block in a .stream file
[ "Takes", "a", "list", "of", "files", "writes", "info", "to", "a", "data", "block", "in", "a", ".", "stream", "file" ]
def SourceIndex(fileStream, outputPath, vcs_root): """Takes a list of files, writes info to a data block in a .stream file""" # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing # Create the srcsrv data block that indexes the pdb file result = True pdbStreamFile = open(...
[ "def", "SourceIndex", "(", "fileStream", ",", "outputPath", ",", "vcs_root", ")", ":", "# Creates a .pdb.stream file in the mozilla\\objdir to be used for source indexing", "# Create the srcsrv data block that indexes the pdb file", "result", "=", "True", "pdbStreamFile", "=", "ope...
https://github.com/MegaGlest/megaglest-source/blob/e3af470288a3c9cc179f63b5a1eb414a669e3772/mk/windoze/symbolstore.py#L294-L306
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/debug/wrappers/hooks.py
python
LocalCLIDebugHook.__init__
(self, ui_type="curses", dump_root=None, thread_name_filter=None)
Create a local debugger command-line interface (CLI) hook. Args: ui_type: (str) user-interface type. dump_root: (`str`) optional path to the dump root directory. Must be a directory that does not exist or an empty directory. If the directory does not exist, it will be created by the deb...
Create a local debugger command-line interface (CLI) hook.
[ "Create", "a", "local", "debugger", "command", "-", "line", "interface", "(", "CLI", ")", "hook", "." ]
def __init__(self, ui_type="curses", dump_root=None, thread_name_filter=None): """Create a local debugger command-line interface (CLI) hook. Args: ui_type: (str) user-interface type. dump_root: (`str`) optional path to the dump root directory. Must be a ...
[ "def", "__init__", "(", "self", ",", "ui_type", "=", "\"curses\"", ",", "dump_root", "=", "None", ",", "thread_name_filter", "=", "None", ")", ":", "self", ".", "_ui_type", "=", "ui_type", "self", ".", "_dump_root", "=", "dump_root", "self", ".", "_thread_...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/wrappers/hooks.py#L42-L63
MRPT/mrpt
b0be3557a4cded6bafff03feb28f7fa1f75762a3
scripts/clang_git_format/format_code.py
python
ClangRepoFormatter.lint
(self)
return True
Lint files command entry point
Lint files command entry point
[ "Lint", "files", "command", "entry", "point" ]
def lint(self): """Lint files command entry point """ files = self.get_files_to_check() self._lint_files(files) return True
[ "def", "lint", "(", "self", ")", ":", "files", "=", "self", ".", "get_files_to_check", "(", ")", "self", ".", "_lint_files", "(", "files", ")", "return", "True" ]
https://github.com/MRPT/mrpt/blob/b0be3557a4cded6bafff03feb28f7fa1f75762a3/scripts/clang_git_format/format_code.py#L352-L358
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Builder.py
python
_node_errors
(builder, env, tlist, slist)
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
[ "Validate", "that", "the", "lists", "of", "target", "and", "source", "nodes", "are", "legal", "for", "this", "builder", "and", "environment", ".", "Raise", "errors", "or", "issue", "warnings", "as", "appropriate", "." ]
def _node_errors(builder, env, tlist, slist): """Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate. """ # First, figure out if there are any errors in the way the targets # were specified. for t in t...
[ "def", "_node_errors", "(", "builder", ",", "env", ",", "tlist", ",", "slist", ")", ":", "# First, figure out if there are any errors in the way the targets", "# were specified.", "for", "t", "in", "tlist", ":", "if", "t", ".", "side_effect", ":", "raise", "UserErro...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Builder.py#L281-L328
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
RobotModel.mount
(self, link: int, subRobot: "RobotModel", R: Rotation, t: Point)
return _robotsim.RobotModel_mount(self, link, subRobot, R, t)
r""" Mounts a sub-robot onto a link, with its origin at a given local transform (R,t). The sub-robot's links will be renamed to subRobot.getName() + ':' + link.getName() unless subRobot.getName() is '', in which case the link names are preserved. Args: link (int) ...
r""" Mounts a sub-robot onto a link, with its origin at a given local transform (R,t). The sub-robot's links will be renamed to subRobot.getName() + ':' + link.getName() unless subRobot.getName() is '', in which case the link names are preserved.
[ "r", "Mounts", "a", "sub", "-", "robot", "onto", "a", "link", "with", "its", "origin", "at", "a", "given", "local", "transform", "(", "R", "t", ")", ".", "The", "sub", "-", "robot", "s", "links", "will", "be", "renamed", "to", "subRobot", ".", "get...
def mount(self, link: int, subRobot: "RobotModel", R: Rotation, t: Point) ->None: r""" Mounts a sub-robot onto a link, with its origin at a given local transform (R,t). The sub-robot's links will be renamed to subRobot.getName() + ':' + link.getName() unless subRobot.getName() is '', in...
[ "def", "mount", "(", "self", ",", "link", ":", "int", ",", "subRobot", ":", "\"RobotModel\"", ",", "R", ":", "Rotation", ",", "t", ":", "Point", ")", "->", "None", ":", "return", "_robotsim", ".", "RobotModel_mount", "(", "self", ",", "link", ",", "s...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5222-L5235
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/typeannotation.py
python
TypeAnnotationParser.Append
(self, type_obj, error_token)
Appends a new TypeAnnotation object to the current parent.
Appends a new TypeAnnotation object to the current parent.
[ "Appends", "a", "new", "TypeAnnotation", "object", "to", "the", "current", "parent", "." ]
def Append(self, type_obj, error_token): """Appends a new TypeAnnotation object to the current parent.""" if self._stack: self._stack[-1].Append(type_obj) else: self.ClosingError(error_token)
[ "def", "Append", "(", "self", ",", "type_obj", ",", "error_token", ")", ":", "if", "self", ".", "_stack", ":", "self", ".", "_stack", "[", "-", "1", "]", ".", "Append", "(", "type_obj", ")", "else", ":", "self", ".", "ClosingError", "(", "error_token...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/typeannotation.py#L404-L409
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py
python
Gamma.entropy
(self, name="entropy")
The entropy of Gamma distribution(s). This is defined to be ``` entropy = alpha - log(beta) + log(Gamma(alpha)) + (1-alpha)digamma(alpha) ``` where digamma(alpha) is the digamma function. Args: name: The name to give this op. Returns: entropy: tensor of dtyp...
The entropy of Gamma distribution(s).
[ "The", "entropy", "of", "Gamma", "distribution", "(", "s", ")", "." ]
def entropy(self, name="entropy"): """The entropy of Gamma distribution(s). This is defined to be ``` entropy = alpha - log(beta) + log(Gamma(alpha)) + (1-alpha)digamma(alpha) ``` where digamma(alpha) is the digamma function. Args: name: The name to give this op. ...
[ "def", "entropy", "(", "self", ",", "name", "=", "\"entropy\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "alpha", ",", "self", ".", "_beta", "]", ",", "...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py#L311-L334
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/email/quoprimime.py
python
unquote
(s)
return chr(int(s[1:3], 16))
Turn a string in the form =AB to the ASCII character with value 0xab
Turn a string in the form =AB to the ASCII character with value 0xab
[ "Turn", "a", "string", "in", "the", "form", "=", "AB", "to", "the", "ASCII", "character", "with", "value", "0xab" ]
def unquote(s): """Turn a string in the form =AB to the ASCII character with value 0xab""" return chr(int(s[1:3], 16))
[ "def", "unquote", "(", "s", ")", ":", "return", "chr", "(", "int", "(", "s", "[", "1", ":", "3", "]", ",", "16", ")", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/quoprimime.py#L104-L106
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py
python
Common.removePunc
(self, context, data)
return re.sub('[%s]' % re.escape(string.punctuation), '', data)
Remove all punctuation for a string return the resulting string
Remove all punctuation for a string return the resulting string
[ "Remove", "all", "punctuation", "for", "a", "string", "return", "the", "resulting", "string" ]
def removePunc(self, context, data): ''' Remove all punctuation for a string return the resulting string ''' if not len(data): return "" return re.sub('[%s]' % re.escape(string.punctuation), '', data)
[ "def", "removePunc", "(", "self", ",", "context", ",", "data", ")", ":", "if", "not", "len", "(", "data", ")", ":", "return", "\"\"", "return", "re", ".", "sub", "(", "'[%s]'", "%", "re", ".", "escape", "(", "string", ".", "punctuation", ")", ",", ...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py#L804-L810
KhronosGroup/SPIR
f33c27876d9f3d5810162b60fa89cc13d2b55725
bindings/python/clang/cindex.py
python
Type.argument_types
(self)
return ArgumentsIterator(self)
Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance.
Retrieve a container for the non-variadic arguments for this type.
[ "Retrieve", "a", "container", "for", "the", "non", "-", "variadic", "arguments", "for", "this", "type", "." ]
def argument_types(self): """Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance. """ class ArgumentsIterator(collections.Sequence): def __init__(self, parent)...
[ "def", "argument_types", "(", "self", ")", ":", "class", "ArgumentsIterator", "(", "collections", ".", "Sequence", ")", ":", "def", "__init__", "(", "self", ",", "parent", ")", ":", "self", ".", "parent", "=", "parent", "self", ".", "length", "=", "None"...
https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L1442-L1478
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32comext/adsi/demos/scp.py
python
do_UserChangePassword
(po)
return "Password changed OK"
Change the password for a specified user
Change the password for a specified user
[ "Change", "the", "password", "for", "a", "specified", "user" ]
def do_UserChangePassword(po): """Change the password for a specified user""" UserChangePassword(_get_option(po, "account_name_dn"), _get_option(po, "password")) return "Password changed OK"
[ "def", "do_UserChangePassword", "(", "po", ")", ":", "UserChangePassword", "(", "_get_option", "(", "po", ",", "\"account_name_dn\"", ")", ",", "_get_option", "(", "po", ",", "\"password\"", ")", ")", "return", "\"Password changed OK\"" ]
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32comext/adsi/demos/scp.py#L362-L365
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/jsonschema/exceptions.py
python
ErrorTree.__getitem__
(self, index)
return self._contents[index]
Retrieve the child tree one level down at the given ``index``. If the index is not in the instance that this tree corresponds to and is not known by this tree, whatever error would be raised by ``instance.__getitem__`` will be propagated (usually this is some subclass of `exceptions.Loo...
Retrieve the child tree one level down at the given ``index``.
[ "Retrieve", "the", "child", "tree", "one", "level", "down", "at", "the", "given", "index", "." ]
def __getitem__(self, index): """ Retrieve the child tree one level down at the given ``index``. If the index is not in the instance that this tree corresponds to and is not known by this tree, whatever error would be raised by ``instance.__getitem__`` will be propagated (usuall...
[ "def", "__getitem__", "(", "self", ",", "index", ")", ":", "if", "self", ".", "_instance", "is", "not", "_unset", "and", "index", "not", "in", "self", ":", "self", ".", "_instance", "[", "index", "]", "return", "self", ".", "_contents", "[", "index", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/jsonschema/exceptions.py#L257-L269
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/functional.py
python
dropout2d
(input: Tensor, p: float = 0.5, training: bool = True, inplace: bool = False)
return result
r""" Randomly zero out entire channels (a channel is a 2D feature map, e.g., the :math:`j`-th channel of the :math:`i`-th sample in the batched input is a 2D tensor :math:`\text{input}[i, j]`) of the input tensor). Each channel will be zeroed out independently on every forward call with probability ...
r""" Randomly zero out entire channels (a channel is a 2D feature map, e.g., the :math:`j`-th channel of the :math:`i`-th sample in the batched input is a 2D tensor :math:`\text{input}[i, j]`) of the input tensor). Each channel will be zeroed out independently on every forward call with probability ...
[ "r", "Randomly", "zero", "out", "entire", "channels", "(", "a", "channel", "is", "a", "2D", "feature", "map", "e", ".", "g", ".", "the", ":", "math", ":", "j", "-", "th", "channel", "of", "the", ":", "math", ":", "i", "-", "th", "sample", "in", ...
def dropout2d(input: Tensor, p: float = 0.5, training: bool = True, inplace: bool = False) -> Tensor: r""" Randomly zero out entire channels (a channel is a 2D feature map, e.g., the :math:`j`-th channel of the :math:`i`-th sample in the batched input is a 2D tensor :math:`\text{input}[i, j]`) of the in...
[ "def", "dropout2d", "(", "input", ":", "Tensor", ",", "p", ":", "float", "=", "0.5", ",", "training", ":", "bool", "=", "True", ",", "inplace", ":", "bool", "=", "False", ")", "->", "Tensor", ":", "if", "has_torch_function_unary", "(", "input", ")", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/functional.py#L1294-L1331
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
Environment.__getitem__
(self, project_name)
return self._distmap.get(distribution_key, [])
Return a newest-to-oldest list of distributions for `project_name` Uses case-insensitive `project_name` comparison, assuming all the project's distributions use their project's name converted to all lowercase as their key.
Return a newest-to-oldest list of distributions for `project_name`
[ "Return", "a", "newest", "-", "to", "-", "oldest", "list", "of", "distributions", "for", "project_name" ]
def __getitem__(self, project_name): """Return a newest-to-oldest list of distributions for `project_name` Uses case-insensitive `project_name` comparison, assuming all the project's distributions use their project's name converted to all lowercase as their key. """ dis...
[ "def", "__getitem__", "(", "self", ",", "project_name", ")", ":", "distribution_key", "=", "project_name", ".", "lower", "(", ")", "return", "self", ".", "_distmap", ".", "get", "(", "distribution_key", ",", "[", "]", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1100-L1109
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/driver.py
python
require_device_memory
(obj)
A sentry for methods that accept HSA memory object.
A sentry for methods that accept HSA memory object.
[ "A", "sentry", "for", "methods", "that", "accept", "HSA", "memory", "object", "." ]
def require_device_memory(obj): """A sentry for methods that accept HSA memory object. """ if not is_device_memory(obj): raise Exception("Not a HSA memory object.")
[ "def", "require_device_memory", "(", "obj", ")", ":", "if", "not", "is_device_memory", "(", "obj", ")", ":", "raise", "Exception", "(", "\"Not a HSA memory object.\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/hsadrv/driver.py#L1448-L1452
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
NumberGenerator.create
(self, type)
return counter
Create a counter for the given type.
Create a counter for the given type.
[ "Create", "a", "counter", "for", "the", "given", "type", "." ]
def create(self, type): "Create a counter for the given type." if self.isnumbered(type) and self.getlevel(type) > 1: index = self.orderedlayouts.index(type) above = self.orderedlayouts[index - 1] master = self.getcounter(above) return self.createdependent(type, master) counter = Numb...
[ "def", "create", "(", "self", ",", "type", ")", ":", "if", "self", ".", "isnumbered", "(", "type", ")", "and", "self", ".", "getlevel", "(", "type", ")", ">", "1", ":", "index", "=", "self", ".", "orderedlayouts", ".", "index", "(", "type", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L3364-L3374
choasup/caffe-yolo9000
e8a476c4c23d756632f7a26c681a96e3ab672544
python/caffe/io.py
python
array_to_blobproto
(arr, diff=None)
return blob
Converts a N-dimensional array to blob proto. If diff is given, also convert the diff. You need to make sure that arr and diff have the same shape, and this function does not do sanity check.
Converts a N-dimensional array to blob proto. If diff is given, also convert the diff. You need to make sure that arr and diff have the same shape, and this function does not do sanity check.
[ "Converts", "a", "N", "-", "dimensional", "array", "to", "blob", "proto", ".", "If", "diff", "is", "given", "also", "convert", "the", "diff", ".", "You", "need", "to", "make", "sure", "that", "arr", "and", "diff", "have", "the", "same", "shape", "and",...
def array_to_blobproto(arr, diff=None): """Converts a N-dimensional array to blob proto. If diff is given, also convert the diff. You need to make sure that arr and diff have the same shape, and this function does not do sanity check. """ blob = caffe_pb2.BlobProto() blob.shape.dim.extend(arr.sh...
[ "def", "array_to_blobproto", "(", "arr", ",", "diff", "=", "None", ")", ":", "blob", "=", "caffe_pb2", ".", "BlobProto", "(", ")", "blob", ".", "shape", ".", "dim", ".", "extend", "(", "arr", ".", "shape", ")", "blob", ".", "data", ".", "extend", "...
https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/python/caffe/io.py#L36-L46
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/ensdf_processing.py
python
logft
(inputdict_unchecked)
return inputdict_unchecked
This program calculates log ft values for beta and electron-capture decay, average beta energies, and capture fractions. (LOGFT readme) Parameters ---------- inputdict_unchecked : dictionary dictionary that must have the following key-pair values: input_data_set : string, path to i...
This program calculates log ft values for beta and electron-capture decay, average beta energies, and capture fractions. (LOGFT readme)
[ "This", "program", "calculates", "log", "ft", "values", "for", "beta", "and", "electron", "-", "capture", "decay", "average", "beta", "energies", "and", "capture", "fractions", ".", "(", "LOGFT", "readme", ")" ]
def logft(inputdict_unchecked): #NOTE: changed input file line length to 90 to support longer file paths # in fortran source. """ This program calculates log ft values for beta and electron-capture decay, average beta energies, and capture fractions. (LOGFT readme) Parameters --------...
[ "def", "logft", "(", "inputdict_unchecked", ")", ":", "#NOTE: changed input file line length to 90 to support longer file paths", "# in fortran source.", "inputdict", "=", "{", "}", "input_data_set", "=", "inputdict_unchecked", "[", "'input_data_set'", "]", "output_report", ...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/ensdf_processing.py#L480-L516
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetCflags
(self, config)
return cflags
Returns the flags that need to be added to .c and .cc compilations.
Returns the flags that need to be added to .c and .cc compilations.
[ "Returns", "the", "flags", "that", "need", "to", "be", "added", "to", ".", "c", "and", ".", "cc", "compilations", "." ]
def GetCflags(self, config): """Returns the flags that need to be added to .c and .cc compilations.""" config = self._TargetConfig(config) cflags = [] cflags.extend(["/wd" + w for w in self.msvs_disabled_warnings[config]]) cl = self._GetWrapper( self, self.msvs_settin...
[ "def", "GetCflags", "(", "self", ",", "config", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "cflags", "=", "[", "]", "cflags", ".", "extend", "(", "[", "\"/wd\"", "+", "w", "for", "w", "in", "self", ".", "msvs_disabled_...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py#L479-L555
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/plotting/_matplotlib/core.py
python
MPLPlot._post_plot_logic_common
(self, ax, data)
Common post process for each axes
Common post process for each axes
[ "Common", "post", "process", "for", "each", "axes" ]
def _post_plot_logic_common(self, ax, data): """Common post process for each axes""" if self.orientation == "vertical" or self.orientation is None: self._apply_axis_properties(ax.xaxis, rot=self.rot, fontsize=self.fontsize) self._apply_axis_properties(ax.yaxis, fontsize=self.fon...
[ "def", "_post_plot_logic_common", "(", "self", ",", "ax", ",", "data", ")", ":", "if", "self", ".", "orientation", "==", "\"vertical\"", "or", "self", ".", "orientation", "is", "None", ":", "self", ".", "_apply_axis_properties", "(", "ax", ".", "xaxis", ",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/plotting/_matplotlib/core.py#L433-L450
jts/sga
229293b2c97777aa015581b6075ed6b60050b34d
src/bin/sga-preqc-report.py
python
_fancy_barh
(ax, values, data, val_fmt='', is_legend=False)
return True
fancy-ish horizontal bar plot values must be same len as data, use np.nan if no values for sample :param is_legend: if True, will include legend like line segments :param val_fmt: is format string for value; None don't show vlaue, '' just str()
fancy-ish horizontal bar plot values must be same len as data, use np.nan if no values for sample :param is_legend: if True, will include legend like line segments :param val_fmt: is format string for value; None don't show vlaue, '' just str()
[ "fancy", "-", "ish", "horizontal", "bar", "plot", "values", "must", "be", "same", "len", "as", "data", "use", "np", ".", "nan", "if", "no", "values", "for", "sample", ":", "param", "is_legend", ":", "if", "True", "will", "include", "legend", "like", "l...
def _fancy_barh(ax, values, data, val_fmt='', is_legend=False): """fancy-ish horizontal bar plot values must be same len as data, use np.nan if no values for sample :param is_legend: if True, will include legend like line segments :param val_fmt: is format string for value; ...
[ "def", "_fancy_barh", "(", "ax", ",", "values", ",", "data", ",", "val_fmt", "=", "''", ",", "is_legend", "=", "False", ")", ":", "assert", "(", "len", "(", "values", ")", "==", "len", "(", "data", ")", ")", "names", "=", "[", "]", "for", "d", ...
https://github.com/jts/sga/blob/229293b2c97777aa015581b6075ed6b60050b34d/src/bin/sga-preqc-report.py#L258-L316
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
cmake/std/trilinosprhelpers/TrilinosPRConfigurationInstallation.py
python
TrilinosPRConfigurationInstallation.execute_test
(self)
return 0
Execute the test
Execute the test
[ "Execute", "the", "test" ]
def execute_test(self): """ Execute the test """ print("+" + "="*78 + "+") print("| E X E C U T E I N S T A L L A T I O N P U L L R E Q U E S T T E S T") print("+" + "="*78 + "+") # # Typically, we execute the test from $WORKSPACE/TFW_testing_sing...
[ "def", "execute_test", "(", "self", ")", ":", "print", "(", "\"+\"", "+", "\"=\"", "*", "78", "+", "\"+\"", ")", "print", "(", "\"| E X E C U T E I N S T A L L A T I O N P U L L R E Q U E S T T E S T\"", ")", "print", "(", "\"+\"", "+", "\"=\"", "*", "78",...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/std/trilinosprhelpers/TrilinosPRConfigurationInstallation.py#L22-L78
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
TopLevelWindow.IsFullScreen
(*args, **kwargs)
return _windows_.TopLevelWindow_IsFullScreen(*args, **kwargs)
IsFullScreen(self) -> bool
IsFullScreen(self) -> bool
[ "IsFullScreen", "(", "self", ")", "-", ">", "bool" ]
def IsFullScreen(*args, **kwargs): """IsFullScreen(self) -> bool""" return _windows_.TopLevelWindow_IsFullScreen(*args, **kwargs)
[ "def", "IsFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "TopLevelWindow_IsFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L449-L451
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.terminate
(self, force=False)
This forces a child process to terminate. It starts nicely with SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This returns True if the child was terminated. This returns False if the child could not be terminated.
This forces a child process to terminate. It starts nicely with SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This returns True if the child was terminated. This returns False if the child could not be terminated.
[ "This", "forces", "a", "child", "process", "to", "terminate", ".", "It", "starts", "nicely", "with", "SIGHUP", "and", "SIGINT", ".", "If", "force", "is", "True", "then", "moves", "onto", "SIGKILL", ".", "This", "returns", "True", "if", "the", "child", "w...
def terminate(self, force=False): '''This forces a child process to terminate. It starts nicely with SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This returns True if the child was terminated. This returns False if the child could not be terminated. ''' if not ...
[ "def", "terminate", "(", "self", ",", "force", "=", "False", ")", ":", "if", "not", "self", ".", "isalive", "(", ")", ":", "return", "True", "try", ":", "self", ".", "kill", "(", "signal", ".", "SIGHUP", ")", "time", ".", "sleep", "(", "self", "....
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L616-L654
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteActionsRulesCopies
(self, spec, extra_sources, prebuild, mac_bundle_depends)
return stamp
Write out the Actions, Rules, and Copies steps. Return a path representing the outputs of these steps.
Write out the Actions, Rules, and Copies steps. Return a path representing the outputs of these steps.
[ "Write", "out", "the", "Actions", "Rules", "and", "Copies", "steps", ".", "Return", "a", "path", "representing", "the", "outputs", "of", "these", "steps", "." ]
def WriteActionsRulesCopies(self, spec, extra_sources, prebuild, mac_bundle_depends): """Write out the Actions, Rules, and Copies steps. Return a path representing the outputs of these steps.""" outputs = [] extra_mac_bundle_resources = [] if 'actions' in spec: ...
[ "def", "WriteActionsRulesCopies", "(", "self", ",", "spec", ",", "extra_sources", ",", "prebuild", ",", "mac_bundle_depends", ")", ":", "outputs", "=", "[", "]", "extra_mac_bundle_resources", "=", "[", "]", "if", "'actions'", "in", "spec", ":", "outputs", "+="...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L496-L523
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/configuration.py
python
Configuration.get_file_to_edit
(self)
Returns the file with highest priority in configuration
Returns the file with highest priority in configuration
[ "Returns", "the", "file", "with", "highest", "priority", "in", "configuration" ]
def get_file_to_edit(self): # type: () -> Optional[str] """Returns the file with highest priority in configuration """ assert self.load_only is not None, \ "Need to be specified a file to be editing" try: return self._get_parser_to_modify()[0] exc...
[ "def", "get_file_to_edit", "(", "self", ")", ":", "# type: () -> Optional[str]", "assert", "self", ".", "load_only", "is", "not", "None", ",", "\"Need to be specified a file to be editing\"", "try", ":", "return", "self", ".", "_get_parser_to_modify", "(", ")", "[", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/configuration.py#L141-L151
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/lib/backgroundjobs.py
python
BackgroundJobManager.status
(self,verbose=0)
Print a status of all jobs currently being managed.
Print a status of all jobs currently being managed.
[ "Print", "a", "status", "of", "all", "jobs", "currently", "being", "managed", "." ]
def status(self,verbose=0): """Print a status of all jobs currently being managed.""" self._update_status() self._group_report(self.running,'Running') self._group_report(self.completed,'Completed') self._group_report(self.dead,'Dead') # Also flush the report queues ...
[ "def", "status", "(", "self", ",", "verbose", "=", "0", ")", ":", "self", ".", "_update_status", "(", ")", "self", ".", "_group_report", "(", "self", ".", "running", ",", "'Running'", ")", "self", ".", "_group_report", "(", "self", ".", "completed", ",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/backgroundjobs.py#L284-L293
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/sans/stitcher.py
python
StitcherWidget._high_q_browse
(self)
Browse for High-Q I(Q) data set
Browse for High-Q I(Q) data set
[ "Browse", "for", "High", "-", "Q", "I", "(", "Q", ")", "data", "set" ]
def _high_q_browse(self): """ Browse for High-Q I(Q) data set """ fname = self.data_browse_dialog() if fname: self._content.high_q_combo.setItemText(0, fname) self._content.high_q_combo.setCurrentIndex(0) self._update_high_q()
[ "def", "_high_q_browse", "(", "self", ")", ":", "fname", "=", "self", ".", "data_browse_dialog", "(", ")", "if", "fname", ":", "self", ".", "_content", ".", "high_q_combo", ".", "setItemText", "(", "0", ",", "fname", ")", "self", ".", "_content", ".", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/sans/stitcher.py#L380-L388
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/xrc.py
python
XmlNodeEasy
(*args, **kwargs)
return val
XmlNodeEasy(int type, String name, String content=EmptyString) -> XmlNode
XmlNodeEasy(int type, String name, String content=EmptyString) -> XmlNode
[ "XmlNodeEasy", "(", "int", "type", "String", "name", "String", "content", "=", "EmptyString", ")", "-", ">", "XmlNode" ]
def XmlNodeEasy(*args, **kwargs): """XmlNodeEasy(int type, String name, String content=EmptyString) -> XmlNode""" val = _xrc.new_XmlNodeEasy(*args, **kwargs) return val
[ "def", "XmlNodeEasy", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_xrc", ".", "new_XmlNodeEasy", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L498-L501
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py
python
_compute_placement_auc
(labels, predictions, weights, alpha, logit_transformation, is_valid)
return AucData(*control_flow_ops.cond( is_valid, lambda: [auc, lower, upper], lambda: [trivial_value] * 3))
Computes the AUC and asymptotic normally distributed confidence interval. The calculations are achieved using the fact that AUC = P(Y_1>Y_0) and the concept of placement values for each labeled group, as presented by Delong and Delong (1988). The actual algorithm used is a more computationally efficient approa...
Computes the AUC and asymptotic normally distributed confidence interval.
[ "Computes", "the", "AUC", "and", "asymptotic", "normally", "distributed", "confidence", "interval", "." ]
def _compute_placement_auc(labels, predictions, weights, alpha, logit_transformation, is_valid): """Computes the AUC and asymptotic normally distributed confidence interval. The calculations are achieved using the fact that AUC = P(Y_1>Y_0) and the concept of placement values for each ...
[ "def", "_compute_placement_auc", "(", "labels", ",", "predictions", ",", "weights", ",", "alpha", ",", "logit_transformation", ",", "is_valid", ")", ":", "# Disable the invalid-name checker so that we can capitalize the name.", "# pylint: disable=invalid-name", "AucData", "=", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py#L1231-L1397
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/inspector_protocol/jinja2/sandbox.py
python
unsafe
(f)
return f
Marks a function or method as unsafe. :: @unsafe def delete(self): pass
Marks a function or method as unsafe.
[ "Marks", "a", "function", "or", "method", "as", "unsafe", "." ]
def unsafe(f): """Marks a function or method as unsafe. :: @unsafe def delete(self): pass """ f.unsafe_callable = True return f
[ "def", "unsafe", "(", "f", ")", ":", "f", ".", "unsafe_callable", "=", "True", "return", "f" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/sandbox.py#L158-L168
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py
python
freezable_variable
(value, shape=None, name=None)
return x
A tensor-like object whose value can be updated only up until execution. After creating the freezable variable, you can update its value by calling `var.update_value(new_value)` (similar to a regular variable). Unlike an actual variable, the value used during execution is the current value at the time the exec...
A tensor-like object whose value can be updated only up until execution.
[ "A", "tensor", "-", "like", "object", "whose", "value", "can", "be", "updated", "only", "up", "until", "execution", "." ]
def freezable_variable(value, shape=None, name=None): """A tensor-like object whose value can be updated only up until execution. After creating the freezable variable, you can update its value by calling `var.update_value(new_value)` (similar to a regular variable). Unlike an actual variable, the value used d...
[ "def", "freezable_variable", "(", "value", ",", "shape", "=", "None", ",", "name", "=", "None", ")", ":", "graph", "=", "get_graph", "(", ")", "with", "graph", ".", "as_default", "(", ")", ":", "x", "=", "array_ops", ".", "placeholder_with_default", "(",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L1074-L1120
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
infant/freesurfer_pipeline.py
python
CommandPipeline.total_time_str
(self)
return str(self.total_time()).split('.')[0]
Returns the total time since start in string form.
Returns the total time since start in string form.
[ "Returns", "the", "total", "time", "since", "start", "in", "string", "form", "." ]
def total_time_str(self): """ Returns the total time since start in string form. """ return str(self.total_time()).split('.')[0]
[ "def", "total_time_str", "(", "self", ")", ":", "return", "str", "(", "self", ".", "total_time", "(", ")", ")", ".", "split", "(", "'.'", ")", "[", "0", "]" ]
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/infant/freesurfer_pipeline.py#L61-L65
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/plan/motionplanning.py
python
CSpaceInterface.distance
(self, a: object, b: object)
return _motionplanning.CSpaceInterface_distance(self, a, b)
r""" Returns the distance between two configurations. Args: a (:obj:`object`) b (:obj:`object`)
r""" Returns the distance between two configurations.
[ "r", "Returns", "the", "distance", "between", "two", "configurations", "." ]
def distance(self, a: object, b: object) ->float: r""" Returns the distance between two configurations. Args: a (:obj:`object`) b (:obj:`object`) """ return _motionplanning.CSpaceInterface_distance(self, a, b)
[ "def", "distance", "(", "self", ",", "a", ":", "object", ",", "b", ":", "object", ")", "->", "float", ":", "return", "_motionplanning", ".", "CSpaceInterface_distance", "(", "self", ",", "a", ",", "b", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/motionplanning.py#L649-L657
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_KDF_SCHEME_KDF1_SP800_108.fromTpm
(buf)
return buf.createObj(TPMS_KDF_SCHEME_KDF1_SP800_108)
Returns new TPMS_KDF_SCHEME_KDF1_SP800_108 object constructed from its marshaled representation in the given TpmBuffer buffer
Returns new TPMS_KDF_SCHEME_KDF1_SP800_108 object constructed from its marshaled representation in the given TpmBuffer buffer
[ "Returns", "new", "TPMS_KDF_SCHEME_KDF1_SP800_108", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "TpmBuffer", "buffer" ]
def fromTpm(buf): """ Returns new TPMS_KDF_SCHEME_KDF1_SP800_108 object constructed from its marshaled representation in the given TpmBuffer buffer """ return buf.createObj(TPMS_KDF_SCHEME_KDF1_SP800_108)
[ "def", "fromTpm", "(", "buf", ")", ":", "return", "buf", ".", "createObj", "(", "TPMS_KDF_SCHEME_KDF1_SP800_108", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6876-L6880
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/compileall.py
python
main
()
return True
Script main program.
Script main program.
[ "Script", "main", "program", "." ]
def main(): """Script main program.""" import argparse parser = argparse.ArgumentParser( description='Utilities to support installing Python libraries.') parser.add_argument('-l', action='store_const', const=0, default=10, dest='maxlevels', help="...
[ "def", "main", "(", ")", ":", "import", "argparse", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Utilities to support installing Python libraries.'", ")", "parser", ".", "add_argument", "(", "'-l'", ",", "action", "=", "'store_const'"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/compileall.py#L226-L331
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/externals/joblib/_parallel_backends.py
python
MultiprocessingBackend.terminate
(self)
Shutdown the process or thread pool
Shutdown the process or thread pool
[ "Shutdown", "the", "process", "or", "thread", "pool" ]
def terminate(self): """Shutdown the process or thread pool""" super(MultiprocessingBackend, self).terminate() if self.JOBLIB_SPAWNED_PROCESS in os.environ: del os.environ[self.JOBLIB_SPAWNED_PROCESS]
[ "def", "terminate", "(", "self", ")", ":", "super", "(", "MultiprocessingBackend", ",", "self", ")", ".", "terminate", "(", ")", "if", "self", ".", "JOBLIB_SPAWNED_PROCESS", "in", "os", ".", "environ", ":", "del", "os", ".", "environ", "[", "self", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/joblib/_parallel_backends.py#L315-L319
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
libVeles/cpplint.py
python
RemoveMultiLineComments
(filename, lines, error)
Removes multiline (c-style) comments from lines.
Removes multiline (c-style) comments from lines.
[ "Removes", "multiline", "(", "c", "-", "style", ")", "comments", "from", "lines", "." ]
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, line...
[ "def", "RemoveMultiLineComments", "(", "filename", ",", "lines", ",", "error", ")", ":", "lineix", "=", "0", "while", "lineix", "<", "len", "(", "lines", ")", ":", "lineix_begin", "=", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", "if", ...
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/libVeles/cpplint.py#L956-L969
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/build/lib.linux-x86_64-2.7/mxnet/base.py
python
check_call
(ret)
Check the return value of C API call This function will raise exception when error occurs. Wrap every API call with this function Parameters ---------- ret : int return value from API calls
Check the return value of C API call
[ "Check", "the", "return", "value", "of", "C", "API", "call" ]
def check_call(ret): """Check the return value of C API call This function will raise exception when error occurs. Wrap every API call with this function Parameters ---------- ret : int return value from API calls """ if ret != 0: raise MXNetError(py_str(_LIB.MXGetLastE...
[ "def", "check_call", "(", "ret", ")", ":", "if", "ret", "!=", "0", ":", "raise", "MXNetError", "(", "py_str", "(", "_LIB", ".", "MXGetLastError", "(", ")", ")", ")" ]
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/base.py#L65-L77
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/examples/Potjans_2014/helpers.py
python
adjust_weights_and_input_to_synapse_scaling
( full_num_neurons, full_num_synapses, K_scaling, mean_PSC_matrix, PSC_ext, tau_syn, full_mean_rates, DC_amp, poisson_input, bg_rate, K_ext)
return PSC_matrix_new, PSC_ext_new, DC_amp_new
Adjusts weights and external input to scaling of indegrees. The recurrent and external weights are adjusted to the scaling of the indegrees. Extra DC input is added to compensate for the scaling in order to preserve the mean and variance of the input. Parameters ---------- full_num_neurons ...
Adjusts weights and external input to scaling of indegrees.
[ "Adjusts", "weights", "and", "external", "input", "to", "scaling", "of", "indegrees", "." ]
def adjust_weights_and_input_to_synapse_scaling( full_num_neurons, full_num_synapses, K_scaling, mean_PSC_matrix, PSC_ext, tau_syn, full_mean_rates, DC_amp, poisson_input, bg_rate, K_ext): """ Adjusts weights and external input ...
[ "def", "adjust_weights_and_input_to_synapse_scaling", "(", "full_num_neurons", ",", "full_num_synapses", ",", "K_scaling", ",", "mean_PSC_matrix", ",", "PSC_ext", ",", "tau_syn", ",", "full_mean_rates", ",", "DC_amp", ",", "poisson_input", ",", "bg_rate", ",", "K_ext", ...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/examples/Potjans_2014/helpers.py#L139-L207
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
qa/setup_packages.py
python
BasePackage.get_extra_index
(self, cuda_version)
return ""
Gets a extra url index for pip for given cuda version. Parameters ---------- `cuda_version`: str Cuda version used for this query
Gets a extra url index for pip for given cuda version.
[ "Gets", "a", "extra", "url", "index", "for", "pip", "for", "given", "cuda", "version", "." ]
def get_extra_index(self, cuda_version): """Gets a extra url index for pip for given cuda version. Parameters ---------- `cuda_version`: str Cuda version used for this query """ return ""
[ "def", "get_extra_index", "(", "self", ",", "cuda_version", ")", ":", "return", "\"\"" ]
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/qa/setup_packages.py#L228-L236
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/colorizer.py
python
color_config
(text)
Set color options of Text widget. If ColorDelegator is used, this should be called first.
Set color options of Text widget.
[ "Set", "color", "options", "of", "Text", "widget", "." ]
def color_config(text): """Set color options of Text widget. If ColorDelegator is used, this should be called first. """ # Called from htest, TextFrame, Editor, and Turtledemo. # Not automatic because ColorDelegator does not know 'text'. theme = idleConf.CurrentTheme() normal_colors = idleC...
[ "def", "color_config", "(", "text", ")", ":", "# Called from htest, TextFrame, Editor, and Turtledemo.", "# Not automatic because ColorDelegator does not know 'text'.", "theme", "=", "idleConf", ".", "CurrentTheme", "(", ")", "normal_colors", "=", "idleConf", ".", "GetHighlight...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/colorizer.py#L34-L52
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/coordinator.py
python
Coordinator.should_stop
(self)
return self._stop_event.is_set()
Check if stop was requested. Returns: True if a stop was requested.
Check if stop was requested.
[ "Check", "if", "stop", "was", "requested", "." ]
def should_stop(self): """Check if stop was requested. Returns: True if a stop was requested. """ return self._stop_event.is_set()
[ "def", "should_stop", "(", "self", ")", ":", "return", "self", ".", "_stop_event", ".", "is_set", "(", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/coordinator.py#L255-L261
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/cron_servlet.py
python
CronServlet._GetSafeServerInstance
(self)
return self._CreateServerInstance(safe_revision)
Returns a ServerInstance with a host file system at a safe revision, meaning the last revision that the current running version of the server existed.
Returns a ServerInstance with a host file system at a safe revision, meaning the last revision that the current running version of the server existed.
[ "Returns", "a", "ServerInstance", "with", "a", "host", "file", "system", "at", "a", "safe", "revision", "meaning", "the", "last", "revision", "that", "the", "current", "running", "version", "of", "the", "server", "existed", "." ]
def _GetSafeServerInstance(self): '''Returns a ServerInstance with a host file system at a safe revision, meaning the last revision that the current running version of the server existed. ''' delegate = self._delegate # IMPORTANT: Get a ServerInstance pinned to the most recent revision, not ...
[ "def", "_GetSafeServerInstance", "(", "self", ")", ":", "delegate", "=", "self", ".", "_delegate", "# IMPORTANT: Get a ServerInstance pinned to the most recent revision, not", "# HEAD. These cron jobs take a while and run very frequently such that", "# there is usually one running at any g...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/cron_servlet.py#L252-L282
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/retries/quota.py
python
RetryQuota.release
(self, capacity_amount)
Release capacity back to the retry quota. The capacity being released will be truncated if necessary to ensure the max capacity is never exceeded.
Release capacity back to the retry quota.
[ "Release", "capacity", "back", "to", "the", "retry", "quota", "." ]
def release(self, capacity_amount): """Release capacity back to the retry quota. The capacity being released will be truncated if necessary to ensure the max capacity is never exceeded. """ # Implementation note: The release() method is called as part # of the "after-c...
[ "def", "release", "(", "self", ",", "capacity_amount", ")", ":", "# Implementation note: The release() method is called as part", "# of the \"after-call\" event, which means it gets invoked for", "# every API call. In the common case where the request is", "# successful and we're at full cap...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/retries/quota.py#L34-L53
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
build_tools/benchmarks/run_benchmarks_on_android.py
python
adb_execute_and_get_output
(cmd_args: Sequence[str], relative_dir: str = "", verbose: bool = False)
return execute_cmd_and_get_output(cmd, verbose=verbose)
Executes command with adb shell. Switches to `relative_dir` relative to the android tmp directory before executing. Waits for completion and returns the command stdout. Args: cmd_args: a list containing the command to execute and its parameters relative_dir: the directory to execute the command in; rela...
Executes command with adb shell.
[ "Executes", "command", "with", "adb", "shell", "." ]
def adb_execute_and_get_output(cmd_args: Sequence[str], relative_dir: str = "", verbose: bool = False) -> str: """Executes command with adb shell. Switches to `relative_dir` relative to the android tmp directory before executing. Waits for completion ...
[ "def", "adb_execute_and_get_output", "(", "cmd_args", ":", "Sequence", "[", "str", "]", ",", "relative_dir", ":", "str", "=", "\"\"", ",", "verbose", ":", "bool", "=", "False", ")", "->", "str", ":", "cmd", "=", "[", "\"adb\"", ",", "\"shell\"", "]", "...
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/build_tools/benchmarks/run_benchmarks_on_android.py#L136-L157
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py
python
cc_add_flags
(conf)
Read the CFLAGS/CPPFLAGS from os.environ and add to conf.env.CFLAGS
Read the CFLAGS/CPPFLAGS from os.environ and add to conf.env.CFLAGS
[ "Read", "the", "CFLAGS", "/", "CPPFLAGS", "from", "os", ".", "environ", "and", "add", "to", "conf", ".", "env", ".", "CFLAGS" ]
def cc_add_flags(conf): """ Read the CFLAGS/CPPFLAGS from os.environ and add to conf.env.CFLAGS """ conf.add_os_flags('CPPFLAGS', 'CFLAGS') conf.add_os_flags('CFLAGS')
[ "def", "cc_add_flags", "(", "conf", ")", ":", "conf", ".", "add_os_flags", "(", "'CPPFLAGS'", ",", "'CFLAGS'", ")", "conf", ".", "add_os_flags", "(", "'CFLAGS'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py#L995-L1000
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/errors.py
python
ParserContext.add_enum_value_not_unique_error
(self, location, enum_name)
Add an error for an enum having duplicate values.
Add an error for an enum having duplicate values.
[ "Add", "an", "error", "for", "an", "enum", "having", "duplicate", "values", "." ]
def add_enum_value_not_unique_error(self, location, enum_name): # type: (common.SourceLocation, str) -> None """Add an error for an enum having duplicate values.""" self._add_error(location, ERROR_ID_ENUM_NON_UNIQUE_VALUES, "Enum '%s' has duplicate values, all values must...
[ "def", "add_enum_value_not_unique_error", "(", "self", ",", "location", ",", "enum_name", ")", ":", "# type: (common.SourceLocation, str) -> None", "self", ".", "_add_error", "(", "location", ",", "ERROR_ID_ENUM_NON_UNIQUE_VALUES", ",", "\"Enum '%s' has duplicate values, all va...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/errors.py#L614-L618
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unsafe/nrt.py
python
NRT_get_api
(tyctx)
return sig, codegen
NRT_get_api() Calls NRT_get_api() from the NRT C API Returns LLVM Type i8* (void pointer)
NRT_get_api()
[ "NRT_get_api", "()" ]
def NRT_get_api(tyctx): """NRT_get_api() Calls NRT_get_api() from the NRT C API Returns LLVM Type i8* (void pointer) """ def codegen(cgctx, builder, sig, args): return cgctx.nrt.get_nrt_api(builder) sig = signature(types.voidptr) return sig, codegen
[ "def", "NRT_get_api", "(", "tyctx", ")", ":", "def", "codegen", "(", "cgctx", ",", "builder", ",", "sig", ",", "args", ")", ":", "return", "cgctx", ".", "nrt", ".", "get_nrt_api", "(", "builder", ")", "sig", "=", "signature", "(", "types", ".", "void...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unsafe/nrt.py#L11-L20
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/gauth.py
python
get_captcha_challenge
(http_body, captcha_base_url='http://www.google.com/accounts/')
Returns the URL and token for a CAPTCHA challenge issued by the server. Args: http_body: str The body of the HTTP response from the server which contains the CAPTCHA challenge. captcha_base_url: str This function returns a full URL for viewing the challenge image which is built from the serve...
Returns the URL and token for a CAPTCHA challenge issued by the server.
[ "Returns", "the", "URL", "and", "token", "for", "a", "CAPTCHA", "challenge", "issued", "by", "the", "server", "." ]
def get_captcha_challenge(http_body, captcha_base_url='http://www.google.com/accounts/'): """Returns the URL and token for a CAPTCHA challenge issued by the server. Args: http_body: str The body of the HTTP response from the server which contains the CAPTCHA challenge. captcha_base_url: str Thi...
[ "def", "get_captcha_challenge", "(", "http_body", ",", "captcha_base_url", "=", "'http://www.google.com/accounts/'", ")", ":", "contains_captcha_challenge", "=", "False", "captcha_parameters", "=", "{", "}", "for", "response_line", "in", "http_body", ".", "splitlines", ...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/gauth.py#L131-L167
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
ChildFocusEvent.GetWindow
(*args, **kwargs)
return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
GetWindow(self) -> Window The window, or (grand)parent of the window which has just received the focus.
GetWindow(self) -> Window
[ "GetWindow", "(", "self", ")", "-", ">", "Window" ]
def GetWindow(*args, **kwargs): """ GetWindow(self) -> Window The window, or (grand)parent of the window which has just received the focus. """ return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
[ "def", "GetWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "ChildFocusEvent_GetWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6349-L6356
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/Cookie.py
python
BaseCookie.__set
(self, key, real_value, coded_value)
Private method for setting a cookie's value
Private method for setting a cookie's value
[ "Private", "method", "for", "setting", "a", "cookie", "s", "value" ]
def __set(self, key, real_value, coded_value): """Private method for setting a cookie's value""" M = self.get(key, Morsel()) M.set(key, real_value, coded_value) dict.__setitem__(self, key, M)
[ "def", "__set", "(", "self", ",", "key", ",", "real_value", ",", "coded_value", ")", ":", "M", "=", "self", ".", "get", "(", "key", ",", "Morsel", "(", ")", ")", "M", ".", "set", "(", "key", ",", "real_value", ",", "coded_value", ")", "dict", "."...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/Cookie.py#L586-L590
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/rnn.py
python
_is_keras_rnn_cell
(rnn_cell)
return (not isinstance(rnn_cell, rnn_cell_impl.RNNCell) and isinstance(rnn_cell, base_layer.Layer) and getattr(rnn_cell, "zero_state", None) is None)
Check whether the cell is a Keras RNN cell. The Keras RNN cell accept the state as a list even the state is a single tensor, whereas the TF RNN cell does not wrap single state tensor in list. This behavior difference should be unified in future version. Args: rnn_cell: An RNN cell instance that either fol...
Check whether the cell is a Keras RNN cell.
[ "Check", "whether", "the", "cell", "is", "a", "Keras", "RNN", "cell", "." ]
def _is_keras_rnn_cell(rnn_cell): """Check whether the cell is a Keras RNN cell. The Keras RNN cell accept the state as a list even the state is a single tensor, whereas the TF RNN cell does not wrap single state tensor in list. This behavior difference should be unified in future version. Args: rnn_cel...
[ "def", "_is_keras_rnn_cell", "(", "rnn_cell", ")", ":", "# Cell type check is not strict enough since there are cells created by other", "# library like Deepmind that didn't inherit tf.nn.rnn_cell.RNNCell.", "# Keras cells never had zero_state method, which was from the original", "# interface fro...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/rnn.py#L145-L165
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap.py
python
FrozenImporter.get_code
(cls, fullname)
return _imp.get_frozen_object(fullname)
Return the code object for the frozen module.
Return the code object for the frozen module.
[ "Return", "the", "code", "object", "for", "the", "frozen", "module", "." ]
def get_code(cls, fullname): """Return the code object for the frozen module.""" return _imp.get_frozen_object(fullname)
[ "def", "get_code", "(", "cls", ",", "fullname", ")", ":", "return", "_imp", ".", "get_frozen_object", "(", "fullname", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap.py#L832-L834
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/workspacedisplay/table/presenter.py
python
TableWorkspaceDisplay.__init__
( self, ws, parent=None, window_flags=Qt.Window, plot=None, model=None, view=None, name=None, ads_observer=None, container=None, window_width=600, window_height=400, ...
Creates a display for the provided workspace. :param ws: Workspace to be displayed :param parent: Parent of the widget :param window_flags: An optional set of window flags :param plot: Plotting function that will be used to plot workspaces. This requires Matplotlib directly. ...
Creates a display for the provided workspace.
[ "Creates", "a", "display", "for", "the", "provided", "workspace", "." ]
def __init__( self, ws, parent=None, window_flags=Qt.Window, plot=None, model=None, view=None, name=None, ads_observer=None, container=None, window_width=600, window_height=400...
[ "def", "__init__", "(", "self", ",", "ws", ",", "parent", "=", "None", ",", "window_flags", "=", "Qt", ".", "Window", ",", "plot", "=", "None", ",", "model", "=", "None", ",", "view", "=", "None", ",", "name", "=", "None", ",", "ads_observer", "=",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/workspacedisplay/table/presenter.py#L49-L99
deepmind/streetlearn
ccf1d60b9c45154894d45a897748aee85d7eb69b
streetlearn/python/environment/instructions_base.py
python
InstructionsBase._add_reward_to_pano
(self, pano_id, reward, color, streetlearn)
Add reward to a pano and all its neighbours. Args: pano_id: centroid pano id. reward: Amount of reward to attach to this and neighbouring panos. color: Color for the goal in the minimap. streetlearn: Streetlearn instance
Add reward to a pano and all its neighbours.
[ "Add", "reward", "to", "a", "pano", "and", "all", "its", "neighbours", "." ]
def _add_reward_to_pano(self, pano_id, reward, color, streetlearn): """Add reward to a pano and all its neighbours. Args: pano_id: centroid pano id. reward: Amount of reward to attach to this and neighbouring panos. color: Color for the goal in the minimap. streetlearn: Streetlearn inst...
[ "def", "_add_reward_to_pano", "(", "self", ",", "pano_id", ",", "reward", ",", "color", ",", "streetlearn", ")", ":", "# If this already has a reward indirectly through a neighbour, undo that.", "if", "pano_id", "in", "self", ".", "_reward_pano_id_list", ":", "if", "sel...
https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/instructions_base.py#L280-L312
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/smtplib.py
python
quotedata
(data)
return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
Quote data for email. Double leading '.', and change Unix newline '\\n', or Mac '\\r' into Internet CRLF end-of-line.
Quote data for email.
[ "Quote", "data", "for", "email", "." ]
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\\n', or Mac '\\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
[ "def", "quotedata", "(", "data", ")", ":", "return", "re", ".", "sub", "(", "r'(?m)^\\.'", ",", "'..'", ",", "re", ".", "sub", "(", "r'(?:\\r\\n|\\n|\\r(?!\\n))'", ",", "CRLF", ",", "data", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/smtplib.py#L166-L173
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Font.GetStyleString
(*args, **kwargs)
return _gdi_.Font_GetStyleString(*args, **kwargs)
GetStyleString(self) -> String Returns a string representation of the font style.
GetStyleString(self) -> String
[ "GetStyleString", "(", "self", ")", "-", ">", "String" ]
def GetStyleString(*args, **kwargs): """ GetStyleString(self) -> String Returns a string representation of the font style. """ return _gdi_.Font_GetStyleString(*args, **kwargs)
[ "def", "GetStyleString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Font_GetStyleString", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2510-L2516
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
clang/bindings/python/clang/cindex.py
python
Type.get_array_element_type
(self)
return conf.lib.clang_getArrayElementType(self)
Retrieve the type of the elements of the array type.
Retrieve the type of the elements of the array type.
[ "Retrieve", "the", "type", "of", "the", "elements", "of", "the", "array", "type", "." ]
def get_array_element_type(self): """ Retrieve the type of the elements of the array type. """ return conf.lib.clang_getArrayElementType(self)
[ "def", "get_array_element_type", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getArrayElementType", "(", "self", ")" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L2354-L2358
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
copy_mesh
(fromFileName, toFileName, exoFromObj=None, additionalElementAttributes=[], array_type='ctype')
return exo_to
Copies the mesh data from an existing exodus database to a new exodus database. Parameters ---------- fromFileName : string File name of the exodus mesh to be copied toFileName : string File name of the new exodus mesh exoFromObj : exodus object, optional Exodus object t...
Copies the mesh data from an existing exodus database to a new exodus database.
[ "Copies", "the", "mesh", "data", "from", "an", "existing", "exodus", "database", "to", "a", "new", "exodus", "database", "." ]
def copy_mesh(fromFileName, toFileName, exoFromObj=None, additionalElementAttributes=[], array_type='ctype'): """ Copies the mesh data from an existing exodus database to a new exodus database. Parameters ---------- fromFileName : string File name of the exodus mesh to be ...
[ "def", "copy_mesh", "(", "fromFileName", ",", "toFileName", ",", "exoFromObj", "=", "None", ",", "additionalElementAttributes", "=", "[", "]", ",", "array_type", "=", "'ctype'", ")", ":", "debugPrint", "=", "False", "# If the user did not supply a exodus object to cop...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L6219-L6426
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/serve_utils.py
python
DatetimeNoTzToIsoFormatUtc
(timestamp)
return "{0}+00:00".format(timestamp.isoformat())
Return a string representing the date and time in ISO 8601 format. Args: timestamp: datetime.datetime object without time zone info. Returns: a string representing the date and time in ISO 8601 with UTC time zone info.
Return a string representing the date and time in ISO 8601 format.
[ "Return", "a", "string", "representing", "the", "date", "and", "time", "in", "ISO", "8601", "format", "." ]
def DatetimeNoTzToIsoFormatUtc(timestamp): """Return a string representing the date and time in ISO 8601 format. Args: timestamp: datetime.datetime object without time zone info. Returns: a string representing the date and time in ISO 8601 with UTC time zone info. """ assert isinstance(timestamp, dat...
[ "def", "DatetimeNoTzToIsoFormatUtc", "(", "timestamp", ")", ":", "assert", "isinstance", "(", "timestamp", ",", "datetime", ".", "datetime", ")", "timestamp", "=", "timestamp", ".", "replace", "(", "tzinfo", "=", "None", ")", "return", "\"{0}+00:00\"", ".", "f...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/serve_utils.py#L56-L66
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
IKSolver.getMaxIters
(self)
return _robotsim.IKSolver_getMaxIters(self)
r""" Returns the max # of iterations.
r""" Returns the max # of iterations.
[ "r", "Returns", "the", "max", "#", "of", "iterations", "." ]
def getMaxIters(self) ->int: r""" Returns the max # of iterations. """ return _robotsim.IKSolver_getMaxIters(self)
[ "def", "getMaxIters", "(", "self", ")", "->", "int", ":", "return", "_robotsim", ".", "IKSolver_getMaxIters", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L6422-L6427
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/base/role_maker.py
python
PaddleCloudRoleMaker._is_worker
(self)
return self._role == Role.WORKER
whether current process is worker
whether current process is worker
[ "whether", "current", "process", "is", "worker" ]
def _is_worker(self): """ whether current process is worker """ if not self._role_is_generated: self._generate_role() return self._role == Role.WORKER
[ "def", "_is_worker", "(", "self", ")", ":", "if", "not", "self", ".", "_role_is_generated", ":", "self", ".", "_generate_role", "(", ")", "return", "self", ".", "_role", "==", "Role", ".", "WORKER" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/base/role_maker.py#L593-L599
SOUI2/soui
774e5566b2d3254a94f4b3efd55b982e7c665434
third-part/jsoncpp/devtools/batchbuild.py
python
fix_eol
(stdout)
return re.sub('\r*\n', os.linesep, stdout)
Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n).
Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n).
[ "Fixes", "wrong", "EOL", "produced", "by", "cmake", "--", "build", "on", "Windows", "(", "\\", "r", "\\", "r", "\\", "n", "instead", "of", "\\", "r", "\\", "n", ")", "." ]
def fix_eol(stdout): """Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n). """ return re.sub('\r*\n', os.linesep, stdout)
[ "def", "fix_eol", "(", "stdout", ")", ":", "return", "re", ".", "sub", "(", "'\\r*\\n'", ",", "os", ".", "linesep", ",", "stdout", ")" ]
https://github.com/SOUI2/soui/blob/774e5566b2d3254a94f4b3efd55b982e7c665434/third-part/jsoncpp/devtools/batchbuild.py#L106-L109
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/de2/modpack_subprocessor.py
python
DE2ModpackSubprocessor.get_modpacks
(cls, gamedata)
return [de2_base]
Return all modpacks that can be created from the gamedata.
Return all modpacks that can be created from the gamedata.
[ "Return", "all", "modpacks", "that", "can", "be", "created", "from", "the", "gamedata", "." ]
def get_modpacks(cls, gamedata): """ Return all modpacks that can be created from the gamedata. """ de2_base = cls._get_aoe2_base(gamedata) return [de2_base]
[ "def", "get_modpacks", "(", "cls", ",", "gamedata", ")", ":", "de2_base", "=", "cls", ".", "_get_aoe2_base", "(", "gamedata", ")", "return", "[", "de2_base", "]" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/de2/modpack_subprocessor.py#L19-L25
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/composable_model.py
python
DNNComposableModel.__init__
(self, num_label_columns, hidden_units, optimizer=None, activation_fn=nn.relu, dropout=None, gradient_clip_norm=None, num_ps_replicas=0, scope=None)
Initializes DNNComposableModel objects. Args: num_label_columns: The number of label/target columns. hidden_units: List of hidden units per layer. All layers are fully connected. optimizer: An instance of `tf.Optimizer` used to apply gradients to the model. If `None`, will use a F...
Initializes DNNComposableModel objects.
[ "Initializes", "DNNComposableModel", "objects", "." ]
def __init__(self, num_label_columns, hidden_units, optimizer=None, activation_fn=nn.relu, dropout=None, gradient_clip_norm=None, num_ps_replicas=0, scope=None): """Initializes DNNComposableModel ...
[ "def", "__init__", "(", "self", ",", "num_label_columns", ",", "hidden_units", ",", "optimizer", "=", "None", ",", "activation_fn", "=", "nn", ".", "relu", ",", "dropout", "=", "None", ",", "gradient_clip_norm", "=", "None", ",", "num_ps_replicas", "=", "0",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/composable_model.py#L235-L272
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/entity_object/conversion/combined_sprite.py
python
CombinedSprite.__init__
(self, head_sprite_id, filename, full_data_set)
Creates a new CombinedSprite instance. :param head_sprite_id: The id of the top level graphic of this sprite. :type head_sprite_id: int :param filename: Name of the sprite and definition file. :type filename: str :param full_data_set: GenieObjectContainer instance that ...
Creates a new CombinedSprite instance.
[ "Creates", "a", "new", "CombinedSprite", "instance", "." ]
def __init__(self, head_sprite_id, filename, full_data_set): """ Creates a new CombinedSprite instance. :param head_sprite_id: The id of the top level graphic of this sprite. :type head_sprite_id: int :param filename: Name of the sprite and definition file. :type filenam...
[ "def", "__init__", "(", "self", ",", "head_sprite_id", ",", "filename", ",", "full_data_set", ")", ":", "self", ".", "head_sprite_id", "=", "head_sprite_id", "self", ".", "filename", "=", "filename", "self", ".", "data", "=", "full_data_set", "self", ".", "m...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/combined_sprite.py#L17-L41
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/nntplib.py
python
NNTP.post
(self, f)
return self.getresp()
Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if successful
Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if successful
[ "Process", "a", "POST", "command", ".", "Arguments", ":", "-", "f", ":", "file", "containing", "the", "article", "Returns", ":", "-", "resp", ":", "server", "response", "if", "successful" ]
def post(self, f): """Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if successful""" resp = self.shortcmd('POST') # Raises error_??? if posting is not allowed if resp[0] != '3': raise NNTPReplyEr...
[ "def", "post", "(", "self", ",", "f", ")", ":", "resp", "=", "self", ".", "shortcmd", "(", "'POST'", ")", "# Raises error_??? if posting is not allowed", "if", "resp", "[", "0", "]", "!=", "'3'", ":", "raise", "NNTPReplyError", "(", "resp", ")", "while", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/nntplib.py#L549-L569
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/regular_languages/compiler.py
python
_CompiledGrammar._transform_prefix
( cls, root_node: Node, create_group_func: Callable[[Variable], str] )
Yield all the regular expressions matching a prefix of the grammar defined by the `Node` instance. For each `Variable`, one regex pattern will be generated, with this named group at the end. This is required because a regex engine will terminate once a match is found. For autocompletion...
Yield all the regular expressions matching a prefix of the grammar defined by the `Node` instance.
[ "Yield", "all", "the", "regular", "expressions", "matching", "a", "prefix", "of", "the", "grammar", "defined", "by", "the", "Node", "instance", "." ]
def _transform_prefix( cls, root_node: Node, create_group_func: Callable[[Variable], str] ) -> Iterable[str]: """ Yield all the regular expressions matching a prefix of the grammar defined by the `Node` instance. For each `Variable`, one regex pattern will be generated, with...
[ "def", "_transform_prefix", "(", "cls", ",", "root_node", ":", "Node", ",", "create_group_func", ":", "Callable", "[", "[", "Variable", "]", ",", "str", "]", ")", "->", "Iterable", "[", "str", "]", ":", "def", "contains_variable", "(", "node", ":", "Node...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/regular_languages/compiler.py#L200-L357
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
DepFile.register
(self, node, source=True)
Add the node to the hashed files.
Add the node to the hashed files.
[ "Add", "the", "node", "to", "the", "hashed", "files", "." ]
def register(self, node, source=True): """Add the node to the hashed files.""" self.__files.append((node, source))
[ "def", "register", "(", "self", ",", "node", ",", "source", "=", "True", ")", ":", "self", ".", "__files", ".", "append", "(", "(", "node", ",", "source", ")", ")" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1185-L1187
Jittor/jittor
e9aca0444c2bdc8e2389d99122954cd0903eec46
python/jittor/__init__.py
python
Module.load
(self, path: str)
loads parameters from a file. :param path: path to load. :type path: str Example: >>> class Net(nn.Module): >>> ... >>> net = Net() >>> net.save('net.pkl') >>> net.load('net.pkl') This method also supports loading a ...
loads parameters from a file.
[ "loads", "parameters", "from", "a", "file", "." ]
def load(self, path: str): ''' loads parameters from a file. :param path: path to load. :type path: str Example: >>> class Net(nn.Module): >>> ... >>> net = Net() >>> net.save('net.pkl') >>> net.load('net.pkl') ...
[ "def", "load", "(", "self", ",", "path", ":", "str", ")", ":", "self", ".", "load_parameters", "(", "load", "(", "path", ")", ")" ]
https://github.com/Jittor/jittor/blob/e9aca0444c2bdc8e2389d99122954cd0903eec46/python/jittor/__init__.py#L1118-L1148
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/gluon/lipnet/utils/align.py
python
Align.sentence
(self, padding=75)
return np.array(vec, dtype=np.int32)
Get sentence
Get sentence
[ "Get", "sentence" ]
def sentence(self, padding=75): """ Get sentence """ vec = word_to_vector(self.sentence_str) vec += [-1] * (padding - self.sentence_length) return np.array(vec, dtype=np.int32)
[ "def", "sentence", "(", "self", ",", "padding", "=", "75", ")", ":", "vec", "=", "word_to_vector", "(", "self", ".", "sentence_str", ")", "vec", "+=", "[", "-", "1", "]", "*", "(", "padding", "-", "self", ".", "sentence_length", ")", "return", "np", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/gluon/lipnet/utils/align.py#L54-L60
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryengine/PyBtcWallet.py
python
PyBtcWallet.supplyRootKeyForWatchingOnlyWallet
(self, securePlainRootKey32, \ permanent=False)
If you have a watching only wallet, you might want to upgrade it to a full wallet by supplying the 32-byte root private key. Generally, this will be used to make a 'permanent' upgrade to your wallet, and the new keys will be written to file ( NOTE: you should setup encryption just after doing ...
If you have a watching only wallet, you might want to upgrade it to a full wallet by supplying the 32-byte root private key. Generally, this will be used to make a 'permanent' upgrade to your wallet, and the new keys will be written to file ( NOTE: you should setup encryption just after doing ...
[ "If", "you", "have", "a", "watching", "only", "wallet", "you", "might", "want", "to", "upgrade", "it", "to", "a", "full", "wallet", "by", "supplying", "the", "32", "-", "byte", "root", "private", "key", ".", "Generally", "this", "will", "be", "used", "...
def supplyRootKeyForWatchingOnlyWallet(self, securePlainRootKey32, \ permanent=False): """ If you have a watching only wallet, you might want to upgrade it to a full wallet by supplying the 32-byte root private key. Generally, this will be used to...
[ "def", "supplyRootKeyForWatchingOnlyWallet", "(", "self", ",", "securePlainRootKey32", ",", "permanent", "=", "False", ")", ":", "pass" ]
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/PyBtcWallet.py#L1380-L1395
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/r2s.py
python
tag_source_intensity
(m, source_intensity, tag_name='source_intensity')
return m
This function tags the source intensity of photon source to the PyMOAB mesh instance as a sparse tag for the purpose of photon source sampling. Parameters ---------- m : PyNE Mesh The object containing the mesh instance to be tagged. source_intensity : float The source intensity of ...
This function tags the source intensity of photon source to the PyMOAB mesh instance as a sparse tag for the purpose of photon source sampling.
[ "This", "function", "tags", "the", "source", "intensity", "of", "photon", "source", "to", "the", "PyMOAB", "mesh", "instance", "as", "a", "sparse", "tag", "for", "the", "purpose", "of", "photon", "source", "sampling", "." ]
def tag_source_intensity(m, source_intensity, tag_name='source_intensity'): """This function tags the source intensity of photon source to the PyMOAB mesh instance as a sparse tag for the purpose of photon source sampling. Parameters ---------- m : PyNE Mesh The object containing the mesh i...
[ "def", "tag_source_intensity", "(", "m", ",", "source_intensity", ",", "tag_name", "=", "'source_intensity'", ")", ":", "# do not provide value when initializing a sparse tag", "m", ".", "tag", "(", "name", "=", "tag_name", ",", "doc", "=", "tag_name", "+", "' of th...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/r2s.py#L278-L302
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/integrate/_ivp/common.py
python
norm
(x)
return np.linalg.norm(x) / x.size ** 0.5
Compute RMS norm.
Compute RMS norm.
[ "Compute", "RMS", "norm", "." ]
def norm(x): """Compute RMS norm.""" return np.linalg.norm(x) / x.size ** 0.5
[ "def", "norm", "(", "x", ")", ":", "return", "np", ".", "linalg", ".", "norm", "(", "x", ")", "/", "x", ".", "size", "**", "0.5" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_ivp/common.py#L60-L62
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
caffe-20160312/scripts/cpp_lint.py
python
_CppLintState.ResetErrorCounts
(self)
Sets the module's error statistic back to zero.
Sets the module's error statistic back to zero.
[ "Sets", "the", "module", "s", "error", "statistic", "back", "to", "zero", "." ]
def ResetErrorCounts(self): """Sets the module's error statistic back to zero.""" self.error_count = 0 self.errors_by_category = {}
[ "def", "ResetErrorCounts", "(", "self", ")", ":", "self", ".", "error_count", "=", "0", "self", ".", "errors_by_category", "=", "{", "}" ]
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/cpp_lint.py#L742-L745
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
plant-lighting-system/python/iot_plant_lighting_system/hardware/board.py
python
Board.update_hardware_state
(self)
Abstract method for updating hardware state.
Abstract method for updating hardware state.
[ "Abstract", "method", "for", "updating", "hardware", "state", "." ]
def update_hardware_state(self): """ Abstract method for updating hardware state. """ pass
[ "def", "update_hardware_state", "(", "self", ")", ":", "pass" ]
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/plant-lighting-system/python/iot_plant_lighting_system/hardware/board.py#L95-L101
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/ansic/cparse.py
python
p_direct_declarator_4
(t)
direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN
direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN
[ "direct_declarator", ":", "direct_declarator", "LPAREN", "parameter_type_list", "RPAREN" ]
def p_direct_declarator_4(t): 'direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN ' pass
[ "def", "p_direct_declarator_4", "(", "t", ")", ":", "pass" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L285-L287
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
RobotModelLink.setName
(self, name)
return _robotsim.RobotModelLink_setName(self, name)
setName(RobotModelLink self, char const * name) Sets the name of the robot link.
setName(RobotModelLink self, char const * name)
[ "setName", "(", "RobotModelLink", "self", "char", "const", "*", "name", ")" ]
def setName(self, name): """ setName(RobotModelLink self, char const * name) Sets the name of the robot link. """ return _robotsim.RobotModelLink_setName(self, name)
[ "def", "setName", "(", "self", ",", "name", ")", ":", "return", "_robotsim", ".", "RobotModelLink_setName", "(", "self", ",", "name", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L3698-L3707
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/runtime.py
python
new_context
(environment, template_name, blocks, vars=None, shared=None, globals=None, locals=None)
return environment.context_class(environment, parent, template_name, blocks)
Internal helper to for context creation.
Internal helper to for context creation.
[ "Internal", "helper", "to", "for", "context", "creation", "." ]
def new_context(environment, template_name, blocks, vars=None, shared=None, globals=None, locals=None): """Internal helper to for context creation.""" if vars is None: vars = {} if shared: parent = vars else: parent = dict(globals or (), **vars) if locals: ...
[ "def", "new_context", "(", "environment", ",", "template_name", ",", "blocks", ",", "vars", "=", "None", ",", "shared", "=", "None", ",", "globals", "=", "None", ",", "locals", "=", "None", ")", ":", "if", "vars", "is", "None", ":", "vars", "=", "{",...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/runtime.py#L55-L73
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/hermite_e.py
python
hermediv
(c1, c2)
Divide one Hermite series by another. Returns the quotient-with-remainder of two Hermite series `c1` / `c2`. The arguments are sequences of coefficients from lowest order "term" to highest, e.g., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_l...
Divide one Hermite series by another.
[ "Divide", "one", "Hermite", "series", "by", "another", "." ]
def hermediv(c1, c2): """ Divide one Hermite series by another. Returns the quotient-with-remainder of two Hermite series `c1` / `c2`. The arguments are sequences of coefficients from lowest order "term" to highest, e.g., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ...
[ "def", "hermediv", "(", "c1", ",", "c2", ")", ":", "# c1, c2 are trimmed copies", "[", "c1", ",", "c2", "]", "=", "pu", ".", "as_series", "(", "[", "c1", ",", "c2", "]", ")", "if", "c2", "[", "-", "1", "]", "==", "0", ":", "raise", "ZeroDivisionE...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/hermite_e.py#L515-L577
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/debugger_r.py
python
close_remote_debugger
(rpcclt)
Shut down subprocess debugger and Idle side of debugger RPC link Request that the RPCServer shut down the subprocess debugger and link. Unregister the GUIAdapter, which will cause a GC on the Idle process debugger and RPC link objects. (The second reference to the debugger GUI is deleted in pyshell.cl...
Shut down subprocess debugger and Idle side of debugger RPC link
[ "Shut", "down", "subprocess", "debugger", "and", "Idle", "side", "of", "debugger", "RPC", "link" ]
def close_remote_debugger(rpcclt): """Shut down subprocess debugger and Idle side of debugger RPC link Request that the RPCServer shut down the subprocess debugger and link. Unregister the GUIAdapter, which will cause a GC on the Idle process debugger and RPC link objects. (The second reference to the...
[ "def", "close_remote_debugger", "(", "rpcclt", ")", ":", "close_subprocess_debugger", "(", "rpcclt", ")", "rpcclt", ".", "unregister", "(", "gui_adap_oid", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/debugger_r.py#L370-L380
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_shape.py
python
RaggedShape._alt_inner_shape
(self, new_inner_rank)
Get an alternative inner shape with higher or lower rank. For the rank of the inner shape to be be higher, the last few ragged dimensions must have uniform_row_length. Args: new_inner_rank: the new rank of the inner_shape Returns: A new inner_shape of rank new_inner_rank.
Get an alternative inner shape with higher or lower rank.
[ "Get", "an", "alternative", "inner", "shape", "with", "higher", "or", "lower", "rank", "." ]
def _alt_inner_shape(self, new_inner_rank): """Get an alternative inner shape with higher or lower rank. For the rank of the inner shape to be be higher, the last few ragged dimensions must have uniform_row_length. Args: new_inner_rank: the new rank of the inner_shape Returns: A new ...
[ "def", "_alt_inner_shape", "(", "self", ",", "new_inner_rank", ")", ":", "if", "new_inner_rank", "==", "0", ":", "raise", "ValueError", "(", "\"new_inner_rank cannot be zero\"", ")", "elif", "self", ".", "inner_rank", "==", "0", ":", "raise", "ValueError", "(", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_shape.py#L601-L642
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
CheckSectionSpacing
(filename, clean_lines, class_info, linenum, error)
Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number ...
Checks for additional blank line issues related to sections.
[ "Checks", "for", "additional", "blank", "line", "issues", "related", "to", "sections", "." ]
def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance co...
[ "def", "CheckSectionSpacing", "(", "filename", ",", "clean_lines", ",", "class_info", ",", "linenum", ",", "error", ")", ":", "# Skip checks if the class is small, where small means 25 lines or less.", "# 25 lines seems like a good cutoff since that's the usual height of", "# termina...
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L3812-L3864
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListLineData.Highlight
(self, on)
return True
Sets the current line as highlighted or not highlighted. :param `on`: ``True`` to set the current line as highlighted, ``False`` otherwise.
Sets the current line as highlighted or not highlighted.
[ "Sets", "the", "current", "line", "as", "highlighted", "or", "not", "highlighted", "." ]
def Highlight(self, on): """ Sets the current line as highlighted or not highlighted. :param `on`: ``True`` to set the current line as highlighted, ``False`` otherwise. """ if on == self._highlighted: return False self._highlighted = on re...
[ "def", "Highlight", "(", "self", ",", "on", ")", ":", "if", "on", "==", "self", ".", "_highlighted", ":", "return", "False", "self", ".", "_highlighted", "=", "on", "return", "True" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L4907-L4920
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/android_commands.py
python
AndroidCommands.SyncLogCat
(self)
return self._logcat.expect([tag, pexpect.EOF, pexpect.TIMEOUT]) == 0
Synchronize with logcat. Synchronize with the monitored logcat so that WaitForLogMatch will only consider new message that are received after this point in time. Returns: True if the synchronization succeeded.
Synchronize with logcat.
[ "Synchronize", "with", "logcat", "." ]
def SyncLogCat(self): """Synchronize with logcat. Synchronize with the monitored logcat so that WaitForLogMatch will only consider new message that are received after this point in time. Returns: True if the synchronization succeeded. """ assert self._logcat tag = 'logcat_sync_%s' % ...
[ "def", "SyncLogCat", "(", "self", ")", ":", "assert", "self", ".", "_logcat", "tag", "=", "'logcat_sync_%s'", "%", "time", ".", "time", "(", ")", "self", ".", "RunShellCommand", "(", "'log '", "+", "tag", ")", "return", "self", ".", "_logcat", ".", "ex...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/android_commands.py#L1275-L1287
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudfront/__init__.py
python
CloudFrontConnection.get_invalidation_requests
(self, distribution_id, marker=None, max_items=None)
return self._get_all_objects(uri, tags, result_set_class=rs_class, result_set_kwargs=rs_kwargs)
Get all invalidation requests for a given CloudFront distribution. This returns an instance of an InvalidationListResultSet that automatically handles all of the result paging, etc. from CF - you just need to keep iterating until there are no more results. :type distribution_id: string ...
Get all invalidation requests for a given CloudFront distribution. This returns an instance of an InvalidationListResultSet that automatically handles all of the result paging, etc. from CF - you just need to keep iterating until there are no more results.
[ "Get", "all", "invalidation", "requests", "for", "a", "given", "CloudFront", "distribution", ".", "This", "returns", "an", "instance", "of", "an", "InvalidationListResultSet", "that", "automatically", "handles", "all", "of", "the", "result", "paging", "etc", ".", ...
def get_invalidation_requests(self, distribution_id, marker=None, max_items=None): """ Get all invalidation requests for a given CloudFront distribution. This returns an instance of an InvalidationListResultSet that automatically handles all of the resul...
[ "def", "get_invalidation_requests", "(", "self", ",", "distribution_id", ",", "marker", "=", "None", ",", "max_items", "=", "None", ")", ":", "uri", "=", "'distribution/%s/invalidation'", "%", "distribution_id", "params", "=", "dict", "(", ")", "if", "marker", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudfront/__init__.py#L280-L326
google/ml-metadata
b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d
ml_metadata/metadata_store/types.py
python
_create_pre_json
(artifact_struct: ArtifactStruct)
Given an ArtifactStruct, create a structure that can be dumped to JSON.
Given an ArtifactStruct, create a structure that can be dumped to JSON.
[ "Given", "an", "ArtifactStruct", "create", "a", "structure", "that", "can", "be", "dumped", "to", "JSON", "." ]
def _create_pre_json(artifact_struct: ArtifactStruct): """Given an ArtifactStruct, create a structure that can be dumped to JSON.""" if artifact_struct is None: raise NotImplementedError("Cannot serialize None yet") elif isinstance(artifact_struct, dict): return {k: _create_pre_json(v) for k, v in artifac...
[ "def", "_create_pre_json", "(", "artifact_struct", ":", "ArtifactStruct", ")", ":", "if", "artifact_struct", "is", "None", ":", "raise", "NotImplementedError", "(", "\"Cannot serialize None yet\"", ")", "elif", "isinstance", "(", "artifact_struct", ",", "dict", ")", ...
https://github.com/google/ml-metadata/blob/b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d/ml_metadata/metadata_store/types.py#L633-L644
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/Tpm.py
python
Tpm.DictionaryAttackLockReset
(self, lockHandle)
return self.processResponse(respBuf)
This command cancels the effect of a TPM lockout due to a number of successive authorization failures. If this command is properly authorized, the lockout counter is set to zero. Args: lockHandle (TPM_HANDLE): TPM_RH_LOCKOUT Auth Index: 1 Auth Role: U...
This command cancels the effect of a TPM lockout due to a number of successive authorization failures. If this command is properly authorized, the lockout counter is set to zero.
[ "This", "command", "cancels", "the", "effect", "of", "a", "TPM", "lockout", "due", "to", "a", "number", "of", "successive", "authorization", "failures", ".", "If", "this", "command", "is", "properly", "authorized", "the", "lockout", "counter", "is", "set", "...
def DictionaryAttackLockReset(self, lockHandle): """ This command cancels the effect of a TPM lockout due to a number of successive authorization failures. If this command is properly authorized, the lockout counter is set to zero. Args: lockHandle (TPM_HANDLE): TPM_RH_LOCKO...
[ "def", "DictionaryAttackLockReset", "(", "self", ",", "lockHandle", ")", ":", "req", "=", "TPM2_DictionaryAttackLockReset_REQUEST", "(", "lockHandle", ")", "respBuf", "=", "self", ".", "dispatchCommand", "(", "TPM_CC", ".", "DictionaryAttackLockReset", ",", "req", "...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/Tpm.py#L1949-L1961
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
demo/PropertyGrid.py
python
TrivialPropertyEditor.OnEvent
(self, propgrid, property, ctrl, event)
return False
Return True if modified editor value should be committed to the property. To just mark the property value modified, call propgrid.EditorsValueWasModified().
Return True if modified editor value should be committed to the property. To just mark the property value modified, call propgrid.EditorsValueWasModified().
[ "Return", "True", "if", "modified", "editor", "value", "should", "be", "committed", "to", "the", "property", ".", "To", "just", "mark", "the", "property", "value", "modified", "call", "propgrid", ".", "EditorsValueWasModified", "()", "." ]
def OnEvent(self, propgrid, property, ctrl, event): """ Return True if modified editor value should be committed to the property. To just mark the property value modified, call propgrid.EditorsValueWasModified(). """ if not ctrl: return False evtType ...
[ "def", "OnEvent", "(", "self", ",", "propgrid", ",", "property", ",", "ctrl", ",", "event", ")", ":", "if", "not", "ctrl", ":", "return", "False", "evtType", "=", "event", ".", "GetEventType", "(", ")", "if", "evtType", "==", "wx", ".", "wxEVT_COMMAND_...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/demo/PropertyGrid.py#L438-L462
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/docs/tools/dump_ast_matchers.py
python
unify_arguments
(args)
return args
Gets rid of anything the user doesn't care about in the argument list.
Gets rid of anything the user doesn't care about in the argument list.
[ "Gets", "rid", "of", "anything", "the", "user", "doesn", "t", "care", "about", "in", "the", "argument", "list", "." ]
def unify_arguments(args): """Gets rid of anything the user doesn't care about in the argument list.""" args = re.sub(r'internal::', r'', args) args = re.sub(r'extern const\s+(.*)&', r'\1 ', args) args = re.sub(r'&', r' ', args) args = re.sub(r'(^|\s)M\d?(\s)', r'\1Matcher<*>\2', args) args = re.sub(r'Binda...
[ "def", "unify_arguments", "(", "args", ")", ":", "args", "=", "re", ".", "sub", "(", "r'internal::'", ",", "r''", ",", "args", ")", "args", "=", "re", ".", "sub", "(", "r'extern const\\s+(.*)&'", ",", "r'\\1 '", ",", "args", ")", "args", "=", "re", "...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/docs/tools/dump_ast_matchers.py#L98-L106
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
RSA_EncryptResponse.__init__
(self, outData = None)
This command performs RSA encryption using the indicated padding scheme according to IETF RFC 8017. If the scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme to specify the padding scheme. If scheme of keyHandle is not TPM_ALG_NULL, then inScheme shall either be TPM_AL...
This command performs RSA encryption using the indicated padding scheme according to IETF RFC 8017. If the scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme to specify the padding scheme. If scheme of keyHandle is not TPM_ALG_NULL, then inScheme shall either be TPM_AL...
[ "This", "command", "performs", "RSA", "encryption", "using", "the", "indicated", "padding", "scheme", "according", "to", "IETF", "RFC", "8017", ".", "If", "the", "scheme", "of", "keyHandle", "is", "TPM_ALG_NULL", "then", "the", "caller", "may", "use", "inSchem...
def __init__(self, outData = None): """ This command performs RSA encryption using the indicated padding scheme according to IETF RFC 8017. If the scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme to specify the padding scheme. If scheme of keyHandle is not TPM_ALG_NU...
[ "def", "__init__", "(", "self", ",", "outData", "=", "None", ")", ":", "self", ".", "outData", "=", "outData" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L10676-L10686
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2_extras/i18n.py
python
gettext
(string, **variables)
return get_i18n().gettext(string, **variables)
See :meth:`I18n.gettext`.
See :meth:`I18n.gettext`.
[ "See", ":", "meth", ":", "I18n", ".", "gettext", "." ]
def gettext(string, **variables): """See :meth:`I18n.gettext`.""" return get_i18n().gettext(string, **variables)
[ "def", "gettext", "(", "string", ",", "*", "*", "variables", ")", ":", "return", "get_i18n", "(", ")", ".", "gettext", "(", "string", ",", "*", "*", "variables", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/i18n.py#L711-L713
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
python/artm/master_component.py
python
MasterComponent.get_phi_info
(self, model)
return phi_matrix_info
:param str model: name of matrix in BigARTM :return: messages.TopicModel object
:param str model: name of matrix in BigARTM :return: messages.TopicModel object
[ ":", "param", "str", "model", ":", "name", "of", "matrix", "in", "BigARTM", ":", "return", ":", "messages", ".", "TopicModel", "object" ]
def get_phi_info(self, model): """ :param str model: name of matrix in BigARTM :return: messages.TopicModel object """ args = messages.GetTopicModelArgs(model_name=model) args.matrix_layout = constants.MatrixLayout_Sparse args.eps = 1.001 # hack to not get any da...
[ "def", "get_phi_info", "(", "self", ",", "model", ")", ":", "args", "=", "messages", ".", "GetTopicModelArgs", "(", "model_name", "=", "model", ")", "args", ".", "matrix_layout", "=", "constants", ".", "MatrixLayout_Sparse", "args", ".", "eps", "=", "1.001",...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/master_component.py#L784-L794
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py
python
DrillView.set_acquisition_mode
(self, mode)
Set the current acquisition mode in the combobox. Args: mode (str): acquisition mode
Set the current acquisition mode in the combobox.
[ "Set", "the", "current", "acquisition", "mode", "in", "the", "combobox", "." ]
def set_acquisition_mode(self, mode): """ Set the current acquisition mode in the combobox. Args: mode (str): acquisition mode """ self.modeSelector.blockSignals(True) self.modeSelector.setCurrentText(mode) self.modeSelector.blockSignals(False)
[ "def", "set_acquisition_mode", "(", "self", ",", "mode", ")", ":", "self", ".", "modeSelector", ".", "blockSignals", "(", "True", ")", "self", ".", "modeSelector", ".", "setCurrentText", "(", "mode", ")", "self", ".", "modeSelector", ".", "blockSignals", "("...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py#L482-L491
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/algorithms.py
python
isin
(comps, values)
return f(comps, values)
Compute the isin boolean array. Parameters ---------- comps : array-like values : array-like Returns ------- ndarray[bool] Same length as `comps`.
Compute the isin boolean array.
[ "Compute", "the", "isin", "boolean", "array", "." ]
def isin(comps, values) -> np.ndarray: """ Compute the isin boolean array. Parameters ---------- comps : array-like values : array-like Returns ------- ndarray[bool] Same length as `comps`. """ if not is_list_like(comps): raise TypeError( "only l...
[ "def", "isin", "(", "comps", ",", "values", ")", "->", "np", ".", "ndarray", ":", "if", "not", "is_list_like", "(", "comps", ")", ":", "raise", "TypeError", "(", "\"only list-like objects are allowed to be passed \"", "f\"to isin(), you passed a [{type(comps).__name__}]...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/algorithms.py#L390-L453
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/nntplib.py
python
_NNTPBase.ihave
(self, message_id, data)
return self._post('IHAVE {0}'.format(message_id), data)
Process an IHAVE command. Arguments: - message_id: message-id of the article - data: file containing the article Returns: - resp: server response if successful Note that if the server refuses the article an exception is raised.
Process an IHAVE command. Arguments: - message_id: message-id of the article - data: file containing the article Returns: - resp: server response if successful Note that if the server refuses the article an exception is raised.
[ "Process", "an", "IHAVE", "command", ".", "Arguments", ":", "-", "message_id", ":", "message", "-", "id", "of", "the", "article", "-", "data", ":", "file", "containing", "the", "article", "Returns", ":", "-", "resp", ":", "server", "response", "if", "suc...
def ihave(self, message_id, data): """Process an IHAVE command. Arguments: - message_id: message-id of the article - data: file containing the article Returns: - resp: server response if successful Note that if the server refuses the article an exception is raised.""" ...
[ "def", "ihave", "(", "self", ",", "message_id", ",", "data", ")", ":", "return", "self", ".", "_post", "(", "'IHAVE {0}'", ".", "format", "(", "message_id", ")", ",", "data", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/nntplib.py#L918-L925
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/gframe.py
python
GFrame.rename
(self, names)
Rename the columns using the 'names' dict. This changes the names of the columns given as the keys and replaces them with the names given as the values. Parameters ---------- names : dict[string, string] Dictionary of [old_name, new_name]
Rename the columns using the 'names' dict. This changes the names of the columns given as the keys and replaces them with the names given as the values.
[ "Rename", "the", "columns", "using", "the", "names", "dict", ".", "This", "changes", "the", "names", "of", "the", "columns", "given", "as", "the", "keys", "and", "replaces", "them", "with", "the", "names", "given", "as", "the", "values", "." ]
def rename(self, names): """ Rename the columns using the 'names' dict. This changes the names of the columns given as the keys and replaces them with the names given as the values. Parameters ---------- names : dict[string, string] Dictionary of [ol...
[ "def", "rename", "(", "self", ",", "names", ")", ":", "if", "(", "type", "(", "names", ")", "is", "not", "dict", ")", ":", "raise", "TypeError", "(", "'names must be a dictionary: oldname -> newname'", ")", "self", ".", "__is_dirty__", "=", "True", "with", ...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/gframe.py#L162-L183
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/examples/matrix_game_example.py
python
_manually_create_game
()
return game
Creates the game manually from the spiel building blocks.
Creates the game manually from the spiel building blocks.
[ "Creates", "the", "game", "manually", "from", "the", "spiel", "building", "blocks", "." ]
def _manually_create_game(): """Creates the game manually from the spiel building blocks.""" game_type = pyspiel.GameType( "matching_pennies", "Matching Pennies", pyspiel.GameType.Dynamics.SIMULTANEOUS, pyspiel.GameType.ChanceMode.DETERMINISTIC, pyspiel.GameType.Information.ONE_SHOT, ...
[ "def", "_manually_create_game", "(", ")", ":", "game_type", "=", "pyspiel", ".", "GameType", "(", "\"matching_pennies\"", ",", "\"Matching Pennies\"", ",", "pyspiel", ".", "GameType", ".", "Dynamics", ".", "SIMULTANEOUS", ",", "pyspiel", ".", "GameType", ".", "C...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/examples/matrix_game_example.py#L30-L56