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
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/text_classifier/_text_classifier.py
python
TextClassifier.evaluate
(self, dataset, metric="auto", **kwargs)
return m.evaluate(test, metric, **kwargs)
Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame An SFrame having the same feature columns as provided when creating the model. metric : str, optional Name ...
Evaluate the model by making predictions of target values and comparing these to actual values.
[ "Evaluate", "the", "model", "by", "making", "predictions", "of", "target", "values", "and", "comparing", "these", "to", "actual", "values", "." ]
def evaluate(self, dataset, metric="auto", **kwargs): """ Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame An SFrame having the same feature columns as provided when creatin...
[ "def", "evaluate", "(", "self", ",", "dataset", ",", "metric", "=", "\"auto\"", ",", "*", "*", "kwargs", ")", ":", "m", "=", "self", ".", "__proxy__", "[", "\"classifier\"", "]", "target", "=", "self", ".", "__proxy__", "[", "\"target\"", "]", "f", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/text_classifier/_text_classifier.py#L318-L361
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/distributions/python/ops/binomial.py
python
Binomial._maybe_assert_valid_sample
(self, counts)
return control_flow_ops.with_dependencies([ check_ops.assert_less_equal( counts, self.total_count, message="counts are not less than or equal to n."), ], counts)
Check counts for proper shape, values, then return tensor version.
Check counts for proper shape, values, then return tensor version.
[ "Check", "counts", "for", "proper", "shape", "values", "then", "return", "tensor", "version", "." ]
def _maybe_assert_valid_sample(self, counts): """Check counts for proper shape, values, then return tensor version.""" if not self.validate_args: return counts counts = distribution_util.embed_check_nonnegative_integer_form(counts) return control_flow_ops.with_dependencies([ check_ops.asse...
[ "def", "_maybe_assert_valid_sample", "(", "self", ",", "counts", ")", ":", "if", "not", "self", ".", "validate_args", ":", "return", "counts", "counts", "=", "distribution_util", ".", "embed_check_nonnegative_integer_form", "(", "counts", ")", "return", "control_flo...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/binomial.py#L275-L284
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
tomviz/python/tomviz/utils.py
python
get_coordinate_arrays
(dataobject)
return (xx, yy, zz)
Returns a triple of Numpy arrays containing x, y, and z coordinates for each point in the dataset. This can be used to evaluate a function at each point, for instance.
Returns a triple of Numpy arrays containing x, y, and z coordinates for each point in the dataset. This can be used to evaluate a function at each point, for instance.
[ "Returns", "a", "triple", "of", "Numpy", "arrays", "containing", "x", "y", "and", "z", "coordinates", "for", "each", "point", "in", "the", "dataset", ".", "This", "can", "be", "used", "to", "evaluate", "a", "function", "at", "each", "point", "for", "inst...
def get_coordinate_arrays(dataobject): """Returns a triple of Numpy arrays containing x, y, and z coordinates for each point in the dataset. This can be used to evaluate a function at each point, for instance. """ assert dataobject.IsA("vtkImageData"), "Dataset must be a vtkImageData" # Create ...
[ "def", "get_coordinate_arrays", "(", "dataobject", ")", ":", "assert", "dataobject", ".", "IsA", "(", "\"vtkImageData\"", ")", ",", "\"Dataset must be a vtkImageData\"", "# Create meshgrid for image", "spacing", "=", "dataobject", ".", "GetSpacing", "(", ")", "origin", ...
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/utils.py#L173-L191
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/atom/http_core.py
python
HttpRequest.add_form_inputs
(self, form_data, mime_type='application/x-www-form-urlencoded')
Form-encodes and adds data to the request body. Args: form_data: dict or sequnce or two member tuples which contains the form keys and values. mime_type: str The MIME type of the form data being sent. Defaults to 'application/x-www-form-urlencoded'.
Form-encodes and adds data to the request body.
[ "Form", "-", "encodes", "and", "adds", "data", "to", "the", "request", "body", "." ]
def add_form_inputs(self, form_data, mime_type='application/x-www-form-urlencoded'): """Form-encodes and adds data to the request body. Args: form_data: dict or sequnce or two member tuples which contains the form keys and values. mime_type: str The MIME type ...
[ "def", "add_form_inputs", "(", "self", ",", "form_data", ",", "mime_type", "=", "'application/x-www-form-urlencoded'", ")", ":", "body", "=", "urllib", ".", "urlencode", "(", "form_data", ")", "self", ".", "add_body_part", "(", "body", ",", "mime_type", ")" ]
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/atom/http_core.py#L153-L164
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/bond_core/smclib/python/smclib/statemap.py
python
FSMContext.getState
(self)
return self._state
Returns the current state.
Returns the current state.
[ "Returns", "the", "current", "state", "." ]
def getState(self): """Returns the current state.""" if self._state == None: raise StateUndefinedException return self._state
[ "def", "getState", "(", "self", ")", ":", "if", "self", ".", "_state", "==", "None", ":", "raise", "StateUndefinedException", "return", "self", ".", "_state" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/bond_core/smclib/python/smclib/statemap.py#L101-L105
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/bindings/python/clang/cindex.py
python
Cursor.underlying_typedef_type
(self)
return self._underlying_type
Return the underlying type of a typedef declaration. Returns a Type for the typedef this cursor is a declaration for. If the current cursor is not a typedef, this raises.
Return the underlying type of a typedef declaration.
[ "Return", "the", "underlying", "type", "of", "a", "typedef", "declaration", "." ]
def underlying_typedef_type(self): """Return the underlying type of a typedef declaration. Returns a Type for the typedef this cursor is a declaration for. If the current cursor is not a typedef, this raises. """ if not hasattr(self, '_underlying_type'): assert self....
[ "def", "underlying_typedef_type", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_underlying_type'", ")", ":", "assert", "self", ".", "kind", ".", "is_declaration", "(", ")", "self", ".", "_underlying_type", "=", "conf", ".", "lib", "."...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L1685-L1696
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchEquipment.py
python
_Equipment.addSketchArchFeatures
(self,obj,linkObj=None,mode=None)
To add features in the SketchArch External Add-on, if present (https://github.com/paullee0/FreeCAD_SketchArch) - import ArchSketchObject module, and - set properties that are common to ArchObjects (including Links) and ArchSketch to support the additional features To in...
To add features in the SketchArch External Add-on, if present (https://github.com/paullee0/FreeCAD_SketchArch) - import ArchSketchObject module, and - set properties that are common to ArchObjects (including Links) and ArchSketch to support the additional features
[ "To", "add", "features", "in", "the", "SketchArch", "External", "Add", "-", "on", "if", "present", "(", "https", ":", "//", "github", ".", "com", "/", "paullee0", "/", "FreeCAD_SketchArch", ")", "-", "import", "ArchSketchObject", "module", "and", "-", "set...
def addSketchArchFeatures(self,obj,linkObj=None,mode=None): ''' To add features in the SketchArch External Add-on, if present (https://github.com/paullee0/FreeCAD_SketchArch) - import ArchSketchObject module, and - set properties that are common to ArchObjects (including Link...
[ "def", "addSketchArchFeatures", "(", "self", ",", "obj", ",", "linkObj", "=", "None", ",", "mode", "=", "None", ")", ":", "try", ":", "import", "ArchSketchObject", "ArchSketchObject", ".", "ArchSketch", ".", "setPropertiesLinkCommon", "(", "self", ",", "obj", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchEquipment.py#L287-L301
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
get_stats_for_node_def
(graph, node, statistic_type)
return result
Looks up the node's statistics function in the registry and calls it. This function takes a Graph object and a NodeDef from a GraphDef, and if there's an associated statistics method, calls it and returns a result. If no function has been registered for the particular node type, it returns an empty statistics ...
Looks up the node's statistics function in the registry and calls it.
[ "Looks", "up", "the", "node", "s", "statistics", "function", "in", "the", "registry", "and", "calls", "it", "." ]
def get_stats_for_node_def(graph, node, statistic_type): """Looks up the node's statistics function in the registry and calls it. This function takes a Graph object and a NodeDef from a GraphDef, and if there's an associated statistics method, calls it and returns a result. If no function has been registered f...
[ "def", "get_stats_for_node_def", "(", "graph", ",", "node", ",", "statistic_type", ")", ":", "try", ":", "stats_func", "=", "_stats_registry", ".", "lookup", "(", "node", ".", "op", "+", "\",\"", "+", "statistic_type", ")", "result", "=", "stats_func", "(", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L2045-L2066
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Menu.GetStyle
(*args, **kwargs)
return _core_.Menu_GetStyle(*args, **kwargs)
GetStyle(self) -> long
GetStyle(self) -> long
[ "GetStyle", "(", "self", ")", "-", ">", "long" ]
def GetStyle(*args, **kwargs): """GetStyle(self) -> long""" return _core_.Menu_GetStyle(*args, **kwargs)
[ "def", "GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Menu_GetStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12218-L12220
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
LayoutAlgorithm.LayoutMDIFrame
(*args, **kwargs)
return _windows_.LayoutAlgorithm_LayoutMDIFrame(*args, **kwargs)
LayoutMDIFrame(self, MDIParentFrame frame, Rect rect=None) -> bool
LayoutMDIFrame(self, MDIParentFrame frame, Rect rect=None) -> bool
[ "LayoutMDIFrame", "(", "self", "MDIParentFrame", "frame", "Rect", "rect", "=", "None", ")", "-", ">", "bool" ]
def LayoutMDIFrame(*args, **kwargs): """LayoutMDIFrame(self, MDIParentFrame frame, Rect rect=None) -> bool""" return _windows_.LayoutAlgorithm_LayoutMDIFrame(*args, **kwargs)
[ "def", "LayoutMDIFrame", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "LayoutAlgorithm_LayoutMDIFrame", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L2093-L2095
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/bayesflow/python/ops/stochastic_tensor_impl.py
python
ObservedStochasticTensor.__init__
(self, dist, value, name=None)
Construct an `ObservedStochasticTensor`. `ObservedStochasticTensor` is backed by distribution `dist` and uses the provided value instead of using the current value type to draw a value from the distribution. The provided value argument must be appropriately shaped to have come from the distribution. ...
Construct an `ObservedStochasticTensor`.
[ "Construct", "an", "ObservedStochasticTensor", "." ]
def __init__(self, dist, value, name=None): """Construct an `ObservedStochasticTensor`. `ObservedStochasticTensor` is backed by distribution `dist` and uses the provided value instead of using the current value type to draw a value from the distribution. The provided value argument must be appropriatel...
[ "def", "__init__", "(", "self", ",", "dist", ",", "value", ",", "name", "=", "None", ")", ":", "if", "not", "isinstance", "(", "dist", ",", "distribution", ".", "Distribution", ")", ":", "raise", "TypeError", "(", "\"dist must be an instance of Distribution\""...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/bayesflow/python/ops/stochastic_tensor_impl.py#L421-L463
baidu/AnyQ
d94d450d2aaa5f7ed73424b10aa4539835b97527
tools/simnet/train/tf/tools/tf_record_writer.py
python
int_feature
(v)
return tf.train.Feature(int64_list=tf.train.Int64List(value=v))
int feature
int feature
[ "int", "feature" ]
def int_feature(v): """ int feature """ return tf.train.Feature(int64_list=tf.train.Int64List(value=v))
[ "def", "int_feature", "(", "v", ")", ":", "return", "tf", ".", "train", ".", "Feature", "(", "int64_list", "=", "tf", ".", "train", ".", "Int64List", "(", "value", "=", "v", ")", ")" ]
https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/train/tf/tools/tf_record_writer.py#L27-L31
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/turtle.py
python
TNavigator.distance
(self, x, y=None)
return abs(pos - self._position)
Return the distance from the turtle to (x,y) in turtle step units. Arguments: x -- a number or a pair/vector of numbers or a turtle instance y -- a number None None call: distance(x, y) # two coordinates --or: distance((x, y)) ...
Return the distance from the turtle to (x,y) in turtle step units.
[ "Return", "the", "distance", "from", "the", "turtle", "to", "(", "x", "y", ")", "in", "turtle", "step", "units", "." ]
def distance(self, x, y=None): """Return the distance from the turtle to (x,y) in turtle step units. Arguments: x -- a number or a pair/vector of numbers or a turtle instance y -- a number None None call: distance(x, y) # two coor...
[ "def", "distance", "(", "self", ",", "x", ",", "y", "=", "None", ")", ":", "if", "y", "is", "not", "None", ":", "pos", "=", "Vec2D", "(", "x", ",", "y", ")", "if", "isinstance", "(", "x", ",", "Vec2D", ")", ":", "pos", "=", "x", "elif", "is...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L1828-L1858
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel._get_closest_point_distance_brute
(self, points)
return dist
Return the distance between the two closest points.
Return the distance between the two closest points.
[ "Return", "the", "distance", "between", "the", "two", "closest", "points", "." ]
def _get_closest_point_distance_brute(self, points): """Return the distance between the two closest points.""" point_count = len(points) dist = sys.float_info.max for i in range(1, point_count): for j in range(i): dist = min(dist, self._distance_between(points...
[ "def", "_get_closest_point_distance_brute", "(", "self", ",", "points", ")", ":", "point_count", "=", "len", "(", "points", ")", "dist", "=", "sys", ".", "float_info", ".", "max", "for", "i", "in", "range", "(", "1", ",", "point_count", ")", ":", "for", ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L8192-L8199
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
AcceleratorEntry.ToString
(*args, **kwargs)
return _core_.AcceleratorEntry_ToString(*args, **kwargs)
ToString(self) -> String Returns a string representation for the this accelerator. The string is formatted using the <flags>-<keycode> format where <flags> maybe a hyphen-separed list of "shift|alt|ctrl"
ToString(self) -> String
[ "ToString", "(", "self", ")", "-", ">", "String" ]
def ToString(*args, **kwargs): """ ToString(self) -> String Returns a string representation for the this accelerator. The string is formatted using the <flags>-<keycode> format where <flags> maybe a hyphen-separed list of "shift|alt|ctrl" """ return _core_.Acce...
[ "def", "ToString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "AcceleratorEntry_ToString", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8960-L8969
anestisb/oatdump_plus
ba858c1596598f0d9ae79c14d08c708cecc50af3
tools/cpplint.py
python
_Quiet
()
return _cpplint_state.quiet
Returns the module's quiet setting.
Returns the module's quiet setting.
[ "Returns", "the", "module", "s", "quiet", "setting", "." ]
def _Quiet(): """Returns the module's quiet setting.""" return _cpplint_state.quiet
[ "def", "_Quiet", "(", ")", ":", "return", "_cpplint_state", ".", "quiet" ]
https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L657-L659
simsong/bulk_extractor
738911df22b7066ca9e1662f4131fb44090a4196
python/dfxml.py
python
ET_tostring
(*pargs, **kwargs)
return retval
The ElementTree XML interface produces redundant namespace declarations if you print an element at a time. This method simply removes all xmlns delcarations from the string.
The ElementTree XML interface produces redundant namespace declarations if you print an element at a time. This method simply removes all xmlns delcarations from the string.
[ "The", "ElementTree", "XML", "interface", "produces", "redundant", "namespace", "declarations", "if", "you", "print", "an", "element", "at", "a", "time", ".", "This", "method", "simply", "removes", "all", "xmlns", "delcarations", "from", "the", "string", "." ]
def ET_tostring(*pargs, **kwargs): """ The ElementTree XML interface produces redundant namespace declarations if you print an element at a time. This method simply removes all xmlns delcarations from the string. """ global rx_xmlns import xml.etree.ElementTree as ET tempstring = ET.tos...
[ "def", "ET_tostring", "(", "*", "pargs", ",", "*", "*", "kwargs", ")", ":", "global", "rx_xmlns", "import", "xml", ".", "etree", ".", "ElementTree", "as", "ET", "tempstring", "=", "ET", ".", "tostring", "(", "*", "pargs", ",", "*", "*", "kwargs", ")"...
https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L1554-L1564
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/psro_v2/psro_v2.py
python
PSROSolver.update_empirical_gamestate
(self, seed=None)
return meta_games
Given new agents in _new_policies, update meta_games through simulations. Args: seed: Seed for environment generation. Returns: Meta game payoff matrix.
Given new agents in _new_policies, update meta_games through simulations.
[ "Given", "new", "agents", "in", "_new_policies", "update", "meta_games", "through", "simulations", "." ]
def update_empirical_gamestate(self, seed=None): """Given new agents in _new_policies, update meta_games through simulations. Args: seed: Seed for environment generation. Returns: Meta game payoff matrix. """ if seed is not None: np.random.seed(seed=seed) assert self._oracle ...
[ "def", "update_empirical_gamestate", "(", "self", ",", "seed", "=", "None", ")", ":", "if", "seed", "is", "not", "None", ":", "np", ".", "random", ".", "seed", "(", "seed", "=", "seed", ")", "assert", "self", ".", "_oracle", "is", "not", "None", "if"...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/psro_v2/psro_v2.py#L353-L460
Yijunmaverick/GenerativeFaceCompletion
f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2
scripts/cpp_lint.py
python
RemoveMultiLineComments
(filename, lines, error)
Removes multiline (c-style) comments from lines.
Removes multiline (c-style) comments from lines.
[ "Removes", "multiline", "(", "c", "-", "style", ")", "comments", "from", "lines", "." ]
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, line...
[ "def", "RemoveMultiLineComments", "(", "filename", ",", "lines", ",", "error", ")", ":", "lineix", "=", "0", "while", "lineix", "<", "len", "(", "lines", ")", ":", "lineix_begin", "=", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", "if", ...
https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/scripts/cpp_lint.py#L1151-L1164
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
sscnn_skullstripping/sscnn_skullstripping/deeplearn_utils/DeepImageSynth.py
python
FeatureGenerator.build_seg_from_patches
(self, in_patches, indices, padded_img_size, patch_crop_size, step_size, center_voxel=False)
return label_img_data
patch_crop_size depends on the size of the cnn filter. If [3,3,3] then [1,1,1]
patch_crop_size depends on the size of the cnn filter. If [3,3,3] then [1,1,1]
[ "patch_crop_size", "depends", "on", "the", "size", "of", "the", "cnn", "filter", ".", "If", "[", "3", "3", "3", "]", "then", "[", "1", "1", "1", "]" ]
def build_seg_from_patches(self, in_patches, indices, padded_img_size, patch_crop_size, step_size, center_voxel=False): ''' patch_crop_size depends on the size of the cnn filter. If [3,3,3] then [1,1,1]''' print(padded_img_size) out_img_data = np.zeros(padded_img_size) count_img_data = n...
[ "def", "build_seg_from_patches", "(", "self", ",", "in_patches", ",", "indices", ",", "padded_img_size", ",", "patch_crop_size", ",", "step_size", ",", "center_voxel", "=", "False", ")", ":", "print", "(", "padded_img_size", ")", "out_img_data", "=", "np", ".", ...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/sscnn_skullstripping/sscnn_skullstripping/deeplearn_utils/DeepImageSynth.py#L2148-L2246
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
DataHandler.WriteImmediateCmdSet
(self, func, file)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteImmediateCmdSet(self, func, file): """Overrriden from TypeHandler.""" copy_args = func.MakeCmdArgString("_", False) file.Write(" void* Set(void* cmd%s) {\n" % func.MakeTypedCmdArgString("_", True)) self.WriteImmediateCmdGetTotalSize(func, file) file.Write(" static_cast<Va...
[ "def", "WriteImmediateCmdSet", "(", "self", ",", "func", ",", "file", ")", ":", "copy_args", "=", "func", ".", "MakeCmdArgString", "(", "\"_\"", ",", "False", ")", "file", ".", "Write", "(", "\" void* Set(void* cmd%s) {\\n\"", "%", "func", ".", "MakeTypedCmdA...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3704-L3714
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/py_vulcanize/resource_loader.py
python
ResourceLoader.FindModuleResource
(self, requested_module_name)
return html_resource
Finds a module javascript file and returns a Resource, or none.
Finds a module javascript file and returns a Resource, or none.
[ "Finds", "a", "module", "javascript", "file", "and", "returns", "a", "Resource", "or", "none", "." ]
def FindModuleResource(self, requested_module_name): """Finds a module javascript file and returns a Resource, or none.""" js_resource = self._FindResourceGivenNameAndSuffix( requested_module_name, '.js', return_resource=True) html_resource = self._FindResourceGivenNameAndSuffix( requested_m...
[ "def", "FindModuleResource", "(", "self", ",", "requested_module_name", ")", ":", "js_resource", "=", "self", ".", "_FindResourceGivenNameAndSuffix", "(", "requested_module_name", ",", "'.js'", ",", "return_resource", "=", "True", ")", "html_resource", "=", "self", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/py_vulcanize/resource_loader.py#L96-L109
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/symbol.py
python
load
(fname)
return Symbol(handle)
Loads symbol from a JSON file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save ...
Loads symbol from a JSON file.
[ "Loads", "symbol", "from", "a", "JSON", "file", "." ]
def load(fname): """Loads symbol from a JSON file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being abl...
[ "def", "load", "(", "fname", ")", ":", "if", "not", "isinstance", "(", "fname", ",", "string_types", ")", ":", "raise", "TypeError", "(", "'fname need to be string'", ")", "handle", "=", "SymbolHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolCrea...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/symbol.py#L2810-L2840
cksystemsgroup/scal
fa2208a97a77d65f4e90f85fef3404c27c1f2ac2
tools/cpplint.py
python
CheckSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
Checks for the correctness of various spacing issues in the code.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L2999-L3124
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/importer.py
python
_MaybeDevice
(device)
Applies the given device only if device is not None or empty.
Applies the given device only if device is not None or empty.
[ "Applies", "the", "given", "device", "only", "if", "device", "is", "not", "None", "or", "empty", "." ]
def _MaybeDevice(device): """Applies the given device only if device is not None or empty.""" if device: with ops.device(device): yield else: yield
[ "def", "_MaybeDevice", "(", "device", ")", ":", "if", "device", ":", "with", "ops", ".", "device", "(", "device", ")", ":", "yield", "else", ":", "yield" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/importer.py#L136-L142
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/external/bazel_tools/tools/cpp/wrapper/bin/pydir/msvc_link.py
python
MsvcLinker.Run
(self, argv)
Runs the linker using the passed clang/gcc style argument list. Args: argv: List of arguments Returns: The return code of the link. Raises: ValueError: if target architecture or compile mode isn't specified
Runs the linker using the passed clang/gcc style argument list.
[ "Runs", "the", "linker", "using", "the", "passed", "clang", "/", "gcc", "style", "argument", "list", "." ]
def Run(self, argv): """Runs the linker using the passed clang/gcc style argument list. Args: argv: List of arguments Returns: The return code of the link. Raises: ValueError: if target architecture or compile mode isn't specified """ # For now assume we are building a libra...
[ "def", "Run", "(", "self", ",", "argv", ")", ":", "# For now assume we are building a library.", "tool", "=", "'lib'", "default_args", "=", "[", "'/nologo'", "]", "# Build argument list.", "parser", "=", "msvc_tools", ".", "ArgParser", "(", "self", ",", "argv", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/tools/cpp/wrapper/bin/pydir/msvc_link.py#L51-L120
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/computation/pytables.py
python
FilterBinOp.format
(self)
return [self.filter]
return the actual filter format
return the actual filter format
[ "return", "the", "actual", "filter", "format" ]
def format(self): """ return the actual filter format """ return [self.filter]
[ "def", "format", "(", "self", ")", ":", "return", "[", "self", ".", "filter", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/computation/pytables.py#L243-L245
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrintPreview.__init__
(self, *args)
__init__(self, Printout printout, Printout printoutForPrinting, PrintDialogData data=None) -> PrintPreview __init__(self, Printout printout, Printout printoutForPrinting, PrintData data) -> PrintPreview
__init__(self, Printout printout, Printout printoutForPrinting, PrintDialogData data=None) -> PrintPreview __init__(self, Printout printout, Printout printoutForPrinting, PrintData data) -> PrintPreview
[ "__init__", "(", "self", "Printout", "printout", "Printout", "printoutForPrinting", "PrintDialogData", "data", "=", "None", ")", "-", ">", "PrintPreview", "__init__", "(", "self", "Printout", "printout", "Printout", "printoutForPrinting", "PrintData", "data", ")", "...
def __init__(self, *args): """ __init__(self, Printout printout, Printout printoutForPrinting, PrintDialogData data=None) -> PrintPreview __init__(self, Printout printout, Printout printoutForPrinting, PrintData data) -> PrintPreview """ _windows_.PrintPreview_swiginit(self,_win...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_windows_", ".", "PrintPreview_swiginit", "(", "self", ",", "_windows_", ".", "new_PrintPreview", "(", "*", "args", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5557-L5562
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/impute/_base.py
python
_BaseImputer._transform_indicator
(self, X)
Compute the indicator mask.' Note that X must be the original data as passed to the imputer before any imputation, since imputation may be done inplace in some cases.
Compute the indicator mask.'
[ "Compute", "the", "indicator", "mask", "." ]
def _transform_indicator(self, X): """Compute the indicator mask.' Note that X must be the original data as passed to the imputer before any imputation, since imputation may be done inplace in some cases. """ if self.add_indicator: if not hasattr(self, 'indicator_'):...
[ "def", "_transform_indicator", "(", "self", ",", "X", ")", ":", "if", "self", ".", "add_indicator", ":", "if", "not", "hasattr", "(", "self", ",", "'indicator_'", ")", ":", "raise", "ValueError", "(", "\"Make sure to call _fit_indicator before \"", "\"_transform_i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/impute/_base.py#L85-L97
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
HVScrolledWindow.EstimateTotalHeight
(*args, **kwargs)
return _windows_.HVScrolledWindow_EstimateTotalHeight(*args, **kwargs)
EstimateTotalHeight(self) -> int
EstimateTotalHeight(self) -> int
[ "EstimateTotalHeight", "(", "self", ")", "-", ">", "int" ]
def EstimateTotalHeight(*args, **kwargs): """EstimateTotalHeight(self) -> int""" return _windows_.HVScrolledWindow_EstimateTotalHeight(*args, **kwargs)
[ "def", "EstimateTotalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "HVScrolledWindow_EstimateTotalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2562-L2564
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/ansic/cparse.py
python
p_labeled_statement_1
(t)
labeled_statement : ID COLON statement
labeled_statement : ID COLON statement
[ "labeled_statement", ":", "ID", "COLON", "statement" ]
def p_labeled_statement_1(t): 'labeled_statement : ID COLON statement' pass
[ "def", "p_labeled_statement_1", "(", "t", ")", ":", "pass" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L466-L468
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
contrib/fd-plugins/openvz7/BareosFdPluginVz7CtFs.py
python
BareosFdPluginVz7CtFs.list_snapshots
(self, )
return snapshots
Returns a list of existing snapshots for a container and returns a list of hashes containing uuid of parent snapshot, the snapshot_uuid of the snapshot, its status and the path of delta image
Returns a list of existing snapshots for a container and returns a list of hashes containing uuid of parent snapshot, the snapshot_uuid of the snapshot, its status and the path of delta image
[ "Returns", "a", "list", "of", "existing", "snapshots", "for", "a", "container", "and", "returns", "a", "list", "of", "hashes", "containing", "uuid", "of", "parent", "snapshot", "the", "snapshot_uuid", "of", "the", "snapshot", "its", "status", "and", "the", "...
def list_snapshots(self, ): ''' Returns a list of existing snapshots for a container and returns a list of hashes containing uuid of parent snapshot, the snapshot_uuid of the snapshot, its status and the path of delta image ''' try: snapshot_list = subprocess.check_ou...
[ "def", "list_snapshots", "(", "self", ",", ")", ":", "try", ":", "snapshot_list", "=", "subprocess", ".", "check_output", "(", "[", "'/usr/sbin/ploop'", ",", "'snapshot-list'", ",", "self", ".", "disk_descriptor", "]", ",", "universal_newlines", "=", "True", "...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/contrib/fd-plugins/openvz7/BareosFdPluginVz7CtFs.py#L139-L174
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/uploader.py
python
ResourceGroupUploader.__init__
(self, deployment_uploader, resource_group_name)
Initializes a ResourceGroupUploader object. Args: deployment_uploader: The DeploymentUploader object on which the uploader is based. resource_group_name: The name of the resource group targeted by the uploader.
Initializes a ResourceGroupUploader object.
[ "Initializes", "a", "ResourceGroupUploader", "object", "." ]
def __init__(self, deployment_uploader, resource_group_name): """Initializes a ResourceGroupUploader object. Args: deployment_uploader: The DeploymentUploader object on which the uploader is based. resource_group_name: The name of the resource group targeted by the uploader. ...
[ "def", "__init__", "(", "self", ",", "deployment_uploader", ",", "resource_group_name", ")", ":", "Uploader", ".", "__init__", "(", "self", ",", "deployment_uploader", ".", "context", ",", "deployment_uploader", ".", "bucket", ",", "deployment_uploader", ".", "key...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/uploader.py#L663-L681
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/nn_ops.py
python
_TopKShape
(op)
return [output_shape, output_shape]
Shape function for TopK and TopKV2 ops.
Shape function for TopK and TopKV2 ops.
[ "Shape", "function", "for", "TopK", "and", "TopKV2", "ops", "." ]
def _TopKShape(op): """Shape function for TopK and TopKV2 ops.""" input_shape = op.inputs[0].get_shape().with_rank_at_least(1) if len(op.inputs) >= 2: k = tensor_util.constant_value(op.inputs[1]) else: k = op.get_attr("k") last = input_shape[-1].value if last is not None and k is not None and last <...
[ "def", "_TopKShape", "(", "op", ")", ":", "input_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", ".", "with_rank_at_least", "(", "1", ")", "if", "len", "(", "op", ".", "inputs", ")", ">=", "2", ":", "k", "=", "tensor_...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/nn_ops.py#L722-L734
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/losses/python/metric_learning/metric_loss_ops.py
python
cluster_loss
(labels, embeddings, margin_multiplier, enable_pam_finetuning=True, margin_type='nmi', print_losses=False)
return clustering_loss
Computes the clustering loss. The following structured margins are supported: nmi: normalized mutual information ami: adjusted mutual information ari: adjusted random index vmeasure: v-measure const: indicator checking whether the two clusterings are the same. Args: labels: 2-D Tensor of l...
Computes the clustering loss.
[ "Computes", "the", "clustering", "loss", "." ]
def cluster_loss(labels, embeddings, margin_multiplier, enable_pam_finetuning=True, margin_type='nmi', print_losses=False): """Computes the clustering loss. The following structured margins are supported: nmi: normalized mutua...
[ "def", "cluster_loss", "(", "labels", ",", "embeddings", ",", "margin_multiplier", ",", "enable_pam_finetuning", "=", "True", ",", "margin_type", "=", "'nmi'", ",", "print_losses", "=", "False", ")", ":", "if", "not", "HAS_SKLEARN", ":", "raise", "ImportError", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/losses/python/metric_learning/metric_loss_ops.py#L946-L1031
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
TextAreaBase.GetLineLength
(*args, **kwargs)
return _core_.TextAreaBase_GetLineLength(*args, **kwargs)
GetLineLength(self, long lineNo) -> int
GetLineLength(self, long lineNo) -> int
[ "GetLineLength", "(", "self", "long", "lineNo", ")", "-", ">", "int" ]
def GetLineLength(*args, **kwargs): """GetLineLength(self, long lineNo) -> int""" return _core_.TextAreaBase_GetLineLength(*args, **kwargs)
[ "def", "GetLineLength", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "TextAreaBase_GetLineLength", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13384-L13386
coinapi/coinapi-sdk
854f21e7f69ea8599ae35c5403565cf299d8b795
oeml-sdk/python/openapi_client/model/exec_inst.py
python
ExecInst.__init__
(self, *args, **kwargs)
ExecInst - a model defined in OpenAPI Note that value can be passed either in args or in kwargs, but not in both. Args: args[0] ([str]): Order execution instructions are documented in the separate section: <a href=\"#oeml-order-params-exec\">OEML / Starter Guide / Order parameters / Execut...
ExecInst - a model defined in OpenAPI
[ "ExecInst", "-", "a", "model", "defined", "in", "OpenAPI" ]
def __init__(self, *args, **kwargs): """ExecInst - a model defined in OpenAPI Note that value can be passed either in args or in kwargs, but not in both. Args: args[0] ([str]): Order execution instructions are documented in the separate section: <a href=\"#oeml-order-params-exec\">...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# required up here when default value is not given", "_path_to_item", "=", "kwargs", ".", "pop", "(", "'_path_to_item'", ",", "(", ")", ")", "if", "'value'", "in", "kwargs", ...
https://github.com/coinapi/coinapi-sdk/blob/854f21e7f69ea8599ae35c5403565cf299d8b795/oeml-sdk/python/openapi_client/model/exec_inst.py#L99-L185
avast/retdec
b9879088a5f0278508185ec645494e6c5c57a455
scripts/type_extractor/type_extractor/io.py
python
types_sub
(type_text)
return type_text
Substitutes type for lti type.
Substitutes type for lti type.
[ "Substitutes", "type", "for", "lti", "type", "." ]
def types_sub(type_text): """Substitutes type for lti type.""" if type_text in LTI_TYPES.keys(): return LTI_TYPES[type_text] return type_text
[ "def", "types_sub", "(", "type_text", ")", ":", "if", "type_text", "in", "LTI_TYPES", ".", "keys", "(", ")", ":", "return", "LTI_TYPES", "[", "type_text", "]", "return", "type_text" ]
https://github.com/avast/retdec/blob/b9879088a5f0278508185ec645494e6c5c57a455/scripts/type_extractor/type_extractor/io.py#L114-L118
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/__init__.py
python
Logger.setLevel
(self, level)
Set the logging level of this logger.
Set the logging level of this logger.
[ "Set", "the", "logging", "level", "of", "this", "logger", "." ]
def setLevel(self, level): """ Set the logging level of this logger. """ self.level = level
[ "def", "setLevel", "(", "self", ",", "level", ")", ":", "self", ".", "level", "=", "level" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/__init__.py#L1020-L1024
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/plasma/Plasma.py
python
PtLocalAvatarIsMoving
()
Returns true if the local avatar is moving (a movement key is held down)
Returns true if the local avatar is moving (a movement key is held down)
[ "Returns", "true", "if", "the", "local", "avatar", "is", "moving", "(", "a", "movement", "key", "is", "held", "down", ")" ]
def PtLocalAvatarIsMoving(): """Returns true if the local avatar is moving (a movement key is held down)""" pass
[ "def", "PtLocalAvatarIsMoving", "(", ")", ":", "pass" ]
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/Plasma.py#L630-L632
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/mesa/MesaLib/src/mesa/main/APIspec.py
python
Spec.get_api
(self, name)
return API(self, self.api_nodes[name])
Return an API.
Return an API.
[ "Return", "an", "API", "." ]
def get_api(self, name): """Return an API.""" return API(self, self.api_nodes[name])
[ "def", "get_api", "(", "self", ",", "name", ")", ":", "return", "API", "(", "self", ",", "self", ".", "api_nodes", "[", "name", "]", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mesa/main/APIspec.py#L67-L69
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tools/saved_model_cli.py
python
show
(args)
Function triggered by show command. Args: args: A namespace parsed from command line.
Function triggered by show command.
[ "Function", "triggered", "by", "show", "command", "." ]
def show(args): """Function triggered by show command. Args: args: A namespace parsed from command line. """ # If all tag is specified, display all information. if args.all: _show_all(args.dir) else: # If no tag is specified, display all tag_set, if no signature_def key is # specified, disp...
[ "def", "show", "(", "args", ")", ":", "# If all tag is specified, display all information.", "if", "args", ".", "all", ":", "_show_all", "(", "args", ".", "dir", ")", "else", ":", "# If no tag is specified, display all tag_set, if no signature_def key is", "# specified, dis...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tools/saved_model_cli.py#L726-L745
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlHelpController.AddBook
(*args, **kwargs)
return _html.HtmlHelpController_AddBook(*args, **kwargs)
AddBook(self, String book, int show_wait_msg=False) -> bool
AddBook(self, String book, int show_wait_msg=False) -> bool
[ "AddBook", "(", "self", "String", "book", "int", "show_wait_msg", "=", "False", ")", "-", ">", "bool" ]
def AddBook(*args, **kwargs): """AddBook(self, String book, int show_wait_msg=False) -> bool""" return _html.HtmlHelpController_AddBook(*args, **kwargs)
[ "def", "AddBook", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlHelpController_AddBook", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1966-L1968
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/feature_column/feature_column.py
python
_categorical_column_with_identity
(key, num_buckets, default_value=None)
return _IdentityCategoricalColumn( key=key, num_buckets=num_buckets, default_value=default_value)
A `_CategoricalColumn` that returns identity values. Use this when your inputs are integers in the range `[0, num_buckets)`, and you want to use the input value itself as the categorical ID. Values outside this range will result in `default_value` if specified, otherwise it will fail. Typically, this is use...
A `_CategoricalColumn` that returns identity values.
[ "A", "_CategoricalColumn", "that", "returns", "identity", "values", "." ]
def _categorical_column_with_identity(key, num_buckets, default_value=None): """A `_CategoricalColumn` that returns identity values. Use this when your inputs are integers in the range `[0, num_buckets)`, and you want to use the input value itself as the categorical ID. Values outside this range will result in...
[ "def", "_categorical_column_with_identity", "(", "key", ",", "num_buckets", ",", "default_value", "=", "None", ")", ":", "if", "num_buckets", "<", "1", ":", "raise", "ValueError", "(", "'num_buckets {} < 1, column_name {}'", ".", "format", "(", "num_buckets", ",", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column.py#L1391-L1455
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/bisect_utils.py
python
SubprocessCall
(cmd, cwd=None)
return subprocess.call(cmd, shell=shell, cwd=cwd)
Runs a subprocess with specified parameters. Args: params: A list of parameters to pass to gclient. cwd: Working directory to run from. Returns: The return code of the call.
Runs a subprocess with specified parameters.
[ "Runs", "a", "subprocess", "with", "specified", "parameters", "." ]
def SubprocessCall(cmd, cwd=None): """Runs a subprocess with specified parameters. Args: params: A list of parameters to pass to gclient. cwd: Working directory to run from. Returns: The return code of the call. """ if os.name == 'nt': # "HOME" isn't normally defined on windows, but is neede...
[ "def", "SubprocessCall", "(", "cmd", ",", "cwd", "=", "None", ")", ":", "if", "os", ".", "name", "==", "'nt'", ":", "# \"HOME\" isn't normally defined on windows, but is needed", "# for git to find the user's .netrc file.", "if", "not", "os", ".", "getenv", "(", "'H...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect_utils.py#L147-L163
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py
python
MH.get_file
(self, key)
return _ProxyFile(f)
Return a file-like representation or raise a KeyError.
Return a file-like representation or raise a KeyError.
[ "Return", "a", "file", "-", "like", "representation", "or", "raise", "a", "KeyError", "." ]
def get_file(self, key): """Return a file-like representation or raise a KeyError.""" try: f = open(os.path.join(self._path, str(key)), 'rb') except OSError as e: if e.errno == errno.ENOENT: raise KeyError('No message with key: %s' % key) else:...
[ "def", "get_file", "(", "self", ",", "key", ")", ":", "try", ":", "f", "=", "open", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "str", "(", "key", ")", ")", ",", "'rb'", ")", "except", "OSError", "as", "e", ":", "if",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L1065-L1074
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/factorization_ops.py
python
WALSModel.row_factors
(self)
return self._row_factors
Returns a list of tensors corresponding to row factor shards.
Returns a list of tensors corresponding to row factor shards.
[ "Returns", "a", "list", "of", "tensors", "corresponding", "to", "row", "factor", "shards", "." ]
def row_factors(self): """Returns a list of tensors corresponding to row factor shards.""" return self._row_factors
[ "def", "row_factors", "(", "self", ")", ":", "return", "self", ".", "_row_factors" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L299-L301
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
mlir/utils/spirv/gen_spirv_dialect.py
python
gen_opcode
(instructions)
return opcode_str + '\n\n' + enum_attr
Generates the TableGen definition to map opname to opcode Returns: - A string containing the TableGen SPV_OpCode definition
Generates the TableGen definition to map opname to opcode
[ "Generates", "the", "TableGen", "definition", "to", "map", "opname", "to", "opcode" ]
def gen_opcode(instructions): """ Generates the TableGen definition to map opname to opcode Returns: - A string containing the TableGen SPV_OpCode definition """ max_len = max([len(inst['opname']) for inst in instructions]) def_fmt_str = 'def SPV_OC_{name} {colon:>{offset}} '\ 'I32EnumAttrCa...
[ "def", "gen_opcode", "(", "instructions", ")", ":", "max_len", "=", "max", "(", "[", "len", "(", "inst", "[", "'opname'", "]", ")", "for", "inst", "in", "instructions", "]", ")", "def_fmt_str", "=", "'def SPV_OC_{name} {colon:>{offset}} '", "'I32EnumAttrCase<\"{...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/mlir/utils/spirv/gen_spirv_dialect.py#L408-L440
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/plot.py
python
PlotCanvas.GetEnablePointLabel
(self)
return self._pointLabelEnabled
True if pointLabel enabled.
True if pointLabel enabled.
[ "True", "if", "pointLabel", "enabled", "." ]
def GetEnablePointLabel(self): """True if pointLabel enabled.""" return self._pointLabelEnabled
[ "def", "GetEnablePointLabel", "(", "self", ")", ":", "return", "self", ".", "_pointLabelEnabled" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/plot.py#L984-L986
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Misc.pack_propagate
(self, flag=_noarg_)
Set or get the status for propagation of geometry information. A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned.
Set or get the status for propagation of geometry information.
[ "Set", "or", "get", "the", "status", "for", "propagation", "of", "geometry", "information", "." ]
def pack_propagate(self, flag=_noarg_): """Set or get the status for propagation of geometry information. A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned. ...
[ "def", "pack_propagate", "(", "self", ",", "flag", "=", "_noarg_", ")", ":", "if", "flag", "is", "Misc", ".", "_noarg_", ":", "return", "self", ".", "_getboolean", "(", "self", ".", "tk", ".", "call", "(", "'pack'", ",", "'propagate'", ",", "self", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L1281-L1292
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py
python
IMetadataProvider.run_script
(script_name, namespace)
Execute the named script in the supplied namespace dictionary
Execute the named script in the supplied namespace dictionary
[ "Execute", "the", "named", "script", "in", "the", "supplied", "namespace", "dictionary" ]
def run_script(script_name, namespace): """Execute the named script in the supplied namespace dictionary"""
[ "def", "run_script", "(", "script_name", ",", "namespace", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L522-L523
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/subprocess.py
python
Popen.__init__
(self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0)
Create new Popen instance.
Create new Popen instance.
[ "Create", "new", "Popen", "instance", "." ]
def __init__(self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0): """Create new Popen inst...
[ "def", "__init__", "(", "self", ",", "args", ",", "bufsize", "=", "0", ",", "executable", "=", "None", ",", "stdin", "=", "None", ",", "stdout", "=", "None", ",", "stderr", "=", "None", ",", "preexec_fn", "=", "None", ",", "close_fds", "=", "False", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/subprocess.py#L650-L752
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/internal/decoder.py
python
MessageSetItemDecoder
(extensions_by_number)
return DecodeItem
Returns a decoder for a MessageSet item. The parameter is the _extensions_by_number map for the message class. The message set message looks like this: message MessageSet { repeated group Item = 1 { required int32 type_id = 2; required string message = 3; } }
Returns a decoder for a MessageSet item.
[ "Returns", "a", "decoder", "for", "a", "MessageSet", "item", "." ]
def MessageSetItemDecoder(extensions_by_number): """Returns a decoder for a MessageSet item. The parameter is the _extensions_by_number map for the message class. The message set message looks like this: message MessageSet { repeated group Item = 1 { required int32 type_id = 2; require...
[ "def", "MessageSetItemDecoder", "(", "extensions_by_number", ")", ":", "type_id_tag_bytes", "=", "encoder", ".", "TagBytes", "(", "2", ",", "wire_format", ".", "WIRETYPE_VARINT", ")", "message_tag_bytes", "=", "encoder", ".", "TagBytes", "(", "3", ",", "wire_forma...
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/decoder.py#L556-L626
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
ControlFlowContext.outer_context
(self)
return self._outer_context
Return the context containing this context.
Return the context containing this context.
[ "Return", "the", "context", "containing", "this", "context", "." ]
def outer_context(self): """Return the context containing this context.""" return self._outer_context
[ "def", "outer_context", "(", "self", ")", ":", "return", "self", ".", "_outer_context" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1094-L1096
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextObject.Dereference
(*args, **kwargs)
return _richtext.RichTextObject_Dereference(*args, **kwargs)
Dereference(self)
Dereference(self)
[ "Dereference", "(", "self", ")" ]
def Dereference(*args, **kwargs): """Dereference(self)""" return _richtext.RichTextObject_Dereference(*args, **kwargs)
[ "def", "Dereference", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_Dereference", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1387-L1389
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/nonlin.py
python
LowRankMatrix.restart_reduce
(self, rank)
Reduce the rank of the matrix by dropping all vectors.
Reduce the rank of the matrix by dropping all vectors.
[ "Reduce", "the", "rank", "of", "the", "matrix", "by", "dropping", "all", "vectors", "." ]
def restart_reduce(self, rank): """ Reduce the rank of the matrix by dropping all vectors. """ if self.collapsed is not None: return assert rank > 0 if len(self.cs) > rank: del self.cs[:] del self.ds[:]
[ "def", "restart_reduce", "(", "self", ",", "rank", ")", ":", "if", "self", ".", "collapsed", "is", "not", "None", ":", "return", "assert", "rank", ">", "0", "if", "len", "(", "self", ".", "cs", ")", ">", "rank", ":", "del", "self", ".", "cs", "["...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/nonlin.py#L799-L808
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/rjsmin.py
python
jsmin_for_posers
(script, keep_bang_comments=False)
return _re.sub(rex, subber, '\n%s\n' % script).strip()
r""" Minify javascript based on `jsmin.c by Douglas Crockford`_\. Instead of parsing the stream char by char, it uses a regular expression approach which minifies the whole script with one big substitution regex. .. _jsmin.c by Douglas Crockford: http://www.crockford.com/javascript/jsmin.c ...
r""" Minify javascript based on `jsmin.c by Douglas Crockford`_\.
[ "r", "Minify", "javascript", "based", "on", "jsmin", ".", "c", "by", "Douglas", "Crockford", "_", "\\", "." ]
def jsmin_for_posers(script, keep_bang_comments=False): r""" Minify javascript based on `jsmin.c by Douglas Crockford`_\. Instead of parsing the stream char by char, it uses a regular expression approach which minifies the whole script with one big substitution regex. .. _jsmin.c by Douglas Cr...
[ "def", "jsmin_for_posers", "(", "script", ",", "keep_bang_comments", "=", "False", ")", ":", "if", "not", "keep_bang_comments", ":", "rex", "=", "(", "r'([^\\047\"/\\000-\\040]+)|((?:(?:\\047[^\\047\\\\\\r\\n]*(?:\\\\(?:[^\\r\\n]'", "r'|\\r?\\n|\\r)[^\\047\\\\\\r\\n]*)*\\047)|(?:...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/rjsmin.py#L312-L427
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/fluka.py
python
UsrbinTally._create_mesh
(self, part_data, error_data)
This will create the mesh object with the name of the tally specified by the user. One mesh object contains both the part_data and the error_data.
This will create the mesh object with the name of the tally specified by the user. One mesh object contains both the part_data and the error_data.
[ "This", "will", "create", "the", "mesh", "object", "with", "the", "name", "of", "the", "tally", "specified", "by", "the", "user", ".", "One", "mesh", "object", "contains", "both", "the", "part_data", "and", "the", "error_data", "." ]
def _create_mesh(self, part_data, error_data): """This will create the mesh object with the name of the tally specified by the user. One mesh object contains both the part_data and the error_data. """ super(UsrbinTally, self).__init__(structured_coords=[self.x_bounds, ...
[ "def", "_create_mesh", "(", "self", ",", "part_data", ",", "error_data", ")", ":", "super", "(", "UsrbinTally", ",", "self", ")", ".", "__init__", "(", "structured_coords", "=", "[", "self", ".", "x_bounds", ",", "self", ".", "y_bounds", ",", "self", "."...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/fluka.py#L200-L215
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/utils/vector.py
python
Vector2D.__floordiv__
(self, other)
return self.__truediv__(other)
Divide the vector to another.
Divide the vector to another.
[ "Divide", "the", "vector", "to", "another", "." ]
def __floordiv__(self, other): """Divide the vector to another.""" return self.__truediv__(other)
[ "def", "__floordiv__", "(", "self", ",", "other", ")", ":", "return", "self", ".", "__truediv__", "(", "other", ")" ]
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/utils/vector.py#L74-L76
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
NDArray.repeat
(self, *args, **kwargs)
return op.repeat(self, *args, **kwargs)
Convenience fluent method for :py:func:`repeat`. The arguments are the same as for :py:func:`repeat`, with this array as data.
Convenience fluent method for :py:func:`repeat`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "repeat", "." ]
def repeat(self, *args, **kwargs): """Convenience fluent method for :py:func:`repeat`. The arguments are the same as for :py:func:`repeat`, with this array as data. """ return op.repeat(self, *args, **kwargs)
[ "def", "repeat", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "repeat", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1102-L1108
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py
python
getcoroutinelocals
(coroutine)
Get the mapping of coroutine local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.
Get the mapping of coroutine local variables to their current values.
[ "Get", "the", "mapping", "of", "coroutine", "local", "variables", "to", "their", "current", "values", "." ]
def getcoroutinelocals(coroutine): """ Get the mapping of coroutine local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.""" frame = getattr(coroutine, "cr_frame", None) if frame is not None: return frame.f_local...
[ "def", "getcoroutinelocals", "(", "coroutine", ")", ":", "frame", "=", "getattr", "(", "coroutine", ",", "\"cr_frame\"", ",", "None", ")", "if", "frame", "is", "not", "None", ":", "return", "frame", ".", "f_locals", "else", ":", "return", "{", "}" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py#L1679-L1689
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py
python
Process.num_ctx_switches
(self)
return self._proc.num_ctx_switches()
Return the number of voluntary and involuntary context switches performed by this process.
Return the number of voluntary and involuntary context switches performed by this process.
[ "Return", "the", "number", "of", "voluntary", "and", "involuntary", "context", "switches", "performed", "by", "this", "process", "." ]
def num_ctx_switches(self): """Return the number of voluntary and involuntary context switches performed by this process. """ return self._proc.num_ctx_switches()
[ "def", "num_ctx_switches", "(", "self", ")", ":", "return", "self", ".", "_proc", ".", "num_ctx_switches", "(", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py#L691-L695
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/universe_generation/galaxy.py
python
DisjointSets.complete_sets
(self)
return list(ret.values())
returns a list of list of all sets O(n).
returns a list of list of all sets O(n).
[ "returns", "a", "list", "of", "list", "of", "all", "sets", "O", "(", "n", ")", "." ]
def complete_sets(self): """returns a list of list of all sets O(n).""" ret = defaultdict(list) for pos in self.dsets.keys(): ret[self.root(pos)].append(pos) return list(ret.values())
[ "def", "complete_sets", "(", "self", ")", ":", "ret", "=", "defaultdict", "(", "list", ")", "for", "pos", "in", "self", ".", "dsets", ".", "keys", "(", ")", ":", "ret", "[", "self", ".", "root", "(", "pos", ")", "]", ".", "append", "(", "pos", ...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/galaxy.py#L209-L214
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
createOutputBuffer
(file, encoding)
return outputBuffer(_obj=ret)
Create a libxml2 output buffer from a Python file
Create a libxml2 output buffer from a Python file
[ "Create", "a", "libxml2", "output", "buffer", "from", "a", "Python", "file" ]
def createOutputBuffer(file, encoding): """Create a libxml2 output buffer from a Python file """ ret = libxml2mod.xmlCreateOutputBuffer(file, encoding) if ret is None:raise treeError('xmlCreateOutputBuffer() failed') return outputBuffer(_obj=ret)
[ "def", "createOutputBuffer", "(", "file", ",", "encoding", ")", ":", "ret", "=", "libxml2mod", ".", "xmlCreateOutputBuffer", "(", "file", ",", "encoding", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlCreateOutputBuffer() failed'", ")", ...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1565-L1569
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py
python
BaseManager._number_of_objects
(self)
Return the number of shared objects
Return the number of shared objects
[ "Return", "the", "number", "of", "shared", "objects" ]
def _number_of_objects(self): ''' Return the number of shared objects ''' conn = self._Client(self._address, authkey=self._authkey) try: return dispatch(conn, None, 'number_of_objects') finally: conn.close()
[ "def", "_number_of_objects", "(", "self", ")", ":", "conn", "=", "self", ".", "_Client", "(", "self", ".", "_address", ",", "authkey", "=", "self", ".", "_authkey", ")", "try", ":", "return", "dispatch", "(", "conn", ",", "None", ",", "'number_of_objects...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py#L633-L641
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/interactiveshell.py
python
InteractiveShell._indent_current_str
(self)
return self.input_splitter.get_indent_spaces() * ' '
return the current level of indentation as a string
return the current level of indentation as a string
[ "return", "the", "current", "level", "of", "indentation", "as", "a", "string" ]
def _indent_current_str(self): """return the current level of indentation as a string""" return self.input_splitter.get_indent_spaces() * ' '
[ "def", "_indent_current_str", "(", "self", ")", ":", "return", "self", ".", "input_splitter", ".", "get_indent_spaces", "(", ")", "*", "' '" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/interactiveshell.py#L2166-L2168
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/_pydecimal.py
python
Decimal.copy_sign
(self, other, context=None)
return _dec_from_triple(other._sign, self._int, self._exp, self._is_special)
Returns self with the sign of other.
Returns self with the sign of other.
[ "Returns", "self", "with", "the", "sign", "of", "other", "." ]
def copy_sign(self, other, context=None): """Returns self with the sign of other.""" other = _convert_other(other, raiseit=True) return _dec_from_triple(other._sign, self._int, self._exp, self._is_special)
[ "def", "copy_sign", "(", "self", ",", "other", ",", "context", "=", "None", ")", ":", "other", "=", "_convert_other", "(", "other", ",", "raiseit", "=", "True", ")", "return", "_dec_from_triple", "(", "other", ".", "_sign", ",", "self", ".", "_int", ",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L3030-L3034
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_math_ops.py
python
get_bprop_cumsum
(self)
return bprop
Grad definition for `CumSum` operation.
Grad definition for `CumSum` operation.
[ "Grad", "definition", "for", "CumSum", "operation", "." ]
def get_bprop_cumsum(self): """Grad definition for `CumSum` operation.""" cumsum = P.CumSum(exclusive=self.exclusive, reverse=not self.reverse) def bprop(x, axis, out, dout): return cumsum(dout, axis), zeros_like(axis) return bprop
[ "def", "get_bprop_cumsum", "(", "self", ")", ":", "cumsum", "=", "P", ".", "CumSum", "(", "exclusive", "=", "self", ".", "exclusive", ",", "reverse", "=", "not", "self", ".", "reverse", ")", "def", "bprop", "(", "x", ",", "axis", ",", "out", ",", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_math_ops.py#L686-L693
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/tools/scan-build-py/libear/__init__.py
python
Toolset.add_definitions
(self, defines)
part of public interface
part of public interface
[ "part", "of", "public", "interface" ]
def add_definitions(self, defines): """ part of public interface """ self.c_flags.extend(defines)
[ "def", "add_definitions", "(", "self", ",", "defines", ")", ":", "self", ".", "c_flags", ".", "extend", "(", "defines", ")" ]
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/tools/scan-build-py/libear/__init__.py#L94-L96
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.NextToken
(self)
Reads the next meaningful token.
Reads the next meaningful token.
[ "Reads", "the", "next", "meaningful", "token", "." ]
def NextToken(self): """Reads the next meaningful token.""" self._previous_line = self._line self._previous_column = self._column self._column += len(self.token) self._SkipWhitespace() if not self._lines and len(self._current_line) <= self._column: self.token = '' return match...
[ "def", "NextToken", "(", "self", ")", ":", "self", ".", "_previous_line", "=", "self", ".", "_line", "self", ".", "_previous_column", "=", "self", ".", "_column", "self", ".", "_column", "+=", "len", "(", "self", ".", "token", ")", "self", ".", "_SkipW...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/text_format.py#L640-L657
networkit/networkit
695b7a786a894a303fa8587597d5ef916e797729
scripts/DynamicBetweennessExperiments.py
python
setRandomWeights
(G, mu, sigma)
return G
Add random weights, normal distribution with mean mu and standard deviation sigma
Add random weights, normal distribution with mean mu and standard deviation sigma
[ "Add", "random", "weights", "normal", "distribution", "with", "mean", "mu", "and", "standard", "deviation", "sigma" ]
def setRandomWeights(G, mu, sigma): """ Add random weights, normal distribution with mean mu and standard deviation sigma """ for (u, v) in G.iterEdges(): w = random.normalvariate(mu, sigma) G.setWeight(u, v, w) return G
[ "def", "setRandomWeights", "(", "G", ",", "mu", ",", "sigma", ")", ":", "for", "(", "u", ",", "v", ")", "in", "G", ".", "iterEdges", "(", ")", ":", "w", "=", "random", ".", "normalvariate", "(", "mu", ",", "sigma", ")", "G", ".", "setWeight", "...
https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/scripts/DynamicBetweennessExperiments.py#L35-L42
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
_ProxyFile.read
(self, size=None)
return self._read(size, self._file.read)
Read bytes.
Read bytes.
[ "Read", "bytes", "." ]
def read(self, size=None): """Read bytes.""" return self._read(size, self._file.read)
[ "def", "read", "(", "self", ",", "size", "=", "None", ")", ":", "return", "self", ".", "_read", "(", "size", ",", "self", ".", "_file", ".", "read", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L1871-L1873
TheLegendAli/DeepLab-Context
fb04e9e2fc2682490ad9f60533b9d6c4c0e0479c
scripts/cpp_lint.py
python
GetLineWidth
(line)
Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters.
Determines the width of the line in column positions.
[ "Determines", "the", "width", "of", "the", "line", "in", "column", "positions", "." ]
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
[ "def", "GetLineWidth", "(", "line", ")", ":", "if", "isinstance", "(", "line", ",", "unicode", ")", ":", "width", "=", "0", "for", "uc", "in", "unicodedata", ".", "normalize", "(", "'NFC'", ",", "line", ")", ":", "if", "unicodedata", ".", "east_asian_w...
https://github.com/TheLegendAli/DeepLab-Context/blob/fb04e9e2fc2682490ad9f60533b9d6c4c0e0479c/scripts/cpp_lint.py#L3437-L3456
ucbrise/confluo
578883a4f7fbbb4aea78c342d366f5122ef598f7
pyclient/confluo/rpc/data_types.py
python
DataType.pack
(self, data)
Args: data: Python data Returns: Binary data
[]
def pack(self, data): """ Args: data: Python data Returns: Binary data """ try: return struct.pack(self.format_code(), data) except Exception as e: raise ValueError('Error converting {} to {}: {}'.format(data, to_string(sel...
[ "def", "pack", "(", "self", ",", "data", ")", ":", "try", ":", "return", "struct", ".", "pack", "(", "self", ".", "format_code", "(", ")", ",", "data", ")", "except", "Exception", "as", "e", ":", "raise", "ValueError", "(", "'Error converting {} to {}: {...
https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/data_types.py#L129-L140
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextObject.Layout
(*args, **kwargs)
return _richtext.RichTextObject_Layout(*args, **kwargs)
Layout(self, DC dc, RichTextDrawingContext context, Rect rect, Rect parentRect, int style) -> bool
Layout(self, DC dc, RichTextDrawingContext context, Rect rect, Rect parentRect, int style) -> bool
[ "Layout", "(", "self", "DC", "dc", "RichTextDrawingContext", "context", "Rect", "rect", "Rect", "parentRect", "int", "style", ")", "-", ">", "bool" ]
def Layout(*args, **kwargs): """ Layout(self, DC dc, RichTextDrawingContext context, Rect rect, Rect parentRect, int style) -> bool """ return _richtext.RichTextObject_Layout(*args, **kwargs)
[ "def", "Layout", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_Layout", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1172-L1177
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/decomposition/_fastica.py
python
FastICA._fit
(self, X, compute_sources=False)
return S
Fit the model Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. compute_sources : bool If False, sources are not computes but only the...
Fit the model
[ "Fit", "the", "model" ]
def _fit(self, X, compute_sources=False): """Fit the model Parameters ---------- X : array-like, shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. compute_sources : bool ...
[ "def", "_fit", "(", "self", ",", "X", ",", "compute_sources", "=", "False", ")", ":", "fun_args", "=", "{", "}", "if", "self", ".", "fun_args", "is", "None", "else", "self", ".", "fun_args", "random_state", "=", "check_random_state", "(", "self", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/decomposition/_fastica.py#L410-L542
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/collections/__init__.py
python
OrderedDict.__init__
(*args, **kwds)
Initialize an ordered dictionary. The signature is the same as regular dictionaries. Keyword argument order is preserved.
Initialize an ordered dictionary. The signature is the same as regular dictionaries. Keyword argument order is preserved.
[ "Initialize", "an", "ordered", "dictionary", ".", "The", "signature", "is", "the", "same", "as", "regular", "dictionaries", ".", "Keyword", "argument", "order", "is", "preserved", "." ]
def __init__(*args, **kwds): '''Initialize an ordered dictionary. The signature is the same as regular dictionaries. Keyword argument order is preserved. ''' if not args: raise TypeError("descriptor '__init__' of 'OrderedDict' object " "needs an ...
[ "def", "__init__", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "if", "not", "args", ":", "raise", "TypeError", "(", "\"descriptor '__init__' of 'OrderedDict' object \"", "\"needs an argument\"", ")", "self", ",", "", "*", "args", "=", "args", "if", "l...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/collections/__init__.py#L96-L113
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
log10
(x, out=None, **kwargs)
return _mx_nd_np.log10(x, out=out, **kwargs)
Return the base 10 logarithm of the input array, element-wise. Parameters ---------- x : ndarray or scalar Input array or scalar. out : ndarray or None A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided ...
Return the base 10 logarithm of the input array, element-wise.
[ "Return", "the", "base", "10", "logarithm", "of", "the", "input", "array", "element", "-", "wise", "." ]
def log10(x, out=None, **kwargs): """ Return the base 10 logarithm of the input array, element-wise. Parameters ---------- x : ndarray or scalar Input array or scalar. out : ndarray or None A location into which the result is stored. If provided, it must have a shape tha...
[ "def", "log10", "(", "x", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "_mx_nd_np", ".", "log10", "(", "x", ",", "out", "=", "out", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L4229-L4258
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.CacheBestSize
(*args, **kwargs)
return _core_.Window_CacheBestSize(*args, **kwargs)
CacheBestSize(self, Size size) Cache the best size so it doesn't need to be calculated again, (at least until some properties of the window change.)
CacheBestSize(self, Size size)
[ "CacheBestSize", "(", "self", "Size", "size", ")" ]
def CacheBestSize(*args, **kwargs): """ CacheBestSize(self, Size size) Cache the best size so it doesn't need to be calculated again, (at least until some properties of the window change.) """ return _core_.Window_CacheBestSize(*args, **kwargs)
[ "def", "CacheBestSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_CacheBestSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9628-L9635
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/nturl2path.py
python
pathname2url
(p)
return path
OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.
OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.
[ "OS", "-", "specific", "conversion", "from", "a", "file", "system", "path", "to", "a", "relative", "URL", "of", "the", "file", "scheme", ";", "not", "recommended", "for", "general", "use", "." ]
def pathname2url(p): """OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.""" # e.g. # C:\foo\bar\spam.foo # becomes # ///C:/foo/bar/spam.foo import urllib.parse if not ':' in p: # No drive specifier, just c...
[ "def", "pathname2url", "(", "p", ")", ":", "# e.g.", "# C:\\foo\\bar\\spam.foo", "# becomes", "# ///C:/foo/bar/spam.foo", "import", "urllib", ".", "parse", "if", "not", "':'", "in", "p", ":", "# No drive specifier, just convert slashes and quote the name", "if", "p", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/nturl2path.py#L45-L73
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/configDialog.py
python
ConfigDialog.create_extension_frame
(self, ext_name)
return
Create a frame holding the widgets to configure one extension
Create a frame holding the widgets to configure one extension
[ "Create", "a", "frame", "holding", "the", "widgets", "to", "configure", "one", "extension" ]
def create_extension_frame(self, ext_name): """Create a frame holding the widgets to configure one extension""" f = VerticalScrolledFrame(self.details_frame, height=250, width=250) self.config_frame[ext_name] = f entry_area = f.interior # create an entry for each configuration op...
[ "def", "create_extension_frame", "(", "self", ",", "ext_name", ")", ":", "f", "=", "VerticalScrolledFrame", "(", "self", ".", "details_frame", ",", "height", "=", "250", ",", "width", "=", "250", ")", "self", ".", "config_frame", "[", "ext_name", "]", "=",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/configDialog.py#L1330-L1354
ComputationalRadiationPhysics/picongpu
59e9b53605f9a5c1bf271eeb055bc74370a99052
lib/python/picongpu/plugins/jupyter_widgets/base_widget.py
python
BaseWidget._create_sim_dropdown
(self, options)
return sim_drop
Provide the widget for selection of simulations. Can be overridden in derived classes if some of those widgets are not necessary. Note: Make sure that no value of the widget is selected initially since otherwise initial plotting after creation of the widget might not work (since ...
Provide the widget for selection of simulations. Can be overridden in derived classes if some of those widgets are not necessary. Note: Make sure that no value of the widget is selected initially since otherwise initial plotting after creation of the widget might not work (since ...
[ "Provide", "the", "widget", "for", "selection", "of", "simulations", ".", "Can", "be", "overridden", "in", "derived", "classes", "if", "some", "of", "those", "widgets", "are", "not", "necessary", ".", "Note", ":", "Make", "sure", "that", "no", "value", "of...
def _create_sim_dropdown(self, options): """ Provide the widget for selection of simulations. Can be overridden in derived classes if some of those widgets are not necessary. Note: Make sure that no value of the widget is selected initially since otherwise initial plottin...
[ "def", "_create_sim_dropdown", "(", "self", ",", "options", ")", ":", "sim_drop", "=", "widgets", ".", "SelectMultiple", "(", "description", "=", "\"Sims\"", ",", "options", "=", "options", ",", "value", "=", "(", ")", ")", "return", "sim_drop" ]
https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/lib/python/picongpu/plugins/jupyter_widgets/base_widget.py#L236-L253
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
TopLevelWindow.ShowFullScreen
(*args, **kwargs)
return _windows_.TopLevelWindow_ShowFullScreen(*args, **kwargs)
ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool
ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool
[ "ShowFullScreen", "(", "self", "bool", "show", "long", "style", "=", "FULLSCREEN_ALL", ")", "-", ">", "bool" ]
def ShowFullScreen(*args, **kwargs): """ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool""" return _windows_.TopLevelWindow_ShowFullScreen(*args, **kwargs)
[ "def", "ShowFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "TopLevelWindow_ShowFullScreen", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L441-L443
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py
python
_get_supported_file_loaders
()
return [extensions, source, bytecode]
Returns a list of file-based module loaders. Each item is a tuple (loader, suffixes).
Returns a list of file-based module loaders.
[ "Returns", "a", "list", "of", "file", "-", "based", "module", "loaders", "." ]
def _get_supported_file_loaders(): """Returns a list of file-based module loaders. Each item is a tuple (loader, suffixes). """ extensions = ExtensionFileLoader, _imp.extension_suffixes() source = SourceFileLoader, SOURCE_SUFFIXES bytecode = SourcelessFileLoader, BYTECODE_SUFFIXES return [e...
[ "def", "_get_supported_file_loaders", "(", ")", ":", "extensions", "=", "ExtensionFileLoader", ",", "_imp", ".", "extension_suffixes", "(", ")", "source", "=", "SourceFileLoader", ",", "SOURCE_SUFFIXES", "bytecode", "=", "SourcelessFileLoader", ",", "BYTECODE_SUFFIXES",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py#L1482-L1490
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/resource_variable_ops.py
python
ResourceVariable._init_from_args
(self, initial_value=None, trainable=True, collections=None, validate_shape=True, caching_device=None, name=None, dtype=None, constraint=None)
Creates a variable. Args: initial_value: A `Tensor`, or Python object convertible to a `Tensor`, which is the initial value for the Variable. The initial value must have a shape specified unless `validate_shape` is set to False. Can also be a callable with no argument that returns the...
Creates a variable.
[ "Creates", "a", "variable", "." ]
def _init_from_args(self, initial_value=None, trainable=True, collections=None, validate_shape=True, caching_device=None, name=None, dtype=None, ...
[ "def", "_init_from_args", "(", "self", ",", "initial_value", "=", "None", ",", "trainable", "=", "True", ",", "collections", "=", "None", ",", "validate_shape", "=", "True", ",", "caching_device", "=", "None", ",", "name", "=", "None", ",", "dtype", "=", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/resource_variable_ops.py#L211-L409
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/pychan/widgets/widget.py
python
Widget.isModalMouseInputFocusable
(self)
return self.real_widget.isModalMouseInputFocusable()
Checks if a widget is modal mouse input focusable. True if no other widget has modal mouse input focus, false otherwise.
Checks if a widget is modal mouse input focusable. True if no other widget has modal mouse input focus, false otherwise.
[ "Checks", "if", "a", "widget", "is", "modal", "mouse", "input", "focusable", ".", "True", "if", "no", "other", "widget", "has", "modal", "mouse", "input", "focus", "false", "otherwise", "." ]
def isModalMouseInputFocusable(self): """ Checks if a widget is modal mouse input focusable. True if no other widget has modal mouse input focus, false otherwise. """ return self.real_widget.isModalMouseInputFocusable()
[ "def", "isModalMouseInputFocusable", "(", "self", ")", ":", "return", "self", ".", "real_widget", ".", "isModalMouseInputFocusable", "(", ")" ]
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/widgets/widget.py#L358-L363
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
libpyclingo/clingo/backend.py
python
Backend.add_atom
(self, symbol: Optional[Symbol]=None)
return _c_call('clingo_atom_t', _lib.clingo_backend_add_atom, self._rep, p_sym, handler=self._error)
Return a fresh program atom or the atom associated with the given symbol. If the given symbol does not exist in the atom base, it is added first. Such atoms will be used in subequents calls to ground for instantiation. Parameters ---------- symbol The symbol associa...
Return a fresh program atom or the atom associated with the given symbol.
[ "Return", "a", "fresh", "program", "atom", "or", "the", "atom", "associated", "with", "the", "given", "symbol", "." ]
def add_atom(self, symbol: Optional[Symbol]=None) -> int: ''' Return a fresh program atom or the atom associated with the given symbol. If the given symbol does not exist in the atom base, it is added first. Such atoms will be used in subequents calls to ground for instantiation. ...
[ "def", "add_atom", "(", "self", ",", "symbol", ":", "Optional", "[", "Symbol", "]", "=", "None", ")", "->", "int", ":", "# pylint: disable=protected-access", "if", "symbol", "is", "None", ":", "p_sym", "=", "_ffi", ".", "NULL", "else", ":", "p_sym", "=",...
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/backend.py#L546-L568
syoyo/tinygltf
e7f1ff5c59d3ca2489923beb239bdf93d863498f
deps/cpplint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/syoyo/tinygltf/blob/e7f1ff5c59d3ca2489923beb239bdf93d863498f/deps/cpplint.py#L775-L777
RapidsAtHKUST/CommunityDetectionCodes
23dbafd2e57ab0f5f0528b1322c4a409f21e5892
Prensentation/graph_tool_usage/intro_graph_tool/nx2gt.py
python
nx2gt
(nxG)
return gtG
Converts a networkx graph to a graph-tool graph.
Converts a networkx graph to a graph-tool graph.
[ "Converts", "a", "networkx", "graph", "to", "a", "graph", "-", "tool", "graph", "." ]
def nx2gt(nxG): """ Converts a networkx graph to a graph-tool graph. """ # Phase 0: Create a directed or undirected graph-tool Graph gtG = gt.Graph(directed=nxG.is_directed()) # Add the Graph properties as "internal properties" for key, value in nxG.graph.items(): # Convert the valu...
[ "def", "nx2gt", "(", "nxG", ")", ":", "# Phase 0: Create a directed or undirected graph-tool Graph", "gtG", "=", "gt", ".", "Graph", "(", "directed", "=", "nxG", ".", "is_directed", "(", ")", ")", "# Add the Graph properties as \"internal properties\"", "for", "key", ...
https://github.com/RapidsAtHKUST/CommunityDetectionCodes/blob/23dbafd2e57ab0f5f0528b1322c4a409f21e5892/Prensentation/graph_tool_usage/intro_graph_tool/nx2gt.py#L40-L122
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/io/netcdf.py
python
netcdf_variable.assignValue
(self, value)
Assign a scalar value to a `netcdf_variable` of length one. Parameters ---------- value : scalar Scalar value (of compatible type) to assign to a length-one netcdf variable. This value will be written to file. Raises ------ ValueError ...
Assign a scalar value to a `netcdf_variable` of length one.
[ "Assign", "a", "scalar", "value", "to", "a", "netcdf_variable", "of", "length", "one", "." ]
def assignValue(self, value): """ Assign a scalar value to a `netcdf_variable` of length one. Parameters ---------- value : scalar Scalar value (of compatible type) to assign to a length-one netcdf variable. This value will be written to file. Ra...
[ "def", "assignValue", "(", "self", ",", "value", ")", ":", "if", "not", "self", ".", "data", ".", "flags", ".", "writeable", ":", "# Work-around for a bug in NumPy. Calling itemset() on a read-only", "# memory-mapped array causes a seg. fault.", "# See NumPy ticket #1622, an...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/io/netcdf.py#L889-L914
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distro.py
python
LinuxDistribution.__init__
(self, include_lsb=True, os_release_file='', distro_release_file='', include_uname=True)
The initialization method of this class gathers information from the available data sources, and stores that in private instance attributes. Subsequent access to the information items uses these private instance attributes, so that the data sources are read only once. Parameters: ...
The initialization method of this class gathers information from the available data sources, and stores that in private instance attributes. Subsequent access to the information items uses these private instance attributes, so that the data sources are read only once.
[ "The", "initialization", "method", "of", "this", "class", "gathers", "information", "from", "the", "available", "data", "sources", "and", "stores", "that", "in", "private", "instance", "attributes", ".", "Subsequent", "access", "to", "the", "information", "items",...
def __init__(self, include_lsb=True, os_release_file='', distro_release_file='', include_uname=True): """ The initialization method of this class gathers information from the available data sources, and stores that in private in...
[ "def", "__init__", "(", "self", ",", "include_lsb", "=", "True", ",", "os_release_file", "=", "''", ",", "distro_release_file", "=", "''", ",", "include_uname", "=", "True", ")", ":", "self", ".", "os_release_file", "=", "os_release_file", "or", "os", ".", ...
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/distro.py#L578-L654
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/stata.py
python
_dtype_to_default_stata_fmt
( dtype, column: Series, dta_version: int = 114, force_strl: bool = False )
Map numpy dtype to stata's default format for this type. Not terribly important since users can change this in Stata. Semantics are object -> "%DDs" where DD is the length of the string. If not a string, raise ValueError float64 -> "%10.0g" float32 -> "%9.0g" int64 -> "%9.0g" ...
Map numpy dtype to stata's default format for this type. Not terribly important since users can change this in Stata. Semantics are
[ "Map", "numpy", "dtype", "to", "stata", "s", "default", "format", "for", "this", "type", ".", "Not", "terribly", "important", "since", "users", "can", "change", "this", "in", "Stata", ".", "Semantics", "are" ]
def _dtype_to_default_stata_fmt( dtype, column: Series, dta_version: int = 114, force_strl: bool = False ) -> str: """ Map numpy dtype to stata's default format for this type. Not terribly important since users can change this in Stata. Semantics are object -> "%DDs" where DD is the length of the ...
[ "def", "_dtype_to_default_stata_fmt", "(", "dtype", ",", "column", ":", "Series", ",", "dta_version", ":", "int", "=", "114", ",", "force_strl", ":", "bool", "=", "False", ")", "->", "str", ":", "# TODO: Refactor to combine type with format", "# TODO: expand this to...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/stata.py#L2065-L2107
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
IRC.add_global_handler
(self, event, handler, priority=0)
Adds a global handler function for a specific event type. Arguments: event -- Event type (a string). Check the values of the numeric_events dictionary in irclib.py for possible event types. handler -- Callback function. priority -- A number (the l...
Adds a global handler function for a specific event type.
[ "Adds", "a", "global", "handler", "function", "for", "a", "specific", "event", "type", "." ]
def add_global_handler(self, event, handler, priority=0): """Adds a global handler function for a specific event type. Arguments: event -- Event type (a string). Check the values of the numeric_events dictionary in irclib.py for possible event types. h...
[ "def", "add_global_handler", "(", "self", ",", "event", ",", "handler", ",", "priority", "=", "0", ")", ":", "if", "not", "event", "in", "self", ".", "handlers", ":", "self", ".", "handlers", "[", "event", "]", "=", "[", "]", "bisect", ".", "insort",...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L236-L259
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/json_format.py
python
_ConvertBool
(value, require_str)
return value
Convert a boolean value. Args: value: A scalar value to convert. require_str: If True, value must be a str. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed.
Convert a boolean value.
[ "Convert", "a", "boolean", "value", "." ]
def _ConvertBool(value, require_str): """Convert a boolean value. Args: value: A scalar value to convert. require_str: If True, value must be a str. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed. """ if require_str: if value == 'true': ret...
[ "def", "_ConvertBool", "(", "value", ",", "require_str", ")", ":", "if", "require_str", ":", "if", "value", "==", "'true'", ":", "return", "True", "elif", "value", "==", "'false'", ":", "return", "False", "else", ":", "raise", "ParseError", "(", "'Expected...
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/json_format.py#L605-L628
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
modules/tools/record_parse_save/record_parse_save.py
python
define_destinations
(parse_dict)
return dest_dict, parser_func
define destination for extracted files
define destination for extracted files
[ "define", "destination", "for", "extracted", "files" ]
def define_destinations(parse_dict): """ define destination for extracted files """ dest_dict = { "channel_name": "", "timestamp_file": "", "destination_folder": "" } parse_type = parse_dict["parse_type"] params = parse_dict["params"] dest_folder = parse_dict["ou...
[ "def", "define_destinations", "(", "parse_dict", ")", ":", "dest_dict", "=", "{", "\"channel_name\"", ":", "\"\"", ",", "\"timestamp_file\"", ":", "\"\"", ",", "\"destination_folder\"", ":", "\"\"", "}", "parse_type", "=", "parse_dict", "[", "\"parse_type\"", "]",...
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/record_parse_save/record_parse_save.py#L73-L98
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/message.py
python
Message.add_header
(self, _name, _value, **_params)
Extended header setting. name is the header field to add. keyword arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as key="value" unless value is None, in which case only the key will be...
Extended header setting.
[ "Extended", "header", "setting", "." ]
def add_header(self, _name, _value, **_params): """Extended header setting. name is the header field to add. keyword arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as key="value" unles...
[ "def", "add_header", "(", "self", ",", "_name", ",", "_value", ",", "*", "*", "_params", ")", ":", "parts", "=", "[", "]", "for", "k", ",", "v", "in", "_params", ".", "items", "(", ")", ":", "if", "v", "is", "None", ":", "parts", ".", "append",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/message.py#L388-L411
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/backend.py
python
set_session
(session)
Sets the global TensorFlow session. Args: session: A TF Session.
Sets the global TensorFlow session.
[ "Sets", "the", "global", "TensorFlow", "session", "." ]
def set_session(session): """Sets the global TensorFlow session. Args: session: A TF Session. """ global _SESSION _SESSION.session = session
[ "def", "set_session", "(", "session", ")", ":", "global", "_SESSION", "_SESSION", ".", "session", "=", "session" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L806-L813
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/core/defchararray.py
python
isupper
(a)
return _vec_string(a, bool_, 'isupper')
Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise. Call `str.isupper` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ...
Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise.
[ "Returns", "true", "for", "each", "element", "if", "all", "cased", "characters", "in", "the", "string", "are", "uppercase", "and", "there", "is", "at", "least", "one", "character", "false", "otherwise", "." ]
def isupper(a): """ Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise. Call `str.isupper` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of ...
[ "def", "isupper", "(", "a", ")", ":", "return", "_vec_string", "(", "a", ",", "bool_", ",", "'isupper'", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/defchararray.py#L916-L939
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/scons/getversion.py
python
OpenGeeVersion.set_long
(self, value)
Overrides the long version string by using the given value. Overriding the long version string would indirectly override the short version string, as well, unless the former is also overridden.
Overrides the long version string by using the given value. Overriding the long version string would indirectly override the short version string, as well, unless the former is also overridden.
[ "Overrides", "the", "long", "version", "string", "by", "using", "the", "given", "value", ".", "Overriding", "the", "long", "version", "string", "would", "indirectly", "override", "the", "short", "version", "string", "as", "well", "unless", "the", "former", "is...
def set_long(self, value): """Overrides the long version string by using the given value. Overriding the long version string would indirectly override the short version string, as well, unless the former is also overridden. """ self.long_version_string = value
[ "def", "set_long", "(", "self", ",", "value", ")", ":", "self", ".", "long_version_string", "=", "value" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/scons/getversion.py#L358-L364
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py
python
Formatter.formatStack
(self, stack_info)
return stack_info
This method is provided as an extension point for specialized formatting of stack information. The input data is a string as returned from a call to :func:`traceback.print_stack`, but with the last trailing newline removed. The base implementation just returns the value passed ...
This method is provided as an extension point for specialized formatting of stack information.
[ "This", "method", "is", "provided", "as", "an", "extension", "point", "for", "specialized", "formatting", "of", "stack", "information", "." ]
def formatStack(self, stack_info): """ This method is provided as an extension point for specialized formatting of stack information. The input data is a string as returned from a call to :func:`traceback.print_stack`, but with the last trailing newline removed. ...
[ "def", "formatStack", "(", "self", ",", "stack_info", ")", ":", "return", "stack_info" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py#L582-L593