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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/socket.py | python | _socketobject.makefile | (self, mode='r', bufsize=-1) | return _fileobject(self._sock, mode, bufsize) | makefile([mode[, bufsize]]) -> file object
Return a regular file object corresponding to the socket. The mode
and bufsize arguments are as for the built-in open() function. | makefile([mode[, bufsize]]) -> file object | [
"makefile",
"(",
"[",
"mode",
"[",
"bufsize",
"]]",
")",
"-",
">",
"file",
"object"
] | def makefile(self, mode='r', bufsize=-1):
"""makefile([mode[, bufsize]]) -> file object
Return a regular file object corresponding to the socket. The mode
and bufsize arguments are as for the built-in open() function."""
return _fileobject(self._sock, mode, bufsize) | [
"def",
"makefile",
"(",
"self",
",",
"mode",
"=",
"'r'",
",",
"bufsize",
"=",
"-",
"1",
")",
":",
"return",
"_fileobject",
"(",
"self",
".",
"_sock",
",",
"mode",
",",
"bufsize",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/socket.py#L212-L217 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.GetTraitsIfExists | (*args, **kwargs) | return _core_.PyApp_GetTraitsIfExists(*args, **kwargs) | GetTraitsIfExists() -> wxAppTraits
This function provides safer access to traits object than
wx.GetApp().GetTraits() during startup or termination when the global
application object itself may be unavailable. | GetTraitsIfExists() -> wxAppTraits | [
"GetTraitsIfExists",
"()",
"-",
">",
"wxAppTraits"
] | def GetTraitsIfExists(*args, **kwargs):
"""
GetTraitsIfExists() -> wxAppTraits
This function provides safer access to traits object than
wx.GetApp().GetTraits() during startup or termination when the global
application object itself may be unavailable.
"""
return... | [
"def",
"GetTraitsIfExists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetTraitsIfExists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7819-L7827 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | SpherePoser.__init__ | (self) | r"""
__init__(SpherePoser self) -> SpherePoser | r"""
__init__(SpherePoser self) -> SpherePoser | [
"r",
"__init__",
"(",
"SpherePoser",
"self",
")",
"-",
">",
"SpherePoser"
] | def __init__(self):
r"""
__init__(SpherePoser self) -> SpherePoser
"""
_robotsim.SpherePoser_swiginit(self, _robotsim.new_SpherePoser()) | [
"def",
"__init__",
"(",
"self",
")",
":",
"_robotsim",
".",
"SpherePoser_swiginit",
"(",
"self",
",",
"_robotsim",
".",
"new_SpherePoser",
"(",
")",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3825-L3831 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | Geometry3D.getCurrentTransform | (self) | return _robotsim.Geometry3D_getCurrentTransform(self) | getCurrentTransform(Geometry3D self)
Gets the current transformation. | getCurrentTransform(Geometry3D self) | [
"getCurrentTransform",
"(",
"Geometry3D",
"self",
")"
] | def getCurrentTransform(self):
"""
getCurrentTransform(Geometry3D self)
Gets the current transformation.
"""
return _robotsim.Geometry3D_getCurrentTransform(self) | [
"def",
"getCurrentTransform",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"Geometry3D_getCurrentTransform",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L2158-L2167 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Feature.GetStyleString | (self, *args) | return _ogr.Feature_GetStyleString(self, *args) | r"""
GetStyleString(Feature self) -> char const *
const char*
OGR_F_GetStyleString(OGRFeatureH hFeat)
Fetch style string for this feature.
Set the OGR Feature Style Specification for details on the format of
this string, and ogr_featurestyle.h for services available to ... | r"""
GetStyleString(Feature self) -> char const *
const char*
OGR_F_GetStyleString(OGRFeatureH hFeat) | [
"r",
"GetStyleString",
"(",
"Feature",
"self",
")",
"-",
">",
"char",
"const",
"*",
"const",
"char",
"*",
"OGR_F_GetStyleString",
"(",
"OGRFeatureH",
"hFeat",
")"
] | def GetStyleString(self, *args):
r"""
GetStyleString(Feature self) -> char const *
const char*
OGR_F_GetStyleString(OGRFeatureH hFeat)
Fetch style string for this feature.
Set the OGR Feature Style Specification for details on the format of
this string, and ogr_... | [
"def",
"GetStyleString",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"Feature_GetStyleString",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L3928-L3951 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.StyleSetBold | (*args, **kwargs) | return _stc.StyledTextCtrl_StyleSetBold(*args, **kwargs) | StyleSetBold(self, int style, bool bold)
Set a style to be bold or not. | StyleSetBold(self, int style, bool bold) | [
"StyleSetBold",
"(",
"self",
"int",
"style",
"bool",
"bold",
")"
] | def StyleSetBold(*args, **kwargs):
"""
StyleSetBold(self, int style, bool bold)
Set a style to be bold or not.
"""
return _stc.StyledTextCtrl_StyleSetBold(*args, **kwargs) | [
"def",
"StyleSetBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StyleSetBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L2530-L2536 | |
ufal/udpipe | e51f02d2744cdfd4a29efc1320644ea04d535f0b | doc/t2t_docsys/txt2tags.py | python | ConfigMaster.get_outfile_name | (self, config={}) | return outfile | Dirname is the same for {in,out}file | Dirname is the same for {in,out}file | [
"Dirname",
"is",
"the",
"same",
"for",
"{",
"in",
"out",
"}",
"file"
] | def get_outfile_name(self, config={}):
"Dirname is the same for {in,out}file"
infile, outfile = config['sourcefile'], config['outfile']
if outfile and outfile not in (STDOUT, MODULEOUT) \
and not os.path.isabs(outfile):
outfile = os.path.join(os.path.dirname(infile), outfile)
if infile == STDIN and n... | [
"def",
"get_outfile_name",
"(",
"self",
",",
"config",
"=",
"{",
"}",
")",
":",
"infile",
",",
"outfile",
"=",
"config",
"[",
"'sourcefile'",
"]",
",",
"config",
"[",
"'outfile'",
"]",
"if",
"outfile",
"and",
"outfile",
"not",
"in",
"(",
"STDOUT",
",",... | https://github.com/ufal/udpipe/blob/e51f02d2744cdfd4a29efc1320644ea04d535f0b/doc/t2t_docsys/txt2tags.py#L2800-L2813 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/compiler.py | python | CodeGenerator.position | (self, node) | return rv | Return a human readable position for the node. | Return a human readable position for the node. | [
"Return",
"a",
"human",
"readable",
"position",
"for",
"the",
"node",
"."
] | def position(self, node):
"""Return a human readable position for the node."""
rv = 'line %d' % node.lineno
if self.name is not None:
rv += ' in ' + repr(self.name)
return rv | [
"def",
"position",
"(",
"self",
",",
"node",
")",
":",
"rv",
"=",
"'line %d'",
"%",
"node",
".",
"lineno",
"if",
"self",
".",
"name",
"is",
"not",
"None",
":",
"rv",
"+=",
"' in '",
"+",
"repr",
"(",
"self",
".",
"name",
")",
"return",
"rv"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/compiler.py#L593-L598 | |
polyworld/polyworld | eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26 | scripts/agent/agent.py | python | Agent.reset | (self) | function to reset lazily loaded data - was used for some memory
allocation optimizations. Ran into trouble with the Python GIL. Contact
Jaimie with questions. | function to reset lazily loaded data - was used for some memory
allocation optimizations. Ran into trouble with the Python GIL. Contact
Jaimie with questions. | [
"function",
"to",
"reset",
"lazily",
"loaded",
"data",
"-",
"was",
"used",
"for",
"some",
"memory",
"allocation",
"optimizations",
".",
"Ran",
"into",
"trouble",
"with",
"the",
"Python",
"GIL",
".",
"Contact",
"Jaimie",
"with",
"questions",
"."
] | def reset(self):
''' function to reset lazily loaded data - was used for some memory
allocation optimizations. Ran into trouble with the Python GIL. Contact
Jaimie with questions. '''
self._reset_complexity()
self._reset_genome()
self._reset_func()
self._reset_pos... | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"_reset_complexity",
"(",
")",
"self",
".",
"_reset_genome",
"(",
")",
"self",
".",
"_reset_func",
"(",
")",
"self",
".",
"_reset_positions",
"(",
")"
] | https://github.com/polyworld/polyworld/blob/eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26/scripts/agent/agent.py#L222-L229 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | PyDataViewCustomRenderer.Render | (*args, **kwargs) | return _dataview.PyDataViewCustomRenderer_Render(*args, **kwargs) | Render(self, Rect cell, DC dc, int state) -> bool
Override this to render the cell. Before this is called, `SetValue`
was called so that this instance knows what to render. This must be
overridden in derived classes. | Render(self, Rect cell, DC dc, int state) -> bool | [
"Render",
"(",
"self",
"Rect",
"cell",
"DC",
"dc",
"int",
"state",
")",
"-",
">",
"bool"
] | def Render(*args, **kwargs):
"""
Render(self, Rect cell, DC dc, int state) -> bool
Override this to render the cell. Before this is called, `SetValue`
was called so that this instance knows what to render. This must be
overridden in derived classes.
"""
return _... | [
"def",
"Render",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"PyDataViewCustomRenderer_Render",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1465-L1473 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/nodes.py | python | Expr.as_const | (self, eval_ctx=None) | Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible.
An :class:`EvalContext` can be provided, if none is given
a default context is created which requires the nodes to have
an attached environment.
.. versionchanged:: 2.4
... | Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible. | [
"Return",
"the",
"value",
"of",
"the",
"expression",
"as",
"constant",
"or",
"raise",
":",
"exc",
":",
"Impossible",
"if",
"this",
"was",
"not",
"possible",
"."
] | def as_const(self, eval_ctx=None):
"""Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible.
An :class:`EvalContext` can be provided, if none is given
a default context is created which requires the nodes to have
an attached environme... | [
"def",
"as_const",
"(",
"self",
",",
"eval_ctx",
"=",
"None",
")",
":",
"raise",
"Impossible",
"(",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/nodes.py#L397-L408 | ||
lzhang10/maxent | 3560c94b737d4272ed86de529e50d823200e6d8e | example/postagger/context.py | python | get_context32 | (words, pos, i, rare_word) | return context | get tag context for words[i] | get tag context for words[i] | [
"get",
"tag",
"context",
"for",
"words",
"[",
"i",
"]"
] | def get_context32(words, pos, i, rare_word):
'get tag context for words[i]'
context = []
w = words[i]
n = len(words)
if rare_word:
prefix, suffix = get_prefix_suffix2(w, 1)
for p in prefix:
context.append('prefix=' + p)
for s in suffix:
context.append(... | [
"def",
"get_context32",
"(",
"words",
",",
"pos",
",",
"i",
",",
"rare_word",
")",
":",
"context",
"=",
"[",
"]",
"w",
"=",
"words",
"[",
"i",
"]",
"n",
"=",
"len",
"(",
"words",
")",
"if",
"rare_word",
":",
"prefix",
",",
"suffix",
"=",
"get_pre... | https://github.com/lzhang10/maxent/blob/3560c94b737d4272ed86de529e50d823200e6d8e/example/postagger/context.py#L852-L890 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/sumolib/net/lane.py | python | Lane.getShape | (self, includeJunctions=False) | return self._shape | Returns the shape of the lane in 2d.
This function returns the shape of the lane, as defined in the net.xml
file. The returned shape is a list containing numerical
2-tuples representing the x,y coordinates of the shape points.
For includeJunctions=True the returned list will contain
... | Returns the shape of the lane in 2d. | [
"Returns",
"the",
"shape",
"of",
"the",
"lane",
"in",
"2d",
"."
] | def getShape(self, includeJunctions=False):
"""Returns the shape of the lane in 2d.
This function returns the shape of the lane, as defined in the net.xml
file. The returned shape is a list containing numerical
2-tuples representing the x,y coordinates of the shape points.
For ... | [
"def",
"getShape",
"(",
"self",
",",
"includeJunctions",
"=",
"False",
")",
":",
"if",
"includeJunctions",
"and",
"not",
"self",
".",
"_edge",
".",
"isSpecial",
"(",
")",
":",
"if",
"self",
".",
"_shapeWithJunctions",
"is",
"None",
":",
"self",
".",
"_sh... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/sumolib/net/lane.py#L129-L151 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/package_index.py | python | PackageIndex.add_find_links | (self, urls) | Add `urls` to the list that will be prescanned for searches | Add `urls` to the list that will be prescanned for searches | [
"Add",
"urls",
"to",
"the",
"list",
"that",
"will",
"be",
"prescanned",
"for",
"searches"
] | def add_find_links(self, urls):
"""Add `urls` to the list that will be prescanned for searches"""
for url in urls:
if (
self.to_scan is None # if we have already "gone online"
or not URL_SCHEME(url) # or it's a local file/directory
or url.sta... | [
"def",
"add_find_links",
"(",
"self",
",",
"urls",
")",
":",
"for",
"url",
"in",
"urls",
":",
"if",
"(",
"self",
".",
"to_scan",
"is",
"None",
"# if we have already \"gone online\"",
"or",
"not",
"URL_SCHEME",
"(",
"url",
")",
"# or it's a local file/directory",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/package_index.py#L529-L542 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | _SetVerboseLevel | (level) | return _cpplint_state.SetVerboseLevel(level) | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def _SetVerboseLevel(level):
"""Sets the module's verbosity, and returns the previous setting."""
return _cpplint_state.SetVerboseLevel(level) | [
"def",
"_SetVerboseLevel",
"(",
"level",
")",
":",
"return",
"_cpplint_state",
".",
"SetVerboseLevel",
"(",
"level",
")"
] | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L1194-L1196 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/nasm.py | python | apply_nasm_vars | (self) | provided for compatibility | provided for compatibility | [
"provided",
"for",
"compatibility"
] | def apply_nasm_vars(self):
"""provided for compatibility"""
self.env.append_value('ASFLAGS', self.to_list(getattr(self, 'nasm_flags', []))) | [
"def",
"apply_nasm_vars",
"(",
"self",
")",
":",
"self",
".",
"env",
".",
"append_value",
"(",
"'ASFLAGS'",
",",
"self",
".",
"to_list",
"(",
"getattr",
"(",
"self",
",",
"'nasm_flags'",
",",
"[",
"]",
")",
")",
")"
] | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/nasm.py#L14-L16 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ParticleMechanicsApplication/python_scripts/apply_mpm_particle_dirichlet_condition_process.py | python | ApplyMPMParticleDirichletConditionProcess.__init__ | (self, Model, settings ) | Set boundary_condition_type:
1. penalty
2. lagrange (WIP)
3. fixdof (WIP) | Set boundary_condition_type:
1. penalty
2. lagrange (WIP)
3. fixdof (WIP) | [
"Set",
"boundary_condition_type",
":",
"1",
".",
"penalty",
"2",
".",
"lagrange",
"(",
"WIP",
")",
"3",
".",
"fixdof",
"(",
"WIP",
")"
] | def __init__(self, Model, settings ):
KratosMultiphysics.Process.__init__(self)
default_parameters = KratosMultiphysics.Parameters( """
{
"model_part_name" : "PLEASE_SPECIFY_MODEL_PART_NAME",
"particles_per_condition" : 0,
"imposit... | [
"def",
"__init__",
"(",
"self",
",",
"Model",
",",
"settings",
")",
":",
"KratosMultiphysics",
".",
"Process",
".",
"__init__",
"(",
"self",
")",
"default_parameters",
"=",
"KratosMultiphysics",
".",
"Parameters",
"(",
"\"\"\"\n {\n \"model_p... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ParticleMechanicsApplication/python_scripts/apply_mpm_particle_dirichlet_condition_process.py#L11-L127 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel.calculate_element_volumes | (self,
element_field_name='volume',
element_block_ids='all') | Calculate and store the volume of each element.
This will approximate the element volume. Since a timestep must be
defined in order for element fields to exist, one will be created if
none exist.
For two dimensional elements, this calculates the area. For one
dimensional elem... | Calculate and store the volume of each element. | [
"Calculate",
"and",
"store",
"the",
"volume",
"of",
"each",
"element",
"."
] | def calculate_element_volumes(self,
element_field_name='volume',
element_block_ids='all'):
"""
Calculate and store the volume of each element.
This will approximate the element volume. Since a timestep must be
defined ... | [
"def",
"calculate_element_volumes",
"(",
"self",
",",
"element_field_name",
"=",
"'volume'",
",",
"element_block_ids",
"=",
"'all'",
")",
":",
"element_block_ids",
"=",
"self",
".",
"_format_element_block_id_list",
"(",
"element_block_ids",
")",
"if",
"not",
"self",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L6105-L6211 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py | python | ConfigDialog.create_widgets | (self) | Create and place widgets for tabbed dialog.
Widgets Bound to self:
note: Notebook
highpage: HighPage
fontpage: FontPage
keyspage: KeysPage
genpage: GenPage
extpage: self.create_page_extensions
Methods:
create_action_bu... | Create and place widgets for tabbed dialog. | [
"Create",
"and",
"place",
"widgets",
"for",
"tabbed",
"dialog",
"."
] | def create_widgets(self):
"""Create and place widgets for tabbed dialog.
Widgets Bound to self:
note: Notebook
highpage: HighPage
fontpage: FontPage
keyspage: KeysPage
genpage: GenPage
extpage: self.create_page_extensions
... | [
"def",
"create_widgets",
"(",
"self",
")",
":",
"self",
".",
"note",
"=",
"note",
"=",
"Notebook",
"(",
"self",
")",
"self",
".",
"highpage",
"=",
"HighPage",
"(",
"note",
")",
"self",
".",
"fontpage",
"=",
"FontPage",
"(",
"note",
",",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py#L96-L125 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py | python | PhactoriPlot1Base.ClearPvViewAndPvRepAfterWriteImage | (self) | Since it turns out to be much more memory efficient to reuse a single\n render view rather than having one per image, this routine is called\n immediately after WriteImage in order to make stuff invisible again\n before the next item gets a chance to do WriteImage | Since it turns out to be much more memory efficient to reuse a single\n render view rather than having one per image, this routine is called\n immediately after WriteImage in order to make stuff invisible again\n before the next item gets a chance to do WriteImage | [
"Since",
"it",
"turns",
"out",
"to",
"be",
"much",
"more",
"memory",
"efficient",
"to",
"reuse",
"a",
"single",
"\\",
"n",
"render",
"view",
"rather",
"than",
"having",
"one",
"per",
"image",
"this",
"routine",
"is",
"called",
"\\",
"n",
"immediately",
"... | def ClearPvViewAndPvRepAfterWriteImage(self):
"Since it turns out to be much more memory efficient to reuse a single\n render view rather than having one per image, this routine is called\n immediately after WriteImage in order to make stuff invisible again\n before the next item gets a chance to ... | [
"def",
"ClearPvViewAndPvRepAfterWriteImage",
"(",
"self",
")",
":",
"#if PhactoriDbg(150):",
"# myDebugPrint3(\"ClearPvViewAndPvRepAfterWriteImage entered\\n\", 150)",
"#3d/pointset dataset invisible (plot or 3d viewing)",
"self",
".",
"mPvDataRepresentation2",
".",
"Visibility",
"=",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py#L18748-L18754 | ||
zhaoweicai/cascade-rcnn | 2252f46158ea6555868ca6fa5c221ea71d9b5e6c | tools/extra/resize_and_crop_images.py | python | OpenCVResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256) | Takes an image name, resize it and crop the center square | Takes an image name, resize it and crop the center square | [
"Takes",
"an",
"image",
"name",
"resize",
"it",
"and",
"crop",
"the",
"center",
"square"
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256):
'''Takes an image name, resize it and crop the center square
'''
img = cv2.imread(input_file)
height, width, depth = img.shape
new_height = output_side_length
new_width = output_side_lengt... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
")",
":",
"img",
"=",
"cv2",
".",
"imread",
"(",
"input_file",
")",
"height",
",",
"width",
",",
"depth",
"=",
"img",
".",
"shape",
... | https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/tools/extra/resize_and_crop_images.py#L20-L36 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Point2D.GetDistanceSquare | (*args, **kwargs) | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | GetDistanceSquare(self, Point2D pt) -> double | GetDistanceSquare(self, Point2D pt) -> double | [
"GetDistanceSquare",
"(",
"self",
"Point2D",
"pt",
")",
"-",
">",
"double"
] | def GetDistanceSquare(*args, **kwargs):
"""GetDistanceSquare(self, Point2D pt) -> double"""
return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | [
"def",
"GetDistanceSquare",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Point2D_GetDistanceSquare",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1698-L1700 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_parser.py | python | IDLParser.p_expression_binop | (self, p) | expression : expression LSHIFT expression
| expression RSHIFT expression
| expression '|' expression
| expression '&' expression
| expression '^' expression
| expression '+' expression
| expression '-' expression... | expression : expression LSHIFT expression
| expression RSHIFT expression
| expression '|' expression
| expression '&' expression
| expression '^' expression
| expression '+' expression
| expression '-' expression... | [
"expression",
":",
"expression",
"LSHIFT",
"expression",
"|",
"expression",
"RSHIFT",
"expression",
"|",
"expression",
"|",
"expression",
"|",
"expression",
"&",
"expression",
"|",
"expression",
"^",
"expression",
"|",
"expression",
"+",
"expression",
"|",
"expres... | def p_expression_binop(self, p):
"""expression : expression LSHIFT expression
| expression RSHIFT expression
| expression '|' expression
| expression '&' expression
| expression '^' expression
| expression '+' expression
... | [
"def",
"p_expression_binop",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"\"%s %s %s\"",
"%",
"(",
"str",
"(",
"p",
"[",
"1",
"]",
")",
",",
"str",
"(",
"p",
"[",
"2",
"]",
")",
",",
"str",
"(",
"p",
"[",
"3",
"]",
")",
")",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L517-L528 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/re.py | python | search | (pattern, string, flags=0) | return _compile(pattern, flags).search(string) | Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found. | Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found. | [
"Scan",
"through",
"string",
"looking",
"for",
"a",
"match",
"to",
"the",
"pattern",
"returning",
"a",
"Match",
"object",
"or",
"None",
"if",
"no",
"match",
"was",
"found",
"."
] | def search(pattern, string, flags=0):
"""Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found."""
return _compile(pattern, flags).search(string) | [
"def",
"search",
"(",
"pattern",
",",
"string",
",",
"flags",
"=",
"0",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"flags",
")",
".",
"search",
"(",
"string",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/re.py#L182-L185 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/message.py | python | Message.ListFields | (self) | Returns a list of (FieldDescriptor, value) tuples for all
fields in the message which are not empty. A singular field is non-empty
if HasField() would return true, and a repeated field is non-empty if
it contains at least one element. The fields are ordered by field
number | Returns a list of (FieldDescriptor, value) tuples for all
fields in the message which are not empty. A singular field is non-empty
if HasField() would return true, and a repeated field is non-empty if
it contains at least one element. The fields are ordered by field
number | [
"Returns",
"a",
"list",
"of",
"(",
"FieldDescriptor",
"value",
")",
"tuples",
"for",
"all",
"fields",
"in",
"the",
"message",
"which",
"are",
"not",
"empty",
".",
"A",
"singular",
"field",
"is",
"non",
"-",
"empty",
"if",
"HasField",
"()",
"would",
"retu... | def ListFields(self):
"""Returns a list of (FieldDescriptor, value) tuples for all
fields in the message which are not empty. A singular field is non-empty
if HasField() would return true, and a repeated field is non-empty if
it contains at least one element. The fields are ordered by field
number... | [
"def",
"ListFields",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/message.py#L226-L232 | ||
slam-code/SLAM | 16d109ac7e73067b19466818549889aaf0a230fb | 0-AI_for_Robotics_cs373/ch5_PID_Control/10.py | python | robot.move | (self, steering, distance, tolerance=0.001, max_steering_angle=np.pi / 4.0) | return res | steering = front wheel steering angle, limited by max_steering_angle
distance = total distance driven, most be non-negative | steering = front wheel steering angle, limited by max_steering_angle
distance = total distance driven, most be non-negative | [
"steering",
"=",
"front",
"wheel",
"steering",
"angle",
"limited",
"by",
"max_steering_angle",
"distance",
"=",
"total",
"distance",
"driven",
"most",
"be",
"non",
"-",
"negative"
] | def move(self, steering, distance, tolerance=0.001, max_steering_angle=np.pi / 4.0):
"""
steering = front wheel steering angle, limited by max_steering_angle
distance = total distance driven, most be non-negative
"""
if steering > max_steering_angle:
steering = max_st... | [
"def",
"move",
"(",
"self",
",",
"steering",
",",
"distance",
",",
"tolerance",
"=",
"0.001",
",",
"max_steering_angle",
"=",
"np",
".",
"pi",
"/",
"4.0",
")",
":",
"if",
"steering",
">",
"max_steering_angle",
":",
"steering",
"=",
"max_steering_angle",
"i... | https://github.com/slam-code/SLAM/blob/16d109ac7e73067b19466818549889aaf0a230fb/0-AI_for_Robotics_cs373/ch5_PID_Control/10.py#L69-L112 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | TranslationUnit.from_source | (cls, filename, args=None, unsaved_files=None, options=0,
index=None) | return cls(ptr, index=index) | Create a TranslationUnit by parsing source.
This is capable of processing source code both from files on the
filesystem as well as in-memory contents.
Command-line arguments that would be passed to clang are specified as
a list via args. These can be used to specify include paths, warn... | Create a TranslationUnit by parsing source. | [
"Create",
"a",
"TranslationUnit",
"by",
"parsing",
"source",
"."
] | def from_source(cls, filename, args=None, unsaved_files=None, options=0,
index=None):
"""Create a TranslationUnit by parsing source.
This is capable of processing source code both from files on the
filesystem as well as in-memory contents.
Command-line arguments tha... | [
"def",
"from_source",
"(",
"cls",
",",
"filename",
",",
"args",
"=",
"None",
",",
"unsaved_files",
"=",
"None",
",",
"options",
"=",
"0",
",",
"index",
"=",
"None",
")",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"[",
"]",
"if",
"unsaved_fi... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L2155-L2227 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/bindings/python/clang/cindex.py | python | TranslationUnit.from_source | (cls, filename, args=None, unsaved_files=None, options=0,
index=None) | return cls(ptr, index=index) | Create a TranslationUnit by parsing source.
This is capable of processing source code both from files on the
filesystem as well as in-memory contents.
Command-line arguments that would be passed to clang are specified as
a list via args. These can be used to specify include paths, warn... | Create a TranslationUnit by parsing source. | [
"Create",
"a",
"TranslationUnit",
"by",
"parsing",
"source",
"."
] | def from_source(cls, filename, args=None, unsaved_files=None, options=0,
index=None):
"""Create a TranslationUnit by parsing source.
This is capable of processing source code both from files on the
filesystem as well as in-memory contents.
Command-line arguments tha... | [
"def",
"from_source",
"(",
"cls",
",",
"filename",
",",
"args",
"=",
"None",
",",
"unsaved_files",
"=",
"None",
",",
"options",
"=",
"0",
",",
"index",
"=",
"None",
")",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"[",
"]",
"if",
"unsaved_fi... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L2765-L2839 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/async_helpers.py | python | _curio_runner | (coroutine) | return curio.run(coroutine) | handler for curio autoawait | handler for curio autoawait | [
"handler",
"for",
"curio",
"autoawait"
] | def _curio_runner(coroutine):
"""
handler for curio autoawait
"""
import curio
return curio.run(coroutine) | [
"def",
"_curio_runner",
"(",
"coroutine",
")",
":",
"import",
"curio",
"return",
"curio",
".",
"run",
"(",
"coroutine",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/async_helpers.py#L46-L52 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py | python | FitFunctionOptionsView.set_current_dataset_index | (self, dataset_index: int) | Sets the index of the current dataset. | Sets the index of the current dataset. | [
"Sets",
"the",
"index",
"of",
"the",
"current",
"dataset",
"."
] | def set_current_dataset_index(self, dataset_index: int) -> None:
"""Sets the index of the current dataset."""
self.function_browser.setCurrentDataset(dataset_index) | [
"def",
"set_current_dataset_index",
"(",
"self",
",",
"dataset_index",
":",
"int",
")",
"->",
"None",
":",
"self",
".",
"function_browser",
".",
"setCurrentDataset",
"(",
"dataset_index",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py#L171-L173 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/bindings/python/clang/cindex.py | python | BaseEnumeration.name | (self) | return self._name_map[self] | Get the enumeration name of this cursor kind. | Get the enumeration name of this cursor kind. | [
"Get",
"the",
"enumeration",
"name",
"of",
"this",
"cursor",
"kind",
"."
] | def name(self):
"""Get the enumeration name of this cursor kind."""
if self._name_map is None:
self._name_map = {}
for key, value in self.__class__.__dict__.items():
if isinstance(value, self.__class__):
self._name_map[value] = key
retu... | [
"def",
"name",
"(",
"self",
")",
":",
"if",
"self",
".",
"_name_map",
"is",
"None",
":",
"self",
".",
"_name_map",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"self",
".",
"__class__",
".",
"__dict__",
".",
"items",
"(",
")",
":",
"if",
"isi... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L638-L645 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/constraint_solver/samples/cvrptw_break.py | python | create_time_evaluator | (data) | return time_evaluator | Creates callback to get total times between locations. | Creates callback to get total times between locations. | [
"Creates",
"callback",
"to",
"get",
"total",
"times",
"between",
"locations",
"."
] | def create_time_evaluator(data):
"""Creates callback to get total times between locations."""
def service_time(data, node):
"""Gets the service time for the specified location."""
return data['demands'][node] * data['time_per_demand_unit']
def travel_time(data, from_node, to_node):
... | [
"def",
"create_time_evaluator",
"(",
"data",
")",
":",
"def",
"service_time",
"(",
"data",
",",
"node",
")",
":",
"\"\"\"Gets the service time for the specified location.\"\"\"",
"return",
"data",
"[",
"'demands'",
"]",
"[",
"node",
"]",
"*",
"data",
"[",
"'time_p... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/cvrptw_break.py#L132-L166 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/tensorboard/backend/handler.py | python | TensorboardHandler._send_gzip_response | (self, content, content_type, code=200) | Writes the given content as gzip response using the given content type.
If the HTTP client does not accept gzip encoding, then the response will be
sent uncompressed.
Args:
content: The content to respond with.
content_type: The mime type of the content.
code: The numeric HTTP status cod... | Writes the given content as gzip response using the given content type. | [
"Writes",
"the",
"given",
"content",
"as",
"gzip",
"response",
"using",
"the",
"given",
"content",
"type",
"."
] | def _send_gzip_response(self, content, content_type, code=200):
"""Writes the given content as gzip response using the given content type.
If the HTTP client does not accept gzip encoding, then the response will be
sent uncompressed.
Args:
content: The content to respond with.
content_type... | [
"def",
"_send_gzip_response",
"(",
"self",
",",
"content",
",",
"content_type",
",",
"code",
"=",
"200",
")",
":",
"encoding",
"=",
"None",
"if",
"self",
".",
"_is_gzip_accepted",
"(",
")",
":",
"out",
"=",
"BytesIO",
"(",
")",
"f",
"=",
"gzip",
".",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/tensorboard/backend/handler.py#L204-L223 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/games/tic_tac_toe.py | python | TicTacToeGame.make_py_observer | (self, iig_obs_type=None, params=None) | Returns an object used for observing game state. | Returns an object used for observing game state. | [
"Returns",
"an",
"object",
"used",
"for",
"observing",
"game",
"state",
"."
] | def make_py_observer(self, iig_obs_type=None, params=None):
"""Returns an object used for observing game state."""
if ((iig_obs_type is None) or
(iig_obs_type.public_info and not iig_obs_type.perfect_recall)):
return BoardObserver(params)
else:
return IIGObserverForPublicInfoGame(iig_obs... | [
"def",
"make_py_observer",
"(",
"self",
",",
"iig_obs_type",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"(",
"(",
"iig_obs_type",
"is",
"None",
")",
"or",
"(",
"iig_obs_type",
".",
"public_info",
"and",
"not",
"iig_obs_type",
".",
"perfect_re... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/games/tic_tac_toe.py#L74-L80 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/tensor_forest/client/random_forest.py | python | TensorForestEstimator.__init__ | (self,
params,
device_assigner=None,
model_dir=None,
graph_builder_class=tensor_forest.RandomForestGraphs,
config=None,
weights_name=None,
keys_name=None,
feature_engineering_fn=None,
e... | Initializes a TensorForestEstimator instance.
Args:
params: ForestHParams object that holds random forest hyperparameters.
These parameters will be passed into `model_fn`.
device_assigner: An `object` instance that controls how trees get
assigned to devices. If `None`, will use
... | Initializes a TensorForestEstimator instance. | [
"Initializes",
"a",
"TensorForestEstimator",
"instance",
"."
] | def __init__(self,
params,
device_assigner=None,
model_dir=None,
graph_builder_class=tensor_forest.RandomForestGraphs,
config=None,
weights_name=None,
keys_name=None,
feature_engineering_fn=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"params",
",",
"device_assigner",
"=",
"None",
",",
"model_dir",
"=",
"None",
",",
"graph_builder_class",
"=",
"tensor_forest",
".",
"RandomForestGraphs",
",",
"config",
"=",
"None",
",",
"weights_name",
"=",
"None",
",",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tensor_forest/client/random_forest.py#L290-L378 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tools/saved_model_cli.py | python | _show_inputs_outputs | (saved_model_dir, tag_set, signature_def_key, indent=0) | Prints input and output TensorInfos.
Prints the details of input and output TensorInfos for the SignatureDef mapped
by the given signature_def_key.
Args:
saved_model_dir: Directory containing the SavedModel to inspect.
tag_set: Group of tag(s) of the MetaGraphDef, in string format, separated by
... | Prints input and output TensorInfos. | [
"Prints",
"input",
"and",
"output",
"TensorInfos",
"."
] | def _show_inputs_outputs(saved_model_dir, tag_set, signature_def_key, indent=0):
"""Prints input and output TensorInfos.
Prints the details of input and output TensorInfos for the SignatureDef mapped
by the given signature_def_key.
Args:
saved_model_dir: Directory containing the SavedModel to inspect.
... | [
"def",
"_show_inputs_outputs",
"(",
"saved_model_dir",
",",
"tag_set",
",",
"signature_def_key",
",",
"indent",
"=",
"0",
")",
":",
"meta_graph_def",
"=",
"saved_model_utils",
".",
"get_meta_graph_def",
"(",
"saved_model_dir",
",",
"tag_set",
")",
"inputs_tensor_info"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tools/saved_model_cli.py#L138-L174 | ||
arkenthera/electron-vibrancy | 383153ef9ccb23a6c7517150d6bb0794dff3115e | scripts/cpplint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L696-L719 | ||
intel-iot-devkit/how-to-code-samples | b4ea616f36bbfa2e042beb1698f968cfd651d79f | watering-system/python/iot_watering_system/hardware/board.py | python | Board.update_hardware_state | (self) | Abstract method for updating hardware state. | Abstract method for updating hardware state. | [
"Abstract",
"method",
"for",
"updating",
"hardware",
"state",
"."
] | def update_hardware_state(self):
"""
Abstract method for updating hardware state.
"""
pass | [
"def",
"update_hardware_state",
"(",
"self",
")",
":",
"pass"
] | https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/watering-system/python/iot_watering_system/hardware/board.py#L95-L101 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/packages/six.py | python | _add_doc | (func, doc) | Add documentation to a function. | Add documentation to a function. | [
"Add",
"documentation",
"to",
"a",
"function",
"."
] | def _add_doc(func, doc):
"""Add documentation to a function."""
func.__doc__ = doc | [
"def",
"_add_doc",
"(",
"func",
",",
"doc",
")",
":",
"func",
".",
"__doc__",
"=",
"doc"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/packages/six.py#L75-L77 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py | python | blend | (im1, im2, alpha) | return im1._new(core.blend(im1.im, im2.im, alpha)) | Creates a new image by interpolating between two input images, using
a constant alpha.::
out = image1 * (1.0 - alpha) + image2 * alpha
:param im1: The first image.
:param im2: The second image. Must have the same mode and size as
the first image.
:param alpha: The interpolation alpha f... | Creates a new image by interpolating between two input images, using
a constant alpha.:: | [
"Creates",
"a",
"new",
"image",
"by",
"interpolating",
"between",
"two",
"input",
"images",
"using",
"a",
"constant",
"alpha",
".",
"::"
] | def blend(im1, im2, alpha):
"""
Creates a new image by interpolating between two input images, using
a constant alpha.::
out = image1 * (1.0 - alpha) + image2 * alpha
:param im1: The first image.
:param im2: The second image. Must have the same mode and size as
the first image.
... | [
"def",
"blend",
"(",
"im1",
",",
"im2",
",",
"alpha",
")",
":",
"im1",
".",
"load",
"(",
")",
"im2",
".",
"load",
"(",
")",
"return",
"im1",
".",
"_new",
"(",
"core",
".",
"blend",
"(",
"im1",
".",
"im",
",",
"im2",
".",
"im",
",",
"alpha",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L2919-L2939 | |
google/clif | cab24d6a105609a65c95a36a1712ae3c20c7b5df | clif/pybind11/variables.py | python | _generate_pointer_attr_property | (
class_name: str, var_decl: ast_pb2.VarDecl, class_decl: ast_pb2.ClassDecl
) | Generates property with customized getter and setter to handle pointers. | Generates property with customized getter and setter to handle pointers. | [
"Generates",
"property",
"with",
"customized",
"getter",
"and",
"setter",
"to",
"handle",
"pointers",
"."
] | def _generate_pointer_attr_property(
class_name: str, var_decl: ast_pb2.VarDecl, class_decl: ast_pb2.ClassDecl
) -> Generator[str, None, None]:
"""Generates property with customized getter and setter to handle pointers."""
fget = (f'[]({class_decl.name.cpp_name} &self){{ '
f'return *self.{var_decl.nam... | [
"def",
"_generate_pointer_attr_property",
"(",
"class_name",
":",
"str",
",",
"var_decl",
":",
"ast_pb2",
".",
"VarDecl",
",",
"class_decl",
":",
"ast_pb2",
".",
"ClassDecl",
")",
"->",
"Generator",
"[",
"str",
",",
"None",
",",
"None",
"]",
":",
"fget",
"... | https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/pybind11/variables.py#L47-L60 | ||
mandliya/algorithms_and_data_structures | 60f95dae236d13bd17f20df63268b524a776c8e1 | tree_problems/level_order_tree_traversal_iterative.py | python | Tree.in_order | (self) | In order traversal of the tree | In order traversal of the tree | [
"In",
"order",
"traversal",
"of",
"the",
"tree"
] | def in_order(self):
"""In order traversal of the tree"""
current = self.root
stack = []
done = False
while not done:
if current is not None:
stack.append(current)
current = current.left
elif stack:
current =... | [
"def",
"in_order",
"(",
"self",
")",
":",
"current",
"=",
"self",
".",
"root",
"stack",
"=",
"[",
"]",
"done",
"=",
"False",
"while",
"not",
"done",
":",
"if",
"current",
"is",
"not",
"None",
":",
"stack",
".",
"append",
"(",
"current",
")",
"curre... | https://github.com/mandliya/algorithms_and_data_structures/blob/60f95dae236d13bd17f20df63268b524a776c8e1/tree_problems/level_order_tree_traversal_iterative.py#L15-L31 | ||
citizenfx/fivem | 88276d40cc7baf8285d02754cc5ae42ec7a8563f | vendor/chromium/mojo/public/tools/bindings/mojom_bindings_generator.py | python | FindImportFile | (rel_dir, file_name, search_rel_dirs) | return RelativePath(os.path.join(rel_dir.path, file_name),
rel_dir.source_root) | Finds |file_name| in either |rel_dir| or |search_rel_dirs|. Returns a
RelativePath with first file found, or an arbitrary non-existent file
otherwise. | Finds |file_name| in either |rel_dir| or |search_rel_dirs|. Returns a
RelativePath with first file found, or an arbitrary non-existent file
otherwise. | [
"Finds",
"|file_name|",
"in",
"either",
"|rel_dir|",
"or",
"|search_rel_dirs|",
".",
"Returns",
"a",
"RelativePath",
"with",
"first",
"file",
"found",
"or",
"an",
"arbitrary",
"non",
"-",
"existent",
"file",
"otherwise",
"."
] | def FindImportFile(rel_dir, file_name, search_rel_dirs):
"""Finds |file_name| in either |rel_dir| or |search_rel_dirs|. Returns a
RelativePath with first file found, or an arbitrary non-existent file
otherwise."""
for rel_search_dir in [rel_dir] + search_rel_dirs:
path = os.path.join(rel_search_dir.path, fi... | [
"def",
"FindImportFile",
"(",
"rel_dir",
",",
"file_name",
",",
"search_rel_dirs",
")",
":",
"for",
"rel_search_dir",
"in",
"[",
"rel_dir",
"]",
"+",
"search_rel_dirs",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"rel_search_dir",
".",
"path",
"... | https://github.com/citizenfx/fivem/blob/88276d40cc7baf8285d02754cc5ae42ec7a8563f/vendor/chromium/mojo/public/tools/bindings/mojom_bindings_generator.py#L103-L112 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ScrollBar.GetThumbSize | (*args, **kwargs) | return _controls_.ScrollBar_GetThumbSize(*args, **kwargs) | GetThumbSize(self) -> int | GetThumbSize(self) -> int | [
"GetThumbSize",
"(",
"self",
")",
"-",
">",
"int"
] | def GetThumbSize(*args, **kwargs):
"""GetThumbSize(self) -> int"""
return _controls_.ScrollBar_GetThumbSize(*args, **kwargs) | [
"def",
"GetThumbSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ScrollBar_GetThumbSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2167-L2169 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/wizard.py | python | Wizard.Create | (*args, **kwargs) | return _wizard.Wizard_Create(*args, **kwargs) | Create(self, Window parent, int id=-1, String title=EmptyString,
Bitmap bitmap=wxNullBitmap, Point pos=DefaultPosition) -> bool | Create(self, Window parent, int id=-1, String title=EmptyString,
Bitmap bitmap=wxNullBitmap, Point pos=DefaultPosition) -> bool | [
"Create",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"String",
"title",
"=",
"EmptyString",
"Bitmap",
"bitmap",
"=",
"wxNullBitmap",
"Point",
"pos",
"=",
"DefaultPosition",
")",
"-",
">",
"bool"
] | def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String title=EmptyString,
Bitmap bitmap=wxNullBitmap, Point pos=DefaultPosition) -> bool
"""
return _wizard.Wizard_Create(*args, **kwargs) | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"Wizard_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/wizard.py#L363-L368 | |
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/bg2/CharGenCommon.py | python | NextPress | () | return | Moves to the next step. | Moves to the next step. | [
"Moves",
"to",
"the",
"next",
"step",
"."
] | def NextPress():
"""Moves to the next step."""
step = GemRB.GetVar ("Step")
if step == 1:
CharGenWindow.GetControl(15).SetDisabled(True)
GemRB.SetNextScript ("GUICG1")
elif step == 2:
GemRB.SetNextScript ("GUICG8")
elif step == 6:
GemRB.SetNextScript ("GUICG15")
elif step == 7:
GemRB.SetNextScript ("GU... | [
"def",
"NextPress",
"(",
")",
":",
"step",
"=",
"GemRB",
".",
"GetVar",
"(",
"\"Step\"",
")",
"if",
"step",
"==",
"1",
":",
"CharGenWindow",
".",
"GetControl",
"(",
"15",
")",
".",
"SetDisabled",
"(",
"True",
")",
"GemRB",
".",
"SetNextScript",
"(",
... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/bg2/CharGenCommon.py#L343-L362 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/dashboard/services/cephfs.py | python | CephFS.ls_snapshots | (self, path) | return result | List snapshots for the specified path.
:param path: The path of the directory.
:type path: str
:return: A list of dictionaries containing the name and the
creation time of the snapshot.
:rtype: list | List snapshots for the specified path.
:param path: The path of the directory.
:type path: str
:return: A list of dictionaries containing the name and the
creation time of the snapshot.
:rtype: list | [
"List",
"snapshots",
"for",
"the",
"specified",
"path",
".",
":",
"param",
"path",
":",
"The",
"path",
"of",
"the",
"directory",
".",
":",
"type",
"path",
":",
"str",
":",
"return",
":",
"A",
"list",
"of",
"dictionaries",
"containing",
"the",
"name",
"... | def ls_snapshots(self, path):
"""
List snapshots for the specified path.
:param path: The path of the directory.
:type path: str
:return: A list of dictionaries containing the name and the
creation time of the snapshot.
:rtype: list
"""
result = ... | [
"def",
"ls_snapshots",
"(",
"self",
",",
"path",
")",
":",
"result",
"=",
"[",
"]",
"client_snapdir",
"=",
"self",
".",
"cfs",
".",
"conf_get",
"(",
"'client_snapdir'",
")",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"client_snapdir... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/services/cephfs.py#L188-L213 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/affine/unary_operators.py | python | NegExpression.is_incr | (self, idx) | return False | Is the composition non-decreasing in argument idx? | Is the composition non-decreasing in argument idx? | [
"Is",
"the",
"composition",
"non",
"-",
"decreasing",
"in",
"argument",
"idx?"
] | def is_incr(self, idx) -> bool:
"""Is the composition non-decreasing in argument idx?
"""
return False | [
"def",
"is_incr",
"(",
"self",
",",
"idx",
")",
"->",
"bool",
":",
"return",
"False"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/unary_operators.py#L57-L60 | |
BSVino/DoubleAction | c550b168a3e919926c198c30240f506538b92e75 | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__eq__ | (self, other) | return other == self._values | Compares the current instance with another one. | Compares the current instance with another one. | [
"Compares",
"the",
"current",
"instance",
"with",
"another",
"one",
"."
] | def __eq__(self, other):
"""Compares the current instance with another one."""
if self is other:
return True
# Special case for the same type which should be common and fast.
if isinstance(other, self.__class__):
return other._values == self._values
# We are presumably comparing against ... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
"is",
"other",
":",
"return",
"True",
"# Special case for the same type which should be common and fast.",
"if",
"isinstance",
"(",
"other",
",",
"self",
".",
"__class__",
")",
":",
"return",
"o... | https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py#L165-L173 | |
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | TranslationUnit.codeComplete | (self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False) | return None | Code complete in this translation unit.
In-memory contents for files can be provided by passing a list of pairs
as unsaved_files, the first items should be the filenames to be mapped
and the second should be the contents to be substituted for the
file. The contents may be passed as stri... | Code complete in this translation unit. | [
"Code",
"complete",
"in",
"this",
"translation",
"unit",
"."
] | def codeComplete(self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False):
"""
Code complete in this translation unit.
In-memory contents for files can be provided by passing a list o... | [
"def",
"codeComplete",
"(",
"self",
",",
"path",
",",
"line",
",",
"column",
",",
"unsaved_files",
"=",
"None",
",",
"include_macros",
"=",
"False",
",",
"include_code_patterns",
"=",
"False",
",",
"include_brief_comments",
"=",
"False",
")",
":",
"options",
... | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L2737-L2780 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Decimal.__str__ | (self, eng=False, context=None) | return sign + intpart + fracpart + exp | Return string representation of the number in scientific notation.
Captures all of the information in the underlying representation. | Return string representation of the number in scientific notation. | [
"Return",
"string",
"representation",
"of",
"the",
"number",
"in",
"scientific",
"notation",
"."
] | def __str__(self, eng=False, context=None):
"""Return string representation of the number in scientific notation.
Captures all of the information in the underlying representation.
"""
sign = ['', '-'][self._sign]
if self._is_special:
if self._exp == 'F':
... | [
"def",
"__str__",
"(",
"self",
",",
"eng",
"=",
"False",
",",
"context",
"=",
"None",
")",
":",
"sign",
"=",
"[",
"''",
",",
"'-'",
"]",
"[",
"self",
".",
"_sign",
"]",
"if",
"self",
".",
"_is_special",
":",
"if",
"self",
".",
"_exp",
"==",
"'F... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L1031-L1081 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/simpla/_utils.py | python | GapController.step | (self, s=0) | return self._duration > 0 | Perform one control step and count down the activity period for the controller | Perform one control step and count down the activity period for the controller | [
"Perform",
"one",
"control",
"step",
"and",
"count",
"down",
"the",
"activity",
"period",
"for",
"the",
"controller"
] | def step(self, s=0):
'''
Perform one control step and count down the activity period for the controller
'''
self._applyControl()
self._duration -= self._TS
if DEBUG_GAP_CONTROL:
print("Step of gap controller with listenerID=%s" % self.getID())
pr... | [
"def",
"step",
"(",
"self",
",",
"s",
"=",
"0",
")",
":",
"self",
".",
"_applyControl",
"(",
")",
"self",
".",
"_duration",
"-=",
"self",
".",
"_TS",
"if",
"DEBUG_GAP_CONTROL",
":",
"print",
"(",
"\"Step of gap controller with listenerID=%s\"",
"%",
"self",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/simpla/_utils.py#L79-L91 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Spinbox.scan_dragto | (self, x) | return self.scan("dragto", x) | Compute the difference between the given x argument
and the x argument to the last scan mark command
It then adjusts the view left or right by 10 times the
difference in x-coordinates. This command is typically
associated with mouse motion events in the widget, to
produce the ef... | Compute the difference between the given x argument
and the x argument to the last scan mark command | [
"Compute",
"the",
"difference",
"between",
"the",
"given",
"x",
"argument",
"and",
"the",
"x",
"argument",
"to",
"the",
"last",
"scan",
"mark",
"command"
] | def scan_dragto(self, x):
"""Compute the difference between the given x argument
and the x argument to the last scan mark command
It then adjusts the view left or right by 10 times the
difference in x-coordinates. This command is typically
associated with mouse motion events in ... | [
"def",
"scan_dragto",
"(",
"self",
",",
"x",
")",
":",
"return",
"self",
".",
"scan",
"(",
"\"dragto\"",
",",
"x",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3480-L3490 | |
abseil/abseil-cpp | 73316fc3c565e5998983b0fb502d938ccddcded2 | absl/abseil.podspec.gen.py | python | relevant_rule | (rule) | return (
# cc_library only (ignore cc_test, cc_binary)
rule.type == "cc_library" and
# ignore empty rule
(rule.hdrs + rule.textual_hdrs + rule.srcs) and
# ignore test-only rule
not rule.testonly) | Returns true if a given rule is relevant when generating a podspec. | Returns true if a given rule is relevant when generating a podspec. | [
"Returns",
"true",
"if",
"a",
"given",
"rule",
"is",
"relevant",
"when",
"generating",
"a",
"podspec",
"."
] | def relevant_rule(rule):
"""Returns true if a given rule is relevant when generating a podspec."""
return (
# cc_library only (ignore cc_test, cc_binary)
rule.type == "cc_library" and
# ignore empty rule
(rule.hdrs + rule.textual_hdrs + rule.srcs) and
# ignore test-only rule
not ... | [
"def",
"relevant_rule",
"(",
"rule",
")",
":",
"return",
"(",
"# cc_library only (ignore cc_test, cc_binary)",
"rule",
".",
"type",
"==",
"\"cc_library\"",
"and",
"# ignore empty rule",
"(",
"rule",
".",
"hdrs",
"+",
"rule",
".",
"textual_hdrs",
"+",
"rule",
".",
... | https://github.com/abseil/abseil-cpp/blob/73316fc3c565e5998983b0fb502d938ccddcded2/absl/abseil.podspec.gen.py#L111-L119 | |
mozilla/DeepSpeech | aa1d28530d531d0d92289bf5f11a49fe516fdc86 | native_client/python/__init__.py | python | Model.enableExternalScorer | (self, scorer_path) | Enable decoding using an external scorer.
:param scorer_path: The path to the external scorer file.
:type scorer_path: str
:throws: RuntimeError on error | Enable decoding using an external scorer. | [
"Enable",
"decoding",
"using",
"an",
"external",
"scorer",
"."
] | def enableExternalScorer(self, scorer_path):
"""
Enable decoding using an external scorer.
:param scorer_path: The path to the external scorer file.
:type scorer_path: str
:throws: RuntimeError on error
"""
status = deepspeech.impl.EnableExternalScorer(self._imp... | [
"def",
"enableExternalScorer",
"(",
"self",
",",
"scorer_path",
")",
":",
"status",
"=",
"deepspeech",
".",
"impl",
".",
"EnableExternalScorer",
"(",
"self",
".",
"_impl",
",",
"scorer_path",
")",
"if",
"status",
"!=",
"0",
":",
"raise",
"RuntimeError",
"(",... | https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/native_client/python/__init__.py#L77-L88 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/storage.py | python | TypedStorage.bfloat16 | (self) | return self._to(torch.bfloat16) | Casts this storage to bfloat16 type | Casts this storage to bfloat16 type | [
"Casts",
"this",
"storage",
"to",
"bfloat16",
"type"
] | def bfloat16(self):
"""Casts this storage to bfloat16 type"""
return self._to(torch.bfloat16) | [
"def",
"bfloat16",
"(",
"self",
")",
":",
"return",
"self",
".",
"_to",
"(",
"torch",
".",
"bfloat16",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/storage.py#L583-L585 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py | python | TransformedDistribution.log_det_jacobian | (self) | return self._log_det_jacobian | Function computing the log determinant of the Jacobian of transform. | Function computing the log determinant of the Jacobian of transform. | [
"Function",
"computing",
"the",
"log",
"determinant",
"of",
"the",
"Jacobian",
"of",
"transform",
"."
] | def log_det_jacobian(self):
"""Function computing the log determinant of the Jacobian of transform."""
return self._log_det_jacobian | [
"def",
"log_det_jacobian",
"(",
"self",
")",
":",
"return",
"self",
".",
"_log_det_jacobian"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py#L169-L171 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/python/digital/psk_constellations.py | python | psk_4_0x2_1_0 | () | return constellation_map_generator(psk_4()[0], psk_4()[1], k, pi) | | 11 | 01
| -------
| 10 | 00 | | 11 | 01
| -------
| 10 | 00 | [
"|",
"11",
"|",
"01",
"|",
"-------",
"|",
"10",
"|",
"00"
] | def psk_4_0x2_1_0():
'''
| 11 | 01
| -------
| 10 | 00
'''
k = 0x2
pi = [1, 0]
return constellation_map_generator(psk_4()[0], psk_4()[1], k, pi) | [
"def",
"psk_4_0x2_1_0",
"(",
")",
":",
"k",
"=",
"0x2",
"pi",
"=",
"[",
"1",
",",
"0",
"]",
"return",
"constellation_map_generator",
"(",
"psk_4",
"(",
")",
"[",
"0",
"]",
",",
"psk_4",
"(",
")",
"[",
"1",
"]",
",",
"k",
",",
"pi",
")"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/psk_constellations.py#L200-L208 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils/grid.py | python | GraphicRenderer.set_range | (self, start, end) | ! Set Range
@param self this object
@param start start
@param end end
@return none | ! Set Range | [
"!",
"Set",
"Range"
] | def set_range(self, start, end):
"""! Set Range
@param self this object
@param start start
@param end end
@return none
"""
s = min(start, end)
e = max(start, end)
start = max(self.__start, s)
end = min(self.__end, e)
self.__r_start... | [
"def",
"set_range",
"(",
"self",
",",
"start",
",",
"end",
")",
":",
"s",
"=",
"min",
"(",
"start",
",",
"end",
")",
"e",
"=",
"max",
"(",
"start",
",",
"end",
")",
"start",
"=",
"max",
"(",
"self",
".",
"__start",
",",
"s",
")",
"end",
"=",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L1070-L1085 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/ops/dataset_ops.py | python | PrefetchDataset.__init__ | (self, input_dataset, buffer_size, slack_period=None) | See `Dataset.prefetch()` for details.
Args:
input_dataset: The input dataset.
buffer_size: See `Dataset.prefetch()` for details.
slack_period: (Optional.) An integer. If non-zero, determines the number
of GetNext calls before injecting slack into the execution. This may
reduce CPU... | See `Dataset.prefetch()` for details. | [
"See",
"Dataset",
".",
"prefetch",
"()",
"for",
"details",
"."
] | def __init__(self, input_dataset, buffer_size, slack_period=None):
"""See `Dataset.prefetch()` for details.
Args:
input_dataset: The input dataset.
buffer_size: See `Dataset.prefetch()` for details.
slack_period: (Optional.) An integer. If non-zero, determines the number
of GetNext ca... | [
"def",
"__init__",
"(",
"self",
",",
"input_dataset",
",",
"buffer_size",
",",
"slack_period",
"=",
"None",
")",
":",
"self",
".",
"_input_dataset",
"=",
"input_dataset",
"if",
"buffer_size",
"is",
"None",
":",
"buffer_size",
"=",
"-",
"1",
"# This is the sent... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/ops/dataset_ops.py#L3643-L3666 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/dis.py | python | _test | () | Simple test program to disassemble a file. | Simple test program to disassemble a file. | [
"Simple",
"test",
"program",
"to",
"disassemble",
"a",
"file",
"."
] | def _test():
"""Simple test program to disassemble a file."""
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('infile', type=argparse.FileType(), nargs='?', default='-')
args = parser.parse_args()
with args.infile as infile:
source = infile.read()
code = compi... | [
"def",
"_test",
"(",
")",
":",
"import",
"argparse",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'infile'",
",",
"type",
"=",
"argparse",
".",
"FileType",
"(",
")",
",",
"nargs",
"=",
"'?'",
",",
"de... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/dis.py#L522-L532 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/python/ops/stats_accumulator_ops.py | python | StatsAccumulatorSaveable.deserialize | (self, stamp_token, num_updates, partition_ids, feature_ids,
gradients, hessians) | Resets the stats accumulator with the serialized state. | Resets the stats accumulator with the serialized state. | [
"Resets",
"the",
"stats",
"accumulator",
"with",
"the",
"serialized",
"state",
"."
] | def deserialize(self, stamp_token, num_updates, partition_ids, feature_ids,
gradients, hessians):
"""Resets the stats accumulator with the serialized state."""
if self._is_scalar:
return gen_stats_accumulator_ops.stats_accumulator_scalar_deserialize(
self._resource_handle, stam... | [
"def",
"deserialize",
"(",
"self",
",",
"stamp_token",
",",
"num_updates",
",",
"partition_ids",
",",
"feature_ids",
",",
"gradients",
",",
"hessians",
")",
":",
"if",
"self",
".",
"_is_scalar",
":",
"return",
"gen_stats_accumulator_ops",
".",
"stats_accumulator_s... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/python/ops/stats_accumulator_ops.py#L71-L81 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/_parseaddr.py | python | AddrlistClass.gotonext | (self) | Parse up to the start of the next address. | Parse up to the start of the next address. | [
"Parse",
"up",
"to",
"the",
"start",
"of",
"the",
"next",
"address",
"."
] | def gotonext(self):
"""Parse up to the start of the next address."""
while self.pos < len(self.field):
if self.field[self.pos] in self.LWS + '\n\r':
self.pos += 1
elif self.field[self.pos] == '(':
self.commentlist.append(self.getcomment())
... | [
"def",
"gotonext",
"(",
"self",
")",
":",
"while",
"self",
".",
"pos",
"<",
"len",
"(",
"self",
".",
"field",
")",
":",
"if",
"self",
".",
"field",
"[",
"self",
".",
"pos",
"]",
"in",
"self",
".",
"LWS",
"+",
"'\\n\\r'",
":",
"self",
".",
"pos"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/_parseaddr.py#L201-L209 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/nn_impl.py | python | _count_nonzero | (input_tensor, dtype=dtypes.int64) | Same as math_ops.count_nonzero.
The reduction is done in dtype, which can be faster for 32-bit dtypes.
Args:
input_tensor: numeric tensor
dtype: reduction dtype
Returns:
number of nonzero values with type dtype | Same as math_ops.count_nonzero. | [
"Same",
"as",
"math_ops",
".",
"count_nonzero",
"."
] | def _count_nonzero(input_tensor, dtype=dtypes.int64):
"""Same as math_ops.count_nonzero.
The reduction is done in dtype, which can be faster for 32-bit dtypes.
Args:
input_tensor: numeric tensor
dtype: reduction dtype
Returns:
number of nonzero values with type dtype
"""
with ops.name_s... | [
"def",
"_count_nonzero",
"(",
"input_tensor",
",",
"dtype",
"=",
"dtypes",
".",
"int64",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"\"count_nonzero\"",
",",
"values",
"=",
"[",
"input_tensor",
"]",
")",
":",
"zero",
"=",
"array_ops",
".",
"zeros",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_impl.py#L703-L721 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosmaster/src/rosmaster/registrations.py | python | RegistrationManager.register_param_subscriber | (self, param, caller_id, caller_api) | Register param subscriber
@return: None | Register param subscriber | [
"Register",
"param",
"subscriber"
] | def register_param_subscriber(self, param, caller_id, caller_api):
"""
Register param subscriber
@return: None
"""
self._register(self.param_subscribers, param, caller_id, caller_api) | [
"def",
"register_param_subscriber",
"(",
"self",
",",
"param",
",",
"caller_id",
",",
"caller_api",
")",
":",
"self",
".",
"_register",
"(",
"self",
".",
"param_subscribers",
",",
"param",
",",
"caller_id",
",",
"caller_api",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosmaster/src/rosmaster/registrations.py#L430-L435 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/vesuvio/commands.py | python | _create_intensity_constraint_str | (intensity_constraints) | return intensity_constraints_str | Create a string suitable for the algorithms out of the intensity constraint flags
:param intensity_constraints: A list of lists for the constraints (can be None)
:return: A string to pass to the algorithm | Create a string suitable for the algorithms out of the intensity constraint flags
:param intensity_constraints: A list of lists for the constraints (can be None)
:return: A string to pass to the algorithm | [
"Create",
"a",
"string",
"suitable",
"for",
"the",
"algorithms",
"out",
"of",
"the",
"intensity",
"constraint",
"flags",
":",
"param",
"intensity_constraints",
":",
"A",
"list",
"of",
"lists",
"for",
"the",
"constraints",
"(",
"can",
"be",
"None",
")",
":",
... | def _create_intensity_constraint_str(intensity_constraints):
"""
Create a string suitable for the algorithms out of the intensity constraint flags
:param intensity_constraints: A list of lists for the constraints (can be None)
:return: A string to pass to the algorithm
"""
if intensity_constrain... | [
"def",
"_create_intensity_constraint_str",
"(",
"intensity_constraints",
")",
":",
"if",
"intensity_constraints",
":",
"if",
"not",
"isinstance",
"(",
"intensity_constraints",
"[",
"0",
"]",
",",
"list",
")",
":",
"intensity_constraints",
"=",
"[",
"intensity_constrai... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/vesuvio/commands.py#L783-L798 | |
facebookresearch/ELF | 1f790173095cd910976d9f651b80beb872ec5d12 | rlpytorch/methods/actor_critic.py | python | ActorCritic.update | (self, mi, batch, stats) | Actor critic model update.
Feed stats for later summarization.
Args:
mi(`ModelInterface`): mode interface used
batch(dict): batch of data. Keys in a batch:
``s``: state,
``r``: immediate reward,
``terminal``: if game is terminated
... | Actor critic model update.
Feed stats for later summarization. | [
"Actor",
"critic",
"model",
"update",
".",
"Feed",
"stats",
"for",
"later",
"summarization",
"."
] | def update(self, mi, batch, stats):
''' Actor critic model update.
Feed stats for later summarization.
Args:
mi(`ModelInterface`): mode interface used
batch(dict): batch of data. Keys in a batch:
``s``: state,
``r``: immediate reward,
... | [
"def",
"update",
"(",
"self",
",",
"mi",
",",
"batch",
",",
"stats",
")",
":",
"m",
"=",
"mi",
"[",
"\"model\"",
"]",
"args",
"=",
"self",
".",
"args",
"value_node",
"=",
"self",
".",
"args",
".",
"value_node",
"T",
"=",
"batch",
"[",
"\"s\"",
"]... | https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/rlpytorch/methods/actor_critic.py#L37-L76 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/traceback.py | python | print_stack | (f=None, limit=None, file=None) | Print a stack trace from its invocation point.
The optional 'f' argument can be used to specify an alternate
stack frame at which to start. The optional 'limit' and 'file'
arguments have the same meaning as for print_exception(). | Print a stack trace from its invocation point. | [
"Print",
"a",
"stack",
"trace",
"from",
"its",
"invocation",
"point",
"."
] | def print_stack(f=None, limit=None, file=None):
"""Print a stack trace from its invocation point.
The optional 'f' argument can be used to specify an alternate
stack frame at which to start. The optional 'limit' and 'file'
arguments have the same meaning as for print_exception().
"""
if f is No... | [
"def",
"print_stack",
"(",
"f",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"file",
"=",
"None",
")",
":",
"if",
"f",
"is",
"None",
":",
"try",
":",
"raise",
"ZeroDivisionError",
"except",
"ZeroDivisionError",
":",
"f",
"=",
"sys",
".",
"exc_info",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/traceback.py#L258-L270 | ||
baidu/AnyQ | d94d450d2aaa5f7ed73424b10aa4539835b97527 | tools/simnet/train/tf/utils/controler.py | python | run_trainer | (loss, optimizer, config) | run classification training function handle | run classification training function handle | [
"run",
"classification",
"training",
"function",
"handle"
] | def run_trainer(loss, optimizer, config):
"""
run classification training function handle
"""
thread_num = int(config["thread_num"])
model_path = config["model_path"]
model_file = config["model_prefix"]
print_iter = int(config["print_iter"])
data_size = int(config["data_size"])
batch... | [
"def",
"run_trainer",
"(",
"loss",
",",
"optimizer",
",",
"config",
")",
":",
"thread_num",
"=",
"int",
"(",
"config",
"[",
"\"thread_num\"",
"]",
")",
"model_path",
"=",
"config",
"[",
"\"model_path\"",
"]",
"model_file",
"=",
"config",
"[",
"\"model_prefix... | https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/train/tf/utils/controler.py#L69-L115 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py | python | reconstruct_from_patches_2d | (patches, image_size) | return img | Reconstruct the image from all of its patches.
Patches are assumed to overlap and the image is constructed by filling in
the patches from left to right, top to bottom, averaging the overlapping
regions.
Read more in the :ref:`User Guide <image_feature_extraction>`.
Parameters
----------
p... | Reconstruct the image from all of its patches. | [
"Reconstruct",
"the",
"image",
"from",
"all",
"of",
"its",
"patches",
"."
] | def reconstruct_from_patches_2d(patches, image_size):
"""Reconstruct the image from all of its patches.
Patches are assumed to overlap and the image is constructed by filling in
the patches from left to right, top to bottom, averaging the overlapping
regions.
Read more in the :ref:`User Guide <ima... | [
"def",
"reconstruct_from_patches_2d",
"(",
"patches",
",",
"image_size",
")",
":",
"i_h",
",",
"i_w",
"=",
"image_size",
"[",
":",
"2",
"]",
"p_h",
",",
"p_w",
"=",
"patches",
".",
"shape",
"[",
"1",
":",
"3",
"]",
"img",
"=",
"np",
".",
"zeros",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py#L438-L479 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/cookielib.py | python | unmatched | (match) | return match.string[:start]+match.string[end:] | Return unmatched part of re.Match object. | Return unmatched part of re.Match object. | [
"Return",
"unmatched",
"part",
"of",
"re",
".",
"Match",
"object",
"."
] | def unmatched(match):
"""Return unmatched part of re.Match object."""
start, end = match.span(0)
return match.string[:start]+match.string[end:] | [
"def",
"unmatched",
"(",
"match",
")",
":",
"start",
",",
"end",
"=",
"match",
".",
"span",
"(",
"0",
")",
"return",
"match",
".",
"string",
"[",
":",
"start",
"]",
"+",
"match",
".",
"string",
"[",
"end",
":",
"]"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cookielib.py#L317-L320 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/tools/saved_model_cli.py | python | preprocess_inputs_arg_string | (inputs_str) | return input_dict | Parses input arg into dictionary that maps input to file/variable tuple.
Parses input string in the format of, for example,
"input1=filename1[variable_name1],input2=filename2" into a
dictionary looks like
{'input_key1': (filename1, variable_name1),
'input_key2': (file2, None)}
, which maps input keys to a... | Parses input arg into dictionary that maps input to file/variable tuple. | [
"Parses",
"input",
"arg",
"into",
"dictionary",
"that",
"maps",
"input",
"to",
"file",
"/",
"variable",
"tuple",
"."
] | def preprocess_inputs_arg_string(inputs_str):
"""Parses input arg into dictionary that maps input to file/variable tuple.
Parses input string in the format of, for example,
"input1=filename1[variable_name1],input2=filename2" into a
dictionary looks like
{'input_key1': (filename1, variable_name1),
'input_k... | [
"def",
"preprocess_inputs_arg_string",
"(",
"inputs_str",
")",
":",
"input_dict",
"=",
"{",
"}",
"inputs_raw",
"=",
"inputs_str",
".",
"split",
"(",
"';'",
")",
"for",
"input_raw",
"in",
"filter",
"(",
"bool",
",",
"inputs_raw",
")",
":",
"# skip empty strings... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/tools/saved_model_cli.py#L322-L366 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/ConfigParser.py | python | RawConfigParser.remove_section | (self, section) | return existed | Remove a file section. | Remove a file section. | [
"Remove",
"a",
"file",
"section",
"."
] | def remove_section(self, section):
"""Remove a file section."""
existed = section in self._sections
if existed:
del self._sections[section]
return existed | [
"def",
"remove_section",
"(",
"self",
",",
"section",
")",
":",
"existed",
"=",
"section",
"in",
"self",
".",
"_sections",
"if",
"existed",
":",
"del",
"self",
".",
"_sections",
"[",
"section",
"]",
"return",
"existed"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ConfigParser.py#L431-L436 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PrintData.GetMedia | (*args, **kwargs) | return _windows_.PrintData_GetMedia(*args, **kwargs) | GetMedia(self) -> int | GetMedia(self) -> int | [
"GetMedia",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMedia(*args, **kwargs):
"""GetMedia(self) -> int"""
return _windows_.PrintData_GetMedia(*args, **kwargs) | [
"def",
"GetMedia",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintData_GetMedia",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4763-L4765 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | floordiv | (x, y, name=None) | Divides `x / y` elementwise, rounding down for floating point.
The same as `tf.div(x,y)` for integers, but uses `tf.floor(tf.div(x,y))` for
floating point arguments so that the result is always an integer (though
possibly an integer represented as floating point). This op is generated by
`x // y` floor divisi... | Divides `x / y` elementwise, rounding down for floating point. | [
"Divides",
"x",
"/",
"y",
"elementwise",
"rounding",
"down",
"for",
"floating",
"point",
"."
] | def floordiv(x, y, name=None):
"""Divides `x / y` elementwise, rounding down for floating point.
The same as `tf.div(x,y)` for integers, but uses `tf.floor(tf.div(x,y))` for
floating point arguments so that the result is always an integer (though
possibly an integer represented as floating point). This op is ... | [
"def",
"floordiv",
"(",
"x",
",",
"y",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"x",
",",
"y",
"]",
",",
"name",
",",
"\"floordiv\"",
")",
"as",
"name",
":",
"x",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L868-L902 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/generator/cmake.py | python | SetVariable | (output, variable_name, value) | Sets a CMake variable. | Sets a CMake variable. | [
"Sets",
"a",
"CMake",
"variable",
"."
] | def SetVariable(output, variable_name, value):
"""Sets a CMake variable."""
output.write('set(')
output.write(variable_name)
output.write(' "')
output.write(CMakeStringEscape(value))
output.write('")\n') | [
"def",
"SetVariable",
"(",
"output",
",",
"variable_name",
",",
"value",
")",
":",
"output",
".",
"write",
"(",
"'set('",
")",
"output",
".",
"write",
"(",
"variable_name",
")",
"output",
".",
"write",
"(",
"' \"'",
")",
"output",
".",
"write",
"(",
"C... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/cmake.py#L182-L188 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/network/routing.py | python | priorityDictionary.setdefault | (self, key, val) | return self[key] | Reimplement setdefault to call our customized __setitem__. | Reimplement setdefault to call our customized __setitem__. | [
"Reimplement",
"setdefault",
"to",
"call",
"our",
"customized",
"__setitem__",
"."
] | def setdefault(self, key, val):
'''Reimplement setdefault to call our customized __setitem__.'''
if key not in self:
self[key] = val
return self[key] | [
"def",
"setdefault",
"(",
"self",
",",
"key",
",",
"val",
")",
":",
"if",
"key",
"not",
"in",
"self",
":",
"self",
"[",
"key",
"]",
"=",
"val",
"return",
"self",
"[",
"key",
"]"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/network/routing.py#L88-L92 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/stubout.py | python | StubOutForTesting.SmartSet | (self, obj, attr_name, new_attr) | Replace obj.attr_name with new_attr. This method is smart and works
at the module, class, and instance level while preserving proper
inheritance. It will not stub out C types however unless that has been
explicitly allowed by the type.
This method supports the case where attr_name is a stat... | Replace obj.attr_name with new_attr. This method is smart and works
at the module, class, and instance level while preserving proper
inheritance. It will not stub out C types however unless that has been
explicitly allowed by the type. | [
"Replace",
"obj",
".",
"attr_name",
"with",
"new_attr",
".",
"This",
"method",
"is",
"smart",
"and",
"works",
"at",
"the",
"module",
"class",
"and",
"instance",
"level",
"while",
"preserving",
"proper",
"inheritance",
".",
"It",
"will",
"not",
"stub",
"out",... | def SmartSet(self, obj, attr_name, new_attr):
"""Replace obj.attr_name with new_attr. This method is smart and works
at the module, class, and instance level while preserving proper
inheritance. It will not stub out C types however unless that has been
explicitly allowed by the type.
Th... | [
"def",
"SmartSet",
"(",
"self",
",",
"obj",
",",
"attr_name",
",",
"new_attr",
")",
":",
"if",
"(",
"inspect",
".",
"ismodule",
"(",
"obj",
")",
"or",
"(",
"not",
"inspect",
".",
"isclass",
"(",
"obj",
")",
"and",
"obj",
".",
"__dict__",
".",
"has_... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/stubout.py#L42-L94 | ||
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | SynthText_Chinese/gen.py | python | get_data | () | return h5py.File(DB_FNAME,'r') | Download the image,depth and segmentation data:
Returns, the h5 database. | Download the image,depth and segmentation data:
Returns, the h5 database. | [
"Download",
"the",
"image",
"depth",
"and",
"segmentation",
"data",
":",
"Returns",
"the",
"h5",
"database",
"."
] | def get_data():
"""
Download the image,depth and segmentation data:
Returns, the h5 database.
"""
if not osp.exists(DB_FNAME):
try:
colorprint(Color.BLUE,'\tdownloading data (56 M) from: '+DATA_URL,bold=True)
print
sys.stdout.flush()
out_fname = 'data.tar.gz'
wget.download(DA... | [
"def",
"get_data",
"(",
")",
":",
"if",
"not",
"osp",
".",
"exists",
"(",
"DB_FNAME",
")",
":",
"try",
":",
"colorprint",
"(",
"Color",
".",
"BLUE",
",",
"'\\tdownloading data (56 M) from: '",
"+",
"DATA_URL",
",",
"bold",
"=",
"True",
")",
"print",
"sys... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/SynthText_Chinese/gen.py#L38-L61 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/_base_index.py | python | BaseIndex.set_names | (self, names, level=None, inplace=False) | return self._set_names(names=names, inplace=inplace) | Set Index or MultiIndex name.
Able to set new names partially and by level.
Parameters
----------
names : label or list of label
Name(s) to set.
level : int, label or list of int or label, optional
If the index is a MultiIndex, level(s) to set (None for a... | Set Index or MultiIndex name.
Able to set new names partially and by level. | [
"Set",
"Index",
"or",
"MultiIndex",
"name",
".",
"Able",
"to",
"set",
"new",
"names",
"partially",
"and",
"by",
"level",
"."
] | def set_names(self, names, level=None, inplace=False):
"""
Set Index or MultiIndex name.
Able to set new names partially and by level.
Parameters
----------
names : label or list of label
Name(s) to set.
level : int, label or list of int or label, opt... | [
"def",
"set_names",
"(",
"self",
",",
"names",
",",
"level",
"=",
"None",
",",
"inplace",
"=",
"False",
")",
":",
"if",
"level",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Level must be None for non-MultiIndex\"",
")",
"if",
"not",
"is_list_lik... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/_base_index.py#L218-L274 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/json_schema_compiler/cpp_type_generator.py | python | CppTypeGenerator.GetEnumValue | (self, type_, enum_value) | return value | Gets the enum value of the given model.Property of the given type.
e.g VAR_STRING | Gets the enum value of the given model.Property of the given type. | [
"Gets",
"the",
"enum",
"value",
"of",
"the",
"given",
"model",
".",
"Property",
"of",
"the",
"given",
"type",
"."
] | def GetEnumValue(self, type_, enum_value):
"""Gets the enum value of the given model.Property of the given type.
e.g VAR_STRING
"""
value = cpp_util.Classname(enum_value.name.upper())
prefix = (type_.cpp_enum_prefix_override or
self.FollowRef(type_).unix_name)
value = '%s_%s' % (p... | [
"def",
"GetEnumValue",
"(",
"self",
",",
"type_",
",",
"enum_value",
")",
":",
"value",
"=",
"cpp_util",
".",
"Classname",
"(",
"enum_value",
".",
"name",
".",
"upper",
"(",
")",
")",
"prefix",
"=",
"(",
"type_",
".",
"cpp_enum_prefix_override",
"or",
"s... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/cpp_type_generator.py#L50-L63 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mailbox.py | python | MH.set_sequences | (self, sequences) | Set sequences using the given name-to-key-list dictionary. | Set sequences using the given name-to-key-list dictionary. | [
"Set",
"sequences",
"using",
"the",
"given",
"name",
"-",
"to",
"-",
"key",
"-",
"list",
"dictionary",
"."
] | def set_sequences(self, sequences):
"""Set sequences using the given name-to-key-list dictionary."""
f = open(os.path.join(self._path, '.mh_sequences'), 'r+')
try:
os.close(os.open(f.name, os.O_WRONLY | os.O_TRUNC))
for name, keys in sequences.iteritems():
... | [
"def",
"set_sequences",
"(",
"self",
",",
"sequences",
")",
":",
"f",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"'.mh_sequences'",
")",
",",
"'r+'",
")",
"try",
":",
"os",
".",
"close",
"(",
"os",
".",
"ope... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L1047-L1074 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/markdown/treeprocessors.py | python | InlineProcessor.__processPlaceholders | (self, data, parent) | return result | Process string with placeholders and generate ElementTree tree.
Keyword arguments:
* data: string with placeholders instead of ElementTree elements.
* parent: Element, which contains processing inline data
Returns: list with ElementTree elements with applied inline patterns. | Process string with placeholders and generate ElementTree tree. | [
"Process",
"string",
"with",
"placeholders",
"and",
"generate",
"ElementTree",
"tree",
"."
] | def __processPlaceholders(self, data, parent):
"""
Process string with placeholders and generate ElementTree tree.
Keyword arguments:
* data: string with placeholders instead of ElementTree elements.
* parent: Element, which contains processing inline data
Returns: lis... | [
"def",
"__processPlaceholders",
"(",
"self",
",",
"data",
",",
"parent",
")",
":",
"def",
"linkText",
"(",
"text",
")",
":",
"if",
"text",
":",
"if",
"result",
":",
"if",
"result",
"[",
"-",
"1",
"]",
".",
"tail",
":",
"result",
"[",
"-",
"1",
"]... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/markdown/treeprocessors.py#L175-L241 | |
f4exb/sdrangel | fce235b2bc59b932f93d2cb8784055d51b3b8424 | scriptsapi/ptt_active.py | python | set_focus | (device_index, sdrangel_ip, sdrangel_port) | Set focus on the specified device | Set focus on the specified device | [
"Set",
"focus",
"on",
"the",
"specified",
"device"
] | def set_focus(device_index, sdrangel_ip, sdrangel_port):
""" Set focus on the specified device """
# ----------------------------------------------------------------------
base_url = f'http://{sdrangel_ip}:{sdrangel_port}/sdrangel'
dev_focus_url = base_url + f'/deviceset/{device_index}/focus'
r = reques... | [
"def",
"set_focus",
"(",
"device_index",
",",
"sdrangel_ip",
",",
"sdrangel_port",
")",
":",
"# ----------------------------------------------------------------------",
"base_url",
"=",
"f'http://{sdrangel_ip}:{sdrangel_port}/sdrangel'",
"dev_focus_url",
"=",
"base_url",
"+",
"f'... | https://github.com/f4exb/sdrangel/blob/fce235b2bc59b932f93d2cb8784055d51b3b8424/scriptsapi/ptt_active.py#L91-L102 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py | python | reduce_sum | (input_tensor, axis=None, keepdims=False, name=None) | return _may_reduce_to_scalar(
keepdims, axis,
gen_math_ops._sum(
input_tensor, _ReductionDims(input_tensor, axis), keepdims,
name=name)) | Computes the sum of elements across dimensions of a tensor.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each
entry in `axis`. If `keepdims` is true, the reduced dimensions
are retained with length 1.
If `axis` is None, al... | Computes the sum of elements across dimensions of a tensor. | [
"Computes",
"the",
"sum",
"of",
"elements",
"across",
"dimensions",
"of",
"a",
"tensor",
"."
] | def reduce_sum(input_tensor, axis=None, keepdims=False, name=None):
"""Computes the sum of elements across dimensions of a tensor.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each
entry in `axis`. If `keepdims` is true, the ... | [
"def",
"reduce_sum",
"(",
"input_tensor",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"keepdims",
"=",
"False",
"if",
"keepdims",
"is",
"None",
"else",
"keepdims",
"return",
"_may_reduce_to_scalar",
"(",
"ke... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L1521-L1564 | |
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | scripts/cpp_lint.py | python | _CppLintState.ResetErrorCounts | (self) | Sets the module's error statistic back to zero. | Sets the module's error statistic back to zero. | [
"Sets",
"the",
"module",
"s",
"error",
"statistic",
"back",
"to",
"zero",
"."
] | def ResetErrorCounts(self):
"""Sets the module's error statistic back to zero."""
self.error_count = 0
self.errors_by_category = {} | [
"def",
"ResetErrorCounts",
"(",
"self",
")",
":",
"self",
".",
"error_count",
"=",
"0",
"self",
".",
"errors_by_category",
"=",
"{",
"}"
] | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L742-L745 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | BVRedOr | (a) | return BitVecRef(Z3_mk_bvredor(a.ctx_ref(), a.as_ast()), a.ctx) | Return the reduction-or expression of `a`. | Return the reduction-or expression of `a`. | [
"Return",
"the",
"reduction",
"-",
"or",
"expression",
"of",
"a",
"."
] | def BVRedOr(a):
"""Return the reduction-or expression of `a`."""
if z3_debug():
_z3_assert(is_bv(a), "First argument must be a Z3 bit-vector expression")
return BitVecRef(Z3_mk_bvredor(a.ctx_ref(), a.as_ast()), a.ctx) | [
"def",
"BVRedOr",
"(",
"a",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_bv",
"(",
"a",
")",
",",
"\"First argument must be a Z3 bit-vector expression\"",
")",
"return",
"BitVecRef",
"(",
"Z3_mk_bvredor",
"(",
"a",
".",
"ctx_ref",
"(",
"... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L4417-L4421 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pdb.py | python | Pdb.do_ignore | (self, arg) | ignore bpnumber [count]
Set the ignore count for the given breakpoint number. If
count is omitted, the ignore count is set to 0. A breakpoint
becomes active when the ignore count is zero. When non-zero,
the count is decremented each time the breakpoint is reached
and the break... | ignore bpnumber [count]
Set the ignore count for the given breakpoint number. If
count is omitted, the ignore count is set to 0. A breakpoint
becomes active when the ignore count is zero. When non-zero,
the count is decremented each time the breakpoint is reached
and the break... | [
"ignore",
"bpnumber",
"[",
"count",
"]",
"Set",
"the",
"ignore",
"count",
"for",
"the",
"given",
"breakpoint",
"number",
".",
"If",
"count",
"is",
"omitted",
"the",
"ignore",
"count",
"is",
"set",
"to",
"0",
".",
"A",
"breakpoint",
"becomes",
"active",
"... | def do_ignore(self, arg):
"""ignore bpnumber [count]
Set the ignore count for the given breakpoint number. If
count is omitted, the ignore count is set to 0. A breakpoint
becomes active when the ignore count is zero. When non-zero,
the count is decremented each time the breakp... | [
"def",
"do_ignore",
"(",
"self",
",",
"arg",
")",
":",
"args",
"=",
"arg",
".",
"split",
"(",
")",
"try",
":",
"count",
"=",
"int",
"(",
"args",
"[",
"1",
"]",
".",
"strip",
"(",
")",
")",
"except",
":",
"count",
"=",
"0",
"try",
":",
"bp",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pdb.py#L832-L863 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/findertools.py | python | _geticon | (object_alias) | get the icondata for object. Binary data of some sort. | get the icondata for object. Binary data of some sort. | [
"get",
"the",
"icondata",
"for",
"object",
".",
"Binary",
"data",
"of",
"some",
"sort",
"."
] | def _geticon(object_alias):
"""get the icondata for object. Binary data of some sort."""
finder = _getfinder()
args = {}
attrs = {}
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'),
form="alis", seld=object_alias, fr=None)
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.T... | [
"def",
"_geticon",
"(",
"object_alias",
")",
":",
"finder",
"=",
"_getfinder",
"(",
")",
"args",
"=",
"{",
"}",
"attrs",
"=",
"{",
"}",
"aeobj_00",
"=",
"aetypes",
".",
"ObjectSpecifier",
"(",
"want",
"=",
"aetypes",
".",
"Type",
"(",
"'cobj'",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/findertools.py#L544-L558 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/parameter.py | python | ParameterDict.initialize | (self, init=initializer.Uniform(), ctx=None, verbose=False,
force_reinit=False) | Initializes all Parameters managed by this dictionary to be used for :py:class:`NDArray`
API. It has no effect when using :py:class:`Symbol` API.
Parameters
----------
init : Initializer
Global default Initializer to be used when :py:meth:`Parameter.init` is ``None``.
... | Initializes all Parameters managed by this dictionary to be used for :py:class:`NDArray`
API. It has no effect when using :py:class:`Symbol` API. | [
"Initializes",
"all",
"Parameters",
"managed",
"by",
"this",
"dictionary",
"to",
"be",
"used",
"for",
":",
"py",
":",
"class",
":",
"NDArray",
"API",
".",
"It",
"has",
"no",
"effect",
"when",
"using",
":",
"py",
":",
"class",
":",
"Symbol",
"API",
"."
... | def initialize(self, init=initializer.Uniform(), ctx=None, verbose=False,
force_reinit=False):
"""Initializes all Parameters managed by this dictionary to be used for :py:class:`NDArray`
API. It has no effect when using :py:class:`Symbol` API.
Parameters
----------
... | [
"def",
"initialize",
"(",
"self",
",",
"init",
"=",
"initializer",
".",
"Uniform",
"(",
")",
",",
"ctx",
"=",
"None",
",",
"verbose",
"=",
"False",
",",
"force_reinit",
"=",
"False",
")",
":",
"if",
"verbose",
":",
"init",
".",
"set_verbosity",
"(",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/parameter.py#L842-L862 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/tensor_array_ops.py | python | TensorArray._maybe_colocate_with | (self, value) | Colocate operations with an internal colocation group or `value`.
Args:
value: `Tensor`, the tensor to try to colocate with.
Yields:
Does not yield anything, but the new context is a colocation context.
If no internal colocation group is set, colocate with `value` and set
the internal col... | Colocate operations with an internal colocation group or `value`. | [
"Colocate",
"operations",
"with",
"an",
"internal",
"colocation",
"group",
"or",
"value",
"."
] | def _maybe_colocate_with(self, value):
"""Colocate operations with an internal colocation group or `value`.
Args:
value: `Tensor`, the tensor to try to colocate with.
Yields:
Does not yield anything, but the new context is a colocation context.
If no internal colocation group is set, colo... | [
"def",
"_maybe_colocate_with",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"self",
".",
"_colocate_with_first_write_call",
":",
"yield",
"else",
":",
"if",
"not",
"self",
".",
"_colocate_with",
":",
"self",
".",
"_colocate_with",
".",
"append",
"(",
"v... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/tensor_array_ops.py#L206-L224 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | domain_greater.__call__ | (self, x) | return umath.less_equal (x, self.critical_value) | Execute the call behavior. | Execute the call behavior. | [
"Execute",
"the",
"call",
"behavior",
"."
] | def __call__ (self, x):
"Execute the call behavior."
return umath.less_equal (x, self.critical_value) | [
"def",
"__call__",
"(",
"self",
",",
"x",
")",
":",
"return",
"umath",
".",
"less_equal",
"(",
"x",
",",
"self",
".",
"critical_value",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L285-L287 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/extras/cross_gnu.py | python | get_chost_stuff | (conf) | return chost, chost_envar | Get the CHOST environment variable contents | Get the CHOST environment variable contents | [
"Get",
"the",
"CHOST",
"environment",
"variable",
"contents"
] | def get_chost_stuff(conf):
"""
Get the CHOST environment variable contents
"""
chost = None
chost_envar = None
if conf.env.CHOST:
chost = conf.env.CHOST[0]
chost_envar = chost.replace('-', '_')
return chost, chost_envar | [
"def",
"get_chost_stuff",
"(",
"conf",
")",
":",
"chost",
"=",
"None",
"chost_envar",
"=",
"None",
"if",
"conf",
".",
"env",
".",
"CHOST",
":",
"chost",
"=",
"conf",
".",
"env",
".",
"CHOST",
"[",
"0",
"]",
"chost_envar",
"=",
"chost",
".",
"replace"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/cross_gnu.py#L92-L101 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py | python | DistributionPath.distinfo_dirname | (cls, name, version) | return '-'.join([name, version]) + DISTINFO_EXT | The *name* and *version* parameters are converted into their
filename-escaped form, i.e. any ``'-'`` characters are replaced
with ``'_'`` other than the one in ``'dist-info'`` and the one
separating the name from the version number.
:parameter name: is converted to a standard distributi... | The *name* and *version* parameters are converted into their
filename-escaped form, i.e. any ``'-'`` characters are replaced
with ``'_'`` other than the one in ``'dist-info'`` and the one
separating the name from the version number. | [
"The",
"*",
"name",
"*",
"and",
"*",
"version",
"*",
"parameters",
"are",
"converted",
"into",
"their",
"filename",
"-",
"escaped",
"form",
"i",
".",
"e",
".",
"any",
"-",
"characters",
"are",
"replaced",
"with",
"_",
"other",
"than",
"the",
"one",
"in... | def distinfo_dirname(cls, name, version):
"""
The *name* and *version* parameters are converted into their
filename-escaped form, i.e. any ``'-'`` characters are replaced
with ``'_'`` other than the one in ``'dist-info'`` and the one
separating the name from the version number.
... | [
"def",
"distinfo_dirname",
"(",
"cls",
",",
"name",
",",
"version",
")",
":",
"name",
"=",
"name",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
"return",
"'-'",
".",
"join",
"(",
"[",
"name",
",",
"version",
"]",
")",
"+",
"DISTINFO_EXT"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/database.py#L179-L198 | |
dogecoin/dogecoin | 31afd133119dd2e15862d46530cb99424cf564b0 | contrib/devtools/security-check.py | python | check_ELF_RELRO | (executable) | return have_gnu_relro and have_bindnow | Check for read-only relocations.
GNU_RELRO program header must exist
Dynamic section must have BIND_NOW flag | Check for read-only relocations.
GNU_RELRO program header must exist
Dynamic section must have BIND_NOW flag | [
"Check",
"for",
"read",
"-",
"only",
"relocations",
".",
"GNU_RELRO",
"program",
"header",
"must",
"exist",
"Dynamic",
"section",
"must",
"have",
"BIND_NOW",
"flag"
] | def check_ELF_RELRO(executable):
'''
Check for read-only relocations.
GNU_RELRO program header must exist
Dynamic section must have BIND_NOW flag
'''
have_gnu_relro = False
for (typ, flags) in get_ELF_program_headers(executable):
# Note: not checking flags == 'R': here as linkers set... | [
"def",
"check_ELF_RELRO",
"(",
"executable",
")",
":",
"have_gnu_relro",
"=",
"False",
"for",
"(",
"typ",
",",
"flags",
")",
"in",
"get_ELF_program_headers",
"(",
"executable",
")",
":",
"# Note: not checking flags == 'R': here as linkers set the permission differently",
... | https://github.com/dogecoin/dogecoin/blob/31afd133119dd2e15862d46530cb99424cf564b0/contrib/devtools/security-check.py#L78-L103 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.PositionBefore | (*args, **kwargs) | return _stc.StyledTextCtrl_PositionBefore(*args, **kwargs) | PositionBefore(self, int pos) -> int
Given a valid document position, return the previous position taking code
page into account. Returns 0 if passed 0. | PositionBefore(self, int pos) -> int | [
"PositionBefore",
"(",
"self",
"int",
"pos",
")",
"-",
">",
"int"
] | def PositionBefore(*args, **kwargs):
"""
PositionBefore(self, int pos) -> int
Given a valid document position, return the previous position taking code
page into account. Returns 0 if passed 0.
"""
return _stc.StyledTextCtrl_PositionBefore(*args, **kwargs) | [
"def",
"PositionBefore",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_PositionBefore",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5300-L5307 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/ops/genome_ops.py | python | _nucleotide_to_onehot | (nucleotide) | Encodes a nucleotide using a one hot encoding. | Encodes a nucleotide using a one hot encoding. | [
"Encodes",
"a",
"nucleotide",
"using",
"a",
"one",
"hot",
"encoding",
"."
] | def _nucleotide_to_onehot(nucleotide):
"""Encodes a nucleotide using a one hot encoding."""
a_onehot = tf.constant([1, 0, 0, 0])
c_onehot = tf.constant([0, 1, 0, 0])
g_onehot = tf.constant([0, 0, 1, 0])
t_onehot = tf.constant([0, 0, 0, 1])
error_onehot = tf.constant([1, 1, 1, 1])
if tf.math... | [
"def",
"_nucleotide_to_onehot",
"(",
"nucleotide",
")",
":",
"a_onehot",
"=",
"tf",
".",
"constant",
"(",
"[",
"1",
",",
"0",
",",
"0",
",",
"0",
"]",
")",
"c_onehot",
"=",
"tf",
".",
"constant",
"(",
"[",
"0",
",",
"1",
",",
"0",
",",
"0",
"]"... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/genome_ops.py#L36-L54 | ||
ros-perception/vision_opencv | c791220cefd0abf02c6719e2ce0fea465857a88e | image_geometry/src/image_geometry/cameramodels.py | python | PinholeCameraModel.tfFrame | (self) | return self.tf_frame | Returns the tf frame name - a string - of the camera.
This is the frame of the :class:`sensor_msgs.msg.CameraInfo` message. | Returns the tf frame name - a string - of the camera.
This is the frame of the :class:`sensor_msgs.msg.CameraInfo` message. | [
"Returns",
"the",
"tf",
"frame",
"name",
"-",
"a",
"string",
"-",
"of",
"the",
"camera",
".",
"This",
"is",
"the",
"frame",
"of",
"the",
":",
"class",
":",
"sensor_msgs",
".",
"msg",
".",
"CameraInfo",
"message",
"."
] | def tfFrame(self):
""" Returns the tf frame name - a string - of the camera.
This is the frame of the :class:`sensor_msgs.msg.CameraInfo` message.
"""
return self.tf_frame | [
"def",
"tfFrame",
"(",
"self",
")",
":",
"return",
"self",
".",
"tf_frame"
] | https://github.com/ros-perception/vision_opencv/blob/c791220cefd0abf02c6719e2ce0fea465857a88e/image_geometry/src/image_geometry/cameramodels.py#L251-L255 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/plotting/_core.py | python | PlotAccessor.barh | (self, x=None, y=None, **kwargs) | return self(kind="barh", x=x, y=y, **kwargs) | Make a horizontal bar plot.
A horizontal bar plot is a plot that presents quantitative data with
rectangular bars with lengths proportional to the values that they
represent. A bar plot shows comparisons among discrete categories. One
axis of the plot shows the specific categories being... | Make a horizontal bar plot. | [
"Make",
"a",
"horizontal",
"bar",
"plot",
"."
] | def barh(self, x=None, y=None, **kwargs):
"""
Make a horizontal bar plot.
A horizontal bar plot is a plot that presents quantitative data with
rectangular bars with lengths proportional to the values that they
represent. A bar plot shows comparisons among discrete categories. On... | [
"def",
"barh",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
"(",
"kind",
"=",
"\"barh\"",
",",
"x",
"=",
"x",
",",
"y",
"=",
"y",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/plotting/_core.py#L1005-L1083 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/xrc.py | python | XmlResourceHandler.GetIcon | (*args, **kwargs) | return _xrc.XmlResourceHandler_GetIcon(*args, **kwargs) | GetIcon(self, String param=IconString, wxArtClient defaultArtClient=wxART_OTHER,
Size size=DefaultSize) -> Icon | GetIcon(self, String param=IconString, wxArtClient defaultArtClient=wxART_OTHER,
Size size=DefaultSize) -> Icon | [
"GetIcon",
"(",
"self",
"String",
"param",
"=",
"IconString",
"wxArtClient",
"defaultArtClient",
"=",
"wxART_OTHER",
"Size",
"size",
"=",
"DefaultSize",
")",
"-",
">",
"Icon"
] | def GetIcon(*args, **kwargs):
"""
GetIcon(self, String param=IconString, wxArtClient defaultArtClient=wxART_OTHER,
Size size=DefaultSize) -> Icon
"""
return _xrc.XmlResourceHandler_GetIcon(*args, **kwargs) | [
"def",
"GetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_GetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/xrc.py#L702-L707 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.