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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/RemoteConsole/ly_remote_console/ly_remote_console/remote_console_commands.py | python | _default_disconnect | () | On a disconnect a user can overwrite the functionality with any function, this one will just print to the
logger a line 'Disconnecting from the Port.'
:return: None | On a disconnect a user can overwrite the functionality with any function, this one will just print to the
logger a line 'Disconnecting from the Port.'
:return: None | [
"On",
"a",
"disconnect",
"a",
"user",
"can",
"overwrite",
"the",
"functionality",
"with",
"any",
"function",
"this",
"one",
"will",
"just",
"print",
"to",
"the",
"logger",
"a",
"line",
"Disconnecting",
"from",
"the",
"Port",
".",
":",
"return",
":",
"None"... | def _default_disconnect():
# type: () -> None
"""
On a disconnect a user can overwrite the functionality with any function, this one will just print to the
logger a line 'Disconnecting from the Port.'
:return: None
"""
logger.info('Disconnecting from the Port') | [
"def",
"_default_disconnect",
"(",
")",
":",
"# type: () -> None",
"logger",
".",
"info",
"(",
"'Disconnecting from the Port'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/RemoteConsole/ly_remote_console/ly_remote_console/remote_console_commands.py#L87-L94 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py | python | host_memory_extents | (obj) | return mviewbuf.memoryview_get_extents(obj) | Returns (start, end) the start and end pointer of the array (half open). | Returns (start, end) the start and end pointer of the array (half open). | [
"Returns",
"(",
"start",
"end",
")",
"the",
"start",
"and",
"end",
"pointer",
"of",
"the",
"array",
"(",
"half",
"open",
")",
"."
] | def host_memory_extents(obj):
"Returns (start, end) the start and end pointer of the array (half open)."
obj = _workaround_for_datetime(obj)
return mviewbuf.memoryview_get_extents(obj) | [
"def",
"host_memory_extents",
"(",
"obj",
")",
":",
"obj",
"=",
"_workaround_for_datetime",
"(",
"obj",
")",
"return",
"mviewbuf",
".",
"memoryview_get_extents",
"(",
"obj",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1821-L1824 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/input.py | python | SequenceFileStream.transform_from_node | (self, load_node, pipeline) | return pcollection.PCollection(transformed.node().leave_scope(), pipeline) | 内部方法 | 内部方法 | [
"内部方法"
] | def transform_from_node(self, load_node, pipeline):
""" 内部方法 """
transformed = load_node.repeatedly() \
.process_by(_KVFromBinaryRecord()) \
.as_type(serde.tuple_of(serde.StrSerde(), serde.StrSerde())) \
.set_effective_key_num(0) \
.input(0).allow_partial_... | [
"def",
"transform_from_node",
"(",
"self",
",",
"load_node",
",",
"pipeline",
")",
":",
"transformed",
"=",
"load_node",
".",
"repeatedly",
"(",
")",
".",
"process_by",
"(",
"_KVFromBinaryRecord",
"(",
")",
")",
".",
"as_type",
"(",
"serde",
".",
"tuple_of",... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/input.py#L742-L764 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/value_object/read/media/datfile/empiresdat.py | python | EmpiresDatWrapper.get_data_format_members | (cls, game_version) | return data_format | Return the members in this struct. | Return the members in this struct. | [
"Return",
"the",
"members",
"in",
"this",
"struct",
"."
] | def get_data_format_members(cls, game_version):
"""
Return the members in this struct.
"""
data_format = [
(READ_GEN, "empiresdat", StorageType.ARRAY_CONTAINER, SubdataMember(
ref_type=EmpiresDat,
length=1,
)),
]
re... | [
"def",
"get_data_format_members",
"(",
"cls",
",",
"game_version",
")",
":",
"data_format",
"=",
"[",
"(",
"READ_GEN",
",",
"\"empiresdat\"",
",",
"StorageType",
".",
"ARRAY_CONTAINER",
",",
"SubdataMember",
"(",
"ref_type",
"=",
"EmpiresDat",
",",
"length",
"="... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/value_object/read/media/datfile/empiresdat.py#L341-L352 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/enum_type_wrapper.py | python | EnumTypeWrapper.Name | (self, number) | Returns a string containing the name of an enum value. | Returns a string containing the name of an enum value. | [
"Returns",
"a",
"string",
"containing",
"the",
"name",
"of",
"an",
"enum",
"value",
"."
] | def Name(self, number): # pylint: disable=invalid-name
"""Returns a string containing the name of an enum value."""
try:
return self._enum_type.values_by_number[number].name
except KeyError:
pass # fall out to break exception chaining
if not isinstance(number, six.integer_types):
ra... | [
"def",
"Name",
"(",
"self",
",",
"number",
")",
":",
"# pylint: disable=invalid-name",
"try",
":",
"return",
"self",
".",
"_enum_type",
".",
"values_by_number",
"[",
"number",
"]",
".",
"name",
"except",
"KeyError",
":",
"pass",
"# fall out to break exception chai... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/enum_type_wrapper.py#L53-L67 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/inspect.py | python | _signature_is_functionlike | (obj) | return (isinstance(code, types.CodeType) and
isinstance(name, str) and
(defaults is None or isinstance(defaults, tuple)) and
(kwdefaults is None or isinstance(kwdefaults, dict)) and
isinstance(annotations, dict)) | Private helper to test if `obj` is a duck type of FunctionType.
A good example of such objects are functions compiled with
Cython, which have all attributes that a pure Python function
would have, but have their code statically compiled. | Private helper to test if `obj` is a duck type of FunctionType.
A good example of such objects are functions compiled with
Cython, which have all attributes that a pure Python function
would have, but have their code statically compiled. | [
"Private",
"helper",
"to",
"test",
"if",
"obj",
"is",
"a",
"duck",
"type",
"of",
"FunctionType",
".",
"A",
"good",
"example",
"of",
"such",
"objects",
"are",
"functions",
"compiled",
"with",
"Cython",
"which",
"have",
"all",
"attributes",
"that",
"a",
"pur... | def _signature_is_functionlike(obj):
"""Private helper to test if `obj` is a duck type of FunctionType.
A good example of such objects are functions compiled with
Cython, which have all attributes that a pure Python function
would have, but have their code statically compiled.
"""
if not callab... | [
"def",
"_signature_is_functionlike",
"(",
"obj",
")",
":",
"if",
"not",
"callable",
"(",
"obj",
")",
"or",
"isclass",
"(",
"obj",
")",
":",
"# All function-like objects are obviously callables,",
"# and not classes.",
"return",
"False",
"name",
"=",
"getattr",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/inspect.py#L1837-L1859 | |
xieyufei1993/FOTS | 9881966697fd5e2936d2cca8aa04309e4b64f77c | data/dataset.py | python | image_label | (txt_root, image_list, img_name, index,
input_size=512, random_scale=np.array([0.5, 1, 2.0, 3.0]),
background_ratio=3. / 8) | return images, score_maps, geo_maps, training_masks | get image's corresponding matrix and ground truth | get image's corresponding matrix and ground truth | [
"get",
"image",
"s",
"corresponding",
"matrix",
"and",
"ground",
"truth"
] | def image_label(txt_root, image_list, img_name, index,
input_size=512, random_scale=np.array([0.5, 1, 2.0, 3.0]),
background_ratio=3. / 8):
'''
get image's corresponding matrix and ground truth
'''
try:
im_fn = image_list[index]
im_name = img_name[index]
... | [
"def",
"image_label",
"(",
"txt_root",
",",
"image_list",
",",
"img_name",
",",
"index",
",",
"input_size",
"=",
"512",
",",
"random_scale",
"=",
"np",
".",
"array",
"(",
"[",
"0.5",
",",
"1",
",",
"2.0",
",",
"3.0",
"]",
")",
",",
"background_ratio",
... | https://github.com/xieyufei1993/FOTS/blob/9881966697fd5e2936d2cca8aa04309e4b64f77c/data/dataset.py#L566-L633 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddByteSizeMethod | (message_descriptor, cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddByteSizeMethod(message_descriptor, cls):
"""Helper for _AddMessageMethods()."""
def ByteSize(self):
if not self._cached_byte_size_dirty:
return self._cached_byte_size
size = 0
for field_descriptor, field_value in self.ListFields():
size += field_descriptor._sizer(field_value)
... | [
"def",
"_AddByteSizeMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"def",
"ByteSize",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_cached_byte_size_dirty",
":",
"return",
"self",
".",
"_cached_byte_size",
"size",
"=",
"0",
"for",
"field_descri... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L768-L784 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/turtle.py | python | TurtleScreen.getcanvas | (self) | return self.cv | Return the Canvas of this TurtleScreen.
No argument.
Example (for a Screen instance named screen):
>>> cv = screen.getcanvas()
>>> cv
<turtle.ScrolledCanvas instance at 0x010742D8> | Return the Canvas of this TurtleScreen. | [
"Return",
"the",
"Canvas",
"of",
"this",
"TurtleScreen",
"."
] | def getcanvas(self):
"""Return the Canvas of this TurtleScreen.
No argument.
Example (for a Screen instance named screen):
>>> cv = screen.getcanvas()
>>> cv
<turtle.ScrolledCanvas instance at 0x010742D8>
"""
return self.cv | [
"def",
"getcanvas",
"(",
"self",
")",
":",
"return",
"self",
".",
"cv"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L1327-L1337 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/nn/api/remote_module.py | python | _recursive_script_module_receiver | (
recursive_script_module_serialized,
) | return m | Deserializes a RecursiveScirptModule that does not contain a script RemoteModule. | Deserializes a RecursiveScirptModule that does not contain a script RemoteModule. | [
"Deserializes",
"a",
"RecursiveScirptModule",
"that",
"does",
"not",
"contain",
"a",
"script",
"RemoteModule",
"."
] | def _recursive_script_module_receiver(
recursive_script_module_serialized,
):
"""
Deserializes a RecursiveScirptModule that does not contain a script RemoteModule.
"""
f = io.BytesIO(recursive_script_module_serialized)
m = torch.jit.load(f)
return m | [
"def",
"_recursive_script_module_receiver",
"(",
"recursive_script_module_serialized",
",",
")",
":",
"f",
"=",
"io",
".",
"BytesIO",
"(",
"recursive_script_module_serialized",
")",
"m",
"=",
"torch",
".",
"jit",
".",
"load",
"(",
"f",
")",
"return",
"m"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/nn/api/remote_module.py#L707-L715 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py | python | Common.getItemElement | (self, context, arg) | return self.itemElement | Return an item element that was created by a previous call to the checkIfDBItem function | Return an item element that was created by a previous call to the checkIfDBItem function | [
"Return",
"an",
"item",
"element",
"that",
"was",
"created",
"by",
"a",
"previous",
"call",
"to",
"the",
"checkIfDBItem",
"function"
] | def getItemElement(self, context, arg):
''' Return an item element that was created by a previous call to the checkIfDBItem function
'''
return self.itemElement | [
"def",
"getItemElement",
"(",
"self",
",",
"context",
",",
"arg",
")",
":",
"return",
"self",
".",
"itemElement"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/common/common_api.py#L841-L844 | |
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeInt64 | (self) | return result | Consumes a signed 64bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If a signed 64bit integer couldn't be consumed. | Consumes a signed 64bit integer number. | [
"Consumes",
"a",
"signed",
"64bit",
"integer",
"number",
"."
] | def ConsumeInt64(self):
"""Consumes a signed 64bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If a signed 64bit integer couldn't be consumed.
"""
try:
result = self._ParseInteger(self.token, is_signed=True, is_long=True)
except ValueError, e:
raise... | [
"def",
"ConsumeInt64",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"self",
".",
"_ParseInteger",
"(",
"self",
".",
"token",
",",
"is_signed",
"=",
"True",
",",
"is_long",
"=",
"True",
")",
"except",
"ValueError",
",",
"e",
":",
"raise",
"self",
... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py#L442-L456 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/yaml_key_value.py | python | get_yaml_value | (yaml_file, yaml_key) | return str(yaml_dict.get(yaml_key, "")) | Return string value for 'yaml_key' from 'yaml_file'. | Return string value for 'yaml_key' from 'yaml_file'. | [
"Return",
"string",
"value",
"for",
"yaml_key",
"from",
"yaml_file",
"."
] | def get_yaml_value(yaml_file, yaml_key):
"""Return string value for 'yaml_key' from 'yaml_file'."""
with open(yaml_file, "r") as ystream:
yaml_dict = yaml.safe_load(ystream)
return str(yaml_dict.get(yaml_key, "")) | [
"def",
"get_yaml_value",
"(",
"yaml_file",
",",
"yaml_key",
")",
":",
"with",
"open",
"(",
"yaml_file",
",",
"\"r\"",
")",
"as",
"ystream",
":",
"yaml_dict",
"=",
"yaml",
".",
"safe_load",
"(",
"ystream",
")",
"return",
"str",
"(",
"yaml_dict",
".",
"get... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/yaml_key_value.py#L9-L13 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/stringold.py | python | index | (s, *args) | return _apply(s.index, args) | index(s, sub [,start [,end]]) -> int
Like find but raises ValueError when the substring is not found. | index(s, sub [,start [,end]]) -> int | [
"index",
"(",
"s",
"sub",
"[",
"start",
"[",
"end",
"]]",
")",
"-",
">",
"int"
] | def index(s, *args):
"""index(s, sub [,start [,end]]) -> int
Like find but raises ValueError when the substring is not found.
"""
return _apply(s.index, args) | [
"def",
"index",
"(",
"s",
",",
"*",
"args",
")",
":",
"return",
"_apply",
"(",
"s",
".",
"index",
",",
"args",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/stringold.py#L136-L142 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/optparse.py | python | OptionParser.enable_interspersed_args | (self) | Set parsing to not stop on the first non-option, allowing
interspersing switches with command arguments. This is the
default behavior. See also disable_interspersed_args() and the
class documentation description of the attribute
allow_interspersed_args. | Set parsing to not stop on the first non-option, allowing
interspersing switches with command arguments. This is the
default behavior. See also disable_interspersed_args() and the
class documentation description of the attribute
allow_interspersed_args. | [
"Set",
"parsing",
"to",
"not",
"stop",
"on",
"the",
"first",
"non",
"-",
"option",
"allowing",
"interspersing",
"switches",
"with",
"command",
"arguments",
".",
"This",
"is",
"the",
"default",
"behavior",
".",
"See",
"also",
"disable_interspersed_args",
"()",
... | def enable_interspersed_args(self):
"""Set parsing to not stop on the first non-option, allowing
interspersing switches with command arguments. This is the
default behavior. See also disable_interspersed_args() and the
class documentation description of the attribute
allow_inters... | [
"def",
"enable_interspersed_args",
"(",
"self",
")",
":",
"self",
".",
"allow_interspersed_args",
"=",
"True"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/optparse.py#L1275-L1281 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py | python | Calendar.monthdays2calendar | (self, year, month) | return [ days[i:i+7] for i in range(0, len(days), 7) ] | Return a matrix representing a month's calendar.
Each row represents a week; week entries are
(day number, weekday number) tuples. Day numbers outside this month
are zero. | Return a matrix representing a month's calendar.
Each row represents a week; week entries are
(day number, weekday number) tuples. Day numbers outside this month
are zero. | [
"Return",
"a",
"matrix",
"representing",
"a",
"month",
"s",
"calendar",
".",
"Each",
"row",
"represents",
"a",
"week",
";",
"week",
"entries",
"are",
"(",
"day",
"number",
"weekday",
"number",
")",
"tuples",
".",
"Day",
"numbers",
"outside",
"this",
"month... | def monthdays2calendar(self, year, month):
"""
Return a matrix representing a month's calendar.
Each row represents a week; week entries are
(day number, weekday number) tuples. Day numbers outside this month
are zero.
"""
days = list(self.itermonthdays2(year, mon... | [
"def",
"monthdays2calendar",
"(",
"self",
",",
"year",
",",
"month",
")",
":",
"days",
"=",
"list",
"(",
"self",
".",
"itermonthdays2",
"(",
"year",
",",
"month",
")",
")",
"return",
"[",
"days",
"[",
"i",
":",
"i",
"+",
"7",
"]",
"for",
"i",
"in... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py#L202-L210 | |
zhaoweicai/hwgq | ebc706bee3e2d145de1da4be446ce8de8740738f | scripts/cpp_lint.py | python | ReverseCloseExpression | (clean_lines, linenum, pos) | return (line, 0, -1) | If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | If input points to ) or } or ] or >, finds the position that opens it. | [
"If",
"input",
"points",
"to",
")",
"or",
"}",
"or",
"]",
"or",
">",
"finds",
"the",
"position",
"that",
"opens",
"it",
"."
] | def ReverseCloseExpression(clean_lines, linenum, pos):
"""If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance ... | [
"def",
"ReverseCloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"endchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"endchar",
"not",
"in",
"')}]>'",
":",
"return",
"("... | https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/scripts/cpp_lint.py#L1327-L1369 | |
tum-vision/fusenet | a1451be2971b348a01b0f525c2a3a7a0e215a591 | tools/extra/parse_log.py | python | parse_log | (path_to_log) | return train_dict_list, test_dict_list | Parse log file
Returns (train_dict_list, train_dict_names, test_dict_list, test_dict_names)
train_dict_list and test_dict_list are lists of dicts that define the table
rows
train_dict_names and test_dict_names are ordered tuples of the column names
for the two dict_lists | Parse log file
Returns (train_dict_list, train_dict_names, test_dict_list, test_dict_names) | [
"Parse",
"log",
"file",
"Returns",
"(",
"train_dict_list",
"train_dict_names",
"test_dict_list",
"test_dict_names",
")"
] | def parse_log(path_to_log):
"""Parse log file
Returns (train_dict_list, train_dict_names, test_dict_list, test_dict_names)
train_dict_list and test_dict_list are lists of dicts that define the table
rows
train_dict_names and test_dict_names are ordered tuples of the column names
for the two di... | [
"def",
"parse_log",
"(",
"path_to_log",
")",
":",
"regex_iteration",
"=",
"re",
".",
"compile",
"(",
"'Iteration (\\d+)'",
")",
"regex_train_output",
"=",
"re",
".",
"compile",
"(",
"'Train net output #(\\d+): (\\S+) = ([\\.\\deE+-]+)'",
")",
"regex_test_output",
"=",
... | https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/tools/extra/parse_log.py#L17-L74 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py | python | generate | (node, environment, name, filename, stream=None,
defer_init=False, optimized=True) | Generate the python source for a node tree. | Generate the python source for a node tree. | [
"Generate",
"the",
"python",
"source",
"for",
"a",
"node",
"tree",
"."
] | def generate(node, environment, name, filename, stream=None,
defer_init=False, optimized=True):
"""Generate the python source for a node tree."""
if not isinstance(node, nodes.Template):
raise TypeError('Can\'t compile non template nodes')
generator = environment.code_generator_class(en... | [
"def",
"generate",
"(",
"node",
",",
"environment",
",",
"name",
",",
"filename",
",",
"stream",
"=",
"None",
",",
"defer_init",
"=",
"False",
",",
"optimized",
"=",
"True",
")",
":",
"if",
"not",
"isinstance",
"(",
"node",
",",
"nodes",
".",
"Template... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py#L74-L84 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/tools/gcc.py | python | init_link_flags | (toolset, linker, condition) | Now, the vendor specific flags.
The parameter linker can be either gnu, darwin, osf, hpux or sun. | Now, the vendor specific flags.
The parameter linker can be either gnu, darwin, osf, hpux or sun. | [
"Now",
"the",
"vendor",
"specific",
"flags",
".",
"The",
"parameter",
"linker",
"can",
"be",
"either",
"gnu",
"darwin",
"osf",
"hpux",
"or",
"sun",
"."
] | def init_link_flags(toolset, linker, condition):
"""
Now, the vendor specific flags.
The parameter linker can be either gnu, darwin, osf, hpux or sun.
"""
toolset_link = toolset + '.link'
if linker == 'gnu':
# Strip the binary when no debugging is needed. We use --strip-all flag
... | [
"def",
"init_link_flags",
"(",
"toolset",
",",
"linker",
",",
"condition",
")",
":",
"toolset_link",
"=",
"toolset",
"+",
"'.link'",
"if",
"linker",
"==",
"'gnu'",
":",
"# Strip the binary when no debugging is needed. We use --strip-all flag",
"# as opposed to -s since icc ... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/tools/gcc.py#L459-L573 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | InputStream.GetC | (*args, **kwargs) | return _core_.InputStream_GetC(*args, **kwargs) | GetC(self) -> char | GetC(self) -> char | [
"GetC",
"(",
"self",
")",
"-",
">",
"char"
] | def GetC(*args, **kwargs):
"""GetC(self) -> char"""
return _core_.InputStream_GetC(*args, **kwargs) | [
"def",
"GetC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"InputStream_GetC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2194-L2196 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py | python | PthDistributions.add | (self, dist) | Add `dist` to the distribution map | Add `dist` to the distribution map | [
"Add",
"dist",
"to",
"the",
"distribution",
"map"
] | def add(self, dist):
"""Add `dist` to the distribution map"""
new_path = (
dist.location not in self.paths and (
dist.location not in self.sitedirs or
# account for '.' being in PYTHONPATH
dist.location == os.getcwd()
)
)
... | [
"def",
"add",
"(",
"self",
",",
"dist",
")",
":",
"new_path",
"=",
"(",
"dist",
".",
"location",
"not",
"in",
"self",
".",
"paths",
"and",
"(",
"dist",
".",
"location",
"not",
"in",
"self",
".",
"sitedirs",
"or",
"# account for '.' being in PYTHONPATH",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py#L1659-L1671 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | GCDC.SetGraphicsContext | (*args, **kwargs) | return _gdi_.GCDC_SetGraphicsContext(*args, **kwargs) | SetGraphicsContext(self, GraphicsContext ctx) | SetGraphicsContext(self, GraphicsContext ctx) | [
"SetGraphicsContext",
"(",
"self",
"GraphicsContext",
"ctx",
")"
] | def SetGraphicsContext(*args, **kwargs):
"""SetGraphicsContext(self, GraphicsContext ctx)"""
return _gdi_.GCDC_SetGraphicsContext(*args, **kwargs) | [
"def",
"SetGraphicsContext",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GCDC_SetGraphicsContext",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L6696-L6698 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | cast | (x, dtype) | return math_ops.cast(x, dtype) | Casts a tensor to a different dtype and returns it.
You can cast a Keras variable but it still returns a Keras tensor.
Arguments:
x: Keras tensor (or variable).
dtype: String, either (`'float16'`, `'float32'`, or `'float64'`).
Returns:
Keras tensor with dtype `dtype`.
Examples:
Cast ... | Casts a tensor to a different dtype and returns it. | [
"Casts",
"a",
"tensor",
"to",
"a",
"different",
"dtype",
"and",
"returns",
"it",
"."
] | def cast(x, dtype):
"""Casts a tensor to a different dtype and returns it.
You can cast a Keras variable but it still returns a Keras tensor.
Arguments:
x: Keras tensor (or variable).
dtype: String, either (`'float16'`, `'float32'`, or `'float64'`).
Returns:
Keras tensor with dtype `dtype`.... | [
"def",
"cast",
"(",
"x",
",",
"dtype",
")",
":",
"return",
"math_ops",
".",
"cast",
"(",
"x",
",",
"dtype",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L1537-L1565 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/interpolate/fitpack2.py | python | _BivariateSplineBase.get_coeffs | (self) | return self.tck[2] | Return spline coefficients. | Return spline coefficients. | [
"Return",
"spline",
"coefficients",
"."
] | def get_coeffs(self):
""" Return spline coefficients."""
return self.tck[2] | [
"def",
"get_coeffs",
"(",
"self",
")",
":",
"return",
"self",
".",
"tck",
"[",
"2",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/fitpack2.py#L787-L789 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/abinsdata.py | python | AbinsData.from_calculation_data | (filename: str,
ab_initio_program: str) | return data | Get AbinsData from ab initio calculation output file.
:param filename: Path to vibration/phonon data file
:param ab_initio_program: Program which generated data file; this should be a key in AbinsData.ab_initio_loaders | Get AbinsData from ab initio calculation output file. | [
"Get",
"AbinsData",
"from",
"ab",
"initio",
"calculation",
"output",
"file",
"."
] | def from_calculation_data(filename: str,
ab_initio_program: str) -> 'AbinsData':
"""
Get AbinsData from ab initio calculation output file.
:param filename: Path to vibration/phonon data file
:param ab_initio_program: Program which generated data file; this ... | [
"def",
"from_calculation_data",
"(",
"filename",
":",
"str",
",",
"ab_initio_program",
":",
"str",
")",
"->",
"'AbinsData'",
":",
"from",
"abins",
".",
"input",
"import",
"all_loaders",
"# Defer import to avoid loops when abins.__init__ imports AbinsData",
"if",
"ab_initi... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/abinsdata.py#L34-L50 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.semantic_parent | (self) | return self._semantic_parent | Return the semantic parent for this cursor. | Return the semantic parent for this cursor. | [
"Return",
"the",
"semantic",
"parent",
"for",
"this",
"cursor",
"."
] | def semantic_parent(self):
"""Return the semantic parent for this cursor."""
if not hasattr(self, '_semantic_parent'):
self._semantic_parent = conf.lib.clang_getCursorSemanticParent(self)
return self._semantic_parent | [
"def",
"semantic_parent",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_semantic_parent'",
")",
":",
"self",
".",
"_semantic_parent",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorSemanticParent",
"(",
"self",
")",
"return",
"self",
"."... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L1733-L1738 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/nodes.py | python | Node.set_ctx | (self, ctx) | return self | Reset the context of a node and all child nodes. Per default the
parser will all generate nodes that have a 'load' context as it's the
most common one. This method is used in the parser to set assignment
targets and other nodes to a store context. | Reset the context of a node and all child nodes. Per default the
parser will all generate nodes that have a 'load' context as it's the
most common one. This method is used in the parser to set assignment
targets and other nodes to a store context. | [
"Reset",
"the",
"context",
"of",
"a",
"node",
"and",
"all",
"child",
"nodes",
".",
"Per",
"default",
"the",
"parser",
"will",
"all",
"generate",
"nodes",
"that",
"have",
"a",
"load",
"context",
"as",
"it",
"s",
"the",
"most",
"common",
"one",
".",
"Thi... | def set_ctx(self, ctx):
"""Reset the context of a node and all child nodes. Per default the
parser will all generate nodes that have a 'load' context as it's the
most common one. This method is used in the parser to set assignment
targets and other nodes to a store context.
"""... | [
"def",
"set_ctx",
"(",
"self",
",",
"ctx",
")",
":",
"todo",
"=",
"deque",
"(",
"[",
"self",
"]",
")",
"while",
"todo",
":",
"node",
"=",
"todo",
".",
"popleft",
"(",
")",
"if",
"'ctx'",
"in",
"node",
".",
"fields",
":",
"node",
".",
"ctx",
"="... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/nodes.py#L194-L206 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/initializer.py | python | Initializer._init_weight | (self, name, arr) | Abstruct method to Initialize weight | Abstruct method to Initialize weight | [
"Abstruct",
"method",
"to",
"Initialize",
"weight"
] | def _init_weight(self, name, arr):
"""Abstruct method to Initialize weight"""
raise NotImplementedError("Must override it") | [
"def",
"_init_weight",
"(",
"self",
",",
"name",
",",
"arr",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Must override it\"",
")"
] | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/initializer.py#L74-L76 | ||
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Wrapping/Generators/Python/itk/support/extras.py | python | index | (image_or_filter: "itkt.ImageOrImageSource") | return img.GetLargestPossibleRegion().GetIndex() | Return the index of an image, or of the output image of a filter
This method take care of updating the needed information | Return the index of an image, or of the output image of a filter | [
"Return",
"the",
"index",
"of",
"an",
"image",
"or",
"of",
"the",
"output",
"image",
"of",
"a",
"filter"
] | def index(image_or_filter: "itkt.ImageOrImageSource") -> Sequence[int]:
"""Return the index of an image, or of the output image of a filter
This method take care of updating the needed information
"""
import itk
# we don't need the entire output, only its size
image_or_filter.UpdateOutputInfor... | [
"def",
"index",
"(",
"image_or_filter",
":",
"\"itkt.ImageOrImageSource\"",
")",
"->",
"Sequence",
"[",
"int",
"]",
":",
"import",
"itk",
"# we don't need the entire output, only its size",
"image_or_filter",
".",
"UpdateOutputInformation",
"(",
")",
"img",
"=",
"itk",
... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/extras.py#L227-L237 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/Paste/paste/util/datetimeutil.py | python | normalize_timedelta | (val) | return "%d.%02d" % (hr, mn * 100/60) | produces a normalized string value of the timedelta
This module returns a normalized time span value consisting of the
number of hours in fractional form. For example '1h 15min' is
formatted as 01.25. | produces a normalized string value of the timedelta | [
"produces",
"a",
"normalized",
"string",
"value",
"of",
"the",
"timedelta"
] | def normalize_timedelta(val):
"""
produces a normalized string value of the timedelta
This module returns a normalized time span value consisting of the
number of hours in fractional form. For example '1h 15min' is
formatted as 01.25.
"""
if type(val) == str:
val = parse_timedelta(v... | [
"def",
"normalize_timedelta",
"(",
"val",
")",
":",
"if",
"type",
"(",
"val",
")",
"==",
"str",
":",
"val",
"=",
"parse_timedelta",
"(",
"val",
")",
"if",
"not",
"val",
":",
"return",
"''",
"hr",
"=",
"val",
".",
"seconds",
"/",
"3600",
"mn",
"=",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/util/datetimeutil.py#L99-L113 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/urllib/request.py | python | URLopener.retrieve | (self, url, filename=None, reporthook=None, data=None) | return result | retrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object. | retrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object. | [
"retrieve",
"(",
"url",
")",
"returns",
"(",
"filename",
"headers",
")",
"for",
"a",
"local",
"object",
"or",
"(",
"tempfilename",
"headers",
")",
"for",
"a",
"remote",
"object",
"."
] | def retrieve(self, url, filename=None, reporthook=None, data=None):
"""retrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object."""
url = unwrap(_to_bytes(url))
if self.tempcache and url in self.tempcache:
return self.tempcac... | [
"def",
"retrieve",
"(",
"self",
",",
"url",
",",
"filename",
"=",
"None",
",",
"reporthook",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"url",
"=",
"unwrap",
"(",
"_to_bytes",
"(",
"url",
")",
")",
"if",
"self",
".",
"tempcache",
"and",
"url"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/urllib/request.py#L1805-L1866 | |
llvm-mirror/libcxx | 78d6a7767ed57b50122a161b91f59f19c9bd0d19 | utils/libcxx/sym_check/extract.py | python | NMExtractor._want_sym | (sym) | return (sym['type'] not in bad_types
and sym['name'] not in ['__bss_start', '_end', '_edata']) | Check that s is a valid symbol that we want to keep. | Check that s is a valid symbol that we want to keep. | [
"Check",
"that",
"s",
"is",
"a",
"valid",
"symbol",
"that",
"we",
"want",
"to",
"keep",
"."
] | def _want_sym(sym):
"""
Check that s is a valid symbol that we want to keep.
"""
if sym is None or len(sym) < 2:
return False
if sym['name'] in extract_ignore_names:
return False
bad_types = ['t', 'b', 'r', 'd', 'w']
return (sym['type'] not... | [
"def",
"_want_sym",
"(",
"sym",
")",
":",
"if",
"sym",
"is",
"None",
"or",
"len",
"(",
"sym",
")",
"<",
"2",
":",
"return",
"False",
"if",
"sym",
"[",
"'name'",
"]",
"in",
"extract_ignore_names",
":",
"return",
"False",
"bad_types",
"=",
"[",
"'t'",
... | https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b50122a161b91f59f19c9bd0d19/utils/libcxx/sym_check/extract.py#L84-L94 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiManager.AddPane | (*args, **kwargs) | return _aui.AuiManager_AddPane(*args, **kwargs) | AddPane(self, Window window, AuiPaneInfo paneInfo, Point dropPos) -> bool | AddPane(self, Window window, AuiPaneInfo paneInfo, Point dropPos) -> bool | [
"AddPane",
"(",
"self",
"Window",
"window",
"AuiPaneInfo",
"paneInfo",
"Point",
"dropPos",
")",
"-",
">",
"bool"
] | def AddPane(*args, **kwargs):
"""AddPane(self, Window window, AuiPaneInfo paneInfo, Point dropPos) -> bool"""
return _aui.AuiManager_AddPane(*args, **kwargs) | [
"def",
"AddPane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiManager_AddPane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L643-L645 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/dos/load_castep.py | python | parse_castep_file | (file_name, ir_or_raman) | return file_data | Read frequencies from a <>.castep file
@param file_name - file path of the file to read
@return the frequencies, infra red and raman intensities and weights of frequency blocks | Read frequencies from a <>.castep file | [
"Read",
"frequencies",
"from",
"a",
"<",
">",
".",
"castep",
"file"
] | def parse_castep_file(file_name, ir_or_raman):
"""
Read frequencies from a <>.castep file
@param file_name - file path of the file to read
@return the frequencies, infra red and raman intensities and weights of frequency blocks
"""
file_data = {}
# Get Regex strings from load_helper
h... | [
"def",
"parse_castep_file",
"(",
"file_name",
",",
"ir_or_raman",
")",
":",
"file_data",
"=",
"{",
"}",
"# Get Regex strings from load_helper",
"header_regex",
"=",
"re",
".",
"compile",
"(",
"load_helper",
".",
"CASTEP_HEADER_REGEX",
")",
"data_regex",
"=",
"re",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/dos/load_castep.py#L14-L78 | |
ZhanLang/jcfs | cddcb29290e6eada908333e6c8b2d9dbc17bb7bd | code/scintilla/scripts/FileGenerator.py | python | Regenerate | (filename, commentPrefix, *lists) | Regenerate the given file. | Regenerate the given file. | [
"Regenerate",
"the",
"given",
"file",
"."
] | def Regenerate(filename, commentPrefix, *lists):
"""Regenerate the given file.
"""
Generate(filename, filename, commentPrefix, *lists) | [
"def",
"Regenerate",
"(",
"filename",
",",
"commentPrefix",
",",
"*",
"lists",
")",
":",
"Generate",
"(",
"filename",
",",
"filename",
",",
"commentPrefix",
",",
"*",
"lists",
")"
] | https://github.com/ZhanLang/jcfs/blob/cddcb29290e6eada908333e6c8b2d9dbc17bb7bd/code/scintilla/scripts/FileGenerator.py#L135-L138 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/estimator/export/export.py | python | build_parsing_serving_input_receiver_fn | (feature_spec,
default_batch_size=None) | return serving_input_receiver_fn | Build a serving_input_receiver_fn expecting fed tf.Examples.
Creates a serving_input_receiver_fn that expects a serialized tf.Example fed
into a string placeholder. The function parses the tf.Example according to
the provided feature_spec, and returns all parsed Tensors as features.
Args:
feature_spec: a... | Build a serving_input_receiver_fn expecting fed tf.Examples. | [
"Build",
"a",
"serving_input_receiver_fn",
"expecting",
"fed",
"tf",
".",
"Examples",
"."
] | def build_parsing_serving_input_receiver_fn(feature_spec,
default_batch_size=None):
"""Build a serving_input_receiver_fn expecting fed tf.Examples.
Creates a serving_input_receiver_fn that expects a serialized tf.Example fed
into a string placeholder. The function par... | [
"def",
"build_parsing_serving_input_receiver_fn",
"(",
"feature_spec",
",",
"default_batch_size",
"=",
"None",
")",
":",
"def",
"serving_input_receiver_fn",
"(",
")",
":",
"\"\"\"An input_fn that expects a serialized tf.Example.\"\"\"",
"serialized_tf_example",
"=",
"array_ops",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/estimator/export/export.py#L84-L109 | |
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/interfaces/covariance_interface.py | python | CovarianceInterface.covariance | (self, point_one, point_two) | r"""Compute the covariance function of two points, cov(``point_one``, ``point_two``).
.. Note:: comments are copied from the matching method comments of CovarianceInterface in gpp_covariance.hpp
and comments are copied to the matching method comments of
:mod:`moe.optimal_learning.python.pyt... | r"""Compute the covariance function of two points, cov(``point_one``, ``point_two``). | [
"r",
"Compute",
"the",
"covariance",
"function",
"of",
"two",
"points",
"cov",
"(",
"point_one",
"point_two",
")",
"."
] | def covariance(self, point_one, point_two):
r"""Compute the covariance function of two points, cov(``point_one``, ``point_two``).
.. Note:: comments are copied from the matching method comments of CovarianceInterface in gpp_covariance.hpp
and comments are copied to the matching method comment... | [
"def",
"covariance",
"(",
"self",
",",
"point_one",
",",
"point_two",
")",
":",
"pass"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/interfaces/covariance_interface.py#L74-L92 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py | python | _log10_lb | (c, correction = {
'1': 100, '2': 70, '3': 53, '4': 40, '5': 31,
'6': 23, '7': 16, '8': 10, '9': 5}) | return 100*len(str_c) - correction[str_c[0]] | Compute a lower bound for 100*log10(c) for a positive integer c. | Compute a lower bound for 100*log10(c) for a positive integer c. | [
"Compute",
"a",
"lower",
"bound",
"for",
"100",
"*",
"log10",
"(",
"c",
")",
"for",
"a",
"positive",
"integer",
"c",
"."
] | def _log10_lb(c, correction = {
'1': 100, '2': 70, '3': 53, '4': 40, '5': 31,
'6': 23, '7': 16, '8': 10, '9': 5}):
"""Compute a lower bound for 100*log10(c) for a positive integer c."""
if c <= 0:
raise ValueError("The argument to _log10_lb should be nonnegative.")
str_c = str(c)
... | [
"def",
"_log10_lb",
"(",
"c",
",",
"correction",
"=",
"{",
"'1'",
":",
"100",
",",
"'2'",
":",
"70",
",",
"'3'",
":",
"53",
",",
"'4'",
":",
"40",
",",
"'5'",
":",
"31",
",",
"'6'",
":",
"23",
",",
"'7'",
":",
"16",
",",
"'8'",
":",
"10",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L5824-L5831 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | _ProxyFile.close | (self) | Close the file. | Close the file. | [
"Close",
"the",
"file",
"."
] | def close(self):
"""Close the file."""
if hasattr(self, '_file'):
if hasattr(self._file, 'close'):
self._file.close()
del self._file | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'_file'",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"_file",
",",
"'close'",
")",
":",
"self",
".",
"_file",
".",
"close",
"(",
")",
"del",
"self",
".",
"_file"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L1905-L1910 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | RobotModel.getTotalInertia | (self) | return _robotsim.RobotModel_getTotalInertia(self) | r"""
Computes the 3x3 total inertia matrix of the robot. | r"""
Computes the 3x3 total inertia matrix of the robot. | [
"r",
"Computes",
"the",
"3x3",
"total",
"inertia",
"matrix",
"of",
"the",
"robot",
"."
] | def getTotalInertia(self) ->None:
r"""
Computes the 3x3 total inertia matrix of the robot.
"""
return _robotsim.RobotModel_getTotalInertia(self) | [
"def",
"getTotalInertia",
"(",
"self",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"RobotModel_getTotalInertia",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4934-L4939 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | examples/manipulation_station/end_effector_teleop_sliders.py | python | EndEffectorTeleop.SetRPY | (self, rpy) | @param rpy is a RollPitchYaw object | [] | def SetRPY(self, rpy):
"""
@param rpy is a RollPitchYaw object
"""
self.roll.set(rpy.roll_angle())
if not self.planar:
self.pitch.set(rpy.pitch_angle())
self.yaw.set(rpy.yaw_angle()) | [
"def",
"SetRPY",
"(",
"self",
",",
"rpy",
")",
":",
"self",
".",
"roll",
".",
"set",
"(",
"rpy",
".",
"roll_angle",
"(",
")",
")",
"if",
"not",
"self",
".",
"planar",
":",
"self",
".",
"pitch",
".",
"set",
"(",
"rpy",
".",
"pitch_angle",
"(",
"... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/examples/manipulation_station/end_effector_teleop_sliders.py#L152-L159 | |||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/webkit.py | python | WebKitNewWindowEvent.SetTargetName | (*args, **kwargs) | return _webkit.WebKitNewWindowEvent_SetTargetName(*args, **kwargs) | SetTargetName(self, String name) | SetTargetName(self, String name) | [
"SetTargetName",
"(",
"self",
"String",
"name",
")"
] | def SetTargetName(*args, **kwargs):
"""SetTargetName(self, String name)"""
return _webkit.WebKitNewWindowEvent_SetTargetName(*args, **kwargs) | [
"def",
"SetTargetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_webkit",
".",
"WebKitNewWindowEvent_SetTargetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/webkit.py#L274-L276 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | File._add_strings_to_dependency_map | (self, dmap) | return dmap | In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map
:return: | In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map
:return: | [
"In",
"the",
"case",
"comparing",
"node",
"objects",
"isn",
"t",
"sufficient",
"we",
"ll",
"add",
"the",
"strings",
"for",
"the",
"nodes",
"to",
"the",
"dependency",
"map",
":",
"return",
":"
] | def _add_strings_to_dependency_map(self, dmap):
"""
In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map
:return:
"""
first_string = str(next(iter(dmap)))
# print("DMAP:%s"%id(dmap))
if first_string not i... | [
"def",
"_add_strings_to_dependency_map",
"(",
"self",
",",
"dmap",
")",
":",
"first_string",
"=",
"str",
"(",
"next",
"(",
"iter",
"(",
"dmap",
")",
")",
")",
"# print(\"DMAP:%s\"%id(dmap))",
"if",
"first_string",
"not",
"in",
"dmap",
":",
"string_dict",
"=",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L3326-L3338 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/SampleData/SampleData.py | python | SampleDataLogic.registerCustomSampleDataSource | (category='Custom',
sampleName=None, uris=None, fileNames=None, nodeNames=None,
customDownloader=None, thumbnailFileName=None,
loadFileType='VolumeFile', loadFiles=None, loadFileProperties={},
checksums=None) | Adds custom data sets to SampleData.
:param category: Section title of data set in SampleData module GUI.
:param sampleName: Displayed name of data set in SampleData module GUI.
:param thumbnailFileName: Displayed thumbnail of data set in SampleData module GUI,
:param uris: Download URL(s).
:param f... | Adds custom data sets to SampleData.
:param category: Section title of data set in SampleData module GUI.
:param sampleName: Displayed name of data set in SampleData module GUI.
:param thumbnailFileName: Displayed thumbnail of data set in SampleData module GUI,
:param uris: Download URL(s).
:param f... | [
"Adds",
"custom",
"data",
"sets",
"to",
"SampleData",
".",
":",
"param",
"category",
":",
"Section",
"title",
"of",
"data",
"set",
"in",
"SampleData",
"module",
"GUI",
".",
":",
"param",
"sampleName",
":",
"Displayed",
"name",
"of",
"data",
"set",
"in",
... | def registerCustomSampleDataSource(category='Custom',
sampleName=None, uris=None, fileNames=None, nodeNames=None,
customDownloader=None, thumbnailFileName=None,
loadFileType='VolumeFile', loadFiles=None, loadFileProperties={},
checksums=None):
"""Adds custom data sets to SampleData.
:param categ... | [
"def",
"registerCustomSampleDataSource",
"(",
"category",
"=",
"'Custom'",
",",
"sampleName",
"=",
"None",
",",
"uris",
"=",
"None",
",",
"fileNames",
"=",
"None",
",",
"nodeNames",
"=",
"None",
",",
"customDownloader",
"=",
"None",
",",
"thumbnailFileName",
"... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/SampleData/SampleData.py#L412-L455 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/autograd.py | python | Asin.forward | (self, x) | return singa.Asin(x) | Args:
x (CTensor): Input tensor
Returns:
CTensor, the output | Args:
x (CTensor): Input tensor
Returns:
CTensor, the output | [
"Args",
":",
"x",
"(",
"CTensor",
")",
":",
"Input",
"tensor",
"Returns",
":",
"CTensor",
"the",
"output"
] | def forward(self, x):
"""
Args:
x (CTensor): Input tensor
Returns:
CTensor, the output
"""
if training:
self.input = x
return singa.Asin(x) | [
"def",
"forward",
"(",
"self",
",",
"x",
")",
":",
"if",
"training",
":",
"self",
".",
"input",
"=",
"x",
"return",
"singa",
".",
"Asin",
"(",
"x",
")"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L2239-L2248 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py | python | shared_embedding_columns | (sparse_id_columns,
dimension,
combiner="mean",
shared_embedding_name=None,
initializer=None,
ckpt_to_load_from=None,
tensor_name_in_ckpt=None,
... | Creates a list of `_EmbeddingColumn` sharing the same embedding.
Args:
sparse_id_columns: An iterable of `_SparseColumn`, such as those created by
`sparse_column_with_*` or crossed_column functions. Note that `combiner`
defined in each sparse_id_column is ignored.
dimension: An integer specifying... | Creates a list of `_EmbeddingColumn` sharing the same embedding. | [
"Creates",
"a",
"list",
"of",
"_EmbeddingColumn",
"sharing",
"the",
"same",
"embedding",
"."
] | def shared_embedding_columns(sparse_id_columns,
dimension,
combiner="mean",
shared_embedding_name=None,
initializer=None,
ckpt_to_load_from=None,
... | [
"def",
"shared_embedding_columns",
"(",
"sparse_id_columns",
",",
"dimension",
",",
"combiner",
"=",
"\"mean\"",
",",
"shared_embedding_name",
"=",
"None",
",",
"initializer",
"=",
"None",
",",
"ckpt_to_load_from",
"=",
"None",
",",
"tensor_name_in_ckpt",
"=",
"None... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py#L1355-L1485 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/command_interface/ISISCommandInterface.py | python | TransWorkspace | (sample, can=None) | Use a given workpspace that contains pre-calculated transmissions
@param sample the workspace to use for the sample
@param can calculated transmission for the can | Use a given workpspace that contains pre-calculated transmissions | [
"Use",
"a",
"given",
"workpspace",
"that",
"contains",
"pre",
"-",
"calculated",
"transmissions"
] | def TransWorkspace(sample, can=None):
"""
Use a given workpspace that contains pre-calculated transmissions
@param sample the workspace to use for the sample
@param can calculated transmission for the can
"""
_, _ = sample, can # noqa
raise NotImplementedError("The TransWorkspac... | [
"def",
"TransWorkspace",
"(",
"sample",
",",
"can",
"=",
"None",
")",
":",
"_",
",",
"_",
"=",
"sample",
",",
"can",
"# noqa",
"raise",
"NotImplementedError",
"(",
"\"The TransWorkspace command is not implemented in SANS v2.\"",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/command_interface/ISISCommandInterface.py#L132-L139 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/environment.py | python | Template.debug_info | (self) | return [tuple(imap(int, x.split('='))) for x in
self._debug_info.split('&')] | The debug info mapping. | The debug info mapping. | [
"The",
"debug",
"info",
"mapping",
"."
] | def debug_info(self):
"""The debug info mapping."""
return [tuple(imap(int, x.split('='))) for x in
self._debug_info.split('&')] | [
"def",
"debug_info",
"(",
"self",
")",
":",
"return",
"[",
"tuple",
"(",
"imap",
"(",
"int",
",",
"x",
".",
"split",
"(",
"'='",
")",
")",
")",
"for",
"x",
"in",
"self",
".",
"_debug_info",
".",
"split",
"(",
"'&'",
")",
"]"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/environment.py#L1125-L1128 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Rect2D.GetRight | (*args, **kwargs) | return _core_.Rect2D_GetRight(*args, **kwargs) | GetRight(self) -> Double | GetRight(self) -> Double | [
"GetRight",
"(",
"self",
")",
"-",
">",
"Double"
] | def GetRight(*args, **kwargs):
"""GetRight(self) -> Double"""
return _core_.Rect2D_GetRight(*args, **kwargs) | [
"def",
"GetRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect2D_GetRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1891-L1893 | |
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/python/cpplint/cpplint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/python/cpplint/cpplint.py#L2574-L2735 | ||
gitahead/gitahead | 711a9633149ef8f9dd0d2d6becfee4e147b6458c | dep/scintilla/scintilla-3.21.0/scripts/FileGenerator.py | python | UpdateLineInPlistFile | (path, key, value) | Replace a single string value preceded by 'key' in an XML plist file. | Replace a single string value preceded by 'key' in an XML plist file. | [
"Replace",
"a",
"single",
"string",
"value",
"preceded",
"by",
"key",
"in",
"an",
"XML",
"plist",
"file",
"."
] | def UpdateLineInPlistFile(path, key, value):
"""Replace a single string value preceded by 'key' in an XML plist file.
"""
lines = []
keyCurrent = ""
with codecs.open(path, "rb", "utf-8") as f:
for l in f.readlines():
ls = l.strip()
if ls.startswith("<key>"):
... | [
"def",
"UpdateLineInPlistFile",
"(",
"path",
",",
"key",
",",
"value",
")",
":",
"lines",
"=",
"[",
"]",
"keyCurrent",
"=",
"\"\"",
"with",
"codecs",
".",
"open",
"(",
"path",
",",
"\"rb\"",
",",
"\"utf-8\"",
")",
"as",
"f",
":",
"for",
"l",
"in",
... | https://github.com/gitahead/gitahead/blob/711a9633149ef8f9dd0d2d6becfee4e147b6458c/dep/scintilla/scintilla-3.21.0/scripts/FileGenerator.py#L140-L157 | ||
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | python/caffe/coord_map.py | python | conv_params | (fn) | return (axis, np.array(params.get('stride', 1), ndmin=1),
(ks - 1) * dilation + 1,
np.array(params.get('pad', 0), ndmin=1)) | Extract the spatial parameters that determine the coordinate mapping:
kernel size, stride, padding, and dilation.
Implementation detail: Convolution, Deconvolution, and Im2col layers
define these in the convolution_param message, while Pooling has its
own fields in pooling_param. This method deals with... | Extract the spatial parameters that determine the coordinate mapping:
kernel size, stride, padding, and dilation. | [
"Extract",
"the",
"spatial",
"parameters",
"that",
"determine",
"the",
"coordinate",
"mapping",
":",
"kernel",
"size",
"stride",
"padding",
"and",
"dilation",
"."
] | def conv_params(fn):
"""
Extract the spatial parameters that determine the coordinate mapping:
kernel size, stride, padding, and dilation.
Implementation detail: Convolution, Deconvolution, and Im2col layers
define these in the convolution_param message, while Pooling has its
own fields in pool... | [
"def",
"conv_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'convolution_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"1",
")",
"ks",
"=",
"np",
".",
"array",
... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/python/caffe/coord_map.py#L18-L37 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | examples/clingo/dl/app.py | python | DLPropagator.init | (self, init: PropagateInit) | Initialize the propagator extracting difference constraints from the
theory data. | Initialize the propagator extracting difference constraints from the
theory data. | [
"Initialize",
"the",
"propagator",
"extracting",
"difference",
"constraints",
"from",
"the",
"theory",
"data",
"."
] | def init(self, init: PropagateInit):
'''
Initialize the propagator extracting difference constraints from the
theory data.
'''
for atom in init.theory_atoms:
term = atom.term
if term.name == "diff" and len(term.arguments) == 1:
assert atom.... | [
"def",
"init",
"(",
"self",
",",
"init",
":",
"PropagateInit",
")",
":",
"for",
"atom",
"in",
"init",
".",
"theory_atoms",
":",
"term",
"=",
"atom",
".",
"term",
"if",
"term",
".",
"name",
"==",
"\"diff\"",
"and",
"len",
"(",
"term",
".",
"arguments"... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/examples/clingo/dl/app.py#L277-L292 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py | python | extract_dask_data | (data) | Extract data from dask.Series or dask.DataFrame for predictors. | Extract data from dask.Series or dask.DataFrame for predictors. | [
"Extract",
"data",
"from",
"dask",
".",
"Series",
"or",
"dask",
".",
"DataFrame",
"for",
"predictors",
"."
] | def extract_dask_data(data):
"""Extract data from dask.Series or dask.DataFrame for predictors."""
if isinstance(data, allowed_classes):
return _construct_dask_df_with_divisions(data)
else:
return data | [
"def",
"extract_dask_data",
"(",
"data",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"allowed_classes",
")",
":",
"return",
"_construct_dask_df_with_divisions",
"(",
"data",
")",
"else",
":",
"return",
"data"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py#L63-L68 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/passes/graph_manipulation.py | python | serialize_module | (fx_module: GraphModule, weights: Dict, name_prefix="") | return serialized_dict | Recursively Serializes a graph module (fx_module) to a dictionary which is later exported to JSON.
It also adds all weights the provided weights dictionary by qualified_name.
Dictionary Schema:
MODULE
{
modules: {module_name: MODULE],
nodes: [NODE],
weights {qualified_name: WEIGH... | Recursively Serializes a graph module (fx_module) to a dictionary which is later exported to JSON.
It also adds all weights the provided weights dictionary by qualified_name.
Dictionary Schema:
MODULE
{
modules: {module_name: MODULE],
nodes: [NODE],
weights {qualified_name: WEIGH... | [
"Recursively",
"Serializes",
"a",
"graph",
"module",
"(",
"fx_module",
")",
"to",
"a",
"dictionary",
"which",
"is",
"later",
"exported",
"to",
"JSON",
".",
"It",
"also",
"adds",
"all",
"weights",
"the",
"provided",
"weights",
"dictionary",
"by",
"qualified_nam... | def serialize_module(fx_module: GraphModule, weights: Dict, name_prefix="") -> Dict:
"""Recursively Serializes a graph module (fx_module) to a dictionary which is later exported to JSON.
It also adds all weights the provided weights dictionary by qualified_name.
Dictionary Schema:
MODULE
{
m... | [
"def",
"serialize_module",
"(",
"fx_module",
":",
"GraphModule",
",",
"weights",
":",
"Dict",
",",
"name_prefix",
"=",
"\"\"",
")",
"->",
"Dict",
":",
"serialized_dict",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
"=",
"{",
"}",
"serialized_dict",
"[",
"\"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/passes/graph_manipulation.py#L248-L465 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Sizer.GetItemCount | (*args, **kwargs) | return _core_.Sizer_GetItemCount(*args, **kwargs) | GetItemCount(self) -> size_t | GetItemCount(self) -> size_t | [
"GetItemCount",
"(",
"self",
")",
"-",
">",
"size_t"
] | def GetItemCount(*args, **kwargs):
"""GetItemCount(self) -> size_t"""
return _core_.Sizer_GetItemCount(*args, **kwargs) | [
"def",
"GetItemCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_GetItemCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L14756-L14758 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.setundobuffer | (self, size) | Set or disable undobuffer.
Argument:
size -- an integer or None
If size is an integer an empty undobuffer of given size is installed.
Size gives the maximum number of turtle-actions that can be undone
by the undo() function.
If size is None, no undobuffer is present.
... | Set or disable undobuffer. | [
"Set",
"or",
"disable",
"undobuffer",
"."
] | def setundobuffer(self, size):
"""Set or disable undobuffer.
Argument:
size -- an integer or None
If size is an integer an empty undobuffer of given size is installed.
Size gives the maximum number of turtle-actions that can be undone
by the undo() function.
If ... | [
"def",
"setundobuffer",
"(",
"self",
",",
"size",
")",
":",
"if",
"size",
"is",
"None",
":",
"self",
".",
"undobuffer",
"=",
"None",
"else",
":",
"self",
".",
"undobuffer",
"=",
"Tbuffer",
"(",
"size",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L2488-L2505 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/hulu/hulu_api.py | python | Videos.searchTitle | (self, title, pagenumber, pagelen) | return [itemDict, morePages] | Key word video search of the Hulu web site
return an array of matching item elements
return | Key word video search of the Hulu web site
return an array of matching item elements
return | [
"Key",
"word",
"video",
"search",
"of",
"the",
"Hulu",
"web",
"site",
"return",
"an",
"array",
"of",
"matching",
"item",
"elements",
"return"
] | def searchTitle(self, title, pagenumber, pagelen):
'''Key word video search of the Hulu web site
return an array of matching item elements
return
'''
# Save the origninal URL
orgUrl = self.hulu_config.find('searchURLS').xpath(".//href")[0].text
url = self.hulu_co... | [
"def",
"searchTitle",
"(",
"self",
",",
"title",
",",
"pagenumber",
",",
"pagelen",
")",
":",
"# Save the origninal URL",
"orgUrl",
"=",
"self",
".",
"hulu_config",
".",
"find",
"(",
"'searchURLS'",
")",
".",
"xpath",
"(",
"\".//href\"",
")",
"[",
"0",
"]"... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/hulu/hulu_api.py#L271-L368 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/format/policy_templates/writers/doc_writer.py | python | DocWriter._AddDictionaryExampleAndroidLinux | (self, parent, policy) | Adds an example value for Android/Linux of a 'dict' policy to a DOM node.
Args:
parent: The DOM node for which the example will be added.
policy: A policy of type 'dict', for which the Android/Linux example value
is generated. | Adds an example value for Android/Linux of a 'dict' policy to a DOM node. | [
"Adds",
"an",
"example",
"value",
"for",
"Android",
"/",
"Linux",
"of",
"a",
"dict",
"policy",
"to",
"a",
"DOM",
"node",
"."
] | def _AddDictionaryExampleAndroidLinux(self, parent, policy):
'''Adds an example value for Android/Linux of a 'dict' policy to a DOM node.
Args:
parent: The DOM node for which the example will be added.
policy: A policy of type 'dict', for which the Android/Linux example value
is generated.
... | [
"def",
"_AddDictionaryExampleAndroidLinux",
"(",
"self",
",",
"parent",
",",
"policy",
")",
":",
"self",
".",
"AddElement",
"(",
"parent",
",",
"'dt'",
",",
"{",
"}",
",",
"'Android/Linux:'",
")",
"element",
"=",
"self",
".",
"_AddStyledElement",
"(",
"paren... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/doc_writer.py#L317-L328 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/superplot/presenter.py | python | SuperplotPresenter.on_workspace_renamed | (self, old_name, new_name) | Triggered when the model reports a workspace renaming.
Args:
old_name (str): old name of the workspace
new_name (str): new name of the workspace | Triggered when the model reports a workspace renaming. | [
"Triggered",
"when",
"the",
"model",
"reports",
"a",
"workspace",
"renaming",
"."
] | def on_workspace_renamed(self, old_name, new_name):
"""
Triggered when the model reports a workspace renaming.
Args:
old_name (str): old name of the workspace
new_name (str): new name of the workspace
"""
selection = self._view.get_selection()
if ... | [
"def",
"on_workspace_renamed",
"(",
"self",
",",
"old_name",
",",
"new_name",
")",
":",
"selection",
"=",
"self",
".",
"_view",
".",
"get_selection",
"(",
")",
"if",
"old_name",
"in",
"selection",
":",
"selection",
"[",
"new_name",
"]",
"=",
"selection",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/superplot/presenter.py#L584-L598 | ||
ros-planning/moveit2 | dd240ef6fd8b9932a7a53964140f2952786187a9 | moveit_commander/src/moveit_commander/move_group.py | python | MoveGroupCommander.set_workspace | (self, ws) | Set the workspace for the robot as either [], [minX, minY, maxX, maxY] or [minX, minY, minZ, maxX, maxY, maxZ] | Set the workspace for the robot as either [], [minX, minY, maxX, maxY] or [minX, minY, minZ, maxX, maxY, maxZ] | [
"Set",
"the",
"workspace",
"for",
"the",
"robot",
"as",
"either",
"[]",
"[",
"minX",
"minY",
"maxX",
"maxY",
"]",
"or",
"[",
"minX",
"minY",
"minZ",
"maxX",
"maxY",
"maxZ",
"]"
] | def set_workspace(self, ws):
""" Set the workspace for the robot as either [], [minX, minY, maxX, maxY] or [minX, minY, minZ, maxX, maxY, maxZ] """
if len(ws) == 0:
self._g.set_workspace(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
else:
if len(ws) == 4:
self._g.set_work... | [
"def",
"set_workspace",
"(",
"self",
",",
"ws",
")",
":",
"if",
"len",
"(",
"ws",
")",
"==",
"0",
":",
"self",
".",
"_g",
".",
"set_workspace",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
",",
"0.0",
",",
"0.0",
",",
"0.0",
")",
"else",
":",
"if",
"l... | https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_commander/src/moveit_commander/move_group.py#L556-L569 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Compiler/ParseTreeTransforms.py | python | AnalyseDeclarationsTransform._handle_fused_def_decorators | (self, old_decorators, env, node) | return node | Create function calls to the decorators and reassignments to
the function. | Create function calls to the decorators and reassignments to
the function. | [
"Create",
"function",
"calls",
"to",
"the",
"decorators",
"and",
"reassignments",
"to",
"the",
"function",
"."
] | def _handle_fused_def_decorators(self, old_decorators, env, node):
"""
Create function calls to the decorators and reassignments to
the function.
"""
# Delete staticmethod and classmethod decorators, this is
# handled directly by the fused function object.
decorat... | [
"def",
"_handle_fused_def_decorators",
"(",
"self",
",",
"old_decorators",
",",
"env",
",",
"node",
")",
":",
"# Delete staticmethod and classmethod decorators, this is",
"# handled directly by the fused function object.",
"decorators",
"=",
"[",
"]",
"for",
"decorator",
"in"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/ParseTreeTransforms.py#L1772-L1796 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Wm.wm_minsize | (self, width=None, height=None) | return self._getints(self.tk.call(
'wm', 'minsize', self._w, width, height)) | Set min WIDTH and HEIGHT for this widget. If the window is gridded
the values are given in grid units. Return the current values if None
is given. | Set min WIDTH and HEIGHT for this widget. If the window is gridded
the values are given in grid units. Return the current values if None
is given. | [
"Set",
"min",
"WIDTH",
"and",
"HEIGHT",
"for",
"this",
"widget",
".",
"If",
"the",
"window",
"is",
"gridded",
"the",
"values",
"are",
"given",
"in",
"grid",
"units",
".",
"Return",
"the",
"current",
"values",
"if",
"None",
"is",
"given",
"."
] | def wm_minsize(self, width=None, height=None):
"""Set min WIDTH and HEIGHT for this widget. If the window is gridded
the values are given in grid units. Return the current values if None
is given."""
return self._getints(self.tk.call(
'wm', 'minsize', self._w, width, height)) | [
"def",
"wm_minsize",
"(",
"self",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
")",
":",
"return",
"self",
".",
"_getints",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'minsize'",
",",
"self",
".",
"_w",
",",
"width",
",",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1658-L1663 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiPaneInfo.dock_direction_set | (self, value) | Setter for the `dock_direction`.
:param integer `value`: the docking direction. This can be one of the following bits:
============================ ======= =============================================
Dock Flag Value Description
============================ ======... | Setter for the `dock_direction`. | [
"Setter",
"for",
"the",
"dock_direction",
"."
] | def dock_direction_set(self, value):
"""
Setter for the `dock_direction`.
:param integer `value`: the docking direction. This can be one of the following bits:
============================ ======= =============================================
Dock Flag Value... | [
"def",
"dock_direction_set",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_dock_direction",
"=",
"value"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L568-L589 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/PyShell.py | python | ModifiedInterpreter.open_remote_stack_viewer | (self) | return | Initiate the remote stack viewer from a separate thread.
This method is called from the subprocess, and by returning from this
method we allow the subprocess to unblock. After a bit the shell
requests the subprocess to open the remote stack viewer which returns a
static object looking ... | Initiate the remote stack viewer from a separate thread. | [
"Initiate",
"the",
"remote",
"stack",
"viewer",
"from",
"a",
"separate",
"thread",
"."
] | def open_remote_stack_viewer(self):
"""Initiate the remote stack viewer from a separate thread.
This method is called from the subprocess, and by returning from this
method we allow the subprocess to unblock. After a bit the shell
requests the subprocess to open the remote stack viewer... | [
"def",
"open_remote_stack_viewer",
"(",
"self",
")",
":",
"self",
".",
"tkconsole",
".",
"text",
".",
"after",
"(",
"300",
",",
"self",
".",
"remote_stack_viewer",
")",
"return"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/PyShell.py#L583-L594 | |
bristolcrypto/SPDZ-2 | 721abfae849625a02ea49aabc534f9cf41ca643f | Compiler/oram.py | python | TreeORAM.batch_init | (self, values) | Batch initalization. Obliviously shuffles and adds N entries to
random leaf buckets. | Batch initalization. Obliviously shuffles and adds N entries to
random leaf buckets. | [
"Batch",
"initalization",
".",
"Obliviously",
"shuffles",
"and",
"adds",
"N",
"entries",
"to",
"random",
"leaf",
"buckets",
"."
] | def batch_init(self, values):
""" Batch initalization. Obliviously shuffles and adds N entries to
random leaf buckets. """
m = len(values)
assert((m & (m-1)) == 0)
if m != self.size:
raise CompilerError('Batch initialization must have N values.')
if self.v... | [
"def",
"batch_init",
"(",
"self",
",",
"values",
")",
":",
"m",
"=",
"len",
"(",
"values",
")",
"assert",
"(",
"(",
"m",
"&",
"(",
"m",
"-",
"1",
")",
")",
"==",
"0",
")",
"if",
"m",
"!=",
"self",
".",
"size",
":",
"raise",
"CompilerError",
"... | https://github.com/bristolcrypto/SPDZ-2/blob/721abfae849625a02ea49aabc534f9cf41ca643f/Compiler/oram.py#L1145-L1285 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | NativeFontInfo.GetFamily | (*args, **kwargs) | return _gdi_.NativeFontInfo_GetFamily(*args, **kwargs) | GetFamily(self) -> int | GetFamily(self) -> int | [
"GetFamily",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFamily(*args, **kwargs):
"""GetFamily(self) -> int"""
return _gdi_.NativeFontInfo_GetFamily(*args, **kwargs) | [
"def",
"GetFamily",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo_GetFamily",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1901-L1903 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/__init__.py | python | RawArray | (typecode_or_type, size_or_initializer) | return RawArray(typecode_or_type, size_or_initializer) | Returns a shared array | Returns a shared array | [
"Returns",
"a",
"shared",
"array"
] | def RawArray(typecode_or_type, size_or_initializer):
'''
Returns a shared array
'''
from multiprocessing.sharedctypes import RawArray
return RawArray(typecode_or_type, size_or_initializer) | [
"def",
"RawArray",
"(",
"typecode_or_type",
",",
"size_or_initializer",
")",
":",
"from",
"multiprocessing",
".",
"sharedctypes",
"import",
"RawArray",
"return",
"RawArray",
"(",
"typecode_or_type",
",",
"size_or_initializer",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/__init__.py#L241-L246 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiPaneInfo.SafeSet | (*args, **kwargs) | return _aui.AuiPaneInfo_SafeSet(*args, **kwargs) | SafeSet(self, AuiPaneInfo source) | SafeSet(self, AuiPaneInfo source) | [
"SafeSet",
"(",
"self",
"AuiPaneInfo",
"source",
")"
] | def SafeSet(*args, **kwargs):
"""SafeSet(self, AuiPaneInfo source)"""
return _aui.AuiPaneInfo_SafeSet(*args, **kwargs) | [
"def",
"SafeSet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_SafeSet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L233-L235 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/findif_response_utils/db_helper.py | python | stat | (db) | Checks displacement sub_directories for the status of each
displacement computation
db: (database) the database storing information for this distributed
property calculation
Returns: nothing
Throws: nothing | Checks displacement sub_directories for the status of each
displacement computation | [
"Checks",
"displacement",
"sub_directories",
"for",
"the",
"status",
"of",
"each",
"displacement",
"computation"
] | def stat(db):
"""
Checks displacement sub_directories for the status of each
displacement computation
db: (database) the database storing information for this distributed
property calculation
Returns: nothing
Throws: nothing
"""
n_finished = 0
for job, status in db[... | [
"def",
"stat",
"(",
"db",
")",
":",
"n_finished",
"=",
"0",
"for",
"job",
",",
"status",
"in",
"db",
"[",
"'job_status'",
"]",
".",
"items",
"(",
")",
":",
"if",
"status",
"==",
"'finished'",
":",
"n_finished",
"+=",
"1",
"elif",
"status",
"in",
"(... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/findif_response_utils/db_helper.py#L147-L177 | ||
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | python/dolfinx/io.py | python | ufl_mesh_from_gmsh | (gmsh_cell: int, gdim: int) | return ufl.Mesh(ufl.VectorElement(scalar_element)) | Create a UFL mesh from a Gmsh cell identifier and the geometric dimension.
See: # http://gmsh.info//doc/texinfo/gmsh.html#MSH-file-format | Create a UFL mesh from a Gmsh cell identifier and the geometric dimension.
See: # http://gmsh.info//doc/texinfo/gmsh.html#MSH-file-format | [
"Create",
"a",
"UFL",
"mesh",
"from",
"a",
"Gmsh",
"cell",
"identifier",
"and",
"the",
"geometric",
"dimension",
".",
"See",
":",
"#",
"http",
":",
"//",
"gmsh",
".",
"info",
"//",
"doc",
"/",
"texinfo",
"/",
"gmsh",
".",
"html#MSH",
"-",
"file",
"-"... | def ufl_mesh_from_gmsh(gmsh_cell: int, gdim: int) -> ufl.Mesh:
"""Create a UFL mesh from a Gmsh cell identifier and the geometric dimension.
See: # http://gmsh.info//doc/texinfo/gmsh.html#MSH-file-format
"""
shape, degree = _gmsh_to_cells[gmsh_cell]
cell = ufl.Cell(shape, geometric_dimension=gdim)
... | [
"def",
"ufl_mesh_from_gmsh",
"(",
"gmsh_cell",
":",
"int",
",",
"gdim",
":",
"int",
")",
"->",
"ufl",
".",
"Mesh",
":",
"shape",
",",
"degree",
"=",
"_gmsh_to_cells",
"[",
"gmsh_cell",
"]",
"cell",
"=",
"ufl",
".",
"Cell",
"(",
"shape",
",",
"geometric... | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/io.py#L165-L173 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/uuid.py | python | _random_getnode | () | return random.getrandbits(48) | (1 << 40) | Get a random node ID. | Get a random node ID. | [
"Get",
"a",
"random",
"node",
"ID",
"."
] | def _random_getnode():
"""Get a random node ID."""
# RFC 4122, $4.1.6 says "For systems with no IEEE address, a randomly or
# pseudo-randomly generated value may be used; see Section 4.5. The
# multicast bit must be set in such addresses, in order that they will
# never conflict with addresses obta... | [
"def",
"_random_getnode",
"(",
")",
":",
"# RFC 4122, $4.1.6 says \"For systems with no IEEE address, a randomly or",
"# pseudo-randomly generated value may be used; see Section 4.5. The",
"# multicast bit must be set in such addresses, in order that they will",
"# never conflict with addresses obt... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/uuid.py#L662-L675 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CustomTreeCtrl.GetBorderPen | (self) | return self._borderPen | Returns the pen used to draw the selected item border.
:return: An instance of :class:`Pen`.
:note: The border pen is not used if the Windows Vista selection style is applied. | Returns the pen used to draw the selected item border. | [
"Returns",
"the",
"pen",
"used",
"to",
"draw",
"the",
"selected",
"item",
"border",
"."
] | def GetBorderPen(self):
"""
Returns the pen used to draw the selected item border.
:return: An instance of :class:`Pen`.
:note: The border pen is not used if the Windows Vista selection style is applied.
"""
return self._borderPen | [
"def",
"GetBorderPen",
"(",
"self",
")",
":",
"return",
"self",
".",
"_borderPen"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L4161-L4170 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/numpy_ops/np_utils.py | python | finfo | (dtype) | return np.finfo(_to_numpy_type(dtype)) | Note that currently it just forwards to the numpy namesake, while
tensorflow and numpy dtypes may have different properties. | Note that currently it just forwards to the numpy namesake, while
tensorflow and numpy dtypes may have different properties. | [
"Note",
"that",
"currently",
"it",
"just",
"forwards",
"to",
"the",
"numpy",
"namesake",
"while",
"tensorflow",
"and",
"numpy",
"dtypes",
"may",
"have",
"different",
"properties",
"."
] | def finfo(dtype):
"""Note that currently it just forwards to the numpy namesake, while
tensorflow and numpy dtypes may have different properties."""
return np.finfo(_to_numpy_type(dtype)) | [
"def",
"finfo",
"(",
"dtype",
")",
":",
"return",
"np",
".",
"finfo",
"(",
"_to_numpy_type",
"(",
"dtype",
")",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/numpy_ops/np_utils.py#L475-L478 | |
doxygen/doxygen | c5d4b67565a5fadea5d84d28cfe86db605b4593f | examples/docstring.py | python | func | () | Documentation for a function.
More details. | Documentation for a function. | [
"Documentation",
"for",
"a",
"function",
"."
] | def func():
"""Documentation for a function.
More details.
"""
pass | [
"def",
"func",
"(",
")",
":",
"pass"
] | https://github.com/doxygen/doxygen/blob/c5d4b67565a5fadea5d84d28cfe86db605b4593f/examples/docstring.py#L7-L12 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/re.py | python | subn | (pattern, repl, string, count=0) | return _compile(pattern, 0).subn(repl, string, count) | Return a 2-tuple containing (new_string, number).
new_string is the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in the source
string by the replacement repl. number is the number of
substitutions that were made. repl can be either a string or a
callable; if ... | Return a 2-tuple containing (new_string, number).
new_string is the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in the source
string by the replacement repl. number is the number of
substitutions that were made. repl can be either a string or a
callable; if ... | [
"Return",
"a",
"2",
"-",
"tuple",
"containing",
"(",
"new_string",
"number",
")",
".",
"new_string",
"is",
"the",
"string",
"obtained",
"by",
"replacing",
"the",
"leftmost",
"non",
"-",
"overlapping",
"occurrences",
"of",
"the",
"pattern",
"in",
"the",
"sour... | def subn(pattern, repl, string, count=0):
"""Return a 2-tuple containing (new_string, number).
new_string is the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in the source
string by the replacement repl. number is the number of
substitutions that were made. r... | [
"def",
"subn",
"(",
"pattern",
",",
"repl",
",",
"string",
",",
"count",
"=",
"0",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"0",
")",
".",
"subn",
"(",
"repl",
",",
"string",
",",
"count",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/re.py#L153-L162 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py | python | Section.merge | (self, indict) | A recursive update - useful for merging config files.
>>> a = '''[section1]
... option1 = True
... [[subsection]]
... more_options = False
... # end of file'''.splitlines()
>>> b = '''# File is user.ini
... [section1]
... o... | A recursive update - useful for merging config files.
>>> a = '''[section1]
... option1 = True
... [[subsection]]
... more_options = False
... # end of file'''.splitlines()
>>> b = '''# File is user.ini
... [section1]
... o... | [
"A",
"recursive",
"update",
"-",
"useful",
"for",
"merging",
"config",
"files",
".",
">>>",
"a",
"=",
"[",
"section1",
"]",
"...",
"option1",
"=",
"True",
"...",
"[[",
"subsection",
"]]",
"...",
"more_options",
"=",
"False",
"...",
"#",
"end",
"of",
"f... | def merge(self, indict):
"""
A recursive update - useful for merging config files.
>>> a = '''[section1]
... option1 = True
... [[subsection]]
... more_options = False
... # end of file'''.splitlines()
>>> b = '''# File is user.ini... | [
"def",
"merge",
"(",
"self",
",",
"indict",
")",
":",
"for",
"key",
",",
"val",
"in",
"indict",
".",
"items",
"(",
")",
":",
"if",
"(",
"key",
"in",
"self",
"and",
"isinstance",
"(",
"self",
"[",
"key",
"]",
",",
"dict",
")",
"and",
"isinstance",... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py#L798-L822 | ||
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | BindHandler.WriteGLES2Implementation | (self, func, f) | Writes the GLES2 Implemention. | Writes the GLES2 Implemention. | [
"Writes",
"the",
"GLES2",
"Implemention",
"."
] | def WriteGLES2Implementation(self, func, f):
"""Writes the GLES2 Implemention."""
impl_func = func.GetInfo('impl_func', True)
if func.can_auto_generate and impl_func:
f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeType... | [
"def",
"WriteGLES2Implementation",
"(",
"self",
",",
"func",
",",
"f",
")",
":",
"impl_func",
"=",
"func",
".",
"GetInfo",
"(",
"'impl_func'",
",",
"True",
")",
"if",
"func",
".",
"can_auto_generate",
"and",
"impl_func",
":",
"f",
".",
"write",
"(",
"\"%... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L5897-L5927 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/preprocessing/image.py | python | random_shift | (x,
wrg,
hrg,
row_axis=1,
col_axis=2,
channel_axis=0,
fill_mode='nearest',
cval=0.) | return x | Performs a random spatial shift of a Numpy image tensor.
Arguments:
x: Input tensor. Must be 3D.
wrg: Width shift range, as a float fraction of the width.
hrg: Height shift range, as a float fraction of the height.
row_axis: Index of axis for rows in the input tensor.
col_axis: Index of... | Performs a random spatial shift of a Numpy image tensor. | [
"Performs",
"a",
"random",
"spatial",
"shift",
"of",
"a",
"Numpy",
"image",
"tensor",
"."
] | def random_shift(x,
wrg,
hrg,
row_axis=1,
col_axis=2,
channel_axis=0,
fill_mode='nearest',
cval=0.):
"""Performs a random spatial shift of a Numpy image tensor.
Arguments:
x: Input tensor. M... | [
"def",
"random_shift",
"(",
"x",
",",
"wrg",
",",
"hrg",
",",
"row_axis",
"=",
"1",
",",
"col_axis",
"=",
"2",
",",
"channel_axis",
"=",
"0",
",",
"fill_mode",
"=",
"'nearest'",
",",
"cval",
"=",
"0.",
")",
":",
"h",
",",
"w",
"=",
"x",
".",
"s... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/preprocessing/image.py#L85-L118 | |
qt/qt | 0a2f2382541424726168804be2c90b91381608c6 | src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/input.py | python | QualifyDependencies | (targets) | Make dependency links fully-qualified relative to the current directory.
|targets| is a dict mapping fully-qualified target names to their target
dicts. For each target in this dict, keys known to contain dependency
links are examined, and any dependencies referenced will be rewritten
so that they are fully-q... | Make dependency links fully-qualified relative to the current directory. | [
"Make",
"dependency",
"links",
"fully",
"-",
"qualified",
"relative",
"to",
"the",
"current",
"directory",
"."
] | def QualifyDependencies(targets):
"""Make dependency links fully-qualified relative to the current directory.
|targets| is a dict mapping fully-qualified target names to their target
dicts. For each target in this dict, keys known to contain dependency
links are examined, and any dependencies referenced will ... | [
"def",
"QualifyDependencies",
"(",
"targets",
")",
":",
"for",
"target",
",",
"target_dict",
"in",
"targets",
".",
"iteritems",
"(",
")",
":",
"target_build_file",
"=",
"gyp",
".",
"common",
".",
"BuildFile",
"(",
"target",
")",
"toolset",
"=",
"target_dict"... | https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/input.py#L1034-L1067 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/stats.py | python | trimboth | (a, proportiontocut, axis=0) | return atmp[sl] | Slices off a proportion of items from both ends of an array.
Slices off the passed proportion of items from both ends of the passed
array (i.e., with `proportiontocut` = 0.1, slices leftmost 10% **and**
rightmost 10% of scores). The trimmed values are the lowest and
highest ones.
Slices off less if... | Slices off a proportion of items from both ends of an array. | [
"Slices",
"off",
"a",
"proportion",
"of",
"items",
"from",
"both",
"ends",
"of",
"an",
"array",
"."
] | def trimboth(a, proportiontocut, axis=0):
"""
Slices off a proportion of items from both ends of an array.
Slices off the passed proportion of items from both ends of the passed
array (i.e., with `proportiontocut` = 0.1, slices leftmost 10% **and**
rightmost 10% of scores). The trimmed values are t... | [
"def",
"trimboth",
"(",
"a",
",",
"proportiontocut",
",",
"axis",
"=",
"0",
")",
":",
"a",
"=",
"np",
".",
"asarray",
"(",
"a",
")",
"if",
"a",
".",
"size",
"==",
"0",
":",
"return",
"a",
"if",
"axis",
"is",
"None",
":",
"a",
"=",
"a",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/stats.py#L2678-L2742 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/fastboot_utils.py | python | FastbootUtils.WaitForFastbootMode | (self, timeout=None, retries=None) | Wait for device to boot into fastboot mode.
This waits for the device serial to show up in fastboot devices output. | Wait for device to boot into fastboot mode. | [
"Wait",
"for",
"device",
"to",
"boot",
"into",
"fastboot",
"mode",
"."
] | def WaitForFastbootMode(self, timeout=None, retries=None):
"""Wait for device to boot into fastboot mode.
This waits for the device serial to show up in fastboot devices output.
"""
def fastboot_mode():
return self._serial in self.fastboot.Devices()
timeout_retry.WaitFor(fastboot_mode, wait_... | [
"def",
"WaitForFastbootMode",
"(",
"self",
",",
"timeout",
"=",
"None",
",",
"retries",
"=",
"None",
")",
":",
"def",
"fastboot_mode",
"(",
")",
":",
"return",
"self",
".",
"_serial",
"in",
"self",
".",
"fastboot",
".",
"Devices",
"(",
")",
"timeout_retr... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/fastboot_utils.py#L103-L111 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.AdjustLibraries | (self, libraries, config_name=None) | return libraries | Transforms entries like 'Cocoa.framework' in libraries into entries like
'-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. | Transforms entries like 'Cocoa.framework' in libraries into entries like
'-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. | [
"Transforms",
"entries",
"like",
"Cocoa",
".",
"framework",
"in",
"libraries",
"into",
"entries",
"like",
"-",
"framework",
"Cocoa",
"libcrypto",
".",
"dylib",
"into",
"-",
"lcrypto",
"etc",
"."
] | def AdjustLibraries(self, libraries, config_name=None):
"""Transforms entries like 'Cocoa.framework' in libraries into entries like
'-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc.
"""
libraries = [self._AdjustLibrary(library, config_name)
for library in libraries]
return... | [
"def",
"AdjustLibraries",
"(",
"self",
",",
"libraries",
",",
"config_name",
"=",
"None",
")",
":",
"libraries",
"=",
"[",
"self",
".",
"_AdjustLibrary",
"(",
"library",
",",
"config_name",
")",
"for",
"library",
"in",
"libraries",
"]",
"return",
"libraries"... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py#L1182-L1188 | |
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | pytengine/tengine/graph.py | python | Graph.setlayout | (self, type) | return _LIB.set_graph_layout(ctypes.c_void_p(self.graph), type) | set the layer type of the graph
:param type: <layout_type> like: tg.TENGINE_LAYOUT_NCHW, tg.TENGINE_LAYOUT_NHWC
:return: 0: success, -1: fail | set the layer type of the graph
:param type: <layout_type> like: tg.TENGINE_LAYOUT_NCHW, tg.TENGINE_LAYOUT_NHWC
:return: 0: success, -1: fail | [
"set",
"the",
"layer",
"type",
"of",
"the",
"graph",
":",
"param",
"type",
":",
"<layout_type",
">",
"like",
":",
"tg",
".",
"TENGINE_LAYOUT_NCHW",
"tg",
".",
"TENGINE_LAYOUT_NHWC",
":",
"return",
":",
"0",
":",
"success",
"-",
"1",
":",
"fail"
] | def setlayout(self, type):
"""
set the layer type of the graph
:param type: <layout_type> like: tg.TENGINE_LAYOUT_NCHW, tg.TENGINE_LAYOUT_NHWC
:return: 0: success, -1: fail
"""
return _LIB.set_graph_layout(ctypes.c_void_p(self.graph), type) | [
"def",
"setlayout",
"(",
"self",
",",
"type",
")",
":",
"return",
"_LIB",
".",
"set_graph_layout",
"(",
"ctypes",
".",
"c_void_p",
"(",
"self",
".",
"graph",
")",
",",
"type",
")"
] | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/pytengine/tengine/graph.py#L107-L113 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | TopLevelWindow.GetIcon | (*args, **kwargs) | return _windows_.TopLevelWindow_GetIcon(*args, **kwargs) | GetIcon(self) -> Icon | GetIcon(self) -> Icon | [
"GetIcon",
"(",
"self",
")",
"-",
">",
"Icon"
] | def GetIcon(*args, **kwargs):
"""GetIcon(self) -> Icon"""
return _windows_.TopLevelWindow_GetIcon(*args, **kwargs) | [
"def",
"GetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"TopLevelWindow_GetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L429-L431 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | _IsLoopConstantEnter | (op) | return is_enter and op.get_attr("is_constant") | Return true iff op is a loop invariant. | Return true iff op is a loop invariant. | [
"Return",
"true",
"iff",
"op",
"is",
"a",
"loop",
"invariant",
"."
] | def _IsLoopConstantEnter(op):
"""Return true iff op is a loop invariant."""
is_enter = (op.type == "Enter" or op.type == "RefEnter")
return is_enter and op.get_attr("is_constant") | [
"def",
"_IsLoopConstantEnter",
"(",
"op",
")",
":",
"is_enter",
"=",
"(",
"op",
".",
"type",
"==",
"\"Enter\"",
"or",
"op",
".",
"type",
"==",
"\"RefEnter\"",
")",
"return",
"is_enter",
"and",
"op",
".",
"get_attr",
"(",
"\"is_constant\"",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L416-L419 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathUtils.py | python | depth_params.start_depth | (self) | return self.__start_depth | Start Depth is the top of the model. | Start Depth is the top of the model. | [
"Start",
"Depth",
"is",
"the",
"top",
"of",
"the",
"model",
"."
] | def start_depth(self):
"""
Start Depth is the top of the model.
"""
return self.__start_depth | [
"def",
"start_depth",
"(",
"self",
")",
":",
"return",
"self",
".",
"__start_depth"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathUtils.py#L642-L646 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/plots/mantidaxes.py | python | MantidAxes.imshow | (self, *args, **kwargs) | return self._plot_2d_func('imshow', *args, **kwargs) | If the **mantid** projection is chosen, it can be
used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
or it can be used to plot :class:`mantid.api.MatrixWorkspace`
or :class:`mantid.api.IMDHistoWorkspace`. You can have something like::
import matplotlib.pyplot as plt... | If the **mantid** projection is chosen, it can be
used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
or it can be used to plot :class:`mantid.api.MatrixWorkspace`
or :class:`mantid.api.IMDHistoWorkspace`. You can have something like:: | [
"If",
"the",
"**",
"mantid",
"**",
"projection",
"is",
"chosen",
"it",
"can",
"be",
"used",
"the",
"same",
"as",
":",
"py",
":",
"meth",
":",
"matplotlib",
".",
"axes",
".",
"Axes",
".",
"imshow",
"for",
"arrays",
"or",
"it",
"can",
"be",
"used",
"... | def imshow(self, *args, **kwargs):
"""
If the **mantid** projection is chosen, it can be
used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
or it can be used to plot :class:`mantid.api.MatrixWorkspace`
or :class:`mantid.api.IMDHistoWorkspace`. You can have someth... | [
"def",
"imshow",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_plot_2d_func",
"(",
"'imshow'",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/plots/mantidaxes.py#L878-L897 | |
google/ml-metadata | b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d | ml_metadata/metadata_store/types.py | python | Execution.save_input | (self, store: metadata_store.MetadataStore) | Saves input_struct to store.
Saves the structure of the input, as well as the individual artifacts
if they have not already been saved.
It is intended for orchestration users.
This should never be called more than once, or it will fail.
Args:
store: the database the data goes to.
Raises... | Saves input_struct to store. | [
"Saves",
"input_struct",
"to",
"store",
"."
] | def save_input(self, store: metadata_store.MetadataStore):
"""Saves input_struct to store.
Saves the structure of the input, as well as the individual artifacts
if they have not already been saved.
It is intended for orchestration users.
This should never be called more than once, or it will fail.
... | [
"def",
"save_input",
"(",
"self",
",",
"store",
":",
"metadata_store",
".",
"MetadataStore",
")",
":",
"if",
"not",
"self",
".",
"has_id",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"Must save_execution before save_input\"",
")",
"if",
"self",
".",
"_input_e... | https://github.com/google/ml-metadata/blob/b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d/ml_metadata/metadata_store/types.py#L1214-L1235 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mutex.py | python | mutex.lock | (self, function, argument) | Lock a mutex, call the function with supplied argument
when it is acquired. If the mutex is already locked, place
function and argument in the queue. | Lock a mutex, call the function with supplied argument
when it is acquired. If the mutex is already locked, place
function and argument in the queue. | [
"Lock",
"a",
"mutex",
"call",
"the",
"function",
"with",
"supplied",
"argument",
"when",
"it",
"is",
"acquired",
".",
"If",
"the",
"mutex",
"is",
"already",
"locked",
"place",
"function",
"and",
"argument",
"in",
"the",
"queue",
"."
] | def lock(self, function, argument):
"""Lock a mutex, call the function with supplied argument
when it is acquired. If the mutex is already locked, place
function and argument in the queue."""
if self.testandset():
function(argument)
else:
self.queue.appen... | [
"def",
"lock",
"(",
"self",
",",
"function",
",",
"argument",
")",
":",
"if",
"self",
".",
"testandset",
"(",
")",
":",
"function",
"(",
"argument",
")",
"else",
":",
"self",
".",
"queue",
".",
"append",
"(",
"(",
"function",
",",
"argument",
")",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mutex.py#L39-L46 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.AdjustIncludeDirs | (self, include_dirs, config) | return [self.ConvertVSMacros(p, config=config) for p in includes] | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | [
"Updates",
"include_dirs",
"to",
"expand",
"VS",
"specific",
"paths",
"and",
"adds",
"the",
"system",
"include",
"dirs",
"used",
"for",
"platform",
"SDK",
"and",
"similar",
"."
] | def AdjustIncludeDirs(self, include_dirs, config):
"""Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar."""
config = self._RealConfig(config)
includes = include_dirs + self.msvs_system_include_dirs[config]
includes.extend(self._Setti... | [
"def",
"AdjustIncludeDirs",
"(",
"self",
",",
"include_dirs",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_RealConfig",
"(",
"config",
")",
"includes",
"=",
"include_dirs",
"+",
"self",
".",
"msvs_system_include_dirs",
"[",
"config",
"]",
"includes",... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/msvs_emulation.py#L245-L252 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/utils/hybrid_parallel_inference.py | python | HybridParallelInferenceHelper._get_while_block | (self) | return None, None | Get the while sub-block. | Get the while sub-block. | [
"Get",
"the",
"while",
"sub",
"-",
"block",
"."
] | def _get_while_block(self):
"""
Get the while sub-block.
"""
main_block = self._main_program.global_block()
num_while = 0
sub_block_id = None
for op in main_block.ops:
assert num_while < 2, "More than one while op found."
if op.type == 'whi... | [
"def",
"_get_while_block",
"(",
"self",
")",
":",
"main_block",
"=",
"self",
".",
"_main_program",
".",
"global_block",
"(",
")",
"num_while",
"=",
"0",
"sub_block_id",
"=",
"None",
"for",
"op",
"in",
"main_block",
".",
"ops",
":",
"assert",
"num_while",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/utils/hybrid_parallel_inference.py#L700-L713 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py | python | chararray.__rmul__ | (self, i) | return asarray(multiply(self, i)) | Return (self * i), that is string multiple concatenation,
element-wise.
See also
--------
multiply | Return (self * i), that is string multiple concatenation,
element-wise. | [
"Return",
"(",
"self",
"*",
"i",
")",
"that",
"is",
"string",
"multiple",
"concatenation",
"element",
"-",
"wise",
"."
] | def __rmul__(self, i):
"""
Return (self * i), that is string multiple concatenation,
element-wise.
See also
--------
multiply
"""
return asarray(multiply(self, i)) | [
"def",
"__rmul__",
"(",
"self",
",",
"i",
")",
":",
"return",
"asarray",
"(",
"multiply",
"(",
"self",
",",
"i",
")",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py#L1958-L1967 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.is_static_method | (self) | return conf.lib.clang_CXXMethod_isStatic(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'. | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"static",
"."
] | def is_static_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'.
"""
return conf.lib.clang_CXXMethod_isStatic(self) | [
"def",
"is_static_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isStatic",
"(",
"self",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1070-L1074 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | AlphaPixelData_Accessor.Offset | (*args, **kwargs) | return _gdi_.AlphaPixelData_Accessor_Offset(*args, **kwargs) | Offset(self, AlphaPixelData data, int x, int y) | Offset(self, AlphaPixelData data, int x, int y) | [
"Offset",
"(",
"self",
"AlphaPixelData",
"data",
"int",
"x",
"int",
"y",
")"
] | def Offset(*args, **kwargs):
"""Offset(self, AlphaPixelData data, int x, int y)"""
return _gdi_.AlphaPixelData_Accessor_Offset(*args, **kwargs) | [
"def",
"Offset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"AlphaPixelData_Accessor_Offset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1217-L1219 | |
cztomczak/cefpython | 5679f28cec18a57a56e298da2927aac8d8f83ad6 | tools/automate.py | python | fix_cef_include_files | () | Fixes to CEF include header files for eg. VS2008 on Windows. | Fixes to CEF include header files for eg. VS2008 on Windows. | [
"Fixes",
"to",
"CEF",
"include",
"header",
"files",
"for",
"eg",
".",
"VS2008",
"on",
"Windows",
"."
] | def fix_cef_include_files():
"""Fixes to CEF include header files for eg. VS2008 on Windows."""
# TODO: This was fixed in upstream CEF, remove this code during
# next CEF update on Windows.
if platform.system() == "Windows" and get_msvs_for_python() == "2008":
print("[automate.py] Fixing C... | [
"def",
"fix_cef_include_files",
"(",
")",
":",
"# TODO: This was fixed in upstream CEF, remove this code during",
"# next CEF update on Windows.",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"\"Windows\"",
"and",
"get_msvs_for_python",
"(",
")",
"==",
"\"2008\"",
... | https://github.com/cztomczak/cefpython/blob/5679f28cec18a57a56e298da2927aac8d8f83ad6/tools/automate.py#L704-L719 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | python | StoppedCommandPane.get_selected_line | (self) | return None | Subclasses implement this to control where the cursor (and selected highlight)
is placed. | Subclasses implement this to control where the cursor (and selected highlight)
is placed. | [
"Subclasses",
"implement",
"this",
"to",
"control",
"where",
"the",
"cursor",
"(",
"and",
"selected",
"highlight",
")",
"is",
"placed",
"."
] | def get_selected_line(self):
""" Subclasses implement this to control where the cursor (and selected highlight)
is placed.
"""
return None | [
"def",
"get_selected_line",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L598-L602 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_usps_dataset | (method) | return new_method | A wrapper that wraps a parameter checker around the original Dataset(USPSDataset). | A wrapper that wraps a parameter checker around the original Dataset(USPSDataset). | [
"A",
"wrapper",
"that",
"wraps",
"a",
"parameter",
"checker",
"around",
"the",
"original",
"Dataset",
"(",
"USPSDataset",
")",
"."
] | def check_usps_dataset(method):
"""A wrapper that wraps a parameter checker around the original Dataset(USPSDataset)."""
@wraps(method)
def new_method(self, *args, **kwargs):
_, param_dict = parse_user_args(method, *args, **kwargs)
nreq_param_int = ['num_samples', 'num_parallel_workers', '... | [
"def",
"check_usps_dataset",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_",
",",
"param_dict",
"=",
"parse_user_args",
"(",
"method",
",",
"*",
"a... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L465-L489 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rmic.py | python | generate | (env) | Add Builders and construction variables for rmic to an Environment. | Add Builders and construction variables for rmic to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"rmic",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for rmic to an Environment."""
env['BUILDERS']['RMIC'] = RMICBuilder
env['RMIC'] = 'rmic'
env['RMICFLAGS'] = SCons.Util.CLVar('')
env['RMICCOM'] = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpa... | [
"def",
"generate",
"(",
"env",
")",
":",
"env",
"[",
"'BUILDERS'",
"]",
"[",
"'RMIC'",
"]",
"=",
"RMICBuilder",
"env",
"[",
"'RMIC'",
"]",
"=",
"'rmic'",
"env",
"[",
"'RMICFLAGS'",
"]",
"=",
"SCons",
".",
"Util",
".",
"CLVar",
"(",
"''",
")",
"env"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rmic.py#L104-L111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.