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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/elb/__init__.py | python | ELBConnection.set_lb_policies_of_listener | (self, lb_name, lb_port, policies) | return self.get_status('SetLoadBalancerPoliciesOfListener', params) | Associates, updates, or disables a policy with a listener on the load
balancer. Currently only zero (0) or one (1) policy can be associated
with a listener. | Associates, updates, or disables a policy with a listener on the load
balancer. Currently only zero (0) or one (1) policy can be associated
with a listener. | [
"Associates",
"updates",
"or",
"disables",
"a",
"policy",
"with",
"a",
"listener",
"on",
"the",
"load",
"balancer",
".",
"Currently",
"only",
"zero",
"(",
"0",
")",
"or",
"one",
"(",
"1",
")",
"policy",
"can",
"be",
"associated",
"with",
"a",
"listener",... | def set_lb_policies_of_listener(self, lb_name, lb_port, policies):
"""
Associates, updates, or disables a policy with a listener on the load
balancer. Currently only zero (0) or one (1) policy can be associated
with a listener.
"""
params = {'LoadBalancerName': lb_name,
... | [
"def",
"set_lb_policies_of_listener",
"(",
"self",
",",
"lb_name",
",",
"lb_port",
",",
"policies",
")",
":",
"params",
"=",
"{",
"'LoadBalancerName'",
":",
"lb_name",
",",
"'LoadBalancerPort'",
":",
"lb_port",
"}",
"if",
"len",
"(",
"policies",
")",
":",
"s... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/elb/__init__.py#L667-L679 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/ndimage/interpolation.py | python | zoom | (input, zoom, output=None, order=3, mode='constant', cval=0.0,
prefilter=True) | return return_value | Zoom an array.
The array is zoomed using spline interpolation of the requested order.
Parameters
----------
input : ndarray
The input array.
zoom : float or sequence, optional
The zoom factor along the axes. If a float, `zoom` is the same for each
axis. If a sequence, `zoom... | Zoom an array. | [
"Zoom",
"an",
"array",
"."
] | def zoom(input, zoom, output=None, order=3, mode='constant', cval=0.0,
prefilter=True):
"""
Zoom an array.
The array is zoomed using spline interpolation of the requested order.
Parameters
----------
input : ndarray
The input array.
zoom : float or sequence, optional
... | [
"def",
"zoom",
"(",
"input",
",",
"zoom",
",",
"output",
"=",
"None",
",",
"order",
"=",
"3",
",",
"mode",
"=",
"'constant'",
",",
"cval",
"=",
"0.0",
",",
"prefilter",
"=",
"True",
")",
":",
"if",
"order",
"<",
"0",
"or",
"order",
">",
"5",
":... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/ndimage/interpolation.py#L506-L582 | |
mickem/nscp | 79f89fdbb6da63f91bc9dedb7aea202fe938f237 | scripts/python/lib/google/protobuf/internal/python_message.py | python | _AddPropertiesForFields | (descriptor, cls) | Adds properties for all fields in this protocol message type. | Adds properties for all fields in this protocol message type. | [
"Adds",
"properties",
"for",
"all",
"fields",
"in",
"this",
"protocol",
"message",
"type",
"."
] | def _AddPropertiesForFields(descriptor, cls):
"""Adds properties for all fields in this protocol message type."""
for field in descriptor.fields:
_AddPropertiesForField(field, cls)
if descriptor.is_extendable:
# _ExtensionDict is just an adaptor with no state so we allocate a new one
# every time it ... | [
"def",
"_AddPropertiesForFields",
"(",
"descriptor",
",",
"cls",
")",
":",
"for",
"field",
"in",
"descriptor",
".",
"fields",
":",
"_AddPropertiesForField",
"(",
"field",
",",
"cls",
")",
"if",
"descriptor",
".",
"is_extendable",
":",
"# _ExtensionDict is just an ... | https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/python_message.py#L333-L341 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/xcodeproj_file.py | python | XCObject.Comment | (self) | return self.Name() | Return a comment string for the object.
Most objects just use their name as the comment, but PBXProject uses
different values.
The returned comment is not escaped and does not have any comment marker
strings applied to it. | Return a comment string for the object. | [
"Return",
"a",
"comment",
"string",
"for",
"the",
"object",
"."
] | def Comment(self):
"""Return a comment string for the object.
Most objects just use their name as the comment, but PBXProject uses
different values.
The returned comment is not escaped and does not have any comment marker
strings applied to it.
"""
return self.Name() | [
"def",
"Comment",
"(",
"self",
")",
":",
"return",
"self",
".",
"Name",
"(",
")"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/xcodeproj_file.py#L371-L381 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/bccache.py | python | BytecodeCache.load_bytecode | (self, bucket) | Subclasses have to override this method to load bytecode into a
bucket. If they are not able to find code in the cache for the
bucket, it must not do anything. | Subclasses have to override this method to load bytecode into a
bucket. If they are not able to find code in the cache for the
bucket, it must not do anything. | [
"Subclasses",
"have",
"to",
"override",
"this",
"method",
"to",
"load",
"bytecode",
"into",
"a",
"bucket",
".",
"If",
"they",
"are",
"not",
"able",
"to",
"find",
"code",
"in",
"the",
"cache",
"for",
"the",
"bucket",
"it",
"must",
"not",
"do",
"anything",... | def load_bytecode(self, bucket):
"""Subclasses have to override this method to load bytecode into a
bucket. If they are not able to find code in the cache for the
bucket, it must not do anything.
"""
raise NotImplementedError() | [
"def",
"load_bytecode",
"(",
"self",
",",
"bucket",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/bccache.py#L146-L151 | ||
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/assembly_graph.py | python | AssemblyGraph.get_path_availability | (self, path) | Given a path, this function returns the fraction that is available. A segment is considered
fully available it has a depth of above 0.5. Below that, availability drops towards 0. A
single segment can have negative availability (if it has negative depth), but this function
will only return a numb... | Given a path, this function returns the fraction that is available. A segment is considered
fully available it has a depth of above 0.5. Below that, availability drops towards 0. A
single segment can have negative availability (if it has negative depth), but this function
will only return a numb... | [
"Given",
"a",
"path",
"this",
"function",
"returns",
"the",
"fraction",
"that",
"is",
"available",
".",
"A",
"segment",
"is",
"considered",
"fully",
"available",
"it",
"has",
"a",
"depth",
"of",
"above",
"0",
".",
"5",
".",
"Below",
"that",
"availability",... | def get_path_availability(self, path):
"""
Given a path, this function returns the fraction that is available. A segment is considered
fully available it has a depth of above 0.5. Below that, availability drops towards 0. A
single segment can have negative availability (if it has negativ... | [
"def",
"get_path_availability",
"(",
"self",
",",
"path",
")",
":",
"total_bases",
"=",
"0",
"available_bases",
"=",
"0.0",
"for",
"seg_num",
"in",
"path",
":",
"seg",
"=",
"self",
".",
"segments",
"[",
"abs",
"(",
"seg_num",
")",
"]",
"if",
"seg",
"."... | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph.py#L1885-L1906 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/base_events.py | python | BaseEventLoop.call_later | (self, delay, callback, *args, context=None) | return timer | Arrange for a callback to be called at a given time.
Return a Handle: an opaque object with a cancel() method that
can be used to cancel the call.
The delay can be an int or float, expressed in seconds. It is
always relative to the current time.
Each callback will be called e... | Arrange for a callback to be called at a given time. | [
"Arrange",
"for",
"a",
"callback",
"to",
"be",
"called",
"at",
"a",
"given",
"time",
"."
] | def call_later(self, delay, callback, *args, context=None):
"""Arrange for a callback to be called at a given time.
Return a Handle: an opaque object with a cancel() method that
can be used to cancel the call.
The delay can be an int or float, expressed in seconds. It is
alway... | [
"def",
"call_later",
"(",
"self",
",",
"delay",
",",
"callback",
",",
"*",
"args",
",",
"context",
"=",
"None",
")",
":",
"timer",
"=",
"self",
".",
"call_at",
"(",
"self",
".",
"time",
"(",
")",
"+",
"delay",
",",
"callback",
",",
"*",
"args",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/base_events.py#L643-L663 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/program_members/uniform.py | python | Uniform.read | (self) | return self.mglo.data | Read the value of the uniform. | Read the value of the uniform. | [
"Read",
"the",
"value",
"of",
"the",
"uniform",
"."
] | def read(self) -> bytes:
'''
Read the value of the uniform.
'''
return self.mglo.data | [
"def",
"read",
"(",
"self",
")",
"->",
"bytes",
":",
"return",
"self",
".",
"mglo",
".",
"data"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/program_members/uniform.py#L169-L174 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextParagraphLayoutBox.ClearListStyle | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_ClearListStyle(*args, **kwargs) | ClearListStyle(self, RichTextRange range, int flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool | ClearListStyle(self, RichTextRange range, int flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool | [
"ClearListStyle",
"(",
"self",
"RichTextRange",
"range",
"int",
"flags",
"=",
"RICHTEXT_SETSTYLE_WITH_UNDO",
")",
"-",
">",
"bool"
] | def ClearListStyle(*args, **kwargs):
"""ClearListStyle(self, RichTextRange range, int flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool"""
return _richtext.RichTextParagraphLayoutBox_ClearListStyle(*args, **kwargs) | [
"def",
"ClearListStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_ClearListStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1765-L1767 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib2to3/pgen2/tokenize.py | python | untokenize | (iterable) | return ut.untokenize(iterable) | Transform tokens back into Python source code.
Each element returned by the iterable must be a token sequence
with at least two elements, a token number and token value. If
only two tokens are passed, the resulting output is poor.
Round-trip invariant for full input:
Untokenized source will m... | Transform tokens back into Python source code. | [
"Transform",
"tokens",
"back",
"into",
"Python",
"source",
"code",
"."
] | def untokenize(iterable):
"""Transform tokens back into Python source code.
Each element returned by the iterable must be a token sequence
with at least two elements, a token number and token value. If
only two tokens are passed, the resulting output is poor.
Round-trip invariant for full input:
... | [
"def",
"untokenize",
"(",
"iterable",
")",
":",
"ut",
"=",
"Untokenizer",
"(",
")",
"return",
"ut",
".",
"untokenize",
"(",
"iterable",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/pgen2/tokenize.py#L326-L345 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/pycc/cc.py | python | CC.export | (self, exported_name, sig) | return decorator | Mark a function for exporting in the extension module. | Mark a function for exporting in the extension module. | [
"Mark",
"a",
"function",
"for",
"exporting",
"in",
"the",
"extension",
"module",
"."
] | def export(self, exported_name, sig):
"""
Mark a function for exporting in the extension module.
"""
fn_args, fn_retty = sigutils.normalize_signature(sig)
sig = typing.signature(fn_retty, *fn_args)
if exported_name in self._exported_functions:
raise KeyError("... | [
"def",
"export",
"(",
"self",
",",
"exported_name",
",",
"sig",
")",
":",
"fn_args",
",",
"fn_retty",
"=",
"sigutils",
".",
"normalize_signature",
"(",
"sig",
")",
"sig",
"=",
"typing",
".",
"signature",
"(",
"fn_retty",
",",
"*",
"fn_args",
")",
"if",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/pycc/cc.py#L134-L148 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimum-knight-moves.py | python | Solution2.minKnightMoves | (self, x, y) | return dp(x, y) | :type x: int
:type y: int
:rtype: int | :type x: int
:type y: int
:rtype: int | [
":",
"type",
"x",
":",
"int",
":",
"type",
"y",
":",
"int",
":",
"rtype",
":",
"int"
] | def minKnightMoves(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
def dp(x, y):
x, y = abs(x), abs(y)
if x < y:
x, y = y, x
if (x, y) not in self.__lookup: # greedy, smaller x, y is always better if not spec... | [
"def",
"minKnightMoves",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"def",
"dp",
"(",
"x",
",",
"y",
")",
":",
"x",
",",
"y",
"=",
"abs",
"(",
"x",
")",
",",
"abs",
"(",
"y",
")",
"if",
"x",
"<",
"y",
":",
"x",
",",
"y",
"=",
"y",
","... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-knight-moves.py#L55-L68 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/distributed/DoCollectionManager.py | python | DoCollectionManager.doFindAll | (self, str) | return matches | Returns list of distributed objects with matching str in value. | Returns list of distributed objects with matching str in value. | [
"Returns",
"list",
"of",
"distributed",
"objects",
"with",
"matching",
"str",
"in",
"value",
"."
] | def doFindAll(self, str):
"""
Returns list of distributed objects with matching str in value.
"""
matches = []
for value in self.doId2do.values():
if repr(value).find(str) >= 0:
matches.append(value)
return matches | [
"def",
"doFindAll",
"(",
"self",
",",
"str",
")",
":",
"matches",
"=",
"[",
"]",
"for",
"value",
"in",
"self",
".",
"doId2do",
".",
"values",
"(",
")",
":",
"if",
"repr",
"(",
"value",
")",
".",
"find",
"(",
"str",
")",
">=",
"0",
":",
"matches... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/DoCollectionManager.py#L64-L72 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/postgis/plugin.py | python | PGRasterTable.uri | (self, uri=None) | return uri | Returns the datasource URI for postgresraster provider | Returns the datasource URI for postgresraster provider | [
"Returns",
"the",
"datasource",
"URI",
"for",
"postgresraster",
"provider"
] | def uri(self, uri=None):
"""Returns the datasource URI for postgresraster provider"""
if not uri:
uri = self.database().uri()
service = (u'service=\'%s\'' % uri.service()) if uri.service() else ''
dbname = (u'dbname=\'%s\'' % uri.database()) if uri.database() else ''
... | [
"def",
"uri",
"(",
"self",
",",
"uri",
"=",
"None",
")",
":",
"if",
"not",
"uri",
":",
"uri",
"=",
"self",
".",
"database",
"(",
")",
".",
"uri",
"(",
")",
"service",
"=",
"(",
"u'service=\\'%s\\''",
"%",
"uri",
".",
"service",
"(",
")",
")",
"... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/postgis/plugin.py#L343-L375 | |
zetavm/zetavm | 61af9cd317fa5629f570b30b61ea8c7ffc375e59 | espresso/e_parser.py | python | parse_atom | (input_handler) | Parsing an atomic expression | Parsing an atomic expression | [
"Parsing",
"an",
"atomic",
"expression"
] | def parse_atom(input_handler):
"""Parsing an atomic expression"""
input_handler.eat_ws()
if input_handler.peek_ch().isdigit():
return parse_num(input_handler)
if input_handler.match('"'):
return parse_string_literal(input_handler, '"')
if input_handler.match("'"):
return pars... | [
"def",
"parse_atom",
"(",
"input_handler",
")",
":",
"input_handler",
".",
"eat_ws",
"(",
")",
"if",
"input_handler",
".",
"peek_ch",
"(",
")",
".",
"isdigit",
"(",
")",
":",
"return",
"parse_num",
"(",
"input_handler",
")",
"if",
"input_handler",
".",
"ma... | https://github.com/zetavm/zetavm/blob/61af9cd317fa5629f570b30b61ea8c7ffc375e59/espresso/e_parser.py#L207-L237 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/virtualenv/files/virtualenv.py | python | install_python | (home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear) | return py_executable | Install just the base environment, no distutils patches etc | Install just the base environment, no distutils patches etc | [
"Install",
"just",
"the",
"base",
"environment",
"no",
"distutils",
"patches",
"etc"
] | def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
"""Install just the base environment, no distutils patches etc"""
if sys.executable.startswith(bin_dir):
print('Please use the *system* python to run this script')
return
if clear:
rmtree(lib_dir)
... | [
"def",
"install_python",
"(",
"home_dir",
",",
"lib_dir",
",",
"inc_dir",
",",
"bin_dir",
",",
"site_packages",
",",
"clear",
")",
":",
"if",
"sys",
".",
"executable",
".",
"startswith",
"(",
"bin_dir",
")",
":",
"print",
"(",
"'Please use the *system* python ... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/virtualenv/files/virtualenv.py#L981-L1214 | |
kevinlin311tw/Caffe-DeepBinaryCode | 9eaa7662be47d49f475ecbeea2bd51be105270d2 | scripts/cpp_lint.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] = '// dummy' | [
"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/kevinlin311tw/Caffe-DeepBinaryCode/blob/9eaa7662be47d49f475ecbeea2bd51be105270d2/scripts/cpp_lint.py#L1143-L1148 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/io/matlab/mio4.py | python | MatFile4Reader.list_variables | (self) | return vars | list variables from stream | list variables from stream | [
"list",
"variables",
"from",
"stream"
] | def list_variables(self):
''' list variables from stream '''
self.mat_stream.seek(0)
# set up variable reader
self.initialize_read()
vars = []
while not self.end_of_stream():
hdr, next_position = self.read_var_header()
name = asstr(hdr.name)
... | [
"def",
"list_variables",
"(",
"self",
")",
":",
"self",
".",
"mat_stream",
".",
"seek",
"(",
"0",
")",
"# set up variable reader",
"self",
".",
"initialize_read",
"(",
")",
"vars",
"=",
"[",
"]",
"while",
"not",
"self",
".",
"end_of_stream",
"(",
")",
":... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/io/matlab/mio4.py#L408-L422 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/distributions/util.py | python | pad | (x, axis, front=False, back=False, value=0, count=1, name=None) | Pads `value` to the front and/or back of a `Tensor` dim, `count` times.
Args:
x: `Tensor` input.
axis: Scalar `int`-like `Tensor` representing the single dimension to pad.
(Negative indexing is supported.)
front: Python `bool`; if `True` the beginning of the `axis` dimension is
padded with `v... | Pads `value` to the front and/or back of a `Tensor` dim, `count` times. | [
"Pads",
"value",
"to",
"the",
"front",
"and",
"/",
"or",
"back",
"of",
"a",
"Tensor",
"dim",
"count",
"times",
"."
] | def pad(x, axis, front=False, back=False, value=0, count=1, name=None):
"""Pads `value` to the front and/or back of a `Tensor` dim, `count` times.
Args:
x: `Tensor` input.
axis: Scalar `int`-like `Tensor` representing the single dimension to pad.
(Negative indexing is supported.)
front: Python `b... | [
"def",
"pad",
"(",
"x",
",",
"axis",
",",
"front",
"=",
"False",
",",
"back",
"=",
"False",
",",
"value",
"=",
"0",
",",
"count",
"=",
"1",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"pad\"",
",",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/distributions/util.py#L1280-L1348 | ||
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/recognizers.py | python | BaseRecognizer._getRuleInvocationStack | (cls, module) | return rules | A more general version of getRuleInvocationStack where you can
pass in, for example, a RecognitionException to get it's rule
stack trace. This routine is shared with all recognizers, hence,
static.
TODO: move to a utility class or something; weird having lexer call
this | A more general version of getRuleInvocationStack where you can
pass in, for example, a RecognitionException to get it's rule
stack trace. This routine is shared with all recognizers, hence,
static. | [
"A",
"more",
"general",
"version",
"of",
"getRuleInvocationStack",
"where",
"you",
"can",
"pass",
"in",
"for",
"example",
"a",
"RecognitionException",
"to",
"get",
"it",
"s",
"rule",
"stack",
"trace",
".",
"This",
"routine",
"is",
"shared",
"with",
"all",
"r... | def _getRuleInvocationStack(cls, module):
"""
A more general version of getRuleInvocationStack where you can
pass in, for example, a RecognitionException to get it's rule
stack trace. This routine is shared with all recognizers, hence,
static.
TODO: move to a utility cl... | [
"def",
"_getRuleInvocationStack",
"(",
"cls",
",",
"module",
")",
":",
"# mmmhhh,... perhaps look at the first argument",
"# (f_locals[co_varnames[0]]?) and test if it's a (sub)class of",
"# requested recognizer...",
"rules",
"=",
"[",
"]",
"for",
"frame",
"in",
"reversed",
"("... | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/recognizers.py#L886-L918 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/slim/quantization/cal_kl_threshold.py | python | expand_quantized_bins | (quantized_bins, reference_bins) | return expanded_quantized_bins | Expand hist bins. | Expand hist bins. | [
"Expand",
"hist",
"bins",
"."
] | def expand_quantized_bins(quantized_bins, reference_bins):
'''
Expand hist bins.
'''
expanded_quantized_bins = [0] * len(reference_bins)
num_merged_bins = int(len(reference_bins) / len(quantized_bins))
j_start = 0
j_end = num_merged_bins
for idx in range(len(quantized_bins)):
zer... | [
"def",
"expand_quantized_bins",
"(",
"quantized_bins",
",",
"reference_bins",
")",
":",
"expanded_quantized_bins",
"=",
"[",
"0",
"]",
"*",
"len",
"(",
"reference_bins",
")",
"num_merged_bins",
"=",
"int",
"(",
"len",
"(",
"reference_bins",
")",
"/",
"len",
"(... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/slim/quantization/cal_kl_threshold.py#L26-L49 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/branch_spec.py | python | spec_force_individual_build_directory | (ctx, spec_name = None, platform = None, configuration = None) | return force_individual_build_directory[0].lower() == "true" | Return true if the current platform|configuration should use it's own temporary build directory | Return true if the current platform|configuration should use it's own temporary build directory | [
"Return",
"true",
"if",
"the",
"current",
"platform|configuration",
"should",
"use",
"it",
"s",
"own",
"temporary",
"build",
"directory"
] | def spec_force_individual_build_directory(ctx, spec_name = None, platform = None, configuration = None):
""" Return true if the current platform|configuration should use it's own temporary build directory """
force_individual_build_directory = _spec_entry_as_single_list(ctx, 'force_individual_build_directory', spec_n... | [
"def",
"spec_force_individual_build_directory",
"(",
"ctx",
",",
"spec_name",
"=",
"None",
",",
"platform",
"=",
"None",
",",
"configuration",
"=",
"None",
")",
":",
"force_individual_build_directory",
"=",
"_spec_entry_as_single_list",
"(",
"ctx",
",",
"'force_indivi... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/branch_spec.py#L305-L313 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py | python | LoadVesuvio._set_spectra_type | (self, spectrum_no) | Set whether this spectrum no is forward/backward scattering
and set the normalization range appropriately
@param spectrum_no The current spectrum no | Set whether this spectrum no is forward/backward scattering
and set the normalization range appropriately | [
"Set",
"whether",
"this",
"spectrum",
"no",
"is",
"forward",
"/",
"backward",
"scattering",
"and",
"set",
"the",
"normalization",
"range",
"appropriately"
] | def _set_spectra_type(self, spectrum_no):
"""
Set whether this spectrum no is forward/backward scattering
and set the normalization range appropriately
@param spectrum_no The current spectrum no
"""
if self._is_back_scattering(spectrum_no):
self._spectra_type=... | [
"def",
"_set_spectra_type",
"(",
"self",
",",
"spectrum_no",
")",
":",
"if",
"self",
".",
"_is_back_scattering",
"(",
"spectrum_no",
")",
":",
"self",
".",
"_spectra_type",
"=",
"BACKWARD",
"self",
".",
"_mon_norm_start",
",",
"self",
".",
"_mon_norm_end",
"="... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py#L669-L686 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/SanitizationLambda/sanitization_lambda.py | python | Sanitizer.__validate_file | (self, key, file_path) | Validates plain text files like logs. | Validates plain text files like logs. | [
"Validates",
"plain",
"text",
"files",
"like",
"logs",
"."
] | def __validate_file(self, key, file_path):
''' Validates plain text files like logs. '''
if self.__validate_file_size(file_path):
return True
else:
self.rejected_files.append(FileStatus(key, False, "Invalid file size.", ''))
return False | [
"def",
"__validate_file",
"(",
"self",
",",
"key",
",",
"file_path",
")",
":",
"if",
"self",
".",
"__validate_file_size",
"(",
"file_path",
")",
":",
"return",
"True",
"else",
":",
"self",
".",
"rejected_files",
".",
"append",
"(",
"FileStatus",
"(",
"key"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/lambda-code/SanitizationLambda/sanitization_lambda.py#L252-L259 | ||
qt/qt | 0a2f2382541424726168804be2c90b91381608c6 | src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/MSVSProject.py | python | Writer.AddConfig | (self, name, attrs=None, tools=None) | Adds a configuration to the project.
Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None. | Adds a configuration to the project. | [
"Adds",
"a",
"configuration",
"to",
"the",
"project",
"."
] | def AddConfig(self, name, attrs=None, tools=None):
"""Adds a configuration to the project.
Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
"""
self._AddConfigToNode(self.n_configs, 'Conf... | [
"def",
"AddConfig",
"(",
"self",
",",
"name",
",",
"attrs",
"=",
"None",
",",
"tools",
"=",
"None",
")",
":",
"self",
".",
"_AddConfigToNode",
"(",
"self",
".",
"n_configs",
",",
"'Configuration'",
",",
"name",
",",
"attrs",
",",
"tools",
")"
] | https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/MSVSProject.py#L173-L181 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WriteTarget | (self, spec, configs, deps, link_deps, bundle_deps,
extra_outputs, part_of_all) | Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
extra_outputs: any extra outputs that our target should depend on
part_of_all: flag indicating this target is part of 'all' | Write Makefile code to produce the final target of the gyp spec. | [
"Write",
"Makefile",
"code",
"to",
"produce",
"the",
"final",
"target",
"of",
"the",
"gyp",
"spec",
"."
] | def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
extra_outputs, part_of_all):
"""Write Makefile code to produce the final target of the gyp spec.
spec, configs: input from gyp.
deps, link_deps: dependency lists; see ComputeDeps()
extra_outputs: any extra outputs that... | [
"def",
"WriteTarget",
"(",
"self",
",",
"spec",
",",
"configs",
",",
"deps",
",",
"link_deps",
",",
"bundle_deps",
",",
"extra_outputs",
",",
"part_of_all",
")",
":",
"self",
".",
"WriteLn",
"(",
"'### Rules for final target.'",
")",
"if",
"extra_outputs",
":"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L1458-L1691 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/multiprocessing/util.py | python | close_fds | (*fds) | Close each file descriptor given as an argument | Close each file descriptor given as an argument | [
"Close",
"each",
"file",
"descriptor",
"given",
"as",
"an",
"argument"
] | def close_fds(*fds):
"""Close each file descriptor given as an argument"""
for fd in fds:
os.close(fd) | [
"def",
"close_fds",
"(",
"*",
"fds",
")",
":",
"for",
"fd",
"in",
"fds",
":",
"os",
".",
"close",
"(",
"fd",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/util.py#L476-L479 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlTextReader.ReadOuterXml | (self) | return ret | Reads the contents of the current node, including child
nodes and markup. | Reads the contents of the current node, including child
nodes and markup. | [
"Reads",
"the",
"contents",
"of",
"the",
"current",
"node",
"including",
"child",
"nodes",
"and",
"markup",
"."
] | def ReadOuterXml(self):
"""Reads the contents of the current node, including child
nodes and markup. """
ret = libxml2mod.xmlTextReaderReadOuterXml(self._o)
return ret | [
"def",
"ReadOuterXml",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderReadOuterXml",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L6844-L6848 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/chardet/cli/chardetect.py | python | description_of | (lines, name='stdin') | Return a string describing the probable encoding of a file or
list of strings.
:param lines: The lines to get the encoding of.
:type lines: Iterable of bytes
:param name: Name of file or collection of lines
:type name: str | Return a string describing the probable encoding of a file or
list of strings. | [
"Return",
"a",
"string",
"describing",
"the",
"probable",
"encoding",
"of",
"a",
"file",
"or",
"list",
"of",
"strings",
"."
] | def description_of(lines, name='stdin'):
"""
Return a string describing the probable encoding of a file or
list of strings.
:param lines: The lines to get the encoding of.
:type lines: Iterable of bytes
:param name: Name of file or collection of lines
:type name: str
"""
u = Univers... | [
"def",
"description_of",
"(",
"lines",
",",
"name",
"=",
"'stdin'",
")",
":",
"u",
"=",
"UniversalDetector",
"(",
")",
"for",
"line",
"in",
"lines",
":",
"line",
"=",
"bytearray",
"(",
"line",
")",
"u",
".",
"feed",
"(",
"line",
")",
"# shortcut out of... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/chardet/cli/chardetect.py#L26-L51 | ||
dmlc/treelite | df56babb6a4a2d7c29d719c28ce53acfa7dbab3c | runtime/python/treelite_runtime/libpath.py | python | find_lib_path | () | return lib_path | Find the path to Treelite runtime library files.
Returns
-------
lib_path: :py:class:`list <python:list>` of :py:class:`str <python:str>`
List of all found library path to Treelite | Find the path to Treelite runtime library files. | [
"Find",
"the",
"path",
"to",
"Treelite",
"runtime",
"library",
"files",
"."
] | def find_lib_path():
"""Find the path to Treelite runtime library files.
Returns
-------
lib_path: :py:class:`list <python:list>` of :py:class:`str <python:str>`
List of all found library path to Treelite
"""
if sys.platform == 'win32':
lib_name = f'treelite_runtime.dll'
elif... | [
"def",
"find_lib_path",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"lib_name",
"=",
"f'treelite_runtime.dll'",
"elif",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
":",
"lib_name",
"=",
"f'libtreelite_runtime.so'",
"e... | https://github.com/dmlc/treelite/blob/df56babb6a4a2d7c29d719c28ce53acfa7dbab3c/runtime/python/treelite_runtime/libpath.py#L13-L57 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/descriptor_pool.py | python | DescriptorPool.FindFileByName | (self, file_name) | return self._ConvertFileProtoToFileDescriptor(file_proto) | Gets a FileDescriptor by file name.
Args:
file_name (str): The path to the file to get a descriptor for.
Returns:
FileDescriptor: The descriptor for the named file.
Raises:
KeyError: if the file cannot be found in the pool. | Gets a FileDescriptor by file name. | [
"Gets",
"a",
"FileDescriptor",
"by",
"file",
"name",
"."
] | def FindFileByName(self, file_name):
"""Gets a FileDescriptor by file name.
Args:
file_name (str): The path to the file to get a descriptor for.
Returns:
FileDescriptor: The descriptor for the named file.
Raises:
KeyError: if the file cannot be found in the pool.
"""
try:
... | [
"def",
"FindFileByName",
"(",
"self",
",",
"file_name",
")",
":",
"try",
":",
"return",
"self",
".",
"_file_descriptors",
"[",
"file_name",
"]",
"except",
"KeyError",
":",
"pass",
"try",
":",
"file_proto",
"=",
"self",
".",
"_internal_db",
".",
"FindFileByNa... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/descriptor_pool.py#L391-L418 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/level_trend.py | python | AdderStateSpaceModel.transition_power_noise_accumulator | (self, num_steps) | return _pack_and_reshape(
num_steps * a + sum_of_first_n * (b + c) + sum_of_first_n_squares * d,
num_steps * b + sum_of_first_n * d,
num_steps * c + sum_of_first_n * d,
num_steps * d) | Computes power sums in closed form. | Computes power sums in closed form. | [
"Computes",
"power",
"sums",
"in",
"closed",
"form",
"."
] | def transition_power_noise_accumulator(self, num_steps):
"""Computes power sums in closed form."""
def _pack_and_reshape(*values):
return array_ops.reshape(
array_ops.stack(axis=1, values=values),
array_ops.concat(values=[array_ops.shape(num_steps), [2, 2]], axis=0))
num_steps = m... | [
"def",
"transition_power_noise_accumulator",
"(",
"self",
",",
"num_steps",
")",
":",
"def",
"_pack_and_reshape",
"(",
"*",
"values",
")",
":",
"return",
"array_ops",
".",
"reshape",
"(",
"array_ops",
".",
"stack",
"(",
"axis",
"=",
"1",
",",
"values",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/state_space_models/level_trend.py#L93-L120 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/nn_ops.py | python | KLDivLoss.__init__ | (self, reduction='mean') | Initialize KLDivLoss. | Initialize KLDivLoss. | [
"Initialize",
"KLDivLoss",
"."
] | def __init__(self, reduction='mean'):
"""Initialize KLDivLoss."""
self.reduction = validator.check_string(reduction, ['none', 'mean', 'sum'], 'reduction', self.name) | [
"def",
"__init__",
"(",
"self",
",",
"reduction",
"=",
"'mean'",
")",
":",
"self",
".",
"reduction",
"=",
"validator",
".",
"check_string",
"(",
"reduction",
",",
"[",
"'none'",
",",
"'mean'",
",",
"'sum'",
"]",
",",
"'reduction'",
",",
"self",
".",
"n... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/nn_ops.py#L5138-L5140 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py | python | WildcardPattern._bare_name_matches | (self, nodes) | return count, r | Special optimized matcher for bare_name. | Special optimized matcher for bare_name. | [
"Special",
"optimized",
"matcher",
"for",
"bare_name",
"."
] | def _bare_name_matches(self, nodes):
"""Special optimized matcher for bare_name."""
count = 0
r = {}
done = False
max = len(nodes)
while not done and count < max:
done = True
for leaf in self.content:
if leaf[0].match(nodes[count], ... | [
"def",
"_bare_name_matches",
"(",
"self",
",",
"nodes",
")",
":",
"count",
"=",
"0",
"r",
"=",
"{",
"}",
"done",
"=",
"False",
"max",
"=",
"len",
"(",
"nodes",
")",
"while",
"not",
"done",
"and",
"count",
"<",
"max",
":",
"done",
"=",
"True",
"fo... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py#L762-L776 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/CommandBody.py | python | CommandBody.accept | (self, visitor) | The operation in Visitor design pattern that takes a visitor as an argument
and calls the visitor's method that corresponds to this element.
@raise Exception: if the given visitor is not a subclass of AbstractVisitor | The operation in Visitor design pattern that takes a visitor as an argument
and calls the visitor's method that corresponds to this element. | [
"The",
"operation",
"in",
"Visitor",
"design",
"pattern",
"that",
"takes",
"a",
"visitor",
"as",
"an",
"argument",
"and",
"calls",
"the",
"visitor",
"s",
"method",
"that",
"corresponds",
"to",
"this",
"element",
"."
] | def accept(self, visitor):
"""
The operation in Visitor design pattern that takes a visitor as an argument
and calls the visitor's method that corresponds to this element.
@raise Exception: if the given visitor is not a subclass of AbstractVisitor
"""
# visitor should be ... | [
"def",
"accept",
"(",
"self",
",",
"visitor",
")",
":",
"# visitor should be extended from the AbstractVisitor class",
"if",
"issubclass",
"(",
"visitor",
".",
"__class__",
",",
"AbstractVisitor",
".",
"AbstractVisitor",
")",
":",
"visitor",
".",
"commandBodyVisit",
"... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/CommandBody.py#L69-L84 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings._GetStandaloneBinaryPath | (self) | return target_prefix + target + target_ext | Returns the name of the non-bundle binary represented by this target.
E.g. hello_world. Only valid for non-bundles. | Returns the name of the non-bundle binary represented by this target.
E.g. hello_world. Only valid for non-bundles. | [
"Returns",
"the",
"name",
"of",
"the",
"non",
"-",
"bundle",
"binary",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"hello_world",
".",
"Only",
"valid",
"for",
"non",
"-",
"bundles",
"."
] | def _GetStandaloneBinaryPath(self):
"""Returns the name of the non-bundle binary represented by this target.
E.g. hello_world. Only valid for non-bundles."""
assert not self._IsBundle()
assert self.spec['type'] in (
'executable', 'shared_library', 'static_library', 'loadable_module'), (
... | [
"def",
"_GetStandaloneBinaryPath",
"(",
"self",
")",
":",
"assert",
"not",
"self",
".",
"_IsBundle",
"(",
")",
"assert",
"self",
".",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'executable'",
",",
"'shared_library'",
",",
"'static_library'",
",",
"'loadable_modul... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L384-L402 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/distributions/bijector_impl.py | python | Bijector._lookup | (self, x=None, y=None, kwargs=None) | return mapping | Helper which retrieves mapping info from forward/inverse dicts. | Helper which retrieves mapping info from forward/inverse dicts. | [
"Helper",
"which",
"retrieves",
"mapping",
"info",
"from",
"forward",
"/",
"inverse",
"dicts",
"."
] | def _lookup(self, x=None, y=None, kwargs=None):
"""Helper which retrieves mapping info from forward/inverse dicts."""
mapping = _Mapping(x=x, y=y, kwargs=kwargs)
# Since _cache requires both x,y to be set, we only need to do one cache
# lookup since the mapping is always in both or neither.
if mappi... | [
"def",
"_lookup",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"mapping",
"=",
"_Mapping",
"(",
"x",
"=",
"x",
",",
"y",
"=",
"y",
",",
"kwargs",
"=",
"kwargs",
")",
"# Since _cache requires both ... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/distributions/bijector_impl.py#L1019-L1028 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/ma/mrecords.py | python | fromtextfile | (fname, delimitor=None, commentchar='#', missingchar='',
varnames=None, vartypes=None) | return fromarrays(_datalist, dtype=mdescr) | Creates a mrecarray from data stored in the file `filename`.
Parameters
----------
fname : {file name/handle}
Handle of an opened file.
delimitor : {None, string}, optional
Alphanumeric character used to separate columns in the file.
If None, any (group of) white spacestring(s) ... | Creates a mrecarray from data stored in the file `filename`. | [
"Creates",
"a",
"mrecarray",
"from",
"data",
"stored",
"in",
"the",
"file",
"filename",
"."
] | def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='',
varnames=None, vartypes=None):
"""
Creates a mrecarray from data stored in the file `filename`.
Parameters
----------
fname : {file name/handle}
Handle of an opened file.
delimitor : {None, string}... | [
"def",
"fromtextfile",
"(",
"fname",
",",
"delimitor",
"=",
"None",
",",
"commentchar",
"=",
"'#'",
",",
"missingchar",
"=",
"''",
",",
"varnames",
"=",
"None",
",",
"vartypes",
"=",
"None",
")",
":",
"# Try to open the file.",
"ftext",
"=",
"openfile",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/mrecords.py#L672-L737 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/pipeline/sync/skip/skippable.py | python | Skippable.poppable | (self) | Iterates over namespaced skip names to be popped. | Iterates over namespaced skip names to be popped. | [
"Iterates",
"over",
"namespaced",
"skip",
"names",
"to",
"be",
"popped",
"."
] | def poppable(self) -> Iterable[Tuple[Namespace, str]]:
"""Iterates over namespaced skip names to be popped."""
for name in self.poppable_names:
yield self.namespaced(name) | [
"def",
"poppable",
"(",
"self",
")",
"->",
"Iterable",
"[",
"Tuple",
"[",
"Namespace",
",",
"str",
"]",
"]",
":",
"for",
"name",
"in",
"self",
".",
"poppable_names",
":",
"yield",
"self",
".",
"namespaced",
"(",
"name",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/skip/skippable.py#L83-L86 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py | python | SSLProtocol.resume_writing | (self) | Called when the low-level transport's buffer drains below
the low-water mark. | Called when the low-level transport's buffer drains below
the low-water mark. | [
"Called",
"when",
"the",
"low",
"-",
"level",
"transport",
"s",
"buffer",
"drains",
"below",
"the",
"low",
"-",
"water",
"mark",
"."
] | def resume_writing(self):
"""Called when the low-level transport's buffer drains below
the low-water mark.
"""
self._app_protocol.resume_writing() | [
"def",
"resume_writing",
"(",
"self",
")",
":",
"self",
".",
"_app_protocol",
".",
"resume_writing",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/sslproto.py#L514-L518 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | Blocker.blocked | (self) | return self._count > 0 | Returns True if in the 'blocked' state, and False otherwise. | Returns True if in the 'blocked' state, and False otherwise. | [
"Returns",
"True",
"if",
"in",
"the",
"blocked",
"state",
"and",
"False",
"otherwise",
"."
] | def blocked(self):
"""Returns True if in the 'blocked' state, and False otherwise."""
return self._count > 0 | [
"def",
"blocked",
"(",
"self",
")",
":",
"return",
"self",
".",
"_count",
">",
"0"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L67-L70 | |
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/nest/lib/hl_api_connections.py | python | Connect | (pre, post, conn_spec=None, syn_spec=None,
return_synapsecollection=False) | Connect `pre` nodes to `post` nodes.
Nodes in `pre` and `post` are connected using the specified connectivity
(`all-to-all` by default) and synapse type (:cpp:class:`static_synapse <nest::static_synapse>` by default).
Details depend on the connectivity rule.
Parameters
----------
pre : NodeCol... | Connect `pre` nodes to `post` nodes. | [
"Connect",
"pre",
"nodes",
"to",
"post",
"nodes",
"."
] | def Connect(pre, post, conn_spec=None, syn_spec=None,
return_synapsecollection=False):
"""
Connect `pre` nodes to `post` nodes.
Nodes in `pre` and `post` are connected using the specified connectivity
(`all-to-all` by default) and synapse type (:cpp:class:`static_synapse <nest::static_synap... | [
"def",
"Connect",
"(",
"pre",
",",
"post",
",",
"conn_spec",
"=",
"None",
",",
"syn_spec",
"=",
"None",
",",
"return_synapsecollection",
"=",
"False",
")",
":",
"use_connect_arrays",
",",
"pre",
",",
"post",
"=",
"_process_input_nodes",
"(",
"pre",
",",
"p... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_connections.py#L116-L287 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/sql.py | python | SQLTable._query_iterator | (
self, result, chunksize, columns, coerce_float=True, parse_dates=None
) | Return generator through chunked result set. | Return generator through chunked result set. | [
"Return",
"generator",
"through",
"chunked",
"result",
"set",
"."
] | def _query_iterator(
self, result, chunksize, columns, coerce_float=True, parse_dates=None
):
"""Return generator through chunked result set."""
while True:
data = result.fetchmany(chunksize)
if not data:
break
else:
self.f... | [
"def",
"_query_iterator",
"(",
"self",
",",
"result",
",",
"chunksize",
",",
"columns",
",",
"coerce_float",
"=",
"True",
",",
"parse_dates",
"=",
"None",
")",
":",
"while",
"True",
":",
"data",
"=",
"result",
".",
"fetchmany",
"(",
"chunksize",
")",
"if... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/sql.py#L757-L776 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | build/compare-mozconfig/compare-mozconfigs-wrapper.py | python | main | () | A wrapper script that calls compare-mozconfig.py
based on the platform that the machine is building for | A wrapper script that calls compare-mozconfig.py
based on the platform that the machine is building for | [
"A",
"wrapper",
"script",
"that",
"calls",
"compare",
"-",
"mozconfig",
".",
"py",
"based",
"on",
"the",
"platform",
"that",
"the",
"machine",
"is",
"building",
"for"
] | def main():
""" A wrapper script that calls compare-mozconfig.py
based on the platform that the machine is building for"""
platform = determine_platform()
if platform is not None:
python_exe = substs['PYTHON']
topsrcdir = substs['top_srcdir']
# construct paths and args for comp... | [
"def",
"main",
"(",
")",
":",
"platform",
"=",
"determine_platform",
"(",
")",
"if",
"platform",
"is",
"not",
"None",
":",
"python_exe",
"=",
"substs",
"[",
"'PYTHON'",
"]",
"topsrcdir",
"=",
"substs",
"[",
"'top_srcdir'",
"]",
"# construct paths and args for ... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/compare-mozconfig/compare-mozconfigs-wrapper.py#L28-L60 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/configHandler.py | python | IdleConfParser.Get | (self, section, option, type=None, default=None, raw=False) | Get an option value for given section/option or return default.
If type is specified, return as type. | Get an option value for given section/option or return default.
If type is specified, return as type. | [
"Get",
"an",
"option",
"value",
"for",
"given",
"section",
"/",
"option",
"or",
"return",
"default",
".",
"If",
"type",
"is",
"specified",
"return",
"as",
"type",
"."
] | def Get(self, section, option, type=None, default=None, raw=False):
"""
Get an option value for given section/option or return default.
If type is specified, return as type.
"""
if not self.has_option(section, option):
return default
if type=='bool':
... | [
"def",
"Get",
"(",
"self",
",",
"section",
",",
"option",
",",
"type",
"=",
"None",
",",
"default",
"=",
"None",
",",
"raw",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"has_option",
"(",
"section",
",",
"option",
")",
":",
"return",
"default... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/configHandler.py#L42-L54 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/data_selectors/cyclic_data_selector_view.py | python | CyclicDataSelectorView.set_data_combo_box_label | (self, text: str) | Sets the label text next to the data selector combobox. | Sets the label text next to the data selector combobox. | [
"Sets",
"the",
"label",
"text",
"next",
"to",
"the",
"data",
"selector",
"combobox",
"."
] | def set_data_combo_box_label(self, text: str) -> None:
"""Sets the label text next to the data selector combobox."""
self.data_combo_box_label.setText(text) | [
"def",
"set_data_combo_box_label",
"(",
"self",
",",
"text",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"data_combo_box_label",
".",
"setText",
"(",
"text",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/data_selectors/cyclic_data_selector_view.py#L137-L139 | ||
bayandin/chromedriver | d40a2092b50f2fca817221eeb5ea093e0e642c10 | log_replay/client_replay.py | python | Replayer.__init__ | (self, logfile, server, chrome_binary, base_url=None) | Initialize the Replayer instance.
Args:
logfile: log file handle object to replay from.
options: command-line options; see below. Needs at least
options.chromedriver for the ChromeDriver binary.
base_url: string, base of the url to replace in the logged urls (useful
for when ports c... | Initialize the Replayer instance. | [
"Initialize",
"the",
"Replayer",
"instance",
"."
] | def __init__(self, logfile, server, chrome_binary, base_url=None):
"""Initialize the Replayer instance.
Args:
logfile: log file handle object to replay from.
options: command-line options; see below. Needs at least
options.chromedriver for the ChromeDriver binary.
base_url: string, ba... | [
"def",
"__init__",
"(",
"self",
",",
"logfile",
",",
"server",
",",
"chrome_binary",
",",
"base_url",
"=",
"None",
")",
":",
"# TODO(cwinstanley) Add Android support and perhaps support for other",
"# chromedriver command line options.",
"self",
".",
"executor",
"=",
"com... | https://github.com/bayandin/chromedriver/blob/d40a2092b50f2fca817221eeb5ea093e0e642c10/log_replay/client_replay.py#L847-L864 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/wxPIA_book/Chapter-14/grid_editor.py | python | UpCaseCellEditor.SetSize | (self, rect) | Called to position/size the edit control within the cell rectangle.
If you don't fill the cell (the rect) then be sure to override
PaintBackground and do something meaningful there. | Called to position/size the edit control within the cell rectangle.
If you don't fill the cell (the rect) then be sure to override
PaintBackground and do something meaningful there. | [
"Called",
"to",
"position",
"/",
"size",
"the",
"edit",
"control",
"within",
"the",
"cell",
"rectangle",
".",
"If",
"you",
"don",
"t",
"fill",
"the",
"cell",
"(",
"the",
"rect",
")",
"then",
"be",
"sure",
"to",
"override",
"PaintBackground",
"and",
"do",... | def SetSize(self, rect):
"""
Called to position/size the edit control within the cell rectangle.
If you don't fill the cell (the rect) then be sure to override
PaintBackground and do something meaningful there.
"""
self._tc.SetDimensions(rect.x, rect.y, rect.width+2, rect... | [
"def",
"SetSize",
"(",
"self",
",",
"rect",
")",
":",
"self",
".",
"_tc",
".",
"SetDimensions",
"(",
"rect",
".",
"x",
",",
"rect",
".",
"y",
",",
"rect",
".",
"width",
"+",
"2",
",",
"rect",
".",
"height",
"+",
"2",
",",
"wx",
".",
"SIZE_ALLOW... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/wxPIA_book/Chapter-14/grid_editor.py#L23-L30 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/cloud/common/google_instance_helper.py | python | GoogleInstanceHelper.DeleteInstanceGroup | (self, tag) | return False | Deletes the instance group identified by tag. If instances are still
running in this group, they are deleted as well. | Deletes the instance group identified by tag. If instances are still
running in this group, they are deleted as well. | [
"Deletes",
"the",
"instance",
"group",
"identified",
"by",
"tag",
".",
"If",
"instances",
"are",
"still",
"running",
"in",
"this",
"group",
"they",
"are",
"deleted",
"as",
"well",
"."
] | def DeleteInstanceGroup(self, tag):
"""Deletes the instance group identified by tag. If instances are still
running in this group, they are deleted as well.
"""
group_name = self._GetInstanceGroupName(tag)
request = self._compute_api.instanceGroupManagers().delete(
project=self._project, zon... | [
"def",
"DeleteInstanceGroup",
"(",
"self",
",",
"tag",
")",
":",
"group_name",
"=",
"self",
".",
"_GetInstanceGroupName",
"(",
"tag",
")",
"request",
"=",
"self",
".",
"_compute_api",
".",
"instanceGroupManagers",
"(",
")",
".",
"delete",
"(",
"project",
"="... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/cloud/common/google_instance_helper.py#L162-L178 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/tempfile.py | python | mkdtemp | (suffix="", prefix=template, dir=None) | User-callable function to create and return a unique temporary
directory. The return value is the pathname of the directory.
Arguments are as for mkstemp, except that the 'text' argument is
not accepted.
The directory is readable, writable, and searchable only by the
creating user.
Caller is... | User-callable function to create and return a unique temporary
directory. The return value is the pathname of the directory. | [
"User",
"-",
"callable",
"function",
"to",
"create",
"and",
"return",
"a",
"unique",
"temporary",
"directory",
".",
"The",
"return",
"value",
"is",
"the",
"pathname",
"of",
"the",
"directory",
"."
] | def mkdtemp(suffix="", prefix=template, dir=None):
"""User-callable function to create and return a unique temporary
directory. The return value is the pathname of the directory.
Arguments are as for mkstemp, except that the 'text' argument is
not accepted.
The directory is readable, writable, an... | [
"def",
"mkdtemp",
"(",
"suffix",
"=",
"\"\"",
",",
"prefix",
"=",
"template",
",",
"dir",
"=",
"None",
")",
":",
"if",
"dir",
"is",
"None",
":",
"dir",
"=",
"gettempdir",
"(",
")",
"names",
"=",
"_get_candidate_names",
"(",
")",
"for",
"seq",
"in",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/tempfile.py#L307-L336 | ||
ivansafrin/Polycode | 37a40fefe194ec7f6e9d1257f3bb3517b0a168bc | Bindings/Scripts/create_lua_library/zipfile.py | python | _ZipDecrypter.__call__ | (self, c) | return c | Decrypt a single character. | Decrypt a single character. | [
"Decrypt",
"a",
"single",
"character",
"."
] | def __call__(self, c):
"""Decrypt a single character."""
c = ord(c)
k = self.key2 | 2
c = c ^ (((k * (k^1)) >> 8) & 255)
c = chr(c)
self._UpdateKeys(c)
return c | [
"def",
"__call__",
"(",
"self",
",",
"c",
")",
":",
"c",
"=",
"ord",
"(",
"c",
")",
"k",
"=",
"self",
".",
"key2",
"|",
"2",
"c",
"=",
"c",
"^",
"(",
"(",
"(",
"k",
"*",
"(",
"k",
"^",
"1",
")",
")",
">>",
"8",
")",
"&",
"255",
")",
... | https://github.com/ivansafrin/Polycode/blob/37a40fefe194ec7f6e9d1257f3bb3517b0a168bc/Bindings/Scripts/create_lua_library/zipfile.py#L455-L462 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/html5lib-python/html5lib/treebuilders/etree_lxml.py | python | TreeBuilder.insertRoot | (self, token) | Create the document root | Create the document root | [
"Create",
"the",
"document",
"root"
] | def insertRoot(self, token):
"""Create the document root"""
# Because of the way libxml2 works, it doesn't seem to be possible to
# alter information like the doctype after the tree has been parsed.
# Therefore we need to use the built-in parser to create our iniial
# tree, after... | [
"def",
"insertRoot",
"(",
"self",
",",
"token",
")",
":",
"# Because of the way libxml2 works, it doesn't seem to be possible to",
"# alter information like the doctype after the tree has been parsed.",
"# Therefore we need to use the built-in parser to create our iniial",
"# tree, after which... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/html5lib-python/html5lib/treebuilders/etree_lxml.py#L314-L369 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/signaltools.py | python | correlate | (in1, in2, mode='full', method='auto') | r"""
Cross-correlate two N-dimensional arrays.
Cross-correlate `in1` and `in2`, with the output size determined by the
`mode` argument.
Parameters
----------
in1 : array_like
First input.
in2 : array_like
Second input. Should have the same number of dimensions as `in1`.
... | r"""
Cross-correlate two N-dimensional arrays. | [
"r",
"Cross",
"-",
"correlate",
"two",
"N",
"-",
"dimensional",
"arrays",
"."
] | def correlate(in1, in2, mode='full', method='auto'):
r"""
Cross-correlate two N-dimensional arrays.
Cross-correlate `in1` and `in2`, with the output size determined by the
`mode` argument.
Parameters
----------
in1 : array_like
First input.
in2 : array_like
Second input... | [
"def",
"correlate",
"(",
"in1",
",",
"in2",
",",
"mode",
"=",
"'full'",
",",
"method",
"=",
"'auto'",
")",
":",
"in1",
"=",
"asarray",
"(",
"in1",
")",
"in2",
"=",
"asarray",
"(",
"in2",
")",
"if",
"in1",
".",
"ndim",
"==",
"in2",
".",
"ndim",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/signaltools.py#L105-L269 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/markdown/extensions/smart_strong.py | python | SmartEmphasisExtension.extendMarkdown | (self, md, md_globals) | Modify inline patterns. | Modify inline patterns. | [
"Modify",
"inline",
"patterns",
"."
] | def extendMarkdown(self, md, md_globals):
""" Modify inline patterns. """
md.inlinePatterns['strong'] = SimpleTagPattern(STRONG_RE, 'strong')
md.inlinePatterns.add('strong2', SimpleTagPattern(SMART_STRONG_RE, 'strong'), '>emphasis2') | [
"def",
"extendMarkdown",
"(",
"self",
",",
"md",
",",
"md_globals",
")",
":",
"md",
".",
"inlinePatterns",
"[",
"'strong'",
"]",
"=",
"SimpleTagPattern",
"(",
"STRONG_RE",
",",
"'strong'",
")",
"md",
".",
"inlinePatterns",
".",
"add",
"(",
"'strong2'",
","... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/markdown/extensions/smart_strong.py#L68-L71 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/win/split_link/install_split_link.py | python | EscapeForCommandLineAndCString | (path) | return path.replace('\\', '\\\\').replace('"', '\\"') | Quoted sufficiently to be passed on the compile command line as a define
to be turned into a string in the target C program. | Quoted sufficiently to be passed on the compile command line as a define
to be turned into a string in the target C program. | [
"Quoted",
"sufficiently",
"to",
"be",
"passed",
"on",
"the",
"compile",
"command",
"line",
"as",
"a",
"define",
"to",
"be",
"turned",
"into",
"a",
"string",
"in",
"the",
"target",
"C",
"program",
"."
] | def EscapeForCommandLineAndCString(path):
"""Quoted sufficiently to be passed on the compile command line as a define
to be turned into a string in the target C program."""
path = '"' + path + '"'
return path.replace('\\', '\\\\').replace('"', '\\"') | [
"def",
"EscapeForCommandLineAndCString",
"(",
"path",
")",
":",
"path",
"=",
"'\"'",
"+",
"path",
"+",
"'\"'",
"return",
"path",
".",
"replace",
"(",
"'\\\\'",
",",
"'\\\\\\\\'",
")",
".",
"replace",
"(",
"'\"'",
",",
"'\\\\\"'",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/win/split_link/install_split_link.py#L35-L39 | |
Ewenwan/MVision | 97b394dfa48cb21c82cd003b1a952745e413a17f | CNN/MobileNet/MobileNet_v1_ssd_caffe/ssd_detect.py | python | parse_args | () | return parser.parse_args() | parse args | parse args | [
"parse",
"args"
] | def parse_args():
'''parse args'''
parser = argparse.ArgumentParser()
parser.add_argument('--gpu_id', type=int, default=1, help='gpu id')
parser.add_argument('--labelmap_file',
default='labelmap_voc.prototxt')
parser.add_argument('--model_def',
default... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'--gpu_id'",
",",
"type",
"=",
"int",
",",
"default",
"=",
"1",
",",
"help",
"=",
"'gpu id'",
")",
"parser",
".",
"add_... | https://github.com/Ewenwan/MVision/blob/97b394dfa48cb21c82cd003b1a952745e413a17f/CNN/MobileNet/MobileNet_v1_ssd_caffe/ssd_detect.py#L152-L166 | |
martinmoene/expected-lite | 6284387cb117ea78d973fb5b1cbff1651a8d5d9a | script/create-vcpkg.py | python | createPortfile | ( args ) | Create vcpkg portfile | Create vcpkg portfile | [
"Create",
"vcpkg",
"portfile"
] | def createPortfile( args ):
"""Create vcpkg portfile"""
output = tpl_vcpkg_portfile.format(
optpfx=cfg_cmake_optpfx, usr=args.user, prj=args.project, ref=to_ref(args.version), sha=args.sha, lic=cfg_license )
if args.verbose:
print( "Creating portfile '{f}':".format( f=portfile_path( args ) )... | [
"def",
"createPortfile",
"(",
"args",
")",
":",
"output",
"=",
"tpl_vcpkg_portfile",
".",
"format",
"(",
"optpfx",
"=",
"cfg_cmake_optpfx",
",",
"usr",
"=",
"args",
".",
"user",
",",
"prj",
"=",
"args",
".",
"project",
",",
"ref",
"=",
"to_ref",
"(",
"... | https://github.com/martinmoene/expected-lite/blob/6284387cb117ea78d973fb5b1cbff1651a8d5d9a/script/create-vcpkg.py#L134-L144 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.HasBuildSetting | (self, key) | return 1 | Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns 0.
If some, but not all, child obj... | Determines the state of a build setting in all XCBuildConfiguration
child objects. | [
"Determines",
"the",
"state",
"of",
"a",
"build",
"setting",
"in",
"all",
"XCBuildConfiguration",
"child",
"objects",
"."
] | def HasBuildSetting(self, key):
"""Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns ... | [
"def",
"HasBuildSetting",
"(",
"self",
",",
"key",
")",
":",
"has",
"=",
"None",
"value",
"=",
"None",
"for",
"configuration",
"in",
"self",
".",
"_properties",
"[",
"'buildConfigurations'",
"]",
":",
"configuration_has",
"=",
"configuration",
".",
"HasBuildSe... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcodeproj_file.py#L1567-L1599 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/indentation.py | python | IndentationRules._AllFunctionPropertyAssignTokens | (self, start_token, end_token) | return True | Checks if tokens are (likely) a valid function property assignment.
Args:
start_token: Start of the token range.
end_token: End of the token range.
Returns:
True if all tokens between start_token and end_token are legal tokens
within a function declaration and assignment into a propert... | Checks if tokens are (likely) a valid function property assignment. | [
"Checks",
"if",
"tokens",
"are",
"(",
"likely",
")",
"a",
"valid",
"function",
"property",
"assignment",
"."
] | def _AllFunctionPropertyAssignTokens(self, start_token, end_token):
"""Checks if tokens are (likely) a valid function property assignment.
Args:
start_token: Start of the token range.
end_token: End of the token range.
Returns:
True if all tokens between start_token and end_token are leg... | [
"def",
"_AllFunctionPropertyAssignTokens",
"(",
"self",
",",
"start_token",
",",
"end_token",
")",
":",
"for",
"token",
"in",
"tokenutil",
".",
"GetTokenRange",
"(",
"start_token",
",",
"end_token",
")",
":",
"fn_decl_tokens",
"=",
"(",
"Type",
".",
"FUNCTION_DE... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/indentation.py#L459-L482 | |
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp3/ctptd.py | python | CtpTd.onErrRtnFutureToBankByFuture | (self, ReqTransferField, RspInfoField) | 期货发起期货资金转银行错误回报 | 期货发起期货资金转银行错误回报 | [
"期货发起期货资金转银行错误回报"
] | def onErrRtnFutureToBankByFuture(self, ReqTransferField, RspInfoField):
"""期货发起期货资金转银行错误回报"""
pass | [
"def",
"onErrRtnFutureToBankByFuture",
"(",
"self",
",",
"ReqTransferField",
",",
"RspInfoField",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L499-L501 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/array_ops.py | python | DynamicShape.__init__ | (self) | init Shape | init Shape | [
"init",
"Shape"
] | def __init__(self):
"""init Shape"""
self.init_prim_io_names(inputs=['tensor'], outputs=['output'])
self.add_prim_attr('is_dynamic_shape', True) | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"init_prim_io_names",
"(",
"inputs",
"=",
"[",
"'tensor'",
"]",
",",
"outputs",
"=",
"[",
"'output'",
"]",
")",
"self",
".",
"add_prim_attr",
"(",
"'is_dynamic_shape'",
",",
"True",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/array_ops.py#L671-L674 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/eager/function.py | python | _GraphModeFunction._build_call_outputs | (self, func_outputs, result) | return tuple(outputs) if type(func_outputs) is tuple else outputs | Maps the fdef output list to actual output structure.
Args:
func_outputs: The outputs originally defined by the graph function. It
could potentially be a nested structure.
result: Output lists defined by FunctionDef.
Returns:
The actual call output. | Maps the fdef output list to actual output structure. | [
"Maps",
"the",
"fdef",
"output",
"list",
"to",
"actual",
"output",
"structure",
"."
] | def _build_call_outputs(self, func_outputs, result):
"""Maps the fdef output list to actual output structure.
Args:
func_outputs: The outputs originally defined by the graph function. It
could potentially be a nested structure.
result: Output lists defined by FunctionDef.
Returns:
... | [
"def",
"_build_call_outputs",
"(",
"self",
",",
"func_outputs",
",",
"result",
")",
":",
"if",
"self",
".",
"_func_outputs",
"is",
"None",
":",
"return",
"None",
"if",
"isinstance",
"(",
"self",
".",
"_func_outputs",
",",
"ops",
".",
"Tensor",
")",
":",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/function.py#L376-L401 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGridInterface.BeginAddChildren | (*args, **kwargs) | return _propgrid.PropertyGridInterface_BeginAddChildren(*args, **kwargs) | BeginAddChildren(self, PGPropArg id) | BeginAddChildren(self, PGPropArg id) | [
"BeginAddChildren",
"(",
"self",
"PGPropArg",
"id",
")"
] | def BeginAddChildren(*args, **kwargs):
"""BeginAddChildren(self, PGPropArg id)"""
return _propgrid.PropertyGridInterface_BeginAddChildren(*args, **kwargs) | [
"def",
"BeginAddChildren",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_BeginAddChildren",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1102-L1104 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibar.py | python | AuiToolBar.SetToolOrientation | (self, orientation) | Sets the tool orientation for the toolbar items.
:param integer `orientation`: the :class:`AuiToolBarItem` orientation. | Sets the tool orientation for the toolbar items. | [
"Sets",
"the",
"tool",
"orientation",
"for",
"the",
"toolbar",
"items",
"."
] | def SetToolOrientation(self, orientation):
"""
Sets the tool orientation for the toolbar items.
:param integer `orientation`: the :class:`AuiToolBarItem` orientation.
"""
self._tool_orientation = orientation
if self._art:
self._art.SetOrientation(orientation... | [
"def",
"SetToolOrientation",
"(",
"self",
",",
"orientation",
")",
":",
"self",
".",
"_tool_orientation",
"=",
"orientation",
"if",
"self",
".",
"_art",
":",
"self",
".",
"_art",
".",
"SetOrientation",
"(",
"orientation",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L2386-L2395 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | LabelFrame.__init__ | (self, master=None, cnf={}, **kw) | Construct a labelframe widget with the parent MASTER.
STANDARD OPTIONS
borderwidth, cursor, font, foreground,
highlightbackground, highlightcolor,
highlightthickness, padx, pady, relief,
takefocus, text
WIDGET-SPECIFIC OPTIONS
background, c... | Construct a labelframe widget with the parent MASTER. | [
"Construct",
"a",
"labelframe",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct a labelframe widget with the parent MASTER.
STANDARD OPTIONS
borderwidth, cursor, font, foreground,
highlightbackground, highlightcolor,
highlightthickness, padx, pady, relief,
takefocus, text
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'labelframe'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L3609-L3625 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | ipc/ipdl/ipdl/parser.py | python | p_OptionalMessageCompress | (p) | OptionalMessageCompress : COMPRESS
| | OptionalMessageCompress : COMPRESS
| | [
"OptionalMessageCompress",
":",
"COMPRESS",
"|"
] | def p_OptionalMessageCompress(p):
"""OptionalMessageCompress : COMPRESS
| """
if 1 == len(p):
p[0] = ''
else:
p[0] = 'compress' | [
"def",
"p_OptionalMessageCompress",
"(",
"p",
")",
":",
"if",
"1",
"==",
"len",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"''",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"'compress'"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/parser.py#L542-L548 | ||
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/text_format.py | python | ParseBool | (text) | Parse a boolean value.
Args:
text: Text to parse.
Returns:
Boolean values parsed
Raises:
ValueError: If text is not a valid boolean. | Parse a boolean value. | [
"Parse",
"a",
"boolean",
"value",
"."
] | def ParseBool(text):
"""Parse a boolean value.
Args:
text: Text to parse.
Returns:
Boolean values parsed
Raises:
ValueError: If text is not a valid boolean.
"""
if text in ('true', 't', '1'):
return True
elif text in ('false', 'f', '0'):
return False
else:
raise ValueError('Ex... | [
"def",
"ParseBool",
"(",
"text",
")",
":",
"if",
"text",
"in",
"(",
"'true'",
",",
"'t'",
",",
"'1'",
")",
":",
"return",
"True",
"elif",
"text",
"in",
"(",
"'false'",
",",
"'f'",
",",
"'0'",
")",
":",
"return",
"False",
"else",
":",
"raise",
"Va... | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/text_format.py#L820-L837 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/build_swift/build_swift/shell.py | python | copy | (source, dest, echo=False) | Emulates the `cp` command to copy a file or directory. | Emulates the `cp` command to copy a file or directory. | [
"Emulates",
"the",
"cp",
"command",
"to",
"copy",
"a",
"file",
"or",
"directory",
"."
] | def copy(source, dest, echo=False):
"""Emulates the `cp` command to copy a file or directory.
"""
source = _convert_pathlib_path(source)
dest = _convert_pathlib_path(dest)
if os.path.isfile(source):
if echo:
_echo_command(['cp', source, dest], sys.stdout)
return shutil.... | [
"def",
"copy",
"(",
"source",
",",
"dest",
",",
"echo",
"=",
"False",
")",
":",
"source",
"=",
"_convert_pathlib_path",
"(",
"source",
")",
"dest",
"=",
"_convert_pathlib_path",
"(",
"dest",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"source",
"... | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/build_swift/build_swift/shell.py#L355-L370 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.SetOwnBackgroundColour | (*args, **kwargs) | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | SetOwnBackgroundColour(self, Colour colour) | SetOwnBackgroundColour(self, Colour colour) | [
"SetOwnBackgroundColour",
"(",
"self",
"Colour",
"colour",
")"
] | def SetOwnBackgroundColour(*args, **kwargs):
"""SetOwnBackgroundColour(self, Colour colour)"""
return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | [
"def",
"SetOwnBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetOwnBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10865-L10867 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | PreCheckBox | (*args, **kwargs) | return val | PreCheckBox() -> CheckBox
Precreate a CheckBox for 2-phase creation. | PreCheckBox() -> CheckBox | [
"PreCheckBox",
"()",
"-",
">",
"CheckBox"
] | def PreCheckBox(*args, **kwargs):
"""
PreCheckBox() -> CheckBox
Precreate a CheckBox for 2-phase creation.
"""
val = _controls_.new_PreCheckBox(*args, **kwargs)
return val | [
"def",
"PreCheckBox",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_controls_",
".",
"new_PreCheckBox",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L457-L464 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/_polybase.py | python | ABCPolyBase.has_sametype | (self, other) | return isinstance(other, self.__class__) | Check if types match.
.. versionadded:: 1.7.0
Parameters
----------
other : object
Class instance.
Returns
-------
bool : boolean
True if other is same class as self | Check if types match. | [
"Check",
"if",
"types",
"match",
"."
] | def has_sametype(self, other):
"""Check if types match.
.. versionadded:: 1.7.0
Parameters
----------
other : object
Class instance.
Returns
-------
bool : boolean
True if other is same class as self
"""
return i... | [
"def",
"has_sametype",
"(",
"self",
",",
"other",
")",
":",
"return",
"isinstance",
"(",
"other",
",",
"self",
".",
"__class__",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/_polybase.py#L211-L227 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/cluster/hierarchy.py | python | ClusterNode.get_left | (self) | return self.left | Return a reference to the left child tree object.
Returns
-------
left : ClusterNode
The left child of the target node. If the node is a leaf,
None is returned. | Return a reference to the left child tree object. | [
"Return",
"a",
"reference",
"to",
"the",
"left",
"child",
"tree",
"object",
"."
] | def get_left(self):
"""
Return a reference to the left child tree object.
Returns
-------
left : ClusterNode
The left child of the target node. If the node is a leaf,
None is returned.
"""
return self.left | [
"def",
"get_left",
"(",
"self",
")",
":",
"return",
"self",
".",
"left"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/cluster/hierarchy.py#L1228-L1239 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/nonlin.py | python | LowRankMatrix.collapse | (self) | Collapse the low-rank matrix to a full-rank one. | Collapse the low-rank matrix to a full-rank one. | [
"Collapse",
"the",
"low",
"-",
"rank",
"matrix",
"to",
"a",
"full",
"-",
"rank",
"one",
"."
] | def collapse(self):
"""Collapse the low-rank matrix to a full-rank one."""
self.collapsed = np.array(self)
self.cs = None
self.ds = None
self.alpha = None | [
"def",
"collapse",
"(",
"self",
")",
":",
"self",
".",
"collapsed",
"=",
"np",
".",
"array",
"(",
"self",
")",
"self",
".",
"cs",
"=",
"None",
"self",
".",
"ds",
"=",
"None",
"self",
".",
"alpha",
"=",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/nonlin.py#L792-L797 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Locale.GetName | (*args, **kwargs) | return _gdi_.Locale_GetName(*args, **kwargs) | GetName(self) -> String | GetName(self) -> String | [
"GetName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetName(*args, **kwargs):
"""GetName(self) -> String"""
return _gdi_.Locale_GetName(*args, **kwargs) | [
"def",
"GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Locale_GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L3084-L3086 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tree.py | python | listicons | (icondir=ICONDIR) | Utility to display the available icons. | Utility to display the available icons. | [
"Utility",
"to",
"display",
"the",
"available",
"icons",
"."
] | def listicons(icondir=ICONDIR):
"""Utility to display the available icons."""
root = Tk()
import glob
list = glob.glob(os.path.join(icondir, "*.gif"))
list.sort()
images = []
row = column = 0
for file in list:
name = os.path.splitext(os.path.basename(file))[0]
image = Pho... | [
"def",
"listicons",
"(",
"icondir",
"=",
"ICONDIR",
")",
":",
"root",
"=",
"Tk",
"(",
")",
"import",
"glob",
"list",
"=",
"glob",
".",
"glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"icondir",
",",
"\"*.gif\"",
")",
")",
"list",
".",
"sort",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tree.py#L37-L57 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/window/rolling.py | python | _Window._create_blocks | (self) | return blocks, obj | Split data into blocks & return conformed data. | Split data into blocks & return conformed data. | [
"Split",
"data",
"into",
"blocks",
"&",
"return",
"conformed",
"data",
"."
] | def _create_blocks(self):
"""
Split data into blocks & return conformed data.
"""
obj = self._selected_obj
# filter out the on from the object
if self.on is not None and not isinstance(self.on, Index):
if obj.ndim == 2:
obj = obj.reindex(colu... | [
"def",
"_create_blocks",
"(",
"self",
")",
":",
"obj",
"=",
"self",
".",
"_selected_obj",
"# filter out the on from the object",
"if",
"self",
".",
"on",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"self",
".",
"on",
",",
"Index",
")",
":",
"if",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/window/rolling.py#L148-L161 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/wms/ogc/implementation/impl_v130.py | python | GetCapabilitiesRequest.SetLayers | (self) | Set the layers for the capabilities xml. | Set the layers for the capabilities xml. | [
"Set",
"the",
"layers",
"for",
"the",
"capabilities",
"xml",
"."
] | def SetLayers(self):
"""Set the layers for the capabilities xml."""
# This outer, inaccessible layer is to give information just once;
# the sub-layers inherit it.
outer_layer = capabilities_wms.Layer(
# 7.2.4.7.4 The layer is area-filling => opaque
opaque=True,
# 7.2.4.7.5 -- w... | [
"def",
"SetLayers",
"(",
"self",
")",
":",
"# This outer, inaccessible layer is to give information just once;",
"# the sub-layers inherit it.",
"outer_layer",
"=",
"capabilities_wms",
".",
"Layer",
"(",
"# 7.2.4.7.4 The layer is area-filling => opaque",
"opaque",
"=",
"True",
",... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/implementation/impl_v130.py#L190-L257 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/third_party/jinja2/lexer.py | python | Lexer.tokenize | (self, source, name=None, filename=None, state=None) | return TokenStream(self.wrap(stream, name, filename), name, filename) | Calls tokeniter + tokenize and wraps it in a token stream. | Calls tokeniter + tokenize and wraps it in a token stream. | [
"Calls",
"tokeniter",
"+",
"tokenize",
"and",
"wraps",
"it",
"in",
"a",
"token",
"stream",
"."
] | def tokenize(self, source, name=None, filename=None, state=None):
"""Calls tokeniter + tokenize and wraps it in a token stream.
"""
stream = self.tokeniter(source, name, filename, state)
return TokenStream(self.wrap(stream, name, filename), name, filename) | [
"def",
"tokenize",
"(",
"self",
",",
"source",
",",
"name",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"state",
"=",
"None",
")",
":",
"stream",
"=",
"self",
".",
"tokeniter",
"(",
"source",
",",
"name",
",",
"filename",
",",
"state",
")",
"re... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/lexer.py#L542-L546 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/wubi/backends/common/metalink.py | python | Metalink.get_dict | (self) | return dict | Return all the data as a dictionary. Used by __eq__. | Return all the data as a dictionary. Used by __eq__. | [
"Return",
"all",
"the",
"data",
"as",
"a",
"dictionary",
".",
"Used",
"by",
"__eq__",
"."
] | def get_dict(self):
"""Return all the data as a dictionary. Used by __eq__."""
dict = copy.copy(self.__dict__)
files = []
for f in self.files:
files.append(f.get_dict())
dict['files'] = files
return dict | [
"def",
"get_dict",
"(",
"self",
")",
":",
"dict",
"=",
"copy",
".",
"copy",
"(",
"self",
".",
"__dict__",
")",
"files",
"=",
"[",
"]",
"for",
"f",
"in",
"self",
".",
"files",
":",
"files",
".",
"append",
"(",
"f",
".",
"get_dict",
"(",
")",
")"... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/wubi/backends/common/metalink.py#L35-L42 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/scons/khEnvironment.py | python | khEnvironment.bash_escape | (value) | return "'{0}'".format(value.replace("'", "'\\''")) | Escapes a given value as a BASH string. | Escapes a given value as a BASH string. | [
"Escapes",
"a",
"given",
"value",
"as",
"a",
"BASH",
"string",
"."
] | def bash_escape(value):
"""Escapes a given value as a BASH string."""
return "'{0}'".format(value.replace("'", "'\\''")) | [
"def",
"bash_escape",
"(",
"value",
")",
":",
"return",
"\"'{0}'\"",
".",
"format",
"(",
"value",
".",
"replace",
"(",
"\"'\"",
",",
"\"'\\\\''\"",
")",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/scons/khEnvironment.py#L310-L313 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/dask_cudf/dask_cudf/core.py | python | DataFrame.to_parquet | (self, path, *args, **kwargs) | return to_parquet(self, path, *args, **kwargs) | Calls dask.dataframe.io.to_parquet with CudfEngine backend | Calls dask.dataframe.io.to_parquet with CudfEngine backend | [
"Calls",
"dask",
".",
"dataframe",
".",
"io",
".",
"to_parquet",
"with",
"CudfEngine",
"backend"
] | def to_parquet(self, path, *args, **kwargs):
"""Calls dask.dataframe.io.to_parquet with CudfEngine backend"""
from dask_cudf.io import to_parquet
return to_parquet(self, path, *args, **kwargs) | [
"def",
"to_parquet",
"(",
"self",
",",
"path",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"dask_cudf",
".",
"io",
"import",
"to_parquet",
"return",
"to_parquet",
"(",
"self",
",",
"path",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/core.py#L264-L268 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/function.py | python | get_extra_args | () | Returns the corresponding function arguments for the captured inputs.
Returns:
If the default graph is being used to define a function, the
returned list of place holders are those used inside the function
body corresponding those returned by get_extra_inputs(). Otherwise,
returns an empty list. | Returns the corresponding function arguments for the captured inputs. | [
"Returns",
"the",
"corresponding",
"function",
"arguments",
"for",
"the",
"captured",
"inputs",
"."
] | def get_extra_args():
"""Returns the corresponding function arguments for the captured inputs.
Returns:
If the default graph is being used to define a function, the
returned list of place holders are those used inside the function
body corresponding those returned by get_extra_inputs(). Otherwise,
... | [
"def",
"get_extra_args",
"(",
")",
":",
"g",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"if",
"isinstance",
"(",
"g",
",",
"_FuncGraph",
")",
":",
"return",
"g",
".",
"extra_args",
"else",
":",
"return",
"[",
"]"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/function.py#L1047-L1060 | ||
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.read_nonblocking | (self, size=1, timeout=None) | return s | This reads data from the file descriptor.
This is a simple implementation suitable for a regular file. Subclasses using ptys or pipes should override it.
The timeout parameter is ignored. | This reads data from the file descriptor. | [
"This",
"reads",
"data",
"from",
"the",
"file",
"descriptor",
"."
] | def read_nonblocking(self, size=1, timeout=None):
"""This reads data from the file descriptor.
This is a simple implementation suitable for a regular file. Subclasses using ptys or pipes should override it.
The timeout parameter is ignored.
"""
try:
s = os.read(sel... | [
"def",
"read_nonblocking",
"(",
"self",
",",
"size",
"=",
"1",
",",
"timeout",
"=",
"None",
")",
":",
"try",
":",
"s",
"=",
"os",
".",
"read",
"(",
"self",
".",
"child_fd",
",",
"size",
")",
"except",
"OSError",
"as",
"err",
":",
"if",
"err",
"."... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L157-L180 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py | python | DataFrame._ixs | (self, i: int, axis: int = 0) | Parameters
----------
i : int
axis : int
Notes
-----
If slice passed, the resulting data will be a view. | Parameters
----------
i : int
axis : int | [
"Parameters",
"----------",
"i",
":",
"int",
"axis",
":",
"int"
] | def _ixs(self, i: int, axis: int = 0):
"""
Parameters
----------
i : int
axis : int
Notes
-----
If slice passed, the resulting data will be a view.
"""
# irow
if axis == 0:
new_values = self._data.fast_xs(i)
... | [
"def",
"_ixs",
"(",
"self",
",",
"i",
":",
"int",
",",
"axis",
":",
"int",
"=",
"0",
")",
":",
"# irow",
"if",
"axis",
"==",
"0",
":",
"new_values",
"=",
"self",
".",
"_data",
".",
"fast_xs",
"(",
"i",
")",
"# if we are a copy, mark as such",
"copy",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py#L2722-L2765 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | Examples/ReinforcementLearning/DeepQNeuralNetwork.py | python | DeepQAgent.observe | (self, old_state, action, reward, done) | This allows the agent to observe the output of doing the action it selected through act() on the old_state
Attributes:
old_state (Tensor[input_shape]): Previous environment state
action (int): Action done by the agent
reward (float): Reward for doing this action in the old_s... | This allows the agent to observe the output of doing the action it selected through act() on the old_state | [
"This",
"allows",
"the",
"agent",
"to",
"observe",
"the",
"output",
"of",
"doing",
"the",
"action",
"it",
"selected",
"through",
"act",
"()",
"on",
"the",
"old_state"
] | def observe(self, old_state, action, reward, done):
""" This allows the agent to observe the output of doing the action it selected through act() on the old_state
Attributes:
old_state (Tensor[input_shape]): Previous environment state
action (int): Action done by the agent
... | [
"def",
"observe",
"(",
"self",
",",
"old_state",
",",
"action",
",",
"reward",
",",
"done",
")",
":",
"self",
".",
"_episode_rewards",
".",
"append",
"(",
"reward",
")",
"# If done, reset short term memory (ie. History)",
"if",
"done",
":",
"# Plot the metrics thr... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/Examples/ReinforcementLearning/DeepQNeuralNetwork.py#L363-L385 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetComputedDefines | (self, config) | return defines | Returns the set of defines that are injected to the defines list based
on other VS settings. | Returns the set of defines that are injected to the defines list based
on other VS settings. | [
"Returns",
"the",
"set",
"of",
"defines",
"that",
"are",
"injected",
"to",
"the",
"defines",
"list",
"based",
"on",
"other",
"VS",
"settings",
"."
] | def GetComputedDefines(self, config):
"""Returns the set of defines that are injected to the defines list based
on other VS settings."""
config = self._TargetConfig(config)
defines = []
if self._ConfigAttrib(['CharacterSet'], config) == '1':
defines.extend(('_UNICODE', 'UNICODE'))
if self.... | [
"def",
"GetComputedDefines",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"defines",
"=",
"[",
"]",
"if",
"self",
".",
"_ConfigAttrib",
"(",
"[",
"'CharacterSet'",
"]",
",",
"config",
")",
"==",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L358-L369 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ListItem.SetWidth | (*args, **kwargs) | return _controls_.ListItem_SetWidth(*args, **kwargs) | SetWidth(self, int width) | SetWidth(self, int width) | [
"SetWidth",
"(",
"self",
"int",
"width",
")"
] | def SetWidth(*args, **kwargs):
"""SetWidth(self, int width)"""
return _controls_.ListItem_SetWidth(*args, **kwargs) | [
"def",
"SetWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItem_SetWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4200-L4202 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py | python | searcher_string.__init__ | (self, strings) | This creates an instance of searcher_string. This argument 'strings'
may be a list; a sequence of strings; or the EOF or TIMEOUT types. | This creates an instance of searcher_string. This argument 'strings'
may be a list; a sequence of strings; or the EOF or TIMEOUT types. | [
"This",
"creates",
"an",
"instance",
"of",
"searcher_string",
".",
"This",
"argument",
"strings",
"may",
"be",
"a",
"list",
";",
"a",
"sequence",
"of",
"strings",
";",
"or",
"the",
"EOF",
"or",
"TIMEOUT",
"types",
"."
] | def __init__(self, strings):
'''This creates an instance of searcher_string. This argument 'strings'
may be a list; a sequence of strings; or the EOF or TIMEOUT types. '''
self.eof_index = -1
self.timeout_index = -1
self._strings = []
for n, s in enumerate(strings):
... | [
"def",
"__init__",
"(",
"self",
",",
"strings",
")",
":",
"self",
".",
"eof_index",
"=",
"-",
"1",
"self",
".",
"timeout_index",
"=",
"-",
"1",
"self",
".",
"_strings",
"=",
"[",
"]",
"for",
"n",
",",
"s",
"in",
"enumerate",
"(",
"strings",
")",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py#L144-L158 | ||
opencv/opencv | 76aff8478883858f0e46746044348ebb16dc3c67 | modules/java/generator/gen_java.py | python | JavaWrapperGenerator.isSmartClass | (self, ci) | return ci.smart | Check if class stores Ptr<T>* instead of T* in nativeObj field | Check if class stores Ptr<T>* instead of T* in nativeObj field | [
"Check",
"if",
"class",
"stores",
"Ptr<T",
">",
"*",
"instead",
"of",
"T",
"*",
"in",
"nativeObj",
"field"
] | def isSmartClass(self, ci):
'''
Check if class stores Ptr<T>* instead of T* in nativeObj field
'''
if ci.smart != None:
return ci.smart
ci.smart = True # smart class is not properly handled in case of base/derived classes
return ci.smart | [
"def",
"isSmartClass",
"(",
"self",
",",
"ci",
")",
":",
"if",
"ci",
".",
"smart",
"!=",
"None",
":",
"return",
"ci",
".",
"smart",
"ci",
".",
"smart",
"=",
"True",
"# smart class is not properly handled in case of base/derived classes",
"return",
"ci",
".",
"... | https://github.com/opencv/opencv/blob/76aff8478883858f0e46746044348ebb16dc3c67/modules/java/generator/gen_java.py#L1217-L1225 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/utils.py | python | should_bypass_proxies | (url) | return False | Returns whether we should bypass proxies or not. | Returns whether we should bypass proxies or not. | [
"Returns",
"whether",
"we",
"should",
"bypass",
"proxies",
"or",
"not",
"."
] | def should_bypass_proxies(url):
"""
Returns whether we should bypass proxies or not.
"""
get_proxy = lambda k: os.environ.get(k) or os.environ.get(k.upper())
# First check whether no_proxy is defined. If it is, check that the URL
# we're getting isn't in the no_proxy list.
no_proxy = get_pr... | [
"def",
"should_bypass_proxies",
"(",
"url",
")",
":",
"get_proxy",
"=",
"lambda",
"k",
":",
"os",
".",
"environ",
".",
"get",
"(",
"k",
")",
"or",
"os",
".",
"environ",
".",
"get",
"(",
"k",
".",
"upper",
"(",
")",
")",
"# First check whether no_proxy ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/utils.py#L487-L530 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/batch_execution.py | python | single_reduction_for_batch | (state, use_optimizations, output_mode, plot_results, output_graph, save_can=False) | return out_scale_factors, out_shift_factors | Runs a single reduction.
This function creates reduction packages which essentially contain information for a single valid reduction, run it
and store the results according to the user specified setting (output_mode). Although this is considered a single
reduction it can contain still several reductions si... | Runs a single reduction. | [
"Runs",
"a",
"single",
"reduction",
"."
] | def single_reduction_for_batch(state, use_optimizations, output_mode, plot_results, output_graph, save_can=False):
"""
Runs a single reduction.
This function creates reduction packages which essentially contain information for a single valid reduction, run it
and store the results according to the user... | [
"def",
"single_reduction_for_batch",
"(",
"state",
",",
"use_optimizations",
",",
"output_mode",
",",
"plot_results",
",",
"output_graph",
",",
"save_can",
"=",
"False",
")",
":",
"# -------------------------------------------------------------------------------------------------... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/batch_execution.py#L59-L187 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py | python | XMLReader.setContentHandler | (self, handler) | Registers a new object to receive document content events. | Registers a new object to receive document content events. | [
"Registers",
"a",
"new",
"object",
"to",
"receive",
"document",
"content",
"events",
"."
] | def setContentHandler(self, handler):
"Registers a new object to receive document content events."
self._cont_handler = handler | [
"def",
"setContentHandler",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"_cont_handler",
"=",
"handler"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py#L38-L40 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/P4.py | python | Map.is_empty | (self) | return self.count() == 0 | Returns True if this map has no entries yet, otherwise False | Returns True if this map has no entries yet, otherwise False | [
"Returns",
"True",
"if",
"this",
"map",
"has",
"no",
"entries",
"yet",
"otherwise",
"False"
] | def is_empty(self):
"""Returns True if this map has no entries yet, otherwise False"""
return self.count() == 0 | [
"def",
"is_empty",
"(",
"self",
")",
":",
"return",
"self",
".",
"count",
"(",
")",
"==",
"0"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/P4.py#L1411-L1417 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | demo/VART/resnet50_mt_py/resnet50.py | python | main | (argv) | image list to be run | image list to be run | [
"image",
"list",
"to",
"be",
"run"
] | def main(argv):
global threadnum
listimage = os.listdir(calib_image_dir)
threadAll = []
threadnum = int(argv[1])
i = 0
global runTotall
runTotall = len(listimage)
g = xir.Graph.deserialize(argv[2])
subgraphs = get_child_subgraph_dpu(g)
assert len(subgraphs) == 1 # only one DPU ... | [
"def",
"main",
"(",
"argv",
")",
":",
"global",
"threadnum",
"listimage",
"=",
"os",
".",
"listdir",
"(",
"calib_image_dir",
")",
"threadAll",
"=",
"[",
"]",
"threadnum",
"=",
"int",
"(",
"argv",
"[",
"1",
"]",
")",
"i",
"=",
"0",
"global",
"runTotal... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/VART/resnet50_mt_py/resnet50.py#L167-L219 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py | python | JIRA.assign_issue | (self, issue, assignee) | return True | Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
:param issue: the issue to assign
:param assignee: the user to assign the issue to | Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic. | [
"Assign",
"an",
"issue",
"to",
"a",
"user",
".",
"None",
"will",
"set",
"it",
"to",
"unassigned",
".",
"-",
"1",
"will",
"set",
"it",
"to",
"Automatic",
"."
] | def assign_issue(self, issue, assignee):
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
:param issue: the issue to assign
:param assignee: the user to assign the issue to
"""
url = self._options['server'] + \
'/rest/api/lat... | [
"def",
"assign_issue",
"(",
"self",
",",
"issue",
",",
"assignee",
")",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/api/latest/issue/'",
"+",
"str",
"(",
"issue",
")",
"+",
"'/assignee'",
"payload",
"=",
"{",
"'name'",
":... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L1278-L1290 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/build/android/pylib/valgrind_tools.py | python | MemcheckTool.GetTestWrapper | (self) | return ValgrindTool.VG_DIR + '/' + 'vg-chrome-wrapper.sh' | Returns a string that is to be prepended to the test command line. | Returns a string that is to be prepended to the test command line. | [
"Returns",
"a",
"string",
"that",
"is",
"to",
"be",
"prepended",
"to",
"the",
"test",
"command",
"line",
"."
] | def GetTestWrapper(self):
"""Returns a string that is to be prepended to the test command line."""
return ValgrindTool.VG_DIR + '/' + 'vg-chrome-wrapper.sh' | [
"def",
"GetTestWrapper",
"(",
"self",
")",
":",
"return",
"ValgrindTool",
".",
"VG_DIR",
"+",
"'/'",
"+",
"'vg-chrome-wrapper.sh'"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/valgrind_tools.py#L197-L199 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.__rpow__ | (self, other, context=None) | return other.__pow__(self, context=context) | Swaps self/other and returns __pow__. | Swaps self/other and returns __pow__. | [
"Swaps",
"self",
"/",
"other",
"and",
"returns",
"__pow__",
"."
] | def __rpow__(self, other, context=None):
"""Swaps self/other and returns __pow__."""
other = _convert_other(other)
if other is NotImplemented:
return other
return other.__pow__(self, context=context) | [
"def",
"__rpow__",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
")",
"if",
"other",
"is",
"NotImplemented",
":",
"return",
"other",
"return",
"other",
".",
"__pow__",
"(",
"self",
",",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L2390-L2395 | |
0xPhoeniX/MazeWalker | 4da160908419fdbf6fadf2c8b4794325f5cbcfba | MazeUI/mazeui.py | python | MazeUIPluginForm.__init__ | (self) | Initialization. | Initialization. | [
"Initialization",
"."
] | def __init__(self):
"""
Initialization.
"""
idaapi.PluginForm.__init__(self)
self.Widgets = []
self.iconp = Config().icons_path | [
"def",
"__init__",
"(",
"self",
")",
":",
"idaapi",
".",
"PluginForm",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"Widgets",
"=",
"[",
"]",
"self",
".",
"iconp",
"=",
"Config",
"(",
")",
".",
"icons_path"
] | https://github.com/0xPhoeniX/MazeWalker/blob/4da160908419fdbf6fadf2c8b4794325f5cbcfba/MazeUI/mazeui.py#L27-L33 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/fispact.py | python | parse_spectra | (data) | return spectra | reads gamma spectra data for each timestep
returns list of length 24 corresponding to 24 gamma energy groups
data is in gamma/s/cc | reads gamma spectra data for each timestep
returns list of length 24 corresponding to 24 gamma energy groups
data is in gamma/s/cc | [
"reads",
"gamma",
"spectra",
"data",
"for",
"each",
"timestep",
"returns",
"list",
"of",
"length",
"24",
"corresponding",
"to",
"24",
"gamma",
"energy",
"groups",
"data",
"is",
"in",
"gamma",
"/",
"s",
"/",
"cc"
] | def parse_spectra(data):
""" reads gamma spectra data for each timestep
returns list of length 24 corresponding to 24 gamma energy groups
data is in gamma/s/cc
"""
p1 = find_ind(data, "GAMMA SPECTRUM AND ENERGIES/SECOND")
data = data[p1+7:p1+31]
spectra = []
for l in data:
... | [
"def",
"parse_spectra",
"(",
"data",
")",
":",
"p1",
"=",
"find_ind",
"(",
"data",
",",
"\"GAMMA SPECTRUM AND ENERGIES/SECOND\"",
")",
"data",
"=",
"data",
"[",
"p1",
"+",
"7",
":",
"p1",
"+",
"31",
"]",
"spectra",
"=",
"[",
"]",
"for",
"l",
"in",
"d... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/fispact.py#L362-L372 | |
lukasmonk/lucaschess | 13e2e5cb13b38a720ccf897af649054a64bcb914 | Code/SQL/DBFcache.py | python | DBFcache.buscarID | (self, xid) | return -1 | Busca el recno de un ID.
@param xid: numero de id. | Busca el recno de un ID. | [
"Busca",
"el",
"recno",
"de",
"un",
"ID",
"."
] | def buscarID(self, xid):
"""
Busca el recno de un ID.
@param xid: numero de id.
"""
for r in range(self.reccount()):
if self.rowid(r) == xid:
return r
return -1 | [
"def",
"buscarID",
"(",
"self",
",",
"xid",
")",
":",
"for",
"r",
"in",
"range",
"(",
"self",
".",
"reccount",
"(",
")",
")",
":",
"if",
"self",
".",
"rowid",
"(",
"r",
")",
"==",
"xid",
":",
"return",
"r",
"return",
"-",
"1"
] | https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/SQL/DBFcache.py#L187-L196 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.