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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/validators.py | python | check_positive_degrees | (method) | return new_method | A wrapper method to check degrees parameter in RandomSharpness and RandomColor ops (Python and C++) | A wrapper method to check degrees parameter in RandomSharpness and RandomColor ops (Python and C++) | [
"A",
"wrapper",
"method",
"to",
"check",
"degrees",
"parameter",
"in",
"RandomSharpness",
"and",
"RandomColor",
"ops",
"(",
"Python",
"and",
"C",
"++",
")"
] | def check_positive_degrees(method):
"""A wrapper method to check degrees parameter in RandomSharpness and RandomColor ops (Python and C++)"""
@wraps(method)
def new_method(self, *args, **kwargs):
[degrees], _ = parse_user_args(method, *args, **kwargs)
if degrees is not None:
if... | [
"def",
"check_positive_degrees",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"degrees",
"]",
",",
"_",
"=",
"parse_user_args",
"(",
"method",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/validators.py#L907-L927 | |
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | sandbox/mintime/RRT_Smooth.py | python | Retime | (robot,rave_traj,tunings) | return [rave_traj,traj2] | Optimal-time parameterization of a trajectory under torque constraints
Return a couple (rave_traj,traj) where traj is an instance of MintimeTrajectory class
robot -- the robot
rave_traj -- an openrave trajectory
tunings -- set of tuning parameter for the time-parameterization algorithm (see test-RRT.py... | Optimal-time parameterization of a trajectory under torque constraints
Return a couple (rave_traj,traj) where traj is an instance of MintimeTrajectory class | [
"Optimal",
"-",
"time",
"parameterization",
"of",
"a",
"trajectory",
"under",
"torque",
"constraints",
"Return",
"a",
"couple",
"(",
"rave_traj",
"traj",
")",
"where",
"traj",
"is",
"an",
"instance",
"of",
"MintimeTrajectory",
"class"
] | def Retime(robot,rave_traj,tunings):
"""Optimal-time parameterization of a trajectory under torque constraints
Return a couple (rave_traj,traj) where traj is an instance of MintimeTrajectory class
robot -- the robot
rave_traj -- an openrave trajectory
tunings -- set of tuning parameter for the time... | [
"def",
"Retime",
"(",
"robot",
",",
"rave_traj",
",",
"tunings",
")",
":",
"t_step",
"=",
"tunings",
".",
"t_step",
"tau_min",
"=",
"tunings",
".",
"tau_min",
"tau_max",
"=",
"tunings",
".",
"tau_max",
"qd_max",
"=",
"tunings",
".",
"qd_max",
"algo_list",
... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/sandbox/mintime/RRT_Smooth.py#L125-L183 | |
pskun/finance_news_analysis | 6ac13e32deede37a4cf57bba8b2897941ae3d80d | utils/processpool.py | python | ProcessPool.wait_completion | (self) | 等待数据处理完成 | 等待数据处理完成 | [
"等待数据处理完成"
] | def wait_completion(self):
""" 等待数据处理完成 """
self.__queue.join()
if self.__output is not None:
self.__output.join()
pass | [
"def",
"wait_completion",
"(",
"self",
")",
":",
"self",
".",
"__queue",
".",
"join",
"(",
")",
"if",
"self",
".",
"__output",
"is",
"not",
"None",
":",
"self",
".",
"__output",
".",
"join",
"(",
")",
"pass"
] | https://github.com/pskun/finance_news_analysis/blob/6ac13e32deede37a4cf57bba8b2897941ae3d80d/utils/processpool.py#L99-L104 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBValueList.IsValid | (self) | return _lldb.SBValueList_IsValid(self) | IsValid(SBValueList self) -> bool | IsValid(SBValueList self) -> bool | [
"IsValid",
"(",
"SBValueList",
"self",
")",
"-",
">",
"bool"
] | def IsValid(self):
"""IsValid(SBValueList self) -> bool"""
return _lldb.SBValueList_IsValid(self) | [
"def",
"IsValid",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBValueList_IsValid",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14925-L14927 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/data_structures/sarray.py | python | SArray.abs | (self) | return abs(self) | Returns a new SArray containing the absolute value of each element.
Examples
--------
>>> tc.SArray([1, -1, -2]).abs()
dtype: int
Rows: 3
[1, 1, 2]
>>> tc.SArray([-1., -2.]).abs()
dtype: float
Rows: 2
[1.0, 2.0] | Returns a new SArray containing the absolute value of each element. | [
"Returns",
"a",
"new",
"SArray",
"containing",
"the",
"absolute",
"value",
"of",
"each",
"element",
"."
] | def abs(self):
"""
Returns a new SArray containing the absolute value of each element.
Examples
--------
>>> tc.SArray([1, -1, -2]).abs()
dtype: int
Rows: 3
[1, 1, 2]
>>> tc.SArray([-1., -2.]).abs()
dtype: float
Rows: 2
[1... | [
"def",
"abs",
"(",
"self",
")",
":",
"return",
"abs",
"(",
"self",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L4662-L4679 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBModule.FindSymbols | (self, *args) | return _lldb.SBModule_FindSymbols(self, *args) | FindSymbols(self, str name, SymbolType type = eSymbolTypeAny) -> SBSymbolContextList
FindSymbols(self, str name) -> SBSymbolContextList | FindSymbols(self, str name, SymbolType type = eSymbolTypeAny) -> SBSymbolContextList
FindSymbols(self, str name) -> SBSymbolContextList | [
"FindSymbols",
"(",
"self",
"str",
"name",
"SymbolType",
"type",
"=",
"eSymbolTypeAny",
")",
"-",
">",
"SBSymbolContextList",
"FindSymbols",
"(",
"self",
"str",
"name",
")",
"-",
">",
"SBSymbolContextList"
] | def FindSymbols(self, *args):
"""
FindSymbols(self, str name, SymbolType type = eSymbolTypeAny) -> SBSymbolContextList
FindSymbols(self, str name) -> SBSymbolContextList
"""
return _lldb.SBModule_FindSymbols(self, *args) | [
"def",
"FindSymbols",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBModule_FindSymbols",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L6128-L6133 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/bin/bundyctl/cmdparse.py | python | _remove_list_and_map_whitespace | (text) | return "".join(result) | Returns a string where the whitespace between matching [ and ]
is removed, unless quoted | Returns a string where the whitespace between matching [ and ]
is removed, unless quoted | [
"Returns",
"a",
"string",
"where",
"the",
"whitespace",
"between",
"matching",
"[",
"and",
"]",
"is",
"removed",
"unless",
"quoted"
] | def _remove_list_and_map_whitespace(text):
"""Returns a string where the whitespace between matching [ and ]
is removed, unless quoted"""
# regular expression aren't really the right tool, since we may have
# nested structures
result = []
start_pos = 0
pos = 0
list_count = 0
map_c... | [
"def",
"_remove_list_and_map_whitespace",
"(",
"text",
")",
":",
"# regular expression aren't really the right tool, since we may have",
"# nested structures",
"result",
"=",
"[",
"]",
"start_pos",
"=",
"0",
"pos",
"=",
"0",
"list_count",
"=",
"0",
"map_count",
"=",
"0"... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/bin/bundyctl/cmdparse.py#L51-L91 | |
tpfister/caffe-heatmap | 4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e | scripts/cpp_lint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
bool, True iff the error... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the curre... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"(",
")",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"None... | https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L500-L513 | |
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | scribus/plugins/scriptplugin/scripts/CalendarWizard.py | python | ScCalendar.createPage | (self) | Wrapper to the new page with layers | Wrapper to the new page with layers | [
"Wrapper",
"to",
"the",
"new",
"page",
"with",
"layers"
] | def createPage(self):
""" Wrapper to the new page with layers """
if self.firstPage:
self.firstPage = False
newPage(-1, self.masterPage) # create a new page using the masterPage
deletePage(1) # now it's safe to delete the first page
gotoPage(1)
... | [
"def",
"createPage",
"(",
"self",
")",
":",
"if",
"self",
".",
"firstPage",
":",
"self",
".",
"firstPage",
"=",
"False",
"newPage",
"(",
"-",
"1",
",",
"self",
".",
"masterPage",
")",
"# create a new page using the masterPage",
"deletePage",
"(",
"1",
")",
... | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin/scripts/CalendarWizard.py#L292-L300 | ||
RcppCore/RcppParallel | ff49e84602a1771c06bc39fdea995447564f2b7f | src/tbb/python/tbb/pool.py | python | Job.__call__ | (self) | Call the function with the args/kwds and tell the ApplyResult
that its result is ready. Correctly handles the exceptions
happening during the execution of the function | Call the function with the args/kwds and tell the ApplyResult
that its result is ready. Correctly handles the exceptions
happening during the execution of the function | [
"Call",
"the",
"function",
"with",
"the",
"args",
"/",
"kwds",
"and",
"tell",
"the",
"ApplyResult",
"that",
"its",
"result",
"is",
"ready",
".",
"Correctly",
"handles",
"the",
"exceptions",
"happening",
"during",
"the",
"execution",
"of",
"the",
"function"
] | def __call__(self):
"""
Call the function with the args/kwds and tell the ApplyResult
that its result is ready. Correctly handles the exceptions
happening during the execution of the function
"""
try:
result = self._func(*self._args, **self._kwds)
exce... | [
"def",
"__call__",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"self",
".",
"_func",
"(",
"*",
"self",
".",
"_args",
",",
"*",
"*",
"self",
".",
"_kwds",
")",
"except",
":",
"self",
".",
"_result",
".",
"_set_exception",
"(",
")",
"else",
"... | https://github.com/RcppCore/RcppParallel/blob/ff49e84602a1771c06bc39fdea995447564f2b7f/src/tbb/python/tbb/pool.py#L282-L293 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathJobGui.py | python | TaskPanel.getFields | (self) | sets properties in the object to match the form | sets properties in the object to match the form | [
"sets",
"properties",
"in",
"the",
"object",
"to",
"match",
"the",
"form"
] | def getFields(self):
"""sets properties in the object to match the form"""
if self.obj:
self.obj.PostProcessor = str(self.form.postProcessor.currentText())
self.obj.PostProcessorArgs = str(
self.form.postProcessorArguments.displayText()
)
s... | [
"def",
"getFields",
"(",
"self",
")",
":",
"if",
"self",
".",
"obj",
":",
"self",
".",
"obj",
".",
"PostProcessor",
"=",
"str",
"(",
"self",
".",
"form",
".",
"postProcessor",
".",
"currentText",
"(",
")",
")",
"self",
".",
"obj",
".",
"PostProcessor... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathJobGui.py#L741-L781 | ||
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | protobuf/python/mox.py | python | In.equals | (self, rhs) | return self._key in rhs | Check to see whether key is in rhs.
Args:
rhs: dict
Returns:
bool | Check to see whether key is in rhs. | [
"Check",
"to",
"see",
"whether",
"key",
"is",
"in",
"rhs",
"."
] | def equals(self, rhs):
"""Check to see whether key is in rhs.
Args:
rhs: dict
Returns:
bool
"""
return self._key in rhs | [
"def",
"equals",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"self",
".",
"_key",
"in",
"rhs"
] | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/mox.py#L955-L965 | |
leggedrobotics/free_gait | 93e6c2f385fe9ac7107153965e14f6b7a1e0d702 | free_gait_python/src/free_gait/action.py | python | LaunchAction.start | (self) | Subscribe to action state (param in launchfile), if available, to monitor the action state in a different node. | Subscribe to action state (param in launchfile), if available, to monitor the action state in a different node. | [
"Subscribe",
"to",
"action",
"state",
"(",
"param",
"in",
"launchfile",
")",
"if",
"available",
"to",
"monitor",
"the",
"action",
"state",
"in",
"a",
"different",
"node",
"."
] | def start(self):
try:
self.launch.start()
except roslaunch.core.RLException:
rospy.logerr(traceback.print_exc())
self.set_state(ActionState.ERROR)
return
"""Subscribe to action state (param in launchfile), if available, to monitor the acti... | [
"def",
"start",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"launch",
".",
"start",
"(",
")",
"except",
"roslaunch",
".",
"core",
".",
"RLException",
":",
"rospy",
".",
"logerr",
"(",
"traceback",
".",
"print_exc",
"(",
")",
")",
"self",
".",
"... | https://github.com/leggedrobotics/free_gait/blob/93e6c2f385fe9ac7107153965e14f6b7a1e0d702/free_gait_python/src/free_gait/action.py#L292-L303 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/installer/util/prebuild/create_string_rc.py | python | GrdHandler.__OnMessageText | (self, containing_element, message_text) | Invoked to handle a block of text for a message. | Invoked to handle a block of text for a message. | [
"Invoked",
"to",
"handle",
"a",
"block",
"of",
"text",
"for",
"a",
"message",
"."
] | def __OnMessageText(self, containing_element, message_text):
"""Invoked to handle a block of text for a message."""
if message_text and (containing_element == 'message' or
containing_element == 'ph'):
self.__text_scraps.append(message_text) | [
"def",
"__OnMessageText",
"(",
"self",
",",
"containing_element",
",",
"message_text",
")",
":",
"if",
"message_text",
"and",
"(",
"containing_element",
"==",
"'message'",
"or",
"containing_element",
"==",
"'ph'",
")",
":",
"self",
".",
"__text_scraps",
".",
"ap... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/installer/util/prebuild/create_string_rc.py#L136-L140 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTime.ParseDate | (*args, **kwargs) | return _misc_.DateTime_ParseDate(*args, **kwargs) | ParseDate(self, String date) -> int | ParseDate(self, String date) -> int | [
"ParseDate",
"(",
"self",
"String",
"date",
")",
"-",
">",
"int"
] | def ParseDate(*args, **kwargs):
"""ParseDate(self, String date) -> int"""
return _misc_.DateTime_ParseDate(*args, **kwargs) | [
"def",
"ParseDate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_ParseDate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4154-L4156 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/sonnx.py | python | SingaRep.to_input_tensor | (self, x) | return tensor_dict | convert the input to tensors
Args:
x (np.ndarray[]): a list of numpy ndarray as inputs
Returns:
a dict of SINGA Tensors | convert the input to tensors
Args:
x (np.ndarray[]): a list of numpy ndarray as inputs
Returns:
a dict of SINGA Tensors | [
"convert",
"the",
"input",
"to",
"tensors",
"Args",
":",
"x",
"(",
"np",
".",
"ndarray",
"[]",
")",
":",
"a",
"list",
"of",
"numpy",
"ndarray",
"as",
"inputs",
"Returns",
":",
"a",
"dict",
"of",
"SINGA",
"Tensors"
] | def to_input_tensor(self, x):
"""
convert the input to tensors
Args:
x (np.ndarray[]): a list of numpy ndarray as inputs
Returns:
a dict of SINGA Tensors
"""
tensor_dict = {}
# init inputs as Tensor
for (key, val) in zip(self.input... | [
"def",
"to_input_tensor",
"(",
"self",
",",
"x",
")",
":",
"tensor_dict",
"=",
"{",
"}",
"# init inputs as Tensor",
"for",
"(",
"key",
",",
"val",
")",
"in",
"zip",
"(",
"self",
".",
"inputs",
",",
"x",
")",
":",
"if",
"not",
"self",
".",
"is_graph",... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/sonnx.py#L2011-L2029 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/autocomp/completer.py | python | BaseCompleter.SetChooseSingle | (self, single) | Set whether the completer should automatically choose a selection
when there is only one symbol in the completion list.
@param single: bool | Set whether the completer should automatically choose a selection
when there is only one symbol in the completion list.
@param single: bool | [
"Set",
"whether",
"the",
"completer",
"should",
"automatically",
"choose",
"a",
"selection",
"when",
"there",
"is",
"only",
"one",
"symbol",
"in",
"the",
"completion",
"list",
".",
"@param",
"single",
":",
"bool"
] | def SetChooseSingle(self, single):
"""Set whether the completer should automatically choose a selection
when there is only one symbol in the completion list.
@param single: bool
"""
self._choose_single = single | [
"def",
"SetChooseSingle",
"(",
"self",
",",
"single",
")",
":",
"self",
".",
"_choose_single",
"=",
"single"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/autocomp/completer.py#L285-L291 | ||
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py | python | CompositeProperty | (cdescriptor, message_type) | return property(Getter) | Returns a Python property the given composite field. | Returns a Python property the given composite field. | [
"Returns",
"a",
"Python",
"property",
"the",
"given",
"composite",
"field",
"."
] | def CompositeProperty(cdescriptor, message_type):
"""Returns a Python property the given composite field."""
def Getter(self):
sub_message = self._composite_fields.get(cdescriptor.name, None)
if sub_message is None:
cmessage = self._cmsg.NewSubMessage(cdescriptor)
sub_message = message_type._co... | [
"def",
"CompositeProperty",
"(",
"cdescriptor",
",",
"message_type",
")",
":",
"def",
"Getter",
"(",
"self",
")",
":",
"sub_message",
"=",
"self",
".",
"_composite_fields",
".",
"get",
"(",
"cdescriptor",
".",
"name",
",",
"None",
")",
"if",
"sub_message",
... | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py#L90-L101 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/postproc.py | python | PostProcessor._insert_var_dels | (self) | Insert del statements for each variable.
Returns a 2-tuple of (variable definition map, variable deletion map)
which indicates variables defined and deleted in each block.
The algorithm avoids relying on explicit knowledge on loops and
distinguish between variables that are defined loca... | Insert del statements for each variable.
Returns a 2-tuple of (variable definition map, variable deletion map)
which indicates variables defined and deleted in each block. | [
"Insert",
"del",
"statements",
"for",
"each",
"variable",
".",
"Returns",
"a",
"2",
"-",
"tuple",
"of",
"(",
"variable",
"definition",
"map",
"variable",
"deletion",
"map",
")",
"which",
"indicates",
"variables",
"defined",
"and",
"deleted",
"in",
"each",
"b... | def _insert_var_dels(self):
"""
Insert del statements for each variable.
Returns a 2-tuple of (variable definition map, variable deletion map)
which indicates variables defined and deleted in each block.
The algorithm avoids relying on explicit knowledge on loops and
dis... | [
"def",
"_insert_var_dels",
"(",
"self",
")",
":",
"vlt",
"=",
"self",
".",
"func_ir",
".",
"variable_lifetime",
"self",
".",
"_patch_var_dels",
"(",
"vlt",
".",
"deadmaps",
".",
"internal",
",",
"vlt",
".",
"deadmaps",
".",
"escaping",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/postproc.py#L153-L171 | ||
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/dump_breakpad_symbols.py | python | enumerate_pkg_files | (pkg, symbol_pkg) | Return a generator over BinarySymbolInfo tuples for all ELF files in 'pkg'.
This function extracts both RPM/DEB files, then walks the binary pkg directory to
enumerate all ELF files, matches them to the location of their respective .debug files
and yields all tuples thereof. We use a generator here to keep the t... | Return a generator over BinarySymbolInfo tuples for all ELF files in 'pkg'. | [
"Return",
"a",
"generator",
"over",
"BinarySymbolInfo",
"tuples",
"for",
"all",
"ELF",
"files",
"in",
"pkg",
"."
] | def enumerate_pkg_files(pkg, symbol_pkg):
"""Return a generator over BinarySymbolInfo tuples for all ELF files in 'pkg'.
This function extracts both RPM/DEB files, then walks the binary pkg directory to
enumerate all ELF files, matches them to the location of their respective .debug files
and yields all tuples... | [
"def",
"enumerate_pkg_files",
"(",
"pkg",
",",
"symbol_pkg",
")",
":",
"IMPALA_BINARY_BASE",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'usr'",
",",
"'lib'",
",",
"'impala'",
")",
"IMPALA_SYMBOL_BASE",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'usr'",
"... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/dump_breakpad_symbols.py#L191-L221 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/roslib/src/roslib/network.py | python | get_local_addresses | () | return local_addrs | @return: known local addresses. Not affected by ROS_IP/ROS_HOSTNAME
@rtype: [str] | [] | def get_local_addresses():
"""
@return: known local addresses. Not affected by ROS_IP/ROS_HOSTNAME
@rtype: [str]
"""
# cache address data as it can be slow to calculate
global _local_addrs
if _local_addrs is not None:
return _local_addrs
local_addrs = None
if _use_netifaces... | [
"def",
"get_local_addresses",
"(",
")",
":",
"# cache address data as it can be slow to calculate",
"global",
"_local_addrs",
"if",
"_local_addrs",
"is",
"not",
"None",
":",
"return",
"_local_addrs",
"local_addrs",
"=",
"None",
"if",
"_use_netifaces",
":",
"# #552: netifa... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/network.py#L151-L213 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlWindowInterface.SetHTMLBackgroundImage | (*args, **kwargs) | return _html.HtmlWindowInterface_SetHTMLBackgroundImage(*args, **kwargs) | SetHTMLBackgroundImage(self, Bitmap bmpBg) | SetHTMLBackgroundImage(self, Bitmap bmpBg) | [
"SetHTMLBackgroundImage",
"(",
"self",
"Bitmap",
"bmpBg",
")"
] | def SetHTMLBackgroundImage(*args, **kwargs):
"""SetHTMLBackgroundImage(self, Bitmap bmpBg)"""
return _html.HtmlWindowInterface_SetHTMLBackgroundImage(*args, **kwargs) | [
"def",
"SetHTMLBackgroundImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindowInterface_SetHTMLBackgroundImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L944-L946 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py | python | Decimal.max | (self, other, context=None) | return ans._fix(context) | Returns the larger value.
Like max(self, other) except if one is not a number, returns
NaN (and signals if one is sNaN). Also rounds. | Returns the larger value. | [
"Returns",
"the",
"larger",
"value",
"."
] | def max(self, other, context=None):
"""Returns the larger value.
Like max(self, other) except if one is not a number, returns
NaN (and signals if one is sNaN). Also rounds.
"""
other = _convert_other(other, raiseit=True)
if context is None:
context = getcon... | [
"def",
"max",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"if",
"self",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L2712-L2752 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | IconBundle.AddIconFromFile | (*args, **kwargs) | return _gdi_.IconBundle_AddIconFromFile(*args, **kwargs) | AddIconFromFile(self, String file, int type=BITMAP_TYPE_ANY)
Adds all the icons contained in the file to the collection, if the
collection already contains icons with the same width and height, they
are replaced | AddIconFromFile(self, String file, int type=BITMAP_TYPE_ANY) | [
"AddIconFromFile",
"(",
"self",
"String",
"file",
"int",
"type",
"=",
"BITMAP_TYPE_ANY",
")"
] | def AddIconFromFile(*args, **kwargs):
"""
AddIconFromFile(self, String file, int type=BITMAP_TYPE_ANY)
Adds all the icons contained in the file to the collection, if the
collection already contains icons with the same width and height, they
are replaced
"""
retur... | [
"def",
"AddIconFromFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"IconBundle_AddIconFromFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1410-L1418 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/utils/DiffAndRename.py | python | DiffAndRename | (filename, dated_files_enable=True) | Compare two files that are named 'file' and 'file.new'
If the files differ by more than one line (the time stamp),
then move 'file' to '.file.bu' and move 'file.new' to 'file'
date_files_enable allows one to turn off the generation
of the *.new.date and *.old.date files so CC will not
go crazy. LJ... | Compare two files that are named 'file' and 'file.new'
If the files differ by more than one line (the time stamp),
then move 'file' to '.file.bu' and move 'file.new' to 'file' | [
"Compare",
"two",
"files",
"that",
"are",
"named",
"file",
"and",
"file",
".",
"new",
"If",
"the",
"files",
"differ",
"by",
"more",
"than",
"one",
"line",
"(",
"the",
"time",
"stamp",
")",
"then",
"move",
"file",
"to",
".",
"file",
".",
"bu",
"and",
... | def DiffAndRename(filename, dated_files_enable=True):
"""
Compare two files that are named 'file' and 'file.new'
If the files differ by more than one line (the time stamp),
then move 'file' to '.file.bu' and move 'file.new' to 'file'
date_files_enable allows one to turn off the generation
of th... | [
"def",
"DiffAndRename",
"(",
"filename",
",",
"dated_files_enable",
"=",
"True",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
"+",
"\".new\"",
")",
":",
"print",
"(",
"\"Cannot find %s.new\"",
"%",
"filename",
")",
"return",
"i... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/DiffAndRename.py#L137-L205 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/operators/loss.py | python | L2Loss | (inputs, normalization='BATCH_SIZE', **kwargs) | return output | L2Loss(EuclideanLoss).
Parameters
----------
inputs : list of Tensor
The inputs, represent [input, targets, inside_w].
normalization : str
The normalization, ``FULL``, ``BATCH_SIZE`` or ``NONE``.
Returns
-------
Tensor
The loss, calculated as: |l2_loss_function|
... | L2Loss(EuclideanLoss). | [
"L2Loss",
"(",
"EuclideanLoss",
")",
"."
] | def L2Loss(inputs, normalization='BATCH_SIZE', **kwargs):
"""L2Loss(EuclideanLoss).
Parameters
----------
inputs : list of Tensor
The inputs, represent [input, targets, inside_w].
normalization : str
The normalization, ``FULL``, ``BATCH_SIZE`` or ``NONE``.
Returns
-------
... | [
"def",
"L2Loss",
"(",
"inputs",
",",
"normalization",
"=",
"'BATCH_SIZE'",
",",
"*",
"*",
"kwargs",
")",
":",
"CheckInputs",
"(",
"inputs",
",",
"2",
",",
"3",
")",
"arguments",
"=",
"ParseArguments",
"(",
"locals",
"(",
")",
")",
"output",
"=",
"Tenso... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/operators/loss.py#L184-L209 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | Appearance.setColors | (self, feature, colors, alpha=False) | return _robotsim.Appearance_setColors(self, feature, colors, alpha) | setColors(Appearance self, int feature, floatVector colors, bool alpha=False)
setColors(Appearance self, int feature, floatVector colors)
Sets per-element color for elements of the given feature type.
If alpha=True, colors are assumed to be 4*N rgba values, where N is the number
of... | setColors(Appearance self, int feature, floatVector colors, bool alpha=False)
setColors(Appearance self, int feature, floatVector colors) | [
"setColors",
"(",
"Appearance",
"self",
"int",
"feature",
"floatVector",
"colors",
"bool",
"alpha",
"=",
"False",
")",
"setColors",
"(",
"Appearance",
"self",
"int",
"feature",
"floatVector",
"colors",
")"
] | def setColors(self, feature, colors, alpha=False):
"""
setColors(Appearance self, int feature, floatVector colors, bool alpha=False)
setColors(Appearance self, int feature, floatVector colors)
Sets per-element color for elements of the given feature type.
If alpha=True, col... | [
"def",
"setColors",
"(",
"self",
",",
"feature",
",",
"colors",
",",
"alpha",
"=",
"False",
")",
":",
"return",
"_robotsim",
".",
"Appearance_setColors",
"(",
"self",
",",
"feature",
",",
"colors",
",",
"alpha",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L2663-L2679 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/cookies.py | python | remove_cookie_by_name | (cookiejar, name, domain=None, path=None) | Unsets a cookie by name, by default over all domains and paths.
Wraps CookieJar.clear(), is O(n). | Unsets a cookie by name, by default over all domains and paths. | [
"Unsets",
"a",
"cookie",
"by",
"name",
"by",
"default",
"over",
"all",
"domains",
"and",
"paths",
"."
] | def remove_cookie_by_name(cookiejar, name, domain=None, path=None):
"""Unsets a cookie by name, by default over all domains and paths.
Wraps CookieJar.clear(), is O(n).
"""
clearables = []
for cookie in cookiejar:
if cookie.name != name:
continue
if domain is not None an... | [
"def",
"remove_cookie_by_name",
"(",
"cookiejar",
",",
"name",
",",
"domain",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"clearables",
"=",
"[",
"]",
"for",
"cookie",
"in",
"cookiejar",
":",
"if",
"cookie",
".",
"name",
"!=",
"name",
":",
"contin... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/cookies.py#L146-L162 | ||
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/DICOMLib/DICOMUtils.py | python | openDatabase | (databaseDir) | return True | Open DICOM database in the specified folder | Open DICOM database in the specified folder | [
"Open",
"DICOM",
"database",
"in",
"the",
"specified",
"folder"
] | def openDatabase(databaseDir):
"""Open DICOM database in the specified folder"""
if not os.access(databaseDir, os.F_OK):
logging.error('Specified database directory ' + repr(databaseDir) + ' cannot be found')
return False
databaseFileName = databaseDir + "/ctkDICOM.sql"
slicer.dicomDatabase.openDatabase... | [
"def",
"openDatabase",
"(",
"databaseDir",
")",
":",
"if",
"not",
"os",
".",
"access",
"(",
"databaseDir",
",",
"os",
".",
"F_OK",
")",
":",
"logging",
".",
"error",
"(",
"'Specified database directory '",
"+",
"repr",
"(",
"databaseDir",
")",
"+",
"' cann... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMLib/DICOMUtils.py#L252-L262 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/errors.py | python | ParserContext.add_bad_command_namespace_error | (self, location, command_name, command_namespace,
valid_commands) | Add an error about the namespace value not being a valid choice. | Add an error about the namespace value not being a valid choice. | [
"Add",
"an",
"error",
"about",
"the",
"namespace",
"value",
"not",
"being",
"a",
"valid",
"choice",
"."
] | def add_bad_command_namespace_error(self, location, command_name, command_namespace,
valid_commands):
# type: (common.SourceLocation, str, str, List[str]) -> None
"""Add an error about the namespace value not being a valid choice."""
self._add_error(
... | [
"def",
"add_bad_command_namespace_error",
"(",
"self",
",",
"location",
",",
"command_name",
",",
"command_namespace",
",",
"valid_commands",
")",
":",
"# type: (common.SourceLocation, str, str, List[str]) -> None",
"self",
".",
"_add_error",
"(",
"location",
",",
"ERROR_ID... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/errors.py#L628-L635 | ||
hughperkins/Jinja2CppLight | 04196b080adf6edb86184824a1cf948ace310d19 | thirdparty/cogapp/cogapp/cogapp.py | python | Cog.processString | (self, sInput, fname=None) | return fNew.getvalue() | Process sInput as the text to cog.
Return the cogged output as a string. | Process sInput as the text to cog.
Return the cogged output as a string. | [
"Process",
"sInput",
"as",
"the",
"text",
"to",
"cog",
".",
"Return",
"the",
"cogged",
"output",
"as",
"a",
"string",
"."
] | def processString(self, sInput, fname=None):
""" Process sInput as the text to cog.
Return the cogged output as a string.
"""
fOld = StringIO(sInput)
fNew = StringIO()
self.processFile(fOld, fNew, fname=fname)
return fNew.getvalue() | [
"def",
"processString",
"(",
"self",
",",
"sInput",
",",
"fname",
"=",
"None",
")",
":",
"fOld",
"=",
"StringIO",
"(",
"sInput",
")",
"fNew",
"=",
"StringIO",
"(",
")",
"self",
".",
"processFile",
"(",
"fOld",
",",
"fNew",
",",
"fname",
"=",
"fname",... | https://github.com/hughperkins/Jinja2CppLight/blob/04196b080adf6edb86184824a1cf948ace310d19/thirdparty/cogapp/cogapp/cogapp.py#L549-L556 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLCollectData.py | python | DirectILLCollectData._flatBkgMon | (self, monWS) | return bkgSubtractedMonWS | Subtract flat background from a monitor workspace. | Subtract flat background from a monitor workspace. | [
"Subtract",
"flat",
"background",
"from",
"a",
"monitor",
"workspace",
"."
] | def _flatBkgMon(self, monWS):
"""Subtract flat background from a monitor workspace."""
windowWidth = self.getProperty(common.PROP_FLAT_BKG_WINDOW).value
monBkgWS = _createFlatBkg(monWS, common.WS_CONTENT_MONS, windowWidth, self._names, self._subalgLogging)
monBkgScaling = 1
bkgSu... | [
"def",
"_flatBkgMon",
"(",
"self",
",",
"monWS",
")",
":",
"windowWidth",
"=",
"self",
".",
"getProperty",
"(",
"common",
".",
"PROP_FLAT_BKG_WINDOW",
")",
".",
"value",
"monBkgWS",
"=",
"_createFlatBkg",
"(",
"monWS",
",",
"common",
".",
"WS_CONTENT_MONS",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLCollectData.py#L730-L739 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/prediction/boxstack_pybullet_sim.py | python | BoxStackPyBulletSim.ApplyAction | (self, action) | Set the desired action. | Set the desired action. | [
"Set",
"the",
"desired",
"action",
"."
] | def ApplyAction(self, action):
"""Set the desired action.
"""
self.m_actions_taken_since_reset += 1 | [
"def",
"ApplyAction",
"(",
"self",
",",
"action",
")",
":",
"self",
".",
"m_actions_taken_since_reset",
"+=",
"1"
] | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/prediction/boxstack_pybullet_sim.py#L140-L143 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Cluster/Murtagh.py | python | _LookupDist | (dists, i, j, n) | return dists[j * (j - 1) // 2 + i] | *Internal Use Only*
returns the distance between points i and j in the symmetric
distance matrix _dists_ | *Internal Use Only* | [
"*",
"Internal",
"Use",
"Only",
"*"
] | def _LookupDist(dists, i, j, n):
""" *Internal Use Only*
returns the distance between points i and j in the symmetric
distance matrix _dists_
"""
if i == j:
return 0.0
if i > j:
i, j = j, i
return dists[j * (j - 1) // 2 + i] | [
"def",
"_LookupDist",
"(",
"dists",
",",
"i",
",",
"j",
",",
"n",
")",
":",
"if",
"i",
"==",
"j",
":",
"return",
"0.0",
"if",
"i",
">",
"j",
":",
"i",
",",
"j",
"=",
"j",
",",
"i",
"return",
"dists",
"[",
"j",
"*",
"(",
"j",
"-",
"1",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Cluster/Murtagh.py#L43-L54 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Job.py | python | Jobs.were_interrupted | (self) | return self.job.interrupted() | Returns whether the jobs were interrupted by a signal. | Returns whether the jobs were interrupted by a signal. | [
"Returns",
"whether",
"the",
"jobs",
"were",
"interrupted",
"by",
"a",
"signal",
"."
] | def were_interrupted(self):
"""Returns whether the jobs were interrupted by a signal."""
return self.job.interrupted() | [
"def",
"were_interrupted",
"(",
"self",
")",
":",
"return",
"self",
".",
"job",
".",
"interrupted",
"(",
")"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Job.py#L112-L114 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/TemplatePyMod/FeaturePython.py | python | MeshFeature.execute | (self, fp) | return | Print a short message when doing a recomputation, this method is mandatory | Print a short message when doing a recomputation, this method is mandatory | [
"Print",
"a",
"short",
"message",
"when",
"doing",
"a",
"recomputation",
"this",
"method",
"is",
"mandatory"
] | def execute(self, fp):
''' Print a short message when doing a recomputation, this method is mandatory '''
return | [
"def",
"execute",
"(",
"self",
",",
"fp",
")",
":",
"return"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/TemplatePyMod/FeaturePython.py#L450-L452 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.interact | (self, escape_character=chr(29),
input_filter=None, output_filter=None) | This gives control of the child process to the interactive user (the
human at the keyboard). Keystrokes are sent to the child process, and
the stdout and stderr output of the child process is printed. This
simply echos the child stdout and child stderr to the real stdout and
it echos the... | This gives control of the child process to the interactive user (the
human at the keyboard). Keystrokes are sent to the child process, and
the stdout and stderr output of the child process is printed. This
simply echos the child stdout and child stderr to the real stdout and
it echos the... | [
"This",
"gives",
"control",
"of",
"the",
"child",
"process",
"to",
"the",
"interactive",
"user",
"(",
"the",
"human",
"at",
"the",
"keyboard",
")",
".",
"Keystrokes",
"are",
"sent",
"to",
"the",
"child",
"process",
"and",
"the",
"stdout",
"and",
"stderr",
... | def interact(self, escape_character=chr(29),
input_filter=None, output_filter=None):
'''This gives control of the child process to the interactive user (the
human at the keyboard). Keystrokes are sent to the child process, and
the stdout and stderr output of the child process is pri... | [
"def",
"interact",
"(",
"self",
",",
"escape_character",
"=",
"chr",
"(",
"29",
")",
",",
"input_filter",
"=",
"None",
",",
"output_filter",
"=",
"None",
")",
":",
"# Flush the buffer.",
"self",
".",
"write_to_stdout",
"(",
"self",
".",
"buffer",
")",
"sel... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L716-L768 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextBuffer.EndSymbolBullet | (*args, **kwargs) | return _richtext.RichTextBuffer_EndSymbolBullet(*args, **kwargs) | EndSymbolBullet(self) -> bool | EndSymbolBullet(self) -> bool | [
"EndSymbolBullet",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndSymbolBullet(*args, **kwargs):
"""EndSymbolBullet(self) -> bool"""
return _richtext.RichTextBuffer_EndSymbolBullet(*args, **kwargs) | [
"def",
"EndSymbolBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_EndSymbolBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2436-L2438 | |
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/plasma/Plasma.py | python | PtDirtySynchState | (selfKey,SDLStateName,flags) | DO NOT USE - handled by ptSDL | DO NOT USE - handled by ptSDL | [
"DO",
"NOT",
"USE",
"-",
"handled",
"by",
"ptSDL"
] | def PtDirtySynchState(selfKey,SDLStateName,flags):
"""DO NOT USE - handled by ptSDL"""
pass | [
"def",
"PtDirtySynchState",
"(",
"selfKey",
",",
"SDLStateName",
",",
"flags",
")",
":",
"pass"
] | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/Plasma.py#L194-L196 | ||
intel/ros_object_analytics | eb0208edbb6da67e5d5c4092fd2964a2c8d9838e | object_analytics_visualization/scripts/marker_publisher.py | python | ObjectItem.max_text | (self) | return text | Build text marker to hold max text | Build text marker to hold max text | [
"Build",
"text",
"marker",
"to",
"hold",
"max",
"text"
] | def max_text(self):
"""Build text marker to hold max text
"""
text = Marker()
text.header = self._header
text.type = Marker.TEXT_VIEW_FACING
text.action = Marker.ADD
text.scale.z = 0.05
text.color = self.GREEN
text.pose = deepcopy(self.POSE)
... | [
"def",
"max_text",
"(",
"self",
")",
":",
"text",
"=",
"Marker",
"(",
")",
"text",
".",
"header",
"=",
"self",
".",
"_header",
"text",
".",
"type",
"=",
"Marker",
".",
"TEXT_VIEW_FACING",
"text",
".",
"action",
"=",
"Marker",
".",
"ADD",
"text",
".",... | https://github.com/intel/ros_object_analytics/blob/eb0208edbb6da67e5d5c4092fd2964a2c8d9838e/object_analytics_visualization/scripts/marker_publisher.py#L143-L155 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/tools/git/gen_git_source.py | python | configure | (src_base_path, debug=False) | Configure `src_base_path` to embed git hashes if available. | Configure `src_base_path` to embed git hashes if available. | [
"Configure",
"src_base_path",
"to",
"embed",
"git",
"hashes",
"if",
"available",
"."
] | def configure(src_base_path, debug=False):
"""Configure `src_base_path` to embed git hashes if available."""
# TODO(aselle): No files generated or symlinked here are deleted by
# the build system. I don't know of a way to do it in bazel. It
# should only be a problem if somebody moves a sandbox directory
# w... | [
"def",
"configure",
"(",
"src_base_path",
",",
"debug",
"=",
"False",
")",
":",
"# TODO(aselle): No files generated or symlinked here are deleted by",
"# the build system. I don't know of a way to do it in bazel. It",
"# should only be a problem if somebody moves a sandbox directory",
"# w... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/git/gen_git_source.py#L65-L133 | ||
Smorodov/Multitarget-tracker | bee300e8bfd660c86cbeb6892c65a5b7195c9381 | thirdparty/pybind11/tools/clang/cindex.py | python | CompilationDatabase.fromDirectory | (buildDir) | return cdb | Builds a CompilationDatabase from the database found in buildDir | Builds a CompilationDatabase from the database found in buildDir | [
"Builds",
"a",
"CompilationDatabase",
"from",
"the",
"database",
"found",
"in",
"buildDir"
] | def fromDirectory(buildDir):
"""Builds a CompilationDatabase from the database found in buildDir"""
errorCode = c_uint()
try:
cdb = conf.lib.clang_CompilationDatabase_fromDirectory(buildDir,
byref(errorCode))
except CompilationDatabaseError as e:
r... | [
"def",
"fromDirectory",
"(",
"buildDir",
")",
":",
"errorCode",
"=",
"c_uint",
"(",
")",
"try",
":",
"cdb",
"=",
"conf",
".",
"lib",
".",
"clang_CompilationDatabase_fromDirectory",
"(",
"buildDir",
",",
"byref",
"(",
"errorCode",
")",
")",
"except",
"Compila... | https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L2950-L2959 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py | python | ParserElement.ignore | ( self, other ) | return self | Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
... | Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
... | [
"Define",
"expression",
"to",
"be",
"ignored",
"(",
"e",
".",
"g",
".",
"comments",
")",
"while",
"doing",
"pattern",
"matching",
";",
"may",
"be",
"called",
"repeatedly",
"to",
"define",
"multiple",
"comment",
"or",
"other",
"ignorable",
"patterns",
".",
... | def ignore( self, other ):
"""
Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseStri... | [
"def",
"ignore",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"Suppress",
"(",
"other",
")",
"if",
"isinstance",
"(",
"other",
",",
"Suppress",
")",
":",
"if",
"other",
"not",
"in",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L2079-L2100 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | FontPickerCtrl.SetMaxPointSize | (*args, **kwargs) | return _controls_.FontPickerCtrl_SetMaxPointSize(*args, **kwargs) | SetMaxPointSize(self, unsigned int max) | SetMaxPointSize(self, unsigned int max) | [
"SetMaxPointSize",
"(",
"self",
"unsigned",
"int",
"max",
")"
] | def SetMaxPointSize(*args, **kwargs):
"""SetMaxPointSize(self, unsigned int max)"""
return _controls_.FontPickerCtrl_SetMaxPointSize(*args, **kwargs) | [
"def",
"SetMaxPointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FontPickerCtrl_SetMaxPointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L7165-L7167 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/tabnanny.py | python | check | (file) | check(file_or_dir)
If file_or_dir is a directory and not a symbolic link, then recursively
descend the directory tree named by file_or_dir, checking all .py files
along the way. If file_or_dir is an ordinary Python source file, it is
checked for whitespace related problems. The diagnostic messages are
... | check(file_or_dir) | [
"check",
"(",
"file_or_dir",
")"
] | def check(file):
"""check(file_or_dir)
If file_or_dir is a directory and not a symbolic link, then recursively
descend the directory tree named by file_or_dir, checking all .py files
along the way. If file_or_dir is an ordinary Python source file, it is
checked for whitespace related problems. The ... | [
"def",
"check",
"(",
"file",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"file",
")",
"and",
"not",
"os",
".",
"path",
".",
"islink",
"(",
"file",
")",
":",
"if",
"verbose",
":",
"print",
"\"%r: listing directory\"",
"%",
"(",
"file",
","... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/tabnanny.py#L74-L130 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/isis_reduction_steps.py | python | DarkRunSubtraction._load_workspace | (self, dark_run_ws_name, dark_run_file_path, start_spec_index, end_spec_index, workspace_index_offset) | return dark_run_ws | Loads the dark run workspace
@param dark_run_file_path: file path to the dark run
@param dark_run_ws_name: the name of the dark run workspace
@param start_spec_index: the start spec number to consider
@param end_spec_index: the end spec number to consider
@param workspace_index_... | Loads the dark run workspace | [
"Loads",
"the",
"dark",
"run",
"workspace"
] | def _load_workspace(self, dark_run_ws_name, dark_run_file_path, start_spec_index, end_spec_index, workspace_index_offset):
'''
Loads the dark run workspace
@param dark_run_file_path: file path to the dark run
@param dark_run_ws_name: the name of the dark run workspace
@param sta... | [
"def",
"_load_workspace",
"(",
"self",
",",
"dark_run_ws_name",
",",
"dark_run_file_path",
",",
"start_spec_index",
",",
"end_spec_index",
",",
"workspace_index_offset",
")",
":",
"dark_run_ws",
"=",
"None",
"if",
"ADD_TAG",
"in",
"dark_run_ws_name",
":",
"alg_load",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reduction_steps.py#L1550-L1601 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/kvstore.py | python | KVStore.type | (self) | return py_str(kv_type.value) | Get the type of this kvstore
Returns
-------
type : str
the string type | Get the type of this kvstore | [
"Get",
"the",
"type",
"of",
"this",
"kvstore"
] | def type(self):
"""Get the type of this kvstore
Returns
-------
type : str
the string type
"""
kv_type = ctypes.c_char_p()
check_call(_LIB.MXKVStoreGetType(self.handle, ctypes.byref(kv_type)))
return py_str(kv_type.value) | [
"def",
"type",
"(",
"self",
")",
":",
"kv_type",
"=",
"ctypes",
".",
"c_char_p",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"MXKVStoreGetType",
"(",
"self",
".",
"handle",
",",
"ctypes",
".",
"byref",
"(",
"kv_type",
")",
")",
")",
"return",
"py_str",
... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/kvstore.py#L259-L269 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_ScopedNameParts | (self, p) | ScopedNameParts : SCOPE IDENTIFIER ScopedNameParts | ScopedNameParts : SCOPE IDENTIFIER ScopedNameParts | [
"ScopedNameParts",
":",
"SCOPE",
"IDENTIFIER",
"ScopedNameParts"
] | def p_ScopedNameParts(self, p):
"""
ScopedNameParts : SCOPE IDENTIFIER ScopedNameParts
"""
assert False
pass | [
"def",
"p_ScopedNameParts",
"(",
"self",
",",
"p",
")",
":",
"assert",
"False",
"pass"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L5498-L5503 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | Printout.GetLogicalPageMarginsRect | (*args, **kwargs) | return _windows_.Printout_GetLogicalPageMarginsRect(*args, **kwargs) | GetLogicalPageMarginsRect(self, PageSetupDialogData pageSetupData) -> Rect | GetLogicalPageMarginsRect(self, PageSetupDialogData pageSetupData) -> Rect | [
"GetLogicalPageMarginsRect",
"(",
"self",
"PageSetupDialogData",
"pageSetupData",
")",
"-",
">",
"Rect"
] | def GetLogicalPageMarginsRect(*args, **kwargs):
"""GetLogicalPageMarginsRect(self, PageSetupDialogData pageSetupData) -> Rect"""
return _windows_.Printout_GetLogicalPageMarginsRect(*args, **kwargs) | [
"def",
"GetLogicalPageMarginsRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Printout_GetLogicalPageMarginsRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5319-L5321 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/TowerofHanoi/environment.py | python | AgentState.update | (self, agent) | Update the state of the agent | Update the state of the agent | [
"Update",
"the",
"state",
"of",
"the",
"agent"
] | def update(self, agent):
"""
Update the state of the agent
"""
pos = copy(agent.state.position)
self.prev_rc = self.rc
self.rc = self.xy2rc(pos.x, pos.y)
self.time = time.time() | [
"def",
"update",
"(",
"self",
",",
"agent",
")",
":",
"pos",
"=",
"copy",
"(",
"agent",
".",
"state",
".",
"position",
")",
"self",
".",
"prev_rc",
"=",
"self",
".",
"rc",
"self",
".",
"rc",
"=",
"self",
".",
"xy2rc",
"(",
"pos",
".",
"x",
",",... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/TowerofHanoi/environment.py#L75-L82 | ||
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/meshutils/remove_obtuse_triangles.py | python | remove_obtuse_triangles | (mesh, max_angle=120, max_iterations=5) | return form_mesh(vertices, faces), info | Wrapper function of :func:`remove_obtuse_triangles_raw`.
Args:
mesh (:class:`Mesh`): Input mesh.
max_angle (``float``): (optional) Maximum obtuse angle in degrees
allowed. All triangle with larger internal angle would be split.
Default is 120 degrees.
max_iterations... | Wrapper function of :func:`remove_obtuse_triangles_raw`. | [
"Wrapper",
"function",
"of",
":",
"func",
":",
"remove_obtuse_triangles_raw",
"."
] | def remove_obtuse_triangles(mesh, max_angle=120, max_iterations=5):
""" Wrapper function of :func:`remove_obtuse_triangles_raw`.
Args:
mesh (:class:`Mesh`): Input mesh.
max_angle (``float``): (optional) Maximum obtuse angle in degrees
allowed. All triangle with larger internal angl... | [
"def",
"remove_obtuse_triangles",
"(",
"mesh",
",",
"max_angle",
"=",
"120",
",",
"max_iterations",
"=",
"5",
")",
":",
"vertices",
",",
"faces",
",",
"info",
"=",
"remove_obtuse_triangles_raw",
"(",
"mesh",
".",
"vertices",
",",
"mesh",
".",
"faces",
",",
... | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/meshutils/remove_obtuse_triangles.py#L60-L83 | |
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/stats-viewer.py | python | Main | (data_file, name_filter) | Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names. | Run the stats counter. | [
"Run",
"the",
"stats",
"counter",
"."
] | def Main(data_file, name_filter):
"""Run the stats counter.
Args:
data_file: The counters file to monitor.
name_filter: The regexp filter to apply to counter names.
"""
StatsViewer(data_file, name_filter).Run() | [
"def",
"Main",
"(",
"data_file",
",",
"name_filter",
")",
":",
"StatsViewer",
"(",
"data_file",
",",
"name_filter",
")",
".",
"Run",
"(",
")"
] | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/stats-viewer.py#L454-L461 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/codebrowser/codebrowser/cbrowser.py | python | CodeBrowserTree.OnShowAUIPane | (self) | Interface method that the main Editra window will call
When its auimanager does a Show when this window is contained
within an aui pane. Forces the tree to update. | Interface method that the main Editra window will call
When its auimanager does a Show when this window is contained
within an aui pane. Forces the tree to update. | [
"Interface",
"method",
"that",
"the",
"main",
"Editra",
"window",
"will",
"call",
"When",
"its",
"auimanager",
"does",
"a",
"Show",
"when",
"this",
"window",
"is",
"contained",
"within",
"an",
"aui",
"pane",
".",
"Forces",
"the",
"tree",
"to",
"update",
".... | def OnShowAUIPane(self):
"""Interface method that the main Editra window will call
When its auimanager does a Show when this window is contained
within an aui pane. Forces the tree to update.
"""
self.OnUpdateTree(force=True) | [
"def",
"OnShowAUIPane",
"(",
"self",
")",
":",
"self",
".",
"OnUpdateTree",
"(",
"force",
"=",
"True",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/codebrowser/codebrowser/cbrowser.py#L606-L612 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tarfile.py | python | TarInfo.tobuf | (self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape") | Return a tar header as a string of 512 byte blocks. | Return a tar header as a string of 512 byte blocks. | [
"Return",
"a",
"tar",
"header",
"as",
"a",
"string",
"of",
"512",
"byte",
"blocks",
"."
] | def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"):
"""Return a tar header as a string of 512 byte blocks.
"""
info = self.get_info()
if format == USTAR_FORMAT:
return self.create_ustar_header(info, encoding, errors)
elif format == GN... | [
"def",
"tobuf",
"(",
"self",
",",
"format",
"=",
"DEFAULT_FORMAT",
",",
"encoding",
"=",
"ENCODING",
",",
"errors",
"=",
"\"surrogateescape\"",
")",
":",
"info",
"=",
"self",
".",
"get_info",
"(",
")",
"if",
"format",
"==",
"USTAR_FORMAT",
":",
"return",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tarfile.py#L808-L820 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/_header_value_parser.py | python | _refold_parse_tree | (parse_tree, *, policy) | return policy.linesep.join(lines) + policy.linesep | Return string of contents of parse_tree folded according to RFC rules. | Return string of contents of parse_tree folded according to RFC rules. | [
"Return",
"string",
"of",
"contents",
"of",
"parse_tree",
"folded",
"according",
"to",
"RFC",
"rules",
"."
] | def _refold_parse_tree(parse_tree, *, policy):
"""Return string of contents of parse_tree folded according to RFC rules.
"""
# max_line_length 0/None means no limit, ie: infinitely long.
maxlen = policy.max_line_length or sys.maxsize
encoding = 'utf-8' if policy.utf8 else 'us-ascii'
lines = [''... | [
"def",
"_refold_parse_tree",
"(",
"parse_tree",
",",
"*",
",",
"policy",
")",
":",
"# max_line_length 0/None means no limit, ie: infinitely long.",
"maxlen",
"=",
"policy",
".",
"max_line_length",
"or",
"sys",
".",
"maxsize",
"encoding",
"=",
"'utf-8'",
"if",
"policy"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/_header_value_parser.py#L2643-L2744 | |
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py | python | get_max_fallback_duration | (request, mode, dp_future) | return min(max_duration, dp_duration) | By knowing the duration of direct path, we can limit the max duration for proximities by crowfly and fallback
durations
:param request:
:param mode:
:param dp: direct_path future
:return: max_fallback_duration | By knowing the duration of direct path, we can limit the max duration for proximities by crowfly and fallback
durations
:param request:
:param mode:
:param dp: direct_path future
:return: max_fallback_duration | [
"By",
"knowing",
"the",
"duration",
"of",
"direct",
"path",
"we",
"can",
"limit",
"the",
"max",
"duration",
"for",
"proximities",
"by",
"crowfly",
"and",
"fallback",
"durations",
":",
"param",
"request",
":",
":",
"param",
"mode",
":",
":",
"param",
"dp",
... | def get_max_fallback_duration(request, mode, dp_future):
"""
By knowing the duration of direct path, we can limit the max duration for proximities by crowfly and fallback
durations
:param request:
:param mode:
:param dp: direct_path future
:return: max_fallback_duration
"""
# 30 min... | [
"def",
"get_max_fallback_duration",
"(",
"request",
",",
"mode",
",",
"dp_future",
")",
":",
"# 30 minutes by default",
"max_duration",
"=",
"request",
".",
"get",
"(",
"'max_{}_duration_to_pt'",
".",
"format",
"(",
"mode",
")",
",",
"1800",
")",
"dp",
"=",
"d... | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py#L570-L583 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | common/proto/call_python_client.py | python | CallPythonClient._read_next_message | (self) | Returns incoming messages using a generator. | Returns incoming messages using a generator. | [
"Returns",
"incoming",
"messages",
"using",
"a",
"generator",
"."
] | def _read_next_message(self):
"""Returns incoming messages using a generator."""
while not self._done:
fifo = self._get_file()
# Close the file if we reach the end, NOT when exiting the scope
# (which is why `with` is not used here).
# This way the user ca... | [
"def",
"_read_next_message",
"(",
"self",
")",
":",
"while",
"not",
"self",
".",
"_done",
":",
"fifo",
"=",
"self",
".",
"_get_file",
"(",
")",
"# Close the file if we reach the end, NOT when exiting the scope",
"# (which is why `with` is not used here).",
"# This way the u... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/common/proto/call_python_client.py#L515-L532 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py | python | print_line | (line) | Default retrlines callback to print a line. | Default retrlines callback to print a line. | [
"Default",
"retrlines",
"callback",
"to",
"print",
"a",
"line",
"."
] | def print_line(line):
'''Default retrlines callback to print a line.'''
print(line) | [
"def",
"print_line",
"(",
"line",
")",
":",
"print",
"(",
"line",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py#L904-L906 | ||
AcademySoftwareFoundation/OpenColorIO | 73508eb5230374df8d96147a0627c015d359a641 | share/nuke/ocionuke/cdl.py | python | _cdltransforms_to_xml | (allcc) | return ET.tostring(root) | Given a list of CDLTransform objects, returns an XML string | Given a list of CDLTransform objects, returns an XML string | [
"Given",
"a",
"list",
"of",
"CDLTransform",
"objects",
"returns",
"an",
"XML",
"string"
] | def _cdltransforms_to_xml(allcc):
"""Given a list of CDLTransform objects, returns an XML string
"""
root = ET.Element("ColorCorrectionCollection")
root.attrib['xmlns'] = 'urn:ASC:CDL:v1.2'
for cc in allcc:
cur = ET.fromstring(cc.getXML())
# Strip away xmlns
for elem in cu... | [
"def",
"_cdltransforms_to_xml",
"(",
"allcc",
")",
":",
"root",
"=",
"ET",
".",
"Element",
"(",
"\"ColorCorrectionCollection\"",
")",
"root",
".",
"attrib",
"[",
"'xmlns'",
"]",
"=",
"'urn:ASC:CDL:v1.2'",
"for",
"cc",
"in",
"allcc",
":",
"cur",
"=",
"ET",
... | https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/73508eb5230374df8d96147a0627c015d359a641/share/nuke/ocionuke/cdl.py#L97-L113 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.GetColLabelSize | (*args, **kwargs) | return _grid.Grid_GetColLabelSize(*args, **kwargs) | GetColLabelSize(self) -> int | GetColLabelSize(self) -> int | [
"GetColLabelSize",
"(",
"self",
")",
"-",
">",
"int"
] | def GetColLabelSize(*args, **kwargs):
"""GetColLabelSize(self) -> int"""
return _grid.Grid_GetColLabelSize(*args, **kwargs) | [
"def",
"GetColLabelSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetColLabelSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1482-L1484 | |
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp2/ctptd.py | python | CtpTd.onRspParkedOrderAction | (self, ParkedOrderActionField, RspInfoField, requestId, final) | 预埋撤单录入请求响应 | 预埋撤单录入请求响应 | [
"预埋撤单录入请求响应"
] | def onRspParkedOrderAction(self, ParkedOrderActionField, RspInfoField, requestId, final):
"""预埋撤单录入请求响应"""
pass | [
"def",
"onRspParkedOrderAction",
"(",
"self",
",",
"ParkedOrderActionField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp2/ctptd.py#L112-L114 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py | python | MainWindow.do_switch_roi_mode | (self) | Add region of interest to 2D image
:return: | Add region of interest to 2D image
:return: | [
"Add",
"region",
"of",
"interest",
"to",
"2D",
"image",
":",
"return",
":"
] | def do_switch_roi_mode(self):
""" Add region of interest to 2D image
:return:
"""
# set the button to next mode
if str(self.ui.pushButton_switchROIMode.text()) == 'Enter ROI-Edit Mode':
# enter adding ROI mode
self.ui.graphicsView_detector2dPlot.enter_roi_... | [
"def",
"do_switch_roi_mode",
"(",
"self",
")",
":",
"# set the button to next mode",
"if",
"str",
"(",
"self",
".",
"ui",
".",
"pushButton_switchROIMode",
".",
"text",
"(",
")",
")",
"==",
"'Enter ROI-Edit Mode'",
":",
"# enter adding ROI mode",
"self",
".",
"ui",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L704-L718 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CustomTreeCtrl.SetHyperTextVisitedColour | (self, colour) | Sets the colour used to render a visited hypertext item.
:param `colour`: a valid :class:`Colour` instance.
:note: This method is meaningful only for hypertext-like items. | Sets the colour used to render a visited hypertext item. | [
"Sets",
"the",
"colour",
"used",
"to",
"render",
"a",
"visited",
"hypertext",
"item",
"."
] | def SetHyperTextVisitedColour(self, colour):
"""
Sets the colour used to render a visited hypertext item.
:param `colour`: a valid :class:`Colour` instance.
:note: This method is meaningful only for hypertext-like items.
"""
self._hypertextvisitedcolour = colour
... | [
"def",
"SetHyperTextVisitedColour",
"(",
"self",
",",
"colour",
")",
":",
"self",
".",
"_hypertextvisitedcolour",
"=",
"colour",
"self",
".",
"_dirty",
"=",
"True"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L3924-L3934 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/series.py | python | Series.nullable | (self) | return self._column.nullable | A boolean indicating whether a null-mask is needed | A boolean indicating whether a null-mask is needed | [
"A",
"boolean",
"indicating",
"whether",
"a",
"null",
"-",
"mask",
"is",
"needed"
] | def nullable(self):
"""A boolean indicating whether a null-mask is needed"""
return self._column.nullable | [
"def",
"nullable",
"(",
"self",
")",
":",
"return",
"self",
".",
"_column",
".",
"nullable"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/series.py#L1503-L1505 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/summary_io.py | python | SummaryWriter.__init__ | (self,
logdir,
graph=None,
max_queue=10,
flush_secs=120,
graph_def=None) | Creates a `SummaryWriter` and an event file.
This class is deprecated, and should be replaced with tf.summary.FileWriter.
On construction the summary writer creates a new event file in `logdir`.
This event file will contain `Event` protocol buffers constructed when you
call one of the following functi... | Creates a `SummaryWriter` and an event file. | [
"Creates",
"a",
"SummaryWriter",
"and",
"an",
"event",
"file",
"."
] | def __init__(self,
logdir,
graph=None,
max_queue=10,
flush_secs=120,
graph_def=None):
"""Creates a `SummaryWriter` and an event file.
This class is deprecated, and should be replaced with tf.summary.FileWriter.
On construction the ... | [
"def",
"__init__",
"(",
"self",
",",
"logdir",
",",
"graph",
"=",
"None",
",",
"max_queue",
"=",
"10",
",",
"flush_secs",
"=",
"120",
",",
"graph_def",
"=",
"None",
")",
":",
"super",
"(",
"SummaryWriter",
",",
"self",
")",
".",
"__init__",
"(",
"log... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/summary_io.py#L34-L81 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | FPRef.ebits | (self) | return self.sort().ebits() | Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8 | Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8 | [
"Retrieves",
"the",
"number",
"of",
"bits",
"reserved",
"for",
"the",
"exponent",
"in",
"the",
"FloatingPoint",
"expression",
"self",
".",
">>>",
"b",
"=",
"FPSort",
"(",
"8",
"24",
")",
">>>",
"b",
".",
"ebits",
"()",
"8"
] | def ebits(self):
"""Retrieves the number of bits reserved for the exponent in the FloatingPoint expression `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8
"""
return self.sort().ebits() | [
"def",
"ebits",
"(",
"self",
")",
":",
"return",
"self",
".",
"sort",
"(",
")",
".",
"ebits",
"(",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L9364-L9370 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events.negate | (self, _object, _attributes={}, **_arguments) | negate: Numeric negation
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | negate: Numeric negation
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"negate",
":",
"Numeric",
"negation",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def negate(self, _object, _attributes={}, **_arguments):
"""negate: Numeric negation
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = 'neg '
if _argumen... | [
"def",
"negate",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'neg '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L517-L536 | ||
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/detection/object_detection/scripts/yolo3/utils.py | python | get_random_data | (annotation_line, input_shape, random=True, max_boxes=20, jitter=.3, hue=.1, sat=1.5, val=1.5, proc_img=True) | return image_data, box_data | random preprocessing for real-time data augmentation | random preprocessing for real-time data augmentation | [
"random",
"preprocessing",
"for",
"real",
"-",
"time",
"data",
"augmentation"
] | def get_random_data(annotation_line, input_shape, random=True, max_boxes=20, jitter=.3, hue=.1, sat=1.5, val=1.5, proc_img=True):
'''random preprocessing for real-time data augmentation'''
line = annotation_line.split()
image = Image.open(line[0])
iw, ih = image.size
h, w = input_shape
box = np.... | [
"def",
"get_random_data",
"(",
"annotation_line",
",",
"input_shape",
",",
"random",
"=",
"True",
",",
"max_boxes",
"=",
"20",
",",
"jitter",
"=",
".3",
",",
"hue",
"=",
".1",
",",
"sat",
"=",
"1.5",
",",
"val",
"=",
"1.5",
",",
"proc_img",
"=",
"Tru... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/detection/object_detection/scripts/yolo3/utils.py#L36-L121 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathSlot.py | python | ObjectSlot._getLowestPoint | (self, shape_1) | _getLowestPoint(shape)... Returns lowest vertex of shape as vector. | _getLowestPoint(shape)... Returns lowest vertex of shape as vector. | [
"_getLowestPoint",
"(",
"shape",
")",
"...",
"Returns",
"lowest",
"vertex",
"of",
"shape",
"as",
"vector",
"."
] | def _getLowestPoint(self, shape_1):
"""_getLowestPoint(shape)... Returns lowest vertex of shape as vector."""
# find lowest vertex
vMin = shape_1.Vertexes[0]
zmin = vMin.Z
same = [vMin]
for V in shape_1.Vertexes:
if V.Z < zmin:
zmin = V.Z
... | [
"def",
"_getLowestPoint",
"(",
"self",
",",
"shape_1",
")",
":",
"# find lowest vertex",
"vMin",
"=",
"shape_1",
".",
"Vertexes",
"[",
"0",
"]",
"zmin",
"=",
"vMin",
".",
"Z",
"same",
"=",
"[",
"vMin",
"]",
"for",
"V",
"in",
"shape_1",
".",
"Vertexes",... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSlot.py#L1123-L1142 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/leaf.py | python | Leaf.value | (self) | return self._value | NumPy.ndarray or None: The numeric value of the parameter. | NumPy.ndarray or None: The numeric value of the parameter. | [
"NumPy",
".",
"ndarray",
"or",
"None",
":",
"The",
"numeric",
"value",
"of",
"the",
"parameter",
"."
] | def value(self):
"""NumPy.ndarray or None: The numeric value of the parameter.
"""
return self._value | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_value"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/leaf.py#L359-L362 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/bayesflow/python/ops/monte_carlo.py | python | expectation_importance_sampler_logspace | (
log_f,
log_p,
sampling_dist_q,
z=None,
n=None,
seed=None,
name='expectation_importance_sampler_logspace') | r"""Importance sampling with a positive function, in log-space.
With `p(z) := exp{log_p(z)}`, and `f(z) = exp{log_f(z)}`, this `Op`
returns
```
Log[ n^{-1} sum_{i=1}^n [ f(z_i) p(z_i) / q(z_i) ] ], z_i ~ q,
\approx Log[ E_q[ f(Z) p(Z) / q(Z) ] ]
= Log[E_p[f(Z)]]
```
This integral is done in lo... | r"""Importance sampling with a positive function, in log-space. | [
"r",
"Importance",
"sampling",
"with",
"a",
"positive",
"function",
"in",
"log",
"-",
"space",
"."
] | def expectation_importance_sampler_logspace(
log_f,
log_p,
sampling_dist_q,
z=None,
n=None,
seed=None,
name='expectation_importance_sampler_logspace'):
r"""Importance sampling with a positive function, in log-space.
With `p(z) := exp{log_p(z)}`, and `f(z) = exp{log_f(z)}`, this `Op`
r... | [
"def",
"expectation_importance_sampler_logspace",
"(",
"log_f",
",",
"log_p",
",",
"sampling_dist_q",
",",
"z",
"=",
"None",
",",
"n",
"=",
"None",
",",
"seed",
"=",
"None",
",",
"name",
"=",
"'expectation_importance_sampler_logspace'",
")",
":",
"q",
"=",
"sa... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/bayesflow/python/ops/monte_carlo.py#L159-L211 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool._GetCFBundleIdentifier | (self) | return info_plist_data['CFBundleIdentifier'] | Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle. | Extracts CFBundleIdentifier value from Info.plist in the bundle. | [
"Extracts",
"CFBundleIdentifier",
"value",
"from",
"Info",
".",
"plist",
"in",
"the",
"bundle",
"."
] | def _GetCFBundleIdentifier(self):
"""Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
"""
info_plist_path = os.path.join(
os.environ['TARGET_BUILD_DIR'],
os.environ['INFOPLIST_PATH'])
... | [
"def",
"_GetCFBundleIdentifier",
"(",
"self",
")",
":",
"info_plist_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'TARGET_BUILD_DIR'",
"]",
",",
"os",
".",
"environ",
"[",
"'INFOPLIST_PATH'",
"]",
")",
"info_plist_data",
"=",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/mac_tool.py#L577-L587 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_crop | (node, **kwargs) | return nodes | Map MXNet's crop operator attributes to onnx's Slice operator | Map MXNet's crop operator attributes to onnx's Slice operator | [
"Map",
"MXNet",
"s",
"crop",
"operator",
"attributes",
"to",
"onnx",
"s",
"Slice",
"operator"
] | def convert_crop(node, **kwargs):
"""Map MXNet's crop operator attributes to onnx's Slice operator
"""
from onnx.helper import make_node
name, inputs, attrs = get_inputs(node, kwargs)
num_inputs = len(inputs)
y, x = convert_string_to_list(attrs.get('offset', '(0, 0)')) # pylint: disable=unbalan... | [
"def",
"convert_crop",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"name",
",",
"inputs",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
")",
"num_inputs",
"=",
"len",
"(",
"inputs... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L319-L352 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/factory.py | python | ResourceFactory._create_autoload_property | (factory_self, resource_name, name,
snake_cased, member_model, service_context) | return property(property_loader) | Creates a new property on the resource to lazy-load its value
via the resource's ``load`` method (if it exists). | Creates a new property on the resource to lazy-load its value
via the resource's ``load`` method (if it exists). | [
"Creates",
"a",
"new",
"property",
"on",
"the",
"resource",
"to",
"lazy",
"-",
"load",
"its",
"value",
"via",
"the",
"resource",
"s",
"load",
"method",
"(",
"if",
"it",
"exists",
")",
"."
] | def _create_autoload_property(factory_self, resource_name, name,
snake_cased, member_model, service_context):
"""
Creates a new property on the resource to lazy-load its value
via the resource's ``load`` method (if it exists).
"""
# The property ... | [
"def",
"_create_autoload_property",
"(",
"factory_self",
",",
"resource_name",
",",
"name",
",",
"snake_cased",
",",
"member_model",
",",
"service_context",
")",
":",
"# The property loader will check to see if this resource has already",
"# been loaded and return the cached value ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/factory.py#L326-L357 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/plugin.py | python | Plugin.get_plugin | (self, key) | return self.plugins[key] | Visit a plugin by key.
Parameters
----------
key : str
key of the plugin
Returns
-------
object
the plugin | Visit a plugin by key.
Parameters
----------
key : str
key of the plugin
Returns
-------
object
the plugin | [
"Visit",
"a",
"plugin",
"by",
"key",
".",
"Parameters",
"----------",
"key",
":",
"str",
"key",
"of",
"the",
"plugin",
"Returns",
"-------",
"object",
"the",
"plugin"
] | def get_plugin(self, key) -> object:
"""Visit a plugin by key.
Parameters
----------
key : str
key of the plugin
Returns
-------
object
the plugin
"""
return self.plugins[key] | [
"def",
"get_plugin",
"(",
"self",
",",
"key",
")",
"->",
"object",
":",
"return",
"self",
".",
"plugins",
"[",
"key",
"]"
] | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/plugin.py#L50-L63 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | Vendor_TCG_TestResponse.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(Vendor_TCG_TestResponse) | Returns new Vendor_TCG_TestResponse object constructed from its
marshaled representation in the given byte buffer | Returns new Vendor_TCG_TestResponse object constructed from its
marshaled representation in the given byte buffer | [
"Returns",
"new",
"Vendor_TCG_TestResponse",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new Vendor_TCG_TestResponse object constructed from its
marshaled representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(Vendor_TCG_TestResponse) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"Vendor_TCG_TestResponse",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L17653-L17657 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/message.py | python | Message.MergeFrom | (self, other_msg) | Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repeated fields are
appended. Singular s... | Merges the contents of the specified message into current message. | [
"Merges",
"the",
"contents",
"of",
"the",
"specified",
"message",
"into",
"current",
"message",
"."
] | def MergeFrom(self, other_msg):
"""Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repea... | [
"def",
"MergeFrom",
"(",
"self",
",",
"other_msg",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/message.py#L94-L105 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/cmake.py | python | UnsetVariable | (output, variable_name) | Unsets a CMake variable. | Unsets a CMake variable. | [
"Unsets",
"a",
"CMake",
"variable",
"."
] | def UnsetVariable(output, variable_name):
"""Unsets a CMake variable."""
output.write('unset(')
output.write(variable_name)
output.write(')\n') | [
"def",
"UnsetVariable",
"(",
"output",
",",
"variable_name",
")",
":",
"output",
".",
"write",
"(",
"'unset('",
")",
"output",
".",
"write",
"(",
"variable_name",
")",
"output",
".",
"write",
"(",
"')\\n'",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/cmake.py#L204-L208 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | AsyncReader.UnlockBuffer | (self, *args) | return _gdal.AsyncReader_UnlockBuffer(self, *args) | r"""UnlockBuffer(AsyncReader self) | r"""UnlockBuffer(AsyncReader self) | [
"r",
"UnlockBuffer",
"(",
"AsyncReader",
"self",
")"
] | def UnlockBuffer(self, *args):
r"""UnlockBuffer(AsyncReader self)"""
return _gdal.AsyncReader_UnlockBuffer(self, *args) | [
"def",
"UnlockBuffer",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"AsyncReader_UnlockBuffer",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2113-L2115 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/pylabtools.py | python | select_figure_formats | (shell, formats, **kwargs) | Select figure formats for the inline backend.
Parameters
==========
shell : InteractiveShell
The main IPython instance.
formats : str or set
One or a set of figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
**kwargs : any
Extra keyword arguments to be passed t... | Select figure formats for the inline backend. | [
"Select",
"figure",
"formats",
"for",
"the",
"inline",
"backend",
"."
] | def select_figure_formats(shell, formats, **kwargs):
"""Select figure formats for the inline backend.
Parameters
==========
shell : InteractiveShell
The main IPython instance.
formats : str or set
One or a set of figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
*... | [
"def",
"select_figure_formats",
"(",
"shell",
",",
"formats",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"matplotlib",
"from",
"matplotlib",
".",
"figure",
"import",
"Figure",
"svg_formatter",
"=",
"shell",
".",
"display_formatter",
".",
"formatters",
"[",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/pylabtools.py#L240-L293 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/ipaddress.py | python | IPv4Network.__init__ | (self, address, strict=True) | Instantiate a new IPv4 network object.
Args:
address: A string or integer representing the IP [& network].
'192.0.2.0/24'
'192.0.2.0/255.255.255.0'
'192.0.0.2/0.0.0.255'
are all functionally the same in IPv4. Similarly,
'192.0.2.... | Instantiate a new IPv4 network object. | [
"Instantiate",
"a",
"new",
"IPv4",
"network",
"object",
"."
] | def __init__(self, address, strict=True):
"""Instantiate a new IPv4 network object.
Args:
address: A string or integer representing the IP [& network].
'192.0.2.0/24'
'192.0.2.0/255.255.255.0'
'192.0.0.2/0.0.0.255'
are all functionall... | [
"def",
"__init__",
"(",
"self",
",",
"address",
",",
"strict",
"=",
"True",
")",
":",
"_BaseV4",
".",
"__init__",
"(",
"self",
",",
"address",
")",
"_BaseNetwork",
".",
"__init__",
"(",
"self",
",",
"address",
")",
"# Constructing from a packed address",
"if... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L1443-L1542 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py | python | ASTCodeUpgrader.process_file | (self, in_filename, out_filename) | return ret | Process the given python file for incompatible changes.
Args:
in_filename: filename to parse
out_filename: output file to write to
Returns:
A tuple representing number of files processed, log of actions, errors | Process the given python file for incompatible changes. | [
"Process",
"the",
"given",
"python",
"file",
"for",
"incompatible",
"changes",
"."
] | def process_file(self, in_filename, out_filename):
"""Process the given python file for incompatible changes.
Args:
in_filename: filename to parse
out_filename: output file to write to
Returns:
A tuple representing number of files processed, log of actions, errors
"""
# Write to ... | [
"def",
"process_file",
"(",
"self",
",",
"in_filename",
",",
"out_filename",
")",
":",
"# Write to a temporary file, just in case we are doing an implace modify.",
"# pylint: disable=g-backslash-continuation",
"with",
"open",
"(",
"in_filename",
",",
"\"r\"",
")",
"as",
"in_f... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ast_edits.py#L885-L904 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLSumForeground.py | python | ReflectometryILLSumForeground.summary | (self) | return 'Sums foreground pixels in selected summation mode, optionally converting to reflectivity.' | Return a summary of the algorithm. | Return a summary of the algorithm. | [
"Return",
"a",
"summary",
"of",
"the",
"algorithm",
"."
] | def summary(self):
"""Return a summary of the algorithm."""
return 'Sums foreground pixels in selected summation mode, optionally converting to reflectivity.' | [
"def",
"summary",
"(",
"self",
")",
":",
"return",
"'Sums foreground pixels in selected summation mode, optionally converting to reflectivity.'"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLSumForeground.py#L51-L53 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/input.py | python | _shuffle_batch_join | (tensors_list, batch_size, capacity,
min_after_dequeue, keep_input, seed=None,
enqueue_many=False, shapes=None,
allow_smaller_final_batch=False, shared_name=None,
name=None) | Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`. | Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`. | [
"Helper",
"function",
"for",
"shuffle_batch_join",
"and",
"maybe_shuffle_batch_join",
"."
] | def _shuffle_batch_join(tensors_list, batch_size, capacity,
min_after_dequeue, keep_input, seed=None,
enqueue_many=False, shapes=None,
allow_smaller_final_batch=False, shared_name=None,
name=None):
"""Helper function for `... | [
"def",
"_shuffle_batch_join",
"(",
"tensors_list",
",",
"batch_size",
",",
"capacity",
",",
"min_after_dequeue",
",",
"keep_input",
",",
"seed",
"=",
"None",
",",
"enqueue_many",
"=",
"False",
",",
"shapes",
"=",
"None",
",",
"allow_smaller_final_batch",
"=",
"F... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/input.py#L802-L841 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/model.py | python | ServiceModel.signing_name | (self) | return signing_name | The name to use when computing signatures.
If the model does not define a signing name, this
value will be the endpoint prefix defined in the model. | The name to use when computing signatures. | [
"The",
"name",
"to",
"use",
"when",
"computing",
"signatures",
"."
] | def signing_name(self):
"""The name to use when computing signatures.
If the model does not define a signing name, this
value will be the endpoint prefix defined in the model.
"""
signing_name = self.metadata.get('signingName')
if signing_name is None:
signin... | [
"def",
"signing_name",
"(",
"self",
")",
":",
"signing_name",
"=",
"self",
".",
"metadata",
".",
"get",
"(",
"'signingName'",
")",
"if",
"signing_name",
"is",
"None",
":",
"signing_name",
"=",
"self",
".",
"endpoint_prefix",
"return",
"signing_name"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/model.py#L311-L320 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/index.py | python | PackageIndex.__init__ | (self, url=None, mirror_host=None) | Initialise an instance.
:param url: The URL of the index. If not specified, the URL for PyPI is
used.
:param mirror_host: If not specified, ``last.pypi.python.org`` is used.
This is expected to have a canonial name which
allows... | Initialise an instance. | [
"Initialise",
"an",
"instance",
"."
] | def __init__(self, url=None, mirror_host=None):
"""
Initialise an instance.
:param url: The URL of the index. If not specified, the URL for PyPI is
used.
:param mirror_host: If not specified, ``last.pypi.python.org`` is used.
This is expec... | [
"def",
"__init__",
"(",
"self",
",",
"url",
"=",
"None",
",",
"mirror_host",
"=",
"None",
")",
":",
"self",
".",
"url",
"=",
"url",
"or",
"DEFAULT_INDEX",
"self",
".",
"mirror_host",
"=",
"mirror_host",
"or",
"DEFAULT_MIRROR_HOST",
"self",
".",
"read_confi... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/index.py#L37-L71 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/web.py | python | RequestHandler.cookies | (self) | return self.request.cookies | An alias for
`self.request.cookies <.httputil.HTTPServerRequest.cookies>`. | An alias for
`self.request.cookies <.httputil.HTTPServerRequest.cookies>`. | [
"An",
"alias",
"for",
"self",
".",
"request",
".",
"cookies",
"<",
".",
"httputil",
".",
"HTTPServerRequest",
".",
"cookies",
">",
"."
] | def cookies(self) -> Dict[str, http.cookies.Morsel]:
"""An alias for
`self.request.cookies <.httputil.HTTPServerRequest.cookies>`."""
return self.request.cookies | [
"def",
"cookies",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"http",
".",
"cookies",
".",
"Morsel",
"]",
":",
"return",
"self",
".",
"request",
".",
"cookies"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/web.py#L578-L581 | |
nasa/astrobee | 9241e67e6692810d6e275abb3165b6d02f4ca5ef | localization/sparse_mapping/tools/grow_map.py | python | check_bot | () | It is very crucial that the bot is set. | It is very crucial that the bot is set. | [
"It",
"is",
"very",
"crucial",
"that",
"the",
"bot",
"is",
"set",
"."
] | def check_bot():
"""It is very crucial that the bot is set."""
bot = "ASTROBEE_ROBOT"
if bot in os.environ:
print((bot + "=" + os.environ[bot]))
else:
raise Exception("Must set " + bot) | [
"def",
"check_bot",
"(",
")",
":",
"bot",
"=",
"\"ASTROBEE_ROBOT\"",
"if",
"bot",
"in",
"os",
".",
"environ",
":",
"print",
"(",
"(",
"bot",
"+",
"\"=\"",
"+",
"os",
".",
"environ",
"[",
"bot",
"]",
")",
")",
"else",
":",
"raise",
"Exception",
"(",... | https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/localization/sparse_mapping/tools/grow_map.py#L32-L38 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | reciprocal | (x, dtype=None) | return _apply_tensor_op(lambda x: F.tensor_div(1, x), x, dtype=dtype) | Returns the reciprocal of the argument, element-wise.
Calculates ``1/x``.
Note:
Numpy arguments `casting`, `order`, `subok`, `signature`, and `extobj` are
not supported.
When `where` is provided, `out` must have a tensor value. `out` is not supported
for storing the result, how... | Returns the reciprocal of the argument, element-wise. | [
"Returns",
"the",
"reciprocal",
"of",
"the",
"argument",
"element",
"-",
"wise",
"."
] | def reciprocal(x, dtype=None):
"""
Returns the reciprocal of the argument, element-wise.
Calculates ``1/x``.
Note:
Numpy arguments `casting`, `order`, `subok`, `signature`, and `extobj` are
not supported.
When `where` is provided, `out` must have a tensor value. `out` is not su... | [
"def",
"reciprocal",
"(",
"x",
",",
"dtype",
"=",
"None",
")",
":",
"return",
"_apply_tensor_op",
"(",
"lambda",
"x",
":",
"F",
".",
"tensor_div",
"(",
"1",
",",
"x",
")",
",",
"x",
",",
"dtype",
"=",
"dtype",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L1198-L1232 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | linspace | (start, stop, num, endpoint=True, ctx=None, dtype=mx_real_t) | return _internal._linspace(start=start, stop=stop, num=num,
endpoint=endpoint, dtype=dtype, ctx=str(ctx)) | Return evenly spaced numbers within a specified interval.
Values are generated within the half-open interval [`start`, `stop`) or
closed interval [start, stop] depending on whether `endpoint` is True or
False. The function is similar to `numpy.linspace`, but returns an `NDArray`.
Parameters
------... | Return evenly spaced numbers within a specified interval. | [
"Return",
"evenly",
"spaced",
"numbers",
"within",
"a",
"specified",
"interval",
"."
] | def linspace(start, stop, num, endpoint=True, ctx=None, dtype=mx_real_t):
"""Return evenly spaced numbers within a specified interval.
Values are generated within the half-open interval [`start`, `stop`) or
closed interval [start, stop] depending on whether `endpoint` is True or
False. The function is ... | [
"def",
"linspace",
"(",
"start",
",",
"stop",
",",
"num",
",",
"endpoint",
"=",
"True",
",",
"ctx",
"=",
"None",
",",
"dtype",
"=",
"mx_real_t",
")",
":",
"if",
"ctx",
"is",
"None",
":",
"ctx",
"=",
"current_device",
"(",
")",
"return",
"_internal",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L3565-L3606 | |
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/jormungandr/jormungandr/equipments/sytral.py | python | SytralProvider._process_for_journeys | (self, data, stop_points_list) | For each stop point within journeys response, the structure 'equipment_details' is updated if the corresponding code is present
:param data: equipments data received from the webservice
:param stop_points_list: list of stop_points from the protobuf response | For each stop point within journeys response, the structure 'equipment_details' is updated if the corresponding code is present
:param data: equipments data received from the webservice
:param stop_points_list: list of stop_points from the protobuf response | [
"For",
"each",
"stop",
"point",
"within",
"journeys",
"response",
"the",
"structure",
"equipment_details",
"is",
"updated",
"if",
"the",
"corresponding",
"code",
"is",
"present",
":",
"param",
"data",
":",
"equipments",
"data",
"received",
"from",
"the",
"webser... | def _process_for_journeys(self, data, stop_points_list):
"""
For each stop point within journeys response, the structure 'equipment_details' is updated if the corresponding code is present
:param data: equipments data received from the webservice
:param stop_points_list: list of stop_poi... | [
"def",
"_process_for_journeys",
"(",
"self",
",",
"data",
",",
"stop_points_list",
")",
":",
"for",
"st",
"in",
"stop_points_list",
":",
"for",
"code",
"in",
"st",
".",
"codes",
":",
"if",
"code",
".",
"type",
"in",
"self",
".",
"code_types",
":",
"equip... | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/jormungandr/jormungandr/equipments/sytral.py#L144-L161 | ||
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/plot_rtneat.py | python | process_line | (line) | Process a line of the log file and record the information in it in the LearningCurve | Process a line of the log file and record the information in it in the LearningCurve | [
"Process",
"a",
"line",
"of",
"the",
"log",
"file",
"and",
"record",
"the",
"information",
"in",
"it",
"in",
"the",
"LearningCurve"
] | def process_line(line):
"""
Process a line of the log file and record the information in it in the LearningCurve
"""
global zmin, zmax, rmin, rmax, w, mean, stdev
line = line.strip().lower()
m = ai_rtneat_pattern.search(line)
if not m:
m = nero_pattern.search(line)
if m:
... | [
"def",
"process_line",
"(",
"line",
")",
":",
"global",
"zmin",
",",
"zmax",
",",
"rmin",
",",
"rmax",
",",
"w",
",",
"mean",
",",
"stdev",
"line",
"=",
"line",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"m",
"=",
"ai_rtneat_pattern",
".",
"... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/plot_rtneat.py#L44-L63 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsMyanmar | (code) | return ret | Check whether the character is part of Myanmar UCS Block | Check whether the character is part of Myanmar UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Myanmar",
"UCS",
"Block"
] | def uCSIsMyanmar(code):
"""Check whether the character is part of Myanmar UCS Block """
ret = libxml2mod.xmlUCSIsMyanmar(code)
return ret | [
"def",
"uCSIsMyanmar",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsMyanmar",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1993-L1996 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/visualization/mpl_tripinfos_twoAgainst.py | python | toHex | (val) | return hex[int(val / 16)] + hex[int(val - int(val / 16) * 16)] | Converts the given value (0-255) into its hexadecimal representation | Converts the given value (0-255) into its hexadecimal representation | [
"Converts",
"the",
"given",
"value",
"(",
"0",
"-",
"255",
")",
"into",
"its",
"hexadecimal",
"representation"
] | def toHex(val):
"""Converts the given value (0-255) into its hexadecimal representation"""
hex = "0123456789abcdef"
return hex[int(val / 16)] + hex[int(val - int(val / 16) * 16)] | [
"def",
"toHex",
"(",
"val",
")",
":",
"hex",
"=",
"\"0123456789abcdef\"",
"return",
"hex",
"[",
"int",
"(",
"val",
"/",
"16",
")",
"]",
"+",
"hex",
"[",
"int",
"(",
"val",
"-",
"int",
"(",
"val",
"/",
"16",
")",
"*",
"16",
")",
"]"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/visualization/mpl_tripinfos_twoAgainst.py#L35-L38 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/slicer/util.py | python | resetSliceViews | () | Reset focal view around volumes | Reset focal view around volumes | [
"Reset",
"focal",
"view",
"around",
"volumes"
] | def resetSliceViews():
"""Reset focal view around volumes
"""
import slicer
manager = slicer.app.layoutManager().resetSliceViews() | [
"def",
"resetSliceViews",
"(",
")",
":",
"import",
"slicer",
"manager",
"=",
"slicer",
".",
"app",
".",
"layoutManager",
"(",
")",
".",
"resetSliceViews",
"(",
")"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/util.py#L826-L830 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/ReplaceDialog.py | python | ReplaceDialog._replace_expand | (self, m, repl) | return new | Helper function for expanding a regular expression
in the replace field, if needed. | Helper function for expanding a regular expression
in the replace field, if needed. | [
"Helper",
"function",
"for",
"expanding",
"a",
"regular",
"expression",
"in",
"the",
"replace",
"field",
"if",
"needed",
"."
] | def _replace_expand(self, m, repl):
""" Helper function for expanding a regular expression
in the replace field, if needed. """
if self.engine.isre():
try:
new = m.expand(repl)
except re.error:
self.engine.report_error(repl, 'Invalid Re... | [
"def",
"_replace_expand",
"(",
"self",
",",
"m",
",",
"repl",
")",
":",
"if",
"self",
".",
"engine",
".",
"isre",
"(",
")",
":",
"try",
":",
"new",
"=",
"m",
".",
"expand",
"(",
"repl",
")",
"except",
"re",
".",
"error",
":",
"self",
".",
"engi... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/ReplaceDialog.py#L65-L76 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/environment.py | python | Template.new_context | (self, vars=None, shared=False, locals=None) | return new_context(self.environment, self.name, self.blocks,
vars, shared, self.globals, locals) | Create a new :class:`Context` for this template. The vars
provided will be passed to the template. Per default the globals
are added to the context. If shared is set to `True` the data
is passed as it to the context without adding the globals.
`locals` can be a dict of local variable... | Create a new :class:`Context` for this template. The vars
provided will be passed to the template. Per default the globals
are added to the context. If shared is set to `True` the data
is passed as it to the context without adding the globals. | [
"Create",
"a",
"new",
":",
"class",
":",
"Context",
"for",
"this",
"template",
".",
"The",
"vars",
"provided",
"will",
"be",
"passed",
"to",
"the",
"template",
".",
"Per",
"default",
"the",
"globals",
"are",
"added",
"to",
"the",
"context",
".",
"If",
... | def new_context(self, vars=None, shared=False, locals=None):
"""Create a new :class:`Context` for this template. The vars
provided will be passed to the template. Per default the globals
are added to the context. If shared is set to `True` the data
is passed as it to the context witho... | [
"def",
"new_context",
"(",
"self",
",",
"vars",
"=",
"None",
",",
"shared",
"=",
"False",
",",
"locals",
"=",
"None",
")",
":",
"return",
"new_context",
"(",
"self",
".",
"environment",
",",
"self",
".",
"name",
",",
"self",
".",
"blocks",
",",
"vars... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/environment.py#L1055-L1064 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewListCtrl.AppendTextColumn | (*args, **kwargs) | return _dataview.DataViewListCtrl_AppendTextColumn(*args, **kwargs) | AppendTextColumn(self, String label, int mode=DATAVIEW_CELL_INERT, int width=-1,
int align=ALIGN_LEFT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | AppendTextColumn(self, String label, int mode=DATAVIEW_CELL_INERT, int width=-1,
int align=ALIGN_LEFT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | [
"AppendTextColumn",
"(",
"self",
"String",
"label",
"int",
"mode",
"=",
"DATAVIEW_CELL_INERT",
"int",
"width",
"=",
"-",
"1",
"int",
"align",
"=",
"ALIGN_LEFT",
"int",
"flags",
"=",
"DATAVIEW_COL_RESIZABLE",
")",
"-",
">",
"DataViewColumn"
] | def AppendTextColumn(*args, **kwargs):
"""
AppendTextColumn(self, String label, int mode=DATAVIEW_CELL_INERT, int width=-1,
int align=ALIGN_LEFT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
"""
return _dataview.DataViewListCtrl_AppendTextColumn(*args, **kwargs) | [
"def",
"AppendTextColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_AppendTextColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L2128-L2133 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py | python | sigmoid | (x, name=None) | Computes sigmoid of `x` element-wise.
Specifically, `y = 1 / (1 + exp(-x))`.
Args:
x: A Tensor with type `float16`, `float32`, `float64`, `complex64`, or
`complex128`.
name: A name for the operation (optional).
Returns:
A Tensor with the same type as `x`.
@compatibility(scipy)
Equivalent... | Computes sigmoid of `x` element-wise. | [
"Computes",
"sigmoid",
"of",
"x",
"element",
"-",
"wise",
"."
] | def sigmoid(x, name=None):
"""Computes sigmoid of `x` element-wise.
Specifically, `y = 1 / (1 + exp(-x))`.
Args:
x: A Tensor with type `float16`, `float32`, `float64`, `complex64`, or
`complex128`.
name: A name for the operation (optional).
Returns:
A Tensor with the same type as `x`.
@c... | [
"def",
"sigmoid",
"(",
"x",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"Sigmoid\"",
",",
"[",
"x",
"]",
")",
"as",
"name",
":",
"x",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"x",
",",
"name",
"=",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L3102-L3121 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlAttr.debugDumpAttrList | (self, output, depth) | Dumps debug information for the attribute list | Dumps debug information for the attribute list | [
"Dumps",
"debug",
"information",
"for",
"the",
"attribute",
"list"
] | def debugDumpAttrList(self, output, depth):
"""Dumps debug information for the attribute list """
libxml2mod.xmlDebugDumpAttrList(output, self._o, depth) | [
"def",
"debugDumpAttrList",
"(",
"self",
",",
"output",
",",
"depth",
")",
":",
"libxml2mod",
".",
"xmlDebugDumpAttrList",
"(",
"output",
",",
"self",
".",
"_o",
",",
"depth",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5581-L5583 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.