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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/targets.py | python | BasicTarget.construct | (self, name, source_targets, properties) | Constructs the virtual targets for this abstract targets and
the dependecy graph. Returns a tuple consisting of the properties and the list of virtual targets.
Should be overrided in derived classes. | Constructs the virtual targets for this abstract targets and
the dependecy graph. Returns a tuple consisting of the properties and the list of virtual targets.
Should be overrided in derived classes. | [
"Constructs",
"the",
"virtual",
"targets",
"for",
"this",
"abstract",
"targets",
"and",
"the",
"dependecy",
"graph",
".",
"Returns",
"a",
"tuple",
"consisting",
"of",
"the",
"properties",
"and",
"the",
"list",
"of",
"virtual",
"targets",
".",
"Should",
"be",
... | def construct (self, name, source_targets, properties):
""" Constructs the virtual targets for this abstract targets and
the dependecy graph. Returns a tuple consisting of the properties and the list of virtual targets.
Should be overrided in derived classes.
"""
raise Ba... | [
"def",
"construct",
"(",
"self",
",",
"name",
",",
"source_targets",
",",
"properties",
")",
":",
"raise",
"BaseException",
"(",
"\"method should be defined in derived classes\"",
")"
] | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/targets.py#L1270-L1275 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Control.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
String name=ControlNameStr) -> Control
Create a Control. Normally you should only call this from a subclass'
__init__ as a plain old ... | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
String name=ControlNameStr) -> Control | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"0",
"Validator",
"validator",
"=",
"DefaultValidator",
"String",
"name",
"=",
"Control... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
String name=ControlNameStr) -> Control
Create a Control. Normally you should only c... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"Control_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_Control",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_setOORInfo",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12659-L12669 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/methodheap.py | python | MythBE.freeTuner | (self,id=None) | Frees a requested tuner ID
If no ID given, free all tuners listed as used by this class instance | Frees a requested tuner ID
If no ID given, free all tuners listed as used by this class instance | [
"Frees",
"a",
"requested",
"tuner",
"ID",
"If",
"no",
"ID",
"given",
"free",
"all",
"tuners",
"listed",
"as",
"used",
"by",
"this",
"class",
"instance"
] | def freeTuner(self,id=None):
"""
Frees a requested tuner ID
If no ID given, free all tuners listed as used by this class instance
"""
tunerlist = {}
if id is not None:
id = int(id)
if id in self.locked_tuners:
# tuner is known, pop... | [
"def",
"freeTuner",
"(",
"self",
",",
"id",
"=",
"None",
")",
":",
"tunerlist",
"=",
"{",
"}",
"if",
"id",
"is",
"not",
"None",
":",
"id",
"=",
"int",
"(",
"id",
")",
"if",
"id",
"in",
"self",
".",
"locked_tuners",
":",
"# tuner is known, pop from li... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/methodheap.py#L183-L226 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/svrg_module/linear_regression/common.py | python | calc_expectation | (grad_dict, num_batches) | return grad_dict | Calculates the expectation of the gradients per epoch for each parameter w.r.t number of batches
Parameters
----------
grad_dict: dict
dictionary that maps parameter name to gradients in the mod executor group
num_batches: int
number of batches
Returns
----------
grad_dict:... | Calculates the expectation of the gradients per epoch for each parameter w.r.t number of batches | [
"Calculates",
"the",
"expectation",
"of",
"the",
"gradients",
"per",
"epoch",
"for",
"each",
"parameter",
"w",
".",
"r",
".",
"t",
"number",
"of",
"batches"
] | def calc_expectation(grad_dict, num_batches):
"""Calculates the expectation of the gradients per epoch for each parameter w.r.t number of batches
Parameters
----------
grad_dict: dict
dictionary that maps parameter name to gradients in the mod executor group
num_batches: int
number ... | [
"def",
"calc_expectation",
"(",
"grad_dict",
",",
"num_batches",
")",
":",
"for",
"key",
"in",
"grad_dict",
".",
"keys",
"(",
")",
":",
"grad_dict",
"[",
"str",
".",
"format",
"(",
"key",
"+",
"\"_expectation\"",
")",
"]",
"=",
"mx",
".",
"ndarray",
".... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/svrg_module/linear_regression/common.py#L74-L93 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/feature_column.py | python | _WeightedSparseColumn.is_compatible | (self, other_column) | return self.sparse_id_column.is_compatible(other_column) | Check compatibility with other sparse column. | Check compatibility with other sparse column. | [
"Check",
"compatibility",
"with",
"other",
"sparse",
"column",
"."
] | def is_compatible(self, other_column):
"""Check compatibility with other sparse column."""
if isinstance(other_column, _WeightedSparseColumn):
return self.sparse_id_column.is_compatible(other_column.sparse_id_column)
return self.sparse_id_column.is_compatible(other_column) | [
"def",
"is_compatible",
"(",
"self",
",",
"other_column",
")",
":",
"if",
"isinstance",
"(",
"other_column",
",",
"_WeightedSparseColumn",
")",
":",
"return",
"self",
".",
"sparse_id_column",
".",
"is_compatible",
"(",
"other_column",
".",
"sparse_id_column",
")",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column.py#L820-L824 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas_utils/solvers/nonsymmetric/qre_anneal.py | python | Solver.init_vars | (self, num_strats, num_players) | return (init_dist, init_y, init_anneal_steps) | Initialize solver parameters. | Initialize solver parameters. | [
"Initialize",
"solver",
"parameters",
"."
] | def init_vars(self, num_strats, num_players):
"""Initialize solver parameters."""
self.num_players = num_players
if len(num_strats) != num_players:
raise ValueError('Must specify num strategies for each player')
init_dist = []
for num_strats_i in num_strats:
if self.rnd_init:
ini... | [
"def",
"init_vars",
"(",
"self",
",",
"num_strats",
",",
"num_players",
")",
":",
"self",
".",
"num_players",
"=",
"num_players",
"if",
"len",
"(",
"num_strats",
")",
"!=",
"num_players",
":",
"raise",
"ValueError",
"(",
"'Must specify num strategies for each play... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/solvers/nonsymmetric/qre_anneal.py#L56-L71 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/range.py | python | RangeIndex._arith_method | (self, other, op) | Parameters
----------
other : Any
op : callable that accepts 2 params
perform the binary op | Parameters
----------
other : Any
op : callable that accepts 2 params
perform the binary op | [
"Parameters",
"----------",
"other",
":",
"Any",
"op",
":",
"callable",
"that",
"accepts",
"2",
"params",
"perform",
"the",
"binary",
"op"
] | def _arith_method(self, other, op):
"""
Parameters
----------
other : Any
op : callable that accepts 2 params
perform the binary op
"""
if isinstance(other, ABCTimedeltaIndex):
# Defer to TimedeltaIndex implementation
return No... | [
"def",
"_arith_method",
"(",
"self",
",",
"other",
",",
"op",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"ABCTimedeltaIndex",
")",
":",
"# Defer to TimedeltaIndex implementation",
"return",
"NotImplemented",
"elif",
"isinstance",
"(",
"other",
",",
"(",
"t... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/range.py#L881-L952 | ||
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/ikfast.py | python | IKFastSolver.__init__ | (self, kinbody=None,kinematicshash='',precision=None, checkpreemptfn=None) | :param checkpreemptfn: checkpreemptfn(msg, progress) called periodically at various points in ikfast. Takes in two arguments to notify user how far the process has completed. | :param checkpreemptfn: checkpreemptfn(msg, progress) called periodically at various points in ikfast. Takes in two arguments to notify user how far the process has completed. | [
":",
"param",
"checkpreemptfn",
":",
"checkpreemptfn",
"(",
"msg",
"progress",
")",
"called",
"periodically",
"at",
"various",
"points",
"in",
"ikfast",
".",
"Takes",
"in",
"two",
"arguments",
"to",
"notify",
"user",
"how",
"far",
"the",
"process",
"has",
"c... | def __init__(self, kinbody=None,kinematicshash='',precision=None, checkpreemptfn=None):
"""
:param checkpreemptfn: checkpreemptfn(msg, progress) called periodically at various points in ikfast. Takes in two arguments to notify user how far the process has completed.
"""
self._checkpreemp... | [
"def",
"__init__",
"(",
"self",
",",
"kinbody",
"=",
"None",
",",
"kinematicshash",
"=",
"''",
",",
"precision",
"=",
"None",
",",
"checkpreemptfn",
"=",
"None",
")",
":",
"self",
".",
"_checkpreemptfn",
"=",
"checkpreemptfn",
"self",
".",
"usinglapack",
"... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast.py#L1386-L1417 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_selectplane.py | python | Draft_SelectPlane.getCenterPoint | (self, x, y, z) | return cp | Get the center point. | Get the center point. | [
"Get",
"the",
"center",
"point",
"."
] | def getCenterPoint(self, x, y, z):
"""Get the center point."""
if not self.taskd.form.checkCenter.isChecked():
return FreeCAD.Vector()
v = FreeCAD.Vector(x, y, z)
view = FreeCADGui.ActiveDocument.ActiveView
camera = view.getCameraNode()
cam1 = FreeCAD.Vector(c... | [
"def",
"getCenterPoint",
"(",
"self",
",",
"x",
",",
"y",
",",
"z",
")",
":",
"if",
"not",
"self",
".",
"taskd",
".",
"form",
".",
"checkCenter",
".",
"isChecked",
"(",
")",
":",
"return",
"FreeCAD",
".",
"Vector",
"(",
")",
"v",
"=",
"FreeCAD",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_selectplane.py#L326-L343 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/sgmllib.py | python | SGMLParser.setnomoretags | (self) | Enter literal mode (CDATA) till EOF.
Intended for derived classes only. | Enter literal mode (CDATA) till EOF. | [
"Enter",
"literal",
"mode",
"(",
"CDATA",
")",
"till",
"EOF",
"."
] | def setnomoretags(self):
"""Enter literal mode (CDATA) till EOF.
Intended for derived classes only.
"""
self.nomoretags = self.literal = 1 | [
"def",
"setnomoretags",
"(",
"self",
")",
":",
"self",
".",
"nomoretags",
"=",
"self",
".",
"literal",
"=",
"1"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/sgmllib.py#L81-L86 | ||
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/cpp_wrappers/covariance.py | python | SquareExponential.get_json_serializable_info | (self) | return {
'covariance_type': self.covariance_type,
'hyperparameters': self.hyperparameters.tolist(),
} | Create and return a covariance_info dictionary of this covariance object. | Create and return a covariance_info dictionary of this covariance object. | [
"Create",
"and",
"return",
"a",
"covariance_info",
"dictionary",
"of",
"this",
"covariance",
"object",
"."
] | def get_json_serializable_info(self):
"""Create and return a covariance_info dictionary of this covariance object."""
return {
'covariance_type': self.covariance_type,
'hyperparameters': self.hyperparameters.tolist(),
} | [
"def",
"get_json_serializable_info",
"(",
"self",
")",
":",
"return",
"{",
"'covariance_type'",
":",
"self",
".",
"covariance_type",
",",
"'hyperparameters'",
":",
"self",
".",
"hyperparameters",
".",
"tolist",
"(",
")",
",",
"}"
] | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/covariance.py#L61-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | MaskedArray.__getitem__ | (self, indx) | return dout | x.__getitem__(y) <==> x[y]
Return the item described by i, as a masked array. | x.__getitem__(y) <==> x[y] | [
"x",
".",
"__getitem__",
"(",
"y",
")",
"<",
"==",
">",
"x",
"[",
"y",
"]"
] | def __getitem__(self, indx):
"""
x.__getitem__(y) <==> x[y]
Return the item described by i, as a masked array.
"""
# We could directly use ndarray.__getitem__ on self.
# But then we would have to modify __array_finalize__ to prevent the
# mask of being reshaped ... | [
"def",
"__getitem__",
"(",
"self",
",",
"indx",
")",
":",
"# We could directly use ndarray.__getitem__ on self.",
"# But then we would have to modify __array_finalize__ to prevent the",
"# mask of being reshaped if it hasn't been set up properly yet",
"# So it's easier to stick to the current ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L3177-L3295 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/utils.py | python | parseaddr | (addr) | return addrs[0] | Parse addr into its constituent realname and email address parts.
Return a tuple of realname and email address, unless the parse fails, in
which case return a 2-tuple of ('', ''). | Parse addr into its constituent realname and email address parts. | [
"Parse",
"addr",
"into",
"its",
"constituent",
"realname",
"and",
"email",
"address",
"parts",
"."
] | def parseaddr(addr):
"""
Parse addr into its constituent realname and email address parts.
Return a tuple of realname and email address, unless the parse fails, in
which case return a 2-tuple of ('', '').
"""
addrs = _AddressList(addr).addresslist
if not addrs:
return '', ''
ret... | [
"def",
"parseaddr",
"(",
"addr",
")",
":",
"addrs",
"=",
"_AddressList",
"(",
"addr",
")",
".",
"addresslist",
"if",
"not",
"addrs",
":",
"return",
"''",
",",
"''",
"return",
"addrs",
"[",
"0",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/utils.py#L205-L215 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/copies.py | python | CopyObjectTask._main | (self, client, copy_source, bucket, key, extra_args, callbacks,
size) | :param client: The client to use when calling PutObject
:param copy_source: The CopySource parameter to use
:param bucket: The name of the bucket to copy to
:param key: The name of the key to copy to
:param extra_args: A dictionary of any extra arguments that may be
used in t... | :param client: The client to use when calling PutObject
:param copy_source: The CopySource parameter to use
:param bucket: The name of the bucket to copy to
:param key: The name of the key to copy to
:param extra_args: A dictionary of any extra arguments that may be
used in t... | [
":",
"param",
"client",
":",
"The",
"client",
"to",
"use",
"when",
"calling",
"PutObject",
":",
"param",
"copy_source",
":",
"The",
"CopySource",
"parameter",
"to",
"use",
":",
"param",
"bucket",
":",
"The",
"name",
"of",
"the",
"bucket",
"to",
"copy",
"... | def _main(self, client, copy_source, bucket, key, extra_args, callbacks,
size):
"""
:param client: The client to use when calling PutObject
:param copy_source: The CopySource parameter to use
:param bucket: The name of the bucket to copy to
:param key: The name of t... | [
"def",
"_main",
"(",
"self",
",",
"client",
",",
"copy_source",
",",
"bucket",
",",
"key",
",",
"extra_args",
",",
"callbacks",
",",
"size",
")",
":",
"client",
".",
"copy_object",
"(",
"CopySource",
"=",
"copy_source",
",",
"Bucket",
"=",
"bucket",
",",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/copies.py#L272-L289 | ||
wdas/SeExpr | 42b695546689c61ae87c7747fc27ae50653f09f5 | src/py/utils.py | python | Edits.makeNewString | (self) | return s | Apply the edits to the string and give a new expression | Apply the edits to the string and give a new expression | [
"Apply",
"the",
"edits",
"to",
"the",
"string",
"and",
"give",
"a",
"new",
"expression"
] | def makeNewString(self):
"Apply the edits to the string and give a new expression"
# reverse sort
self.changes.sort(lambda x,y: -cmp(x[0][0],y[0][0]))
s=self.str
for r,newVal in self.changes:
s=s[:r[0]]+self.formatNewValue(newVal)+s[r[1]:]
return s | [
"def",
"makeNewString",
"(",
"self",
")",
":",
"# reverse sort",
"self",
".",
"changes",
".",
"sort",
"(",
"lambda",
"x",
",",
"y",
":",
"-",
"cmp",
"(",
"x",
"[",
"0",
"]",
"[",
"0",
"]",
",",
"y",
"[",
"0",
"]",
"[",
"0",
"]",
")",
")",
"... | https://github.com/wdas/SeExpr/blob/42b695546689c61ae87c7747fc27ae50653f09f5/src/py/utils.py#L88-L95 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/resource_variable_ops.py | python | BaseResourceVariable.scatter_nd_sub | (self, indices, updates, name=None) | return self._lazy_read(gen_state_ops.resource_scatter_nd_sub(
self.handle, indices, ops.convert_to_tensor(updates, self.dtype),
name=name)) | Applies sparse subtraction to individual values or slices in a Variable.
`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`.
It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of... | Applies sparse subtraction to individual values or slices in a Variable. | [
"Applies",
"sparse",
"subtraction",
"to",
"individual",
"values",
"or",
"slices",
"in",
"a",
"Variable",
"."
] | def scatter_nd_sub(self, indices, updates, name=None):
"""Applies sparse subtraction to individual values or slices in a Variable.
`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`.
It must be shape `[d_0, ..., d_... | [
"def",
"scatter_nd_sub",
"(",
"self",
",",
"indices",
",",
"updates",
",",
"name",
"=",
"None",
")",
":",
"return",
"self",
".",
"_lazy_read",
"(",
"gen_state_ops",
".",
"resource_scatter_nd_sub",
"(",
"self",
".",
"handle",
",",
"indices",
",",
"ops",
"."... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/resource_variable_ops.py#L1032-L1080 | |
Caffe-MPI/Caffe-MPI.github.io | df5992af571a2a19981b69635115c393f18d1c76 | scripts/cpp_lint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/scripts/cpp_lint.py#L1384-L1405 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/shortcuts.py | python | create_prompt_layout | (message='', lexer=None, is_password=False,
reserve_space_for_menu=8,
get_prompt_tokens=None, get_continuation_tokens=None,
get_rprompt_tokens=None,
get_bottom_toolbar_tokens=None,
display_comple... | return HSplit([
# The main input, with completion menus floating on top of it.
FloatContainer(
HSplit([
ConditionalContainer(
Window(
TokenListControl(get_prompt_tokens_1),
dont_extend_height=True),
... | Create a :class:`.Container` instance for a prompt.
:param message: Text to be used as prompt.
:param lexer: :class:`~prompt_toolkit.layout.lexers.Lexer` to be used for
the highlighting.
:param is_password: `bool` or :class:`~prompt_toolkit.filters.CLIFilter`.
When True, display input as '*... | Create a :class:`.Container` instance for a prompt. | [
"Create",
"a",
":",
"class",
":",
".",
"Container",
"instance",
"for",
"a",
"prompt",
"."
] | def create_prompt_layout(message='', lexer=None, is_password=False,
reserve_space_for_menu=8,
get_prompt_tokens=None, get_continuation_tokens=None,
get_rprompt_tokens=None,
get_bottom_toolbar_tokens=None,
... | [
"def",
"create_prompt_layout",
"(",
"message",
"=",
"''",
",",
"lexer",
"=",
"None",
",",
"is_password",
"=",
"False",
",",
"reserve_space_for_menu",
"=",
"8",
",",
"get_prompt_tokens",
"=",
"None",
",",
"get_continuation_tokens",
"=",
"None",
",",
"get_rprompt_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/shortcuts.py#L192-L360 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/shapedbutton.py | python | SButton._GetLabelSize | (self) | return w, h, True | Used internally | Used internally | [
"Used",
"internally"
] | def _GetLabelSize(self):
""" Used internally """
w, h = self.GetTextExtent(self.GetLabel())
return w, h, True | [
"def",
"_GetLabelSize",
"(",
"self",
")",
":",
"w",
",",
"h",
"=",
"self",
".",
"GetTextExtent",
"(",
"self",
".",
"GetLabel",
"(",
")",
")",
"return",
"w",
",",
"h",
",",
"True"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shapedbutton.py#L513-L517 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | tools/fast_nvcc/fast_nvcc.py | python | write_log_csv | (
command_parts: List[List[str]],
command_results: List[Result],
*,
filename: str,
) | Write a CSV file of the times and /tmp file sizes from each command. | Write a CSV file of the times and /tmp file sizes from each command. | [
"Write",
"a",
"CSV",
"file",
"of",
"the",
"times",
"and",
"/",
"tmp",
"file",
"sizes",
"from",
"each",
"command",
"."
] | def write_log_csv(
command_parts: List[List[str]],
command_results: List[Result],
*,
filename: str,
) -> None:
"""
Write a CSV file of the times and /tmp file sizes from each command.
"""
tmp_files: List[str] = []
for result in command_results:
tmp_files.extend(result.get('fi... | [
"def",
"write_log_csv",
"(",
"command_parts",
":",
"List",
"[",
"List",
"[",
"str",
"]",
"]",
",",
"command_results",
":",
"List",
"[",
"Result",
"]",
",",
"*",
",",
"filename",
":",
"str",
",",
")",
"->",
"None",
":",
"tmp_files",
":",
"List",
"[",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/fast_nvcc/fast_nvcc.py#L447-L466 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/analyzer.py | python | _NamesNotIn | (names, mapping) | return [name for name in names if name not in mapping] | Returns a list of the values in |names| that are not in |mapping|. | Returns a list of the values in |names| that are not in |mapping|. | [
"Returns",
"a",
"list",
"of",
"the",
"values",
"in",
"|names|",
"that",
"are",
"not",
"in",
"|mapping|",
"."
] | def _NamesNotIn(names, mapping):
"""Returns a list of the values in |names| that are not in |mapping|."""
return [name for name in names if name not in mapping] | [
"def",
"_NamesNotIn",
"(",
"names",
",",
"mapping",
")",
":",
"return",
"[",
"name",
"for",
"name",
"in",
"names",
"if",
"name",
"not",
"in",
"mapping",
"]"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/analyzer.py#L507-L509 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/estimator/run_config.py | python | _validate_service | (service) | return service | Validates the service key. | Validates the service key. | [
"Validates",
"the",
"service",
"key",
"."
] | def _validate_service(service):
"""Validates the service key."""
if service is not None and not isinstance(service, dict):
raise TypeError(
'If "service" is set in TF_CONFIG, it must be a dict. Given %s' %
type(service))
return service | [
"def",
"_validate_service",
"(",
"service",
")",
":",
"if",
"service",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"service",
",",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"'If \"service\" is set in TF_CONFIG, it must be a dict. Given %s'",
"%",
"type"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/estimator/run_config.py#L105-L111 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.ComputeExportEnvString | (self, env) | return ' '.join(export_str) | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell. | [
"Given",
"an",
"environment",
"returns",
"a",
"string",
"looking",
"like",
"export",
"FOO",
"=",
"foo",
";",
"export",
"BAR",
"=",
"$",
"{",
"FOO",
"}",
"bar",
";",
"that",
"exports",
"|env|",
"to",
"the",
"shell",
"."
] | def ComputeExportEnvString(self, env):
"""Given an environment, returns a string looking like
'export FOO=foo; export BAR="${FOO} bar;'
that exports |env| to the shell."""
export_str = []
for k, v in env:
export_str.append('export %s=%s;' %
(k, ninja_syntax.escape(gyp.common.Enco... | [
"def",
"ComputeExportEnvString",
"(",
"self",
",",
"env",
")",
":",
"export_str",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"env",
":",
"export_str",
".",
"append",
"(",
"'export %s=%s;'",
"%",
"(",
"k",
",",
"ninja_syntax",
".",
"escape",
"(",
"gyp",... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py#L1038-L1046 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/p4util/text.py | python | find_approximate_string_matches | (seq1, options, max_distance) | return [seq2 for seq2 in options if (levenshtein(seq1, seq2) <= max_distance)] | Find list of approximate (within `max_distance`) matches to string `seq1` among `options`. | Find list of approximate (within `max_distance`) matches to string `seq1` among `options`. | [
"Find",
"list",
"of",
"approximate",
"(",
"within",
"max_distance",
")",
"matches",
"to",
"string",
"seq1",
"among",
"options",
"."
] | def find_approximate_string_matches(seq1, options, max_distance):
"""Find list of approximate (within `max_distance`) matches to string `seq1` among `options`."""
return [seq2 for seq2 in options if (levenshtein(seq1, seq2) <= max_distance)] | [
"def",
"find_approximate_string_matches",
"(",
"seq1",
",",
"options",
",",
"max_distance",
")",
":",
"return",
"[",
"seq2",
"for",
"seq2",
"in",
"options",
"if",
"(",
"levenshtein",
"(",
"seq1",
",",
"seq2",
")",
"<=",
"max_distance",
")",
"]"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/p4util/text.py#L226-L229 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListHeaderData.HasImage | (self) | return len(self._image) > 0 | Returns ``True`` if the header item has at least one image associated
with it. | Returns ``True`` if the header item has at least one image associated
with it. | [
"Returns",
"True",
"if",
"the",
"header",
"item",
"has",
"at",
"least",
"one",
"image",
"associated",
"with",
"it",
"."
] | def HasImage(self):
"""
Returns ``True`` if the header item has at least one image associated
with it.
"""
return len(self._image) > 0 | [
"def",
"HasImage",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_image",
")",
">",
"0"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L3434-L3440 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events._2a_ | (self, _object, _attributes={}, **_arguments) | *: Multiplication
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | *: Multiplication
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"*",
":",
"Multiplication",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def _2a_(self, _object, _attributes={}, **_arguments):
"""*: Multiplication
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = '* '
if _arguments: raise... | [
"def",
"_2a_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'* '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L36-L55 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetPerTargetSettings | (self) | return result | Gets a list of all the per-target settings. This will only fetch keys
whose values are the same across all configurations. | Gets a list of all the per-target settings. This will only fetch keys
whose values are the same across all configurations. | [
"Gets",
"a",
"list",
"of",
"all",
"the",
"per",
"-",
"target",
"settings",
".",
"This",
"will",
"only",
"fetch",
"keys",
"whose",
"values",
"are",
"the",
"same",
"across",
"all",
"configurations",
"."
] | def GetPerTargetSettings(self):
"""Gets a list of all the per-target settings. This will only fetch keys
whose values are the same across all configurations."""
first_pass = True
result = {}
for configname in sorted(self.xcode_settings.keys()):
if first_pass:
result = dict(self.xcode_s... | [
"def",
"GetPerTargetSettings",
"(",
"self",
")",
":",
"first_pass",
"=",
"True",
"result",
"=",
"{",
"}",
"for",
"configname",
"in",
"sorted",
"(",
"self",
".",
"xcode_settings",
".",
"keys",
"(",
")",
")",
":",
"if",
"first_pass",
":",
"result",
"=",
... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py#L956-L971 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | register_finder | (importer_type, distribution_finder) | Register `distribution_finder` to find distributions in sys.path items
`importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
handler), and `distribution_finder` is a callable that, passed a path
item and the importer instance, yields ``Distribution`` instances found on
that path i... | Register `distribution_finder` to find distributions in sys.path items | [
"Register",
"distribution_finder",
"to",
"find",
"distributions",
"in",
"sys",
".",
"path",
"items"
] | def register_finder(importer_type, distribution_finder):
"""Register `distribution_finder` to find distributions in sys.path items
`importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
handler), and `distribution_finder` is a callable that, passed a path
item and the importer inst... | [
"def",
"register_finder",
"(",
"importer_type",
",",
"distribution_finder",
")",
":",
"_distribution_finders",
"[",
"importer_type",
"]",
"=",
"distribution_finder"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1940-L1947 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._get_internal_timestep_index | (self, timestep) | return self.timesteps.index(timestep) | Return the local timestep index. | Return the local timestep index. | [
"Return",
"the",
"local",
"timestep",
"index",
"."
] | def _get_internal_timestep_index(self, timestep):
"""Return the local timestep index."""
[timestep] = self._format_id_list([timestep],
self.get_timesteps(),
'timestep',
single=Tr... | [
"def",
"_get_internal_timestep_index",
"(",
"self",
",",
"timestep",
")",
":",
"[",
"timestep",
"]",
"=",
"self",
".",
"_format_id_list",
"(",
"[",
"timestep",
"]",
",",
"self",
".",
"get_timesteps",
"(",
")",
",",
"'timestep'",
",",
"single",
"=",
"True",... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L3330-L3336 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | Pythonwin/pywin/scintilla/view.py | python | CScintillaView.FormatRange | (self, dc, pageStart, lengthDoc, rc, draw) | return nextPageStart | typedef struct _formatrange {
HDC hdc;
HDC hdcTarget;
RECT rc;
RECT rcPage;
CHARRANGE chrg;} FORMATRANGE; | typedef struct _formatrange {
HDC hdc;
HDC hdcTarget;
RECT rc;
RECT rcPage;
CHARRANGE chrg;} FORMATRANGE; | [
"typedef",
"struct",
"_formatrange",
"{",
"HDC",
"hdc",
";",
"HDC",
"hdcTarget",
";",
"RECT",
"rc",
";",
"RECT",
"rcPage",
";",
"CHARRANGE",
"chrg",
";",
"}",
"FORMATRANGE",
";"
] | def FormatRange(self, dc, pageStart, lengthDoc, rc, draw):
"""
typedef struct _formatrange {
HDC hdc;
HDC hdcTarget;
RECT rc;
RECT rcPage;
CHARRANGE chrg;} FORMATRANGE;
"""
fmt = "PPIIIIIIIIll"
hdcRen... | [
"def",
"FormatRange",
"(",
"self",
",",
"dc",
",",
"pageStart",
",",
"lengthDoc",
",",
"rc",
",",
"draw",
")",
":",
"fmt",
"=",
"\"PPIIIIIIIIll\"",
"hdcRender",
"=",
"dc",
".",
"GetHandleOutput",
"(",
")",
"hdcFormat",
"=",
"dc",
".",
"GetHandleAttrib",
... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/scintilla/view.py#L756-L784 | |
deweylab/RSEM | e4dda70e90fb5eb9b831306f1c381f8bbf71ef0e | pRSEM/Prsem.py | python | calTSSBodyTESMappability | (trs, prm, out_q) | calculate average mappability around TSS, body, and TES for all transcripts of
given list of genes
save results in transcript's attribute | calculate average mappability around TSS, body, and TES for all transcripts of
given list of genes | [
"calculate",
"average",
"mappability",
"around",
"TSS",
"body",
"and",
"TES",
"for",
"all",
"transcripts",
"of",
"given",
"list",
"of",
"genes"
] | def calTSSBodyTESMappability(trs, prm, out_q):
"""
calculate average mappability around TSS, body, and TES for all transcripts of
given list of genes
save results in transcript's attribute
"""
outdict = {}
for tr in trs:
tr.calculateMappability(prm.bigwigsummary_bin, prm.mappability_bigwig_file,
... | [
"def",
"calTSSBodyTESMappability",
"(",
"trs",
",",
"prm",
",",
"out_q",
")",
":",
"outdict",
"=",
"{",
"}",
"for",
"tr",
"in",
"trs",
":",
"tr",
".",
"calculateMappability",
"(",
"prm",
".",
"bigwigsummary_bin",
",",
"prm",
".",
"mappability_bigwig_file",
... | https://github.com/deweylab/RSEM/blob/e4dda70e90fb5eb9b831306f1c381f8bbf71ef0e/pRSEM/Prsem.py#L105-L118 | ||
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | wutils.py | python | run_program | (program_string, env, command_template=None, cwd=None, visualize=False) | return run_argv(execvec, env, cwd=cwd) | if command_template is not None, then program_string == program
name and argv is given by command_template with %s replaced by the
full path to the program. Else, program_string is interpreted as
a shell command with first name being the program name. | if command_template is not None, then program_string == program
name and argv is given by command_template with %s replaced by the
full path to the program. Else, program_string is interpreted as
a shell command with first name being the program name. | [
"if",
"command_template",
"is",
"not",
"None",
"then",
"program_string",
"==",
"program",
"name",
"and",
"argv",
"is",
"given",
"by",
"command_template",
"with",
"%s",
"replaced",
"by",
"the",
"full",
"path",
"to",
"the",
"program",
".",
"Else",
"program_strin... | def run_program(program_string, env, command_template=None, cwd=None, visualize=False):
"""
if command_template is not None, then program_string == program
name and argv is given by command_template with %s replaced by the
full path to the program. Else, program_string is interpreted as
a shell com... | [
"def",
"run_program",
"(",
"program_string",
",",
"env",
",",
"command_template",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"visualize",
"=",
"False",
")",
":",
"dummy_program_name",
",",
"execvec",
"=",
"get_run_program",
"(",
"program_string",
",",
"command... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/wutils.py#L223-L238 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGValidationInfo.SetFailureBehavior | (*args, **kwargs) | return _propgrid.PGValidationInfo_SetFailureBehavior(*args, **kwargs) | SetFailureBehavior(self, char failureBehavior) | SetFailureBehavior(self, char failureBehavior) | [
"SetFailureBehavior",
"(",
"self",
"char",
"failureBehavior",
")"
] | def SetFailureBehavior(*args, **kwargs):
"""SetFailureBehavior(self, char failureBehavior)"""
return _propgrid.PGValidationInfo_SetFailureBehavior(*args, **kwargs) | [
"def",
"SetFailureBehavior",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGValidationInfo_SetFailureBehavior",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1901-L1903 | |
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | tools/align_tool/align_with_onnx.py | python | AlignOnnx._write_data | (self, text_path, data) | too difficult to write, I don't want to do this again. :(
If anyone has better way to realizing, pls tell me or PR. | too difficult to write, I don't want to do this again. :(
If anyone has better way to realizing, pls tell me or PR. | [
"too",
"difficult",
"to",
"write",
"I",
"don",
"t",
"want",
"to",
"do",
"this",
"again",
".",
":",
"(",
"If",
"anyone",
"has",
"better",
"way",
"to",
"realizing",
"pls",
"tell",
"me",
"or",
"PR",
"."
] | def _write_data(self, text_path, data):
"""
too difficult to write, I don't want to do this again. :(
If anyone has better way to realizing, pls tell me or PR.
"""
shape_str = '{' + ' '.join([str(i) for i in data.shape]) + '}'
mat_shape = data.shape
data = data.f... | [
"def",
"_write_data",
"(",
"self",
",",
"text_path",
",",
"data",
")",
":",
"shape_str",
"=",
"'{'",
"+",
"' '",
".",
"join",
"(",
"[",
"str",
"(",
"i",
")",
"for",
"i",
"in",
"data",
".",
"shape",
"]",
")",
"+",
"'}'",
"mat_shape",
"=",
"data",
... | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/tools/align_tool/align_with_onnx.py#L151-L189 | ||
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | scripts/cpp_lint.py | python | _NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L1940-L1946 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/tkSimpleDialog.py | python | Dialog.body | (self, master) | create dialog body.
return widget that should have initial focus.
This method should be overridden, and is called
by the __init__ method. | create dialog body. | [
"create",
"dialog",
"body",
"."
] | def body(self, master):
'''create dialog body.
return widget that should have initial focus.
This method should be overridden, and is called
by the __init__ method.
'''
pass | [
"def",
"body",
"(",
"self",
",",
"master",
")",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/tkSimpleDialog.py#L96-L103 | ||
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/log_likelihood_mcmc.py | python | GaussianProcessLogLikelihoodMCMC._points_sampled_value | (self) | return self._historical_data.points_sampled_value | Return the function values measured at each of points_sampled; see :class:`moe.optimal_learning.python.data_containers.HistoricalData`. | Return the function values measured at each of points_sampled; see :class:`moe.optimal_learning.python.data_containers.HistoricalData`. | [
"Return",
"the",
"function",
"values",
"measured",
"at",
"each",
"of",
"points_sampled",
";",
"see",
":",
"class",
":",
"moe",
".",
"optimal_learning",
".",
"python",
".",
"data_containers",
".",
"HistoricalData",
"."
] | def _points_sampled_value(self):
"""Return the function values measured at each of points_sampled; see :class:`moe.optimal_learning.python.data_containers.HistoricalData`."""
return self._historical_data.points_sampled_value | [
"def",
"_points_sampled_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_historical_data",
".",
"points_sampled_value"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/log_likelihood_mcmc.py#L140-L142 | |
xenia-project/xenia | 9b1fdac98665ac091b9660a5d0fbb259ed79e578 | third_party/google-styleguide/cpplint/cpplint.py | python | GetIndentLevel | (line) | Return the number of leading spaces in line.
Args:
line: A string to check.
Returns:
An integer count of leading spaces, possibly zero. | Return the number of leading spaces in line. | [
"Return",
"the",
"number",
"of",
"leading",
"spaces",
"in",
"line",
"."
] | def GetIndentLevel(line):
"""Return the number of leading spaces in line.
Args:
line: A string to check.
Returns:
An integer count of leading spaces, possibly zero.
"""
indent = Match(r'^( *)\S', line)
if indent:
return len(indent.group(1))
else:
return 0 | [
"def",
"GetIndentLevel",
"(",
"line",
")",
":",
"indent",
"=",
"Match",
"(",
"r'^( *)\\S'",
",",
"line",
")",
"if",
"indent",
":",
"return",
"len",
"(",
"indent",
".",
"group",
"(",
"1",
")",
")",
"else",
":",
"return",
"0"
] | https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L1520-L1533 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/actionlib/src/actionlib/server_goal_handle.py | python | ServerGoalHandle.set_cancel_requested | (self) | return False | A private method to set status to PENDING or RECALLING
@return True if the cancel request should be passed on to the user, false otherwise | A private method to set status to PENDING or RECALLING | [
"A",
"private",
"method",
"to",
"set",
"status",
"to",
"PENDING",
"or",
"RECALLING"
] | def set_cancel_requested(self):
"""
A private method to set status to PENDING or RECALLING
@return True if the cancel request should be passed on to the user, false otherwise
"""
rospy.logdebug("Transisitoning to a cancel requested state on goal id: %s, stamp: %.2f",
... | [
"def",
"set_cancel_requested",
"(",
"self",
")",
":",
"rospy",
".",
"logdebug",
"(",
"\"Transisitoning to a cancel requested state on goal id: %s, stamp: %.2f\"",
",",
"self",
".",
"get_goal_id",
"(",
")",
".",
"id",
",",
"self",
".",
"get_goal_id",
"(",
")",
".",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/actionlib/src/actionlib/server_goal_handle.py#L299-L319 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py | python | Cursor.brief_comment | (self) | return conf.lib.clang_Cursor_getBriefCommentText(self) | Returns the brief comment text associated with that Cursor | Returns the brief comment text associated with that Cursor | [
"Returns",
"the",
"brief",
"comment",
"text",
"associated",
"with",
"that",
"Cursor"
] | def brief_comment(self):
"""Returns the brief comment text associated with that Cursor"""
return conf.lib.clang_Cursor_getBriefCommentText(self) | [
"def",
"brief_comment",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Cursor_getBriefCommentText",
"(",
"self",
")"
] | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L1638-L1640 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/emma_coverage_stats.py | python | _EmmaCoverageStats.GetCoverageDict | (self, lines_for_coverage) | return {
'files': file_coverage,
'patch': {
'incremental': {
'covered': num_covered_lines,
'total': num_total_lines
}
}
} | Returns a dict containing detailed coverage information.
Gets detailed coverage stats for each file specified in the
|lines_for_coverage| dict and the total incremental number of lines covered
and executable for all files in |lines_for_coverage|.
Args:
lines_for_coverage: A dict mapping Java sou... | Returns a dict containing detailed coverage information. | [
"Returns",
"a",
"dict",
"containing",
"detailed",
"coverage",
"information",
"."
] | def GetCoverageDict(self, lines_for_coverage):
"""Returns a dict containing detailed coverage information.
Gets detailed coverage stats for each file specified in the
|lines_for_coverage| dict and the total incremental number of lines covered
and executable for all files in |lines_for_coverage|.
A... | [
"def",
"GetCoverageDict",
"(",
"self",
",",
"lines_for_coverage",
")",
":",
"file_coverage",
"=",
"{",
"}",
"for",
"file_path",
",",
"line_numbers",
"in",
"lines_for_coverage",
".",
"iteritems",
"(",
")",
":",
"file_coverage_dict",
"=",
"self",
".",
"GetCoverage... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/emma_coverage_stats.py#L241-L279 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py | python | PimpPackage.filterExpectedSkips | (self, names) | return newnames | Return a list that contains only unpexpected skips | Return a list that contains only unpexpected skips | [
"Return",
"a",
"list",
"that",
"contains",
"only",
"unpexpected",
"skips"
] | def filterExpectedSkips(self, names):
"""Return a list that contains only unpexpected skips"""
if not self._db.preferences.isUserInstall():
return names
expected_skips = self._dict.get('User-install-skips')
if not expected_skips:
return names
newnames = []... | [
"def",
"filterExpectedSkips",
"(",
"self",
",",
"names",
")",
":",
"if",
"not",
"self",
".",
"_db",
".",
"preferences",
".",
"isUserInstall",
"(",
")",
":",
"return",
"names",
"expected_skips",
"=",
"self",
".",
"_dict",
".",
"get",
"(",
"'User-install-ski... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py#L775-L789 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/ascii_boards.py | python | render_grid | (point_formatter, size) | return result | Render a board-shaped grid as a list of strings.
point_formatter -- function (row, col) -> string of length 2.
Returns a list of strings. | Render a board-shaped grid as a list of strings. | [
"Render",
"a",
"board",
"-",
"shaped",
"grid",
"as",
"a",
"list",
"of",
"strings",
"."
] | def render_grid(point_formatter, size):
"""Render a board-shaped grid as a list of strings.
point_formatter -- function (row, col) -> string of length 2.
Returns a list of strings.
"""
column_header_string = " ".join(column_letters[i] for i in range(size))
result = []
if size > 9:
... | [
"def",
"render_grid",
"(",
"point_formatter",
",",
"size",
")",
":",
"column_header_string",
"=",
"\" \"",
".",
"join",
"(",
"column_letters",
"[",
"i",
"]",
"for",
"i",
"in",
"range",
"(",
"size",
")",
")",
"result",
"=",
"[",
"]",
"if",
"size",
">",
... | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/ascii_boards.py#L6-L27 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/nntplib.py | python | NNTP.slave | (self) | return self.shortcmd('SLAVE') | Process a SLAVE command. Returns:
- resp: server response if successful | Process a SLAVE command. Returns:
- resp: server response if successful | [
"Process",
"a",
"SLAVE",
"command",
".",
"Returns",
":",
"-",
"resp",
":",
"server",
"response",
"if",
"successful"
] | def slave(self):
"""Process a SLAVE command. Returns:
- resp: server response if successful"""
return self.shortcmd('SLAVE') | [
"def",
"slave",
"(",
"self",
")",
":",
"return",
"self",
".",
"shortcmd",
"(",
"'SLAVE'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/nntplib.py#L455-L459 | |
kevinlin311tw/cvpr16-deepbit | c60fb3233d7d534cfcee9d3ed47d77af437ee32a | python/caffe/draw.py | python | get_edge_label | (layer) | return edge_label | Define edge label based on layer type. | Define edge label based on layer type. | [
"Define",
"edge",
"label",
"based",
"on",
"layer",
"type",
"."
] | def get_edge_label(layer):
"""Define edge label based on layer type.
"""
if layer.type == 'Data':
edge_label = 'Batch ' + str(layer.data_param.batch_size)
elif layer.type == 'Convolution':
edge_label = str(layer.convolution_param.num_output)
elif layer.type == 'InnerProduct':
... | [
"def",
"get_edge_label",
"(",
"layer",
")",
":",
"if",
"layer",
".",
"type",
"==",
"'Data'",
":",
"edge_label",
"=",
"'Batch '",
"+",
"str",
"(",
"layer",
".",
"data_param",
".",
"batch_size",
")",
"elif",
"layer",
".",
"type",
"==",
"'Convolution'",
":"... | https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/python/caffe/draw.py#L37-L50 | |
cmu-db/bustub | fe1b9e984bd2967997b52df872c873d80f71cf7d | build_support/cpplint.py | python | FindNextMultiLineCommentStart | (lines, lineix) | return len(lines) | Find the beginning marker for a multiline comment. | Find the beginning marker for a multiline comment. | [
"Find",
"the",
"beginning",
"marker",
"for",
"a",
"multiline",
"comment",
"."
] | def FindNextMultiLineCommentStart(lines, lineix):
"""Find the beginning marker for a multiline comment."""
while lineix < len(lines):
if lines[lineix].strip().startswith('/*'):
# Only return this marker if the comment goes beyond this line
if lines[lineix].strip().find('*/', 2) < 0:
return l... | [
"def",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"startswith",
"(",
"'/*'",
")",
":",
"# Only return this... | https://github.com/cmu-db/bustub/blob/fe1b9e984bd2967997b52df872c873d80f71cf7d/build_support/cpplint.py#L1589-L1597 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/abc.py | python | Finder.find_module | (self, fullname, path=None) | An abstract method that should find a module.
The fullname is a str and the optional path is a str or None.
Returns a Loader object or None. | An abstract method that should find a module.
The fullname is a str and the optional path is a str or None.
Returns a Loader object or None. | [
"An",
"abstract",
"method",
"that",
"should",
"find",
"a",
"module",
".",
"The",
"fullname",
"is",
"a",
"str",
"and",
"the",
"optional",
"path",
"is",
"a",
"str",
"or",
"None",
".",
"Returns",
"a",
"Loader",
"object",
"or",
"None",
"."
] | def find_module(self, fullname, path=None):
"""An abstract method that should find a module.
The fullname is a str and the optional path is a str or None.
Returns a Loader object or None.
""" | [
"def",
"find_module",
"(",
"self",
",",
"fullname",
",",
"path",
"=",
"None",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/abc.py#L43-L47 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/compiler.py | python | CUDAKernel.inspect_llvm | (self) | return str(self._func.ptx.llvmir) | Returns the LLVM IR for this kernel. | Returns the LLVM IR for this kernel. | [
"Returns",
"the",
"LLVM",
"IR",
"for",
"this",
"kernel",
"."
] | def inspect_llvm(self):
'''
Returns the LLVM IR for this kernel.
'''
return str(self._func.ptx.llvmir) | [
"def",
"inspect_llvm",
"(",
"self",
")",
":",
"return",
"str",
"(",
"self",
".",
"_func",
".",
"ptx",
".",
"llvmir",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/compiler.py#L564-L568 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__setitem__ | (self, key, value) | Sets the item on the specified position. | Sets the item on the specified position. | [
"Sets",
"the",
"item",
"on",
"the",
"specified",
"position",
"."
] | def __setitem__(self, key, value):
"""Sets the item on the specified position."""
# No need to call TransitionToNonempty(), since if we're able to
# set the element at this index, we were already nonempty before
# this method was called.
self._message_listener.ByteSizeDirty()
self._type_checker.... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"# No need to call TransitionToNonempty(), since if we're able to",
"# set the element at this index, we were already nonempty before",
"# this method was called.",
"self",
".",
"_message_listener",
".",
"ByteSi... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/internal/containers.py#L129-L136 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.abs | (self, *args, **kwargs) | return op.abs(self, *args, **kwargs) | Convenience fluent method for :py:func:`abs`.
The arguments are the same as for :py:func:`abs`, with
this array as data. | Convenience fluent method for :py:func:`abs`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"abs",
"."
] | def abs(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`abs`.
The arguments are the same as for :py:func:`abs`, with
this array as data.
"""
return op.abs(self, *args, **kwargs) | [
"def",
"abs",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"abs",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1140-L1146 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/gallery.py | python | RibbonGallery.OnPaint | (self, event) | Handles the ``wx.EVT_PAINT`` event for :class:`RibbonGallery`.
:param `event`: a :class:`PaintEvent` event to be processed. | Handles the ``wx.EVT_PAINT`` event for :class:`RibbonGallery`. | [
"Handles",
"the",
"wx",
".",
"EVT_PAINT",
"event",
"for",
":",
"class",
":",
"RibbonGallery",
"."
] | def OnPaint(self, event):
"""
Handles the ``wx.EVT_PAINT`` event for :class:`RibbonGallery`.
:param `event`: a :class:`PaintEvent` event to be processed.
"""
dc = wx.AutoBufferedPaintDC(self)
if self._art == None:
return
self._art.DrawGalleryBackgr... | [
"def",
"OnPaint",
"(",
"self",
",",
"event",
")",
":",
"dc",
"=",
"wx",
".",
"AutoBufferedPaintDC",
"(",
"self",
")",
"if",
"self",
".",
"_art",
"==",
"None",
":",
"return",
"self",
".",
"_art",
".",
"DrawGalleryBackground",
"(",
"dc",
",",
"self",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/gallery.py#L557-L594 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/shape_base.py | python | tile | (A, reps) | return c.reshape(shape_out) | Construct an array by repeating A the number of times given by reps.
If `reps` has length ``d``, the result will have dimension of
``max(d, A.ndim)``.
If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new
axes. So a shape (3,) array is promoted to (1, 3) for 2-D replication,
or ... | Construct an array by repeating A the number of times given by reps. | [
"Construct",
"an",
"array",
"by",
"repeating",
"A",
"the",
"number",
"of",
"times",
"given",
"by",
"reps",
"."
] | def tile(A, reps):
"""
Construct an array by repeating A the number of times given by reps.
If `reps` has length ``d``, the result will have dimension of
``max(d, A.ndim)``.
If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new
axes. So a shape (3,) array is promoted to (1, ... | [
"def",
"tile",
"(",
"A",
",",
"reps",
")",
":",
"try",
":",
"tup",
"=",
"tuple",
"(",
"reps",
")",
"except",
"TypeError",
":",
"tup",
"=",
"(",
"reps",
",",
")",
"d",
"=",
"len",
"(",
"tup",
")",
"if",
"all",
"(",
"x",
"==",
"1",
"for",
"x"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/shape_base.py#L1170-L1258 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/ops.py | python | Operation.node_def | (self) | return self._node_def | Returns a serialized `NodeDef` representation of this operation.
Returns:
A
[`NodeDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto)
protocol buffer. | Returns a serialized `NodeDef` representation of this operation. | [
"Returns",
"a",
"serialized",
"NodeDef",
"representation",
"of",
"this",
"operation",
"."
] | def node_def(self):
"""Returns a serialized `NodeDef` representation of this operation.
Returns:
A
[`NodeDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto)
protocol buffer.
"""
return self._node_def | [
"def",
"node_def",
"(",
"self",
")",
":",
"return",
"self",
".",
"_node_def"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L1486-L1494 | |
NVlabs/fermat | 06e8c03ac59ab440cbb13897f90631ef1861e769 | contrib/assimp-4.1.0/port/PyAssimp/scripts/3d_viewer.py | python | PyAssimp3DViewer.recursive_render | (self, node, shader, mode=BASE, with_normals=True) | Main recursive rendering method. | Main recursive rendering method. | [
"Main",
"recursive",
"rendering",
"method",
"."
] | def recursive_render(self, node, shader, mode=BASE, with_normals=True):
""" Main recursive rendering method.
"""
normals = with_normals
if mode == COLORS:
normals = False
if not hasattr(node, "selected"):
node.selected = False
m = get_world_tr... | [
"def",
"recursive_render",
"(",
"self",
",",
"node",
",",
"shader",
",",
"mode",
"=",
"BASE",
",",
"with_normals",
"=",
"True",
")",
":",
"normals",
"=",
"with_normals",
"if",
"mode",
"==",
"COLORS",
":",
"normals",
"=",
"False",
"if",
"not",
"hasattr",
... | https://github.com/NVlabs/fermat/blob/06e8c03ac59ab440cbb13897f90631ef1861e769/contrib/assimp-4.1.0/port/PyAssimp/scripts/3d_viewer.py#L964-L1062 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/serialposix.py | python | Serial.cd | (self) | return struct.unpack('I', s)[0] & TIOCM_CD != 0 | Read terminal status line: Carrier Detect | Read terminal status line: Carrier Detect | [
"Read",
"terminal",
"status",
"line",
":",
"Carrier",
"Detect"
] | def cd(self):
"""Read terminal status line: Carrier Detect"""
if not self.is_open:
raise portNotOpenError
s = fcntl.ioctl(self.fd, TIOCMGET, TIOCM_zero_str)
return struct.unpack('I', s)[0] & TIOCM_CD != 0 | [
"def",
"cd",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"s",
"=",
"fcntl",
".",
"ioctl",
"(",
"self",
".",
"fd",
",",
"TIOCMGET",
",",
"TIOCM_zero_str",
")",
"return",
"struct",
".",
"unpack",
"(",
"... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialposix.py#L663-L668 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/importIFCmulticore.py | python | writeProgress | (count=None,total=None,starttime=None) | write progress to console | write progress to console | [
"write",
"progress",
"to",
"console"
] | def writeProgress(count=None,total=None,starttime=None):
"""write progress to console"""
if not FreeCAD.GuiUp:
if count is None:
sys.stdout.write("\r")
return
r = count/total
elapsed = round(time.time()-starttime,1)
if r:
rest = elapsed*((1-r... | [
"def",
"writeProgress",
"(",
"count",
"=",
"None",
",",
"total",
"=",
"None",
",",
"starttime",
"=",
"None",
")",
":",
"if",
"not",
"FreeCAD",
".",
"GuiUp",
":",
"if",
"count",
"is",
"None",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"\"\\r\"",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFCmulticore.py#L137-L154 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/stepper.py | python | NodeStepper.output_slots_in_closure | (self, node_name) | return tensor_slots | Get the output tensors in the transitive closure from node.
Args:
node_name: (str) Name of the node in question.
Returns:
(list of int) Output slots of the output tensors of the node that are in
the transitive closure of the stepper. | Get the output tensors in the transitive closure from node. | [
"Get",
"the",
"output",
"tensors",
"in",
"the",
"transitive",
"closure",
"from",
"node",
"."
] | def output_slots_in_closure(self, node_name):
"""Get the output tensors in the transitive closure from node.
Args:
node_name: (str) Name of the node in question.
Returns:
(list of int) Output slots of the output tensors of the node that are in
the transitive closure of the stepper.
... | [
"def",
"output_slots_in_closure",
"(",
"self",
",",
"node_name",
")",
":",
"node",
"=",
"self",
".",
"_sess",
".",
"graph",
".",
"as_graph_element",
"(",
"node_name",
")",
"tensor_slots",
"=",
"[",
"]",
"for",
"i",
",",
"_",
"in",
"enumerate",
"(",
"node... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/stepper.py#L355-L374 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/psro_v2/strategy_selectors.py | python | top_k_probabilites_non_marginalized | (solver) | return used_policies | Returns [kwargs] policies with highest selection probabilities.
Args:
solver: A GenPSROSolver instance. | Returns [kwargs] policies with highest selection probabilities. | [
"Returns",
"[",
"kwargs",
"]",
"policies",
"with",
"highest",
"selection",
"probabilities",
"."
] | def top_k_probabilites_non_marginalized(solver):
"""Returns [kwargs] policies with highest selection probabilities.
Args:
solver: A GenPSROSolver instance.
"""
kwargs = solver.get_kwargs()
# By default, select only 1 new policy to optimize from.
number_policies_to_select = kwargs.get("number_policies_s... | [
"def",
"top_k_probabilites_non_marginalized",
"(",
"solver",
")",
":",
"kwargs",
"=",
"solver",
".",
"get_kwargs",
"(",
")",
"# By default, select only 1 new policy to optimize from.",
"number_policies_to_select",
"=",
"kwargs",
".",
"get",
"(",
"\"number_policies_selected\""... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/psro_v2/strategy_selectors.py#L380-L404 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/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/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L179-L198 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryengine/PyBtcWalletRecovery.py | python | PyBtcWalletRecovery.__init__ | (self) | Set of lists holding various errors at given indexes. Used at the end of
the recovery process to compile a wallet specific log of encountered
inconsistencies | Set of lists holding various errors at given indexes. Used at the end of
the recovery process to compile a wallet specific log of encountered
inconsistencies | [
"Set",
"of",
"lists",
"holding",
"various",
"errors",
"at",
"given",
"indexes",
".",
"Used",
"at",
"the",
"end",
"of",
"the",
"recovery",
"process",
"to",
"compile",
"a",
"wallet",
"specific",
"log",
"of",
"encountered",
"inconsistencies"
] | def __init__(self):
"""
Set of lists holding various errors at given indexes. Used at the end of
the recovery process to compile a wallet specific log of encountered
inconsistencies
"""
self.byteError = [] #byte errors
self.brokenSequence = [] #inconsistent address entry order... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"byteError",
"=",
"[",
"]",
"#byte errors",
"self",
".",
"brokenSequence",
"=",
"[",
"]",
"#inconsistent address entry order in the file",
"self",
".",
"sequenceGaps",
"=",
"[",
"]",
"#gaps in key pair chain",... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/PyBtcWalletRecovery.py#L43-L100 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/srv/_GetRoutePlan.py | python | GetRoutePlanRequest.deserialize | (self, str) | unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str`` | unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str`` | [
"unpack",
"serialized",
"message",
"in",
"str",
"into",
"this",
"message",
"instance",
":",
"param",
"str",
":",
"byte",
"array",
"of",
"serialized",
"message",
"str"
] | def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
if self.network is None:
self.network = uuid_msgs.msg.UniqueID()
if self.start is None:
self.start = uuid_msgs.msg.Un... | [
"def",
"deserialize",
"(",
"self",
",",
"str",
")",
":",
"try",
":",
"if",
"self",
".",
"network",
"is",
"None",
":",
"self",
".",
"network",
"=",
"uuid_msgs",
".",
"msg",
".",
"UniqueID",
"(",
")",
"if",
"self",
".",
"start",
"is",
"None",
":",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/srv/_GetRoutePlan.py#L97-L121 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/SearchDialogBase.py | python | SearchDialogBase.__init__ | (self, root, engine) | Initialize root, engine, and top attributes.
top (level widget): set in create_widgets() called from open().
text (Text searched): set in open(), only used in subclasses().
ent (ry): created in make_entry() called from create_entry().
row (of grid): 0 in create_widgets(), +1 in make_ent... | Initialize root, engine, and top attributes. | [
"Initialize",
"root",
"engine",
"and",
"top",
"attributes",
"."
] | def __init__(self, root, engine):
'''Initialize root, engine, and top attributes.
top (level widget): set in create_widgets() called from open().
text (Text searched): set in open(), only used in subclasses().
ent (ry): created in make_entry() called from create_entry().
row (of... | [
"def",
"__init__",
"(",
"self",
",",
"root",
",",
"engine",
")",
":",
"self",
".",
"root",
"=",
"root",
"self",
".",
"engine",
"=",
"engine",
"self",
".",
"top",
"=",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/SearchDialogBase.py#L31-L45 | ||
telefonicaid/fiware-orion | 27c3202b9ddcfb9e3635a0af8d373f76e89b1d24 | scripts/pdi-pep8.py | python | Checker.run_check | (self, check, argument_names) | return check(*arguments) | Run a check plugin. | Run a check plugin. | [
"Run",
"a",
"check",
"plugin",
"."
] | def run_check(self, check, argument_names):
"""
Run a check plugin.
"""
arguments = []
for name in argument_names:
arguments.append(getattr(self, name))
return check(*arguments) | [
"def",
"run_check",
"(",
"self",
",",
"check",
",",
"argument_names",
")",
":",
"arguments",
"=",
"[",
"]",
"for",
"name",
"in",
"argument_names",
":",
"arguments",
".",
"append",
"(",
"getattr",
"(",
"self",
",",
"name",
")",
")",
"return",
"check",
"... | https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/pdi-pep8.py#L853-L860 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TBPGraph.EndEI | (self) | return _snap.TBPGraph_EndEI(self) | EndEI(TBPGraph self) -> TBPGraph::TEdgeI
Parameters:
self: TBPGraph const * | EndEI(TBPGraph self) -> TBPGraph::TEdgeI | [
"EndEI",
"(",
"TBPGraph",
"self",
")",
"-",
">",
"TBPGraph",
"::",
"TEdgeI"
] | def EndEI(self):
"""
EndEI(TBPGraph self) -> TBPGraph::TEdgeI
Parameters:
self: TBPGraph const *
"""
return _snap.TBPGraph_EndEI(self) | [
"def",
"EndEI",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TBPGraph_EndEI",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5129-L5137 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pyparsing/py2/pyparsing.py | python | unicode_set.nums | (cls) | return u''.join(filter(unicode.isdigit, cls._get_chars_for_ranges())) | all numeric digit characters in this range | all numeric digit characters in this range | [
"all",
"numeric",
"digit",
"characters",
"in",
"this",
"range"
] | def nums(cls):
"all numeric digit characters in this range"
return u''.join(filter(unicode.isdigit, cls._get_chars_for_ranges())) | [
"def",
"nums",
"(",
"cls",
")",
":",
"return",
"u''",
".",
"join",
"(",
"filter",
"(",
"unicode",
".",
"isdigit",
",",
"cls",
".",
"_get_chars_for_ranges",
"(",
")",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py2/pyparsing.py#L6753-L6755 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.clear_tab | (self) | Clears tab at the current position. | Clears tab at the current position. | [
"Clears",
"tab",
"at",
"the",
"current",
"position",
"."
] | def clear_tab (self): # <ESC>[g
'''Clears tab at the current position.'''
pass | [
"def",
"clear_tab",
"(",
"self",
")",
":",
"# <ESC>[g",
"pass"
] | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L417-L420 | ||
facebook/mysql-5.6 | 65a650660ec7b4d627d1b738f397252ff4706207 | arcanist/lint/cpp_linter/cpplint.py | python | _FunctionState.End | (self) | Stop analyzing function body. | Stop analyzing function body. | [
"Stop",
"analyzing",
"function",
"body",
"."
] | def End(self):
"""Stop analyzing function body."""
self.in_a_function = False | [
"def",
"End",
"(",
"self",
")",
":",
"self",
".",
"in_a_function",
"=",
"False"
] | https://github.com/facebook/mysql-5.6/blob/65a650660ec7b4d627d1b738f397252ff4706207/arcanist/lint/cpp_linter/cpplint.py#L855-L857 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiNotebookEvent.SetDragSource | (*args, **kwargs) | return _aui.AuiNotebookEvent_SetDragSource(*args, **kwargs) | SetDragSource(self, AuiNotebook s) | SetDragSource(self, AuiNotebook s) | [
"SetDragSource",
"(",
"self",
"AuiNotebook",
"s",
")"
] | def SetDragSource(*args, **kwargs):
"""SetDragSource(self, AuiNotebook s)"""
return _aui.AuiNotebookEvent_SetDragSource(*args, **kwargs) | [
"def",
"SetDragSource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiNotebookEvent_SetDragSource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1084-L1086 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | LayoutConstraints.__init__ | (self, *args, **kwargs) | __init__(self) -> LayoutConstraints | __init__(self) -> LayoutConstraints | [
"__init__",
"(",
"self",
")",
"-",
">",
"LayoutConstraints"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> LayoutConstraints"""
_core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"LayoutConstraints_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_LayoutConstraints",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16353-L16355 | ||
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | python/caffe/io.py | python | load_image | (filename, color=True) | return img | Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type ... | Load an image converting from grayscale or alpha as needed. | [
"Load",
"an",
"image",
"converting",
"from",
"grayscale",
"or",
"alpha",
"as",
"needed",
"."
] | def load_image(filename, color=True):
"""
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
R... | [
"def",
"load_image",
"(",
"filename",
",",
"color",
"=",
"True",
")",
":",
"img",
"=",
"skimage",
".",
"img_as_float",
"(",
"skimage",
".",
"io",
".",
"imread",
"(",
"filename",
",",
"as_grey",
"=",
"not",
"color",
")",
")",
".",
"astype",
"(",
"np",... | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/python/caffe/io.py#L279-L303 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/linear_model/_least_angle.py | python | Lars._fit | (self, X, y, max_iter, alpha, fit_path, Xy=None) | return self | Auxiliary method to fit the model using X, y as training data | Auxiliary method to fit the model using X, y as training data | [
"Auxiliary",
"method",
"to",
"fit",
"the",
"model",
"using",
"X",
"y",
"as",
"training",
"data"
] | def _fit(self, X, y, max_iter, alpha, fit_path, Xy=None):
"""Auxiliary method to fit the model using X, y as training data"""
n_features = X.shape[1]
X, y, X_offset, y_offset, X_scale = self._preprocess_data(
X, y, self.fit_intercept, self.normalize, self.copy_X)
if y.ndim ... | [
"def",
"_fit",
"(",
"self",
",",
"X",
",",
"y",
",",
"max_iter",
",",
"alpha",
",",
"fit_path",
",",
"Xy",
"=",
"None",
")",
":",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"X",
",",
"y",
",",
"X_offset",
",",
"y_offset",
",",
"X_scal... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_least_angle.py#L878-L934 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/TaskGen.py | python | feature | (*k) | return deco | Decorator: register a task generator method that will be executed when the
object attribute 'feature' contains the corresponding key(s)::
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
def build(bld):
... | Decorator: register a task generator method that will be executed when the
object attribute 'feature' contains the corresponding key(s):: | [
"Decorator",
":",
"register",
"a",
"task",
"generator",
"method",
"that",
"will",
"be",
"executed",
"when",
"the",
"object",
"attribute",
"feature",
"contains",
"the",
"corresponding",
"key",
"(",
"s",
")",
"::"
] | def feature(*k):
"""
Decorator: register a task generator method that will be executed when the
object attribute 'feature' contains the corresponding key(s)::
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
... | [
"def",
"feature",
"(",
"*",
"k",
")",
":",
"def",
"deco",
"(",
"func",
")",
":",
"setattr",
"(",
"task_gen",
",",
"func",
".",
"__name__",
",",
"func",
")",
"for",
"name",
"in",
"k",
":",
"feats",
"[",
"name",
"]",
".",
"update",
"(",
"[",
"fun... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/TaskGen.py#L372-L392 | |
ndrplz/self-driving-car | 2bdcc7c822e8f03adc0a7490f1ae29a658720713 | project_12_road_segmentation/main_27.py | python | gen_test_output | (sess, logits, keep_prob, image_pl, data_folder, image_shape) | Generate test output using the test images
:param sess: TF session
:param logits: TF Tensor for the logits
:param keep_prob: TF Placeholder for the dropout keep robability
:param image_pl: TF Placeholder for the image placeholder
:param data_folder: Path to the folder that contains the datasets
... | Generate test output using the test images
:param sess: TF session
:param logits: TF Tensor for the logits
:param keep_prob: TF Placeholder for the dropout keep robability
:param image_pl: TF Placeholder for the image placeholder
:param data_folder: Path to the folder that contains the datasets
... | [
"Generate",
"test",
"output",
"using",
"the",
"test",
"images",
":",
"param",
"sess",
":",
"TF",
"session",
":",
"param",
"logits",
":",
"TF",
"Tensor",
"for",
"the",
"logits",
":",
"param",
"keep_prob",
":",
"TF",
"Placeholder",
"for",
"the",
"dropout",
... | def gen_test_output(sess, logits, keep_prob, image_pl, data_folder, image_shape):
"""
Generate test output using the test images
:param sess: TF session
:param logits: TF Tensor for the logits
:param keep_prob: TF Placeholder for the dropout keep robability
:param image_pl: TF Placeholder for th... | [
"def",
"gen_test_output",
"(",
"sess",
",",
"logits",
",",
"keep_prob",
",",
"image_pl",
",",
"data_folder",
",",
"image_shape",
")",
":",
"for",
"image_file",
"in",
"glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"data_folder",
",",
"'image_2'",
",",
... | https://github.com/ndrplz/self-driving-car/blob/2bdcc7c822e8f03adc0a7490f1ae29a658720713/project_12_road_segmentation/main_27.py#L64-L88 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/distributions/bernoulli.py | python | Bernoulli.probs | (self) | return self._probs | Probability of a `1` outcome (vs `0`). | Probability of a `1` outcome (vs `0`). | [
"Probability",
"of",
"a",
"1",
"outcome",
"(",
"vs",
"0",
")",
"."
] | def probs(self):
"""Probability of a `1` outcome (vs `0`)."""
return self._probs | [
"def",
"probs",
"(",
"self",
")",
":",
"return",
"self",
".",
"_probs"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/distributions/bernoulli.py#L99-L101 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/intelhex/__init__.py | python | IntelHex.frombytes | (self, bytes, offset=0) | Load data from array or list of bytes.
Similar to loadbin() method but works directly with iterable bytes. | Load data from array or list of bytes.
Similar to loadbin() method but works directly with iterable bytes. | [
"Load",
"data",
"from",
"array",
"or",
"list",
"of",
"bytes",
".",
"Similar",
"to",
"loadbin",
"()",
"method",
"but",
"works",
"directly",
"with",
"iterable",
"bytes",
"."
] | def frombytes(self, bytes, offset=0):
"""Load data from array or list of bytes.
Similar to loadbin() method but works directly with iterable bytes.
"""
for b in bytes:
self._buf[offset] = b
offset += 1 | [
"def",
"frombytes",
"(",
"self",
",",
"bytes",
",",
"offset",
"=",
"0",
")",
":",
"for",
"b",
"in",
"bytes",
":",
"self",
".",
"_buf",
"[",
"offset",
"]",
"=",
"b",
"offset",
"+=",
"1"
] | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/intelhex/__init__.py#L281-L287 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py | python | ShapeEquivSet.get_equiv_const | (self, obj) | return super(ShapeEquivSet, self).get_equiv_const(names[0]) | If the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise. | If the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise. | [
"If",
"the",
"given",
"object",
"is",
"equivalent",
"to",
"a",
"constant",
"scalar",
"return",
"the",
"scalar",
"value",
"or",
"None",
"otherwise",
"."
] | def get_equiv_const(self, obj):
"""If the given object is equivalent to a constant scalar,
return the scalar value, or None otherwise.
"""
names = self._get_names(obj)
if len(names) > 1:
return None
return super(ShapeEquivSet, self).get_equiv_const(names[0]) | [
"def",
"get_equiv_const",
"(",
"self",
",",
"obj",
")",
":",
"names",
"=",
"self",
".",
"_get_names",
"(",
"obj",
")",
"if",
"len",
"(",
"names",
")",
">",
"1",
":",
"return",
"None",
"return",
"super",
"(",
"ShapeEquivSet",
",",
"self",
")",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py#L416-L423 | |
Xilinx/XRT | dd071c90309df61d3ecdd92dca39f43804915c99 | src/python/xrt_binding.py | python | xclCopyBO | (handle, dstBoHandle, srcBoHandle, size, dst_offset, src_offset) | return _valueOrError(xclCopyBO(handle, dstBoHandle, srcBoHandle, size, dst_offset, src_offset)) | Copy device buffer contents to another buffer
:param handle: Device handle
:param dstBoHandle: Destination BO handle
:param srcBoHandle: Source BO handle
:param size: Size of data to synchronize
:param dst_offset: dst Offset within the BO
:param src_offset: src Offset within the BO
:return... | Copy device buffer contents to another buffer
:param handle: Device handle
:param dstBoHandle: Destination BO handle
:param srcBoHandle: Source BO handle
:param size: Size of data to synchronize
:param dst_offset: dst Offset within the BO
:param src_offset: src Offset within the BO
:return... | [
"Copy",
"device",
"buffer",
"contents",
"to",
"another",
"buffer",
":",
"param",
"handle",
":",
"Device",
"handle",
":",
"param",
"dstBoHandle",
":",
"Destination",
"BO",
"handle",
":",
"param",
"srcBoHandle",
":",
"Source",
"BO",
"handle",
":",
"param",
"si... | def xclCopyBO(handle, dstBoHandle, srcBoHandle, size, dst_offset, src_offset):
"""
Copy device buffer contents to another buffer
:param handle: Device handle
:param dstBoHandle: Destination BO handle
:param srcBoHandle: Source BO handle
:param size: Size of data to synchronize
:param dst_off... | [
"def",
"xclCopyBO",
"(",
"handle",
",",
"dstBoHandle",
",",
"srcBoHandle",
",",
"size",
",",
"dst_offset",
",",
"src_offset",
")",
":",
"_xclDeprecation",
"(",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_code",
".",
"co_name",
")",
"libcore",
".",
"xclCopyB... | https://github.com/Xilinx/XRT/blob/dd071c90309df61d3ecdd92dca39f43804915c99/src/python/xrt_binding.py#L515-L530 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.GetMacExitMenuItemId | (*args, **kwargs) | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | GetMacExitMenuItemId() -> long | GetMacExitMenuItemId() -> long | [
"GetMacExitMenuItemId",
"()",
"-",
">",
"long"
] | def GetMacExitMenuItemId(*args, **kwargs):
"""GetMacExitMenuItemId() -> long"""
return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | [
"def",
"GetMacExitMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetMacExitMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8155-L8157 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/nets.py | python | sequence_conv_pool | (input,
num_filters,
filter_size,
param_attr=None,
act="sigmoid",
pool_type="max",
bias_attr=None) | return pool_out | :api_attr: Static Graph
**This api takes input as an LoDTensor. If input is a Tensor, please use**
:ref:`api_fluid_nets_simple_img_conv_pool` **instead**
The sequence_conv_pool is composed of :ref:`api_fluid_layers_sequence_conv`
and :ref:`api_fluid_layers_sequence_pool` .
Args:
input (... | :api_attr: Static Graph | [
":",
"api_attr",
":",
"Static",
"Graph"
] | def sequence_conv_pool(input,
num_filters,
filter_size,
param_attr=None,
act="sigmoid",
pool_type="max",
bias_attr=None):
"""
:api_attr: Static Graph
**This api takes input... | [
"def",
"sequence_conv_pool",
"(",
"input",
",",
"num_filters",
",",
"filter_size",
",",
"param_attr",
"=",
"None",
",",
"act",
"=",
"\"sigmoid\"",
",",
"pool_type",
"=",
"\"max\"",
",",
"bias_attr",
"=",
"None",
")",
":",
"check_variable_and_dtype",
"(",
"inpu... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/nets.py#L262-L333 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/hashes.py | python | Hashes.__init__ | (self, hashes=None) | :param hashes: A dict of algorithm names pointing to lists of allowed
hex digests | :param hashes: A dict of algorithm names pointing to lists of allowed
hex digests | [
":",
"param",
"hashes",
":",
"A",
"dict",
"of",
"algorithm",
"names",
"pointing",
"to",
"lists",
"of",
"allowed",
"hex",
"digests"
] | def __init__(self, hashes=None):
# type: (Dict[str, List[str]]) -> None
"""
:param hashes: A dict of algorithm names pointing to lists of allowed
hex digests
"""
self._allowed = {} if hashes is None else hashes | [
"def",
"__init__",
"(",
"self",
",",
"hashes",
"=",
"None",
")",
":",
"# type: (Dict[str, List[str]]) -> None",
"self",
".",
"_allowed",
"=",
"{",
"}",
"if",
"hashes",
"is",
"None",
"else",
"hashes"
] | 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/_internal/utils/hashes.py#L39-L45 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI.getChildTimeoutValue | (self) | return int(childTimeout) | get child timeout | get child timeout | [
"get",
"child",
"timeout"
] | def getChildTimeoutValue(self):
"""get child timeout"""
print('%s call getChildTimeoutValue' % self)
childTimeout = self.__executeCommand('childtimeout')[0]
return int(childTimeout) | [
"def",
"getChildTimeoutValue",
"(",
"self",
")",
":",
"print",
"(",
"'%s call getChildTimeoutValue'",
"%",
"self",
")",
"childTimeout",
"=",
"self",
".",
"__executeCommand",
"(",
"'childtimeout'",
")",
"[",
"0",
"]",
"return",
"int",
"(",
"childTimeout",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L2182-L2186 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L467-L480 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py | python | Block._interpolate_with_fill | (
self,
method="pad",
axis=0,
inplace=False,
limit=None,
fill_value=None,
coerce=False,
downcast=None,
) | return self._maybe_downcast(blocks, downcast) | fillna but using the interpolate machinery | fillna but using the interpolate machinery | [
"fillna",
"but",
"using",
"the",
"interpolate",
"machinery"
] | def _interpolate_with_fill(
self,
method="pad",
axis=0,
inplace=False,
limit=None,
fill_value=None,
coerce=False,
downcast=None,
):
""" fillna but using the interpolate machinery """
inplace = validate_bool_kwarg(inplace, "inplace")
... | [
"def",
"_interpolate_with_fill",
"(",
"self",
",",
"method",
"=",
"\"pad\"",
",",
"axis",
"=",
"0",
",",
"inplace",
"=",
"False",
",",
"limit",
"=",
"None",
",",
"fill_value",
"=",
"None",
",",
"coerce",
"=",
"False",
",",
"downcast",
"=",
"None",
",",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py#L1173-L1211 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | XmlDocument.SetRoot | (*args, **kwargs) | return _xrc.XmlDocument_SetRoot(*args, **kwargs) | SetRoot(self, XmlNode node) | SetRoot(self, XmlNode node) | [
"SetRoot",
"(",
"self",
"XmlNode",
"node",
")"
] | def SetRoot(*args, **kwargs):
"""SetRoot(self, XmlNode node)"""
return _xrc.XmlDocument_SetRoot(*args, **kwargs) | [
"def",
"SetRoot",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlDocument_SetRoot",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L551-L553 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/buttonpanel.py | python | ButtonPanel.SetBarText | (self, text) | Sets the main caption text.
:param string `text`: the main caption text label. An empty string erases the
main caption text. | Sets the main caption text. | [
"Sets",
"the",
"main",
"caption",
"text",
"."
] | def SetBarText(self, text):
"""
Sets the main caption text.
:param string `text`: the main caption text label. An empty string erases the
main caption text.
"""
self.Freeze()
text = text.strip()
if self._controlCreated:
self.Remov... | [
"def",
"SetBarText",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"Freeze",
"(",
")",
"text",
"=",
"text",
".",
"strip",
"(",
")",
"if",
"self",
".",
"_controlCreated",
":",
"self",
".",
"RemoveText",
"(",
")",
"self",
".",
"_text",
"=",
"Butto... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L1849-L1889 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | DC.DeviceToLogicalXRel | (*args, **kwargs) | return _gdi_.DC_DeviceToLogicalXRel(*args, **kwargs) | DeviceToLogicalXRel(self, int x) -> int
Convert device X coordinate to relative logical coordinate, using the
current mapping mode but ignoring the x axis orientation. Use this
function for converting a width, for example. | DeviceToLogicalXRel(self, int x) -> int | [
"DeviceToLogicalXRel",
"(",
"self",
"int",
"x",
")",
"-",
">",
"int"
] | def DeviceToLogicalXRel(*args, **kwargs):
"""
DeviceToLogicalXRel(self, int x) -> int
Convert device X coordinate to relative logical coordinate, using the
current mapping mode but ignoring the x axis orientation. Use this
function for converting a width, for example.
""... | [
"def",
"DeviceToLogicalXRel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_DeviceToLogicalXRel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4229-L4237 | |
android/app-bundle-samples | 437afcd38743663c43c56db60145699a438afcb5 | PlayAssetDelivery/BundletoolScriptSample/add_packs.py | python | parse_args | () | return parser.parse_args() | Parse input arguments. | Parse input arguments. | [
"Parse",
"input",
"arguments",
"."
] | def parse_args() -> argparse.Namespace:
"""Parse input arguments."""
parser = argparse.ArgumentParser(
description="Augments an Android App Bundle with given asset packs.",
add_help=True)
parser.add_argument(
"--androidsdk", required=True, help="Android SDK location")
parser.add_argument("--sd... | [
"def",
"parse_args",
"(",
")",
"->",
"argparse",
".",
"Namespace",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"\"Augments an Android App Bundle with given asset packs.\"",
",",
"add_help",
"=",
"True",
")",
"parser",
".",
"add_ar... | https://github.com/android/app-bundle-samples/blob/437afcd38743663c43c56db60145699a438afcb5/PlayAssetDelivery/BundletoolScriptSample/add_packs.py#L39-L78 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/resample.py | python | Resampler.interpolate | (
self,
method="linear",
axis=0,
limit=None,
inplace=False,
limit_direction="forward",
limit_area=None,
downcast=None,
**kwargs,
) | return result.interpolate(
method=method,
axis=axis,
limit=limit,
inplace=inplace,
limit_direction=limit_direction,
limit_area=limit_area,
downcast=downcast,
**kwargs,
) | Interpolate values according to different methods. | Interpolate values according to different methods. | [
"Interpolate",
"values",
"according",
"to",
"different",
"methods",
"."
] | def interpolate(
self,
method="linear",
axis=0,
limit=None,
inplace=False,
limit_direction="forward",
limit_area=None,
downcast=None,
**kwargs,
):
"""
Interpolate values according to different methods.
"""
result... | [
"def",
"interpolate",
"(",
"self",
",",
"method",
"=",
"\"linear\"",
",",
"axis",
"=",
"0",
",",
"limit",
"=",
"None",
",",
"inplace",
"=",
"False",
",",
"limit_direction",
"=",
"\"forward\"",
",",
"limit_area",
"=",
"None",
",",
"downcast",
"=",
"None",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/resample.py#L785-L809 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/layers/python/layers/feature_column.py | python | _WeightedSparseColumn.key | (self) | return "{}".format(self) | Returns a string which will be used as a key when we do sorting. | Returns a string which will be used as a key when we do sorting. | [
"Returns",
"a",
"string",
"which",
"will",
"be",
"used",
"as",
"a",
"key",
"when",
"we",
"do",
"sorting",
"."
] | def key(self):
"""Returns a string which will be used as a key when we do sorting."""
return "{}".format(self) | [
"def",
"key",
"(",
"self",
")",
":",
"return",
"\"{}\"",
".",
"format",
"(",
"self",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/feature_column.py#L752-L754 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | cyber/python/cyber_py3/cyber_time.py | python | Time.to_sec | (self) | return _CYBER_TIME.PyTime_to_sec(self.time) | convert to second. | convert to second. | [
"convert",
"to",
"second",
"."
] | def to_sec(self):
"""
convert to second.
"""
return _CYBER_TIME.PyTime_to_sec(self.time) | [
"def",
"to_sec",
"(",
"self",
")",
":",
"return",
"_CYBER_TIME",
".",
"PyTime_to_sec",
"(",
"self",
".",
"time",
")"
] | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/cyber/python/cyber_py3/cyber_time.py#L151-L155 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py | python | NeuralNetworkBuilder.add_rank_preserving_reshape | (self, name, input_name, output_name, output_shape) | return spec_layer | Add a rank_preserving_reshape layer to the model that reshapes the input
tensor without altering the rank of the tensor.
Refer to the **RankPreservingReshapeLayerParams** message in specification
(NeuralNetwork.proto) for more details.
Parameters
----------
name: str
... | Add a rank_preserving_reshape layer to the model that reshapes the input
tensor without altering the rank of the tensor.
Refer to the **RankPreservingReshapeLayerParams** message in specification
(NeuralNetwork.proto) for more details. | [
"Add",
"a",
"rank_preserving_reshape",
"layer",
"to",
"the",
"model",
"that",
"reshapes",
"the",
"input",
"tensor",
"without",
"altering",
"the",
"rank",
"of",
"the",
"tensor",
".",
"Refer",
"to",
"the",
"**",
"RankPreservingReshapeLayerParams",
"**",
"message",
... | def add_rank_preserving_reshape(self, name, input_name, output_name, output_shape):
"""
Add a rank_preserving_reshape layer to the model that reshapes the input
tensor without altering the rank of the tensor.
Refer to the **RankPreservingReshapeLayerParams** message in specification
... | [
"def",
"add_rank_preserving_reshape",
"(",
"self",
",",
"name",
",",
"input_name",
",",
"output_name",
",",
"output_shape",
")",
":",
"spec_layer",
"=",
"self",
".",
"_add_generic_layer",
"(",
"name",
",",
"[",
"input_name",
"]",
",",
"[",
"output_name",
"]",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L7211-L7248 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/python_interface/__init__.py | python | __ModuleInitDetail | () | return kratos_globals.KratosGlobalsImpl(Kernel(using_mpi), KratosPaths.kratos_applications) | Configure the parallel environment.
This is done before initializing the kernel to ensure that MPI
and the parallel DataCommunicator are initialized when the Kernel is built.
It is defined as a function to avoid polluting the Kratos namespace with local variables. | Configure the parallel environment.
This is done before initializing the kernel to ensure that MPI
and the parallel DataCommunicator are initialized when the Kernel is built.
It is defined as a function to avoid polluting the Kratos namespace with local variables. | [
"Configure",
"the",
"parallel",
"environment",
".",
"This",
"is",
"done",
"before",
"initializing",
"the",
"kernel",
"to",
"ensure",
"that",
"MPI",
"and",
"the",
"parallel",
"DataCommunicator",
"are",
"initialized",
"when",
"the",
"Kernel",
"is",
"built",
".",
... | def __ModuleInitDetail():
"""
Configure the parallel environment.
This is done before initializing the kernel to ensure that MPI
and the parallel DataCommunicator are initialized when the Kernel is built.
It is defined as a function to avoid polluting the Kratos namespace with local variables.
"... | [
"def",
"__ModuleInitDetail",
"(",
")",
":",
"# Detect if MPI is used",
"mpi_detected",
"=",
"(",
"# Probing the environment to see if this is an MPI run",
"\"OMPI_COMM_WORLD_SIZE\"",
"in",
"os",
".",
"environ",
"# OpenMPI implementation detected",
"or",
"\"PMI_SIZE\"",
"in",
"o... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_interface/__init__.py#L21-L89 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | TextBoxAttr.RemoveStyle | (*args, **kwargs) | return _richtext.TextBoxAttr_RemoveStyle(*args, **kwargs) | RemoveStyle(self, TextBoxAttr attr) -> bool | RemoveStyle(self, TextBoxAttr attr) -> bool | [
"RemoveStyle",
"(",
"self",
"TextBoxAttr",
"attr",
")",
"-",
">",
"bool"
] | def RemoveStyle(*args, **kwargs):
"""RemoveStyle(self, TextBoxAttr attr) -> bool"""
return _richtext.TextBoxAttr_RemoveStyle(*args, **kwargs) | [
"def",
"RemoveStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextBoxAttr_RemoveStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L552-L554 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ast.py | python | NodeVisitor.visit | (self, node) | return visitor(node) | Visit a node. | Visit a node. | [
"Visit",
"a",
"node",
"."
] | def visit(self, node):
"""Visit a node."""
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
return visitor(node) | [
"def",
"visit",
"(",
"self",
",",
"node",
")",
":",
"method",
"=",
"'visit_'",
"+",
"node",
".",
"__class__",
".",
"__name__",
"visitor",
"=",
"getattr",
"(",
"self",
",",
"method",
",",
"self",
".",
"generic_visit",
")",
"return",
"visitor",
"(",
"nod... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ast.py#L237-L241 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/pygments/scanner.py | python | Scanner.check | (self, pattern) | return self._re_cache[pattern].match(self.data, self.pos) | Apply `pattern` on the current position and return
the match object. (Doesn't touch pos). Use this for
lookahead. | Apply `pattern` on the current position and return
the match object. (Doesn't touch pos). Use this for
lookahead. | [
"Apply",
"pattern",
"on",
"the",
"current",
"position",
"and",
"return",
"the",
"match",
"object",
".",
"(",
"Doesn",
"t",
"touch",
"pos",
")",
".",
"Use",
"this",
"for",
"lookahead",
"."
] | def check(self, pattern):
"""
Apply `pattern` on the current position and return
the match object. (Doesn't touch pos). Use this for
lookahead.
"""
if self.eos:
raise EndOfText()
if pattern not in self._re_cache:
self._re_cache[pattern] = r... | [
"def",
"check",
"(",
"self",
",",
"pattern",
")",
":",
"if",
"self",
".",
"eos",
":",
"raise",
"EndOfText",
"(",
")",
"if",
"pattern",
"not",
"in",
"self",
".",
"_re_cache",
":",
"self",
".",
"_re_cache",
"[",
"pattern",
"]",
"=",
"re",
".",
"compi... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pygments/scanner.py#L55-L65 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py | python | remove_function | (name) | Remove a function from the context. | Remove a function from the context. | [
"Remove",
"a",
"function",
"from",
"the",
"context",
"."
] | def remove_function(name):
"""Remove a function from the context."""
context().remove_function(name) | [
"def",
"remove_function",
"(",
"name",
")",
":",
"context",
"(",
")",
".",
"remove_function",
"(",
"name",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L1875-L1877 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | Mailbox.update | (self, arg=None) | Change the messages that correspond to certain keys. | Change the messages that correspond to certain keys. | [
"Change",
"the",
"messages",
"that",
"correspond",
"to",
"certain",
"keys",
"."
] | def update(self, arg=None):
"""Change the messages that correspond to certain keys."""
if hasattr(arg, 'iteritems'):
source = arg.iteritems()
elif hasattr(arg, 'items'):
source = arg.items()
else:
source = arg
bad_key = False
for key, m... | [
"def",
"update",
"(",
"self",
",",
"arg",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"arg",
",",
"'iteritems'",
")",
":",
"source",
"=",
"arg",
".",
"iteritems",
"(",
")",
"elif",
"hasattr",
"(",
"arg",
",",
"'items'",
")",
":",
"source",
"=",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L167-L182 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/xml/sax/xmlreader.py | python | InputSource.setPublicId | (self, public_id) | Sets the public identifier of this InputSource. | Sets the public identifier of this InputSource. | [
"Sets",
"the",
"public",
"identifier",
"of",
"this",
"InputSource",
"."
] | def setPublicId(self, public_id):
"Sets the public identifier of this InputSource."
self.__public_id = public_id | [
"def",
"setPublicId",
"(",
"self",
",",
"public_id",
")",
":",
"self",
".",
"__public_id",
"=",
"public_id"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xml/sax/xmlreader.py#L212-L214 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py | python | tokenMap | (func, *args) | return pa | Helper to define a parse action by mapping a function to all
elements of a ParseResults list. If any additional args are passed,
they are forwarded to the given function as additional arguments
after the token, as in
``hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))``,
which will conve... | Helper to define a parse action by mapping a function to all
elements of a ParseResults list. If any additional args are passed,
they are forwarded to the given function as additional arguments
after the token, as in
``hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))``,
which will conve... | [
"Helper",
"to",
"define",
"a",
"parse",
"action",
"by",
"mapping",
"a",
"function",
"to",
"all",
"elements",
"of",
"a",
"ParseResults",
"list",
".",
"If",
"any",
"additional",
"args",
"are",
"passed",
"they",
"are",
"forwarded",
"to",
"the",
"given",
"func... | def tokenMap(func, *args):
"""Helper to define a parse action by mapping a function to all
elements of a ParseResults list. If any additional args are passed,
they are forwarded to the given function as additional arguments
after the token, as in
``hex_integer = Word(hexnums).setParseAction(tokenMap... | [
"def",
"tokenMap",
"(",
"func",
",",
"*",
"args",
")",
":",
"def",
"pa",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"return",
"[",
"func",
"(",
"tokn",
",",
"*",
"args",
")",
"for",
"tokn",
"in",
"t",
"]",
"try",
":",
"func_name",
"=",
"getattr"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py#L5750-L5796 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler.py | python | DefaultPassBuilder.define_objectmode_pipeline | (state, name='object') | return pm | Returns an object-mode pipeline based PassManager | Returns an object-mode pipeline based PassManager | [
"Returns",
"an",
"object",
"-",
"mode",
"pipeline",
"based",
"PassManager"
] | def define_objectmode_pipeline(state, name='object'):
"""Returns an object-mode pipeline based PassManager
"""
pm = PassManager(name)
if state.func_ir is None:
pm.add_pass(TranslateByteCode, "analyzing bytecode")
pm.add_pass(FixupArgs, "fix up args")
pm.ad... | [
"def",
"define_objectmode_pipeline",
"(",
"state",
",",
"name",
"=",
"'object'",
")",
":",
"pm",
"=",
"PassManager",
"(",
"name",
")",
"if",
"state",
".",
"func_ir",
"is",
"None",
":",
"pm",
".",
"add_pass",
"(",
"TranslateByteCode",
",",
"\"analyzing byteco... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler.py#L488-L512 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.