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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/python/caffe/coord_map.py | python | crop_params | (fn) | return (axis, offset) | Extract the crop layer parameters with defaults. | Extract the crop layer parameters with defaults. | [
"Extract",
"the",
"crop",
"layer",
"parameters",
"with",
"defaults",
"."
] | def crop_params(fn):
"""
Extract the crop layer parameters with defaults.
"""
params = fn.params.get('crop_param', fn.params)
axis = params.get('axis', 2) # default to spatial crop for N, C, H, W
offset = np.array(params.get('offset', 0), ndmin=1)
return (axis, offset) | [
"def",
"crop_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'crop_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"2",
")",
"# default to spatial crop for N, C, H, W",
"o... | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/python/caffe/coord_map.py#L40-L47 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/operation.py | python | InputCollectionDescription.from_function | (function) | return InputCollectionDescription(description.items()) | Inspect a function to be wrapped.
Used internally by gmxapi.operation.function_wrapper()
Raises:
exceptions.ProtocolError if function signature cannot be determined to be valid.
Returns:
InputCollectionDescription for the function input signature. | Inspect a function to be wrapped. | [
"Inspect",
"a",
"function",
"to",
"be",
"wrapped",
"."
] | def from_function(function):
"""Inspect a function to be wrapped.
Used internally by gmxapi.operation.function_wrapper()
Raises:
exceptions.ProtocolError if function signature cannot be determined to be valid.
Returns:
InputCollectionDescription... | [
"def",
"from_function",
"(",
"function",
")",
":",
"# First, inspect the function.",
"assert",
"callable",
"(",
"function",
")",
"signature",
"=",
"inspect",
".",
"signature",
"(",
"function",
")",
"# The function must have clear and static input schema",
"# Make sure that ... | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/operation.py#L391-L434 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/decomposition/_dict_learning.py | python | dict_learning | (X, n_components, alpha, max_iter=100, tol=1e-8,
method='lars', n_jobs=None, dict_init=None, code_init=None,
callback=None, verbose=False, random_state=None,
return_n_iter=False, positive_dict=False,
positive_code=False, method_max_iter=1000) | Solves a dictionary learning matrix factorization problem.
Finds the best dictionary and the corresponding sparse code for
approximating the data matrix X by solving::
(U^*, V^*) = argmin 0.5 || X - U V ||_2^2 + alpha * || U ||_1
(U,V)
with || V_k ||_2 = 1 for ... | Solves a dictionary learning matrix factorization problem. | [
"Solves",
"a",
"dictionary",
"learning",
"matrix",
"factorization",
"problem",
"."
] | def dict_learning(X, n_components, alpha, max_iter=100, tol=1e-8,
method='lars', n_jobs=None, dict_init=None, code_init=None,
callback=None, verbose=False, random_state=None,
return_n_iter=False, positive_dict=False,
positive_code=False, method_max... | [
"def",
"dict_learning",
"(",
"X",
",",
"n_components",
",",
"alpha",
",",
"max_iter",
"=",
"100",
",",
"tol",
"=",
"1e-8",
",",
"method",
"=",
"'lars'",
",",
"n_jobs",
"=",
"None",
",",
"dict_init",
"=",
"None",
",",
"code_init",
"=",
"None",
",",
"c... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/decomposition/_dict_learning.py#L425-L617 | ||
google/swiftshader | 8ccc63f045d5975fb67f9dfd3d2b8235b0526990 | third_party/SPIRV-Tools/utils/check_copyright.py | python | find | (top, filename_glob, skip_glob_dir_list, skip_glob_files_list) | return file_list | Returns files in the tree rooted at top matching filename_glob but not
in directories matching skip_glob_dir_list nor files matching
skip_glob_dir_list. | Returns files in the tree rooted at top matching filename_glob but not
in directories matching skip_glob_dir_list nor files matching
skip_glob_dir_list. | [
"Returns",
"files",
"in",
"the",
"tree",
"rooted",
"at",
"top",
"matching",
"filename_glob",
"but",
"not",
"in",
"directories",
"matching",
"skip_glob_dir_list",
"nor",
"files",
"matching",
"skip_glob_dir_list",
"."
] | def find(top, filename_glob, skip_glob_dir_list, skip_glob_files_list):
"""Returns files in the tree rooted at top matching filename_glob but not
in directories matching skip_glob_dir_list nor files matching
skip_glob_dir_list."""
file_list = []
for path, dirs, files in os.walk(top):
for gl... | [
"def",
"find",
"(",
"top",
",",
"filename_glob",
",",
"skip_glob_dir_list",
",",
"skip_glob_files_list",
")",
":",
"file_list",
"=",
"[",
"]",
"for",
"path",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"top",
")",
":",
"for",
"glob",
"in",... | https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/SPIRV-Tools/utils/check_copyright.py#L72-L86 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer.list_outputs | (self, args, screen_info=None) | return self._list_inputs_or_outputs(
parsed.recursive,
parsed.node_name,
parsed.depth,
parsed.control,
parsed.op_type,
do_outputs=True) | Command handler for inputs.
Show inputs to a given node.
Args:
args: Command-line arguments, excluding the command prefix, as a list of
str.
screen_info: Optional dict input containing screen information such as
cols.
Returns:
Output text lines as a RichTextLines object. | Command handler for inputs. | [
"Command",
"handler",
"for",
"inputs",
"."
] | def list_outputs(self, args, screen_info=None):
"""Command handler for inputs.
Show inputs to a given node.
Args:
args: Command-line arguments, excluding the command prefix, as a list of
str.
screen_info: Optional dict input containing screen information such as
cols.
Retu... | [
"def",
"list_outputs",
"(",
"self",
",",
"args",
",",
"screen_info",
"=",
"None",
")",
":",
"# Screen info not currently used by this handler. Include this line to",
"# mute pylint.",
"_",
"=",
"screen_info",
"# TODO(cais): Use screen info to format the output lines more prettily,"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/cli/analyzer_cli.py#L495-L524 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridTableBase.SetAttr | (*args, **kwargs) | return _grid.GridTableBase_SetAttr(*args, **kwargs) | SetAttr(self, GridCellAttr attr, int row, int col) | SetAttr(self, GridCellAttr attr, int row, int col) | [
"SetAttr",
"(",
"self",
"GridCellAttr",
"attr",
"int",
"row",
"int",
"col",
")"
] | def SetAttr(*args, **kwargs):
"""SetAttr(self, GridCellAttr attr, int row, int col)"""
return _grid.GridTableBase_SetAttr(*args, **kwargs) | [
"def",
"SetAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_SetAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L910-L912 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/cli/command_parser.py | python | extract_output_file_path | (args) | return args, output_file_path | Extract output file path from command arguments.
Args:
args: (list of str) command arguments.
Returns:
(list of str) Command arguments with the output file path part stripped.
(str or None) Output file path (if any).
Raises:
SyntaxError: If there is no file path after the last ">" character. | Extract output file path from command arguments. | [
"Extract",
"output",
"file",
"path",
"from",
"command",
"arguments",
"."
] | def extract_output_file_path(args):
"""Extract output file path from command arguments.
Args:
args: (list of str) command arguments.
Returns:
(list of str) Command arguments with the output file path part stripped.
(str or None) Output file path (if any).
Raises:
SyntaxError: If there is no f... | [
"def",
"extract_output_file_path",
"(",
"args",
")",
":",
"if",
"args",
"and",
"args",
"[",
"-",
"1",
"]",
".",
"endswith",
"(",
"\">\"",
")",
":",
"raise",
"SyntaxError",
"(",
"\"Redirect file path is empty\"",
")",
"elif",
"args",
"and",
"args",
"[",
"-"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/command_parser.py#L103-L147 | |
JoseExposito/touchegg | 1f3fda214358d071c05da4bf17c070c33d67b5eb | cmake/cpplint.py | python | _CppLintState.IncrementErrorCount | (self, category) | Bumps the module's error statistic. | Bumps the module's error statistic. | [
"Bumps",
"the",
"module",
"s",
"error",
"statistic",
"."
] | def IncrementErrorCount(self, category):
"""Bumps the module's error statistic."""
self.error_count += 1
if self.counting in ('toplevel', 'detailed'):
if self.counting != 'detailed':
category = category.split('/')[0]
if category not in self.errors_by_category:
self.errors_by_cate... | [
"def",
"IncrementErrorCount",
"(",
"self",
",",
"category",
")",
":",
"self",
".",
"error_count",
"+=",
"1",
"if",
"self",
".",
"counting",
"in",
"(",
"'toplevel'",
",",
"'detailed'",
")",
":",
"if",
"self",
".",
"counting",
"!=",
"'detailed'",
":",
"cat... | https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L943-L951 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/Paste/paste/util/multidict.py | python | UnicodeMultiDict.dict_of_lists | (self) | return unicode_dict | Returns a dictionary where each key is associated with a
list of values. | Returns a dictionary where each key is associated with a
list of values. | [
"Returns",
"a",
"dictionary",
"where",
"each",
"key",
"is",
"associated",
"with",
"a",
"list",
"of",
"values",
"."
] | def dict_of_lists(self):
"""
Returns a dictionary where each key is associated with a
list of values.
"""
unicode_dict = {}
for key, value in six.iteritems(self.multi.dict_of_lists()):
value = [self._decode_value(value) for value in value]
unicode_... | [
"def",
"dict_of_lists",
"(",
"self",
")",
":",
"unicode_dict",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"multi",
".",
"dict_of_lists",
"(",
")",
")",
":",
"value",
"=",
"[",
"self",
".",
"_decode_val... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/util/multidict.py#L327-L336 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py2/traitlets/config/loader.py | python | JSONFileConfigLoader.load_config | (self) | return self.config | Load the config from a file and return it as a Config object. | Load the config from a file and return it as a Config object. | [
"Load",
"the",
"config",
"from",
"a",
"file",
"and",
"return",
"it",
"as",
"a",
"Config",
"object",
"."
] | def load_config(self):
"""Load the config from a file and return it as a Config object."""
self.clear()
try:
self._find_file()
except IOError as e:
raise ConfigFileNotFound(str(e))
dct = self._read_file_as_dict()
self.config = self._convert_to_conf... | [
"def",
"load_config",
"(",
"self",
")",
":",
"self",
".",
"clear",
"(",
")",
"try",
":",
"self",
".",
"_find_file",
"(",
")",
"except",
"IOError",
"as",
"e",
":",
"raise",
"ConfigFileNotFound",
"(",
"str",
"(",
"e",
")",
")",
"dct",
"=",
"self",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/config/loader.py#L399-L408 | |
Kitware/TeleSculptor | 84821cabd2fd60c5fbfeaf61a1948cbced716641 | plugins/blender/io_import_krtd_camera.py | python | readCameraPath | (context, files, scale) | Read a camera path from a sequence KRTD files | Read a camera path from a sequence KRTD files | [
"Read",
"a",
"camera",
"path",
"from",
"a",
"sequence",
"KRTD",
"files"
] | def readCameraPath(context, files, scale):
"""Read a camera path from a sequence KRTD files
"""
cam = bpy.data.cameras.new("camera_KRTD")
cam_ob = bpy.data.objects.new("KRTD", cam)
bpy.context.scene.objects.link(cam_ob)
bpy.context.scene.frame_start = 0
bpy.context.scene.frame_end = len(file... | [
"def",
"readCameraPath",
"(",
"context",
",",
"files",
",",
"scale",
")",
":",
"cam",
"=",
"bpy",
".",
"data",
".",
"cameras",
".",
"new",
"(",
"\"camera_KRTD\"",
")",
"cam_ob",
"=",
"bpy",
".",
"data",
".",
"objects",
".",
"new",
"(",
"\"KRTD\"",
",... | https://github.com/Kitware/TeleSculptor/blob/84821cabd2fd60c5fbfeaf61a1948cbced716641/plugins/blender/io_import_krtd_camera.py#L100-L121 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/build_tools/nacl_sdk_scons/nacl_utils.py | python | GetJSONFromNexeSpec | (nexe_spec) | return nmf_json | Generate a JSON string that represents the architecture-to-nexe mapping
in |nexe_spec|.
The nexe spec is a simple dictionary, whose keys are architecture names and
values are the nexe files that should be loaded for the corresponding
architecture. For example:
{'x86-32': 'hello_world_x86_32.nexe',
... | Generate a JSON string that represents the architecture-to-nexe mapping
in |nexe_spec|. | [
"Generate",
"a",
"JSON",
"string",
"that",
"represents",
"the",
"architecture",
"-",
"to",
"-",
"nexe",
"mapping",
"in",
"|nexe_spec|",
"."
] | def GetJSONFromNexeSpec(nexe_spec):
'''Generate a JSON string that represents the architecture-to-nexe mapping
in |nexe_spec|.
The nexe spec is a simple dictionary, whose keys are architecture names and
values are the nexe files that should be loaded for the corresponding
architecture. For example:
{'... | [
"def",
"GetJSONFromNexeSpec",
"(",
"nexe_spec",
")",
":",
"nmf_json",
"=",
"'{\\n'",
"nmf_json",
"+=",
"' \"program\": {\\n'",
"# Add an entry in the JSON for each specified architecture. Note that this",
"# loop emits a trailing ',' for every line but the last one.",
"if",
"nexe_spe... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/nacl_sdk_scons/nacl_utils.py#L227-L259 | |
Sigil-Ebook/Sigil | 0d145d3a4874b4a26f7aabd68dbd9d18a2402e52 | src/Resource_Files/plugin_launchers/python/sigil_bs4/diagnose.py | python | rsentence | (length=4) | return " ".join(rword(random.randint(4,9)) for i in range(length)) | Generate a random sentence-like string. | Generate a random sentence-like string. | [
"Generate",
"a",
"random",
"sentence",
"-",
"like",
"string",
"."
] | def rsentence(length=4):
"Generate a random sentence-like string."
return " ".join(rword(random.randint(4,9)) for i in range(length)) | [
"def",
"rsentence",
"(",
"length",
"=",
"4",
")",
":",
"return",
"\" \"",
".",
"join",
"(",
"rword",
"(",
"random",
".",
"randint",
"(",
"4",
",",
"9",
")",
")",
"for",
"i",
"in",
"range",
"(",
"length",
")",
")"
] | https://github.com/Sigil-Ebook/Sigil/blob/0d145d3a4874b4a26f7aabd68dbd9d18a2402e52/src/Resource_Files/plugin_launchers/python/sigil_bs4/diagnose.py#L147-L149 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/preprocessing/_label.py | python | MultiLabelBinarizer.inverse_transform | (self, yt) | Transform the given indicator matrix into label sets
Parameters
----------
yt : array or sparse matrix of shape (n_samples, n_classes)
A matrix containing only 1s ands 0s.
Returns
-------
y : list of tuples
The set of labels for each sample such ... | Transform the given indicator matrix into label sets | [
"Transform",
"the",
"given",
"indicator",
"matrix",
"into",
"label",
"sets"
] | def inverse_transform(self, yt):
"""Transform the given indicator matrix into label sets
Parameters
----------
yt : array or sparse matrix of shape (n_samples, n_classes)
A matrix containing only 1s ands 0s.
Returns
-------
y : list of tuples
... | [
"def",
"inverse_transform",
"(",
"self",
",",
"yt",
")",
":",
"check_is_fitted",
"(",
"self",
")",
"if",
"yt",
".",
"shape",
"[",
"1",
"]",
"!=",
"len",
"(",
"self",
".",
"classes_",
")",
":",
"raise",
"ValueError",
"(",
"'Expected indicator for {0} classe... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/preprocessing/_label.py#L993-L1025 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/feature.py | python | enumerate | () | return __all_features.iteritems () | Returns an iterator to the features map. | Returns an iterator to the features map. | [
"Returns",
"an",
"iterator",
"to",
"the",
"features",
"map",
"."
] | def enumerate ():
""" Returns an iterator to the features map.
"""
return __all_features.iteritems () | [
"def",
"enumerate",
"(",
")",
":",
"return",
"__all_features",
".",
"iteritems",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/feature.py#L120-L123 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/nanfunctions.py | python | nanmin | (a, axis=None, out=None, keepdims=np._NoValue) | return res | Return minimum of an array or minimum along an axis, ignoring any NaNs.
When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
Nan is returned for that slice.
Parameters
----------
a : array_like
Array containing numbers whose minimum is desired. If `a` is not an
arr... | Return minimum of an array or minimum along an axis, ignoring any NaNs.
When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
Nan is returned for that slice. | [
"Return",
"minimum",
"of",
"an",
"array",
"or",
"minimum",
"along",
"an",
"axis",
"ignoring",
"any",
"NaNs",
".",
"When",
"all",
"-",
"NaN",
"slices",
"are",
"encountered",
"a",
"RuntimeWarning",
"is",
"raised",
"and",
"Nan",
"is",
"returned",
"for",
"that... | def nanmin(a, axis=None, out=None, keepdims=np._NoValue):
"""
Return minimum of an array or minimum along an axis, ignoring any NaNs.
When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
Nan is returned for that slice.
Parameters
----------
a : array_like
Array con... | [
"def",
"nanmin",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"keepdims",
"is",
"not",
"np",
".",
"_NoValue",
":",
"kwargs",
"[",
"'keepdims'",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/nanfunctions.py#L229-L336 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/onedim.py | python | CounterflowPremixedFlame.__init__ | (self, gas, grid=None, width=None) | :param gas:
`Solution` (using the IdealGas thermodynamic model) used to
evaluate all gas properties and reaction rates.
:param grid:
Array of initial grid points. Not recommended unless solving only on
a fixed grid; Use the `width` parameter instead.
:para... | :param gas:
`Solution` (using the IdealGas thermodynamic model) used to
evaluate all gas properties and reaction rates.
:param grid:
Array of initial grid points. Not recommended unless solving only on
a fixed grid; Use the `width` parameter instead.
:para... | [
":",
"param",
"gas",
":",
"Solution",
"(",
"using",
"the",
"IdealGas",
"thermodynamic",
"model",
")",
"used",
"to",
"evaluate",
"all",
"gas",
"properties",
"and",
"reaction",
"rates",
".",
":",
"param",
"grid",
":",
"Array",
"of",
"initial",
"grid",
"point... | def __init__(self, gas, grid=None, width=None):
"""
:param gas:
`Solution` (using the IdealGas thermodynamic model) used to
evaluate all gas properties and reaction rates.
:param grid:
Array of initial grid points. Not recommended unless solving only on
... | [
"def",
"__init__",
"(",
"self",
",",
"gas",
",",
"grid",
"=",
"None",
",",
"width",
"=",
"None",
")",
":",
"self",
".",
"reactants",
"=",
"Inlet1D",
"(",
"name",
"=",
"'reactants'",
",",
"phase",
"=",
"gas",
")",
"self",
".",
"reactants",
".",
"T",... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/onedim.py#L1504-L1537 | ||
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/project.py | python | ProjectRegistry.target | (self, project_module) | return self.module2target[project_module] | Returns the project target corresponding to the 'project-module'. | Returns the project target corresponding to the 'project-module'. | [
"Returns",
"the",
"project",
"target",
"corresponding",
"to",
"the",
"project",
"-",
"module",
"."
] | def target(self, project_module):
"""Returns the project target corresponding to the 'project-module'."""
assert isinstance(project_module, basestring)
if project_module not in self.module2target:
self.module2target[project_module] = \
b2.build.targets.ProjectTarget(p... | [
"def",
"target",
"(",
"self",
",",
"project_module",
")",
":",
"assert",
"isinstance",
"(",
"project_module",
",",
"basestring",
")",
"if",
"project_module",
"not",
"in",
"self",
".",
"module2target",
":",
"self",
".",
"module2target",
"[",
"project_module",
"... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/project.py#L611-L619 | |
hifiberry/hifiberry-os | 88c05213fb3e6230645cb4bf8eb8fceda8bd07d4 | buildroot/package/audiocontrol2/src/mpris.py | python | MPRISController.retrievePlayers | (self) | return [name for name in self.bus.list_names()
if name.startswith("org.mpris")] | Returns a list of all MPRIS enabled players that are active in
the system | Returns a list of all MPRIS enabled players that are active in
the system | [
"Returns",
"a",
"list",
"of",
"all",
"MPRIS",
"enabled",
"players",
"that",
"are",
"active",
"in",
"the",
"system"
] | def retrievePlayers(self):
"""
Returns a list of all MPRIS enabled players that are active in
the system
"""
return [name for name in self.bus.list_names()
if name.startswith("org.mpris")] | [
"def",
"retrievePlayers",
"(",
"self",
")",
":",
"return",
"[",
"name",
"for",
"name",
"in",
"self",
".",
"bus",
".",
"list_names",
"(",
")",
"if",
"name",
".",
"startswith",
"(",
"\"org.mpris\"",
")",
"]"
] | https://github.com/hifiberry/hifiberry-os/blob/88c05213fb3e6230645cb4bf8eb8fceda8bd07d4/buildroot/package/audiocontrol2/src/mpris.py#L70-L76 | |
nasa/trick | 7b85aa66329d62fe8816462627c09a353aac8299 | share/trick/trickops/WorkflowCommon.py | python | WorkflowCommon.execute_jobs | (self, jobs, max_concurrent=None, header=None) | return any(job.get_status() is not job.Status.SUCCESS for job in jobs) | Run jobs, blocking until all have returned.
Parameters
----------
jobs : iterable of Job
The jobs to run.
max_concurrent : int
The maximum number of jobs to execute simultaneously.
header : str
Header text.
Returns
-------
... | Run jobs, blocking until all have returned. | [
"Run",
"jobs",
"blocking",
"until",
"all",
"have",
"returned",
"."
] | def execute_jobs(self, jobs, max_concurrent=None, header=None):
"""
Run jobs, blocking until all have returned.
Parameters
----------
jobs : iterable of Job
The jobs to run.
max_concurrent : int
The maximum number of jobs to execute simultaneously... | [
"def",
"execute_jobs",
"(",
"self",
",",
"jobs",
",",
"max_concurrent",
"=",
"None",
",",
"header",
"=",
"None",
")",
":",
"if",
"not",
"os",
".",
"environ",
".",
"get",
"(",
"'TERM'",
")",
"and",
"not",
"self",
".",
"quiet",
":",
"tprint",
"(",
"'... | https://github.com/nasa/trick/blob/7b85aa66329d62fe8816462627c09a353aac8299/share/trick/trickops/WorkflowCommon.py#L574-L811 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/adapters.py | python | HTTPAdapter.init_poolmanager | (self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs) | Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only
exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param connections: The number of urllib3 connection pools to cache.
:param maxsize: The ma... | Initializes a urllib3 PoolManager. | [
"Initializes",
"a",
"urllib3",
"PoolManager",
"."
] | def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs):
"""Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only
exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
... | [
"def",
"init_poolmanager",
"(",
"self",
",",
"connections",
",",
"maxsize",
",",
"block",
"=",
"DEFAULT_POOLBLOCK",
",",
"*",
"*",
"pool_kwargs",
")",
":",
"# save these values for pickling",
"self",
".",
"_pool_connections",
"=",
"connections",
"self",
".",
"_poo... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/adapters.py#L146-L164 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/CrystalField/fitting.py | python | CrystalField.getSpectrum | (self, i=0, workspace=None, ws_index=0) | return self._calcSpectrum(i, wksp, 0) | Get the i-th spectrum calculated with the current field and peak parameters.
Alternatively can be called getSpectrum(workspace, ws_index). Spectrum index i is assumed zero.
Examples:
cf.getSpectrum() # Return the first spectrum calculated on a generated set of x-values.
cf.get... | Get the i-th spectrum calculated with the current field and peak parameters. | [
"Get",
"the",
"i",
"-",
"th",
"spectrum",
"calculated",
"with",
"the",
"current",
"field",
"and",
"peak",
"parameters",
"."
] | def getSpectrum(self, i=0, workspace=None, ws_index=0):
"""
Get the i-th spectrum calculated with the current field and peak parameters.
Alternatively can be called getSpectrum(workspace, ws_index). Spectrum index i is assumed zero.
Examples:
cf.getSpectrum() # Return the ... | [
"def",
"getSpectrum",
"(",
"self",
",",
"i",
"=",
"0",
",",
"workspace",
"=",
"None",
",",
"ws_index",
"=",
"0",
")",
":",
"wksp",
"=",
"workspace",
"# Allow to call getSpectrum with a workspace as the first argument.",
"if",
"not",
"isinstance",
"(",
"i",
",",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/CrystalField/fitting.py#L718-L767 | |
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | src/python/interface/src/mesos/interface/__init__.py | python | SchedulerDriver.join | (self) | Waits for the driver to be stopped or aborted, possibly blocking the
current thread indefinitely. The return status of this function can
be used to determine if the driver was aborted (see mesos.proto for a
description of Status). | Waits for the driver to be stopped or aborted, possibly blocking the
current thread indefinitely. The return status of this function can
be used to determine if the driver was aborted (see mesos.proto for a
description of Status). | [
"Waits",
"for",
"the",
"driver",
"to",
"be",
"stopped",
"or",
"aborted",
"possibly",
"blocking",
"the",
"current",
"thread",
"indefinitely",
".",
"The",
"return",
"status",
"of",
"this",
"function",
"can",
"be",
"used",
"to",
"determine",
"if",
"the",
"drive... | def join(self):
"""
Waits for the driver to be stopped or aborted, possibly blocking the
current thread indefinitely. The return status of this function can
be used to determine if the driver was aborted (see mesos.proto for a
description of Status).
""" | [
"def",
"join",
"(",
"self",
")",
":"
] | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/src/python/interface/src/mesos/interface/__init__.py#L171-L177 | ||
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | EClient.calculateImpliedVolatility | (self, reqId, contract, optionPrice, underPrice) | return _swigibpy.EClient_calculateImpliedVolatility(self, reqId, contract, optionPrice, underPrice) | calculateImpliedVolatility(EClient self, TickerId reqId, Contract contract, double optionPrice, double underPrice) | calculateImpliedVolatility(EClient self, TickerId reqId, Contract contract, double optionPrice, double underPrice) | [
"calculateImpliedVolatility",
"(",
"EClient",
"self",
"TickerId",
"reqId",
"Contract",
"contract",
"double",
"optionPrice",
"double",
"underPrice",
")"
] | def calculateImpliedVolatility(self, reqId, contract, optionPrice, underPrice):
"""calculateImpliedVolatility(EClient self, TickerId reqId, Contract contract, double optionPrice, double underPrice)"""
return _swigibpy.EClient_calculateImpliedVolatility(self, reqId, contract, optionPrice, underPrice) | [
"def",
"calculateImpliedVolatility",
"(",
"self",
",",
"reqId",
",",
"contract",
",",
"optionPrice",
",",
"underPrice",
")",
":",
"return",
"_swigibpy",
".",
"EClient_calculateImpliedVolatility",
"(",
"self",
",",
"reqId",
",",
"contract",
",",
"optionPrice",
",",... | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L1270-L1272 | |
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L4673-L4748 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py | python | _parse_content_type_header | (header) | return content_type, params_dict | Returns content type and parameters from given header
:param header: string
:return: tuple containing content type and dictionary of
parameters | Returns content type and parameters from given header | [
"Returns",
"content",
"type",
"and",
"parameters",
"from",
"given",
"header"
] | def _parse_content_type_header(header):
"""Returns content type and parameters from given header
:param header: string
:return: tuple containing content type and dictionary of
parameters
"""
tokens = header.split(';')
content_type, params = tokens[0].strip(), tokens[1:]
... | [
"def",
"_parse_content_type_header",
"(",
"header",
")",
":",
"tokens",
"=",
"header",
".",
"split",
"(",
"';'",
")",
"content_type",
",",
"params",
"=",
"tokens",
"[",
"0",
"]",
".",
"strip",
"(",
")",
",",
"tokens",
"[",
"1",
":",
"]",
"params_dict",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py#L921-L965 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridEvent.CanVeto | (*args, **kwargs) | return _propgrid.PropertyGridEvent_CanVeto(*args, **kwargs) | CanVeto(self) -> bool | CanVeto(self) -> bool | [
"CanVeto",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanVeto(*args, **kwargs):
"""CanVeto(self) -> bool"""
return _propgrid.PropertyGridEvent_CanVeto(*args, **kwargs) | [
"def",
"CanVeto",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridEvent_CanVeto",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2525-L2527 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | linked_list/library/circular_linked_list.py | python | CircularLinkedList.print | (self) | prints entire linked list without changing underlying data | prints entire linked list without changing underlying data | [
"prints",
"entire",
"linked",
"list",
"without",
"changing",
"underlying",
"data"
] | def print(self):
""" prints entire linked list without changing underlying data """
current = self.head
while current is not None:
print(" ->", current.data, end="")
current = current.next
if current == self.head:
break
print(end=" -> .... | [
"def",
"print",
"(",
"self",
")",
":",
"current",
"=",
"self",
".",
"head",
"while",
"current",
"is",
"not",
"None",
":",
"print",
"(",
"\" ->\"",
",",
"current",
".",
"data",
",",
"end",
"=",
"\"\"",
")",
"current",
"=",
"current",
".",
"next",
"i... | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/linked_list/library/circular_linked_list.py#L83-L92 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/xs/data_source.py | python | DataSource.discretize | (self, nuc, rx, temp=300.0, src_phi_g=None, dst_phi_g=None) | return dst_sigma | Discretizes the reaction channel from the source group structure to that
of the destination weighted by the group fluxes. This implemenation is only
valid for multi-group data sources. Non-multigroup data source should also
override this method.
Parameters
----------
n... | Discretizes the reaction channel from the source group structure to that
of the destination weighted by the group fluxes. This implemenation is only
valid for multi-group data sources. Non-multigroup data source should also
override this method. | [
"Discretizes",
"the",
"reaction",
"channel",
"from",
"the",
"source",
"group",
"structure",
"to",
"that",
"of",
"the",
"destination",
"weighted",
"by",
"the",
"group",
"fluxes",
".",
"This",
"implemenation",
"is",
"only",
"valid",
"for",
"multi",
"-",
"group",... | def discretize(self, nuc, rx, temp=300.0, src_phi_g=None, dst_phi_g=None):
"""Discretizes the reaction channel from the source group structure to that
of the destination weighted by the group fluxes. This implemenation is only
valid for multi-group data sources. Non-multigroup data source shou... | [
"def",
"discretize",
"(",
"self",
",",
"nuc",
",",
"rx",
",",
"temp",
"=",
"300.0",
",",
"src_phi_g",
"=",
"None",
",",
"dst_phi_g",
"=",
"None",
")",
":",
"src_phi_g",
"=",
"self",
".",
"src_phi_g",
"if",
"src_phi_g",
"is",
"None",
"else",
"np",
"."... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/xs/data_source.py#L194-L224 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus3.in.py | python | exodus.get_variable_values | (self, objType, entityId, name, step) | return values | get list of `objType` variable values for a specified object id
block, variable name, and time step
>>> evar_vals = exo.get_variable_values('EX_ELEM_BLOCK', elem_blk_id,
... evar_name, time_step)
Parameters
----------
objType ... | get list of `objType` variable values for a specified object id
block, variable name, and time step | [
"get",
"list",
"of",
"objType",
"variable",
"values",
"for",
"a",
"specified",
"object",
"id",
"block",
"variable",
"name",
"and",
"time",
"step"
] | def get_variable_values(self, objType, entityId, name, step):
"""
get list of `objType` variable values for a specified object id
block, variable name, and time step
>>> evar_vals = exo.get_variable_values('EX_ELEM_BLOCK', elem_blk_id,
... ... | [
"def",
"get_variable_values",
"(",
"self",
",",
"objType",
",",
"entityId",
",",
"name",
",",
"step",
")",
":",
"names",
"=",
"self",
".",
"get_variable_names",
"(",
"objType",
")",
"var_id",
"=",
"names",
".",
"index",
"(",
"name",
")",
"+",
"1",
"num... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L2162-L2209 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/support.py | python | clean_from_chars_not_for_filename | (filename_in) | return filename_out.replace(cons.CHAR_SPACE, cons.CHAR_USCORE) | Clean a string from chars not good for filename | Clean a string from chars not good for filename | [
"Clean",
"a",
"string",
"from",
"chars",
"not",
"good",
"for",
"filename"
] | def clean_from_chars_not_for_filename(filename_in):
"""Clean a string from chars not good for filename"""
filename_out = filename_in.replace(cons.CHAR_SLASH, cons.CHAR_MINUS).replace(cons.CHAR_BSLASH, cons.CHAR_MINUS)
filename_out = filename_out.replace(cons.CHAR_STAR, "").replace(cons.CHAR_QUESTION, "").re... | [
"def",
"clean_from_chars_not_for_filename",
"(",
"filename_in",
")",
":",
"filename_out",
"=",
"filename_in",
".",
"replace",
"(",
"cons",
".",
"CHAR_SLASH",
",",
"cons",
".",
"CHAR_MINUS",
")",
".",
"replace",
"(",
"cons",
".",
"CHAR_BSLASH",
",",
"cons",
"."... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/support.py#L636-L643 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_base.py | python | BaseFix.compile_pattern | (self) | Compiles self.PATTERN into self.pattern.
Subclass may override if it doesn't want to use
self.{pattern,PATTERN} in .match(). | Compiles self.PATTERN into self.pattern. | [
"Compiles",
"self",
".",
"PATTERN",
"into",
"self",
".",
"pattern",
"."
] | def compile_pattern(self):
"""Compiles self.PATTERN into self.pattern.
Subclass may override if it doesn't want to use
self.{pattern,PATTERN} in .match().
"""
if self.PATTERN is not None:
PC = PatternCompiler()
self.pattern, self.pattern_tree = PC.compile... | [
"def",
"compile_pattern",
"(",
"self",
")",
":",
"if",
"self",
".",
"PATTERN",
"is",
"not",
"None",
":",
"PC",
"=",
"PatternCompiler",
"(",
")",
"self",
".",
"pattern",
",",
"self",
".",
"pattern_tree",
"=",
"PC",
".",
"compile_pattern",
"(",
"self",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_base.py#L61-L70 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py | python | TarInfo._proc_gnulong | (self, tarfile) | return next | Process the blocks that hold a GNU longname
or longlink member. | Process the blocks that hold a GNU longname
or longlink member. | [
"Process",
"the",
"blocks",
"that",
"hold",
"a",
"GNU",
"longname",
"or",
"longlink",
"member",
"."
] | def _proc_gnulong(self, tarfile):
"""Process the blocks that hold a GNU longname
or longlink member.
"""
buf = tarfile.fileobj.read(self._block(self.size))
# Fetch the next header and process it.
try:
next = self.fromtarfile(tarfile)
except HeaderE... | [
"def",
"_proc_gnulong",
"(",
"self",
",",
"tarfile",
")",
":",
"buf",
"=",
"tarfile",
".",
"fileobj",
".",
"read",
"(",
"self",
".",
"_block",
"(",
"self",
".",
"size",
")",
")",
"# Fetch the next header and process it.",
"try",
":",
"next",
"=",
"self",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py#L1333-L1353 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/numpy_interface/internal_algorithms.py | python | area | (dataset) | return _cell_quality(dataset, "area") | Returns the surface area of each cell in a mesh. | Returns the surface area of each cell in a mesh. | [
"Returns",
"the",
"surface",
"area",
"of",
"each",
"cell",
"in",
"a",
"mesh",
"."
] | def area (dataset) :
"Returns the surface area of each cell in a mesh."
return _cell_quality(dataset, "area") | [
"def",
"area",
"(",
"dataset",
")",
":",
"return",
"_cell_quality",
"(",
"dataset",
",",
"\"area\"",
")"
] | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/numpy_interface/internal_algorithms.py#L184-L186 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/imputil.py | python | ImportManager._determine_import_context | (self, globals) | return parent | Returns the context in which a module should be imported.
The context could be a loaded (package) module and the imported module
will be looked for within that package. The context could also be None,
meaning there is no context -- the module should be looked for as a
"top-level" module... | Returns the context in which a module should be imported. | [
"Returns",
"the",
"context",
"in",
"which",
"a",
"module",
"should",
"be",
"imported",
"."
] | def _determine_import_context(self, globals):
"""Returns the context in which a module should be imported.
The context could be a loaded (package) module and the imported module
will be looked for within that package. The context could also be None,
meaning there is no context -- the mo... | [
"def",
"_determine_import_context",
"(",
"self",
",",
"globals",
")",
":",
"if",
"not",
"globals",
"or",
"not",
"globals",
".",
"get",
"(",
"'__importer__'",
")",
":",
"# globals does not refer to one of our modules or packages. That",
"# implies there is no relative import... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/imputil.py#L149-L186 | |
cryfs/cryfs | 5f908c641cd5854b8a347f842b996bfe76a64577 | src/gitversion/versioneer.py | python | do_vcs_install | (manifest_in, versionfile_source, ipy) | Git-specific installation logic for Versioneer.
For Git, this means creating/changing .gitattributes to mark _version.py
for export-time keyword substitution. | Git-specific installation logic for Versioneer. | [
"Git",
"-",
"specific",
"installation",
"logic",
"for",
"Versioneer",
"."
] | def do_vcs_install(manifest_in, versionfile_source, ipy):
"""Git-specific installation logic for Versioneer.
For Git, this means creating/changing .gitattributes to mark _version.py
for export-time keyword substitution.
"""
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "... | [
"def",
"do_vcs_install",
"(",
"manifest_in",
",",
"versionfile_source",
",",
"ipy",
")",
":",
"GITS",
"=",
"[",
"\"git\"",
"]",
"if",
"sys",
".",
"platform",
"==",
"\"win32\"",
":",
"GITS",
"=",
"[",
"\"git.cmd\"",
",",
"\"git.exe\"",
"]",
"files",
"=",
... | https://github.com/cryfs/cryfs/blob/5f908c641cd5854b8a347f842b996bfe76a64577/src/gitversion/versioneer.py#L1129-L1164 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexing.py | python | _NDFrameIndexer._validate_key | (self, key, axis: int) | Ensure that key is valid for current indexer.
Parameters
----------
key : scalar, slice or list-like
Key requested.
axis : int
Dimension on which the indexing is being made.
Raises
------
TypeError
If the key (or some element ... | Ensure that key is valid for current indexer. | [
"Ensure",
"that",
"key",
"is",
"valid",
"for",
"current",
"indexer",
"."
] | def _validate_key(self, key, axis: int):
"""
Ensure that key is valid for current indexer.
Parameters
----------
key : scalar, slice or list-like
Key requested.
axis : int
Dimension on which the indexing is being made.
Raises
----... | [
"def",
"_validate_key",
"(",
"self",
",",
"key",
",",
"axis",
":",
"int",
")",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexing.py#L673-L693 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/numarray/numerictypes.py | python | getType | (type) | Return the numeric type object for type
type may be the name of a type object or the actual object | Return the numeric type object for type | [
"Return",
"the",
"numeric",
"type",
"object",
"for",
"type"
] | def getType(type):
"""Return the numeric type object for type
type may be the name of a type object or the actual object
"""
if isinstance(type, NumericType):
return type
try:
return typeDict[type]
except KeyError:
raise TypeError("Not a numeric type") | [
"def",
"getType",
"(",
"type",
")",
":",
"if",
"isinstance",
"(",
"type",
",",
"NumericType",
")",
":",
"return",
"type",
"try",
":",
"return",
"typeDict",
"[",
"type",
"]",
"except",
"KeyError",
":",
"raise",
"TypeError",
"(",
"\"Not a numeric type\"",
")... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/numarray/numerictypes.py#L501-L511 | ||
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/crnn/util.py | python | strLabelConverter.encode | (self, text, depth=0) | return (torch.IntTensor(text), torch.IntTensor(length)) | Support batch or single str. | Support batch or single str. | [
"Support",
"batch",
"or",
"single",
"str",
"."
] | def encode(self, text, depth=0):
"""Support batch or single str."""
length = []
result=[]
for str in text:
str = unicode(str,"utf8")
length.append(len(str))
for char in str:
#print(char)
index = self.dict[char]
... | [
"def",
"encode",
"(",
"self",
",",
"text",
",",
"depth",
"=",
"0",
")",
":",
"length",
"=",
"[",
"]",
"result",
"=",
"[",
"]",
"for",
"str",
"in",
"text",
":",
"str",
"=",
"unicode",
"(",
"str",
",",
"\"utf8\"",
")",
"length",
".",
"append",
"(... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/crnn/util.py#L17-L29 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/contrib/lc/launcher.py | python | run | (*args, **kwargs) | Run LBANN with LC-specific optimizations (deprecated).
This is deprecated. Use `lbann.contrib.launcher.run` instead. | Run LBANN with LC-specific optimizations (deprecated). | [
"Run",
"LBANN",
"with",
"LC",
"-",
"specific",
"optimizations",
"(",
"deprecated",
")",
"."
] | def run(*args, **kwargs):
"""Run LBANN with LC-specific optimizations (deprecated).
This is deprecated. Use `lbann.contrib.launcher.run` instead.
"""
import warnings
warnings.warn(
'Using deprecated function `lbann.contrib.lc.launcher.run`. '
'Use `lbann.contrib.launcher.run` inst... | [
"def",
"run",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"warnings",
"warnings",
".",
"warn",
"(",
"'Using deprecated function `lbann.contrib.lc.launcher.run`. '",
"'Use `lbann.contrib.launcher.run` instead.'",
")",
"from",
".",
".",
"launcher",
"i... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/contrib/lc/launcher.py#L6-L19 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/macostools.py | python | copytree | (src, dst, copydates=1) | Copy a complete file tree to a new destination | Copy a complete file tree to a new destination | [
"Copy",
"a",
"complete",
"file",
"tree",
"to",
"a",
"new",
"destination"
] | def copytree(src, dst, copydates=1):
"""Copy a complete file tree to a new destination"""
if os.path.isdir(src):
mkdirs(dst)
files = os.listdir(src)
for f in files:
copytree(os.path.join(src, f), os.path.join(dst, f), copydates)
else:
copy(src, dst, 1, copydates) | [
"def",
"copytree",
"(",
"src",
",",
"dst",
",",
"copydates",
"=",
"1",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"src",
")",
":",
"mkdirs",
"(",
"dst",
")",
"files",
"=",
"os",
".",
"listdir",
"(",
"src",
")",
"for",
"f",
"in",
"f... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/macostools.py#L130-L138 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Simulator.getJointForces | (self, link: "RobotModelLink") | return _robotsim.Simulator_getJointForces(self, link) | r"""
getJointForces(Simulator self, RobotModelLink link)
Returns the joint force and torque local to the link, as would be read by a
force-torque sensor mounted at the given link's origin.
Returns:
6 entries of the wrench (fx,fy,fz,mx,my,mz) | r"""
getJointForces(Simulator self, RobotModelLink link) | [
"r",
"getJointForces",
"(",
"Simulator",
"self",
"RobotModelLink",
"link",
")"
] | def getJointForces(self, link: "RobotModelLink") -> "void":
r"""
getJointForces(Simulator self, RobotModelLink link)
Returns the joint force and torque local to the link, as would be read by a
force-torque sensor mounted at the given link's origin.
Returns:
6 ... | [
"def",
"getJointForces",
"(",
"self",
",",
"link",
":",
"\"RobotModelLink\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"Simulator_getJointForces",
"(",
"self",
",",
"link",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8506-L8519 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | pyparsing_common.convertToDate | (fmt="%Y-%m-%d") | return cvt_fn | Helper to create a parse action for converting parsed date string to Python datetime.date
Params -
- fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``)
Example::
date_expr = pyparsing_common.iso8601_date.copy()
date_expr.setParseAction(pyparsing_... | Helper to create a parse action for converting parsed date string to Python datetime.date | [
"Helper",
"to",
"create",
"a",
"parse",
"action",
"for",
"converting",
"parsed",
"date",
"string",
"to",
"Python",
"datetime",
".",
"date"
] | def convertToDate(fmt="%Y-%m-%d"):
"""
Helper to create a parse action for converting parsed date string to Python datetime.date
Params -
- fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``)
Example::
date_expr = pyparsing_common.iso8601_date... | [
"def",
"convertToDate",
"(",
"fmt",
"=",
"\"%Y-%m-%d\"",
")",
":",
"def",
"cvt_fn",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"try",
":",
"return",
"datetime",
".",
"strptime",
"(",
"t",
"[",
"0",
"]",
",",
"fmt",
")",
".",
"date",
"(",
")",
"exc... | 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/pyparsing.py#L6605-L6627 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Tk.report_callback_exception | (self, exc, val, tb) | Report callback exception on sys.stderr.
Applications may want to override this internal function, and
should when sys.stderr is None. | Report callback exception on sys.stderr. | [
"Report",
"callback",
"exception",
"on",
"sys",
".",
"stderr",
"."
] | def report_callback_exception(self, exc, val, tb):
"""Report callback exception on sys.stderr.
Applications may want to override this internal function, and
should when sys.stderr is None."""
import traceback
print("Exception in Tkinter callback", file=sys.stderr)
sys.la... | [
"def",
"report_callback_exception",
"(",
"self",
",",
"exc",
",",
"val",
",",
"tb",
")",
":",
"import",
"traceback",
"print",
"(",
"\"Exception in Tkinter callback\"",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"sys",
".",
"last_type",
"=",
"exc",
"sys",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L2088-L2098 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/offline_debug/dbg_services.py | python | TensorData.shape | (self) | return self.instance.get_shape() | Function to receive TensorData shape.
Returns:
shape of TensorData instance (list).
Examples:
>>> from mindspore.ccsrc.debug.debugger.offline_debug import dbg_services
>>> tensor_data = dbg_services.TensorData(data_ptr=b'\xba\xd0\xba\xd0',
... ... | Function to receive TensorData shape. | [
"Function",
"to",
"receive",
"TensorData",
"shape",
"."
] | def shape(self):
"""
Function to receive TensorData shape.
Returns:
shape of TensorData instance (list).
Examples:
>>> from mindspore.ccsrc.debug.debugger.offline_debug import dbg_services
>>> tensor_data = dbg_services.TensorData(data_ptr=b'\xba\xd0... | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"self",
".",
"instance",
".",
"get_shape",
"(",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/offline_debug/dbg_services.py#L600-L615 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/json_format.py | python | _ConvertValueMessage | (value, message) | Convert a JSON representation into Value message. | Convert a JSON representation into Value message. | [
"Convert",
"a",
"JSON",
"representation",
"into",
"Value",
"message",
"."
] | def _ConvertValueMessage(value, message):
"""Convert a JSON representation into Value message."""
if isinstance(value, dict):
_ConvertStructMessage(value, message.struct_value)
elif isinstance(value, list):
_ConvertListValueMessage(value, message.list_value)
elif value is None:
message.null_value = ... | [
"def",
"_ConvertValueMessage",
"(",
"value",
",",
"message",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"_ConvertStructMessage",
"(",
"value",
",",
"message",
".",
"struct_value",
")",
"elif",
"isinstance",
"(",
"value",
",",
"list",
... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/json_format.py#L459-L474 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | CWriter.__WriteLine | (self, line, ends_with_eol) | Given a signle line, writes it to a file, splitting if it's > 80 chars | Given a signle line, writes it to a file, splitting if it's > 80 chars | [
"Given",
"a",
"signle",
"line",
"writes",
"it",
"to",
"a",
"file",
"splitting",
"if",
"it",
"s",
">",
"80",
"chars"
] | def __WriteLine(self, line, ends_with_eol):
"""Given a signle line, writes it to a file, splitting if it's > 80 chars"""
if len(line) >= 80:
i = self.__FindSplit(line)
if i > 0:
line1 = line[0:i + 1]
if line1[-1] == ' ':
line1 = line1[:-1]
lineend = ''
if li... | [
"def",
"__WriteLine",
"(",
"self",
",",
"line",
",",
"ends_with_eol",
")",
":",
"if",
"len",
"(",
"line",
")",
">=",
"80",
":",
"i",
"=",
"self",
".",
"__FindSplit",
"(",
"line",
")",
"if",
"i",
">",
"0",
":",
"line1",
"=",
"line",
"[",
"0",
":... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L1775-L1804 | ||
ycm-core/ycmd | fc0fb7e5e15176cc5a2a30c80956335988c6b59a | ycmd/completers/cpp/clang_completer.py | python | GetIncompleteIncludeValue | ( line ) | return ( line[ include_start : separator_char_pos + 1 ],
quoted_include,
separator_char_pos + 2 ) | Returns the tuple |include_value|, |quoted_include|, and |start_codepoint|
where:
- |include_value| is the string starting from the opening quote or bracket of
the include statement in |line|. None if no include statement is found;
- |quoted_include| is True if the statement is a quoted include, False
oth... | Returns the tuple |include_value|, |quoted_include|, and |start_codepoint|
where:
- |include_value| is the string starting from the opening quote or bracket of
the include statement in |line|. None if no include statement is found;
- |quoted_include| is True if the statement is a quoted include, False
oth... | [
"Returns",
"the",
"tuple",
"|include_value|",
"|quoted_include|",
"and",
"|start_codepoint|",
"where",
":",
"-",
"|include_value|",
"is",
"the",
"string",
"starting",
"from",
"the",
"opening",
"quote",
"or",
"bracket",
"of",
"the",
"include",
"statement",
"in",
"|... | def GetIncompleteIncludeValue( line ):
"""Returns the tuple |include_value|, |quoted_include|, and |start_codepoint|
where:
- |include_value| is the string starting from the opening quote or bracket of
the include statement in |line|. None if no include statement is found;
- |quoted_include| is True if the ... | [
"def",
"GetIncompleteIncludeValue",
"(",
"line",
")",
":",
"match",
"=",
"INCLUDE_REGEX",
".",
"match",
"(",
"line",
")",
"if",
"not",
"match",
":",
"return",
"None",
",",
"False",
",",
"None",
"include_start",
"=",
"match",
".",
"end",
"(",
"1",
")",
... | https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/cpp/clang_completer.py#L590-L612 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy/multiarray.py | python | bitwise_left_shift | (x1, x2, out=None) | return _mx_nd_np.bitwise_left_shift(x1, x2, out) | r"""
Shift the bits of and integer to the left. Bits are shifted to the left by
appending x2 0s at the right of x1. Since the internal representation of numbers
is in binary format, this operation is equivalent to ``x1 * 2**x2``
Parameters
----------
x1 : ndarray or scalar
Input values.... | r"""
Shift the bits of and integer to the left. Bits are shifted to the left by
appending x2 0s at the right of x1. Since the internal representation of numbers
is in binary format, this operation is equivalent to ``x1 * 2**x2`` | [
"r",
"Shift",
"the",
"bits",
"of",
"and",
"integer",
"to",
"the",
"left",
".",
"Bits",
"are",
"shifted",
"to",
"the",
"left",
"by",
"appending",
"x2",
"0s",
"at",
"the",
"right",
"of",
"x1",
".",
"Since",
"the",
"internal",
"representation",
"of",
"num... | def bitwise_left_shift(x1, x2, out=None):
r"""
Shift the bits of and integer to the left. Bits are shifted to the left by
appending x2 0s at the right of x1. Since the internal representation of numbers
is in binary format, this operation is equivalent to ``x1 * 2**x2``
Parameters
----------
... | [
"def",
"bitwise_left_shift",
"(",
"x1",
",",
"x2",
",",
"out",
"=",
"None",
")",
":",
"return",
"_mx_nd_np",
".",
"bitwise_left_shift",
"(",
"x1",
",",
"x2",
",",
"out",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L13229-L13260 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/utilities/proof_analysis.py | python | _thm_string | (thm: proof_assistant_pb2.Theorem) | return '|:|'.join([str(hyp) for hyp in thm.hypotheses] +
[str(thm.conclusion)]) | Turn theorem into a string for unique representation.
Args:
thm: Theorem to be turned into a string.
Returns:
string: Joined hypotheses and conclusion. | Turn theorem into a string for unique representation. | [
"Turn",
"theorem",
"into",
"a",
"string",
"for",
"unique",
"representation",
"."
] | def _thm_string(thm: proof_assistant_pb2.Theorem) -> Text:
"""Turn theorem into a string for unique representation.
Args:
thm: Theorem to be turned into a string.
Returns:
string: Joined hypotheses and conclusion.
"""
return '|:|'.join([str(hyp) for hyp in thm.hypotheses] +
[str(... | [
"def",
"_thm_string",
"(",
"thm",
":",
"proof_assistant_pb2",
".",
"Theorem",
")",
"->",
"Text",
":",
"return",
"'|:|'",
".",
"join",
"(",
"[",
"str",
"(",
"hyp",
")",
"for",
"hyp",
"in",
"thm",
".",
"hypotheses",
"]",
"+",
"[",
"str",
"(",
"thm",
... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/utilities/proof_analysis.py#L24-L34 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/jit/_passes/_property_propagation.py | python | apply_input_props_using_example | (graph: Graph, example_input: List[Any]) | Applies properties for each tensor in the graph inputs
using the example supplied. | Applies properties for each tensor in the graph inputs
using the example supplied. | [
"Applies",
"properties",
"for",
"each",
"tensor",
"in",
"the",
"graph",
"inputs",
"using",
"the",
"example",
"supplied",
"."
] | def apply_input_props_using_example(graph: Graph, example_input: List[Any]):
"""
Applies properties for each tensor in the graph inputs
using the example supplied.
"""
graph_inputs = list(graph.inputs())
if len(graph_inputs) == 0:
return
# Strip self args off for methods
in_0 = ... | [
"def",
"apply_input_props_using_example",
"(",
"graph",
":",
"Graph",
",",
"example_input",
":",
"List",
"[",
"Any",
"]",
")",
":",
"graph_inputs",
"=",
"list",
"(",
"graph",
".",
"inputs",
"(",
")",
")",
"if",
"len",
"(",
"graph_inputs",
")",
"==",
"0",... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/jit/_passes/_property_propagation.py#L15-L41 | ||
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/pydot.py | python | Graph.get_subgraph_list | (self) | return sgraph_objs | Get the list of Subgraph instances.
This method returns the list of Subgraph instances
in the graph. | Get the list of Subgraph instances.
This method returns the list of Subgraph instances
in the graph. | [
"Get",
"the",
"list",
"of",
"Subgraph",
"instances",
".",
"This",
"method",
"returns",
"the",
"list",
"of",
"Subgraph",
"instances",
"in",
"the",
"graph",
"."
] | def get_subgraph_list(self):
"""Get the list of Subgraph instances.
This method returns the list of Subgraph instances
in the graph.
"""
sgraph_objs = list()
for sgraph, obj_dict_list in self.obj_dict['subgraphs'].items():
sgraph_objs.extend([ S... | [
"def",
"get_subgraph_list",
"(",
"self",
")",
":",
"sgraph_objs",
"=",
"list",
"(",
")",
"for",
"sgraph",
",",
"obj_dict_list",
"in",
"self",
".",
"obj_dict",
"[",
"'subgraphs'",
"]",
".",
"items",
"(",
")",
":",
"sgraph_objs",
".",
"extend",
"(",
"[",
... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/pydot.py#L1531-L1543 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py | python | _parse_config_to_function | (config, custom_objects, func_attr_name,
func_type_attr_name, module_attr_name) | return function | Reconstruct the function from the config. | Reconstruct the function from the config. | [
"Reconstruct",
"the",
"function",
"from",
"the",
"config",
"."
] | def _parse_config_to_function(config, custom_objects, func_attr_name,
func_type_attr_name, module_attr_name):
"""Reconstruct the function from the config."""
globs = globals()
module = config.pop(module_attr_name, None)
if module in sys.modules:
globs.update(sys.modules[module]... | [
"def",
"_parse_config_to_function",
"(",
"config",
",",
"custom_objects",
",",
"func_attr_name",
",",
"func_type_attr_name",
",",
"module_attr_name",
")",
":",
"globs",
"=",
"globals",
"(",
")",
"module",
"=",
"config",
".",
"pop",
"(",
"module_attr_name",
",",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py#L464-L490 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Crf.py | python | Crf.free_terms | (self) | return self._internal.get_free_terms() | Gets the hidden layer free terms. The blob size is class_count. | Gets the hidden layer free terms. The blob size is class_count. | [
"Gets",
"the",
"hidden",
"layer",
"free",
"terms",
".",
"The",
"blob",
"size",
"is",
"class_count",
"."
] | def free_terms(self):
"""Gets the hidden layer free terms. The blob size is class_count.
"""
return self._internal.get_free_terms() | [
"def",
"free_terms",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_free_terms",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Crf.py#L177-L180 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | Process.Redirect | (*args, **kwargs) | return _misc_.Process_Redirect(*args, **kwargs) | Redirect(self) | Redirect(self) | [
"Redirect",
"(",
"self",
")"
] | def Redirect(*args, **kwargs):
"""Redirect(self)"""
return _misc_.Process_Redirect(*args, **kwargs) | [
"def",
"Redirect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Process_Redirect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2007-L2009 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/subrobot.py | python | SubRobotModel.sensor | (self,index) | Returns the SimSensorModel corresponding to index. Note however that
you can't set the "link" setting according to this SubRobotModel.
Args:
index (int or str) | Returns the SimSensorModel corresponding to index. Note however that
you can't set the "link" setting according to this SubRobotModel. | [
"Returns",
"the",
"SimSensorModel",
"corresponding",
"to",
"index",
".",
"Note",
"however",
"that",
"you",
"can",
"t",
"set",
"the",
"link",
"setting",
"according",
"to",
"this",
"SubRobotModel",
"."
] | def sensor(self,index):
"""Returns the SimSensorModel corresponding to index. Note however that
you can't set the "link" setting according to this SubRobotModel.
Args:
index (int or str)
"""
if isinstance(index,str):
return self._robot.sensor(index)
... | [
"def",
"sensor",
"(",
"self",
",",
"index",
")",
":",
"if",
"isinstance",
"(",
"index",
",",
"str",
")",
":",
"return",
"self",
".",
"_robot",
".",
"sensor",
"(",
"index",
")",
"else",
":",
"return",
"self",
".",
"_robot",
".",
"sensor",
"(",
"self... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/subrobot.py#L364-L374 | ||
facebookincubator/katran | 192eb988c398afc673620254097defb7035d669e | build/fbcode_builder/shell_quoting.py | python | ShellQuoted.format | (self, **kwargs) | return ShellQuoted(
self.do_not_use_raw_str.format(
**dict(
(k, shell_quote(v).do_not_use_raw_str) for k, v in kwargs.items()
)
)
) | Use instead of str.format() when the arguments are either
`ShellQuoted()` or raw strings needing to be `shell_quote()`d.
Positional args are deliberately not supported since they are more
error-prone. | [] | def format(self, **kwargs):
"""
Use instead of str.format() when the arguments are either
`ShellQuoted()` or raw strings needing to be `shell_quote()`d.
Positional args are deliberately not supported since they are more
error-prone.
"""
return ShellQuoted(
... | [
"def",
"format",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"ShellQuoted",
"(",
"self",
".",
"do_not_use_raw_str",
".",
"format",
"(",
"*",
"*",
"dict",
"(",
"(",
"k",
",",
"shell_quote",
"(",
"v",
")",
".",
"do_not_use_raw_str",
")",
... | https://github.com/facebookincubator/katran/blob/192eb988c398afc673620254097defb7035d669e/build/fbcode_builder/shell_quoting.py#L49-L65 | ||
alexgkendall/caffe-posenet | 62aafbd7c45df91acdba14f5d1406d8295c2bc6f | examples/finetune_flickr_style/assemble_data.py | python | download_image | (args_tuple) | For use with multiprocessing map. Returns filename on fail. | For use with multiprocessing map. Returns filename on fail. | [
"For",
"use",
"with",
"multiprocessing",
"map",
".",
"Returns",
"filename",
"on",
"fail",
"."
] | def download_image(args_tuple):
"For use with multiprocessing map. Returns filename on fail."
try:
url, filename = args_tuple
if not os.path.exists(filename):
urllib.urlretrieve(url, filename)
with open(filename) as f:
assert hashlib.sha1(f.read()).hexdigest() != ... | [
"def",
"download_image",
"(",
"args_tuple",
")",
":",
"try",
":",
"url",
",",
"filename",
"=",
"args_tuple",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"urllib",
".",
"urlretrieve",
"(",
"url",
",",
"filename",
")",
"with... | https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/examples/finetune_flickr_style/assemble_data.py#L23-L36 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags_validators.py | python | SimpleValidator.__init__ | (self, flag_name, checker, message) | Constructor.
Args:
flag_name: string, name of the flag.
checker: function to verify the validator.
input - value of the corresponding flag (string, boolean, etc).
output - Boolean. Must return True if validator constraint is satisfied.
If constraint is not satisfied, it shoul... | Constructor. | [
"Constructor",
"."
] | def __init__(self, flag_name, checker, message):
"""Constructor.
Args:
flag_name: string, name of the flag.
checker: function to verify the validator.
input - value of the corresponding flag (string, boolean, etc).
output - Boolean. Must return True if validator constraint is satis... | [
"def",
"__init__",
"(",
"self",
",",
"flag_name",
",",
"checker",
",",
"message",
")",
":",
"super",
"(",
"SimpleValidator",
",",
"self",
")",
".",
"__init__",
"(",
"checker",
",",
"message",
")",
"self",
".",
"flag_name",
"=",
"flag_name"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags_validators.py#L111-L125 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/GardenSnake/GardenSnake.py | python | t_WS | (t) | r' [ ]+ | r' [ ]+ | [
"r",
"[",
"]",
"+"
] | def t_WS(t):
r' [ ]+ '
if t.lexer.at_line_start and t.lexer.paren_count == 0:
return t | [
"def",
"t_WS",
"(",
"t",
")",
":",
"if",
"t",
".",
"lexer",
".",
"at_line_start",
"and",
"t",
".",
"lexer",
".",
"paren_count",
"==",
"0",
":",
"return",
"t"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/GardenSnake/GardenSnake.py#L120-L123 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py | python | FitFunctionOptionsView.update_function_browser_parameters | (self, is_simultaneous_fit: bool, fit_function: IFunction,
global_parameters: list = []) | Updates the parameters in the function browser. | Updates the parameters in the function browser. | [
"Updates",
"the",
"parameters",
"in",
"the",
"function",
"browser",
"."
] | def update_function_browser_parameters(self, is_simultaneous_fit: bool, fit_function: IFunction,
global_parameters: list = []) -> None:
"""Updates the parameters in the function browser."""
self.function_browser.blockSignals(True)
if fit_function is No... | [
"def",
"update_function_browser_parameters",
"(",
"self",
",",
"is_simultaneous_fit",
":",
"bool",
",",
"fit_function",
":",
"IFunction",
",",
"global_parameters",
":",
"list",
"=",
"[",
"]",
")",
"->",
"None",
":",
"self",
".",
"function_browser",
".",
"blockSi... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py#L187-L201 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PrintPreview.DetermineScaling | (*args, **kwargs) | return _windows_.PrintPreview_DetermineScaling(*args, **kwargs) | DetermineScaling(self) | DetermineScaling(self) | [
"DetermineScaling",
"(",
"self",
")"
] | def DetermineScaling(*args, **kwargs):
"""DetermineScaling(self)"""
return _windows_.PrintPreview_DetermineScaling(*args, **kwargs) | [
"def",
"DetermineScaling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintPreview_DetermineScaling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5654-L5656 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topicobj.py | python | Topic.hasListener | (self, listener) | return listener in self.__listeners | Return true if listener is subscribed to this topic. | Return true if listener is subscribed to this topic. | [
"Return",
"true",
"if",
"listener",
"is",
"subscribed",
"to",
"this",
"topic",
"."
] | def hasListener(self, listener):
"""Return true if listener is subscribed to this topic."""
return listener in self.__listeners | [
"def",
"hasListener",
"(",
"self",
",",
"listener",
")",
":",
"return",
"listener",
"in",
"self",
".",
"__listeners"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicobj.py#L253-L255 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TreeCtrl.Collapse | (*args, **kwargs) | return _controls_.TreeCtrl_Collapse(*args, **kwargs) | Collapse(self, TreeItemId item) | Collapse(self, TreeItemId item) | [
"Collapse",
"(",
"self",
"TreeItemId",
"item",
")"
] | def Collapse(*args, **kwargs):
"""Collapse(self, TreeItemId item)"""
return _controls_.TreeCtrl_Collapse(*args, **kwargs) | [
"def",
"Collapse",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_Collapse",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5475-L5477 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | 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/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/bindings/python/clang/cindex.py#L1380-L1391 | |
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | libs/EXTERNAL/libcatch2/tools/scripts/updateDocumentToC.py | python | createToc | (headlines, hyperlink=True, top_link=False, no_toc_header=False) | return processed | Creates the table of contents from the headline list
that was returned by the tagAndCollect function.
Keyword Arguments:
headlines: list of lists
e.g., ['Some header lvl3', 'some-header-lvl3', 3]
hyperlink: Creates hyperlinks in Markdown format if True,
e.g., '- [Some he... | Creates the table of contents from the headline list
that was returned by the tagAndCollect function. | [
"Creates",
"the",
"table",
"of",
"contents",
"from",
"the",
"headline",
"list",
"that",
"was",
"returned",
"by",
"the",
"tagAndCollect",
"function",
"."
] | def createToc(headlines, hyperlink=True, top_link=False, no_toc_header=False):
"""
Creates the table of contents from the headline list
that was returned by the tagAndCollect function.
Keyword Arguments:
headlines: list of lists
e.g., ['Some header lvl3', 'some-header-lvl3', 3]
... | [
"def",
"createToc",
"(",
"headlines",
",",
"hyperlink",
"=",
"True",
",",
"top_link",
"=",
"False",
",",
"no_toc_header",
"=",
"False",
")",
":",
"processed",
"=",
"[",
"]",
"if",
"not",
"no_toc_header",
":",
"if",
"top_link",
":",
"processed",
".",
"app... | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/libs/EXTERNAL/libcatch2/tools/scripts/updateDocumentToC.py#L193-L225 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/instrument.py | python | Instrument.funding_premium_symbol | (self, funding_premium_symbol) | Sets the funding_premium_symbol of this Instrument.
:param funding_premium_symbol: The funding_premium_symbol of this Instrument. # noqa: E501
:type: str | Sets the funding_premium_symbol of this Instrument. | [
"Sets",
"the",
"funding_premium_symbol",
"of",
"this",
"Instrument",
"."
] | def funding_premium_symbol(self, funding_premium_symbol):
"""Sets the funding_premium_symbol of this Instrument.
:param funding_premium_symbol: The funding_premium_symbol of this Instrument. # noqa: E501
:type: str
"""
self._funding_premium_symbol = funding_premium_symbol | [
"def",
"funding_premium_symbol",
"(",
"self",
",",
"funding_premium_symbol",
")",
":",
"self",
".",
"_funding_premium_symbol",
"=",
"funding_premium_symbol"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L1622-L1630 | ||
h0x91b/redis-v8 | ac8b9d49701d75bcee3719892a2a6a50b437e47a | redis/deps/v8/tools/grokdump.py | python | InspectionPadawan.FindMap | (self, tagged_address) | When used as a mixin in place of V8Heap. | When used as a mixin in place of V8Heap. | [
"When",
"used",
"as",
"a",
"mixin",
"in",
"place",
"of",
"V8Heap",
"."
] | def FindMap(self, tagged_address):
"""When used as a mixin in place of V8Heap."""
raise NotImplementedError | [
"def",
"FindMap",
"(",
"self",
",",
"tagged_address",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/h0x91b/redis-v8/blob/ac8b9d49701d75bcee3719892a2a6a50b437e47a/redis/deps/v8/tools/grokdump.py#L1631-L1633 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Decimal._islogical | (self) | return True | Return True if self is a logical operand.
For being logical, it must be a finite number with a sign of 0,
an exponent of 0, and a coefficient whose digits must all be
either 0 or 1. | Return True if self is a logical operand. | [
"Return",
"True",
"if",
"self",
"is",
"a",
"logical",
"operand",
"."
] | def _islogical(self):
"""Return True if self is a logical operand.
For being logical, it must be a finite number with a sign of 0,
an exponent of 0, and a coefficient whose digits must all be
either 0 or 1.
"""
if self._sign != 0 or self._exp != 0:
return Fal... | [
"def",
"_islogical",
"(",
"self",
")",
":",
"if",
"self",
".",
"_sign",
"!=",
"0",
"or",
"self",
".",
"_exp",
"!=",
"0",
":",
"return",
"False",
"for",
"dig",
"in",
"self",
".",
"_int",
":",
"if",
"dig",
"not",
"in",
"'01'",
":",
"return",
"False... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L3353-L3365 | |
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/swift_build_support/swift_build_support/products/tsan_libdispatch.py | python | TSanLibDispatch.build | (self, host_target) | Build TSan runtime (compiler-rt). | Build TSan runtime (compiler-rt). | [
"Build",
"TSan",
"runtime",
"(",
"compiler",
"-",
"rt",
")",
"."
] | def build(self, host_target):
"""Build TSan runtime (compiler-rt)."""
rt_source_dir = join_path(
self.source_dir, os.pardir,
'llvm-project', 'compiler-rt')
toolchain_path = join_path(self.args.install_destdir, 'usr')
clang = join_path(toolchain_path, 'bin', 'clang... | [
"def",
"build",
"(",
"self",
",",
"host_target",
")",
":",
"rt_source_dir",
"=",
"join_path",
"(",
"self",
".",
"source_dir",
",",
"os",
".",
"pardir",
",",
"'llvm-project'",
",",
"'compiler-rt'",
")",
"toolchain_path",
"=",
"join_path",
"(",
"self",
".",
... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/swift_build_support/swift_build_support/products/tsan_libdispatch.py#L49-L79 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsFont.__init__ | (self, *args, **kwargs) | __init__(self) -> GraphicsFont
A `wx.GraphicsFont` is a native representation of a font (including
text colour). The contents are specific an private to the respective
renderer. The only way to get a valid instance is via a CreateFont
call on the graphics context or the renderer instan... | __init__(self) -> GraphicsFont | [
"__init__",
"(",
"self",
")",
"-",
">",
"GraphicsFont"
] | def __init__(self, *args, **kwargs):
"""
__init__(self) -> GraphicsFont
A `wx.GraphicsFont` is a native representation of a font (including
text colour). The contents are specific an private to the respective
renderer. The only way to get a valid instance is via a CreateFont
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gdi_",
".",
"GraphicsFont_swiginit",
"(",
"self",
",",
"_gdi_",
".",
"new_GraphicsFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5569-L5578 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | v8_7_5/tools/stats-viewer.py | python | Main | (data_file, name_filter) | Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names. | Run the stats counter. | [
"Run",
"the",
"stats",
"counter",
"."
] | def Main(data_file, name_filter):
"""Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names.
"""
StatsViewer(data_file, name_filter).Run() | [
"def",
"Main",
"(",
"data_file",
",",
"name_filter",
")",
":",
"StatsViewer",
"(",
"data_file",
",",
"name_filter",
")",
".",
"Run",
"(",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_7_5/tools/stats-viewer.py#L454-L461 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchSite.py | python | _Site.execute | (self,obj) | Method run when the object is recomputed.
If the site has no Shape or Terrain property assigned, do nothing.
Perform additions and subtractions on terrain, and assign to the site's
Shape. | Method run when the object is recomputed. | [
"Method",
"run",
"when",
"the",
"object",
"is",
"recomputed",
"."
] | def execute(self,obj):
"""Method run when the object is recomputed.
If the site has no Shape or Terrain property assigned, do nothing.
Perform additions and subtractions on terrain, and assign to the site's
Shape.
"""
if not hasattr(obj,'Shape'): # old-style Site
... | [
"def",
"execute",
"(",
"self",
",",
"obj",
")",
":",
"if",
"not",
"hasattr",
"(",
"obj",
",",
"'Shape'",
")",
":",
"# old-style Site",
"return",
"pl",
"=",
"obj",
".",
"Placement",
"shape",
"=",
"None",
"if",
"obj",
".",
"Terrain",
":",
"if",
"hasatt... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchSite.py#L649-L696 | ||
OkCupid/okws | 1c337392c676ccb4e9a4c92d11d5d2fada6427d2 | contrib/pub3-upgrade.py | python | Pub1Parser.p_env | (self, p) | env : DLBRACE blocks DRBRACE | env : DLBRACE blocks DRBRACE | [
"env",
":",
"DLBRACE",
"blocks",
"DRBRACE"
] | def p_env (self, p):
'''env : DLBRACE blocks DRBRACE'''
p[0] = NestedHtml (HtmlBlock (p[2])) | [
"def",
"p_env",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"NestedHtml",
"(",
"HtmlBlock",
"(",
"p",
"[",
"2",
"]",
")",
")"
] | https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/contrib/pub3-upgrade.py#L1035-L1037 | ||
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | vtr_flow/scripts/benchtracker/interface_db.py | python | connect_db | (dbname="results.db") | return db | Attempt a database connection, exiting with 1 if dbname does not exist, else return with db connection | Attempt a database connection, exiting with 1 if dbname does not exist, else return with db connection | [
"Attempt",
"a",
"database",
"connection",
"exiting",
"with",
"1",
"if",
"dbname",
"does",
"not",
"exist",
"else",
"return",
"with",
"db",
"connection"
] | def connect_db(dbname="results.db"):
"""Attempt a database connection, exiting with 1 if dbname does not exist, else return with db connection"""
if not os.path.isfile(dbname):
print("{} does not exist".format(dbname))
raise IOError(dbname)
db = sqlite3.connect(dbname)
db.row_factory = s... | [
"def",
"connect_db",
"(",
"dbname",
"=",
"\"results.db\"",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"dbname",
")",
":",
"print",
"(",
"\"{} does not exist\"",
".",
"format",
"(",
"dbname",
")",
")",
"raise",
"IOError",
"(",
"dbname",... | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/benchtracker/interface_db.py#L190-L197 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | TextEntryBase.CanUndo | (*args, **kwargs) | return _core_.TextEntryBase_CanUndo(*args, **kwargs) | CanUndo(self) -> bool
Returns True if the text field is editable and the last edit can be
undone. | CanUndo(self) -> bool | [
"CanUndo",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanUndo(*args, **kwargs):
"""
CanUndo(self) -> bool
Returns True if the text field is editable and the last edit can be
undone.
"""
return _core_.TextEntryBase_CanUndo(*args, **kwargs) | [
"def",
"CanUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextEntryBase_CanUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L13227-L13234 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/shape_base.py | python | atleast_3d | (*arys) | View inputs as arrays with at least three dimensions.
Parameters
----------
arys1, arys2, ... : array_like
One or more array-like sequences. Non-array inputs are converted to
arrays. Arrays that already have three or more dimensions are
preserved.
Returns
-------
res1... | View inputs as arrays with at least three dimensions. | [
"View",
"inputs",
"as",
"arrays",
"with",
"at",
"least",
"three",
"dimensions",
"."
] | def atleast_3d(*arys):
"""
View inputs as arrays with at least three dimensions.
Parameters
----------
arys1, arys2, ... : array_like
One or more array-like sequences. Non-array inputs are converted to
arrays. Arrays that already have three or more dimensions are
preserved... | [
"def",
"atleast_3d",
"(",
"*",
"arys",
")",
":",
"res",
"=",
"[",
"]",
"for",
"ary",
"in",
"arys",
":",
"ary",
"=",
"asanyarray",
"(",
"ary",
")",
"if",
"len",
"(",
"ary",
".",
"shape",
")",
"==",
"0",
":",
"result",
"=",
"ary",
".",
"reshape",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/shape_base.py#L112-L176 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/tensor_shape.py | python | TensorShape.__getitem__ | (self, key) | Returns the value of a dimension or a shape, depending on the key.
Args:
key: If `key` is an integer, returns the dimension at that index;
otherwise if `key` is a slice, returns a TensorShape whose
dimensions are those selected by the slice from `self`.
Returns:
A dimension if `key... | Returns the value of a dimension or a shape, depending on the key. | [
"Returns",
"the",
"value",
"of",
"a",
"dimension",
"or",
"a",
"shape",
"depending",
"on",
"the",
"key",
"."
] | def __getitem__(self, key):
"""Returns the value of a dimension or a shape, depending on the key.
Args:
key: If `key` is an integer, returns the dimension at that index;
otherwise if `key` is a slice, returns a TensorShape whose
dimensions are those selected by the slice from `self`.
... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"_dims",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"key",
",",
"slice",
")",
":",
"return",
"TensorShape",
"(",
"self",
".",
"_dims",
"[",
"key",
"]",
")",
"else",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/tensor_shape.py#L501-L543 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/functions/GuinierPorod.py | python | GuinierPorod._boundary_conditions | (self, dummy_qval) | return False | Check boundary constraints and return True if we
are out of bounds.
@param dummy_qval: q-value to evaluate at | Check boundary constraints and return True if we
are out of bounds. | [
"Check",
"boundary",
"constraints",
"and",
"return",
"True",
"if",
"we",
"are",
"out",
"of",
"bounds",
"."
] | def _boundary_conditions(self, dummy_qval):
"""
Check boundary constraints and return True if we
are out of bounds.
@param dummy_qval: q-value to evaluate at
"""
s = self.getParameterValue('Dimension')
Rg = self.getParameterValue('Rg')
m = self... | [
"def",
"_boundary_conditions",
"(",
"self",
",",
"dummy_qval",
")",
":",
"s",
"=",
"self",
".",
"getParameterValue",
"(",
"'Dimension'",
")",
"Rg",
"=",
"self",
".",
"getParameterValue",
"(",
"'Rg'",
")",
"m",
"=",
"self",
".",
"getParameterValue",
"(",
"'... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/functions/GuinierPorod.py#L35-L50 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py | python | Random.sample | (self, population, k) | return result | Chooses k unique random elements from a population sequence or set.
Returns a new list containing elements from the population while
leaving the original population unchanged. The resulting list is
in selection order so that all sub-slices will also be valid random
samples. This allow... | Chooses k unique random elements from a population sequence or set. | [
"Chooses",
"k",
"unique",
"random",
"elements",
"from",
"a",
"population",
"sequence",
"or",
"set",
"."
] | def sample(self, population, k):
"""Chooses k unique random elements from a population sequence or set.
Returns a new list containing elements from the population while
leaving the original population unchanged. The resulting list is
in selection order so that all sub-slices will also ... | [
"def",
"sample",
"(",
"self",
",",
"population",
",",
"k",
")",
":",
"# Sampling without replacement entails tracking either potential",
"# selections (the pool) in a list or previous selections in a set.",
"# When the number of selections is small compared to the",
"# population, then tra... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/random.py#L286-L342 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | MaskedArray.tobytes | (self, fill_value=None, order='C') | return self.filled(fill_value).tobytes(order=order) | Return the array data as a string containing the raw bytes in the array.
The array is filled with a fill value before the string conversion.
.. versionadded:: 1.9.0
Parameters
----------
fill_value : scalar, optional
Value used to fill in the masked values. Default... | Return the array data as a string containing the raw bytes in the array. | [
"Return",
"the",
"array",
"data",
"as",
"a",
"string",
"containing",
"the",
"raw",
"bytes",
"in",
"the",
"array",
"."
] | def tobytes(self, fill_value=None, order='C'):
"""
Return the array data as a string containing the raw bytes in the array.
The array is filled with a fill value before the string conversion.
.. versionadded:: 1.9.0
Parameters
----------
fill_value : scalar, op... | [
"def",
"tobytes",
"(",
"self",
",",
"fill_value",
"=",
"None",
",",
"order",
"=",
"'C'",
")",
":",
"return",
"self",
".",
"filled",
"(",
"fill_value",
")",
".",
"tobytes",
"(",
"order",
"=",
"order",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L5981-L6019 | |
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | script/self_driving/model_server.py | python | ForecastModel.infer | (self, data: Dict) | return {0: result}, True, "" | Do inference on the model, give the data file, and the model_map_path
:param data: {
input_path: PATH_TO_TRACE, or None
input_sequence: Input sequence data, or None
model_path: model path
model_names: [LSTM...]
models_config: PATH_TO_JSON model config ... | Do inference on the model, give the data file, and the model_map_path
:param data: {
input_path: PATH_TO_TRACE, or None
input_sequence: Input sequence data, or None
model_path: model path
model_names: [LSTM...]
models_config: PATH_TO_JSON model config ... | [
"Do",
"inference",
"on",
"the",
"model",
"give",
"the",
"data",
"file",
"and",
"the",
"model_map_path",
":",
"param",
"data",
":",
"{",
"input_path",
":",
"PATH_TO_TRACE",
"or",
"None",
"input_sequence",
":",
"Input",
"sequence",
"data",
"or",
"None",
"model... | def infer(self, data: Dict) -> Tuple[Any, bool, str]:
"""
Do inference on the model, give the data file, and the model_map_path
:param data: {
input_path: PATH_TO_TRACE, or None
input_sequence: Input sequence data, or None
model_path: model path
mo... | [
"def",
"infer",
"(",
"self",
",",
"data",
":",
"Dict",
")",
"->",
"Tuple",
"[",
"Any",
",",
"bool",
",",
"str",
"]",
":",
"input_path",
"=",
"data",
"[",
"\"input_path\"",
"]",
"if",
"\"input_path\"",
"in",
"data",
"else",
"None",
"input_sequence",
"="... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/script/self_driving/model_server.py#L539-L594 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/saver.py | python | BaseSaverBuilder._AddSaveOps | (self, filename_tensor, saveables) | return control_flow_ops.with_dependencies([save], filename_tensor) | Add ops to save variables that are on the same shard.
Args:
filename_tensor: String Tensor.
saveables: A list of SaveableObject objects.
Returns:
A tensor with the filename used to save. | Add ops to save variables that are on the same shard. | [
"Add",
"ops",
"to",
"save",
"variables",
"that",
"are",
"on",
"the",
"same",
"shard",
"."
] | def _AddSaveOps(self, filename_tensor, saveables):
"""Add ops to save variables that are on the same shard.
Args:
filename_tensor: String Tensor.
saveables: A list of SaveableObject objects.
Returns:
A tensor with the filename used to save.
"""
save = self.save_op(filename_tensor... | [
"def",
"_AddSaveOps",
"(",
"self",
",",
"filename_tensor",
",",
"saveables",
")",
":",
"save",
"=",
"self",
".",
"save_op",
"(",
"filename_tensor",
",",
"saveables",
")",
"return",
"control_flow_ops",
".",
"with_dependencies",
"(",
"[",
"save",
"]",
",",
"fi... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/saver.py#L220-L231 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/graph_matcher.py | python | GraphMatcher._match_pattern | (self, pattern, op, tensor) | return True | Returns whether an TF expression rooted at `op` matches `pattern`.
If there is a match, adds to `self._match_result` the matching op and tensor
with key `pattern`.
Args:
pattern: An `Pattern`.
op: A `tf.Operation` to match against the pattern.
tensor: the output `tf.Tensor` of `op` that ... | Returns whether an TF expression rooted at `op` matches `pattern`. | [
"Returns",
"whether",
"an",
"TF",
"expression",
"rooted",
"at",
"op",
"matches",
"pattern",
"."
] | def _match_pattern(self, pattern, op, tensor):
"""Returns whether an TF expression rooted at `op` matches `pattern`.
If there is a match, adds to `self._match_result` the matching op and tensor
with key `pattern`.
Args:
pattern: An `Pattern`.
op: A `tf.Operation` to match against the patte... | [
"def",
"_match_pattern",
"(",
"self",
",",
"pattern",
",",
"op",
",",
"tensor",
")",
":",
"match_result",
"=",
"pattern",
".",
"match",
"(",
"op",
",",
"tensor",
")",
"if",
"match_result",
"is",
"None",
":",
"return",
"False",
"self",
".",
"_match_result... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/quantize/python/graph_matcher.py#L213-L233 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/conv2d_benchmark.py | python | build_graph | (device, dtype, data_format, input_shape, filter_shape, strides,
padding, num_iters, warmup_iters) | builds a graph containing a sequence of conv2d operations.
Args:
device: String, the device to run on.
dtype: Data type for the convolution.
data_format: A string from: "NHWC" or "NCHW". Data format for input and
output data.
input_shape: Shape of the input tensor.
filter_shape: ... | builds a graph containing a sequence of conv2d operations. | [
"builds",
"a",
"graph",
"containing",
"a",
"sequence",
"of",
"conv2d",
"operations",
"."
] | def build_graph(device, dtype, data_format, input_shape, filter_shape, strides,
padding, num_iters, warmup_iters):
"""builds a graph containing a sequence of conv2d operations.
Args:
device: String, the device to run on.
dtype: Data type for the convolution.
data_format: A string from: ... | [
"def",
"build_graph",
"(",
"device",
",",
"dtype",
",",
"data_format",
",",
"input_shape",
",",
"filter_shape",
",",
"strides",
",",
"padding",
",",
"num_iters",
",",
"warmup_iters",
")",
":",
"with",
"ops",
".",
"device",
"(",
"\"/%s:0\"",
"%",
"device",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/conv2d_benchmark.py#L40-L87 | ||
danmar/cppcheck | 78228599da0dfce3763a90a130b14fa2d614ab9f | addons/misra.py | python | MisraChecker.isRuleSuppressed | (self, file_path, linenr, ruleNum) | return ruleIsSuppressed | Check to see if a rule is suppressed.
:param ruleNum: is the rule number in hundreds format
:param file_path: File path of checked location
:param linenr: Line number of checked location
If the rule exists in the dict then check for a filename
If the filename is None then rule ... | Check to see if a rule is suppressed. | [
"Check",
"to",
"see",
"if",
"a",
"rule",
"is",
"suppressed",
"."
] | def isRuleSuppressed(self, file_path, linenr, ruleNum):
"""
Check to see if a rule is suppressed.
:param ruleNum: is the rule number in hundreds format
:param file_path: File path of checked location
:param linenr: Line number of checked location
If the rule exists in t... | [
"def",
"isRuleSuppressed",
"(",
"self",
",",
"file_path",
",",
"linenr",
",",
"ruleNum",
")",
":",
"ruleIsSuppressed",
"=",
"False",
"# Remove any prefix listed in command arguments from the filename.",
"filename",
"=",
"None",
"if",
"file_path",
"is",
"not",
"None",
... | https://github.com/danmar/cppcheck/blob/78228599da0dfce3763a90a130b14fa2d614ab9f/addons/misra.py#L3916-L3973 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.GetGridLineColour | (*args, **kwargs) | return _grid.Grid_GetGridLineColour(*args, **kwargs) | GetGridLineColour(self) -> Colour | GetGridLineColour(self) -> Colour | [
"GetGridLineColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetGridLineColour(*args, **kwargs):
"""GetGridLineColour(self) -> Colour"""
return _grid.Grid_GetGridLineColour(*args, **kwargs) | [
"def",
"GetGridLineColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetGridLineColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1694-L1696 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/symsrc/pefile.py | python | Structure.all_zeroes | (self) | return self._all_zeroes | Returns true is the unpacked data is all zeroes. | Returns true is the unpacked data is all zeroes. | [
"Returns",
"true",
"is",
"the",
"unpacked",
"data",
"is",
"all",
"zeroes",
"."
] | def all_zeroes(self):
"""Returns true is the unpacked data is all zeroes."""
return self._all_zeroes | [
"def",
"all_zeroes",
"(",
"self",
")",
":",
"return",
"self",
".",
"_all_zeroes"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/symsrc/pefile.py#L697-L700 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/datasets/base.py | python | load_csv_with_header | (filename,
target_dtype,
features_dtype,
target_column=-1) | return Dataset(data=data, target=target) | Load dataset from CSV file with a header row. | Load dataset from CSV file with a header row. | [
"Load",
"dataset",
"from",
"CSV",
"file",
"with",
"a",
"header",
"row",
"."
] | def load_csv_with_header(filename,
target_dtype,
features_dtype,
target_column=-1):
"""Load dataset from CSV file with a header row."""
with gfile.Open(filename) as csv_file:
data_file = csv.reader(csv_file)
header = next(data_file)
... | [
"def",
"load_csv_with_header",
"(",
"filename",
",",
"target_dtype",
",",
"features_dtype",
",",
"target_column",
"=",
"-",
"1",
")",
":",
"with",
"gfile",
".",
"Open",
"(",
"filename",
")",
"as",
"csv_file",
":",
"data_file",
"=",
"csv",
".",
"reader",
"(... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/datasets/base.py#L46-L62 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/python/lite.py | python | TFLiteConverterBase._get_base_converter_args | (self) | return args | Returns the base converter args.
Returns:
{key str: val} | Returns the base converter args. | [
"Returns",
"the",
"base",
"converter",
"args",
"."
] | def _get_base_converter_args(self):
"""Returns the base converter args.
Returns:
{key str: val}
"""
args = {
"input_format":
constants.TENSORFLOW_GRAPHDEF,
"allow_custom_ops":
self.allow_custom_ops,
"debug_info":
self._debug_info,
... | [
"def",
"_get_base_converter_args",
"(",
"self",
")",
":",
"args",
"=",
"{",
"\"input_format\"",
":",
"constants",
".",
"TENSORFLOW_GRAPHDEF",
",",
"\"allow_custom_ops\"",
":",
"self",
".",
"allow_custom_ops",
",",
"\"debug_info\"",
":",
"self",
".",
"_debug_info",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/lite.py#L637-L680 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | Dataset.dense_to_sparse_batch | (self, batch_size, row_shape) | return self.apply(batching.dense_to_sparse_batch(batch_size, row_shape)) | Use: `Dataset.apply(tf.contrib.data.dense_to_sparse_batch(...))`. | Use: `Dataset.apply(tf.contrib.data.dense_to_sparse_batch(...))`. | [
"Use",
":",
"Dataset",
".",
"apply",
"(",
"tf",
".",
"contrib",
".",
"data",
".",
"dense_to_sparse_batch",
"(",
"...",
"))",
"."
] | def dense_to_sparse_batch(self, batch_size, row_shape):
"""Use: `Dataset.apply(tf.contrib.data.dense_to_sparse_batch(...))`."""
return self.apply(batching.dense_to_sparse_batch(batch_size, row_shape)) | [
"def",
"dense_to_sparse_batch",
"(",
"self",
",",
"batch_size",
",",
"row_shape",
")",
":",
"return",
"self",
".",
"apply",
"(",
"batching",
".",
"dense_to_sparse_batch",
"(",
"batch_size",
",",
"row_shape",
")",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/data/python/ops/dataset_ops.py#L461-L464 | |
qt/qtwebkit | ab1bd15209abaf7effc51dbc2f272c5681af7223 | Source/JavaScriptCore/disassembler/udis86/ud_opcode.py | python | UdOpcodeTables.mergeSSENONE | (self) | Merge sse tables with only one entry for /sse=none | Merge sse tables with only one entry for /sse=none | [
"Merge",
"sse",
"tables",
"with",
"only",
"one",
"entry",
"for",
"/",
"sse",
"=",
"none"
] | def mergeSSENONE(self):
"""Merge sse tables with only one entry for /sse=none
"""
for table in self._tables:
for k, e in table.entries():
if isinstance(e, UdOpcodeTable) and e.typ() == '/sse':
if e.numEntries() == 1:
sse = e... | [
"def",
"mergeSSENONE",
"(",
"self",
")",
":",
"for",
"table",
"in",
"self",
".",
"_tables",
":",
"for",
"k",
",",
"e",
"in",
"table",
".",
"entries",
"(",
")",
":",
"if",
"isinstance",
"(",
"e",
",",
"UdOpcodeTable",
")",
"and",
"e",
".",
"typ",
... | https://github.com/qt/qtwebkit/blob/ab1bd15209abaf7effc51dbc2f272c5681af7223/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py#L337-L356 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | bindings/pydrake/systems/planar_scenegraph_visualizer.py | python | PlanarSceneGraphVisualizer.draw | (self, context) | Overrides base with the implementation. | Overrides base with the implementation. | [
"Overrides",
"base",
"with",
"the",
"implementation",
"."
] | def draw(self, context):
"""Overrides base with the implementation."""
query_object = self._geometry_query_input_port.Eval(context)
inspector = query_object.inspector()
view_dir = np.cross(self._T_VW[0, :3], self._T_VW[1, :3])
for frame_id in inspector.GetAllFrameIds():
... | [
"def",
"draw",
"(",
"self",
",",
"context",
")",
":",
"query_object",
"=",
"self",
".",
"_geometry_query_input_port",
".",
"Eval",
"(",
"context",
")",
"inspector",
"=",
"query_object",
".",
"inspector",
"(",
")",
"view_dir",
"=",
"np",
".",
"cross",
"(",
... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/systems/planar_scenegraph_visualizer.py#L383-L404 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/utils.py | python | who | (vardict=None) | return | Print the NumPy arrays in the given dictionary.
If there is no dictionary passed in or `vardict` is None then returns
NumPy arrays in the globals() dictionary (all NumPy arrays in the
namespace).
Parameters
----------
vardict : dict, optional
A dictionary possibly containing ndarrays. ... | Print the NumPy arrays in the given dictionary. | [
"Print",
"the",
"NumPy",
"arrays",
"in",
"the",
"given",
"dictionary",
"."
] | def who(vardict=None):
"""
Print the NumPy arrays in the given dictionary.
If there is no dictionary passed in or `vardict` is None then returns
NumPy arrays in the globals() dictionary (all NumPy arrays in the
namespace).
Parameters
----------
vardict : dict, optional
A dictio... | [
"def",
"who",
"(",
"vardict",
"=",
"None",
")",
":",
"if",
"vardict",
"is",
"None",
":",
"frame",
"=",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_back",
"vardict",
"=",
"frame",
".",
"f_globals",
"sta",
"=",
"[",
"]",
"cache",
"=",
"{",
"}",
"for... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/utils.py#L285-L379 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/tensor/creation.py | python | empty_like | (x, dtype=None, name=None) | return out | This Op returns a Tensor with uninitialized data which has identical shape of ``x`` and ``dtype``.
If the ``dtype`` is None, the data type of Tensor is same with ``x``.
Args:
x(Tensor): The input tensor which specifies shape and data type. The data type can be bool, float16, float32, float64, int32... | This Op returns a Tensor with uninitialized data which has identical shape of ``x`` and ``dtype``.
If the ``dtype`` is None, the data type of Tensor is same with ``x``.
Args:
x(Tensor): The input tensor which specifies shape and data type. The data type can be bool, float16, float32, float64, int32... | [
"This",
"Op",
"returns",
"a",
"Tensor",
"with",
"uninitialized",
"data",
"which",
"has",
"identical",
"shape",
"of",
"x",
"and",
"dtype",
".",
"If",
"the",
"dtype",
"is",
"None",
"the",
"data",
"type",
"of",
"Tensor",
"is",
"same",
"with",
"x",
".",
"A... | def empty_like(x, dtype=None, name=None):
"""
This Op returns a Tensor with uninitialized data which has identical shape of ``x`` and ``dtype``.
If the ``dtype`` is None, the data type of Tensor is same with ``x``.
Args:
x(Tensor): The input tensor which specifies shape and data type. The d... | [
"def",
"empty_like",
"(",
"x",
",",
"dtype",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"dtype",
"is",
"None",
":",
"dtype",
"=",
"x",
".",
"dtype",
"dtype",
"=",
"convert_dtype",
"(",
"dtype",
")",
"if",
"in_dygraph_mode",
"(",
")",
":... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/creation.py#L1092-L1155 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/c_config.py | python | have_define | (self, key) | return (self.env.HAVE_PAT or 'HAVE_%s') % Utils.quote_define_name(key) | :param key: define name
:type key: string
:return: the input key prefixed by *HAVE_* and substitute any invalid characters.
:rtype: string | :param key: define name
:type key: string
:return: the input key prefixed by *HAVE_* and substitute any invalid characters.
:rtype: string | [
":",
"param",
"key",
":",
"define",
"name",
":",
"type",
"key",
":",
"string",
":",
"return",
":",
"the",
"input",
"key",
"prefixed",
"by",
"*",
"HAVE_",
"*",
"and",
"substitute",
"any",
"invalid",
"characters",
".",
":",
"rtype",
":",
"string"
] | def have_define(self, key):
"""
:param key: define name
:type key: string
:return: the input key prefixed by *HAVE_* and substitute any invalid characters.
:rtype: string
"""
return (self.env.HAVE_PAT or 'HAVE_%s') % Utils.quote_define_name(key) | [
"def",
"have_define",
"(",
"self",
",",
"key",
")",
":",
"return",
"(",
"self",
".",
"env",
".",
"HAVE_PAT",
"or",
"'HAVE_%s'",
")",
"%",
"Utils",
".",
"quote_define_name",
"(",
"key",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/c_config.py#L906-L913 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.GetPreDrag | (*args, **kwargs) | return _richtext.RichTextCtrl_GetPreDrag(*args, **kwargs) | GetPreDrag(self) -> bool | GetPreDrag(self) -> bool | [
"GetPreDrag",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetPreDrag(*args, **kwargs):
"""GetPreDrag(self) -> bool"""
return _richtext.RichTextCtrl_GetPreDrag(*args, **kwargs) | [
"def",
"GetPreDrag",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetPreDrag",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3037-L3039 | |
HyeonwooNoh/caffe | d9e8494a2832d67b25dee37194c7bcb9d52d0e42 | scripts/cpp_lint.py | python | ProcessFile | (filename, vlevel, extra_check_functions=[]) | Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An array of additional check functions that will be
... | Does google-lint on a single file. | [
"Does",
"google",
"-",
"lint",
"on",
"a",
"single",
"file",
"."
] | def ProcessFile(filename, vlevel, extra_check_functions=[]):
"""Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An ar... | [
"def",
"ProcessFile",
"(",
"filename",
",",
"vlevel",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"_SetVerboseLevel",
"(",
"vlevel",
")",
"try",
":",
"# Support the UNIX convention of using \"-\" for stdin. Note that",
"# we are not opening the file with universal... | https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L4689-L4754 | ||
qt/qt | 0a2f2382541424726168804be2c90b91381608c6 | src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/make.py | python | Target | (filename) | return os.path.splitext(filename)[0] + '.o' | Translate a compilable filename to its .o target. | Translate a compilable filename to its .o target. | [
"Translate",
"a",
"compilable",
"filename",
"to",
"its",
".",
"o",
"target",
"."
] | def Target(filename):
"""Translate a compilable filename to its .o target."""
return os.path.splitext(filename)[0] + '.o' | [
"def",
"Target",
"(",
"filename",
")",
":",
"return",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"[",
"0",
"]",
"+",
"'.o'"
] | https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/make.py#L442-L444 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | driver/python/pysequoiadb/lob.py | python | lob.write | (self, data, length) | write data into lob.
Parameters:
Name Type Info:
data str The data to be written
length int The length of data to be written
Exceptions:
pysequoiadb.error.SDBBaseError | write data into lob. | [
"write",
"data",
"into",
"lob",
"."
] | def write(self, data, length):
"""write data into lob.
Parameters:
Name Type Info:
data str The data to be written
length int The length of data to be written
Exceptions:
pysequoiadb.error.SD... | [
"def",
"write",
"(",
"self",
",",
"data",
",",
"length",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"str_type",
")",
":",
"raise",
"SDBTypeError",
"(",
"\"data should be byte or string\"",
")",
"rc",
"=",
"sdb",
".",
"lob_write",
"(",
"self",
... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/lob.py#L180-L194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.