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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/imaplib.py | python | IMAP4.create | (self, mailbox) | return self._simple_command('CREATE', mailbox) | Create new mailbox.
(typ, [data]) = <instance>.create(mailbox) | Create new mailbox. | [
"Create",
"new",
"mailbox",
"."
] | def create(self, mailbox):
"""Create new mailbox.
(typ, [data]) = <instance>.create(mailbox)
"""
return self._simple_command('CREATE', mailbox) | [
"def",
"create",
"(",
"self",
",",
"mailbox",
")",
":",
"return",
"self",
".",
"_simple_command",
"(",
"'CREATE'",
",",
"mailbox",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/imaplib.py#L396-L401 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/bundy/component.py | python | Configurator.reconfigure | (self, configuration) | Changes configuration from the current one to the provided. It
starts and stops all the components as needed (eg. if there's
a component that was not in the original configuration, it is
started, any component that was in the old and is not in the
new one is stopped). | Changes configuration from the current one to the provided. It
starts and stops all the components as needed (eg. if there's
a component that was not in the original configuration, it is
started, any component that was in the old and is not in the
new one is stopped). | [
"Changes",
"configuration",
"from",
"the",
"current",
"one",
"to",
"the",
"provided",
".",
"It",
"starts",
"and",
"stops",
"all",
"the",
"components",
"as",
"needed",
"(",
"eg",
".",
"if",
"there",
"s",
"a",
"component",
"that",
"was",
"not",
"in",
"the"... | def reconfigure(self, configuration):
"""
Changes configuration from the current one to the provided. It
starts and stops all the components as needed (eg. if there's
a component that was not in the original configuration, it is
started, any component that was in the old and is n... | [
"def",
"reconfigure",
"(",
"self",
",",
"configuration",
")",
":",
"if",
"not",
"self",
".",
"_running",
":",
"raise",
"ValueError",
"(",
"\"Trying to reconfigure the component \"",
"+",
"\"configurator while it's not yet running\"",
")",
"logger",
".",
"info",
"(",
... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/bundy/component.py#L590-L602 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/exodus/ExodusSource.py | python | ExodusSource.__getRange | (self) | return utils.get_min_max(*pairs) | Private version of range for the update method. | Private version of range for the update method. | [
"Private",
"version",
"of",
"range",
"for",
"the",
"update",
"method",
"."
] | def __getRange(self):
"""
Private version of range for the update method.
"""
component = self.getOption('component')
pairs = []
for i in range(self.__vtkextractblock.GetOutput().GetNumberOfBlocks()):
current = self.__vtkextractblock.GetOutput().GetBlock(i)
... | [
"def",
"__getRange",
"(",
"self",
")",
":",
"component",
"=",
"self",
".",
"getOption",
"(",
"'component'",
")",
"pairs",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"__vtkextractblock",
".",
"GetOutput",
"(",
")",
".",
"GetNumberOfBlocks... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/exodus/ExodusSource.py#L130-L149 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/PfemFluidDynamicsApplication/python_scripts/pfem_check_and_prepare_fluid_model_process.py | python | Factory | (settings, Model) | return CheckAndPrepareModelProcess(Model, settings["Parameters"]) | This function creates the process | This function creates the process | [
"This",
"function",
"creates",
"the",
"process"
] | def Factory(settings, Model):
"""This function creates the process
"""
if type(settings) != KratosMultiphysics.Parameters:
raise Exception("Expected input shall be a Parameters object, encapsulating a json string")
return CheckAndPrepareModelProcess(Model, settings["Parameters"]) | [
"def",
"Factory",
"(",
"settings",
",",
"Model",
")",
":",
"if",
"type",
"(",
"settings",
")",
"!=",
"KratosMultiphysics",
".",
"Parameters",
":",
"raise",
"Exception",
"(",
"\"Expected input shall be a Parameters object, encapsulating a json string\"",
")",
"return",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/PfemFluidDynamicsApplication/python_scripts/pfem_check_and_prepare_fluid_model_process.py#L25-L30 | |
VowpalWabbit/vowpal_wabbit | 866b8fa88ff85a957c7eb72065ea44518b9ba416 | python/vowpalwabbit/sklearn.py | python | VW.__getstate__ | (self) | return state | Support pickling | Support pickling | [
"Support",
"pickling"
] | def __getstate__(self):
"""Support pickling"""
f = NamedTemporaryFile()
self.save(filename=f.name)
state = self.get_params()
with open(f.name, "rb") as tmp:
state["vw_"] = tmp.read()
f.close()
return state | [
"def",
"__getstate__",
"(",
"self",
")",
":",
"f",
"=",
"NamedTemporaryFile",
"(",
")",
"self",
".",
"save",
"(",
"filename",
"=",
"f",
".",
"name",
")",
"state",
"=",
"self",
".",
"get_params",
"(",
")",
"with",
"open",
"(",
"f",
".",
"name",
",",... | https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/sklearn.py#L500-L508 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/io.py | python | _get_output_from_program | (program,
program_holder,
dict_rename_var_old_new=None) | return outs | Get output name of 'program' according to program_holder | Get output name of 'program' according to program_holder | [
"Get",
"output",
"name",
"of",
"program",
"according",
"to",
"program_holder"
] | def _get_output_from_program(program,
program_holder,
dict_rename_var_old_new=None):
"""
Get output name of 'program' according to program_holder
"""
outs = list()
for var in program_holder.output_descs:
for idx in range(program.num_b... | [
"def",
"_get_output_from_program",
"(",
"program",
",",
"program_holder",
",",
"dict_rename_var_old_new",
"=",
"None",
")",
":",
"outs",
"=",
"list",
"(",
")",
"for",
"var",
"in",
"program_holder",
".",
"output_descs",
":",
"for",
"idx",
"in",
"range",
"(",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/io.py#L975-L992 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py | python | NDFrame._to_dict_of_blocks | (self, copy: bool_t = True) | return {
k: self._constructor(v).__finalize__(self)
for k, v, in self._data.to_dict(copy=copy).items()
} | Return a dict of dtype -> Constructor Types that
each is a homogeneous dtype.
Internal ONLY | Return a dict of dtype -> Constructor Types that
each is a homogeneous dtype. | [
"Return",
"a",
"dict",
"of",
"dtype",
"-",
">",
"Constructor",
"Types",
"that",
"each",
"is",
"a",
"homogeneous",
"dtype",
"."
] | def _to_dict_of_blocks(self, copy: bool_t = True):
"""
Return a dict of dtype -> Constructor Types that
each is a homogeneous dtype.
Internal ONLY
"""
return {
k: self._constructor(v).__finalize__(self)
for k, v, in self._data.to_dict(copy=copy).i... | [
"def",
"_to_dict_of_blocks",
"(",
"self",
",",
"copy",
":",
"bool_t",
"=",
"True",
")",
":",
"return",
"{",
"k",
":",
"self",
".",
"_constructor",
"(",
"v",
")",
".",
"__finalize__",
"(",
"self",
")",
"for",
"k",
",",
"v",
",",
"in",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L5551-L5561 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/perf/metrics/speedindex.py | python | PaintRectSpeedIndexImpl._TimeAreaDict | (self, paint_events, viewport) | return event_area_dict | Make a dict from time to adjusted area value for events at that time.
The adjusted area value of each paint event is determined by how many paint
events cover the same rectangle, and whether it's a full-window paint event.
"Adjusted area" can also be thought of as "points" of visual completeness --
eac... | Make a dict from time to adjusted area value for events at that time. | [
"Make",
"a",
"dict",
"from",
"time",
"to",
"adjusted",
"area",
"value",
"for",
"events",
"at",
"that",
"time",
"."
] | def _TimeAreaDict(self, paint_events, viewport):
"""Make a dict from time to adjusted area value for events at that time.
The adjusted area value of each paint event is determined by how many paint
events cover the same rectangle, and whether it's a full-window paint event.
"Adjusted area" can also be ... | [
"def",
"_TimeAreaDict",
"(",
"self",
",",
"paint_events",
",",
"viewport",
")",
":",
"width",
",",
"height",
"=",
"viewport",
"fullscreen_area",
"=",
"width",
"*",
"height",
"def",
"ClippedArea",
"(",
"rectangle",
")",
":",
"\"\"\"Returns rectangle area clipped to... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/metrics/speedindex.py#L251-L297 | |
lawy623/SVS | b7c7ae367c82a4797ff4a896a2ff304f02e7f724 | caffe/python/caffe/classifier.py | python | Classifier.predict | (self, inputs, oversample=True) | return predictions | Predict classification probabilities of inputs.
Parameters
----------
inputs : iterable of (H x W x K) input ndarrays.
oversample : boolean
average predictions across center, corners, and mirrors
when True (default). Center-only prediction when False.
Re... | Predict classification probabilities of inputs. | [
"Predict",
"classification",
"probabilities",
"of",
"inputs",
"."
] | def predict(self, inputs, oversample=True):
"""
Predict classification probabilities of inputs.
Parameters
----------
inputs : iterable of (H x W x K) input ndarrays.
oversample : boolean
average predictions across center, corners, and mirrors
whe... | [
"def",
"predict",
"(",
"self",
",",
"inputs",
",",
"oversample",
"=",
"True",
")",
":",
"# Scale to standardize input dimensions.",
"input_",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"inputs",
")",
",",
"self",
".",
"image_dims",
"[",
"0",
"]",
","... | https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/python/caffe/classifier.py#L47-L98 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | DLG_SZE | (win, size_width, height=None) | Convenience function for converting a Size or (w,h) in
dialog units to pixel units. | Convenience function for converting a Size or (w,h) in
dialog units to pixel units. | [
"Convenience",
"function",
"for",
"converting",
"a",
"Size",
"or",
"(",
"w",
"h",
")",
"in",
"dialog",
"units",
"to",
"pixel",
"units",
"."
] | def DLG_SZE(win, size_width, height=None):
"""
Convenience function for converting a Size or (w,h) in
dialog units to pixel units.
"""
if height is None:
return win.ConvertDialogSizeToPixels(size_width)
else:
return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | [
"def",
"DLG_SZE",
"(",
"win",
",",
"size_width",
",",
"height",
"=",
"None",
")",
":",
"if",
"height",
"is",
"None",
":",
"return",
"win",
".",
"ConvertDialogSizeToPixels",
"(",
"size_width",
")",
"else",
":",
"return",
"win",
".",
"ConvertDialogSizeToPixels... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L11791-L11799 | ||
Jittor/jittor | e9aca0444c2bdc8e2389d99122954cd0903eec46 | python/jittor/transform/__init__.py | python | RandomAffine.__call__ | (self, img:Image.Image) | return F_pil.affine(img, *ret, resample=self.resample, fillcolor=self.fillcolor) | img (PIL Image): Image to be transformed.
Returns:
PIL Image: Affine transformed image. | img (PIL Image): Image to be transformed. | [
"img",
"(",
"PIL",
"Image",
")",
":",
"Image",
"to",
"be",
"transformed",
"."
] | def __call__(self, img:Image.Image):
"""
img (PIL Image): Image to be transformed.
Returns:
PIL Image: Affine transformed image.
"""
if not isinstance(img, Image.Image):
img = to_pil_image(img)
ret = self.get_params(self.degrees, self.translat... | [
"def",
"__call__",
"(",
"self",
",",
"img",
":",
"Image",
".",
"Image",
")",
":",
"if",
"not",
"isinstance",
"(",
"img",
",",
"Image",
".",
"Image",
")",
":",
"img",
"=",
"to_pil_image",
"(",
"img",
")",
"ret",
"=",
"self",
".",
"get_params",
"(",
... | https://github.com/Jittor/jittor/blob/e9aca0444c2bdc8e2389d99122954cd0903eec46/python/jittor/transform/__init__.py#L1438-L1448 | |
include-what-you-use/include-what-you-use | 208fbfffa5d69364b9f78e427caa443441279283 | fix_includes.py | python | _MarkHeaderGuardIfPresent | (file_lines) | If any line in file_lines is a header-guard, mark it in file_lines.
We define a header-guard as follows: an #ifdef where there is
nothing contentful before or after the #ifdef. Also, the #ifdef
should have no #elif in it (though we don't currently test that).
This catches the common case of an 'ifdef guard' i... | If any line in file_lines is a header-guard, mark it in file_lines. | [
"If",
"any",
"line",
"in",
"file_lines",
"is",
"a",
"header",
"-",
"guard",
"mark",
"it",
"in",
"file_lines",
"."
] | def _MarkHeaderGuardIfPresent(file_lines):
"""If any line in file_lines is a header-guard, mark it in file_lines.
We define a header-guard as follows: an #ifdef where there is
nothing contentful before or after the #ifdef. Also, the #ifdef
should have no #elif in it (though we don't currently test that).
Th... | [
"def",
"_MarkHeaderGuardIfPresent",
"(",
"file_lines",
")",
":",
"# Pass over blank lines, pragmas and comments at the top of the file.",
"i",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"file_lines",
")",
")",
":",
"if",
"(",
"not",
"file_lines",
"[",
"... | https://github.com/include-what-you-use/include-what-you-use/blob/208fbfffa5d69364b9f78e427caa443441279283/fix_includes.py#L630-L691 | ||
telefonicaid/fiware-orion | 27c3202b9ddcfb9e3635a0af8d373f76e89b1d24 | scripts/check_files_compliance.py | python | supported_extension | (root, file) | return False | Check if the file is supported depending of the name, the extension of the name inside a path
:param root:
:param file:
:return: | Check if the file is supported depending of the name, the extension of the name inside a path
:param root:
:param file:
:return: | [
"Check",
"if",
"the",
"file",
"is",
"supported",
"depending",
"of",
"the",
"name",
"the",
"extension",
"of",
"the",
"name",
"inside",
"a",
"path",
":",
"param",
"root",
":",
":",
"param",
"file",
":",
":",
"return",
":"
] | def supported_extension(root, file):
"""
Check if the file is supported depending of the name, the extension of the name inside a path
:param root:
:param file:
:return:
"""
extensions = ['py', 'cpp', 'h', 'xml', 'json', 'test', 'vtest', 'txt', 'sh', 'spec', 'cfg', 'DISABLED', 'xtest',
... | [
"def",
"supported_extension",
"(",
"root",
",",
"file",
")",
":",
"extensions",
"=",
"[",
"'py'",
",",
"'cpp'",
",",
"'h'",
",",
"'xml'",
",",
"'json'",
",",
"'test'",
",",
"'vtest'",
",",
"'txt'",
",",
"'sh'",
",",
"'spec'",
",",
"'cfg'",
",",
"'DIS... | https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/check_files_compliance.py#L152-L177 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/misc/pilutil.py | python | imresize | (arr, size, interp='bilinear', mode=None) | return fromimage(imnew) | Resize an image.
Parameters
----------
arr : ndarray
The array of image to be resized.
size : int, float or tuple
* int - Percentage of current size.
* float - Fraction of current size.
* tuple - Size of the output image.
interp : str, optional
Interpolat... | Resize an image. | [
"Resize",
"an",
"image",
"."
] | def imresize(arr, size, interp='bilinear', mode=None):
"""
Resize an image.
Parameters
----------
arr : ndarray
The array of image to be resized.
size : int, float or tuple
* int - Percentage of current size.
* float - Fraction of current size.
* tuple - Size ... | [
"def",
"imresize",
"(",
"arr",
",",
"size",
",",
"interp",
"=",
"'bilinear'",
",",
"mode",
"=",
"None",
")",
":",
"im",
"=",
"toimage",
"(",
"arr",
",",
"mode",
"=",
"mode",
")",
"ts",
"=",
"type",
"(",
"size",
")",
"if",
"issubdtype",
"(",
"ts",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/misc/pilutil.py#L446-L489 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_3_0_0.py | python | MiroInterpreter.do_download | (self, line) | download <name> -- Downloads an item by name in the feed/playlist selected. | download <name> -- Downloads an item by name in the feed/playlist selected. | [
"download",
"<name",
">",
"--",
"Downloads",
"an",
"item",
"by",
"name",
"in",
"the",
"feed",
"/",
"playlist",
"selected",
"."
] | def do_download(self, line):
"""download <name> -- Downloads an item by name in the feed/playlist selected."""
if self.selection_type is None:
print "Error: No feed/playlist selected"
return
item = self._find_item(line)
if item is None:
print "No item ... | [
"def",
"do_download",
"(",
"self",
",",
"line",
")",
":",
"if",
"self",
".",
"selection_type",
"is",
"None",
":",
"print",
"\"Error: No feed/playlist selected\"",
"return",
"item",
"=",
"self",
".",
"_find_item",
"(",
"line",
")",
"if",
"item",
"is",
"None",... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_3_0_0.py#L618-L632 | ||
JumpingYang001/webrtc | c03d6e965e1f54aeadd670e491eabe5fdb8db968 | tools_webrtc/autoroller/roll_deps.py | python | ReadUrlContent | (url) | Connect to a remote host and read the contents. Returns a list of lines. | Connect to a remote host and read the contents. Returns a list of lines. | [
"Connect",
"to",
"a",
"remote",
"host",
"and",
"read",
"the",
"contents",
".",
"Returns",
"a",
"list",
"of",
"lines",
"."
] | def ReadUrlContent(url):
"""Connect to a remote host and read the contents. Returns a list of lines."""
conn = urllib2.urlopen(url)
try:
return conn.readlines()
except IOError as e:
logging.exception('Error connecting to %s. Error: %s', url, e)
raise
finally:
conn.clo... | [
"def",
"ReadUrlContent",
"(",
"url",
")",
":",
"conn",
"=",
"urllib2",
".",
"urlopen",
"(",
"url",
")",
"try",
":",
"return",
"conn",
".",
"readlines",
"(",
")",
"except",
"IOError",
"as",
"e",
":",
"logging",
".",
"exception",
"(",
"'Error connecting to... | https://github.com/JumpingYang001/webrtc/blob/c03d6e965e1f54aeadd670e491eabe5fdb8db968/tools_webrtc/autoroller/roll_deps.py#L211-L220 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/wheel.py | python | WheelBuilder._build_one | (self, req) | Build one wheel. | Build one wheel. | [
"Build",
"one",
"wheel",
"."
] | def _build_one(self, req):
"""Build one wheel."""
base_args = [
sys.executable, '-c',
"import setuptools;__file__=%r;"\
"exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))" % req.setup_py] + \
list(self.global_options)
... | [
"def",
"_build_one",
"(",
"self",
",",
"req",
")",
":",
"base_args",
"=",
"[",
"sys",
".",
"executable",
",",
"'-c'",
",",
"\"import setuptools;__file__=%r;\"",
"\"exec(compile(open(__file__).read().replace('\\\\r\\\\n', '\\\\n'), __file__, 'exec'))\"",
"%",
"req",
".",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/wheel.py#L286-L303 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | bindings/pydrake/systems/drawing.py | python | plot_graphviz | (dot_text) | return plt.imshow(plt.imread(f.name), aspect="equal") | Renders a DOT graph in matplotlib. | Renders a DOT graph in matplotlib. | [
"Renders",
"a",
"DOT",
"graph",
"in",
"matplotlib",
"."
] | def plot_graphviz(dot_text):
"""Renders a DOT graph in matplotlib."""
# @ref https://stackoverflow.com/a/18522941/7829525
# Tried (reason ignored): pydotplus (`pydot` works), networkx
# (`read_dot` does not work robustly?), pygraphviz (coupled with
# `networkx`).
g = pydot.graph_from_dot_data(do... | [
"def",
"plot_graphviz",
"(",
"dot_text",
")",
":",
"# @ref https://stackoverflow.com/a/18522941/7829525",
"# Tried (reason ignored): pydotplus (`pydot` works), networkx",
"# (`read_dot` does not work robustly?), pygraphviz (coupled with",
"# `networkx`).",
"g",
"=",
"pydot",
".",
"graph_... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/systems/drawing.py#L16-L33 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/parse.py | python | Parser.__init__ | (self, grammar, convert=None) | Constructor.
The grammar argument is a grammar.Grammar instance; see the
grammar module for more information.
The parser is not ready yet for parsing; you must call the
setup() method to get it started.
The optional convert argument is a function mapping concrete
synta... | Constructor. | [
"Constructor",
"."
] | def __init__(self, grammar, convert=None):
"""Constructor.
The grammar argument is a grammar.Grammar instance; see the
grammar module for more information.
The parser is not ready yet for parsing; you must call the
setup() method to get it started.
The optional convert... | [
"def",
"__init__",
"(",
"self",
",",
"grammar",
",",
"convert",
"=",
"None",
")",
":",
"self",
".",
"grammar",
"=",
"grammar",
"self",
".",
"convert",
"=",
"convert",
"or",
"(",
"lambda",
"grammar",
",",
"node",
":",
"node",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/parse.py#L57-L87 | ||
nodejs/nan | 8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62 | cpplint.py | python | RemoveMultiLineCommentsFromRange | (lines, begin, end) | Clears a range of lines for multi-line comments. | Clears a range of lines for multi-line comments. | [
"Clears",
"a",
"range",
"of",
"lines",
"for",
"multi",
"-",
"line",
"comments",
"."
] | def RemoveMultiLineCommentsFromRange(lines, begin, end):
"""Clears a range of lines for multi-line comments."""
# Having // dummy comments makes the lines non-empty, so we will not get
# unnecessary blank line warnings later in the code.
for i in range(begin, end):
lines[i] = '/**/' | [
"def",
"RemoveMultiLineCommentsFromRange",
"(",
"lines",
",",
"begin",
",",
"end",
")",
":",
"# Having // dummy comments makes the lines non-empty, so we will not get",
"# unnecessary blank line warnings later in the code.",
"for",
"i",
"in",
"range",
"(",
"begin",
",",
"end",
... | https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L1609-L1614 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/youtube/service.py | python | YouTubeService.AddVideoEntryToFavorites | (self, video_entry, username='default') | return self.Post(video_entry, post_uri,
converter=gdata.youtube.YouTubeVideoEntryFromString) | Add a video entry to a users favorite feed.
Needs authentication.
Args:
video_entry: The YouTubeVideoEntry to add.
username: An optional string representing the username to whose favorite
feed you wish to add the entry. Defaults to the currently
authenticated user.
Returns:... | Add a video entry to a users favorite feed. | [
"Add",
"a",
"video",
"entry",
"to",
"a",
"users",
"favorite",
"feed",
"."
] | def AddVideoEntryToFavorites(self, video_entry, username='default'):
"""Add a video entry to a users favorite feed.
Needs authentication.
Args:
video_entry: The YouTubeVideoEntry to add.
username: An optional string representing the username to whose favorite
feed you wish to add the... | [
"def",
"AddVideoEntryToFavorites",
"(",
"self",
",",
"video_entry",
",",
"username",
"=",
"'default'",
")",
":",
"post_uri",
"=",
"'%s/%s/%s'",
"%",
"(",
"YOUTUBE_USER_FEED_URI",
",",
"username",
",",
"'favorites'",
")",
"return",
"self",
".",
"Post",
"(",
"vi... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/youtube/service.py#L874-L890 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTime.GetCountry | (*args, **kwargs) | return _misc_.DateTime_GetCountry(*args, **kwargs) | GetCountry() -> int | GetCountry() -> int | [
"GetCountry",
"()",
"-",
">",
"int"
] | def GetCountry(*args, **kwargs):
"""GetCountry() -> int"""
return _misc_.DateTime_GetCountry(*args, **kwargs) | [
"def",
"GetCountry",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_GetCountry",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3677-L3679 | |
flexflow/FlexFlow | 581fad8ba8d10a16a3102ee2b406b0319586df24 | python/flexflow/keras/utils/generic_utils.py | python | custom_object_scope | (*args) | return CustomObjectScope(*args) | Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape.
Convenience wrapper for `CustomObjectScope`.
Code within a `with` statement will be able to access custom objects
by name. Changes to global custom objects persist
within the enclosing `with` statement. At end of the `with` statem... | Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape. | [
"Provides",
"a",
"scope",
"that",
"changes",
"to",
"_GLOBAL_CUSTOM_OBJECTS",
"cannot",
"escape",
"."
] | def custom_object_scope(*args):
"""Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape.
Convenience wrapper for `CustomObjectScope`.
Code within a `with` statement will be able to access custom objects
by name. Changes to global custom objects persist
within the enclosing `with`... | [
"def",
"custom_object_scope",
"(",
"*",
"args",
")",
":",
"return",
"CustomObjectScope",
"(",
"*",
"args",
")"
] | https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/python/flexflow/keras/utils/generic_utils.py#L56-L83 | |
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/rj_gameplay/tactic/clear_tactic.py | python | Clear.tick | (
self,
world_state: rc.WorldState,
role_results: tactic.RoleResults,
) | return [] | :return: A list of size 1 or 2 skills depending on which roles are filled and state of aiming
TODO: Come up with better timings for starting receive | :return: A list of size 1 or 2 skills depending on which roles are filled and state of aiming
TODO: Come up with better timings for starting receive | [
":",
"return",
":",
"A",
"list",
"of",
"size",
"1",
"or",
"2",
"skills",
"depending",
"on",
"which",
"roles",
"are",
"filled",
"and",
"state",
"of",
"aiming",
"TODO",
":",
"Come",
"up",
"with",
"better",
"timings",
"for",
"starting",
"receive"
] | def tick(
self,
world_state: rc.WorldState,
role_results: tactic.RoleResults,
) -> List[tactic.SkillEntry]:
"""
:return: A list of size 1 or 2 skills depending on which roles are filled and state of aiming
TODO: Come up with better timings for starting receive
... | [
"def",
"tick",
"(",
"self",
",",
"world_state",
":",
"rc",
".",
"WorldState",
",",
"role_results",
":",
"tactic",
".",
"RoleResults",
",",
")",
"->",
"List",
"[",
"tactic",
".",
"SkillEntry",
"]",
":",
"clearer_result",
"=",
"role_results",
"[",
"self",
... | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/rj_gameplay/tactic/clear_tactic.py#L85-L97 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiManager.HitTest | (self, x, y) | return result | This is an internal function which determines
which UI item the specified coordinates are over.
:param integer `x`: specifies a x position in client coordinates;
:param integer `y`: specifies a y position in client coordinates. | This is an internal function which determines
which UI item the specified coordinates are over. | [
"This",
"is",
"an",
"internal",
"function",
"which",
"determines",
"which",
"UI",
"item",
"the",
"specified",
"coordinates",
"are",
"over",
"."
] | def HitTest(self, x, y):
"""
This is an internal function which determines
which UI item the specified coordinates are over.
:param integer `x`: specifies a x position in client coordinates;
:param integer `y`: specifies a y position in client coordinates.
"""
r... | [
"def",
"HitTest",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"result",
"=",
"None",
"for",
"item",
"in",
"self",
".",
"_uiparts",
":",
"# we are not interested in typeDock, because this space",
"# isn't used to draw anything, just for measurements",
"# besides, the entire... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L4341-L4370 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py | python | Pdb.displayhook | (self, obj) | Custom displayhook for the exec in default(), which prevents
assignment of the _ variable in the builtins. | Custom displayhook for the exec in default(), which prevents
assignment of the _ variable in the builtins. | [
"Custom",
"displayhook",
"for",
"the",
"exec",
"in",
"default",
"()",
"which",
"prevents",
"assignment",
"of",
"the",
"_",
"variable",
"in",
"the",
"builtins",
"."
] | def displayhook(self, obj):
"""Custom displayhook for the exec in default(), which prevents
assignment of the _ variable in the builtins.
"""
# reproduce the behavior of the standard displayhook, not printing None
if obj is not None:
self.message(repr(obj)) | [
"def",
"displayhook",
"(",
"self",
",",
"obj",
")",
":",
"# reproduce the behavior of the standard displayhook, not printing None",
"if",
"obj",
"is",
"not",
"None",
":",
"self",
".",
"message",
"(",
"repr",
"(",
"obj",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py#L353-L359 | ||
RapidsAtHKUST/CommunityDetectionCodes | 23dbafd2e57ab0f5f0528b1322c4a409f21e5892 | Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py | python | loadNet_edg | (input, mutualEdges=False, splitterChar=None, symmetricNet=True) | return newNet | Reads a network data from input in edg format.
If mutualEdges is set to True, an edge is added between nodes i
and j only if both edges (i,j) and (j,i) are listed. The weight of
the edge is the average of the weights of the original edges. | Reads a network data from input in edg format. | [
"Reads",
"a",
"network",
"data",
"from",
"input",
"in",
"edg",
"format",
"."
] | def loadNet_edg(input, mutualEdges=False, splitterChar=None, symmetricNet=True):
"""
Reads a network data from input in edg format.
If mutualEdges is set to True, an edge is added between nodes i
and j only if both edges (i,j) and (j,i) are listed. The weight of
the edge is the average of the weigh... | [
"def",
"loadNet_edg",
"(",
"input",
",",
"mutualEdges",
"=",
"False",
",",
"splitterChar",
"=",
"None",
",",
"symmetricNet",
"=",
"True",
")",
":",
"def",
"isNumerical",
"(",
"input",
")",
":",
"try",
":",
"for",
"line",
"in",
"input",
":",
"int",
"(",... | https://github.com/RapidsAtHKUST/CommunityDetectionCodes/blob/23dbafd2e57ab0f5f0528b1322c4a409f21e5892/Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py#L197-L242 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/model.py | python | SequentialTimeSeriesModel._prediction_step | (self, current_times, state) | Compute a batch of single-step predictions.
Args:
current_times: A [batch size] Tensor of times for each observation.
state: Model state, imputed to one step before current_times.
Returns:
A tuple of (updated state, outputs):
updated state: Model state updated to current_times.
... | Compute a batch of single-step predictions. | [
"Compute",
"a",
"batch",
"of",
"single",
"-",
"step",
"predictions",
"."
] | def _prediction_step(self, current_times, state):
"""Compute a batch of single-step predictions.
Args:
current_times: A [batch size] Tensor of times for each observation.
state: Model state, imputed to one step before current_times.
Returns:
A tuple of (updated state, outputs):
up... | [
"def",
"_prediction_step",
"(",
"self",
",",
"current_times",
",",
"state",
")",
":",
"pass"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/model.py#L428-L440 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/manifests.py | python | InstallManifest.add_preprocess | (self, source, dest, deps, marker='#', defines={}) | Add a preprocessed file to this manifest.
``source`` will be passed through preprocessor.py, and the output will be
written to ``dest``. | Add a preprocessed file to this manifest. | [
"Add",
"a",
"preprocessed",
"file",
"to",
"this",
"manifest",
"."
] | def add_preprocess(self, source, dest, deps, marker='#', defines={}):
"""Add a preprocessed file to this manifest.
``source`` will be passed through preprocessor.py, and the output will be
written to ``dest``.
"""
self._add_entry(dest,
(self.PREPROCESS, source, deps,... | [
"def",
"add_preprocess",
"(",
"self",
",",
"source",
",",
"dest",
",",
"deps",
",",
"marker",
"=",
"'#'",
",",
"defines",
"=",
"{",
"}",
")",
":",
"self",
".",
"_add_entry",
"(",
"dest",
",",
"(",
"self",
".",
"PREPROCESS",
",",
"source",
",",
"dep... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/manifests.py#L284-L291 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | ProcessFileData | (filename, file_extension, lines, error,
extra_check_functions=[]) | Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array of strings, each representing a line of the file, with the
last element being emp... | Performs lint checks and reports any errors to the given error function. | [
"Performs",
"lint",
"checks",
"and",
"reports",
"any",
"errors",
"to",
"the",
"given",
"error",
"function",
"."
] | def ProcessFileData(filename, file_extension, lines, error,
extra_check_functions=[]):
"""Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
... | [
"def",
"ProcessFileData",
"(",
"filename",
",",
"file_extension",
",",
"lines",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"lines",
"=",
"(",
"[",
"'// marker so line numbers and indices both start at 1'",
"]",
"+",
"lines",
"+",
"[",
"... | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L6004-L6053 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimum-number-of-refueling-stops.py | python | Solution.minRefuelStops | (self, target, startFuel, stations) | return result | :type target: int
:type startFuel: int
:type stations: List[List[int]]
:rtype: int | :type target: int
:type startFuel: int
:type stations: List[List[int]]
:rtype: int | [
":",
"type",
"target",
":",
"int",
":",
"type",
"startFuel",
":",
"int",
":",
"type",
"stations",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def minRefuelStops(self, target, startFuel, stations):
"""
:type target: int
:type startFuel: int
:type stations: List[List[int]]
:rtype: int
"""
max_heap = []
stations.append((target, float("inf")))
result = prev = 0
for location, capacit... | [
"def",
"minRefuelStops",
"(",
"self",
",",
"target",
",",
"startFuel",
",",
"stations",
")",
":",
"max_heap",
"=",
"[",
"]",
"stations",
".",
"append",
"(",
"(",
"target",
",",
"float",
"(",
"\"inf\"",
")",
")",
")",
"result",
"=",
"prev",
"=",
"0",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-number-of-refueling-stops.py#L8-L29 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Rect.SetHeight | (*args, **kwargs) | return _core_.Rect_SetHeight(*args, **kwargs) | SetHeight(self, int h) | SetHeight(self, int h) | [
"SetHeight",
"(",
"self",
"int",
"h",
")"
] | def SetHeight(*args, **kwargs):
"""SetHeight(self, int h)"""
return _core_.Rect_SetHeight(*args, **kwargs) | [
"def",
"SetHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_SetHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1297-L1299 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinema/paraview/tpl/cinema_python/database/oexr_helper.py | python | save_rgb | (image, filePath, comp=OexrCompression.ZIP) | Saves the rgb (image) in OpenEXR format. Expects a 3-chan uint32 image. | Saves the rgb (image) in OpenEXR format. Expects a 3-chan uint32 image. | [
"Saves",
"the",
"rgb",
"(",
"image",
")",
"in",
"OpenEXR",
"format",
".",
"Expects",
"a",
"3",
"-",
"chan",
"uint32",
"image",
"."
] | def save_rgb(image, filePath, comp=OexrCompression.ZIP):
'''
Saves the rgb (image) in OpenEXR format. Expects a 3-chan uint32 image.
'''
if len(image.shape) != 3:
raise Exception("Incorrect dimensions!")
h, w, c = image.shape
if c != 3:
raise Exception("Incorrect number of cha... | [
"def",
"save_rgb",
"(",
"image",
",",
"filePath",
",",
"comp",
"=",
"OexrCompression",
".",
"ZIP",
")",
":",
"if",
"len",
"(",
"image",
".",
"shape",
")",
"!=",
"3",
":",
"raise",
"Exception",
"(",
"\"Incorrect dimensions!\"",
")",
"h",
",",
"w",
",",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/oexr_helper.py#L19-L52 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py | python | get_default_sdk | () | return InstalledSDKList[0] | Set up the default Platform/Windows SDK. | Set up the default Platform/Windows SDK. | [
"Set",
"up",
"the",
"default",
"Platform",
"/",
"Windows",
"SDK",
"."
] | def get_default_sdk():
"""Set up the default Platform/Windows SDK."""
get_installed_sdks()
if not InstalledSDKList:
return None
return InstalledSDKList[0] | [
"def",
"get_default_sdk",
"(",
")",
":",
"get_installed_sdks",
"(",
")",
"if",
"not",
"InstalledSDKList",
":",
"return",
"None",
"return",
"InstalledSDKList",
"[",
"0",
"]"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py#L316-L321 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/distributions/beta.py | python | Beta.__init__ | (self,
concentration1=None,
concentration0=None,
validate_args=False,
allow_nan_stats=True,
name="Beta") | Initialize a batch of Beta distributions.
Args:
concentration1: Positive floating-point `Tensor` indicating mean
number of successes; aka "alpha". Implies `self.dtype` and
`self.batch_shape`, i.e.,
`concentration1.shape = [N1, N2, ..., Nm] = self.batch_shape`.
concentration0: Po... | Initialize a batch of Beta distributions. | [
"Initialize",
"a",
"batch",
"of",
"Beta",
"distributions",
"."
] | def __init__(self,
concentration1=None,
concentration0=None,
validate_args=False,
allow_nan_stats=True,
name="Beta"):
"""Initialize a batch of Beta distributions.
Args:
concentration1: Positive floating-point `Tensor` indicating m... | [
"def",
"__init__",
"(",
"self",
",",
"concentration1",
"=",
"None",
",",
"concentration0",
"=",
"None",
",",
"validate_args",
"=",
"False",
",",
"allow_nan_stats",
"=",
"True",
",",
"name",
"=",
"\"Beta\"",
")",
":",
"parameters",
"=",
"locals",
"(",
")",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/distributions/beta.py#L125-L171 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/sysconfig.py | python | get_makefile_filename | () | return os.path.join(lib_dir, "config", "Makefile") | Return full pathname of installed Makefile from the Python build. | Return full pathname of installed Makefile from the Python build. | [
"Return",
"full",
"pathname",
"of",
"installed",
"Makefile",
"from",
"the",
"Python",
"build",
"."
] | def get_makefile_filename():
"""Return full pathname of installed Makefile from the Python build."""
if python_build:
return os.path.join(project_base, "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
return os.path.join(lib_dir, "config", "Makefile") | [
"def",
"get_makefile_filename",
"(",
")",
":",
"if",
"python_build",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"project_base",
",",
"\"Makefile\"",
")",
"lib_dir",
"=",
"get_python_lib",
"(",
"plat_specific",
"=",
"1",
",",
"standard_lib",
"=",
"1"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/sysconfig.py#L248-L253 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/share/gdb/system-gdbinit/elinos.py | python | get_elinos_environment | () | return result | Return the ELinOS environment.
If the ELinOS environment is properly set up, return a dictionary
which contains:
* The path to the ELinOS project at key 'project';
* The path to the ELinOS CDK at key 'cdk';
* The ELinOS target name at key 'target' (Eg. 'i486-linux');
* A list of Xenomai... | Return the ELinOS environment. | [
"Return",
"the",
"ELinOS",
"environment",
"."
] | def get_elinos_environment():
"""Return the ELinOS environment.
If the ELinOS environment is properly set up, return a dictionary
which contains:
* The path to the ELinOS project at key 'project';
* The path to the ELinOS CDK at key 'cdk';
* The ELinOS target name at key 'target' (Eg. 'i4... | [
"def",
"get_elinos_environment",
"(",
")",
":",
"result",
"=",
"{",
"}",
"for",
"key",
"in",
"(",
"\"project\"",
",",
"\"cdk\"",
",",
"\"target\"",
")",
":",
"var",
"=",
"\"ELINOS_\"",
"+",
"key",
".",
"upper",
"(",
")",
"if",
"var",
"in",
"os",
".",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/share/gdb/system-gdbinit/elinos.py#L27-L55 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | python | _parseForGCC | (lines, efifilepath) | return pcds | Parse map file generated by GCC linker | Parse map file generated by GCC linker | [
"Parse",
"map",
"file",
"generated",
"by",
"GCC",
"linker"
] | def _parseForGCC(lines, efifilepath):
""" Parse map file generated by GCC linker """
status = 0
imageBase = -1
sections = []
bpcds = []
for line in lines:
line = line.strip()
# status machine transection
if status == 0 and line == "Memory Configuration":
statu... | [
"def",
"_parseForGCC",
"(",
"lines",
",",
"efifilepath",
")",
":",
"status",
"=",
"0",
"imageBase",
"=",
"-",
"1",
"sections",
"=",
"[",
"]",
"bpcds",
"=",
"[",
"]",
"for",
"line",
"in",
"lines",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py#L63-L108 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/metrics.py | python | BuiltinMetric.set_hints | (self, **hints) | Sets hints for the metric. Hints are not validated.
Implemented in child classes.
Returns
----------
self: for chained calls. | Sets hints for the metric. Hints are not validated.
Implemented in child classes. | [
"Sets",
"hints",
"for",
"the",
"metric",
".",
"Hints",
"are",
"not",
"validated",
".",
"Implemented",
"in",
"child",
"classes",
"."
] | def set_hints(self, **hints):
"""
Sets hints for the metric. Hints are not validated.
Implemented in child classes.
Returns
----------
self: for chained calls.
"""
raise NotImplementedError('Should be overridden by the child class.') | [
"def",
"set_hints",
"(",
"self",
",",
"*",
"*",
"hints",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Should be overridden by the child class.'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/metrics.py#L45-L54 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/blocks.py | python | EABackedBlock.delete | (self, loc) | Delete given loc(-s) from block in-place. | Delete given loc(-s) from block in-place. | [
"Delete",
"given",
"loc",
"(",
"-",
"s",
")",
"from",
"block",
"in",
"-",
"place",
"."
] | def delete(self, loc) -> None:
"""
Delete given loc(-s) from block in-place.
"""
# This will be unnecessary if/when __array_function__ is implemented
self.values = self.values.delete(loc)
self.mgr_locs = self._mgr_locs.delete(loc)
try:
self._cache.clea... | [
"def",
"delete",
"(",
"self",
",",
"loc",
")",
"->",
"None",
":",
"# This will be unnecessary if/when __array_function__ is implemented",
"self",
".",
"values",
"=",
"self",
".",
"values",
".",
"delete",
"(",
"loc",
")",
"self",
".",
"mgr_locs",
"=",
"self",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L1334-L1345 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Event.GetSkipped | (*args, **kwargs) | return _core_.Event_GetSkipped(*args, **kwargs) | GetSkipped(self) -> bool
Returns true if the event handler should be skipped, false otherwise.
:see: `Skip` | GetSkipped(self) -> bool | [
"GetSkipped",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetSkipped(*args, **kwargs):
"""
GetSkipped(self) -> bool
Returns true if the event handler should be skipped, false otherwise.
:see: `Skip`
"""
return _core_.Event_GetSkipped(*args, **kwargs) | [
"def",
"GetSkipped",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Event_GetSkipped",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L5061-L5068 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | Cursor.kind | (self) | return CursorKind.from_id(self._kind_id) | Return the kind of this cursor. | Return the kind of this cursor. | [
"Return",
"the",
"kind",
"of",
"this",
"cursor",
"."
] | def kind(self):
"""Return the kind of this cursor."""
return CursorKind.from_id(self._kind_id) | [
"def",
"kind",
"(",
"self",
")",
":",
"return",
"CursorKind",
".",
"from_id",
"(",
"self",
".",
"_kind_id",
")"
] | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L1521-L1523 | |
MrMC/mrmc | 5a8e460b2aec44f03eb9604cbd7681d4277dbb81 | tools/Fake Episode Maker/openAnything.py | python | openAnything | (source, etag=None, lastmodified=None, agent=USER_AGENT) | return StringIO(str(source)) | URL, filename, or string --> stream
This function lets you define parsers that take any input source
(URL, pathname to local or network file, or actual data as a string)
and deal with it in a uniform manner. Returned object is guaranteed
to have all the basic stdio read methods (read, readline, readli... | URL, filename, or string --> stream | [
"URL",
"filename",
"or",
"string",
"--",
">",
"stream"
] | def openAnything(source, etag=None, lastmodified=None, agent=USER_AGENT):
'''URL, filename, or string --> stream
This function lets you define parsers that take any input source
(URL, pathname to local or network file, or actual data as a string)
and deal with it in a uniform manner. Returned object i... | [
"def",
"openAnything",
"(",
"source",
",",
"etag",
"=",
"None",
",",
"lastmodified",
"=",
"None",
",",
"agent",
"=",
"USER_AGENT",
")",
":",
"if",
"hasattr",
"(",
"source",
",",
"'read'",
")",
":",
"return",
"source",
"if",
"source",
"==",
"'-'",
":",
... | https://github.com/MrMC/mrmc/blob/5a8e460b2aec44f03eb9604cbd7681d4277dbb81/tools/Fake Episode Maker/openAnything.py#L46-L92 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/nndct_shared/nndct_graph/base_graph.py | python | GraphBase.nodes | (self) | Yield node in graph according to topo order
Returns:
generator: yiled a node when tranverse graph | Yield node in graph according to topo order | [
"Yield",
"node",
"in",
"graph",
"according",
"to",
"topo",
"order"
] | def nodes(self):
"""Yield node in graph according to topo order
Returns:
generator: yiled a node when tranverse graph
""" | [
"def",
"nodes",
"(",
"self",
")",
":"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/nndct_shared/nndct_graph/base_graph.py#L43-L48 | ||
microsoft/CCF | 14801dc01f3f225fc85772eeb1c066d1b1b10a47 | python/ccf/ledger.py | python | LedgerValidator.add_transaction | (self, transaction) | To validate the ledger, ledger transactions need to be added via this method.
Depending on the tables that were part of the transaction, it does different things.
When transaction contains signature table, it starts the verification process and verifies that the root of merkle tree was signed by a node ... | To validate the ledger, ledger transactions need to be added via this method.
Depending on the tables that were part of the transaction, it does different things.
When transaction contains signature table, it starts the verification process and verifies that the root of merkle tree was signed by a node ... | [
"To",
"validate",
"the",
"ledger",
"ledger",
"transactions",
"need",
"to",
"be",
"added",
"via",
"this",
"method",
".",
"Depending",
"on",
"the",
"tables",
"that",
"were",
"part",
"of",
"the",
"transaction",
"it",
"does",
"different",
"things",
".",
"When",
... | def add_transaction(self, transaction):
"""
To validate the ledger, ledger transactions need to be added via this method.
Depending on the tables that were part of the transaction, it does different things.
When transaction contains signature table, it starts the verification process and... | [
"def",
"add_transaction",
"(",
"self",
",",
"transaction",
")",
":",
"transaction_public_domain",
"=",
"transaction",
".",
"get_public_domain",
"(",
")",
"tables",
"=",
"transaction_public_domain",
".",
"get_tables",
"(",
")",
"# Add contributing nodes certs and update no... | https://github.com/microsoft/CCF/blob/14801dc01f3f225fc85772eeb1c066d1b1b10a47/python/ccf/ledger.py#L356-L444 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/ipaddress.py | python | IPv4Address.packed | (self) | return v4_int_to_packed(self._ip) | The binary representation of this address. | The binary representation of this address. | [
"The",
"binary",
"representation",
"of",
"this",
"address",
"."
] | def packed(self):
"""The binary representation of this address."""
return v4_int_to_packed(self._ip) | [
"def",
"packed",
"(",
"self",
")",
":",
"return",
"v4_int_to_packed",
"(",
"self",
".",
"_ip",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ipaddress.py#L1310-L1312 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/zip_utils.py | python | unzip | (zip_file, target_dir) | Unzip the given zip file into the target dir. | Unzip the given zip file into the target dir. | [
"Unzip",
"the",
"given",
"zip",
"file",
"into",
"the",
"target",
"dir",
"."
] | def unzip(zip_file, target_dir):
"""Unzip the given zip file into the target dir."""
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
with zipfile.ZipFile(zip_file, 'r', zipfile.ZIP_DEFLATED, True) as z:
for zi in z.infolist():
dst_subpath = zi.filename
if os.name == 'nt':
# D... | [
"def",
"unzip",
"(",
"zip_file",
",",
"target_dir",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"target_dir",
")",
":",
"os",
".",
"makedirs",
"(",
"target_dir",
")",
"with",
"zipfile",
".",
"ZipFile",
"(",
"zip_file",
",",
"'r'",
",... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/zip_utils.py#L61-L78 | ||
wesnoth/wesnoth | 6ccac5a5e8ff75303c9190c0da60580925cb32c0 | data/tools/wesnoth/wmltools3.py | python | is_namespace | (name) | return name in map(os.path.basename, scopelist()) | Is the name either a valid campaign name or core? | Is the name either a valid campaign name or core? | [
"Is",
"the",
"name",
"either",
"a",
"valid",
"campaign",
"name",
"or",
"core?"
] | def is_namespace(name):
"Is the name either a valid campaign name or core?"
return name in map(os.path.basename, scopelist()) | [
"def",
"is_namespace",
"(",
"name",
")",
":",
"return",
"name",
"in",
"map",
"(",
"os",
".",
"path",
".",
"basename",
",",
"scopelist",
"(",
")",
")"
] | https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmltools3.py#L1075-L1077 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/estimator/export/export.py | python | build_parsing_serving_input_receiver_fn | (feature_spec,
default_batch_size=None) | return serving_input_receiver_fn | Build a serving_input_receiver_fn expecting fed tf.Examples.
Creates a serving_input_receiver_fn that expects a serialized tf.Example fed
into a string placeholder. The function parses the tf.Example according to
the provided feature_spec, and returns all parsed Tensors as features.
Args:
feature_spec: a... | Build a serving_input_receiver_fn expecting fed tf.Examples. | [
"Build",
"a",
"serving_input_receiver_fn",
"expecting",
"fed",
"tf",
".",
"Examples",
"."
] | def build_parsing_serving_input_receiver_fn(feature_spec,
default_batch_size=None):
"""Build a serving_input_receiver_fn expecting fed tf.Examples.
Creates a serving_input_receiver_fn that expects a serialized tf.Example fed
into a string placeholder. The function par... | [
"def",
"build_parsing_serving_input_receiver_fn",
"(",
"feature_spec",
",",
"default_batch_size",
"=",
"None",
")",
":",
"def",
"serving_input_receiver_fn",
"(",
")",
":",
"\"\"\"An input_fn that expects a serialized tf.Example.\"\"\"",
"serialized_tf_example",
"=",
"array_ops",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/estimator/export/export.py#L121-L146 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | Message._become_message | (self, message) | Assume the non-format-specific state of message. | Assume the non-format-specific state of message. | [
"Assume",
"the",
"non",
"-",
"format",
"-",
"specific",
"state",
"of",
"message",
"."
] | def _become_message(self, message):
"""Assume the non-format-specific state of message."""
for name in ('_headers', '_unixfrom', '_payload', '_charset',
'preamble', 'epilogue', 'defects', '_default_type'):
self.__dict__[name] = message.__dict__[name] | [
"def",
"_become_message",
"(",
"self",
",",
"message",
")",
":",
"for",
"name",
"in",
"(",
"'_headers'",
",",
"'_unixfrom'",
",",
"'_payload'",
",",
"'_charset'",
",",
"'preamble'",
",",
"'epilogue'",
",",
"'defects'",
",",
"'_default_type'",
")",
":",
"self... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1457-L1461 | ||
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/runtime/python_resource.py | python | Resource.files_list | (self) | return self.__files[:] | Returns a list containing all files added.
Returns:
list: added files | Returns a list containing all files added. | [
"Returns",
"a",
"list",
"containing",
"all",
"files",
"added",
"."
] | def files_list(self):
"""
Returns a list containing all files added.
Returns:
list: added files
"""
return self.__files[:] | [
"def",
"files_list",
"(",
"self",
")",
":",
"return",
"self",
".",
"__files",
"[",
":",
"]"
] | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/runtime/python_resource.py#L172-L179 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/system_info.py | python | system_info.combine_paths | (self, *args) | return combine_paths(*args, **{'verbosity': self.verbosity}) | Return a list of existing paths composed by all combinations
of items from the arguments. | Return a list of existing paths composed by all combinations
of items from the arguments. | [
"Return",
"a",
"list",
"of",
"existing",
"paths",
"composed",
"by",
"all",
"combinations",
"of",
"items",
"from",
"the",
"arguments",
"."
] | def combine_paths(self, *args):
"""Return a list of existing paths composed by all combinations
of items from the arguments.
"""
return combine_paths(*args, **{'verbosity': self.verbosity}) | [
"def",
"combine_paths",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"combine_paths",
"(",
"*",
"args",
",",
"*",
"*",
"{",
"'verbosity'",
":",
"self",
".",
"verbosity",
"}",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/system_info.py#L724-L728 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/writer.py | python | IndentedTextWriter.write_unindented_line | (self, msg) | Write an unindented line to the stream, no template formattin applied. | Write an unindented line to the stream, no template formattin applied. | [
"Write",
"an",
"unindented",
"line",
"to",
"the",
"stream",
"no",
"template",
"formattin",
"applied",
"."
] | def write_unindented_line(self, msg):
# type: (str) -> None
"""Write an unindented line to the stream, no template formattin applied."""
self._stream.write(msg)
self._stream.write("\n") | [
"def",
"write_unindented_line",
"(",
"self",
",",
"msg",
")",
":",
"# type: (str) -> None",
"self",
".",
"_stream",
".",
"write",
"(",
"msg",
")",
"self",
".",
"_stream",
".",
"write",
"(",
"\"\\n\"",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/writer.py#L111-L115 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir._prune_non_control_edges_of_debug_ops | (self, device_name) | Prune (non-control) edges related to debug ops.
Prune the Copy ops and associated _Send ops inserted by the debugger out
from the non-control inputs and output recipients map. Replace the inputs
and recipients with original ones.
Args:
device_name: (`str`) device name. | Prune (non-control) edges related to debug ops. | [
"Prune",
"(",
"non",
"-",
"control",
")",
"edges",
"related",
"to",
"debug",
"ops",
"."
] | def _prune_non_control_edges_of_debug_ops(self, device_name):
"""Prune (non-control) edges related to debug ops.
Prune the Copy ops and associated _Send ops inserted by the debugger out
from the non-control inputs and output recipients map. Replace the inputs
and recipients with original ones.
Arg... | [
"def",
"_prune_non_control_edges_of_debug_ops",
"(",
"self",
",",
"device_name",
")",
":",
"copy_nodes",
"=",
"[",
"]",
"for",
"node",
"in",
"self",
".",
"_node_inputs",
"[",
"device_name",
"]",
":",
"if",
"node",
"in",
"self",
".",
"_copy_send_nodes",
"[",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/lib/debug_data.py#L1106-L1137 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/fourcircle_utility.py | python | get_merge_pt_info_ws_name | (exp_no, scan_no) | return ws_name | Create the standard table workspace's name to contain the information to merge Pts. in a scan
:param exp_no:
:param scan_no:
:return: | Create the standard table workspace's name to contain the information to merge Pts. in a scan
:param exp_no:
:param scan_no:
:return: | [
"Create",
"the",
"standard",
"table",
"workspace",
"s",
"name",
"to",
"contain",
"the",
"information",
"to",
"merge",
"Pts",
".",
"in",
"a",
"scan",
":",
"param",
"exp_no",
":",
":",
"param",
"scan_no",
":",
":",
"return",
":"
] | def get_merge_pt_info_ws_name(exp_no, scan_no):
""" Create the standard table workspace's name to contain the information to merge Pts. in a scan
:param exp_no:
:param scan_no:
:return:
"""
ws_name = 'ScanPtInfo_Exp%d_Scan%d' % (exp_no, scan_no)
return ws_name | [
"def",
"get_merge_pt_info_ws_name",
"(",
"exp_no",
",",
"scan_no",
")",
":",
"ws_name",
"=",
"'ScanPtInfo_Exp%d_Scan%d'",
"%",
"(",
"exp_no",
",",
"scan_no",
")",
"return",
"ws_name"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/fourcircle_utility.py#L607-L615 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/command.py | python | FbCmd.parseline | (self, line) | return cmd, arg, line | Parse the line into a command name and a string containing the
arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if line couldn't be parsed. Check for
registered special handlers. | Parse the line into a command name and a string containing the
arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if line couldn't be parsed. Check for
registered special handlers. | [
"Parse",
"the",
"line",
"into",
"a",
"command",
"name",
"and",
"a",
"string",
"containing",
"the",
"arguments",
".",
"Returns",
"a",
"tuple",
"containing",
"(",
"command",
"args",
"line",
")",
".",
"command",
"and",
"args",
"may",
"be",
"None",
"if",
"li... | def parseline(self, line):
"""Parse the line into a command name and a string containing the
arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if line couldn't be parsed. Check for
registered special handlers.
"""
line = line.... | [
"def",
"parseline",
"(",
"self",
",",
"line",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"not",
"line",
":",
"return",
"None",
",",
"None",
",",
"line",
"if",
"line",
"[",
"-",
"1",
":",
"]",
"in",
"self",
".",
"helpKeys",
":"... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/command.py#L238-L258 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/lmbr_aws/cleanup_utils/cleanup_iam_utils.py | python | _delete_access_keys | (cleaner, iam_user_name) | Deletes all access keys from the client. It will construct a list of resources, delete them, then wait for
each deletion.
:param cleaner: A Cleaner object from the main cleanup.py script
:param iam_user_name: The iam user name to be cleaned
:return: None | Deletes all access keys from the client. It will construct a list of resources, delete them, then wait for
each deletion.
:param cleaner: A Cleaner object from the main cleanup.py script
:param iam_user_name: The iam user name to be cleaned
:return: None | [
"Deletes",
"all",
"access",
"keys",
"from",
"the",
"client",
".",
"It",
"will",
"construct",
"a",
"list",
"of",
"resources",
"delete",
"them",
"then",
"wait",
"for",
"each",
"deletion",
".",
":",
"param",
"cleaner",
":",
"A",
"Cleaner",
"object",
"from",
... | def _delete_access_keys(cleaner, iam_user_name):
"""
Deletes all access keys from the client. It will construct a list of resources, delete them, then wait for
each deletion.
:param cleaner: A Cleaner object from the main cleanup.py script
:param iam_user_name: The iam user name to be cleaned
:r... | [
"def",
"_delete_access_keys",
"(",
"cleaner",
",",
"iam_user_name",
")",
":",
"print",
"(",
"'\\n\\nlooking for access keys with names starting with one of {0}'",
".",
"format",
"(",
"cleaner",
".",
"describe_prefixes",
"(",
")",
")",
")",
"iam_access_key_id_list",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/lmbr_aws/cleanup_utils/cleanup_iam_utils.py#L530-L587 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBLaunchInfo.GetUserID | (self) | return _lldb.SBLaunchInfo_GetUserID(self) | GetUserID(self) -> uint32_t | GetUserID(self) -> uint32_t | [
"GetUserID",
"(",
"self",
")",
"-",
">",
"uint32_t"
] | def GetUserID(self):
"""GetUserID(self) -> uint32_t"""
return _lldb.SBLaunchInfo_GetUserID(self) | [
"def",
"GetUserID",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBLaunchInfo_GetUserID",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5425-L5427 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window_GetClassDefaultAttributes | (*args, **kwargs) | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours or ... | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"Window_GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def Window_GetClassDefaultAttributes(*args, **kwargs):
"""
Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- whic... | [
"def",
"Window_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11764-L11779 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/config_key.py | python | GetKeysDialog.set_modifiers_for_platform | (self) | Determine list of names of key modifiers for this platform.
The names are used to build Tk bindings -- it doesn't matter if the
keyboard has these keys; it matters if Tk understands them. The
order is also important: key binding equality depends on it, so
config-keys.def must use the s... | Determine list of names of key modifiers for this platform. | [
"Determine",
"list",
"of",
"names",
"of",
"key",
"modifiers",
"for",
"this",
"platform",
"."
] | def set_modifiers_for_platform(self):
"""Determine list of names of key modifiers for this platform.
The names are used to build Tk bindings -- it doesn't matter if the
keyboard has these keys; it matters if Tk understands them. The
order is also important: key binding equality depends... | [
"def",
"set_modifiers_for_platform",
"(",
"self",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"\"darwin\"",
":",
"self",
".",
"modifiers",
"=",
"[",
"'Shift'",
",",
"'Control'",
",",
"'Option'",
",",
"'Command'",
"]",
"else",
":",
"self",
".",
"modifiers... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/config_key.py#L202-L214 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailcap.py | python | parsefield | (line, i, n) | return line[start:i].strip(), i | Separate one key-value pair in a mailcap entry. | Separate one key-value pair in a mailcap entry. | [
"Separate",
"one",
"key",
"-",
"value",
"pair",
"in",
"a",
"mailcap",
"entry",
"."
] | def parsefield(line, i, n):
"""Separate one key-value pair in a mailcap entry."""
start = i
while i < n:
c = line[i]
if c == ';':
break
elif c == '\\':
i = i+2
else:
i = i+1
return line[start:i].strip(), i | [
"def",
"parsefield",
"(",
"line",
",",
"i",
",",
"n",
")",
":",
"start",
"=",
"i",
"while",
"i",
"<",
"n",
":",
"c",
"=",
"line",
"[",
"i",
"]",
"if",
"c",
"==",
"';'",
":",
"break",
"elif",
"c",
"==",
"'\\\\'",
":",
"i",
"=",
"i",
"+",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailcap.py#L122-L133 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/resmokelib/selector.py | python | _TestList.include_any_pattern | (self, patterns) | Filters the test list to only include tests that match any of the given glob patterns. | Filters the test list to only include tests that match any of the given glob patterns. | [
"Filters",
"the",
"test",
"list",
"to",
"only",
"include",
"tests",
"that",
"match",
"any",
"of",
"the",
"given",
"glob",
"patterns",
"."
] | def include_any_pattern(self, patterns):
"""
Filters the test list to only include tests that match any of the given glob patterns.
"""
def match(test):
for pattern in patterns:
if test == pattern or fnmatch.fnmatchcase(test, pattern):
retu... | [
"def",
"include_any_pattern",
"(",
"self",
",",
"patterns",
")",
":",
"def",
"match",
"(",
"test",
")",
":",
"for",
"pattern",
"in",
"patterns",
":",
"if",
"test",
"==",
"pattern",
"or",
"fnmatch",
".",
"fnmatchcase",
"(",
"test",
",",
"pattern",
")",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/resmokelib/selector.py#L214-L224 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/util.py | python | get_predefined_collection_names | () | return [getattr(tf_ops.GraphKeys, key) for key in dir(tf_ops.GraphKeys)
if not _INTERNAL_VARIABLE_RE.match(key)] | Return all the predefined collection names. | Return all the predefined collection names. | [
"Return",
"all",
"the",
"predefined",
"collection",
"names",
"."
] | def get_predefined_collection_names():
"""Return all the predefined collection names."""
return [getattr(tf_ops.GraphKeys, key) for key in dir(tf_ops.GraphKeys)
if not _INTERNAL_VARIABLE_RE.match(key)] | [
"def",
"get_predefined_collection_names",
"(",
")",
":",
"return",
"[",
"getattr",
"(",
"tf_ops",
".",
"GraphKeys",
",",
"key",
")",
"for",
"key",
"in",
"dir",
"(",
"tf_ops",
".",
"GraphKeys",
")",
"if",
"not",
"_INTERNAL_VARIABLE_RE",
".",
"match",
"(",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/util.py#L485-L488 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/six.py | python | _import_module | (name) | return sys.modules[name] | Import module, returning the module after the last dot. | Import module, returning the module after the last dot. | [
"Import",
"module",
"returning",
"the",
"module",
"after",
"the",
"last",
"dot",
"."
] | def _import_module(name):
"""Import module, returning the module after the last dot."""
__import__(name)
return sys.modules[name] | [
"def",
"_import_module",
"(",
"name",
")",
":",
"__import__",
"(",
"name",
")",
"return",
"sys",
".",
"modules",
"[",
"name",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/six.py#L80-L83 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/types.py | python | Type._get_ll_pointer_type | (self, target_data, context=None) | Convert this type object to an LLVM type. | Convert this type object to an LLVM type. | [
"Convert",
"this",
"type",
"object",
"to",
"an",
"LLVM",
"type",
"."
] | def _get_ll_pointer_type(self, target_data, context=None):
"""
Convert this type object to an LLVM type.
"""
from . import Module, GlobalVariable
from ..binding import parse_assembly
if context is None:
m = Module()
else:
m = Module(contex... | [
"def",
"_get_ll_pointer_type",
"(",
"self",
",",
"target_data",
",",
"context",
"=",
"None",
")",
":",
"from",
".",
"import",
"Module",
",",
"GlobalVariable",
"from",
".",
".",
"binding",
"import",
"parse_assembly",
"if",
"context",
"is",
"None",
":",
"m",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/types.py#L35-L48 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/sliceshell.py | python | SlicesShellFrame.OnEnableShellMode | (self,event) | Change between Slices Mode and Shell Mode | Change between Slices Mode and Shell Mode | [
"Change",
"between",
"Slices",
"Mode",
"and",
"Shell",
"Mode"
] | def OnEnableShellMode(self,event):
"""Change between Slices Mode and Shell Mode"""
frame.Frame.OnEnableShellMode(self,event)
self.sliceshell.ToggleShellMode(self.enableShellMode) | [
"def",
"OnEnableShellMode",
"(",
"self",
",",
"event",
")",
":",
"frame",
".",
"Frame",
".",
"OnEnableShellMode",
"(",
"self",
",",
"event",
")",
"self",
".",
"sliceshell",
".",
"ToggleShellMode",
"(",
"self",
".",
"enableShellMode",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L240-L243 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/BERT/squad/evaluate-v2.0.py | python | normalize_answer | (s) | return white_space_fix(remove_articles(remove_punc(lower(s)))) | Lower text and remove punctuation, articles and extra whitespace. | Lower text and remove punctuation, articles and extra whitespace. | [
"Lower",
"text",
"and",
"remove",
"punctuation",
"articles",
"and",
"extra",
"whitespace",
"."
] | def normalize_answer(s):
"""Lower text and remove punctuation, articles and extra whitespace."""
def remove_articles(text):
regex = re.compile(r'\b(a|an|the)\b', re.UNICODE)
return re.sub(regex, ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = ... | [
"def",
"normalize_answer",
"(",
"s",
")",
":",
"def",
"remove_articles",
"(",
"text",
")",
":",
"regex",
"=",
"re",
".",
"compile",
"(",
"r'\\b(a|an|the)\\b'",
",",
"re",
".",
"UNICODE",
")",
"return",
"re",
".",
"sub",
"(",
"regex",
",",
"' '",
",",
... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/BERT/squad/evaluate-v2.0.py#L64-L76 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Platform/virtualenv.py | python | _is_path_in | (path, base) | return (not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir) | Returns true if **path** is located under the **base** directory. | Returns true if **path** is located under the **base** directory. | [
"Returns",
"true",
"if",
"**",
"path",
"**",
"is",
"located",
"under",
"the",
"**",
"base",
"**",
"directory",
"."
] | def _is_path_in(path, base):
"""Returns true if **path** is located under the **base** directory."""
if not path or not base: # empty path may happen, base too
return False
rp = os.path.relpath(path, base)
return (not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir) | [
"def",
"_is_path_in",
"(",
"path",
",",
"base",
")",
":",
"if",
"not",
"path",
"or",
"not",
"base",
":",
"# empty path may happen, base too",
"return",
"False",
"rp",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"path",
",",
"base",
")",
"return",
"(",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Platform/virtualenv.py#L54-L59 | |
vtraag/leidenalg | b53366829360e10922a2dbf57eb405a516c23bc9 | src/leidenalg/VertexPartition.py | python | MutableVertexPartition.weight_to_comm | (self, v, comm) | return _c_leiden._MutableVertexPartition_weight_to_comm(self._partition, v, comm) | The total number of edges (or sum of weights) from node ``v`` to
community ``comm``.
See Also
--------
:func:`~VertexPartition.MutableVertexPartition.weight_from_comm` | The total number of edges (or sum of weights) from node ``v`` to
community ``comm``. | [
"The",
"total",
"number",
"of",
"edges",
"(",
"or",
"sum",
"of",
"weights",
")",
"from",
"node",
"v",
"to",
"community",
"comm",
"."
] | def weight_to_comm(self, v, comm):
""" The total number of edges (or sum of weights) from node ``v`` to
community ``comm``.
See Also
--------
:func:`~VertexPartition.MutableVertexPartition.weight_from_comm`
"""
return _c_leiden._MutableVertexPartition_weight_to_comm(self._partition, v, comm... | [
"def",
"weight_to_comm",
"(",
"self",
",",
"v",
",",
"comm",
")",
":",
"return",
"_c_leiden",
".",
"_MutableVertexPartition_weight_to_comm",
"(",
"self",
".",
"_partition",
",",
"v",
",",
"comm",
")"
] | https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/src/leidenalg/VertexPartition.py#L364-L372 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/summary/event_file_inspector.py | python | get_field_to_observations_map | (generator, query_for_tag='') | return field_to_obs | Return a field to `Observations` dict for the event generator.
Args:
generator: A generator over event protos.
query_for_tag: A string that if specified, only create observations for
events with this tag name.
Returns:
A dict mapping keys in `TRACKED_FIELDS` to an `Observation` list. | Return a field to `Observations` dict for the event generator. | [
"Return",
"a",
"field",
"to",
"Observations",
"dict",
"for",
"the",
"event",
"generator",
"."
] | def get_field_to_observations_map(generator, query_for_tag=''):
"""Return a field to `Observations` dict for the event generator.
Args:
generator: A generator over event protos.
query_for_tag: A string that if specified, only create observations for
events with this tag name.
Returns:
A dict m... | [
"def",
"get_field_to_observations_map",
"(",
"generator",
",",
"query_for_tag",
"=",
"''",
")",
":",
"def",
"increment",
"(",
"stat",
",",
"event",
",",
"tag",
"=",
"''",
")",
":",
"assert",
"stat",
"in",
"TRACKED_FIELDS",
"field_to_obs",
"[",
"stat",
"]",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/summary/event_file_inspector.py#L172-L212 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.remove | (self, elem) | Removes an item from the list. Similar to list.remove(). | Removes an item from the list. Similar to list.remove(). | [
"Removes",
"an",
"item",
"from",
"the",
"list",
".",
"Similar",
"to",
"list",
".",
"remove",
"()",
"."
] | def remove(self, elem):
"""Removes an item from the list. Similar to list.remove()."""
self._values.remove(elem)
self._message_listener.Modified() | [
"def",
"remove",
"(",
"self",
",",
"elem",
")",
":",
"self",
".",
"_values",
".",
"remove",
"(",
"elem",
")",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/containers.py#L399-L402 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_inductionloop.py | python | InductionLoopDomain.getLastStepVehicleNumber | (self, loopID) | return self._getUniversal(tc.LAST_STEP_VEHICLE_NUMBER, loopID) | getLastStepVehicleNumber(string) -> integer
Returns the number of vehicles that were on the named induction loop within the last simulation step. | getLastStepVehicleNumber(string) -> integer | [
"getLastStepVehicleNumber",
"(",
"string",
")",
"-",
">",
"integer"
] | def getLastStepVehicleNumber(self, loopID):
"""getLastStepVehicleNumber(string) -> integer
Returns the number of vehicles that were on the named induction loop within the last simulation step.
"""
return self._getUniversal(tc.LAST_STEP_VEHICLE_NUMBER, loopID) | [
"def",
"getLastStepVehicleNumber",
"(",
"self",
",",
"loopID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"LAST_STEP_VEHICLE_NUMBER",
",",
"loopID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_inductionloop.py#L64-L69 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | linked_list/library/linked_list.py | python | Node.set_data | (self, new_data) | replace the existing value of the self.data attribute with
new_data parameter | replace the existing value of the self.data attribute with
new_data parameter | [
"replace",
"the",
"existing",
"value",
"of",
"the",
"self",
".",
"data",
"attribute",
"with",
"new_data",
"parameter"
] | def set_data(self, new_data):
""" replace the existing value of the self.data attribute with
new_data parameter
"""
self.data = new_data | [
"def",
"set_data",
"(",
"self",
",",
"new_data",
")",
":",
"self",
".",
"data",
"=",
"new_data"
] | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/linked_list/library/linked_list.py#L19-L23 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGTextCtrlEditor_OnTextCtrlEvent | (*args, **kwargs) | return _propgrid.PGTextCtrlEditor_OnTextCtrlEvent(*args, **kwargs) | PGTextCtrlEditor_OnTextCtrlEvent(PropertyGrid propgrid, PGProperty property, Window ctrl,
Event event) -> bool | PGTextCtrlEditor_OnTextCtrlEvent(PropertyGrid propgrid, PGProperty property, Window ctrl,
Event event) -> bool | [
"PGTextCtrlEditor_OnTextCtrlEvent",
"(",
"PropertyGrid",
"propgrid",
"PGProperty",
"property",
"Window",
"ctrl",
"Event",
"event",
")",
"-",
">",
"bool"
] | def PGTextCtrlEditor_OnTextCtrlEvent(*args, **kwargs):
"""
PGTextCtrlEditor_OnTextCtrlEvent(PropertyGrid propgrid, PGProperty property, Window ctrl,
Event event) -> bool
"""
return _propgrid.PGTextCtrlEditor_OnTextCtrlEvent(*args, **kwargs) | [
"def",
"PGTextCtrlEditor_OnTextCtrlEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGTextCtrlEditor_OnTextCtrlEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2744-L2749 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/response.py | python | StreamingBody.set_socket_timeout | (self, timeout) | Set the timeout seconds on the socket. | Set the timeout seconds on the socket. | [
"Set",
"the",
"timeout",
"seconds",
"on",
"the",
"socket",
"."
] | def set_socket_timeout(self, timeout):
"""Set the timeout seconds on the socket."""
# The problem we're trying to solve is to prevent .read() calls from
# hanging. This can happen in rare cases. What we'd like to ideally
# do is set a timeout on the .read() call so that callers can ret... | [
"def",
"set_socket_timeout",
"(",
"self",
",",
"timeout",
")",
":",
"# The problem we're trying to solve is to prevent .read() calls from",
"# hanging. This can happen in rare cases. What we'd like to ideally",
"# do is set a timeout on the .read() call so that callers can retry",
"# the req... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/response.py#L46-L67 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/telnetlib.py | python | Telnet.mt_interact | (self) | Multithreaded version of interact(). | Multithreaded version of interact(). | [
"Multithreaded",
"version",
"of",
"interact",
"()",
"."
] | def mt_interact(self):
"""Multithreaded version of interact()."""
import thread
thread.start_new_thread(self.listener, ())
while 1:
line = sys.stdin.readline()
if not line:
break
self.write(line) | [
"def",
"mt_interact",
"(",
"self",
")",
":",
"import",
"thread",
"thread",
".",
"start_new_thread",
"(",
"self",
".",
"listener",
",",
"(",
")",
")",
"while",
"1",
":",
"line",
"=",
"sys",
".",
"stdin",
".",
"readline",
"(",
")",
"if",
"not",
"line",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/telnetlib.py#L604-L612 | ||
ChilliWorks/ChilliSource | 1f482f1e84c1402b7ded7130d9ff9d114b4a458d | Tools/Scripts/ninja_syntax.py | python | Writer._line | (self, text, indent=0) | Write 'text' word-wrapped at self.width characters. | Write 'text' word-wrapped at self.width characters. | [
"Write",
"text",
"word",
"-",
"wrapped",
"at",
"self",
".",
"width",
"characters",
"."
] | def _line(self, text, indent=0):
"""Write 'text' word-wrapped at self.width characters."""
leading_space = ' ' * indent
while len(leading_space) + len(text) > self.width:
# The text is too wide; wrap if possible.
# Find the rightmost space that would obey our width cons... | [
"def",
"_line",
"(",
"self",
",",
"text",
",",
"indent",
"=",
"0",
")",
":",
"leading_space",
"=",
"' '",
"*",
"indent",
"while",
"len",
"(",
"leading_space",
")",
"+",
"len",
"(",
"text",
")",
">",
"self",
".",
"width",
":",
"# The text is too wide; ... | https://github.com/ChilliWorks/ChilliSource/blob/1f482f1e84c1402b7ded7130d9ff9d114b4a458d/Tools/Scripts/ninja_syntax.py#L109-L143 | ||
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/onedim.py | python | FlameBase.set_profile | (self, component, positions, values) | Set an initial estimate for a profile of one component.
:param component:
component name or index
:param positions:
sequence of relative positions, from 0 on the left to 1 on the right
:param values:
sequence of values at the relative positions specified in *... | Set an initial estimate for a profile of one component. | [
"Set",
"an",
"initial",
"estimate",
"for",
"a",
"profile",
"of",
"one",
"component",
"."
] | def set_profile(self, component, positions, values):
"""
Set an initial estimate for a profile of one component.
:param component:
component name or index
:param positions:
sequence of relative positions, from 0 on the left to 1 on the right
:param values... | [
"def",
"set_profile",
"(",
"self",
",",
"component",
",",
"positions",
",",
"values",
")",
":",
"super",
"(",
")",
".",
"set_profile",
"(",
"self",
".",
"flame",
",",
"component",
",",
"positions",
",",
"values",
")"
] | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/onedim.py#L184-L197 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_imdb_dataset | (method) | return new_method | A wrapper that wraps a parameter checker around the original IMDBDataset. | A wrapper that wraps a parameter checker around the original IMDBDataset. | [
"A",
"wrapper",
"that",
"wraps",
"a",
"parameter",
"checker",
"around",
"the",
"original",
"IMDBDataset",
"."
] | def check_imdb_dataset(method):
"""A wrapper that wraps a parameter checker around the original IMDBDataset."""
@wraps(method)
def new_method(self, *args, **kwargs):
_, param_dict = parse_user_args(method, *args, **kwargs)
nreq_param_int = ['num_samples', 'num_parallel_workers', 'num_shard... | [
"def",
"check_imdb_dataset",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_",
",",
"param_dict",
"=",
"parse_user_args",
"(",
"method",
",",
"*",
"a... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L66-L92 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py | python | TranslationUnit.spelling | (self) | return conf.lib.clang_getTranslationUnitSpelling(self) | Get the original translation unit source file name. | Get the original translation unit source file name. | [
"Get",
"the",
"original",
"translation",
"unit",
"source",
"file",
"name",
"."
] | def spelling(self):
"""Get the original translation unit source file name."""
return conf.lib.clang_getTranslationUnitSpelling(self) | [
"def",
"spelling",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTranslationUnitSpelling",
"(",
"self",
")"
] | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L2607-L2609 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/holparam_predictor.py | python | recommend_from_scores | (scores: List[List[float]], n: int) | return [top_idx(s) for s in scores] | Return the index of the top n predicted scores.
Args:
scores: A list of tactic probabilities, each of length equal to the number
of tactics.
n: The number of recommendations requested.
Returns:
A list of the indices with the highest scores. | Return the index of the top n predicted scores. | [
"Return",
"the",
"index",
"of",
"the",
"top",
"n",
"predicted",
"scores",
"."
] | def recommend_from_scores(scores: List[List[float]], n: int) -> List[List[int]]:
"""Return the index of the top n predicted scores.
Args:
scores: A list of tactic probabilities, each of length equal to the number
of tactics.
n: The number of recommendations requested.
Returns:
A list of the in... | [
"def",
"recommend_from_scores",
"(",
"scores",
":",
"List",
"[",
"List",
"[",
"float",
"]",
"]",
",",
"n",
":",
"int",
")",
"->",
"List",
"[",
"List",
"[",
"int",
"]",
"]",
":",
"def",
"top_idx",
"(",
"scores",
")",
":",
"return",
"np",
".",
"arr... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/holparam_predictor.py#L25-L40 | |
RegrowthStudios/SoACode-Public | c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe | utils/git-hooks/pep8.py | python | Checker.check_logical | (self) | Build a line from tokens and run all logical checks on it. | Build a line from tokens and run all logical checks on it. | [
"Build",
"a",
"line",
"from",
"tokens",
"and",
"run",
"all",
"logical",
"checks",
"on",
"it",
"."
] | def check_logical(self):
"""
Build a line from tokens and run all logical checks on it.
"""
self.build_tokens_line()
self.report.increment_logical_line()
first_line = self.lines[self.mapping[0][1][2][0] - 1]
indent = first_line[:self.mapping[0][1][2][1]]
s... | [
"def",
"check_logical",
"(",
"self",
")",
":",
"self",
".",
"build_tokens_line",
"(",
")",
"self",
".",
"report",
".",
"increment_logical_line",
"(",
")",
"first_line",
"=",
"self",
".",
"lines",
"[",
"self",
".",
"mapping",
"[",
"0",
"]",
"[",
"1",
"]... | https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/pep8.py#L1312-L1337 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/api/trade_api.py | python | TradeApi.trade_get_bucketed_with_http_info | (self, **kwargs) | return self.api_client.call_api(
'/trade/bucketed', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[TradeBin]', # noqa: E501
... | Get previous trades in time buckets. # noqa: E501
Timestamps returned by our bucketed endpoints are the **end** of the period, indicating when the bucket was written to disk. Some other common systems use the timestamp as the beginning of the period. Please be aware of this when using this endpoint. Also not... | Get previous trades in time buckets. # noqa: E501 | [
"Get",
"previous",
"trades",
"in",
"time",
"buckets",
".",
"#",
"noqa",
":",
"E501"
] | def trade_get_bucketed_with_http_info(self, **kwargs): # noqa: E501
"""Get previous trades in time buckets. # noqa: E501
Timestamps returned by our bucketed endpoints are the **end** of the period, indicating when the bucket was written to disk. Some other common systems use the timestamp as the begi... | [
"def",
"trade_get_bucketed_with_http_info",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"all_params",
"=",
"[",
"'bin_size'",
",",
"'partial'",
",",
"'symbol'",
",",
"'filter'",
",",
"'columns'",
",",
"'count'",
",",
"'start'",
",",
"'rever... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/api/trade_api.py#L190-L288 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/configuration.py | python | Configuration.load | (self) | Loads configuration from configuration files and environment | Loads configuration from configuration files and environment | [
"Loads",
"configuration",
"from",
"configuration",
"files",
"and",
"environment"
] | def load(self):
# type: () -> None
"""Loads configuration from configuration files and environment
"""
self._load_config_files()
if not self.isolated:
self._load_environment_vars() | [
"def",
"load",
"(",
"self",
")",
":",
"# type: () -> None",
"self",
".",
"_load_config_files",
"(",
")",
"if",
"not",
"self",
".",
"isolated",
":",
"self",
".",
"_load_environment_vars",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/configuration.py#L133-L139 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | CheckForIncludeWhatYouUse | (filename, clean_lines, include_state, error,
io=codecs) | Reports for missing stl includes.
This function will output warnings to make sure you are including the headers
necessary for the stl containers and functions that you use. We only give one
reason to include a header. For example, if you use both equal_to<> and
less<> in a .h file, only one (the latter in the ... | Reports for missing stl includes. | [
"Reports",
"for",
"missing",
"stl",
"includes",
"."
] | def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
io=codecs):
"""Reports for missing stl includes.
This function will output warnings to make sure you are including the headers
necessary for the stl containers and functions that you use. We only give one
r... | [
"def",
"CheckForIncludeWhatYouUse",
"(",
"filename",
",",
"clean_lines",
",",
"include_state",
",",
"error",
",",
"io",
"=",
"codecs",
")",
":",
"required",
"=",
"{",
"}",
"# A map of header name to linenumber and the template entity.",
"# Example of required: { '<functiona... | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L5611-L5702 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlWindow.SetRelatedStatusBar | (*args) | return _html.HtmlWindow_SetRelatedStatusBar(*args) | SetRelatedStatusBar(self, int bar)
SetRelatedStatusBar(self, StatusBar ?, int index=0) | SetRelatedStatusBar(self, int bar)
SetRelatedStatusBar(self, StatusBar ?, int index=0) | [
"SetRelatedStatusBar",
"(",
"self",
"int",
"bar",
")",
"SetRelatedStatusBar",
"(",
"self",
"StatusBar",
"?",
"int",
"index",
"=",
"0",
")"
] | def SetRelatedStatusBar(*args):
"""
SetRelatedStatusBar(self, int bar)
SetRelatedStatusBar(self, StatusBar ?, int index=0)
"""
return _html.HtmlWindow_SetRelatedStatusBar(*args) | [
"def",
"SetRelatedStatusBar",
"(",
"*",
"args",
")",
":",
"return",
"_html",
".",
"HtmlWindow_SetRelatedStatusBar",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1022-L1027 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | Context._import_config | (self) | Import config if passed in during construction.
If Context was created with a ConfigProto such as when calling
tf.compat.v1.enable_eager_execution(), then we need to pull out the
various pieces we might be replacing and import then into our internal
class representation. | Import config if passed in during construction. | [
"Import",
"config",
"if",
"passed",
"in",
"during",
"construction",
"."
] | def _import_config(self):
"""Import config if passed in during construction.
If Context was created with a ConfigProto such as when calling
tf.compat.v1.enable_eager_execution(), then we need to pull out the
various pieces we might be replacing and import then into our internal
class representation... | [
"def",
"_import_config",
"(",
"self",
")",
":",
"if",
"self",
".",
"_config",
"is",
"None",
":",
"return",
"num_cpus",
"=",
"self",
".",
"_config",
".",
"device_count",
".",
"get",
"(",
"\"CPU\"",
",",
"1",
")",
"if",
"num_cpus",
"!=",
"1",
":",
"cpu... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L1485-L1529 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py | python | _ServiceBuilder._NonImplementedMethod | (self, method_name, rpc_controller, callback) | The body of all methods in the generated service class.
Args:
method_name: Name of the method being executed.
rpc_controller: RPC controller used to execute this method.
callback: A callback which will be invoked when the method finishes. | The body of all methods in the generated service class. | [
"The",
"body",
"of",
"all",
"methods",
"in",
"the",
"generated",
"service",
"class",
"."
] | def _NonImplementedMethod(self, method_name, rpc_controller, callback):
"""The body of all methods in the generated service class.
Args:
method_name: Name of the method being executed.
rpc_controller: RPC controller used to execute this method.
callback: A callback which will be invoked when ... | [
"def",
"_NonImplementedMethod",
"(",
"self",
",",
"method_name",
",",
"rpc_controller",
",",
"callback",
")",
":",
"rpc_controller",
".",
"SetFailed",
"(",
"'Method %s not implemented.'",
"%",
"method_name",
")",
"callback",
"(",
"None",
")"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py#L218-L227 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/pylib/results/flakiness_dashboard/json_results_generator.py | python | AddPathToTrie | (path, value, trie) | Inserts a single path and value into a directory trie structure. | Inserts a single path and value into a directory trie structure. | [
"Inserts",
"a",
"single",
"path",
"and",
"value",
"into",
"a",
"directory",
"trie",
"structure",
"."
] | def AddPathToTrie(path, value, trie):
"""Inserts a single path and value into a directory trie structure."""
if not '/' in path:
trie[path] = value
return
directory, _, rest = path.partition('/')
if not directory in trie:
trie[directory] = {}
AddPathToTrie(rest, value, trie[directory]) | [
"def",
"AddPathToTrie",
"(",
"path",
",",
"value",
",",
"trie",
")",
":",
"if",
"not",
"'/'",
"in",
"path",
":",
"trie",
"[",
"path",
"]",
"=",
"value",
"return",
"directory",
",",
"_",
",",
"rest",
"=",
"path",
".",
"partition",
"(",
"'/'",
")",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/results/flakiness_dashboard/json_results_generator.py#L65-L74 | ||
xiaohaoChen/rrc_detection | 4f2b110cd122da7f55e8533275a9b4809a88785a | scripts/cpp_lint.py | python | _NestingState.SeenOpenBrace | (self) | return (not self.stack) or self.stack[-1].seen_open_brace | Check if we have seen the opening brace for the innermost block.
Returns:
True if we have seen the opening brace, False if the innermost
block is still expecting an opening brace. | Check if we have seen the opening brace for the innermost block. | [
"Check",
"if",
"we",
"have",
"seen",
"the",
"opening",
"brace",
"for",
"the",
"innermost",
"block",
"."
] | def SeenOpenBrace(self):
"""Check if we have seen the opening brace for the innermost block.
Returns:
True if we have seen the opening brace, False if the innermost
block is still expecting an opening brace.
"""
return (not self.stack) or self.stack[-1].seen_open_brace | [
"def",
"SeenOpenBrace",
"(",
"self",
")",
":",
"return",
"(",
"not",
"self",
".",
"stack",
")",
"or",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
".",
"seen_open_brace"
] | https://github.com/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/scripts/cpp_lint.py#L1935-L1942 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_RelativeScopedName | (self, p) | RelativeScopedName : IDENTIFIER ScopedNameParts | RelativeScopedName : IDENTIFIER ScopedNameParts | [
"RelativeScopedName",
":",
"IDENTIFIER",
"ScopedNameParts"
] | def p_RelativeScopedName(self, p):
"""
RelativeScopedName : IDENTIFIER ScopedNameParts
"""
assert not p[2] # Not implemented!
p[0] = IDLUnresolvedIdentifier(self.getLocation(p, 1), p[1]) | [
"def",
"p_RelativeScopedName",
"(",
"self",
",",
"p",
")",
":",
"assert",
"not",
"p",
"[",
"2",
"]",
"# Not implemented!",
"p",
"[",
"0",
"]",
"=",
"IDLUnresolvedIdentifier",
"(",
"self",
".",
"getLocation",
"(",
"p",
",",
"1",
")",
",",
"p",
"[",
"1... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L5490-L5496 | ||
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/box.py | python | Box.square | (cls, L) | return cls(L, L, 0, 0, 0, 0) | Create a square with side lengths ``L``.
Args:
L (float): The box side length :math:`[\\mathrm{length}]`.
Returns:
hoomd.Box: The created 2D box. | Create a square with side lengths ``L``. | [
"Create",
"a",
"square",
"with",
"side",
"lengths",
"L",
"."
] | def square(cls, L):
"""Create a square with side lengths ``L``.
Args:
L (float): The box side length :math:`[\\mathrm{length}]`.
Returns:
hoomd.Box: The created 2D box.
"""
return cls(L, L, 0, 0, 0, 0) | [
"def",
"square",
"(",
"cls",
",",
"L",
")",
":",
"return",
"cls",
"(",
"L",
",",
"L",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
")"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/box.py#L122-L131 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/elo.py | python | EloInfo.get_approx_elo_stderr | (self, p1: Player) | return self.elo_stderr[p1] | Returns an approximation of the standard error on the Elo of p1, ASSUMING all other players Elos are equal to their maximum likelihood value.
This approximation may underestimate if the amount of data is very small. | Returns an approximation of the standard error on the Elo of p1, ASSUMING all other players Elos are equal to their maximum likelihood value.
This approximation may underestimate if the amount of data is very small. | [
"Returns",
"an",
"approximation",
"of",
"the",
"standard",
"error",
"on",
"the",
"Elo",
"of",
"p1",
"ASSUMING",
"all",
"other",
"players",
"Elos",
"are",
"equal",
"to",
"their",
"maximum",
"likelihood",
"value",
".",
"This",
"approximation",
"may",
"underestim... | def get_approx_elo_stderr(self, p1: Player) -> float:
"""Returns an approximation of the standard error on the Elo of p1, ASSUMING all other players Elos are equal to their maximum likelihood value.
This approximation may underestimate if the amount of data is very small."""
return self.elo_stderr[p1] | [
"def",
"get_approx_elo_stderr",
"(",
"self",
",",
"p1",
":",
"Player",
")",
"->",
"float",
":",
"return",
"self",
".",
"elo_stderr",
"[",
"p1",
"]"
] | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/elo.py#L39-L42 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/style_render.py | python | StylerRenderer._translate | (self, sparse_index: bool, sparse_cols: bool, blank: str = " ") | return d | Process Styler data and settings into a dict for template rendering.
Convert data and settings from ``Styler`` attributes such as ``self.data``,
``self.tooltips`` including applying any methods in ``self._todo``.
Parameters
----------
sparse_index : bool
Whether to ... | Process Styler data and settings into a dict for template rendering. | [
"Process",
"Styler",
"data",
"and",
"settings",
"into",
"a",
"dict",
"for",
"template",
"rendering",
"."
] | def _translate(self, sparse_index: bool, sparse_cols: bool, blank: str = " "):
"""
Process Styler data and settings into a dict for template rendering.
Convert data and settings from ``Styler`` attributes such as ``self.data``,
``self.tooltips`` including applying any methods in ``... | [
"def",
"_translate",
"(",
"self",
",",
"sparse_index",
":",
"bool",
",",
"sparse_cols",
":",
"bool",
",",
"blank",
":",
"str",
"=",
"\" \"",
")",
":",
"ROW_HEADING_CLASS",
"=",
"\"row_heading\"",
"COL_HEADING_CLASS",
"=",
"\"col_heading\"",
"INDEX_NAME_CLASS"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/style_render.py#L163-L251 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/heapq.py | python | _siftdown_max | (heap, startpos, pos) | Maxheap variant of _siftdown | Maxheap variant of _siftdown | [
"Maxheap",
"variant",
"of",
"_siftdown"
] | def _siftdown_max(heap, startpos, pos):
'Maxheap variant of _siftdown'
newitem = heap[pos]
# Follow the path to the root, moving parents down until finding a place
# newitem fits.
while pos > startpos:
parentpos = (pos - 1) >> 1
parent = heap[parentpos]
if parent < newitem:
... | [
"def",
"_siftdown_max",
"(",
"heap",
",",
"startpos",
",",
"pos",
")",
":",
"newitem",
"=",
"heap",
"[",
"pos",
"]",
"# Follow the path to the root, moving parents down until finding a place",
"# newitem fits.",
"while",
"pos",
">",
"startpos",
":",
"parentpos",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/heapq.py#L278-L291 | ||
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/descriptor.py | python | DescriptorBase.__init__ | (self, options, options_class_name) | Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created. | Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created. | [
"Initialize",
"the",
"descriptor",
"given",
"its",
"options",
"message",
"and",
"the",
"name",
"of",
"the",
"class",
"of",
"the",
"options",
"message",
".",
"The",
"name",
"of",
"the",
"class",
"is",
"required",
"in",
"case",
"the",
"options",
"message",
"... | def __init__(self, options, options_class_name):
"""Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created.
"""
self._options = options
self._options_class_n... | [
"def",
"__init__",
"(",
"self",
",",
"options",
",",
"options_class_name",
")",
":",
"self",
".",
"_options",
"=",
"options",
"self",
".",
"_options_class_name",
"=",
"options_class_name",
"# Does this descriptor have non-default options?",
"self",
".",
"has_options",
... | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/descriptor.py#L71-L80 | ||
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeInt64 | (self) | return result | Consumes a signed 64bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If a signed 64bit integer couldn't be consumed. | Consumes a signed 64bit integer number. | [
"Consumes",
"a",
"signed",
"64bit",
"integer",
"number",
"."
] | def ConsumeInt64(self):
"""Consumes a signed 64bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If a signed 64bit integer couldn't be consumed.
"""
try:
result = ParseInteger(self.token, is_signed=True, is_long=True)
except ValueError, e:
raise self.... | [
"def",
"ConsumeInt64",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"ParseInteger",
"(",
"self",
".",
"token",
",",
"is_signed",
"=",
"True",
",",
"is_long",
"=",
"True",
")",
"except",
"ValueError",
",",
"e",
":",
"raise",
"self",
".",
"_ParseErr... | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/text_format.py#L593-L607 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py | python | _concat | (prefix, suffix, static=False) | return shape | Concat that enables int, Tensor, or TensorShape values.
This function takes a size specification, which can be an integer, a
TensorShape, or a Tensor, and converts it into a concatenated Tensor
(if static = False) or a list of integers (if static = True).
Args:
prefix: The prefix; usually the batch size (... | Concat that enables int, Tensor, or TensorShape values. | [
"Concat",
"that",
"enables",
"int",
"Tensor",
"or",
"TensorShape",
"values",
"."
] | def _concat(prefix, suffix, static=False):
"""Concat that enables int, Tensor, or TensorShape values.
This function takes a size specification, which can be an integer, a
TensorShape, or a Tensor, and converts it into a concatenated Tensor
(if static = False) or a list of integers (if static = True).
Args:
... | [
"def",
"_concat",
"(",
"prefix",
",",
"suffix",
",",
"static",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"prefix",
",",
"ops",
".",
"Tensor",
")",
":",
"p",
"=",
"prefix",
"p_static",
"=",
"tensor_util",
".",
"constant_value",
"(",
"prefix",
")"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py#L106-L165 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/loggers/loggers.py | python | set_log_handles | (
level: int,
log_path: Optional["Path"] = None,
mpi_log: Optional[str] = None
) | Set desired level for package loggers and add file handlers.
Parameters
----------
level: int
logging level
log_path: Optional[str]
path to log file, if None logs will be send only to console. If the parent
directory does not exist it will be automatically created, by default No... | Set desired level for package loggers and add file handlers. | [
"Set",
"desired",
"level",
"for",
"package",
"loggers",
"and",
"add",
"file",
"handlers",
"."
] | def set_log_handles(
level: int,
log_path: Optional["Path"] = None,
mpi_log: Optional[str] = None
):
"""Set desired level for package loggers and add file handlers.
Parameters
----------
level: int
logging level
log_path: Optional[str]
path to log file, if None logs will... | [
"def",
"set_log_handles",
"(",
"level",
":",
"int",
",",
"log_path",
":",
"Optional",
"[",
"\"Path\"",
"]",
"=",
"None",
",",
"mpi_log",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
":",
"# silence logging for OpenMP when running on CPU if level is any othe... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/loggers/loggers.py#L137-L268 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/client/session.py | python | BaseSession._do_run | (self, handle, target_list, fetch_list, feed_dict,
options, run_metadata) | Runs a step based on the given fetches and feeds.
Args:
handle: a handle for partial_run. None if this is just a call to run().
target_list: A list of byte arrays corresponding to names of tensors
or operations to be run to, but not fetched.
fetch_list: A list of byte arrays corresponding... | Runs a step based on the given fetches and feeds. | [
"Runs",
"a",
"step",
"based",
"on",
"the",
"given",
"fetches",
"and",
"feeds",
"."
] | def _do_run(self, handle, target_list, fetch_list, feed_dict,
options, run_metadata):
"""Runs a step based on the given fetches and feeds.
Args:
handle: a handle for partial_run. None if this is just a call to run().
target_list: A list of byte arrays corresponding to names of tensors... | [
"def",
"_do_run",
"(",
"self",
",",
"handle",
",",
"target_list",
",",
"fetch_list",
",",
"feed_dict",
",",
"options",
",",
"run_metadata",
")",
":",
"def",
"_run_fn",
"(",
"session",
",",
"feed_dict",
",",
"fetch_list",
",",
"target_list",
",",
"options",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/client/session.py#L923-L968 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.