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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/changelog.py | python | Changelog.foreach_version | (self, reverse=False) | Creates a generator for iterating over the versions, dates and content
Versions are stored and iterated in order.
:param reverse: ``bool`` if True then the iteration is reversed
:returns: ``generator`` for iterating over versions, dates and content | Creates a generator for iterating over the versions, dates and content | [
"Creates",
"a",
"generator",
"for",
"iterating",
"over",
"the",
"versions",
"dates",
"and",
"content"
] | def foreach_version(self, reverse=False):
'''
Creates a generator for iterating over the versions, dates and content
Versions are stored and iterated in order.
:param reverse: ``bool`` if True then the iteration is reversed
:returns: ``generator`` for iterating over versions, d... | [
"def",
"foreach_version",
"(",
"self",
",",
"reverse",
"=",
"False",
")",
":",
"for",
"version",
"in",
"reversed",
"(",
"self",
".",
"__versions",
")",
"if",
"reverse",
"else",
"self",
".",
"__versions",
":",
"yield",
"version",
",",
"self",
".",
"__date... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/changelog.py#L430-L440 | ||
LisaAnne/lisa-caffe-public | 49b8643ddef23a4f6120017968de30c45e693f59 | scripts/cpp_lint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/scripts/cpp_lint.py#L792-L794 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/ui/imgui.py | python | Gui.text | (self, text) | Declares a line of text. | Declares a line of text. | [
"Declares",
"a",
"line",
"of",
"text",
"."
] | def text(self, text):
"""Declares a line of text.
"""
self.gui.text(text) | [
"def",
"text",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"gui",
".",
"text",
"(",
"text",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/ui/imgui.py#L51-L54 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/apiclient/googleapiclient/discovery.py | python | Resource._set_dynamic_attr | (self, attr_name, value) | Sets an instance attribute and tracks it in a list of dynamic attributes.
Args:
attr_name: string; The name of the attribute to be set
value: The value being set on the object and tracked in the dynamic cache. | Sets an instance attribute and tracks it in a list of dynamic attributes. | [
"Sets",
"an",
"instance",
"attribute",
"and",
"tracks",
"it",
"in",
"a",
"list",
"of",
"dynamic",
"attributes",
"."
] | def _set_dynamic_attr(self, attr_name, value):
"""Sets an instance attribute and tracks it in a list of dynamic attributes.
Args:
attr_name: string; The name of the attribute to be set
value: The value being set on the object and tracked in the dynamic cache.
"""
self._dynamic_attrs.append(... | [
"def",
"_set_dynamic_attr",
"(",
"self",
",",
"attr_name",
",",
"value",
")",
":",
"self",
".",
"_dynamic_attrs",
".",
"append",
"(",
"attr_name",
")",
"self",
".",
"__dict__",
"[",
"attr_name",
"]",
"=",
"value"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/apiclient/googleapiclient/discovery.py#L915-L923 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | PageContainer.CanFitToScreen | (self, page) | return True | Returns wheter a tab can fit in the left space in the screen or not.
:param `page`: an integer specifying the page index. | Returns wheter a tab can fit in the left space in the screen or not. | [
"Returns",
"wheter",
"a",
"tab",
"can",
"fit",
"in",
"the",
"left",
"space",
"in",
"the",
"screen",
"or",
"not",
"."
] | def CanFitToScreen(self, page):
"""
Returns wheter a tab can fit in the left space in the screen or not.
:param `page`: an integer specifying the page index.
"""
# Incase the from is greater than page,
# we need to reset the self._nFrom, so in order
# to force t... | [
"def",
"CanFitToScreen",
"(",
"self",
",",
"page",
")",
":",
"# Incase the from is greater than page,",
"# we need to reset the self._nFrom, so in order",
"# to force the caller to do so, we return false",
"if",
"self",
".",
"_nFrom",
">",
"page",
":",
"return",
"False",
"agw... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L6210-L6231 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/targets.py | python | MainTarget.__select_alternatives | (self, property_set_, debug) | return best | Returns the best viable alternative for this property_set
See the documentation for selection rules.
# TODO: shouldn't this be 'alternative' (singular)? | Returns the best viable alternative for this property_set
See the documentation for selection rules.
# TODO: shouldn't this be 'alternative' (singular)? | [
"Returns",
"the",
"best",
"viable",
"alternative",
"for",
"this",
"property_set",
"See",
"the",
"documentation",
"for",
"selection",
"rules",
".",
"#",
"TODO",
":",
"shouldn",
"t",
"this",
"be",
"alternative",
"(",
"singular",
")",
"?"
] | def __select_alternatives (self, property_set_, debug):
""" Returns the best viable alternative for this property_set
See the documentation for selection rules.
# TODO: shouldn't this be 'alternative' (singular)?
"""
# When selecting alternatives we have to consider defau... | [
"def",
"__select_alternatives",
"(",
"self",
",",
"property_set_",
",",
"debug",
")",
":",
"# When selecting alternatives we have to consider defaults,",
"# for example:",
"# lib l : l.cpp : <variant>debug ;",
"# lib l : l_opt.cpp : <variant>release ;",
"# won't work unless we add ... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/targets.py#L680-L733 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/configHandler.py | python | IdleConf.GetSectionList | (self, configSet, configType) | return cfgParser.sections() | Return sections for configSet configType configuration.
configSet must be either 'user' or 'default'
configType must be in self.config_types. | Return sections for configSet configType configuration. | [
"Return",
"sections",
"for",
"configSet",
"configType",
"configuration",
"."
] | def GetSectionList(self, configSet, configType):
"""Return sections for configSet configType configuration.
configSet must be either 'user' or 'default'
configType must be in self.config_types.
"""
if not (configType in self.config_types):
raise InvalidConfigType('In... | [
"def",
"GetSectionList",
"(",
"self",
",",
"configSet",
",",
"configType",
")",
":",
"if",
"not",
"(",
"configType",
"in",
"self",
".",
"config_types",
")",
":",
"raise",
"InvalidConfigType",
"(",
"'Invalid configType specified'",
")",
"if",
"configSet",
"==",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/configHandler.py#L266-L280 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py | python | AddrlistClass.getatom | (self, atomends=None) | return ''.join(atomlist) | Parse an RFC 2822 atom.
Optional atomends specifies a different set of end token delimiters
(the default is to use self.atomends). This is used e.g. in
getphraselist() since phrase endings must not include the `.' (which
is legal in phrases). | Parse an RFC 2822 atom. | [
"Parse",
"an",
"RFC",
"2822",
"atom",
"."
] | def getatom(self, atomends=None):
"""Parse an RFC 2822 atom.
Optional atomends specifies a different set of end token delimiters
(the default is to use self.atomends). This is used e.g. in
getphraselist() since phrase endings must not include the `.' (which
is legal in phrases)... | [
"def",
"getatom",
"(",
"self",
",",
"atomends",
"=",
"None",
")",
":",
"atomlist",
"=",
"[",
"''",
"]",
"if",
"atomends",
"is",
"None",
":",
"atomends",
"=",
"self",
".",
"atomends",
"while",
"self",
".",
"pos",
"<",
"len",
"(",
"self",
".",
"field... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/rfc822.py#L728-L745 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/contrib/crosstalk/__init__.py | python | Crosstalk.register_funcs | (self, var_type, setter=None, getter=None) | Register setter/getter functions for a given variable type
Args:
var_type: Type of the variable
setter: Lambda function to set value
getter: Lambda function to get value | Register setter/getter functions for a given variable type
Args:
var_type: Type of the variable
setter: Lambda function to set value
getter: Lambda function to get value | [
"Register",
"setter",
"/",
"getter",
"functions",
"for",
"a",
"given",
"variable",
"type",
"Args",
":",
"var_type",
":",
"Type",
"of",
"the",
"variable",
"setter",
":",
"Lambda",
"function",
"to",
"set",
"value",
"getter",
":",
"Lambda",
"function",
"to",
... | def register_funcs(self, var_type, setter=None, getter=None):
'''
Register setter/getter functions for a given variable type
Args:
var_type: Type of the variable
setter: Lambda function to set value
getter: Lambda function to get value
'''
... | [
"def",
"register_funcs",
"(",
"self",
",",
"var_type",
",",
"setter",
"=",
"None",
",",
"getter",
"=",
"None",
")",
":",
"self",
".",
"funcs",
"[",
"var_type",
"]",
"=",
"_FuncInfo",
"(",
"setter",
",",
"getter",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalk/__init__.py#L171-L180 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | CursorKind.is_reference | (self) | return conf.lib.clang_isReference(self) | Test if this is a reference kind. | Test if this is a reference kind. | [
"Test",
"if",
"this",
"is",
"a",
"reference",
"kind",
"."
] | def is_reference(self):
"""Test if this is a reference kind."""
return conf.lib.clang_isReference(self) | [
"def",
"is_reference",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isReference",
"(",
"self",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L636-L638 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py | python | Process.cmdline | (self) | return self._proc.cmdline() | The command line this process has been called with. | The command line this process has been called with. | [
"The",
"command",
"line",
"this",
"process",
"has",
"been",
"called",
"with",
"."
] | def cmdline(self):
"""The command line this process has been called with."""
return self._proc.cmdline() | [
"def",
"cmdline",
"(",
"self",
")",
":",
"return",
"self",
".",
"_proc",
".",
"cmdline",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py#L549-L551 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | NotificationMessage.SetFlags | (*args, **kwargs) | return _misc_.NotificationMessage_SetFlags(*args, **kwargs) | SetFlags(self, int flags) | SetFlags(self, int flags) | [
"SetFlags",
"(",
"self",
"int",
"flags",
")"
] | def SetFlags(*args, **kwargs):
"""SetFlags(self, int flags)"""
return _misc_.NotificationMessage_SetFlags(*args, **kwargs) | [
"def",
"SetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"NotificationMessage_SetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1230-L1232 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.DrawImageLabel | (*args, **kwargs) | return _gdi_.DC_DrawImageLabel(*args, **kwargs) | DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
int indexAccel=-1) -> Rect
Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
drawing it) within the specified rectangle, abiding by the alignment
flags. Will additiona... | DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
int indexAccel=-1) -> Rect | [
"DrawImageLabel",
"(",
"self",
"String",
"text",
"Bitmap",
"image",
"Rect",
"rect",
"int",
"alignment",
"=",
"wxALIGN_LEFT|wxALIGN_TOP",
"int",
"indexAccel",
"=",
"-",
"1",
")",
"-",
">",
"Rect"
] | def DrawImageLabel(*args, **kwargs):
"""
DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
int indexAccel=-1) -> Rect
Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
drawing it) within the specified rectangle... | [
"def",
"DrawImageLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_DrawImageLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3943-L3953 | |
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | docs/examples/frameworks/mxnet/demo/symbols/vgg.py | python | get_symbol | (num_classes, num_layers=11, batch_norm=False, dtype='float32', **kwargs) | return symbol | Parameters
----------
num_classes : int, default 1000
Number of classification classes.
num_layers : int
Number of layers for the variant of densenet. Options are 11, 13, 16, 19.
batch_norm : bool, default False
Use batch normalization.
dtype: str, float32 or float16
... | Parameters
----------
num_classes : int, default 1000
Number of classification classes.
num_layers : int
Number of layers for the variant of densenet. Options are 11, 13, 16, 19.
batch_norm : bool, default False
Use batch normalization.
dtype: str, float32 or float16
... | [
"Parameters",
"----------",
"num_classes",
":",
"int",
"default",
"1000",
"Number",
"of",
"classification",
"classes",
".",
"num_layers",
":",
"int",
"Number",
"of",
"layers",
"for",
"the",
"variant",
"of",
"densenet",
".",
"Options",
"are",
"11",
"13",
"16",
... | def get_symbol(num_classes, num_layers=11, batch_norm=False, dtype='float32', **kwargs):
"""
Parameters
----------
num_classes : int, default 1000
Number of classification classes.
num_layers : int
Number of layers for the variant of densenet. Options are 11, 13, 16, 19.
batch_no... | [
"def",
"get_symbol",
"(",
"num_classes",
",",
"num_layers",
"=",
"11",
",",
"batch_norm",
"=",
"False",
",",
"dtype",
"=",
"'float32'",
",",
"*",
"*",
"kwargs",
")",
":",
"vgg_spec",
"=",
"{",
"11",
":",
"(",
"[",
"1",
",",
"1",
",",
"2",
",",
"2... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/frameworks/mxnet/demo/symbols/vgg.py#L48-L76 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/elastic/agent/server/api.py | python | ElasticAgent.run | (self, role: str = DEFAULT_ROLE) | Runs the agent, retrying the worker group on failures up to
``max_restarts``.
Returns:
The result of the execution, containing the return values or
failure details for each worker mapped by the worker's global rank.
Raises:
Exception - any other failures NOT... | Runs the agent, retrying the worker group on failures up to
``max_restarts``. | [
"Runs",
"the",
"agent",
"retrying",
"the",
"worker",
"group",
"on",
"failures",
"up",
"to",
"max_restarts",
"."
] | def run(self, role: str = DEFAULT_ROLE) -> RunResult:
"""
Runs the agent, retrying the worker group on failures up to
``max_restarts``.
Returns:
The result of the execution, containing the return values or
failure details for each worker mapped by the worker's gl... | [
"def",
"run",
"(",
"self",
",",
"role",
":",
"str",
"=",
"DEFAULT_ROLE",
")",
"->",
"RunResult",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/agent/server/api.py#L424-L436 | ||
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | vpr/scripts/profile/parse_and_plot_detailed.py | python | plot_results | (param_names, param_options, results, params) | Create a directory based on key parameters and date and plot results vs iteration
Each of the parameter in results will receive its own plot, drawn by matplotlib | Create a directory based on key parameters and date and plot results vs iteration | [
"Create",
"a",
"directory",
"based",
"on",
"key",
"parameters",
"and",
"date",
"and",
"plot",
"results",
"vs",
"iteration"
] | def plot_results(param_names, param_options, results, params):
"""Create a directory based on key parameters and date and plot results vs iteration
Each of the parameter in results will receive its own plot, drawn by matplotlib"""
# circuit/run_num where run_num is one before the existing one
director... | [
"def",
"plot_results",
"(",
"param_names",
",",
"param_options",
",",
"results",
",",
"params",
")",
":",
"# circuit/run_num where run_num is one before the existing one",
"directory",
"=",
"params",
".",
"circuit",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",... | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vpr/scripts/profile/parse_and_plot_detailed.py#L40-L107 | ||
sfzhang15/FaceBoxes | b52cc92f9362d3adc08d54666aeb9ebb62fdb7da | scripts/cpp_lint.py | python | CheckForCopyright | (filename, lines, error) | Logs an error if a Copyright message appears at the top of the file. | Logs an error if a Copyright message appears at the top of the file. | [
"Logs",
"an",
"error",
"if",
"a",
"Copyright",
"message",
"appears",
"at",
"the",
"top",
"of",
"the",
"file",
"."
] | def CheckForCopyright(filename, lines, error):
"""Logs an error if a Copyright message appears at the top of the file."""
# We'll check up to line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
if _RE_COPYRIGHT.search(lines[line], re.I):
error(filena... | [
"def",
"CheckForCopyright",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# We'll check up to line 10. Don't forget there's a",
"# dummy line at the front.",
"for",
"line",
"in",
"xrange",
"(",
"1",
",",
"min",
"(",
"len",
"(",
"lines",
")",
",",
"11",
... | https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/scripts/cpp_lint.py#L1372-L1381 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/utilities/deterministic.py | python | unique_list | (duplicates_list) | return unique | Return unique list preserving the order.
https://stackoverflow.com/a/58666031/1002277 | Return unique list preserving the order.
https://stackoverflow.com/a/58666031/1002277 | [
"Return",
"unique",
"list",
"preserving",
"the",
"order",
".",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"58666031",
"/",
"1002277"
] | def unique_list(duplicates_list):
"""Return unique list preserving the order.
https://stackoverflow.com/a/58666031/1002277
"""
used = set()
unique = [x for x in duplicates_list
if x not in used and
(used.add(x) or True)]
return unique | [
"def",
"unique_list",
"(",
"duplicates_list",
")",
":",
"used",
"=",
"set",
"(",
")",
"unique",
"=",
"[",
"x",
"for",
"x",
"in",
"duplicates_list",
"if",
"x",
"not",
"in",
"used",
"and",
"(",
"used",
".",
"add",
"(",
"x",
")",
"or",
"True",
")",
... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/utilities/deterministic.py#L1-L9 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeMaterialSolid | (
doc,
name="MaterialSolid"
) | return obj | makeMaterialSolid(document, [name]):
makes a FEM Material for solid | makeMaterialSolid(document, [name]):
makes a FEM Material for solid | [
"makeMaterialSolid",
"(",
"document",
"[",
"name",
"]",
")",
":",
"makes",
"a",
"FEM",
"Material",
"for",
"solid"
] | def makeMaterialSolid(
doc,
name="MaterialSolid"
):
"""makeMaterialSolid(document, [name]):
makes a FEM Material for solid"""
obj = doc.addObject("App::MaterialObjectPython", name)
from femobjects import material_common
material_common.MaterialCommon(obj)
obj.Category = "Solid"
if Fr... | [
"def",
"makeMaterialSolid",
"(",
"doc",
",",
"name",
"=",
"\"MaterialSolid\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"App::MaterialObjectPython\"",
",",
"name",
")",
"from",
"femobjects",
"import",
"material_common",
"material_common",
".",
"Materi... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L476-L489 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/wrappers/framework.py | python | NonInteractiveDebugWrapperSession.on_run_start | (self, request) | return OnRunStartResponse(
OnRunStartAction.DEBUG_RUN,
debug_urls,
debug_ops=watch_opts.debug_ops,
node_name_regex_whitelist=watch_opts.node_name_regex_whitelist,
op_type_regex_whitelist=watch_opts.op_type_regex_whitelist,
tensor_dtype_regex_whitelist=watch_opts.tensor_dt... | See doc of BaseDebugWrapperSession.on_run_start. | See doc of BaseDebugWrapperSession.on_run_start. | [
"See",
"doc",
"of",
"BaseDebugWrapperSession",
".",
"on_run_start",
"."
] | def on_run_start(self, request):
"""See doc of BaseDebugWrapperSession.on_run_start."""
debug_urls, watch_opts = self._prepare_run_watch_config(
request.fetches, request.feed_dict)
return OnRunStartResponse(
OnRunStartAction.DEBUG_RUN,
debug_urls,
debug_ops=watch_opts.debug... | [
"def",
"on_run_start",
"(",
"self",
",",
"request",
")",
":",
"debug_urls",
",",
"watch_opts",
"=",
"self",
".",
"_prepare_run_watch_config",
"(",
"request",
".",
"fetches",
",",
"request",
".",
"feed_dict",
")",
"return",
"OnRunStartResponse",
"(",
"OnRunStartA... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/wrappers/framework.py#L945-L959 | |
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/glfw.py | python | hide_window | (window) | Hides the specified window.
Wrapper for:
void glfwHideWindow(GLFWwindow* window); | Hides the specified window. | [
"Hides",
"the",
"specified",
"window",
"."
] | def hide_window(window):
"""
Hides the specified window.
Wrapper for:
void glfwHideWindow(GLFWwindow* window);
"""
_glfw.glfwHideWindow(window) | [
"def",
"hide_window",
"(",
"window",
")",
":",
"_glfw",
".",
"glfwHideWindow",
"(",
"window",
")"
] | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L1146-L1153 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py | python | Index._reset_identity | (self) | return self | Initializes or resets ``_id`` attribute with new object. | Initializes or resets ``_id`` attribute with new object. | [
"Initializes",
"or",
"resets",
"_id",
"attribute",
"with",
"new",
"object",
"."
] | def _reset_identity(self):
"""
Initializes or resets ``_id`` attribute with new object.
"""
self._id = _Identity()
return self | [
"def",
"_reset_identity",
"(",
"self",
")",
":",
"self",
".",
"_id",
"=",
"_Identity",
"(",
")",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L592-L597 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/codecs.py | python | StreamReader.__next__ | (self) | Return the next decoded line from the input stream. | Return the next decoded line from the input stream. | [
"Return",
"the",
"next",
"decoded",
"line",
"from",
"the",
"input",
"stream",
"."
] | def __next__(self):
""" Return the next decoded line from the input stream."""
line = self.readline()
if line:
return line
raise StopIteration | [
"def",
"__next__",
"(",
"self",
")",
":",
"line",
"=",
"self",
".",
"readline",
"(",
")",
"if",
"line",
":",
"return",
"line",
"raise",
"StopIteration"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/codecs.py#L642-L648 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/wrappers.py | python | UArrayArg.load_direct | (self, byteoffset) | return self.context.unpack_value(self.builder, self.fe_type, ptr) | Generic load from the given *byteoffset*. load_aligned() is
preferred if possible. | Generic load from the given *byteoffset*. load_aligned() is
preferred if possible. | [
"Generic",
"load",
"from",
"the",
"given",
"*",
"byteoffset",
"*",
".",
"load_aligned",
"()",
"is",
"preferred",
"if",
"possible",
"."
] | def load_direct(self, byteoffset):
"""
Generic load from the given *byteoffset*. load_aligned() is
preferred if possible.
"""
ptr = cgutils.pointer_add(self.builder, self.dataptr, byteoffset)
return self.context.unpack_value(self.builder, self.fe_type, ptr) | [
"def",
"load_direct",
"(",
"self",
",",
"byteoffset",
")",
":",
"ptr",
"=",
"cgutils",
".",
"pointer_add",
"(",
"self",
".",
"builder",
",",
"self",
".",
"dataptr",
",",
"byteoffset",
")",
"return",
"self",
".",
"context",
".",
"unpack_value",
"(",
"self... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/wrappers.py#L267-L273 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | SortRef.cast | (self, val) | return val | Try to cast `val` as an element of sort `self`.
This method is used in Z3Py to convert Python objects such as integers,
floats, longs and strings into Z3 expressions.
>>> x = Int('x')
>>> RealSort().cast(x)
ToReal(x) | Try to cast `val` as an element of sort `self`. | [
"Try",
"to",
"cast",
"val",
"as",
"an",
"element",
"of",
"sort",
"self",
"."
] | def cast(self, val):
"""Try to cast `val` as an element of sort `self`.
This method is used in Z3Py to convert Python objects such as integers,
floats, longs and strings into Z3 expressions.
>>> x = Int('x')
>>> RealSort().cast(x)
ToReal(x)
"""
if z3_deb... | [
"def",
"cast",
"(",
"self",
",",
"val",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_expr",
"(",
"val",
")",
",",
"\"Z3 expression expected\"",
")",
"_z3_assert",
"(",
"self",
".",
"eq",
"(",
"val",
".",
"sort",
"(",
")",
")",
... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L592-L605 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/function.py | python | traceConf.parseTableJson | (self) | return self.traceSections | Add and match functions to be traced get keys that starts with 'trace | Add and match functions to be traced get keys that starts with 'trace | [
"Add",
"and",
"match",
"functions",
"to",
"be",
"traced",
"get",
"keys",
"that",
"starts",
"with",
"trace"
] | def parseTableJson(self):
if self.parsed == True:
return self.traceSections
conf = self.traceList
"""Add and match functions to be traced get keys that starts with 'trace'"""
for section in [s for s in conf.keys() if s.startswith('trace')]:
if conf[section] is N... | [
"def",
"parseTableJson",
"(",
"self",
")",
":",
"if",
"self",
".",
"parsed",
"==",
"True",
":",
"return",
"self",
".",
"traceSections",
"conf",
"=",
"self",
".",
"traceList",
"for",
"section",
"in",
"[",
"s",
"for",
"s",
"in",
"conf",
".",
"keys",
"(... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/function.py#L296-L331 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/utils/export.py | python | generic_signature_fn | (examples, unused_features, predictions) | return default_signature, {} | Creates generic signature from given examples and predictions.
This is needed for backward compatibility with default behaviour of
export_estimator.
Args:
examples: `Tensor`.
unused_features: `dict` of `Tensor`s.
predictions: `Tensor` or `dict` of `Tensor`s.
Returns:
Tuple of default signatur... | Creates generic signature from given examples and predictions. | [
"Creates",
"generic",
"signature",
"from",
"given",
"examples",
"and",
"predictions",
"."
] | def generic_signature_fn(examples, unused_features, predictions):
"""Creates generic signature from given examples and predictions.
This is needed for backward compatibility with default behaviour of
export_estimator.
Args:
examples: `Tensor`.
unused_features: `dict` of `Tensor`s.
predictions: `Te... | [
"def",
"generic_signature_fn",
"(",
"examples",
",",
"unused_features",
",",
"predictions",
")",
":",
"if",
"examples",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'examples cannot be None when using this signature fn.'",
")",
"tensors",
"=",
"{",
"'inputs'",
":",... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/utils/export.py#L84-L109 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/security/fuzzing/python_fuzzing.py | python | FuzzingHelper.get_tf_dtype | (self, allowed_set=None) | Return a random tensorflow dtype.
Args:
allowed_set: An allowlisted set of dtypes to choose from instead of all of
them.
Returns:
A random type from the list containing all TensorFlow types. | Return a random tensorflow dtype. | [
"Return",
"a",
"random",
"tensorflow",
"dtype",
"."
] | def get_tf_dtype(self, allowed_set=None):
"""Return a random tensorflow dtype.
Args:
allowed_set: An allowlisted set of dtypes to choose from instead of all of
them.
Returns:
A random type from the list containing all TensorFlow types.
"""
if allowed_set:
index = self.get_i... | [
"def",
"get_tf_dtype",
"(",
"self",
",",
"allowed_set",
"=",
"None",
")",
":",
"if",
"allowed_set",
":",
"index",
"=",
"self",
".",
"get_int",
"(",
"0",
",",
"len",
"(",
"allowed_set",
")",
"-",
"1",
")",
"if",
"allowed_set",
"[",
"index",
"]",
"not"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/security/fuzzing/python_fuzzing.py#L137-L156 | ||
calamares/calamares | 9f6f82405b3074af7c99dc26487d2e46e4ece3e5 | src/modules/initcpiocfg/main.py | python | run | () | return None | Calls routine with given parameters to modify '/etc/mkinitcpio.conf'.
:return: | Calls routine with given parameters to modify '/etc/mkinitcpio.conf'. | [
"Calls",
"routine",
"with",
"given",
"parameters",
"to",
"modify",
"/",
"etc",
"/",
"mkinitcpio",
".",
"conf",
"."
] | def run():
"""
Calls routine with given parameters to modify '/etc/mkinitcpio.conf'.
:return:
"""
partitions = libcalamares.globalstorage.value("partitions")
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
if not partitions:
libcalamares.utils.warning("partiti... | [
"def",
"run",
"(",
")",
":",
"partitions",
"=",
"libcalamares",
".",
"globalstorage",
".",
"value",
"(",
"\"partitions\"",
")",
"root_mount_point",
"=",
"libcalamares",
".",
"globalstorage",
".",
"value",
"(",
"\"rootMountPoint\"",
")",
"if",
"not",
"partitions"... | https://github.com/calamares/calamares/blob/9f6f82405b3074af7c99dc26487d2e46e4ece3e5/src/modules/initcpiocfg/main.py#L224-L245 | |
Ewenwan/MVision | 97b394dfa48cb21c82cd003b1a952745e413a17f | darknect/tensorflow/yolo_v1/yolo_v1_tf.py | python | Yolo._load_weights | (self, weights_file) | Load weights from file | Load weights from file | [
"Load",
"weights",
"from",
"file"
] | def _load_weights(self, weights_file):
"""Load weights from file"""
if self.verbose:
print("Start to load weights from file:%s" % (weights_file))
saver = tf.train.Saver()
saver.restore(self.sess, weights_file) | [
"def",
"_load_weights",
"(",
"self",
",",
"weights_file",
")",
":",
"if",
"self",
".",
"verbose",
":",
"print",
"(",
"\"Start to load weights from file:%s\"",
"%",
"(",
"weights_file",
")",
")",
"saver",
"=",
"tf",
".",
"train",
".",
"Saver",
"(",
")",
"sa... | https://github.com/Ewenwan/MVision/blob/97b394dfa48cb21c82cd003b1a952745e413a17f/darknect/tensorflow/yolo_v1/yolo_v1_tf.py#L208-L213 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/syntax.py | python | Struct.__init__ | (self, file_name, line, column) | Construct a Struct. | Construct a Struct. | [
"Construct",
"a",
"Struct",
"."
] | def __init__(self, file_name, line, column):
# type: (str, int, int) -> None
"""Construct a Struct."""
self.name = None # type: str
self.description = None # type: str
self.strict = True # type: bool
self.immutable = False # type: bool
self.inline_chained_stru... | [
"def",
"__init__",
"(",
"self",
",",
"file_name",
",",
"line",
",",
"column",
")",
":",
"# type: (str, int, int) -> None",
"self",
".",
"name",
"=",
"None",
"# type: str",
"self",
".",
"description",
"=",
"None",
"# type: str",
"self",
".",
"strict",
"=",
"T... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/syntax.py#L518-L543 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/session.py | python | Session.set_file_logger | (self, log_level, path, logger_name='botocore') | Convenience function to quickly configure any level of logging
to a file.
:type log_level: int
:param log_level: A log level as specified in the `logging` module
:type path: string
:param path: Path to the log file. The file will be created
if it doesn't already ex... | Convenience function to quickly configure any level of logging
to a file. | [
"Convenience",
"function",
"to",
"quickly",
"configure",
"any",
"level",
"of",
"logging",
"to",
"a",
"file",
"."
] | def set_file_logger(self, log_level, path, logger_name='botocore'):
"""
Convenience function to quickly configure any level of logging
to a file.
:type log_level: int
:param log_level: A log level as specified in the `logging` module
:type path: string
:param pa... | [
"def",
"set_file_logger",
"(",
"self",
",",
"log_level",
",",
"path",
",",
"logger_name",
"=",
"'botocore'",
")",
":",
"log",
"=",
"logging",
".",
"getLogger",
"(",
"logger_name",
")",
"log",
".",
"setLevel",
"(",
"logging",
".",
"DEBUG",
")",
"# create co... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/session.py#L619-L645 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/filters.py | python | do_format | (value: str, *args: t.Any, **kwargs: t.Any) | return soft_str(value) % (kwargs or args) | Apply the given values to a `printf-style`_ format string, like
``string % values``.
.. sourcecode:: jinja
{{ "%s, %s!"|format(greeting, name) }}
Hello, World!
In most cases it should be more convenient and efficient to use the
``%`` operator or :meth:`str.format`.
.. code-block:... | Apply the given values to a `printf-style`_ format string, like
``string % values``. | [
"Apply",
"the",
"given",
"values",
"to",
"a",
"printf",
"-",
"style",
"_",
"format",
"string",
"like",
"string",
"%",
"values",
"."
] | def do_format(value: str, *args: t.Any, **kwargs: t.Any) -> str:
"""Apply the given values to a `printf-style`_ format string, like
``string % values``.
.. sourcecode:: jinja
{{ "%s, %s!"|format(greeting, name) }}
Hello, World!
In most cases it should be more convenient and efficient ... | [
"def",
"do_format",
"(",
"value",
":",
"str",
",",
"*",
"args",
":",
"t",
".",
"Any",
",",
"*",
"*",
"kwargs",
":",
"t",
".",
"Any",
")",
"->",
"str",
":",
"if",
"args",
"and",
"kwargs",
":",
"raise",
"FilterArgumentError",
"(",
"\"can't handle posit... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L1000-L1025 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/node.py | python | Node.__init__ | (self) | Initialize a DNS node. | Initialize a DNS node. | [
"Initialize",
"a",
"DNS",
"node",
"."
] | def __init__(self):
"""Initialize a DNS node.
"""
self.rdatasets = []; | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"rdatasets",
"=",
"[",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/node.py#L34-L38 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/tools/inspect_checkpoint.py | python | parse_numpy_printoption | (kv_str) | Sets a single numpy printoption from a string of the form 'x=y'.
See documentation on numpy.set_printoptions() for details about what values
x and y can take. x can be any option listed there other than 'formatter'.
Args:
kv_str: A string of the form 'x=y', such as 'threshold=100000'
Raises:
argparse... | Sets a single numpy printoption from a string of the form 'x=y'. | [
"Sets",
"a",
"single",
"numpy",
"printoption",
"from",
"a",
"string",
"of",
"the",
"form",
"x",
"=",
"y",
"."
] | def parse_numpy_printoption(kv_str):
"""Sets a single numpy printoption from a string of the form 'x=y'.
See documentation on numpy.set_printoptions() for details about what values
x and y can take. x can be any option listed there other than 'formatter'.
Args:
kv_str: A string of the form 'x=y', such as ... | [
"def",
"parse_numpy_printoption",
"(",
"kv_str",
")",
":",
"k_v_str",
"=",
"kv_str",
".",
"split",
"(",
"\"=\"",
",",
"1",
")",
"if",
"len",
"(",
"k_v_str",
")",
"!=",
"2",
"or",
"not",
"k_v_str",
"[",
"0",
"]",
":",
"raise",
"argparse",
".",
"Argume... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/tools/inspect_checkpoint.py#L72-L101 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewListCtrl.AppendColumn | (*args, **kwargs) | return _dataview.DataViewListCtrl_AppendColumn(*args, **kwargs) | AppendColumn(self, DataViewColumn column, String varianttype="string") -> bool | AppendColumn(self, DataViewColumn column, String varianttype="string") -> bool | [
"AppendColumn",
"(",
"self",
"DataViewColumn",
"column",
"String",
"varianttype",
"=",
"string",
")",
"-",
">",
"bool"
] | def AppendColumn(*args, **kwargs):
"""AppendColumn(self, DataViewColumn column, String varianttype="string") -> bool"""
return _dataview.DataViewListCtrl_AppendColumn(*args, **kwargs) | [
"def",
"AppendColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_AppendColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2116-L2118 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/__init__.py | python | set_warn_always | (b) | r"""When this flag is False (default) then some PyTorch warnings may only
appear once per process. This helps avoid excessive warning information.
Setting it to True causes these warnings to always appear, which may be
helpful when debugging.
Args:
b (:class:`bool`): If True, force warnings to ... | r"""When this flag is False (default) then some PyTorch warnings may only
appear once per process. This helps avoid excessive warning information.
Setting it to True causes these warnings to always appear, which may be
helpful when debugging. | [
"r",
"When",
"this",
"flag",
"is",
"False",
"(",
"default",
")",
"then",
"some",
"PyTorch",
"warnings",
"may",
"only",
"appear",
"once",
"per",
"process",
".",
"This",
"helps",
"avoid",
"excessive",
"warning",
"information",
".",
"Setting",
"it",
"to",
"Tr... | def set_warn_always(b):
r"""When this flag is False (default) then some PyTorch warnings may only
appear once per process. This helps avoid excessive warning information.
Setting it to True causes these warnings to always appear, which may be
helpful when debugging.
Args:
b (:class:`bool`):... | [
"def",
"set_warn_always",
"(",
"b",
")",
":",
"_C",
".",
"_set_warnAlways",
"(",
"b",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/__init__.py#L565-L575 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.AnnotationGetText | (*args, **kwargs) | return _stc.StyledTextCtrl_AnnotationGetText(*args, **kwargs) | AnnotationGetText(self, int line) -> String
Get the annotation text for a line | AnnotationGetText(self, int line) -> String | [
"AnnotationGetText",
"(",
"self",
"int",
"line",
")",
"-",
">",
"String"
] | def AnnotationGetText(*args, **kwargs):
"""
AnnotationGetText(self, int line) -> String
Get the annotation text for a line
"""
return _stc.StyledTextCtrl_AnnotationGetText(*args, **kwargs) | [
"def",
"AnnotationGetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_AnnotationGetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5927-L5933 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/apiclient/googleapiclient/discovery.py | python | ResourceMethodParameters.set_parameters | (self, method_desc) | Populates maps and lists based on method description.
Iterates through each parameter for the method and parses the values from
the parameter dictionary.
Args:
method_desc: Dictionary with metadata describing an API method. Value
comes from the dictionary of methods stored in the 'methods'... | Populates maps and lists based on method description. | [
"Populates",
"maps",
"and",
"lists",
"based",
"on",
"method",
"description",
"."
] | def set_parameters(self, method_desc):
"""Populates maps and lists based on method description.
Iterates through each parameter for the method and parses the values from
the parameter dictionary.
Args:
method_desc: Dictionary with metadata describing an API method. Value
comes from the... | [
"def",
"set_parameters",
"(",
"self",
",",
"method_desc",
")",
":",
"for",
"arg",
",",
"desc",
"in",
"six",
".",
"iteritems",
"(",
"method_desc",
".",
"get",
"(",
"'parameters'",
",",
"{",
"}",
")",
")",
":",
"param",
"=",
"key2param",
"(",
"arg",
")... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/apiclient/googleapiclient/discovery.py#L563-L600 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/mox.py | python | MockMethod._PopNextMethod | (self) | Pop the next method from our call queue. | Pop the next method from our call queue. | [
"Pop",
"the",
"next",
"method",
"from",
"our",
"call",
"queue",
"."
] | def _PopNextMethod(self):
"""Pop the next method from our call queue."""
try:
return self._call_queue.popleft()
except IndexError:
raise UnexpectedMethodCallError(self, None) | [
"def",
"_PopNextMethod",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_call_queue",
".",
"popleft",
"(",
")",
"except",
"IndexError",
":",
"raise",
"UnexpectedMethodCallError",
"(",
"self",
",",
"None",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L581-L586 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/git.py | python | GitCommandResult.check_returncode | (self) | Raise GitException if the exit code is non-zero. | Raise GitException if the exit code is non-zero. | [
"Raise",
"GitException",
"if",
"the",
"exit",
"code",
"is",
"non",
"-",
"zero",
"."
] | def check_returncode(self):
"""Raise GitException if the exit code is non-zero."""
if self.returncode:
raise GitException(
"Command '{0}' failed with code '{1}'".format(" ".join(self.process_args),
self.returncode)... | [
"def",
"check_returncode",
"(",
"self",
")",
":",
"if",
"self",
".",
"returncode",
":",
"raise",
"GitException",
"(",
"\"Command '{0}' failed with code '{1}'\"",
".",
"format",
"(",
"\" \"",
".",
"join",
"(",
"self",
".",
"process_args",
")",
",",
"self",
".",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/git.py#L284-L290 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/sparse.py | python | _prepare_src_array | (source_array, dtype) | return source_array | Prepare `source_array` so that it can be used to construct NDArray.
`source_array` is converted to a `np.ndarray` if it's neither an `NDArray` \
nor an `np.ndarray`. | Prepare `source_array` so that it can be used to construct NDArray.
`source_array` is converted to a `np.ndarray` if it's neither an `NDArray` \
nor an `np.ndarray`. | [
"Prepare",
"source_array",
"so",
"that",
"it",
"can",
"be",
"used",
"to",
"construct",
"NDArray",
".",
"source_array",
"is",
"converted",
"to",
"a",
"np",
".",
"ndarray",
"if",
"it",
"s",
"neither",
"an",
"NDArray",
"\\",
"nor",
"an",
"np",
".",
"ndarray... | def _prepare_src_array(source_array, dtype):
"""Prepare `source_array` so that it can be used to construct NDArray.
`source_array` is converted to a `np.ndarray` if it's neither an `NDArray` \
nor an `np.ndarray`.
"""
if not isinstance(source_array, NDArray) and not isinstance(source_array, np.ndarr... | [
"def",
"_prepare_src_array",
"(",
"source_array",
",",
"dtype",
")",
":",
"if",
"not",
"isinstance",
"(",
"source_array",
",",
"NDArray",
")",
"and",
"not",
"isinstance",
"(",
"source_array",
",",
"np",
".",
"ndarray",
")",
":",
"try",
":",
"source_array",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/sparse.py#L796-L806 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/ops.py | python | RegisterStatistics.__init__ | (self, op_type, statistic_type) | Saves the `op_type` as the `Operation` type. | Saves the `op_type` as the `Operation` type. | [
"Saves",
"the",
"op_type",
"as",
"the",
"Operation",
"type",
"."
] | def __init__(self, op_type, statistic_type):
"""Saves the `op_type` as the `Operation` type."""
if not isinstance(op_type, six.string_types):
raise TypeError("op_type must be a string.")
if "," in op_type:
raise TypeError("op_type must not contain a comma.")
self._op_type = op_type
if no... | [
"def",
"__init__",
"(",
"self",
",",
"op_type",
",",
"statistic_type",
")",
":",
"if",
"not",
"isinstance",
"(",
"op_type",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"TypeError",
"(",
"\"op_type must be a string.\"",
")",
"if",
"\",\"",
"in",
"op_t... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L2367-L2378 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.get_textbuffer_from_tree_iter | (self, tree_iter) | return self.treestore[tree_iter][2] | Returns the text buffer given the tree iter | Returns the text buffer given the tree iter | [
"Returns",
"the",
"text",
"buffer",
"given",
"the",
"tree",
"iter"
] | def get_textbuffer_from_tree_iter(self, tree_iter):
"""Returns the text buffer given the tree iter"""
if not self.treestore[tree_iter][2]:
# we are using db storage and the buffer was not created yet
self.ctdb_handler.read_db_node_content(tree_iter, self.db)
return self.t... | [
"def",
"get_textbuffer_from_tree_iter",
"(",
"self",
",",
"tree_iter",
")",
":",
"if",
"not",
"self",
".",
"treestore",
"[",
"tree_iter",
"]",
"[",
"2",
"]",
":",
"# we are using db storage and the buffer was not created yet",
"self",
".",
"ctdb_handler",
".",
"read... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L3251-L3256 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/interpreter.py | python | Interpreter.getAutoCompleteList | (self, command='', *args, **kwds) | return l | Return list of auto-completion options for a command.
The list of options will be based on the locals namespace. | Return list of auto-completion options for a command.
The list of options will be based on the locals namespace. | [
"Return",
"list",
"of",
"auto",
"-",
"completion",
"options",
"for",
"a",
"command",
".",
"The",
"list",
"of",
"options",
"will",
"be",
"based",
"on",
"the",
"locals",
"namespace",
"."
] | def getAutoCompleteList(self, command='', *args, **kwds):
"""Return list of auto-completion options for a command.
The list of options will be based on the locals namespace."""
stdin, stdout, stderr = sys.stdin, sys.stdout, sys.stderr
sys.stdin, sys.stdout, sys.stderr = \
... | [
"def",
"getAutoCompleteList",
"(",
"self",
",",
"command",
"=",
"''",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"stdin",
",",
"stdout",
",",
"stderr",
"=",
"sys",
".",
"stdin",
",",
"sys",
".",
"stdout",
",",
"sys",
".",
"stderr",
"sys",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/interpreter.py#L140-L150 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/array_grad.py | python | _StridedSliceGradGrad | (op, grad) | return None, None, None, None, array_ops.strided_slice(
grad,
begin,
end,
strides,
begin_mask=op.get_attr("begin_mask"),
end_mask=op.get_attr("end_mask"),
ellipsis_mask=op.get_attr("ellipsis_mask"),
new_axis_mask=op.get_attr("new_axis_mask"),
shrink_axis_mask=op.get... | Gradient for StridedSliceGrad op. | Gradient for StridedSliceGrad op. | [
"Gradient",
"for",
"StridedSliceGrad",
"op",
"."
] | def _StridedSliceGradGrad(op, grad):
"""Gradient for StridedSliceGrad op."""
begin = op.inputs[1]
end = op.inputs[2]
strides = op.inputs[3]
return None, None, None, None, array_ops.strided_slice(
grad,
begin,
end,
strides,
begin_mask=op.get_attr("begin_mask"),
end_mask=op.... | [
"def",
"_StridedSliceGradGrad",
"(",
"op",
",",
"grad",
")",
":",
"begin",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
"end",
"=",
"op",
".",
"inputs",
"[",
"2",
"]",
"strides",
"=",
"op",
".",
"inputs",
"[",
"3",
"]",
"return",
"None",
",",
"None",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_grad.py#L299-L314 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/command/easy_install.py | python | is_python_script | (script_text, filename) | return False | Is this text, as a whole, a Python script? (as opposed to shell/bat/etc. | Is this text, as a whole, a Python script? (as opposed to shell/bat/etc. | [
"Is",
"this",
"text",
"as",
"a",
"whole",
"a",
"Python",
"script?",
"(",
"as",
"opposed",
"to",
"shell",
"/",
"bat",
"/",
"etc",
"."
] | def is_python_script(script_text, filename):
"""Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
"""
if filename.endswith('.py') or filename.endswith('.pyw'):
return True # extension says it's Python
if is_python(script_text, filename):
return True # it's syntac... | [
"def",
"is_python_script",
"(",
"script_text",
",",
"filename",
")",
":",
"if",
"filename",
".",
"endswith",
"(",
"'.py'",
")",
"or",
"filename",
".",
"endswith",
"(",
"'.pyw'",
")",
":",
"return",
"True",
"# extension says it's Python",
"if",
"is_python",
"("... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/command/easy_install.py#L1937-L1948 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/nntplib.py | python | NNTP.getresp | (self) | return resp | Internal: get a response from the server.
Raise various errors if the response indicates an error. | Internal: get a response from the server.
Raise various errors if the response indicates an error. | [
"Internal",
":",
"get",
"a",
"response",
"from",
"the",
"server",
".",
"Raise",
"various",
"errors",
"if",
"the",
"response",
"indicates",
"an",
"error",
"."
] | def getresp(self):
"""Internal: get a response from the server.
Raise various errors if the response indicates an error."""
resp = self.getline()
if self.debugging: print '*resp*', repr(resp)
c = resp[:1]
if c == '4':
raise NNTPTemporaryError(resp)
if ... | [
"def",
"getresp",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"getline",
"(",
")",
"if",
"self",
".",
"debugging",
":",
"print",
"'*resp*'",
",",
"repr",
"(",
"resp",
")",
"c",
"=",
"resp",
"[",
":",
"1",
"]",
"if",
"c",
"==",
"'4'",
":",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/nntplib.py#L211-L223 | |
ukoethe/vigra | 093d57d15c8c237adf1704d96daa6393158ce299 | vigranumpy/lib/arraytypes.py | python | VigraArray.subarray | (self, p1, p2=None) | Construct a subarray view from a pair of points. The first point denotes the start
of the subarray (inclusive), the second its end (exclusive). For example,
a.subarray((1,2,3), (4,5,6)) # equivalent to a[1:4, 2:5, 3:6]
The given points must have the same dimension, otherwise an IndexError... | Construct a subarray view from a pair of points. The first point denotes the start
of the subarray (inclusive), the second its end (exclusive). For example, | [
"Construct",
"a",
"subarray",
"view",
"from",
"a",
"pair",
"of",
"points",
".",
"The",
"first",
"point",
"denotes",
"the",
"start",
"of",
"the",
"subarray",
"(",
"inclusive",
")",
"the",
"second",
"its",
"end",
"(",
"exclusive",
")",
".",
"For",
"example... | def subarray(self, p1, p2=None):
'''
Construct a subarray view from a pair of points. The first point denotes the start
of the subarray (inclusive), the second its end (exclusive). For example,
a.subarray((1,2,3), (4,5,6)) # equivalent to a[1:4, 2:5, 3:6]
The given points ... | [
"def",
"subarray",
"(",
"self",
",",
"p1",
",",
"p2",
"=",
"None",
")",
":",
"if",
"p2",
"is",
"not",
"None",
":",
"if",
"len",
"(",
"p1",
")",
"!=",
"len",
"(",
"p2",
")",
":",
"raise",
"IndexError",
"(",
"'VigraArray.subarray(): points must have the ... | https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/arraytypes.py#L1277-L1300 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | AF/video_demo.py | python | get_labelname | (labelmap, labels) | return labelnames | Get Label Name from LabelMap | Get Label Name from LabelMap | [
"Get",
"Label",
"Name",
"from",
"LabelMap"
] | def get_labelname(labelmap, labels):
"""Get Label Name from LabelMap"""
num_labels = len(labelmap.item)
labelnames = []
if type(labels) is not list:
labels = [labels]
for label in labels:
found = False
for i in range(0, num_labels):
if label == labelmap.item[i].l... | [
"def",
"get_labelname",
"(",
"labelmap",
",",
"labels",
")",
":",
"num_labels",
"=",
"len",
"(",
"labelmap",
".",
"item",
")",
"labelnames",
"=",
"[",
"]",
"if",
"type",
"(",
"labels",
")",
"is",
"not",
"list",
":",
"labels",
"=",
"[",
"labels",
"]",... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/AF/video_demo.py#L50-L65 | |
9miao/CrossApp | 1f5375e061bf69841eb19728598f5ae3f508d620 | tools/plugin_jscompile/__init__.py | python | CCPluginJSCompile.get_output_file_path | (self, jsfile) | return jsc_filepath | Gets output file path by source js file | Gets output file path by source js file | [
"Gets",
"output",
"file",
"path",
"by",
"source",
"js",
"file"
] | def get_output_file_path(self, jsfile):
"""
Gets output file path by source js file
"""
# create folder for generated file
jsc_filepath = ""
relative_path = self.get_relative_path(jsfile)+"c"
jsc_filepath = os.path.join(self._dst_dir, relative_path)
dst_r... | [
"def",
"get_output_file_path",
"(",
"self",
",",
"jsfile",
")",
":",
"# create folder for generated file",
"jsc_filepath",
"=",
"\"\"",
"relative_path",
"=",
"self",
".",
"get_relative_path",
"(",
"jsfile",
")",
"+",
"\"c\"",
"jsc_filepath",
"=",
"os",
".",
"path"... | https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/plugin_jscompile/__init__.py#L101-L121 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_minimize.py | python | standardize_bounds | (bounds, x0, meth) | return bounds | Converts bounds to the form required by the solver. | Converts bounds to the form required by the solver. | [
"Converts",
"bounds",
"to",
"the",
"form",
"required",
"by",
"the",
"solver",
"."
] | def standardize_bounds(bounds, x0, meth):
"""Converts bounds to the form required by the solver."""
if meth == 'trust-constr':
if not isinstance(bounds, Bounds):
lb, ub = old_bound_to_new(bounds)
bounds = Bounds(lb, ub)
elif meth in ('l-bfgs-b', 'tnc', 'slsqp'):
if is... | [
"def",
"standardize_bounds",
"(",
"bounds",
",",
"x0",
",",
"meth",
")",
":",
"if",
"meth",
"==",
"'trust-constr'",
":",
"if",
"not",
"isinstance",
"(",
"bounds",
",",
"Bounds",
")",
":",
"lb",
",",
"ub",
"=",
"old_bound_to_new",
"(",
"bounds",
")",
"b... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_minimize.py#L788-L797 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_EncryptDecrypt2_REQUEST.fromTpm | (buf) | return buf.createObj(TPM2_EncryptDecrypt2_REQUEST) | Returns new TPM2_EncryptDecrypt2_REQUEST object constructed from its
marshaled representation in the given TpmBuffer buffer | Returns new TPM2_EncryptDecrypt2_REQUEST object constructed from its
marshaled representation in the given TpmBuffer buffer | [
"Returns",
"new",
"TPM2_EncryptDecrypt2_REQUEST",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"TpmBuffer",
"buffer"
] | def fromTpm(buf):
""" Returns new TPM2_EncryptDecrypt2_REQUEST object constructed from its
marshaled representation in the given TpmBuffer buffer
"""
return buf.createObj(TPM2_EncryptDecrypt2_REQUEST) | [
"def",
"fromTpm",
"(",
"buf",
")",
":",
"return",
"buf",
".",
"createObj",
"(",
"TPM2_EncryptDecrypt2_REQUEST",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L11489-L11493 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | tools/sanitize_source_files.py | python | TabReplacer | (line, file_path, line_number) | return line.replace('\t', ' ') | Replaces Tabs with 4 whitespaces. | Replaces Tabs with 4 whitespaces. | [
"Replaces",
"Tabs",
"with",
"4",
"whitespaces",
"."
] | def TabReplacer(line, file_path, line_number):
"""Replaces Tabs with 4 whitespaces."""
if '\t' in line:
print('Replacing Tab with whitespace in %s:%s' % (file_path, line_number))
return line.replace('\t', ' ') | [
"def",
"TabReplacer",
"(",
"line",
",",
"file_path",
",",
"line_number",
")",
":",
"if",
"'\\t'",
"in",
"line",
":",
"print",
"(",
"'Replacing Tab with whitespace in %s:%s'",
"%",
"(",
"file_path",
",",
"line_number",
")",
")",
"return",
"line",
".",
"replace"... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/tools/sanitize_source_files.py#L102-L106 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py | python | Block.set | (self, locs, values) | Modify Block in-place with new item value
Returns
-------
None | Modify Block in-place with new item value | [
"Modify",
"Block",
"in",
"-",
"place",
"with",
"new",
"item",
"value"
] | def set(self, locs, values):
"""
Modify Block in-place with new item value
Returns
-------
None
"""
self.values[locs] = values | [
"def",
"set",
"(",
"self",
",",
"locs",
",",
"values",
")",
":",
"self",
".",
"values",
"[",
"locs",
"]",
"=",
"values"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py#L368-L376 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/specs/python/params_ops.py | python | Nt | (mu, sigma, limit=3.0) | return min(max(random.gauss(mu, sigma), mu-limit*sigma), mu+limit*sigma) | Normally distributed floating point number with truncation. | Normally distributed floating point number with truncation. | [
"Normally",
"distributed",
"floating",
"point",
"number",
"with",
"truncation",
"."
] | def Nt(mu, sigma, limit=3.0):
"""Normally distributed floating point number with truncation."""
return min(max(random.gauss(mu, sigma), mu-limit*sigma), mu+limit*sigma) | [
"def",
"Nt",
"(",
"mu",
",",
"sigma",
",",
"limit",
"=",
"3.0",
")",
":",
"return",
"min",
"(",
"max",
"(",
"random",
".",
"gauss",
"(",
"mu",
",",
"sigma",
")",
",",
"mu",
"-",
"limit",
"*",
"sigma",
")",
",",
"mu",
"+",
"limit",
"*",
"sigma... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/specs/python/params_ops.py#L82-L84 | |
evpo/EncryptPad | 156904860aaba8e7e8729b44e269b2992f9fe9f4 | deps/libencryptmsg/configure.py | python | configure_encryptmsg | (system_command, options) | Build the encryptmsg library and cli | Build the encryptmsg library and cli | [
"Build",
"the",
"encryptmsg",
"library",
"and",
"cli"
] | def configure_encryptmsg(system_command, options):
"""
Build the encryptmsg library and cli
"""
source_paths = SourcePaths(os.path.dirname(system_command))
info_arch = load_build_data_info_files(source_paths, 'CPU info', 'arch', ArchInfo)
info_os = load_build_data_info_files(source_paths, 'OS i... | [
"def",
"configure_encryptmsg",
"(",
"system_command",
",",
"options",
")",
":",
"source_paths",
"=",
"SourcePaths",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"system_command",
")",
")",
"info_arch",
"=",
"load_build_data_info_files",
"(",
"source_paths",
",",
... | https://github.com/evpo/EncryptPad/blob/156904860aaba8e7e8729b44e269b2992f9fe9f4/deps/libencryptmsg/configure.py#L1908-L1979 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/abinsalgorithm.py | python | AbinsAlgorithm.create_total_workspace | (self, workspaces: list) | Sum together elemental totals to make an additional Total workspace | Sum together elemental totals to make an additional Total workspace | [
"Sum",
"together",
"elemental",
"totals",
"to",
"make",
"an",
"additional",
"Total",
"workspace"
] | def create_total_workspace(self, workspaces: list) -> None:
"""Sum together elemental totals to make an additional Total workspace"""
total_atom_workspaces = []
for ws in workspaces:
if "total" in ws:
total_atom_workspaces.append(ws)
total_workspace = self._cr... | [
"def",
"create_total_workspace",
"(",
"self",
",",
"workspaces",
":",
"list",
")",
"->",
"None",
":",
"total_atom_workspaces",
"=",
"[",
"]",
"for",
"ws",
"in",
"workspaces",
":",
"if",
"\"total\"",
"in",
"ws",
":",
"total_atom_workspaces",
".",
"append",
"(... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/abinsalgorithm.py#L487-L494 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewTreeCtrl.GetChildCount | (*args, **kwargs) | return _dataview.DataViewTreeCtrl_GetChildCount(*args, **kwargs) | GetChildCount(self, DataViewItem parent) -> int | GetChildCount(self, DataViewItem parent) -> int | [
"GetChildCount",
"(",
"self",
"DataViewItem",
"parent",
")",
"-",
">",
"int"
] | def GetChildCount(*args, **kwargs):
"""GetChildCount(self, DataViewItem parent) -> int"""
return _dataview.DataViewTreeCtrl_GetChildCount(*args, **kwargs) | [
"def",
"GetChildCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewTreeCtrl_GetChildCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2529-L2531 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/util/timeout.py | python | Timeout.connect_timeout | (self) | return min(self._connect, self.total) | Get the value to use when setting a connection timeout.
This will be a positive float or integer, the value None
(never timeout), or the default system timeout.
:return: Connect timeout.
:rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None | Get the value to use when setting a connection timeout. | [
"Get",
"the",
"value",
"to",
"use",
"when",
"setting",
"a",
"connection",
"timeout",
"."
] | def connect_timeout(self):
""" Get the value to use when setting a connection timeout.
This will be a positive float or integer, the value None
(never timeout), or the default system timeout.
:return: Connect timeout.
:rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None
... | [
"def",
"connect_timeout",
"(",
"self",
")",
":",
"if",
"self",
".",
"total",
"is",
"None",
":",
"return",
"self",
".",
"_connect",
"if",
"self",
".",
"_connect",
"is",
"None",
"or",
"self",
".",
"_connect",
"is",
"self",
".",
"DEFAULT_TIMEOUT",
":",
"r... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/util/timeout.py#L211-L226 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsContext.OffsetEnabled | (*args, **kwargs) | return _gdi_.GraphicsContext_OffsetEnabled(*args, **kwargs) | OffsetEnabled(self) -> bool | OffsetEnabled(self) -> bool | [
"OffsetEnabled",
"(",
"self",
")",
"-",
">",
"bool"
] | def OffsetEnabled(*args, **kwargs):
"""OffsetEnabled(self) -> bool"""
return _gdi_.GraphicsContext_OffsetEnabled(*args, **kwargs) | [
"def",
"OffsetEnabled",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_OffsetEnabled",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6522-L6524 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HelpControllerBase.DisplaySection | (*args) | return _html.HelpControllerBase_DisplaySection(*args) | DisplaySection(self, int sectionNo) -> bool
DisplaySection(self, String section) -> bool | DisplaySection(self, int sectionNo) -> bool
DisplaySection(self, String section) -> bool | [
"DisplaySection",
"(",
"self",
"int",
"sectionNo",
")",
"-",
">",
"bool",
"DisplaySection",
"(",
"self",
"String",
"section",
")",
"-",
">",
"bool"
] | def DisplaySection(*args):
"""
DisplaySection(self, int sectionNo) -> bool
DisplaySection(self, String section) -> bool
"""
return _html.HelpControllerBase_DisplaySection(*args) | [
"def",
"DisplaySection",
"(",
"*",
"args",
")",
":",
"return",
"_html",
".",
"HelpControllerBase_DisplaySection",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1888-L1893 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | HeaderButtonParams.__init__ | (self, *args, **kwargs) | __init__(self) -> HeaderButtonParams
Extra (optional) parameters for `wx.RendererNative.DrawHeaderButton` | __init__(self) -> HeaderButtonParams | [
"__init__",
"(",
"self",
")",
"-",
">",
"HeaderButtonParams"
] | def __init__(self, *args, **kwargs):
"""
__init__(self) -> HeaderButtonParams
Extra (optional) parameters for `wx.RendererNative.DrawHeaderButton`
"""
_gdi_.HeaderButtonParams_swiginit(self,_gdi_.new_HeaderButtonParams(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gdi_",
".",
"HeaderButtonParams_swiginit",
"(",
"self",
",",
"_gdi_",
".",
"new_HeaderButtonParams",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L7168-L7174 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/data.py | python | Manpages.dispatch | (cls, files) | return [cls(manpages, prefix=_posixpath.join(
'share', 'man', 'man%s' % section,
)) for section, manpages in list(mpmap.items())] | Automatically dispatch manpages to their target directories | Automatically dispatch manpages to their target directories | [
"Automatically",
"dispatch",
"manpages",
"to",
"their",
"target",
"directories"
] | def dispatch(cls, files):
""" Automatically dispatch manpages to their target directories """
mpmap = {}
for manpage in files:
normalized = _os.path.normpath(manpage)
_, ext = _os.path.splitext(normalized)
if ext.startswith(_os.path.extsep):
ex... | [
"def",
"dispatch",
"(",
"cls",
",",
"files",
")",
":",
"mpmap",
"=",
"{",
"}",
"for",
"manpage",
"in",
"files",
":",
"normalized",
"=",
"_os",
".",
"path",
".",
"normpath",
"(",
"manpage",
")",
"_",
",",
"ext",
"=",
"_os",
".",
"path",
".",
"spli... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/data.py#L147-L158 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/legendre.py | python | leggrid2d | (x, y, c) | return c | Evaluate a 2-D Legendre series on the Cartesian product of x and y.
This function returns the values:
.. math:: p(a,b) = \sum_{i,j} c_{i,j} * L_i(a) * L_j(b)
where the points `(a, b)` consist of all pairs formed by taking
`a` from `x` and `b` from `y`. The resulting points form a grid with
`x` in... | Evaluate a 2-D Legendre series on the Cartesian product of x and y. | [
"Evaluate",
"a",
"2",
"-",
"D",
"Legendre",
"series",
"on",
"the",
"Cartesian",
"product",
"of",
"x",
"and",
"y",
"."
] | def leggrid2d(x, y, c):
"""
Evaluate a 2-D Legendre series on the Cartesian product of x and y.
This function returns the values:
.. math:: p(a,b) = \sum_{i,j} c_{i,j} * L_i(a) * L_j(b)
where the points `(a, b)` consist of all pairs formed by taking
`a` from `x` and `b` from `y`. The resultin... | [
"def",
"leggrid2d",
"(",
"x",
",",
"y",
",",
"c",
")",
":",
"c",
"=",
"legval",
"(",
"x",
",",
"c",
")",
"c",
"=",
"legval",
"(",
"y",
",",
"c",
")",
"return",
"c"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/legendre.py#L1040-L1092 | |
martinmoene/expected-lite | 6284387cb117ea78d973fb5b1cbff1651a8d5d9a | conanfile.py | python | ExpectedLiteConan.package | (self) | Run CMake install | Run CMake install | [
"Run",
"CMake",
"install"
] | def package(self):
"""Run CMake install"""
cmake = CMake(self)
cmake.definitions["EXPECTED_LITE_OPT_BUILD_TESTS"] = "OFF"
cmake.definitions["EXPECTED_LITE_OPT_BUILD_EXAMPLES"] = "OFF"
cmake.configure()
cmake.install() | [
"def",
"package",
"(",
"self",
")",
":",
"cmake",
"=",
"CMake",
"(",
"self",
")",
"cmake",
".",
"definitions",
"[",
"\"EXPECTED_LITE_OPT_BUILD_TESTS\"",
"]",
"=",
"\"OFF\"",
"cmake",
".",
"definitions",
"[",
"\"EXPECTED_LITE_OPT_BUILD_EXAMPLES\"",
"]",
"=",
"\"O... | https://github.com/martinmoene/expected-lite/blob/6284387cb117ea78d973fb5b1cbff1651a8d5d9a/conanfile.py#L18-L24 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/cond_v2.py | python | _IfGrad | (op, *grads) | return [None] + outputs | The gradient of an If op produced by cond_v2. | The gradient of an If op produced by cond_v2. | [
"The",
"gradient",
"of",
"an",
"If",
"op",
"produced",
"by",
"cond_v2",
"."
] | def _IfGrad(op, *grads): # pylint: disable=invalid-name
"""The gradient of an If op produced by cond_v2."""
# Get the if operator (this logic handles the case where op is a MockOp)
if_op = op.outputs[0].op
true_graph, false_graph = get_func_graphs(if_op)
# Note: op.graph != ops.get_default_graph() when we ar... | [
"def",
"_IfGrad",
"(",
"op",
",",
"*",
"grads",
")",
":",
"# pylint: disable=invalid-name",
"# Get the if operator (this logic handles the case where op is a MockOp)",
"if_op",
"=",
"op",
".",
"outputs",
"[",
"0",
"]",
".",
"op",
"true_graph",
",",
"false_graph",
"=",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/cond_v2.py#L108-L190 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | urllib3/response.py | python | HTTPResponse.read | (self, amt=None, decode_content=None, cache_content=False) | Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
parameters: ``decode_content`` and ``cache_content``.
:param amt:
How much of the content to read. If specified, caching is skipped
because it doesn't make sense to cache partial content as the full
... | Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
parameters: ``decode_content`` and ``cache_content``. | [
"Similar",
"to",
":",
"meth",
":",
"httplib",
".",
"HTTPResponse",
".",
"read",
"but",
"with",
"two",
"additional",
"parameters",
":",
"decode_content",
"and",
"cache_content",
"."
] | def read(self, amt=None, decode_content=None, cache_content=False):
"""
Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
parameters: ``decode_content`` and ``cache_content``.
:param amt:
How much of the content to read. If specified, caching is skipped
... | [
"def",
"read",
"(",
"self",
",",
"amt",
"=",
"None",
",",
"decode_content",
"=",
"None",
",",
"cache_content",
"=",
"False",
")",
":",
"# Note: content-encoding value should be case-insensitive, per RFC 2616",
"# Section 3.5",
"content_encoding",
"=",
"self",
".",
"he... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/urllib3/response.py#L145-L221 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/exodus/ExodusReader.py | python | ExodusReaderErrorObserver.errors | (self) | return self._errors | Return the list of errors. | Return the list of errors. | [
"Return",
"the",
"list",
"of",
"errors",
"."
] | def errors(self):
"""
Return the list of errors.
"""
return self._errors | [
"def",
"errors",
"(",
"self",
")",
":",
"return",
"self",
".",
"_errors"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/exodus/ExodusReader.py#L54-L58 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | Listbook.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, String name=EmptyString) -> Listbook | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, String name=EmptyString) -> Listbook | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"0",
"String",
"name",
"=",
"EmptyString",
")",
"-",
">",
"Listbook"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, String name=EmptyString) -> Listbook
"""
_controls_.Listbook_swiginit(self,_controls_.new_Listbook(*args, **kwargs))
sel... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_controls_",
".",
"Listbook_swiginit",
"(",
"self",
",",
"_controls_",
".",
"new_Listbook",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_setO... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3211-L3217 | ||
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/dump_breakpad_symbols.py | python | is_regular_file | (path) | return os.path.isfile(path) and not os.path.islink(path) | Check whether 'path' is a regular file, especially not a symlink. | Check whether 'path' is a regular file, especially not a symlink. | [
"Check",
"whether",
"path",
"is",
"a",
"regular",
"file",
"especially",
"not",
"a",
"symlink",
"."
] | def is_regular_file(path):
"""Check whether 'path' is a regular file, especially not a symlink."""
return os.path.isfile(path) and not os.path.islink(path) | [
"def",
"is_regular_file",
"(",
"path",
")",
":",
"return",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
"and",
"not",
"os",
".",
"path",
".",
"islink",
"(",
"path",
")"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/dump_breakpad_symbols.py#L146-L148 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForNonRepeatedCompositeField | (field, cls) | Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field.
Clients can use this property to get the value of the field, but cannot
assign to the property directly.
Args:
field: A FieldDescriptor for this field.
cls: The class we're co... | Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"nonrepeated",
"composite",
"protocol",
"message",
"field",
".",
"A",
"composite",
"field",
"is",
"a",
"group",
"or",
"message",
"field",
"."
] | def _AddPropertiesForNonRepeatedCompositeField(field, cls):
"""Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field.
Clients can use this property to get the value of the field, but cannot
assign to the property directly.
Args:
fie... | [
"def",
"_AddPropertiesForNonRepeatedCompositeField",
"(",
"field",
",",
"cls",
")",
":",
"# TODO(robinson): Remove duplication with similar method",
"# for non-repeated scalars.",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_... | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/python_message.py#L492-L543 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/FreeType2/FreeType2-2.4.12/src/tools/glnames.py | python | dump_encoding | ( file, encoding_name, encoding_list ) | dump a given encoding | dump a given encoding | [
"dump",
"a",
"given",
"encoding"
] | def dump_encoding( file, encoding_name, encoding_list ):
"""dump a given encoding"""
write = file.write
write( " /* the following are indices into the SID name table */\n" )
write( " static const unsigned short " + encoding_name +
"[" + repr( len( encoding_list ) ) + "] =\n" )
write( " {\n" )
... | [
"def",
"dump_encoding",
"(",
"file",
",",
"encoding_name",
",",
"encoding_list",
")",
":",
"write",
"=",
"file",
".",
"write",
"write",
"(",
"\" /* the following are indices into the SID name table */\\n\"",
")",
"write",
"(",
"\" static const unsigned short \"",
"+",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/FreeType2/FreeType2-2.4.12/src/tools/glnames.py#L5186-L5207 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py | python | TimingScriptGenerator.writeTimingCall | (self, irname, callname) | Echo some comments and invoke both versions of toy | Echo some comments and invoke both versions of toy | [
"Echo",
"some",
"comments",
"and",
"invoke",
"both",
"versions",
"of",
"toy"
] | def writeTimingCall(self, irname, callname):
"""Echo some comments and invoke both versions of toy"""
rootname = irname
if '.' in irname:
rootname = irname[:irname.rfind('.')]
self.shfile.write("echo \"%s: Calls %s\" >> %s\n" % (callname, irname, self.timeFile))
self.... | [
"def",
"writeTimingCall",
"(",
"self",
",",
"irname",
",",
"callname",
")",
":",
"rootname",
"=",
"irname",
"if",
"'.'",
"in",
"irname",
":",
"rootname",
"=",
"irname",
"[",
":",
"irname",
".",
"rfind",
"(",
"'.'",
")",
"]",
"self",
".",
"shfile",
".... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py#L12-L34 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/api/lvm.py | python | Volume.set_tag | (self, key, value) | Set the key/value pair as an LVM tag. | Set the key/value pair as an LVM tag. | [
"Set",
"the",
"key",
"/",
"value",
"pair",
"as",
"an",
"LVM",
"tag",
"."
] | def set_tag(self, key, value):
"""
Set the key/value pair as an LVM tag.
"""
# remove it first if it exists
self.clear_tag(key)
process.call(
[
'lvchange',
'--addtag', '%s=%s' % (key, value), self.lv_path
],
... | [
"def",
"set_tag",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"# remove it first if it exists",
"self",
".",
"clear_tag",
"(",
"key",
")",
"process",
".",
"call",
"(",
"[",
"'lvchange'",
",",
"'--addtag'",
",",
"'%s=%s'",
"%",
"(",
"key",
",",
"valu... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/api/lvm.py#L902-L916 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_util.py | python | Assign | (target, source) | return Node(syms.atom,
target + [Leaf(token.EQUAL, u"=", prefix=u" ")] + source) | Build an assignment statement | Build an assignment statement | [
"Build",
"an",
"assignment",
"statement"
] | def Assign(target, source):
"""Build an assignment statement"""
if not isinstance(target, list):
target = [target]
if not isinstance(source, list):
source.prefix = u" "
source = [source]
return Node(syms.atom,
target + [Leaf(token.EQUAL, u"=", prefix=u" ")] + sou... | [
"def",
"Assign",
"(",
"target",
",",
"source",
")",
":",
"if",
"not",
"isinstance",
"(",
"target",
",",
"list",
")",
":",
"target",
"=",
"[",
"target",
"]",
"if",
"not",
"isinstance",
"(",
"source",
",",
"list",
")",
":",
"source",
".",
"prefix",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/fixer_util.py#L27-L36 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/computation/expr.py | python | _replace_booleans | (tok) | return toknum, tokval | Replace ``&`` with ``and`` and ``|`` with ``or`` so that bitwise
precedence is changed to boolean precedence.
Parameters
----------
tok : tuple of int, str
ints correspond to the all caps constants in the tokenize module
Returns
-------
t : tuple of int, str
Either the inpu... | Replace ``&`` with ``and`` and ``|`` with ``or`` so that bitwise
precedence is changed to boolean precedence. | [
"Replace",
"&",
"with",
"and",
"and",
"|",
"with",
"or",
"so",
"that",
"bitwise",
"precedence",
"is",
"changed",
"to",
"boolean",
"precedence",
"."
] | def _replace_booleans(tok):
"""Replace ``&`` with ``and`` and ``|`` with ``or`` so that bitwise
precedence is changed to boolean precedence.
Parameters
----------
tok : tuple of int, str
ints correspond to the all caps constants in the tokenize module
Returns
-------
t : tuple ... | [
"def",
"_replace_booleans",
"(",
"tok",
")",
":",
"toknum",
",",
"tokval",
"=",
"tok",
"if",
"toknum",
"==",
"tokenize",
".",
"OP",
":",
"if",
"tokval",
"==",
"'&'",
":",
"return",
"tokenize",
".",
"NAME",
",",
"'and'",
"elif",
"tokval",
"==",
"'|'",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/computation/expr.py#L56-L77 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/calendar.py | python | CalendarCtrlBase.EnableHolidayDisplay | (*args, **kwargs) | return _calendar.CalendarCtrlBase_EnableHolidayDisplay(*args, **kwargs) | EnableHolidayDisplay(self, bool display=True)
This function should be used instead of changing CAL_SHOW_HOLIDAYS
style bit directly. It enables or disables the special highlighting of
the holidays. | EnableHolidayDisplay(self, bool display=True) | [
"EnableHolidayDisplay",
"(",
"self",
"bool",
"display",
"=",
"True",
")"
] | def EnableHolidayDisplay(*args, **kwargs):
"""
EnableHolidayDisplay(self, bool display=True)
This function should be used instead of changing CAL_SHOW_HOLIDAYS
style bit directly. It enables or disables the special highlighting of
the holidays.
"""
return _calend... | [
"def",
"EnableHolidayDisplay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_calendar",
".",
"CalendarCtrlBase_EnableHolidayDisplay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L350-L358 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/wildcard.py | python | list_namespace | (namespace, type_pattern, filter, ignore_case=False, show_all=False) | Return dictionary of all objects in a namespace dictionary that match
type_pattern and filter. | Return dictionary of all objects in a namespace dictionary that match
type_pattern and filter. | [
"Return",
"dictionary",
"of",
"all",
"objects",
"in",
"a",
"namespace",
"dictionary",
"that",
"match",
"type_pattern",
"and",
"filter",
"."
] | def list_namespace(namespace, type_pattern, filter, ignore_case=False, show_all=False):
"""Return dictionary of all objects in a namespace dictionary that match
type_pattern and filter."""
pattern_list=filter.split(".")
if len(pattern_list) == 1:
return filter_ns(namespace, name_pattern=pattern_l... | [
"def",
"list_namespace",
"(",
"namespace",
",",
"type_pattern",
",",
"filter",
",",
"ignore_case",
"=",
"False",
",",
"show_all",
"=",
"False",
")",
":",
"pattern_list",
"=",
"filter",
".",
"split",
"(",
"\".\"",
")",
"if",
"len",
"(",
"pattern_list",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/wildcard.py#L90-L112 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Pygments/py3/pygments/lexer.py | python | RegexLexerMeta._process_state | (cls, unprocessed, processed, state) | return tokens | Preprocess a single state definition. | Preprocess a single state definition. | [
"Preprocess",
"a",
"single",
"state",
"definition",
"."
] | def _process_state(cls, unprocessed, processed, state):
"""Preprocess a single state definition."""
assert type(state) is str, "wrong state name %r" % state
assert state[0] != '#', "invalid state name %r" % state
if state in processed:
return processed[state]
tokens =... | [
"def",
"_process_state",
"(",
"cls",
",",
"unprocessed",
",",
"processed",
",",
"state",
")",
":",
"assert",
"type",
"(",
"state",
")",
"is",
"str",
",",
"\"wrong state name %r\"",
"%",
"state",
"assert",
"state",
"[",
"0",
"]",
"!=",
"'#'",
",",
"\"inva... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/lexer.py#L467-L509 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/android_platform/development/scripts/stack_core.py | python | ConvertTrace | (lines, more_info) | Convert strings containing native crash to a stack. | Convert strings containing native crash to a stack. | [
"Convert",
"strings",
"containing",
"native",
"crash",
"to",
"a",
"stack",
"."
] | def ConvertTrace(lines, more_info):
"""Convert strings containing native crash to a stack."""
process_info_line = re.compile("(pid: [0-9]+, tid: [0-9]+.*)")
signal_line = re.compile("(signal [0-9]+ \(.*\).*)")
register_line = re.compile("(([ ]*[0-9a-z]{2} [0-9a-f]{8}){4})")
thread_line = re.compile("(.*)(\-\-... | [
"def",
"ConvertTrace",
"(",
"lines",
",",
"more_info",
")",
":",
"process_info_line",
"=",
"re",
".",
"compile",
"(",
"\"(pid: [0-9]+, tid: [0-9]+.*)\"",
")",
"signal_line",
"=",
"re",
".",
"compile",
"(",
"\"(signal [0-9]+ \\(.*\\).*)\"",
")",
"register_line",
"=",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/android_platform/development/scripts/stack_core.py#L67-L224 | ||
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | TypeKind.spelling | (self) | return conf.lib.clang_getTypeKindSpelling(self.value) | Retrieve the spelling of this TypeKind. | Retrieve the spelling of this TypeKind. | [
"Retrieve",
"the",
"spelling",
"of",
"this",
"TypeKind",
"."
] | def spelling(self):
"""Retrieve the spelling of this TypeKind."""
return conf.lib.clang_getTypeKindSpelling(self.value) | [
"def",
"spelling",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTypeKindSpelling",
"(",
"self",
".",
"value",
")"
] | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1570-L1572 | |
chuckcho/video-caffe | fc232b3e3a90ea22dd041b9fc5c542f170581f20 | tools/extra/parse_log.py | python | parse_line_for_net_output | (regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate) | return row_dict_list, row | Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row_dict_list: may be either the current row_dict_list or an augmented
version of the current row_dict_list | Parse a single line for training or test output | [
"Parse",
"a",
"single",
"line",
"for",
"training",
"or",
"test",
"output"
] | def parse_line_for_net_output(regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate):
"""Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row... | [
"def",
"parse_line_for_net_output",
"(",
"regex_obj",
",",
"row",
",",
"row_dict_list",
",",
"line",
",",
"iteration",
",",
"seconds",
",",
"learning_rate",
")",
":",
"output_match",
"=",
"regex_obj",
".",
"search",
"(",
"line",
")",
"if",
"output_match",
":",... | https://github.com/chuckcho/video-caffe/blob/fc232b3e3a90ea22dd041b9fc5c542f170581f20/tools/extra/parse_log.py#L86-L125 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/tk/vtkTkRenderWidget.py | python | vtkTkRenderWidget.GetDesiredUpdateRate | (self) | return self._DesiredUpdateRate | Mirrors the method with the same name in
vtkRenderWindowInteractor. | Mirrors the method with the same name in
vtkRenderWindowInteractor. | [
"Mirrors",
"the",
"method",
"with",
"the",
"same",
"name",
"in",
"vtkRenderWindowInteractor",
"."
] | def GetDesiredUpdateRate(self):
"""Mirrors the method with the same name in
vtkRenderWindowInteractor."""
return self._DesiredUpdateRate | [
"def",
"GetDesiredUpdateRate",
"(",
"self",
")",
":",
"return",
"self",
".",
"_DesiredUpdateRate"
] | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/tk/vtkTkRenderWidget.py#L195-L198 | |
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/rc.py | python | Field.center_field_loc | (self) | return np.array([0.0, self.length_m / 2]) | Conveniance function for getting the center field location
:return: the location of the center of the field | Conveniance function for getting the center field location
:return: the location of the center of the field | [
"Conveniance",
"function",
"for",
"getting",
"the",
"center",
"field",
"location",
":",
"return",
":",
"the",
"location",
"of",
"the",
"center",
"of",
"the",
"field"
] | def center_field_loc(self) -> np.ndarray:
"""
Conveniance function for getting the center field location
:return: the location of the center of the field
"""
return np.array([0.0, self.length_m / 2]) | [
"def",
"center_field_loc",
"(",
"self",
")",
"->",
"np",
".",
"ndarray",
":",
"return",
"np",
".",
"array",
"(",
"[",
"0.0",
",",
"self",
".",
"length_m",
"/",
"2",
"]",
")"
] | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/rc.py#L362-L367 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/_constexpr_utils.py | python | generate_broadcast_shape | (shapes, op_name) | return tuple(broadcast_shape) | Generate broadcast shape for a tuple of shape. | Generate broadcast shape for a tuple of shape. | [
"Generate",
"broadcast",
"shape",
"for",
"a",
"tuple",
"of",
"shape",
"."
] | def generate_broadcast_shape(shapes, op_name):
"""Generate broadcast shape for a tuple of shape."""
if not shapes:
return ()
broadcast_shape = shapes[0]
for i, shape in enumerate(shapes):
logger.debug(f"Broadcasts the {i}th tensor, the shape is {shape}.")
try:
broadca... | [
"def",
"generate_broadcast_shape",
"(",
"shapes",
",",
"op_name",
")",
":",
"if",
"not",
"shapes",
":",
"return",
"(",
")",
"broadcast_shape",
"=",
"shapes",
"[",
"0",
"]",
"for",
"i",
",",
"shape",
"in",
"enumerate",
"(",
"shapes",
")",
":",
"logger",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/_constexpr_utils.py#L442-L454 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/EditorLib/EditUtil.py | python | EditUtil.structureVolume | (masterNode, structureName, mergeVolumePostfix="-label") | return slicer.util.getFirstNodeByName(structureVolumeName, className=masterNode.GetClassName()) | Return the per-structure volume associated with the master node for the given
structure name | Return the per-structure volume associated with the master node for the given
structure name | [
"Return",
"the",
"per",
"-",
"structure",
"volume",
"associated",
"with",
"the",
"master",
"node",
"for",
"the",
"given",
"structure",
"name"
] | def structureVolume(masterNode, structureName, mergeVolumePostfix="-label"):
"""Return the per-structure volume associated with the master node for the given
structure name"""
masterName = masterNode.GetName()
structureVolumeName = masterName+"-%s"%structureName + mergeVolumePostfix
return slicer.ut... | [
"def",
"structureVolume",
"(",
"masterNode",
",",
"structureName",
",",
"mergeVolumePostfix",
"=",
"\"-label\"",
")",
":",
"masterName",
"=",
"masterNode",
".",
"GetName",
"(",
")",
"structureVolumeName",
"=",
"masterName",
"+",
"\"-%s\"",
"%",
"structureName",
"+... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/EditUtil.py#L308-L313 | |
vmware/concord-bft | ec036a384b4c81be0423d4b429bd37900b13b864 | util/pyclient/bft_client.py | python | BftClient._process_received_msg | (self, data, sender, replicas_addr, required_replies, cancel_scope) | Called by child class to process a received message. At this point it's unknown if message is valid | Called by child class to process a received message. At this point it's unknown if message is valid | [
"Called",
"by",
"child",
"class",
"to",
"process",
"a",
"received",
"message",
".",
"At",
"this",
"point",
"it",
"s",
"unknown",
"if",
"message",
"is",
"valid"
] | def _process_received_msg(self, data, sender, replicas_addr, required_replies, cancel_scope):
"""Called by child class to process a received message. At this point it's unknown if message is valid"""
rsi_msg = RSI.MsgWithReplicaSpecificInfo(data, sender)
header, reply = rsi_msg.get_common_reply(... | [
"def",
"_process_received_msg",
"(",
"self",
",",
"data",
",",
"sender",
",",
"replicas_addr",
",",
"required_replies",
",",
"cancel_scope",
")",
":",
"rsi_msg",
"=",
"RSI",
".",
"MsgWithReplicaSpecificInfo",
"(",
"data",
",",
"sender",
")",
"header",
",",
"re... | https://github.com/vmware/concord-bft/blob/ec036a384b4c81be0423d4b429bd37900b13b864/util/pyclient/bft_client.py#L332-L346 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | StandardPaths.GetExecutablePath | (*args, **kwargs) | return _misc_.StandardPaths_GetExecutablePath(*args, **kwargs) | GetExecutablePath(self) -> String
Return the path (directory+filename) of the running executable or an
empty string if it couldn't be determined. The path is returned as an
absolute path whenever possible. | GetExecutablePath(self) -> String | [
"GetExecutablePath",
"(",
"self",
")",
"-",
">",
"String"
] | def GetExecutablePath(*args, **kwargs):
"""
GetExecutablePath(self) -> String
Return the path (directory+filename) of the running executable or an
empty string if it couldn't be determined. The path is returned as an
absolute path whenever possible.
"""
return _... | [
"def",
"GetExecutablePath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StandardPaths_GetExecutablePath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L6299-L6307 | |
arx/ArxLibertatis | 0313c51625f3f55016cdad43d2c7f7296d27949c | scripts/cpplint.py | python | FileInfo.IsSource | (self) | return self.Extension()[1:] in EXTENSIONS | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return self.Extension()[1:] in EXTENSIONS | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
"in",
"EXTENSIONS"
] | https://github.com/arx/ArxLibertatis/blob/0313c51625f3f55016cdad43d2c7f7296d27949c/scripts/cpplint.py#L802-L804 | |
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/message_factory.py | python | MessageFactory.__init__ | (self) | Initializes a new factory. | Initializes a new factory. | [
"Initializes",
"a",
"new",
"factory",
"."
] | def __init__(self):
"""Initializes a new factory."""
self._classes = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_classes",
"=",
"{",
"}"
] | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/message_factory.py#L44-L46 | ||
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | panreas_hnn/hed-globalweight/python/caffe/draw.py | python | get_pydot_graph | (caffe_net, rankdir, label_edges=True) | return pydot_graph | Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is True).
Returns
-------
pydot graph object | Create a data structure which represents the `caffe_net`. | [
"Create",
"a",
"data",
"structure",
"which",
"represents",
"the",
"caffe_net",
"."
] | def get_pydot_graph(caffe_net, rankdir, label_edges=True):
"""Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is Tr... | [
"def",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"label_edges",
"=",
"True",
")",
":",
"pydot_graph",
"=",
"pydot",
".",
"Dot",
"(",
"caffe_net",
".",
"name",
",",
"graph_type",
"=",
"'digraph'",
",",
"rankdir",
"=",
"rankdir",
")",
"pydot_... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/python/caffe/draw.py#L121-L177 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1.py | python | BucketsGet.RunWithArgs | (self, bucket) | Returns metadata for the specified bucket.
Args:
bucket: Name of a bucket.
Flags:
ifMetagenerationMatch: Makes the return of the bucket metadata
conditional on whether the bucket's current metageneration matches the
given value.
ifMetagenerationNotMatch: Makes the return of t... | Returns metadata for the specified bucket. | [
"Returns",
"metadata",
"for",
"the",
"specified",
"bucket",
"."
] | def RunWithArgs(self, bucket):
"""Returns metadata for the specified bucket.
Args:
bucket: Name of a bucket.
Flags:
ifMetagenerationMatch: Makes the return of the bucket metadata
conditional on whether the bucket's current metageneration matches the
given value.
ifMetagen... | [
"def",
"RunWithArgs",
"(",
"self",
",",
"bucket",
")",
":",
"client",
"=",
"GetClientFromFlags",
"(",
")",
"global_params",
"=",
"GetGlobalParamsFromFlags",
"(",
")",
"request",
"=",
"messages",
".",
"StorageBucketsGetRequest",
"(",
"bucket",
"=",
"bucket",
".",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1.py#L666-L694 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/package/package_exporter.py | python | PackageExporter._intern_module | (
self,
module_name: str,
dependencies: bool,
) | Adds the module to the dependency graph as an interned module,
along with any metadata needed to write it out to the zipfile at serialization time. | Adds the module to the dependency graph as an interned module,
along with any metadata needed to write it out to the zipfile at serialization time. | [
"Adds",
"the",
"module",
"to",
"the",
"dependency",
"graph",
"as",
"an",
"interned",
"module",
"along",
"with",
"any",
"metadata",
"needed",
"to",
"write",
"it",
"out",
"to",
"the",
"zipfile",
"at",
"serialization",
"time",
"."
] | def _intern_module(
self,
module_name: str,
dependencies: bool,
):
"""Adds the module to the dependency graph as an interned module,
along with any metadata needed to write it out to the zipfile at serialization time.
"""
module_obj = self._import_module(modul... | [
"def",
"_intern_module",
"(",
"self",
",",
"module_name",
":",
"str",
",",
"dependencies",
":",
"bool",
",",
")",
":",
"module_obj",
"=",
"self",
".",
"_import_module",
"(",
"module_name",
")",
"# Subtle: if the import above succeeded, either:",
"# 1. The module nam... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/package_exporter.py#L497-L551 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/timeseries/python/timeseries/model.py | python | SequentialTimeSeriesModel._filtering_step | (self, current_times, current_values, state, predictions) | Compute a single-step loss for a batch of data.
Args:
current_times: A [batch size] Tensor of times for each observation.
current_values: A [batch size] Tensor of values for each observaiton.
state: Model state, updated to current_times.
predictions: The outputs of _prediction_step
Retu... | Compute a single-step loss for a batch of data. | [
"Compute",
"a",
"single",
"-",
"step",
"loss",
"for",
"a",
"batch",
"of",
"data",
"."
] | def _filtering_step(self, current_times, current_values, state, predictions):
"""Compute a single-step loss for a batch of data.
Args:
current_times: A [batch size] Tensor of times for each observation.
current_values: A [batch size] Tensor of values for each observaiton.
state: Model state, ... | [
"def",
"_filtering_step",
"(",
"self",
",",
"current_times",
",",
"current_values",
",",
"state",
",",
"predictions",
")",
":",
"pass"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/model.py#L352-L369 | ||
schwehr/libais | 1e19605942c8e155cd02fde6d1acde75ecd15d75 | third_party/gmock/scripts/generator/cpp/ast.py | python | Node.Requires | (self, node) | return False | Does this AST node require the definition of the node passed in? | Does this AST node require the definition of the node passed in? | [
"Does",
"this",
"AST",
"node",
"require",
"the",
"definition",
"of",
"the",
"node",
"passed",
"in?"
] | def Requires(self, node):
"""Does this AST node require the definition of the node passed in?"""
return False | [
"def",
"Requires",
"(",
"self",
",",
"node",
")",
":",
"return",
"False"
] | https://github.com/schwehr/libais/blob/1e19605942c8e155cd02fde6d1acde75ecd15d75/third_party/gmock/scripts/generator/cpp/ast.py#L128-L130 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/pytorch/nfsp.py | python | NFSP.restore | (self, checkpoint_dir) | Restores the average policy network and the inner RL agent's q-network.
Note that this does not restore the experience replay buffers and should
only be used to restore the agent's policy, not resume training.
Args:
checkpoint_dir: directory from which checkpoints will be restored. | Restores the average policy network and the inner RL agent's q-network. | [
"Restores",
"the",
"average",
"policy",
"network",
"and",
"the",
"inner",
"RL",
"agent",
"s",
"q",
"-",
"network",
"."
] | def restore(self, checkpoint_dir):
"""Restores the average policy network and the inner RL agent's q-network.
Note that this does not restore the experience replay buffers and should
only be used to restore the agent's policy, not resume training.
Args:
checkpoint_dir: directory from which check... | [
"def",
"restore",
"(",
"self",
",",
"checkpoint_dir",
")",
":",
"for",
"name",
",",
"model",
"in",
"self",
".",
"_savers",
":",
"full_checkpoint_dir",
"=",
"self",
".",
"_full_checkpoint_name",
"(",
"checkpoint_dir",
",",
"name",
")",
"logging",
".",
"info",... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/pytorch/nfsp.py#L274-L286 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.WriteSourcesForArch | (self, ninja_file, config_name, config, sources,
predepends, precompiled_header, spec, arch=None) | return outputs | Write build rules to compile all of |sources|. | Write build rules to compile all of |sources|. | [
"Write",
"build",
"rules",
"to",
"compile",
"all",
"of",
"|sources|",
"."
] | def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
predepends, precompiled_header, spec, arch=None):
"""Write build rules to compile all of |sources|."""
extra_defines = []
if self.flavor == 'mac':
cflags = self.xcode_settings.GetCflags(config_name, arch... | [
"def",
"WriteSourcesForArch",
"(",
"self",
",",
"ninja_file",
",",
"config_name",
",",
"config",
",",
"sources",
",",
"predepends",
",",
"precompiled_header",
",",
"spec",
",",
"arch",
"=",
"None",
")",
":",
"extra_defines",
"=",
"[",
"]",
"if",
"self",
".... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L884-L1042 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/SocketServer.py | python | ForkingMixIn.process_request | (self, request, client_address) | Fork a new subprocess to process the request. | Fork a new subprocess to process the request. | [
"Fork",
"a",
"new",
"subprocess",
"to",
"process",
"the",
"request",
"."
] | def process_request(self, request, client_address):
"""Fork a new subprocess to process the request."""
self.collect_children()
pid = os.fork()
if pid:
# Parent process
if self.active_children is None:
self.active_children = []
self.act... | [
"def",
"process_request",
"(",
"self",
",",
"request",
",",
"client_address",
")",
":",
"self",
".",
"collect_children",
"(",
")",
"pid",
"=",
"os",
".",
"fork",
"(",
")",
"if",
"pid",
":",
"# Parent process",
"if",
"self",
".",
"active_children",
"is",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/SocketServer.py#L520-L541 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/front/common/partial_infer/caffe_fallback.py | python | caffe_native_node_infer | (node: Node) | Infers shape of the unknown operation via Caffe if it is available.
Requires graph to contain paths to both prototxt and caffemodel files.
When it is visited for the first time, net object is created and written to graph.
Next time, it just takes the built net from graph.
Parameters
----------
... | Infers shape of the unknown operation via Caffe if it is available.
Requires graph to contain paths to both prototxt and caffemodel files.
When it is visited for the first time, net object is created and written to graph.
Next time, it just takes the built net from graph. | [
"Infers",
"shape",
"of",
"the",
"unknown",
"operation",
"via",
"Caffe",
"if",
"it",
"is",
"available",
".",
"Requires",
"graph",
"to",
"contain",
"paths",
"to",
"both",
"prototxt",
"and",
"caffemodel",
"files",
".",
"When",
"it",
"is",
"visited",
"for",
"t... | def caffe_native_node_infer(node: Node):
"""
Infers shape of the unknown operation via Caffe if it is available.
Requires graph to contain paths to both prototxt and caffemodel files.
When it is visited for the first time, net object is created and written to graph.
Next time, it just takes the buil... | [
"def",
"caffe_native_node_infer",
"(",
"node",
":",
"Node",
")",
":",
"log",
".",
"error",
"(",
"\"Caffe fallback is deprecated. It will be removed in future releases. Please use extensions for unsupported layers.\\n\"",
"+",
"\"See more information in the \\\"Custom Layers in the Model ... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/common/partial_infer/caffe_fallback.py#L79-L109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.