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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py | python | Binomial.mode | (self, name="mode") | Mode of the distribution.
Note that when `(n + 1) * p` is an integer, there are actually two modes.
Namely, `(n + 1) * p` and `(n + 1) * p - 1` are both modes. Here we return
only the larger of the two modes.
Args:
name: The name for this op.
Returns:
The mode of the Binomial distribu... | Mode of the distribution. | [
"Mode",
"of",
"the",
"distribution",
"."
] | def mode(self, name="mode"):
"""Mode of the distribution.
Note that when `(n + 1) * p` is an integer, there are actually two modes.
Namely, `(n + 1) * p` and `(n + 1) * p - 1` are both modes. Here we return
only the larger of the two modes.
Args:
name: The name for this op.
Returns:
... | [
"def",
"mode",
"(",
"self",
",",
"name",
"=",
"\"mode\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"name",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"self",
".",
"_n",
",",
"self",
".",
"_p",
"]",
",",
"name",
")"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/binomial.py#L251-L266 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/losses/python/metric_learning/metric_loss_ops.py | python | compute_augmented_facility_locations_pam | (pairwise_distances,
labels,
margin_multiplier,
margin_type,
chosen_ids,
pam_max_iter=5) | return chosen_ids | Refine the cluster centroids with PAM local search.
For fixed iterations, alternate between updating the cluster assignment
and updating cluster medoids.
Args:
pairwise_distances: 2-D Tensor of pairwise distances.
labels: 1-D Tensor of ground truth cluster assignment.
margin_multiplier: multiplica... | Refine the cluster centroids with PAM local search. | [
"Refine",
"the",
"cluster",
"centroids",
"with",
"PAM",
"local",
"search",
"."
] | def compute_augmented_facility_locations_pam(pairwise_distances,
labels,
margin_multiplier,
margin_type,
chosen_ids,
... | [
"def",
"compute_augmented_facility_locations_pam",
"(",
"pairwise_distances",
",",
"labels",
",",
"margin_multiplier",
",",
"margin_type",
",",
"chosen_ids",
",",
"pam_max_iter",
"=",
"5",
")",
":",
"for",
"_",
"in",
"range",
"(",
"pam_max_iter",
")",
":",
"# upda... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/losses/python/metric_learning/metric_loss_ops.py#L873-L903 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftgeoutils/circles_incomplete.py | python | circlefromCircleLinePoint | (circle, line, point) | Do nothing. Placeholder function. Needs to be implemented. | Do nothing. Placeholder function. Needs to be implemented. | [
"Do",
"nothing",
".",
"Placeholder",
"function",
".",
"Needs",
"to",
"be",
"implemented",
"."
] | def circlefromCircleLinePoint(circle, line, point):
"""Do nothing. Placeholder function. Needs to be implemented."""
_wrn("Placeholder function, does nothing.") | [
"def",
"circlefromCircleLinePoint",
"(",
"circle",
",",
"line",
",",
"point",
")",
":",
"_wrn",
"(",
"\"Placeholder function, does nothing.\"",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftgeoutils/circles_incomplete.py#L68-L70 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/Heppy/python/analyzers/core/AutoFillTreeProducer.py | python | AutoFillTreeProducer.fillCoreVariables | (self, tr, event, isMC) | Here we fill the variables that we always want and that are hard-coded | Here we fill the variables that we always want and that are hard-coded | [
"Here",
"we",
"fill",
"the",
"variables",
"that",
"we",
"always",
"want",
"and",
"that",
"are",
"hard",
"-",
"coded"
] | def fillCoreVariables(self, tr, event, isMC):
"""Here we fill the variables that we always want and that are hard-coded"""
tr.fill('run', event.input.eventAuxiliary().id().run())
tr.fill('lumi',event.input.eventAuxiliary().id().luminosityBlock())
tr.fill('evt', event.input.eventAuxiliary... | [
"def",
"fillCoreVariables",
"(",
"self",
",",
"tr",
",",
"event",
",",
"isMC",
")",
":",
"tr",
".",
"fill",
"(",
"'run'",
",",
"event",
".",
"input",
".",
"eventAuxiliary",
"(",
")",
".",
"id",
"(",
")",
".",
"run",
"(",
")",
")",
"tr",
".",
"f... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/Heppy/python/analyzers/core/AutoFillTreeProducer.py#L109-L144 | ||
twtygqyy/caffe-augmentation | c76600d247e5132fa5bd89d87bb5df458341fa84 | tools/extra/parse_log.py | python | fix_initial_nan_learning_rate | (dict_list) | Correct initial value of learning rate
Learning rate is normally not printed until after the initial test and
training step, which means the initial testing and training rows have
LearningRate = NaN. Fix this by copying over the LearningRate from the
second row, if it exists. | Correct initial value of learning rate | [
"Correct",
"initial",
"value",
"of",
"learning",
"rate"
] | def fix_initial_nan_learning_rate(dict_list):
"""Correct initial value of learning rate
Learning rate is normally not printed until after the initial test and
training step, which means the initial testing and training rows have
LearningRate = NaN. Fix this by copying over the LearningRate from the
... | [
"def",
"fix_initial_nan_learning_rate",
"(",
"dict_list",
")",
":",
"if",
"len",
"(",
"dict_list",
")",
">",
"1",
":",
"dict_list",
"[",
"0",
"]",
"[",
"'LearningRate'",
"]",
"=",
"dict_list",
"[",
"1",
"]",
"[",
"'LearningRate'",
"]"
] | https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/tools/extra/parse_log.py#L128-L138 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/filter_design.py | python | lp2bp_zpk | (z, p, k, wo=1.0, bw=1.0) | return z_bp, p_bp, k_bp | r"""
Transform a lowpass filter prototype to a bandpass filter.
Return an analog band-pass filter with center frequency `wo` and
bandwidth `bw` from an analog low-pass filter prototype with unity
cutoff frequency, using zeros, poles, and gain ('zpk') representation.
Parameters
----------
z... | r"""
Transform a lowpass filter prototype to a bandpass filter. | [
"r",
"Transform",
"a",
"lowpass",
"filter",
"prototype",
"to",
"a",
"bandpass",
"filter",
"."
] | def lp2bp_zpk(z, p, k, wo=1.0, bw=1.0):
r"""
Transform a lowpass filter prototype to a bandpass filter.
Return an analog band-pass filter with center frequency `wo` and
bandwidth `bw` from an analog low-pass filter prototype with unity
cutoff frequency, using zeros, poles, and gain ('zpk') represen... | [
"def",
"lp2bp_zpk",
"(",
"z",
",",
"p",
",",
"k",
",",
"wo",
"=",
"1.0",
",",
"bw",
"=",
"1.0",
")",
":",
"z",
"=",
"atleast_1d",
"(",
"z",
")",
"p",
"=",
"atleast_1d",
"(",
"p",
")",
"wo",
"=",
"float",
"(",
"wo",
")",
"bw",
"=",
"float",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/filter_design.py#L2331-L2407 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/vendored/six.py | python | add_move | (move) | Add an item to six.moves. | Add an item to six.moves. | [
"Add",
"an",
"item",
"to",
"six",
".",
"moves",
"."
] | def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move) | [
"def",
"add_move",
"(",
"move",
")",
":",
"setattr",
"(",
"_MovedItems",
",",
"move",
".",
"name",
",",
"move",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/vendored/six.py#L486-L488 | ||
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/python_version/optimization.py | python | LBFGSBParameters.scipy_kwargs | (self) | return out_dict | Return a dict that can be unpacked as kwargs to ``scipy.optimize.fmin_l_bfgs_b``.
:return: kwargs for controlling the behavior of fmin_l_bfgs_b
:rtype: dict | Return a dict that can be unpacked as kwargs to ``scipy.optimize.fmin_l_bfgs_b``. | [
"Return",
"a",
"dict",
"that",
"can",
"be",
"unpacked",
"as",
"kwargs",
"to",
"scipy",
".",
"optimize",
".",
"fmin_l_bfgs_b",
"."
] | def scipy_kwargs(self):
"""Return a dict that can be unpacked as kwargs to ``scipy.optimize.fmin_l_bfgs_b``.
:return: kwargs for controlling the behavior of fmin_l_bfgs_b
:rtype: dict
"""
out_dict = dict(self._asdict())
out_dict['m'] = out_dict.pop('max_metric_correc')
... | [
"def",
"scipy_kwargs",
"(",
"self",
")",
":",
"out_dict",
"=",
"dict",
"(",
"self",
".",
"_asdict",
"(",
")",
")",
"out_dict",
"[",
"'m'",
"]",
"=",
"out_dict",
".",
"pop",
"(",
"'max_metric_correc'",
")",
"out_dict",
"[",
"'maxfun'",
"]",
"=",
"out_di... | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/python_version/optimization.py#L329-L339 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/utilities/normalization_lib.py | python | theorem_database_contains_duplicates | (
database: proof_assistant_pb2.TheoremDatabase) | return False | Returns whether the database contains a duplicate w.r.t normalized fp. | Returns whether the database contains a duplicate w.r.t normalized fp. | [
"Returns",
"whether",
"the",
"database",
"contains",
"a",
"duplicate",
"w",
".",
"r",
".",
"t",
"normalized",
"fp",
"."
] | def theorem_database_contains_duplicates(
database: proof_assistant_pb2.TheoremDatabase):
"""Returns whether the database contains a duplicate w.r.t normalized fp."""
fingerprints = set()
for theorem in database.theorems:
if theorem.tag != proof_assistant_pb2.Theorem.THEOREM:
continue
f = normal... | [
"def",
"theorem_database_contains_duplicates",
"(",
"database",
":",
"proof_assistant_pb2",
".",
"TheoremDatabase",
")",
":",
"fingerprints",
"=",
"set",
"(",
")",
"for",
"theorem",
"in",
"database",
".",
"theorems",
":",
"if",
"theorem",
".",
"tag",
"!=",
"proo... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/utilities/normalization_lib.py#L141-L153 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetInstallNameBase | (self) | return install_base | Return DYLIB_INSTALL_NAME_BASE for this target. | Return DYLIB_INSTALL_NAME_BASE for this target. | [
"Return",
"DYLIB_INSTALL_NAME_BASE",
"for",
"this",
"target",
"."
] | def GetInstallNameBase(self):
"""Return DYLIB_INSTALL_NAME_BASE for this target."""
# Xcode sets this for shared_libraries, and for nonbundled loadable_modules.
if (self.spec['type'] != 'shared_library' and
(self.spec['type'] != 'loadable_module' or self._IsBundle())):
return None
install_... | [
"def",
"GetInstallNameBase",
"(",
"self",
")",
":",
"# Xcode sets this for shared_libraries, and for nonbundled loadable_modules.",
"if",
"(",
"self",
".",
"spec",
"[",
"'type'",
"]",
"!=",
"'shared_library'",
"and",
"(",
"self",
".",
"spec",
"[",
"'type'",
"]",
"!=... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/xcode_emulation.py#L760-L769 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/prefdlg.py | python | PreferencesPanelBase.DoSelected | (self) | Handle initial selection to create controls | Handle initial selection to create controls | [
"Handle",
"initial",
"selection",
"to",
"create",
"controls"
] | def DoSelected(self):
"""Handle initial selection to create controls"""
if not self._layout_done:
self._layout_done = True
self._DoLayout()
self.SetAutoLayout(True) | [
"def",
"DoSelected",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_layout_done",
":",
"self",
".",
"_layout_done",
"=",
"True",
"self",
".",
"_DoLayout",
"(",
")",
"self",
".",
"SetAutoLayout",
"(",
"True",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/prefdlg.py#L85-L90 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/excel/_openpyxl.py | python | OpenpyxlWriter._convert_to_stop | (cls, stop_seq) | return map(cls._convert_to_color, stop_seq) | Convert ``stop_seq`` to a list of openpyxl v2 Color objects,
suitable for initializing the ``GradientFill`` ``stop`` parameter.
Parameters
----------
stop_seq : iterable
An iterable that yields objects suitable for consumption by
``_convert_to_color``.
R... | Convert ``stop_seq`` to a list of openpyxl v2 Color objects,
suitable for initializing the ``GradientFill`` ``stop`` parameter. | [
"Convert",
"stop_seq",
"to",
"a",
"list",
"of",
"openpyxl",
"v2",
"Color",
"objects",
"suitable",
"for",
"initializing",
"the",
"GradientFill",
"stop",
"parameter",
"."
] | def _convert_to_stop(cls, stop_seq):
"""
Convert ``stop_seq`` to a list of openpyxl v2 Color objects,
suitable for initializing the ``GradientFill`` ``stop`` parameter.
Parameters
----------
stop_seq : iterable
An iterable that yields objects suitable for con... | [
"def",
"_convert_to_stop",
"(",
"cls",
",",
"stop_seq",
")",
":",
"return",
"map",
"(",
"cls",
".",
"_convert_to_color",
",",
"stop_seq",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/excel/_openpyxl.py#L201-L216 | |
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | pytengine/tengine/node.py | python | Node.getInputTensorByIdx | (self, idx) | return Tensor(tensor=tensor) | Get the input tensor handle of a node.
:param idx: <int> The index of the input tensor.
:return: The tensor name or None on error | Get the input tensor handle of a node.
:param idx: <int> The index of the input tensor.
:return: The tensor name or None on error | [
"Get",
"the",
"input",
"tensor",
"handle",
"of",
"a",
"node",
".",
":",
"param",
"idx",
":",
"<int",
">",
"The",
"index",
"of",
"the",
"input",
"tensor",
".",
":",
"return",
":",
"The",
"tensor",
"name",
"or",
"None",
"on",
"error"
] | def getInputTensorByIdx(self, idx):
"""
Get the input tensor handle of a node.
:param idx: <int> The index of the input tensor.
:return: The tensor name or None on error
"""
_LIB.get_node_input_tensor.restype = tensor_t
tensor = _LIB.get_node_input_tensor(ctypes.c... | [
"def",
"getInputTensorByIdx",
"(",
"self",
",",
"idx",
")",
":",
"_LIB",
".",
"get_node_input_tensor",
".",
"restype",
"=",
"tensor_t",
"tensor",
"=",
"_LIB",
".",
"get_node_input_tensor",
"(",
"ctypes",
".",
"c_void_p",
"(",
"self",
".",
"node",
")",
",",
... | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/pytengine/tengine/node.py#L55-L63 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Utilities/Templates/Modules/ScriptedDesigner/TemplateKey.py | python | TemplateKeyLogic.setDefaultParameters | (self, parameterNode) | Initialize parameter node with default settings. | Initialize parameter node with default settings. | [
"Initialize",
"parameter",
"node",
"with",
"default",
"settings",
"."
] | def setDefaultParameters(self, parameterNode):
"""
Initialize parameter node with default settings.
"""
if not parameterNode.GetParameter("Threshold"):
parameterNode.SetParameter("Threshold", "50.0")
if not parameterNode.GetParameter("Invert"):
parameterNode.SetParameter("Invert", "false... | [
"def",
"setDefaultParameters",
"(",
"self",
",",
"parameterNode",
")",
":",
"if",
"not",
"parameterNode",
".",
"GetParameter",
"(",
"\"Threshold\"",
")",
":",
"parameterNode",
".",
"SetParameter",
"(",
"\"Threshold\"",
",",
"\"50.0\"",
")",
"if",
"not",
"paramet... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Utilities/Templates/Modules/ScriptedDesigner/TemplateKey.py#L205-L212 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/random_ops.py | python | random_normal | (shape,
mean=0.0,
stddev=1.0,
dtype=dtypes.float32,
seed=None,
name=None) | Outputs random values from a normal distribution.
Example that generates a new set of random values every time:
>>> tf.random.set_seed(5);
>>> tf.random.normal([4], 0, 1, tf.float32)
<tf.Tensor: shape=(4,), dtype=float32, numpy=..., dtype=float32)>
Example that outputs a reproducible result:
>>> tf.rand... | Outputs random values from a normal distribution. | [
"Outputs",
"random",
"values",
"from",
"a",
"normal",
"distribution",
"."
] | def random_normal(shape,
mean=0.0,
stddev=1.0,
dtype=dtypes.float32,
seed=None,
name=None):
"""Outputs random values from a normal distribution.
Example that generates a new set of random values every time:
>>> tf.random.s... | [
"def",
"random_normal",
"(",
"shape",
",",
"mean",
"=",
"0.0",
",",
"stddev",
"=",
"1.0",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"seed",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/random_ops.py#L43-L96 | ||
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/dump_breakpad_symbols.py | python | parse_args | () | return args | Parse command line arguments and perform sanity checks. | Parse command line arguments and perform sanity checks. | [
"Parse",
"command",
"line",
"arguments",
"and",
"perform",
"sanity",
"checks",
"."
] | def parse_args():
"""Parse command line arguments and perform sanity checks."""
parser = ArgumentParser()
parser.add_argument('-d', '--dest_dir', required=True, help="""The target directory,
below which to place extracted symbol files""")
parser.add_argument('--dump_syms', help='Path to the dump_syms bina... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'-d'",
",",
"'--dest_dir'",
",",
"required",
"=",
"True",
",",
"help",
"=",
"\"\"\"The target directory,\n below which to place extracted symbol fi... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/dump_breakpad_symbols.py#L100-L128 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/hang_analyzer/process_list.py | python | _pname_match | (match_type, pname, interesting_processes) | return False | Return True if the pname matches an interesting_processes. | Return True if the pname matches an interesting_processes. | [
"Return",
"True",
"if",
"the",
"pname",
"matches",
"an",
"interesting_processes",
"."
] | def _pname_match(match_type, pname, interesting_processes):
"""Return True if the pname matches an interesting_processes."""
pname = os.path.splitext(pname)[0]
for ip in interesting_processes:
if match_type == 'exact' and pname == ip or match_type == 'contains' and ip in pname:
return Tr... | [
"def",
"_pname_match",
"(",
"match_type",
",",
"pname",
",",
"interesting_processes",
")",
":",
"pname",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"pname",
")",
"[",
"0",
"]",
"for",
"ip",
"in",
"interesting_processes",
":",
"if",
"match_type",
"==",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/hang_analyzer/process_list.py#L176-L182 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/pylib/utils/time_profile.py | python | TimeProfile.GetDelta | (self) | return delta | Returns the rounded delta.
Also stops the timer if Stop() has not already been called. | Returns the rounded delta. | [
"Returns",
"the",
"rounded",
"delta",
"."
] | def GetDelta(self):
"""Returns the rounded delta.
Also stops the timer if Stop() has not already been called.
"""
if self._endtime is None:
self.Stop(log=False)
delta = self._endtime - self._starttime
delta = round(delta, 2) if delta < 10 else round(delta, 1)
return delta | [
"def",
"GetDelta",
"(",
"self",
")",
":",
"if",
"self",
".",
"_endtime",
"is",
"None",
":",
"self",
".",
"Stop",
"(",
"log",
"=",
"False",
")",
"delta",
"=",
"self",
".",
"_endtime",
"-",
"self",
".",
"_starttime",
"delta",
"=",
"round",
"(",
"delt... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/utils/time_profile.py#L22-L31 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/visualization.py | python | loop | (setup : Callable=None, callback : Callable=None, cleanup : Callable=None) | Runs the visualization thread inline with the main thread.
The setup() function is called at the start, the callback() function is run
every time the event thread is idle, and the cleanup() function is called
on termination.
NOTE FOR MAC USERS: a multithreaded GUI is not supported on Mac, so the loop()... | Runs the visualization thread inline with the main thread.
The setup() function is called at the start, the callback() function is run
every time the event thread is idle, and the cleanup() function is called
on termination. | [
"Runs",
"the",
"visualization",
"thread",
"inline",
"with",
"the",
"main",
"thread",
".",
"The",
"setup",
"()",
"function",
"is",
"called",
"at",
"the",
"start",
"the",
"callback",
"()",
"function",
"is",
"run",
"every",
"time",
"the",
"event",
"thread",
"... | def loop(setup : Callable=None, callback : Callable=None, cleanup : Callable=None) -> None:
"""Runs the visualization thread inline with the main thread.
The setup() function is called at the start, the callback() function is run
every time the event thread is idle, and the cleanup() function is called
... | [
"def",
"loop",
"(",
"setup",
":",
"Callable",
"=",
"None",
",",
"callback",
":",
"Callable",
"=",
"None",
",",
"cleanup",
":",
"Callable",
"=",
"None",
")",
"->",
"None",
":",
"global",
"_window_manager",
"_init",
"(",
")",
"_window_manager",
".",
"loop"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L1055-L1068 | ||
BTCPrivate/BTCP-Rebase | c8c7fe6ac26b6fba71eae1c89cdc0d924f5c6d82 | contrib/devtools/github-merge.py | python | retrieve_pr_info | (repo,pull) | Retrieve pull request information from github.
Return None if no title can be found, or an error happens. | Retrieve pull request information from github.
Return None if no title can be found, or an error happens. | [
"Retrieve",
"pull",
"request",
"information",
"from",
"github",
".",
"Return",
"None",
"if",
"no",
"title",
"can",
"be",
"found",
"or",
"an",
"error",
"happens",
"."
] | def retrieve_pr_info(repo,pull):
'''
Retrieve pull request information from github.
Return None if no title can be found, or an error happens.
'''
try:
req = Request("https://api.github.com/repos/"+repo+"/pulls/"+pull)
result = urlopen(req)
reader = codecs.getreader('utf-8')
... | [
"def",
"retrieve_pr_info",
"(",
"repo",
",",
"pull",
")",
":",
"try",
":",
"req",
"=",
"Request",
"(",
"\"https://api.github.com/repos/\"",
"+",
"repo",
"+",
"\"/pulls/\"",
"+",
"pull",
")",
"result",
"=",
"urlopen",
"(",
"req",
")",
"reader",
"=",
"codecs... | https://github.com/BTCPrivate/BTCP-Rebase/blob/c8c7fe6ac26b6fba71eae1c89cdc0d924f5c6d82/contrib/devtools/github-merge.py#L53-L66 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pyedbglib/protocols/edbgprotocol.py | python | EdbgProtocol.read_id_chip | (self, id_number) | Reads the ID information from the ID chip connected at id_number
:param id_number: Extension header ID number (Range 1 - 16)
:return: A 64-byte data array | Reads the ID information from the ID chip connected at id_number | [
"Reads",
"the",
"ID",
"information",
"from",
"the",
"ID",
"chip",
"connected",
"at",
"id_number"
] | def read_id_chip(self, id_number):
"""
Reads the ID information from the ID chip connected at id_number
:param id_number: Extension header ID number (Range 1 - 16)
:return: A 64-byte data array
"""
self.logger.info("Reading ID chip...")
try:
self.chec... | [
"def",
"read_id_chip",
"(",
"self",
",",
"id_number",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Reading ID chip...\"",
")",
"try",
":",
"self",
".",
"check_command_exists",
"(",
"self",
".",
"CMD_EDBG_READ_ID_CHIP",
")",
"except",
"NotImplementedErro... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/edbgprotocol.py#L151-L175 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_main.py | python | MainWindow.FlushEventStack | (self) | Clear the Menu and UpdateUI event handler stack
@note: only unregisters this frames handlers from the app | Clear the Menu and UpdateUI event handler stack
@note: only unregisters this frames handlers from the app | [
"Clear",
"the",
"Menu",
"and",
"UpdateUI",
"event",
"handler",
"stack",
"@note",
":",
"only",
"unregisters",
"this",
"frames",
"handlers",
"from",
"the",
"app"
] | def FlushEventStack(self):
"""Clear the Menu and UpdateUI event handler stack
@note: only unregisters this frames handlers from the app
"""
app = wx.GetApp()
for handler in self._handlers['menu']:
app.RemoveHandlerForID(handler[0])
for handler in self._handl... | [
"def",
"FlushEventStack",
"(",
"self",
")",
":",
"app",
"=",
"wx",
".",
"GetApp",
"(",
")",
"for",
"handler",
"in",
"self",
".",
"_handlers",
"[",
"'menu'",
"]",
":",
"app",
".",
"RemoveHandlerForID",
"(",
"handler",
"[",
"0",
"]",
")",
"for",
"handl... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_main.py#L482-L492 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py | python | OpsWorksConnection.describe_time_based_auto_scaling | (self, instance_ids) | return self.make_request(action='DescribeTimeBasedAutoScaling',
body=json.dumps(params)) | Describes time-based auto scaling configurations for specified
instances.
You must specify at least one of the parameters.
**Required Permissions**: To use this action, an IAM user must
have a Show, Deploy, or Manage permissions level for the
stack, or an attached policy that... | Describes time-based auto scaling configurations for specified
instances. | [
"Describes",
"time",
"-",
"based",
"auto",
"scaling",
"configurations",
"for",
"specified",
"instances",
"."
] | def describe_time_based_auto_scaling(self, instance_ids):
"""
Describes time-based auto scaling configurations for specified
instances.
You must specify at least one of the parameters.
**Required Permissions**: To use this action, an IAM user must
have a Show, Deploy,... | [
"def",
"describe_time_based_auto_scaling",
"(",
"self",
",",
"instance_ids",
")",
":",
"params",
"=",
"{",
"'InstanceIds'",
":",
"instance_ids",
",",
"}",
"return",
"self",
".",
"make_request",
"(",
"action",
"=",
"'DescribeTimeBasedAutoScaling'",
",",
"body",
"="... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py#L1844-L1865 | |
greenheartgames/greenworks | 3ea4ab490b56676de3f0a237c74bcfdb17323e60 | deps/cpplint/cpplint.py | python | _BlockInfo.IsBlockInfo | (self) | return self.__class__ == _BlockInfo | Returns true if this block is a _BlockInfo.
This is convenient for verifying that an object is an instance of
a _BlockInfo, but not an instance of any of the derived classes.
Returns:
True for this class, False for derived classes. | Returns true if this block is a _BlockInfo. | [
"Returns",
"true",
"if",
"this",
"block",
"is",
"a",
"_BlockInfo",
"."
] | def IsBlockInfo(self):
"""Returns true if this block is a _BlockInfo.
This is convenient for verifying that an object is an instance of
a _BlockInfo, but not an instance of any of the derived classes.
Returns:
True for this class, False for derived classes.
"""
return self.__class__ == _... | [
"def",
"IsBlockInfo",
"(",
"self",
")",
":",
"return",
"self",
".",
"__class__",
"==",
"_BlockInfo"
] | https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L2147-L2156 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/versionpredicate.py | python | split_provision | (value) | return m.group(1), ver | Return the name and optional version number of a provision.
The version number, if given, will be returned as a `StrictVersion`
instance, otherwise it will be `None`.
>>> split_provision('mypkg')
('mypkg', None)
>>> split_provision(' mypkg( 1.2 ) ')
('mypkg', StrictVersion ('1.2')) | Return the name and optional version number of a provision. | [
"Return",
"the",
"name",
"and",
"optional",
"version",
"number",
"of",
"a",
"provision",
"."
] | def split_provision(value):
"""Return the name and optional version number of a provision.
The version number, if given, will be returned as a `StrictVersion`
instance, otherwise it will be `None`.
>>> split_provision('mypkg')
('mypkg', None)
>>> split_provision(' mypkg( 1.2 ) ')
('mypkg',... | [
"def",
"split_provision",
"(",
"value",
")",
":",
"global",
"_provision_rx",
"if",
"_provision_rx",
"is",
"None",
":",
"_provision_rx",
"=",
"re",
".",
"compile",
"(",
"\"([a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*)(?:\\s*\\(\\s*([^)\\s]+)\\s*\\))?$\"",
")",
"value",
"=",
"valu... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/versionpredicate.py#L142-L164 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | Widget.drag | (self, dx, dy, viewport) | return _robotsim.Widget_drag(self, dx, dy, viewport) | drag(Widget self, int dx, int dy, Viewport viewport) | drag(Widget self, int dx, int dy, Viewport viewport) | [
"drag",
"(",
"Widget",
"self",
"int",
"dx",
"int",
"dy",
"Viewport",
"viewport",
")"
] | def drag(self, dx, dy, viewport):
"""
drag(Widget self, int dx, int dy, Viewport viewport)
"""
return _robotsim.Widget_drag(self, dx, dy, viewport) | [
"def",
"drag",
"(",
"self",
",",
"dx",
",",
"dy",
",",
"viewport",
")",
":",
"return",
"_robotsim",
".",
"Widget_drag",
"(",
"self",
",",
"dx",
",",
"dy",
",",
"viewport",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L3009-L3016 | |
Netflix/NfWebCrypto | 499faf4eb9f9ccf0b21dc728e974970f54bd6c52 | plugin/ppapi/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py | python | UseWhitelistedChars | (orig_basename, arch) | return result | Make the filename match the pattern expected by pnacl_file_host.
Currently, this assumes there is prefix "pnacl_public_" and
that the allowed chars are in the set [a-zA-Z0-9_]. | Make the filename match the pattern expected by pnacl_file_host. | [
"Make",
"the",
"filename",
"match",
"the",
"pattern",
"expected",
"by",
"pnacl_file_host",
"."
] | def UseWhitelistedChars(orig_basename, arch):
""" Make the filename match the pattern expected by pnacl_file_host.
Currently, this assumes there is prefix "pnacl_public_" and
that the allowed chars are in the set [a-zA-Z0-9_].
"""
if arch:
target_basename = 'pnacl_public_%s_%s' % (arch, orig_basename)
... | [
"def",
"UseWhitelistedChars",
"(",
"orig_basename",
",",
"arch",
")",
":",
"if",
"arch",
":",
"target_basename",
"=",
"'pnacl_public_%s_%s'",
"%",
"(",
"arch",
",",
"orig_basename",
")",
"else",
":",
"target_basename",
"=",
"'pnacl_public_%s'",
"%",
"orig_basename... | https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py#L484-L496 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/mrecords.py | python | fromtextfile | (fname, delimitor=None, commentchar='#', missingchar='',
varnames=None, vartypes=None) | return fromarrays(_datalist, dtype=mdescr) | Creates a mrecarray from data stored in the file `filename`.
Parameters
----------
filename : {file name/handle}
Handle of an opened file.
delimitor : {None, string}, optional
Alphanumeric character used to separate columns in the file.
If None, any (group of) white spacestring(... | Creates a mrecarray from data stored in the file `filename`. | [
"Creates",
"a",
"mrecarray",
"from",
"data",
"stored",
"in",
"the",
"file",
"filename",
"."
] | def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='',
varnames=None, vartypes=None):
"""Creates a mrecarray from data stored in the file `filename`.
Parameters
----------
filename : {file name/handle}
Handle of an opened file.
delimitor : {None, string}, ... | [
"def",
"fromtextfile",
"(",
"fname",
",",
"delimitor",
"=",
"None",
",",
"commentchar",
"=",
"'#'",
",",
"missingchar",
"=",
"''",
",",
"varnames",
"=",
"None",
",",
"vartypes",
"=",
"None",
")",
":",
"# Try to open the file ......................",
"f",
"=",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/mrecords.py#L629-L686 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.PushStyleSheet | (*args, **kwargs) | return _richtext.RichTextCtrl_PushStyleSheet(*args, **kwargs) | PushStyleSheet(self, wxRichTextStyleSheet styleSheet) -> bool
Push style sheet to top of stack | PushStyleSheet(self, wxRichTextStyleSheet styleSheet) -> bool | [
"PushStyleSheet",
"(",
"self",
"wxRichTextStyleSheet",
"styleSheet",
")",
"-",
">",
"bool"
] | def PushStyleSheet(*args, **kwargs):
"""
PushStyleSheet(self, wxRichTextStyleSheet styleSheet) -> bool
Push style sheet to top of stack
"""
return _richtext.RichTextCtrl_PushStyleSheet(*args, **kwargs) | [
"def",
"PushStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_PushStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4007-L4013 | |
tiann/android-native-debug | 198903ed9346dc4a74327a63cb98d449b97d8047 | app/source/art/tools/cpplint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of the... | Retrieves all the text between matching open and close parentheses. | [
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sym... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(sugawarayu): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.... | https://github.com/tiann/android-native-debug/blob/198903ed9346dc4a74327a63cb98d449b97d8047/app/source/art/tools/cpplint.py#L3097-L3150 | |
tkn-tub/ns3-gym | 19bfe0a583e641142609939a090a09dfc63a095f | utils/grid.py | python | GtkGraphicRenderer.output_png | (self, filename) | ! Output PNG
@param self this object
@param filename file name
@return none | ! Output PNG | [
"!",
"Output",
"PNG"
] | def output_png(self, filename):
"""! Output PNG
@param self this object
@param filename file name
@return none
"""
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32,
self.__data.get_width(),
self._... | [
"def",
"output_png",
"(",
"self",
",",
"filename",
")",
":",
"surface",
"=",
"cairo",
".",
"ImageSurface",
"(",
"cairo",
".",
"FORMAT_ARGB32",
",",
"self",
".",
"__data",
".",
"get_width",
"(",
")",
",",
"self",
".",
"__data",
".",
"get_height",
"(",
"... | https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/utils/grid.py#L1339-L1350 | ||
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/DICOM/DICOM.py | python | DICOMWidget.onListenerAddedFile | (self) | Called after the listener has added a file.
Restore and refresh the app model | Called after the listener has added a file.
Restore and refresh the app model | [
"Called",
"after",
"the",
"listener",
"has",
"added",
"a",
"file",
".",
"Restore",
"and",
"refresh",
"the",
"app",
"model"
] | def onListenerAddedFile(self):
"""Called after the listener has added a file.
Restore and refresh the app model
"""
newFile = slicer.dicomListener.lastFileAdded
if newFile:
slicer.util.showStatusMessage("Received DICOM file: %s" % newFile, 1000)
self.databaseRefreshRequestTimer.start() | [
"def",
"onListenerAddedFile",
"(",
"self",
")",
":",
"newFile",
"=",
"slicer",
".",
"dicomListener",
".",
"lastFileAdded",
"if",
"newFile",
":",
"slicer",
".",
"util",
".",
"showStatusMessage",
"(",
"\"Received DICOM file: %s\"",
"%",
"newFile",
",",
"1000",
")"... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/DICOM/DICOM.py#L727-L734 | ||
shogun-toolbox/shogun | 9b8d856971af5a295dd6ad70623ae45647a6334c | applications/easysvm/esvm/experiment.py | python | crossvalidation | (cv, kname, kparam, C, all_examples, all_labels, seq_source, nuc_con) | return (all_outputs, all_split) | Perform cross validation using an SVM
cv -- the number of folds
kernel -- the kernel used
data -- the dataset, assumed to be compatible to kernel, label is in the first column | Perform cross validation using an SVM | [
"Perform",
"cross",
"validation",
"using",
"an",
"SVM"
] | def crossvalidation(cv, kname, kparam, C, all_examples, all_labels, seq_source, nuc_con):
"""Perform cross validation using an SVM
cv -- the number of folds
kernel -- the kernel used
data -- the dataset, assumed to be compatible to kernel, label is in the first column
"""
print 'Using %i-fold ... | [
"def",
"crossvalidation",
"(",
"cv",
",",
"kname",
",",
"kparam",
",",
"C",
",",
"all_examples",
",",
"all_labels",
",",
"seq_source",
",",
"nuc_con",
")",
":",
"print",
"'Using %i-fold crossvalidation'",
"%",
"cv",
"partitions",
"=",
"getPartitionedSet",
"(",
... | https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/applications/easysvm/esvm/experiment.py#L346-L371 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/MultiCall.py | python | _parse_sequence | (sequence) | return modifiers, type, detail | Get a string which should describe an event sequence. If it is
successfully parsed as one, return a tuple containing the state (as an int),
the event type (as an index of _types), and the detail - None if none, or a
string if there is one. If the parsing is unsuccessful, return None. | Get a string which should describe an event sequence. If it is
successfully parsed as one, return a tuple containing the state (as an int),
the event type (as an index of _types), and the detail - None if none, or a
string if there is one. If the parsing is unsuccessful, return None. | [
"Get",
"a",
"string",
"which",
"should",
"describe",
"an",
"event",
"sequence",
".",
"If",
"it",
"is",
"successfully",
"parsed",
"as",
"one",
"return",
"a",
"tuple",
"containing",
"the",
"state",
"(",
"as",
"an",
"int",
")",
"the",
"event",
"type",
"(",
... | def _parse_sequence(sequence):
"""Get a string which should describe an event sequence. If it is
successfully parsed as one, return a tuple containing the state (as an int),
the event type (as an index of _types), and the detail - None if none, or a
string if there is one. If the parsing is unsuccessful... | [
"def",
"_parse_sequence",
"(",
"sequence",
")",
":",
"if",
"not",
"sequence",
"or",
"sequence",
"[",
"0",
"]",
"!=",
"'<'",
"or",
"sequence",
"[",
"-",
"1",
"]",
"!=",
"'>'",
":",
"return",
"None",
"words",
"=",
"string",
".",
"split",
"(",
"sequence... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/MultiCall.py#L254-L294 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/python_version/expected_improvement.py | python | ExpectedImprovement.get_current_point | (self) | return numpy.copy(self._points_to_sample) | Get the current_point (array of float64 with shape (problem_size)) at which this object is evaluating the objective function, ``f(x)``. | Get the current_point (array of float64 with shape (problem_size)) at which this object is evaluating the objective function, ``f(x)``. | [
"Get",
"the",
"current_point",
"(",
"array",
"of",
"float64",
"with",
"shape",
"(",
"problem_size",
"))",
"at",
"which",
"this",
"object",
"is",
"evaluating",
"the",
"objective",
"function",
"f",
"(",
"x",
")",
"."
] | def get_current_point(self):
"""Get the current_point (array of float64 with shape (problem_size)) at which this object is evaluating the objective function, ``f(x)``."""
return numpy.copy(self._points_to_sample) | [
"def",
"get_current_point",
"(",
"self",
")",
":",
"return",
"numpy",
".",
"copy",
"(",
"self",
".",
"_points_to_sample",
")"
] | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/python_version/expected_improvement.py#L218-L220 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/ops.py | python | add | (a, b) | return _binary_operation(_ti_core.expr_add, _bt_ops_mod.add, a, b) | The add function.
Args:
a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): A number or a matrix.
b (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): A number or a matrix.
Returns:
sum of `a` and `b`. | The add function. | [
"The",
"add",
"function",
"."
] | def add(a, b):
"""The add function.
Args:
a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): A number or a matrix.
b (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): A number or a matrix.
Returns:
sum of `a` and `b`.
"... | [
"def",
"add",
"(",
"a",
",",
"b",
")",
":",
"return",
"_binary_operation",
"(",
"_ti_core",
".",
"expr_add",
",",
"_bt_ops_mod",
".",
"add",
",",
"a",
",",
"b",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/ops.py#L402-L412 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/parameter.py | python | Parameter.reset_device | (self, device) | Re-assign Parameter to other devices.
Parameters
----------
device : Device or list of Device, default ``device.current_device()``.
Assign Parameter to given device. If device is a list of Device, a
copy will be made for each device. | Re-assign Parameter to other devices. | [
"Re",
"-",
"assign",
"Parameter",
"to",
"other",
"devices",
"."
] | def reset_device(self, device):
"""Re-assign Parameter to other devices.
Parameters
----------
device : Device or list of Device, default ``device.current_device()``.
Assign Parameter to given device. If device is a list of Device, a
copy will be made for each de... | [
"def",
"reset_device",
"(",
"self",
",",
"device",
")",
":",
"if",
"device",
"is",
"None",
":",
"device",
"=",
"[",
"_device",
".",
"current_device",
"(",
")",
"]",
"if",
"isinstance",
"(",
"device",
",",
"Device",
")",
":",
"device",
"=",
"[",
"devi... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/parameter.py#L494-L516 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/cephfs/setup.py | python | check_sanity | () | Test if development headers and library for cephfs is available by compiling a dummy C program. | Test if development headers and library for cephfs is available by compiling a dummy C program. | [
"Test",
"if",
"development",
"headers",
"and",
"library",
"for",
"cephfs",
"is",
"available",
"by",
"compiling",
"a",
"dummy",
"C",
"program",
"."
] | def check_sanity():
"""
Test if development headers and library for cephfs is available by compiling a dummy C program.
"""
CEPH_SRC_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'..',
'..'
)
tmp_dir = tempfile.mkdtemp(dir=os.environ.get('TMPDIR', os.pa... | [
"def",
"check_sanity",
"(",
")",
":",
"CEPH_SRC_DIR",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"__file__",
")",
")",
",",
"'..'",
",",
"'..'",
")",
"tmp_dir",
"=",
"... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/cephfs/setup.py#L77-L136 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Menu.insert_cascade | (self, index, cnf={}, **kw) | Add hierarchical menu item at INDEX. | Add hierarchical menu item at INDEX. | [
"Add",
"hierarchical",
"menu",
"item",
"at",
"INDEX",
"."
] | def insert_cascade(self, index, cnf={}, **kw):
"""Add hierarchical menu item at INDEX."""
self.insert(index, 'cascade', cnf or kw) | [
"def",
"insert_cascade",
"(",
"self",
",",
"index",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"self",
".",
"insert",
"(",
"index",
",",
"'cascade'",
",",
"cnf",
"or",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2694-L2696 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/tensorflow/tf_nndct/utils/logging.py | python | get_verbosity | () | return get_logger().getEffectiveLevel() | Return how much logging output will be produced. | Return how much logging output will be produced. | [
"Return",
"how",
"much",
"logging",
"output",
"will",
"be",
"produced",
"."
] | def get_verbosity():
"""Return how much logging output will be produced."""
return get_logger().getEffectiveLevel() | [
"def",
"get_verbosity",
"(",
")",
":",
"return",
"get_logger",
"(",
")",
".",
"getEffectiveLevel",
"(",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/tensorflow/tf_nndct/utils/logging.py#L215-L217 | |
leela-zero/leela-zero | e3ed6310d33d75078ba74c3adf887d18439fc2e3 | scripts/cpplint.py | python | ReverseCloseExpression | (clean_lines, linenum, pos) | return (line, 0, -1) | If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | If input points to ) or } or ] or >, finds the position that opens it. | [
"If",
"input",
"points",
"to",
")",
"or",
"}",
"or",
"]",
"or",
">",
"finds",
"the",
"position",
"that",
"opens",
"it",
"."
] | def ReverseCloseExpression(clean_lines, linenum, pos):
"""If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance ... | [
"def",
"ReverseCloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"line",
"[",
"pos",
"]",
"not",
"in",
"')}]>'",
":",
"return",
"(",
"line",
",",
"0",
",",
... | https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L1584-L1619 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/ao/quantization/fx/prepare.py | python | get_arg_target_dtype_as_output | (
arg: Node,
modules: Dict[str, torch.nn.Module],
node_name_to_target_dtype: Dict[str, Dict[str, Optional[torch.dtype]]],
) | Get the target output activation dtype for
the argumnet in the original graph, skipping inserted observers
We are assuming that the observers are inserted correctly, and the dtype for
argument in quantized graph will match what is specified by the qconfig | Get the target output activation dtype for
the argumnet in the original graph, skipping inserted observers
We are assuming that the observers are inserted correctly, and the dtype for
argument in quantized graph will match what is specified by the qconfig | [
"Get",
"the",
"target",
"output",
"activation",
"dtype",
"for",
"the",
"argumnet",
"in",
"the",
"original",
"graph",
"skipping",
"inserted",
"observers",
"We",
"are",
"assuming",
"that",
"the",
"observers",
"are",
"inserted",
"correctly",
"and",
"the",
"dtype",
... | def get_arg_target_dtype_as_output(
arg: Node,
modules: Dict[str, torch.nn.Module],
node_name_to_target_dtype: Dict[str, Dict[str, Optional[torch.dtype]]],
) -> Optional[torch.dtype]:
""" Get the target output activation dtype for
the argumnet in the original graph, skipping inserted observers
W... | [
"def",
"get_arg_target_dtype_as_output",
"(",
"arg",
":",
"Node",
",",
"modules",
":",
"Dict",
"[",
"str",
",",
"torch",
".",
"nn",
".",
"Module",
"]",
",",
"node_name_to_target_dtype",
":",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"Optional",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/fx/prepare.py#L360-L376 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py | python | FTP.mkd | (self, dirname) | return parse257(resp) | Make a directory, return its full pathname. | Make a directory, return its full pathname. | [
"Make",
"a",
"directory",
"return",
"its",
"full",
"pathname",
"."
] | def mkd(self, dirname):
'''Make a directory, return its full pathname.'''
resp = self.sendcmd('MKD ' + dirname)
return parse257(resp) | [
"def",
"mkd",
"(",
"self",
",",
"dirname",
")",
":",
"resp",
"=",
"self",
".",
"sendcmd",
"(",
"'MKD '",
"+",
"dirname",
")",
"return",
"parse257",
"(",
"resp",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py#L566-L569 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/contrib/securetransport.py | python | _read_callback | (connection_id, data_buffer, data_length_pointer) | SecureTransport read callback. This is called by ST to request that data
be returned from the socket. | SecureTransport read callback. This is called by ST to request that data
be returned from the socket. | [
"SecureTransport",
"read",
"callback",
".",
"This",
"is",
"called",
"by",
"ST",
"to",
"request",
"that",
"data",
"be",
"returned",
"from",
"the",
"socket",
"."
] | def _read_callback(connection_id, data_buffer, data_length_pointer):
"""
SecureTransport read callback. This is called by ST to request that data
be returned from the socket.
"""
wrapped_socket = None
try:
wrapped_socket = _connection_refs.get(connection_id)
if wrapped_socket is ... | [
"def",
"_read_callback",
"(",
"connection_id",
",",
"data_buffer",
",",
"data_length_pointer",
")",
":",
"wrapped_socket",
"=",
"None",
"try",
":",
"wrapped_socket",
"=",
"_connection_refs",
".",
"get",
"(",
"connection_id",
")",
"if",
"wrapped_socket",
"is",
"Non... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/contrib/securetransport.py#L204-L256 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/tensor.py | python | Tensor.is_dummy | (self) | Returns:
True if the tensor is a dummy tensor | Returns:
True if the tensor is a dummy tensor | [
"Returns",
":",
"True",
"if",
"the",
"tensor",
"is",
"a",
"dummy",
"tensor"
] | def is_dummy(self):
'''
Returns:
True if the tensor is a dummy tensor
'''
match = re.match(r'Dummy#\d+', self.name)
if match:
return True
else:
return False | [
"def",
"is_dummy",
"(",
"self",
")",
":",
"match",
"=",
"re",
".",
"match",
"(",
"r'Dummy#\\d+'",
",",
"self",
".",
"name",
")",
"if",
"match",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/tensor.py#L159-L168 | ||
tcpexmachina/remy | 687b5db29b81df7ae8737889c78b47e7f9788297 | scripts/plot_log.py | python | BasePlotGenerator.get_plot_data | (self, run_data) | Either this or `iter_plot_data()` be impelemented by subclasses.
Returns a tuple of two elements (x, y) each being a list of data points.
The two lists must have the same length. | Either this or `iter_plot_data()` be impelemented by subclasses.
Returns a tuple of two elements (x, y) each being a list of data points.
The two lists must have the same length. | [
"Either",
"this",
"or",
"iter_plot_data",
"()",
"be",
"impelemented",
"by",
"subclasses",
".",
"Returns",
"a",
"tuple",
"of",
"two",
"elements",
"(",
"x",
"y",
")",
"each",
"being",
"a",
"list",
"of",
"data",
"points",
".",
"The",
"two",
"lists",
"must",... | def get_plot_data(self, run_data):
"""Either this or `iter_plot_data()` be impelemented by subclasses.
Returns a tuple of two elements (x, y) each being a list of data points.
The two lists must have the same length."""
raise NotImplementedError("Subclasses must implement either get_plot... | [
"def",
"get_plot_data",
"(",
"self",
",",
"run_data",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Subclasses must implement either get_plot_data() or iter_plot_data()\"",
")"
] | https://github.com/tcpexmachina/remy/blob/687b5db29b81df7ae8737889c78b47e7f9788297/scripts/plot_log.py#L92-L96 | ||
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | cmake/ReverseDDPostProcess.py | python | get_processed_rows | (file_object: TextIO) | return rows | Process each row by rounding individual tokens and then building back into row strings | Process each row by rounding individual tokens and then building back into row strings | [
"Process",
"each",
"row",
"by",
"rounding",
"individual",
"tokens",
"and",
"then",
"building",
"back",
"into",
"row",
"strings"
] | def get_processed_rows(file_object: TextIO) -> Set[str]:
"""Process each row by rounding individual tokens and then building back into row strings"""
rows = set()
for line_num, li in enumerate(file_object.readlines()):
if line_num == 0:
rows.add(li)
continue
tokens = ... | [
"def",
"get_processed_rows",
"(",
"file_object",
":",
"TextIO",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"rows",
"=",
"set",
"(",
")",
"for",
"line_num",
",",
"li",
"in",
"enumerate",
"(",
"file_object",
".",
"readlines",
"(",
")",
")",
":",
"if",
"li... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/cmake/ReverseDDPostProcess.py#L100-L118 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | Distribution.activate | (self, path=None, replace=False) | Ensure distribution is importable on `path` (default=sys.path) | Ensure distribution is importable on `path` (default=sys.path) | [
"Ensure",
"distribution",
"is",
"importable",
"on",
"path",
"(",
"default",
"=",
"sys",
".",
"path",
")"
] | def activate(self, path=None, replace=False):
"""Ensure distribution is importable on `path` (default=sys.path)"""
if path is None:
path = sys.path
self.insert_on(path, replace=replace)
if path is sys.path:
fixup_namespace_packages(self.location)
for p... | [
"def",
"activate",
"(",
"self",
",",
"path",
"=",
"None",
",",
"replace",
"=",
"False",
")",
":",
"if",
"path",
"is",
"None",
":",
"path",
"=",
"sys",
".",
"path",
"self",
".",
"insert_on",
"(",
"path",
",",
"replace",
"=",
"replace",
")",
"if",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L2776-L2785 | ||
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/lookups.py | python | LookupTable.copy_names | (self, source_lut) | Copies names of matching label indices from a source LookupTable. | Copies names of matching label indices from a source LookupTable. | [
"Copies",
"names",
"of",
"matching",
"label",
"indices",
"from",
"a",
"source",
"LookupTable",
"."
] | def copy_names(self, source_lut):
"""
Copies names of matching label indices from a source LookupTable.
"""
for label in self.keys():
elt = source_lut.get(label)
if elt is not None:
self[label].name = elt.name | [
"def",
"copy_names",
"(",
"self",
",",
"source_lut",
")",
":",
"for",
"label",
"in",
"self",
".",
"keys",
"(",
")",
":",
"elt",
"=",
"source_lut",
".",
"get",
"(",
"label",
")",
"if",
"elt",
"is",
"not",
"None",
":",
"self",
"[",
"label",
"]",
".... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/lookups.py#L96-L103 | ||
lattice/quda | 7d04db018e01718e80cf32d78f44e8cdffdbe46e | lib/generate/wrap.py | python | handle_list | (list_name, list, args) | This function handles indexing lists used as macros in the wrapper generator.
There are two syntaxes:
{{<list_name>}} Evaluates to the whole list, e.g. 'foo, bar, baz'
{{<list_name> <index>}} Evaluates to a particular element of a list. | This function handles indexing lists used as macros in the wrapper generator.
There are two syntaxes:
{{<list_name>}} Evaluates to the whole list, e.g. 'foo, bar, baz'
{{<list_name> <index>}} Evaluates to a particular element of a list. | [
"This",
"function",
"handles",
"indexing",
"lists",
"used",
"as",
"macros",
"in",
"the",
"wrapper",
"generator",
".",
"There",
"are",
"two",
"syntaxes",
":",
"{{",
"<list_name",
">",
"}}",
"Evaluates",
"to",
"the",
"whole",
"list",
"e",
".",
"g",
".",
"f... | def handle_list(list_name, list, args):
"""This function handles indexing lists used as macros in the wrapper generator.
There are two syntaxes:
{{<list_name>}} Evaluates to the whole list, e.g. 'foo, bar, baz'
{{<list_name> <index>}} Evaluates to a particular element of a list.
"... | [
"def",
"handle_list",
"(",
"list_name",
",",
"list",
",",
"args",
")",
":",
"if",
"not",
"args",
":",
"return",
"list",
"else",
":",
"len",
"(",
"args",
")",
"==",
"1",
"or",
"syntax_error",
"(",
"\"Wrong number of args for list expression.\"",
")",
"try",
... | https://github.com/lattice/quda/blob/7d04db018e01718e80cf32d78f44e8cdffdbe46e/lib/generate/wrap.py#L812-L827 | ||
Jittor/jittor | e9aca0444c2bdc8e2389d99122954cd0903eec46 | python/jittor/init.py | python | xavier_uniform | (shape, dtype="float32", gain=1.0) | return uniform(shape, dtype, -bound, bound) | Inplace initialize Jittor Var by xavier_uniform.
The resulting var will have values sampled from
:math:`uniform(-a, a)` where
.. math::
a = \text{gain} \times \sqrt{\frac{6}{\text{fan\_in} + \text{fan\_out}}}
Args:
shape (int or tuple of int):
shape of the return Var.
... | Inplace initialize Jittor Var by xavier_uniform.
The resulting var will have values sampled from
:math:`uniform(-a, a)` where | [
"Inplace",
"initialize",
"Jittor",
"Var",
"by",
"xavier_uniform",
".",
"The",
"resulting",
"var",
"will",
"have",
"values",
"sampled",
"from",
":",
"math",
":",
"uniform",
"(",
"-",
"a",
"a",
")",
"where"
] | def xavier_uniform(shape, dtype="float32", gain=1.0):
''' Inplace initialize Jittor Var by xavier_uniform.
The resulting var will have values sampled from
:math:`uniform(-a, a)` where
.. math::
a = \text{gain} \times \sqrt{\frac{6}{\text{fan\_in} + \text{fan\_out}}}
Args:
shape (in... | [
"def",
"xavier_uniform",
"(",
"shape",
",",
"dtype",
"=",
"\"float32\"",
",",
"gain",
"=",
"1.0",
")",
":",
"assert",
"len",
"(",
"shape",
")",
">",
"1",
"matsize",
"=",
"1",
"for",
"i",
"in",
"shape",
"[",
"2",
":",
"]",
":",
"matsize",
"*=",
"i... | https://github.com/Jittor/jittor/blob/e9aca0444c2bdc8e2389d99122954cd0903eec46/python/jittor/init.py#L503-L533 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/patch_builds/task_generation.py | python | TimeoutInfo.overridden | (cls, exec_timeout=None, timeout=None) | return cls(False, exec_timeout=exec_timeout, timeout=timeout) | Create an instance of TimeoutInfo that overwrites timeouts.
:param exec_timeout: Exec timeout value to overwrite.
:param timeout: Timeout value to overwrite.
:return: TimeoutInfo that overwrites given timeouts. | Create an instance of TimeoutInfo that overwrites timeouts. | [
"Create",
"an",
"instance",
"of",
"TimeoutInfo",
"that",
"overwrites",
"timeouts",
"."
] | def overridden(cls, exec_timeout=None, timeout=None):
"""
Create an instance of TimeoutInfo that overwrites timeouts.
:param exec_timeout: Exec timeout value to overwrite.
:param timeout: Timeout value to overwrite.
:return: TimeoutInfo that overwrites given timeouts.
""... | [
"def",
"overridden",
"(",
"cls",
",",
"exec_timeout",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"not",
"exec_timeout",
"and",
"not",
"timeout",
":",
"raise",
"ValueError",
"(",
"\"Must override either 'exec_timeout' or 'timeout'\"",
")",
"return",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/patch_builds/task_generation.py#L78-L88 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/estimators/dnn.py | python | DNNClassifier.predict_proba | (self,
x=None,
input_fn=None,
batch_size=None,
as_iterable=True) | return preds[key] | Returns predicted probabilities for given features.
Args:
x: features.
input_fn: Input function. If set, x and y must be None.
batch_size: Override default batch size.
as_iterable: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhaust... | Returns predicted probabilities for given features. | [
"Returns",
"predicted",
"probabilities",
"for",
"given",
"features",
"."
] | def predict_proba(self,
x=None,
input_fn=None,
batch_size=None,
as_iterable=True):
"""Returns predicted probabilities for given features.
Args:
x: features.
input_fn: Input function. If set, x and y must be None.
... | [
"def",
"predict_proba",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"as_iterable",
"=",
"True",
")",
":",
"key",
"=",
"prediction_key",
".",
"PredictionKey",
".",
"PROBABILITIES",
"preds",
"=",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/dnn.py#L461-L490 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | python-threatexchange/threatexchange/cli/main.py | python | init_config_file | (cli_provided: t.IO = None) | Initialize the collaboration file from a variety of sources | Initialize the collaboration file from a variety of sources | [
"Initialize",
"the",
"collaboration",
"file",
"from",
"a",
"variety",
"of",
"sources"
] | def init_config_file(cli_provided: t.IO = None) -> CollaborationConfig:
"""Initialize the collaboration file from a variety of sources"""
if cli_provided is not None:
return CollaborationConfig.load(cli_provided)
path_order = ("te.cfg", "~/te.cfg")
for loc in path_order:
path = pathlib.P... | [
"def",
"init_config_file",
"(",
"cli_provided",
":",
"t",
".",
"IO",
"=",
"None",
")",
"->",
"CollaborationConfig",
":",
"if",
"cli_provided",
"is",
"not",
"None",
":",
"return",
"CollaborationConfig",
".",
"load",
"(",
"cli_provided",
")",
"path_order",
"=",
... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/cli/main.py#L162-L181 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py | python | BabylMessage.update_visible | (self) | Update and/or sensibly generate a set of visible headers. | Update and/or sensibly generate a set of visible headers. | [
"Update",
"and",
"/",
"or",
"sensibly",
"generate",
"a",
"set",
"of",
"visible",
"headers",
"."
] | def update_visible(self):
"""Update and/or sensibly generate a set of visible headers."""
for header in self._visible.keys():
if header in self:
self._visible.replace_header(header, self[header])
else:
del self._visible[header]
for header i... | [
"def",
"update_visible",
"(",
"self",
")",
":",
"for",
"header",
"in",
"self",
".",
"_visible",
".",
"keys",
"(",
")",
":",
"if",
"header",
"in",
"self",
":",
"self",
".",
"_visible",
".",
"replace_header",
"(",
"header",
",",
"self",
"[",
"header",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L1863-L1872 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBValue.SetSyntheticChildrenGenerated | (self, arg2) | return _lldb.SBValue_SetSyntheticChildrenGenerated(self, arg2) | SetSyntheticChildrenGenerated(SBValue self, bool arg2) | SetSyntheticChildrenGenerated(SBValue self, bool arg2) | [
"SetSyntheticChildrenGenerated",
"(",
"SBValue",
"self",
"bool",
"arg2",
")"
] | def SetSyntheticChildrenGenerated(self, arg2):
"""SetSyntheticChildrenGenerated(SBValue self, bool arg2)"""
return _lldb.SBValue_SetSyntheticChildrenGenerated(self, arg2) | [
"def",
"SetSyntheticChildrenGenerated",
"(",
"self",
",",
"arg2",
")",
":",
"return",
"_lldb",
".",
"SBValue_SetSyntheticChildrenGenerated",
"(",
"self",
",",
"arg2",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14329-L14331 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/debug.py | python | ProcessedTraceback.standard_exc_info | (self) | return self.exc_type, self.exc_value, tb | Standard python exc_info for re-raising | Standard python exc_info for re-raising | [
"Standard",
"python",
"exc_info",
"for",
"re",
"-",
"raising"
] | def standard_exc_info(self):
"""Standard python exc_info for re-raising"""
tb = self.frames[0]
# the frame will be an actual traceback (or transparent proxy) if
# we are on pypy or a python implementation with support for tproxy
if type(tb) is not TracebackType:
tb = ... | [
"def",
"standard_exc_info",
"(",
"self",
")",
":",
"tb",
"=",
"self",
".",
"frames",
"[",
"0",
"]",
"# the frame will be an actual traceback (or transparent proxy) if",
"# we are on pypy or a python implementation with support for tproxy",
"if",
"type",
"(",
"tb",
")",
"is"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/debug.py#L122-L129 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/examples/automatic_control.py | python | GnssSensor.__init__ | (self, parent_actor) | Constructor method | Constructor method | [
"Constructor",
"method"
] | def __init__(self, parent_actor):
"""Constructor method"""
self.sensor = None
self._parent = parent_actor
self.lat = 0.0
self.lon = 0.0
world = self._parent.get_world()
blueprint = world.get_blueprint_library().find('sensor.other.gnss')
self.sensor = world... | [
"def",
"__init__",
"(",
"self",
",",
"parent_actor",
")",
":",
"self",
".",
"sensor",
"=",
"None",
"self",
".",
"_parent",
"=",
"parent_actor",
"self",
".",
"lat",
"=",
"0.0",
"self",
".",
"lon",
"=",
"0.0",
"world",
"=",
"self",
".",
"_parent",
".",... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/automatic_control.py#L530-L543 | ||
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | assembler/ext/src/python_libs/joblib2/numpy_pickle.py | python | read_zfile | (file_handle) | return data | Read the z-file and return the content as a string
Z-files are raw data compressed with zlib used internally by joblib
for persistence. Backward compatibility is not garantied. Do not
use for external purposes. | Read the z-file and return the content as a string | [
"Read",
"the",
"z",
"-",
"file",
"and",
"return",
"the",
"content",
"as",
"a",
"string"
] | def read_zfile(file_handle):
"""Read the z-file and return the content as a string
Z-files are raw data compressed with zlib used internally by joblib
for persistence. Backward compatibility is not garantied. Do not
use for external purposes.
"""
file_handle.seek(0)
assert _read_magic(file_... | [
"def",
"read_zfile",
"(",
"file_handle",
")",
":",
"file_handle",
".",
"seek",
"(",
"0",
")",
"assert",
"_read_magic",
"(",
"file_handle",
")",
"==",
"_ZFILE_PREFIX",
",",
"\"File does not have the right magic\"",
"length",
"=",
"file_handle",
".",
"read",
"(",
... | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/joblib2/numpy_pickle.py#L53-L72 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.LineFromPosition | (*args, **kwargs) | return _stc.StyledTextCtrl_LineFromPosition(*args, **kwargs) | LineFromPosition(self, int pos) -> int
Retrieve the line containing a position. | LineFromPosition(self, int pos) -> int | [
"LineFromPosition",
"(",
"self",
"int",
"pos",
")",
"-",
">",
"int"
] | def LineFromPosition(*args, **kwargs):
"""
LineFromPosition(self, int pos) -> int
Retrieve the line containing a position.
"""
return _stc.StyledTextCtrl_LineFromPosition(*args, **kwargs) | [
"def",
"LineFromPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_LineFromPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3601-L3607 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/layers.py | python | _inner_flatten | (inputs, new_rank, output_collections=None, scope=None) | return utils.collect_named_outputs(output_collections, sc, flattened) | Flattens inner dimensions of `inputs`, returns a Tensor with `new_rank`.
For example:
'''
x = tf.random.uniform(shape=[1, 2, 3, 4, 5, 6])
y = _inner_flatten(x, 4)
assert y.get_shape().as_list() == [1, 2, 3, (4 * 5 * 6)]
'''
This layer will fail at run time if `new_rank` is greater than the cu... | Flattens inner dimensions of `inputs`, returns a Tensor with `new_rank`. | [
"Flattens",
"inner",
"dimensions",
"of",
"inputs",
"returns",
"a",
"Tensor",
"with",
"new_rank",
"."
] | def _inner_flatten(inputs, new_rank, output_collections=None, scope=None):
"""Flattens inner dimensions of `inputs`, returns a Tensor with `new_rank`.
For example:
'''
x = tf.random.uniform(shape=[1, 2, 3, 4, 5, 6])
y = _inner_flatten(x, 4)
assert y.get_shape().as_list() == [1, 2, 3, (4 * 5 * 6... | [
"def",
"_inner_flatten",
"(",
"inputs",
",",
"new_rank",
",",
"output_collections",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"scope",
",",
"'InnerFlatten'",
",",
"[",
"inputs",
",",
"new_rank",
"]",
")",
"a... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/layers.py#L1683-L1714 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewItemAttr.GetEffectiveFont | (*args, **kwargs) | return _dataview.DataViewItemAttr_GetEffectiveFont(*args, **kwargs) | GetEffectiveFont(self, Font font) -> Font | GetEffectiveFont(self, Font font) -> Font | [
"GetEffectiveFont",
"(",
"self",
"Font",
"font",
")",
"-",
">",
"Font"
] | def GetEffectiveFont(*args, **kwargs):
"""GetEffectiveFont(self, Font font) -> Font"""
return _dataview.DataViewItemAttr_GetEffectiveFont(*args, **kwargs) | [
"def",
"GetEffectiveFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewItemAttr_GetEffectiveFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L381-L383 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/response_graph_ucb.py | python | ResponseGraphUCB.check_confidence | (self) | return edges_removed | Returns the edges that are 'resolved' given a confidence bound check. | Returns the edges that are 'resolved' given a confidence bound check. | [
"Returns",
"the",
"edges",
"that",
"are",
"resolved",
"given",
"a",
"confidence",
"bound",
"check",
"."
] | def check_confidence(self):
"""Returns the edges that are 'resolved' given a confidence bound check."""
edges_to_check = []
for e in self.edges_remaining:
for s in self.active_strategy_profiles:
if s in e:
if e not in edges_to_check:
edges_to_check.append(e)
edges_r... | [
"def",
"check_confidence",
"(",
"self",
")",
":",
"edges_to_check",
"=",
"[",
"]",
"for",
"e",
"in",
"self",
".",
"edges_remaining",
":",
"for",
"s",
"in",
"self",
".",
"active_strategy_profiles",
":",
"if",
"s",
"in",
"e",
":",
"if",
"e",
"not",
"in",... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/response_graph_ucb.py#L355-L375 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/__init__.py | python | Distribution._dep_map | (self) | return self.__dep_map | A map of extra to its list of (direct) requirements
for this distribution, including the null extra. | A map of extra to its list of (direct) requirements
for this distribution, including the null extra. | [
"A",
"map",
"of",
"extra",
"to",
"its",
"list",
"of",
"(",
"direct",
")",
"requirements",
"for",
"this",
"distribution",
"including",
"the",
"null",
"extra",
"."
] | def _dep_map(self):
"""
A map of extra to its list of (direct) requirements
for this distribution, including the null extra.
"""
try:
return self.__dep_map
except AttributeError:
self.__dep_map = self._filter_extras(self._build_dep_map())
r... | [
"def",
"_dep_map",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"__dep_map",
"except",
"AttributeError",
":",
"self",
".",
"__dep_map",
"=",
"self",
".",
"_filter_extras",
"(",
"self",
".",
"_build_dep_map",
"(",
")",
")",
"return",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/__init__.py#L2707-L2716 | |
PlatformLab/Arachne | e67391471007174dd4002dc2c160628e19c284e8 | scripts/cpplint.py | python | _AddFilters | (filters) | Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Adds more filter overrides. | [
"Adds",
"more",
"filter",
"overrides",
"."
] | def _AddFilters(filters):
"""Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint_sta... | [
"def",
"_AddFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"AddFilters",
"(",
"filters",
")"
] | https://github.com/PlatformLab/Arachne/blob/e67391471007174dd4002dc2c160628e19c284e8/scripts/cpplint.py#L986-L996 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/filters.py | python | do_capitalize | (s) | return soft_unicode(s).capitalize() | Capitalize a value. The first character will be uppercase, all others
lowercase. | Capitalize a value. The first character will be uppercase, all others
lowercase. | [
"Capitalize",
"a",
"value",
".",
"The",
"first",
"character",
"will",
"be",
"uppercase",
"all",
"others",
"lowercase",
"."
] | def do_capitalize(s):
"""Capitalize a value. The first character will be uppercase, all others
lowercase.
"""
return soft_unicode(s).capitalize() | [
"def",
"do_capitalize",
"(",
"s",
")",
":",
"return",
"soft_unicode",
"(",
"s",
")",
".",
"capitalize",
"(",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/filters.py#L189-L193 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/configure.py | python | is_arch_armv6 | () | return cc_macros_cache.get('__ARM_ARCH') == '6' | Check for ARMv6 instructions | Check for ARMv6 instructions | [
"Check",
"for",
"ARMv6",
"instructions"
] | def is_arch_armv6():
"""Check for ARMv6 instructions"""
cc_macros_cache = cc_macros()
return cc_macros_cache.get('__ARM_ARCH') == '6' | [
"def",
"is_arch_armv6",
"(",
")",
":",
"cc_macros_cache",
"=",
"cc_macros",
"(",
")",
"return",
"cc_macros_cache",
".",
"get",
"(",
"'__ARM_ARCH'",
")",
"==",
"'6'"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/configure.py#L818-L821 | |
sfzhang15/FaceBoxes | b52cc92f9362d3adc08d54666aeb9ebb62fdb7da | scripts/cpp_lint.py | python | ProcessFile | (filename, vlevel, extra_check_functions=[]) | Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An array of additional check functions that will be
... | Does google-lint on a single file. | [
"Does",
"google",
"-",
"lint",
"on",
"a",
"single",
"file",
"."
] | def ProcessFile(filename, vlevel, extra_check_functions=[]):
"""Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An ar... | [
"def",
"ProcessFile",
"(",
"filename",
",",
"vlevel",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"_SetVerboseLevel",
"(",
"vlevel",
")",
"try",
":",
"# Support the UNIX convention of using \"-\" for stdin. Note that",
"# we are not opening the file with universal... | https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/scripts/cpp_lint.py#L4693-L4758 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_math_ops.py | python | get_bprop_sin | (self) | return bprop | Grad definition for `Sin` operation. | Grad definition for `Sin` operation. | [
"Grad",
"definition",
"for",
"Sin",
"operation",
"."
] | def get_bprop_sin(self):
"""Grad definition for `Sin` operation."""
cos = P.Cos()
def bprop(x, out, dout):
dx = dout * cos(x)
return (dx,)
return bprop | [
"def",
"get_bprop_sin",
"(",
"self",
")",
":",
"cos",
"=",
"P",
".",
"Cos",
"(",
")",
"def",
"bprop",
"(",
"x",
",",
"out",
",",
"dout",
")",
":",
"dx",
"=",
"dout",
"*",
"cos",
"(",
"x",
")",
"return",
"(",
"dx",
",",
")",
"return",
"bprop"
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_math_ops.py#L1046-L1054 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | get_map_func | (a) | return FuncDeclRef(
Z3_to_func_decl(
a.ctx_ref(),
Z3_get_decl_ast_parameter(a.ctx_ref(), a.decl().ast, 0),
),
ctx=a.ctx,
) | Return the function declaration associated with a Z3 map array expression.
>>> f = Function('f', IntSort(), IntSort())
>>> b = Array('b', IntSort(), IntSort())
>>> a = Map(f, b)
>>> eq(f, get_map_func(a))
True
>>> get_map_func(a)
f
>>> get_map_func(a)(0)
f(0) | Return the function declaration associated with a Z3 map array expression. | [
"Return",
"the",
"function",
"declaration",
"associated",
"with",
"a",
"Z3",
"map",
"array",
"expression",
"."
] | def get_map_func(a):
"""Return the function declaration associated with a Z3 map array expression.
>>> f = Function('f', IntSort(), IntSort())
>>> b = Array('b', IntSort(), IntSort())
>>> a = Map(f, b)
>>> eq(f, get_map_func(a))
True
>>> get_map_func(a)
f
>>> get_map_func(a)(0)
... | [
"def",
"get_map_func",
"(",
"a",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_map",
"(",
"a",
")",
",",
"\"Z3 array map expression expected.\"",
")",
"return",
"FuncDeclRef",
"(",
"Z3_to_func_decl",
"(",
"a",
".",
"ctx_ref",
"(",
")",
... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L4641-L4662 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | RobotModelLink.getAngularVelocity | (self) | return _robotsim.RobotModelLink_getAngularVelocity(self) | getAngularVelocity(RobotModelLink self)
Returns the angular velocity of the link given the robot's current joint
configuration and velocities.
Returns:
(list of 3 floats): the current angular velocity of the link, in world
coordinates | getAngularVelocity(RobotModelLink self) | [
"getAngularVelocity",
"(",
"RobotModelLink",
"self",
")"
] | def getAngularVelocity(self):
"""
getAngularVelocity(RobotModelLink self)
Returns the angular velocity of the link given the robot's current joint
configuration and velocities.
Returns:
(list of 3 floats): the current angular velocity of the link, in world
... | [
"def",
"getAngularVelocity",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RobotModelLink_getAngularVelocity",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L4028-L4043 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py | python | is_same_structure | (structure1,
structure2,
check_values=False) | return True | Check two structures for equality, optionally of types and of values. | Check two structures for equality, optionally of types and of values. | [
"Check",
"two",
"structures",
"for",
"equality",
"optionally",
"of",
"types",
"and",
"of",
"values",
"."
] | def is_same_structure(structure1,
structure2,
check_values=False):
"""Check two structures for equality, optionally of types and of values."""
try:
nest.assert_same_structure(structure1, structure2, expand_composites=True)
except (ValueError, TypeError):
return ... | [
"def",
"is_same_structure",
"(",
"structure1",
",",
"structure2",
",",
"check_values",
"=",
"False",
")",
":",
"try",
":",
"nest",
".",
"assert_same_structure",
"(",
"structure1",
",",
"structure2",
",",
"expand_composites",
"=",
"True",
")",
"except",
"(",
"V... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py#L242-L257 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/numpy_interface/internal_algorithms.py | python | sum | (narray, axis=None) | return numpy.sum(narray, axis) | Returns the min value of an array of scalars/vectors/tensors. | Returns the min value of an array of scalars/vectors/tensors. | [
"Returns",
"the",
"min",
"value",
"of",
"an",
"array",
"of",
"scalars",
"/",
"vectors",
"/",
"tensors",
"."
] | def sum (narray, axis=None):
"Returns the min value of an array of scalars/vectors/tensors."
if narray is dsa.NoneArray:
return dsa.NoneArray
return numpy.sum(narray, axis) | [
"def",
"sum",
"(",
"narray",
",",
"axis",
"=",
"None",
")",
":",
"if",
"narray",
"is",
"dsa",
".",
"NoneArray",
":",
"return",
"dsa",
".",
"NoneArray",
"return",
"numpy",
".",
"sum",
"(",
"narray",
",",
"axis",
")"
] | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/numpy_interface/internal_algorithms.py#L442-L446 | |
BlueBrain/Brayns | 0133aae76cc2b7f800fc0bfb064400b64fd9b792 | python/brayns/client/reply_error.py | python | ReplyError.__init__ | (
self,
code: int,
message: str,
data: Any = None
) | Init exception attributes.
:param code: error code.
:type code: int
:param message: error description
:type message: str
:param data: additional error data, defaults to None
:type data: Any, optional | Init exception attributes. | [
"Init",
"exception",
"attributes",
"."
] | def __init__(
self,
code: int,
message: str,
data: Any = None
) -> None:
"""Init exception attributes.
:param code: error code.
:type code: int
:param message: error description
:type message: str
:param data: additional error data, de... | [
"def",
"__init__",
"(",
"self",
",",
"code",
":",
"int",
",",
"message",
":",
"str",
",",
"data",
":",
"Any",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"code",
"=",
"code",
"self",
".",
"message",
"=",
"message",
"self",
".",
"data",
"=",... | https://github.com/BlueBrain/Brayns/blob/0133aae76cc2b7f800fc0bfb064400b64fd9b792/python/brayns/client/reply_error.py#L42-L59 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/plugin.py | python | Plugin.getType | (self, name) | return self._trch_gettype(name) | Get the type of a parameter | Get the type of a parameter | [
"Get",
"the",
"type",
"of",
"a",
"parameter"
] | def getType(self, name):
"""Get the type of a parameter"""
return self._trch_gettype(name) | [
"def",
"getType",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_trch_gettype",
"(",
"name",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/plugin.py#L160-L162 | |
choasup/caffe-yolo9000 | e8a476c4c23d756632f7a26c681a96e3ab672544 | scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/scripts/cpp_lint.py#L1254-L1297 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/internal/encoder.py | python | GroupSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a group field. | Returns a sizer for a group field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"group",
"field",
"."
] | def GroupSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a group field."""
tag_size = _TagSize(field_number) * 2
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in value:
result += element.ByteSize()
... | [
"def",
"GroupSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"*",
"2",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"def",
"RepeatedFieldSize",
"(",
"value",
")",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/encoder.py#L274-L289 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/BASIC/basparse.py | python | p_statement_interactive | (p) | statement : RUN NEWLINE
| LIST NEWLINE
| NEW NEWLINE | statement : RUN NEWLINE
| LIST NEWLINE
| NEW NEWLINE | [
"statement",
":",
"RUN",
"NEWLINE",
"|",
"LIST",
"NEWLINE",
"|",
"NEW",
"NEWLINE"
] | def p_statement_interactive(p):
'''statement : RUN NEWLINE
| LIST NEWLINE
| NEW NEWLINE'''
p[0] = (0, (p[1],0)) | [
"def",
"p_statement_interactive",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"(",
"0",
",",
"(",
"p",
"[",
"1",
"]",
",",
"0",
")",
")"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basparse.py#L56-L60 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/autodiff/ad.py | python | ADFunctionInterface.n_args | (self) | Returns the number of arguments. | Returns the number of arguments. | [
"Returns",
"the",
"number",
"of",
"arguments",
"."
] | def n_args(self):
"""Returns the number of arguments."""
raise NotImplementedError() | [
"def",
"n_args",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/autodiff/ad.py#L303-L305 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/linalg/python/ops/linear_operator.py | python | LinearOperator._assert_non_singular | (self) | Private default implementation of _assert_non_singular. | Private default implementation of _assert_non_singular. | [
"Private",
"default",
"implementation",
"of",
"_assert_non_singular",
"."
] | def _assert_non_singular(self):
"""Private default implementation of _assert_non_singular."""
logging.warn(
"Using (possibly slow) default implementation of assert_non_singular."
" Requires conversion to a dense matrix and O(N^3) operations.")
if self._can_use_cholesky():
return self.... | [
"def",
"_assert_non_singular",
"(",
"self",
")",
":",
"logging",
".",
"warn",
"(",
"\"Using (possibly slow) default implementation of assert_non_singular.\"",
"\" Requires conversion to a dense matrix and O(N^3) operations.\"",
")",
"if",
"self",
".",
"_can_use_cholesky",
"(",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/linalg/python/ops/linear_operator.py#L463-L480 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/BASIC/basparse.py | python | p_optstep | (p) | optstep : STEP expr
| empty | optstep : STEP expr
| empty | [
"optstep",
":",
"STEP",
"expr",
"|",
"empty"
] | def p_optstep(p):
'''optstep : STEP expr
| empty'''
if len(p) == 3:
p[0] = p[2]
else:
p[0] = None | [
"def",
"p_optstep",
"(",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"3",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"2",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"None"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/BASIC/basparse.py#L182-L188 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/code.py | python | InteractiveInterpreter.runsource | (self, source, filename="<input>", symbol="single") | return False | Compile and run some source in the interpreter.
Arguments are as for compile_command().
One several things can happen:
1) The input is incorrect; compile_command() raised an
exception (SyntaxError or OverflowError). A syntax traceback
will be printed by calling the showsyntax... | Compile and run some source in the interpreter. | [
"Compile",
"and",
"run",
"some",
"source",
"in",
"the",
"interpreter",
"."
] | def runsource(self, source, filename="<input>", symbol="single"):
"""Compile and run some source in the interpreter.
Arguments are as for compile_command().
One several things can happen:
1) The input is incorrect; compile_command() raised an
exception (SyntaxError or Overflow... | [
"def",
"runsource",
"(",
"self",
",",
"source",
",",
"filename",
"=",
"\"<input>\"",
",",
"symbol",
"=",
"\"single\"",
")",
":",
"try",
":",
"code",
"=",
"self",
".",
"compile",
"(",
"source",
",",
"filename",
",",
"symbol",
")",
"except",
"(",
"Overfl... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/code.py#L51-L88 | |
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py | python | NotEmacsMode.start_kbd_macro | (self, e) | Begin saving the characters typed into the current keyboard macro. | Begin saving the characters typed into the current keyboard macro. | [
"Begin",
"saving",
"the",
"characters",
"typed",
"into",
"the",
"current",
"keyboard",
"macro",
"."
] | def start_kbd_macro(self, e): # (C-x ()
'''Begin saving the characters typed into the current keyboard macro. '''
pass | [
"def",
"start_kbd_macro",
"(",
"self",
",",
"e",
")",
":",
"# (C-x ()",
"pass"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py#L469-L471 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py | python | _TensorArrayConcatGrad | (op, grad, unused_lengths_grad) | return [None, u_g.flow] | Gradient for TensorArrayConcat.
Args:
op: Forward TensorArrayConcat op.
grad: Gradient `Tensor` to TensorArrayConcat.
Returns:
A flow `Tensor`, which can be used in control dependencies to
force the write of `grad` to the gradient `TensorArray`. | Gradient for TensorArrayConcat. | [
"Gradient",
"for",
"TensorArrayConcat",
"."
] | def _TensorArrayConcatGrad(op, grad, unused_lengths_grad):
"""Gradient for TensorArrayConcat.
Args:
op: Forward TensorArrayConcat op.
grad: Gradient `Tensor` to TensorArrayConcat.
Returns:
A flow `Tensor`, which can be used in control dependencies to
force the write of `grad` to the gradient `Te... | [
"def",
"_TensorArrayConcatGrad",
"(",
"op",
",",
"grad",
",",
"unused_lengths_grad",
")",
":",
"# Note: the forward flow dependency in the call to grad() is necessary for",
"# the case of dynamic sized TensorArrays. When creating the gradient",
"# TensorArray, the final size of the forward ... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py#L167-L192 | |
vesoft-inc/nebula | 25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35 | .linters/cpp/cpplint.py | python | _BackupFilters | () | Saves the current filter list to backup storage. | Saves the current filter list to backup storage. | [
"Saves",
"the",
"current",
"filter",
"list",
"to",
"backup",
"storage",
"."
] | def _BackupFilters():
""" Saves the current filter list to backup storage."""
_cpplint_state.BackupFilters() | [
"def",
"_BackupFilters",
"(",
")",
":",
"_cpplint_state",
".",
"BackupFilters",
"(",
")"
] | https://github.com/vesoft-inc/nebula/blob/25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35/.linters/cpp/cpplint.py#L1233-L1235 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | tools/query_cmp/src/query_two_server.py | python | getopt | () | return options | get options from user. | get options from user. | [
"get",
"options",
"from",
"user",
"."
] | def getopt():
"""
get options from user.
"""
usage = "usage: %prog -f <file> -s <svr1> [-p <port1>] -t <svr2> [-q <port2>] [-e] [-u] [--bufsize] [--edns]"
parser = OptionParser(usage)
parser.add_option("-f", "--file", dest="filename",
help="specify the input data filename")
parser.add_option("-s", "--svr1", de... | [
"def",
"getopt",
"(",
")",
":",
"usage",
"=",
"\"usage: %prog -f <file> -s <svr1> [-p <port1>] -t <svr2> [-q <port2>] [-e] [-u] [--bufsize] [--edns]\"",
"parser",
"=",
"OptionParser",
"(",
"usage",
")",
"parser",
".",
"add_option",
"(",
"\"-f\"",
",",
"\"--file\"",
",",
"... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/tools/query_cmp/src/query_two_server.py#L24-L57 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | Grid.SetDefaultCellOverflow | (*args, **kwargs) | return _grid.Grid_SetDefaultCellOverflow(*args, **kwargs) | SetDefaultCellOverflow(self, bool allow) | SetDefaultCellOverflow(self, bool allow) | [
"SetDefaultCellOverflow",
"(",
"self",
"bool",
"allow",
")"
] | def SetDefaultCellOverflow(*args, **kwargs):
"""SetDefaultCellOverflow(self, bool allow)"""
return _grid.Grid_SetDefaultCellOverflow(*args, **kwargs) | [
"def",
"SetDefaultCellOverflow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_SetDefaultCellOverflow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1966-L1968 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/interactiveshell.py | python | InteractiveShell._showtraceback | (self, etype, evalue, stb: str) | Actually show a traceback.
Subclasses may override this method to put the traceback on a different
place, like a side channel. | Actually show a traceback. | [
"Actually",
"show",
"a",
"traceback",
"."
] | def _showtraceback(self, etype, evalue, stb: str):
"""Actually show a traceback.
Subclasses may override this method to put the traceback on a different
place, like a side channel.
"""
val = self.InteractiveTB.stb2text(stb)
try:
print(val)
except Unic... | [
"def",
"_showtraceback",
"(",
"self",
",",
"etype",
",",
"evalue",
",",
"stb",
":",
"str",
")",
":",
"val",
"=",
"self",
".",
"InteractiveTB",
".",
"stb2text",
"(",
"stb",
")",
"try",
":",
"print",
"(",
"val",
")",
"except",
"UnicodeEncodeError",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/interactiveshell.py#L2094-L2104 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Task.py | python | Task.split_argfile | (self, cmd) | return ([cmd[0]], [self.quote_flag(x) for x in cmd[1:]]) | Splits a list of process commands into the executable part and its list of arguments
:return: a tuple containing the executable first and then the rest of arguments
:rtype: tuple | Splits a list of process commands into the executable part and its list of arguments | [
"Splits",
"a",
"list",
"of",
"process",
"commands",
"into",
"the",
"executable",
"part",
"and",
"its",
"list",
"of",
"arguments"
] | def split_argfile(self, cmd):
"""
Splits a list of process commands into the executable part and its list of arguments
:return: a tuple containing the executable first and then the rest of arguments
:rtype: tuple
"""
return ([cmd[0]], [self.quote_flag(x) for x in cmd[1:]]) | [
"def",
"split_argfile",
"(",
"self",
",",
"cmd",
")",
":",
"return",
"(",
"[",
"cmd",
"[",
"0",
"]",
"]",
",",
"[",
"self",
".",
"quote_flag",
"(",
"x",
")",
"for",
"x",
"in",
"cmd",
"[",
"1",
":",
"]",
"]",
")"
] | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Task.py#L266-L273 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_basic.py | python | Shape.GetSpaceAttachments | (self) | return self._spaceAttachments | Return whether lines should be spaced out evenly at the point they
touch the node (True), or whether they should join at a single point
(False). | Return whether lines should be spaced out evenly at the point they
touch the node (True), or whether they should join at a single point
(False). | [
"Return",
"whether",
"lines",
"should",
"be",
"spaced",
"out",
"evenly",
"at",
"the",
"point",
"they",
"touch",
"the",
"node",
"(",
"True",
")",
"or",
"whether",
"they",
"should",
"join",
"at",
"a",
"single",
"point",
"(",
"False",
")",
"."
] | def GetSpaceAttachments(self):
"""Return whether lines should be spaced out evenly at the point they
touch the node (True), or whether they should join at a single point
(False).
"""
return self._spaceAttachments | [
"def",
"GetSpaceAttachments",
"(",
"self",
")",
":",
"return",
"self",
".",
"_spaceAttachments"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_basic.py#L1991-L1996 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py | python | reroute_b2a | (sgv0, sgv1) | return _reroute_sgv(sgv0, sgv1, _RerouteMode.b2a) | Re-route the inputs and outputs of sgv1 to sgv0 (see _reroute). | Re-route the inputs and outputs of sgv1 to sgv0 (see _reroute). | [
"Re",
"-",
"route",
"the",
"inputs",
"and",
"outputs",
"of",
"sgv1",
"to",
"sgv0",
"(",
"see",
"_reroute",
")",
"."
] | def reroute_b2a(sgv0, sgv1):
"""Re-route the inputs and outputs of sgv1 to sgv0 (see _reroute)."""
return _reroute_sgv(sgv0, sgv1, _RerouteMode.b2a) | [
"def",
"reroute_b2a",
"(",
"sgv0",
",",
"sgv1",
")",
":",
"return",
"_reroute_sgv",
"(",
"sgv0",
",",
"sgv1",
",",
"_RerouteMode",
".",
"b2a",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py#L438-L440 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-utils/modtool/cli/base.py | python | cli | () | A tool for editing GNU Radio out-of-tree modules. | A tool for editing GNU Radio out-of-tree modules. | [
"A",
"tool",
"for",
"editing",
"GNU",
"Radio",
"out",
"-",
"of",
"-",
"tree",
"modules",
"."
] | def cli():
"""A tool for editing GNU Radio out-of-tree modules."""
pass | [
"def",
"cli",
"(",
")",
":",
"pass"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/cli/base.py#L147-L149 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/BilbyCustomFunctions_Reduction.py | python | strip_NaNs | (output_workspace, base_output_name) | return base_output_name | Strip NaNs from the 1D OutputWorkspace | Strip NaNs from the 1D OutputWorkspace | [
"Strip",
"NaNs",
"from",
"the",
"1D",
"OutputWorkspace"
] | def strip_NaNs(output_workspace, base_output_name):
""" Strip NaNs from the 1D OutputWorkspace """ # add isinf
data = output_workspace.readY(0)
start_index = next((index for index in range(len(data)) if not math.isnan(data[index])), None)
end_index = next((index for index in range(len(data)-1, -1, -1... | [
"def",
"strip_NaNs",
"(",
"output_workspace",
",",
"base_output_name",
")",
":",
"# add isinf",
"data",
"=",
"output_workspace",
".",
"readY",
"(",
"0",
")",
"start_index",
"=",
"next",
"(",
"(",
"index",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"da... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/BilbyCustomFunctions_Reduction.py#L100-L113 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/install.py | python | install.has_scripts | (self) | return self.distribution.has_scripts() | Returns true if the current distribution has any scripts to.
install. | Returns true if the current distribution has any scripts to.
install. | [
"Returns",
"true",
"if",
"the",
"current",
"distribution",
"has",
"any",
"scripts",
"to",
".",
"install",
"."
] | def has_scripts(self):
"""Returns true if the current distribution has any scripts to.
install."""
return self.distribution.has_scripts() | [
"def",
"has_scripts",
"(",
"self",
")",
":",
"return",
"self",
".",
"distribution",
".",
"has_scripts",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/install.py#L639-L642 | |
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/execute.py | python | OrderTicket.set_session | (self, session) | return self | Sets session type using ORDER_SESSION_[] constant. Returns self. | Sets session type using ORDER_SESSION_[] constant. Returns self. | [
"Sets",
"session",
"type",
"using",
"ORDER_SESSION_",
"[]",
"constant",
".",
"Returns",
"self",
"."
] | def set_session(self, session):
"""Sets session type using ORDER_SESSION_[] constant. Returns self."""
clib.set_val('OrderTicket_SetSession_ABI', c_int, session, self._obj)
return self | [
"def",
"set_session",
"(",
"self",
",",
"session",
")",
":",
"clib",
".",
"set_val",
"(",
"'OrderTicket_SetSession_ABI'",
",",
"c_int",
",",
"session",
",",
"self",
".",
"_obj",
")",
"return",
"self"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/execute.py#L309-L312 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/feature_column.py | python | hashed_embedding_column | (column_name,
size,
dimension,
combiner=None,
initializer=None) | return _HashedEmbeddingColumn(column_name, size, dimension, combiner,
initializer) | Creates an embedding column of a sparse feature using parameter hashing.
The i-th embedding component of a value v is found by retrieving an
embedding weight whose index is a fingerprint of the pair (v,i).
Args:
column_name: A string defining sparse column name.
size: An integer specifying the number of... | Creates an embedding column of a sparse feature using parameter hashing. | [
"Creates",
"an",
"embedding",
"column",
"of",
"a",
"sparse",
"feature",
"using",
"parameter",
"hashing",
"."
] | def hashed_embedding_column(column_name,
size,
dimension,
combiner=None,
initializer=None):
"""Creates an embedding column of a sparse feature using parameter hashing.
The i-th embedding component of a v... | [
"def",
"hashed_embedding_column",
"(",
"column_name",
",",
"size",
",",
"dimension",
",",
"combiner",
"=",
"None",
",",
"initializer",
"=",
"None",
")",
":",
"if",
"combiner",
"is",
"None",
":",
"logging",
".",
"warn",
"(",
"\"The default value of combiner will ... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/feature_column.py#L1057-L1105 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/saved_model/builder_impl.py | python | _add_asset_to_collection | (asset_filename, asset_tensor) | Builds an asset proto and adds it to the asset collection of the graph.
Args:
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to populate the tensor info of the
asset proto. | Builds an asset proto and adds it to the asset collection of the graph. | [
"Builds",
"an",
"asset",
"proto",
"and",
"adds",
"it",
"to",
"the",
"asset",
"collection",
"of",
"the",
"graph",
"."
] | def _add_asset_to_collection(asset_filename, asset_tensor):
"""Builds an asset proto and adds it to the asset collection of the graph.
Args:
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to populate the tensor info of the
asset proto.
"""
asset_proto... | [
"def",
"_add_asset_to_collection",
"(",
"asset_filename",
",",
"asset_tensor",
")",
":",
"asset_proto",
"=",
"meta_graph_pb2",
".",
"AssetFileDef",
"(",
")",
"asset_proto",
".",
"filename",
"=",
"asset_filename",
"asset_proto",
".",
"tensor_info",
".",
"name",
"=",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/saved_model/builder_impl.py#L491-L505 | ||
baidu/AnyQ | d94d450d2aaa5f7ed73424b10aa4539835b97527 | tools/simnet/train/paddle/layers/paddle_layers.py | python | SigmoidLayer.ops | (self, input) | return sigmoid | operation | operation | [
"operation"
] | def ops(self, input):
"""
operation
"""
sigmoid = fluid.layers.sigmoid(input)
return sigmoid | [
"def",
"ops",
"(",
"self",
",",
"input",
")",
":",
"sigmoid",
"=",
"fluid",
".",
"layers",
".",
"sigmoid",
"(",
"input",
")",
"return",
"sigmoid"
] | https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/train/paddle/layers/paddle_layers.py#L366-L371 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/__init__.py | python | PackageFinder._build_filter | (*patterns) | return lambda name: any(fnmatchcase(name, pat=pat) for pat in patterns) | Given a list of patterns, return a callable that will be true only if
the input matches at least one of the patterns. | Given a list of patterns, return a callable that will be true only if
the input matches at least one of the patterns. | [
"Given",
"a",
"list",
"of",
"patterns",
"return",
"a",
"callable",
"that",
"will",
"be",
"true",
"only",
"if",
"the",
"input",
"matches",
"at",
"least",
"one",
"of",
"the",
"patterns",
"."
] | def _build_filter(*patterns):
"""
Given a list of patterns, return a callable that will be true only if
the input matches at least one of the patterns.
"""
return lambda name: any(fnmatchcase(name, pat=pat) for pat in patterns) | [
"def",
"_build_filter",
"(",
"*",
"patterns",
")",
":",
"return",
"lambda",
"name",
":",
"any",
"(",
"fnmatchcase",
"(",
"name",
",",
"pat",
"=",
"pat",
")",
"for",
"pat",
"in",
"patterns",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/__init__.py#L109-L114 | |
christinaa/LLVM-VideoCore4 | 7773c3c9e5d22b785d4b96ed0acea37c8aa9c183 | bindings/python/llvm/object.py | python | Relocation.type_name | (self) | return lib.LLVMGetRelocationTypeName(self) | The relocation type's name, as a str. | The relocation type's name, as a str. | [
"The",
"relocation",
"type",
"s",
"name",
"as",
"a",
"str",
"."
] | def type_name(self):
"""The relocation type's name, as a str."""
if self.expired:
raise Exception('Relocation instance has expired.')
return lib.LLVMGetRelocationTypeName(self) | [
"def",
"type_name",
"(",
"self",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Relocation instance has expired.'",
")",
"return",
"lib",
".",
"LLVMGetRelocationTypeName",
"(",
"self",
")"
] | https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/bindings/python/llvm/object.py#L408-L413 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.