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
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/security/fuzzing/acos_fuzz.py
python
TestOneInput
(data)
Test randomized fuzzing input for tf.raw_ops.Acos.
Test randomized fuzzing input for tf.raw_ops.Acos.
[ "Test", "randomized", "fuzzing", "input", "for", "tf", ".", "raw_ops", ".", "Acos", "." ]
def TestOneInput(data): """Test randomized fuzzing input for tf.raw_ops.Acos.""" fh = FuzzingHelper(data) # tf.raw_ops.Acos takes tf.bfloat16, tf.half, tf.float32, tf.float64, tf.int8, # tf.int16, tf.int32, tf.int64, tf.complex64, tf.complex128, but # get_random_numeric_tensor only generates tf.float16, tf.f...
[ "def", "TestOneInput", "(", "data", ")", ":", "fh", "=", "FuzzingHelper", "(", "data", ")", "# tf.raw_ops.Acos takes tf.bfloat16, tf.half, tf.float32, tf.float64, tf.int8,", "# tf.int16, tf.int32, tf.int64, tf.complex64, tf.complex128, but", "# get_random_numeric_tensor only generates tf...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/security/fuzzing/acos_fuzz.py#L23-L32
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Joystick.ReleaseCapture
(*args, **kwargs)
return _misc_.Joystick_ReleaseCapture(*args, **kwargs)
ReleaseCapture(self) -> bool
ReleaseCapture(self) -> bool
[ "ReleaseCapture", "(", "self", ")", "-", ">", "bool" ]
def ReleaseCapture(*args, **kwargs): """ReleaseCapture(self) -> bool""" return _misc_.Joystick_ReleaseCapture(*args, **kwargs)
[ "def", "ReleaseCapture", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Joystick_ReleaseCapture", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2290-L2292
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/profiler/internal/flops_registry.py
python
_max_pool_flops
(graph, node)
return _pool_flops(graph, node)
Compute flops for MaxPool operation.
Compute flops for MaxPool operation.
[ "Compute", "flops", "for", "MaxPool", "operation", "." ]
def _max_pool_flops(graph, node): """Compute flops for MaxPool operation.""" return _pool_flops(graph, node)
[ "def", "_max_pool_flops", "(", "graph", ",", "node", ")", ":", "return", "_pool_flops", "(", "graph", ",", "node", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/profiler/internal/flops_registry.py#L331-L333
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/WebIDL.py
python
Parser.p_AttributeRest
(self, p)
AttributeRest : ReadOnly ATTRIBUTE Type IDENTIFIER SEMICOLON
AttributeRest : ReadOnly ATTRIBUTE Type IDENTIFIER SEMICOLON
[ "AttributeRest", ":", "ReadOnly", "ATTRIBUTE", "Type", "IDENTIFIER", "SEMICOLON" ]
def p_AttributeRest(self, p): """ AttributeRest : ReadOnly ATTRIBUTE Type IDENTIFIER SEMICOLON """ location = self.getLocation(p, 2) readonly = p[1] t = p[3] identifier = IDLUnresolvedIdentifier(self.getLocation(p, 4), p[4]) p[0] = (location, identifie...
[ "def", "p_AttributeRest", "(", "self", ",", "p", ")", ":", "location", "=", "self", ".", "getLocation", "(", "p", ",", "2", ")", "readonly", "=", "p", "[", "1", "]", "t", "=", "p", "[", "3", "]", "identifier", "=", "IDLUnresolvedIdentifier", "(", "...
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L4069-L4077
cksystemsgroup/scalloc
049857919b5fa1d539c9e4206e353daca2e87394
tools/cpplint.py
python
CleansedLines._CollapseStrings
(elided)
return elided
Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings.
Collapses strings and chars on a line to simple "" or '' blocks.
[ "Collapses", "strings", "and", "chars", "on", "a", "line", "to", "simple", "or", "blocks", "." ]
def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if not _RE_PATTERN_INCLUDE.matc...
[ "def", "_CollapseStrings", "(", "elided", ")", ":", "if", "not", "_RE_PATTERN_INCLUDE", ".", "match", "(", "elided", ")", ":", "# Remove escaped characters first to make quote/single quote collapsing", "# basic. Things that look like escaped characters shouldn't occur", "# outside...
https://github.com/cksystemsgroup/scalloc/blob/049857919b5fa1d539c9e4206e353daca2e87394/tools/cpplint.py#L1197-L1215
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ToolBar.Create
(*args, **kwargs)
return _controls_.ToolBar_Create(*args, **kwargs)
Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxNO_BORDER|wxTB_HORIZONTAL, String name=wxPyToolBarNameStr) -> bool
Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxNO_BORDER|wxTB_HORIZONTAL, String name=wxPyToolBarNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "wxNO_BORDER|wxTB_HORIZONTAL", "String", "name", "=", "wxPyToolBarNameStr", ")", "-", ">", ...
def Create(*args, **kwargs): """ Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxNO_BORDER|wxTB_HORIZONTAL, String name=wxPyToolBarNameStr) -> bool """ return _controls_.ToolBar_Create(*args, **kwargs)
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBar_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3947-L3953
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py
python
MainWindow.load_spice_file
(self, exp_number, scan_number, overwrite)
load spice file :param exp_number: :param scan_number: :param overwrite: :return:
load spice file :param exp_number: :param scan_number: :param overwrite: :return:
[ "load", "spice", "file", ":", "param", "exp_number", ":", ":", "param", "scan_number", ":", ":", "param", "overwrite", ":", ":", "return", ":" ]
def load_spice_file(self, exp_number, scan_number, overwrite): """ load spice file :param exp_number: :param scan_number: :param overwrite: :return: """ # check inputs assert isinstance(exp_number, int), 'Exp number {0} must be an integer but not o...
[ "def", "load_spice_file", "(", "self", ",", "exp_number", ",", "scan_number", ",", "overwrite", ")", ":", "# check inputs", "assert", "isinstance", "(", "exp_number", ",", "int", ")", ",", "'Exp number {0} must be an integer but not of type {1}'", "''", ".", "format",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L3921-L3951
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
MenuItem.SetMenu
(*args, **kwargs)
return _core_.MenuItem_SetMenu(*args, **kwargs)
SetMenu(self, Menu menu)
SetMenu(self, Menu menu)
[ "SetMenu", "(", "self", "Menu", "menu", ")" ]
def SetMenu(*args, **kwargs): """SetMenu(self, Menu menu)""" return _core_.MenuItem_SetMenu(*args, **kwargs)
[ "def", "SetMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuItem_SetMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12443-L12445
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_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/osx_carbon/_misc.py#L2059-L2061
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/rfcn/lib/rpn/anchor_target_layer.py
python
_compute_targets
(ex_rois, gt_rois)
return targets
Compute bounding-box regression targets for an image.
Compute bounding-box regression targets for an image.
[ "Compute", "bounding", "-", "box", "regression", "targets", "for", "an", "image", "." ]
def _compute_targets(ex_rois, gt_rois): """Compute bounding-box regression targets for an image.""" assert ex_rois.shape[0] == gt_rois.shape[0] assert ex_rois.shape[1] == 4 assert gt_rois.shape[1] == 5 targets = bbox_transform(ex_rois, gt_rois[:, :4]).astype(np.float32, copy=False) if cfg.TRAI...
[ "def", "_compute_targets", "(", "ex_rois", ",", "gt_rois", ")", ":", "assert", "ex_rois", ".", "shape", "[", "0", "]", "==", "gt_rois", ".", "shape", "[", "0", "]", "assert", "ex_rois", ".", "shape", "[", "1", "]", "==", "4", "assert", "gt_rois", "."...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/lib/rpn/anchor_target_layer.py#L275-L288
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py
python
_is_dtype_type
(arr_or_dtype, condition)
return condition(tipo)
Return a boolean if the condition is satisfied for the arr_or_dtype. Parameters ---------- arr_or_dtype : array-like The array-like or dtype object whose dtype we want to extract. condition : callable[Union[np.dtype, ExtensionDtypeType]] Returns ------- bool : if the condition is s...
Return a boolean if the condition is satisfied for the arr_or_dtype.
[ "Return", "a", "boolean", "if", "the", "condition", "is", "satisfied", "for", "the", "arr_or_dtype", "." ]
def _is_dtype_type(arr_or_dtype, condition) -> bool: """ Return a boolean if the condition is satisfied for the arr_or_dtype. Parameters ---------- arr_or_dtype : array-like The array-like or dtype object whose dtype we want to extract. condition : callable[Union[np.dtype, ExtensionDtyp...
[ "def", "_is_dtype_type", "(", "arr_or_dtype", ",", "condition", ")", "->", "bool", ":", "if", "arr_or_dtype", "is", "None", ":", "return", "condition", "(", "type", "(", "None", ")", ")", "# fastpath", "if", "isinstance", "(", "arr_or_dtype", ",", "np", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py#L1708-L1750
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py
python
BaseContext.pack_value
(self, builder, ty, value, ptr, align=None)
Pack value into the array storage at *ptr*. If *align* is given, it is the guaranteed alignment for *ptr* (by default, the standard ABI alignment).
Pack value into the array storage at *ptr*. If *align* is given, it is the guaranteed alignment for *ptr* (by default, the standard ABI alignment).
[ "Pack", "value", "into", "the", "array", "storage", "at", "*", "ptr", "*", ".", "If", "*", "align", "*", "is", "given", "it", "is", "the", "guaranteed", "alignment", "for", "*", "ptr", "*", "(", "by", "default", "the", "standard", "ABI", "alignment", ...
def pack_value(self, builder, ty, value, ptr, align=None): """ Pack value into the array storage at *ptr*. If *align* is given, it is the guaranteed alignment for *ptr* (by default, the standard ABI alignment). """ dataval = self.data_model_manager[ty].as_data(builder, va...
[ "def", "pack_value", "(", "self", ",", "builder", ",", "ty", ",", "value", ",", "ptr", ",", "align", "=", "None", ")", ":", "dataval", "=", "self", ".", "data_model_manager", "[", "ty", "]", ".", "as_data", "(", "builder", ",", "value", ")", "builder...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py#L486-L493
vector-of-bool/dds
b35d87245e8174506df780fd9fe112d89351a85b
tools/dds_ci/paths.py
python
new_tempdir
()
Create and yield a new temporary directory, which will be destroyed on context-manager exit
Create and yield a new temporary directory, which will be destroyed on context-manager exit
[ "Create", "and", "yield", "a", "new", "temporary", "directory", "which", "will", "be", "destroyed", "on", "context", "-", "manager", "exit" ]
def new_tempdir() -> Iterator[Path]: """ Create and yield a new temporary directory, which will be destroyed on context-manager exit """ tdir = Path(tempfile.mkdtemp()) try: yield tdir finally: shutil.rmtree(tdir)
[ "def", "new_tempdir", "(", ")", "->", "Iterator", "[", "Path", "]", ":", "tdir", "=", "Path", "(", "tempfile", ".", "mkdtemp", "(", ")", ")", "try", ":", "yield", "tdir", "finally", ":", "shutil", ".", "rmtree", "(", "tdir", ")" ]
https://github.com/vector-of-bool/dds/blob/b35d87245e8174506df780fd9fe112d89351a85b/tools/dds_ci/paths.py#L28-L37
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/init_ops.py
python
Initializer.__call__
(self, shape, dtype=None, partition_info=None)
Returns a tensor object initialized as specified by the initializer. Args: shape: Shape of the tensor. dtype: Optional dtype of the tensor. If not provided use the initializer dtype. partition_info: Optional information about the possible partitioning of a tensor.
Returns a tensor object initialized as specified by the initializer.
[ "Returns", "a", "tensor", "object", "initialized", "as", "specified", "by", "the", "initializer", "." ]
def __call__(self, shape, dtype=None, partition_info=None): """Returns a tensor object initialized as specified by the initializer. Args: shape: Shape of the tensor. dtype: Optional dtype of the tensor. If not provided use the initializer dtype. partition_info: Optional information ab...
[ "def", "__call__", "(", "self", ",", "shape", ",", "dtype", "=", "None", ",", "partition_info", "=", "None", ")", ":", "raise", "NotImplementedError" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/init_ops.py#L54-L64
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/internals/blocks.py
python
DatetimeTZBlock._try_coerce_result
(self, result)
return result
reverse of try_coerce_args
reverse of try_coerce_args
[ "reverse", "of", "try_coerce_args" ]
def _try_coerce_result(self, result): """ reverse of try_coerce_args """ if isinstance(result, np.ndarray): if result.dtype.kind in ['i', 'f']: result = result.astype('M8[ns]') elif isinstance(result, (np.integer, np.float, np.datetime64)): result = self....
[ "def", "_try_coerce_result", "(", "self", ",", "result", ")", ":", "if", "isinstance", "(", "result", ",", "np", ".", "ndarray", ")", ":", "if", "result", ".", "dtype", ".", "kind", "in", "[", "'i'", ",", "'f'", "]", ":", "result", "=", "result", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/blocks.py#L2376-L2394
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/tools/grokdump.py
python
InspectionShell.do_known_map
(self, address)
Teach V8 heap layout information to the inspector. Set the first map-space page by passing any pointer into that page.
Teach V8 heap layout information to the inspector.
[ "Teach", "V8", "heap", "layout", "information", "to", "the", "inspector", "." ]
def do_known_map(self, address): """ Teach V8 heap layout information to the inspector. Set the first map-space page by passing any pointer into that page. """ address = self.ParseAddressExpr(address) page_address = address & ~self.heap.PageAlignmentMask() self.padawan.known_first_map_pag...
[ "def", "do_known_map", "(", "self", ",", "address", ")", ":", "address", "=", "self", ".", "ParseAddressExpr", "(", "address", ")", "page_address", "=", "address", "&", "~", "self", ".", "heap", ".", "PageAlignmentMask", "(", ")", "self", ".", "padawan", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/tools/grokdump.py#L3664-L3672
AojunZhou/Incremental-Network-Quantization
c7f6a609d5817d8424ce224209cf4c50f1e4de50
scripts/cpp_lint.py
python
_NestingState.InNamespaceBody
(self)
return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise.
Check if we are currently one level inside a namespace body.
[ "Check", "if", "we", "are", "currently", "one", "level", "inside", "a", "namespace", "body", "." ]
def InNamespaceBody(self): """Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
[ "def", "InNamespaceBody", "(", "self", ")", ":", "return", "self", ".", "stack", "and", "isinstance", "(", "self", ".", "stack", "[", "-", "1", "]", ",", "_NamespaceInfo", ")" ]
https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/scripts/cpp_lint.py#L1940-L1946
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/jax/deep_cfr.py
python
DeepCFRSolver._reinitialize_advantage_network
(self, player)
Reinitalize player's advantage network and optimizer for training.
Reinitalize player's advantage network and optimizer for training.
[ "Reinitalize", "player", "s", "advantage", "network", "and", "optimizer", "for", "training", "." ]
def _reinitialize_advantage_network(self, player): """Reinitalize player's advantage network and optimizer for training.""" x, mask = (jnp.ones([1, self._embedding_size]), jnp.ones([1, self._num_actions])) self._params_adv_network[player] = self._hk_adv_network.init( self._next_rng_ke...
[ "def", "_reinitialize_advantage_network", "(", "self", ",", "player", ")", ":", "x", ",", "mask", "=", "(", "jnp", ".", "ones", "(", "[", "1", ",", "self", ".", "_embedding_size", "]", ")", ",", "jnp", ".", "ones", "(", "[", "1", ",", "self", ".", ...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/jax/deep_cfr.py#L298-L305
makefile/frcnn
8d9b9ebf8be8315ba2f374d460121b0adf1df29c
scripts/cpp_lint.py
python
_OutputFormat
()
return _cpplint_state.output_format
Gets the module's output format.
Gets the module's output format.
[ "Gets", "the", "module", "s", "output", "format", "." ]
def _OutputFormat(): """Gets the module's output format.""" return _cpplint_state.output_format
[ "def", "_OutputFormat", "(", ")", ":", "return", "_cpplint_state", ".", "output_format" ]
https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/scripts/cpp_lint.py#L767-L769
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/universe_generation/galaxy.py
python
AdjacencyGrid.insert_pos
(self, pos)
Inserts pos.
Inserts pos.
[ "Inserts", "pos", "." ]
def insert_pos(self, pos): """Inserts pos.""" self.grid[self.cell(pos)].add(pos)
[ "def", "insert_pos", "(", "self", ",", "pos", ")", ":", "self", ".", "grid", "[", "self", ".", "cell", "(", "pos", ")", "]", ".", "add", "(", "pos", ")" ]
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L30-L32
apache/mesos
97d9a4063332aae3825d78de71611657e05cf5e2
src/python/lib/mesos/http.py
python
Resource.default_headers
(self)
return deepcopy(self._default_headers)
Return a copy of the default headers. :rtype: dict[str, str]
Return a copy of the default headers.
[ "Return", "a", "copy", "of", "the", "default", "headers", "." ]
def default_headers(self): """ Return a copy of the default headers. :rtype: dict[str, str] """ return deepcopy(self._default_headers)
[ "def", "default_headers", "(", "self", ")", ":", "return", "deepcopy", "(", "self", ".", "_default_headers", ")" ]
https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/src/python/lib/mesos/http.py#L128-L134
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/trajectory.py
python
Trajectory.deriv_state
(self,t,endBehavior='halt')
return self.difference_state(self.milestones[i+1],self.milestones[i],u,self.times[i+1]-self.times[i])
Internal deriv, used on the underlying state representation
Internal deriv, used on the underlying state representation
[ "Internal", "deriv", "used", "on", "the", "underlying", "state", "representation" ]
def deriv_state(self,t,endBehavior='halt'): """Internal deriv, used on the underlying state representation""" i,u = self.getSegment(t,endBehavior) if i<0: return [0.0]*len(self.milestones[0]) elif i+1>=len(self.milestones): return [0.0]*len(self.milestones[-1]) return self.differ...
[ "def", "deriv_state", "(", "self", ",", "t", ",", "endBehavior", "=", "'halt'", ")", ":", "i", ",", "u", "=", "self", ".", "getSegment", "(", "t", ",", "endBehavior", ")", "if", "i", "<", "0", ":", "return", "[", "0.0", "]", "*", "len", "(", "s...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/trajectory.py#L196-L201
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.SetZoom
(*args, **kwargs)
return _stc.StyledTextCtrl_SetZoom(*args, **kwargs)
SetZoom(self, int zoom) Set the zoom level. This number of points is added to the size of all fonts. It may be positive to magnify or negative to reduce.
SetZoom(self, int zoom)
[ "SetZoom", "(", "self", "int", "zoom", ")" ]
def SetZoom(*args, **kwargs): """ SetZoom(self, int zoom) Set the zoom level. This number of points is added to the size of all fonts. It may be positive to magnify or negative to reduce. """ return _stc.StyledTextCtrl_SetZoom(*args, **kwargs)
[ "def", "SetZoom", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetZoom", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4972-L4979
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TCnCom.Add
(self, *args)
return _snap.TCnCom_Add(self, *args)
Add(TCnCom self, int const & NodeId) Parameters: NodeId: int const &
Add(TCnCom self, int const & NodeId)
[ "Add", "(", "TCnCom", "self", "int", "const", "&", "NodeId", ")" ]
def Add(self, *args): """ Add(TCnCom self, int const & NodeId) Parameters: NodeId: int const & """ return _snap.TCnCom_Add(self, *args)
[ "def", "Add", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TCnCom_Add", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L836-L844
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.UseBgCol
(*args, **kwargs)
return _core_.Window_UseBgCol(*args, **kwargs)
UseBgCol(self) -> bool
UseBgCol(self) -> bool
[ "UseBgCol", "(", "self", ")", "-", ">", "bool" ]
def UseBgCol(*args, **kwargs): """UseBgCol(self) -> bool""" return _core_.Window_UseBgCol(*args, **kwargs)
[ "def", "UseBgCol", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_UseBgCol", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10906-L10908
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/buildtime_helpers/mac_tool.py
python
MacTool._FindProvisioningProfile
(self, profile, bundle_identifier)
return valid_provisioning_profiles[selected_key]
Finds the .mobileprovision file to use for signing the bundle. Checks all the installed provisioning profiles (or if the user specified the PROVISIONING_PROFILE variable, only consult it) and select the most specific that correspond to the bundle identifier. Args: profile: string, optional, shor...
Finds the .mobileprovision file to use for signing the bundle.
[ "Finds", "the", ".", "mobileprovision", "file", "to", "use", "for", "signing", "the", "bundle", "." ]
def _FindProvisioningProfile(self, profile, bundle_identifier): """Finds the .mobileprovision file to use for signing the bundle. Checks all the installed provisioning profiles (or if the user specified the PROVISIONING_PROFILE variable, only consult it) and select the most specific that correspond to ...
[ "def", "_FindProvisioningProfile", "(", "self", ",", "profile", ",", "bundle_identifier", ")", ":", "profiles_dir", "=", "os", ".", "path", ".", "join", "(", "os", ".", "environ", "[", "'HOME'", "]", ",", "'Library'", ",", "'MobileDevice'", ",", "'Provisioni...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/buildtime_helpers/mac_tool.py#L460-L515
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/integrate/_ivp/bdf.py
python
change_D
(D, order, factor)
Change differences array in-place when step size is changed.
Change differences array in-place when step size is changed.
[ "Change", "differences", "array", "in", "-", "place", "when", "step", "size", "is", "changed", "." ]
def change_D(D, order, factor): """Change differences array in-place when step size is changed.""" R = compute_R(order, factor) U = compute_R(order, 1) RU = R.dot(U) D[:order + 1] = np.dot(RU.T, D[:order + 1])
[ "def", "change_D", "(", "D", ",", "order", ",", "factor", ")", ":", "R", "=", "compute_R", "(", "order", ",", "factor", ")", "U", "=", "compute_R", "(", "order", ",", "1", ")", "RU", "=", "R", ".", "dot", "(", "U", ")", "D", "[", ":", "order"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/integrate/_ivp/bdf.py#L29-L34
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/lazy_wheel.py
python
LazyZipOverHTTP.truncate
(self, size=None)
return self._file.truncate(size)
Resize the stream to the given size in bytes. If size is unspecified resize to the current position. The current stream position isn't changed. Return the new file size.
Resize the stream to the given size in bytes.
[ "Resize", "the", "stream", "to", "the", "given", "size", "in", "bytes", "." ]
def truncate(self, size=None): # type: (Optional[int]) -> int """Resize the stream to the given size in bytes. If size is unspecified resize to the current position. The current stream position isn't changed. Return the new file size. """ return self._file.trunc...
[ "def", "truncate", "(", "self", ",", "size", "=", "None", ")", ":", "# type: (Optional[int]) -> int", "return", "self", ".", "_file", ".", "truncate", "(", "size", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/lazy_wheel.py#L135-L144
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/xcode_emulation.py
python
XcodeSettings.GetExtraPlistItems
(self, configname=None)
return items
Returns a dictionary with extra items to insert into Info.plist.
Returns a dictionary with extra items to insert into Info.plist.
[ "Returns", "a", "dictionary", "with", "extra", "items", "to", "insert", "into", "Info", ".", "plist", "." ]
def GetExtraPlistItems(self, configname=None): """Returns a dictionary with extra items to insert into Info.plist.""" if configname not in XcodeSettings._plist_cache: cache = {} cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild() xcode_version, xcode_build = XcodeVersion() cache[...
[ "def", "GetExtraPlistItems", "(", "self", ",", "configname", "=", "None", ")", ":", "if", "configname", "not", "in", "XcodeSettings", ".", "_plist_cache", ":", "cache", "=", "{", "}", "cache", "[", "'BuildMachineOSBuild'", "]", "=", "self", ".", "_BuildMachi...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/xcode_emulation.py#L1086-L1121
jiangxiluning/FOTS.PyTorch
b1851c170b4f1ad18406766352cb5171648ce603
FOTS/trainer/trainer.py
python
Trainer._train_epoch
(self, epoch)
return log
Training logic for an epoch :param epoch: Current training epoch. :return: A log that contains all information you want to save. Note: If you have additional information to record, for example: > additional_log = {"x": x, "y": y} merge it with log before...
Training logic for an epoch
[ "Training", "logic", "for", "an", "epoch" ]
def _train_epoch(self, epoch): """ Training logic for an epoch :param epoch: Current training epoch. :return: A log that contains all information you want to save. Note: If you have additional information to record, for example: > additional_log = {"...
[ "def", "_train_epoch", "(", "self", ",", "epoch", ")", ":", "self", ".", "model", ".", "train", "(", ")", "total_loss", "=", "0", "total_metrics", "=", "np", ".", "zeros", "(", "3", ")", "# precious, recall, hmean", "for", "batch_idx", ",", "gt", "in", ...
https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/trainer/trainer.py#L39-L127
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
external/tools/build/v2/build/property_set.py
python
empty
()
return create ()
Returns PropertySet with empty set of properties.
Returns PropertySet with empty set of properties.
[ "Returns", "PropertySet", "with", "empty", "set", "of", "properties", "." ]
def empty (): """ Returns PropertySet with empty set of properties. """ return create ()
[ "def", "empty", "(", ")", ":", "return", "create", "(", ")" ]
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/property_set.py#L63-L66
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
_singlefileMailbox._pre_message_hook
(self, f)
return
Called before writing each message to file f.
Called before writing each message to file f.
[ "Called", "before", "writing", "each", "message", "to", "file", "f", "." ]
def _pre_message_hook(self, f): """Called before writing each message to file f.""" return
[ "def", "_pre_message_hook", "(", "self", ",", "f", ")", ":", "return" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L706-L708
facebookincubator/fizz
bd0ba1b80f72023cb7ede671a4caa85f6664d3f6
build/fbcode_builder/getdeps/platform.py
python
is_windows
()
return sys.platform.startswith("win")
Returns true if the system we are currently running on is a Windows system
Returns true if the system we are currently running on is a Windows system
[ "Returns", "true", "if", "the", "system", "we", "are", "currently", "running", "on", "is", "a", "Windows", "system" ]
def is_windows(): """Returns true if the system we are currently running on is a Windows system""" return sys.platform.startswith("win")
[ "def", "is_windows", "(", ")", ":", "return", "sys", ".", "platform", ".", "startswith", "(", "\"win\"", ")" ]
https://github.com/facebookincubator/fizz/blob/bd0ba1b80f72023cb7ede671a4caa85f6664d3f6/build/fbcode_builder/getdeps/platform.py#L12-L15
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
IndigoObject.iterateSuperatoms
(self)
return self.dispatcher.IndigoObject( self.dispatcher, self.dispatcher._checkResult( Indigo._lib.indigoIterateSuperatoms(self.id) ), )
Molecule method iterates superatoms Returns: IndigoObject: superatoms iterator
Molecule method iterates superatoms
[ "Molecule", "method", "iterates", "superatoms" ]
def iterateSuperatoms(self): """Molecule method iterates superatoms Returns: IndigoObject: superatoms iterator """ self.dispatcher._setSessionId() return self.dispatcher.IndigoObject( self.dispatcher, self.dispatcher._checkResult( ...
[ "def", "iterateSuperatoms", "(", "self", ")", ":", "self", ".", "dispatcher", ".", "_setSessionId", "(", ")", "return", "self", ".", "dispatcher", ".", "IndigoObject", "(", "self", ".", "dispatcher", ",", "self", ".", "dispatcher", ".", "_checkResult", "(", ...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L1374-L1386
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/seqan/auto_build.py
python
BuildStep.buildNeeded
(self)
return False
Returns whether one of the package files is missing.
Returns whether one of the package files is missing.
[ "Returns", "whether", "one", "of", "the", "package", "files", "is", "missing", "." ]
def buildNeeded(self): """Returns whether one of the package files is missing.""" for p in self.packages: package_path = os.path.join(self.base_path, p.name, p.fileName()) if 'x86' in package_path and 'x86_64' not in package_path: # fix processor name package_pat...
[ "def", "buildNeeded", "(", "self", ")", ":", "for", "p", "in", "self", ".", "packages", ":", "package_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "base_path", ",", "p", ".", "name", ",", "p", ".", "fileName", "(", ")", ")", "if"...
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/auto_build.py#L157-L173
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/procrouting/sapt/sapt_sf_terms.py
python
_sf_compute_JK
(jk, Cleft, Cright, rotation=None)
A specialized JK computer class for terms that arrise from SF-SAPT. The density is computed as (Cl_mu,i rotation_ij Cr_nu,j) where the rotation is an arbitrary perturbation on the density.
A specialized JK computer class for terms that arrise from SF-SAPT.
[ "A", "specialized", "JK", "computer", "class", "for", "terms", "that", "arrise", "from", "SF", "-", "SAPT", "." ]
def _sf_compute_JK(jk, Cleft, Cright, rotation=None): """ A specialized JK computer class for terms that arrise from SF-SAPT. The density is computed as (Cl_mu,i rotation_ij Cr_nu,j) where the rotation is an arbitrary perturbation on the density. """ # Handle both list and single value input ...
[ "def", "_sf_compute_JK", "(", "jk", ",", "Cleft", ",", "Cright", ",", "rotation", "=", "None", ")", ":", "# Handle both list and single value input", "return_single", "=", "False", "if", "not", "isinstance", "(", "Cleft", ",", "(", "list", ",", "tuple", ")", ...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/sapt/sapt_sf_terms.py#L41-L117
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py
python
_ConsumeInt64
(tokenizer)
return _ConsumeInteger(tokenizer, is_signed=True, is_long=True)
Consumes a signed 32bit integer number from tokenizer. Args: tokenizer: A tokenizer used to parse the number. Returns: The integer parsed. Raises: ParseError: If a signed 32bit integer couldn't be consumed.
Consumes a signed 32bit integer number from tokenizer.
[ "Consumes", "a", "signed", "32bit", "integer", "number", "from", "tokenizer", "." ]
def _ConsumeInt64(tokenizer): """Consumes a signed 32bit integer number from tokenizer. Args: tokenizer: A tokenizer used to parse the number. Returns: The integer parsed. Raises: ParseError: If a signed 32bit integer couldn't be consumed. """ return _ConsumeInteger(tokenizer, is_signed=True,...
[ "def", "_ConsumeInt64", "(", "tokenizer", ")", ":", "return", "_ConsumeInteger", "(", "tokenizer", ",", "is_signed", "=", "True", ",", "is_long", "=", "True", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py#L1313-L1325
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime.IsLaterThan
(*args, **kwargs)
return _misc_.DateTime_IsLaterThan(*args, **kwargs)
IsLaterThan(self, DateTime datetime) -> bool
IsLaterThan(self, DateTime datetime) -> bool
[ "IsLaterThan", "(", "self", "DateTime", "datetime", ")", "-", ">", "bool" ]
def IsLaterThan(*args, **kwargs): """IsLaterThan(self, DateTime datetime) -> bool""" return _misc_.DateTime_IsLaterThan(*args, **kwargs)
[ "def", "IsLaterThan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_IsLaterThan", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4033-L4035
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/viewspicedialog.py
python
ViewSpiceDialog.clear_text
(self)
return
Clear the text of the edit :return: None
Clear the text of the edit
[ "Clear", "the", "text", "of", "the", "edit" ]
def clear_text(self): """Clear the text of the edit :return: None """ self.ui.textBrowser_spice.clear() return
[ "def", "clear_text", "(", "self", ")", ":", "self", ".", "ui", ".", "textBrowser_spice", ".", "clear", "(", ")", "return" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/viewspicedialog.py#L43-L50
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
Babyl._pre_mailbox_hook
(self, f)
Called before writing the mailbox to file f.
Called before writing the mailbox to file f.
[ "Called", "before", "writing", "the", "mailbox", "to", "file", "f", "." ]
def _pre_mailbox_hook(self, f): """Called before writing the mailbox to file f.""" f.write('BABYL OPTIONS:%sVersion: 5%sLabels:%s%s\037' % (os.linesep, os.linesep, ','.join(self.get_labels()), os.linesep))
[ "def", "_pre_mailbox_hook", "(", "self", ",", "f", ")", ":", "f", ".", "write", "(", "'BABYL OPTIONS:%sVersion: 5%sLabels:%s%s\\037'", "%", "(", "os", ".", "linesep", ",", "os", ".", "linesep", ",", "','", ".", "join", "(", "self", ".", "get_labels", "(", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L1336-L1340
LiXizhi/NPLRuntime
a42720e5fe9a6960e0a9ce40bbbcd809192906be
Client/trunk/externals/assimp-4.0.0/port/PyAssimp/scripts/transformations.py
python
shear_matrix
(angle, direction, point, normal)
return M
Return matrix to shear by angle along direction vector on shear plane. The shear plane is defined by a point and normal vector. The direction vector must be orthogonal to the plane's normal vector. A point P is transformed by the shear matrix into P" such that the vector P-P" is parallel to the direct...
Return matrix to shear by angle along direction vector on shear plane.
[ "Return", "matrix", "to", "shear", "by", "angle", "along", "direction", "vector", "on", "shear", "plane", "." ]
def shear_matrix(angle, direction, point, normal): """Return matrix to shear by angle along direction vector on shear plane. The shear plane is defined by a point and normal vector. The direction vector must be orthogonal to the plane's normal vector. A point P is transformed by the shear matrix into ...
[ "def", "shear_matrix", "(", "angle", ",", "direction", ",", "point", ",", "normal", ")", ":", "normal", "=", "unit_vector", "(", "normal", "[", ":", "3", "]", ")", "direction", "=", "unit_vector", "(", "direction", "[", ":", "3", "]", ")", "if", "abs...
https://github.com/LiXizhi/NPLRuntime/blob/a42720e5fe9a6960e0a9ce40bbbcd809192906be/Client/trunk/externals/assimp-4.0.0/port/PyAssimp/scripts/transformations.py#L624-L652
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/combotreebox.py
python
BaseComboTreeBox.Popup
(self)
Pops up the frame with the tree.
Pops up the frame with the tree.
[ "Pops", "up", "the", "frame", "with", "the", "tree", "." ]
def Popup(self): """Pops up the frame with the tree.""" comboBoxSize = self.GetSize() x, y = self.GetParent().ClientToScreen(self.GetPosition()) y += comboBoxSize[1] width = comboBoxSize[0] height = 300 self._popupFrame.SetDimensions(x, y, width, height) #...
[ "def", "Popup", "(", "self", ")", ":", "comboBoxSize", "=", "self", ".", "GetSize", "(", ")", "x", ",", "y", "=", "self", ".", "GetParent", "(", ")", ".", "ClientToScreen", "(", "self", ".", "GetPosition", "(", ")", ")", "y", "+=", "comboBoxSize", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/combotreebox.py#L443-L454
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/parsing_ops.py
python
parse_example_v2
(serialized, features, example_names=None, name=None)
return _construct_tensors_for_composite_features(features, outputs)
Parses `Example` protos into a `dict` of tensors. Parses a number of serialized [`Example`](https://www.tensorflow.org/code/tensorflow/core/example/example.proto) protos given in `serialized`. We refer to `serialized` as a batch with `batch_size` many entries of individual `Example` protos. `example_names` ma...
Parses `Example` protos into a `dict` of tensors.
[ "Parses", "Example", "protos", "into", "a", "dict", "of", "tensors", "." ]
def parse_example_v2(serialized, features, example_names=None, name=None): # pylint: disable=line-too-long """Parses `Example` protos into a `dict` of tensors. Parses a number of serialized [`Example`](https://www.tensorflow.org/code/tensorflow/core/example/example.proto) protos given in `serialized`. We refer...
[ "def", "parse_example_v2", "(", "serialized", ",", "features", ",", "example_names", "=", "None", ",", "name", "=", "None", ")", ":", "# pylint: disable=line-too-long", "if", "not", "features", ":", "raise", "ValueError", "(", "\"Argument `features` cannot be None.\""...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/parsing_ops.py#L78-L311
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
MaskedArray.all
(self, axis=None, out=None, keepdims=np._NoValue)
return out
Returns True if all elements evaluate to True. The output array is masked where all the values along the given axis are masked: if the output would have been a scalar and that all the values are masked, then the output is `masked`. Refer to `numpy.all` for full documentation. ...
Returns True if all elements evaluate to True.
[ "Returns", "True", "if", "all", "elements", "evaluate", "to", "True", "." ]
def all(self, axis=None, out=None, keepdims=np._NoValue): """ Returns True if all elements evaluate to True. The output array is masked where all the values along the given axis are masked: if the output would have been a scalar and that all the values are masked, then the outpu...
[ "def", "all", "(", "self", ",", "axis", "=", "None", ",", "out", "=", "None", ",", "keepdims", "=", "np", ".", "_NoValue", ")", ":", "kwargs", "=", "{", "}", "if", "keepdims", "is", "np", ".", "_NoValue", "else", "{", "'keepdims'", ":", "keepdims",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L4788-L4826
OpenGenus/quark
225ad96efdfcc66cb6584a756c17eb3871e6eb62
code/code/graph_algorithms/src/hamiltonian_cycle/hamiltonian_cycle.py
python
Graph.hamCycle
(self)
return True
Let us put vertex 0 as the first vertex in the path. If there is a Hamiltonian Cycle, then the path can be started from any point of the cycle as the graph is undirected
Let us put vertex 0 as the first vertex in the path. If there is a Hamiltonian Cycle, then the path can be started from any point of the cycle as the graph is undirected
[ "Let", "us", "put", "vertex", "0", "as", "the", "first", "vertex", "in", "the", "path", ".", "If", "there", "is", "a", "Hamiltonian", "Cycle", "then", "the", "path", "can", "be", "started", "from", "any", "point", "of", "the", "cycle", "as", "the", "...
def hamCycle(self): path = [-1] * self.V ''' Let us put vertex 0 as the first vertex in the path. If there is a Hamiltonian Cycle, then the path can be started from any point of the cycle as the graph is undirected ''' path[0] = 0 if self.hamCycl...
[ "def", "hamCycle", "(", "self", ")", ":", "path", "=", "[", "-", "1", "]", "*", "self", ".", "V", "path", "[", "0", "]", "=", "0", "if", "self", ".", "hamCycleUtil", "(", "path", ",", "1", ")", "==", "False", ":", "print", "\"Solution does not ex...
https://github.com/OpenGenus/quark/blob/225ad96efdfcc66cb6584a756c17eb3871e6eb62/code/code/graph_algorithms/src/hamiltonian_cycle/hamiltonian_cycle.py#L61-L75
facebook/folly
744a0a698074d1b013813065fe60f545aa2c9b94
build/fbcode_builder/getdeps/fetcher.py
python
ChangeStatus.__init__
(self, all_changed=False)
Construct a ChangeStatus object. The default is to create a status that indicates no changes, but passing all_changed=True will create one that indicates that everything changed
Construct a ChangeStatus object. The default is to create a status that indicates no changes, but passing all_changed=True will create one that indicates that everything changed
[ "Construct", "a", "ChangeStatus", "object", ".", "The", "default", "is", "to", "create", "a", "status", "that", "indicates", "no", "changes", "but", "passing", "all_changed", "=", "True", "will", "create", "one", "that", "indicates", "that", "everything", "cha...
def __init__(self, all_changed=False): """Construct a ChangeStatus object. The default is to create a status that indicates no changes, but passing all_changed=True will create one that indicates that everything changed""" if all_changed: self.source_files = 1 se...
[ "def", "__init__", "(", "self", ",", "all_changed", "=", "False", ")", ":", "if", "all_changed", ":", "self", ".", "source_files", "=", "1", "self", ".", "make_files", "=", "1", "else", ":", "self", ".", "source_files", "=", "0", "self", ".", "make_fil...
https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/getdeps/fetcher.py#L53-L62
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/appdirs.py
python
site_data_dir
(appname=None, appauthor=None, version=None, multipath=False)
return path
r"""Return full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically ...
r"""Return full path to the user-shared data dir for this application.
[ "r", "Return", "full", "path", "to", "the", "user", "-", "shared", "data", "dir", "for", "this", "application", "." ]
def site_data_dir(appname=None, appauthor=None, version=None, multipath=False): r"""Return full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of ...
[ "def", "site_data_dir", "(", "appname", "=", "None", ",", "appauthor", "=", "None", ",", "version", "=", "None", ",", "multipath", "=", "False", ")", ":", "if", "system", "==", "\"win32\"", ":", "if", "appauthor", "is", "None", ":", "appauthor", "=", "...
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/appdirs.py#L104-L167
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/core/exceptions.py
python
Error.AddDebuggingMessage
(self, msg)
Adds a message to the description of the exception. Many Telemetry exceptions arise from failures in another application. These failures are difficult to pinpoint. This method allows Telemetry classes to append useful debugging information to the exception. This method also logs information about the l...
Adds a message to the description of the exception.
[ "Adds", "a", "message", "to", "the", "description", "of", "the", "exception", "." ]
def AddDebuggingMessage(self, msg): """Adds a message to the description of the exception. Many Telemetry exceptions arise from failures in another application. These failures are difficult to pinpoint. This method allows Telemetry classes to append useful debugging information to the exception. This m...
[ "def", "AddDebuggingMessage", "(", "self", ",", "msg", ")", ":", "frame", "=", "sys", ".", "_getframe", "(", "1", ")", "line_number", "=", "frame", ".", "f_lineno", "file_name", "=", "frame", ".", "f_code", ".", "co_filename", "function_name", "=", "frame"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/exceptions.py#L15-L30
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/tfssa.py
python
NetworkEnsemble.rename_function
(self, src_func, tgt_func)
Renames the function with function name (src_func) to (tgt_func)
Renames the function with function name (src_func) to (tgt_func)
[ "Renames", "the", "function", "with", "function", "name", "(", "src_func", ")", "to", "(", "tgt_func", ")" ]
def rename_function(self, src_func, tgt_func): """ Renames the function with function name (src_func) to (tgt_func) """ if src_func not in self.functions: logging.warning("Couldn't find function name (%s).", src_func) return if tgt_func in self.functions: ...
[ "def", "rename_function", "(", "self", ",", "src_func", ",", "tgt_func", ")", ":", "if", "src_func", "not", "in", "self", ".", "functions", ":", "logging", ".", "warning", "(", "\"Couldn't find function name (%s).\"", ",", "src_func", ")", "return", "if", "tgt...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/tfssa.py#L208-L222
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/controller/building.py
python
BuildDriver.install_tests
(self, remove=True)
Install test files (through manifest).
Install test files (through manifest).
[ "Install", "test", "files", "(", "through", "manifest", ")", "." ]
def install_tests(self, remove=True): """Install test files (through manifest).""" if self.is_clobber_needed(): print(INSTALL_TESTS_CLOBBER.format( clobber_file=os.path.join(self.topobjdir, 'CLOBBER'))) sys.exit(1) env = {} if not remove: ...
[ "def", "install_tests", "(", "self", ",", "remove", "=", "True", ")", ":", "if", "self", ".", "is_clobber_needed", "(", ")", ":", "print", "(", "INSTALL_TESTS_CLOBBER", ".", "format", "(", "clobber_file", "=", "os", ".", "path", ".", "join", "(", "self",...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/controller/building.py#L642-L655
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/_iotools.py
python
flatten_dtype
(ndtype, flatten_base=False)
Unpack a structured data-type by collapsing nested fields and/or fields with a shape. Note that the field names are lost. Parameters ---------- ndtype : dtype The datatype to collapse flatten_base : bool, optional If True, transform a field with a shape into several fields. Defa...
Unpack a structured data-type by collapsing nested fields and/or fields with a shape.
[ "Unpack", "a", "structured", "data", "-", "type", "by", "collapsing", "nested", "fields", "and", "/", "or", "fields", "with", "a", "shape", "." ]
def flatten_dtype(ndtype, flatten_base=False): """ Unpack a structured data-type by collapsing nested fields and/or fields with a shape. Note that the field names are lost. Parameters ---------- ndtype : dtype The datatype to collapse flatten_base : bool, optional If Tru...
[ "def", "flatten_dtype", "(", "ndtype", ",", "flatten_base", "=", "False", ")", ":", "names", "=", "ndtype", ".", "names", "if", "names", "is", "None", ":", "if", "flatten_base", ":", "return", "[", "ndtype", ".", "base", "]", "*", "int", "(", "np", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/_iotools.py#L129-L167
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter._WinIdlRule
(self, source, prebuild, outputs)
Handle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated.
Handle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated.
[ "Handle", "the", "implicit", "VS", ".", "idl", "rule", "for", "one", "source", "file", ".", "Fills", "|outputs|", "with", "files", "that", "are", "generated", "." ]
def _WinIdlRule(self, source, prebuild, outputs): """Handle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated.""" outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( source, self.config_name) outdir = self.GypPathToNinja(outdir) def fi...
[ "def", "_WinIdlRule", "(", "self", ",", "source", ",", "prebuild", ",", "outputs", ")", ":", "outdir", ",", "output", ",", "vars", ",", "flags", "=", "self", ".", "msvs_settings", ".", "GetIdlBuildData", "(", "source", ",", "self", ".", "config_name", ")...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/ninja.py#L457-L479
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ListItemAttr.AssignFrom
(*args, **kwargs)
return _controls_.ListItemAttr_AssignFrom(*args, **kwargs)
AssignFrom(self, ListItemAttr source)
AssignFrom(self, ListItemAttr source)
[ "AssignFrom", "(", "self", "ListItemAttr", "source", ")" ]
def AssignFrom(*args, **kwargs): """AssignFrom(self, ListItemAttr source)""" return _controls_.ListItemAttr_AssignFrom(*args, **kwargs)
[ "def", "AssignFrom", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListItemAttr_AssignFrom", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4126-L4128
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/operator.py
python
CustomOpProp.list_auxiliary_states
(self)
return []
list_auxiliary_states interface. Can override when creating new operators. Returns ------- auxs : list list of auxiliary state blob names.
list_auxiliary_states interface. Can override when creating new operators.
[ "list_auxiliary_states", "interface", ".", "Can", "override", "when", "creating", "new", "operators", "." ]
def list_auxiliary_states(self): """list_auxiliary_states interface. Can override when creating new operators. Returns ------- auxs : list list of auxiliary state blob names. """ return []
[ "def", "list_auxiliary_states", "(", "self", ")", ":", "return", "[", "]" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/operator.py#L541-L549
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/npyio.py
python
recfromcsv
(fname, **kwargs)
return output
Load ASCII data stored in a comma-separated file. The returned array is a record array (if ``usemask=False``, see `recarray`) or a masked record array (if ``usemask=True``, see `ma.mrecords.MaskedRecords`). Parameters ---------- fname, kwargs : For a description of input parameters, see `genfr...
Load ASCII data stored in a comma-separated file.
[ "Load", "ASCII", "data", "stored", "in", "a", "comma", "-", "separated", "file", "." ]
def recfromcsv(fname, **kwargs): """ Load ASCII data stored in a comma-separated file. The returned array is a record array (if ``usemask=False``, see `recarray`) or a masked record array (if ``usemask=True``, see `ma.mrecords.MaskedRecords`). Parameters ---------- fname, kwargs : For ...
[ "def", "recfromcsv", "(", "fname", ",", "*", "*", "kwargs", ")", ":", "# Set default kwargs for genfromtxt as relevant to csv import.", "kwargs", ".", "setdefault", "(", "\"case_sensitive\"", ",", "\"lower\"", ")", "kwargs", ".", "setdefault", "(", "\"names\"", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/npyio.py#L2345-L2380
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/urllib/parse.py
python
urlparse
(url, scheme='', allow_fragments=True)
return _coerce_result(result)
Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand % escapes.
Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand % escapes.
[ "Parse", "a", "URL", "into", "6", "components", ":", "<scheme", ">", ":", "//", "<netloc", ">", "/", "<path", ">", ";", "<params", ">", "?<query", ">", "#<fragment", ">", "Return", "a", "6", "-", "tuple", ":", "(", "scheme", "netloc", "path", "params...
def urlparse(url, scheme='', allow_fragments=True): """Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) ...
[ "def", "urlparse", "(", "url", ",", "scheme", "=", "''", ",", "allow_fragments", "=", "True", ")", ":", "url", ",", "scheme", ",", "_coerce_result", "=", "_coerce_args", "(", "url", ",", "scheme", ")", "splitresult", "=", "urlsplit", "(", "url", ",", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/urllib/parse.py#L361-L375
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/compat.py
python
as_str_any
(value)
Converts input to `str` type. Uses `str(value)`, except for `bytes` typed inputs, which are converted using `as_str`. Args: value: A object that can be converted to `str`. Returns: A `str` object.
Converts input to `str` type.
[ "Converts", "input", "to", "str", "type", "." ]
def as_str_any(value): """Converts input to `str` type. Uses `str(value)`, except for `bytes` typed inputs, which are converted using `as_str`. Args: value: A object that can be converted to `str`. Returns: A `str` object. """ if isinstance(value, bytes): return as_str(value) else: ...
[ "def", "as_str_any", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "bytes", ")", ":", "return", "as_str", "(", "value", ")", "else", ":", "return", "str", "(", "value", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/compat.py#L110-L125
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/ssl.py
python
SSLObject.session
(self)
return self._sslobj.session
The SSLSession for client socket.
The SSLSession for client socket.
[ "The", "SSLSession", "for", "client", "socket", "." ]
def session(self): """The SSLSession for client socket.""" return self._sslobj.session
[ "def", "session", "(", "self", ")", ":", "return", "self", ".", "_sslobj", ".", "session" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ssl.py#L685-L687
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/collections/__init__.py
python
Counter.__and__
(self, other)
return result
Intersection is the minimum of corresponding counts. >>> Counter('abbb') & Counter('bcc') Counter({'b': 1})
Intersection is the minimum of corresponding counts.
[ "Intersection", "is", "the", "minimum", "of", "corresponding", "counts", "." ]
def __and__(self, other): ''' Intersection is the minimum of corresponding counts. >>> Counter('abbb') & Counter('bcc') Counter({'b': 1}) ''' if not isinstance(other, Counter): return NotImplemented result = Counter() for elem, count in self.items():...
[ "def", "__and__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "Counter", ")", ":", "return", "NotImplemented", "result", "=", "Counter", "(", ")", "for", "elem", ",", "count", "in", "self", ".", "items", "(", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/collections/__init__.py#L782-L797
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/upgrade_arch.py
python
upgrade_pinlocations
(arch)
return modified
Upgrades custom pin locations from the 'offset' to 'yoffset' attribute. Since previously only width==1 blocks were supported, we only need to consider the yoffset case
Upgrades custom pin locations from the 'offset' to 'yoffset' attribute. Since previously only width==1 blocks were supported, we only need to consider the yoffset case
[ "Upgrades", "custom", "pin", "locations", "from", "the", "offset", "to", "yoffset", "attribute", ".", "Since", "previously", "only", "width", "==", "1", "blocks", "were", "supported", "we", "only", "need", "to", "consider", "the", "yoffset", "case" ]
def upgrade_pinlocations(arch): """ Upgrades custom pin locations from the 'offset' to 'yoffset' attribute. Since previously only width==1 blocks were supported, we only need to consider the yoffset case """ modified = False pinlocations_list = arch.findall(".//pb_type/pinlocations") fo...
[ "def", "upgrade_pinlocations", "(", "arch", ")", ":", "modified", "=", "False", "pinlocations_list", "=", "arch", ".", "findall", "(", "\".//pb_type/pinlocations\"", ")", "for", "pinlocations", "in", "pinlocations_list", ":", "pb_type", "=", "pinlocations", ".", "...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/upgrade_arch.py#L580-L627
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py
python
Index._format_native_types
(self, na_rep="", quoting=None, **kwargs)
return values
Actually format specific types of the index.
Actually format specific types of the index.
[ "Actually", "format", "specific", "types", "of", "the", "index", "." ]
def _format_native_types(self, na_rep="", quoting=None, **kwargs): """ Actually format specific types of the index. """ mask = isna(self) if not self.is_object() and not quoting: values = np.asarray(self).astype(str) else: values = np.array(self, d...
[ "def", "_format_native_types", "(", "self", ",", "na_rep", "=", "\"\"", ",", "quoting", "=", "None", ",", "*", "*", "kwargs", ")", ":", "mask", "=", "isna", "(", "self", ")", "if", "not", "self", ".", "is_object", "(", ")", "and", "not", "quoting", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py#L1024-L1035
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/site_compare/scrapers/chrome/chrome011010.py
python
Time
(urls, size, timeout, **kwargs)
return chromebase.Time(urls, size, timeout, kwargs)
Forwards the Time command to chromebase.
Forwards the Time command to chromebase.
[ "Forwards", "the", "Time", "command", "to", "chromebase", "." ]
def Time(urls, size, timeout, **kwargs): """Forwards the Time command to chromebase.""" chromebase.GetChromeRenderPane = GetChromeRenderPane return chromebase.Time(urls, size, timeout, kwargs)
[ "def", "Time", "(", "urls", ",", "size", ",", "timeout", ",", "*", "*", "kwargs", ")", ":", "chromebase", ".", "GetChromeRenderPane", "=", "GetChromeRenderPane", "return", "chromebase", ".", "Time", "(", "urls", ",", "size", ",", "timeout", ",", "kwargs", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/site_compare/scrapers/chrome/chrome011010.py#L38-L42
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/entity_object/conversion/aoc/genie_unit.py
python
GenieMonkGroup.get_switch_unit
(self)
return self.switch_unit
Returns the unit that is switched to when picking up something.
Returns the unit that is switched to when picking up something.
[ "Returns", "the", "unit", "that", "is", "switched", "to", "when", "picking", "up", "something", "." ]
def get_switch_unit(self): """ Returns the unit that is switched to when picking up something. """ return self.switch_unit
[ "def", "get_switch_unit", "(", "self", ")", ":", "return", "self", ".", "switch_unit" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_unit.py#L897-L901
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/experiment.py
python
Experiment._continuous_eval
(self, input_fn, name, delay_secs, throttle_delay_secs)
Run continuous eval. Runs infinite eval on the evaluation data set. This function starts evaluating after `delay_secs` seconds and then runs no more than one evaluation (with `self._eval_steps` steps each time) per `throttle_delay_secs`. It never returns. Args: input_fn: The input to use for...
Run continuous eval.
[ "Run", "continuous", "eval", "." ]
def _continuous_eval(self, input_fn, name, delay_secs, throttle_delay_secs): """Run continuous eval. Runs infinite eval on the evaluation data set. This function starts evaluating after `delay_secs` seconds and then...
[ "def", "_continuous_eval", "(", "self", ",", "input_fn", ",", "name", ",", "delay_secs", ",", "throttle_delay_secs", ")", ":", "if", "delay_secs", "is", "None", ":", "delay_secs", "=", "self", ".", "_eval_delay_secs", "if", "throttle_delay_secs", "is", "None", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/experiment.py#L161-L205
kismetwireless/kismet
a7c0dc270c960fb1f58bd9cec4601c201885fd4e
capture_freaklabs_zigbee/KismetCaptureFreaklabsZigbee/kismetexternal/__init__.py
python
Datasource.make_uuid
(driver, address)
return "{}-0000-0000-0000-{}".format(driverhex[:8], address[:12])
Generate a UUID :param driver: Driver component, will be hashed :param address: Address component, must be 6 bytes of hex (12 characters) :return: UUID string
Generate a UUID
[ "Generate", "a", "UUID" ]
def make_uuid(driver, address): """ Generate a UUID :param driver: Driver component, will be hashed :param address: Address component, must be 6 bytes of hex (12 characters) :return: UUID string """ driverhex = "{:02X}".format(ExternalInterface.adler32(bytearray...
[ "def", "make_uuid", "(", "driver", ",", "address", ")", ":", "driverhex", "=", "\"{:02X}\"", ".", "format", "(", "ExternalInterface", ".", "adler32", "(", "bytearray", "(", "driver", ",", "'utf-8'", ")", ")", ")", "return", "\"{}-0000-0000-0000-{}\"", ".", "...
https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_freaklabs_zigbee/KismetCaptureFreaklabsZigbee/kismetexternal/__init__.py#L558-L568
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/backend.py
python
zeros
(shape, dtype=None, name=None)
return variable( init_ops.constant_initializer(0., dtype=tf_dtype)(shape), dtype, name)
Instantiates an all-zeros variable and returns it. Arguments: shape: Tuple of integers, shape of returned Keras variable dtype: String, data type of returned Keras variable name: String, name of returned Keras variable Returns: A variable (including Keras metadata), filled with `0.0`. E...
Instantiates an all-zeros variable and returns it.
[ "Instantiates", "an", "all", "-", "zeros", "variable", "and", "returns", "it", "." ]
def zeros(shape, dtype=None, name=None): """Instantiates an all-zeros variable and returns it. Arguments: shape: Tuple of integers, shape of returned Keras variable dtype: String, data type of returned Keras variable name: String, name of returned Keras variable Returns: A variable (incl...
[ "def", "zeros", "(", "shape", ",", "dtype", "=", "None", ",", "name", "=", "None", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "floatx", "(", ")", "tf_dtype", "=", "_convert_string_dtype", "(", "dtype", ")", "return", "variable", "(", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L821-L846
CGRU/cgru
1881a4128530e3d31ac6c25314c18314fc50c2c7
lib/python/filelock.py
python
FileLock.__exit__
(self, type, value, traceback)
Activated at the end of the with statement. It automatically releases the lock if it isn't locked.
Activated at the end of the with statement. It automatically releases the lock if it isn't locked.
[ "Activated", "at", "the", "end", "of", "the", "with", "statement", ".", "It", "automatically", "releases", "the", "lock", "if", "it", "isn", "t", "locked", "." ]
def __exit__(self, type, value, traceback): """Activated at the end of the with statement. It automatically releases the lock if it isn't locked. """ if self.is_locked: self.release()
[ "def", "__exit__", "(", "self", ",", "type", ",", "value", ",", "traceback", ")", ":", "if", "self", ".", "is_locked", ":", "self", ".", "release", "(", ")" ]
https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/lib/python/filelock.py#L98-L103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PreStaticText
(*args, **kwargs)
return val
PreStaticText() -> StaticText
PreStaticText() -> StaticText
[ "PreStaticText", "()", "-", ">", "StaticText" ]
def PreStaticText(*args, **kwargs): """PreStaticText() -> StaticText""" val = _controls_.new_PreStaticText(*args, **kwargs) return val
[ "def", "PreStaticText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreStaticText", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1043-L1046
phisko/kengine
872baa7f8a1d9c34e024fd972cbb6b9f70e8b26d
systems/polyvox/libs/polyvox/documentation/_extensions/sphinxcontrib/doxylink.py
python
parse_tag_file
(doc)
return mapping
Takes in an XML tree from a Doxygen tag file and returns a dictionary that looks something like: .. code-block:: python {'PolyVox': {'file': 'namespace_poly_vox.html', 'kind': 'namespace'}, 'PolyVox::Array': {'file': 'class_poly_vox_1_1_array.html', 'kind': 'class'}, 'P...
Takes in an XML tree from a Doxygen tag file and returns a dictionary that looks something like: .. code-block:: python {'PolyVox': {'file': 'namespace_poly_vox.html', 'kind': 'namespace'}, 'PolyVox::Array': {'file': 'class_poly_vox_1_1_array.html', 'kind': 'class'}, 'P...
[ "Takes", "in", "an", "XML", "tree", "from", "a", "Doxygen", "tag", "file", "and", "returns", "a", "dictionary", "that", "looks", "something", "like", ":", "..", "code", "-", "block", "::", "python", "{", "PolyVox", ":", "{", "file", ":", "namespace_poly_...
def parse_tag_file(doc): """ Takes in an XML tree from a Doxygen tag file and returns a dictionary that looks something like: .. code-block:: python {'PolyVox': {'file': 'namespace_poly_vox.html', 'kind': 'namespace'}, 'PolyVox::Array': {'file': 'class_poly_vox_1_1_array.html', ...
[ "def", "parse_tag_file", "(", "doc", ")", ":", "mapping", "=", "{", "}", "function_list", "=", "[", "]", "#This is a list of function to be parsed and inserted into mapping at the end of the function.", "for", "compound", "in", "doc", ".", "findall", "(", "\"./compound\""...
https://github.com/phisko/kengine/blob/872baa7f8a1d9c34e024fd972cbb6b9f70e8b26d/systems/polyvox/libs/polyvox/documentation/_extensions/sphinxcontrib/doxylink.py#L79-L162
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
FMRenderer.DrawMenuBar
(self, menubar, dc)
Draws everything for :class:`FlatMenuBar`. :param `menubar`: an instance of :class:`FlatMenuBar`. :param `dc`: an instance of :class:`DC`.
Draws everything for :class:`FlatMenuBar`.
[ "Draws", "everything", "for", ":", "class", ":", "FlatMenuBar", "." ]
def DrawMenuBar(self, menubar, dc): """ Draws everything for :class:`FlatMenuBar`. :param `menubar`: an instance of :class:`FlatMenuBar`. :param `dc`: an instance of :class:`DC`. """ #artMgr = ArtManager.Get() fnt = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_F...
[ "def", "DrawMenuBar", "(", "self", ",", "menubar", ",", "dc", ")", ":", "#artMgr = ArtManager.Get()", "fnt", "=", "wx", ".", "SystemSettings_GetFont", "(", "wx", ".", "SYS_DEFAULT_GUI_FONT", ")", "textColour", "=", "colourutils", ".", "BestLabelColour", "(", "me...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L1093-L1286
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/transforms.py
python
find_setupwiths
(blocks)
return known_ranges
Find all top-level with. Returns a list of ranges for the with-regions.
Find all top-level with.
[ "Find", "all", "top", "-", "level", "with", "." ]
def find_setupwiths(blocks): """Find all top-level with. Returns a list of ranges for the with-regions. """ def find_ranges(blocks): for blk in blocks.values(): for ew in blk.find_insts(ir.EnterWith): yield ew.begin, ew.end def previously_occurred(start, known_r...
[ "def", "find_setupwiths", "(", "blocks", ")", ":", "def", "find_ranges", "(", "blocks", ")", ":", "for", "blk", "in", "blocks", ".", "values", "(", ")", ":", "for", "ew", "in", "blk", ".", "find_insts", "(", "ir", ".", "EnterWith", ")", ":", "yield",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/transforms.py#L499-L527
GXYM/DRRG
9e074fa9052de8d131f55ca1f6ae6673c1bfeca4
dataset/TD500/Evaluation_Protocol/script075.py
python
validate_data
(gtFilePath, submFilePath,evaluationParams)
Method validate_data: validates that all files in the results folder are correct (have the correct name contents). Validates also that there are no missing files in the folder. If some error detected, the method raises the error
Method validate_data: validates that all files in the results folder are correct (have the correct name contents). Validates also that there are no missing files in the folder. If some error detected, the method raises the error
[ "Method", "validate_data", ":", "validates", "that", "all", "files", "in", "the", "results", "folder", "are", "correct", "(", "have", "the", "correct", "name", "contents", ")", ".", "Validates", "also", "that", "there", "are", "no", "missing", "files", "in",...
def validate_data(gtFilePath, submFilePath,evaluationParams): """ Method validate_data: validates that all files in the results folder are correct (have the correct name contents). Validates also that there are no missing files in the folder. If some error...
[ "def", "validate_data", "(", "gtFilePath", ",", "submFilePath", ",", "evaluationParams", ")", ":", "gt", "=", "rrc_evaluation_funcs", ".", "load_zip_file", "(", "gtFilePath", ",", "evaluationParams", "[", "'GT_SAMPLE_NAME_2_ID'", "]", ")", "subm", "=", "rrc_evaluati...
https://github.com/GXYM/DRRG/blob/9e074fa9052de8d131f55ca1f6ae6673c1bfeca4/dataset/TD500/Evaluation_Protocol/script075.py#L31-L50
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/xrc.py
python
XmlNode.SetNext
(*args, **kwargs)
return _xrc.XmlNode_SetNext(*args, **kwargs)
SetNext(self, XmlNode next)
SetNext(self, XmlNode next)
[ "SetNext", "(", "self", "XmlNode", "next", ")" ]
def SetNext(*args, **kwargs): """SetNext(self, XmlNode next)""" return _xrc.XmlNode_SetNext(*args, **kwargs)
[ "def", "SetNext", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlNode_SetNext", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L458-L460
GeometryCollective/boundary-first-flattening
8250e5a0e85980ec50b5e8aa8f49dd6519f915cd
deps/nanogui/docs/exhale.py
python
ExhaleRoot.reparentDirectories
(self)
Helper method for :func:`exhale.ExhaleRoot.reparentAll`. Adds subdirectories as children to the relevant directory ExhaleNode. If a node in ``self.dirs`` is added as a child to a different directory node, it is removed from the ``self.dirs`` list.
Helper method for :func:`exhale.ExhaleRoot.reparentAll`. Adds subdirectories as children to the relevant directory ExhaleNode. If a node in ``self.dirs`` is added as a child to a different directory node, it is removed from the ``self.dirs`` list.
[ "Helper", "method", "for", ":", "func", ":", "exhale", ".", "ExhaleRoot", ".", "reparentAll", ".", "Adds", "subdirectories", "as", "children", "to", "the", "relevant", "directory", "ExhaleNode", ".", "If", "a", "node", "in", "self", ".", "dirs", "is", "add...
def reparentDirectories(self): ''' Helper method for :func:`exhale.ExhaleRoot.reparentAll`. Adds subdirectories as children to the relevant directory ExhaleNode. If a node in ``self.dirs`` is added as a child to a different directory node, it is removed from the ``self.dirs`` l...
[ "def", "reparentDirectories", "(", "self", ")", ":", "dir_parts", "=", "[", "]", "dir_ranks", "=", "[", "]", "for", "d", "in", "self", ".", "dirs", ":", "parts", "=", "d", ".", "name", ".", "split", "(", "\"/\"", ")", "for", "p", "in", "parts", "...
https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/docs/exhale.py#L1691-L1724
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Wm.wm_colormapwindows
(self, *wlist)
Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.
Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.
[ "Store", "list", "of", "window", "names", "(", "WLIST", ")", "into", "WM_COLORMAPWINDOWS", "property", "of", "this", "widget", ".", "This", "list", "contains", "windows", "whose", "colormaps", "differ", "from", "their", "parents", ".", "Return", "current", "li...
def wm_colormapwindows(self, *wlist): """Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.""" if len(wlist) > 1: wlist = (...
[ "def", "wm_colormapwindows", "(", "self", ",", "*", "wlist", ")", ":", "if", "len", "(", "wlist", ")", ">", "1", ":", "wlist", "=", "(", "wlist", ",", ")", "# Tk needs a list of windows here", "args", "=", "(", "'wm'", ",", "'colormapwindows'", ",", "sel...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1638-L1648
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py
python
MiniFieldStorage.__repr__
(self)
return "MiniFieldStorage(%r, %r)" % (self.name, self.value)
Return printable representation.
Return printable representation.
[ "Return", "printable", "representation", "." ]
def __repr__(self): """Return printable representation.""" return "MiniFieldStorage(%r, %r)" % (self.name, self.value)
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"MiniFieldStorage(%r, %r)\"", "%", "(", "self", ".", "name", ",", "self", ".", "value", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py#L288-L290
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py
python
IAMConnection.get_all_users
(self, path_prefix='/', marker=None, max_items=None)
return self.get_response('ListUsers', params, list_marker='Users')
List the users that have the specified path prefix. :type path_prefix: string :param path_prefix: If provided, only users whose paths match the provided prefix will be returned. :type marker: string :param marker: Use this only when paginating results and only i...
List the users that have the specified path prefix.
[ "List", "the", "users", "that", "have", "the", "specified", "path", "prefix", "." ]
def get_all_users(self, path_prefix='/', marker=None, max_items=None): """ List the users that have the specified path prefix. :type path_prefix: string :param path_prefix: If provided, only users whose paths match the provided prefix will be returned. :type marker:...
[ "def", "get_all_users", "(", "self", ",", "path_prefix", "=", "'/'", ",", "marker", "=", "None", ",", "max_items", "=", "None", ")", ":", "params", "=", "{", "'PathPrefix'", ":", "path_prefix", "}", "if", "marker", ":", "params", "[", "'Marker'", "]", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py#L314-L337
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py
python
_TensorArrayGradShape
(op)
return [tensor_shape.vector(2)]
Shape function for ops that take a scalar and produce no outputs.
Shape function for ops that take a scalar and produce no outputs.
[ "Shape", "function", "for", "ops", "that", "take", "a", "scalar", "and", "produce", "no", "outputs", "." ]
def _TensorArrayGradShape(op): """Shape function for ops that take a scalar and produce no outputs.""" op.inputs[0].get_shape().merge_with(tensor_shape.vector(2)) return [tensor_shape.vector(2)]
[ "def", "_TensorArrayGradShape", "(", "op", ")", ":", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", ".", "merge_with", "(", "tensor_shape", ".", "vector", "(", "2", ")", ")", "return", "[", "tensor_shape", ".", "vector", "(", "2", ")...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/tensor_array_ops.py#L417-L420
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintspointgrp.py
python
SymRep.i
(self)
Set equal to an inversion
Set equal to an inversion
[ "Set", "equal", "to", "an", "inversion" ]
def i(self): """Set equal to an inversion""" self.zero() self.d[0][0] = -1.0 self.d[1][1] = -1.0 self.d[2][2] = -1.0 self.d[3][3] = -1.0 self.d[4][4] = -1.0
[ "def", "i", "(", "self", ")", ":", "self", ".", "zero", "(", ")", "self", ".", "d", "[", "0", "]", "[", "0", "]", "=", "-", "1.0", "self", ".", "d", "[", "1", "]", "[", "1", "]", "=", "-", "1.0", "self", ".", "d", "[", "2", "]", "[", ...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintspointgrp.py#L485-L492
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/ssd/dataset/yolo_format.py
python
YoloFormat._load_image_labels
(self)
return temp
preprocess all ground-truths Returns: ---------- labels packed in [num_images x max_num_objects x 5] tensor
preprocess all ground-truths
[ "preprocess", "all", "ground", "-", "truths" ]
def _load_image_labels(self): """ preprocess all ground-truths Returns: ---------- labels packed in [num_images x max_num_objects x 5] tensor """ temp = [] # load ground-truths for idx in self.image_set_index: label_file = self._label...
[ "def", "_load_image_labels", "(", "self", ")", ":", "temp", "=", "[", "]", "# load ground-truths", "for", "idx", "in", "self", ".", "image_set_index", ":", "label_file", "=", "self", ".", "_label_path_from_index", "(", "idx", ")", "with", "open", "(", "label...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/dataset/yolo_format.py#L141-L170
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/tools/strip_unused_lib.py
python
strip_unused
(input_graph_def, input_node_names, output_node_names, placeholder_type_enum)
return output_graph_def
Removes unused nodes from a GraphDef. Args: input_graph_def: A graph with nodes we want to prune. input_node_names: A list of the nodes we use as inputs. output_node_names: A list of the output nodes. placeholder_type_enum: The AttrValue enum for the placeholder data type. Returns: A GraphDef ...
Removes unused nodes from a GraphDef.
[ "Removes", "unused", "nodes", "from", "a", "GraphDef", "." ]
def strip_unused(input_graph_def, input_node_names, output_node_names, placeholder_type_enum): """Removes unused nodes from a GraphDef. Args: input_graph_def: A graph with nodes we want to prune. input_node_names: A list of the nodes we use as inputs. output_node_names: A list of the o...
[ "def", "strip_unused", "(", "input_graph_def", ",", "input_node_names", ",", "output_node_names", ",", "placeholder_type_enum", ")", ":", "# Here we replace the nodes we're going to override as inputs with", "# placeholders so that any unused nodes that are inputs to them are", "# automa...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/tools/strip_unused_lib.py#L30-L63
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/chunk.py
python
Chunk.getsize
(self)
return self.chunksize
Return the size of the current chunk.
Return the size of the current chunk.
[ "Return", "the", "size", "of", "the", "current", "chunk", "." ]
def getsize(self): """Return the size of the current chunk.""" return self.chunksize
[ "def", "getsize", "(", "self", ")", ":", "return", "self", ".", "chunksize" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/chunk.py#L82-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/wheel/metadata.py
python
convert_requirements
(requirements)
Yield Requires-Dist: strings for parsed requirements strings.
Yield Requires-Dist: strings for parsed requirements strings.
[ "Yield", "Requires", "-", "Dist", ":", "strings", "for", "parsed", "requirements", "strings", "." ]
def convert_requirements(requirements): """Yield Requires-Dist: strings for parsed requirements strings.""" for req in requirements: parsed_requirement = pkg_resources.Requirement.parse(req) spec = requires_to_requires_dist(parsed_requirement) extras = ",".join(sorted(parsed_requirement....
[ "def", "convert_requirements", "(", "requirements", ")", ":", "for", "req", "in", "requirements", ":", "parsed_requirement", "=", "pkg_resources", ".", "Requirement", ".", "parse", "(", "req", ")", "spec", "=", "requires_to_requires_dist", "(", "parsed_requirement",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/wheel/metadata.py#L26-L34
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/common/walterWidgets/walterBaseTreeView.py
python
BaseModel.refresh
(self)
Read the attributes and recreate the layers.
Read the attributes and recreate the layers.
[ "Read", "the", "attributes", "and", "recreate", "the", "layers", "." ]
def refresh(self): """Read the attributes and recreate the layers.""" pass
[ "def", "refresh", "(", "self", ")", ":", "pass" ]
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterBaseTreeView.py#L130-L132
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/utils/file_baton.py
python
FileBaton.try_acquire
(self)
Tries to atomically create a file under exclusive access. Returns: True if the file could be created, else False.
Tries to atomically create a file under exclusive access.
[ "Tries", "to", "atomically", "create", "a", "file", "under", "exclusive", "access", "." ]
def try_acquire(self): ''' Tries to atomically create a file under exclusive access. Returns: True if the file could be created, else False. ''' try: self.fd = os.open(self.lock_file_path, os.O_CREAT | os.O_EXCL) return True except Fil...
[ "def", "try_acquire", "(", "self", ")", ":", "try", ":", "self", ".", "fd", "=", "os", ".", "open", "(", "self", ".", "lock_file_path", ",", "os", ".", "O_CREAT", "|", "os", ".", "O_EXCL", ")", "return", "True", "except", "FileExistsError", ":", "ret...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/file_baton.py#L21-L32
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/threading.py
python
Thread.run
(self)
Method representing the thread's activity. You may override this method in a subclass. The standard run() method invokes the callable object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments,...
Method representing the thread's activity.
[ "Method", "representing", "the", "thread", "s", "activity", "." ]
def run(self): """Method representing the thread's activity. You may override this method in a subclass. The standard run() method invokes the callable object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the ...
[ "def", "run", "(", "self", ")", ":", "try", ":", "if", "self", ".", "__target", ":", "self", ".", "__target", "(", "*", "self", ".", "__args", ",", "*", "*", "self", ".", "__kwargs", ")", "finally", ":", "# Avoid a refcycle if the thread is running a funct...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/threading.py#L750-L765
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/numbers.py
python
_int_arith_flags
(rettype)
Return the modifier flags for integer arithmetic.
Return the modifier flags for integer arithmetic.
[ "Return", "the", "modifier", "flags", "for", "integer", "arithmetic", "." ]
def _int_arith_flags(rettype): """ Return the modifier flags for integer arithmetic. """ if rettype.signed: # Ignore the effects of signed overflow. This is important for # optimization of some indexing operations. For example # array[i+1] could see `i+1` trigger a signed overf...
[ "def", "_int_arith_flags", "(", "rettype", ")", ":", "if", "rettype", ".", "signed", ":", "# Ignore the effects of signed overflow. This is important for", "# optimization of some indexing operations. For example", "# array[i+1] could see `i+1` trigger a signed overflow and", "# give a...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/numbers.py#L22-L36
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/experimental/parse_avro_ops.py
python
_parse_avro
( serialized, reader_schema, names=None, sparse_keys=None, sparse_types=None, sparse_ranks=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name=None, avro_num_minibatches=0, )
Parses Avro records. Args: serialized: A vector (1-D Tensor) of strings, a batch of binary serialized `Example` protos. reader_schema: A scalar string representing the reader schema. names: A vector (1-D Tensor) of strings (optional), the names of the serialized protos. ...
Parses Avro records.
[ "Parses", "Avro", "records", "." ]
def _parse_avro( serialized, reader_schema, names=None, sparse_keys=None, sparse_types=None, sparse_ranks=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name=None, avro_num_minibatches=0, ): """Parses Avro records. Args: ...
[ "def", "_parse_avro", "(", "serialized", ",", "reader_schema", ",", "names", "=", "None", ",", "sparse_keys", "=", "None", ",", "sparse_types", "=", "None", ",", "sparse_ranks", "=", "None", ",", "dense_keys", "=", "None", ",", "dense_types", "=", "None", ...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/parse_avro_ops.py#L121-L210
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
Slider.GetValue
(*args, **kwargs)
return _controls_.Slider_GetValue(*args, **kwargs)
GetValue(self) -> int
GetValue(self) -> int
[ "GetValue", "(", "self", ")", "-", ">", "int" ]
def GetValue(*args, **kwargs): """GetValue(self) -> int""" return _controls_.Slider_GetValue(*args, **kwargs)
[ "def", "GetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Slider_GetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2840-L2842
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/pkg_resources.py
python
to_filename
(name)
return name.replace('-','_')
Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'.
Convert a project or version name to its filename-escaped form
[ "Convert", "a", "project", "or", "version", "name", "to", "its", "filename", "-", "escaped", "form" ]
def to_filename(name): """Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. """ return name.replace('-','_')
[ "def", "to_filename", "(", "name", ")", ":", "return", "name", ".", "replace", "(", "'-'", ",", "'_'", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pkg_resources.py#L1018-L1023
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.AnnotationGetText
(*args, **kwargs)
return _stc.StyledTextCtrl_AnnotationGetText(*args, **kwargs)
AnnotationGetText(self, int line) -> String Get the annotation text for a line
AnnotationGetText(self, int line) -> String
[ "AnnotationGetText", "(", "self", "int", "line", ")", "-", ">", "String" ]
def AnnotationGetText(*args, **kwargs): """ AnnotationGetText(self, int line) -> String Get the annotation text for a line """ return _stc.StyledTextCtrl_AnnotationGetText(*args, **kwargs)
[ "def", "AnnotationGetText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_AnnotationGetText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5927-L5933
scanner-research/scanner
04a0c4b4196341995985acd729c0788aab823e1c
python/scannerpy/storage.py
python
NamedVideoStream.__init__
(self, sc, name, path=None, inplace=False, storage=None)
Parameters ---------- sc: Client Scanner client name: str Name of the stream in Scanner storage. path: str Path to corresponding video file. If this parameter is given, the named video stream will be created from the video at the given path. ...
Parameters ---------- sc: Client Scanner client
[ "Parameters", "----------", "sc", ":", "Client", "Scanner", "client" ]
def __init__(self, sc, name, path=None, inplace=False, storage=None): """ Parameters ---------- sc: Client Scanner client name: str Name of the stream in Scanner storage. path: str Path to corresponding video file. If this parameter is give...
[ "def", "__init__", "(", "self", ",", "sc", ",", "name", ",", "path", "=", "None", ",", "inplace", "=", "False", ",", "storage", "=", "None", ")", ":", "if", "storage", "is", "None", ":", "self", ".", "_storage", "=", "NamedVideoStorage", "(", ")", ...
https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/storage.py#L307-L334
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/formats/style_render.py
python
maybe_convert_css_to_tuples
(style: CSSProperties)
return style
Convert css-string to sequence of tuples format if needed. 'color:red; border:1px solid black;' -> [('color', 'red'), ('border','1px solid red')]
Convert css-string to sequence of tuples format if needed. 'color:red; border:1px solid black;' -> [('color', 'red'), ('border','1px solid red')]
[ "Convert", "css", "-", "string", "to", "sequence", "of", "tuples", "format", "if", "needed", ".", "color", ":", "red", ";", "border", ":", "1px", "solid", "black", ";", "-", ">", "[", "(", "color", "red", ")", "(", "border", "1px", "solid", "red", ...
def maybe_convert_css_to_tuples(style: CSSProperties) -> CSSList: """ Convert css-string to sequence of tuples format if needed. 'color:red; border:1px solid black;' -> [('color', 'red'), ('border','1px solid red')] """ if isinstance(style, str): ...
[ "def", "maybe_convert_css_to_tuples", "(", "style", ":", "CSSProperties", ")", "->", "CSSList", ":", "if", "isinstance", "(", "style", ",", "str", ")", ":", "s", "=", "style", ".", "split", "(", "\";\"", ")", "try", ":", "return", "[", "(", "x", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/style_render.py#L1050-L1069
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/msvc.py
python
pch_emitter
(target, source, env)
return (target, source)
Adds the object file target.
Adds the object file target.
[ "Adds", "the", "object", "file", "target", "." ]
def pch_emitter(target, source, env): """Adds the object file target.""" validate_vars(env) pch = None obj = None for t in target: if SCons.Util.splitext(str(t))[1] == '.pch': pch = t if SCons.Util.splitext(str(t))[1] == '.obj': obj = t if not obj: ...
[ "def", "pch_emitter", "(", "target", ",", "source", ",", "env", ")", ":", "validate_vars", "(", "env", ")", "pch", "=", "None", "obj", "=", "None", "for", "t", "in", "target", ":", "if", "SCons", ".", "Util", ".", "splitext", "(", "str", "(", "t", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/msvc.py#L79-L98
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/signal/ltisys.py
python
_valid_inputs
(A, B, poles, method, rtol, maxiter)
return update_loop, poles
Check the poles come in complex conjugage pairs Check shapes of A, B and poles are compatible. Check the method chosen is compatible with provided poles Return update method to use and ordered poles
Check the poles come in complex conjugage pairs Check shapes of A, B and poles are compatible. Check the method chosen is compatible with provided poles Return update method to use and ordered poles
[ "Check", "the", "poles", "come", "in", "complex", "conjugage", "pairs", "Check", "shapes", "of", "A", "B", "and", "poles", "are", "compatible", ".", "Check", "the", "method", "chosen", "is", "compatible", "with", "provided", "poles", "Return", "update", "met...
def _valid_inputs(A, B, poles, method, rtol, maxiter): """ Check the poles come in complex conjugage pairs Check shapes of A, B and poles are compatible. Check the method chosen is compatible with provided poles Return update method to use and ordered poles """ poles = np.asarray(poles) ...
[ "def", "_valid_inputs", "(", "A", ",", "B", ",", "poles", ",", "method", ",", "rtol", ",", "maxiter", ")", ":", "poles", "=", "np", ".", "asarray", "(", "poles", ")", "if", "poles", ".", "ndim", ">", "1", ":", "raise", "ValueError", "(", "\"Poles m...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/ltisys.py#L2497-L2545
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2B_PUBLIC_KEY_RSA.initFromTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def initFromTpm(self, buf): """ TpmMarshaller method """ self.buffer = buf.readSizedByteBuf()
[ "def", "initFromTpm", "(", "self", ",", "buf", ")", ":", "self", ".", "buffer", "=", "buf", ".", "readSizedByteBuf", "(", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7151-L7153
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/aoc/civ_subprocessor.py
python
AoCCivSubprocessor.get_starting_resources
(civ_group)
return resource_amounts
Returns the starting resources of a civ.
Returns the starting resources of a civ.
[ "Returns", "the", "starting", "resources", "of", "a", "civ", "." ]
def get_starting_resources(civ_group): """ Returns the starting resources of a civ. """ resource_amounts = [] civ_id = civ_group.get_id() dataset = civ_group.data civ_lookup_dict = internal_name_lookups.get_civ_lookups(dataset.game_version) civ_name = c...
[ "def", "get_starting_resources", "(", "civ_group", ")", ":", "resource_amounts", "=", "[", "]", "civ_id", "=", "civ_group", ".", "get_id", "(", ")", "dataset", "=", "civ_group", ".", "data", "civ_lookup_dict", "=", "internal_name_lookups", ".", "get_civ_lookups", ...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/civ_subprocessor.py#L55-L177
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/utils/history.py
python
Historic.__init__
(self)
Initialize subscriber list.
Initialize subscriber list.
[ "Initialize", "subscriber", "list", "." ]
def __init__(self): """Initialize subscriber list.""" self._subscribers = []
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "_subscribers", "=", "[", "]" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/utils/history.py#L50-L52
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
python
DNSFlippingRatioCorr._can_correct
(self)
return True
checks whether FR correction is possible with the given list of workspaces
checks whether FR correction is possible with the given list of workspaces
[ "checks", "whether", "FR", "correction", "is", "possible", "with", "the", "given", "list", "of", "workspaces" ]
def _can_correct(self): """ checks whether FR correction is possible with the given list of workspaces """ # list of workspaces must not be empty if not self.input_workspaces: message = "No workspace names has been specified! Nothing for FR correction." se...
[ "def", "_can_correct", "(", "self", ")", ":", "# list of workspaces must not be empty", "if", "not", "self", ".", "input_workspaces", ":", "message", "=", "\"No workspace names has been specified! Nothing for FR correction.\"", "self", ".", "log", "(", ")", ".", "error", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py#L101-L118
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/esptool.py
python
ESP8266ROM.get_erase_size
(self, offset, size)
Calculate an erase size given a specific size in bytes. Provides a workaround for the bootloader erase bug.
Calculate an erase size given a specific size in bytes.
[ "Calculate", "an", "erase", "size", "given", "a", "specific", "size", "in", "bytes", "." ]
def get_erase_size(self, offset, size): """ Calculate an erase size given a specific size in bytes. Provides a workaround for the bootloader erase bug.""" sectors_per_block = 16 sector_size = self.FLASH_SECTOR_SIZE num_sectors = (size + sector_size - 1) // sector_size s...
[ "def", "get_erase_size", "(", "self", ",", "offset", ",", "size", ")", ":", "sectors_per_block", "=", "16", "sector_size", "=", "self", ".", "FLASH_SECTOR_SIZE", "num_sectors", "=", "(", "size", "+", "sector_size", "-", "1", ")", "//", "sector_size", "start_...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/esptool.py#L1078-L1095