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
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/utilities/key_utils.py
python
index_to_slice
(idx)
return slice(idx, idx+1, None)
Converts an index to a slice. Args: idx: int The index. Returns: slice A slice equivalent to the index.
Converts an index to a slice.
[ "Converts", "an", "index", "to", "a", "slice", "." ]
def index_to_slice(idx) -> slice: """Converts an index to a slice. Args: idx: int The index. Returns: slice A slice equivalent to the index. """ return slice(idx, idx+1, None)
[ "def", "index_to_slice", "(", "idx", ")", "->", "slice", ":", "return", "slice", "(", "idx", ",", "idx", "+", "1", ",", "None", ")" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/utilities/key_utils.py#L125-L136
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatnotebook.py
python
FlatNotebook.SetPageShapeAngle
(self, page_index, angle)
Sets the angle associated to a tab. :param `page_index`: the index of the tab for which we wish to get the shape angle; :param `angle`: the new shape angle for the tab (must be less than 15 degrees).
Sets the angle associated to a tab.
[ "Sets", "the", "angle", "associated", "to", "a", "tab", "." ]
def SetPageShapeAngle(self, page_index, angle): """ Sets the angle associated to a tab. :param `page_index`: the index of the tab for which we wish to get the shape angle; :param `angle`: the new shape angle for the tab (must be less than 15 degrees). """ if page_index ...
[ "def", "SetPageShapeAngle", "(", "self", ",", "page_index", ",", "angle", ")", ":", "if", "page_index", "<", "0", "or", "page_index", ">=", "len", "(", "self", ".", "_pages", ".", "_pagesInfoVec", ")", ":", "return", "if", "angle", ">", "15", ":", "ret...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L4631-L4645
Tencent/TNN
7acca99f54c55747b415a4c57677403eebc7b706
third_party/flatbuffers/python/flatbuffers/flexbuffers.py
python
Loads
(buf)
return GetRoot(buf).Value
Returns python object decoded from the buffer.
Returns python object decoded from the buffer.
[ "Returns", "python", "object", "decoded", "from", "the", "buffer", "." ]
def Loads(buf): """Returns python object decoded from the buffer.""" return GetRoot(buf).Value
[ "def", "Loads", "(", "buf", ")", ":", "return", "GetRoot", "(", "buf", ")", ".", "Value" ]
https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/flexbuffers.py#L1525-L1527
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/aui.py
python
AuiMDIParentFrame.GetArtProvider
(*args, **kwargs)
return _aui.AuiMDIParentFrame_GetArtProvider(*args, **kwargs)
GetArtProvider(self) -> AuiTabArt
GetArtProvider(self) -> AuiTabArt
[ "GetArtProvider", "(", "self", ")", "-", ">", "AuiTabArt" ]
def GetArtProvider(*args, **kwargs): """GetArtProvider(self) -> AuiTabArt""" return _aui.AuiMDIParentFrame_GetArtProvider(*args, **kwargs)
[ "def", "GetArtProvider", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIParentFrame_GetArtProvider", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1441-L1443
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
chrome/tools/check_grd_for_unused_strings.py
python
CheckForUnusedGrdIDsInSources
(grd_files, src_dirs)
return 0
Will collect the message ids out of the given GRD files and then scan the source directories to try and figure out what ids are not currently being used by any source. grd_files: A list of GRD files to collect the ids from. src_dirs: A list of directories to walk looking for source files.
Will collect the message ids out of the given GRD files and then scan the source directories to try and figure out what ids are not currently being used by any source.
[ "Will", "collect", "the", "message", "ids", "out", "of", "the", "given", "GRD", "files", "and", "then", "scan", "the", "source", "directories", "to", "try", "and", "figure", "out", "what", "ids", "are", "not", "currently", "being", "used", "by", "any", "...
def CheckForUnusedGrdIDsInSources(grd_files, src_dirs): """Will collect the message ids out of the given GRD files and then scan the source directories to try and figure out what ids are not currently being used by any source. grd_files: A list of GRD files to collect the ids from. src_dirs: A list o...
[ "def", "CheckForUnusedGrdIDsInSources", "(", "grd_files", ",", "src_dirs", ")", ":", "# Collect all the ids into a large map", "all_ids", "=", "set", "(", ")", "file_id_map", "=", "{", "}", "for", "y", "in", "grd_files", ":", "handler", "=", "GrdIDExtractor", "(",...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/check_grd_for_unused_strings.py#L38-L110
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/piectrl.py
python
PieCtrl.GetBackColour
(self)
return self._backcolour
Returns the :class:`PieCtrl` background colour.
Returns the :class:`PieCtrl` background colour.
[ "Returns", "the", ":", "class", ":", "PieCtrl", "background", "colour", "." ]
def GetBackColour(self): """ Returns the :class:`PieCtrl` background colour. """ return self._backcolour
[ "def", "GetBackColour", "(", "self", ")", ":", "return", "self", ".", "_backcolour" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/piectrl.py#L622-L625
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
tools/Polygraphy/polygraphy/backend/onnx/util.py
python
str_from_onnx
(model, show_layers=None, show_attrs=None, show_weights=None)
return onnx_str
Converts an ONNX Graph to a human-readable representation Args: graph (onnx.GraphProto): The onnx graph. show_layers (bool): Whether to display per-layer information. show_attrs (bool): Whether to display per-layer attributes. show_weights (bool): Whether to display the value of wei...
Converts an ONNX Graph to a human-readable representation
[ "Converts", "an", "ONNX", "Graph", "to", "a", "human", "-", "readable", "representation" ]
def str_from_onnx(model, show_layers=None, show_attrs=None, show_weights=None): """ Converts an ONNX Graph to a human-readable representation Args: graph (onnx.GraphProto): The onnx graph. show_layers (bool): Whether to display per-layer information. show_attrs (bool): Whether to di...
[ "def", "str_from_onnx", "(", "model", ",", "show_layers", "=", "None", ",", "show_attrs", "=", "None", ",", "show_weights", "=", "None", ")", ":", "show_layers", "=", "util", ".", "default", "(", "show_layers", ",", "False", ")", "show_attrs", "=", "util",...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/Polygraphy/polygraphy/backend/onnx/util.py#L152-L183
WagicProject/wagic
8e551bb287668c285a41206cf10f1a3197887ca2
projects/mtg/tools/build/lib/pyjavaproperties-0.6/pyjavaproperties.py
python
Properties.__parse
(self, lines)
Parse a list of lines and create an internal property dictionary
Parse a list of lines and create an internal property dictionary
[ "Parse", "a", "list", "of", "lines", "and", "create", "an", "internal", "property", "dictionary" ]
def __parse(self, lines): """ Parse a list of lines and create an internal property dictionary """ # Every line in the file must consist of either a comment # or a key-value pair. A key-value pair is a line consisting # of a key which is a combination of non-white space characte...
[ "def", "__parse", "(", "self", ",", "lines", ")", ":", "# Every line in the file must consist of either a comment", "# or a key-value pair. A key-value pair is a line consisting", "# of a key which is a combination of non-white space characters", "# The separator character between key-value pa...
https://github.com/WagicProject/wagic/blob/8e551bb287668c285a41206cf10f1a3197887ca2/projects/mtg/tools/build/lib/pyjavaproperties-0.6/pyjavaproperties.py#L55-L161
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/cpplint.py
python
CheckIncludeLine
(filename, clean_lines, linenum, include_state, error)
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
Check rules that are applicable to #include lines.
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/cpplint.py#L5143-L5229
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
MMDF._generate_toc
(self)
Generate key-to-(start, stop) table of contents.
Generate key-to-(start, stop) table of contents.
[ "Generate", "key", "-", "to", "-", "(", "start", "stop", ")", "table", "of", "contents", "." ]
def _generate_toc(self): """Generate key-to-(start, stop) table of contents.""" starts, stops = [], [] self._file.seek(0) next_pos = 0 while True: line_pos = next_pos line = self._file.readline() next_pos = self._file.tell() if line...
[ "def", "_generate_toc", "(", "self", ")", ":", "starts", ",", "stops", "=", "[", "]", ",", "[", "]", "self", ".", "_file", ".", "seek", "(", "0", ")", "next_pos", "=", "0", "while", "True", ":", "line_pos", "=", "next_pos", "line", "=", "self", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L903-L929
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
com_equilibrium_2d
(*args)
return _robotsim.com_equilibrium_2d(*args)
r""" com_equilibrium_2d(double * contacts, int m, int n, doubleVector fext, PyObject * com) -> PyObject com_equilibrium_2d(doubleMatrix contactPositions, doubleMatrix frictionCones, doubleVector fext, PyObject * com) -> PyObject * Tests whether the given COM com is stable for the given contacts and the gi...
r""" com_equilibrium_2d(double * contacts, int m, int n, doubleVector fext, PyObject * com) -> PyObject com_equilibrium_2d(doubleMatrix contactPositions, doubleMatrix frictionCones, doubleVector fext, PyObject * com) -> PyObject *
[ "r", "com_equilibrium_2d", "(", "double", "*", "contacts", "int", "m", "int", "n", "doubleVector", "fext", "PyObject", "*", "com", ")", "-", ">", "PyObject", "com_equilibrium_2d", "(", "doubleMatrix", "contactPositions", "doubleMatrix", "frictionCones", "doubleVecto...
def com_equilibrium_2d(*args) -> "PyObject *": r""" com_equilibrium_2d(double * contacts, int m, int n, doubleVector fext, PyObject * com) -> PyObject com_equilibrium_2d(doubleMatrix contactPositions, doubleMatrix frictionCones, doubleVector fext, PyObject * com) -> PyObject * Tests whether the given ...
[ "def", "com_equilibrium_2d", "(", "*", "args", ")", "->", "\"PyObject *\"", ":", "return", "_robotsim", ".", "com_equilibrium_2d", "(", "*", "args", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8858-L8901
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert/optimization.py
python
create_optimizer
(loss, init_lr, num_train_steps, num_warmup_steps, use_tpu)
return train_op
Creates an optimizer training op.
Creates an optimizer training op.
[ "Creates", "an", "optimizer", "training", "op", "." ]
def create_optimizer(loss, init_lr, num_train_steps, num_warmup_steps, use_tpu): """Creates an optimizer training op.""" global_step = tf.train.get_or_create_global_step() learning_rate = tf.constant(value=init_lr, shape=[], dtype=tf.float32) # Implements linear decay of the learning rate. learning_rate = t...
[ "def", "create_optimizer", "(", "loss", ",", "init_lr", ",", "num_train_steps", ",", "num_warmup_steps", ",", "use_tpu", ")", ":", "global_step", "=", "tf", ".", "train", ".", "get_or_create_global_step", "(", ")", "learning_rate", "=", "tf", ".", "constant", ...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/optimization.py#L25-L84
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/dom/expatbuilder.py
python
ExpatBuilder.createParser
(self)
return expat.ParserCreate()
Create a new parser object.
Create a new parser object.
[ "Create", "a", "new", "parser", "object", "." ]
def createParser(self): """Create a new parser object.""" return expat.ParserCreate()
[ "def", "createParser", "(", "self", ")", ":", "return", "expat", ".", "ParserCreate", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/dom/expatbuilder.py#L151-L153
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
syzygy/scripts/benchmark/chrome_control.py
python
KillNamedProcesses
(process_name)
Kills all processes with the given name. Only works on Windows. Args: process_name: The name of the processes to kill, e.g. "iexplore.exe".
Kills all processes with the given name. Only works on Windows.
[ "Kills", "all", "processes", "with", "the", "given", "name", ".", "Only", "works", "on", "Windows", "." ]
def KillNamedProcesses(process_name): """Kills all processes with the given name. Only works on Windows. Args: process_name: The name of the processes to kill, e.g. "iexplore.exe". """ subprocess.call(['taskkill.exe', '/IM', process_name])
[ "def", "KillNamedProcesses", "(", "process_name", ")", ":", "subprocess", ".", "call", "(", "[", "'taskkill.exe'", ",", "'/IM'", ",", "process_name", "]", ")" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/scripts/benchmark/chrome_control.py#L219-L225
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
llvm/bindings/python/llvm/object.py
python
Relocation.type_number
(self)
return lib.LLVMGetRelocationType(self)
The relocation type, as a long.
The relocation type, as a long.
[ "The", "relocation", "type", "as", "a", "long", "." ]
def type_number(self): """The relocation type, as a long.""" if self.expired: raise Exception('Relocation instance has expired.') return lib.LLVMGetRelocationType(self)
[ "def", "type_number", "(", "self", ")", ":", "if", "self", ".", "expired", ":", "raise", "Exception", "(", "'Relocation instance has expired.'", ")", "return", "lib", ".", "LLVMGetRelocationType", "(", "self", ")" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/llvm/bindings/python/llvm/object.py#L391-L396
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/qa_burst_shaper.py
python
qa_burst_shaper.test_consecutive_bursts
(self)
test_consecutive_bursts: test with consecutive bursts of different lengths
test_consecutive_bursts: test with consecutive bursts of different lengths
[ "test_consecutive_bursts", ":", "test", "with", "consecutive", "bursts", "of", "different", "lengths" ]
def test_consecutive_bursts(self): ''' test_consecutive_bursts: test with consecutive bursts of different lengths ''' prepad = 10 postpad = 10 length1 = 15 length2 = 25 data = np.concatenate((np.ones(length1), -1.0 * np.ones(length2))) ...
[ "def", "test_consecutive_bursts", "(", "self", ")", ":", "prepad", "=", "10", "postpad", "=", "10", "length1", "=", "15", "length2", "=", "25", "data", "=", "np", ".", "concatenate", "(", "(", "np", ".", "ones", "(", "length1", ")", ",", "-", "1.0", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_burst_shaper.py#L230-L264
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/slim/python/slim/summaries.py
python
add_image_summary
(tensor, name=None, prefix=None, print_summary=False)
return op
Adds an image summary for the given tensor. Args: tensor: a variable or op tensor with shape [batch,height,width,channels] name: the optional name for the summary. prefix: An optional prefix for the summary names. print_summary: If `True`, the summary is printed to stdout when the summary is co...
Adds an image summary for the given tensor.
[ "Adds", "an", "image", "summary", "for", "the", "given", "tensor", "." ]
def add_image_summary(tensor, name=None, prefix=None, print_summary=False): """Adds an image summary for the given tensor. Args: tensor: a variable or op tensor with shape [batch,height,width,channels] name: the optional name for the summary. prefix: An optional prefix for the summary names. print_...
[ "def", "add_image_summary", "(", "tensor", ",", "name", "=", "None", ",", "prefix", "=", "None", ",", "print_summary", "=", "False", ")", ":", "summary_name", "=", "_get_summary_name", "(", "tensor", ",", "name", ",", "prefix", ")", "# If print_summary, then w...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/slim/python/slim/summaries.py#L79-L102
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
Process_Exists
(*args, **kwargs)
return _misc_.Process_Exists(*args, **kwargs)
Process_Exists(int pid) -> bool
Process_Exists(int pid) -> bool
[ "Process_Exists", "(", "int", "pid", ")", "-", ">", "bool" ]
def Process_Exists(*args, **kwargs): """Process_Exists(int pid) -> bool""" return _misc_.Process_Exists(*args, **kwargs)
[ "def", "Process_Exists", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Process_Exists", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L2059-L2061
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
SafeYield
(*args, **kwargs)
return _core_.SafeYield(*args, **kwargs)
SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool This function is similar to `wx.Yield`, except that it disables the user input to all program windows before calling `wx.Yield` and re-enables it again afterwards. If ``win`` is not None, this window will remain enabled, allowing the implement...
SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
[ "SafeYield", "(", "Window", "win", "=", "None", "bool", "onlyIfNeeded", "=", "False", ")", "-", ">", "bool" ]
def SafeYield(*args, **kwargs): """ SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool This function is similar to `wx.Yield`, except that it disables the user input to all program windows before calling `wx.Yield` and re-enables it again afterwards. If ``win`` is not None, this window w...
[ "def", "SafeYield", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SafeYield", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8380-L8392
zhaoweicai/cascade-rcnn
2252f46158ea6555868ca6fa5c221ea71d9b5e6c
scripts/cpp_lint.py
python
_IsTestFilename
(filename)
Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise.
Determines if the given filename has a suffix that identifies it as a test.
[ "Determines", "if", "the", "given", "filename", "has", "a", "suffix", "that", "identifies", "it", "as", "a", "test", "." ]
def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or ...
[ "def", "_IsTestFilename", "(", "filename", ")", ":", "if", "(", "filename", ".", "endswith", "(", "'_test.cc'", ")", "or", "filename", ".", "endswith", "(", "'_unittest.cc'", ")", "or", "filename", ".", "endswith", "(", "'_regtest.cc'", ")", ")", ":", "ret...
https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L3607-L3621
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/session_run_hook.py
python
SessionRunContext.__init__
(self, original_args, session)
Initializes SessionRunContext.
Initializes SessionRunContext.
[ "Initializes", "SessionRunContext", "." ]
def __init__(self, original_args, session): """Initializes SessionRunContext.""" self._original_args = original_args self._session = session self._stop_requested = False
[ "def", "__init__", "(", "self", ",", "original_args", ",", "session", ")", ":", "self", ".", "_original_args", "=", "original_args", "self", ".", "_session", "=", "session", "self", ".", "_stop_requested", "=", "False" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/session_run_hook.py#L184-L188
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/graph_editor/subgraph.py
python
SubGraphView._remap_default
(self, remove_input_map=True, remove_output_map=True)
Remap in the place the inputs and/or outputs to the default mapping. Args: remove_input_map: if True the input map is reset to the default one. remove_output_map: if True the output map is reset to the default one.
Remap in the place the inputs and/or outputs to the default mapping.
[ "Remap", "in", "the", "place", "the", "inputs", "and", "/", "or", "outputs", "to", "the", "default", "mapping", "." ]
def _remap_default(self, remove_input_map=True, remove_output_map=True): """Remap in the place the inputs and/or outputs to the default mapping. Args: remove_input_map: if True the input map is reset to the default one. remove_output_map: if True the output map is reset to the default one. """ ...
[ "def", "_remap_default", "(", "self", ",", "remove_input_map", "=", "True", ",", "remove_output_map", "=", "True", ")", ":", "if", "not", "remove_input_map", "and", "not", "remove_output_map", ":", "return", "# Compute inside and outside tensor", "inputs", ",", "out...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/subgraph.py#L251-L266
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/reflection.py
python
GeneratedProtocolMessageType.__init__
(cls, name, bases, dictionary)
Here we perform the majority of our work on the class. We add enum getters, an __init__ method, implementations of all Message methods, and properties for all fields in the protocol type. Args: name: Name of the class (ignored, but required by the metaclass protocol). bases: Base cl...
Here we perform the majority of our work on the class. We add enum getters, an __init__ method, implementations of all Message methods, and properties for all fields in the protocol type.
[ "Here", "we", "perform", "the", "majority", "of", "our", "work", "on", "the", "class", ".", "We", "add", "enum", "getters", "an", "__init__", "method", "implementations", "of", "all", "Message", "methods", "and", "properties", "for", "all", "fields", "in", ...
def __init__(cls, name, bases, dictionary): """Here we perform the majority of our work on the class. We add enum getters, an __init__ method, implementations of all Message methods, and properties for all fields in the protocol type. Args: name: Name of the class (ignored, but required by th...
[ "def", "__init__", "(", "cls", ",", "name", ",", "bases", ",", "dictionary", ")", ":", "descriptor", "=", "dictionary", "[", "GeneratedProtocolMessageType", ".", "_DESCRIPTOR_KEY", "]", "_InitMessage", "(", "descriptor", ",", "cls", ")", "superclass", "=", "su...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/reflection.py#L122-L142
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/smart_cond.py
python
smart_case
(pred_fn_pairs, default=None, exclusive=False, name="smart_case")
return control_flow_ops._case_helper( # pylint: disable=protected-access smart_cond, pred_fn_pairs, default, exclusive, name, allow_python_preds=True)
Like tf.case, except attempts to statically evaluate predicates. If any predicate in `pred_fn_pairs` is a bool or has a constant value, the associated callable will be called or omitted depending on its value. Otherwise this functions like tf.case. Args: pred_fn_pairs: Dict or list of pairs of a boolean s...
Like tf.case, except attempts to statically evaluate predicates.
[ "Like", "tf", ".", "case", "except", "attempts", "to", "statically", "evaluate", "predicates", "." ]
def smart_case(pred_fn_pairs, default=None, exclusive=False, name="smart_case"): """Like tf.case, except attempts to statically evaluate predicates. If any predicate in `pred_fn_pairs` is a bool or has a constant value, the associated callable will be called or omitted depending on its value. Otherwise this fu...
[ "def", "smart_case", "(", "pred_fn_pairs", ",", "default", "=", "None", ",", "exclusive", "=", "False", ",", "name", "=", "\"smart_case\"", ")", ":", "return", "control_flow_ops", ".", "_case_helper", "(", "# pylint: disable=protected-access", "smart_cond", ",", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/smart_cond.py#L93-L119
KhronosGroup/Vulkan-Headers
b32da5329b50e3cb96229aaecba9ded032fe29cc
registry/vkconventions.py
python
VulkanConventions.valid_pointer_prefix
(self)
return 'valid'
Return prefix to pointers which must themselves be valid
Return prefix to pointers which must themselves be valid
[ "Return", "prefix", "to", "pointers", "which", "must", "themselves", "be", "valid" ]
def valid_pointer_prefix(self): """Return prefix to pointers which must themselves be valid""" return 'valid'
[ "def", "valid_pointer_prefix", "(", "self", ")", ":", "return", "'valid'" ]
https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/vkconventions.py#L77-L79
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-falling-path-sum.py
python
Solution.minFallingPathSum
(self, A)
return min(A[-1])
:type A: List[List[int]] :rtype: int
:type A: List[List[int]] :rtype: int
[ ":", "type", "A", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def minFallingPathSum(self, A): """ :type A: List[List[int]] :rtype: int """ for i in xrange(1, len(A)): for j in xrange(len(A[i])): A[i][j] += min(A[i-1][max(j-1, 0):j+2]) return min(A[-1])
[ "def", "minFallingPathSum", "(", "self", ",", "A", ")", ":", "for", "i", "in", "xrange", "(", "1", ",", "len", "(", "A", ")", ")", ":", "for", "j", "in", "xrange", "(", "len", "(", "A", "[", "i", "]", ")", ")", ":", "A", "[", "i", "]", "[...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-falling-path-sum.py#L5-L13
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/eslint.py
python
is_interesting_file
(file_name)
return ((file_name.startswith("src/mongo") or file_name.startswith("jstests")) and file_name.endswith(".js"))
Return true if this file should be checked
Return true if this file should be checked
[ "Return", "true", "if", "this", "file", "should", "be", "checked" ]
def is_interesting_file(file_name): """"Return true if this file should be checked """ return ((file_name.startswith("src/mongo") or file_name.startswith("jstests")) and file_name.endswith(".js"))
[ "def", "is_interesting_file", "(", "file_name", ")", ":", "return", "(", "(", "file_name", ".", "startswith", "(", "\"src/mongo\"", ")", "or", "file_name", ".", "startswith", "(", "\"jstests\"", ")", ")", "and", "file_name", ".", "endswith", "(", "\".js\"", ...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/eslint.py#L192-L196
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/fx/experimental/debug.py
python
set_trace
(gm: fx.GraphModule)
return gm
Sets a breakpoint in `gm`'s generated python code. It drops into pdb when `gm` gets run. Args: gm: graph module to insert breakpoint. It is then recompiled for it to take effect. Returns: the `gm` with breakpoint inserted.
Sets a breakpoint in `gm`'s generated python code. It drops into pdb when `gm` gets run.
[ "Sets", "a", "breakpoint", "in", "gm", "s", "generated", "python", "code", ".", "It", "drops", "into", "pdb", "when", "gm", "gets", "run", "." ]
def set_trace(gm: fx.GraphModule) -> fx.GraphModule: """ Sets a breakpoint in `gm`'s generated python code. It drops into pdb when `gm` gets run. Args: gm: graph module to insert breakpoint. It is then recompiled for it to take effect. Returns: the `gm` with breakpoint ...
[ "def", "set_trace", "(", "gm", ":", "fx", ".", "GraphModule", ")", "->", "fx", ".", "GraphModule", ":", "def", "insert_pdb", "(", "body", ")", ":", "return", "[", "\"import pdb; pdb.set_trace()\\n\"", ",", "*", "body", "]", "with", "gm", ".", "graph", "....
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/debug.py#L3-L31
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
ArtProvider_HasNativeProvider
(*args)
return _misc_.ArtProvider_HasNativeProvider(*args)
ArtProvider_HasNativeProvider() -> bool Does this platform implement native icons theme?
ArtProvider_HasNativeProvider() -> bool
[ "ArtProvider_HasNativeProvider", "()", "-", ">", "bool" ]
def ArtProvider_HasNativeProvider(*args): """ ArtProvider_HasNativeProvider() -> bool Does this platform implement native icons theme? """ return _misc_.ArtProvider_HasNativeProvider(*args)
[ "def", "ArtProvider_HasNativeProvider", "(", "*", "args", ")", ":", "return", "_misc_", ".", "ArtProvider_HasNativeProvider", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2954-L2960
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/zipfile.py
python
_EndRecData64
(fpin, offset, endrec)
return endrec
Read the ZIP64 end-of-archive records and use that to update endrec
Read the ZIP64 end-of-archive records and use that to update endrec
[ "Read", "the", "ZIP64", "end", "-", "of", "-", "archive", "records", "and", "use", "that", "to", "update", "endrec" ]
def _EndRecData64(fpin, offset, endrec): """ Read the ZIP64 end-of-archive records and use that to update endrec """ fpin.seek(offset - sizeEndCentDir64Locator, 2) data = fpin.read(sizeEndCentDir64Locator) sig, diskno, reloff, disks = struct.unpack(structEndArchive64Locator, data) if sig != ...
[ "def", "_EndRecData64", "(", "fpin", ",", "offset", ",", "endrec", ")", ":", "fpin", ".", "seek", "(", "offset", "-", "sizeEndCentDir64Locator", ",", "2", ")", "data", "=", "fpin", ".", "read", "(", "sizeEndCentDir64Locator", ")", "sig", ",", "diskno", "...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/zipfile.py#L143-L173
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py
python
HTMLDoc.docproperty
(self, object, name=None, mod=None, cl=None)
return self._docdescriptor(name, object, mod)
Produce html documentation for a property.
Produce html documentation for a property.
[ "Produce", "html", "documentation", "for", "a", "property", "." ]
def docproperty(self, object, name=None, mod=None, cl=None): """Produce html documentation for a property.""" return self._docdescriptor(name, object, mod)
[ "def", "docproperty", "(", "self", ",", "object", ",", "name", "=", "None", ",", "mod", "=", "None", ",", "cl", "=", "None", ")", ":", "return", "self", ".", "_docdescriptor", "(", "name", ",", "object", ",", "mod", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py#L918-L920
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/module.py
python
Module.save
(self, file_name, fmt="")
Save the module to file. This do not save the dependent device modules. See also export_shared Parameters ---------- file_name : str The name of the file. fmt : str The format of the file. See Also -------- Module.export_...
Save the module to file.
[ "Save", "the", "module", "to", "file", "." ]
def save(self, file_name, fmt=""): """Save the module to file. This do not save the dependent device modules. See also export_shared Parameters ---------- file_name : str The name of the file. fmt : str The format of the file. Se...
[ "def", "save", "(", "self", ",", "file_name", ",", "fmt", "=", "\"\"", ")", ":", "_SaveToFile", "(", "self", ",", "file_name", ",", "fmt", ")" ]
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/module.py#L96-L113
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/saxutils.py
python
prepare_input_source
(source, base="")
return source
This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.
This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.
[ "This", "function", "takes", "an", "InputSource", "and", "an", "optional", "base", "URL", "and", "returns", "a", "fully", "resolved", "InputSource", "object", "ready", "for", "reading", "." ]
def prepare_input_source(source, base=""): """This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.""" if isinstance(source, str): source = xmlreader.InputSource(source) elif hasattr(source, "read"): f = source ...
[ "def", "prepare_input_source", "(", "source", ",", "base", "=", "\"\"", ")", ":", "if", "isinstance", "(", "source", ",", "str", ")", ":", "source", "=", "xmlreader", ".", "InputSource", "(", "source", ")", "elif", "hasattr", "(", "source", ",", "\"read\...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/saxutils.py#L339-L368
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/bindings/python/clang/cindex.py
python
SourceRange.__contains__
(self, other)
return False
Useful to detect the Token/Lexer bug
Useful to detect the Token/Lexer bug
[ "Useful", "to", "detect", "the", "Token", "/", "Lexer", "bug" ]
def __contains__(self, other): """Useful to detect the Token/Lexer bug""" if not isinstance(other, SourceLocation): return False if other.file is None and self.start.file is None: pass elif ( self.start.file.name != other.file.name or other.file.nam...
[ "def", "__contains__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "SourceLocation", ")", ":", "return", "False", "if", "other", ".", "file", "is", "None", "and", "self", ".", "start", ".", "file", "is", "None", ...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L341-L362
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.SetHScrollBar
(*args, **kwargs)
return _stc.StyledTextCtrl_SetHScrollBar(*args, **kwargs)
SetHScrollBar(self, ScrollBar bar) Set the horizontal scrollbar to use instead of the ont that's built-in.
SetHScrollBar(self, ScrollBar bar)
[ "SetHScrollBar", "(", "self", "ScrollBar", "bar", ")" ]
def SetHScrollBar(*args, **kwargs): """ SetHScrollBar(self, ScrollBar bar) Set the horizontal scrollbar to use instead of the ont that's built-in. """ return _stc.StyledTextCtrl_SetHScrollBar(*args, **kwargs)
[ "def", "SetHScrollBar", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetHScrollBar", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6637-L6643
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/contrib/sparsity/asp.py
python
ASPHelper._get_mask_name
(param_name)
return param_name + ASPHelper.MASK_APPENDDED_NAME
r""" Return mask name by given parameter name :attr:`param_name`. Args: param_name (string): The name of parameter. Returns: string: The mask name of :attr:`param_name`.
r""" Return mask name by given parameter name :attr:`param_name`.
[ "r", "Return", "mask", "name", "by", "given", "parameter", "name", ":", "attr", ":", "param_name", "." ]
def _get_mask_name(param_name): r""" Return mask name by given parameter name :attr:`param_name`. Args: param_name (string): The name of parameter. Returns: string: The mask name of :attr:`param_name`. """ return param_name + ASPHelper.MASK_APPEND...
[ "def", "_get_mask_name", "(", "param_name", ")", ":", "return", "param_name", "+", "ASPHelper", ".", "MASK_APPENDDED_NAME" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/sparsity/asp.py#L377-L386
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/posixfile.py
python
open
(name, mode='r', bufsize=-1)
return _posixfile_().open(name, mode, bufsize)
Public routine to open a file as a posixfile object.
Public routine to open a file as a posixfile object.
[ "Public", "routine", "to", "open", "a", "file", "as", "a", "posixfile", "object", "." ]
def open(name, mode='r', bufsize=-1): """Public routine to open a file as a posixfile object.""" return _posixfile_().open(name, mode, bufsize)
[ "def", "open", "(", "name", ",", "mode", "=", "'r'", ",", "bufsize", "=", "-", "1", ")", ":", "return", "_posixfile_", "(", ")", ".", "open", "(", "name", ",", "mode", ",", "bufsize", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/posixfile.py#L220-L222
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/shortcuteditor.py
python
ConflictDialog.__init__
(self, parent, conflict)
Default class constructor. :param `parent`: an instance of :class:`ShortcutEditor`; :param `conflict`: an instance of :class:`Shortcut`, representing the conflicting shortcut.
Default class constructor.
[ "Default", "class", "constructor", "." ]
def __init__(self, parent, conflict): """ Default class constructor. :param `parent`: an instance of :class:`ShortcutEditor`; :param `conflict`: an instance of :class:`Shortcut`, representing the conflicting shortcut. """ transDict = dict(shortcut=conflict.acce...
[ "def", "__init__", "(", "self", ",", "parent", ",", "conflict", ")", ":", "transDict", "=", "dict", "(", "shortcut", "=", "conflict", ".", "accelerator", ",", "item", "=", "conflict", ".", "label", ",", "group", "=", "conflict", ".", "parent", ".", "la...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shortcuteditor.py#L1644-L1666
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/plan/robotcspace.py
python
ClosedLoopRobotCSpace.sendPathToController
(self,path,controller,epsilon=1e-2)
Given a :class:`CSpace` path ``path``, sends the path to be executed to the :class:`SimRobotController` ``controller``. This discretizes the path and sends it as a piecewise linear curve, limited in speed by the robot's maximum velocity. .. note:: This isn't the best thing ...
Given a :class:`CSpace` path ``path``, sends the path to be executed to the :class:`SimRobotController` ``controller``.
[ "Given", "a", ":", "class", ":", "CSpace", "path", "path", "sends", "the", "path", "to", "be", "executed", "to", "the", ":", "class", ":", "SimRobotController", "controller", "." ]
def sendPathToController(self,path,controller,epsilon=1e-2): """Given a :class:`CSpace` path ``path``, sends the path to be executed to the :class:`SimRobotController` ``controller``. This discretizes the path and sends it as a piecewise linear curve, limited in speed by the robot's max...
[ "def", "sendPathToController", "(", "self", ",", "path", ",", "controller", ",", "epsilon", "=", "1e-2", ")", ":", "dpath", "=", "self", ".", "discretizePath", "(", "path", ",", "epsilon", ")", "vmax", "=", "controller", ".", "model", "(", ")", ".", "g...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/robotcspace.py#L237-L262
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/compiler/xla/python/xla_client.py
python
ComputationBuilder.ConvWithGeneralPadding
(self, lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count=1, ...
return self.ConvGeneralDilated( lhs, rhs, list(window_strides), list(padding), list(lhs_dilation), list(rhs_dilation), dimension_numbers=None, feature_group_count=feature_group_count, batch_group_count=batch_group_count, precision_config=pr...
Enqueues a ConvWithGeneralPadding operation onto the computation. Args: lhs: XlaOp for the rank N+2 array of inputs. rhs: XlaOp for the rank N+2 array of kernel weights. window_strides: length-N array-like of kernel strides. padding: length-N array-like of pairs of integers of (low, high) p...
Enqueues a ConvWithGeneralPadding operation onto the computation.
[ "Enqueues", "a", "ConvWithGeneralPadding", "operation", "onto", "the", "computation", "." ]
def ConvWithGeneralPadding(self, lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count=1...
[ "def", "ConvWithGeneralPadding", "(", "self", ",", "lhs", ",", "rhs", ",", "window_strides", ",", "padding", ",", "lhs_dilation", ",", "rhs_dilation", ",", "feature_group_count", "=", "1", ",", "batch_group_count", "=", "1", ",", "precision_config", "=", "None",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/compiler/xla/python/xla_client.py#L1345-L1380
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/utils.py
python
get_encodings_from_content
(content)
return (charset_re.findall(content) + pragma_re.findall(content) + xml_re.findall(content))
Returns encodings from given content string. :param content: bytestring to extract encodings from.
Returns encodings from given content string.
[ "Returns", "encodings", "from", "given", "content", "string", "." ]
def get_encodings_from_content(content): """Returns encodings from given content string. :param content: bytestring to extract encodings from. """ warnings.warn(( 'In requests 3.0, get_encodings_from_content will be removed. For ' 'more information, please see the discussion on issue #2...
[ "def", "get_encodings_from_content", "(", "content", ")", ":", "warnings", ".", "warn", "(", "(", "'In requests 3.0, get_encodings_from_content will be removed. For '", "'more information, please see the discussion on issue #2266. (This'", "' warning should only appear once.)'", ")", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/utils.py#L441-L458
yyzybb537/libgo
4af17b7c67643c4d54aa354dcc77963ea07847d0
third_party/boost.context/tools/build/src/build/feature.py
python
__is_subproperty_of
(parent_property, p)
return is_subfeature_of (parent_property, p.feature())
As is_subfeature_of, for subproperties.
As is_subfeature_of, for subproperties.
[ "As", "is_subfeature_of", "for", "subproperties", "." ]
def __is_subproperty_of (parent_property, p): """ As is_subfeature_of, for subproperties. """ if __debug__: from .property import Property assert isinstance(parent_property, Property) assert isinstance(p, Property) return is_subfeature_of (parent_property, p.feature())
[ "def", "__is_subproperty_of", "(", "parent_property", ",", "p", ")", ":", "if", "__debug__", ":", "from", ".", "property", "import", "Property", "assert", "isinstance", "(", "parent_property", ",", "Property", ")", "assert", "isinstance", "(", "p", ",", "Prope...
https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/feature.py#L672-L679
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
SplitterWindow.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=SP_3D, String name=SplitterNameStr) -> SplitterWindow Constructor. Creates and shows a SplitterWindow.
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=SP_3D, String name=SplitterNameStr) -> SplitterWindow
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "SP_3D", "String", "name", "=", "SplitterNameStr", ")", "-", ">", "SplitterWindow" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=SP_3D, String name=SplitterNameStr) -> SplitterWindow Constructor. Creates and shows a SplitterWindow. """ if kwargs.has_...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "has_key", "(", "'point'", ")", ":", "kwargs", "[", "'pos'", "]", "=", "kwargs", "[", "'point'", "]", "del", "kwargs", "[", "'point'", "]", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L1386-L1395
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_simulation.py
python
SimulationDomain.getDepartedPersonNumber
(self)
return self._getUniversal(tc.VAR_DEPARTED_PERSONS_NUMBER)
getDepartedPersonNumber() -> integer Returns the number of persons which departed (were inserted into the road network) in this time step.
getDepartedPersonNumber() -> integer
[ "getDepartedPersonNumber", "()", "-", ">", "integer" ]
def getDepartedPersonNumber(self): """getDepartedPersonNumber() -> integer Returns the number of persons which departed (were inserted into the road network) in this time step. """ return self._getUniversal(tc.VAR_DEPARTED_PERSONS_NUMBER)
[ "def", "getDepartedPersonNumber", "(", "self", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_DEPARTED_PERSONS_NUMBER", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_simulation.py#L329-L334
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/jump-game-v.py
python
Solution.maxJumps
(self, arr, d)
return max(itertools.imap(lambda x: dp(arr, d, x, left, right, lookup), xrange(len(arr))))
:type arr: List[int] :type d: int :rtype: int
:type arr: List[int] :type d: int :rtype: int
[ ":", "type", "arr", ":", "List", "[", "int", "]", ":", "type", "d", ":", "int", ":", "rtype", ":", "int" ]
def maxJumps(self, arr, d): """ :type arr: List[int] :type d: int :rtype: int """ def dp(arr, d, i, left, right, lookup): if lookup[i]: return lookup[i] lookup[i] = 1 for j in itertools.chain(left[i], right[i]): ...
[ "def", "maxJumps", "(", "self", ",", "arr", ",", "d", ")", ":", "def", "dp", "(", "arr", ",", "d", ",", "i", ",", "left", ",", "right", ",", "lookup", ")", ":", "if", "lookup", "[", "i", "]", ":", "return", "lookup", "[", "i", "]", "lookup", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/jump-game-v.py#L10-L45
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/checkperms/checkperms.py
python
ApiAllFilesAtOnceBase.list_dir
(self, start_dir)
return [ x[len(start_dir):] for x in self._files if x.startswith(start_dir) ]
Lists all the files and directory inside start_dir.
Lists all the files and directory inside start_dir.
[ "Lists", "all", "the", "files", "and", "directory", "inside", "start_dir", "." ]
def list_dir(self, start_dir): """Lists all the files and directory inside start_dir.""" if self._files is None: self._files = sorted(self._get_all_files()) if not self.bare_output: print 'Found %s files' % len(self._files) start_dir = start_dir[len(self.root_dir) + 1:] return [ ...
[ "def", "list_dir", "(", "self", ",", "start_dir", ")", ":", "if", "self", ".", "_files", "is", "None", ":", "self", ".", "_files", "=", "sorted", "(", "self", ".", "_get_all_files", "(", ")", ")", "if", "not", "self", ".", "bare_output", ":", "print"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/checkperms/checkperms.py#L385-L394
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/arraysetops.py
python
intersect1d
(ar1, ar2, assume_unique=False, return_indices=False)
Find the intersection of two arrays. Return the sorted, unique values that are in both of the input arrays. Parameters ---------- ar1, ar2 : array_like Input arrays. Will be flattened if not already 1D. assume_unique : bool If True, the input arrays are both assumed to be unique, w...
Find the intersection of two arrays.
[ "Find", "the", "intersection", "of", "two", "arrays", "." ]
def intersect1d(ar1, ar2, assume_unique=False, return_indices=False): """ Find the intersection of two arrays. Return the sorted, unique values that are in both of the input arrays. Parameters ---------- ar1, ar2 : array_like Input arrays. Will be flattened if not already 1D. assum...
[ "def", "intersect1d", "(", "ar1", ",", "ar2", ",", "assume_unique", "=", "False", ",", "return_indices", "=", "False", ")", ":", "ar1", "=", "np", ".", "asanyarray", "(", "ar1", ")", "ar2", "=", "np", ".", "asanyarray", "(", "ar2", ")", "if", "not", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/arraysetops.py#L337-L430
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Modules/Scripted/EditorLib/Effect.py
python
EffectTool.cleanup
(self)
clean up actors and observers
clean up actors and observers
[ "clean", "up", "actors", "and", "observers" ]
def cleanup(self): """clean up actors and observers""" for a in self.actors: self.renderer.RemoveActor2D(a) self.sliceView.scheduleRender() for tag in self.interactorObserverTags: self.interactor.RemoveObserver(tag) sliceNode = self.sliceLogic.GetSliceNode() for tag in self.sliceNode...
[ "def", "cleanup", "(", "self", ")", ":", "for", "a", "in", "self", ".", "actors", ":", "self", ".", "renderer", ".", "RemoveActor2D", "(", "a", ")", "self", ".", "sliceView", ".", "scheduleRender", "(", ")", "for", "tag", "in", "self", ".", "interact...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/Effect.py#L248-L257
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/layers/layers.py
python
flatten
(inputs, outputs_collections=None, scope=None)
Flattens the input while maintaining the batch_size. Assumes that the first dimension represents the batch. Args: inputs: A tensor of size [batch_size, ...]. outputs_collections: Collection to add the outputs. scope: Optional scope for name_scope. Returns: A flattened tensor with shape [batch...
Flattens the input while maintaining the batch_size.
[ "Flattens", "the", "input", "while", "maintaining", "the", "batch_size", "." ]
def flatten(inputs, outputs_collections=None, scope=None): """Flattens the input while maintaining the batch_size. Assumes that the first dimension represents the batch. Args: inputs: A tensor of size [batch_size, ...]. outputs_collections: Collection to add the outputs. sc...
[ "def", "flatten", "(", "inputs", ",", "outputs_collections", "=", "None", ",", "scope", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "scope", ",", "'Flatten'", ",", "[", "inputs", "]", ")", "as", "sc", ":", "inputs", "=", "ops", ".",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/layers.py#L1414-L1457
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/tools/get_landmines.py
python
print_landmines
()
return 0
ALL LANDMINES ARE EMITTED FROM HERE.
ALL LANDMINES ARE EMITTED FROM HERE.
[ "ALL", "LANDMINES", "ARE", "EMITTED", "FROM", "HERE", "." ]
def print_landmines(): # pylint: disable=invalid-name """ ALL LANDMINES ARE EMITTED FROM HERE. """ # DO NOT add landmines as part of a regular CL. Landmines are a last-effort # bandaid fix if a CL that got landed has a build dependency bug and all bots # need to be cleaned up. If you're writing a new CL th...
[ "def", "print_landmines", "(", ")", ":", "# pylint: disable=invalid-name", "# DO NOT add landmines as part of a regular CL. Landmines are a last-effort", "# bandaid fix if a CL that got landed has a build dependency bug and all bots", "# need to be cleaned up. If you're writing a new CL that causes ...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/get_landmines.py#L14-L41
cinder/Cinder
e83f5bb9c01a63eec20168d02953a0879e5100f7
docs/libs/pystache/renderer.py
python
Renderer.context
(self)
return self._context
Return the current rendering context [experimental].
Return the current rendering context [experimental].
[ "Return", "the", "current", "rendering", "context", "[", "experimental", "]", "." ]
def context(self): """ Return the current rendering context [experimental]. """ return self._context
[ "def", "context", "(", "self", ")", ":", "return", "self", ".", "_context" ]
https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/pystache/renderer.py#L152-L157
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/DocXMLRPCServer.py
python
ServerHTMLDoc.markup
(self, text, escape=None, funcs={}, classes={}, methods={})
return ''.join(results)
Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.
Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.
[ "Mark", "up", "some", "plain", "text", "given", "a", "context", "of", "symbols", "to", "look", "for", ".", "Each", "context", "dictionary", "maps", "object", "names", "to", "anchor", "names", "." ]
def markup(self, text, escape=None, funcs={}, classes={}, methods={}): """Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.""" escape = escape or self.escape results = [] here = 0 # XXX Note that t...
[ "def", "markup", "(", "self", ",", "text", ",", "escape", "=", "None", ",", "funcs", "=", "{", "}", ",", "classes", "=", "{", "}", ",", "methods", "=", "{", "}", ")", ":", "escape", "=", "escape", "or", "self", ".", "escape", "results", "=", "[...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/DocXMLRPCServer.py#L26-L65
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.open_order_buy_premium
(self, open_order_buy_premium)
Sets the open_order_buy_premium of this Position. :param open_order_buy_premium: The open_order_buy_premium of this Position. # noqa: E501 :type: float
Sets the open_order_buy_premium of this Position.
[ "Sets", "the", "open_order_buy_premium", "of", "this", "Position", "." ]
def open_order_buy_premium(self, open_order_buy_premium): """Sets the open_order_buy_premium of this Position. :param open_order_buy_premium: The open_order_buy_premium of this Position. # noqa: E501 :type: float """ self._open_order_buy_premium = open_order_buy_premium
[ "def", "open_order_buy_premium", "(", "self", ",", "open_order_buy_premium", ")", ":", "self", ".", "_open_order_buy_premium", "=", "open_order_buy_premium" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L976-L984
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/gpus/find_cuda_config.py
python
_find_library
(base_paths, library_name, required_version)
return _find_file(base_paths, _library_paths(), filepattern)
Returns first valid path to the requested library.
Returns first valid path to the requested library.
[ "Returns", "first", "valid", "path", "to", "the", "requested", "library", "." ]
def _find_library(base_paths, library_name, required_version): """Returns first valid path to the requested library.""" if _is_windows(): filepattern = library_name + ".lib" elif _is_macos(): filepattern = "%s*.dylib" % (".".join(["lib" + library_name] + required_...
[ "def", "_find_library", "(", "base_paths", ",", "library_name", ",", "required_version", ")", ":", "if", "_is_windows", "(", ")", ":", "filepattern", "=", "library_name", "+", "\".lib\"", "elif", "_is_macos", "(", ")", ":", "filepattern", "=", "\"%s*.dylib\"", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/gpus/find_cuda_config.py#L209-L219
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/ogl/_basic.py
python
Shape.ResetControlPoints
(self)
Reset the positions of the control points (for instance when the shape's shape has changed).
Reset the positions of the control points (for instance when the shape's shape has changed).
[ "Reset", "the", "positions", "of", "the", "control", "points", "(", "for", "instance", "when", "the", "shape", "s", "shape", "has", "changed", ")", "." ]
def ResetControlPoints(self): """Reset the positions of the control points (for instance when the shape's shape has changed). """ self.ResetMandatoryControlPoints() if len(self._controlPoints) == 0: return maxX, maxY = self.GetBoundingBoxMax() minX, ...
[ "def", "ResetControlPoints", "(", "self", ")", ":", "self", ".", "ResetMandatoryControlPoints", "(", ")", "if", "len", "(", "self", ".", "_controlPoints", ")", "==", "0", ":", "return", "maxX", ",", "maxY", "=", "self", ".", "GetBoundingBoxMax", "(", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_basic.py#L1341-L1384
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/protocols/cmsisdap.py
python
CmsisDapUnit.dap_led
(self, index, state)
Operates the LED :param index: which led :param state: what to do with it :return:
Operates the LED
[ "Operates", "the", "LED" ]
def dap_led(self, index, state): """ Operates the LED :param index: which led :param state: what to do with it :return: """ self.logger.debug("dap_led (%d, %d)", index, state) cmd = bytearray(3) cmd[0] = self.ID_DAP_HostStatus cmd[1] = ind...
[ "def", "dap_led", "(", "self", ",", "index", ",", "state", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"dap_led (%d, %d)\"", ",", "index", ",", "state", ")", "cmd", "=", "bytearray", "(", "3", ")", "cmd", "[", "0", "]", "=", "self", ".", ...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/cmsisdap.py#L101-L115
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
polly/utils/argparse.py
python
_ActionsContainer.add_argument
(self, *args, **kwargs)
return self._add_action(action)
add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...)
add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...)
[ "add_argument", "(", "dest", "...", "name", "=", "value", "...", ")", "add_argument", "(", "option_string", "option_string", "...", "name", "=", "value", "...", ")" ]
def add_argument(self, *args, **kwargs): """ add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...) """ # if no positional args are supplied or only one is supplied and # it doesn't look like an option string, parse a po...
[ "def", "add_argument", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# if no positional args are supplied or only one is supplied and", "# it doesn't look like an option string, parse a positional", "# argument", "chars", "=", "self", ".", "prefix_chars",...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/polly/utils/argparse.py#L1271-L1309
fasiondog/hikyuu
842751aa25283f9fdafc6f560ea262f79e67a307
hikyuu/draw/drawplot/bokeh_draw.py
python
ax_draw_macd2
(axes, ref, kdata, n1=12, n2=26, n3=9)
return gcf()
绘制MACD。 当BAR值变化与参考序列ref变化不一致时,显示为灰色, 当BAR和参考序列ref同时上涨,显示红色 当BAR和参考序列ref同时下跌,显示绿色 :param axes: 指定的坐标轴 :param ref: 参考序列,EMA :param KData kdata: KData :param int n1: 指标 MACD 的参数1 :param int n2: 指标 MACD 的参数2 :param int n3: 指标 MACD 的参数3
绘制MACD。 当BAR值变化与参考序列ref变化不一致时,显示为灰色, 当BAR和参考序列ref同时上涨,显示红色 当BAR和参考序列ref同时下跌,显示绿色
[ "绘制MACD。", "当BAR值变化与参考序列ref变化不一致时,显示为灰色,", "当BAR和参考序列ref同时上涨,显示红色", "当BAR和参考序列ref同时下跌,显示绿色" ]
def ax_draw_macd2(axes, ref, kdata, n1=12, n2=26, n3=9): """绘制MACD。 当BAR值变化与参考序列ref变化不一致时,显示为灰色, 当BAR和参考序列ref同时上涨,显示红色 当BAR和参考序列ref同时下跌,显示绿色 :param axes: 指定的坐标轴 :param ref: 参考序列,EMA :param KData kdata: KData :param int n1: 指标 MACD 的参数1 :param int n2: 指标 MACD 的参数2 :param int n3: ...
[ "def", "ax_draw_macd2", "(", "axes", ",", "ref", ",", "kdata", ",", "n1", "=", "12", ",", "n2", "=", "26", ",", "n3", "=", "9", ")", ":", "macd", "=", "MACD", "(", "CLOSE", "(", "kdata", ")", ",", "n1", ",", "n2", ",", "n3", ")", "bmacd", "...
https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/bokeh_draw.py#L451-L495
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/fir_filter_design.py
python
kaiserord
(ripple, width)
return int(ceil(numtaps)), beta
Determine the filter window parameters for the Kaiser window method. The parameters returned by this function are generally used to create a finite impulse response filter using the window method, with either `firwin` or `firwin2`. Parameters ---------- ripple : float Upper bound for t...
Determine the filter window parameters for the Kaiser window method.
[ "Determine", "the", "filter", "window", "parameters", "for", "the", "Kaiser", "window", "method", "." ]
def kaiserord(ripple, width): """ Determine the filter window parameters for the Kaiser window method. The parameters returned by this function are generally used to create a finite impulse response filter using the window method, with either `firwin` or `firwin2`. Parameters ---------- ...
[ "def", "kaiserord", "(", "ripple", ",", "width", ")", ":", "A", "=", "abs", "(", "ripple", ")", "# in case somebody is confused as to what's meant", "if", "A", "<", "8", ":", "# Formula for N is not valid in this range.", "raise", "ValueError", "(", "\"Requested maxim...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/fir_filter_design.py#L129-L259
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/style_editor.py
python
SettingsPanel.__DoLayout
(self)
Layout the controls in the panel
Layout the controls in the panel
[ "Layout", "the", "controls", "in", "the", "panel" ]
def __DoLayout(self): """Layout the controls in the panel""" hsizer = wx.BoxSizer(wx.HORIZONTAL) # Setup Left hand side with Style Tag List ss_v = wx.BoxSizer(wx.VERTICAL) style_lbl = wx.StaticText(self, label=_("Style Tags") + u": ") ss_v.AddMany([(style_lbl, 0, wx.ALIG...
[ "def", "__DoLayout", "(", "self", ")", ":", "hsizer", "=", "wx", ".", "BoxSizer", "(", "wx", ".", "HORIZONTAL", ")", "# Setup Left hand side with Style Tag List", "ss_v", "=", "wx", ".", "BoxSizer", "(", "wx", ".", "VERTICAL", ")", "style_lbl", "=", "wx", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/style_editor.py#L717-L823
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/context.py
python
global_seed
()
return context()._seed
Returns the eager mode seed.
Returns the eager mode seed.
[ "Returns", "the", "eager", "mode", "seed", "." ]
def global_seed(): """Returns the eager mode seed.""" return context()._seed
[ "def", "global_seed", "(", ")", ":", "return", "context", "(", ")", ".", "_seed" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/context.py#L374-L376
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
external/tools/build/v2/build/virtual_target.py
python
clone_action
(action, new_project, new_action_name, new_properties)
return cloned_action
Takes an 'action' instances and creates new instance of it and all produced target. The rule-name and properties are set to 'new-rule-name' and 'new-properties', if those are specified. Returns the cloned action.
Takes an 'action' instances and creates new instance of it and all produced target. The rule-name and properties are set to 'new-rule-name' and 'new-properties', if those are specified. Returns the cloned action.
[ "Takes", "an", "action", "instances", "and", "creates", "new", "instance", "of", "it", "and", "all", "produced", "target", ".", "The", "rule", "-", "name", "and", "properties", "are", "set", "to", "new", "-", "rule", "-", "name", "and", "new", "-", "pr...
def clone_action (action, new_project, new_action_name, new_properties): """Takes an 'action' instances and creates new instance of it and all produced target. The rule-name and properties are set to 'new-rule-name' and 'new-properties', if those are specified. Returns the cloned action.""" if not ...
[ "def", "clone_action", "(", "action", ",", "new_project", ",", "new_action_name", ",", "new_properties", ")", ":", "if", "not", "new_action_name", ":", "new_action_name", "=", "action", ".", "action_name", "(", ")", "if", "not", "new_properties", ":", "new_prope...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/virtual_target.py#L960-L991
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/bayesian-methods/algos.py
python
step_HMC
(exe, exe_params, exe_grads, label_key, noise_precision, prior_precision, L=10, eps=1E-6)
Generate the implementation of step HMC
Generate the implementation of step HMC
[ "Generate", "the", "implementation", "of", "step", "HMC" ]
def step_HMC(exe, exe_params, exe_grads, label_key, noise_precision, prior_precision, L=10, eps=1E-6): """Generate the implementation of step HMC""" init_params = {k: v.copyto(v.context) for k, v in exe_params.items()} end_params = {k: v.copyto(v.context) for k, v in exe_params.items()} init_momentums =...
[ "def", "step_HMC", "(", "exe", ",", "exe_params", ",", "exe_grads", ",", "label_key", ",", "noise_precision", ",", "prior_precision", ",", "L", "=", "10", ",", "eps", "=", "1E-6", ")", ":", "init_params", "=", "{", "k", ":", "v", ".", "copyto", "(", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/bayesian-methods/algos.py#L52-L100
shuyo/ldig
27599a23a24fb4b95e57213aa942b4c94fe1104a
ldig.py
python
normalize_twitter
(text)
return text
normalization for twitter
normalization for twitter
[ "normalization", "for", "twitter" ]
def normalize_twitter(text): """normalization for twitter""" text = re.sub(r'(@|#|https?:\/\/)[^ ]+', '', text) text = re.sub(r'(^| )[:;x]-?[\(\)dop]($| )', ' ', text) # facemark text = re.sub(r'(^| )(rt[ :]+)*', ' ', text) text = re.sub(r'([hj])+([aieo])+(\1+\2+){1,}', r'\1\2\1\2', text, re.IGNORE...
[ "def", "normalize_twitter", "(", "text", ")", ":", "text", "=", "re", ".", "sub", "(", "r'(@|#|https?:\\/\\/)[^ ]+'", ",", "''", ",", "text", ")", "text", "=", "re", ".", "sub", "(", "r'(^| )[:;x]-?[\\(\\)dop]($| )'", ",", "' '", ",", "text", ")", "# facem...
https://github.com/shuyo/ldig/blob/27599a23a24fb4b95e57213aa942b4c94fe1104a/ldig.py#L194-L201
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
python
DescriptorPool.AddFileDescriptor
(self, file_desc)
Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor.
Adds a FileDescriptor to the pool, non-recursively.
[ "Adds", "a", "FileDescriptor", "to", "the", "pool", "non", "-", "recursively", "." ]
def AddFileDescriptor(self, file_desc): """Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. """ self._AddFileDescriptor(file_desc) # TODO(jieluo): This i...
[ "def", "AddFileDescriptor", "(", "self", ",", "file_desc", ")", ":", "self", ".", "_AddFileDescriptor", "(", "file_desc", ")", "# TODO(jieluo): This is a temporary solution for FieldDescriptor.file.", "# Remove it when FieldDescriptor.file is added in code gen.", "for", "extension"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L247-L262
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.deleverage
(self, deleverage)
Sets the deleverage of this Instrument. :param deleverage: The deleverage of this Instrument. # noqa: E501 :type: bool
Sets the deleverage of this Instrument.
[ "Sets", "the", "deleverage", "of", "this", "Instrument", "." ]
def deleverage(self, deleverage): """Sets the deleverage of this Instrument. :param deleverage: The deleverage of this Instrument. # noqa: E501 :type: bool """ self._deleverage = deleverage
[ "def", "deleverage", "(", "self", ",", "deleverage", ")", ":", "self", ".", "_deleverage", "=", "deleverage" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L1475-L1483
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/ext.py
python
Extension.call_method
(self, name, args=None, kwargs=None, dyn_args=None, dyn_kwargs=None, lineno=None)
return nodes.Call(self.attr(name, lineno=lineno), args, kwargs, dyn_args, dyn_kwargs, lineno=lineno)
Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`.
Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`.
[ "Call", "a", "method", "of", "the", "extension", ".", "This", "is", "a", "shortcut", "for", ":", "meth", ":", "attr", "+", ":", "class", ":", "jinja2", ".", "nodes", ".", "Call", "." ]
def call_method(self, name, args=None, kwargs=None, dyn_args=None, dyn_kwargs=None, lineno=None): """Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`. """ if args is None: args = [] if kwargs is None...
[ "def", "call_method", "(", "self", ",", "name", ",", "args", "=", "None", ",", "kwargs", "=", "None", ",", "dyn_args", "=", "None", ",", "dyn_kwargs", "=", "None", ",", "lineno", "=", "None", ")", ":", "if", "args", "is", "None", ":", "args", "=", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/ext.py#L119-L129
Harick1/caffe-yolo
eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3
tools/extra/extract_seconds.py
python
get_start_time
(line_iterable, year)
return start_datetime
Find start time from group of lines
Find start time from group of lines
[ "Find", "start", "time", "from", "group", "of", "lines" ]
def get_start_time(line_iterable, year): """Find start time from group of lines """ start_datetime = None for line in line_iterable: line = line.strip() if line.find('Solving') != -1: start_datetime = extract_datetime_from_line(line, year) break return start_...
[ "def", "get_start_time", "(", "line_iterable", ",", "year", ")", ":", "start_datetime", "=", "None", "for", "line", "in", "line_iterable", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "line", ".", "find", "(", "'Solving'", ")", "!=", "-", "1...
https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/tools/extra/extract_seconds.py#L31-L41
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/extras/codelite.py
python
vsnode.make_uuid
(self, val)
return make_uuid(val)
Alias for creating uuid values easily (the templates cannot access global variables)
Alias for creating uuid values easily (the templates cannot access global variables)
[ "Alias", "for", "creating", "uuid", "values", "easily", "(", "the", "templates", "cannot", "access", "global", "variables", ")" ]
def make_uuid(self, val): """ Alias for creating uuid values easily (the templates cannot access global variables) """ return make_uuid(val)
[ "def", "make_uuid", "(", "self", ",", "val", ")", ":", "return", "make_uuid", "(", "val", ")" ]
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/codelite.py#L421-L425
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Configure.py
python
cmd_to_list
(self, cmd)
return cmd
Detect if a command is written in pseudo shell like ``ccache g++`` and return a list. :param cmd: command :type cmd: a string or a list of string
Detect if a command is written in pseudo shell like ``ccache g++`` and return a list.
[ "Detect", "if", "a", "command", "is", "written", "in", "pseudo", "shell", "like", "ccache", "g", "++", "and", "return", "a", "list", "." ]
def cmd_to_list(self, cmd): """ Detect if a command is written in pseudo shell like ``ccache g++`` and return a list. :param cmd: command :type cmd: a string or a list of string """ if isinstance(cmd, str) and cmd.find(' '): try: os.stat(cmd) except OSError: return shlex.split(cmd) else: return [c...
[ "def", "cmd_to_list", "(", "self", ",", "cmd", ")", ":", "if", "isinstance", "(", "cmd", ",", "str", ")", "and", "cmd", ".", "find", "(", "' '", ")", ":", "try", ":", "os", ".", "stat", "(", "cmd", ")", "except", "OSError", ":", "return", "shlex"...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Configure.py#L437-L451
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/model_selection/_search.py
python
GridSearchCV.fit
(self, X, y=None, groups=None)
return self._fit(X, y, groups, ParameterGrid(self.param_grid))
Run fit with all sets of parameters. Parameters ---------- X : array-like, shape = [n_samples, n_features] Training vector, where n_samples is the number of samples and n_features is the number of features. y : array-like, shape = [n_samples] or [n_samples, n_o...
Run fit with all sets of parameters.
[ "Run", "fit", "with", "all", "sets", "of", "parameters", "." ]
def fit(self, X, y=None, groups=None): """Run fit with all sets of parameters. Parameters ---------- X : array-like, shape = [n_samples, n_features] Training vector, where n_samples is the number of samples and n_features is the number of features. y : ...
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "groups", "=", "None", ")", ":", "return", "self", ".", "_fit", "(", "X", ",", "y", ",", "groups", ",", "ParameterGrid", "(", "self", ".", "param_grid", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/model_selection/_search.py#L927-L945
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
namePop
(ctxt)
return ret
Pops the top element name from the name stack
Pops the top element name from the name stack
[ "Pops", "the", "top", "element", "name", "from", "the", "name", "stack" ]
def namePop(ctxt): """Pops the top element name from the name stack """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.namePop(ctxt__o) return ret
[ "def", "namePop", "(", "ctxt", ")", ":", "if", "ctxt", "is", "None", ":", "ctxt__o", "=", "None", "else", ":", "ctxt__o", "=", "ctxt", ".", "_o", "ret", "=", "libxml2mod", ".", "namePop", "(", "ctxt__o", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L1463-L1468
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/c_preproc.py
python
c_parser.tryfind
(self, filename)
return found
Try to obtain a node from the filename based from the include paths. Will add the node found to :py:attr:`waflib.Tools.c_preproc.c_parser.nodes` or the file name to :py:attr:`waflib.Tools.c_preproc.c_parser.names` if no corresponding file is found. Called by :py:attr:`waflib.Tools.c_preproc.c_parser.start`. :p...
Try to obtain a node from the filename based from the include paths. Will add the node found to :py:attr:`waflib.Tools.c_preproc.c_parser.nodes` or the file name to :py:attr:`waflib.Tools.c_preproc.c_parser.names` if no corresponding file is found. Called by :py:attr:`waflib.Tools.c_preproc.c_parser.start`.
[ "Try", "to", "obtain", "a", "node", "from", "the", "filename", "based", "from", "the", "include", "paths", ".", "Will", "add", "the", "node", "found", "to", ":", "py", ":", "attr", ":", "waflib", ".", "Tools", ".", "c_preproc", ".", "c_parser", ".", ...
def tryfind(self, filename): """ Try to obtain a node from the filename based from the include paths. Will add the node found to :py:attr:`waflib.Tools.c_preproc.c_parser.nodes` or the file name to :py:attr:`waflib.Tools.c_preproc.c_parser.names` if no corresponding file is found. Called by :py:attr:`waflib.T...
[ "def", "tryfind", "(", "self", ",", "filename", ")", ":", "self", ".", "curfile", "=", "filename", "# for msvc it should be a for loop on the whole stack", "found", "=", "self", ".", "cached_find_resource", "(", "self", ".", "currentnode_stack", "[", "-", "1", "]"...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/c_preproc.py#L832-L862
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/compiler.py
python
CodeGenerator.temporary_identifier
(self)
return 't_%d' % self._last_identifier
Get a new unique identifier.
Get a new unique identifier.
[ "Get", "a", "new", "unique", "identifier", "." ]
def temporary_identifier(self): """Get a new unique identifier.""" self._last_identifier += 1 return 't_%d' % self._last_identifier
[ "def", "temporary_identifier", "(", "self", ")", ":", "self", ".", "_last_identifier", "+=", "1", "return", "'t_%d'", "%", "self", ".", "_last_identifier" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/compiler.py#L317-L320
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/handlers.py
python
BaseHandler.finish_response
(self)
Send any iterable data, then close self and the iterable Subclasses intended for use in asynchronous servers will want to redefine this method, such that it sets up callbacks in the event loop to iterate over the data, and to call 'self.close()' once the response is finished.
Send any iterable data, then close self and the iterable
[ "Send", "any", "iterable", "data", "then", "close", "self", "and", "the", "iterable" ]
def finish_response(self): """Send any iterable data, then close self and the iterable Subclasses intended for use in asynchronous servers will want to redefine this method, such that it sets up callbacks in the event loop to iterate over the data, and to call 'self.close()' onc...
[ "def", "finish_response", "(", "self", ")", ":", "try", ":", "if", "not", "self", ".", "result_is_file", "(", ")", "or", "not", "self", ".", "sendfile", "(", ")", ":", "for", "data", "in", "self", ".", "result", ":", "self", ".", "write", "(", "dat...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/handlers.py#L117-L131
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCtrl.GetFilename
(*args, **kwargs)
return _richtext.RichTextCtrl_GetFilename(*args, **kwargs)
GetFilename(self) -> String
GetFilename(self) -> String
[ "GetFilename", "(", "self", ")", "-", ">", "String" ]
def GetFilename(*args, **kwargs): """GetFilename(self) -> String""" return _richtext.RichTextCtrl_GetFilename(*args, **kwargs)
[ "def", "GetFilename", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_GetFilename", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2935-L2937
google/sandboxed-api
7004d59150c9fbfaa3e5fd1872affffd1ab14fe8
sandboxed_api/tools/generator2/code.py
python
Type.get_related_types
(self, result=None, skip_self=False)
return result
Returns all types related to this one eg. typedefs, nested structs.
Returns all types related to this one eg. typedefs, nested structs.
[ "Returns", "all", "types", "related", "to", "this", "one", "eg", ".", "typedefs", "nested", "structs", "." ]
def get_related_types(self, result=None, skip_self=False): # type: (Optional[Set[Type]], bool) -> Set[Type] """Returns all types related to this one eg. typedefs, nested structs.""" if result is None: result = set() if self in result or self.is_simple_type() or self.is_class(): return resul...
[ "def", "get_related_types", "(", "self", ",", "result", "=", "None", ",", "skip_self", "=", "False", ")", ":", "# type: (Optional[Set[Type]], bool) -> Set[Type]", "if", "result", "is", "None", ":", "result", "=", "set", "(", ")", "if", "self", "in", "result", ...
https://github.com/google/sandboxed-api/blob/7004d59150c9fbfaa3e5fd1872affffd1ab14fe8/sandboxed_api/tools/generator2/code.py#L235-L270
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py
python
get_path_from_frame
(frame, parent_path=None)
return d or '.'
Return path of the module given a frame object from the call stack. Returned path is relative to parent_path when given, otherwise it is absolute path.
Return path of the module given a frame object from the call stack.
[ "Return", "path", "of", "the", "module", "given", "a", "frame", "object", "from", "the", "call", "stack", "." ]
def get_path_from_frame(frame, parent_path=None): """Return path of the module given a frame object from the call stack. Returned path is relative to parent_path when given, otherwise it is absolute path. """ # First, try to find if the file name is in the frame. try: caller_file = eva...
[ "def", "get_path_from_frame", "(", "frame", ",", "parent_path", "=", "None", ")", ":", "# First, try to find if the file name is in the frame.", "try", ":", "caller_file", "=", "eval", "(", "'__file__'", ",", "frame", ".", "f_globals", ",", "frame", ".", "f_locals",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py#L147-L176
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
scripts/cpp_lint.py
python
_NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/scripts/cpp_lint.py#L2172-L2191
apple/swift
469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893
utils/swift_build_support/swift_build_support/products/product.py
python
Product.should_clean
(self, host_target)
return False
should_clean() -> Bool Whether or not this product should be cleaned before being built
should_clean() -> Bool
[ "should_clean", "()", "-", ">", "Bool" ]
def should_clean(self, host_target): """should_clean() -> Bool Whether or not this product should be cleaned before being built """ return False
[ "def", "should_clean", "(", "self", ",", "host_target", ")", ":", "return", "False" ]
https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/swift_build_support/swift_build_support/products/product.py#L108-L113
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/check_ops.py
python
_assert_static
(condition, data)
Raises a InvalidArgumentError with as much information as possible.
Raises a InvalidArgumentError with as much information as possible.
[ "Raises", "a", "InvalidArgumentError", "with", "as", "much", "information", "as", "possible", "." ]
def _assert_static(condition, data): """Raises a InvalidArgumentError with as much information as possible.""" if not condition: data_static = [_maybe_constant_value_string(x) for x in data] raise errors.InvalidArgumentError(node_def=None, op=None, message='\n'.join(dat...
[ "def", "_assert_static", "(", "condition", ",", "data", ")", ":", "if", "not", "condition", ":", "data_static", "=", "[", "_maybe_constant_value_string", "(", "x", ")", "for", "x", "in", "data", "]", "raise", "errors", ".", "InvalidArgumentError", "(", "node...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/check_ops.py#L80-L85
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/summary/writer/event_file_writer_v2.py
python
EventFileWriterV2.reopen
(self)
Reopens the EventFileWriter. Can be called after `close()` to add more events in the same directory. The events will go into a new events file. Does nothing if the EventFileWriter was not closed.
Reopens the EventFileWriter.
[ "Reopens", "the", "EventFileWriter", "." ]
def reopen(self): """Reopens the EventFileWriter. Can be called after `close()` to add more events in the same directory. The events will go into a new events file. Does nothing if the EventFileWriter was not closed. """ if self._closed: self._closed = False self._session.run(self....
[ "def", "reopen", "(", "self", ")", ":", "if", "self", ".", "_closed", ":", "self", ".", "_closed", "=", "False", "self", ".", "_session", ".", "run", "(", "self", ".", "_init_op", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/summary/writer/event_file_writer_v2.py#L97-L107
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/archive_util.py
python
unpack_zipfile
(filename, extract_dir, progress_filter=default_filter)
Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument.
Unpack zip `filename` to `extract_dir`
[ "Unpack", "zip", "filename", "to", "extract_dir" ]
def unpack_zipfile(filename, extract_dir, progress_filter=default_filter): """Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. ...
[ "def", "unpack_zipfile", "(", "filename", ",", "extract_dir", ",", "progress_filter", "=", "default_filter", ")", ":", "if", "not", "zipfile", ".", "is_zipfile", "(", "filename", ")", ":", "raise", "UnrecognizedFormat", "(", "\"%s is not a zip file\"", "%", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/archive_util.py#L91-L125
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.ask_price
(self)
return self._ask_price
Gets the ask_price of this Instrument. # noqa: E501 :return: The ask_price of this Instrument. # noqa: E501 :rtype: float
Gets the ask_price of this Instrument. # noqa: E501
[ "Gets", "the", "ask_price", "of", "this", "Instrument", ".", "#", "noqa", ":", "E501" ]
def ask_price(self): """Gets the ask_price of this Instrument. # noqa: E501 :return: The ask_price of this Instrument. # noqa: E501 :rtype: float """ return self._ask_price
[ "def", "ask_price", "(", "self", ")", ":", "return", "self", ".", "_ask_price" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L2347-L2354
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg/linalg_impl.py
python
matrix_rank
(a, tol=None, validate_args=False, name=None)
Compute the matrix rank of one or more matrices. Args: a: (Batch of) `float`-like matrix-shaped `Tensor`(s) which are to be pseudo-inverted. tol: Threshold below which the singular value is counted as 'zero'. Default value: `None` (i.e., `eps * max(rows, cols) * max(singular_val)`). validate_...
Compute the matrix rank of one or more matrices.
[ "Compute", "the", "matrix", "rank", "of", "one", "or", "more", "matrices", "." ]
def matrix_rank(a, tol=None, validate_args=False, name=None): """Compute the matrix rank of one or more matrices. Args: a: (Batch of) `float`-like matrix-shaped `Tensor`(s) which are to be pseudo-inverted. tol: Threshold below which the singular value is counted as 'zero'. Default value: `None`...
[ "def", "matrix_rank", "(", "a", ",", "tol", "=", "None", ",", "validate_args", "=", "False", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", "or", "'matrix_rank'", ")", ":", "a", "=", "ops", ".", "convert_to_tensor", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/linalg_impl.py#L767-L801
Evolving-AI-Lab/fooling
66f097dd6bd2eb6794ade3e187a7adfdf1887688
caffe/scripts/cpp_lint.py
python
ReverseCloseExpression
(clean_lines, linenum, pos)
return (line, 0, -1)
If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
If input points to ) or } or ] or >, finds the position that opens it.
[ "If", "input", "points", "to", ")", "or", "}", "or", "]", "or", ">", "finds", "the", "position", "that", "opens", "it", "." ]
def ReverseCloseExpression(clean_lines, linenum, pos): """If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance ...
[ "def", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "endchar", "=", "line", "[", "pos", "]", "if", "endchar", "not", "in", "')}]>'", ":", "return", "("...
https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L1326-L1368
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py
python
split_double_braces
(input)
return output
Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (e.g. closing braces make a nice diago...
Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below.
[ "Masks", "out", "the", "quotes", "and", "comments", "and", "then", "splits", "appropriate", "lines", "(", "lines", "that", "matche", "the", "double_", "*", "_brace", "re", "s", "above", ")", "before", "indenting", "them", "below", "." ]
def split_double_braces(input): """Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (...
[ "def", "split_double_braces", "(", "input", ")", ":", "double_open_brace_re", "=", "re", ".", "compile", "(", "r\"(.*?[\\[\\{\\(,])(\\s*)([\\[\\{\\(])\"", ")", "double_close_brace_re", "=", "re", ".", "compile", "(", "r\"(.*?[\\]\\}\\)],?)(\\s*)([\\]\\}\\)])\"", ")", "mas...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py#L65-L83
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Mazar/MazAr_Admin/apps/smsg_r/smsapp/commands.py
python
release_phone
(phone)
Releases the phone from the user control @param phone: Phone to process @type phone: PhoneData @rtype: None
Releases the phone from the user control
[ "Releases", "the", "phone", "from", "the", "user", "control" ]
def release_phone(phone): """ Releases the phone from the user control @param phone: Phone to process @type phone: PhoneData @rtype: None """ if phone.owner_id is None: return phone.sms_status = models.PhoneData.SMS_INITIAL phone.save() set_phone_transient_state(phone.uni...
[ "def", "release_phone", "(", "phone", ")", ":", "if", "phone", ".", "owner_id", "is", "None", ":", "return", "phone", ".", "sms_status", "=", "models", ".", "PhoneData", ".", "SMS_INITIAL", "phone", ".", "save", "(", ")", "set_phone_transient_state", "(", ...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Mazar/MazAr_Admin/apps/smsg_r/smsapp/commands.py#L71-L84
google/omaha
61e8c2833fd69c9a13978400108e5b9ebff24a09
omaha/standalone/standalone_installer.py
python
BuildOfflineInstallersVersion
(env, omaha_version_info, omaha_files_path, empty_metainstaller_path, offline_installers_file_path, manifest_files_path, ...
Builds all standalone installers specified in offline_installers_file_path. Args: env: Environment. omaha_version_info: info about the version of the Omaha files omaha_files_path: Path to the directory containing the Omaha binaries. empty_metainstaller_path: Path to empty (no tarball) metainstaller b...
Builds all standalone installers specified in offline_installers_file_path.
[ "Builds", "all", "standalone", "installers", "specified", "in", "offline_installers_file_path", "." ]
def BuildOfflineInstallersVersion(env, omaha_version_info, omaha_files_path, empty_metainstaller_path, offline_installers_file_path, manifest_files_pa...
[ "def", "BuildOfflineInstallersVersion", "(", "env", ",", "omaha_version_info", ",", "omaha_files_path", ",", "empty_metainstaller_path", ",", "offline_installers_file_path", ",", "manifest_files_path", ",", "prefix", "=", "''", ",", "is_official", "=", "False", ")", ":"...
https://github.com/google/omaha/blob/61e8c2833fd69c9a13978400108e5b9ebff24a09/omaha/standalone/standalone_installer.py#L101-L137
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/doc/doxy2swig/doxy2swig.py
python
Doxy2SWIG.start_new_paragraph
(self)
Make sure to create an empty line. This is overridden, if the previous text ends with the special marker ''. In that case, nothing is done.
Make sure to create an empty line. This is overridden, if the previous text ends with the special marker ''. In that case, nothing is done.
[ "Make", "sure", "to", "create", "an", "empty", "line", ".", "This", "is", "overridden", "if", "the", "previous", "text", "ends", "with", "the", "special", "marker", ".", "In", "that", "case", "nothing", "is", "done", "." ]
def start_new_paragraph(self): """Make sure to create an empty line. This is overridden, if the previous text ends with the special marker ''. In that case, nothing is done. """ if self.pieces[-1:] == ['']: # respect special marker return elif self.pieces == []: # fir...
[ "def", "start_new_paragraph", "(", "self", ")", ":", "if", "self", ".", "pieces", "[", "-", "1", ":", "]", "==", "[", "''", "]", ":", "# respect special marker", "return", "elif", "self", ".", "pieces", "==", "[", "]", ":", "# first paragraph, add '\\n', o...
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/doc/doxy2swig/doxy2swig.py#L293-L304
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/data/python/ops/dataset_ops.py
python
Dataset.group_by_window
(self, key_func, reduce_func, window_size)
return GroupByWindowDataset(self, key_func, reduce_func, window_size)
Performs a windowed "group-by" operation on this dataset. This method maps each consecutive element in this dataset to a key using `key_func` and groups the elements by key. It then applies `reduce_func` to at most `window_size` elements matching the same key. All execpt the final window for each key w...
Performs a windowed "group-by" operation on this dataset.
[ "Performs", "a", "windowed", "group", "-", "by", "operation", "on", "this", "dataset", "." ]
def group_by_window(self, key_func, reduce_func, window_size): """Performs a windowed "group-by" operation on this dataset. This method maps each consecutive element in this dataset to a key using `key_func` and groups the elements by key. It then applies `reduce_func` to at most `window_size` elements...
[ "def", "group_by_window", "(", "self", ",", "key_func", ",", "reduce_func", ",", "window_size", ")", ":", "return", "GroupByWindowDataset", "(", "self", ",", "key_func", ",", "reduce_func", ",", "window_size", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/data/python/ops/dataset_ops.py#L922-L944
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/random.py
python
Random.__init__
(self, x=None)
Initialize an instance. Optional argument x controls seeding, as for Random.seed().
Initialize an instance.
[ "Initialize", "an", "instance", "." ]
def __init__(self, x=None): """Initialize an instance. Optional argument x controls seeding, as for Random.seed(). """ self.seed(x) self.gauss_next = None
[ "def", "__init__", "(", "self", ",", "x", "=", "None", ")", ":", "self", ".", "seed", "(", "x", ")", "self", ".", "gauss_next", "=", "None" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/random.py#L91-L98
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/autograph/operators/control_flow.py
python
_verify_tf_loop_vars
(init_vars, iter_entry_vars, iter_exit_vars, symbol_names, opts, check_shapes=True)
Verifies loop variables for consistency.
Verifies loop variables for consistency.
[ "Verifies", "loop", "variables", "for", "consistency", "." ]
def _verify_tf_loop_vars(init_vars, iter_entry_vars, iter_exit_vars, symbol_names, opts, check_shapes=True): """Verifies loop variables for consistency.""" if check_shapes and 'shape_invarian...
[ "def", "_verify_tf_loop_vars", "(", "init_vars", ",", "iter_entry_vars", ",", "iter_exit_vars", ",", "symbol_names", ",", "opts", ",", "check_shapes", "=", "True", ")", ":", "if", "check_shapes", "and", "'shape_invariants'", "in", "opts", ":", "shape_invariants", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/operators/control_flow.py#L275-L315
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/cpplint_1.4.5/cpplint.py
python
NestingState.SeenOpenBrace
(self)
return (not self.stack) or self.stack[-1].seen_open_brace
Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace.
Check if we have seen the opening brace for the innermost block.
[ "Check", "if", "we", "have", "seen", "the", "opening", "brace", "for", "the", "innermost", "block", "." ]
def SeenOpenBrace(self): """Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace. """ return (not self.stack) or self.stack[-1].seen_open_brace
[ "def", "SeenOpenBrace", "(", "self", ")", ":", "return", "(", "not", "self", ".", "stack", ")", "or", "self", ".", "stack", "[", "-", "1", "]", ".", "seen_open_brace" ]
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L2664-L2671
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/bccache.py
python
BytecodeCache.load_bytecode
(self, bucket)
Subclasses have to override this method to load bytecode into a bucket. If they are not able to find code in the cache for the bucket, it must not do anything.
Subclasses have to override this method to load bytecode into a bucket. If they are not able to find code in the cache for the bucket, it must not do anything.
[ "Subclasses", "have", "to", "override", "this", "method", "to", "load", "bytecode", "into", "a", "bucket", ".", "If", "they", "are", "not", "able", "to", "find", "code", "in", "the", "cache", "for", "the", "bucket", "it", "must", "not", "do", "anything",...
def load_bytecode(self, bucket): """Subclasses have to override this method to load bytecode into a bucket. If they are not able to find code in the cache for the bucket, it must not do anything. """ raise NotImplementedError()
[ "def", "load_bytecode", "(", "self", ",", "bucket", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/bccache.py#L146-L151
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/exif.py
python
EXIF._decode_make_model
(self, value)
Python 2/3 compatible decoding of make/model field.
Python 2/3 compatible decoding of make/model field.
[ "Python", "2", "/", "3", "compatible", "decoding", "of", "make", "/", "model", "field", "." ]
def _decode_make_model(self, value): """Python 2/3 compatible decoding of make/model field.""" if hasattr(value, 'decode'): try: return value.decode('utf-8') except UnicodeDecodeError: return 'unknown' else: return value
[ "def", "_decode_make_model", "(", "self", ",", "value", ")", ":", "if", "hasattr", "(", "value", ",", "'decode'", ")", ":", "try", ":", "return", "value", ".", "decode", "(", "'utf-8'", ")", "except", "UnicodeDecodeError", ":", "return", "'unknown'", "else...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/exif.py#L149-L157
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/parsers/readers.py
python
_validate_skipfooter
(kwds: dict[str, Any])
Check whether skipfooter is compatible with other kwargs in TextFileReader. Parameters ---------- kwds : dict Keyword arguments passed to TextFileReader. Raises ------ ValueError If skipfooter is not compatible with other parameters.
Check whether skipfooter is compatible with other kwargs in TextFileReader.
[ "Check", "whether", "skipfooter", "is", "compatible", "with", "other", "kwargs", "in", "TextFileReader", "." ]
def _validate_skipfooter(kwds: dict[str, Any]) -> None: """ Check whether skipfooter is compatible with other kwargs in TextFileReader. Parameters ---------- kwds : dict Keyword arguments passed to TextFileReader. Raises ------ ValueError If skipfooter is not compatible...
[ "def", "_validate_skipfooter", "(", "kwds", ":", "dict", "[", "str", ",", "Any", "]", ")", "->", "None", ":", "if", "kwds", ".", "get", "(", "\"skipfooter\"", ")", ":", "if", "kwds", ".", "get", "(", "\"iterator\"", ")", "or", "kwds", ".", "get", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/parsers/readers.py#L1479-L1497
tensor-compiler/taco
d0654a84137169883973c40a951dfdb89883fd9c
python_bindings/pytaco/pytensor/taco_tensor.py
python
tensor.dtype
(self)
return self._tensor.dtype()
Returns the :class:`dtype` used to store the tensor.
Returns the :class:`dtype` used to store the tensor.
[ "Returns", "the", ":", "class", ":", "dtype", "used", "to", "store", "the", "tensor", "." ]
def dtype(self): """ Returns the :class:`dtype` used to store the tensor. """ return self._tensor.dtype()
[ "def", "dtype", "(", "self", ")", ":", "return", "self", ".", "_tensor", ".", "dtype", "(", ")" ]
https://github.com/tensor-compiler/taco/blob/d0654a84137169883973c40a951dfdb89883fd9c/python_bindings/pytaco/pytensor/taco_tensor.py#L198-L202
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
GenericDirCtrl.DoResize
(*args, **kwargs)
return _controls_.GenericDirCtrl_DoResize(*args, **kwargs)
DoResize(self)
DoResize(self)
[ "DoResize", "(", "self", ")" ]
def DoResize(*args, **kwargs): """DoResize(self)""" return _controls_.GenericDirCtrl_DoResize(*args, **kwargs)
[ "def", "DoResize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "GenericDirCtrl_DoResize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5776-L5778
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/libs/python/config/ui.py
python
add_option
(*args, **kwds)
Capture the help messages so we can produce a helpful usage text.
Capture the help messages so we can produce a helpful usage text.
[ "Capture", "the", "help", "messages", "so", "we", "can", "produce", "a", "helpful", "usage", "text", "." ]
def add_option(*args, **kwds): """Capture the help messages so we can produce a helpful usage text.""" options.append('{:25} {}'.format(', '.join(args), kwds.get('help', ''))) AddOption(*args, **kwds)
[ "def", "add_option", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "options", ".", "append", "(", "'{:25} {}'", ".", "format", "(", "', '", ".", "join", "(", "args", ")", ",", "kwds", ".", "get", "(", "'help'", ",", "''", ")", ")", ")", "A...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/libs/python/config/ui.py#L15-L18