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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_psbsd.py | python | Process.cwd | (self) | Return process current working directory. | Return process current working directory. | [
"Return",
"process",
"current",
"working",
"directory",
"."
] | def cwd(self):
"""Return process current working directory."""
# sometimes we get an empty string, in which case we turn
# it into None
if OPENBSD and self.pid == 0:
return None # ...else it would raise EINVAL
elif NETBSD or HAS_PROC_OPEN_FILES:
# FreeBSD... | [
"def",
"cwd",
"(",
"self",
")",
":",
"# sometimes we get an empty string, in which case we turn",
"# it into None",
"if",
"OPENBSD",
"and",
"self",
".",
"pid",
"==",
"0",
":",
"return",
"None",
"# ...else it would raise EINVAL",
"elif",
"NETBSD",
"or",
"HAS_PROC_OPEN_FI... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_psbsd.py#L821-L834 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBarArt.GetToolSize | (*args, **kwargs) | return _aui.AuiToolBarArt_GetToolSize(*args, **kwargs) | GetToolSize(self, DC dc, Window wnd, AuiToolBarItem item) -> Size | GetToolSize(self, DC dc, Window wnd, AuiToolBarItem item) -> Size | [
"GetToolSize",
"(",
"self",
"DC",
"dc",
"Window",
"wnd",
"AuiToolBarItem",
"item",
")",
"-",
">",
"Size"
] | def GetToolSize(*args, **kwargs):
"""GetToolSize(self, DC dc, Window wnd, AuiToolBarItem item) -> Size"""
return _aui.AuiToolBarArt_GetToolSize(*args, **kwargs) | [
"def",
"GetToolSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarArt_GetToolSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1958-L1960 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/internal/containers.py | python | BaseContainer.__len__ | (self) | return len(self._values) | Returns the number of elements in the container. | Returns the number of elements in the container. | [
"Returns",
"the",
"number",
"of",
"elements",
"in",
"the",
"container",
"."
] | def __len__(self):
"""Returns the number of elements in the container."""
return len(self._values) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_values",
")"
] | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/internal/containers.py#L67-L69 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/defchararray.py | python | multiply | (a, i) | return _vec_string(
a_arr, (a_arr.dtype.type, out_size), '__mul__', (i_arr,)) | Return (a * i), that is string multiple concatenation,
element-wise.
Values in `i` of less than 0 are treated as 0 (which yields an
empty string).
Parameters
----------
a : array_like of str or unicode
i : array_like of ints
Returns
-------
out : ndarray
Output array ... | Return (a * i), that is string multiple concatenation,
element-wise. | [
"Return",
"(",
"a",
"*",
"i",
")",
"that",
"is",
"string",
"multiple",
"concatenation",
"element",
"-",
"wise",
"."
] | def multiply(a, i):
"""
Return (a * i), that is string multiple concatenation,
element-wise.
Values in `i` of less than 0 are treated as 0 (which yields an
empty string).
Parameters
----------
a : array_like of str or unicode
i : array_like of ints
Returns
-------
out... | [
"def",
"multiply",
"(",
"a",
",",
"i",
")",
":",
"a_arr",
"=",
"numpy",
".",
"asarray",
"(",
"a",
")",
"i_arr",
"=",
"numpy",
".",
"asarray",
"(",
"i",
")",
"if",
"not",
"issubclass",
"(",
"i_arr",
".",
"dtype",
".",
"type",
",",
"integer",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/defchararray.py#L319-L345 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/codecs.py | python | IncrementalEncoder.reset | (self) | Resets the encoder to the initial state. | Resets the encoder to the initial state. | [
"Resets",
"the",
"encoder",
"to",
"the",
"initial",
"state",
"."
] | def reset(self):
"""
Resets the encoder to the initial state.
""" | [
"def",
"reset",
"(",
"self",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/codecs.py#L197-L200 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParserElement.enablePackrat | (cache_size_limit=128) | Enables "packrat" parsing, which adds memoizing to the parsing logic.
Repeated parse attempts at the same string location (which happens
often in many complex grammars) can immediately return a cached value,
instead of re-executing parsing/validating code. Memoizing is done of
... | Enables "packrat" parsing, which adds memoizing to the parsing logic.
Repeated parse attempts at the same string location (which happens
often in many complex grammars) can immediately return a cached value,
instead of re-executing parsing/validating code. Memoizing is done of
... | [
"Enables",
"packrat",
"parsing",
"which",
"adds",
"memoizing",
"to",
"the",
"parsing",
"logic",
".",
"Repeated",
"parse",
"attempts",
"at",
"the",
"same",
"string",
"location",
"(",
"which",
"happens",
"often",
"in",
"many",
"complex",
"grammars",
")",
"can",
... | def enablePackrat(cache_size_limit=128):
"""Enables "packrat" parsing, which adds memoizing to the parsing logic.
Repeated parse attempts at the same string location (which happens
often in many complex grammars) can immediately return a cached value,
instead of re-executing par... | [
"def",
"enablePackrat",
"(",
"cache_size_limit",
"=",
"128",
")",
":",
"if",
"not",
"ParserElement",
".",
"_packratEnabled",
":",
"ParserElement",
".",
"_packratEnabled",
"=",
"True",
"if",
"cache_size_limit",
"is",
"None",
":",
"ParserElement",
".",
"packrat_cach... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py#L1574-L1606 | ||
numenta/nupic.core | 949950cf2c6d8d894c7eabfa2860aae679bf91f7 | bindings/py/src/nupic/bindings/regions/PyRegion.py | python | PyRegion.initialize | (self) | Initialize the node after the network is fully linked
It is called once by NuPIC before the first call to
:meth:`~nupic.bindings.regions.PyRegion.PyRegion.compute`. It is
a good place to perform one time initialization that depend on the inputs
and/or outputs. The region may also remember its inputs and... | Initialize the node after the network is fully linked
It is called once by NuPIC before the first call to
:meth:`~nupic.bindings.regions.PyRegion.PyRegion.compute`. It is
a good place to perform one time initialization that depend on the inputs
and/or outputs. The region may also remember its inputs and... | [
"Initialize",
"the",
"node",
"after",
"the",
"network",
"is",
"fully",
"linked",
"It",
"is",
"called",
"once",
"by",
"NuPIC",
"before",
"the",
"first",
"call",
"to",
":",
"meth",
":",
"~nupic",
".",
"bindings",
".",
"regions",
".",
"PyRegion",
".",
"PyRe... | def initialize(self):
"""Initialize the node after the network is fully linked
It is called once by NuPIC before the first call to
:meth:`~nupic.bindings.regions.PyRegion.PyRegion.compute`. It is
a good place to perform one time initialization that depend on the inputs
and/or outputs. The region may... | [
"def",
"initialize",
"(",
"self",
")",
":"
] | https://github.com/numenta/nupic.core/blob/949950cf2c6d8d894c7eabfa2860aae679bf91f7/bindings/py/src/nupic/bindings/regions/PyRegion.py#L159-L166 | ||
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/common/proto_utils.py | python | get_pb_from_bin_file | (filename, pb_value) | return pb_value | Get a proto from given binary file. | Get a proto from given binary file. | [
"Get",
"a",
"proto",
"from",
"given",
"binary",
"file",
"."
] | def get_pb_from_bin_file(filename, pb_value):
"""Get a proto from given binary file."""
with open(filename, 'rb') as file_in:
pb_value.ParseFromString(file_in.read())
return pb_value | [
"def",
"get_pb_from_bin_file",
"(",
"filename",
",",
"pb_value",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"file_in",
":",
"pb_value",
".",
"ParseFromString",
"(",
"file_in",
".",
"read",
"(",
")",
")",
"return",
"pb_value"
] | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/common/proto_utils.py#L34-L38 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/distributed/functional.py | python | scatter | (
inp: Tensor, group: Optional[Group] = WORLD, device: Optional[str] = None, axis=0,
) | return out | r"""Split tensor in root process at first dimension.
Args:
inp: Input tensor.
group: The process group to work on.
The default group is WORLD which means all processes available.
You can use a list of process ranks to create new group to work on it, e.g. [1, 3, 5].
d... | r"""Split tensor in root process at first dimension. | [
"r",
"Split",
"tensor",
"in",
"root",
"process",
"at",
"first",
"dimension",
"."
] | def scatter(
inp: Tensor, group: Optional[Group] = WORLD, device: Optional[str] = None, axis=0,
) -> Tensor:
r"""Split tensor in root process at first dimension.
Args:
inp: Input tensor.
group: The process group to work on.
The default group is WORLD which means all processes av... | [
"def",
"scatter",
"(",
"inp",
":",
"Tensor",
",",
"group",
":",
"Optional",
"[",
"Group",
"]",
"=",
"WORLD",
",",
"device",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"axis",
"=",
"0",
",",
")",
"->",
"Tensor",
":",
"shape",
",",
"dtype"... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/distributed/functional.py#L637-L700 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/six.py | python | iteritems | (d, **kw) | return iter(getattr(d, _iteritems)(**kw)) | Return an iterator over the (key, value) pairs of a dictionary. | Return an iterator over the (key, value) pairs of a dictionary. | [
"Return",
"an",
"iterator",
"over",
"the",
"(",
"key",
"value",
")",
"pairs",
"of",
"a",
"dictionary",
"."
] | def iteritems(d, **kw):
"""Return an iterator over the (key, value) pairs of a dictionary."""
return iter(getattr(d, _iteritems)(**kw)) | [
"def",
"iteritems",
"(",
"d",
",",
"*",
"*",
"kw",
")",
":",
"return",
"iter",
"(",
"getattr",
"(",
"d",
",",
"_iteritems",
")",
"(",
"*",
"*",
"kw",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/six.py#L286-L288 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SCD_Reduction/ICCFitTools.py | python | getPoissionGoodIDX | (n_events, zBG=1.96, neigh_length_m=3) | return goodIDX, pp_lambda | getPoissionGoodIDX - returns a numpy arrays which is true if the voxel contains events at
the zBG z level (1.96=95%CI). This is based only on Poission statistics.
Input:
n_events: 3D numpy array containing counts
zBG: the z value at which we will set the cutoff
neigh_lengh_m: th... | getPoissionGoodIDX - returns a numpy arrays which is true if the voxel contains events at
the zBG z level (1.96=95%CI). This is based only on Poission statistics.
Input:
n_events: 3D numpy array containing counts
zBG: the z value at which we will set the cutoff
neigh_lengh_m: th... | [
"getPoissionGoodIDX",
"-",
"returns",
"a",
"numpy",
"arrays",
"which",
"is",
"true",
"if",
"the",
"voxel",
"contains",
"events",
"at",
"the",
"zBG",
"z",
"level",
"(",
"1",
".",
"96",
"=",
"95%CI",
")",
".",
"This",
"is",
"based",
"only",
"on",
"Poissi... | def getPoissionGoodIDX(n_events, zBG=1.96, neigh_length_m=3):
"""
getPoissionGoodIDX - returns a numpy arrays which is true if the voxel contains events at
the zBG z level (1.96=95%CI). This is based only on Poission statistics.
Input:
n_events: 3D numpy array containing counts
... | [
"def",
"getPoissionGoodIDX",
"(",
"n_events",
",",
"zBG",
"=",
"1.96",
",",
"neigh_length_m",
"=",
"3",
")",
":",
"hasEventsIDX",
"=",
"n_events",
">",
"0",
"# Set up some things to only consider good pixels",
"# Set to zero for \"this pixel only\" mode - performance is optim... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SCD_Reduction/ICCFitTools.py#L181-L216 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/deep_cfr_tf2.py | python | DeepCFRSolver.solve | (self) | return self._policy_network, advantage_losses, policy_loss | Solution logic for Deep CFR. | Solution logic for Deep CFR. | [
"Solution",
"logic",
"for",
"Deep",
"CFR",
"."
] | def solve(self):
"""Solution logic for Deep CFR."""
advantage_losses = collections.defaultdict(list)
with tf.device(self._infer_device):
with contextlib.ExitStack() as stack:
if self._save_strategy_memories:
self._memories_tfrecordfile = stack.enter_context(
tf.io.TFRec... | [
"def",
"solve",
"(",
"self",
")",
":",
"advantage_losses",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"with",
"tf",
".",
"device",
"(",
"self",
".",
"_infer_device",
")",
":",
"with",
"contextlib",
".",
"ExitStack",
"(",
")",
"as",
"stack"... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/deep_cfr_tf2.py#L428-L452 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | is_is_int | (a) | return is_app_of(a, Z3_OP_IS_INT) | Return `True` if `a` is an expression of the form IsInt(b).
>>> x = Real('x')
>>> is_is_int(IsInt(x))
True
>>> is_is_int(x)
False | Return `True` if `a` is an expression of the form IsInt(b). | [
"Return",
"True",
"if",
"a",
"is",
"an",
"expression",
"of",
"the",
"form",
"IsInt",
"(",
"b",
")",
"."
] | def is_is_int(a):
"""Return `True` if `a` is an expression of the form IsInt(b).
>>> x = Real('x')
>>> is_is_int(IsInt(x))
True
>>> is_is_int(x)
False
"""
return is_app_of(a, Z3_OP_IS_INT) | [
"def",
"is_is_int",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_IS_INT",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L2882-L2891 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/usb_gadget/gadget.py | python | Gadget.GetDescriptor | (self, recipient, typ, index, lang, length) | Handle a standard GET_DESCRIPTOR request.
See Universal Serial Bus Specification Revision 2.0 section 9.4.3.
Args:
recipient: Request recipient (device, interface, endpoint, etc.)
typ: Descriptor type.
index: Descriptor index.
lang: Descriptor language code.
length: Maximum amoun... | Handle a standard GET_DESCRIPTOR request. | [
"Handle",
"a",
"standard",
"GET_DESCRIPTOR",
"request",
"."
] | def GetDescriptor(self, recipient, typ, index, lang, length):
"""Handle a standard GET_DESCRIPTOR request.
See Universal Serial Bus Specification Revision 2.0 section 9.4.3.
Args:
recipient: Request recipient (device, interface, endpoint, etc.)
typ: Descriptor type.
index: Descriptor ind... | [
"def",
"GetDescriptor",
"(",
"self",
",",
"recipient",
",",
"typ",
",",
"index",
",",
"lang",
",",
"length",
")",
":",
"if",
"typ",
"==",
"usb_constants",
".",
"DescriptorType",
".",
"STRING",
":",
"return",
"self",
".",
"GetStringDescriptor",
"(",
"index"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/gadget.py#L275-L293 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | FileTypeInfo.GetExtensionsCount | (*args, **kwargs) | return _misc_.FileTypeInfo_GetExtensionsCount(*args, **kwargs) | GetExtensionsCount(self) -> size_t | GetExtensionsCount(self) -> size_t | [
"GetExtensionsCount",
"(",
"self",
")",
"-",
">",
"size_t"
] | def GetExtensionsCount(*args, **kwargs):
"""GetExtensionsCount(self) -> size_t"""
return _misc_.FileTypeInfo_GetExtensionsCount(*args, **kwargs) | [
"def",
"GetExtensionsCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"FileTypeInfo_GetExtensionsCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L2539-L2541 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/config.py | python | configuration_to_dict | (handlers) | return config_dict | Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict | Returns configuration data gathered by given handlers as a dict. | [
"Returns",
"configuration",
"data",
"gathered",
"by",
"given",
"handlers",
"as",
"a",
"dict",
"."
] | def configuration_to_dict(handlers):
"""Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict
"""
config_dict = defaultdict(dict)
for handler in handlers:
obj_alias ... | [
"def",
"configuration_to_dict",
"(",
"handlers",
")",
":",
"config_dict",
"=",
"defaultdict",
"(",
"dict",
")",
"for",
"handler",
"in",
"handlers",
":",
"obj_alias",
"=",
"handler",
".",
"section_prefix",
"target_obj",
"=",
"handler",
".",
"target_obj",
"for",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/config.py#L60-L86 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/vis/visualization.py | python | VisAppearance.updateAnimation | (self,t) | Updates the configuration, if it's being animated | Updates the configuration, if it's being animated | [
"Updates",
"the",
"configuration",
"if",
"it",
"s",
"being",
"animated"
] | def updateAnimation(self,t):
"""Updates the configuration, if it's being animated"""
if not self.animation:
self.drawConfig = None
else:
u = self.animationSpeed*(t-self.animationStartTime)
q = self.animation.eval(u,self.animationEndBehavior)
self.d... | [
"def",
"updateAnimation",
"(",
"self",
",",
"t",
")",
":",
"if",
"not",
"self",
".",
"animation",
":",
"self",
".",
"drawConfig",
"=",
"None",
"else",
":",
"u",
"=",
"self",
".",
"animationSpeed",
"*",
"(",
"t",
"-",
"self",
".",
"animationStartTime",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/visualization.py#L1855-L1864 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | parserCtxt.htmlParseChunk | (self, chunk, size, terminate) | return ret | Parse a Chunk of memory | Parse a Chunk of memory | [
"Parse",
"a",
"Chunk",
"of",
"memory"
] | def htmlParseChunk(self, chunk, size, terminate):
"""Parse a Chunk of memory """
ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate)
return ret | [
"def",
"htmlParseChunk",
"(",
"self",
",",
"chunk",
",",
"size",
",",
"terminate",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlParseChunk",
"(",
"self",
".",
"_o",
",",
"chunk",
",",
"size",
",",
"terminate",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5009-L5012 | |
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/tools/stats-viewer.py | python | StatsViewer.OpenWindow | (self) | Create and display the root window. | Create and display the root window. | [
"Create",
"and",
"display",
"the",
"root",
"window",
"."
] | def OpenWindow(self):
"""Create and display the root window."""
self.root = Tkinter.Tk()
# Tkinter is no good at resizing so we disable it
self.root.resizable(width=False, height=False)
self.RefreshCounters()
self.ScheduleUpdate()
self.root.mainloop() | [
"def",
"OpenWindow",
"(",
"self",
")",
":",
"self",
".",
"root",
"=",
"Tkinter",
".",
"Tk",
"(",
")",
"# Tkinter is no good at resizing so we disable it",
"self",
".",
"root",
".",
"resizable",
"(",
"width",
"=",
"False",
",",
"height",
"=",
"False",
")",
... | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/stats-viewer.py#L257-L265 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/metadynamics.py | python | BiasVariable.__init__ | (self, force, minValue, maxValue, biasWidth, periodic=False, gridWidth=None) | Create a BiasVariable.
Parameters
----------
force: Force
the Force object whose potential energy defines the collective variable
minValue: float or unit.Quantity
the minimum value the collective variable can take. If it should ever go below this,
th... | Create a BiasVariable. | [
"Create",
"a",
"BiasVariable",
"."
] | def __init__(self, force, minValue, maxValue, biasWidth, periodic=False, gridWidth=None):
"""Create a BiasVariable.
Parameters
----------
force: Force
the Force object whose potential energy defines the collective variable
minValue: float or unit.Quantity
... | [
"def",
"__init__",
"(",
"self",
",",
"force",
",",
"minValue",
",",
"maxValue",
",",
"biasWidth",
",",
"periodic",
"=",
"False",
",",
"gridWidth",
"=",
"None",
")",
":",
"self",
".",
"force",
"=",
"force",
"self",
".",
"minValue",
"=",
"self",
".",
"... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/metadynamics.py#L275-L307 | ||
makefile/frcnn | 8d9b9ebf8be8315ba2f374d460121b0adf1df29c | python/caffe/io.py | python | Transformer.deprocess | (self, in_, data) | return decaf_in | Invert Caffe formatting; see preprocess(). | Invert Caffe formatting; see preprocess(). | [
"Invert",
"Caffe",
"formatting",
";",
"see",
"preprocess",
"()",
"."
] | def deprocess(self, in_, data):
"""
Invert Caffe formatting; see preprocess().
"""
self.__check_input(in_)
decaf_in = data.copy().squeeze()
transpose = self.transpose.get(in_)
channel_swap = self.channel_swap.get(in_)
raw_scale = self.raw_scale.get(in_)
... | [
"def",
"deprocess",
"(",
"self",
",",
"in_",
",",
"data",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"decaf_in",
"=",
"data",
".",
"copy",
"(",
")",
".",
"squeeze",
"(",
")",
"transpose",
"=",
"self",
".",
"transpose",
".",
"get",
"("... | https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/python/caffe/io.py#L164-L185 | |
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | scripts/compute_pr_curve.py | python | tp_fp_fn | (gt, detections, min_iou, dont_care) | return int(tp), int(fp), int(fn), int(fnr), int(fpd) | Computes true positives (tp), false positives (fp) and false negatives (fn) from the given two
sets of bounding boxes - ground truth and detections.
Input:
gt: List of BB2D ground truth bounding boxes
detections: List of BB2D detections' bounding boxes
min_iou: Minimum intersection over ... | Computes true positives (tp), false positives (fp) and false negatives (fn) from the given two
sets of bounding boxes - ground truth and detections. | [
"Computes",
"true",
"positives",
"(",
"tp",
")",
"false",
"positives",
"(",
"fp",
")",
"and",
"false",
"negatives",
"(",
"fn",
")",
"from",
"the",
"given",
"two",
"sets",
"of",
"bounding",
"boxes",
"-",
"ground",
"truth",
"and",
"detections",
"."
] | def tp_fp_fn(gt, detections, min_iou, dont_care):
"""
Computes true positives (tp), false positives (fp) and false negatives (fn) from the given two
sets of bounding boxes - ground truth and detections.
Input:
gt: List of BB2D ground truth bounding boxes
detections: List of BB2D detections' bou... | [
"def",
"tp_fp_fn",
"(",
"gt",
",",
"detections",
",",
"min_iou",
",",
"dont_care",
")",
":",
"# First compute a matrix of intersection over unions - we will be searching best matches in it",
"ious",
"=",
"np",
".",
"zeros",
"(",
"[",
"len",
"(",
"gt",
")",
",",
"len... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/compute_pr_curve.py#L56-L111 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | python | GetAllDefines | (target_list, target_dicts, data, config_name, params, compiler_path) | return all_defines | Calculate the defines for a project.
Returns:
A dict that includes explicit defines declared in gyp files along with all
of the default defines that the compiler uses. | Calculate the defines for a project. | [
"Calculate",
"the",
"defines",
"for",
"a",
"project",
"."
] | def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path):
"""Calculate the defines for a project.
Returns:
A dict that includes explicit defines declared in gyp files along with all
of the default defines that the compiler uses.
"""
# Get defines declared in the gyp f... | [
"def",
"GetAllDefines",
"(",
"target_list",
",",
"target_dicts",
",",
"data",
",",
"config_name",
",",
"params",
",",
"compiler_path",
")",
":",
"# Get defines declared in the gyp files.",
"all_defines",
"=",
"{",
"}",
"flavor",
"=",
"gyp",
".",
"common",
".",
"... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L201-L257 | |
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/scripts/cpp_lint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L716-L739 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/TemplatePyMod/DocumentObject.py | python | DocumentObject.addProperty | (self,typ,name='',group='',doc='',attr=0,readonly=False,hidden=False) | return self.__object__.addProperty(typ,name,group,doc,attr,readonly,hidden) | adds a new property to this object | adds a new property to this object | [
"adds",
"a",
"new",
"property",
"to",
"this",
"object"
] | def addProperty(self,typ,name='',group='',doc='',attr=0,readonly=False,hidden=False):
"adds a new property to this object"
return self.__object__.addProperty(typ,name,group,doc,attr,readonly,hidden) | [
"def",
"addProperty",
"(",
"self",
",",
"typ",
",",
"name",
"=",
"''",
",",
"group",
"=",
"''",
",",
"doc",
"=",
"''",
",",
"attr",
"=",
"0",
",",
"readonly",
"=",
"False",
",",
"hidden",
"=",
"False",
")",
":",
"return",
"self",
".",
"__object__... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/TemplatePyMod/DocumentObject.py#L58-L60 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/receptive_field/python/util/examples/rf_benchmark.py | python | _model_rf | (graphdef,
end_points,
desired_end_point_keys,
model_type='resnet_v1_50',
csv_writer=None) | Computes receptive field information for a given CNN model.
The information will be printed to stdout. If the RF parameters are the same
for the horizontal and vertical directions, it will be printed only once.
Otherwise, they are printed once for the horizontal and once for the vertical
directions.
Args:
... | Computes receptive field information for a given CNN model. | [
"Computes",
"receptive",
"field",
"information",
"for",
"a",
"given",
"CNN",
"model",
"."
] | def _model_rf(graphdef,
end_points,
desired_end_point_keys,
model_type='resnet_v1_50',
csv_writer=None):
"""Computes receptive field information for a given CNN model.
The information will be printed to stdout. If the RF parameters are the same
for the hori... | [
"def",
"_model_rf",
"(",
"graphdef",
",",
"end_points",
",",
"desired_end_point_keys",
",",
"model_type",
"=",
"'resnet_v1_50'",
",",
"csv_writer",
"=",
"None",
")",
":",
"for",
"desired_end_point_key",
"in",
"desired_end_point_keys",
":",
"print",
"(",
"'- %s:'",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/receptive_field/python/util/examples/rf_benchmark.py#L244-L299 | ||
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | scripts/cpp_lint.py | python | CheckSpacingForFunctionCall | (filename, line, linenum, error) | Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for the correctness of various spacing around function calls. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"around",
"function",
"calls",
"."
] | def CheckSpacingForFunctionCall(filename, line, linenum, error):
"""Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any ... | [
"def",
"CheckSpacingForFunctionCall",
"(",
"filename",
",",
"line",
",",
"linenum",
",",
"error",
")",
":",
"# Since function calls often occur inside if/for/while/switch",
"# expressions - which have their own, more liberal conventions - we",
"# first see if we should be looking inside ... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L2301-L2366 | ||
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | CheckComment | (comment, filename, linenum, error) | Checks for common mistakes in TODO comments.
Args:
comment: The text of the comment from the line in question.
filename: The name of the current file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for common mistakes in TODO comments. | [
"Checks",
"for",
"common",
"mistakes",
"in",
"TODO",
"comments",
"."
] | def CheckComment(comment, filename, linenum, error):
"""Checks for common mistakes in TODO comments.
Args:
comment: The text of the comment from the line in question.
filename: The name of the current file.
linenum: The number of the line to check.
error: The function to call with any errors found.... | [
"def",
"CheckComment",
"(",
"comment",
",",
"filename",
",",
"linenum",
",",
"error",
")",
":",
"match",
"=",
"_RE_PATTERN_TODO",
".",
"match",
"(",
"comment",
")",
"if",
"match",
":",
"# One whitespace is correct; zero whitespace is handled elsewhere.",
"leading_whit... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L2457-L2484 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ctypes/macholib/dyld.py | python | ensure_utf8 | (s) | return s | Not all of PyObjC and Python understand unicode paths very well yet | Not all of PyObjC and Python understand unicode paths very well yet | [
"Not",
"all",
"of",
"PyObjC",
"and",
"Python",
"understand",
"unicode",
"paths",
"very",
"well",
"yet"
] | def ensure_utf8(s):
"""Not all of PyObjC and Python understand unicode paths very well yet"""
if isinstance(s, unicode):
return s.encode('utf8')
return s | [
"def",
"ensure_utf8",
"(",
"s",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
":",
"return",
"s",
".",
"encode",
"(",
"'utf8'",
")",
"return",
"s"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ctypes/macholib/dyld.py#L31-L35 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/network.py | python | embedding_net | (xx,
network_size,
precision,
activation_fn = tf.nn.tanh,
resnet_dt = False,
name_suffix = '',
stddev = 1.0,
bavg = 0.0,
seed = None,
trainable = True,
... | return xx | r"""The embedding network.
The embedding network function :math:`\mathcal{N}` is constructed by is the
composition of multiple layers :math:`\mathcal{L}^{(i)}`:
.. math::
\mathcal{N} = \mathcal{L}^{(n)} \circ \mathcal{L}^{(n-1)}
\circ \cdots \circ \mathcal{L}^{(1)}
A layer :math:`\mat... | r"""The embedding network. | [
"r",
"The",
"embedding",
"network",
"."
] | def embedding_net(xx,
network_size,
precision,
activation_fn = tf.nn.tanh,
resnet_dt = False,
name_suffix = '',
stddev = 1.0,
bavg = 0.0,
seed = None,
trainab... | [
"def",
"embedding_net",
"(",
"xx",
",",
"network_size",
",",
"precision",
",",
"activation_fn",
"=",
"tf",
".",
"nn",
".",
"tanh",
",",
"resnet_dt",
"=",
"False",
",",
"name_suffix",
"=",
"''",
",",
"stddev",
"=",
"1.0",
",",
"bavg",
"=",
"0.0",
",",
... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/network.py#L85-L218 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.GetFontAttributes | (*args, **kwargs) | return _controls_.TextAttr_GetFontAttributes(*args, **kwargs) | GetFontAttributes(self, Font font, int flags=TEXT_ATTR_FONT) -> bool | GetFontAttributes(self, Font font, int flags=TEXT_ATTR_FONT) -> bool | [
"GetFontAttributes",
"(",
"self",
"Font",
"font",
"int",
"flags",
"=",
"TEXT_ATTR_FONT",
")",
"-",
">",
"bool"
] | def GetFontAttributes(*args, **kwargs):
"""GetFontAttributes(self, Font font, int flags=TEXT_ATTR_FONT) -> bool"""
return _controls_.TextAttr_GetFontAttributes(*args, **kwargs) | [
"def",
"GetFontAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetFontAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1507-L1509 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/signers.py | python | generate_db_auth_token | (self, DBHostname, Port, DBUsername, Region=None) | return presigned_url[len(scheme):] | Generates an auth token used to connect to a db with IAM credentials.
:type DBHostname: str
:param DBHostname: The hostname of the database to connect to.
:type Port: int
:param Port: The port number the database is listening on.
:type DBUsername: str
:param DBUsername: The username to log in... | Generates an auth token used to connect to a db with IAM credentials. | [
"Generates",
"an",
"auth",
"token",
"used",
"to",
"connect",
"to",
"a",
"db",
"with",
"IAM",
"credentials",
"."
] | def generate_db_auth_token(self, DBHostname, Port, DBUsername, Region=None):
"""Generates an auth token used to connect to a db with IAM credentials.
:type DBHostname: str
:param DBHostname: The hostname of the database to connect to.
:type Port: int
:param Port: The port number the database is li... | [
"def",
"generate_db_auth_token",
"(",
"self",
",",
"DBHostname",
",",
"Port",
",",
"DBUsername",
",",
"Region",
"=",
"None",
")",
":",
"region",
"=",
"Region",
"if",
"region",
"is",
"None",
":",
"region",
"=",
"self",
".",
"meta",
".",
"region_name",
"pa... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/signers.py#L407-L455 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py | python | Handler.__init__ | (self, level=NOTSET) | Initializes the instance - basically setting the formatter to None
and the filter list to empty. | Initializes the instance - basically setting the formatter to None
and the filter list to empty. | [
"Initializes",
"the",
"instance",
"-",
"basically",
"setting",
"the",
"formatter",
"to",
"None",
"and",
"the",
"filter",
"list",
"to",
"empty",
"."
] | def __init__(self, level=NOTSET):
"""
Initializes the instance - basically setting the formatter to None
and the filter list to empty.
"""
Filterer.__init__(self)
self._name = None
self.level = _checkLevel(level)
self.formatter = None
# Add the han... | [
"def",
"__init__",
"(",
"self",
",",
"level",
"=",
"NOTSET",
")",
":",
"Filterer",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"_name",
"=",
"None",
"self",
".",
"level",
"=",
"_checkLevel",
"(",
"level",
")",
"self",
".",
"formatter",
"=",
"None... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py#L655-L666 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.GetBrush | (*args, **kwargs) | return _gdi_.DC_GetBrush(*args, **kwargs) | GetBrush(self) -> Brush
Gets the current brush | GetBrush(self) -> Brush | [
"GetBrush",
"(",
"self",
")",
"-",
">",
"Brush"
] | def GetBrush(*args, **kwargs):
"""
GetBrush(self) -> Brush
Gets the current brush
"""
return _gdi_.DC_GetBrush(*args, **kwargs) | [
"def",
"GetBrush",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_GetBrush",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4337-L4343 | |
floatlazer/semantic_slam | 657814a1ba484de6b7f6f9d07c564566c8121f13 | semantic_cloud/include/ptsemseg/utils.py | python | poly_lr_scheduler | (optimizer, init_lr, iter, lr_decay_iter=1, max_iter=30000, power=0.9,) | Polynomial decay of learning rate
:param init_lr is base learning rate
:param iter is a current iteration
:param lr_decay_iter how frequently decay occurs, default is 1
:param max_iter is number of maximum iterations
:param power is a polymomial power | Polynomial decay of learning rate
:param init_lr is base learning rate
:param iter is a current iteration
:param lr_decay_iter how frequently decay occurs, default is 1
:param max_iter is number of maximum iterations
:param power is a polymomial power | [
"Polynomial",
"decay",
"of",
"learning",
"rate",
":",
"param",
"init_lr",
"is",
"base",
"learning",
"rate",
":",
"param",
"iter",
"is",
"a",
"current",
"iteration",
":",
"param",
"lr_decay_iter",
"how",
"frequently",
"decay",
"occurs",
"default",
"is",
"1",
... | def poly_lr_scheduler(optimizer, init_lr, iter, lr_decay_iter=1, max_iter=30000, power=0.9,):
"""Polynomial decay of learning rate
:param init_lr is base learning rate
:param iter is a current iteration
:param lr_decay_iter how frequently decay occurs, default is 1
:param max_iter is... | [
"def",
"poly_lr_scheduler",
"(",
"optimizer",
",",
"init_lr",
",",
"iter",
",",
"lr_decay_iter",
"=",
"1",
",",
"max_iter",
"=",
"30000",
",",
"power",
"=",
"0.9",
",",
")",
":",
"if",
"iter",
"%",
"lr_decay_iter",
"or",
"iter",
">",
"max_iter",
":",
"... | https://github.com/floatlazer/semantic_slam/blob/657814a1ba484de6b7f6f9d07c564566c8121f13/semantic_cloud/include/ptsemseg/utils.py#L18-L31 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/predictor/predictor_py_utils.py | python | to_first_match_dict | (kv_list) | return d | Construct dict from kv_list | Construct dict from kv_list | [
"Construct",
"dict",
"from",
"kv_list"
] | def to_first_match_dict(kv_list):
"""
Construct dict from kv_list
"""
d = {}
for item in kv_list:
if item.key not in d:
d[item.key] = item.value
return d | [
"def",
"to_first_match_dict",
"(",
"kv_list",
")",
":",
"d",
"=",
"{",
"}",
"for",
"item",
"in",
"kv_list",
":",
"if",
"item",
".",
"key",
"not",
"in",
"d",
":",
"d",
"[",
"item",
".",
"key",
"]",
"=",
"item",
".",
"value",
"return",
"d"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/predictor/predictor_py_utils.py#L74-L82 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/wms/ogc/common/images.py | python | ImagesArray._PreallocateImages | (self, ncols, nrows) | Makes a 2D row-major (y, x) array of <None>s.
Args:
ncols: number of slots along the x axis.
nrows: number of slots along the y axis. | Makes a 2D row-major (y, x) array of <None>s. | [
"Makes",
"a",
"2D",
"row",
"-",
"major",
"(",
"y",
"x",
")",
"array",
"of",
"<None",
">",
"s",
"."
] | def _PreallocateImages(self, ncols, nrows):
"""Makes a 2D row-major (y, x) array of <None>s.
Args:
ncols: number of slots along the x axis.
nrows: number of slots along the y axis.
"""
# This version of the next line:
# self.images = [[None] * ncols] * nrows
# causes the row ... | [
"def",
"_PreallocateImages",
"(",
"self",
",",
"ncols",
",",
"nrows",
")",
":",
"# This version of the next line:",
"# self.images = [[None] * ncols] * nrows",
"# causes the row lists to share references somehow. You might",
"# think that if that were true, that the columns would be tie... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/common/images.py#L43-L57 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | ControlFlowState._GetGradState | (self, op, before) | return None | Return the grad state for this op if it's in a forward loop context. | Return the grad state for this op if it's in a forward loop context. | [
"Return",
"the",
"grad",
"state",
"for",
"this",
"op",
"if",
"it",
"s",
"in",
"a",
"forward",
"loop",
"context",
"."
] | def _GetGradState(self, op, before):
"""Return the grad state for this op if it's in a forward loop context."""
if before and _IsLoopExit(op):
forward_ctxt = op._get_control_flow_context()
forward_ctxt = forward_ctxt.outer_context
if forward_ctxt:
forward_ctxt = forward_ctxt.GetWhileCo... | [
"def",
"_GetGradState",
"(",
"self",
",",
"op",
",",
"before",
")",
":",
"if",
"before",
"and",
"_IsLoopExit",
"(",
"op",
")",
":",
"forward_ctxt",
"=",
"op",
".",
"_get_control_flow_context",
"(",
")",
"forward_ctxt",
"=",
"forward_ctxt",
".",
"outer_contex... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L809-L820 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/uuid.py | python | _ifconfig_getnode | () | Get the hardware address on Unix by running ifconfig. | Get the hardware address on Unix by running ifconfig. | [
"Get",
"the",
"hardware",
"address",
"on",
"Unix",
"by",
"running",
"ifconfig",
"."
] | def _ifconfig_getnode():
"""Get the hardware address on Unix by running ifconfig."""
# This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.
keywords = (b'hwaddr', b'ether', b'address:', b'lladdr')
for args in ('', '-a', '-av'):
mac = _find_mac('ifconfig', args, keywords, lambda i... | [
"def",
"_ifconfig_getnode",
"(",
")",
":",
"# This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.",
"keywords",
"=",
"(",
"b'hwaddr'",
",",
"b'ether'",
",",
"b'address:'",
",",
"b'lladdr'",
")",
"for",
"args",
"in",
"(",
"''",
",",
"'-a'",
",",
"'-a... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/uuid.py#L410-L418 | ||
balint256/gr-baz | 937834ce3520b730277328d8e0cdebb3f2b1aafc | python/usrp/common.py | python | usrp_helper._set_frequency | (self, chan, subdev, frequency, verbose=False) | Set the carrier frequency for the given subdevice.
@param chan specifies the DDC/DUC number
@param frequency the carrier frequency in Hz
@param verbose if true, print usrp tuning information | Set the carrier frequency for the given subdevice. | [
"Set",
"the",
"carrier",
"frequency",
"for",
"the",
"given",
"subdevice",
"."
] | def _set_frequency(self, chan, subdev, frequency, verbose=False):
"""
Set the carrier frequency for the given subdevice.
@param chan specifies the DDC/DUC number
@param frequency the carrier frequency in Hz
@param verbose if true, print usrp tuning information
"""
r = self._get_u().tune(chan, subdev, freq... | [
"def",
"_set_frequency",
"(",
"self",
",",
"chan",
",",
"subdev",
",",
"frequency",
",",
"verbose",
"=",
"False",
")",
":",
"r",
"=",
"self",
".",
"_get_u",
"(",
")",
".",
"tune",
"(",
"chan",
",",
"subdev",
",",
"frequency",
")",
"if",
"not",
"ver... | https://github.com/balint256/gr-baz/blob/937834ce3520b730277328d8e0cdebb3f2b1aafc/python/usrp/common.py#L31-L46 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/ssd/dataset/pycocotools/coco.py | python | COCO.info | (self) | Print information about the annotation file.
:return: | Print information about the annotation file.
:return: | [
"Print",
"information",
"about",
"the",
"annotation",
"file",
".",
":",
"return",
":"
] | def info(self):
"""
Print information about the annotation file.
:return:
"""
for key, value in self.dataset['info'].items():
print('{}: {}'.format(key, value)) | [
"def",
"info",
"(",
"self",
")",
":",
"for",
"key",
",",
"value",
"in",
"self",
".",
"dataset",
"[",
"'info'",
"]",
".",
"items",
"(",
")",
":",
"print",
"(",
"'{}: {}'",
".",
"format",
"(",
"key",
",",
"value",
")",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/ssd/dataset/pycocotools/coco.py#L116-L122 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mhlib.py | python | Message.__init__ | (self, f, n, fp = None) | Constructor. | Constructor. | [
"Constructor",
"."
] | def __init__(self, f, n, fp = None):
"""Constructor."""
self.folder = f
self.number = n
if fp is None:
path = f.getmessagefilename(n)
fp = open(path, 'r')
mimetools.Message.__init__(self, fp) | [
"def",
"__init__",
"(",
"self",
",",
"f",
",",
"n",
",",
"fp",
"=",
"None",
")",
":",
"self",
".",
"folder",
"=",
"f",
"self",
".",
"number",
"=",
"n",
"if",
"fp",
"is",
"None",
":",
"path",
"=",
"f",
".",
"getmessagefilename",
"(",
"n",
")",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mhlib.py#L665-L672 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/mox.py | python | MockAnything._Verify | (self) | Verify that all of the expected calls have been made.
Raises:
ExpectedMethodCallsError: if there are still more method calls in the
expected queue. | Verify that all of the expected calls have been made. | [
"Verify",
"that",
"all",
"of",
"the",
"expected",
"calls",
"have",
"been",
"made",
"."
] | def _Verify(self):
"""Verify that all of the expected calls have been made.
Raises:
ExpectedMethodCallsError: if there are still more method calls in the
expected queue.
"""
# If the list of expected calls is not empty, raise an exception
if self._expected_calls_queue:
# The la... | [
"def",
"_Verify",
"(",
"self",
")",
":",
"# If the list of expected calls is not empty, raise an exception",
"if",
"self",
".",
"_expected_calls_queue",
":",
"# The last MultipleTimesGroup is not popped from the queue.",
"if",
"(",
"len",
"(",
"self",
".",
"_expected_calls_queu... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/mox.py#L331-L347 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/pyct/cfg.py | python | GraphBuilder.enter_section | (self, section_id) | Enters a regular section.
Regular sections admit exit jumps, which end the section.
Args:
section_id: Hashable, the same node that will be used in calls to the
ast_node arg passed to add_exit_node | Enters a regular section. | [
"Enters",
"a",
"regular",
"section",
"."
] | def enter_section(self, section_id):
"""Enters a regular section.
Regular sections admit exit jumps, which end the section.
Args:
section_id: Hashable, the same node that will be used in calls to the
ast_node arg passed to add_exit_node
"""
assert section_id not in self.exits
sel... | [
"def",
"enter_section",
"(",
"self",
",",
"section_id",
")",
":",
"assert",
"section_id",
"not",
"in",
"self",
".",
"exits",
"self",
".",
"exits",
"[",
"section_id",
"]",
"=",
"set",
"(",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/pyct/cfg.py#L480-L490 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py | python | vecDistanceSquared | (inPtA, inPtB) | return ddx*ddx + ddy*ddy + ddz*ddz | calculate the square of the distance between two points | calculate the square of the distance between two points | [
"calculate",
"the",
"square",
"of",
"the",
"distance",
"between",
"two",
"points"
] | def vecDistanceSquared(inPtA, inPtB):
"calculate the square of the distance between two points"
ddx = inPtA[0] - inPtB[0]
ddy = inPtA[1] - inPtB[1]
ddz = inPtA[2] - inPtB[2]
return ddx*ddx + ddy*ddy + ddz*ddz | [
"def",
"vecDistanceSquared",
"(",
"inPtA",
",",
"inPtB",
")",
":",
"ddx",
"=",
"inPtA",
"[",
"0",
"]",
"-",
"inPtB",
"[",
"0",
"]",
"ddy",
"=",
"inPtA",
"[",
"1",
"]",
"-",
"inPtB",
"[",
"1",
"]",
"ddz",
"=",
"inPtA",
"[",
"2",
"]",
"-",
"inP... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py#L1856-L1861 | |
strukturag/libheif | 0082fea96ee70a20c8906a0373bedec0c01777bc | scripts/cpplint.py | python | _FunctionState.Check | (self, error, filename, linenum) | Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check. | Report if too many lines in function body. | [
"Report",
"if",
"too",
"many",
"lines",
"in",
"function",
"body",
"."
] | def Check(self, error, filename, linenum):
"""Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check.
"""
if not self.in_a_function:
return
if Match... | [
"def",
"Check",
"(",
"self",
",",
"error",
",",
"filename",
",",
"linenum",
")",
":",
"if",
"not",
"self",
".",
"in_a_function",
":",
"return",
"if",
"Match",
"(",
"r'T(EST|est)'",
",",
"self",
".",
"current_function",
")",
":",
"base_trigger",
"=",
"sel... | https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L1009-L1035 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/InitGui.py | python | ArchWorkbench.Activated | (self) | When entering the workbench. | When entering the workbench. | [
"When",
"entering",
"the",
"workbench",
"."
] | def Activated(self):
"""When entering the workbench."""
if hasattr(FreeCADGui, "draftToolBar"):
FreeCADGui.draftToolBar.Activated()
if hasattr(FreeCADGui, "Snapper"):
FreeCADGui.Snapper.show()
FreeCAD.Console.PrintLog("Arch workbench activated.\n") | [
"def",
"Activated",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"FreeCADGui",
",",
"\"draftToolBar\"",
")",
":",
"FreeCADGui",
".",
"draftToolBar",
".",
"Activated",
"(",
")",
"if",
"hasattr",
"(",
"FreeCADGui",
",",
"\"Snapper\"",
")",
":",
"FreeCADGui",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/InitGui.py#L214-L220 | ||
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/hpmc/external/field.py | python | Harmonic.energy_rotational | (self) | return self._cpp_obj.getEnergies(timestep)[1] | float: The energy associated with rotational fluctuations \
:math:`[\\mathrm{energy}]`.
:math:`V_\\mathrm{rotational}` | float: The energy associated with rotational fluctuations \
:math:`[\\mathrm{energy}]`. | [
"float",
":",
"The",
"energy",
"associated",
"with",
"rotational",
"fluctuations",
"\\",
":",
"math",
":",
"[",
"\\\\",
"mathrm",
"{",
"energy",
"}",
"]",
"."
] | def energy_rotational(self):
"""float: The energy associated with rotational fluctuations \
:math:`[\\mathrm{energy}]`.
:math:`V_\\mathrm{rotational}`
"""
timestep = self._simulation.timestep
return self._cpp_obj.getEnergies(timestep)[1] | [
"def",
"energy_rotational",
"(",
"self",
")",
":",
"timestep",
"=",
"self",
".",
"_simulation",
".",
"timestep",
"return",
"self",
".",
"_cpp_obj",
".",
"getEnergies",
"(",
"timestep",
")",
"[",
"1",
"]"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/external/field.py#L190-L197 | |
apache/madlib | be297fe6beada0640f93317e8948834032718e32 | src/madpack/upgrade_util.py | python | TableDependency._detect_index_dependency | (self) | @brief Detect the index dependencies on MADlib UDOCs | [] | def _detect_index_dependency(self):
"""
@brief Detect the index dependencies on MADlib UDOCs
"""
rows = self._run_sql(
"""
select
s.idxname, s.oid as opcoid, nsp.nspname as schema, s.name as opcname
from
pg_namespace nsp... | [
"def",
"_detect_index_dependency",
"(",
"self",
")",
":",
"rows",
"=",
"self",
".",
"_run_sql",
"(",
"\"\"\"\n select\n s.idxname, s.oid as opcoid, nsp.nspname as schema, s.name as opcname\n from\n pg_namespace nsp\n join\n ... | https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/upgrade_util.py#L883-L914 | |||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/output.py | python | Output.erase_down | (self) | Erases the screen from the current line down to the bottom of the
screen. | Erases the screen from the current line down to the bottom of the
screen. | [
"Erases",
"the",
"screen",
"from",
"the",
"current",
"line",
"down",
"to",
"the",
"bottom",
"of",
"the",
"screen",
"."
] | def erase_down(self):
"""
Erases the screen from the current line down to the bottom of the
screen.
""" | [
"def",
"erase_down",
"(",
"self",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/output.py#L86-L90 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | scripts/map_dump_file_to_code/map_file_to_code.py | python | ParseIrInfo.ir_path_parse | (self, ir_file) | return map_ir_file | parse the map file path. | parse the map file path. | [
"parse",
"the",
"map",
"file",
"path",
"."
] | def ir_path_parse(self, ir_file):
"""
parse the map file path.
"""
if ir_file == "":
print("[WARNING] No graph_path parameter, use current path as graph path.")
ir_file = os.path.abspath(os.path.dirname(__file__))
map_ir_file = ""
file_size = 0
... | [
"def",
"ir_path_parse",
"(",
"self",
",",
"ir_file",
")",
":",
"if",
"ir_file",
"==",
"\"\"",
":",
"print",
"(",
"\"[WARNING] No graph_path parameter, use current path as graph path.\"",
")",
"ir_file",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"pa... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/scripts/map_dump_file_to_code/map_file_to_code.py#L34-L55 | |
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/bg2/GUIINV.py | python | InitInventoryWindow | (Window) | return | Opens the inventory window. | Opens the inventory window. | [
"Opens",
"the",
"inventory",
"window",
"."
] | def InitInventoryWindow (Window):
"""Opens the inventory window."""
Window.AddAlias("WIN_INV")
Window.GetControl (0x1000003f).AddAlias("MsgSys", 1)
#ground items scrollbar
ScrollBar = Window.GetControl (66)
ScrollBar.SetEvent (IE_GUI_SCROLLBAR_ON_CHANGE, lambda: RefreshInventoryWindow(Window))
#Ground Item
f... | [
"def",
"InitInventoryWindow",
"(",
"Window",
")",
":",
"Window",
".",
"AddAlias",
"(",
"\"WIN_INV\"",
")",
"Window",
".",
"GetControl",
"(",
"0x1000003f",
")",
".",
"AddAlias",
"(",
"\"MsgSys\"",
",",
"1",
")",
"#ground items scrollbar",
"ScrollBar",
"=",
"Win... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/bg2/GUIINV.py#L34-L103 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_path/local.py | python | LocalPath.mkdir | (self, *args) | return p | create & return the directory joined with args. | create & return the directory joined with args. | [
"create",
"&",
"return",
"the",
"directory",
"joined",
"with",
"args",
"."
] | def mkdir(self, *args):
""" create & return the directory joined with args. """
p = self.join(*args)
py.error.checked_call(os.mkdir, fspath(p))
return p | [
"def",
"mkdir",
"(",
"self",
",",
"*",
"args",
")",
":",
"p",
"=",
"self",
".",
"join",
"(",
"*",
"args",
")",
"py",
".",
"error",
".",
"checked_call",
"(",
"os",
".",
"mkdir",
",",
"fspath",
"(",
"p",
")",
")",
"return",
"p"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/local.py#L470-L474 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/wizard.py | python | PyWizardPage.Create | (*args, **kwargs) | return _wizard.PyWizardPage_Create(*args, **kwargs) | Create(self, Wizard parent, Bitmap bitmap=wxNullBitmap) -> bool | Create(self, Wizard parent, Bitmap bitmap=wxNullBitmap) -> bool | [
"Create",
"(",
"self",
"Wizard",
"parent",
"Bitmap",
"bitmap",
"=",
"wxNullBitmap",
")",
"-",
">",
"bool"
] | def Create(*args, **kwargs):
"""Create(self, Wizard parent, Bitmap bitmap=wxNullBitmap) -> bool"""
return _wizard.PyWizardPage_Create(*args, **kwargs) | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"PyWizardPage_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/wizard.py#L143-L145 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/io.py | python | IO._load_dataset | (self, hdf_file=None, name=None, group=None) | Loads one structured dataset.
:param hdf_file: hdf file object from which structured dataset should be loaded.
:param name: name of dataset
:param group: name of the main group
:returns: loaded dataset | Loads one structured dataset.
:param hdf_file: hdf file object from which structured dataset should be loaded.
:param name: name of dataset
:param group: name of the main group
:returns: loaded dataset | [
"Loads",
"one",
"structured",
"dataset",
".",
":",
"param",
"hdf_file",
":",
"hdf",
"file",
"object",
"from",
"which",
"structured",
"dataset",
"should",
"be",
"loaded",
".",
":",
"param",
"name",
":",
"name",
"of",
"dataset",
":",
"param",
"group",
":",
... | def _load_dataset(self, hdf_file=None, name=None, group=None):
"""
Loads one structured dataset.
:param hdf_file: hdf file object from which structured dataset should be loaded.
:param name: name of dataset
:param group: name of the main group
:returns: loaded dataset
... | [
"def",
"_load_dataset",
"(",
"self",
",",
"hdf_file",
"=",
"None",
",",
"name",
"=",
"None",
",",
"group",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"\"Invalid name of the dataset.\"",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/io.py#L377-L406 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/fcompiler/gnu.py | python | GnuFCompiler._c_arch_flags | (self) | return arch_flags | Return detected arch flags from CFLAGS | Return detected arch flags from CFLAGS | [
"Return",
"detected",
"arch",
"flags",
"from",
"CFLAGS"
] | def _c_arch_flags(self):
""" Return detected arch flags from CFLAGS """
from distutils import sysconfig
try:
cflags = sysconfig.get_config_vars()['CFLAGS']
except KeyError:
return []
arch_re = re.compile(r"-arch\s+(\w+)")
arch_flags = []
fo... | [
"def",
"_c_arch_flags",
"(",
"self",
")",
":",
"from",
"distutils",
"import",
"sysconfig",
"try",
":",
"cflags",
"=",
"sysconfig",
".",
"get_config_vars",
"(",
")",
"[",
"'CFLAGS'",
"]",
"except",
"KeyError",
":",
"return",
"[",
"]",
"arch_re",
"=",
"re",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/fcompiler/gnu.py#L251-L262 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlNode.newNs | (self, href, prefix) | return __tmp | Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. Note that for a default
namespace, @prefix should be None. We use href==None in
the case of an element creation where the namespace was n... | Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. Note that for a default
namespace, | [
"Creation",
"of",
"a",
"new",
"Namespace",
".",
"This",
"function",
"will",
"refuse",
"to",
"create",
"a",
"namespace",
"with",
"a",
"similar",
"prefix",
"than",
"an",
"existing",
"one",
"present",
"on",
"this",
"node",
".",
"Note",
"that",
"for",
"a",
"... | def newNs(self, href, prefix):
"""Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. Note that for a default
namespace, @prefix should be None. We use href==None in
the case of an ... | [
"def",
"newNs",
"(",
"self",
",",
"href",
",",
"prefix",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlNewNs",
"(",
"self",
".",
"_o",
",",
"href",
",",
"prefix",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlNewNs() failed'",
"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2577-L2587 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/quoprimime.py | python | body_check | (octet) | return chr(octet) != _QUOPRI_BODY_MAP[octet] | Return True if the octet should be escaped with body quopri. | Return True if the octet should be escaped with body quopri. | [
"Return",
"True",
"if",
"the",
"octet",
"should",
"be",
"escaped",
"with",
"body",
"quopri",
"."
] | def body_check(octet):
"""Return True if the octet should be escaped with body quopri."""
return chr(octet) != _QUOPRI_BODY_MAP[octet] | [
"def",
"body_check",
"(",
"octet",
")",
":",
"return",
"chr",
"(",
"octet",
")",
"!=",
"_QUOPRI_BODY_MAP",
"[",
"octet",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/quoprimime.py#L79-L81 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TInt_GetMegaStr | (*args) | return _snap.TInt_GetMegaStr(*args) | TInt_GetMegaStr(int const & Val) -> TStr
Parameters:
Val: int const & | TInt_GetMegaStr(int const & Val) -> TStr | [
"TInt_GetMegaStr",
"(",
"int",
"const",
"&",
"Val",
")",
"-",
">",
"TStr"
] | def TInt_GetMegaStr(*args):
"""
TInt_GetMegaStr(int const & Val) -> TStr
Parameters:
Val: int const &
"""
return _snap.TInt_GetMegaStr(*args) | [
"def",
"TInt_GetMegaStr",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TInt_GetMegaStr",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L13492-L13500 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | OperatorExpression._simplify | (self,context=None,depth=None,constant_expansion=True) | return simplest | Returns a new expression, or None if this cannot be simplified.
Simplification has three phases:
- pre-simplification (top-down): each expression examines its immediate children for
possible symbolic simplification. Then, it pre-simplifies its descendents.
- post-simplification (bot... | Returns a new expression, or None if this cannot be simplified. | [
"Returns",
"a",
"new",
"expression",
"or",
"None",
"if",
"this",
"cannot",
"be",
"simplified",
"."
] | def _simplify(self,context=None,depth=None,constant_expansion=True):
"""Returns a new expression, or None if this cannot be simplified.
Simplification has three phases:
- pre-simplification (top-down): each expression examines its immediate children for
possible symbolic simplificati... | [
"def",
"_simplify",
"(",
"self",
",",
"context",
"=",
"None",
",",
"depth",
"=",
"None",
",",
"constant_expansion",
"=",
"True",
")",
":",
"if",
"_DEBUG_SIMPLIFY",
":",
"print",
"(",
"\"Simplifying expression\"",
",",
"self",
",",
"\"to depth\"",
",",
"depth... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L4275-L4317 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py | python | ReflectometryISISLoadAndProcess._removePrefix | (self, workspace, isTrans) | Remove the TOF prefix from the given workspace name | Remove the TOF prefix from the given workspace name | [
"Remove",
"the",
"TOF",
"prefix",
"from",
"the",
"given",
"workspace",
"name"
] | def _removePrefix(self, workspace, isTrans):
"""Remove the TOF prefix from the given workspace name"""
prefix = self._transPrefix if isTrans else self._tofPrefix
prefix_len = len(prefix)
name_start = workspace[:prefix_len]
if len(workspace) > prefix_len and name_start == prefix:
... | [
"def",
"_removePrefix",
"(",
"self",
",",
"workspace",
",",
"isTrans",
")",
":",
"prefix",
"=",
"self",
".",
"_transPrefix",
"if",
"isTrans",
"else",
"self",
".",
"_tofPrefix",
"prefix_len",
"=",
"len",
"(",
"prefix",
")",
"name_start",
"=",
"workspace",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py#L447-L455 | ||
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/busco/BuscoAnalysis.py | python | BuscoAnalysis._create_main_and_tmp_dirs | (self) | This function creates the run(main) and the temporary directories
:raises SystemExit: if a run with the same name already exists and
the force option is not set
:raises SystemExit: if the user cannot write in the tmp directory | This function creates the run(main) and the temporary directories
:raises SystemExit: if a run with the same name already exists and
the force option is not set
:raises SystemExit: if the user cannot write in the tmp directory | [
"This",
"function",
"creates",
"the",
"run",
"(",
"main",
")",
"and",
"the",
"temporary",
"directories",
":",
"raises",
"SystemExit",
":",
"if",
"a",
"run",
"with",
"the",
"same",
"name",
"already",
"exists",
"and",
"the",
"force",
"option",
"is",
"not",
... | def _create_main_and_tmp_dirs(self):
"""
This function creates the run(main) and the temporary directories
:raises SystemExit: if a run with the same name already exists and
the force option is not set
:raises SystemExit: if the user cannot write in the tmp directory
"""
... | [
"def",
"_create_main_and_tmp_dirs",
"(",
"self",
")",
":",
"# final output directory",
"self",
".",
"mainout",
"=",
"self",
".",
"_root_folder",
"+",
"'run_%s/'",
"%",
"self",
".",
"_out",
"# complain about the -r option if there is no checkpoint.tmp file",
"if",
"not",
... | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/busco/BuscoAnalysis.py#L740-L800 | ||
peterljq/OpenMMD | 795d4dd660cf7e537ceb599fdb038c5388b33390 | VMD 3D Pose Baseline Multi-Objects/packages/lifting/utils/process.py | python | gaussian_heatmap | (h, w, pos_x, pos_y, sigma_h=1, sigma_w=1, init=None) | return hmap | Compute the heat-map of size (w x h) with a gaussian distribution fit in
position (pos_x, pos_y) and a convariance matix defined by the related
sigma values.
The resulting heat-map can be summed to a given heat-map init. | Compute the heat-map of size (w x h) with a gaussian distribution fit in
position (pos_x, pos_y) and a convariance matix defined by the related
sigma values.
The resulting heat-map can be summed to a given heat-map init. | [
"Compute",
"the",
"heat",
"-",
"map",
"of",
"size",
"(",
"w",
"x",
"h",
")",
"with",
"a",
"gaussian",
"distribution",
"fit",
"in",
"position",
"(",
"pos_x",
"pos_y",
")",
"and",
"a",
"convariance",
"matix",
"defined",
"by",
"the",
"related",
"sigma",
"... | def gaussian_heatmap(h, w, pos_x, pos_y, sigma_h=1, sigma_w=1, init=None):
"""
Compute the heat-map of size (w x h) with a gaussian distribution fit in
position (pos_x, pos_y) and a convariance matix defined by the related
sigma values.
The resulting heat-map can be summed to a given heat-map init.
... | [
"def",
"gaussian_heatmap",
"(",
"h",
",",
"w",
",",
"pos_x",
",",
"pos_y",
",",
"sigma_h",
"=",
"1",
",",
"sigma_w",
"=",
"1",
",",
"init",
"=",
"None",
")",
":",
"init",
"=",
"init",
"if",
"init",
"is",
"not",
"None",
"else",
"[",
"]",
"cov_matr... | https://github.com/peterljq/OpenMMD/blob/795d4dd660cf7e537ceb599fdb038c5388b33390/VMD 3D Pose Baseline Multi-Objects/packages/lifting/utils/process.py#L60-L89 | |
etodd/lasercrabs | 91484d9ac3a47ac38b8f40ec3ff35194714dad8e | assets/script/etodd_blender_fbx/fbx_utils.py | python | get_blender_empty_key | (obj) | return "|".join((get_blenderID_key(obj), "Empty")) | Return bone's keys (Model and NodeAttribute). | Return bone's keys (Model and NodeAttribute). | [
"Return",
"bone",
"s",
"keys",
"(",
"Model",
"and",
"NodeAttribute",
")",
"."
] | def get_blender_empty_key(obj):
"""Return bone's keys (Model and NodeAttribute)."""
return "|".join((get_blenderID_key(obj), "Empty")) | [
"def",
"get_blender_empty_key",
"(",
"obj",
")",
":",
"return",
"\"|\"",
".",
"join",
"(",
"(",
"get_blenderID_key",
"(",
"obj",
")",
",",
"\"Empty\"",
")",
")"
] | https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/fbx_utils.py#L369-L371 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/image_ops_impl.py | python | _assert | (cond, ex_type, msg) | A polymorphic assert, works with tensors and boolean expressions.
If `cond` is not a tensor, behave like an ordinary assert statement, except
that a empty list is returned. If `cond` is a tensor, return a list
containing a single TensorFlow assert op.
Args:
cond: Something evaluates to a boolean value. Ma... | A polymorphic assert, works with tensors and boolean expressions. | [
"A",
"polymorphic",
"assert",
"works",
"with",
"tensors",
"and",
"boolean",
"expressions",
"."
] | def _assert(cond, ex_type, msg):
"""A polymorphic assert, works with tensors and boolean expressions.
If `cond` is not a tensor, behave like an ordinary assert statement, except
that a empty list is returned. If `cond` is a tensor, return a list
containing a single TensorFlow assert op.
Args:
cond: Some... | [
"def",
"_assert",
"(",
"cond",
",",
"ex_type",
",",
"msg",
")",
":",
"if",
"_is_tensor",
"(",
"cond",
")",
":",
"return",
"[",
"control_flow_ops",
".",
"Assert",
"(",
"cond",
",",
"[",
"msg",
"]",
")",
"]",
"else",
":",
"if",
"not",
"cond",
":",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/image_ops_impl.py#L60-L81 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py | python | Pdb.do_commands | (self, arg) | commands [bpnumber]
(com) ...
(com) end
(Pdb)
Specify a list of commands for breakpoint number bpnumber.
The commands themselves are entered on the following lines.
Type a line containing just 'end' to terminate the commands.
The commands are executed when the br... | commands [bpnumber]
(com) ...
(com) end
(Pdb) | [
"commands",
"[",
"bpnumber",
"]",
"(",
"com",
")",
"...",
"(",
"com",
")",
"end",
"(",
"Pdb",
")"
] | def do_commands(self, arg):
"""commands [bpnumber]
(com) ...
(com) end
(Pdb)
Specify a list of commands for breakpoint number bpnumber.
The commands themselves are entered on the following lines.
Type a line containing just 'end' to terminate the commands.
... | [
"def",
"do_commands",
"(",
"self",
",",
"arg",
")",
":",
"if",
"not",
"arg",
":",
"bnum",
"=",
"len",
"(",
"bdb",
".",
"Breakpoint",
".",
"bpbynumber",
")",
"-",
"1",
"else",
":",
"try",
":",
"bnum",
"=",
"int",
"(",
"arg",
")",
"except",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py#L515-L590 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/HuggingFace/T5/onnxrt.py | python | T5ONNXRT.args_to_network_metadata | (self, args) | return NetworkMetadata(
variant=frameworks_parsed_metadata.variant,
precision=Precision(fp16=args.fp16),
other=frameworks_parsed_metadata.other,
) | Override args to metadata to use export subroutine. | Override args to metadata to use export subroutine. | [
"Override",
"args",
"to",
"metadata",
"to",
"use",
"export",
"subroutine",
"."
] | def args_to_network_metadata(self, args) -> NetworkMetadata:
"""Override args to metadata to use export subroutine."""
frameworks_parsed_metadata = self.frameworks_cmd.args_to_network_metadata(args)
return NetworkMetadata(
variant=frameworks_parsed_metadata.variant,
prec... | [
"def",
"args_to_network_metadata",
"(",
"self",
",",
"args",
")",
"->",
"NetworkMetadata",
":",
"frameworks_parsed_metadata",
"=",
"self",
".",
"frameworks_cmd",
".",
"args_to_network_metadata",
"(",
"args",
")",
"return",
"NetworkMetadata",
"(",
"variant",
"=",
"fr... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/T5/onnxrt.py#L279-L287 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/combo.py | python | ComboCtrl.ShouldDrawFocus | (*args, **kwargs) | return _combo.ComboCtrl_ShouldDrawFocus(*args, **kwargs) | ShouldDrawFocus(self) -> bool
Returns true if focus indicator should be drawn in the control. | ShouldDrawFocus(self) -> bool | [
"ShouldDrawFocus",
"(",
"self",
")",
"-",
">",
"bool"
] | def ShouldDrawFocus(*args, **kwargs):
"""
ShouldDrawFocus(self) -> bool
Returns true if focus indicator should be drawn in the control.
"""
return _combo.ComboCtrl_ShouldDrawFocus(*args, **kwargs) | [
"def",
"ShouldDrawFocus",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboCtrl_ShouldDrawFocus",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L438-L444 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/fictitious_play.py | python | XFPSolver.average_policy | (self) | return JointPolicy(self._game, self._policies) | Returns the current average joint policy (policy for all players). | Returns the current average joint policy (policy for all players). | [
"Returns",
"the",
"current",
"average",
"joint",
"policy",
"(",
"policy",
"for",
"all",
"players",
")",
"."
] | def average_policy(self):
"""Returns the current average joint policy (policy for all players)."""
return JointPolicy(self._game, self._policies) | [
"def",
"average_policy",
"(",
"self",
")",
":",
"return",
"JointPolicy",
"(",
"self",
".",
"_game",
",",
"self",
".",
"_policies",
")"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/fictitious_play.py#L165-L167 | |
falkTX/Carla | 74a1ae82c90db85f20550ddcdc8a927b8fb7e414 | source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py | python | Instance.get_extension_data | (self, uri) | Get extension data from the plugin instance.
The type and semantics of the data returned is specific to the particular
extension, though in all cases it is shared and must not be deleted. | Get extension data from the plugin instance. | [
"Get",
"extension",
"data",
"from",
"the",
"plugin",
"instance",
"."
] | def get_extension_data(self, uri):
"""Get extension data from the plugin instance.
The type and semantics of the data returned is specific to the particular
extension, though in all cases it is shared and must not be deleted.
"""
if self.get_descriptor().extension_data:
... | [
"def",
"get_extension_data",
"(",
"self",
",",
"uri",
")",
":",
"if",
"self",
".",
"get_descriptor",
"(",
")",
".",
"extension_data",
":",
"return",
"self",
".",
"get_descriptor",
"(",
")",
".",
"extension_data",
"(",
"str",
"(",
"uri",
")",
")"
] | https://github.com/falkTX/Carla/blob/74a1ae82c90db85f20550ddcdc8a927b8fb7e414/source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py#L1247-L1254 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/python/util.py | python | get_grappler_config | (optimizers_list) | return config | Creates a tf.compat.v1.ConfigProto for configuring Grappler.
Args:
optimizers_list: List of strings that represents the list of optimizers.
Returns:
tf.ConfigProto. | Creates a tf.compat.v1.ConfigProto for configuring Grappler. | [
"Creates",
"a",
"tf",
".",
"compat",
".",
"v1",
".",
"ConfigProto",
"for",
"configuring",
"Grappler",
"."
] | def get_grappler_config(optimizers_list):
"""Creates a tf.compat.v1.ConfigProto for configuring Grappler.
Args:
optimizers_list: List of strings that represents the list of optimizers.
Returns:
tf.ConfigProto.
"""
config = _config_pb2.ConfigProto()
rewrite_options = config.graph_options.rewrite_op... | [
"def",
"get_grappler_config",
"(",
"optimizers_list",
")",
":",
"config",
"=",
"_config_pb2",
".",
"ConfigProto",
"(",
")",
"rewrite_options",
"=",
"config",
".",
"graph_options",
".",
"rewrite_options",
"for",
"optimizer",
"in",
"optimizers_list",
":",
"rewrite_opt... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/util.py#L206-L219 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/cptools.py | python | proxy | (base=None, local='X-Forwarded-Host', remote='X-Forwarded-For',
scheme='X-Forwarded-Proto', debug=False) | Change the base URL (scheme://host[:port][/path]).
For running a CP server behind Apache, lighttpd, or other HTTP server.
For Apache and lighttpd, you should leave the 'local' argument at the
default value of 'X-Forwarded-Host'. For Squid, you probably want to set
tools.proxy.local = 'Origin'.... | Change the base URL (scheme://host[:port][/path]).
For running a CP server behind Apache, lighttpd, or other HTTP server.
For Apache and lighttpd, you should leave the 'local' argument at the
default value of 'X-Forwarded-Host'. For Squid, you probably want to set
tools.proxy.local = 'Origin'.... | [
"Change",
"the",
"base",
"URL",
"(",
"scheme",
":",
"//",
"host",
"[",
":",
"port",
"]",
"[",
"/",
"path",
"]",
")",
".",
"For",
"running",
"a",
"CP",
"server",
"behind",
"Apache",
"lighttpd",
"or",
"other",
"HTTP",
"server",
".",
"For",
"Apache",
... | def proxy(base=None, local='X-Forwarded-Host', remote='X-Forwarded-For',
scheme='X-Forwarded-Proto', debug=False):
"""Change the base URL (scheme://host[:port][/path]).
For running a CP server behind Apache, lighttpd, or other HTTP server.
For Apache and lighttpd, you should leave the 'l... | [
"def",
"proxy",
"(",
"base",
"=",
"None",
",",
"local",
"=",
"'X-Forwarded-Host'",
",",
"remote",
"=",
"'X-Forwarded-For'",
",",
"scheme",
"=",
"'X-Forwarded-Proto'",
",",
"debug",
"=",
"False",
")",
":",
"request",
"=",
"cherrypy",
".",
"serving",
".",
"r... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/cptools.py#L148-L212 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/ltisys.py | python | StateSpace.__new__ | (cls, *system, **kwargs) | return super(StateSpace, cls).__new__(cls) | Create new StateSpace object and settle inheritance. | Create new StateSpace object and settle inheritance. | [
"Create",
"new",
"StateSpace",
"object",
"and",
"settle",
"inheritance",
"."
] | def __new__(cls, *system, **kwargs):
"""Create new StateSpace object and settle inheritance."""
# Handle object conversion if input is an instance of `lti`
if len(system) == 1 and isinstance(system[0], LinearTimeInvariant):
return system[0].to_ss()
# Choose whether to inheri... | [
"def",
"__new__",
"(",
"cls",
",",
"*",
"system",
",",
"*",
"*",
"kwargs",
")",
":",
"# Handle object conversion if input is an instance of `lti`",
"if",
"len",
"(",
"system",
")",
"==",
"1",
"and",
"isinstance",
"(",
"system",
"[",
"0",
"]",
",",
"LinearTim... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L1465-L1481 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/plotting/plotscriptgenerator/__init__.py | python | get_plot_cmds | (ax, ax_object_var) | return cmds | Get commands such as axes.plot or axes.errorbar | Get commands such as axes.plot or axes.errorbar | [
"Get",
"commands",
"such",
"as",
"axes",
".",
"plot",
"or",
"axes",
".",
"errorbar"
] | def get_plot_cmds(ax, ax_object_var):
"""Get commands such as axes.plot or axes.errorbar"""
cmds = []
for artist in sorted_lines_in(ax, ax.get_tracked_artists()):
cmds.append("{ax_obj}.{cmd}".format(ax_obj=ax_object_var,
cmd=generate_plot_command(artist)))... | [
"def",
"get_plot_cmds",
"(",
"ax",
",",
"ax_object_var",
")",
":",
"cmds",
"=",
"[",
"]",
"for",
"artist",
"in",
"sorted_lines_in",
"(",
"ax",
",",
"ax",
".",
"get_tracked_artists",
"(",
")",
")",
":",
"cmds",
".",
"append",
"(",
"\"{ax_obj}.{cmd}\"",
".... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plotting/plotscriptgenerator/__init__.py#L127-L133 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/roi_data_layer/roidb.py | python | _compute_targets | (rois, overlaps, labels) | return targets | Compute bounding-box regression targets for an image. | Compute bounding-box regression targets for an image. | [
"Compute",
"bounding",
"-",
"box",
"regression",
"targets",
"for",
"an",
"image",
"."
] | def _compute_targets(rois, overlaps, labels):
"""Compute bounding-box regression targets for an image."""
# Indices of ground-truth ROIs
gt_inds = np.where(overlaps == 1)[0]
if len(gt_inds) == 0:
# Bail if the image has no ground-truth ROIs
return np.zeros((rois.shape[0], 5), dtype=np.fl... | [
"def",
"_compute_targets",
"(",
"rois",
",",
"overlaps",
",",
"labels",
")",
":",
"# Indices of ground-truth ROIs",
"gt_inds",
"=",
"np",
".",
"where",
"(",
"overlaps",
"==",
"1",
")",
"[",
"0",
"]",
"if",
"len",
"(",
"gt_inds",
")",
"==",
"0",
":",
"#... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/roi_data_layer/roidb.py#L114-L138 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py | python | _register_pythonizations | () | Registers the ROOT pythonizations with cppyy for lazy injection. | Registers the ROOT pythonizations with cppyy for lazy injection. | [
"Registers",
"the",
"ROOT",
"pythonizations",
"with",
"cppyy",
"for",
"lazy",
"injection",
"."
] | def _register_pythonizations():
'''
Registers the ROOT pythonizations with cppyy for lazy injection.
'''
exclude = [ '_rdf_utils' ]
for _, module_name, _ in pkgutil.walk_packages(__path__):
if module_name not in exclude:
importlib.import_module(__name__ + '.' + module_name) | [
"def",
"_register_pythonizations",
"(",
")",
":",
"exclude",
"=",
"[",
"'_rdf_utils'",
"]",
"for",
"_",
",",
"module_name",
",",
"_",
"in",
"pkgutil",
".",
"walk_packages",
"(",
"__path__",
")",
":",
"if",
"module_name",
"not",
"in",
"exclude",
":",
"impor... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py#L343-L351 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialutil.py | python | SerialBase.write_timeout | (self) | return self._write_timeout | Get the current timeout setting. | Get the current timeout setting. | [
"Get",
"the",
"current",
"timeout",
"setting",
"."
] | def write_timeout(self):
"""Get the current timeout setting."""
return self._write_timeout | [
"def",
"write_timeout",
"(",
"self",
")",
":",
"return",
"self",
".",
"_write_timeout"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialutil.py#L371-L373 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | ScrollWinEvent.SetPosition | (*args, **kwargs) | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) | SetPosition(self, int pos) | SetPosition(self, int pos) | [
"SetPosition",
"(",
"self",
"int",
"pos",
")"
] | def SetPosition(*args, **kwargs):
"""SetPosition(self, int pos)"""
return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) | [
"def",
"SetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ScrollWinEvent_SetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L5497-L5499 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/misc_util.py | python | mingw32 | () | return False | Return true when using mingw32 environment. | Return true when using mingw32 environment. | [
"Return",
"true",
"when",
"using",
"mingw32",
"environment",
"."
] | def mingw32():
"""Return true when using mingw32 environment.
"""
if sys.platform=='win32':
if os.environ.get('OSTYPE', '')=='msys':
return True
if os.environ.get('MSYSTEM', '')=='MINGW32':
return True
return False | [
"def",
"mingw32",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'OSTYPE'",
",",
"''",
")",
"==",
"'msys'",
":",
"return",
"True",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'MS... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/misc_util.py#L345-L353 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py | python | PopenSpawn.kill | (self, sig) | Sends a Unix signal to the subprocess.
Use constants from the :mod:`signal` module to specify which signal. | Sends a Unix signal to the subprocess. | [
"Sends",
"a",
"Unix",
"signal",
"to",
"the",
"subprocess",
"."
] | def kill(self, sig):
'''Sends a Unix signal to the subprocess.
Use constants from the :mod:`signal` module to specify which signal.
'''
if sys.platform == 'win32':
if sig in [signal.SIGINT, signal.CTRL_C_EVENT]:
sig = signal.CTRL_C_EVENT
elif sig ... | [
"def",
"kill",
"(",
"self",
",",
"sig",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"if",
"sig",
"in",
"[",
"signal",
".",
"SIGINT",
",",
"signal",
".",
"CTRL_C_EVENT",
"]",
":",
"sig",
"=",
"signal",
".",
"CTRL_C_EVENT",
"elif",
... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py#L171-L184 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/containers.py | python | BaseContainer.__len__ | (self) | return len(self._values) | Returns the number of elements in the container. | Returns the number of elements in the container. | [
"Returns",
"the",
"number",
"of",
"elements",
"in",
"the",
"container",
"."
] | def __len__(self):
"""Returns the number of elements in the container."""
return len(self._values) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_values",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/containers.py#L65-L67 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/six.py | python | _SixMetaPathImporter.get_code | (self, fullname) | return None | Return None
Required, if is_package is implemented | Return None | [
"Return",
"None"
] | def get_code(self, fullname):
"""Return None
Required, if is_package is implemented"""
self.__get_module(fullname) # eventually raises ImportError
return None | [
"def",
"get_code",
"(",
"self",
",",
"fullname",
")",
":",
"self",
".",
"__get_module",
"(",
"fullname",
")",
"# eventually raises ImportError",
"return",
"None"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/six.py#L218-L223 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/viewer/pv/show3d.py | python | Show3D.updateParameterView | (self, param=None) | Change the view to given Parameter values.
Parameters
----------
param: Current text of the just triggered QComboBox
Note
----
May be overloaded. | Change the view to given Parameter values. | [
"Change",
"the",
"view",
"to",
"given",
"Parameter",
"values",
"."
] | def updateParameterView(self, param=None):
"""
Change the view to given Parameter values.
Parameters
----------
param: Current text of the just triggered QComboBox
Note
----
May be overloaded.
"""
# remove the currently displayed mesh
... | [
"def",
"updateParameterView",
"(",
"self",
",",
"param",
"=",
"None",
")",
":",
"# remove the currently displayed mesh",
"self",
".",
"plotter",
".",
"remove_actor",
"(",
"self",
".",
"_actor",
")",
"mesh",
"=",
"self",
".",
"mesh",
"if",
"param",
"is",
"not... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/viewer/pv/show3d.py#L260-L330 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/python/mlir/dialects/linalg/opdsl/lang/config.py | python | LinalgOpConfig.from_linalg_op_def | (
tc_op_def: LinalgOpDef,
context: Optional[_ir.Context] = None) | return [
LinalgOpConfig(
tc_op_def.metadata,
structured_op=LinalgStructuredOpConfig(
tc_op_def.comprehensions[0], tc_op_def.domain,
tc_op_def.registered_operands.values(), context)),
] | Expands a LinalgOpDef into corresponding Linalg configured ops. | Expands a LinalgOpDef into corresponding Linalg configured ops. | [
"Expands",
"a",
"LinalgOpDef",
"into",
"corresponding",
"Linalg",
"configured",
"ops",
"."
] | def from_linalg_op_def(
tc_op_def: LinalgOpDef,
context: Optional[_ir.Context] = None) -> Sequence["LinalgOpConfig"]:
"""Expands a LinalgOpDef into corresponding Linalg configured ops."""
# TODO: Many LinalgOpDef patterns need to expand to multiple generics.
assert len(
tc_op_def.compreh... | [
"def",
"from_linalg_op_def",
"(",
"tc_op_def",
":",
"LinalgOpDef",
",",
"context",
":",
"Optional",
"[",
"_ir",
".",
"Context",
"]",
"=",
"None",
")",
"->",
"Sequence",
"[",
"\"LinalgOpConfig\"",
"]",
":",
"# TODO: Many LinalgOpDef patterns need to expand to multiple ... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/linalg/opdsl/lang/config.py#L423-L436 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py | python | slogdet | (a) | return sign, logdet | Compute the sign and (natural) logarithm of the determinant of an array.
If an array has a very small or very large determinant, then a call to
`det` may overflow or underflow. This routine is more robust against such
issues, because it computes the logarithm of the determinant rather than
the determin... | Compute the sign and (natural) logarithm of the determinant of an array. | [
"Compute",
"the",
"sign",
"and",
"(",
"natural",
")",
"logarithm",
"of",
"the",
"determinant",
"of",
"an",
"array",
"."
] | def slogdet(a):
"""
Compute the sign and (natural) logarithm of the determinant of an array.
If an array has a very small or very large determinant, then a call to
`det` may overflow or underflow. This routine is more robust against such
issues, because it computes the logarithm of the determinant ... | [
"def",
"slogdet",
"(",
"a",
")",
":",
"a",
"=",
"asarray",
"(",
"a",
")",
"_assert_stacked_2d",
"(",
"a",
")",
"_assert_stacked_square",
"(",
"a",
")",
"t",
",",
"result_t",
"=",
"_commonType",
"(",
"a",
")",
"real_t",
"=",
"_realType",
"(",
"result_t"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py#L1977-L2060 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetSelectionNAnchorVirtualSpace | (*args, **kwargs) | return _stc.StyledTextCtrl_GetSelectionNAnchorVirtualSpace(*args, **kwargs) | GetSelectionNAnchorVirtualSpace(self, int selection) -> int | GetSelectionNAnchorVirtualSpace(self, int selection) -> int | [
"GetSelectionNAnchorVirtualSpace",
"(",
"self",
"int",
"selection",
")",
"-",
">",
"int"
] | def GetSelectionNAnchorVirtualSpace(*args, **kwargs):
"""GetSelectionNAnchorVirtualSpace(self, int selection) -> int"""
return _stc.StyledTextCtrl_GetSelectionNAnchorVirtualSpace(*args, **kwargs) | [
"def",
"GetSelectionNAnchorVirtualSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetSelectionNAnchorVirtualSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6172-L6174 | |
leela-zero/leela-zero | e3ed6310d33d75078ba74c3adf887d18439fc2e3 | scripts/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/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L1051-L1053 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.LineBreak | (*args, **kwargs) | return _richtext.RichTextCtrl_LineBreak(*args, **kwargs) | LineBreak(self) -> bool
Insert a line break at the current insertion point. | LineBreak(self) -> bool | [
"LineBreak",
"(",
"self",
")",
"-",
">",
"bool"
] | def LineBreak(*args, **kwargs):
"""
LineBreak(self) -> bool
Insert a line break at the current insertion point.
"""
return _richtext.RichTextCtrl_LineBreak(*args, **kwargs) | [
"def",
"LineBreak",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_LineBreak",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3291-L3297 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_psbsd.py | python | Process.cwd | (self) | Return process current working directory. | Return process current working directory. | [
"Return",
"process",
"current",
"working",
"directory",
"."
] | def cwd(self):
"""Return process current working directory."""
# sometimes we get an empty string, in which case we turn
# it into None
if OPENBSD and self.pid == 0:
return None # ...else it would raise EINVAL
elif NETBSD or HAS_PROC_OPEN_FILES:
# FreeBSD... | [
"def",
"cwd",
"(",
"self",
")",
":",
"# sometimes we get an empty string, in which case we turn",
"# it into None",
"if",
"OPENBSD",
"and",
"self",
".",
"pid",
"==",
"0",
":",
"return",
"None",
"# ...else it would raise EINVAL",
"elif",
"NETBSD",
"or",
"HAS_PROC_OPEN_FI... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_psbsd.py#L821-L834 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Brush.GetColour | (*args, **kwargs) | return _gdi_.Brush_GetColour(*args, **kwargs) | GetColour(self) -> Colour
Returns the `wx.Colour` of the brush. | GetColour(self) -> Colour | [
"GetColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetColour(*args, **kwargs):
"""
GetColour(self) -> Colour
Returns the `wx.Colour` of the brush.
"""
return _gdi_.Brush_GetColour(*args, **kwargs) | [
"def",
"GetColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Brush_GetColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L545-L551 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/browser.py | python | ChildBrowserTreeItem.OnDoubleClick | (self) | Open module with file_open and position to lineno. | Open module with file_open and position to lineno. | [
"Open",
"module",
"with",
"file_open",
"and",
"position",
"to",
"lineno",
"."
] | def OnDoubleClick(self):
"Open module with file_open and position to lineno."
try:
edit = file_open(self.obj.file)
edit.gotoline(self.obj.lineno)
except (OSError, AttributeError):
pass | [
"def",
"OnDoubleClick",
"(",
"self",
")",
":",
"try",
":",
"edit",
"=",
"file_open",
"(",
"self",
".",
"obj",
".",
"file",
")",
"edit",
".",
"gotoline",
"(",
"self",
".",
"obj",
".",
"lineno",
")",
"except",
"(",
"OSError",
",",
"AttributeError",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/browser.py#L223-L229 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | FileSystemHandler.GetLeftLocation | (*args, **kwargs) | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | GetLeftLocation(String location) -> String | GetLeftLocation(String location) -> String | [
"GetLeftLocation",
"(",
"String",
"location",
")",
"-",
">",
"String"
] | def GetLeftLocation(*args, **kwargs):
"""GetLeftLocation(String location) -> String"""
return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | [
"def",
"GetLeftLocation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystemHandler_GetLeftLocation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2365-L2367 | |
Sigil-Ebook/Sigil | 0d145d3a4874b4a26f7aabd68dbd9d18a2402e52 | src/Resource_Files/plugin_launchers/python/sigil_bs4/element.py | python | Tag.__iter__ | (self) | return iter(self.contents) | Iterating over a tag iterates over its contents. | Iterating over a tag iterates over its contents. | [
"Iterating",
"over",
"a",
"tag",
"iterates",
"over",
"its",
"contents",
"."
] | def __iter__(self):
"Iterating over a tag iterates over its contents."
return iter(self.contents) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"contents",
")"
] | https://github.com/Sigil-Ebook/Sigil/blob/0d145d3a4874b4a26f7aabd68dbd9d18a2402e52/src/Resource_Files/plugin_launchers/python/sigil_bs4/element.py#L995-L997 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/fileinput.py | python | input | (files=None, inplace=0, backup="", bufsize=0,
mode="r", openhook=None) | return _state | input([files[, inplace[, backup[, mode[, openhook]]]]])
Create an instance of the FileInput class. The instance will be used
as global state for the functions of this module, and is also returned
to use during iteration. The parameters to this function will be passed
along to the constructor of the Fil... | input([files[, inplace[, backup[, mode[, openhook]]]]]) | [
"input",
"(",
"[",
"files",
"[",
"inplace",
"[",
"backup",
"[",
"mode",
"[",
"openhook",
"]]]]]",
")"
] | def input(files=None, inplace=0, backup="", bufsize=0,
mode="r", openhook=None):
"""input([files[, inplace[, backup[, mode[, openhook]]]]])
Create an instance of the FileInput class. The instance will be used
as global state for the functions of this module, and is also returned
to use during... | [
"def",
"input",
"(",
"files",
"=",
"None",
",",
"inplace",
"=",
"0",
",",
"backup",
"=",
"\"\"",
",",
"bufsize",
"=",
"0",
",",
"mode",
"=",
"\"r\"",
",",
"openhook",
"=",
"None",
")",
":",
"global",
"_state",
"if",
"_state",
"and",
"_state",
".",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/fileinput.py#L91-L104 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/ssd/tools/caffe_converter/compare_layers.py | python | compare_layers_from_nets | (caffe_net, arg_params, aux_params, exe, layer_name_to_record,
top_to_layers, mean_diff_allowed, max_diff_allowed) | return | Compare layer by layer of a caffe network with mxnet network
:param caffe_net: loaded caffe network
:param arg_params: arguments
:param aux_params: auxiliary parameters
:param exe: mxnet model
:param layer_name_to_record: map between caffe layer and information record
:param top_to_layers: map b... | Compare layer by layer of a caffe network with mxnet network
:param caffe_net: loaded caffe network
:param arg_params: arguments
:param aux_params: auxiliary parameters
:param exe: mxnet model
:param layer_name_to_record: map between caffe layer and information record
:param top_to_layers: map b... | [
"Compare",
"layer",
"by",
"layer",
"of",
"a",
"caffe",
"network",
"with",
"mxnet",
"network",
":",
"param",
"caffe_net",
":",
"loaded",
"caffe",
"network",
":",
"param",
"arg_params",
":",
"arguments",
":",
"param",
"aux_params",
":",
"auxiliary",
"parameters"... | def compare_layers_from_nets(caffe_net, arg_params, aux_params, exe, layer_name_to_record,
top_to_layers, mean_diff_allowed, max_diff_allowed):
"""
Compare layer by layer of a caffe network with mxnet network
:param caffe_net: loaded caffe network
:param arg_params: argument... | [
"def",
"compare_layers_from_nets",
"(",
"caffe_net",
",",
"arg_params",
",",
"aux_params",
",",
"exe",
",",
"layer_name_to_record",
",",
"top_to_layers",
",",
"mean_diff_allowed",
",",
"max_diff_allowed",
")",
":",
"import",
"re",
"log_format",
"=",
"' {0:<40} {1:<4... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/tools/caffe_converter/compare_layers.py#L174-L333 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/fileinput.py | python | isstdin | () | return _state.isstdin() | Returns true if the last line was read from sys.stdin,
otherwise returns false. | Returns true if the last line was read from sys.stdin,
otherwise returns false. | [
"Returns",
"true",
"if",
"the",
"last",
"line",
"was",
"read",
"from",
"sys",
".",
"stdin",
"otherwise",
"returns",
"false",
"."
] | def isstdin():
"""
Returns true if the last line was read from sys.stdin,
otherwise returns false.
"""
if not _state:
raise RuntimeError("no active input()")
return _state.isstdin() | [
"def",
"isstdin",
"(",
")",
":",
"if",
"not",
"_state",
":",
"raise",
"RuntimeError",
"(",
"\"no active input()\"",
")",
"return",
"_state",
".",
"isstdin",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/fileinput.py#L166-L173 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests/requests/utils.py | python | default_user_agent | () | return " ".join(['python-requests/%s' % __version__,
'%s/%s' % (_implementation, _implementation_version),
'%s/%s' % (p_system, p_release)]) | Return a string representing the default user agent. | Return a string representing the default user agent. | [
"Return",
"a",
"string",
"representing",
"the",
"default",
"user",
"agent",
"."
] | def default_user_agent():
"""Return a string representing the default user agent."""
_implementation = platform.python_implementation()
if _implementation == 'CPython':
_implementation_version = platform.python_version()
elif _implementation == 'PyPy':
_implementation_version = '%s.%s.%... | [
"def",
"default_user_agent",
"(",
")",
":",
"_implementation",
"=",
"platform",
".",
"python_implementation",
"(",
")",
"if",
"_implementation",
"==",
"'CPython'",
":",
"_implementation_version",
"=",
"platform",
".",
"python_version",
"(",
")",
"elif",
"_implementa... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/utils.py#L428-L456 | |
Qihoo360/mongosync | 55b647e81c072ebe91daaa3b9dc1a953c3c22e19 | dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py | python | ResetNolintSuppressions | () | Resets the set of NOLINT suppressions to empty. | Resets the set of NOLINT suppressions to empty. | [
"Resets",
"the",
"set",
"of",
"NOLINT",
"suppressions",
"to",
"empty",
"."
] | def ResetNolintSuppressions():
"Resets the set of NOLINT suppressions to empty."
_error_suppressions.clear() | [
"def",
"ResetNolintSuppressions",
"(",
")",
":",
"_error_suppressions",
".",
"clear",
"(",
")"
] | https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/cpplint.py#L329-L331 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridCellAttr._setOORInfo | (*args, **kwargs) | return _grid.GridCellAttr__setOORInfo(*args, **kwargs) | _setOORInfo(self, PyObject _self) | _setOORInfo(self, PyObject _self) | [
"_setOORInfo",
"(",
"self",
"PyObject",
"_self",
")"
] | def _setOORInfo(*args, **kwargs):
"""_setOORInfo(self, PyObject _self)"""
return _grid.GridCellAttr__setOORInfo(*args, **kwargs) | [
"def",
"_setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellAttr__setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L524-L526 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/_datasource.py | python | Repository.__init__ | (self, baseurl, destpath=os.curdir) | Create a Repository with a shared url or directory of baseurl. | Create a Repository with a shared url or directory of baseurl. | [
"Create",
"a",
"Repository",
"with",
"a",
"shared",
"url",
"or",
"directory",
"of",
"baseurl",
"."
] | def __init__(self, baseurl, destpath=os.curdir):
"""Create a Repository with a shared url or directory of baseurl."""
DataSource.__init__(self, destpath=destpath)
self._baseurl = baseurl | [
"def",
"__init__",
"(",
"self",
",",
"baseurl",
",",
"destpath",
"=",
"os",
".",
"curdir",
")",
":",
"DataSource",
".",
"__init__",
"(",
"self",
",",
"destpath",
"=",
"destpath",
")",
"self",
".",
"_baseurl",
"=",
"baseurl"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/_datasource.py#L666-L669 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.