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
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
examples/python/random_tsp.py
python
RandomMatrix.__init__
(self, size, seed)
Initialize random matrix.
Initialize random matrix.
[ "Initialize", "random", "matrix", "." ]
def __init__(self, size, seed): """Initialize random matrix.""" rand = random.Random() rand.seed(seed) distance_max = 100 self.matrix = {} for from_node in range(size): self.matrix[from_node] = {} for to_node in range(size): if fro...
[ "def", "__init__", "(", "self", ",", "size", ",", "seed", ")", ":", "rand", "=", "random", ".", "Random", "(", ")", "rand", ".", "seed", "(", "seed", ")", "distance_max", "=", "100", "self", ".", "matrix", "=", "{", "}", "for", "from_node", "in", ...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/random_tsp.py#L66-L80
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyCppVisitor.py
python
InstanceTopologyCppVisitor.finishSourceFilesVisit
(self, obj)
Defined to generate ending static code within files.
Defined to generate ending static code within files.
[ "Defined", "to", "generate", "ending", "static", "code", "within", "files", "." ]
def finishSourceFilesVisit(self, obj): """ Defined to generate ending static code within files. """ # c = finishComponentCpp.finishComponentCpp() # self._writeTmpl(c, "finishSourceFilesVisit") self.__fp.close()
[ "def", "finishSourceFilesVisit", "(", "self", ",", "obj", ")", ":", "# c = finishComponentCpp.finishComponentCpp()", "# self._writeTmpl(c, \"finishSourceFilesVisit\")", "self", ".", "__fp", ".", "close", "(", ")" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyCppVisitor.py#L416-L422
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchCommands.py
python
closeHole
(shape)
closeHole(shape): closes a hole in an open shape
closeHole(shape): closes a hole in an open shape
[ "closeHole", "(", "shape", ")", ":", "closes", "a", "hole", "in", "an", "open", "shape" ]
def closeHole(shape): '''closeHole(shape): closes a hole in an open shape''' import DraftGeomUtils, Part # creating an edges lookup table lut = {} for face in shape.Faces: for edge in face.Edges: hc = edge.hashCode() if hc in lut: lut[hc] = lut[hc] + 1...
[ "def", "closeHole", "(", "shape", ")", ":", "import", "DraftGeomUtils", ",", "Part", "# creating an edges lookup table", "lut", "=", "{", "}", "for", "face", "in", "shape", ".", "Faces", ":", "for", "edge", "in", "face", ".", "Edges", ":", "hc", "=", "ed...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchCommands.py#L374-L399
gemrb/gemrb
730206eed8d1dd358ca5e69a62f9e099aa22ffc6
gemrb/GUIScripts/LUCommon.py
python
SetupLore
(pc, LevelDiff=None)
return
Updates an actors lore based upon level. Level should contain the actors current level. LevelDiff should contain the change in levels. Level and LevelDiff must be of the same length. If either are None, they are filled with the actors current level.
Updates an actors lore based upon level.
[ "Updates", "an", "actors", "lore", "based", "upon", "level", "." ]
def SetupLore (pc, LevelDiff=None): """Updates an actors lore based upon level. Level should contain the actors current level. LevelDiff should contain the change in levels. Level and LevelDiff must be of the same length. If either are None, they are filled with the actors current level.""" LevelDiffs, NumClass...
[ "def", "SetupLore", "(", "pc", ",", "LevelDiff", "=", "None", ")", ":", "LevelDiffs", ",", "NumClasses", ",", "Class", "=", "_SetupLevels", "(", "pc", ",", "LevelDiff", ")", "if", "NumClasses", ">", "len", "(", "LevelDiffs", ")", ":", "return", "#get som...
https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/LUCommon.py#L311-L343
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/difflib.py
python
_mdiff
(fromlines, tolines, context=None, linejunk=None, charjunk=IS_CHARACTER_JUNK)
r"""Returns generator yielding marked up from/to side by side differences. Arguments: fromlines -- list of text lines to compared to tolines tolines -- list of text lines to be compared to fromlines context -- number of context lines to display on each side of difference, if None, all fr...
r"""Returns generator yielding marked up from/to side by side differences.
[ "r", "Returns", "generator", "yielding", "marked", "up", "from", "/", "to", "side", "by", "side", "differences", "." ]
def _mdiff(fromlines, tolines, context=None, linejunk=None, charjunk=IS_CHARACTER_JUNK): r"""Returns generator yielding marked up from/to side by side differences. Arguments: fromlines -- list of text lines to compared to tolines tolines -- list of text lines to be compared to fromlines ...
[ "def", "_mdiff", "(", "fromlines", ",", "tolines", ",", "context", "=", "None", ",", "linejunk", "=", "None", ",", "charjunk", "=", "IS_CHARACTER_JUNK", ")", ":", "import", "re", "# regular expression for finding intraline change indices", "change_re", "=", "re", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/difflib.py#L1352-L1613
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
body_part_regressor/bodypartregressor/train.py
python
train
(solver, solver_param)
return model_paths, validate_accuracies
Network training loop.
Network training loop.
[ "Network", "training", "loop", "." ]
def train(solver, solver_param): """Network training loop.""" last_snapshot_iter = -1 # timer = Timer() model_paths = {} validate_accuracies = [] while solver.iter < solver_param.max_iter: # Make one SGD update # timer.tic() solver.step(1) # timer.toc() # ...
[ "def", "train", "(", "solver", ",", "solver_param", ")", ":", "last_snapshot_iter", "=", "-", "1", "# timer = Timer()", "model_paths", "=", "{", "}", "validate_accuracies", "=", "[", "]", "while", "solver", ".", "iter", "<", "solver_param", ".", "max_iter", ...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/body_part_regressor/bodypartregressor/train.py#L59-L91
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/glob.py
python
glob
(pathname, *, recursive=False)
return list(iglob(pathname, recursive=recursive))
Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files ...
Return a list of paths matching a pathname pattern.
[ "Return", "a", "list", "of", "paths", "matching", "a", "pathname", "pattern", "." ]
def glob(pathname, *, recursive=False): """Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive ...
[ "def", "glob", "(", "pathname", ",", "*", ",", "recursive", "=", "False", ")", ":", "return", "list", "(", "iglob", "(", "pathname", ",", "recursive", "=", "recursive", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/glob.py#L9-L20
DaFuCoding/MTCNN_Caffe
09c30c3ff391bd9cb6b249c1910afaf147767ab3
scripts/cpp_lint.py
python
CheckCheck
(filename, clean_lines, linenum, error)
Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks the use of CHECK and EXPECT macros.
[ "Checks", "the", "use", "of", "CHECK", "and", "EXPECT", "macros", "." ]
def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. ...
[ "def", "CheckCheck", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Decide the set of replacement macros that should be suggested", "lines", "=", "clean_lines", ".", "elided", "check_macro", "=", "None", "start_pos", "=", "-", "1", "...
https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/scripts/cpp_lint.py#L3278-L3402
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/streams.py
python
IntStream.release
(self, marker=None)
You may want to commit to a backtrack but don't want to force the stream to keep bookkeeping objects around for a marker that is no longer necessary. This will have the same behavior as rewind() except it releases resources without the backward seek. This must throw away resources for a...
You may want to commit to a backtrack but don't want to force the stream to keep bookkeeping objects around for a marker that is no longer necessary. This will have the same behavior as rewind() except it releases resources without the backward seek. This must throw away resources for a...
[ "You", "may", "want", "to", "commit", "to", "a", "backtrack", "but", "don", "t", "want", "to", "force", "the", "stream", "to", "keep", "bookkeeping", "objects", "around", "for", "a", "marker", "that", "is", "no", "longer", "necessary", ".", "This", "will...
def release(self, marker=None): """ You may want to commit to a backtrack but don't want to force the stream to keep bookkeeping objects around for a marker that is no longer necessary. This will have the same behavior as rewind() except it releases resources without the backwar...
[ "def", "release", "(", "self", ",", "marker", "=", "None", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/streams.py#L121-L132
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/layers/python/layers/utils.py
python
collect_named_outputs
(collections, name, outputs)
return outputs
Add `Tensor` outputs tagged with name to collections. It is useful to collect end-points or tags for summaries. Example of usage: logits = collect_named_outputs('end_points', 'inception_v3/logits', logits) assert logits.tag == 'inception_v3/logits' Args: collections: A collection or list of collections. ...
Add `Tensor` outputs tagged with name to collections.
[ "Add", "Tensor", "outputs", "tagged", "with", "name", "to", "collections", "." ]
def collect_named_outputs(collections, name, outputs): """Add `Tensor` outputs tagged with name to collections. It is useful to collect end-points or tags for summaries. Example of usage: logits = collect_named_outputs('end_points', 'inception_v3/logits', logits) assert logits.tag == 'inception_v3/logits' ...
[ "def", "collect_named_outputs", "(", "collections", ",", "name", ",", "outputs", ")", ":", "# Remove ending '/' if present.", "if", "name", "[", "-", "1", "]", "==", "'/'", ":", "name", "=", "name", "[", ":", "-", "1", "]", "if", "collections", ":", "ops...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/layers/python/layers/utils.py#L40-L61
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Menu.GetWindow
(*args, **kwargs)
return _core_.Menu_GetWindow(*args, **kwargs)
GetWindow(self) -> Window
GetWindow(self) -> Window
[ "GetWindow", "(", "self", ")", "-", ">", "Window" ]
def GetWindow(*args, **kwargs): """GetWindow(self) -> Window""" return _core_.Menu_GetWindow(*args, **kwargs)
[ "def", "GetWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Menu_GetWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12214-L12216
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
IconizeEvent.IsIconized
(*args, **kwargs)
return _core_.IconizeEvent_IsIconized(*args, **kwargs)
IsIconized(self) -> bool Returns ``True`` if the frame has been iconized, ``False`` if it has been restored.
IsIconized(self) -> bool
[ "IsIconized", "(", "self", ")", "-", ">", "bool" ]
def IsIconized(*args, **kwargs): """ IsIconized(self) -> bool Returns ``True`` if the frame has been iconized, ``False`` if it has been restored. """ return _core_.IconizeEvent_IsIconized(*args, **kwargs)
[ "def", "IsIconized", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "IconizeEvent_IsIconized", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6606-L6613
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
native_client_sdk/src/build_tools/buildbot_common.py
python
Archive
(filename, bucket_path, cwd=None, step_link=True)
Upload the given filename to Google Store.
Upload the given filename to Google Store.
[ "Upload", "the", "given", "filename", "to", "Google", "Store", "." ]
def Archive(filename, bucket_path, cwd=None, step_link=True): """Upload the given filename to Google Store.""" full_dst = 'gs://%s/%s' % (bucket_path, filename) subprocess.check_call( '%s cp -a public-read %s %s' % (GetGsutil(), filename, full_dst), shell=True, cwd=cwd) url = 'https://commond...
[ "def", "Archive", "(", "filename", ",", "bucket_path", ",", "cwd", "=", "None", ",", "step_link", "=", "True", ")", ":", "full_dst", "=", "'gs://%s/%s'", "%", "(", "bucket_path", ",", "filename", ")", "subprocess", ".", "check_call", "(", "'%s cp -a public-r...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/buildbot_common.py#L99-L111
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py
python
Context.clear_post_execution_callbacks
(self)
Clear all post-execution callbacks added to the context.
Clear all post-execution callbacks added to the context.
[ "Clear", "all", "post", "-", "execution", "callbacks", "added", "to", "the", "context", "." ]
def clear_post_execution_callbacks(self): """Clear all post-execution callbacks added to the context.""" del self.post_execution_callbacks[:]
[ "def", "clear_post_execution_callbacks", "(", "self", ")", ":", "del", "self", ".", "post_execution_callbacks", "[", ":", "]" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L1035-L1037
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/common.py
python
get_cython_func
(arg: Callable)
return _cython_table.get(arg)
if we define an internal function for this argument, return it
if we define an internal function for this argument, return it
[ "if", "we", "define", "an", "internal", "function", "for", "this", "argument", "return", "it" ]
def get_cython_func(arg: Callable) -> str | None: """ if we define an internal function for this argument, return it """ return _cython_table.get(arg)
[ "def", "get_cython_func", "(", "arg", ":", "Callable", ")", "->", "str", "|", "None", ":", "return", "_cython_table", ".", "get", "(", "arg", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/common.py#L570-L574
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
openr/py/openr/cli/clis/tech_support.py
python
TechSupportCli.tech_support
(ctx, fib_agent_port, routes)
Extensive logging of Open/R's state for debugging
Extensive logging of Open/R's state for debugging
[ "Extensive", "logging", "of", "Open", "/", "R", "s", "state", "for", "debugging" ]
def tech_support(ctx, fib_agent_port, routes): # noqa: B902 """Extensive logging of Open/R's state for debugging""" """ - Counters (FIB) and recent log samples - Recent perf events """ TechSupportCmd(ctx.obj).run(routes)
[ "def", "tech_support", "(", "ctx", ",", "fib_agent_port", ",", "routes", ")", ":", "# noqa: B902", "\"\"\"\n - Counters (FIB) and recent log samples\n\n - Recent perf events\n \"\"\"", "TechSupportCmd", "(", "ctx", ".", "obj", ")", ".", "run", "(", "rou...
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/clis/tech_support.py#L20-L29
Illumina/manta
75b5c38d4fcd2f6961197b28a41eb61856f2d976
src/python/lib/workflowUtil.py
python
bamListCatCmd
(samtoolsBin, bamList, output)
return cmd + " && \"%s\" index \"%s\"" % (samtoolsBin, output)
Concatenate an input list of bam files to an output bam file, and index. If len(bamList) is 1 the file will be moved to the output file name.
Concatenate an input list of bam files to an output bam file, and index.
[ "Concatenate", "an", "input", "list", "of", "bam", "files", "to", "an", "output", "bam", "file", "and", "index", "." ]
def bamListCatCmd(samtoolsBin, bamList, output) : """ Concatenate an input list of bam files to an output bam file, and index. If len(bamList) is 1 the file will be moved to the output file name. """ assert(len(bamList) > 0) if len(bamList) > 1: headerTmp = bamList[0] + "header" ...
[ "def", "bamListCatCmd", "(", "samtoolsBin", ",", "bamList", ",", "output", ")", ":", "assert", "(", "len", "(", "bamList", ")", ">", "0", ")", "if", "len", "(", "bamList", ")", ">", "1", ":", "headerTmp", "=", "bamList", "[", "0", "]", "+", "\"head...
https://github.com/Illumina/manta/blob/75b5c38d4fcd2f6961197b28a41eb61856f2d976/src/python/lib/workflowUtil.py#L425-L440
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/resource_variable_ops.py
python
BaseResourceVariable.scatter_nd_update
(self, indices, updates, name=None)
return self._lazy_read( gen_state_ops.resource_scatter_nd_update( self.handle, indices, ops.convert_to_tensor(updates, self.dtype), name=name))
Applies sparse assignment to individual values or slices in a Variable. `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. `indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. The innermost dimension of ...
Applies sparse assignment to individual values or slices in a Variable.
[ "Applies", "sparse", "assignment", "to", "individual", "values", "or", "slices", "in", "a", "Variable", "." ]
def scatter_nd_update(self, indices, updates, name=None): """Applies sparse assignment to individual values or slices in a Variable. `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. `indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., ...
[ "def", "scatter_nd_update", "(", "self", ",", "indices", ",", "updates", ",", "name", "=", "None", ")", ":", "return", "self", ".", "_lazy_read", "(", "gen_state_ops", ".", "resource_scatter_nd_update", "(", "self", ".", "handle", ",", "indices", ",", "ops",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/resource_variable_ops.py#L1287-L1337
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py
python
SequenceMatcher.set_seqs
(self, a, b)
Set the two sequences to be compared. >>> s = SequenceMatcher() >>> s.set_seqs("abcd", "bcde") >>> s.ratio() 0.75
Set the two sequences to be compared.
[ "Set", "the", "two", "sequences", "to", "be", "compared", "." ]
def set_seqs(self, a, b): """Set the two sequences to be compared. >>> s = SequenceMatcher() >>> s.set_seqs("abcd", "bcde") >>> s.ratio() 0.75 """ self.set_seq1(a) self.set_seq2(b)
[ "def", "set_seqs", "(", "self", ",", "a", ",", "b", ")", ":", "self", ".", "set_seq1", "(", "a", ")", "self", ".", "set_seq2", "(", "b", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py#L223-L233
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
demo/BERT/builder.py
python
skipln
(prefix, config, init_dict, network, input_tensor, skip, bias=None)
return layer
Add the skip layer
Add the skip layer
[ "Add", "the", "skip", "layer" ]
def skipln(prefix, config, init_dict, network, input_tensor, skip, bias=None): """ Add the skip layer """ idims = input_tensor.shape assert len(idims) == 5 hidden_size = idims[2] dtype = trt.float32 if config.use_fp16: dtype = trt.float16 # Skip layernorm doesn't use INT8 in...
[ "def", "skipln", "(", "prefix", ",", "config", ",", "init_dict", ",", "network", ",", "input_tensor", ",", "skip", ",", "bias", "=", "None", ")", ":", "idims", "=", "input_tensor", ".", "shape", "assert", "len", "(", "idims", ")", "==", "5", "hidden_si...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/BERT/builder.py#L147-L180
gridcoin-community/Gridcoin-Research
9551bf250a90c5756fc24295d1c5781a8c36bfb6
src/crc32c/.ycm_extra_conf.py
python
FlagsForFile
(filename, **kwargs)
return {'flags': final_flags}
Implements the YouCompleteMe API.
Implements the YouCompleteMe API.
[ "Implements", "the", "YouCompleteMe", "API", "." ]
def FlagsForFile(filename, **kwargs): """Implements the YouCompleteMe API.""" # kwargs can be used to pass 'client_data' to the YCM configuration. This # configuration script does not need any extra information, so # pylint: disable=unused-argument build_root = DirectoryOfThisScript() file_path = os.path....
[ "def", "FlagsForFile", "(", "filename", ",", "*", "*", "kwargs", ")", ":", "# kwargs can be used to pass 'client_data' to the YCM configuration. This", "# configuration script does not need any extra information, so", "# pylint: disable=unused-argument", "build_root", "=", "DirectoryOf...
https://github.com/gridcoin-community/Gridcoin-Research/blob/9551bf250a90c5756fc24295d1c5781a8c36bfb6/src/crc32c/.ycm_extra_conf.py#L125-L142
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans.py
python
KMeansClustering.clusters
(self)
return checkpoints.load_variable(self.model_dir, self.CLUSTERS)
Returns cluster centers.
Returns cluster centers.
[ "Returns", "cluster", "centers", "." ]
def clusters(self): """Returns cluster centers.""" return checkpoints.load_variable(self.model_dir, self.CLUSTERS)
[ "def", "clusters", "(", "self", ")", ":", "return", "checkpoints", ".", "load_variable", "(", "self", ".", "model_dir", ",", "self", ".", "CLUSTERS", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans.py#L218-L220
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/frame.py
python
DataFrame.memory_usage
(self, index: bool = True, deep: bool = False)
return result
Return the memory usage of each column in bytes. The memory usage can optionally include the contribution of the index and elements of `object` dtype. This value is displayed in `DataFrame.info` by default. This can be suppressed by setting ``pandas.options.display.memory_usage`` to Fa...
Return the memory usage of each column in bytes.
[ "Return", "the", "memory", "usage", "of", "each", "column", "in", "bytes", "." ]
def memory_usage(self, index: bool = True, deep: bool = False) -> Series: """ Return the memory usage of each column in bytes. The memory usage can optionally include the contribution of the index and elements of `object` dtype. This value is displayed in `DataFrame.info` by de...
[ "def", "memory_usage", "(", "self", ",", "index", ":", "bool", "=", "True", ",", "deep", ":", "bool", "=", "False", ")", "->", "Series", ":", "result", "=", "self", ".", "_constructor_sliced", "(", "[", "c", ".", "memory_usage", "(", "index", "=", "F...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/frame.py#L3134-L3226
cathywu/Sentiment-Analysis
eb501fd1375c0c3f3ab430f963255f1bb858e659
PyML-0.7.9/PyML/preproc/preproc.py
python
dmat
(X)
return D
returns the Euclidean distance-squared matrix
returns the Euclidean distance-squared matrix
[ "returns", "the", "Euclidean", "distance", "-", "squared", "matrix" ]
def dmat(X) : '''returns the Euclidean distance-squared matrix''' K = numpy.matrixmultiply (X, numpy.transpose (X)) n = numpy.shape(K)[0] D = numpy.zeros((n,n), numpy.float) for i in range(1, n-1) : for j in range(i+1, n) : D[i,j] = K[i,i] - 2 * K[i,j] + K[j,j] D[j,...
[ "def", "dmat", "(", "X", ")", ":", "K", "=", "numpy", ".", "matrixmultiply", "(", "X", ",", "numpy", ".", "transpose", "(", "X", ")", ")", "n", "=", "numpy", ".", "shape", "(", "K", ")", "[", "0", "]", "D", "=", "numpy", ".", "zeros", "(", ...
https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/preproc/preproc.py#L68-L80
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Executor.py
python
execute_action_list
(obj, target, kw)
return status
Actually execute the action list.
Actually execute the action list.
[ "Actually", "execute", "the", "action", "list", "." ]
def execute_action_list(obj, target, kw): """Actually execute the action list.""" env = obj.get_build_env() kw = obj.get_kw(kw) status = 0 for act in obj.get_action_list(): args = ([], [], env) status = act(*args, **kw) if isinstance(status, SCons.Errors.BuildError): ...
[ "def", "execute_action_list", "(", "obj", ",", "target", ",", "kw", ")", ":", "env", "=", "obj", ".", "get_build_env", "(", ")", "kw", "=", "obj", ".", "get_kw", "(", "kw", ")", "status", "=", "0", "for", "act", "in", "obj", ".", "get_action_list", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Executor.py#L114-L132
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/requests/requests/utils.py
python
parse_list_header
(value)
return result
Parse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It ba...
Parse lists as described by RFC 2068 Section 2.
[ "Parse", "lists", "as", "described", "by", "RFC", "2068", "Section", "2", "." ]
def parse_list_header(value): """Parse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed au...
[ "def", "parse_list_header", "(", "value", ")", ":", "result", "=", "[", "]", "for", "item", "in", "_parse_list_header", "(", "value", ")", ":", "if", "item", "[", ":", "1", "]", "==", "item", "[", "-", "1", ":", "]", "==", "'\"'", ":", "item", "=...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/utils.py#L147-L174
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py
python
IAMConnection.list_role_policies
(self, role_name, marker=None, max_items=None)
return self.get_response('ListRolePolicies', params, list_marker='PolicyNames')
Lists the names of the policies associated with the specified role. If there are none, the action returns an empty list. :type role_name: string :param role_name: The name of the role to list policies for. :type marker: string :param marker: Use this parameter only when paginat...
Lists the names of the policies associated with the specified role. If there are none, the action returns an empty list.
[ "Lists", "the", "names", "of", "the", "policies", "associated", "with", "the", "specified", "role", ".", "If", "there", "are", "none", "the", "action", "returns", "an", "empty", "list", "." ]
def list_role_policies(self, role_name, marker=None, max_items=None): """ Lists the names of the policies associated with the specified role. If there are none, the action returns an empty list. :type role_name: string :param role_name: The name of the role to list policies for....
[ "def", "list_role_policies", "(", "self", ",", "role_name", ",", "marker", "=", "None", ",", "max_items", "=", "None", ")", ":", "params", "=", "{", "'RoleName'", ":", "role_name", "}", "if", "marker", "is", "not", "None", ":", "params", "[", "'Marker'",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py#L1290-L1314
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/importlib-metadata/py2/importlib_metadata/__init__.py
python
Distribution.requires
(self)
return reqs and list(reqs)
Generated requirements specified for this Distribution
Generated requirements specified for this Distribution
[ "Generated", "requirements", "specified", "for", "this", "Distribution" ]
def requires(self): """Generated requirements specified for this Distribution""" reqs = self._read_dist_info_reqs() or self._read_egg_info_reqs() return reqs and list(reqs)
[ "def", "requires", "(", "self", ")", ":", "reqs", "=", "self", ".", "_read_dist_info_reqs", "(", ")", "or", "self", ".", "_read_egg_info_reqs", "(", ")", "return", "reqs", "and", "list", "(", "reqs", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/importlib-metadata/py2/importlib_metadata/__init__.py#L333-L336
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/model_selection/_split.py
python
LeavePOut.get_n_splits
(self, X, y=None, groups=None)
return int(comb(_num_samples(X), self.p, exact=True))
Returns the number of splitting iterations in the cross-validator Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. y : object Always ...
Returns the number of splitting iterations in the cross-validator
[ "Returns", "the", "number", "of", "splitting", "iterations", "in", "the", "cross", "-", "validator" ]
def get_n_splits(self, X, y=None, groups=None): """Returns the number of splitting iterations in the cross-validator Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the ...
[ "def", "get_n_splits", "(", "self", ",", "X", ",", "y", "=", "None", ",", "groups", "=", "None", ")", ":", "if", "X", "is", "None", ":", "raise", "ValueError", "(", "\"The 'X' parameter should not be None.\"", ")", "return", "int", "(", "comb", "(", "_nu...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/model_selection/_split.py#L249-L266
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
parserCtxt.htmlCtxtReadMemory
(self, buffer, size, URL, encoding, options)
return __tmp
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
parse an XML in-memory document and build a tree. This reuses the existing
[ "parse", "an", "XML", "in", "-", "memory", "document", "and", "build", "a", "tree", ".", "This", "reuses", "the", "existing" ]
def htmlCtxtReadMemory(self, buffer, size, URL, encoding, options): """parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context """ ret = libxml2mod.htmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options) if ret is None:raise treeError(...
[ "def", "htmlCtxtReadMemory", "(", "self", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "htmlCtxtReadMemory", "(", "self", ".", "_o", ",", "buffer", ",", "size", ",", "URL", ",", "enco...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4981-L4987
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
GridEvent.GetPosition
(*args, **kwargs)
return _grid.GridEvent_GetPosition(*args, **kwargs)
GetPosition(self) -> Point
GetPosition(self) -> Point
[ "GetPosition", "(", "self", ")", "-", ">", "Point" ]
def GetPosition(*args, **kwargs): """GetPosition(self) -> Point""" return _grid.GridEvent_GetPosition(*args, **kwargs)
[ "def", "GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridEvent_GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L2313-L2315
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/wizard.py
python
PyWizardPage.DoGetVirtualSize
(*args, **kwargs)
return _wizard.PyWizardPage_DoGetVirtualSize(*args, **kwargs)
DoGetVirtualSize(self) -> Size
DoGetVirtualSize(self) -> Size
[ "DoGetVirtualSize", "(", "self", ")", "-", ">", "Size" ]
def DoGetVirtualSize(*args, **kwargs): """DoGetVirtualSize(self) -> Size""" return _wizard.PyWizardPage_DoGetVirtualSize(*args, **kwargs)
[ "def", "DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_wizard", ".", "PyWizardPage_DoGetVirtualSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/wizard.py#L179-L181
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/coordinator/cluster_coordinator.py
python
Cluster._record_and_ignore_transient_timeouts
(self, e)
return True
Records observed timeout error and return if it should be ignored.
Records observed timeout error and return if it should be ignored.
[ "Records", "observed", "timeout", "error", "and", "return", "if", "it", "should", "be", "ignored", "." ]
def _record_and_ignore_transient_timeouts(self, e): """Records observed timeout error and return if it should be ignored.""" if self._transient_timeouts_threshold <= 0: return False if not isinstance(e, errors.DeadlineExceededError): return False with self._transient_timeouts_lock: sel...
[ "def", "_record_and_ignore_transient_timeouts", "(", "self", ",", "e", ")", ":", "if", "self", ".", "_transient_timeouts_threshold", "<=", "0", ":", "return", "False", "if", "not", "isinstance", "(", "e", ",", "errors", ".", "DeadlineExceededError", ")", ":", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/coordinator/cluster_coordinator.py#L880-L890
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/hapi/model.py
python
Model._save_inference_model
(self, path)
Save inference model can be used in static or dynamic mode. Args: path (str): The path prefix to save model. The format is ``dirname/file_prefix`` or ``file_prefix``. Returns: None
Save inference model can be used in static or dynamic mode.
[ "Save", "inference", "model", "can", "be", "used", "in", "static", "or", "dynamic", "mode", "." ]
def _save_inference_model(self, path): """ Save inference model can be used in static or dynamic mode. Args: path (str): The path prefix to save model. The format is ``dirname/file_prefix`` or ``file_prefix``. Returns: None """ if...
[ "def", "_save_inference_model", "(", "self", ",", "path", ")", ":", "if", "fluid", ".", "in_dygraph_mode", "(", ")", ":", "with", "fluid", ".", "framework", ".", "_dygraph_guard", "(", "None", ")", ":", "layer", "=", "self", ".", "network", "if", "self",...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/hapi/model.py#L2001-L2059
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/resmokelib/parser.py
python
parse_command_line
()
return parser.parse_args()
Parses the command line arguments passed to resmoke.py.
Parses the command line arguments passed to resmoke.py.
[ "Parses", "the", "command", "line", "arguments", "passed", "to", "resmoke", ".", "py", "." ]
def parse_command_line(): """ Parses the command line arguments passed to resmoke.py. """ parser = optparse.OptionParser() parser.add_option("--suites", dest="suite_files", metavar="SUITE1,SUITE2", help=("Comma separated list of YAML files that each specify the configuration"...
[ "def", "parse_command_line", "(", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "\"--suites\"", ",", "dest", "=", "\"suite_files\"", ",", "metavar", "=", "\"SUITE1,SUITE2\"", ",", "help", "=", "(", "\"C...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/parser.py#L52-L206
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py
python
register_namespace
(prefix, uri)
Register a namespace prefix. The registry is global, and any existing mapping for either the given prefix or the namespace URI will be removed. *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and attributes in this namespace will be serialized with prefix if possible. ValueError ...
Register a namespace prefix.
[ "Register", "a", "namespace", "prefix", "." ]
def register_namespace(prefix, uri): """Register a namespace prefix. The registry is global, and any existing mapping for either the given prefix or the namespace URI will be removed. *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and attributes in this namespace will be serializ...
[ "def", "register_namespace", "(", "prefix", ",", "uri", ")", ":", "if", "re", ".", "match", "(", "r\"ns\\d+$\"", ",", "prefix", ")", ":", "raise", "ValueError", "(", "\"Prefix format reserved for internal use\"", ")", "for", "k", ",", "v", "in", "list", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py#L1022-L1039
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/core.py
python
MaskedArray._set_recordmask
(self)
Return the mask of the records. A record is masked when all the fields are masked.
Return the mask of the records. A record is masked when all the fields are masked.
[ "Return", "the", "mask", "of", "the", "records", ".", "A", "record", "is", "masked", "when", "all", "the", "fields", "are", "masked", "." ]
def _set_recordmask(self): """Return the mask of the records. A record is masked when all the fields are masked. """ raise NotImplementedError("Coming soon: setting the mask per records!")
[ "def", "_set_recordmask", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "\"Coming soon: setting the mask per records!\"", ")" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L3145-L3150
omnisci/omniscidb
b9c95f1bd602b4ffc8b0edf18bfad61031e08d86
python/omnisci/thrift/OmniSci.py
python
Client.get_custom_expressions
(self, session)
return self.recv_get_custom_expressions()
Parameters: - session
Parameters: - session
[ "Parameters", ":", "-", "session" ]
def get_custom_expressions(self, session): """ Parameters: - session """ self.send_get_custom_expressions(session) return self.recv_get_custom_expressions()
[ "def", "get_custom_expressions", "(", "self", ",", "session", ")", ":", "self", ".", "send_get_custom_expressions", "(", "session", ")", "return", "self", ".", "recv_get_custom_expressions", "(", ")" ]
https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L2599-L2606
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pipes.py
python
Template.append
(self, cmd, kind)
t.append(cmd, kind) adds a new step at the end.
t.append(cmd, kind) adds a new step at the end.
[ "t", ".", "append", "(", "cmd", "kind", ")", "adds", "a", "new", "step", "at", "the", "end", "." ]
def append(self, cmd, kind): """t.append(cmd, kind) adds a new step at the end.""" if type(cmd) is not type(''): raise TypeError('Template.append: cmd must be a string') if kind not in stepkinds: raise ValueError('Template.append: bad kind %r' % (kind,)) if kind =...
[ "def", "append", "(", "self", ",", "cmd", ",", "kind", ")", ":", "if", "type", "(", "cmd", ")", "is", "not", "type", "(", "''", ")", ":", "raise", "TypeError", "(", "'Template.append: cmd must be a string'", ")", "if", "kind", "not", "in", "stepkinds", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pipes.py#L110-L124
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/base/role_maker.py
python
GeneralRoleMaker._worker_num
(self)
return self._trainers_num
return the current number of worker
return the current number of worker
[ "return", "the", "current", "number", "of", "worker" ]
def _worker_num(self): """ return the current number of worker """ if not self._role_is_generated: self.generate_role() return self._trainers_num
[ "def", "_worker_num", "(", "self", ")", ":", "if", "not", "self", ".", "_role_is_generated", ":", "self", ".", "generate_role", "(", ")", "return", "self", ".", "_trainers_num" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/base/role_maker.py#L884-L890
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/filebrowsebutton.py
python
FileBrowseButton.__init__
(self, parent, id= -1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL, labelText= "File Entry:", buttonText= "Browse", toolTip= "Type filename or click browse to choose file", ...
:param labelText: Text for label to left of text field :param buttonText: Text for button which launches the file dialog :param toolTip: Help text :param dialogTitle: Title used in file dialog :param startDirectory: Default directory for file dialog startup :pa...
:param labelText: Text for label to left of text field :param buttonText: Text for button which launches the file dialog :param toolTip: Help text :param dialogTitle: Title used in file dialog :param startDirectory: Default directory for file dialog startup :pa...
[ ":", "param", "labelText", ":", "Text", "for", "label", "to", "left", "of", "text", "field", ":", "param", "buttonText", ":", "Text", "for", "button", "which", "launches", "the", "file", "dialog", ":", "param", "toolTip", ":", "Help", "text", ":", "param...
def __init__ (self, parent, id= -1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL, labelText= "File Entry:", buttonText= "Browse", toolTip= "Type filename or click browse to choose fil...
[ "def", "__init__", "(", "self", ",", "parent", ",", "id", "=", "-", "1", ",", "pos", "=", "wx", ".", "DefaultPosition", ",", "size", "=", "wx", ".", "DefaultSize", ",", "style", "=", "wx", ".", "TAB_TRAVERSAL", ",", "labelText", "=", "\"File Entry:\"",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/filebrowsebutton.py#L31-L80
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py
python
Common.linkWebPage
(self, context, sourceLink)
return 'file://%s/nv_python_libs/configs/HTML/%s' % (self.baseProcessingDir, 'nodownloads.html')
Check if there is a special local HTML page for the link. If not then return a generic download only local HTML url. return a file://.... link to a local HTML web page
Check if there is a special local HTML page for the link. If not then return a generic download only local HTML url. return a file://.... link to a local HTML web page
[ "Check", "if", "there", "is", "a", "special", "local", "HTML", "page", "for", "the", "link", ".", "If", "not", "then", "return", "a", "generic", "download", "only", "local", "HTML", "url", ".", "return", "a", "file", ":", "//", "....", "link", "to", ...
def linkWebPage(self, context, sourceLink): ''' Check if there is a special local HTML page for the link. If not then return a generic download only local HTML url. return a file://.... link to a local HTML web page ''' # Currently there are no link specific Web pages if ...
[ "def", "linkWebPage", "(", "self", ",", "context", ",", "sourceLink", ")", ":", "# Currently there are no link specific Web pages", "if", "not", "self", ".", "linksWebPage", ":", "self", ".", "linksWebPage", "=", "etree", ".", "parse", "(", "'%s/nv_python_libs/confi...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py#L738-L748
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/bucket.py
python
Bucket.set_xml_logging
(self, logging_str, headers=None)
Set logging on a bucket directly to the given xml string. :type logging_str: unicode string :param logging_str: The XML for the bucketloggingstatus which will be set. The string will be converted to utf-8 before it is sent. Usually, you will obtain this XML from the ...
Set logging on a bucket directly to the given xml string.
[ "Set", "logging", "on", "a", "bucket", "directly", "to", "the", "given", "xml", "string", "." ]
def set_xml_logging(self, logging_str, headers=None): """ Set logging on a bucket directly to the given xml string. :type logging_str: unicode string :param logging_str: The XML for the bucketloggingstatus which will be set. The string will be converted to utf-8 before ...
[ "def", "set_xml_logging", "(", "self", ",", "logging_str", ",", "headers", "=", "None", ")", ":", "body", "=", "logging_str", "if", "not", "isinstance", "(", "body", ",", "bytes", ")", ":", "body", "=", "body", ".", "encode", "(", "'utf-8'", ")", "resp...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/bucket.py#L1146-L1169
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/utilities/outputfile.py
python
OutputFile.close
(self)
Close temp file and overwrite original if they are different.
Close temp file and overwrite original if they are different.
[ "Close", "temp", "file", "and", "overwrite", "original", "if", "they", "are", "different", "." ]
def close(self): """Close temp file and overwrite original if they are different.""" self.outFile_.close() if os.path.exists(self.fileName_): if filecmp.cmp(self.fileName_, self.fileNameTemp_): os.unlink(self.fileNameTemp_) log.Log.instance().logMessag...
[ "def", "close", "(", "self", ")", ":", "self", ".", "outFile_", ".", "close", "(", ")", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "fileName_", ")", ":", "if", "filecmp", ".", "cmp", "(", "self", ".", "fileName_", ",", "self", ".",...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/utilities/outputfile.py#L59-L78
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/tools/common.py
python
path_variable_setting_command
(variable, paths)
return variable_setting_command(variable, sep.join(paths))
Returns a command to sets a named shell path variable to the given NATIVE paths on the current platform.
Returns a command to sets a named shell path variable to the given NATIVE paths on the current platform.
[ "Returns", "a", "command", "to", "sets", "a", "named", "shell", "path", "variable", "to", "the", "given", "NATIVE", "paths", "on", "the", "current", "platform", "." ]
def path_variable_setting_command(variable, paths): """ Returns a command to sets a named shell path variable to the given NATIVE paths on the current platform. """ assert(isinstance(variable, str)) assert(isinstance(paths, list)) sep = os.path.pathsep return variable_setting_com...
[ "def", "path_variable_setting_command", "(", "variable", ",", "paths", ")", ":", "assert", "(", "isinstance", "(", "variable", ",", "str", ")", ")", "assert", "(", "isinstance", "(", "paths", ",", "list", ")", ")", "sep", "=", "os", ".", "path", ".", "...
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/tools/common.py#L514-L522
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py
python
ComponentWriterBase.initHandlers
(self, c)
Handlers to implement for input ports
Handlers to implement for input ports
[ "Handlers", "to", "implement", "for", "input", "ports" ]
def initHandlers(self, c): """ Handlers to implement for input ports """ # Typed handlers c.handlers_typed = [ (instance, type, sync, priority, full, role, max_num) for ( instance, type, sync, ...
[ "def", "initHandlers", "(", "self", ",", "c", ")", ":", "# Typed handlers", "c", ".", "handlers_typed", "=", "[", "(", "instance", ",", "type", ",", "sync", ",", "priority", ",", "full", ",", "role", ",", "max_num", ")", "for", "(", "instance", ",", ...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py#L608-L627
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/auth.py
python
HTTPDigestAuth.handle_401
(self, r, **kwargs)
return r
Takes the given response and tries digest-auth, if needed. :rtype: requests.Response
Takes the given response and tries digest-auth, if needed.
[ "Takes", "the", "given", "response", "and", "tries", "digest", "-", "auth", "if", "needed", "." ]
def handle_401(self, r, **kwargs): """ Takes the given response and tries digest-auth, if needed. :rtype: requests.Response """ # If response is not 4xx, do not auth # See https://github.com/psf/requests/issues/3772 if not 400 <= r.status_code < 500: ...
[ "def", "handle_401", "(", "self", ",", "r", ",", "*", "*", "kwargs", ")", ":", "# If response is not 4xx, do not auth", "# See https://github.com/psf/requests/issues/3772", "if", "not", "400", "<=", "r", ".", "status_code", "<", "500", ":", "self", ".", "_thread_l...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/auth.py#L234-L276
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextRange.ToInternal
(*args, **kwargs)
return _richtext.RichTextRange_ToInternal(*args, **kwargs)
ToInternal(self) -> RichTextRange Convert to internal form: (n, n) is the range of a single character.
ToInternal(self) -> RichTextRange
[ "ToInternal", "(", "self", ")", "-", ">", "RichTextRange" ]
def ToInternal(*args, **kwargs): """ ToInternal(self) -> RichTextRange Convert to internal form: (n, n) is the range of a single character. """ return _richtext.RichTextRange_ToInternal(*args, **kwargs)
[ "def", "ToInternal", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextRange_ToInternal", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1037-L1043
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/query.py
python
CustomRun.entry_ok
(self)
return None if cli_args is None else (cli_args, restart)
Return apparently valid (cli_args, restart) or None
Return apparently valid (cli_args, restart) or None
[ "Return", "apparently", "valid", "(", "cli_args", "restart", ")", "or", "None" ]
def entry_ok(self): "Return apparently valid (cli_args, restart) or None" cli_args = self.cli_args_ok() restart = self.restartvar.get() return None if cli_args is None else (cli_args, restart)
[ "def", "entry_ok", "(", "self", ")", ":", "cli_args", "=", "self", ".", "cli_args_ok", "(", ")", "restart", "=", "self", ".", "restartvar", ".", "get", "(", ")", "return", "None", "if", "cli_args", "is", "None", "else", "(", "cli_args", ",", "restart",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/query.py#L377-L381
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/cookies.py
python
RequestsCookieJar.list_paths
(self)
return paths
Utility method to list all the paths in the jar.
Utility method to list all the paths in the jar.
[ "Utility", "method", "to", "list", "all", "the", "paths", "in", "the", "jar", "." ]
def list_paths(self): """Utility method to list all the paths in the jar.""" paths = [] for cookie in iter(self): if cookie.path not in paths: paths.append(cookie.path) return paths
[ "def", "list_paths", "(", "self", ")", ":", "paths", "=", "[", "]", "for", "cookie", "in", "iter", "(", "self", ")", ":", "if", "cookie", ".", "path", "not", "in", "paths", ":", "paths", ".", "append", "(", "cookie", ".", "path", ")", "return", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/cookies.py#L278-L284
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/proc.py
python
select_mp4
(name, **kwargs)
Function selecting the algorithm for a MP4 energy call and directing to specified or best-performance default modules.
Function selecting the algorithm for a MP4 energy call and directing to specified or best-performance default modules.
[ "Function", "selecting", "the", "algorithm", "for", "a", "MP4", "energy", "call", "and", "directing", "to", "specified", "or", "best", "-", "performance", "default", "modules", "." ]
def select_mp4(name, **kwargs): """Function selecting the algorithm for a MP4 energy call and directing to specified or best-performance default modules. """ reference = core.get_option('SCF', 'REFERENCE') mtd_type = core.get_global_option('MP_TYPE') module = core.get_global_option('QC_MODULE')...
[ "def", "select_mp4", "(", "name", ",", "*", "*", "kwargs", ")", ":", "reference", "=", "core", ".", "get_option", "(", "'SCF'", ",", "'REFERENCE'", ")", "mtd_type", "=", "core", ".", "get_global_option", "(", "'MP_TYPE'", ")", "module", "=", "core", ".",...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/proc.py#L1060-L1092
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/zipfile.py
python
ZipFile.extractall
(self, path=None, members=None, pwd=None)
Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist().
Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist().
[ "Extract", "all", "members", "from", "the", "archive", "to", "the", "current", "working", "directory", ".", "path", "specifies", "a", "different", "directory", "to", "extract", "to", ".", "members", "is", "optional", "and", "must", "be", "a", "subset", "of",...
def extractall(self, path=None, members=None, pwd=None): """Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). """ ...
[ "def", "extractall", "(", "self", ",", "path", "=", "None", ",", "members", "=", "None", ",", "pwd", "=", "None", ")", ":", "if", "members", "is", "None", ":", "members", "=", "self", ".", "namelist", "(", ")", "for", "zipinfo", "in", "members", ":...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/zipfile.py#L928-L938
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
MH.pack
(self)
Re-name messages to eliminate numbering gaps. Invalidates keys.
Re-name messages to eliminate numbering gaps. Invalidates keys.
[ "Re", "-", "name", "messages", "to", "eliminate", "numbering", "gaps", ".", "Invalidates", "keys", "." ]
def pack(self): """Re-name messages to eliminate numbering gaps. Invalidates keys.""" sequences = self.get_sequences() prev = 0 changes = [] for key in self.iterkeys(): if key - 1 != prev: changes.append((key, prev + 1)) if hasattr(os, ...
[ "def", "pack", "(", "self", ")", ":", "sequences", "=", "self", ".", "get_sequences", "(", ")", "prev", "=", "0", "changes", "=", "[", "]", "for", "key", "in", "self", ".", "iterkeys", "(", ")", ":", "if", "key", "-", "1", "!=", "prev", ":", "c...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1178-L1201
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/ops/tpu_ops.py
python
enqueue_tpu_embedding_sparse_tensor_batch
(sample_indices, embedding_indices, aggregation_weights, table_ids, device_ordinal, max_se...
return gen_tpu_ops.enqueue_tpu_embedding_sparse_tensor_batch( sample_indices=sample_indices, embedding_indices=embedding_indices, aggregation_weights=aggregation_weights, table_ids=table_ids, device_ordinal=device_ordinal, max_sequence_lengths=max_sequence_lengths, combiners=co...
A placeholder op for enqueueing embedding IDs to the TPU. Args: sample_indices: A list of rank 2 Tensors specifying the training example to which the corresponding embedding_indices and aggregation_weights values belong. It corresponds to sp_ids.indices in embedding_lookup_sparse(). If the size...
A placeholder op for enqueueing embedding IDs to the TPU.
[ "A", "placeholder", "op", "for", "enqueueing", "embedding", "IDs", "to", "the", "TPU", "." ]
def enqueue_tpu_embedding_sparse_tensor_batch(sample_indices, embedding_indices, aggregation_weights, table_ids, device_ordinal, ...
[ "def", "enqueue_tpu_embedding_sparse_tensor_batch", "(", "sample_indices", ",", "embedding_indices", ",", "aggregation_weights", ",", "table_ids", ",", "device_ordinal", ",", "max_sequence_lengths", "=", "None", ",", "num_features", "=", "None", ",", "combiners", "=", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/ops/tpu_ops.py#L390-L462
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/png/png.py
python
Test.testP2
(self)
2-bit palette.
2-bit palette.
[ "2", "-", "bit", "palette", "." ]
def testP2(self): "2-bit palette." a = (255,255,255) b = (200,120,120) c = (50,99,50) w = Writer(1, 4, bitdepth=2, palette=[a,b,c]) f = BytesIO() w.write_array(f, array('B', (0,1,1,2))) r = Reader(bytes=f.getvalue()) x,y,pixels,meta = r.asRGB8() ...
[ "def", "testP2", "(", "self", ")", ":", "a", "=", "(", "255", ",", "255", ",", "255", ")", "b", "=", "(", "200", ",", "120", ",", "120", ")", "c", "=", "(", "50", ",", "99", ",", "50", ")", "w", "=", "Writer", "(", "1", ",", "4", ",", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L2541-L2553
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/presenter/DrillPresenter.py
python
DrillPresenter._syncViewHeader
(self)
Synchronize the drill header with the model.
Synchronize the drill header with the model.
[ "Synchronize", "the", "drill", "header", "with", "the", "model", "." ]
def _syncViewHeader(self): """ Synchronize the drill header with the model. """ availableModes = self.model.getAvailableAcquisitionModes() instrument = self.model.getInstrument() acquisitionMode = self.model.getAcquisitionMode() cycle, exp = self.model.getCycleAnd...
[ "def", "_syncViewHeader", "(", "self", ")", ":", "availableModes", "=", "self", ".", "model", ".", "getAvailableAcquisitionModes", "(", ")", "instrument", "=", "self", ".", "model", ".", "getInstrument", "(", ")", "acquisitionMode", "=", "self", ".", "model", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/presenter/DrillPresenter.py#L442-L456
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/bindings/python/clang/cindex.py
python
SourceLocation.offset
(self)
return self._get_instantiation()[3]
Get the file offset represented by this source location.
Get the file offset represented by this source location.
[ "Get", "the", "file", "offset", "represented", "by", "this", "source", "location", "." ]
def offset(self): """Get the file offset represented by this source location.""" return self._get_instantiation()[3]
[ "def", "offset", "(", "self", ")", ":", "return", "self", ".", "_get_instantiation", "(", ")", "[", "3", "]" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L285-L287
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/request_validator.py
python
RequestValidator.validate_client_id
(self, client_id, request, *args, **kwargs)
Ensure client_id belong to a valid and active client. Note, while not strictly necessary it can often be very convenient to set request.client to the client object associated with the given client_id. :param request: oauthlib.common.Request :rtype: True or False Method...
Ensure client_id belong to a valid and active client.
[ "Ensure", "client_id", "belong", "to", "a", "valid", "and", "active", "client", "." ]
def validate_client_id(self, client_id, request, *args, **kwargs): """Ensure client_id belong to a valid and active client. Note, while not strictly necessary it can often be very convenient to set request.client to the client object associated with the given client_id. :param ...
[ "def", "validate_client_id", "(", "self", ",", "client_id", ",", "request", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError", "(", "'Subclasses must implement this method.'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/request_validator.py#L373-L387
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Netscape_Suite.py
python
Netscape_Suite_Events.Open_bookmark
(self, _object=None, _attributes={}, **_arguments)
Open bookmark: Opens a bookmark file Required argument: If not available, reloads the current bookmark file Keyword argument _attributes: AppleEvent attribute dictionary
Open bookmark: Opens a bookmark file Required argument: If not available, reloads the current bookmark file Keyword argument _attributes: AppleEvent attribute dictionary
[ "Open", "bookmark", ":", "Opens", "a", "bookmark", "file", "Required", "argument", ":", "If", "not", "available", "reloads", "the", "current", "bookmark", "file", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary" ]
def Open_bookmark(self, _object=None, _attributes={}, **_arguments): """Open bookmark: Opens a bookmark file Required argument: If not available, reloads the current bookmark file Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'MOSS' _subcode = ...
[ "def", "Open_bookmark", "(", "self", ",", "_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'MOSS'", "_subcode", "=", "'book'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No option...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Netscape_Suite.py#L15-L33
Manu343726/siplasplas
9fae7559f87087cf8ef34f04bd1e774b84b2ea9c
reference/cindex.py
python
Type.element_type
(self)
return result
Retrieve the Type of elements within this Type. If accessed on a type that is not an array, complex, or vector type, an exception will be raised.
Retrieve the Type of elements within this Type.
[ "Retrieve", "the", "Type", "of", "elements", "within", "this", "Type", "." ]
def element_type(self): """Retrieve the Type of elements within this Type. If accessed on a type that is not an array, complex, or vector type, an exception will be raised. """ result = conf.lib.clang_getElementType(self) if result.kind == TypeKind.INVALID: r...
[ "def", "element_type", "(", "self", ")", ":", "result", "=", "conf", ".", "lib", ".", "clang_getElementType", "(", "self", ")", "if", "result", ".", "kind", "==", "TypeKind", ".", "INVALID", ":", "raise", "Exception", "(", "'Element type not available on this ...
https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L1801-L1811
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/make_distrib.py
python
run
(command_line, working_dir)
return subprocess.check_call( args, cwd=working_dir, env=os.environ, shell=(sys.platform == 'win32'))
Run a command.
Run a command.
[ "Run", "a", "command", "." ]
def run(command_line, working_dir): """ Run a command. """ sys.stdout.write('-------- Running "'+command_line+'" in "'+\ working_dir+'"...'+"\n") args = shlex.split(command_line.replace('\\', '\\\\')) return subprocess.check_call( args, cwd=working_dir, env=os.environ, shell=(sys.platfo...
[ "def", "run", "(", "command_line", ",", "working_dir", ")", ":", "sys", ".", "stdout", ".", "write", "(", "'-------- Running \"'", "+", "command_line", "+", "'\" in \"'", "+", "working_dir", "+", "'\"...'", "+", "\"\\n\"", ")", "args", "=", "shlex", ".", "...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/make_distrib.py#L425-L431
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PropertyGrid.IsFrozen
(*args, **kwargs)
return _propgrid.PropertyGrid_IsFrozen(*args, **kwargs)
IsFrozen(self) -> bool Returns ``True`` if the window has been frozen and not thawed yet. :see: `Freeze` and `Thaw`
IsFrozen(self) -> bool
[ "IsFrozen", "(", "self", ")", "-", ">", "bool" ]
def IsFrozen(*args, **kwargs): """ IsFrozen(self) -> bool Returns ``True`` if the window has been frozen and not thawed yet. :see: `Freeze` and `Thaw` """ return _propgrid.PropertyGrid_IsFrozen(*args, **kwargs)
[ "def", "IsFrozen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_IsFrozen", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2174-L2182
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextObject.ConvertTenthsMMToPixelsDC
(*args, **kwargs)
return _richtext.RichTextObject_ConvertTenthsMMToPixelsDC(*args, **kwargs)
ConvertTenthsMMToPixelsDC(self, DC dc, int units) -> int
ConvertTenthsMMToPixelsDC(self, DC dc, int units) -> int
[ "ConvertTenthsMMToPixelsDC", "(", "self", "DC", "dc", "int", "units", ")", "-", ">", "int" ]
def ConvertTenthsMMToPixelsDC(*args, **kwargs): """ConvertTenthsMMToPixelsDC(self, DC dc, int units) -> int""" return _richtext.RichTextObject_ConvertTenthsMMToPixelsDC(*args, **kwargs)
[ "def", "ConvertTenthsMMToPixelsDC", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_ConvertTenthsMMToPixelsDC", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1391-L1393
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/msvc.py
python
pch_emitter
(target, source, env)
return (target, source)
Adds the object file target.
Adds the object file target.
[ "Adds", "the", "object", "file", "target", "." ]
def pch_emitter(target, source, env): """Adds the object file target.""" validate_vars(env) pch = None obj = None for t in target: if SCons.Util.splitext(str(t))[1] == '.pch': pch = t if SCons.Util.splitext(str(t))[1] == '.obj': obj = t if not obj: ...
[ "def", "pch_emitter", "(", "target", ",", "source", ",", "env", ")", ":", "validate_vars", "(", "env", ")", "pch", "=", "None", "obj", "=", "None", "for", "t", "in", "target", ":", "if", "SCons", ".", "Util", ".", "splitext", "(", "str", "(", "t", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/msvc.py#L77-L96
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/Paste/paste/util/mimeparse.py
python
parse_media_range
(range)
return type, subtype, params
Carves up a media range and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/*;q=0.5' would get parsed into: ('application', '*', {'q', '0.5'}) In addition this f...
Carves up a media range and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/*;q=0.5' would get parsed into:
[ "Carves", "up", "a", "media", "range", "and", "returns", "a", "tuple", "of", "the", "(", "type", "subtype", "params", ")", "where", "params", "is", "a", "dictionary", "of", "all", "the", "parameters", "for", "the", "media", "range", ".", "For", "example"...
def parse_media_range(range): """Carves up a media range and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/*;q=0.5' would get parsed into: ('application', '*', {'q...
[ "def", "parse_media_range", "(", "range", ")", ":", "type", ",", "subtype", ",", "params", "=", "parse_mime_type", "(", "range", ")", "try", ":", "if", "not", "0", "<=", "float", "(", "params", "[", "'q'", "]", ")", "<=", "1", ":", "raise", "ValueErr...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/util/mimeparse.py#L51-L70
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
PickerBase.SetInternalMargin
(*args, **kwargs)
return _controls_.PickerBase_SetInternalMargin(*args, **kwargs)
SetInternalMargin(self, int newmargin) Sets the margin (in pixels) between the picker and the text control.
SetInternalMargin(self, int newmargin)
[ "SetInternalMargin", "(", "self", "int", "newmargin", ")" ]
def SetInternalMargin(*args, **kwargs): """ SetInternalMargin(self, int newmargin) Sets the margin (in pixels) between the picker and the text control. """ return _controls_.PickerBase_SetInternalMargin(*args, **kwargs)
[ "def", "SetInternalMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "PickerBase_SetInternalMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L6750-L6756
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py
python
getLevelName
(level)
return "Level %s" % level
Return the textual representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name you have associated with 'level' is returned....
Return the textual representation of logging level 'level'.
[ "Return", "the", "textual", "representation", "of", "logging", "level", "level", "." ]
def getLevelName(level): """ Return the textual representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name you have ...
[ "def", "getLevelName", "(", "level", ")", ":", "# See Issues #22386, #27937 and #29220 for why it's this way", "result", "=", "_levelToName", ".", "get", "(", "level", ")", "if", "result", "is", "not", "None", ":", "return", "result", "result", "=", "_nameToLevel", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L117-L138
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/numbers.py
python
complex_abs_impl
(context, builder, sig, args)
return impl_ret_untracked(context, builder, sig.return_type, res)
abs(z) := hypot(z.real, z.imag)
abs(z) := hypot(z.real, z.imag)
[ "abs", "(", "z", ")", ":", "=", "hypot", "(", "z", ".", "real", "z", ".", "imag", ")" ]
def complex_abs_impl(context, builder, sig, args): """ abs(z) := hypot(z.real, z.imag) """ def complex_abs(z): return math.hypot(z.real, z.imag) res = context.compile_internal(builder, complex_abs, sig, args) return impl_ret_untracked(context, builder, sig.return_type, res)
[ "def", "complex_abs_impl", "(", "context", ",", "builder", ",", "sig", ",", "args", ")", ":", "def", "complex_abs", "(", "z", ")", ":", "return", "math", ".", "hypot", "(", "z", ".", "real", ",", "z", ".", "imag", ")", "res", "=", "context", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/numbers.py#L1147-L1155
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/_custom_op/fused_abs_max1_impl.py
python
shape3_1000
(tik_instance, input_x, res)
return tik_instance, res
shape3_1000
shape3_1000
[ "shape3_1000" ]
def shape3_1000(tik_instance, input_x, res): """shape3_1000""" blocks = 32 each_block_element = 7 * 128 * 128 // 32 + 4 * 128 phase_0 = 7 * 128 * 128 // 32 with tik_instance.for_range(0, blocks, block_num=blocks) as block_index: input_x_ub = tik_instance.Tensor("float32", (each_block_element...
[ "def", "shape3_1000", "(", "tik_instance", ",", "input_x", ",", "res", ")", ":", "blocks", "=", "32", "each_block_element", "=", "7", "*", "128", "*", "128", "//", "32", "+", "4", "*", "128", "phase_0", "=", "7", "*", "128", "*", "128", "//", "32",...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/fused_abs_max1_impl.py#L171-L204
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues._GetKeyFlagsForModule
(self, module)
return key_flags
Returns the list of key flags for a module. Args: module: A module object or a module name (a string) Returns: A new list of Flag objects. Caller may update this list as he wishes: none of those changes will affect the internals of this FlagValue object.
Returns the list of key flags for a module.
[ "Returns", "the", "list", "of", "key", "flags", "for", "a", "module", "." ]
def _GetKeyFlagsForModule(self, module): """Returns the list of key flags for a module. Args: module: A module object or a module name (a string) Returns: A new list of Flag objects. Caller may update this list as he wishes: none of those changes will affect the internals of this ...
[ "def", "_GetKeyFlagsForModule", "(", "self", ",", "module", ")", ":", "if", "not", "isinstance", "(", "module", ",", "str", ")", ":", "module", "=", "module", ".", "__name__", "# Any flag is a key flag for the module that defined it. NOTE:", "# key_flags is a fresh lis...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L929-L952
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/signal/signaltools.py
python
_validate_pad
(padtype, padlen, x, axis, ntaps)
return edge, ext
Helper to validate padding for filtfilt
Helper to validate padding for filtfilt
[ "Helper", "to", "validate", "padding", "for", "filtfilt" ]
def _validate_pad(padtype, padlen, x, axis, ntaps): """Helper to validate padding for filtfilt""" if padtype not in ['even', 'odd', 'constant', None]: raise ValueError(("Unknown value '%s' given to padtype. padtype " "must be 'even', 'odd', 'constant', or None.") % ...
[ "def", "_validate_pad", "(", "padtype", ",", "padlen", ",", "x", ",", "axis", ",", "ntaps", ")", ":", "if", "padtype", "not", "in", "[", "'even'", ",", "'odd'", ",", "'constant'", ",", "None", "]", ":", "raise", "ValueError", "(", "(", "\"Unknown value...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/signaltools.py#L3109-L3141
tangzhenyu/Scene-Text-Understanding
0f7ffc7aea5971a50cdc03d33d0a41075285948b
ctpn_crnn_ocr/CTPN/src/other.py
python
prepare_img
(im, mean)
return im_data
transform img into caffe's input img.
transform img into caffe's input img.
[ "transform", "img", "into", "caffe", "s", "input", "img", "." ]
def prepare_img(im, mean): """ transform img into caffe's input img. """ im_data=np.transpose(im-mean, (2, 0, 1)) return im_data
[ "def", "prepare_img", "(", "im", ",", "mean", ")", ":", "im_data", "=", "np", ".", "transpose", "(", "im", "-", "mean", ",", "(", "2", ",", "0", ",", "1", ")", ")", "return", "im_data" ]
https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/src/other.py#L6-L11
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/bandit/data_containers.py
python
SampleArm.variance
(self)
return self._variance
Return the variance of sampled tries, always greater than or equal to zero, if there is no variance it is equal to None.
Return the variance of sampled tries, always greater than or equal to zero, if there is no variance it is equal to None.
[ "Return", "the", "variance", "of", "sampled", "tries", "always", "greater", "than", "or", "equal", "to", "zero", "if", "there", "is", "no", "variance", "it", "is", "equal", "to", "None", "." ]
def variance(self): """Return the variance of sampled tries, always greater than or equal to zero, if there is no variance it is equal to None.""" return self._variance
[ "def", "variance", "(", "self", ")", ":", "return", "self", ".", "_variance" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/bandit/data_containers.py#L120-L122
realm/realm-core
5b2ee26683b4dc6a99afdea4d7a8b54888b89d02
evergreen/hang_analyzer/src/hang_analyzer.py
python
HangAnalyzer._get_process_logger
(self, pinfo)
return process_logger
Return the process logger from options specified.
Return the process logger from options specified.
[ "Return", "the", "process", "logger", "from", "options", "specified", "." ]
def _get_process_logger(self, pinfo): """Return the process logger from options specified.""" process_logger = logging.Logger("process", level=logging.DEBUG) #process_logger.mongo_process_filename = None if 'stdout' in self.options.debugger_output: s_handler = logging.Stream...
[ "def", "_get_process_logger", "(", "self", ",", "pinfo", ")", ":", "process_logger", "=", "logging", ".", "Logger", "(", "\"process\"", ",", "level", "=", "logging", ".", "DEBUG", ")", "#process_logger.mongo_process_filename = None", "if", "'stdout'", "in", "self"...
https://github.com/realm/realm-core/blob/5b2ee26683b4dc6a99afdea4d7a8b54888b89d02/evergreen/hang_analyzer/src/hang_analyzer.py#L143-L160
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/elistmix.py
python
ListRowHighlighter.SetHighlightMode
(self, mode)
Set the highlighting mode to either HIGHLIGHT_EVEN or to HIGHLIGHT_ODD. Call L{RefreshRows} afterwards to update the list state. @param mode: HIGHLIGHT_* mode value
Set the highlighting mode to either HIGHLIGHT_EVEN or to HIGHLIGHT_ODD. Call L{RefreshRows} afterwards to update the list state. @param mode: HIGHLIGHT_* mode value
[ "Set", "the", "highlighting", "mode", "to", "either", "HIGHLIGHT_EVEN", "or", "to", "HIGHLIGHT_ODD", ".", "Call", "L", "{", "RefreshRows", "}", "afterwards", "to", "update", "the", "list", "state", ".", "@param", "mode", ":", "HIGHLIGHT_", "*", "mode", "valu...
def SetHighlightMode(self, mode): """Set the highlighting mode to either HIGHLIGHT_EVEN or to HIGHLIGHT_ODD. Call L{RefreshRows} afterwards to update the list state. @param mode: HIGHLIGHT_* mode value """ self._mode = mode
[ "def", "SetHighlightMode", "(", "self", ",", "mode", ")", ":", "self", ".", "_mode", "=", "mode" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/elistmix.py#L96-L103
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/integrate/python/ops/odes.py
python
_interp_fit
(y0, y1, y_mid, f0, f1, dt)
return [a, b, c, d, e]
Fit coefficients for 4th order polynomial interpolation. Args: y0: function value at the start of the interval. y1: function value at the end of the interval. y_mid: function value at the mid-point of the interval. f0: derivative value at the start of the interval. f1: derivative value at the end...
Fit coefficients for 4th order polynomial interpolation.
[ "Fit", "coefficients", "for", "4th", "order", "polynomial", "interpolation", "." ]
def _interp_fit(y0, y1, y_mid, f0, f1, dt): """Fit coefficients for 4th order polynomial interpolation. Args: y0: function value at the start of the interval. y1: function value at the end of the interval. y_mid: function value at the mid-point of the interval. f0: derivative value at the start of ...
[ "def", "_interp_fit", "(", "y0", ",", "y1", ",", "y_mid", ",", "f0", ",", "f1", ",", "dt", ")", ":", "# a, b, c, d, e = sympy.symbols('a b c d e')", "# x, dt, y0, y1, y_mid, f0, f1 = sympy.symbols('x dt y0 y1 y_mid f0 f1')", "# p = a * x ** 4 + b * x ** 3 + c * x ** 2 + d * x + e...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/integrate/python/ops/odes.py#L136-L171
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdata.py
python
Rdata.choose_relativity
(self, origin = None, relativize = True)
Convert any domain names in the rdata to the specified relativization.
Convert any domain names in the rdata to the specified relativization.
[ "Convert", "any", "domain", "names", "in", "the", "rdata", "to", "the", "specified", "relativization", "." ]
def choose_relativity(self, origin = None, relativize = True): """Convert any domain names in the rdata to the specified relativization. """ pass
[ "def", "choose_relativity", "(", "self", ",", "origin", "=", "None", ",", "relativize", "=", "True", ")", ":", "pass" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdata.py#L297-L302
deepmind/spiral
5ee538cedf1d9cc827ced93fe86a44f8b8742ac0
spiral/agents/default.py
python
Agent.step
(self, step_type, observation, prev_state)
return agent_output, new_state
Computes a single step of the agent.
Computes a single step of the agent.
[ "Computes", "a", "single", "step", "of", "the", "agent", "." ]
def step(self, step_type, observation, prev_state): """Computes a single step of the agent.""" with self._capture_variables(): should_reset = tf.equal(step_type, environment.StepType.FIRST) torso_output = self._torso( observation, prev_state.prev...
[ "def", "step", "(", "self", ",", "step_type", ",", "observation", ",", "prev_state", ")", ":", "with", "self", ".", "_capture_variables", "(", ")", ":", "should_reset", "=", "tf", ".", "equal", "(", "step_type", ",", "environment", ".", "StepType", ".", ...
https://github.com/deepmind/spiral/blob/5ee538cedf1d9cc827ced93fe86a44f8b8742ac0/spiral/agents/default.py#L292-L315
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/generator/analyzer.py
python
_GetCompileTargets
(matching_targets, supplied_targets)
return result
Returns the set of Targets that require a build. matching_targets: targets that changed and need to be built. supplied_targets: set of targets supplied to analyzer to search from.
Returns the set of Targets that require a build. matching_targets: targets that changed and need to be built. supplied_targets: set of targets supplied to analyzer to search from.
[ "Returns", "the", "set", "of", "Targets", "that", "require", "a", "build", ".", "matching_targets", ":", "targets", "that", "changed", "and", "need", "to", "be", "built", ".", "supplied_targets", ":", "set", "of", "targets", "supplied", "to", "analyzer", "to...
def _GetCompileTargets(matching_targets, supplied_targets): """Returns the set of Targets that require a build. matching_targets: targets that changed and need to be built. supplied_targets: set of targets supplied to analyzer to search from.""" result = set() for target in matching_targets: print('findin...
[ "def", "_GetCompileTargets", "(", "matching_targets", ",", "supplied_targets", ")", ":", "result", "=", "set", "(", ")", "for", "target", "in", "matching_targets", ":", "print", "(", "'finding compile targets for match'", ",", "target", ".", "name", ")", "_AddComp...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/analyzer.py#L499-L507
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/geometry/tf_conversions/src/tf_conversions/posemath.py
python
toMsg
(f)
return p
:param f: input pose :type f: :class:`PyKDL.Frame` Return a ROS Pose message for the Frame f.
:param f: input pose :type f: :class:`PyKDL.Frame`
[ ":", "param", "f", ":", "input", "pose", ":", "type", "f", ":", ":", "class", ":", "PyKDL", ".", "Frame" ]
def toMsg(f): """ :param f: input pose :type f: :class:`PyKDL.Frame` Return a ROS Pose message for the Frame f. """ p = Pose() p.orientation.x, p.orientation.y, p.orientation.z, p.orientation.w = f.M.GetQuaternion() p.position.x = f.p[0] p.position.y = f.p[1] p.position.z = f.p...
[ "def", "toMsg", "(", "f", ")", ":", "p", "=", "Pose", "(", ")", "p", ".", "orientation", ".", "x", ",", "p", ".", "orientation", ".", "y", ",", "p", ".", "orientation", ".", "z", ",", "p", ".", "orientation", ".", "w", "=", "f", ".", "M", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/geometry/tf_conversions/src/tf_conversions/posemath.py#L104-L117
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py
python
Transform.__call__
(self, input_series=None)
return self.return_type(*output_series)
Apply this `Transform` to the provided `Series`, producing 'Series'. Args: input_series: None, a `Series`, or a list of input `Series`, acting as positional arguments. Returns: A namedtuple of the output `Series`. Raises: ValueError: `input_series` does not have expected length
Apply this `Transform` to the provided `Series`, producing 'Series'.
[ "Apply", "this", "Transform", "to", "the", "provided", "Series", "producing", "Series", "." ]
def __call__(self, input_series=None): """Apply this `Transform` to the provided `Series`, producing 'Series'. Args: input_series: None, a `Series`, or a list of input `Series`, acting as positional arguments. Returns: A namedtuple of the output `Series`. Raises: ValueError...
[ "def", "__call__", "(", "self", ",", "input_series", "=", "None", ")", ":", "input_series", "=", "_make_list_of_series", "(", "input_series", ")", "if", "len", "(", "input_series", ")", "!=", "self", ".", "input_valency", ":", "raise", "ValueError", "(", "\"...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L203-L224
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBData.CreateDataFromSInt32Array
(endian, addr_byte_size, array)
return _lldb.SBData_CreateDataFromSInt32Array(endian, addr_byte_size, array)
CreateDataFromSInt32Array(lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t * array) -> SBData
CreateDataFromSInt32Array(lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t * array) -> SBData
[ "CreateDataFromSInt32Array", "(", "lldb", "::", "ByteOrder", "endian", "uint32_t", "addr_byte_size", "int32_t", "*", "array", ")", "-", ">", "SBData" ]
def CreateDataFromSInt32Array(endian, addr_byte_size, array): """CreateDataFromSInt32Array(lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t * array) -> SBData""" return _lldb.SBData_CreateDataFromSInt32Array(endian, addr_byte_size, array)
[ "def", "CreateDataFromSInt32Array", "(", "endian", ",", "addr_byte_size", ",", "array", ")", ":", "return", "_lldb", ".", "SBData_CreateDataFromSInt32Array", "(", "endian", ",", "addr_byte_size", ",", "array", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3451-L3453
bingwin/MicroChat
81d9a71a212c1cbca5bba497ec42659a7d25dccf
mars/lint/cpplint.py
python
CleanseComments
(line)
return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.
Removes //-comments and single-line C-style /* */ comments.
[ "Removes", "//", "-", "comments", "and", "single", "-", "line", "C", "-", "style", "/", "*", "*", "/", "comments", "." ]
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos]...
[ "def", "CleanseComments", "(", "line", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", "and", "not", "IsCppString", "(", "line", "[", ":", "commentpos", "]", ")", ":", "line", "=", "line", "[", ...
https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L1279-L1292
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Log.TimeStamp
(*args, **kwargs)
return _misc_.Log_TimeStamp(*args, **kwargs)
TimeStamp() -> String
TimeStamp() -> String
[ "TimeStamp", "()", "-", ">", "String" ]
def TimeStamp(*args, **kwargs): """TimeStamp() -> String""" return _misc_.Log_TimeStamp(*args, **kwargs)
[ "def", "TimeStamp", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Log_TimeStamp", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1600-L1602
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/thermostats.py
python
ThermoNMGLE.step
(self)
Updates the thermostat in NM representation by looping over the individual DOFs.
Updates the thermostat in NM representation by looping over the individual DOFs.
[ "Updates", "the", "thermostat", "in", "NM", "representation", "by", "looping", "over", "the", "individual", "DOFs", "." ]
def step(self): """Updates the thermostat in NM representation by looping over the individual DOFs. """ for t in self._thermos: t.step()
[ "def", "step", "(", "self", ")", ":", "for", "t", "in", "self", ".", "_thermos", ":", "t", ".", "step", "(", ")" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/thermostats.py#L818-L824
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/directtools/__init__.py
python
_finalizeprofileE
(axes)
Set axes for const E axes.
Set axes for const E axes.
[ "Set", "axes", "for", "const", "E", "axes", "." ]
def _finalizeprofileE(axes): """Set axes for const E axes.""" if axes.get_xscale() == 'linear': axes.set_xlim(xmin=0.) axes.set_xlabel(r'$Q$ ($\mathrm{\AA}^{-1}$)') if axes.get_yscale() == 'linear': axes.set_ylim(0.)
[ "def", "_finalizeprofileE", "(", "axes", ")", ":", "if", "axes", ".", "get_xscale", "(", ")", "==", "'linear'", ":", "axes", ".", "set_xlim", "(", "xmin", "=", "0.", ")", "axes", ".", "set_xlabel", "(", "r'$Q$ ($\\mathrm{\\AA}^{-1}$)'", ")", "if", "axes", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/directtools/__init__.py#L122-L128
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/frameworks/harmfit.py
python
HarmFunctor.__init__
(self, A, coeff, xmin, xSpan)
Initialize.
Initialize.
[ "Initialize", "." ]
def __init__(self, A, coeff, xmin, xSpan): """Initialize.""" self.A_ = A self.coeff_ = coeff self.xmin_ = xmin self.xSpan_ = xSpan
[ "def", "__init__", "(", "self", ",", "A", ",", "coeff", ",", "xmin", ",", "xSpan", ")", ":", "self", ".", "A_", "=", "A", "self", ".", "coeff_", "=", "coeff", "self", ".", "xmin_", "=", "xmin", "self", ".", "xSpan_", "=", "xSpan" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/harmfit.py#L11-L16
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/excel/_base.py
python
ExcelWriter.write_cells
( self, cells, sheet_name=None, startrow=0, startcol=0, freeze_panes=None )
Write given formatted cells into Excel an excel sheet Parameters ---------- cells : generator cell of formatted data to save to Excel sheet sheet_name : str, default None Name of Excel sheet, if None, then use self.cur_sheet startrow : upper left cell row...
Write given formatted cells into Excel an excel sheet
[ "Write", "given", "formatted", "cells", "into", "Excel", "an", "excel", "sheet" ]
def write_cells( self, cells, sheet_name=None, startrow=0, startcol=0, freeze_panes=None ): """ Write given formatted cells into Excel an excel sheet Parameters ---------- cells : generator cell of formatted data to save to Excel sheet sheet_name ...
[ "def", "write_cells", "(", "self", ",", "cells", ",", "sheet_name", "=", "None", ",", "startrow", "=", "0", ",", "startcol", "=", "0", ",", "freeze_panes", "=", "None", ")", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/excel/_base.py#L658-L675
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageMorph.py
python
MorphOp.save_lut
(self, filename)
Save an operator to an mrl file
Save an operator to an mrl file
[ "Save", "an", "operator", "to", "an", "mrl", "file" ]
def save_lut(self, filename): """Save an operator to an mrl file""" if self.lut is None: raise Exception("No operator loaded") with open(filename, "wb") as f: f.write(self.lut)
[ "def", "save_lut", "(", "self", ",", "filename", ")", ":", "if", "self", ".", "lut", "is", "None", ":", "raise", "Exception", "(", "\"No operator loaded\"", ")", "with", "open", "(", "filename", ",", "\"wb\"", ")", "as", "f", ":", "f", ".", "write", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageMorph.py#L236-L241
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_tensor_shape.py
python
broadcast_to
(rt_input, shape, broadcast_inner_dimensions=True)
Broadcasts a potentially ragged tensor to a ragged shape. Tiles `rt_input` as necessary to match the given shape. Behavior is undefined if `rt_input` is not broadcast-compatible with `shape`. Args: rt_input: The potentially ragged tensor to broadcast. shape: A `RaggedTensorDynamicShape` broadcast_i...
Broadcasts a potentially ragged tensor to a ragged shape.
[ "Broadcasts", "a", "potentially", "ragged", "tensor", "to", "a", "ragged", "shape", "." ]
def broadcast_to(rt_input, shape, broadcast_inner_dimensions=True): """Broadcasts a potentially ragged tensor to a ragged shape. Tiles `rt_input` as necessary to match the given shape. Behavior is undefined if `rt_input` is not broadcast-compatible with `shape`. Args: rt_input: The potentially ragged ten...
[ "def", "broadcast_to", "(", "rt_input", ",", "shape", ",", "broadcast_inner_dimensions", "=", "True", ")", ":", "if", "not", "isinstance", "(", "shape", ",", "RaggedTensorDynamicShape", ")", ":", "raise", "TypeError", "(", "'shape must be a RaggedTensorDynamicShape'",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_tensor_shape.py#L475-L502
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/service_reflection.py
python
_ServiceBuilder.BuildService
(self, cls)
Constructs the service class. Args: cls: The class that will be constructed.
Constructs the service class.
[ "Constructs", "the", "service", "class", "." ]
def BuildService(self, cls): """Constructs the service class. Args: cls: The class that will be constructed. """ # CallMethod needs to operate with an instance of the Service class. This # internal wrapper function exists only to be able to pass the service # instance to the method that ...
[ "def", "BuildService", "(", "self", ",", "cls", ")", ":", "# CallMethod needs to operate with an instance of the Service class. This", "# internal wrapper function exists only to be able to pass the service", "# instance to the method that does the real CallMethod work.", "def", "_WrapCallMe...
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/service_reflection.py#L133-L154
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/task_generation/timeout.py
python
TimeoutEstimate.generate_timeout_cmd
(self, is_patch: bool, repeat_factor: int, use_default: bool = False)
return TimeoutInfo.overridden(timeout=test_timeout, exec_timeout=task_timeout)
Create the timeout info to use to create a timeout shrub command. :param is_patch: Whether the command is being created in a patch build. :param repeat_factor: How many times the suite will be repeated. :param use_default: Should the default timeout be used. :return: Timeout info for th...
Create the timeout info to use to create a timeout shrub command.
[ "Create", "the", "timeout", "info", "to", "use", "to", "create", "a", "timeout", "shrub", "command", "." ]
def generate_timeout_cmd(self, is_patch: bool, repeat_factor: int, use_default: bool = False) -> TimeoutInfo: """ Create the timeout info to use to create a timeout shrub command. :param is_patch: Whether the command is being created in a patch build. :param...
[ "def", "generate_timeout_cmd", "(", "self", ",", "is_patch", ":", "bool", ",", "repeat_factor", ":", "int", ",", "use_default", ":", "bool", "=", "False", ")", "->", "TimeoutInfo", ":", "if", "not", "self", ".", "is_specified", "or", "use_default", ":", "r...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/task_generation/timeout.py#L80-L109
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame._convert
( self: FrameOrSeries, datetime: bool_t = False, numeric: bool_t = False, timedelta: bool_t = False, coerce: bool_t = False, copy: bool_t = True, )
return self._constructor( self._data.convert( datetime=datetime, numeric=numeric, timedelta=timedelta, coerce=coerce, copy=copy, ) ).__finalize__(self)
Attempt to infer better dtype for object columns Parameters ---------- datetime : bool, default False If True, convert to date where possible. numeric : bool, default False If True, attempt to convert to numbers (including strings), with unconvertible...
Attempt to infer better dtype for object columns
[ "Attempt", "to", "infer", "better", "dtype", "for", "object", "columns" ]
def _convert( self: FrameOrSeries, datetime: bool_t = False, numeric: bool_t = False, timedelta: bool_t = False, coerce: bool_t = False, copy: bool_t = True, ) -> FrameOrSeries: """ Attempt to infer better dtype for object columns Parameters ...
[ "def", "_convert", "(", "self", ":", "FrameOrSeries", ",", "datetime", ":", "bool_t", "=", "False", ",", "numeric", ":", "bool_t", "=", "False", ",", "timedelta", ":", "bool_t", "=", "False", ",", "coerce", ":", "bool_t", "=", "False", ",", "copy", ":"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L5826-L5871
msitt/blpapi-python
bebcf43668c9e5f5467b1f685f9baebbfc45bc87
src/blpapi/element.py
python
Element.toString
(self, level=0, spacesPerLevel=4)
return internals.blpapi_Element_printHelper(self.__handle, level, spacesPerLevel)
Format this :class:`Element` to the string at the specified indentation level. Args: level (int): Indentation level spacesPerLevel (int): Number of spaces per indentation level for this and all nested objects Returns: str: This element format...
Format this :class:`Element` to the string at the specified indentation level.
[ "Format", "this", ":", "class", ":", "Element", "to", "the", "string", "at", "the", "specified", "indentation", "level", "." ]
def toString(self, level=0, spacesPerLevel=4): """Format this :class:`Element` to the string at the specified indentation level. Args: level (int): Indentation level spacesPerLevel (int): Number of spaces per indentation level for this and all nested obje...
[ "def", "toString", "(", "self", ",", "level", "=", "0", ",", "spacesPerLevel", "=", "4", ")", ":", "self", ".", "__assertIsValid", "(", ")", "return", "internals", ".", "blpapi_Element_printHelper", "(", "self", ".", "__handle", ",", "level", ",", "spacesP...
https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/element.py#L547-L567
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
ppapi/cpp/documentation/doxy_cleanup.py
python
main
()
return 0
Main entry for the doxy_cleanup utility doxy_cleanup takes a list of html files and modifies them in place.
Main entry for the doxy_cleanup utility
[ "Main", "entry", "for", "the", "doxy_cleanup", "utility" ]
def main(): '''Main entry for the doxy_cleanup utility doxy_cleanup takes a list of html files and modifies them in place.''' parser = optparse.OptionParser(usage='Usage: %prog [options] files...') parser.add_option('-m', '--move', dest='move', action='store_true', default=False, help='mo...
[ "def", "main", "(", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", "usage", "=", "'Usage: %prog [options] files...'", ")", "parser", ".", "add_option", "(", "'-m'", ",", "'--move'", ",", "dest", "=", "'move'", ",", "action", "=", "'store_true...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/cpp/documentation/doxy_cleanup.py#L102-L138
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pylowering.py
python
PyLower.storevar
(self, value, name, clobber=False)
Stores a llvm value and allocate stack slot if necessary. The llvm value can be of arbitrary type.
Stores a llvm value and allocate stack slot if necessary. The llvm value can be of arbitrary type.
[ "Stores", "a", "llvm", "value", "and", "allocate", "stack", "slot", "if", "necessary", ".", "The", "llvm", "value", "can", "be", "of", "arbitrary", "type", "." ]
def storevar(self, value, name, clobber=False): """ Stores a llvm value and allocate stack slot if necessary. The llvm value can be of arbitrary type. """ is_redefine = name in self._live_vars and not clobber ptr = self._getvar(name, ltype=value.type) if is_redefi...
[ "def", "storevar", "(", "self", ",", "value", ",", "name", ",", "clobber", "=", "False", ")", ":", "is_redefine", "=", "name", "in", "self", ".", "_live_vars", "and", "not", "clobber", "ptr", "=", "self", ".", "_getvar", "(", "name", ",", "ltype", "=...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pylowering.py#L577-L593
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/core/matrix.py
python
MultMatrix.cols
(self)
return self.A.cols()
Return number of columns (using underlying matrix).
Return number of columns (using underlying matrix).
[ "Return", "number", "of", "columns", "(", "using", "underlying", "matrix", ")", "." ]
def cols(self): """Return number of columns (using underlying matrix).""" return self.A.cols()
[ "def", "cols", "(", "self", ")", ":", "return", "self", ".", "A", ".", "cols", "(", ")" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/core/matrix.py#L243-L245
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
TokenGroup.get_tokens
(tu, extent)
Helper method to return all tokens in an extent. This functionality is needed multiple places in this module. We define it here because it seems like a logical place.
Helper method to return all tokens in an extent.
[ "Helper", "method", "to", "return", "all", "tokens", "in", "an", "extent", "." ]
def get_tokens(tu, extent): """Helper method to return all tokens in an extent. This functionality is needed multiple places in this module. We define it here because it seems like a logical place. """ tokens_memory = POINTER(Token)() tokens_count = c_uint() con...
[ "def", "get_tokens", "(", "tu", ",", "extent", ")", ":", "tokens_memory", "=", "POINTER", "(", "Token", ")", "(", ")", "tokens_count", "=", "c_uint", "(", ")", "conf", ".", "lib", ".", "clang_tokenize", "(", "tu", ",", "extent", ",", "byref", "(", "t...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L541-L571
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/code.py
python
interact
(banner=None, readfunc=None, local=None)
Closely emulate the interactive Python interpreter. This is a backwards compatible interface to the InteractiveConsole class. When readfunc is not specified, it attempts to import the readline module to enable GNU readline if it is available. Arguments (all optional, all default to None): banner...
Closely emulate the interactive Python interpreter.
[ "Closely", "emulate", "the", "interactive", "Python", "interpreter", "." ]
def interact(banner=None, readfunc=None, local=None): """Closely emulate the interactive Python interpreter. This is a backwards compatible interface to the InteractiveConsole class. When readfunc is not specified, it attempts to import the readline module to enable GNU readline if it is available. ...
[ "def", "interact", "(", "banner", "=", "None", ",", "readfunc", "=", "None", ",", "local", "=", "None", ")", ":", "console", "=", "InteractiveConsole", "(", "local", ")", "if", "readfunc", "is", "not", "None", ":", "console", ".", "raw_input", "=", "re...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/code.py#L284-L306
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/cachecontrol/controller.py
python
CacheController._urlnorm
(cls, uri)
return defrag_uri
Normalize the URL to create a safe key for the cache
Normalize the URL to create a safe key for the cache
[ "Normalize", "the", "URL", "to", "create", "a", "safe", "key", "for", "the", "cache" ]
def _urlnorm(cls, uri): """Normalize the URL to create a safe key for the cache""" (scheme, authority, path, query, fragment) = parse_uri(uri) if not scheme or not authority: raise Exception("Only absolute URIs are allowed. uri = %s" % uri) scheme = scheme.lower() au...
[ "def", "_urlnorm", "(", "cls", ",", "uri", ")", ":", "(", "scheme", ",", "authority", ",", "path", ",", "query", ",", "fragment", ")", "=", "parse_uri", "(", "uri", ")", "if", "not", "scheme", "or", "not", "authority", ":", "raise", "Exception", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/cachecontrol/controller.py#L43-L60