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
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/sumolib/statistics.py
python
Statistics.toString
(self, precision=2, histStyle=1)
histStyle 0 : not shown 1 : one line 2 : fancy
histStyle 0 : not shown 1 : one line 2 : fancy
[ "histStyle", "0", ":", "not", "shown", "1", ":", "one", "line", "2", ":", "fancy" ]
def toString(self, precision=2, histStyle=1): """histStyle 0 : not shown 1 : one line 2 : fancy """ if len(self.values) > 0: min = '' if self.printMin: min = setPrecision('min %.2f%s, ', precision, self.isArray) % ( ...
[ "def", "toString", "(", "self", ",", "precision", "=", "2", ",", "histStyle", "=", "1", ")", ":", "if", "len", "(", "self", ".", "values", ")", ">", "0", ":", "min", "=", "''", "if", "self", ".", "printMin", ":", "min", "=", "setPrecision", "(", ...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/sumolib/statistics.py#L210-L242
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/asm.py
python
asm_hook
(self, node)
return self.create_compiled_task('asm', node)
Bind the asm extension to the asm task :param node: input file :type node: :py:class:`waflib.Node.Node`
Bind the asm extension to the asm task
[ "Bind", "the", "asm", "extension", "to", "the", "asm", "task" ]
def asm_hook(self, node): """ Bind the asm extension to the asm task :param node: input file :type node: :py:class:`waflib.Node.Node` """ return self.create_compiled_task('asm', node)
[ "def", "asm_hook", "(", "self", ",", "node", ")", ":", "return", "self", ".", "create_compiled_task", "(", "'asm'", ",", "node", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/asm.py#L51-L58
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/proc.py
python
select_mp2_gradient
(name, **kwargs)
Function selecting the algorithm for a MP2 gradient call and directing to specified or best-performance default modules.
Function selecting the algorithm for a MP2 gradient call and directing to specified or best-performance default modules.
[ "Function", "selecting", "the", "algorithm", "for", "a", "MP2", "gradient", "call", "and", "directing", "to", "specified", "or", "best", "-", "performance", "default", "modules", "." ]
def select_mp2_gradient(name, **kwargs): """Function selecting the algorithm for a MP2 gradient call and directing to specified or best-performance default modules. """ reference = core.get_option('SCF', 'REFERENCE') mtd_type = core.get_global_option('MP2_TYPE') module = core.get_global_option(...
[ "def", "select_mp2_gradient", "(", "name", ",", "*", "*", "kwargs", ")", ":", "reference", "=", "core", ".", "get_option", "(", "'SCF'", ",", "'REFERENCE'", ")", "mtd_type", "=", "core", ".", "get_global_option", "(", "'MP2_TYPE'", ")", "module", "=", "cor...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/proc.py#L139-L176
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/regression/decision_tree_regression.py
python
DecisionTreeRegression.__repr__
(self)
return _toolkit_repr_print(self, sections, section_titles, width=30)
Print a string description of the model, when the model name is entered in the terminal.
Print a string description of the model, when the model name is entered in the terminal.
[ "Print", "a", "string", "description", "of", "the", "model", "when", "the", "model", "name", "is", "entered", "in", "the", "terminal", "." ]
def __repr__(self): """ Print a string description of the model, when the model name is entered in the terminal. """ (sections, section_titles) = self._get_summary_struct() return _toolkit_repr_print(self, sections, section_titles, width=30)
[ "def", "__repr__", "(", "self", ")", ":", "(", "sections", ",", "section_titles", ")", "=", "self", ".", "_get_summary_struct", "(", ")", "return", "_toolkit_repr_print", "(", "self", ",", "sections", ",", "section_titles", ",", "width", "=", "30", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/regression/decision_tree_regression.py#L121-L129
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/codecs.py
python
IncrementalDecoder.reset
(self)
Reset the decoder to the initial state.
Reset the decoder to the initial state.
[ "Reset", "the", "decoder", "to", "the", "initial", "state", "." ]
def reset(self): """ Reset the decoder to the initial state. """
[ "def", "reset", "(", "self", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/codecs.py#L276-L279
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py
python
Transform.name
(self)
Name of the transform.
Name of the transform.
[ "Name", "of", "the", "transform", "." ]
def name(self): """Name of the transform.""" raise NotImplementedError()
[ "def", "name", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L116-L118
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/polynomial.py
python
polyfit
(x, y, deg, rcond=None, full=False, w=None)
Least-squares fit of a polynomial to data. Return the coefficients of a polynomial of degree `deg` that is the least squares fit to the data values `y` given at points `x`. If `y` is 1-D the returned coefficients will also be 1-D. If `y` is 2-D multiple fits are done, one for each column of `y`, and th...
Least-squares fit of a polynomial to data.
[ "Least", "-", "squares", "fit", "of", "a", "polynomial", "to", "data", "." ]
def polyfit(x, y, deg, rcond=None, full=False, w=None): """ Least-squares fit of a polynomial to data. Return the coefficients of a polynomial of degree `deg` that is the least squares fit to the data values `y` given at points `x`. If `y` is 1-D the returned coefficients will also be 1-D. If `y` i...
[ "def", "polyfit", "(", "x", ",", "y", ",", "deg", ",", "rcond", "=", "None", ",", "full", "=", "False", ",", "w", "=", "None", ")", ":", "order", "=", "int", "(", "deg", ")", "+", "1", "x", "=", "np", ".", "asarray", "(", "x", ")", "+", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/polynomial.py#L1195-L1388
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/package_index.py
python
PackageIndex.fetch
(self, requirement, tmpdir, force_scan=False, source=False)
return None
Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object.
Obtain a file suitable for fulfilling `requirement`
[ "Obtain", "a", "file", "suitable", "for", "fulfilling", "requirement" ]
def fetch(self, requirement, tmpdir, force_scan=False, source=False): """Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downlo...
[ "def", "fetch", "(", "self", ",", "requirement", ",", "tmpdir", ",", "force_scan", "=", "False", ",", "source", "=", "False", ")", ":", "dist", "=", "self", ".", "fetch_distribution", "(", "requirement", ",", "tmpdir", ",", "force_scan", ",", "source", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/package_index.py#L667-L678
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/node/structure.py
python
StructureNode.GetSkeletonGatherer
(self)
return None
Returns the gatherer for the alternate skeleton that should be used, based on the expressions for selecting skeletons, or None if the skeleton from the English version of the structure should be used.
Returns the gatherer for the alternate skeleton that should be used, based on the expressions for selecting skeletons, or None if the skeleton from the English version of the structure should be used.
[ "Returns", "the", "gatherer", "for", "the", "alternate", "skeleton", "that", "should", "be", "used", "based", "on", "the", "expressions", "for", "selecting", "skeletons", "or", "None", "if", "the", "skeleton", "from", "the", "English", "version", "of", "the", ...
def GetSkeletonGatherer(self): '''Returns the gatherer for the alternate skeleton that should be used, based on the expressions for selecting skeletons, or None if the skeleton from the English version of the structure should be used. ''' for expr in self.skeletons: if self.EvaluateCondition(e...
[ "def", "GetSkeletonGatherer", "(", "self", ")", ":", "for", "expr", "in", "self", ".", "skeletons", ":", "if", "self", ".", "EvaluateCondition", "(", "expr", ")", ":", "return", "self", ".", "skeletons", "[", "expr", "]", "return", "None" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/node/structure.py#L236-L244
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
BaseEstimator._get_predict_ops
(self, features)
Method that builds model graph and returns prediction ops. Args: features: `Tensor` or `dict` of `Tensor` objects. Returns: A `ModelFnOps` object.
Method that builds model graph and returns prediction ops.
[ "Method", "that", "builds", "model", "graph", "and", "returns", "prediction", "ops", "." ]
def _get_predict_ops(self, features): """Method that builds model graph and returns prediction ops. Args: features: `Tensor` or `dict` of `Tensor` objects. Returns: A `ModelFnOps` object. """ pass
[ "def", "_get_predict_ops", "(", "self", ",", "features", ")", ":", "pass" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L772-L781
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py
python
disable
(level)
Disable all logging calls of severity 'level' and below.
Disable all logging calls of severity 'level' and below.
[ "Disable", "all", "logging", "calls", "of", "severity", "level", "and", "below", "." ]
def disable(level): """ Disable all logging calls of severity 'level' and below. """ root.manager.disable = level
[ "def", "disable", "(", "level", ")", ":", "root", ".", "manager", ".", "disable", "=", "level" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py#L1629-L1633
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
python/lbann/util/__init__.py
python
make_iterable
(obj)
Convert to an iterable object. Simply returns `obj` if it is alredy iterable. Otherwise returns a 1-tuple containing `obj`. `str`s are treated as _not_ iterable.
Convert to an iterable object.
[ "Convert", "to", "an", "iterable", "object", "." ]
def make_iterable(obj): """Convert to an iterable object. Simply returns `obj` if it is alredy iterable. Otherwise returns a 1-tuple containing `obj`. `str`s are treated as _not_ iterable. """ if isinstance(obj, collections.abc.Iterable) and not isinstance(obj, str): return obj else: ...
[ "def", "make_iterable", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "collections", ".", "abc", ".", "Iterable", ")", "and", "not", "isinstance", "(", "obj", ",", "str", ")", ":", "return", "obj", "else", ":", "return", "(", "obj", ",",...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/util/__init__.py#L4-L14
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
IKSolver.clear
(self)
return _robotsim.IKSolver_clear(self)
clear(IKSolver self) Clears objectives.
clear(IKSolver self)
[ "clear", "(", "IKSolver", "self", ")" ]
def clear(self): """ clear(IKSolver self) Clears objectives. """ return _robotsim.IKSolver_clear(self)
[ "def", "clear", "(", "self", ")", ":", "return", "_robotsim", ".", "IKSolver_clear", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L6619-L6628
pmneila/PyMCubes
b6ce8cc7a4e86c9b4b1bedea7073f573b6c7b739
mcubes/exporter.py
python
export_obj
(vertices, triangles, filename)
Exports a mesh in the (.obj) format.
Exports a mesh in the (.obj) format.
[ "Exports", "a", "mesh", "in", "the", "(", ".", "obj", ")", "format", "." ]
def export_obj(vertices, triangles, filename): """ Exports a mesh in the (.obj) format. """ with open(filename, 'w') as fh: for v in vertices: fh.write("v {} {} {}\n".format(*v)) for f in triangles: fh.write("f {} {} {}\n".format(*(f + 1...
[ "def", "export_obj", "(", "vertices", ",", "triangles", ",", "filename", ")", ":", "with", "open", "(", "filename", ",", "'w'", ")", "as", "fh", ":", "for", "v", "in", "vertices", ":", "fh", ".", "write", "(", "\"v {} {} {}\\n\"", ".", "format", "(", ...
https://github.com/pmneila/PyMCubes/blob/b6ce8cc7a4e86c9b4b1bedea7073f573b6c7b739/mcubes/exporter.py#L5-L16
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/mailbox.py
python
MaildirMessage._explain_to
(self, message)
Copy Maildir-specific state to message insofar as possible.
Copy Maildir-specific state to message insofar as possible.
[ "Copy", "Maildir", "-", "specific", "state", "to", "message", "insofar", "as", "possible", "." ]
def _explain_to(self, message): """Copy Maildir-specific state to message insofar as possible.""" if isinstance(message, MaildirMessage): message.set_flags(self.get_flags()) message.set_subdir(self.get_subdir()) message.set_date(self.get_date()) elif isinstanc...
[ "def", "_explain_to", "(", "self", ",", "message", ")", ":", "if", "isinstance", "(", "message", ",", "MaildirMessage", ")", ":", "message", ".", "set_flags", "(", "self", ".", "get_flags", "(", ")", ")", "message", ".", "set_subdir", "(", "self", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L1591-L1632
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
third_party/cpplint.py
python
ReverseCloseExpression
(clean_lines, linenum, pos)
return (line, 0, -1)
If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
If input points to ) or } or ] or >, finds the position that opens it.
[ "If", "input", "points", "to", ")", "or", "}", "or", "]", "or", ">", "finds", "the", "position", "that", "opens", "it", "." ]
def ReverseCloseExpression(clean_lines, linenum, pos): """If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance ...
[ "def", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "line", "[", "pos", "]", "not", "in", "')}]>'", ":", "return", "(", "line", ",", "0", ",", ...
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L1716-L1751
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/story/story.py
python
Story.is_local
(self)
return self._is_local
Returns True iff this story does not require network.
Returns True iff this story does not require network.
[ "Returns", "True", "iff", "this", "story", "does", "not", "require", "network", "." ]
def is_local(self): """Returns True iff this story does not require network.""" return self._is_local
[ "def", "is_local", "(", "self", ")", ":", "return", "self", ".", "_is_local" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/story/story.py#L118-L120
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/_constexpr_utils.py
python
raise_index_error
(msg)
Constexpr for raise_index_error.
Constexpr for raise_index_error.
[ "Constexpr", "for", "raise_index_error", "." ]
def raise_index_error(msg): """Constexpr for raise_index_error.""" raise IndexError(msg)
[ "def", "raise_index_error", "(", "msg", ")", ":", "raise", "IndexError", "(", "msg", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/_constexpr_utils.py#L58-L60
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/decomposition/_lda.py
python
LatentDirichletAllocation._check_non_neg_array
(self, X, whom)
return X
check X format check X format and make sure no negative value in X. Parameters ---------- X : array-like or sparse matrix
check X format
[ "check", "X", "format" ]
def _check_non_neg_array(self, X, whom): """check X format check X format and make sure no negative value in X. Parameters ---------- X : array-like or sparse matrix """ X = check_array(X, accept_sparse='csr') check_non_negative(X, whom) return...
[ "def", "_check_non_neg_array", "(", "self", ",", "X", ",", "whom", ")", ":", "X", "=", "check_array", "(", "X", ",", "accept_sparse", "=", "'csr'", ")", "check_non_negative", "(", "X", ",", "whom", ")", "return", "X" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/decomposition/_lda.py#L472-L484
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/caffe-mnc/scripts/cpp_lint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/scripts/cpp_lint.py#L2369-L2381
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/utils/lui/lldbutil.py
python
get_function_names
(thread)
return [GetFuncName(i) for i in range(thread.GetNumFrames())]
Returns a sequence of function names from the stack frames of this thread.
Returns a sequence of function names from the stack frames of this thread.
[ "Returns", "a", "sequence", "of", "function", "names", "from", "the", "stack", "frames", "of", "this", "thread", "." ]
def get_function_names(thread): """ Returns a sequence of function names from the stack frames of this thread. """ def GetFuncName(i): return thread.GetFrameAtIndex(i).GetFunctionName() return [GetFuncName(i) for i in range(thread.GetNumFrames())]
[ "def", "get_function_names", "(", "thread", ")", ":", "def", "GetFuncName", "(", "i", ")", ":", "return", "thread", ".", "GetFrameAtIndex", "(", "i", ")", ".", "GetFunctionName", "(", ")", "return", "[", "GetFuncName", "(", "i", ")", "for", "i", "in", ...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/utils/lui/lldbutil.py#L704-L711
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftobjects/pathtwistedarray.py
python
PathTwistedArray.linkSetup
(self, obj)
Set up the object as a link object.
Set up the object as a link object.
[ "Set", "up", "the", "object", "as", "a", "link", "object", "." ]
def linkSetup(self, obj): """Set up the object as a link object.""" super(PathTwistedArray, self).linkSetup(obj) obj.configLinkProperty(ElementCount='Count')
[ "def", "linkSetup", "(", "self", ",", "obj", ")", ":", "super", "(", "PathTwistedArray", ",", "self", ")", ".", "linkSetup", "(", "obj", ")", "obj", ".", "configLinkProperty", "(", "ElementCount", "=", "'Count'", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/pathtwistedarray.py#L118-L121
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/evergreen_gen_build_variant.py
python
GenerateBuildVariantOrchestrator.generate_build_variant
(self, builder: EvgConfigBuilder, build_variant_name: str)
return builder
Generate task configuration for a build variant. :param builder: Evergreen configuration builder to use. :param build_variant_name: Name of build variant to generate. :return: Evergreen configuration builder with build variant configuration.
Generate task configuration for a build variant.
[ "Generate", "task", "configuration", "for", "a", "build", "variant", "." ]
def generate_build_variant(self, builder: EvgConfigBuilder, build_variant_name: str) -> EvgConfigBuilder: """ Generate task configuration for a build variant. :param builder: Evergreen configuration builder to use. :param build_variant_name: Name of build ...
[ "def", "generate_build_variant", "(", "self", ",", "builder", ":", "EvgConfigBuilder", ",", "build_variant_name", ":", "str", ")", "->", "EvgConfigBuilder", ":", "LOGGER", ".", "info", "(", "\"Generating config\"", ",", "build_variant", "=", "build_variant_name", ")...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/evergreen_gen_build_variant.py#L284-L325
ros-planning/moveit2
dd240ef6fd8b9932a7a53964140f2952786187a9
moveit_commander/src/moveit_commander/move_group.py
python
MoveGroupCommander.place
(self, object_name, location=None, plan_only=False)
return result
Place the named object at a particular location in the environment or somewhere safe in the world if location is not provided
Place the named object at a particular location in the environment or somewhere safe in the world if location is not provided
[ "Place", "the", "named", "object", "at", "a", "particular", "location", "in", "the", "environment", "or", "somewhere", "safe", "in", "the", "world", "if", "location", "is", "not", "provided" ]
def place(self, object_name, location=None, plan_only=False): """Place the named object at a particular location in the environment or somewhere safe in the world if location is not provided""" result = False if not location: result = self._g.place(object_name, plan_only) eli...
[ "def", "place", "(", "self", ",", "object_name", ",", "location", "=", "None", ",", "plan_only", "=", "False", ")", ":", "result", "=", "False", "if", "not", "location", ":", "result", "=", "self", ".", "_g", ".", "place", "(", "object_name", ",", "p...
https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L708-L750
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/backend.py
python
shape
(x)
return array_ops.shape(x)
Returns the symbolic shape of a tensor or variable. Arguments: x: A tensor or variable. Returns: A symbolic shape (which is itself a tensor). Examples: ``` # TensorFlow example >>> from keras import backend as K >>> tf_session = K.get_session() >>> val = np.array([[1, 2], ...
Returns the symbolic shape of a tensor or variable.
[ "Returns", "the", "symbolic", "shape", "of", "a", "tensor", "or", "variable", "." ]
def shape(x): """Returns the symbolic shape of a tensor or variable. Arguments: x: A tensor or variable. Returns: A symbolic shape (which is itself a tensor). Examples: ``` # TensorFlow example >>> from keras import backend as K >>> tf_session = K.get_session() >>> val =...
[ "def", "shape", "(", "x", ")", ":", "return", "array_ops", ".", "shape", "(", "x", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L602-L630
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/message.py
python
Message.ByteSize
(self)
Returns the serialized size of this message. Recursively calls ByteSize() on all contained messages.
Returns the serialized size of this message. Recursively calls ByteSize() on all contained messages.
[ "Returns", "the", "serialized", "size", "of", "this", "message", ".", "Recursively", "calls", "ByteSize", "()", "on", "all", "contained", "messages", "." ]
def ByteSize(self): """Returns the serialized size of this message. Recursively calls ByteSize() on all contained messages. """ raise NotImplementedError
[ "def", "ByteSize", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/message.py#L246-L250
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
configs/example/arm/starter_se.py
python
create
(args)
return system
Create and configure the system object.
Create and configure the system object.
[ "Create", "and", "configure", "the", "system", "object", "." ]
def create(args): ''' Create and configure the system object. ''' system = SimpleSeSystem(args) # Tell components about the expected physical memory ranges. This # is, for example, used by the MemConfig helper to determine where # to map DRAMs in the physical address space. system.mem_ranges =...
[ "def", "create", "(", "args", ")", ":", "system", "=", "SimpleSeSystem", "(", "args", ")", "# Tell components about the expected physical memory ranges. This", "# is, for example, used by the MemConfig helper to determine where", "# to map DRAMs in the physical address space.", "system...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/example/arm/starter_se.py#L149-L176
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py
python
StateSpaceModel.get_prior_mean
(self)
Constructs a Variable-parameterized prior mean. Models should wrap any variables defined here in the model's variable scope. Returns: A one-dimensional floating point Tensor with shape [state dimension] indicating the prior mean.
Constructs a Variable-parameterized prior mean.
[ "Constructs", "a", "Variable", "-", "parameterized", "prior", "mean", "." ]
def get_prior_mean(self): """Constructs a Variable-parameterized prior mean. Models should wrap any variables defined here in the model's variable scope. Returns: A one-dimensional floating point Tensor with shape [state dimension] indicating the prior mean. """ with variable_scope.var...
[ "def", "get_prior_mean", "(", "self", ")", ":", "with", "variable_scope", ".", "variable_scope", "(", "self", ".", "_variable_scope", ")", ":", "state_transition", "=", "ops", ".", "convert_to_tensor", "(", "self", ".", "get_state_transition", "(", ")", ",", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py#L735-L752
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/sNMR/mrs.py
python
MRS.simulate
(model, K, z, t)
return fop.response(model)
Do synthetic modelling.
Do synthetic modelling.
[ "Do", "synthetic", "modelling", "." ]
def simulate(model, K, z, t): """Do synthetic modelling.""" nlay = int(len(model) / 3) + 1 fop = MRS.createFOP(nlay, K, z, t) return fop.response(model)
[ "def", "simulate", "(", "model", ",", "K", ",", "z", ",", "t", ")", ":", "nlay", "=", "int", "(", "len", "(", "model", ")", "/", "3", ")", "+", "1", "fop", "=", "MRS", ".", "createFOP", "(", "nlay", ",", "K", ",", "z", ",", "t", ")", "ret...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/sNMR/mrs.py#L414-L418
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/third_party/jinja2/sandbox.py
python
is_internal_attribute
(obj, attr)
return attr.startswith('__')
Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden. >>> from jinja2.sandbox import is_internal_att...
Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.
[ "Test", "if", "the", "attribute", "given", "is", "an", "internal", "python", "attribute", ".", "For", "example", "this", "function", "returns", "True", "for", "the", "func_code", "attribute", "of", "python", "objects", ".", "This", "is", "useful", "if", "the...
def is_internal_attribute(obj, attr): """Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden. >...
[ "def", "is_internal_attribute", "(", "obj", ",", "attr", ")", ":", "if", "isinstance", "(", "obj", ",", "types", ".", "FunctionType", ")", ":", "if", "attr", "in", "UNSAFE_FUNCTION_ATTRIBUTES", ":", "return", "True", "elif", "isinstance", "(", "obj", ",", ...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/sandbox.py#L121-L148
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/bindings/python/clang/cindex.py
python
Cursor.type
(self)
return self._type
Retrieve the Type (if any) of the entity pointed at by the cursor.
Retrieve the Type (if any) of the entity pointed at by the cursor.
[ "Retrieve", "the", "Type", "(", "if", "any", ")", "of", "the", "entity", "pointed", "at", "by", "the", "cursor", "." ]
def type(self): """ Retrieve the Type (if any) of the entity pointed at by the cursor. """ if not hasattr(self, '_type'): self._type = conf.lib.clang_getCursorType(self) return self._type
[ "def", "type", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_type'", ")", ":", "self", ".", "_type", "=", "conf", ".", "lib", ".", "clang_getCursorType", "(", "self", ")", "return", "self", ".", "_type" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L1644-L1651
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/html5lib-python/html5lib/inputstream.py
python
codecName
(encoding)
Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.
Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.
[ "Return", "the", "python", "codec", "name", "corresponding", "to", "an", "encoding", "or", "None", "if", "the", "string", "doesn", "t", "correspond", "to", "a", "valid", "encoding", "." ]
def codecName(encoding): """Return the python codec name corresponding to an encoding or None if the string doesn't correspond to a valid encoding.""" if isinstance(encoding, bytes): try: encoding = encoding.decode("ascii") except UnicodeDecodeError: return None i...
[ "def", "codecName", "(", "encoding", ")", ":", "if", "isinstance", "(", "encoding", ",", "bytes", ")", ":", "try", ":", "encoding", "=", "encoding", ".", "decode", "(", "\"ascii\"", ")", "except", "UnicodeDecodeError", ":", "return", "None", "if", "encodin...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/html5lib-python/html5lib/inputstream.py#L891-L903
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py
python
Context._set_ocsp_callback
(self, helper, data)
This internal helper does the common work for ``set_ocsp_server_callback`` and ``set_ocsp_client_callback``, which is almost all of it.
This internal helper does the common work for ``set_ocsp_server_callback`` and ``set_ocsp_client_callback``, which is almost all of it.
[ "This", "internal", "helper", "does", "the", "common", "work", "for", "set_ocsp_server_callback", "and", "set_ocsp_client_callback", "which", "is", "almost", "all", "of", "it", "." ]
def _set_ocsp_callback(self, helper, data): """ This internal helper does the common work for ``set_ocsp_server_callback`` and ``set_ocsp_client_callback``, which is almost all of it. """ self._ocsp_helper = helper self._ocsp_callback = helper.callback if ...
[ "def", "_set_ocsp_callback", "(", "self", ",", "helper", ",", "data", ")", ":", "self", ".", "_ocsp_helper", "=", "helper", "self", ".", "_ocsp_callback", "=", "helper", ".", "callback", "if", "data", "is", "None", ":", "self", ".", "_ocsp_data", "=", "_...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L1502-L1520
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
PopupTransientWindow.Dismiss
(*args, **kwargs)
return _windows_.PopupTransientWindow_Dismiss(*args, **kwargs)
Dismiss(self)
Dismiss(self)
[ "Dismiss", "(", "self", ")" ]
def Dismiss(*args, **kwargs): """Dismiss(self)""" return _windows_.PopupTransientWindow_Dismiss(*args, **kwargs)
[ "def", "Dismiss", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PopupTransientWindow_Dismiss", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2152-L2154
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/manifests.py
python
InstallManifest.populate_registry
(self, registry)
Populate a mozpack.copier.FileRegistry instance with data from us. The caller supplied a FileRegistry instance (or at least something that conforms to its interface) and that instance is populated with data from this manifest.
Populate a mozpack.copier.FileRegistry instance with data from us.
[ "Populate", "a", "mozpack", ".", "copier", ".", "FileRegistry", "instance", "with", "data", "from", "us", "." ]
def populate_registry(self, registry): """Populate a mozpack.copier.FileRegistry instance with data from us. The caller supplied a FileRegistry instance (or at least something that conforms to its interface) and that instance is populated with data from this manifest. """ ...
[ "def", "populate_registry", "(", "self", ",", "registry", ")", ":", "for", "dest", "in", "sorted", "(", "self", ".", "_dests", ")", ":", "entry", "=", "self", ".", "_dests", "[", "dest", "]", "install_type", "=", "entry", "[", "0", "]", "if", "instal...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/manifests.py#L299-L352
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.GetAdditionalCaretForeground
(*args, **kwargs)
return _stc.StyledTextCtrl_GetAdditionalCaretForeground(*args, **kwargs)
GetAdditionalCaretForeground(self) -> Colour Get the foreground colour of additional carets.
GetAdditionalCaretForeground(self) -> Colour
[ "GetAdditionalCaretForeground", "(", "self", ")", "-", ">", "Colour" ]
def GetAdditionalCaretForeground(*args, **kwargs): """ GetAdditionalCaretForeground(self) -> Colour Get the foreground colour of additional carets. """ return _stc.StyledTextCtrl_GetAdditionalCaretForeground(*args, **kwargs)
[ "def", "GetAdditionalCaretForeground", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetAdditionalCaretForeground", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6309-L6315
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert-gpu/run_squad.py
python
validate_flags_or_throw
(bert_config)
Validate the input FLAGS or throw an exception.
Validate the input FLAGS or throw an exception.
[ "Validate", "the", "input", "FLAGS", "or", "throw", "an", "exception", "." ]
def validate_flags_or_throw(bert_config): """Validate the input FLAGS or throw an exception.""" tokenization.validate_case_matches_checkpoint(FLAGS.do_lower_case, FLAGS.init_checkpoint) if not FLAGS.do_train and not FLAGS.do_predict and not FLAGS.export_trtis: ...
[ "def", "validate_flags_or_throw", "(", "bert_config", ")", ":", "tokenization", ".", "validate_case_matches_checkpoint", "(", "FLAGS", ".", "do_lower_case", ",", "FLAGS", ".", "init_checkpoint", ")", "if", "not", "FLAGS", ".", "do_train", "and", "not", "FLAGS", "....
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/run_squad.py#L739-L765
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/cpu/BaseCPU.py
python
BaseCPU.support_take_over
(cls)
return False
Does the CPU model support CPU takeOverFrom?
Does the CPU model support CPU takeOverFrom?
[ "Does", "the", "CPU", "model", "support", "CPU", "takeOverFrom?" ]
def support_take_over(cls): """Does the CPU model support CPU takeOverFrom?""" return False
[ "def", "support_take_over", "(", "cls", ")", ":", "return", "False" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/cpu/BaseCPU.py#L125-L127
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py
python
PopenSpawn.wait
(self)
return status
Wait for the subprocess to finish. Returns the exit code.
Wait for the subprocess to finish.
[ "Wait", "for", "the", "subprocess", "to", "finish", "." ]
def wait(self): '''Wait for the subprocess to finish. Returns the exit code. ''' status = self.proc.wait() if status >= 0: self.exitstatus = status self.signalstatus = None else: self.exitstatus = None self.signalstatus = -...
[ "def", "wait", "(", "self", ")", ":", "status", "=", "self", ".", "proc", ".", "wait", "(", ")", "if", "status", ">=", "0", ":", "self", ".", "exitstatus", "=", "status", "self", ".", "signalstatus", "=", "None", "else", ":", "self", ".", "exitstat...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py#L156-L169
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/msvc.py
python
SystemInfo.NetFxSdkVersion
(self)
return (('4.7.2', '4.7.1', '4.7', '4.6.2', '4.6.1', '4.6', '4.5.2', '4.5.1', '4.5') if self.vs_ver >= 14.0 else ())
Microsoft .NET Framework SDK versions. Return ------ tuple of str versions
Microsoft .NET Framework SDK versions.
[ "Microsoft", ".", "NET", "Framework", "SDK", "versions", "." ]
def NetFxSdkVersion(self): """ Microsoft .NET Framework SDK versions. Return ------ tuple of str versions """ # Set FxSdk versions for specified VS version return (('4.7.2', '4.7.1', '4.7', '4.6.2', '4.6.1', '4.6', ...
[ "def", "NetFxSdkVersion", "(", "self", ")", ":", "# Set FxSdk versions for specified VS version", "return", "(", "(", "'4.7.2'", ",", "'4.7.1'", ",", "'4.7'", ",", "'4.6.2'", ",", "'4.6.1'", ",", "'4.6'", ",", "'4.5.2'", ",", "'4.5.1'", ",", "'4.5'", ")", "if"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/msvc.py#L1051-L1064
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py
python
read_bytes8
(f)
r""" >>> import io, struct, sys >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc")) b'' >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef")) b'abc' >>> bigsize8 = struct.pack("<Q", sys.maxsize//3) >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef")) #doctest: ...
r""" >>> import io, struct, sys >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc")) b'' >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef")) b'abc' >>> bigsize8 = struct.pack("<Q", sys.maxsize//3) >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef")) #doctest: ...
[ "r", ">>>", "import", "io", "struct", "sys", ">>>", "read_bytes8", "(", "io", ".", "BytesIO", "(", "b", "\\", "x00", "\\", "x00", "\\", "x00", "\\", "x00", "\\", "x00", "\\", "x00", "\\", "x00", "\\", "x00abc", "))", "b", ">>>", "read_bytes8", "(",...
def read_bytes8(f): r""" >>> import io, struct, sys >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc")) b'' >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef")) b'abc' >>> bigsize8 = struct.pack("<Q", sys.maxsize//3) >>> read_bytes8(io.BytesIO(bigsize8 +...
[ "def", "read_bytes8", "(", "f", ")", ":", "n", "=", "read_uint8", "(", "f", ")", "assert", "n", ">=", "0", "if", "n", ">", "sys", ".", "maxsize", ":", "raise", "ValueError", "(", "\"bytes8 byte count > sys.maxsize: %d\"", "%", "n", ")", "data", "=", "f...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py#L534-L556
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/data.py
python
CoverageData.line_data
(self)
return dict( [(f, self.sorted(lmap.keys())) for f, lmap in self.lines.items()] )
Return the map from filenames to lists of line numbers executed.
Return the map from filenames to lists of line numbers executed.
[ "Return", "the", "map", "from", "filenames", "to", "lists", "of", "line", "numbers", "executed", "." ]
def line_data(self): """Return the map from filenames to lists of line numbers executed.""" return dict( [(f, self.sorted(lmap.keys())) for f, lmap in self.lines.items()] )
[ "def", "line_data", "(", "self", ")", ":", "return", "dict", "(", "[", "(", "f", ",", "self", ".", "sorted", "(", "lmap", ".", "keys", "(", ")", ")", ")", "for", "f", ",", "lmap", "in", "self", ".", "lines", ".", "items", "(", ")", "]", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/data.py#L101-L105
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/json_schema_compiler/h_generator.py
python
HGenerator._GenerateFields
(self, props)
return c
Generates the field declarations when declaring a type.
Generates the field declarations when declaring a type.
[ "Generates", "the", "field", "declarations", "when", "declaring", "a", "type", "." ]
def _GenerateFields(self, props): """Generates the field declarations when declaring a type. """ c = Code() # Generate the enums needed for any fields with "choices" for prop in props: if prop.type_ == PropertyType.CHOICES: enum_name = self._cpp_type_generator.GetChoicesEnumType(prop) ...
[ "def", "_GenerateFields", "(", "self", ",", "props", ")", ":", "c", "=", "Code", "(", ")", "# Generate the enums needed for any fields with \"choices\"", "for", "prop", "in", "props", ":", "if", "prop", ".", "type_", "==", "PropertyType", ".", "CHOICES", ":", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/json_schema_compiler/h_generator.py#L137-L154
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/serial/rfc2217.py
python
Serial.read
(self, size=1)
return bytes(data)
\ Read size bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read.
\ Read size bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read.
[ "\\", "Read", "size", "bytes", "from", "the", "serial", "port", ".", "If", "a", "timeout", "is", "set", "it", "may", "return", "less", "characters", "as", "requested", ".", "With", "no", "timeout", "it", "will", "block", "until", "the", "requested", "num...
def read(self, size=1): """\ Read size bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read. """ if not self.is_open: raise portNotOpenError ...
[ "def", "read", "(", "self", ",", "size", "=", "1", ")", ":", "if", "not", "self", ".", "is_open", ":", "raise", "portNotOpenError", "data", "=", "bytearray", "(", ")", "try", ":", "timeout", "=", "Timeout", "(", "self", ".", "_timeout", ")", "while",...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/rfc2217.py#L602-L621
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.ComputeDeps
(self, spec)
return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps))
Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps).
Compute the dependencies of a gyp spec.
[ "Compute", "the", "dependencies", "of", "a", "gyp", "spec", "." ]
def ComputeDeps(self, spec): """Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps). """ deps = [] link_deps = [] if 'dependencies' in spe...
[ "def", "ComputeDeps", "(", "self", ",", "spec", ")", ":", "deps", "=", "[", "]", "link_deps", "=", "[", "]", "if", "'dependencies'", "in", "spec", ":", "deps", ".", "extend", "(", "[", "target_outputs", "[", "dep", "]", "for", "dep", "in", "spec", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/android.py#L761-L777
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
TranslationUnit.from_ast_file
(cls, filename, index=None)
return cls(ptr=ptr, index=index)
Create a TranslationUnit instance from a saved AST file. A previously-saved AST file (provided with -emit-ast or TranslationUnit.save()) is loaded from the filename specified. If the file cannot be loaded, a TranslationUnitLoadError will be raised. index is optional and is the...
Create a TranslationUnit instance from a saved AST file.
[ "Create", "a", "TranslationUnit", "instance", "from", "a", "saved", "AST", "file", "." ]
def from_ast_file(cls, filename, index=None): """Create a TranslationUnit instance from a saved AST file. A previously-saved AST file (provided with -emit-ast or TranslationUnit.save()) is loaded from the filename specified. If the file cannot be loaded, a TranslationUnitLoadError will...
[ "def", "from_ast_file", "(", "cls", ",", "filename", ",", "index", "=", "None", ")", ":", "if", "index", "is", "None", ":", "index", "=", "Index", ".", "create", "(", ")", "ptr", "=", "conf", ".", "lib", ".", "clang_createTranslationUnit", "(", "index"...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L2842-L2863
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
HLTriggerOffline/Egamma/python/EgammaHLTValidationUtils.py
python
EgammaDQMModuleMaker.makePSetForL1SeedFilter
(self,moduleName)
return cms.PSet( PlotBounds = cms.vdouble(0.0, 0.0), HLTCollectionLabels = cms.InputTag(moduleName,"",self.processName), IsoCollections = cms.VInputTag(cms.InputTag("none")), theHLTOutputTypes = cms.int32(TriggerTypeDefs_cfi.TriggerL1NoIsoEG) )
generates a PSet to analyze the behaviour of an L1 seed. moduleName is the name of the HLT module which filters on the L1 seed.
generates a PSet to analyze the behaviour of an L1 seed.
[ "generates", "a", "PSet", "to", "analyze", "the", "behaviour", "of", "an", "L1", "seed", "." ]
def makePSetForL1SeedFilter(self,moduleName): """ generates a PSet to analyze the behaviour of an L1 seed. moduleName is the name of the HLT module which filters on the L1 seed. """ return cms.PSet( PlotBounds = cms.vdouble(0.0, 0.0), HLTCollecti...
[ "def", "makePSetForL1SeedFilter", "(", "self", ",", "moduleName", ")", ":", "return", "cms", ".", "PSet", "(", "PlotBounds", "=", "cms", ".", "vdouble", "(", "0.0", ",", "0.0", ")", ",", "HLTCollectionLabels", "=", "cms", ".", "InputTag", "(", "moduleName"...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/HLTriggerOffline/Egamma/python/EgammaHLTValidationUtils.py#L331-L343
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/lib2to3/refactor.py
python
_get_head_types
(pat)
Accepts a pytree Pattern Node and returns a set of the pattern types which will match first.
Accepts a pytree Pattern Node and returns a set of the pattern types which will match first.
[ "Accepts", "a", "pytree", "Pattern", "Node", "and", "returns", "a", "set", "of", "the", "pattern", "types", "which", "will", "match", "first", "." ]
def _get_head_types(pat): """ Accepts a pytree Pattern Node and returns a set of the pattern types which will match first. """ if isinstance(pat, (pytree.NodePattern, pytree.LeafPattern)): # NodePatters must either have no type and no content # or a type and content -- so they don't g...
[ "def", "_get_head_types", "(", "pat", ")", ":", "if", "isinstance", "(", "pat", ",", "(", "pytree", ".", "NodePattern", ",", "pytree", ".", "LeafPattern", ")", ")", ":", "# NodePatters must either have no type and no content", "# or a type and content -- so they don't...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/refactor.py#L45-L70
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/session_bundle/exporter.py
python
regression_signature
(input_tensor, output_tensor)
return signature
Creates a regression signature. Args: input_tensor: Tensor specifying the input to a graph. output_tensor: Tensor specifying the output of a graph. Returns: A Signature message.
Creates a regression signature.
[ "Creates", "a", "regression", "signature", "." ]
def regression_signature(input_tensor, output_tensor): """Creates a regression signature. Args: input_tensor: Tensor specifying the input to a graph. output_tensor: Tensor specifying the output of a graph. Returns: A Signature message. """ signature = manifest_pb2.Signature() signature.regress...
[ "def", "regression_signature", "(", "input_tensor", ",", "output_tensor", ")", ":", "signature", "=", "manifest_pb2", ".", "Signature", "(", ")", "signature", ".", "regression_signature", ".", "input", ".", "tensor_name", "=", "input_tensor", ".", "name", "signatu...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/session_bundle/exporter.py#L72-L85
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py
python
MakeDeclarationStringWithContext
(ctx_macro_prefix, params)
Same as MakeDeclarationString, but adds a context macro
Same as MakeDeclarationString, but adds a context macro
[ "Same", "as", "MakeDeclarationString", "but", "adds", "a", "context", "macro" ]
def MakeDeclarationStringWithContext(ctx_macro_prefix, params): """Same as MakeDeclarationString, but adds a context macro """ n = len(params) if n == 0: return ctx_macro_prefix + '_ARGSINGLEDECL' else: result = MakeDeclarationString(params) return ctx_macro_prefix + '_ARGDECL ' + result
[ "def", "MakeDeclarationStringWithContext", "(", "ctx_macro_prefix", ",", "params", ")", ":", "n", "=", "len", "(", "params", ")", "if", "n", "==", "0", ":", "return", "ctx_macro_prefix", "+", "'_ARGSINGLEDECL'", "else", ":", "result", "=", "MakeDeclarationString...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py#L629-L638
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftgeoutils/circles.py
python
findHomotheticCenterOfCircles
(circle1, circle2)
Calculate the homothetic centers from two circles. Return None if the objects are not circles, or if they are concentric. http://en.wikipedia.org/wiki/Homothetic_center http://mathworld.wolfram.com/HomotheticCenter.html
Calculate the homothetic centers from two circles.
[ "Calculate", "the", "homothetic", "centers", "from", "two", "circles", "." ]
def findHomotheticCenterOfCircles(circle1, circle2): """Calculate the homothetic centers from two circles. Return None if the objects are not circles, or if they are concentric. http://en.wikipedia.org/wiki/Homothetic_center http://mathworld.wolfram.com/HomotheticCenter.html """ if (geomType(c...
[ "def", "findHomotheticCenterOfCircles", "(", "circle1", ",", "circle2", ")", ":", "if", "(", "geomType", "(", "circle1", ")", "==", "\"Circle\"", "and", "geomType", "(", "circle2", ")", "==", "\"Circle\"", ")", ":", "print", "(", "\"debug: findHomotheticCenterOf...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftgeoutils/circles.py#L341-L398
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/stats.py
python
trim1
(a, proportiontocut, tail='right', axis=0)
return atmp[lowercut:uppercut]
Slices off a proportion from ONE end of the passed array distribution. If `proportiontocut` = 0.1, slices off 'leftmost' or 'rightmost' 10% of scores. The lowest or highest values are trimmed (depending on the tail). Slices off less if proportion results in a non-integer slice index (i.e., conserva...
Slices off a proportion from ONE end of the passed array distribution.
[ "Slices", "off", "a", "proportion", "from", "ONE", "end", "of", "the", "passed", "array", "distribution", "." ]
def trim1(a, proportiontocut, tail='right', axis=0): """ Slices off a proportion from ONE end of the passed array distribution. If `proportiontocut` = 0.1, slices off 'leftmost' or 'rightmost' 10% of scores. The lowest or highest values are trimmed (depending on the tail). Slices off less if pr...
[ "def", "trim1", "(", "a", ",", "proportiontocut", ",", "tail", "=", "'right'", ",", "axis", "=", "0", ")", ":", "a", "=", "np", ".", "asarray", "(", "a", ")", "if", "axis", "is", "None", ":", "a", "=", "a", ".", "ravel", "(", ")", "axis", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/stats.py#L2739-L2789
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/debug_data.py
python
DebugDumpDir.node_op_type
(self, node_name, device_name=None)
return self._debug_graphs[device_name].node_op_types[node_name]
Get the op type of given node. Args: node_name: (`str`) name of the node. device_name: (`str`) name of the device. If there is only one device or if node_name exists on only one device, this argument is optional. Returns: (`str`) op type of the node. Raises: LookupError: I...
Get the op type of given node.
[ "Get", "the", "op", "type", "of", "given", "node", "." ]
def node_op_type(self, node_name, device_name=None): """Get the op type of given node. Args: node_name: (`str`) name of the node. device_name: (`str`) name of the device. If there is only one device or if node_name exists on only one device, this argument is optional. Returns: (`...
[ "def", "node_op_type", "(", "self", ",", "node_name", ",", "device_name", "=", "None", ")", ":", "if", "not", "self", ".", "_debug_graphs", ":", "raise", "LookupError", "(", "\"Node op types are not loaded from partition graphs yet.\"", ")", "device_name", "=", "sel...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/debug_data.py#L1322-L1342
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py
python
register
(name, klass, instance=None, *, preferred=False)
Register a browser connector.
Register a browser connector.
[ "Register", "a", "browser", "connector", "." ]
def register(name, klass, instance=None, *, preferred=False): """Register a browser connector.""" with _lock: if _tryorder is None: register_standard_browsers() _browsers[name.lower()] = [klass, instance] # Preferred browsers go to the front of the list. # Need to ma...
[ "def", "register", "(", "name", ",", "klass", ",", "instance", "=", "None", ",", "*", ",", "preferred", "=", "False", ")", ":", "with", "_lock", ":", "if", "_tryorder", "is", "None", ":", "register_standard_browsers", "(", ")", "_browsers", "[", "name", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py#L22-L35
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/npyio.py
python
genfromtxt
(fname, dtype=float, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=''.join(sorted(NameValidator.defaultdeletechars)), ...
return output
Load data from a text file, with missing values handled as specified. Each line past the first `skip_header` lines is split at the `delimiter` character, and characters following the `comments` character are discarded. Parameters ---------- fname : file, str, pathlib.Path, list of str, generator ...
Load data from a text file, with missing values handled as specified.
[ "Load", "data", "from", "a", "text", "file", "with", "missing", "values", "handled", "as", "specified", "." ]
def genfromtxt(fname, dtype=float, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=''.join(sorted(NameValidator.defaultdeletechars)),...
[ "def", "genfromtxt", "(", "fname", ",", "dtype", "=", "float", ",", "comments", "=", "'#'", ",", "delimiter", "=", "None", ",", "skip_header", "=", "0", ",", "skip_footer", "=", "0", ",", "converters", "=", "None", ",", "missing_values", "=", "None", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/npyio.py#L1562-L2284
sirikata/sirikata
3a0d54a8c4778ad6e25ef031d461b2bc3e264860
scripts/util/stdio.py
python
StdIO.__init__
(self, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
Construct a StdIO set. Keyword arguments: stdin -- file-like object to use as stdin stdout -- file-like object to use as stdout stderr -- file-like object to use as stderr
Construct a StdIO set.
[ "Construct", "a", "StdIO", "set", "." ]
def __init__(self, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr): """Construct a StdIO set. Keyword arguments: stdin -- file-like object to use as stdin stdout -- file-like object to use as stdout stderr -- file-like object to use as stderr """ self.std...
[ "def", "__init__", "(", "self", ",", "stdin", "=", "sys", ".", "stdin", ",", "stdout", "=", "sys", ".", "stdout", ",", "stderr", "=", "sys", ".", "stderr", ")", ":", "self", ".", "stdin", "=", "stdin", "self", ".", "stdout", "=", "stdout", "self", ...
https://github.com/sirikata/sirikata/blob/3a0d54a8c4778ad6e25ef031d461b2bc3e264860/scripts/util/stdio.py#L12-L23
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/parser/caffe/parser_caffe.py
python
CaffeParser._InsSplitBtwSliceConcat
(self)
Currently, the connection between Slice and Concat must be implemented via Split.
Currently, the connection between Slice and Concat must be implemented via Split.
[ "Currently", "the", "connection", "between", "Slice", "and", "Concat", "must", "be", "implemented", "via", "Split", "." ]
def _InsSplitBtwSliceConcat(self): ''' Currently, the connection between Slice and Concat must be implemented via Split. ''' layers = self.net_parameter.layer or self.net_parameter.layers top_blobs_of_slices = list() btm_blobs_of_concats = list() for layer in laye...
[ "def", "_InsSplitBtwSliceConcat", "(", "self", ")", ":", "layers", "=", "self", ".", "net_parameter", ".", "layer", "or", "self", ".", "net_parameter", ".", "layers", "top_blobs_of_slices", "=", "list", "(", ")", "btm_blobs_of_concats", "=", "list", "(", ")", ...
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/caffe/parser_caffe.py#L252-L282
eldar/deepcut-cnn
928bf2f224fce132f6e4404b4c95fb017297a5e0
scripts/cpp_lint.py
python
PrintCategories
()
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
Prints a list of all the error-categories used by error messages.
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L4770-L4776
funnyzhou/Adaptive_Feeding
9c78182331d8c0ea28de47226e805776c638d46f
lib/rpn/proposal_target_layer.py
python
_sample_rois
(all_rois, gt_boxes, fg_rois_per_image, rois_per_image, num_classes)
return labels, rois, bbox_targets, bbox_inside_weights
Generate a random sample of RoIs comprising foreground and background examples.
Generate a random sample of RoIs comprising foreground and background examples.
[ "Generate", "a", "random", "sample", "of", "RoIs", "comprising", "foreground", "and", "background", "examples", "." ]
def _sample_rois(all_rois, gt_boxes, fg_rois_per_image, rois_per_image, num_classes): """Generate a random sample of RoIs comprising foreground and background examples. """ # overlaps: (rois x gt_boxes) overlaps = bbox_overlaps( np.ascontiguousarray(all_rois[:, 1:5], dtype=np.float), ...
[ "def", "_sample_rois", "(", "all_rois", ",", "gt_boxes", ",", "fg_rois_per_image", ",", "rois_per_image", ",", "num_classes", ")", ":", "# overlaps: (rois x gt_boxes)", "overlaps", "=", "bbox_overlaps", "(", "np", ".", "ascontiguousarray", "(", "all_rois", "[", ":",...
https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/rpn/proposal_target_layer.py#L165-L215
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/mxnet/io.py
python
DataIter.next
(self)
Get next data batch from iterator. Equivalent to self.iter_next() DataBatch(self.getdata(), self.getlabel(), self.getpad(), None) Returns ------- data : DataBatch The data of next batch.
Get next data batch from iterator. Equivalent to self.iter_next() DataBatch(self.getdata(), self.getlabel(), self.getpad(), None) Returns ------- data : DataBatch The data of next batch.
[ "Get", "next", "data", "batch", "from", "iterator", ".", "Equivalent", "to", "self", ".", "iter_next", "()", "DataBatch", "(", "self", ".", "getdata", "()", "self", ".", "getlabel", "()", "self", ".", "getpad", "()", "None", ")", "Returns", "-------", "d...
def next(self): """Get next data batch from iterator. Equivalent to self.iter_next() DataBatch(self.getdata(), self.getlabel(), self.getpad(), None) Returns ------- data : DataBatch The data of next batch. """ if self.iter_next(): r...
[ "def", "next", "(", "self", ")", ":", "if", "self", ".", "iter_next", "(", ")", ":", "return", "DataBatch", "(", "data", "=", "self", ".", "getdata", "(", ")", ",", "label", "=", "self", ".", "getlabel", "(", ")", ",", "pad", "=", "self", ".", ...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/io.py#L48-L61
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGCell.MergeFrom
(*args, **kwargs)
return _propgrid.PGCell_MergeFrom(*args, **kwargs)
MergeFrom(self, PGCell srcCell)
MergeFrom(self, PGCell srcCell)
[ "MergeFrom", "(", "self", "PGCell", "srcCell", ")" ]
def MergeFrom(*args, **kwargs): """MergeFrom(self, PGCell srcCell)""" return _propgrid.PGCell_MergeFrom(*args, **kwargs)
[ "def", "MergeFrom", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGCell_MergeFrom", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L147-L149
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/build_py.py
python
build_py.exclude_data_files
(self, package, src_dir, files)
return list(_unique_everseen(keepers))
Filter filenames for package's data files in 'src_dir
Filter filenames for package's data files in 'src_dir
[ "Filter", "filenames", "for", "package", "s", "data", "files", "in", "src_dir" ]
def exclude_data_files(self, package, src_dir, files): """Filter filenames for package's data files in 'src_dir'""" files = list(files) patterns = self._get_platform_patterns( self.exclude_package_data, package, src_dir, ) match_groups = ( ...
[ "def", "exclude_data_files", "(", "self", ",", "package", ",", "src_dir", ",", "files", ")", ":", "files", "=", "list", "(", "files", ")", "patterns", "=", "self", ".", "_get_platform_patterns", "(", "self", ".", "exclude_package_data", ",", "package", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/build_py.py#L196-L217
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
build/unix/makepchinput.py
python
removeUnwantedHeaders
(allHeadersContent)
return allHeadersContent
remove unwanted headers, e.g. the ones used for dictionaries but not desirable in the pch
remove unwanted headers, e.g. the ones used for dictionaries but not desirable in the pch
[ "remove", "unwanted", "headers", "e", ".", "g", ".", "the", "ones", "used", "for", "dictionaries", "but", "not", "desirable", "in", "the", "pch" ]
def removeUnwantedHeaders(allHeadersContent): """ remove unwanted headers, e.g. the ones used for dictionaries but not desirable in the pch """ unwantedHeaders = [] deprecatedHeaders = [''] unwantedHeaders.extend(deprecatedHeaders) for unwantedHeader in unwantedHeaders: allHeadersContent = allHe...
[ "def", "removeUnwantedHeaders", "(", "allHeadersContent", ")", ":", "unwantedHeaders", "=", "[", "]", "deprecatedHeaders", "=", "[", "''", "]", "unwantedHeaders", ".", "extend", "(", "deprecatedHeaders", ")", "for", "unwantedHeader", "in", "unwantedHeaders", ":", ...
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/build/unix/makepchinput.py#L425-L433
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L775-L777
cathywu/Sentiment-Analysis
eb501fd1375c0c3f3ab430f963255f1bb858e659
PyML-0.7.9/PyML/evaluators/assess.py
python
loo
(classifier, data, **args)
return looResults
perform Leave One Out :Returns: a results object USAGE: loo(classifier, data)
perform Leave One Out
[ "perform", "Leave", "One", "Out" ]
def loo(classifier, data, **args) : """perform Leave One Out :Returns: a results object USAGE: loo(classifier, data) """ looResults = classifier.resultsObject() args['stats'] = False for i in range(len(data)) : trainingPatterns = misc.setminus(range(len(data)), [i]) ...
[ "def", "loo", "(", "classifier", ",", "data", ",", "*", "*", "args", ")", ":", "looResults", "=", "classifier", ".", "resultsObject", "(", ")", "args", "[", "'stats'", "]", "=", "False", "for", "i", "in", "range", "(", "len", "(", "data", ")", ")",...
https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/evaluators/assess.py#L100-L119
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py
python
IndentStack.infer
(self, line)
return outdent_count
Infer what is now the current margin based on this line. Returns: 1 if we have indented (or this is the first margin) 0 if the margin has not changed -N if we have dedented N times
Infer what is now the current margin based on this line. Returns: 1 if we have indented (or this is the first margin) 0 if the margin has not changed -N if we have dedented N times
[ "Infer", "what", "is", "now", "the", "current", "margin", "based", "on", "this", "line", ".", "Returns", ":", "1", "if", "we", "have", "indented", "(", "or", "this", "is", "the", "first", "margin", ")", "0", "if", "the", "margin", "has", "not", "chan...
def infer(self, line): """ Infer what is now the current margin based on this line. Returns: 1 if we have indented (or this is the first margin) 0 if the margin has not changed -N if we have dedented N times """ indent = self.measure(line) ...
[ "def", "infer", "(", "self", ",", "line", ")", ":", "indent", "=", "self", ".", "measure", "(", "line", ")", "margin", "=", "' '", "*", "indent", "if", "not", "self", ".", "indents", ":", "self", ".", "indents", ".", "append", "(", "indent", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py#L3186-L3216
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/git.py
python
Repository._callgit
(self, cmd, args, raise_exception=False)
return result.returncode
Call git for this repository without capturing output. This is designed to be used when git returns non-zero exit codes.
Call git for this repository without capturing output.
[ "Call", "git", "for", "this", "repository", "without", "capturing", "output", "." ]
def _callgit(self, cmd, args, raise_exception=False): """ Call git for this repository without capturing output. This is designed to be used when git returns non-zero exit codes. """ result = self._run_cmd(cmd, args) if raise_exception: result.check_returncod...
[ "def", "_callgit", "(", "self", ",", "cmd", ",", "args", ",", "raise_exception", "=", "False", ")", ":", "result", "=", "self", ".", "_run_cmd", "(", "cmd", ",", "args", ")", "if", "raise_exception", ":", "result", ".", "check_returncode", "(", ")", "r...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/git.py#L215-L224
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py
python
Connection.accept
(self)
return (conn, addr)
Call the :meth:`accept` method of the underlying socket and set up SSL on the returned socket, using the Context object supplied to this :class:`Connection` object at creation. :return: A *(conn, addr)* pair where *conn* is the new :class:`Connection` object created, and *address* i...
Call the :meth:`accept` method of the underlying socket and set up SSL on the returned socket, using the Context object supplied to this :class:`Connection` object at creation.
[ "Call", "the", ":", "meth", ":", "accept", "method", "of", "the", "underlying", "socket", "and", "set", "up", "SSL", "on", "the", "returned", "socket", "using", "the", "Context", "object", "supplied", "to", "this", ":", "class", ":", "Connection", "object"...
def accept(self): """ Call the :meth:`accept` method of the underlying socket and set up SSL on the returned socket, using the Context object supplied to this :class:`Connection` object at creation. :return: A *(conn, addr)* pair where *conn* is the new :class:`Conne...
[ "def", "accept", "(", "self", ")", ":", "client", ",", "addr", "=", "self", ".", "_socket", ".", "accept", "(", ")", "conn", "=", "Connection", "(", "self", ".", "_context", ",", "client", ")", "conn", ".", "set_accept_state", "(", ")", "return", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L1981-L1994
Cantera/cantera
0119484b261967ccb55a0066c020599cacc312e4
interfaces/cython/cantera/ctml_writer.py
python
XMLnode.__call__
(self)
return self._value
Allows getting the value using the syntax 'node()
Allows getting the value using the syntax 'node()
[ "Allows", "getting", "the", "value", "using", "the", "syntax", "node", "()" ]
def __call__(self): """Allows getting the value using the syntax 'node()'""" return self._value
[ "def", "__call__", "(", "self", ")", ":", "return", "self", ".", "_value" ]
https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml_writer.py#L147-L149
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/tools/docs/parser.py
python
_ClassPageInfo.set_doc
(self, doc)
Sets the `doc` field. Args: doc: An instance of `_DocstringInfo`.
Sets the `doc` field.
[ "Sets", "the", "doc", "field", "." ]
def set_doc(self, doc): """Sets the `doc` field. Args: doc: An instance of `_DocstringInfo`. """ assert self.doc is None self._doc = doc
[ "def", "set_doc", "(", "self", ",", "doc", ")", ":", "assert", "self", ".", "doc", "is", "None", "self", ".", "_doc", "=", "doc" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/docs/parser.py#L936-L943
nlohmann/json
eb2182414749825be086c825edb5229e5c28503d
third_party/cpplint/cpplint.py
python
_ClassifyInclude
(fileinfo, include, used_angle_brackets, include_order="default")
return _OTHER_HEADER
Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. used_angle_brackets: True if the #include used <> rather than "". include_order: "default" or other value allowed in program arguments ...
Figures out what kind of header 'include' is.
[ "Figures", "out", "what", "kind", "of", "header", "include", "is", "." ]
def _ClassifyInclude(fileinfo, include, used_angle_brackets, include_order="default"): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. used_angle_brackets: True if the #include used <>...
[ "def", "_ClassifyInclude", "(", "fileinfo", ",", "include", ",", "used_angle_brackets", ",", "include_order", "=", "\"default\"", ")", ":", "# This is a list of all standard c++ header files, except", "# those already checked for above.", "is_cpp_header", "=", "include", "in", ...
https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L4972-L5043
facebook/folly
744a0a698074d1b013813065fe60f545aa2c9b94
build/fbcode_builder/getdeps.py
python
CachedProject.is_cacheable
(self)
return self.cache and self.m.shipit_project is None
We only cache third party projects
We only cache third party projects
[ "We", "only", "cache", "third", "party", "projects" ]
def is_cacheable(self): """We only cache third party projects""" return self.cache and self.m.shipit_project is None
[ "def", "is_cacheable", "(", "self", ")", ":", "return", "self", ".", "cache", "and", "self", ".", "m", ".", "shipit_project", "is", "None" ]
https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/getdeps.py#L238-L240
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dataflow.py
python
DataFlowAnalysis.op_DELETE_SLICE_0
(self, info, inst)
del TOS[:]
del TOS[:]
[ "del", "TOS", "[", ":", "]" ]
def op_DELETE_SLICE_0(self, info, inst): """ del TOS[:] """ tos = info.pop() slicevar = info.make_temp() indexvar = info.make_temp() nonevar = info.make_temp() info.append(inst, base=tos, slicevar=slicevar, indexvar=indexvar, nonevar=no...
[ "def", "op_DELETE_SLICE_0", "(", "self", ",", "info", ",", "inst", ")", ":", "tos", "=", "info", ".", "pop", "(", ")", "slicevar", "=", "info", ".", "make_temp", "(", ")", "indexvar", "=", "info", ".", "make_temp", "(", ")", "nonevar", "=", "info", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dataflow.py#L562-L571
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._screen_create_command_window
(self)
Create command window according to screen size.
Create command window according to screen size.
[ "Create", "command", "window", "according", "to", "screen", "size", "." ]
def _screen_create_command_window(self): """Create command window according to screen size.""" if self._command_window: del self._command_window self._command_window = curses.newwin( self._command_textbox_height, self._max_x - len(self.CLI_PROMPT), self._max_y - self._command_textbox_...
[ "def", "_screen_create_command_window", "(", "self", ")", ":", "if", "self", ".", "_command_window", ":", "del", "self", ".", "_command_window", "self", ".", "_command_window", "=", "curses", ".", "newwin", "(", "self", ".", "_command_textbox_height", ",", "self...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/curses_ui.py#L455-L462
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
commonTools/framework/clean_workspace/clean_workspace.py
python
Cleaner.force_clean_space
(self)
Do the actual cleanup basically just os.unlink()
Do the actual cleanup basically just os.unlink()
[ "Do", "the", "actual", "cleanup", "basically", "just", "os", ".", "unlink", "()" ]
def force_clean_space(self): """Do the actual cleanup basically just os.unlink() """ if os.path.isdir(self.args.dir): shutil.rmtree(self.args.dir)
[ "def", "force_clean_space", "(", "self", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "self", ".", "args", ".", "dir", ")", ":", "shutil", ".", "rmtree", "(", "self", ".", "args", ".", "dir", ")" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/commonTools/framework/clean_workspace/clean_workspace.py#L58-L63
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/urllib.py
python
URLopener.addheader
(self, *args)
Add a header to be used by the HTTP interface only e.g. u.addheader('Accept', 'sound/basic')
Add a header to be used by the HTTP interface only e.g. u.addheader('Accept', 'sound/basic')
[ "Add", "a", "header", "to", "be", "used", "by", "the", "HTTP", "interface", "only", "e", ".", "g", ".", "u", ".", "addheader", "(", "Accept", "sound", "/", "basic", ")" ]
def addheader(self, *args): """Add a header to be used by the HTTP interface only e.g. u.addheader('Accept', 'sound/basic')""" self.addheaders.append(args)
[ "def", "addheader", "(", "self", ",", "*", "args", ")", ":", "self", ".", "addheaders", ".", "append", "(", "args", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/urllib.py#L169-L172
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Tools/c_preproc.py
python
repl
(m)
return s
Replace function used with :py:attr:`waflib.Tools.c_preproc.re_cpp`
Replace function used with :py:attr:`waflib.Tools.c_preproc.re_cpp`
[ "Replace", "function", "used", "with", ":", "py", ":", "attr", ":", "waflib", ".", "Tools", ".", "c_preproc", ".", "re_cpp" ]
def repl(m): """Replace function used with :py:attr:`waflib.Tools.c_preproc.re_cpp`""" s = m.group() if s[0] == '/': return ' ' return s
[ "def", "repl", "(", "m", ")", ":", "s", "=", "m", ".", "group", "(", ")", "if", "s", "[", "0", "]", "==", "'/'", ":", "return", "' '", "return", "s" ]
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Tools/c_preproc.py#L140-L145
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
get_contents_entry
(node)
Fetch the contents of the entry. Returns the exact binary contents of the file.
Fetch the contents of the entry. Returns the exact binary contents of the file.
[ "Fetch", "the", "contents", "of", "the", "entry", ".", "Returns", "the", "exact", "binary", "contents", "of", "the", "file", "." ]
def get_contents_entry(node): """Fetch the contents of the entry. Returns the exact binary contents of the file.""" try: node = node.disambiguate(must_exist=1) except SCons.Errors.UserError: # There was nothing on disk with which to disambiguate # this entry. Leave it as an Ent...
[ "def", "get_contents_entry", "(", "node", ")", ":", "try", ":", "node", "=", "node", ".", "disambiguate", "(", "must_exist", "=", "1", ")", "except", "SCons", ".", "Errors", ".", "UserError", ":", "# There was nothing on disk with which to disambiguate", "# this e...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L186-L199
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/function_base.py
python
flip
(m, axis=None)
return m[indexer]
Reverse the order of elements in an array along the given axis. The shape of the array is preserved, but the elements are reordered. .. versionadded:: 1.12.0 Parameters ---------- m : array_like Input array. axis : None or int or tuple of ints, optional Axis or axes along whi...
Reverse the order of elements in an array along the given axis.
[ "Reverse", "the", "order", "of", "elements", "in", "an", "array", "along", "the", "given", "axis", "." ]
def flip(m, axis=None): """ Reverse the order of elements in an array along the given axis. The shape of the array is preserved, but the elements are reordered. .. versionadded:: 1.12.0 Parameters ---------- m : array_like Input array. axis : None or int or tuple of ints, opti...
[ "def", "flip", "(", "m", ",", "axis", "=", "None", ")", ":", "if", "not", "hasattr", "(", "m", ",", "'ndim'", ")", ":", "m", "=", "asarray", "(", "m", ")", "if", "axis", "is", "None", ":", "indexer", "=", "(", "np", ".", "s_", "[", ":", ":"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/function_base.py#L165-L255
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/third_party/ipaddr/ipaddr.py
python
get_mixed_type_key
(obj)
return NotImplemented
Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they're fundamentally different so the expression IPv4Address('1.1.1.1') <= IPv4Network('1.1.1.1/24') doesn't make any sense. There are some times however, where you may wis...
Return a key suitable for sorting between networks and addresses.
[ "Return", "a", "key", "suitable", "for", "sorting", "between", "networks", "and", "addresses", "." ]
def get_mixed_type_key(obj): """Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they're fundamentally different so the expression IPv4Address('1.1.1.1') <= IPv4Network('1.1.1.1/24') doesn't make any sense. There are s...
[ "def", "get_mixed_type_key", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "_BaseNet", ")", ":", "return", "obj", ".", "_get_networks_key", "(", ")", "elif", "isinstance", "(", "obj", ",", "_BaseIP", ")", ":", "return", "obj", ".", "_get_add...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/ipaddr/ipaddr.py#L393-L415
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/div_impl.py
python
_div_scalar
(x, y)
return F.scalar_div(x, y)
Two numbers divide. Args: x (Number): x y (Number): y Returns: Number, equal to x / y, the type is same as x.
Two numbers divide.
[ "Two", "numbers", "divide", "." ]
def _div_scalar(x, y): """ Two numbers divide. Args: x (Number): x y (Number): y Returns: Number, equal to x / y, the type is same as x. """ return F.scalar_div(x, y)
[ "def", "_div_scalar", "(", "x", ",", "y", ")", ":", "return", "F", ".", "scalar_div", "(", "x", ",", "y", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/div_impl.py#L31-L42
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/textview.py
python
ViewWindow.ok
(self, event=None)
Dismiss text viewer dialog.
Dismiss text viewer dialog.
[ "Dismiss", "text", "viewer", "dialog", "." ]
def ok(self, event=None): """Dismiss text viewer dialog.""" if self.is_modal: self.grab_release() self.destroy()
[ "def", "ok", "(", "self", ",", "event", "=", "None", ")", ":", "if", "self", ".", "is_modal", ":", "self", ".", "grab_release", "(", ")", "self", ".", "destroy", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/textview.py#L143-L147
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
ToolBarBase.AddCheckLabelTool
(self, id, label, bitmap, bmpDisabled = wx.NullBitmap, shortHelp = '', longHelp = '', clientData = None)
return self.DoAddTool(id, label, bitmap, bmpDisabled, wx.ITEM_CHECK, shortHelp, longHelp, clientData)
Add a check tool, i.e. a tool which can be toggled
Add a check tool, i.e. a tool which can be toggled
[ "Add", "a", "check", "tool", "i", ".", "e", ".", "a", "tool", "which", "can", "be", "toggled" ]
def AddCheckLabelTool(self, id, label, bitmap, bmpDisabled = wx.NullBitmap, shortHelp = '', longHelp = '', clientData = None): '''Add a check tool, i.e. a tool which can be toggled''' return self.DoAddTool(id, label, bitmap, bmpDisa...
[ "def", "AddCheckLabelTool", "(", "self", ",", "id", ",", "label", ",", "bitmap", ",", "bmpDisabled", "=", "wx", ".", "NullBitmap", ",", "shortHelp", "=", "''", ",", "longHelp", "=", "''", ",", "clientData", "=", "None", ")", ":", "return", "self", ".",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3693-L3699
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathSetupSheet.py
python
SetupSheet.setFromTemplate
(self, attrs)
setFromTemplate(attrs) ... sets the default values from the given dictionary.
setFromTemplate(attrs) ... sets the default values from the given dictionary.
[ "setFromTemplate", "(", "attrs", ")", "...", "sets", "the", "default", "values", "from", "the", "given", "dictionary", "." ]
def setFromTemplate(self, attrs): """setFromTemplate(attrs) ... sets the default values from the given dictionary.""" for name in Template.All: if attrs.get(name) is not None: setattr(self.obj, name, attrs[name]) for opName, op in PathUtil.keyValueIter(_RegisteredOps...
[ "def", "setFromTemplate", "(", "self", ",", "attrs", ")", ":", "for", "name", "in", "Template", ".", "All", ":", "if", "attrs", ".", "get", "(", "name", ")", "is", "not", "None", ":", "setattr", "(", "self", ".", "obj", ",", "name", ",", "attrs", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSetupSheet.py#L275-L296
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Text.tag_unbind
(self, tagName, sequence, funcid=None)
Unbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.
Unbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.
[ "Unbind", "for", "all", "characters", "with", "TAGNAME", "for", "event", "SEQUENCE", "the", "function", "identified", "with", "FUNCID", "." ]
def tag_unbind(self, tagName, sequence, funcid=None): """Unbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.""" self.tk.call(self._w, 'tag', 'bind', tagName, sequence, '') if funcid: self.deletecommand(funcid)
[ "def", "tag_unbind", "(", "self", ",", "tagName", ",", "sequence", ",", "funcid", "=", "None", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'tag'", ",", "'bind'", ",", "tagName", ",", "sequence", ",", "''", ")", "if", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3105-L3110
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2B_NAME.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPM2B_NAME)
Returns new TPM2B_NAME object constructed from its marshaled representation in the given byte buffer
Returns new TPM2B_NAME object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPM2B_NAME", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPM2B_NAME object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPM2B_NAME)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPM2B_NAME", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4012-L4016
qtumproject/qtum
f5a195cc8c62510336ce4f30b7f74b5fdc445ad7
contrib/devtools/security-check.py
python
check_MACHO_NX
(executable)
return True
Check for no stack execution
Check for no stack execution
[ "Check", "for", "no", "stack", "execution" ]
def check_MACHO_NX(executable) -> bool: ''' Check for no stack execution ''' flags = get_MACHO_executable_flags(executable) if 'ALLOW_STACK_EXECUTION' in flags: return False return True
[ "def", "check_MACHO_NX", "(", "executable", ")", "->", "bool", ":", "flags", "=", "get_MACHO_executable_flags", "(", "executable", ")", "if", "'ALLOW_STACK_EXECUTION'", "in", "flags", ":", "return", "False", "return", "True" ]
https://github.com/qtumproject/qtum/blob/f5a195cc8c62510336ce4f30b7f74b5fdc445ad7/contrib/devtools/security-check.py#L200-L207
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/debug/cli/debugger_cli_common.py
python
TabCompletionRegistry._common_prefix
(self, m)
return s1
Given a list of str, returns the longest common prefix. Args: m: (list of str) A list of strings. Returns: (str) The longest common prefix.
Given a list of str, returns the longest common prefix.
[ "Given", "a", "list", "of", "str", "returns", "the", "longest", "common", "prefix", "." ]
def _common_prefix(self, m): """Given a list of str, returns the longest common prefix. Args: m: (list of str) A list of strings. Returns: (str) The longest common prefix. """ if not m: return "" s1 = min(m) s2 = max(m) for i, c in enumerate(s1): if c != s2[i]:...
[ "def", "_common_prefix", "(", "self", ",", "m", ")", ":", "if", "not", "m", ":", "return", "\"\"", "s1", "=", "min", "(", "m", ")", "s2", "=", "max", "(", "m", ")", "for", "i", ",", "c", "in", "enumerate", "(", "s1", ")", ":", "if", "c", "!...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/debugger_cli_common.py#L952-L970
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py
python
Radiobutton.__init__
(self, master=None, **kw)
Construct a Ttk Radiobutton with parent master. STANDARD OPTIONS class, compound, cursor, image, state, style, takefocus, text, textvariable, underline, width WIDGET-SPECIFIC OPTIONS command, value, variable
Construct a Ttk Radiobutton with parent master.
[ "Construct", "a", "Ttk", "Radiobutton", "with", "parent", "master", "." ]
def __init__(self, master=None, **kw): """Construct a Ttk Radiobutton with parent master. STANDARD OPTIONS class, compound, cursor, image, state, style, takefocus, text, textvariable, underline, width WIDGET-SPECIFIC OPTIONS command, value, variable ...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "\"ttk::radiobutton\"", ",", "kw", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L1035-L1047
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
chrome/tools/extract_actions.py
python
AddWebKitEditorActions
(actions)
Add editor actions from editor_client_impl.cc. Arguments: actions: set of actions to add to.
Add editor actions from editor_client_impl.cc.
[ "Add", "editor", "actions", "from", "editor_client_impl", ".", "cc", "." ]
def AddWebKitEditorActions(actions): """Add editor actions from editor_client_impl.cc. Arguments: actions: set of actions to add to. """ action_re = re.compile(r'''\{ [\w']+, +\w+, +"(.*)" +\},''') editor_file = os.path.join(path_utils.ScriptDir(), '..', '..', 'webkit', 'api...
[ "def", "AddWebKitEditorActions", "(", "actions", ")", ":", "action_re", "=", "re", ".", "compile", "(", "r'''\\{ [\\w']+, +\\w+, +\"(.*)\" +\\},'''", ")", "editor_file", "=", "os", ".", "path", ".", "join", "(", "path_utils", ".", "ScriptDir", "(", ")", ",", "...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/extract_actions.py#L141-L154
pytorch/ELF
e851e786ced8d26cf470f08a6b9bf7e413fc63f7
src_py/rlpytorch/methods/utils.py
python
check_terminals_anyT
(has_terminal, batch, T)
Check if any of ``batch[t], t <= T`` is terminal
Check if any of ``batch[t], t <= T`` is terminal
[ "Check", "if", "any", "of", "batch", "[", "t", "]", "t", "<", "=", "T", "is", "terminal" ]
def check_terminals_anyT(has_terminal, batch, T): ''' Check if any of ``batch[t], t <= T`` is terminal''' for t in range(T): check_terminals(has_terminal, batch[t])
[ "def", "check_terminals_anyT", "(", "has_terminal", ",", "batch", ",", "T", ")", ":", "for", "t", "in", "range", "(", "T", ")", ":", "check_terminals", "(", "has_terminal", ",", "batch", "[", "t", "]", ")" ]
https://github.com/pytorch/ELF/blob/e851e786ced8d26cf470f08a6b9bf7e413fc63f7/src_py/rlpytorch/methods/utils.py#L71-L74
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/framemanager.py
python
AuiFloatingFrame.GetOwnerManager
(self)
return self._owner_mgr
Returns the :class:`AuiManager` that manages the pane.
Returns the :class:`AuiManager` that manages the pane.
[ "Returns", "the", ":", "class", ":", "AuiManager", "that", "manages", "the", "pane", "." ]
def GetOwnerManager(self): """ Returns the :class:`AuiManager` that manages the pane. """ return self._owner_mgr
[ "def", "GetOwnerManager", "(", "self", ")", ":", "return", "self", ".", "_owner_mgr" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L3074-L3077
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/mac_tool.py
python
MacTool.ExecCopyBundleResource
(self, source, dest, convert_to_binary)
Copies a resource file to the bundle/Resources directory, performing any necessary compilation on each resource.
Copies a resource file to the bundle/Resources directory, performing any necessary compilation on each resource.
[ "Copies", "a", "resource", "file", "to", "the", "bundle", "/", "Resources", "directory", "performing", "any", "necessary", "compilation", "on", "each", "resource", "." ]
def ExecCopyBundleResource(self, source, dest, convert_to_binary): """Copies a resource file to the bundle/Resources directory, performing any necessary compilation on each resource.""" convert_to_binary = convert_to_binary == 'True' extension = os.path.splitext(source)[1].lower() if os.path.isdir(s...
[ "def", "ExecCopyBundleResource", "(", "self", ",", "source", ",", "dest", ",", "convert_to_binary", ")", ":", "convert_to_binary", "=", "convert_to_binary", "==", "'True'", "extension", "=", "os", ".", "path", ".", "splitext", "(", "source", ")", "[", "1", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/mac_tool.py#L49-L74
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridTableBase.GetAttr
(*args, **kwargs)
return _grid.GridTableBase_GetAttr(*args, **kwargs)
GetAttr(self, int row, int col, int kind) -> GridCellAttr
GetAttr(self, int row, int col, int kind) -> GridCellAttr
[ "GetAttr", "(", "self", "int", "row", "int", "col", "int", "kind", ")", "-", ">", "GridCellAttr" ]
def GetAttr(*args, **kwargs): """GetAttr(self, int row, int col, int kind) -> GridCellAttr""" return _grid.GridTableBase_GetAttr(*args, **kwargs)
[ "def", "GetAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_GetAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L906-L908
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
python/gtsam_unstable/examples/FixedLagSmootherExample.py
python
BatchFixedLagSmootherExample
()
Runs a batch fixed smoother on an agent with two odometry sensors that is simply moving to the
Runs a batch fixed smoother on an agent with two odometry sensors that is simply moving to the
[ "Runs", "a", "batch", "fixed", "smoother", "on", "an", "agent", "with", "two", "odometry", "sensors", "that", "is", "simply", "moving", "to", "the" ]
def BatchFixedLagSmootherExample(): """ Runs a batch fixed smoother on an agent with two odometry sensors that is simply moving to the """ # Define a batch fixed lag smoother, which uses # Levenberg-Marquardt to perform the nonlinear optimization lag = 2.0 smoother_batch = gtsam_unstabl...
[ "def", "BatchFixedLagSmootherExample", "(", ")", ":", "# Define a batch fixed lag smoother, which uses", "# Levenberg-Marquardt to perform the nonlinear optimization", "lag", "=", "2.0", "smoother_batch", "=", "gtsam_unstable", ".", "BatchFixedLagSmoother", "(", "lag", ")", "# Cr...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam_unstable/examples/FixedLagSmootherExample.py#L19-L87
OGRECave/ogre-next
287307980e6de8910f04f3cc0994451b075071fd
Tools/BlenderExport/ogrepkg/armatureexport.py
python
ArmatureExporter.addAnimation
(self, animation)
return
Adds animation to export. @param animation ArmatureAnimation
Adds animation to export.
[ "Adds", "animation", "to", "export", "." ]
def addAnimation(self, animation): """Adds animation to export. @param animation ArmatureAnimation """ self.animationList.append(animation) return
[ "def", "addAnimation", "(", "self", ",", "animation", ")", ":", "self", ".", "animationList", ".", "append", "(", "animation", ")", "return" ]
https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/armatureexport.py#L475-L481
tensorflow/minigo
6d89c202cdceaf449aefc3149ab2110d44f1a6a4
ml_perf/train_loop.py
python
wait_for_training_examples
(state, num_games)
Wait for training examples to be generated by the latest model. Args: state: the RL loop State instance. num_games: number of games to wait for.
Wait for training examples to be generated by the latest model.
[ "Wait", "for", "training", "examples", "to", "be", "generated", "by", "the", "latest", "model", "." ]
def wait_for_training_examples(state, num_games): """Wait for training examples to be generated by the latest model. Args: state: the RL loop State instance. num_games: number of games to wait for. """ model_dir = os.path.join(FLAGS.selfplay_dir, state.selfplay_model_name) pattern ...
[ "def", "wait_for_training_examples", "(", "state", ",", "num_games", ")", ":", "model_dir", "=", "os", ".", "path", ".", "join", "(", "FLAGS", ".", "selfplay_dir", ",", "state", ".", "selfplay_model_name", ")", "pattern", "=", "os", ".", "path", ".", "join...
https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/ml_perf/train_loop.py#L110-L130
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py
python
obj_class.get_comment
(self)
return self.comment
Return the class comment as an array of lines.
Return the class comment as an array of lines.
[ "Return", "the", "class", "comment", "as", "an", "array", "of", "lines", "." ]
def get_comment(self): """ Return the class comment as an array of lines. """ return self.comment
[ "def", "get_comment", "(", "self", ")", ":", "return", "self", ".", "comment" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L896-L898
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/parser/tensorflow/tf_trans_util.py
python
parse_Pad
(tf_node, graph)
convert pad op :param tf_node: :param graph: :return:
convert pad op :param tf_node: :param graph: :return:
[ "convert", "pad", "op", ":", "param", "tf_node", ":", ":", "param", "graph", ":", ":", "return", ":" ]
def parse_Pad(tf_node, graph): ''' convert pad op :param tf_node: :param graph: :return: ''' tf_node['visted'] = True tf_node['ak_type'] = 'Pad' pad_shape_node = graph[tf_node['input'][1]['name']] assert pad_shape_node['type'] == 'Const' pad_shape = pad_shape_node['tf_attr'][...
[ "def", "parse_Pad", "(", "tf_node", ",", "graph", ")", ":", "tf_node", "[", "'visted'", "]", "=", "True", "tf_node", "[", "'ak_type'", "]", "=", "'Pad'", "pad_shape_node", "=", "graph", "[", "tf_node", "[", "'input'", "]", "[", "1", "]", "[", "'name'",...
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/tensorflow/tf_trans_util.py#L331-L346
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
ResourceManager.postprocess
(self, tempname, filename)
Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully extracting a compressed resource. They must NOT c...
Perform any platform-specific postprocessing of `tempname`
[ "Perform", "any", "platform", "-", "specific", "postprocessing", "of", "tempname" ]
def postprocess(self, tempname, filename): """Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully ...
[ "def", "postprocess", "(", "self", ",", "tempname", ",", "filename", ")", ":", "if", "os", ".", "name", "==", "'posix'", ":", "# Make the resource executable", "mode", "=", "(", "(", "os", ".", "stat", "(", "tempname", ")", ".", "st_mode", ")", "|", "0...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L1243-L1261