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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/debug_param.py | python | set_execution_strategy | (option) | r"""Sets the execution strategy of :class:`~module.Conv2d` and :func:`~.matmul`
Args:
option: Decides how :class:`~.module.Conv2d`and :func:`~.matmul` algorithms are chosen.
Available value Strategy
* HEURISTIC uses heuristic to choose the fastest algorithm.
* P... | r"""Sets the execution strategy of :class:`~module.Conv2d` and :func:`~.matmul` | [
"r",
"Sets",
"the",
"execution",
"strategy",
"of",
":",
"class",
":",
"~module",
".",
"Conv2d",
"and",
":",
"func",
":",
"~",
".",
"matmul"
] | def set_execution_strategy(option):
r"""Sets the execution strategy of :class:`~module.Conv2d` and :func:`~.matmul`
Args:
option: Decides how :class:`~.module.Conv2d`and :func:`~.matmul` algorithms are chosen.
Available value Strategy
* HEURISTIC uses heuristic to choose th... | [
"def",
"set_execution_strategy",
"(",
"option",
")",
":",
"if",
"isinstance",
"(",
"option",
",",
"Strategy",
")",
":",
"_config",
".",
"_benchmark_kernel",
"=",
"(",
"True",
"if",
"option",
"&",
"_valid_string_option",
"[",
"\"PROFILE\"",
"]",
"!=",
"Strategy... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/debug_param.py#L45-L98 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/feather_format.py | python | to_feather | (df: DataFrame, path) | Write a DataFrame to the feather-format
Parameters
----------
df : DataFrame
path : string file path, or file-like object | Write a DataFrame to the feather-format | [
"Write",
"a",
"DataFrame",
"to",
"the",
"feather",
"-",
"format"
] | def to_feather(df: DataFrame, path):
"""
Write a DataFrame to the feather-format
Parameters
----------
df : DataFrame
path : string file path, or file-like object
"""
import_optional_dependency("pyarrow")
from pyarrow import feather
path = stringify_path(path)
if not isin... | [
"def",
"to_feather",
"(",
"df",
":",
"DataFrame",
",",
"path",
")",
":",
"import_optional_dependency",
"(",
"\"pyarrow\"",
")",
"from",
"pyarrow",
"import",
"feather",
"path",
"=",
"stringify_path",
"(",
"path",
")",
"if",
"not",
"isinstance",
"(",
"df",
","... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/feather_format.py#L10-L64 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/range.py | python | RangeIndex.__len__ | (self) | return max(0, -(-(self._stop - self._start) // self._step)) | return the length of the RangeIndex | return the length of the RangeIndex | [
"return",
"the",
"length",
"of",
"the",
"RangeIndex"
] | def __len__(self):
"""
return the length of the RangeIndex
"""
return max(0, -(-(self._stop - self._start) // self._step)) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"max",
"(",
"0",
",",
"-",
"(",
"-",
"(",
"self",
".",
"_stop",
"-",
"self",
".",
"_start",
")",
"//",
"self",
".",
"_step",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/range.py#L510-L514 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py | python | _SimpleEncoder | (wire_type, encode_value, compute_value_size) | return SpecificEncoder | Return a constructor for an encoder for fields of a particular type.
Args:
wire_type: The field's wire type, for encoding tags.
encode_value: A function which encodes an individual value, e.g.
_EncodeVarint().
compute_value_size: A function which computes the size of an individual
... | Return a constructor for an encoder for fields of a particular type. | [
"Return",
"a",
"constructor",
"for",
"an",
"encoder",
"for",
"fields",
"of",
"a",
"particular",
"type",
"."
] | def _SimpleEncoder(wire_type, encode_value, compute_value_size):
"""Return a constructor for an encoder for fields of a particular type.
Args:
wire_type: The field's wire type, for encoding tags.
encode_value: A function which encodes an individual value, e.g.
_EncodeVarint().
compute_v... | [
"def",
"_SimpleEncoder",
"(",
"wire_type",
",",
"encode_value",
",",
"compute_value_size",
")",
":",
"def",
"SpecificEncoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"if",
"is_packed",
":",
"tag_bytes",
"=",
"TagBytes",
"(",
"field_... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L392-L430 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/ninja.py | python | Target.UsesToc | (self, flavor) | return self.type in ('shared_library', 'loadable_module') | Return true if the target should produce a restat rule based on a TOC
file. | Return true if the target should produce a restat rule based on a TOC
file. | [
"Return",
"true",
"if",
"the",
"target",
"should",
"produce",
"a",
"restat",
"rule",
"based",
"on",
"a",
"TOC",
"file",
"."
] | def UsesToc(self, flavor):
"""Return true if the target should produce a restat rule based on a TOC
file."""
# For bundles, the .TOC should be produced for the binary, not for
# FinalOutput(). But the naive approach would put the TOC file into the
# bundle, so don't do this for bundles for now.
... | [
"def",
"UsesToc",
"(",
"self",
",",
"flavor",
")",
":",
"# For bundles, the .TOC should be produced for the binary, not for",
"# FinalOutput(). But the naive approach would put the TOC file into the",
"# bundle, so don't do this for bundles for now.",
"if",
"flavor",
"==",
"'win'",
"or... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/ninja.py#L153-L161 | |
bakwc/JamSpell | ab5ade201df3e52d99c3a1d38ec422cf4ded1795 | evaluate/context_spell.py | python | edits1 | (word) | return set(deletes + transposes + replaces + inserts) | All edits that are one edit away from `word`. | All edits that are one edit away from `word`. | [
"All",
"edits",
"that",
"are",
"one",
"edit",
"away",
"from",
"word",
"."
] | def edits1(word):
"All edits that are one edit away from `word`."
letters = 'abcdefghijklmnopqrstuvwxyz'
splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
deletes = [L + R[1:] for L, R in splits if R]
transposes = [L + R[1] + R[0] + R[2:] for L, R in splits if ... | [
"def",
"edits1",
"(",
"word",
")",
":",
"letters",
"=",
"'abcdefghijklmnopqrstuvwxyz'",
"splits",
"=",
"[",
"(",
"word",
"[",
":",
"i",
"]",
",",
"word",
"[",
"i",
":",
"]",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"word",
")",
"+",
"1",
... | https://github.com/bakwc/JamSpell/blob/ab5ade201df3e52d99c3a1d38ec422cf4ded1795/evaluate/context_spell.py#L46-L54 | |
ROCmSoftwarePlatform/hipCaffe | 4ec5d482515cce532348553b6db6d00d015675d5 | scripts/cpp_lint.py | python | _DropCommonSuffixes | (filename) | return os.path.splitext(filename)[0] | Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/foo_unusualinternal.h')... | Drops common suffixes like _test.cc or -inl.h from filename. | [
"Drops",
"common",
"suffixes",
"like",
"_test",
".",
"cc",
"or",
"-",
"inl",
".",
"h",
"from",
"filename",
"."
] | def _DropCommonSuffixes(filename):
"""Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCom... | [
"def",
"_DropCommonSuffixes",
"(",
"filename",
")",
":",
"for",
"suffix",
"in",
"(",
"'test.cc'",
",",
"'regtest.cc'",
",",
"'unittest.cc'",
",",
"'inl.h'",
",",
"'impl.h'",
",",
"'internal.h'",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"suffix"... | https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/scripts/cpp_lint.py#L3576-L3600 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/isis_reducer.py | python | ISISReducer.set_sample | (self, run, reload, period) | Assigns and load the run that this reduction chain will analysis
@param run: the run in a number.raw|nxs format
@param reload: if this sample should be reloaded before the first reduction
@param period: the period within the sample to be analysed | Assigns and load the run that this reduction chain will analysis | [
"Assigns",
"and",
"load",
"the",
"run",
"that",
"this",
"reduction",
"chain",
"will",
"analysis"
] | def set_sample(self, run, reload, period):
"""
Assigns and load the run that this reduction chain will analysis
@param run: the run in a number.raw|nxs format
@param reload: if this sample should be reloaded before the first reduction
@param period: the period wit... | [
"def",
"set_sample",
"(",
"self",
",",
"run",
",",
"reload",
",",
"period",
")",
":",
"if",
"not",
"self",
".",
"user_settings",
".",
"executed",
":",
"raise",
"RuntimeError",
"(",
"'User settings must be loaded before the sample can be assigned, run UserFile() first'",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reducer.py#L395-L410 | ||
yahoojapan/NGT | eeeb3d6d9fb0de9cea6c7de25c05c04b09f47f5a | python/ngt/base.py | python | Index.create | (path, dimension,
edge_size_for_creation=10, edge_size_for_search=40,
object_type="Float", distance_type="L2") | return obj | create an empty index with the specified parameters.
edge_size_for_creation : Number of edges for each node in the graph.
edge_size_for_search : Number of edges to search.
object_type : Type of the data object. (Float, Integer [Integer is 1 byte])
distance_type ... | create an empty index with the specified parameters.
edge_size_for_creation : Number of edges for each node in the graph.
edge_size_for_search : Number of edges to search.
object_type : Type of the data object. (Float, Integer [Integer is 1 byte])
distance_type ... | [
"create",
"an",
"empty",
"index",
"with",
"the",
"specified",
"parameters",
".",
"edge_size_for_creation",
":",
"Number",
"of",
"edges",
"for",
"each",
"node",
"in",
"the",
"graph",
".",
"edge_size_for_search",
":",
"Number",
"of",
"edges",
"to",
"search",
"."... | def create(path, dimension,
edge_size_for_creation=10, edge_size_for_search=40,
object_type="Float", distance_type="L2"):
'''
create an empty index with the specified parameters.
edge_size_for_creation : Number of edges for each node in the graph.
edge_s... | [
"def",
"create",
"(",
"path",
",",
"dimension",
",",
"edge_size_for_creation",
"=",
"10",
",",
"edge_size_for_search",
"=",
"40",
",",
"object_type",
"=",
"\"Float\"",
",",
"distance_type",
"=",
"\"L2\"",
")",
":",
"err",
"=",
"None",
"prop",
"=",
"None",
... | https://github.com/yahoojapan/NGT/blob/eeeb3d6d9fb0de9cea6c7de25c05c04b09f47f5a/python/ngt/base.py#L199-L279 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py | python | ComponentWriterBase.paramStrsCpp | (self, param) | return param_str, "" | Get the strings for a function parameter in a .cpp file | Get the strings for a function parameter in a .cpp file | [
"Get",
"the",
"strings",
"for",
"a",
"function",
"parameter",
"in",
"a",
".",
"cpp",
"file"
] | def paramStrsCpp(self, param):
"""
Get the strings for a function parameter in a .cpp file
"""
name, type = param[:2]
param_str = "{} {}".format(type, name)
return param_str, "" | [
"def",
"paramStrsCpp",
"(",
"self",
",",
"param",
")",
":",
"name",
",",
"type",
"=",
"param",
"[",
":",
"2",
"]",
"param_str",
"=",
"\"{} {}\"",
".",
"format",
"(",
"type",
",",
"name",
")",
"return",
"param_str",
",",
"\"\""
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py#L884-L890 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateSpan_Weeks | (*args, **kwargs) | return _misc_.DateSpan_Weeks(*args, **kwargs) | DateSpan_Weeks(int weeks) -> DateSpan | DateSpan_Weeks(int weeks) -> DateSpan | [
"DateSpan_Weeks",
"(",
"int",
"weeks",
")",
"-",
">",
"DateSpan"
] | def DateSpan_Weeks(*args, **kwargs):
"""DateSpan_Weeks(int weeks) -> DateSpan"""
return _misc_.DateSpan_Weeks(*args, **kwargs) | [
"def",
"DateSpan_Weeks",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan_Weeks",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4760-L4762 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | Dialog.GetClassDefaultAttributes | (*args, **kwargs) | return _windows_.Dialog_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Dialog_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L891-L906 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/_symbolic_trace.py | python | symbolic_trace | (root : Union[torch.nn.Module, Callable[..., Any]],
concrete_args: Optional[Dict[str, Any]] = None) | return GraphModule(tracer.root, graph, name) | Symbolic tracing API
Given an ``nn.Module`` or function instance ``root``, this function will return a ``GraphModule``
constructed by recording operations seen while tracing through ``root``.
``concrete_args`` allows you to partially specialize your function, whether it's to remove control flow or data st... | Symbolic tracing API | [
"Symbolic",
"tracing",
"API"
] | def symbolic_trace(root : Union[torch.nn.Module, Callable[..., Any]],
concrete_args: Optional[Dict[str, Any]] = None) -> GraphModule:
"""
Symbolic tracing API
Given an ``nn.Module`` or function instance ``root``, this function will return a ``GraphModule``
constructed by recording op... | [
"def",
"symbolic_trace",
"(",
"root",
":",
"Union",
"[",
"torch",
".",
"nn",
".",
"Module",
",",
"Callable",
"[",
"...",
",",
"Any",
"]",
"]",
",",
"concrete_args",
":",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
"=",
"None",
")",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/_symbolic_trace.py#L807-L859 | |
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/generator/xcode.py | python | EscapeXCodeArgument | (s) | return '"' + s + '"' | We must escape the arguments that we give to XCode so that it knows not to
split on spaces and to respect backslash and quote literals. | We must escape the arguments that we give to XCode so that it knows not to
split on spaces and to respect backslash and quote literals. | [
"We",
"must",
"escape",
"the",
"arguments",
"that",
"we",
"give",
"to",
"XCode",
"so",
"that",
"it",
"knows",
"not",
"to",
"split",
"on",
"spaces",
"and",
"to",
"respect",
"backslash",
"and",
"quote",
"literals",
"."
] | def EscapeXCodeArgument(s):
"""We must escape the arguments that we give to XCode so that it knows not to
split on spaces and to respect backslash and quote literals."""
s = s.replace('\\', '\\\\')
s = s.replace('"', '\\"')
return '"' + s + '"' | [
"def",
"EscapeXCodeArgument",
"(",
"s",
")",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"'\\\\'",
",",
"'\\\\\\\\'",
")",
"s",
"=",
"s",
".",
"replace",
"(",
"'\"'",
",",
"'\\\\\"'",
")",
"return",
"'\"'",
"+",
"s",
"+",
"'\"'"
] | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/xcode.py#L582-L587 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Band.SetRasterColorInterpretation | (self, *args) | return _gdal.Band_SetRasterColorInterpretation(self, *args) | r"""SetRasterColorInterpretation(Band self, GDALColorInterp val) -> CPLErr | r"""SetRasterColorInterpretation(Band self, GDALColorInterp val) -> CPLErr | [
"r",
"SetRasterColorInterpretation",
"(",
"Band",
"self",
"GDALColorInterp",
"val",
")",
"-",
">",
"CPLErr"
] | def SetRasterColorInterpretation(self, *args):
r"""SetRasterColorInterpretation(Band self, GDALColorInterp val) -> CPLErr"""
return _gdal.Band_SetRasterColorInterpretation(self, *args) | [
"def",
"SetRasterColorInterpretation",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"Band_SetRasterColorInterpretation",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L3408-L3410 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/mac/tweak_info_plist.py | python | _GetOutputNoError | (args) | return (stdout, proc.returncode) | Similar to _GetOutput() but ignores stderr. If there's an error launching
the child (like file not found), the exception will be caught and (None, 1)
will be returned to mimic quiet failure. | Similar to _GetOutput() but ignores stderr. If there's an error launching
the child (like file not found), the exception will be caught and (None, 1)
will be returned to mimic quiet failure. | [
"Similar",
"to",
"_GetOutput",
"()",
"but",
"ignores",
"stderr",
".",
"If",
"there",
"s",
"an",
"error",
"launching",
"the",
"child",
"(",
"like",
"file",
"not",
"found",
")",
"the",
"exception",
"will",
"be",
"caught",
"and",
"(",
"None",
"1",
")",
"w... | def _GetOutputNoError(args):
"""Similar to _GetOutput() but ignores stderr. If there's an error launching
the child (like file not found), the exception will be caught and (None, 1)
will be returned to mimic quiet failure."""
try:
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
... | [
"def",
"_GetOutputNoError",
"(",
"args",
")",
":",
"try",
":",
"proc",
"=",
"subprocess",
".",
"Popen",
"(",
"args",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIPE",
")",
"except",
"OSError",
":",
"return",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/mac/tweak_info_plist.py#L48-L58 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Action.py | python | FunctionAction.get_presig | (self, target, source, env) | Return the signature contents of this callable action. | Return the signature contents of this callable action. | [
"Return",
"the",
"signature",
"contents",
"of",
"this",
"callable",
"action",
"."
] | def get_presig(self, target, source, env):
"""Return the signature contents of this callable action."""
try:
return self.gc(target, source, env)
except AttributeError:
return self.funccontents | [
"def",
"get_presig",
"(",
"self",
",",
"target",
",",
"source",
",",
"env",
")",
":",
"try",
":",
"return",
"self",
".",
"gc",
"(",
"target",
",",
"source",
",",
"env",
")",
"except",
"AttributeError",
":",
"return",
"self",
".",
"funccontents"
] | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Action.py#L1232-L1237 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/connection.py | python | Client | (address, family=None, authkey=None) | return c | Returns a connection to the address of a `Listener` | Returns a connection to the address of a `Listener` | [
"Returns",
"a",
"connection",
"to",
"the",
"address",
"of",
"a",
"Listener"
] | def Client(address, family=None, authkey=None):
'''
Returns a connection to the address of a `Listener`
'''
family = family or address_type(address)
if family == 'AF_PIPE':
c = PipeClient(address)
else:
c = SocketClient(address)
if authkey is not None and not isinstance(auth... | [
"def",
"Client",
"(",
"address",
",",
"family",
"=",
"None",
",",
"authkey",
"=",
"None",
")",
":",
"family",
"=",
"family",
"or",
"address_type",
"(",
"address",
")",
"if",
"family",
"==",
"'AF_PIPE'",
":",
"c",
"=",
"PipeClient",
"(",
"address",
")",... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/connection.py#L161-L178 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/symbol_database.py | python | SymbolDatabase.RegisterFileDescriptor | (self, file_descriptor) | Registers the given file descriptor in the local database.
Args:
file_descriptor (FileDescriptor): The file descriptor to register. | Registers the given file descriptor in the local database. | [
"Registers",
"the",
"given",
"file",
"descriptor",
"in",
"the",
"local",
"database",
"."
] | def RegisterFileDescriptor(self, file_descriptor):
"""Registers the given file descriptor in the local database.
Args:
file_descriptor (FileDescriptor): The file descriptor to register.
"""
if api_implementation.Type() == 'python':
# pylint: disable=protected-access
self.pool._Interna... | [
"def",
"RegisterFileDescriptor",
"(",
"self",
",",
"file_descriptor",
")",
":",
"if",
"api_implementation",
".",
"Type",
"(",
")",
"==",
"'python'",
":",
"# pylint: disable=protected-access",
"self",
".",
"pool",
".",
"_InternalAddFileDescriptor",
"(",
"file_descripto... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/symbol_database.py#L122-L130 | ||
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | Cursor.is_default_method | (self) | return conf.lib.clang_CXXMethod_isDefaulted(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'. | Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"=",
"default",
"."
] | def is_default_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared '= default'.
"""
return conf.lib.clang_CXXMethod_isDefaulted(self) | [
"def",
"is_default_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isDefaulted",
"(",
"self",
")"
] | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1341-L1345 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/coprocessing.py | python | CoProcessor.ProcessExodusIIWriter | (self, writer) | Extra work for the ExodusII writer to avoid undesired warnings
and print out a message on how to read the files into Ensight. | Extra work for the ExodusII writer to avoid undesired warnings
and print out a message on how to read the files into Ensight. | [
"Extra",
"work",
"for",
"the",
"ExodusII",
"writer",
"to",
"avoid",
"undesired",
"warnings",
"and",
"print",
"out",
"a",
"message",
"on",
"how",
"to",
"read",
"the",
"files",
"into",
"Ensight",
"."
] | def ProcessExodusIIWriter(self, writer):
"""Extra work for the ExodusII writer to avoid undesired warnings
and print out a message on how to read the files into Ensight."""
# Disable the warning about not having meta data available since we can
# use this writer for vtkDataSets
... | [
"def",
"ProcessExodusIIWriter",
"(",
"self",
",",
"writer",
")",
":",
"# Disable the warning about not having meta data available since we can",
"# use this writer for vtkDataSets",
"writer",
".",
"IgnoreMetaDataWarning",
"=",
"1",
"# optionally print message so that people know what f... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/coprocessing.py#L482-L499 | ||
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | CheckRedundantVirtual | (filename, clean_lines, linenum, error) | Check if line contains a redundant "virtual" function-specifier.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check if line contains a redundant "virtual" function-specifier. | [
"Check",
"if",
"line",
"contains",
"a",
"redundant",
"virtual",
"function",
"-",
"specifier",
"."
] | def CheckRedundantVirtual(filename, clean_lines, linenum, error):
"""Check if line contains a redundant "virtual" function-specifier.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The functio... | [
"def",
"CheckRedundantVirtual",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Look for \"virtual\" on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"virtual",
"=",
"Match",
"(",
"r'^(.*)(\\bvirtual\... | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L5752-L5813 | ||
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | ShellCommand.execute | (self) | return self.cmd(self.__pretty or ' '.join(self.command),
self.command,
cwd=self.__workdir,
env=self.__environment,
redirect_stdout=self.__stdout) | Run the command given at construction time. | Run the command given at construction time. | [
"Run",
"the",
"command",
"given",
"at",
"construction",
"time",
"."
] | def execute(self):
"""Run the command given at construction time."""
return self.cmd(self.__pretty or ' '.join(self.command),
self.command,
cwd=self.__workdir,
env=self.__environment,
redirect_stdout=self.__s... | [
"def",
"execute",
"(",
"self",
")",
":",
"return",
"self",
".",
"cmd",
"(",
"self",
".",
"__pretty",
"or",
"' '",
".",
"join",
"(",
"self",
".",
"command",
")",
",",
"self",
".",
"command",
",",
"cwd",
"=",
"self",
".",
"__workdir",
",",
"env",
"... | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L2583-L2589 | |
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/InventoryCommon.py | python | OnDropItemToPC | (pc) | return | Gives an item to another character. | Gives an item to another character. | [
"Gives",
"an",
"item",
"to",
"another",
"character",
"."
] | def OnDropItemToPC (pc):
"""Gives an item to another character."""
if pc > GemRB.GetPartySize ():
return
GemRB.GetView ("MsgSys").SetText ("")
#-3 : drop stuff in inventory (but not equippable slots)
GemRB.DropDraggedItem (pc, -3)
UpdateInventoryWindow ()
return | [
"def",
"OnDropItemToPC",
"(",
"pc",
")",
":",
"if",
"pc",
">",
"GemRB",
".",
"GetPartySize",
"(",
")",
":",
"return",
"GemRB",
".",
"GetView",
"(",
"\"MsgSys\"",
")",
".",
"SetText",
"(",
"\"\"",
")",
"#-3 : drop stuff in inventory (but not equippable slots)",
... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/InventoryCommon.py#L148-L159 | |
v8mips/v8mips | f0c9cc0bbfd461c7f516799d9a58e9a7395f737e | tools/stats-viewer.py | python | UiCounter.Set | (self, value) | Updates the ui for this counter.
Args:
value: The value to display
Returns:
True if the value had changed, otherwise False. The first call
always returns True. | Updates the ui for this counter. | [
"Updates",
"the",
"ui",
"for",
"this",
"counter",
"."
] | def Set(self, value):
"""Updates the ui for this counter.
Args:
value: The value to display
Returns:
True if the value had changed, otherwise False. The first call
always returns True.
"""
if value == self.last_value:
return False
else:
self.last_value = value
... | [
"def",
"Set",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"==",
"self",
".",
"last_value",
":",
"return",
"False",
"else",
":",
"self",
".",
"last_value",
"=",
"value",
"self",
".",
"var",
".",
"set",
"(",
"self",
".",
"format",
"%",
"value... | https://github.com/v8mips/v8mips/blob/f0c9cc0bbfd461c7f516799d9a58e9a7395f737e/tools/stats-viewer.py#L282-L297 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py | python | getbufsize | () | return umath.geterrobj()[0] | Return the size of the buffer used in ufuncs.
Returns
-------
getbufsize : int
Size of ufunc buffer in bytes. | Return the size of the buffer used in ufuncs. | [
"Return",
"the",
"size",
"of",
"the",
"buffer",
"used",
"in",
"ufuncs",
"."
] | def getbufsize():
"""
Return the size of the buffer used in ufuncs.
Returns
-------
getbufsize : int
Size of ufunc buffer in bytes.
"""
return umath.geterrobj()[0] | [
"def",
"getbufsize",
"(",
")",
":",
"return",
"umath",
".",
"geterrobj",
"(",
")",
"[",
"0",
"]"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py#L2489-L2499 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/methodheap.py | python | MythBE.getUpcomingRecordings | (self, pg) | return pg | Returns a list of Program objects which are scheduled to be recorded.
Sorts the list by recording start time and only returns those with
record status of WillRecord. | Returns a list of Program objects which are scheduled to be recorded. | [
"Returns",
"a",
"list",
"of",
"Program",
"objects",
"which",
"are",
"scheduled",
"to",
"be",
"recorded",
"."
] | def getUpcomingRecordings(self, pg):
"""
Returns a list of Program objects which are scheduled to be recorded.
Sorts the list by recording start time and only returns those with
record status of WillRecord.
"""
return pg | [
"def",
"getUpcomingRecordings",
"(",
"self",
",",
"pg",
")",
":",
"return",
"pg"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/methodheap.py#L83-L90 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/collector.py | python | Collector.resume | (self) | Resume tracing after a `pause`. | Resume tracing after a `pause`. | [
"Resume",
"tracing",
"after",
"a",
"pause",
"."
] | def resume(self):
"""Resume tracing after a `pause`."""
for tracer in self.tracers:
tracer.start()
threading.settrace(self._installation_trace) | [
"def",
"resume",
"(",
"self",
")",
":",
"for",
"tracer",
"in",
"self",
".",
"tracers",
":",
"tracer",
".",
"start",
"(",
")",
"threading",
".",
"settrace",
"(",
"self",
".",
"_installation_trace",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/collector.py#L284-L288 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/model.py | python | ServiceModel.signing_name | (self) | return signing_name | The name to use when computing signatures.
If the model does not define a signing name, this
value will be the endpoint prefix defined in the model. | The name to use when computing signatures. | [
"The",
"name",
"to",
"use",
"when",
"computing",
"signatures",
"."
] | def signing_name(self):
"""The name to use when computing signatures.
If the model does not define a signing name, this
value will be the endpoint prefix defined in the model.
"""
signing_name = self.metadata.get('signingName')
if signing_name is None:
signin... | [
"def",
"signing_name",
"(",
"self",
")",
":",
"signing_name",
"=",
"self",
".",
"metadata",
".",
"get",
"(",
"'signingName'",
")",
"if",
"signing_name",
"is",
"None",
":",
"signing_name",
"=",
"self",
".",
"endpoint_prefix",
"return",
"signing_name"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/model.py#L311-L320 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Region.Intersect | (*args, **kwargs) | return _gdi_.Region_Intersect(*args, **kwargs) | Intersect(self, int x, int y, int width, int height) -> bool | Intersect(self, int x, int y, int width, int height) -> bool | [
"Intersect",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"width",
"int",
"height",
")",
"-",
">",
"bool"
] | def Intersect(*args, **kwargs):
"""Intersect(self, int x, int y, int width, int height) -> bool"""
return _gdi_.Region_Intersect(*args, **kwargs) | [
"def",
"Intersect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Region_Intersect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1583-L1585 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/tensorboard/scripts/serialize_tensorboard.py | python | TensorBoardStaticSerializer.GetAndSave | (self, url, save_suffix, unzip=False) | return content | GET the given url. Serialize the result at clean path version of url. | GET the given url. Serialize the result at clean path version of url. | [
"GET",
"the",
"given",
"url",
".",
"Serialize",
"the",
"result",
"at",
"clean",
"path",
"version",
"of",
"url",
"."
] | def GetAndSave(self, url, save_suffix, unzip=False):
"""GET the given url. Serialize the result at clean path version of url."""
self.connection.request('GET',
'/data/' + url,
headers={'content-type': 'text/plain'})
response = self.connection.getrespon... | [
"def",
"GetAndSave",
"(",
"self",
",",
"url",
",",
"save_suffix",
",",
"unzip",
"=",
"False",
")",
":",
"self",
".",
"connection",
".",
"request",
"(",
"'GET'",
",",
"'/data/'",
"+",
"url",
",",
"headers",
"=",
"{",
"'content-type'",
":",
"'text/plain'",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/tensorboard/scripts/serialize_tensorboard.py#L92-L112 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/timeline/memory_dump_event.py | python | MmapCategory.DefaultCategory | (cls) | return cls._DEFAULT_CATEGORY | An implicit 'Others' match-all category with no children. | An implicit 'Others' match-all category with no children. | [
"An",
"implicit",
"Others",
"match",
"-",
"all",
"category",
"with",
"no",
"children",
"."
] | def DefaultCategory(cls):
"""An implicit 'Others' match-all category with no children."""
if cls._DEFAULT_CATEGORY is None:
cls._DEFAULT_CATEGORY = cls('Others', None)
return cls._DEFAULT_CATEGORY | [
"def",
"DefaultCategory",
"(",
"cls",
")",
":",
"if",
"cls",
".",
"_DEFAULT_CATEGORY",
"is",
"None",
":",
"cls",
".",
"_DEFAULT_CATEGORY",
"=",
"cls",
"(",
"'Others'",
",",
"None",
")",
"return",
"cls",
".",
"_DEFAULT_CATEGORY"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/timeline/memory_dump_event.py#L29-L33 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/history.py | python | History.append_string | (self, string: str) | Add string to the history. | Add string to the history. | [
"Add",
"string",
"to",
"the",
"history",
"."
] | def append_string(self, string: str) -> None:
"Add string to the history."
self._loaded_strings.insert(0, string)
self.store_string(string) | [
"def",
"append_string",
"(",
"self",
",",
"string",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"_loaded_strings",
".",
"insert",
"(",
"0",
",",
"string",
")",
"self",
".",
"store_string",
"(",
"string",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/history.py#L71-L74 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/yes_no.py | python | YesNo | (prompt) | return ch in ('Y', 'y') | Prompts with a yes/no question, returns True if yes. | Prompts with a yes/no question, returns True if yes. | [
"Prompts",
"with",
"a",
"yes",
"/",
"no",
"question",
"returns",
"True",
"if",
"yes",
"."
] | def YesNo(prompt):
"""Prompts with a yes/no question, returns True if yes."""
print prompt,
sys.stdout.flush()
# http://code.activestate.com/recipes/134892/
if sys.platform == 'win32':
import msvcrt
ch = msvcrt.getch()
else:
import termios
import tty
fd = sys.stdin.fileno()
old_setti... | [
"def",
"YesNo",
"(",
"prompt",
")",
":",
"print",
"prompt",
",",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"# http://code.activestate.com/recipes/134892/",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"import",
"msvcrt",
"ch",
"=",
"msvcrt",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/yes_no.py#L8-L28 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Precompile | (self, _object, _attributes={}, **_arguments) | Precompile: Precompile the specified file to the specified destination file
Required argument: File to precompile
Keyword argument Saving_As: Destination file for precompiled header
Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller?
Keyw... | Precompile: Precompile the specified file to the specified destination file
Required argument: File to precompile
Keyword argument Saving_As: Destination file for precompiled header
Keyword argument ExternalEditor: Should the contents of the message window be returned to the caller?
Keyw... | [
"Precompile",
":",
"Precompile",
"the",
"specified",
"file",
"to",
"the",
"specified",
"destination",
"file",
"Required",
"argument",
":",
"File",
"to",
"precompile",
"Keyword",
"argument",
"Saving_As",
":",
"Destination",
"file",
"for",
"precompiled",
"header",
"... | def Precompile(self, _object, _attributes={}, **_arguments):
"""Precompile: Precompile the specified file to the specified destination file
Required argument: File to precompile
Keyword argument Saving_As: Destination file for precompiled header
Keyword argument ExternalEditor: Should th... | [
"def",
"Precompile",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'PreC'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_Preco... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L449-L470 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | examples/python/file_extract.py | python | FileExtract.get_sint64 | (self, fail_value=0) | Extract a single int64_t from the binary file at the current file position, returns a single integer | Extract a single int64_t from the binary file at the current file position, returns a single integer | [
"Extract",
"a",
"single",
"int64_t",
"from",
"the",
"binary",
"file",
"at",
"the",
"current",
"file",
"position",
"returns",
"a",
"single",
"integer"
] | def get_sint64(self, fail_value=0):
'''Extract a single int64_t from the binary file at the current file position, returns a single integer'''
s = self.read_size(8)
if s:
v, = struct.unpack(self.byte_order + 'q', s)
return v
else:
return fail_value | [
"def",
"get_sint64",
"(",
"self",
",",
"fail_value",
"=",
"0",
")",
":",
"s",
"=",
"self",
".",
"read_size",
"(",
"8",
")",
"if",
"s",
":",
"v",
",",
"=",
"struct",
".",
"unpack",
"(",
"self",
".",
"byte_order",
"+",
"'q'",
",",
"s",
")",
"retu... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/examples/python/file_extract.py#L117-L124 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py | python | _WeightedSparseColumn.weight_tensor | (self, input_tensor) | return input_tensor[1] | Returns the weight tensor from the given transformed input_tensor. | Returns the weight tensor from the given transformed input_tensor. | [
"Returns",
"the",
"weight",
"tensor",
"from",
"the",
"given",
"transformed",
"input_tensor",
"."
] | def weight_tensor(self, input_tensor):
"""Returns the weight tensor from the given transformed input_tensor."""
return input_tensor[1] | [
"def",
"weight_tensor",
"(",
"self",
",",
"input_tensor",
")",
":",
"return",
"input_tensor",
"[",
"1",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L502-L504 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py | python | Style.configure | (self, style, query_opt=None, **kw) | return _val_or_dict(kw, self.tk.call, self._name, "configure", style) | Query or sets the default value of the specified option(s) in
style.
Each key in kw is an option and each value is either a string or
a sequence identifying the value for that option. | Query or sets the default value of the specified option(s) in
style. | [
"Query",
"or",
"sets",
"the",
"default",
"value",
"of",
"the",
"specified",
"option",
"(",
"s",
")",
"in",
"style",
"."
] | def configure(self, style, query_opt=None, **kw):
"""Query or sets the default value of the specified option(s) in
style.
Each key in kw is an option and each value is either a string or
a sequence identifying the value for that option."""
if query_opt is not None:
k... | [
"def",
"configure",
"(",
"self",
",",
"style",
",",
"query_opt",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if",
"query_opt",
"is",
"not",
"None",
":",
"kw",
"[",
"query_opt",
"]",
"=",
"None",
"return",
"_val_or_dict",
"(",
"kw",
",",
"self",
".... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L380-L388 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/model_selection/_split.py | python | _CVIterableWrapper.split | (self, X=None, y=None, groups=None) | Generate indices to split data into training and test set.
Parameters
----------
X : object
Always ignored, exists for compatibility.
y : object
Always ignored, exists for compatibility.
groups : object
Always ignored, exists for compatibili... | Generate indices to split data into training and test set. | [
"Generate",
"indices",
"to",
"split",
"data",
"into",
"training",
"and",
"test",
"set",
"."
] | def split(self, X=None, y=None, groups=None):
"""Generate indices to split data into training and test set.
Parameters
----------
X : object
Always ignored, exists for compatibility.
y : object
Always ignored, exists for compatibility.
groups : ... | [
"def",
"split",
"(",
"self",
",",
"X",
"=",
"None",
",",
"y",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"for",
"train",
",",
"test",
"in",
"self",
".",
"cv",
":",
"yield",
"train",
",",
"test"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/model_selection/_split.py#L1939-L1962 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | StandardPaths.GetConfigDir | (*args, **kwargs) | return _misc_.StandardPaths_GetConfigDir(*args, **kwargs) | GetConfigDir(self) -> String
Return the directory with system config files: /etc under Unix,
'c:/Documents and Settings/All Users/Application Data' under Windows,
/Library/Preferences for Mac | GetConfigDir(self) -> String | [
"GetConfigDir",
"(",
"self",
")",
"-",
">",
"String"
] | def GetConfigDir(*args, **kwargs):
"""
GetConfigDir(self) -> String
Return the directory with system config files: /etc under Unix,
'c:/Documents and Settings/All Users/Application Data' under Windows,
/Library/Preferences for Mac
"""
return _misc_.StandardPaths_... | [
"def",
"GetConfigDir",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StandardPaths_GetConfigDir",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L6309-L6317 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py | python | BaseSpecifier.__hash__ | (self) | Returns a hash value for this Specifier like object. | Returns a hash value for this Specifier like object. | [
"Returns",
"a",
"hash",
"value",
"for",
"this",
"Specifier",
"like",
"object",
"."
] | def __hash__(self):
"""
Returns a hash value for this Specifier like object.
""" | [
"def",
"__hash__",
"(",
"self",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py#L30-L33 | ||
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/cpplint_1.4.5/cpplint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of... | r"""Retrieves all the text between matching open and close parentheses. | [
"r",
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sy... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(unknown): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.",
... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L4869-L4922 | |
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | python/draw_net.py | python | parse_args | () | return args | Parse input arguments | Parse input arguments | [
"Parse",
"input",
"arguments"
] | def parse_args():
"""Parse input arguments
"""
parser = ArgumentParser(description=__doc__,
formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument('input_net_proto_file',
help='Input network prototxt file')
parser.add_argument('output... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"ArgumentParser",
"(",
"description",
"=",
"__doc__",
",",
"formatter_class",
"=",
"ArgumentDefaultsHelpFormatter",
")",
"parser",
".",
"add_argument",
"(",
"'input_net_proto_file'",
",",
"help",
"=",
"'Input networ... | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/python/draw_net.py#L13-L33 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/platformsettings.py | python | _BasePlatformSettings.get_httpproxy_ip_address | (self, is_server_mode=False) | return '127.0.0.1' | Returns the IP address to use for httpproxy. | Returns the IP address to use for httpproxy. | [
"Returns",
"the",
"IP",
"address",
"to",
"use",
"for",
"httpproxy",
"."
] | def get_httpproxy_ip_address(self, is_server_mode=False):
"""Returns the IP address to use for httpproxy."""
if is_server_mode:
return '0.0.0.0'
return '127.0.0.1' | [
"def",
"get_httpproxy_ip_address",
"(",
"self",
",",
"is_server_mode",
"=",
"False",
")",
":",
"if",
"is_server_mode",
":",
"return",
"'0.0.0.0'",
"return",
"'127.0.0.1'"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/platformsettings.py#L179-L183 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/message_filters/src/message_filters/__init__.py | python | Cache.getLastestTime | (self) | return self.cache_times[-1] | Return the newest recorded timestamp. | Return the newest recorded timestamp. | [
"Return",
"the",
"newest",
"recorded",
"timestamp",
"."
] | def getLastestTime(self):
"""Return the newest recorded timestamp."""
if not self.cache_times:
return None
return self.cache_times[-1] | [
"def",
"getLastestTime",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"cache_times",
":",
"return",
"None",
"return",
"self",
".",
"cache_times",
"[",
"-",
"1",
"]"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/message_filters/src/message_filters/__init__.py#L145-L149 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/blocks.py | python | Block._replace_regex | (
self,
to_replace,
value,
inplace: bool = False,
convert: bool = True,
mask=None,
) | return [block] | Replace elements by the given value.
Parameters
----------
to_replace : object or pattern
Scalar to replace or regular expression to match.
value : object
Replacement object.
inplace : bool, default False
Perform inplace modification.
... | Replace elements by the given value. | [
"Replace",
"elements",
"by",
"the",
"given",
"value",
"."
] | def _replace_regex(
self,
to_replace,
value,
inplace: bool = False,
convert: bool = True,
mask=None,
) -> list[Block]:
"""
Replace elements by the given value.
Parameters
----------
to_replace : object or pattern
Sc... | [
"def",
"_replace_regex",
"(",
"self",
",",
"to_replace",
",",
"value",
",",
"inplace",
":",
"bool",
"=",
"False",
",",
"convert",
":",
"bool",
"=",
"True",
",",
"mask",
"=",
"None",
",",
")",
"->",
"list",
"[",
"Block",
"]",
":",
"if",
"not",
"self... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L723-L762 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/profiler/model_analyzer.py | python | _build_advisor_options | (options) | return opts | Build tfprof.AdvisorOptionsProto.
Args:
options: A dictionary of options. See ALL_ADVICE example.
Returns:
tfprof.AdvisorOptionsProto. | Build tfprof.AdvisorOptionsProto. | [
"Build",
"tfprof",
".",
"AdvisorOptionsProto",
"."
] | def _build_advisor_options(options):
"""Build tfprof.AdvisorOptionsProto.
Args:
options: A dictionary of options. See ALL_ADVICE example.
Returns:
tfprof.AdvisorOptionsProto.
"""
opts = tfprof_options_pb2.AdvisorOptionsProto()
if options is None:
return opts
for checker, checker_opts in six.i... | [
"def",
"_build_advisor_options",
"(",
"options",
")",
":",
"opts",
"=",
"tfprof_options_pb2",
".",
"AdvisorOptionsProto",
"(",
")",
"if",
"options",
"is",
"None",
":",
"return",
"opts",
"for",
"checker",
",",
"checker_opts",
"in",
"six",
".",
"iteritems",
"(",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/profiler/model_analyzer.py#L87-L103 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/_internal_utils.py | python | to_native_string | (string, encoding='ascii') | return out | Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
necessary. This assumes ASCII unless told otherwise. | Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
necessary. This assumes ASCII unless told otherwise. | [
"Given",
"a",
"string",
"object",
"regardless",
"of",
"type",
"returns",
"a",
"representation",
"of",
"that",
"string",
"in",
"the",
"native",
"string",
"type",
"encoding",
"and",
"decoding",
"where",
"necessary",
".",
"This",
"assumes",
"ASCII",
"unless",
"to... | def to_native_string(string, encoding='ascii'):
"""Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
necessary. This assumes ASCII unless told otherwise.
"""
if isinstance(string, builtin_str):
out = stri... | [
"def",
"to_native_string",
"(",
"string",
",",
"encoding",
"=",
"'ascii'",
")",
":",
"if",
"isinstance",
"(",
"string",
",",
"builtin_str",
")",
":",
"out",
"=",
"string",
"else",
":",
"if",
"is_py2",
":",
"out",
"=",
"string",
".",
"encode",
"(",
"enc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/_internal_utils.py#L14-L27 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Cursor.get_children | (self) | return iter(children) | Return an iterator for accessing the children of this cursor. | Return an iterator for accessing the children of this cursor. | [
"Return",
"an",
"iterator",
"for",
"accessing",
"the",
"children",
"of",
"this",
"cursor",
"."
] | def get_children(self):
"""Return an iterator for accessing the children of this cursor."""
# FIXME: Expose iteration from CIndex, PR6125.
def visitor(child, parent, children):
# FIXME: Document this assertion in API.
# FIXME: There should just be an isNull method.
... | [
"def",
"get_children",
"(",
"self",
")",
":",
"# FIXME: Expose iteration from CIndex, PR6125.",
"def",
"visitor",
"(",
"child",
",",
"parent",
",",
"children",
")",
":",
"# FIXME: Document this assertion in API.",
"# FIXME: There should just be an isNull method.",
"assert",
"... | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1439-L1455 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/withcontexts.py | python | _bypass_with_context | (blocks, blk_start, blk_end, forwardvars) | Given the starting and ending block of the with-context,
replaces the head block with a new block that jumps to the end.
*blocks* is modified inplace. | Given the starting and ending block of the with-context,
replaces the head block with a new block that jumps to the end. | [
"Given",
"the",
"starting",
"and",
"ending",
"block",
"of",
"the",
"with",
"-",
"context",
"replaces",
"the",
"head",
"block",
"with",
"a",
"new",
"block",
"that",
"jumps",
"to",
"the",
"end",
"."
] | def _bypass_with_context(blocks, blk_start, blk_end, forwardvars):
"""Given the starting and ending block of the with-context,
replaces the head block with a new block that jumps to the end.
*blocks* is modified inplace.
"""
sblk = blocks[blk_start]
scope = sblk.scope
loc = sblk.loc
new... | [
"def",
"_bypass_with_context",
"(",
"blocks",
",",
"blk_start",
",",
"blk_end",
",",
"forwardvars",
")",
":",
"sblk",
"=",
"blocks",
"[",
"blk_start",
"]",
"scope",
"=",
"sblk",
".",
"scope",
"loc",
"=",
"sblk",
".",
"loc",
"newblk",
"=",
"ir",
".",
"B... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/withcontexts.py#L264-L279 | ||
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | thrift/lib/py/transport/THttpClient.py | python | THttpClient.__init__ | (self, uri_or_host, port=None, path=None, ssl_context=None) | THttpClient supports two different types constructor parameters.
THttpClient(host, port, path) - deprecated
THttpClient(uri)
Only the second supports https. | THttpClient supports two different types constructor parameters. | [
"THttpClient",
"supports",
"two",
"different",
"types",
"constructor",
"parameters",
"."
] | def __init__(self, uri_or_host, port=None, path=None, ssl_context=None):
"""THttpClient supports two different types constructor parameters.
THttpClient(host, port, path) - deprecated
THttpClient(uri)
Only the second supports https."""
if port is not None:
warnings... | [
"def",
"__init__",
"(",
"self",
",",
"uri_or_host",
",",
"port",
"=",
"None",
",",
"path",
"=",
"None",
",",
"ssl_context",
"=",
"None",
")",
":",
"if",
"port",
"is",
"not",
"None",
":",
"warnings",
".",
"warn",
"(",
"\"Please use the THttpClient('http://h... | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/transport/THttpClient.py#L48-L84 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.GetFontSize | (*args, **kwargs) | return _controls_.TextAttr_GetFontSize(*args, **kwargs) | GetFontSize(self) -> int | GetFontSize(self) -> int | [
"GetFontSize",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFontSize(*args, **kwargs):
"""GetFontSize(self) -> int"""
return _controls_.TextAttr_GetFontSize(*args, **kwargs) | [
"def",
"GetFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1671-L1673 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/message.py | python | Message.ClearField | (self, field_name) | Clears the contents of a given field, or the field set inside a oneof
group. If the name neither refers to a defined field or oneof group,
ValueError is raised. | Clears the contents of a given field, or the field set inside a oneof
group. If the name neither refers to a defined field or oneof group,
ValueError is raised. | [
"Clears",
"the",
"contents",
"of",
"a",
"given",
"field",
"or",
"the",
"field",
"set",
"inside",
"a",
"oneof",
"group",
".",
"If",
"the",
"name",
"neither",
"refers",
"to",
"a",
"defined",
"field",
"or",
"oneof",
"group",
"ValueError",
"is",
"raised",
".... | def ClearField(self, field_name):
"""Clears the contents of a given field, or the field set inside a oneof
group. If the name neither refers to a defined field or oneof group,
ValueError is raised."""
raise NotImplementedError | [
"def",
"ClearField",
"(",
"self",
",",
"field_name",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/message.py#L240-L244 | ||
ros-planning/moveit2 | dd240ef6fd8b9932a7a53964140f2952786187a9 | moveit_commander/src/moveit_commander/move_group.py | python | MoveGroupCommander.set_goal_orientation_tolerance | (self, value) | Set the tolerance for a target end-effector orientation | Set the tolerance for a target end-effector orientation | [
"Set",
"the",
"tolerance",
"for",
"a",
"target",
"end",
"-",
"effector",
"orientation"
] | def set_goal_orientation_tolerance(self, value):
""" Set the tolerance for a target end-effector orientation """
self._g.set_goal_orientation_tolerance(value) | [
"def",
"set_goal_orientation_tolerance",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_g",
".",
"set_goal_orientation_tolerance",
"(",
"value",
")"
] | https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L460-L462 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py | python | SystemInfo.WindowsSdkDir | (self) | return sdkdir | Microsoft Windows SDK directory.
Return
------
str
path | Microsoft Windows SDK directory. | [
"Microsoft",
"Windows",
"SDK",
"directory",
"."
] | def WindowsSdkDir(self):
"""
Microsoft Windows SDK directory.
Return
------
str
path
"""
sdkdir = ''
for ver in self.WindowsSdkVersion:
# Try to get it from registry
loc = join(self.ri.windows_sdk, 'v%s' % ver)
... | [
"def",
"WindowsSdkDir",
"(",
"self",
")",
":",
"sdkdir",
"=",
"''",
"for",
"ver",
"in",
"self",
".",
"WindowsSdkVersion",
":",
"# Try to get it from registry",
"loc",
"=",
"join",
"(",
"self",
".",
"ri",
".",
"windows_sdk",
",",
"'v%s'",
"%",
"ver",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L924-L964 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/wrap/cell_wrapper.py | python | WithLossCell.backbone_network | (self) | return self._backbone | Get the backbone network.
Returns:
Cell, the backbone network. | Get the backbone network. | [
"Get",
"the",
"backbone",
"network",
"."
] | def backbone_network(self):
"""
Get the backbone network.
Returns:
Cell, the backbone network.
"""
return self._backbone | [
"def",
"backbone_network",
"(",
"self",
")",
":",
"return",
"self",
".",
"_backbone"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/wrap/cell_wrapper.py#L114-L121 | |
bumptop/BumpTop | 466d23597a07ae738f4265262fa01087fc6e257c | trunk/mac/Build/cpplint.py | python | FileInfo.Split | (self) | return (project,) + os.path.splitext(rest) | Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension). | Splits the file into the directory, basename, and extension. | [
"Splits",
"the",
"file",
"into",
"the",
"directory",
"basename",
"and",
"extension",
"."
] | def Split(self):
"""Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension).
"""
googlename = self.RepositoryName()
project, rest = os... | [
"def",
"Split",
"(",
"self",
")",
":",
"googlename",
"=",
"self",
".",
"RepositoryName",
"(",
")",
"project",
",",
"rest",
"=",
"os",
".",
"path",
".",
"split",
"(",
"googlename",
")",
"return",
"(",
"project",
",",
")",
"+",
"os",
".",
"path",
"."... | https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/mac/Build/cpplint.py#L568-L580 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/svm/_bounds.py | python | l1_min_c | (X, y, loss='squared_hinge', fit_intercept=True,
intercept_scaling=1.0) | Return the lowest bound for C such that for C in (l1_min_C, infinity)
the model is guaranteed not to be empty. This applies to l1 penalized
classifiers, such as LinearSVC with penalty='l1' and
linear_model.LogisticRegression with penalty='l1'.
This value is valid if class_weight parameter in fit() is n... | Return the lowest bound for C such that for C in (l1_min_C, infinity)
the model is guaranteed not to be empty. This applies to l1 penalized
classifiers, such as LinearSVC with penalty='l1' and
linear_model.LogisticRegression with penalty='l1'. | [
"Return",
"the",
"lowest",
"bound",
"for",
"C",
"such",
"that",
"for",
"C",
"in",
"(",
"l1_min_C",
"infinity",
")",
"the",
"model",
"is",
"guaranteed",
"not",
"to",
"be",
"empty",
".",
"This",
"applies",
"to",
"l1",
"penalized",
"classifiers",
"such",
"a... | def l1_min_c(X, y, loss='squared_hinge', fit_intercept=True,
intercept_scaling=1.0):
"""
Return the lowest bound for C such that for C in (l1_min_C, infinity)
the model is guaranteed not to be empty. This applies to l1 penalized
classifiers, such as LinearSVC with penalty='l1' and
linea... | [
"def",
"l1_min_c",
"(",
"X",
",",
"y",
",",
"loss",
"=",
"'squared_hinge'",
",",
"fit_intercept",
"=",
"True",
",",
"intercept_scaling",
"=",
"1.0",
")",
":",
"if",
"loss",
"not",
"in",
"(",
"'squared_hinge'",
",",
"'log'",
")",
":",
"raise",
"ValueError... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/svm/_bounds.py#L12-L72 | ||
skriegman/reconfigurable_organisms | 9a5d685c2f26259122683d304e1ac98d54bac805 | softbot.py | python | Population.get_learning_trials_for_single_ind | (self, ind) | return ind_as_trials | The individual is separated in N learners | The individual is separated in N learners | [
"The",
"individual",
"is",
"separated",
"in",
"N",
"learners"
] | def get_learning_trials_for_single_ind(self, ind):
"""The individual is separated in N learners"""
ind_as_trials = []
learning_id = int(self.max_id)
for trial in range(self.learning_trials):
learner = deepcopy(ind)
if self.learning_targets is not None:
... | [
"def",
"get_learning_trials_for_single_ind",
"(",
"self",
",",
"ind",
")",
":",
"ind_as_trials",
"=",
"[",
"]",
"learning_id",
"=",
"int",
"(",
"self",
".",
"max_id",
")",
"for",
"trial",
"in",
"range",
"(",
"self",
".",
"learning_trials",
")",
":",
"learn... | https://github.com/skriegman/reconfigurable_organisms/blob/9a5d685c2f26259122683d304e1ac98d54bac805/softbot.py#L557-L587 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/serializers/xmlmap.py | python | XMLMapLoader.create_light_nodes | (self, map) | loop through all preloaded lights and create them
according to their data
@type map: object
@param map: FIFE map object | loop through all preloaded lights and create them
according to their data | [
"loop",
"through",
"all",
"preloaded",
"lights",
"and",
"create",
"them",
"according",
"to",
"their",
"data"
] | def create_light_nodes(self, map):
""" loop through all preloaded lights and create them
according to their data
@type map: object
@param map: FIFE map object
"""
cameras = [i.getId() for i in map.getCameras()]
renderers = {}
default_cam = map.getCameras()[0].getId()
def add_simple_light(group, rend... | [
"def",
"create_light_nodes",
"(",
"self",
",",
"map",
")",
":",
"cameras",
"=",
"[",
"i",
".",
"getId",
"(",
")",
"for",
"i",
"in",
"map",
".",
"getCameras",
"(",
")",
"]",
"renderers",
"=",
"{",
"}",
"default_cam",
"=",
"map",
".",
"getCameras",
"... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/serializers/xmlmap.py#L601-L777 | ||
Qihoo360/mongosync | 55b647e81c072ebe91daaa3b9dc1a953c3c22e19 | dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line = line[:commentpos]... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py#L907-L920 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/telnetlib.py | python | Telnet.interact | (self) | Interaction function, emulates a very dumb telnet client. | Interaction function, emulates a very dumb telnet client. | [
"Interaction",
"function",
"emulates",
"a",
"very",
"dumb",
"telnet",
"client",
"."
] | def interact(self):
"""Interaction function, emulates a very dumb telnet client."""
if sys.platform == "win32":
self.mt_interact()
return
with _TelnetSelector() as selector:
selector.register(self, selectors.EVENT_READ)
selector.register(sys.stdin,... | [
"def",
"interact",
"(",
"self",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"\"win32\"",
":",
"self",
".",
"mt_interact",
"(",
")",
"return",
"with",
"_TelnetSelector",
"(",
")",
"as",
"selector",
":",
"selector",
".",
"register",
"(",
"self",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/telnetlib.py#L535-L559 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | GBPosition.__ne__ | (*args, **kwargs) | return _core_.GBPosition___ne__(*args, **kwargs) | __ne__(self, PyObject other) -> bool
Compare GBPosition for inequality. | __ne__(self, PyObject other) -> bool | [
"__ne__",
"(",
"self",
"PyObject",
"other",
")",
"-",
">",
"bool"
] | def __ne__(*args, **kwargs):
"""
__ne__(self, PyObject other) -> bool
Compare GBPosition for inequality.
"""
return _core_.GBPosition___ne__(*args, **kwargs) | [
"def",
"__ne__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"GBPosition___ne__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L15596-L15602 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Misc._getints | (self, string) | Internal function. | Internal function. | [
"Internal",
"function",
"."
] | def _getints(self, string):
"""Internal function."""
if string:
return tuple(map(getint, self.tk.splitlist(string))) | [
"def",
"_getints",
"(",
"self",
",",
"string",
")",
":",
"if",
"string",
":",
"return",
"tuple",
"(",
"map",
"(",
"getint",
",",
"self",
".",
"tk",
".",
"splitlist",
"(",
"string",
")",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L1072-L1075 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewRenderer.GetEditorCtrl | (*args, **kwargs) | return _dataview.DataViewRenderer_GetEditorCtrl(*args, **kwargs) | GetEditorCtrl(self) -> Window | GetEditorCtrl(self) -> Window | [
"GetEditorCtrl",
"(",
"self",
")",
"-",
">",
"Window"
] | def GetEditorCtrl(*args, **kwargs):
"""GetEditorCtrl(self) -> Window"""
return _dataview.DataViewRenderer_GetEditorCtrl(*args, **kwargs) | [
"def",
"GetEditorCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewRenderer_GetEditorCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L1233-L1235 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2containerservice/layer1.py | python | EC2ContainerServiceConnection.start_task | (self, task_definition, container_instances, cluster=None,
overrides=None) | return self._make_request(
action='StartTask',
verb='POST',
path='/', params=params) | Starts a new task from the specified task definition on the
specified container instance or instances. If you want to use
the default Amazon ECS scheduler to place your task, use
`RunTask` instead.
:type cluster: string
:param cluster: The short name or full Amazon Resource Name... | Starts a new task from the specified task definition on the
specified container instance or instances. If you want to use
the default Amazon ECS scheduler to place your task, use
`RunTask` instead. | [
"Starts",
"a",
"new",
"task",
"from",
"the",
"specified",
"task",
"definition",
"on",
"the",
"specified",
"container",
"instance",
"or",
"instances",
".",
"If",
"you",
"want",
"to",
"use",
"the",
"default",
"Amazon",
"ECS",
"scheduler",
"to",
"place",
"your"... | def start_task(self, task_definition, container_instances, cluster=None,
overrides=None):
"""
Starts a new task from the specified task definition on the
specified container instance or instances. If you want to use
the default Amazon ECS scheduler to place your task, ... | [
"def",
"start_task",
"(",
"self",
",",
"task_definition",
",",
"container_instances",
",",
"cluster",
"=",
"None",
",",
"overrides",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'taskDefinition'",
":",
"task_definition",
",",
"}",
"self",
".",
"build_list_param... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2containerservice/layer1.py#L577-L615 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/client/__init__.py | python | GetActiveObject | (Class, clsctx = pythoncom.CLSCTX_ALL) | return __WrapDispatch(dispatch, Class, resultCLSID = resultCLSID, clsctx = clsctx) | Python friendly version of GetObject's ProgID/CLSID functionality. | Python friendly version of GetObject's ProgID/CLSID functionality. | [
"Python",
"friendly",
"version",
"of",
"GetObject",
"s",
"ProgID",
"/",
"CLSID",
"functionality",
"."
] | def GetActiveObject(Class, clsctx = pythoncom.CLSCTX_ALL):
"""
Python friendly version of GetObject's ProgID/CLSID functionality.
"""
resultCLSID = pywintypes.IID(Class)
dispatch = pythoncom.GetActiveObject(resultCLSID)
dispatch = dispatch.QueryInterface(pythoncom.IID_IDispatch)
return __WrapDispatch(... | [
"def",
"GetActiveObject",
"(",
"Class",
",",
"clsctx",
"=",
"pythoncom",
".",
"CLSCTX_ALL",
")",
":",
"resultCLSID",
"=",
"pywintypes",
".",
"IID",
"(",
"Class",
")",
"dispatch",
"=",
"pythoncom",
".",
"GetActiveObject",
"(",
"resultCLSID",
")",
"dispatch",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/client/__init__.py#L74-L81 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/call.py | python | IConference.Hold | (self) | Places all calls in a conference on hold so all active calls have the status L{clsLocalHold<enums.clsLocalHold>}. | Places all calls in a conference on hold so all active calls have the status L{clsLocalHold<enums.clsLocalHold>}. | [
"Places",
"all",
"calls",
"in",
"a",
"conference",
"on",
"hold",
"so",
"all",
"active",
"calls",
"have",
"the",
"status",
"L",
"{",
"clsLocalHold<enums",
".",
"clsLocalHold",
">",
"}",
"."
] | def Hold(self):
'''Places all calls in a conference on hold so all active calls have the status L{clsLocalHold<enums.clsLocalHold>}.
'''
for c in self._GetCalls():
c.Hold() | [
"def",
"Hold",
"(",
"self",
")",
":",
"for",
"c",
"in",
"self",
".",
"_GetCalls",
"(",
")",
":",
"c",
".",
"Hold",
"(",
")"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/call.py#L607-L611 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/HeppyCore/python/utils/production_tasks.py | python | Task.run | (self, input) | return {} | Basic API for a task. input and output are dictionaries | Basic API for a task. input and output are dictionaries | [
"Basic",
"API",
"for",
"a",
"task",
".",
"input",
"and",
"output",
"are",
"dictionaries"
] | def run(self, input):
"""Basic API for a task. input and output are dictionaries"""
return {} | [
"def",
"run",
"(",
"self",
",",
"input",
")",
":",
"return",
"{",
"}"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/HeppyCore/python/utils/production_tasks.py#L44-L46 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.SetRowAttr | (*args, **kwargs) | return _grid.Grid_SetRowAttr(*args, **kwargs) | SetRowAttr(self, int row, GridCellAttr attr) | SetRowAttr(self, int row, GridCellAttr attr) | [
"SetRowAttr",
"(",
"self",
"int",
"row",
"GridCellAttr",
"attr",
")"
] | def SetRowAttr(*args, **kwargs):
"""SetRowAttr(self, int row, GridCellAttr attr)"""
return _grid.Grid_SetRowAttr(*args, **kwargs) | [
"def",
"SetRowAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_SetRowAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1714-L1716 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py | python | _dtype_to_stata_type_117 | (dtype, column, force_strl) | Converts dtype types to stata types. Returns the byte of the given ordinal.
See TYPE_MAP and comments for an explanation. This is also explained in
the dta spec.
1 - 2045 are strings of this length
Pandas Stata
32768 - for object strL
65526 - for int8 byte
65527 - for ... | Converts dtype types to stata types. Returns the byte of the given ordinal.
See TYPE_MAP and comments for an explanation. This is also explained in
the dta spec.
1 - 2045 are strings of this length
Pandas Stata
32768 - for object strL
65526 - for int8 byte
65527 - for ... | [
"Converts",
"dtype",
"types",
"to",
"stata",
"types",
".",
"Returns",
"the",
"byte",
"of",
"the",
"given",
"ordinal",
".",
"See",
"TYPE_MAP",
"and",
"comments",
"for",
"an",
"explanation",
".",
"This",
"is",
"also",
"explained",
"in",
"the",
"dta",
"spec",... | def _dtype_to_stata_type_117(dtype, column, force_strl):
"""
Converts dtype types to stata types. Returns the byte of the given ordinal.
See TYPE_MAP and comments for an explanation. This is also explained in
the dta spec.
1 - 2045 are strings of this length
Pandas Stata
32768... | [
"def",
"_dtype_to_stata_type_117",
"(",
"dtype",
",",
"column",
",",
"force_strl",
")",
":",
"# TODO: expand to handle datetime to integer conversion",
"if",
"force_strl",
":",
"return",
"32768",
"if",
"dtype",
".",
"type",
"==",
"np",
".",
"object_",
":",
"# try to... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py#L2587-L2626 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/imaplib.py | python | IMAP4._CRAM_MD5_AUTH | (self, challenge) | return self.user + " " + hmac.HMAC(self.password, challenge).hexdigest() | Authobject to use with CRAM-MD5 authentication. | Authobject to use with CRAM-MD5 authentication. | [
"Authobject",
"to",
"use",
"with",
"CRAM",
"-",
"MD5",
"authentication",
"."
] | def _CRAM_MD5_AUTH(self, challenge):
""" Authobject to use with CRAM-MD5 authentication. """
import hmac
return self.user + " " + hmac.HMAC(self.password, challenge).hexdigest() | [
"def",
"_CRAM_MD5_AUTH",
"(",
"self",
",",
"challenge",
")",
":",
"import",
"hmac",
"return",
"self",
".",
"user",
"+",
"\" \"",
"+",
"hmac",
".",
"HMAC",
"(",
"self",
".",
"password",
",",
"challenge",
")",
".",
"hexdigest",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/imaplib.py#L514-L517 | |
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/mox.py | python | MoxMetaTestBase.CleanUpTest | (cls, func) | return new_method | Adds Mox cleanup code to any MoxTestBase method.
Always unsets stubs after a test. Will verify all mocks for tests that
otherwise pass.
Args:
cls: MoxTestBase or subclass; the class whose test method we are altering.
func: method; the method of the MoxTestBase test class we wish to alter.
... | Adds Mox cleanup code to any MoxTestBase method. | [
"Adds",
"Mox",
"cleanup",
"code",
"to",
"any",
"MoxTestBase",
"method",
"."
] | def CleanUpTest(cls, func):
"""Adds Mox cleanup code to any MoxTestBase method.
Always unsets stubs after a test. Will verify all mocks for tests that
otherwise pass.
Args:
cls: MoxTestBase or subclass; the class whose test method we are altering.
func: method; the method of the MoxTestBas... | [
"def",
"CleanUpTest",
"(",
"cls",
",",
"func",
")",
":",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"mox_obj",
"=",
"getattr",
"(",
"self",
",",
"'mox'",
",",
"None",
")",
"cleanup_mox",
"=",
"False",
"if... | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/mox.py#L1358-L1386 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/external/qt_loaders.py | python | import_pyside | () | return QtCore, QtGui, QtSvg, QT_API_PYSIDE | Import PySide
ImportErrors raised within this function are non-recoverable | Import PySide | [
"Import",
"PySide"
] | def import_pyside():
"""
Import PySide
ImportErrors raised within this function are non-recoverable
"""
from PySide import QtGui, QtCore, QtSvg
return QtCore, QtGui, QtSvg, QT_API_PYSIDE | [
"def",
"import_pyside",
"(",
")",
":",
"from",
"PySide",
"import",
"QtGui",
",",
"QtCore",
",",
"QtSvg",
"return",
"QtCore",
",",
"QtGui",
",",
"QtSvg",
",",
"QT_API_PYSIDE"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/external/qt_loaders.py#L279-L286 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/_utils/utils.py | python | cast_to_tensor | (t, hint_type=mstype.float32) | Cast an user input value into a Tensor of dtype.
If the input t is of type Parameter, t is directly returned as a Parameter.
Args:
t (int, float, list, numpy.ndarray, Tensor, Parameter): object to be cast to Tensor.
dtype (mindspore.dtype): dtype of the Tensor. Default: mstype.float32.
Rai... | Cast an user input value into a Tensor of dtype.
If the input t is of type Parameter, t is directly returned as a Parameter. | [
"Cast",
"an",
"user",
"input",
"value",
"into",
"a",
"Tensor",
"of",
"dtype",
".",
"If",
"the",
"input",
"t",
"is",
"of",
"type",
"Parameter",
"t",
"is",
"directly",
"returned",
"as",
"a",
"Parameter",
"."
] | def cast_to_tensor(t, hint_type=mstype.float32):
"""
Cast an user input value into a Tensor of dtype.
If the input t is of type Parameter, t is directly returned as a Parameter.
Args:
t (int, float, list, numpy.ndarray, Tensor, Parameter): object to be cast to Tensor.
dtype (mindspore.d... | [
"def",
"cast_to_tensor",
"(",
"t",
",",
"hint_type",
"=",
"mstype",
".",
"float32",
")",
":",
"if",
"t",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"f'Input cannot be None in cast_to_tensor'",
")",
"if",
"isinstance",
"(",
"t",
",",
"Parameter",
")",
":"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/_utils/utils.py#L28-L53 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosmake/src/rosmake/engine.py | python | RosMakeAll.build | (self, p, argument = None, robust_build=False) | Build package
@param p: package name
@type p: str | Build package | [
"Build",
"package"
] | def build(self, p, argument = None, robust_build=False):
"""
Build package
@param p: package name
@type p: str
"""
return_string = ""
try:
# warn if ROS_BUILD_BLACKLIST encountered if applicable
# do not build packages for which the build ... | [
"def",
"build",
"(",
"self",
",",
"p",
",",
"argument",
"=",
"None",
",",
"robust_build",
"=",
"False",
")",
":",
"return_string",
"=",
"\"\"",
"try",
":",
"# warn if ROS_BUILD_BLACKLIST encountered if applicable",
"# do not build packages for which the build has failed",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosmake/src/rosmake/engine.py#L398-L471 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py | python | ParseResults.getName | (self) | r"""
Returns the results name for this token expression. Useful when several
different expressions might match at a particular location.
Example::
integer = Word(nums)
ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
house_number_expr = Suppress('#') + Word(nums, a... | r"""
Returns the results name for this token expression. Useful when several
different expressions might match at a particular location. | [
"r",
"Returns",
"the",
"results",
"name",
"for",
"this",
"token",
"expression",
".",
"Useful",
"when",
"several",
"different",
"expressions",
"might",
"match",
"at",
"a",
"particular",
"location",
"."
] | def getName(self):
r"""
Returns the results name for this token expression. Useful when several
different expressions might match at a particular location.
Example::
integer = Word(nums)
ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
house_number_expr = S... | [
"def",
"getName",
"(",
"self",
")",
":",
"if",
"self",
".",
"__name",
":",
"return",
"self",
".",
"__name",
"elif",
"self",
".",
"__parent",
":",
"par",
"=",
"self",
".",
"__parent",
"(",
")",
"if",
"par",
":",
"return",
"par",
".",
"__lookup",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py#L834-L869 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _GenerateNativeRulesForMSVS | (p, rules, output_dir, spec, options) | Generate a native rules file.
Arguments:
p: the target project
rules: the set of rules to include
output_dir: the directory in which the project/gyp resides
spec: the project dict
options: global generator options | Generate a native rules file. | [
"Generate",
"a",
"native",
"rules",
"file",
"."
] | def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options):
"""Generate a native rules file.
Arguments:
p: the target project
rules: the set of rules to include
output_dir: the directory in which the project/gyp resides
spec: the project dict
options: global generator options
"""
... | [
"def",
"_GenerateNativeRulesForMSVS",
"(",
"p",
",",
"rules",
",",
"output_dir",
",",
"spec",
",",
"options",
")",
":",
"rules_filename",
"=",
"'%s%s.rules'",
"%",
"(",
"spec",
"[",
"'target_name'",
"]",
",",
"options",
".",
"suffix",
")",
"rules_file",
"=",... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L548-L583 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/python.py | python | get_zip_bytes | (filename) | return None | Get data from `filename` if it is a zip file path.
Returns the bytestring data read from the zip file, or None if no zip file
could be found or `filename` isn't in it. The data returned will be
an empty string if the file is empty. | Get data from `filename` if it is a zip file path. | [
"Get",
"data",
"from",
"filename",
"if",
"it",
"is",
"a",
"zip",
"file",
"path",
"."
] | def get_zip_bytes(filename):
"""Get data from `filename` if it is a zip file path.
Returns the bytestring data read from the zip file, or None if no zip file
could be found or `filename` isn't in it. The data returned will be
an empty string if the file is empty.
"""
markers = ['.zip'+os.sep,... | [
"def",
"get_zip_bytes",
"(",
"filename",
")",
":",
"markers",
"=",
"[",
"'.zip'",
"+",
"os",
".",
"sep",
",",
"'.egg'",
"+",
"os",
".",
"sep",
"]",
"for",
"marker",
"in",
"markers",
":",
"if",
"marker",
"in",
"filename",
":",
"parts",
"=",
"filename"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/python.py#L63-L84 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSNew.py | python | MSVSSolution.Write | (self, writer=gyp.common.WriteOnDiff) | Writes the solution file to disk.
Raises:
IndexError: An entry appears multiple times. | Writes the solution file to disk. | [
"Writes",
"the",
"solution",
"file",
"to",
"disk",
"."
] | def Write(self, writer=gyp.common.WriteOnDiff):
"""Writes the solution file to disk.
Raises:
IndexError: An entry appears multiple times.
"""
# Walk the entry tree and collect all the folders and projects.
all_entries = set()
entries_to_check = self.entries[:]
while entries_to_check:
... | [
"def",
"Write",
"(",
"self",
",",
"writer",
"=",
"gyp",
".",
"common",
".",
"WriteOnDiff",
")",
":",
"# Walk the entry tree and collect all the folders and projects.",
"all_entries",
"=",
"set",
"(",
")",
"entries_to_check",
"=",
"self",
".",
"entries",
"[",
":",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSNew.py#L216-L340 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/environment.py | python | Environment.overlay | (self, block_start_string=missing, block_end_string=missing,
variable_start_string=missing, variable_end_string=missing,
comment_start_string=missing, comment_end_string=missing,
line_statement_prefix=missing, line_comment_prefix=missing,
trim_blocks=missi... | return _environment_sanity_check(rv) | Create a new overlay environment that shares all the data with the
current environment except for cache and the overridden attributes.
Extensions cannot be removed for an overlayed environment. An overlayed
environment automatically gets all the extensions of the environment it
is linke... | Create a new overlay environment that shares all the data with the
current environment except for cache and the overridden attributes.
Extensions cannot be removed for an overlayed environment. An overlayed
environment automatically gets all the extensions of the environment it
is linke... | [
"Create",
"a",
"new",
"overlay",
"environment",
"that",
"shares",
"all",
"the",
"data",
"with",
"the",
"current",
"environment",
"except",
"for",
"cache",
"and",
"the",
"overridden",
"attributes",
".",
"Extensions",
"cannot",
"be",
"removed",
"for",
"an",
"ove... | def overlay(self, block_start_string=missing, block_end_string=missing,
variable_start_string=missing, variable_end_string=missing,
comment_start_string=missing, comment_end_string=missing,
line_statement_prefix=missing, line_comment_prefix=missing,
trim_b... | [
"def",
"overlay",
"(",
"self",
",",
"block_start_string",
"=",
"missing",
",",
"block_end_string",
"=",
"missing",
",",
"variable_start_string",
"=",
"missing",
",",
"variable_end_string",
"=",
"missing",
",",
"comment_start_string",
"=",
"missing",
",",
"comment_en... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/environment.py#L356-L399 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/manager.py | python | Manager.construct | (self, properties = [], targets = []) | Constructs the dependency graph.
properties: the build properties.
targets: the targets to consider. If none is specified, uses all. | Constructs the dependency graph.
properties: the build properties.
targets: the targets to consider. If none is specified, uses all. | [
"Constructs",
"the",
"dependency",
"graph",
".",
"properties",
":",
"the",
"build",
"properties",
".",
"targets",
":",
"the",
"targets",
"to",
"consider",
".",
"If",
"none",
"is",
"specified",
"uses",
"all",
"."
] | def construct (self, properties = [], targets = []):
""" Constructs the dependency graph.
properties: the build properties.
targets: the targets to consider. If none is specified, uses all.
"""
if not targets:
for name, project in self.projects ().project... | [
"def",
"construct",
"(",
"self",
",",
"properties",
"=",
"[",
"]",
",",
"targets",
"=",
"[",
"]",
")",
":",
"if",
"not",
"targets",
":",
"for",
"name",
",",
"project",
"in",
"self",
".",
"projects",
"(",
")",
".",
"projects",
"(",
")",
":",
"targ... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/manager.py#L83-L109 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/in_impl.py | python | _string_in_list | (x, y) | return const_utils.scalar_in_sequence(x, y) | Determine if a str in a list.
Args:
x (str): x
y (list): y
Returns:
bool, if x in y return true, x not in y return false. | Determine if a str in a list. | [
"Determine",
"if",
"a",
"str",
"in",
"a",
"list",
"."
] | def _string_in_list(x, y):
"""
Determine if a str in a list.
Args:
x (str): x
y (list): y
Returns:
bool, if x in y return true, x not in y return false.
"""
return const_utils.scalar_in_sequence(x, y) | [
"def",
"_string_in_list",
"(",
"x",
",",
"y",
")",
":",
"return",
"const_utils",
".",
"scalar_in_sequence",
"(",
"x",
",",
"y",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/in_impl.py#L76-L87 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozpack/copier.py | python | Jarrer.preload | (self, paths) | Add the given set of paths to the list of preloaded files. See
mozpack.mozjar.JarWriter documentation for details on jar preloading. | Add the given set of paths to the list of preloaded files. See
mozpack.mozjar.JarWriter documentation for details on jar preloading. | [
"Add",
"the",
"given",
"set",
"of",
"paths",
"to",
"the",
"list",
"of",
"preloaded",
"files",
".",
"See",
"mozpack",
".",
"mozjar",
".",
"JarWriter",
"documentation",
"for",
"details",
"on",
"jar",
"preloading",
"."
] | def preload(self, paths):
'''
Add the given set of paths to the list of preloaded files. See
mozpack.mozjar.JarWriter documentation for details on jar preloading.
'''
self._preload.extend(paths) | [
"def",
"preload",
"(",
"self",
",",
"paths",
")",
":",
"self",
".",
"_preload",
".",
"extend",
"(",
"paths",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/copier.py#L489-L494 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py | python | native | (path) | return _os.path.normpath(_os.path.join(cwd, path)) | Convert slash path to native | Convert slash path to native | [
"Convert",
"slash",
"path",
"to",
"native"
] | def native(path):
""" Convert slash path to native """
path = _os.path.sep.join(path.split('/'))
return _os.path.normpath(_os.path.join(cwd, path)) | [
"def",
"native",
"(",
"path",
")",
":",
"path",
"=",
"_os",
".",
"path",
".",
"sep",
".",
"join",
"(",
"path",
".",
"split",
"(",
"'/'",
")",
")",
"return",
"_os",
".",
"path",
".",
"normpath",
"(",
"_os",
".",
"path",
".",
"join",
"(",
"cwd",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py#L60-L63 | |
inet-framework/inet | e90ef68c11514f6e12bb2b77a4289484b6c65a8c | doc/src/tools/audio.py | python | align | (argument) | return directives.choice(argument, ('left', 'center', 'right')) | Conversion function for the "align" option. | Conversion function for the "align" option. | [
"Conversion",
"function",
"for",
"the",
"align",
"option",
"."
] | def align(argument):
"""Conversion function for the "align" option."""
return directives.choice(argument, ('left', 'center', 'right')) | [
"def",
"align",
"(",
"argument",
")",
":",
"return",
"directives",
".",
"choice",
"(",
"argument",
",",
"(",
"'left'",
",",
"'center'",
",",
"'right'",
")",
")"
] | https://github.com/inet-framework/inet/blob/e90ef68c11514f6e12bb2b77a4289484b6c65a8c/doc/src/tools/audio.py#L18-L20 | |
0vercl0k/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | src/third_party/fmt/support/docopt.py | python | parse_shorts | (tokens, options) | return parsed | shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ; | shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ; | [
"shorts",
"::",
"=",
"-",
"(",
"chars",
")",
"*",
"[",
"[",
"]",
"chars",
"]",
";"
] | def parse_shorts(tokens, options):
"""shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;"""
token = tokens.move()
assert token.startswith('-') and not token.startswith('--')
left = token.lstrip('-')
parsed = []
while left != '':
short, left = '-' + left[0], left[1:]
similar = [o for o... | [
"def",
"parse_shorts",
"(",
"tokens",
",",
"options",
")",
":",
"token",
"=",
"tokens",
".",
"move",
"(",
")",
"assert",
"token",
".",
"startswith",
"(",
"'-'",
")",
"and",
"not",
"token",
".",
"startswith",
"(",
"'--'",
")",
"left",
"=",
"token",
".... | https://github.com/0vercl0k/rp/blob/5fe693c26d76b514efaedb4084f6e37d820db023/src/third_party/fmt/support/docopt.py#L334-L366 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/python/digital/generic_mod_demod.py | python | add_common_options | (parser) | Sets options common to both modulator and demodulator. | Sets options common to both modulator and demodulator. | [
"Sets",
"options",
"common",
"to",
"both",
"modulator",
"and",
"demodulator",
"."
] | def add_common_options(parser):
"""
Sets options common to both modulator and demodulator.
"""
parser.add_option("-p", "--constellation-points", type="int", default=_def_constellation_points,
help="set the number of constellation points (must be a power of 2 for psk, power of 4 for... | [
"def",
"add_common_options",
"(",
"parser",
")",
":",
"parser",
".",
"add_option",
"(",
"\"-p\"",
",",
"\"--constellation-points\"",
",",
"type",
"=",
"\"int\"",
",",
"default",
"=",
"_def_constellation_points",
",",
"help",
"=",
"\"set the number of constellation poi... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/generic_mod_demod.py#L44-L61 | ||
Netflix/NfWebCrypto | 499faf4eb9f9ccf0b21dc728e974970f54bd6c52 | plugin/ppapi/ppapi/generators/idl_gen_pnacl.py | python | PnaclGen.InterfaceNeedsWrapper | (self, iface, releases) | return False | Return true if the interface has ANY methods that need wrapping. | Return true if the interface has ANY methods that need wrapping. | [
"Return",
"true",
"if",
"the",
"interface",
"has",
"ANY",
"methods",
"that",
"need",
"wrapping",
"."
] | def InterfaceNeedsWrapper(self, iface, releases):
"""Return true if the interface has ANY methods that need wrapping.
"""
if self._skip_opt:
return True
for release in iface.GetUniqueReleases(releases):
version = iface.GetVersion(release)
if self.InterfaceVersionNeedsWrapping(iface, ve... | [
"def",
"InterfaceNeedsWrapper",
"(",
"self",
",",
"iface",
",",
"releases",
")",
":",
"if",
"self",
".",
"_skip_opt",
":",
"return",
"True",
"for",
"release",
"in",
"iface",
".",
"GetUniqueReleases",
"(",
"releases",
")",
":",
"version",
"=",
"iface",
".",... | https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/generators/idl_gen_pnacl.py#L61-L70 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/skype_api.py | python | SkypeAPI.run_poll_for_reply | (self, reply_prefix) | Blocks until we got the reply corresponding to the prefic | Blocks until we got the reply corresponding to the prefic | [
"Blocks",
"until",
"we",
"got",
"the",
"reply",
"corresponding",
"to",
"the",
"prefic"
] | def run_poll_for_reply(self, reply_prefix):
"""Blocks until we got the reply corresponding to the prefic"""
got_it = None
while True:
for reply in self.response_wait():
if not len(reply): continue
if reply.startswith(reply_prefix):
got_it = reply
elif reply[0] != '#':
self.queue_event(rep... | [
"def",
"run_poll_for_reply",
"(",
"self",
",",
"reply_prefix",
")",
":",
"got_it",
"=",
"None",
"while",
"True",
":",
"for",
"reply",
"in",
"self",
".",
"response_wait",
"(",
")",
":",
"if",
"not",
"len",
"(",
"reply",
")",
":",
"continue",
"if",
"repl... | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/skype_api.py#L139-L152 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextBuffer_SetBulletRightMargin | (*args, **kwargs) | return _richtext.RichTextBuffer_SetBulletRightMargin(*args, **kwargs) | RichTextBuffer_SetBulletRightMargin(int margin) | RichTextBuffer_SetBulletRightMargin(int margin) | [
"RichTextBuffer_SetBulletRightMargin",
"(",
"int",
"margin",
")"
] | def RichTextBuffer_SetBulletRightMargin(*args, **kwargs):
"""RichTextBuffer_SetBulletRightMargin(int margin)"""
return _richtext.RichTextBuffer_SetBulletRightMargin(*args, **kwargs) | [
"def",
"RichTextBuffer_SetBulletRightMargin",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_SetBulletRightMargin",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2717-L2719 | |
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_TRPYCommand.py | python | TRPYCommand.__init__ | (self, *args, **kwds) | Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
header,thrust,... | Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments. | [
"Constructor",
".",
"Any",
"message",
"fields",
"that",
"are",
"implicitly",
"/",
"explicitly",
"set",
"to",
"None",
"will",
"be",
"assigned",
"a",
"default",
"value",
".",
"The",
"recommend",
"use",
"is",
"keyword",
"arguments",
"as",
"this",
"is",
"more",
... | def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"args",
"or",
"kwds",
":",
"super",
"(",
"TRPYCommand",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
"#message fields canno... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_TRPYCommand.py#L51-L86 | ||
dartsim/dart | 495c82120c836005f2d136d4a50c8cc997fb879b | tools/cpplint.py | python | _NestingState.Update | (self, filename, clean_lines, linenum, error) | Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Update nesting state with current line. | [
"Update",
"nesting",
"state",
"with",
"current",
"line",
"."
] | def Update(self, filename, clean_lines, linenum, error):
"""Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any err... | [
"def",
"Update",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Update pp_stack first",
"self",
".",
"UpdatePreprocessor",
"(",
"line",
")",
"# Coun... | https://github.com/dartsim/dart/blob/495c82120c836005f2d136d4a50c8cc997fb879b/tools/cpplint.py#L1883-L2037 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/viewer/mpl/utils.py | python | setPlotStuff | (fontsize=7, dpi=None) | TODO merge with setOutputStyle.
Change ugly name. | TODO merge with setOutputStyle. | [
"TODO",
"merge",
"with",
"setOutputStyle",
"."
] | def setPlotStuff(fontsize=7, dpi=None):
"""TODO merge with setOutputStyle.
Change ugly name.
"""
from matplotlib import rcParams
# print(rcParams.keys())
# rcParams['ax.labelsize'] = fontsize # REMOVED IN MPL.1.5
# rcParams['ax.titlesize'] = fontsize # REMOVED IN MPL.1.5
# rcParams[... | [
"def",
"setPlotStuff",
"(",
"fontsize",
"=",
"7",
",",
"dpi",
"=",
"None",
")",
":",
"from",
"matplotlib",
"import",
"rcParams",
"# print(rcParams.keys())",
"# rcParams['ax.labelsize'] = fontsize # REMOVED IN MPL.1.5",
"# rcParams['ax.titlesize'] = fontsize # REMOVED IN MPL.1.5... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/viewer/mpl/utils.py#L188-L220 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/json/_normalize.py | python | nested_to_record | (
ds,
prefix: str = "",
sep: str = ".",
level: int = 0,
max_level: Optional[int] = None,
) | return new_ds | A simplified json_normalize
Converts a nested dict into a flat dict ("record"), unlike json_normalize,
it does not attempt to extract a subset of the data.
Parameters
----------
ds : dict or list of dicts
prefix: the prefix, optional, default: ""
sep : str, default '.'
Nested recor... | A simplified json_normalize | [
"A",
"simplified",
"json_normalize"
] | def nested_to_record(
ds,
prefix: str = "",
sep: str = ".",
level: int = 0,
max_level: Optional[int] = None,
):
"""
A simplified json_normalize
Converts a nested dict into a flat dict ("record"), unlike json_normalize,
it does not attempt to extract a subset of the data.
Parame... | [
"def",
"nested_to_record",
"(",
"ds",
",",
"prefix",
":",
"str",
"=",
"\"\"",
",",
"sep",
":",
"str",
"=",
"\".\"",
",",
"level",
":",
"int",
"=",
"0",
",",
"max_level",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
")",
":",
"singleton",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/json/_normalize.py#L32-L111 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | Node.__repr__ | (self) | return str(self.path()) | Filesystem path to the node file, as a string. | Filesystem path to the node file, as a string. | [
"Filesystem",
"path",
"to",
"the",
"node",
"file",
"as",
"a",
"string",
"."
] | def __repr__(self):
"""Filesystem path to the node file, as a string."""
return str(self.path()) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"str",
"(",
"self",
".",
"path",
"(",
")",
")"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1769-L1771 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/api/order_api.py | python | OrderApi.order_get_orders_with_http_info | (self, **kwargs) | return self.api_client.call_api(
'/order', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[Order]', # noqa: E501
auth_settin... | Get your orders. # noqa: E501
To get open orders only, send {\"open\": true} in the filter param. See <a href=\"http://www.onixs.biz/fix-dictionary/5.0.SP2/msgType_D_68.html\">the FIX Spec</a> for explanations of these fields. # noqa: E501
This method makes a synchronous HTTP request by default. To ... | Get your orders. # noqa: E501 | [
"Get",
"your",
"orders",
".",
"#",
"noqa",
":",
"E501"
] | def order_get_orders_with_http_info(self, **kwargs): # noqa: E501
"""Get your orders. # noqa: E501
To get open orders only, send {\"open\": true} in the filter param. See <a href=\"http://www.onixs.biz/fix-dictionary/5.0.SP2/msgType_D_68.html\">the FIX Spec</a> for explanations of these fields. # n... | [
"def",
"order_get_orders_with_http_info",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"all_params",
"=",
"[",
"'symbol'",
",",
"'filter'",
",",
"'columns'",
",",
"'count'",
",",
"'start'",
",",
"'reverse'",
",",
"'start_time'",
",",
"'end_t... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/api/order_api.py#L606-L698 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/bdist_msi.py | python | PyDialog.xbutton | (self, name, title, next, xpos) | return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next) | Add a button with a given title, the tab-next button,
its name in the Control table, giving its x position; the
y-position is aligned with the other buttons.
Return the button, so that events can be associated | Add a button with a given title, the tab-next button,
its name in the Control table, giving its x position; the
y-position is aligned with the other buttons. | [
"Add",
"a",
"button",
"with",
"a",
"given",
"title",
"the",
"tab",
"-",
"next",
"button",
"its",
"name",
"in",
"the",
"Control",
"table",
"giving",
"its",
"x",
"position",
";",
"the",
"y",
"-",
"position",
"is",
"aligned",
"with",
"the",
"other",
"butt... | def xbutton(self, name, title, next, xpos):
"""Add a button with a given title, the tab-next button,
its name in the Control table, giving its x position; the
y-position is aligned with the other buttons.
Return the button, so that events can be associated"""
return self.pushbut... | [
"def",
"xbutton",
"(",
"self",
",",
"name",
",",
"title",
",",
"next",
",",
"xpos",
")",
":",
"return",
"self",
".",
"pushbutton",
"(",
"name",
",",
"int",
"(",
"self",
".",
"w",
"*",
"xpos",
"-",
"28",
")",
",",
"self",
".",
"h",
"-",
"27",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/bdist_msi.py#L75-L81 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | DontUseExceptions | (*args) | return _ogr.DontUseExceptions(*args) | r"""DontUseExceptions() | r"""DontUseExceptions() | [
"r",
"DontUseExceptions",
"()"
] | def DontUseExceptions(*args):
r"""DontUseExceptions()"""
return _ogr.DontUseExceptions(*args) | [
"def",
"DontUseExceptions",
"(",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"DontUseExceptions",
"(",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L403-L405 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/cpplint.py | python | FileInfo.Extension | (self) | return self.Split()[2] | File extension - text following the final period. | File extension - text following the final period. | [
"File",
"extension",
"-",
"text",
"following",
"the",
"final",
"period",
"."
] | def Extension(self):
"""File extension - text following the final period."""
return self.Split()[2] | [
"def",
"Extension",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"2",
"]"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/cpplint.py#L1046-L1048 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.