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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/position.py | python | Position.open_order_buy_premium | (self) | return self._open_order_buy_premium | Gets the open_order_buy_premium of this Position. # noqa: E501
:return: The open_order_buy_premium of this Position. # noqa: E501
:rtype: float | Gets the open_order_buy_premium of this Position. # noqa: E501 | [
"Gets",
"the",
"open_order_buy_premium",
"of",
"this",
"Position",
".",
"#",
"noqa",
":",
"E501"
] | def open_order_buy_premium(self):
"""Gets the open_order_buy_premium of this Position. # noqa: E501
:return: The open_order_buy_premium of this Position. # noqa: E501
:rtype: float
"""
return self._open_order_buy_premium | [
"def",
"open_order_buy_premium",
"(",
"self",
")",
":",
"return",
"self",
".",
"_open_order_buy_premium"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L966-L973 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiTabContainer.SetActivePage | (*args) | return _aui.AuiTabContainer_SetActivePage(*args) | SetActivePage(self, Window page) -> bool
SetActivePage(self, size_t page) -> bool | SetActivePage(self, Window page) -> bool
SetActivePage(self, size_t page) -> bool | [
"SetActivePage",
"(",
"self",
"Window",
"page",
")",
"-",
">",
"bool",
"SetActivePage",
"(",
"self",
"size_t",
"page",
")",
"-",
">",
"bool"
] | def SetActivePage(*args):
"""
SetActivePage(self, Window page) -> bool
SetActivePage(self, size_t page) -> bool
"""
return _aui.AuiTabContainer_SetActivePage(*args) | [
"def",
"SetActivePage",
"(",
"*",
"args",
")",
":",
"return",
"_aui",
".",
"AuiTabContainer_SetActivePage",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1161-L1166 | |
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/xAvatarCustomization.py | python | xAvatarCustomization.ISetWhatWearing | (self,avatar) | Gets whats being worn and sets the dialogs to show what we are wearing | Gets whats being worn and sets the dialogs to show what we are wearing | [
"Gets",
"whats",
"being",
"worn",
"and",
"sets",
"the",
"dialogs",
"to",
"show",
"what",
"we",
"are",
"wearing"
] | def ISetWhatWearing(self,avatar):
"Gets whats being worn and sets the dialogs to show what we are wearing"
# assumes that WornList is already filled out
global listboxDict
for id, group in TheCloset.items():
listbox = listboxDict[id]
acessoryListbox = listboxDict[... | [
"def",
"ISetWhatWearing",
"(",
"self",
",",
"avatar",
")",
":",
"# assumes that WornList is already filled out",
"global",
"listboxDict",
"for",
"id",
",",
"group",
"in",
"TheCloset",
".",
"items",
"(",
")",
":",
"listbox",
"=",
"listboxDict",
"[",
"id",
"]",
... | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/xAvatarCustomization.py#L1523-L1547 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/gyp/util/build_utils.py | python | ExpandFileArgs | (args) | return new_args | Replaces file-arg placeholders in args.
These placeholders have the form:
@FileArg(filename:key1:key2:...:keyn)
The value of such a placeholder is calculated by reading 'filename' as json.
And then extracting the value at [key1][key2]...[keyn].
Note: This intentionally does not return the list of files t... | Replaces file-arg placeholders in args. | [
"Replaces",
"file",
"-",
"arg",
"placeholders",
"in",
"args",
"."
] | def ExpandFileArgs(args):
"""Replaces file-arg placeholders in args.
These placeholders have the form:
@FileArg(filename:key1:key2:...:keyn)
The value of such a placeholder is calculated by reading 'filename' as json.
And then extracting the value at [key1][key2]...[keyn].
Note: This intentionally does... | [
"def",
"ExpandFileArgs",
"(",
"args",
")",
":",
"new_args",
"=",
"list",
"(",
"args",
")",
"file_jsons",
"=",
"dict",
"(",
")",
"r",
"=",
"re",
".",
"compile",
"(",
"'@FileArg\\((.*?)\\)'",
")",
"for",
"i",
",",
"arg",
"in",
"enumerate",
"(",
"args",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/gyp/util/build_utils.py#L438-L474 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.IsReadOnly | (*args, **kwargs) | return _grid.Grid_IsReadOnly(*args, **kwargs) | IsReadOnly(self, int row, int col) -> bool | IsReadOnly(self, int row, int col) -> bool | [
"IsReadOnly",
"(",
"self",
"int",
"row",
"int",
"col",
")",
"-",
">",
"bool"
] | def IsReadOnly(*args, **kwargs):
"""IsReadOnly(self, int row, int col) -> bool"""
return _grid.Grid_IsReadOnly(*args, **kwargs) | [
"def",
"IsReadOnly",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_IsReadOnly",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L2018-L2020 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py | python | Integral.__rshift__ | (self, other) | self >> other | self >> other | [
"self",
">>",
"other"
] | def __rshift__(self, other):
"""self >> other"""
raise NotImplementedError | [
"def",
"__rshift__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py#L330-L332 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plot_color_queue.py | python | ColorQueue._initialise_queue | (self) | Initialize the heap queue with the color_cache | Initialize the heap queue with the color_cache | [
"Initialize",
"the",
"heap",
"queue",
"with",
"the",
"color_cache"
] | def _initialise_queue(self):
"""Initialize the heap queue with the color_cache"""
self._queue = []
for color, priority in self._color_cache.items():
heapq.heappush(self._queue, (priority, color)) | [
"def",
"_initialise_queue",
"(",
"self",
")",
":",
"self",
".",
"_queue",
"=",
"[",
"]",
"for",
"color",
",",
"priority",
"in",
"self",
".",
"_color_cache",
".",
"items",
"(",
")",
":",
"heapq",
".",
"heappush",
"(",
"self",
".",
"_queue",
",",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plot_color_queue.py#L44-L48 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/range.py | python | RangeIndex.is_unique | (self) | return True | return if the index has unique values | return if the index has unique values | [
"return",
"if",
"the",
"index",
"has",
"unique",
"values"
] | def is_unique(self):
""" return if the index has unique values """
return True | [
"def",
"is_unique",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/range.py#L253-L255 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/graph_io.py | python | read_batch_features | (file_pattern, batch_size, features, reader,
randomize_input=True, num_epochs=None,
queue_capacity=10000, reader_num_threads=1,
parser_num_threads=1, name=None) | return features | Adds operations to read, queue, batch and parse `Example` protos.
Given file pattern (or list of files), will setup a queue for file names,
read `Example` proto using provided `reader`, use batch queue to create
batches of examples of size `batch_size` and parse example given `features`
specification.
All q... | Adds operations to read, queue, batch and parse `Example` protos. | [
"Adds",
"operations",
"to",
"read",
"queue",
"batch",
"and",
"parse",
"Example",
"protos",
"."
] | def read_batch_features(file_pattern, batch_size, features, reader,
randomize_input=True, num_epochs=None,
queue_capacity=10000, reader_num_threads=1,
parser_num_threads=1, name=None):
"""Adds operations to read, queue, batch and parse `Example` ... | [
"def",
"read_batch_features",
"(",
"file_pattern",
",",
"batch_size",
",",
"features",
",",
"reader",
",",
"randomize_input",
"=",
"True",
",",
"num_epochs",
"=",
"None",
",",
"queue_capacity",
"=",
"10000",
",",
"reader_num_threads",
"=",
"1",
",",
"parser_num_... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/learn_io/graph_io.py#L355-L402 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py | python | JIRA.search_users | (self, user, startAt=0, maxResults=50, includeActive=True, includeInactive=False) | return self._fetch_pages(User, None, 'user/search', startAt, maxResults, params) | Get a list of user Resources that match the specified search string.
:param user: a string to match usernames, name or email against.
:param startAt: index of the first user to return.
:param maxResults: maximum number of users to return.
If maxResults evaluates as False, it wil... | Get a list of user Resources that match the specified search string. | [
"Get",
"a",
"list",
"of",
"user",
"Resources",
"that",
"match",
"the",
"specified",
"search",
"string",
"."
] | def search_users(self, user, startAt=0, maxResults=50, includeActive=True, includeInactive=False):
"""Get a list of user Resources that match the specified search string.
:param user: a string to match usernames, name or email against.
:param startAt: index of the first user to return.
... | [
"def",
"search_users",
"(",
"self",
",",
"user",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
",",
"includeActive",
"=",
"True",
",",
"includeInactive",
"=",
"False",
")",
":",
"params",
"=",
"{",
"'username'",
":",
"user",
",",
"'includeActiv... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L2283-L2297 | |
google/angle | d5df233189cad620b8e0de653fe5e6cb778e209d | third_party/logdog/logdog/stream.py | python | StreamProtocolRegistry.create | (self, uri, **kwargs) | return client_cls._create(value, **kwargs) | Returns (StreamClient): A stream client for the specified URI.
This uses the default StreamProtocolRegistry to instantiate a StreamClient
for the specified URI.
Args:
uri (str): The streamserver URI.
kwargs: keyword arguments to forward to the stream. See
StreamClient.__init__.
... | Returns (StreamClient): A stream client for the specified URI. | [
"Returns",
"(",
"StreamClient",
")",
":",
"A",
"stream",
"client",
"for",
"the",
"specified",
"URI",
"."
] | def create(self, uri, **kwargs):
"""Returns (StreamClient): A stream client for the specified URI.
This uses the default StreamProtocolRegistry to instantiate a StreamClient
for the specified URI.
Args:
uri (str): The streamserver URI.
kwargs: keyword arguments to forward to the stream... | [
"def",
"create",
"(",
"self",
",",
"uri",
",",
"*",
"*",
"kwargs",
")",
":",
"uri",
"=",
"uri",
".",
"split",
"(",
"':'",
",",
"1",
")",
"if",
"len",
"(",
"uri",
")",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"'Invalid stream server URI [%s]'",
"... | https://github.com/google/angle/blob/d5df233189cad620b8e0de653fe5e6cb778e209d/third_party/logdog/logdog/stream.py#L108-L131 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/common/converters.py | python | LookupTable.get_port_elements_and_memory_layout_for_input | (self, importer_node: ImporterNode, input_index=0) | return (port_elements, port_memory_layout) | Returns an (ell.nodes.PortElements, ell.nodes.PortMemoryLayout) for the corresponding input of the ImporterNode. | Returns an (ell.nodes.PortElements, ell.nodes.PortMemoryLayout) for the corresponding input of the ImporterNode. | [
"Returns",
"an",
"(",
"ell",
".",
"nodes",
".",
"PortElements",
"ell",
".",
"nodes",
".",
"PortMemoryLayout",
")",
"for",
"the",
"corresponding",
"input",
"of",
"the",
"ImporterNode",
"."
] | def get_port_elements_and_memory_layout_for_input(self, importer_node: ImporterNode, input_index=0) \
-> (ell.nodes.PortElements, ell.model.PortMemoryLayout):
"""
Returns an (ell.nodes.PortElements, ell.nodes.PortMemoryLayout) for the corresponding input of the ImporterNode.
"""
... | [
"def",
"get_port_elements_and_memory_layout_for_input",
"(",
"self",
",",
"importer_node",
":",
"ImporterNode",
",",
"input_index",
"=",
"0",
")",
"->",
"(",
"ell",
".",
"nodes",
".",
"PortElements",
",",
"ell",
".",
"model",
".",
"PortMemoryLayout",
")",
":",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/converters.py#L246-L261 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | AppendableFrameTable.get_object | (cls, obj, transposed: bool) | return obj | these are written transposed | these are written transposed | [
"these",
"are",
"written",
"transposed"
] | def get_object(cls, obj, transposed: bool):
""" these are written transposed """
if transposed:
obj = obj.T
return obj | [
"def",
"get_object",
"(",
"cls",
",",
"obj",
",",
"transposed",
":",
"bool",
")",
":",
"if",
"transposed",
":",
"obj",
"=",
"obj",
".",
"T",
"return",
"obj"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L4357-L4361 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/http/cookiejar.py | python | join_header_words | (lists) | return ", ".join(headers) | Do the inverse (almost) of the conversion done by split_header_words.
Takes a list of lists of (key, value) pairs and produces a single header
value. Attribute values are quoted if needed.
>>> join_header_words([[("text/plain", None), ("charset", "iso-8859-1")]])
'text/plain; charset="iso-8859-1"'
... | Do the inverse (almost) of the conversion done by split_header_words. | [
"Do",
"the",
"inverse",
"(",
"almost",
")",
"of",
"the",
"conversion",
"done",
"by",
"split_header_words",
"."
] | def join_header_words(lists):
"""Do the inverse (almost) of the conversion done by split_header_words.
Takes a list of lists of (key, value) pairs and produces a single header
value. Attribute values are quoted if needed.
>>> join_header_words([[("text/plain", None), ("charset", "iso-8859-1")]])
... | [
"def",
"join_header_words",
"(",
"lists",
")",
":",
"headers",
"=",
"[",
"]",
"for",
"pairs",
"in",
"lists",
":",
"attr",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"pairs",
":",
"if",
"v",
"is",
"not",
"None",
":",
"if",
"not",
"re",
".",
"sea... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/cookiejar.py#L426-L449 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/ext.py | python | InternationalizationExtension._make_node | (self, singular, plural, variables, plural_expr,
vars_referenced, num_called_num) | return nodes.Output([node]) | Generates a useful node from the data provided. | Generates a useful node from the data provided. | [
"Generates",
"a",
"useful",
"node",
"from",
"the",
"data",
"provided",
"."
] | def _make_node(self, singular, plural, variables, plural_expr,
vars_referenced, num_called_num):
"""Generates a useful node from the data provided."""
# no variables referenced? no need to escape for old style
# gettext invocations only if there are vars.
if not vars_... | [
"def",
"_make_node",
"(",
"self",
",",
"singular",
",",
"plural",
",",
"variables",
",",
"plural_expr",
",",
"vars_referenced",
",",
"num_called_num",
")",
":",
"# no variables referenced? no need to escape for old style",
"# gettext invocations only if there are vars.",
"if... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/ext.py#L328-L374 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/profiler/parser/memory_usage_parser.py | python | MemoryUsageParser._parse_graph_memory | (self, graphs) | Parse memory usage based on subgraphs. | Parse memory usage based on subgraphs. | [
"Parse",
"memory",
"usage",
"based",
"on",
"subgraphs",
"."
] | def _parse_graph_memory(self, graphs):
"""Parse memory usage based on subgraphs."""
for graph_proto in graphs:
graph_id = graph_proto.graph_id
if graph_id is None:
logger.info('Graph id is missing, skipped the graph.')
continue
graph_p... | [
"def",
"_parse_graph_memory",
"(",
"self",
",",
"graphs",
")",
":",
"for",
"graph_proto",
"in",
"graphs",
":",
"graph_id",
"=",
"graph_proto",
".",
"graph_id",
"if",
"graph_id",
"is",
"None",
":",
"logger",
".",
"info",
"(",
"'Graph id is missing, skipped the gr... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/memory_usage_parser.py#L113-L130 | ||
scanner-research/scanner | 04a0c4b4196341995985acd729c0788aab823e1c | python/scannerpy/kernel.py | python | Kernel.execute | (self, stream_parameter: bytes) | r"""Runs the kernel on input elements and returns new output elements.
Parameters
----------
stream_parameter
An example stream parameter. Must be annotated with a stream parameter type.
See :ref:`stream-parameters`.
Returns
-------
bytes
T... | r"""Runs the kernel on input elements and returns new output elements. | [
"r",
"Runs",
"the",
"kernel",
"on",
"input",
"elements",
"and",
"returns",
"new",
"output",
"elements",
"."
] | def execute(self, stream_parameter: bytes) -> bytes:
r"""Runs the kernel on input elements and returns new output elements.
Parameters
----------
stream_parameter
An example stream parameter. Must be annotated with a stream parameter type.
See :ref:`stream-parameters... | [
"def",
"execute",
"(",
"self",
",",
"stream_parameter",
":",
"bytes",
")",
"->",
"bytes",
":",
"raise",
"NotImplementedError"
] | https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/kernel.py#L63-L78 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/check_ops.py | python | assert_rank_in_v2 | (x, ranks, message=None, name=None) | return assert_rank_in(x=x, ranks=ranks, message=message, name=name) | Assert that `x` has a rank in `ranks`.
This Op checks that the rank of `x` is in `ranks`.
If `x` has a different rank, `message`, as well as the shape of `x` are
printed, and `InvalidArgumentError` is raised.
Args:
x: `Tensor`.
ranks: `Iterable` of scalar `Tensor` objects.
message: A string to pr... | Assert that `x` has a rank in `ranks`. | [
"Assert",
"that",
"x",
"has",
"a",
"rank",
"in",
"ranks",
"."
] | def assert_rank_in_v2(x, ranks, message=None, name=None):
"""Assert that `x` has a rank in `ranks`.
This Op checks that the rank of `x` is in `ranks`.
If `x` has a different rank, `message`, as well as the shape of `x` are
printed, and `InvalidArgumentError` is raised.
Args:
x: `Tensor`.
ranks: `It... | [
"def",
"assert_rank_in_v2",
"(",
"x",
",",
"ranks",
",",
"message",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"assert_rank_in",
"(",
"x",
"=",
"x",
",",
"ranks",
"=",
"ranks",
",",
"message",
"=",
"message",
",",
"name",
"=",
"name",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/check_ops.py#L1324-L1352 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Text.__init__ | (self, master=None, cnf={}, **kw) | Construct a text widget with the parent MASTER.
STANDARD OPTIONS
background, borderwidth, cursor,
exportselection, font, foreground,
highlightbackground, highlightcolor,
highlightthickness, insertbackground,
insertborderwidth, insertofftime,
... | Construct a text widget with the parent MASTER. | [
"Construct",
"a",
"text",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct a text widget with the parent MASTER.
STANDARD OPTIONS
background, borderwidth, cursor,
exportselection, font, foreground,
highlightbackground, highlightcolor,
highlightthickness, insertbackgrou... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'text'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L2932-L2955 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/which/setup.py | python | _getBinDir | () | return bindir | Return the current Python's bindir. | Return the current Python's bindir. | [
"Return",
"the",
"current",
"Python",
"s",
"bindir",
"."
] | def _getBinDir():
"""Return the current Python's bindir."""
if sys.platform.startswith("win"):
bindir = sys.prefix
else:
bindir = os.path.join(sys.prefix, "bin")
return bindir | [
"def",
"_getBinDir",
"(",
")",
":",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"\"win\"",
")",
":",
"bindir",
"=",
"sys",
".",
"prefix",
"else",
":",
"bindir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"sys",
".",
"prefix",
",",
"\"bin\"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/which/setup.py#L19-L25 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/special_math_ops.py | python | bessel_i0 | (x, name=None) | Computes the Bessel i0 function of `x` element-wise.
Modified Bessel function of order 0.
It is preferable to use the numerically stabler function `i0e(x)` instead.
>>> tf.math.special.bessel_i0([-1., -0.5, 0.5, 1.]).numpy()
array([1.26606588, 1.06348337, 1.06348337, 1.26606588], dtype=float32)
Args:
... | Computes the Bessel i0 function of `x` element-wise. | [
"Computes",
"the",
"Bessel",
"i0",
"function",
"of",
"x",
"element",
"-",
"wise",
"."
] | def bessel_i0(x, name=None):
"""Computes the Bessel i0 function of `x` element-wise.
Modified Bessel function of order 0.
It is preferable to use the numerically stabler function `i0e(x)` instead.
>>> tf.math.special.bessel_i0([-1., -0.5, 0.5, 1.]).numpy()
array([1.26606588, 1.06348337, 1.06348337, 1.26606... | [
"def",
"bessel_i0",
"(",
"x",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"'bessel_i0'",
",",
"[",
"x",
"]",
")",
":",
"return",
"gen_special_math_ops",
".",
"bessel_i0",
"(",
"x",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/special_math_ops.py#L255-L278 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/core/generator/cpp_hier_block.py | python | get_hier_block_io | (flow_graph, direction, domain=None) | Get a list of io ports for this flow graph.
Returns a list of dicts with: type, label, vlen, size, optional | Get a list of io ports for this flow graph. | [
"Get",
"a",
"list",
"of",
"io",
"ports",
"for",
"this",
"flow",
"graph",
"."
] | def get_hier_block_io(flow_graph, direction, domain=None):
"""
Get a list of io ports for this flow graph.
Returns a list of dicts with: type, label, vlen, size, optional
"""
pads = flow_graph.get_pad_sources(
) if direction == 'inputs' else flow_graph.get_pad_sinks()
for pad in pads:
... | [
"def",
"get_hier_block_io",
"(",
"flow_graph",
",",
"direction",
",",
"domain",
"=",
"None",
")",
":",
"pads",
"=",
"flow_graph",
".",
"get_pad_sources",
"(",
")",
"if",
"direction",
"==",
"'inputs'",
"else",
"flow_graph",
".",
"get_pad_sinks",
"(",
")",
"fo... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/generator/cpp_hier_block.py#L206-L219 | ||
mapeditor/tiled | b7abf3c9606aa53442bab8fc6a44a1b2797226e0 | src/plugins/python/scripts/mappy.py | python | FMPColormap.pack | (self, cmap) | cmap -- T.qt.QImage.colorTable | cmap -- T.qt.QImage.colorTable | [
"cmap",
"--",
"T",
".",
"qt",
".",
"QImage",
".",
"colorTable"
] | def pack(self, cmap):
"""cmap -- T.qt.QImage.colorTable"""
yield fmpchunk(id='CMAP', len=len(list(cmap))).pack()
for c in cmap:
yield struct.pack('3B', (c.qRed,c.qGreen,c.qBlue)) | [
"def",
"pack",
"(",
"self",
",",
"cmap",
")",
":",
"yield",
"fmpchunk",
"(",
"id",
"=",
"'CMAP'",
",",
"len",
"=",
"len",
"(",
"list",
"(",
"cmap",
")",
")",
")",
".",
"pack",
"(",
")",
"for",
"c",
"in",
"cmap",
":",
"yield",
"struct",
".",
"... | https://github.com/mapeditor/tiled/blob/b7abf3c9606aa53442bab8fc6a44a1b2797226e0/src/plugins/python/scripts/mappy.py#L248-L252 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/lib/io/file_io.py | python | atomic_write_string_to_file | (filename, contents, overwrite=True) | Writes to `filename` atomically.
This means that when `filename` appears in the filesystem, it will contain
all of `contents`. With write_string_to_file, it is possible for the file
to appear in the filesystem with `contents` only partially written.
Accomplished by writing to a temp file and then renaming it.... | Writes to `filename` atomically. | [
"Writes",
"to",
"filename",
"atomically",
"."
] | def atomic_write_string_to_file(filename, contents, overwrite=True):
"""Writes to `filename` atomically.
This means that when `filename` appears in the filesystem, it will contain
all of `contents`. With write_string_to_file, it is possible for the file
to appear in the filesystem with `contents` only partiall... | [
"def",
"atomic_write_string_to_file",
"(",
"filename",
",",
"contents",
",",
"overwrite",
"=",
"True",
")",
":",
"if",
"not",
"has_atomic_move",
"(",
"filename",
")",
":",
"write_string_to_file",
"(",
"filename",
",",
"contents",
")",
"else",
":",
"temp_pathname... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/lib/io/file_io.py#L624-L648 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.EndSymbolBullet | (*args, **kwargs) | return _richtext.RichTextCtrl_EndSymbolBullet(*args, **kwargs) | EndSymbolBullet(self) -> bool
End symbol bullet | EndSymbolBullet(self) -> bool | [
"EndSymbolBullet",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndSymbolBullet(*args, **kwargs):
"""
EndSymbolBullet(self) -> bool
End symbol bullet
"""
return _richtext.RichTextCtrl_EndSymbolBullet(*args, **kwargs) | [
"def",
"EndSymbolBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_EndSymbolBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3540-L3546 | |
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L881-L883 | |
andrivet/ADVi3pp | 31afb95333f2d830a5b762ea030a4a59ec27cb88 | buildroot/share/scripts/createTemperatureLookupMarlin.py | python | Thermistor.voltage | (self, adc) | return adc * VSTEP | Convert ADC reading into a Voltage | Convert ADC reading into a Voltage | [
"Convert",
"ADC",
"reading",
"into",
"a",
"Voltage"
] | def voltage(self, adc):
"Convert ADC reading into a Voltage"
return adc * VSTEP | [
"def",
"voltage",
"(",
"self",
",",
"adc",
")",
":",
"return",
"adc",
"*",
"VSTEP"
] | https://github.com/andrivet/ADVi3pp/blob/31afb95333f2d830a5b762ea030a4a59ec27cb88/buildroot/share/scripts/createTemperatureLookupMarlin.py#L67-L69 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextObject.AdjustAvailableSpace | (*args, **kwargs) | return _richtext.RichTextObject_AdjustAvailableSpace(*args, **kwargs) | AdjustAvailableSpace(DC dc, RichTextBuffer buffer, RichTextAttr parentAttr,
RichTextAttr childAttr, Rect availableParentSpace,
Rect availableContainerSpace) -> Rect | AdjustAvailableSpace(DC dc, RichTextBuffer buffer, RichTextAttr parentAttr,
RichTextAttr childAttr, Rect availableParentSpace,
Rect availableContainerSpace) -> Rect | [
"AdjustAvailableSpace",
"(",
"DC",
"dc",
"RichTextBuffer",
"buffer",
"RichTextAttr",
"parentAttr",
"RichTextAttr",
"childAttr",
"Rect",
"availableParentSpace",
"Rect",
"availableContainerSpace",
")",
"-",
">",
"Rect"
] | def AdjustAvailableSpace(*args, **kwargs):
"""
AdjustAvailableSpace(DC dc, RichTextBuffer buffer, RichTextAttr parentAttr,
RichTextAttr childAttr, Rect availableParentSpace,
Rect availableContainerSpace) -> Rect
"""
return _richtext.RichTextObject_AdjustAvailabl... | [
"def",
"AdjustAvailableSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_AdjustAvailableSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1442-L1448 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/max.py | python | max.is_atom_log_log_convex | (self) | return True | Is the atom log-log convex? | Is the atom log-log convex? | [
"Is",
"the",
"atom",
"log",
"-",
"log",
"convex?"
] | def is_atom_log_log_convex(self) -> bool:
"""Is the atom log-log convex?
"""
return True | [
"def",
"is_atom_log_log_convex",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/max.py#L84-L87 | |
musescore/MuseScore | a817fea23e3c2be30847b7fde5b01746222c252e | thirdparty/freetype/src/tools/glnames.py | python | dump_encoding | ( file, encoding_name, encoding_list ) | dump a given encoding | dump a given encoding | [
"dump",
"a",
"given",
"encoding"
] | def dump_encoding( file, encoding_name, encoding_list ):
"""dump a given encoding"""
write = file.write
write( " /* the following are indices into the SID name table */\n" )
write( " static const unsigned short " + encoding_name +
"[" + repr( len( encoding_list ) ) + "] =\n" )
write( " {\n" )
... | [
"def",
"dump_encoding",
"(",
"file",
",",
"encoding_name",
",",
"encoding_list",
")",
":",
"write",
"=",
"file",
".",
"write",
"write",
"(",
"\" /* the following are indices into the SID name table */\\n\"",
")",
"write",
"(",
"\" static const unsigned short \"",
"+",
... | https://github.com/musescore/MuseScore/blob/a817fea23e3c2be30847b7fde5b01746222c252e/thirdparty/freetype/src/tools/glnames.py#L5186-L5207 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/target.py | python | set_hsa_kernel | (fn) | Ensure `fn` is usable as a SPIR kernel.
- Fix calling convention
- Add metadata | Ensure `fn` is usable as a SPIR kernel.
- Fix calling convention
- Add metadata | [
"Ensure",
"fn",
"is",
"usable",
"as",
"a",
"SPIR",
"kernel",
".",
"-",
"Fix",
"calling",
"convention",
"-",
"Add",
"metadata"
] | def set_hsa_kernel(fn):
"""
Ensure `fn` is usable as a SPIR kernel.
- Fix calling convention
- Add metadata
"""
mod = fn.module
# Set nounwind
# fn.add_attribute(lc.ATTR_NO_UNWIND)
# Set SPIR kernel calling convention
fn.calling_convention = CC_SPIR_KERNEL
# Mark kernels
... | [
"def",
"set_hsa_kernel",
"(",
"fn",
")",
":",
"mod",
"=",
"fn",
".",
"module",
"# Set nounwind",
"# fn.add_attribute(lc.ATTR_NO_UNWIND)",
"# Set SPIR kernel calling convention",
"fn",
".",
"calling_convention",
"=",
"CC_SPIR_KERNEL",
"# Mark kernels",
"ocl_kernels",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/target.py#L203-L236 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py | python | sub | (a, b) | return a - b | Same as a - b. | Same as a - b. | [
"Same",
"as",
"a",
"-",
"b",
"."
] | def sub(a, b):
"Same as a - b."
return a - b | [
"def",
"sub",
"(",
"a",
",",
"b",
")",
":",
"return",
"a",
"-",
"b"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py#L132-L134 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/ast.py | python | Transformer._dispatch | (self, ast: Union[None, AST, ASTSequence], *args: Any, **kwargs: Any) | Visit and transform an (optional) AST or a sequence of ASTs. | Visit and transform an (optional) AST or a sequence of ASTs. | [
"Visit",
"and",
"transform",
"an",
"(",
"optional",
")",
"AST",
"or",
"a",
"sequence",
"of",
"ASTs",
"."
] | def _dispatch(self, ast: Union[None, AST, ASTSequence], *args: Any, **kwargs: Any) -> Union[None, AST, MutableSequence[AST]]:
'''
Visit and transform an (optional) AST or a sequence of ASTs.
'''
if ast is None:
return ast
if isinstance(ast, AST):
return s... | [
"def",
"_dispatch",
"(",
"self",
",",
"ast",
":",
"Union",
"[",
"None",
",",
"AST",
",",
"ASTSequence",
"]",
",",
"*",
"args",
":",
"Any",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"Union",
"[",
"None",
",",
"AST",
",",
"MutableSequence",
"... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/ast.py#L1175-L1188 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | AppendableTable.write_data_chunk | (
self,
rows: np.ndarray,
indexes: list[np.ndarray],
mask: np.ndarray | None,
values: list[np.ndarray],
) | Parameters
----------
rows : an empty memory space where we are putting the chunk
indexes : an array of the indexes
mask : an array of the masks
values : an array of the values | Parameters
----------
rows : an empty memory space where we are putting the chunk
indexes : an array of the indexes
mask : an array of the masks
values : an array of the values | [
"Parameters",
"----------",
"rows",
":",
"an",
"empty",
"memory",
"space",
"where",
"we",
"are",
"putting",
"the",
"chunk",
"indexes",
":",
"an",
"array",
"of",
"the",
"indexes",
"mask",
":",
"an",
"array",
"of",
"the",
"masks",
"values",
":",
"an",
"arr... | def write_data_chunk(
self,
rows: np.ndarray,
indexes: list[np.ndarray],
mask: np.ndarray | None,
values: list[np.ndarray],
):
"""
Parameters
----------
rows : an empty memory space where we are putting the chunk
indexes : an array of t... | [
"def",
"write_data_chunk",
"(",
"self",
",",
"rows",
":",
"np",
".",
"ndarray",
",",
"indexes",
":",
"list",
"[",
"np",
".",
"ndarray",
"]",
",",
"mask",
":",
"np",
".",
"ndarray",
"|",
"None",
",",
"values",
":",
"list",
"[",
"np",
".",
"ndarray",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L4392-L4434 | ||
isl-org/Open3D | 79aec3ddde6a571ce2f28e4096477e52ec465244 | docs/make_docs.py | python | PyAPIDocsBuilder._try_import_module | (self, full_module_name) | Returns the module object for the given module path | Returns the module object for the given module path | [
"Returns",
"the",
"module",
"object",
"for",
"the",
"given",
"module",
"path"
] | def _try_import_module(self, full_module_name):
"""Returns the module object for the given module path"""
import open3d # make sure the root module is loaded
if open3d._build_config['BUILD_TENSORFLOW_OPS']:
import open3d.ml.tf
if open3d._build_config['BUILD_PYTORCH_OPS']:
... | [
"def",
"_try_import_module",
"(",
"self",
",",
"full_module_name",
")",
":",
"import",
"open3d",
"# make sure the root module is loaded",
"if",
"open3d",
".",
"_build_config",
"[",
"'BUILD_TENSORFLOW_OPS'",
"]",
":",
"import",
"open3d",
".",
"ml",
".",
"tf",
"if",
... | https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/docs/make_docs.py#L116-L136 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | RobotModel.setVelocity | (self, dq) | return _robotsim.RobotModel_setVelocity(self, dq) | setVelocity(RobotModel self, doubleVector dq)
Sets the current velocity of the robot model. Like the configuration, this is
also essentially a temporary variable. | setVelocity(RobotModel self, doubleVector dq) | [
"setVelocity",
"(",
"RobotModel",
"self",
"doubleVector",
"dq",
")"
] | def setVelocity(self, dq):
"""
setVelocity(RobotModel self, doubleVector dq)
Sets the current velocity of the robot model. Like the configuration, this is
also essentially a temporary variable.
"""
return _robotsim.RobotModel_setVelocity(self, dq) | [
"def",
"setVelocity",
"(",
"self",
",",
"dq",
")",
":",
"return",
"_robotsim",
".",
"RobotModel_setVelocity",
"(",
"self",
",",
"dq",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L4674-L4684 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/universe/system_network.py | python | get_shortest_distance | (system_1: SystemId, system_2: SystemId) | return _get_shortest_distance(*_min_max(system_1, system_2)) | Return the distance between the systems where objects are located. | Return the distance between the systems where objects are located. | [
"Return",
"the",
"distance",
"between",
"the",
"systems",
"where",
"objects",
"are",
"located",
"."
] | def get_shortest_distance(system_1: SystemId, system_2: SystemId) -> float:
"""
Return the distance between the systems where objects are located.
"""
return _get_shortest_distance(*_min_max(system_1, system_2)) | [
"def",
"get_shortest_distance",
"(",
"system_1",
":",
"SystemId",
",",
"system_2",
":",
"SystemId",
")",
"->",
"float",
":",
"return",
"_get_shortest_distance",
"(",
"*",
"_min_max",
"(",
"system_1",
",",
"system_2",
")",
")"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/universe/system_network.py#L59-L63 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/gyp/apkbuilder.py | python | _ExpandPaths | (paths) | return ret | Converts src:dst into tuples and enumerates files within directories.
Args:
paths: Paths in the form "src_path:dest_path"
Returns:
A list of (src_path, dest_path) tuples sorted by dest_path (for stable
ordering within output .apk). | Converts src:dst into tuples and enumerates files within directories. | [
"Converts",
"src",
":",
"dst",
"into",
"tuples",
"and",
"enumerates",
"files",
"within",
"directories",
"."
] | def _ExpandPaths(paths):
"""Converts src:dst into tuples and enumerates files within directories.
Args:
paths: Paths in the form "src_path:dest_path"
Returns:
A list of (src_path, dest_path) tuples sorted by dest_path (for stable
ordering within output .apk).
"""
ret = []
for path in paths:
... | [
"def",
"_ExpandPaths",
"(",
"paths",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"path",
"in",
"paths",
":",
"src_path",
",",
"dest_path",
"=",
"_SplitAssetPath",
"(",
"path",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"src_path",
")",
":",
"for",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/gyp/apkbuilder.py#L107-L126 | |
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/session.py | python | Session.__dispatchEvent | (sessionRef, eventHandle) | event dispatcher | event dispatcher | [
"event",
"dispatcher"
] | def __dispatchEvent(sessionRef, eventHandle): # pragma: no cover
""" event dispatcher """
try:
session = sessionRef()
if session is not None:
event = Event(eventHandle, session)
session.__handler(event, session)
except:
print("E... | [
"def",
"__dispatchEvent",
"(",
"sessionRef",
",",
"eventHandle",
")",
":",
"# pragma: no cover",
"try",
":",
"session",
"=",
"sessionRef",
"(",
")",
"if",
"session",
"is",
"not",
"None",
":",
"event",
"=",
"Event",
"(",
"eventHandle",
",",
"session",
")",
... | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/session.py#L102-L112 | ||
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L1384-L1405 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | scripts/mk_genfile_common.py | python | mk_z3consts_py_internal | (api_files, output_dir) | return z3consts_output_path | Generate ``z3consts.py`` from the list of API header files
in ``api_files`` and write the output file into
the ``output_dir`` directory
Returns the path to the generated file. | Generate ``z3consts.py`` from the list of API header files
in ``api_files`` and write the output file into
the ``output_dir`` directory | [
"Generate",
"z3consts",
".",
"py",
"from",
"the",
"list",
"of",
"API",
"header",
"files",
"in",
"api_files",
"and",
"write",
"the",
"output",
"file",
"into",
"the",
"output_dir",
"directory"
] | def mk_z3consts_py_internal(api_files, output_dir):
"""
Generate ``z3consts.py`` from the list of API header files
in ``api_files`` and write the output file into
the ``output_dir`` directory
Returns the path to the generated file.
"""
assert os.path.isdir(output_dir)
as... | [
"def",
"mk_z3consts_py_internal",
"(",
"api_files",
",",
"output_dir",
")",
":",
"assert",
"os",
".",
"path",
".",
"isdir",
"(",
"output_dir",
")",
"assert",
"isinstance",
"(",
"api_files",
",",
"list",
")",
"blank_pat",
"=",
"re",
".",
"compile",
"(",
"\"... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/scripts/mk_genfile_common.py#L84-L165 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/subrobot.py | python | SubRobotModel.__init__ | (self, robot : Union[RobotModel,'SubRobotModel'], links : Sequence[Union[int,str]]) | Args:
robot (RobotModel or SubRobotModel): the robot to base this on.
links (list of ints or strs): the links to use in this sub-robot. | Args:
robot (RobotModel or SubRobotModel): the robot to base this on.
links (list of ints or strs): the links to use in this sub-robot. | [
"Args",
":",
"robot",
"(",
"RobotModel",
"or",
"SubRobotModel",
")",
":",
"the",
"robot",
"to",
"base",
"this",
"on",
".",
"links",
"(",
"list",
"of",
"ints",
"or",
"strs",
")",
":",
"the",
"links",
"to",
"use",
"in",
"this",
"sub",
"-",
"robot",
"... | def __init__(self, robot : Union[RobotModel,'SubRobotModel'], links : Sequence[Union[int,str]]):
"""
Args:
robot (RobotModel or SubRobotModel): the robot to base this on.
links (list of ints or strs): the links to use in this sub-robot.
"""
assert isinstance(robot... | [
"def",
"__init__",
"(",
"self",
",",
"robot",
":",
"Union",
"[",
"RobotModel",
",",
"'SubRobotModel'",
"]",
",",
"links",
":",
"Sequence",
"[",
"Union",
"[",
"int",
",",
"str",
"]",
"]",
")",
":",
"assert",
"isinstance",
"(",
"robot",
",",
"(",
"Robo... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/subrobot.py#L28-L49 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.DeselectCell | (*args, **kwargs) | return _grid.Grid_DeselectCell(*args, **kwargs) | DeselectCell(self, int row, int col) | DeselectCell(self, int row, int col) | [
"DeselectCell",
"(",
"self",
"int",
"row",
"int",
"col",
")"
] | def DeselectCell(*args, **kwargs):
"""DeselectCell(self, int row, int col)"""
return _grid.Grid_DeselectCell(*args, **kwargs) | [
"def",
"DeselectCell",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_DeselectCell",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L2085-L2087 | |
zeakey/DeepSkeleton | dc70170f8fd2ec8ca1157484ce66129981104486 | python/caffe/pycaffe.py | python | _Net_set_input_arrays | (self, data, labels) | return self._set_input_arrays(data, labels) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | [
"Set",
"input",
"arrays",
"of",
"the",
"in",
"-",
"memory",
"MemoryDataLayer",
".",
"(",
"Note",
":",
"this",
"is",
"only",
"for",
"networks",
"declared",
"with",
"the",
"memory",
"data",
"layer",
".",
")"
] | def _Net_set_input_arrays(self, data, labels):
"""
Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.)
"""
if labels.ndim == 1:
labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
... | [
"def",
"_Net_set_input_arrays",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"labels",
".",
"ndim",
"==",
"1",
":",
"labels",
"=",
"np",
".",
"ascontiguousarray",
"(",
"labels",
"[",
":",
",",
"np",
".",
"newaxis",
",",
"np",
".",
"newaxi... | https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/python/caffe/pycaffe.py#L236-L244 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/SocketServer.py | python | ForkingMixIn.collect_children | (self) | Internal routine to wait for children that have exited. | Internal routine to wait for children that have exited. | [
"Internal",
"routine",
"to",
"wait",
"for",
"children",
"that",
"have",
"exited",
"."
] | def collect_children(self):
"""Internal routine to wait for children that have exited."""
if self.active_children is None:
return
# If we're above the max number of children, wait and reap them until
# we go back below threshold. Note that we use waitpid(-1) below to be
... | [
"def",
"collect_children",
"(",
"self",
")",
":",
"if",
"self",
".",
"active_children",
"is",
"None",
":",
"return",
"# If we're above the max number of children, wait and reap them until",
"# we go back below threshold. Note that we use waitpid(-1) below to be",
"# able to collect c... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/SocketServer.py#L518-L550 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/resumable_download_handler.py | python | ResumableDownloadHandler._attempt_resumable_download | (self, key, fp, headers, cb, num_cb,
torrent, version_id, hash_algs) | Attempts a resumable download.
Raises ResumableDownloadException if any problems occur. | Attempts a resumable download. | [
"Attempts",
"a",
"resumable",
"download",
"."
] | def _attempt_resumable_download(self, key, fp, headers, cb, num_cb,
torrent, version_id, hash_algs):
"""
Attempts a resumable download.
Raises ResumableDownloadException if any problems occur.
"""
cur_file_size = get_cur_file_size(fp, position... | [
"def",
"_attempt_resumable_download",
"(",
"self",
",",
"key",
",",
"fp",
",",
"headers",
",",
"cb",
",",
"num_cb",
",",
"torrent",
",",
"version_id",
",",
"hash_algs",
")",
":",
"cur_file_size",
"=",
"get_cur_file_size",
"(",
"fp",
",",
"position_to_eof",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/resumable_download_handler.py#L175-L221 | ||
google/filament | d21f092645b8e1e312307cbf89f1484891347c63 | third_party/benchmark/tools/gbench/report.py | python | partition_benchmarks | (json1, json2) | return partitions | While preserving the ordering, find benchmarks with the same names in
both of the inputs, and group them.
(i.e. partition/filter into groups with common name) | While preserving the ordering, find benchmarks with the same names in
both of the inputs, and group them.
(i.e. partition/filter into groups with common name) | [
"While",
"preserving",
"the",
"ordering",
"find",
"benchmarks",
"with",
"the",
"same",
"names",
"in",
"both",
"of",
"the",
"inputs",
"and",
"group",
"them",
".",
"(",
"i",
".",
"e",
".",
"partition",
"/",
"filter",
"into",
"groups",
"with",
"common",
"na... | def partition_benchmarks(json1, json2):
"""
While preserving the ordering, find benchmarks with the same names in
both of the inputs, and group them.
(i.e. partition/filter into groups with common name)
"""
json1_unique_names = get_unique_benchmark_names(json1)
json2_unique_names = get_uniqu... | [
"def",
"partition_benchmarks",
"(",
"json1",
",",
"json2",
")",
":",
"json1_unique_names",
"=",
"get_unique_benchmark_names",
"(",
"json1",
")",
"json2_unique_names",
"=",
"get_unique_benchmark_names",
"(",
"json2",
")",
"names",
"=",
"intersect",
"(",
"json1_unique_n... | https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/benchmark/tools/gbench/report.py#L116-L136 | |
h2oai/deepwater | 80e345c582e6ef912a31f42707a2f31c01b064da | docs/sphinxext/docscrape.py | python | dedent_lines | (lines) | return textwrap.dedent("\n".join(lines)).split("\n") | Deindent a list of lines maximally | Deindent a list of lines maximally | [
"Deindent",
"a",
"list",
"of",
"lines",
"maximally"
] | def dedent_lines(lines):
"""Deindent a list of lines maximally"""
return textwrap.dedent("\n".join(lines)).split("\n") | [
"def",
"dedent_lines",
"(",
"lines",
")",
":",
"return",
"textwrap",
".",
"dedent",
"(",
"\"\\n\"",
".",
"join",
"(",
"lines",
")",
")",
".",
"split",
"(",
"\"\\n\"",
")"
] | https://github.com/h2oai/deepwater/blob/80e345c582e6ef912a31f42707a2f31c01b064da/docs/sphinxext/docscrape.py#L400-L402 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/response.py | python | StreamingBody.set_socket_timeout | (self, timeout) | Set the timeout seconds on the socket. | Set the timeout seconds on the socket. | [
"Set",
"the",
"timeout",
"seconds",
"on",
"the",
"socket",
"."
] | def set_socket_timeout(self, timeout):
"""Set the timeout seconds on the socket."""
# The problem we're trying to solve is to prevent .read() calls from
# hanging. This can happen in rare cases. What we'd like to ideally
# do is set a timeout on the .read() call so that callers can ret... | [
"def",
"set_socket_timeout",
"(",
"self",
",",
"timeout",
")",
":",
"# The problem we're trying to solve is to prevent .read() calls from",
"# hanging. This can happen in rare cases. What we'd like to ideally",
"# do is set a timeout on the .read() call so that callers can retry",
"# the req... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/response.py#L49-L70 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.MoveLeft | (*args, **kwargs) | return _richtext.RichTextCtrl_MoveLeft(*args, **kwargs) | MoveLeft(self, int noPositions=1, int flags=0) -> bool
Move left | MoveLeft(self, int noPositions=1, int flags=0) -> bool | [
"MoveLeft",
"(",
"self",
"int",
"noPositions",
"=",
"1",
"int",
"flags",
"=",
"0",
")",
"-",
">",
"bool"
] | def MoveLeft(*args, **kwargs):
"""
MoveLeft(self, int noPositions=1, int flags=0) -> bool
Move left
"""
return _richtext.RichTextCtrl_MoveLeft(*args, **kwargs) | [
"def",
"MoveLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_MoveLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3728-L3734 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBThread.GetStopReason | (self) | return _lldb.SBThread_GetStopReason(self) | GetStopReason(SBThread self) -> lldb::StopReason | GetStopReason(SBThread self) -> lldb::StopReason | [
"GetStopReason",
"(",
"SBThread",
"self",
")",
"-",
">",
"lldb",
"::",
"StopReason"
] | def GetStopReason(self):
"""GetStopReason(SBThread self) -> lldb::StopReason"""
return _lldb.SBThread_GetStopReason(self) | [
"def",
"GetStopReason",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBThread_GetStopReason",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L11516-L11518 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/wsgiserver/wsgiserver2.py | python | HTTPConnection.close | (self) | Close the socket underlying this connection. | Close the socket underlying this connection. | [
"Close",
"the",
"socket",
"underlying",
"this",
"connection",
"."
] | def close(self):
"""Close the socket underlying this connection."""
self.rfile.close()
if not self.linger:
# Python's socket module does NOT call close on the kernel socket
# when you call socket.close(). We do so manually here because we
# want this ... | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"rfile",
".",
"close",
"(",
")",
"if",
"not",
"self",
".",
"linger",
":",
"# Python's socket module does NOT call close on the kernel socket",
"# when you call socket.close(). We do so manually here because we",
"# want th... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/wsgiserver/wsgiserver2.py#L1358-L1378 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI._connect | (self) | Connect to the device. | Connect to the device. | [
"Connect",
"to",
"the",
"device",
"."
] | def _connect(self):
"""
Connect to the device.
""" | [
"def",
"_connect",
"(",
"self",
")",
":"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L232-L235 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/queue_runner.py | python | QueueRunner._init_from_args | (self, queue=None, enqueue_ops=None, close_op=None,
cancel_op=None) | Create a QueueRunner from arguments.
Args:
queue: A `Queue`.
enqueue_ops: List of enqueue ops to run in threads later.
close_op: Op to close the queue. Pending enqueue ops are preserved.
cancel_op: Op to close the queue and cancel pending enqueue ops.
Raises:
ValueError: If `queu... | Create a QueueRunner from arguments. | [
"Create",
"a",
"QueueRunner",
"from",
"arguments",
"."
] | def _init_from_args(self, queue=None, enqueue_ops=None, close_op=None,
cancel_op=None):
"""Create a QueueRunner from arguments.
Args:
queue: A `Queue`.
enqueue_ops: List of enqueue ops to run in threads later.
close_op: Op to close the queue. Pending enqueue ops are pres... | [
"def",
"_init_from_args",
"(",
"self",
",",
"queue",
"=",
"None",
",",
"enqueue_ops",
"=",
"None",
",",
"close_op",
"=",
"None",
",",
"cancel_op",
"=",
"None",
")",
":",
"if",
"not",
"queue",
"or",
"not",
"enqueue_ops",
":",
"raise",
"ValueError",
"(",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/queue_runner.py#L86-L113 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/urllib3/util/timeout.py | python | Timeout.from_float | (cls, timeout) | return Timeout(read=timeout, connect=timeout) | Create a new Timeout from a legacy timeout value.
The timeout value used by httplib.py sets the same timeout on the
connect(), and recv() socket requests. This creates a :class:`Timeout`
object that sets the individual timeouts to the ``timeout`` value
passed to this function.
... | Create a new Timeout from a legacy timeout value. | [
"Create",
"a",
"new",
"Timeout",
"from",
"a",
"legacy",
"timeout",
"value",
"."
] | def from_float(cls, timeout):
""" Create a new Timeout from a legacy timeout value.
The timeout value used by httplib.py sets the same timeout on the
connect(), and recv() socket requests. This creates a :class:`Timeout`
object that sets the individual timeouts to the ``timeout`` value
... | [
"def",
"from_float",
"(",
"cls",
",",
"timeout",
")",
":",
"return",
"Timeout",
"(",
"read",
"=",
"timeout",
",",
"connect",
"=",
"timeout",
")"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/urllib3/util/timeout.py#L141-L154 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-automation/autothreadharness/pdu_controller.py | python | ApcPduController.close | (self) | Close telnet connection | Close telnet connection | [
"Close",
"telnet",
"connection"
] | def close(self):
"""Close telnet connection"""
logger.info('closing telnet')
if self.tn:
self.tn.close() | [
"def",
"close",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'closing telnet'",
")",
"if",
"self",
".",
"tn",
":",
"self",
".",
"tn",
".",
"close",
"(",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-automation/autothreadharness/pdu_controller.py#L112-L116 | ||
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py | python | _Tokenizer.TryConsume | (self, token) | return False | Tries to consume a given piece of text.
Args:
token: Text to consume.
Returns:
True iff the text was consumed. | Tries to consume a given piece of text. | [
"Tries",
"to",
"consume",
"a",
"given",
"piece",
"of",
"text",
"."
] | def TryConsume(self, token):
"""Tries to consume a given piece of text.
Args:
token: Text to consume.
Returns:
True iff the text was consumed.
"""
if self.token == token:
self.NextToken()
return True
return False | [
"def",
"TryConsume",
"(",
"self",
",",
"token",
")",
":",
"if",
"self",
".",
"token",
"==",
"token",
":",
"self",
".",
"NextToken",
"(",
")",
"return",
"True",
"return",
"False"
] | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/text_format.py#L358-L370 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/flow-monitor/examples/flowmon-parse-results.py | python | Simulation.__init__ | (self, simulation_el) | ! The initializer.
@param self The object pointer.
@param simulation_el The element. | ! The initializer. | [
"!",
"The",
"initializer",
"."
] | def __init__(self, simulation_el):
'''! The initializer.
@param self The object pointer.
@param simulation_el The element.
'''
self.flows = []
FlowClassifier_el, = simulation_el.findall("Ipv4FlowClassifier")
flow_map = {}
for flow_el in simulation_el.finda... | [
"def",
"__init__",
"(",
"self",
",",
"simulation_el",
")",
":",
"self",
".",
"flows",
"=",
"[",
"]",
"FlowClassifier_el",
",",
"=",
"simulation_el",
".",
"findall",
"(",
"\"Ipv4FlowClassifier\"",
")",
"flow_map",
"=",
"{",
"}",
"for",
"flow_el",
"in",
"sim... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/flow-monitor/examples/flowmon-parse-results.py#L160-L188 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/functions/Examples/ExamplePeakFunction.py | python | ExamplePeakFunction.setFwhm | (self, new_fwhm) | Called by an external entity, probably a GUI, in response to a user guessing
the height. | Called by an external entity, probably a GUI, in response to a user guessing
the height. | [
"Called",
"by",
"an",
"external",
"entity",
"probably",
"a",
"GUI",
"in",
"response",
"to",
"a",
"user",
"guessing",
"the",
"height",
"."
] | def setFwhm(self, new_fwhm):
"""
Called by an external entity, probably a GUI, in response to a user guessing
the height.
"""
sigma = new_fwhm/(2.0*math.sqrt(2.0*math.log(2.0)))
self.setParameter("Sigma", sigma) | [
"def",
"setFwhm",
"(",
"self",
",",
"new_fwhm",
")",
":",
"sigma",
"=",
"new_fwhm",
"/",
"(",
"2.0",
"*",
"math",
".",
"sqrt",
"(",
"2.0",
"*",
"math",
".",
"log",
"(",
"2.0",
")",
")",
")",
"self",
".",
"setParameter",
"(",
"\"Sigma\"",
",",
"si... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/functions/Examples/ExamplePeakFunction.py#L177-L183 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/bandwidth.py | python | BandwidthLimitedStream.read | (self, amount) | return self._fileobj.read(amount) | Read a specified amount
Reads will only be throttled if bandwidth limiting is enabled. | Read a specified amount | [
"Read",
"a",
"specified",
"amount"
] | def read(self, amount):
"""Read a specified amount
Reads will only be throttled if bandwidth limiting is enabled.
"""
if not self._bandwidth_limiting_enabled:
return self._fileobj.read(amount)
# We do not want to be calling consume on every read as the read
... | [
"def",
"read",
"(",
"self",
",",
"amount",
")",
":",
"if",
"not",
"self",
".",
"_bandwidth_limiting_enabled",
":",
"return",
"self",
".",
"_fileobj",
".",
"read",
"(",
"amount",
")",
"# We do not want to be calling consume on every read as the read",
"# amounts can be... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/bandwidth.py#L138-L156 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py | python | BeamSearchDecoder.initialize | (self, name=None) | return (finished, start_inputs, initial_state) | Initialize the decoder.
Args:
name: Name scope for any created operations.
Returns:
`(finished, start_inputs, initial_state)`. | Initialize the decoder. | [
"Initialize",
"the",
"decoder",
"."
] | def initialize(self, name=None):
"""Initialize the decoder.
Args:
name: Name scope for any created operations.
Returns:
`(finished, start_inputs, initial_state)`.
"""
finished, start_inputs = self._finished, self._start_inputs
initial_state = BeamSearchDecoderState(
cell_s... | [
"def",
"initialize",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"finished",
",",
"start_inputs",
"=",
"self",
".",
"_finished",
",",
"self",
".",
"_start_inputs",
"initial_state",
"=",
"BeamSearchDecoderState",
"(",
"cell_state",
"=",
"self",
".",
"_in... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py#L289-L309 | |
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/framework/interfaces/face/face.py | python | ResponseReceiver.response | (self, response) | Receives a response from the service-side of the RPC.
Args:
response: A response object emitted from the service-side of the RPC. | Receives a response from the service-side of the RPC. | [
"Receives",
"a",
"response",
"from",
"the",
"service",
"-",
"side",
"of",
"the",
"RPC",
"."
] | def response(self, response):
"""Receives a response from the service-side of the RPC.
Args:
response: A response object emitted from the service-side of the RPC.
"""
raise NotImplementedError() | [
"def",
"response",
"(",
"self",
",",
"response",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/framework/interfaces/face/face.py#L332-L338 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | isIdeographic | (ch) | return ret | This function is DEPRECATED. Use xmlIsIdeographicQ instead | This function is DEPRECATED. Use xmlIsIdeographicQ instead | [
"This",
"function",
"is",
"DEPRECATED",
".",
"Use",
"xmlIsIdeographicQ",
"instead"
] | def isIdeographic(ch):
"""This function is DEPRECATED. Use xmlIsIdeographicQ instead """
ret = libxml2mod.xmlIsIdeographic(ch)
return ret | [
"def",
"isIdeographic",
"(",
"ch",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlIsIdeographic",
"(",
"ch",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L274-L277 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/util/nest.py | python | is_nested_or_composite | (seq) | return _is_nested_or_composite(seq) | Returns true if its input is a nested structure or a composite.
Refer to [tf.nest](https://www.tensorflow.org/api_docs/python/tf/nest)
for the definition of a nested structure.
Args:
seq: the value to test.
Returns:
True if the input is a nested structure or a composite. | Returns true if its input is a nested structure or a composite. | [
"Returns",
"true",
"if",
"its",
"input",
"is",
"a",
"nested",
"structure",
"or",
"a",
"composite",
"."
] | def is_nested_or_composite(seq):
"""Returns true if its input is a nested structure or a composite.
Refer to [tf.nest](https://www.tensorflow.org/api_docs/python/tf/nest)
for the definition of a nested structure.
Args:
seq: the value to test.
Returns:
True if the input is a nested structure or a co... | [
"def",
"is_nested_or_composite",
"(",
"seq",
")",
":",
"return",
"_is_nested_or_composite",
"(",
"seq",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/nest.py#L328-L340 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/scimath.py | python | _tocomplex | (arr) | Convert its input `arr` to a complex array.
The input is returned as a complex array of the smallest type that will fit
the original data: types like single, byte, short, etc. become csingle,
while others become cdouble.
A copy of the input is always made.
Parameters
----------
arr : arra... | Convert its input `arr` to a complex array. | [
"Convert",
"its",
"input",
"arr",
"to",
"a",
"complex",
"array",
"."
] | def _tocomplex(arr):
"""Convert its input `arr` to a complex array.
The input is returned as a complex array of the smallest type that will fit
the original data: types like single, byte, short, etc. become csingle,
while others become cdouble.
A copy of the input is always made.
Parameters
... | [
"def",
"_tocomplex",
"(",
"arr",
")",
":",
"if",
"issubclass",
"(",
"arr",
".",
"dtype",
".",
"type",
",",
"(",
"nt",
".",
"single",
",",
"nt",
".",
"byte",
",",
"nt",
".",
"short",
",",
"nt",
".",
"ubyte",
",",
"nt",
".",
"ushort",
",",
"nt",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/scimath.py#L36-L96 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/tlslite/tlslite/utils/RSAKey.py | python | RSAKey.generate | (bits) | Generate a new key with the specified bit length.
@rtype: L{tlslite.utils.RSAKey.RSAKey} | Generate a new key with the specified bit length. | [
"Generate",
"a",
"new",
"key",
"with",
"the",
"specified",
"bit",
"length",
"."
] | def generate(bits):
"""Generate a new key with the specified bit length.
@rtype: L{tlslite.utils.RSAKey.RSAKey}
"""
raise NotImplementedError() | [
"def",
"generate",
"(",
"bits",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/utils/RSAKey.py#L226-L231 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/default_settings.py | python | load_user_settings | (ctx) | return (user_settings, new_options) | Apply all loaded options if they are different that the default value, and no cmd line value is presented | Apply all loaded options if they are different that the default value, and no cmd line value is presented | [
"Apply",
"all",
"loaded",
"options",
"if",
"they",
"are",
"different",
"that",
"the",
"default",
"value",
"and",
"no",
"cmd",
"line",
"value",
"is",
"presented"
] | def load_user_settings(ctx):
""" Apply all loaded options if they are different that the default value, and no cmd line value is presented """
global user_settings
_load_default_settings_file(ctx)
write_user_settings = False
user_settings = ConfigParser.ConfigParser()
user_setting_file = ctx.get_user_s... | [
"def",
"load_user_settings",
"(",
"ctx",
")",
":",
"global",
"user_settings",
"_load_default_settings_file",
"(",
"ctx",
")",
"write_user_settings",
"=",
"False",
"user_settings",
"=",
"ConfigParser",
".",
"ConfigParser",
"(",
")",
"user_setting_file",
"=",
"ctx",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/default_settings.py#L521-L634 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/tools/graph_transforms/__init__.py | python | TransformGraph | (input_graph_def, inputs, outputs, transforms) | return output_graph_def | Python wrapper for the Graph Transform Tool.
Gives access to all graph transforms available through the command line tool.
See documentation at https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/graph_transforms/README.md
for full details of the options available.
Args:
input_graph_def:... | Python wrapper for the Graph Transform Tool. | [
"Python",
"wrapper",
"for",
"the",
"Graph",
"Transform",
"Tool",
"."
] | def TransformGraph(input_graph_def, inputs, outputs, transforms):
"""Python wrapper for the Graph Transform Tool.
Gives access to all graph transforms available through the command line tool.
See documentation at https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/graph_transforms/README.md
f... | [
"def",
"TransformGraph",
"(",
"input_graph_def",
",",
"inputs",
",",
"outputs",
",",
"transforms",
")",
":",
"input_graph_def_string",
"=",
"input_graph_def",
".",
"SerializeToString",
"(",
")",
"inputs_string",
"=",
"compat",
".",
"as_bytes",
"(",
"\",\"",
".",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/graph_transforms/__init__.py#L27-L54 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | clang/bindings/python/clang/cindex.py | python | Cursor.get_tokens | (self) | return TokenGroup.get_tokens(self._tu, self.extent) | Obtain Token instances formulating that compose this Cursor.
This is a generator for Token instances. It returns all tokens which
occupy the extent this cursor occupies. | Obtain Token instances formulating that compose this Cursor. | [
"Obtain",
"Token",
"instances",
"formulating",
"that",
"compose",
"this",
"Cursor",
"."
] | def get_tokens(self):
"""Obtain Token instances formulating that compose this Cursor.
This is a generator for Token instances. It returns all tokens which
occupy the extent this cursor occupies.
"""
return TokenGroup.get_tokens(self._tu, self.extent) | [
"def",
"get_tokens",
"(",
"self",
")",
":",
"return",
"TokenGroup",
".",
"get_tokens",
"(",
"self",
".",
"_tu",
",",
"self",
".",
"extent",
")"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1855-L1861 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/service.py | python | RpcController.SetFailed | (self, reason) | Sets a failure reason.
Causes Failed() to return true on the client side. "reason" will be
incorporated into the message returned by ErrorText(). If you find
you need to return machine-readable information about failures, you
should incorporate it into your response protocol buffer and should
NOT... | Sets a failure reason. | [
"Sets",
"a",
"failure",
"reason",
"."
] | def SetFailed(self, reason):
"""Sets a failure reason.
Causes Failed() to return true on the client side. "reason" will be
incorporated into the message returned by ErrorText(). If you find
you need to return machine-readable information about failures, you
should incorporate it into your respons... | [
"def",
"SetFailed",
"(",
"self",
",",
"reason",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/service.py#L166-L175 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/dimension.py | python | LayoutDimension.exact | (cls, amount) | return cls(min=amount, max=amount, preferred=amount) | Return a :class:`.LayoutDimension` with an exact size. (min, max and
preferred set to ``amount``). | Return a :class:`.LayoutDimension` with an exact size. (min, max and
preferred set to ``amount``). | [
"Return",
"a",
":",
"class",
":",
".",
"LayoutDimension",
"with",
"an",
"exact",
"size",
".",
"(",
"min",
"max",
"and",
"preferred",
"set",
"to",
"amount",
")",
"."
] | def exact(cls, amount):
"""
Return a :class:`.LayoutDimension` with an exact size. (min, max and
preferred set to ``amount``).
"""
return cls(min=amount, max=amount, preferred=amount) | [
"def",
"exact",
"(",
"cls",
",",
"amount",
")",
":",
"return",
"cls",
"(",
"min",
"=",
"amount",
",",
"max",
"=",
"amount",
",",
"preferred",
"=",
"amount",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/dimension.py#L58-L63 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.SetSelectionMode | (*args, **kwargs) | return _grid.Grid_SetSelectionMode(*args, **kwargs) | SetSelectionMode(self, WXGRIDSELECTIONMODES selmode) | SetSelectionMode(self, WXGRIDSELECTIONMODES selmode) | [
"SetSelectionMode",
"(",
"self",
"WXGRIDSELECTIONMODES",
"selmode",
")"
] | def SetSelectionMode(*args, **kwargs):
"""SetSelectionMode(self, WXGRIDSELECTIONMODES selmode)"""
return _grid.Grid_SetSelectionMode(*args, **kwargs) | [
"def",
"SetSelectionMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_SetSelectionMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1223-L1225 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/recipes.py | python | parse | (repo_root, recipes_cfg_path) | Parse is a lightweight a recipes.cfg file parser.
Args:
repo_root (str) - native path to the root of the repo we're trying to run
recipes for.
recipes_cfg_path (str) - native path to the recipes.cfg file to process.
Returns (as tuple):
engine_dep (EngineDep|None): The recipe_engine dependency, o... | Parse is a lightweight a recipes.cfg file parser. | [
"Parse",
"is",
"a",
"lightweight",
"a",
"recipes",
".",
"cfg",
"file",
"parser",
"."
] | def parse(repo_root, recipes_cfg_path):
"""Parse is a lightweight a recipes.cfg file parser.
Args:
repo_root (str) - native path to the root of the repo we're trying to run
recipes for.
recipes_cfg_path (str) - native path to the recipes.cfg file to process.
Returns (as tuple):
engine_dep (Eng... | [
"def",
"parse",
"(",
"repo_root",
",",
"recipes_cfg_path",
")",
":",
"with",
"open",
"(",
"recipes_cfg_path",
",",
"'r'",
")",
"as",
"fh",
":",
"pb",
"=",
"json",
".",
"load",
"(",
"fh",
")",
"try",
":",
"if",
"pb",
"[",
"'api_version'",
"]",
"!=",
... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipes.py#L59-L109 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/numpy_extension/random.py | python | uniform_n | (low=0.0, high=1.0, batch_shape=None, dtype=None, ctx=None) | r"""Draw samples from a uniform distribution.
Samples are uniformly distributed over the half-open interval
``[low, high)`` (includes low, but excludes high). In other words,
any value within the given interval is equally likely to be drawn
by `uniform`.
Parameters
----------
low : float,... | r"""Draw samples from a uniform distribution. | [
"r",
"Draw",
"samples",
"from",
"a",
"uniform",
"distribution",
"."
] | def uniform_n(low=0.0, high=1.0, batch_shape=None, dtype=None, ctx=None):
r"""Draw samples from a uniform distribution.
Samples are uniformly distributed over the half-open interval
``[low, high)`` (includes low, but excludes high). In other words,
any value within the given interval is equally likely... | [
"def",
"uniform_n",
"(",
"low",
"=",
"0.0",
",",
"high",
"=",
"1.0",
",",
"batch_shape",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"ctx",
"=",
"None",
")",
":",
"from",
".",
".",
"numpy",
"import",
"_Symbol",
"as",
"np_symbol",
"input_type",
"=",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy_extension/random.py#L104-L181 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlTextReader.NewFd | (self, fd, URL, encoding, options) | return ret | Setup an xmltextReader to parse an XML from a file
descriptor. NOTE that the file descriptor will not be
closed when the reader is closed or reset. The parsing
flags @options are a combination of xmlParserOption. This
reuses the existing @reader xmlTextReader. | Setup an xmltextReader to parse an XML from a file
descriptor. NOTE that the file descriptor will not be
closed when the reader is closed or reset. The parsing
flags | [
"Setup",
"an",
"xmltextReader",
"to",
"parse",
"an",
"XML",
"from",
"a",
"file",
"descriptor",
".",
"NOTE",
"that",
"the",
"file",
"descriptor",
"will",
"not",
"be",
"closed",
"when",
"the",
"reader",
"is",
"closed",
"or",
"reset",
".",
"The",
"parsing",
... | def NewFd(self, fd, URL, encoding, options):
"""Setup an xmltextReader to parse an XML from a file
descriptor. NOTE that the file descriptor will not be
closed when the reader is closed or reset. The parsing
flags @options are a combination of xmlParserOption. This
reuse... | [
"def",
"NewFd",
"(",
"self",
",",
"fd",
",",
"URL",
",",
"encoding",
",",
"options",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlReaderNewFd",
"(",
"self",
".",
"_o",
",",
"fd",
",",
"URL",
",",
"encoding",
",",
"options",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L5954-L5961 | |
zdevito/ATen | 4aa3e1de29ed58457e530f84217e53db0998476c | aten/src/ATen/nn_parse.py | python | remove_unused_args | (args, thnn_args) | return args | Returns the subset of args whose name appears in thnn_args | Returns the subset of args whose name appears in thnn_args | [
"Returns",
"the",
"subset",
"of",
"args",
"whose",
"name",
"appears",
"in",
"thnn_args"
] | def remove_unused_args(args, thnn_args):
"""Returns the subset of args whose name appears in thnn_args"""
def clean_name(name):
name = name[:name.index('[')] if '[' in name else name
if name.endswith('_'):
name = name[:-1]
return name
uses = set([clean_name(arg['name']) f... | [
"def",
"remove_unused_args",
"(",
"args",
",",
"thnn_args",
")",
":",
"def",
"clean_name",
"(",
"name",
")",
":",
"name",
"=",
"name",
"[",
":",
"name",
".",
"index",
"(",
"'['",
")",
"]",
"if",
"'['",
"in",
"name",
"else",
"name",
"if",
"name",
".... | https://github.com/zdevito/ATen/blob/4aa3e1de29ed58457e530f84217e53db0998476c/aten/src/ATen/nn_parse.py#L196-L209 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-blocks/python/blocks/qa_repack_bits_bb.py | python | qa_repack_bits_bb.test_002_three_msb | (self) | 8 -> 3 | 8 -> 3 | [
"8",
"-",
">",
"3"
] | def test_002_three_msb(self):
""" 8 -> 3 """
src_data = [0b11111101, 0b11111111, 0b11111111]
expected_data = [0b111, ] + [0b111, ] + [0b011, ] + [0b111, ] * 5
k = 8
l = 3
src = blocks.vector_source_b(src_data, False, 1)
repack = blocks.repack_bits_bb(k, l, "", Fal... | [
"def",
"test_002_three_msb",
"(",
"self",
")",
":",
"src_data",
"=",
"[",
"0b11111101",
",",
"0b11111111",
",",
"0b11111111",
"]",
"expected_data",
"=",
"[",
"0b111",
",",
"]",
"+",
"[",
"0b111",
",",
"]",
"+",
"[",
"0b011",
",",
"]",
"+",
"[",
"0b11... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-blocks/python/blocks/qa_repack_bits_bb.py#L79-L90 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/image-classification/symbols/resnet-v1.py | python | residual_unit | (data, num_filter, stride, dim_match, name, bottle_neck=True, bn_mom=0.9, workspace=256, memonger=False) | Return ResNet Unit symbol for building ResNet
Parameters
----------
data : str
Input data
num_filter : int
Number of output channels
bnf : int
Bottle neck channels factor with regard to num_filter
stride : tuple
Stride used in convolution
dim_match : Boolean
... | Return ResNet Unit symbol for building ResNet
Parameters
----------
data : str
Input data
num_filter : int
Number of output channels
bnf : int
Bottle neck channels factor with regard to num_filter
stride : tuple
Stride used in convolution
dim_match : Boolean
... | [
"Return",
"ResNet",
"Unit",
"symbol",
"for",
"building",
"ResNet",
"Parameters",
"----------",
"data",
":",
"str",
"Input",
"data",
"num_filter",
":",
"int",
"Number",
"of",
"output",
"channels",
"bnf",
":",
"int",
"Bottle",
"neck",
"channels",
"factor",
"with... | def residual_unit(data, num_filter, stride, dim_match, name, bottle_neck=True, bn_mom=0.9, workspace=256, memonger=False):
"""Return ResNet Unit symbol for building ResNet
Parameters
----------
data : str
Input data
num_filter : int
Number of output channels
bnf : int
Bot... | [
"def",
"residual_unit",
"(",
"data",
",",
"num_filter",
",",
"stride",
",",
"dim_match",
",",
"name",
",",
"bottle_neck",
"=",
"True",
",",
"bn_mom",
"=",
"0.9",
",",
"workspace",
"=",
"256",
",",
"memonger",
"=",
"False",
")",
":",
"if",
"bottle_neck",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/image-classification/symbols/resnet-v1.py#L29-L87 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.StyleSetSpec | (*args, **kwargs) | return _stc.StyledTextCtrl_StyleSetSpec(*args, **kwargs) | StyleSetSpec(self, int styleNum, String spec)
Extract style settings from a spec-string which is composed of one or
more of the following comma separated elements::
bold turns on bold
italic turns on italics
fore:[name or #RRGG... | StyleSetSpec(self, int styleNum, String spec) | [
"StyleSetSpec",
"(",
"self",
"int",
"styleNum",
"String",
"spec",
")"
] | def StyleSetSpec(*args, **kwargs):
"""
StyleSetSpec(self, int styleNum, String spec)
Extract style settings from a spec-string which is composed of one or
more of the following comma separated elements::
bold turns on bold
italic ... | [
"def",
"StyleSetSpec",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StyleSetSpec",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6523-L6540 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/slim/python/slim/nets/resnet_v2.py | python | resnet_v2_101 | (inputs,
num_classes=None,
global_pool=True,
is_training=None,
output_stride=None,
reuse=None,
scope='resnet_v2_101') | return resnet_v2(
inputs,
blocks,
num_classes,
is_training,
global_pool,
output_stride,
include_root_block=True,
reuse=reuse,
scope=scope) | ResNet-101 model of [1]. See resnet_v2() for arg and return description. | ResNet-101 model of [1]. See resnet_v2() for arg and return description. | [
"ResNet",
"-",
"101",
"model",
"of",
"[",
"1",
"]",
".",
"See",
"resnet_v2",
"()",
"for",
"arg",
"and",
"return",
"description",
"."
] | def resnet_v2_101(inputs,
num_classes=None,
global_pool=True,
is_training=None,
output_stride=None,
reuse=None,
scope='resnet_v2_101'):
"""ResNet-101 model of [1]. See resnet_v2() for arg and return description... | [
"def",
"resnet_v2_101",
"(",
"inputs",
",",
"num_classes",
"=",
"None",
",",
"global_pool",
"=",
"True",
",",
"is_training",
"=",
"None",
",",
"output_stride",
"=",
"None",
",",
"reuse",
"=",
"None",
",",
"scope",
"=",
"'resnet_v2_101'",
")",
":",
"blocks"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/slim/python/slim/nets/resnet_v2.py#L295-L318 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Token.location | (self) | return conf.lib.clang_getTokenLocation(self._tu, self) | The SourceLocation this Token occurs at. | The SourceLocation this Token occurs at. | [
"The",
"SourceLocation",
"this",
"Token",
"occurs",
"at",
"."
] | def location(self):
"""The SourceLocation this Token occurs at."""
return conf.lib.clang_getTokenLocation(self._tu, self) | [
"def",
"location",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTokenLocation",
"(",
"self",
".",
"_tu",
",",
"self",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L2681-L2683 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/chrome/flags.py | python | Flags.__str__ | (self) | return ' '.join(str(self[k]) for k in self) | Serialize the set of flags. | Serialize the set of flags. | [
"Serialize",
"the",
"set",
"of",
"flags",
"."
] | def __str__(self):
'''
Serialize the set of flags.
'''
return ' '.join(str(self[k]) for k in self) | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"' '",
".",
"join",
"(",
"str",
"(",
"self",
"[",
"k",
"]",
")",
"for",
"k",
"in",
"self",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/chrome/flags.py#L236-L240 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/random_ops.py | python | random_uniform | (shape,
minval=0,
maxval=None,
dtype=dtypes.float32,
seed=None,
name=None) | Outputs random values from a uniform distribution.
The generated values follow a uniform distribution in the range
`[minval, maxval)`. The lower bound `minval` is included in the range, while
the upper bound `maxval` is excluded.
For floats, the default range is `[0, 1)`. For ints, at least `maxval` must
b... | Outputs random values from a uniform distribution. | [
"Outputs",
"random",
"values",
"from",
"a",
"uniform",
"distribution",
"."
] | def random_uniform(shape,
minval=0,
maxval=None,
dtype=dtypes.float32,
seed=None,
name=None):
"""Outputs random values from a uniform distribution.
The generated values follow a uniform distribution in the range
`[minv... | [
"def",
"random_uniform",
"(",
"shape",
",",
"minval",
"=",
"0",
",",
"maxval",
"=",
"None",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"seed",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"dtype",
"=",
"dtypes",
".",
"as_dtype",
"(",
"dt... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/random_ops.py#L188-L250 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | SystemSettings.SetScreenType | (*args, **kwargs) | return _misc_.SystemSettings_SetScreenType(*args, **kwargs) | SetScreenType(int screen) | SetScreenType(int screen) | [
"SetScreenType",
"(",
"int",
"screen",
")"
] | def SetScreenType(*args, **kwargs):
"""SetScreenType(int screen)"""
return _misc_.SystemSettings_SetScreenType(*args, **kwargs) | [
"def",
"SetScreenType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"SystemSettings_SetScreenType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L183-L185 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/probability/distributions/utils.py | python | erfinv | () | return compute | Unified erfinv interface for both scalar and tensor | Unified erfinv interface for both scalar and tensor | [
"Unified",
"erfinv",
"interface",
"for",
"both",
"scalar",
"and",
"tensor"
] | def erfinv():
"""Unified erfinv interface for both scalar and tensor
"""
def compute(value):
if isinstance(value, Number):
if sc is not None:
return sc.erfinv(value)
else:
raise ValueError('Numbers are not supported as input if scipy is not ins... | [
"def",
"erfinv",
"(",
")",
":",
"def",
"compute",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"Number",
")",
":",
"if",
"sc",
"is",
"not",
"None",
":",
"return",
"sc",
".",
"erfinv",
"(",
"value",
")",
"else",
":",
"raise",
"Va... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/probability/distributions/utils.py#L89-L99 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/common.py | python | InvertRelativePath | (path, toplevel_dir=None) | return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) | Given a path like foo/bar that is relative to toplevel_dir, return
the inverse relative path back to the toplevel_dir.
E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))
should always produce the empty string, unless the path contains symlinks. | Given a path like foo/bar that is relative to toplevel_dir, return
the inverse relative path back to the toplevel_dir. | [
"Given",
"a",
"path",
"like",
"foo",
"/",
"bar",
"that",
"is",
"relative",
"to",
"toplevel_dir",
"return",
"the",
"inverse",
"relative",
"path",
"back",
"to",
"the",
"toplevel_dir",
"."
] | def InvertRelativePath(path, toplevel_dir=None):
"""Given a path like foo/bar that is relative to toplevel_dir, return
the inverse relative path back to the toplevel_dir.
E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))
should always produce the empty string, unless the path contains symlink... | [
"def",
"InvertRelativePath",
"(",
"path",
",",
"toplevel_dir",
"=",
"None",
")",
":",
"if",
"not",
"path",
":",
"return",
"path",
"toplevel_dir",
"=",
"'.'",
"if",
"toplevel_dir",
"is",
"None",
"else",
"toplevel_dir",
"return",
"RelativePath",
"(",
"toplevel_d... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/common.py#L171-L181 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py | python | quote_plus | (s, safe='') | return quote(s, safe) | Quote the query fragment of a URL; replacing ' ' with '+ | Quote the query fragment of a URL; replacing ' ' with '+ | [
"Quote",
"the",
"query",
"fragment",
"of",
"a",
"URL",
";",
"replacing",
"with",
"+"
] | def quote_plus(s, safe=''):
"""Quote the query fragment of a URL; replacing ' ' with '+'"""
if ' ' in s:
s = quote(s, safe + ' ')
return s.replace(' ', '+')
return quote(s, safe) | [
"def",
"quote_plus",
"(",
"s",
",",
"safe",
"=",
"''",
")",
":",
"if",
"' '",
"in",
"s",
":",
"s",
"=",
"quote",
"(",
"s",
",",
"safe",
"+",
"' '",
")",
"return",
"s",
".",
"replace",
"(",
"' '",
",",
"'+'",
")",
"return",
"quote",
"(",
"s",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py#L1284-L1289 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/distributions/python/ops/shape.py | python | _DistributionShape.get_shape | (self, x, name="get_shape") | Returns `Tensor`'s shape partitioned into `sample`, `batch`, `event`.
Args:
x: `Tensor`.
name: Python `str`. The name to give this op.
Returns:
sample_shape: `Tensor` (1D, `int32`).
batch_shape: `Tensor` (1D, `int32`).
event_shape: `Tensor` (1D, `int32`). | Returns `Tensor`'s shape partitioned into `sample`, `batch`, `event`. | [
"Returns",
"Tensor",
"s",
"shape",
"partitioned",
"into",
"sample",
"batch",
"event",
"."
] | def get_shape(self, x, name="get_shape"):
"""Returns `Tensor`'s shape partitioned into `sample`, `batch`, `event`.
Args:
x: `Tensor`.
name: Python `str`. The name to give this op.
Returns:
sample_shape: `Tensor` (1D, `int32`).
batch_shape: `Tensor` (1D, `int32`).
event_shape:... | [
"def",
"get_shape",
"(",
"self",
",",
"x",
",",
"name",
"=",
"\"get_shape\"",
")",
":",
"with",
"self",
".",
"_name_scope",
"(",
"name",
",",
"values",
"=",
"[",
"x",
"]",
")",
":",
"x",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"x",
",",
"name",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/shape.py#L325-L357 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/filters.py | python | do_urlize | (eval_ctx, value, trim_url_limit=None, nofollow=False,
target=None, rel=None) | return rv | Converts URLs in plain text into clickable links.
If you pass the filter an additional integer it will shorten the urls
to that number. Also a third argument exists that makes the urls
"nofollow":
.. sourcecode:: jinja
{{ mytext|urlize(40, true) }}
links are shortened to 40 chars ... | Converts URLs in plain text into clickable links. | [
"Converts",
"URLs",
"in",
"plain",
"text",
"into",
"clickable",
"links",
"."
] | def do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False,
target=None, rel=None):
"""Converts URLs in plain text into clickable links.
If you pass the filter an additional integer it will shorten the urls
to that number. Also a third argument exists that makes the urls
"nofollow... | [
"def",
"do_urlize",
"(",
"eval_ctx",
",",
"value",
",",
"trim_url_limit",
"=",
"None",
",",
"nofollow",
"=",
"False",
",",
"target",
"=",
"None",
",",
"rel",
"=",
"None",
")",
":",
"policies",
"=",
"eval_ctx",
".",
"environment",
".",
"policies",
"rel",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/filters.py#L499-L533 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/calltip.py | python | get_entity | (expression) | Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__. | Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__. | [
"Return",
"the",
"object",
"corresponding",
"to",
"expression",
"evaluated",
"in",
"a",
"namespace",
"spanning",
"sys",
".",
"modules",
"and",
"__main",
".",
"dict__",
"."
] | def get_entity(expression):
"""Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__.
"""
if expression:
namespace = {**sys.modules, **__main__.__dict__}
try:
return eval(expression, namespace) # Only protect user code.... | [
"def",
"get_entity",
"(",
"expression",
")",
":",
"if",
"expression",
":",
"namespace",
"=",
"{",
"*",
"*",
"sys",
".",
"modules",
",",
"*",
"*",
"__main__",
".",
"__dict__",
"}",
"try",
":",
"return",
"eval",
"(",
"expression",
",",
"namespace",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/calltip.py#L101-L112 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/tasks.py | python | Task.__init__ | (self, transfer_coordinator, main_kwargs=None,
pending_main_kwargs=None, done_callbacks=None,
is_final=False) | :type transfer_coordinator: s3transfer.futures.TransferCoordinator
:param transfer_coordinator: The context associated to the
TransferFuture for which this Task is associated with.
:type main_kwargs: dict
:param main_kwargs: The keyword args that can be immediately supplied
... | :type transfer_coordinator: s3transfer.futures.TransferCoordinator
:param transfer_coordinator: The context associated to the
TransferFuture for which this Task is associated with. | [
":",
"type",
"transfer_coordinator",
":",
"s3transfer",
".",
"futures",
".",
"TransferCoordinator",
":",
"param",
"transfer_coordinator",
":",
"The",
"context",
"associated",
"to",
"the",
"TransferFuture",
"for",
"which",
"this",
"Task",
"is",
"associated",
"with",
... | def __init__(self, transfer_coordinator, main_kwargs=None,
pending_main_kwargs=None, done_callbacks=None,
is_final=False):
"""
:type transfer_coordinator: s3transfer.futures.TransferCoordinator
:param transfer_coordinator: The context associated to the
... | [
"def",
"__init__",
"(",
"self",
",",
"transfer_coordinator",
",",
"main_kwargs",
"=",
"None",
",",
"pending_main_kwargs",
"=",
"None",
",",
"done_callbacks",
"=",
"None",
",",
"is_final",
"=",
"False",
")",
":",
"self",
".",
"_transfer_coordinator",
"=",
"tran... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/tasks.py#L28-L77 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiPaneInfo.IsDestroyOnClose | (*args, **kwargs) | return _aui.AuiPaneInfo_IsDestroyOnClose(*args, **kwargs) | IsDestroyOnClose(self) -> bool | IsDestroyOnClose(self) -> bool | [
"IsDestroyOnClose",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsDestroyOnClose(*args, **kwargs):
"""IsDestroyOnClose(self) -> bool"""
return _aui.AuiPaneInfo_IsDestroyOnClose(*args, **kwargs) | [
"def",
"IsDestroyOnClose",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_IsDestroyOnClose",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L293-L295 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/examples/rss/rss_visualization.py | python | RssUnstructuredSceneVisualizer._world_to_sensor | (cords, camera_transform) | return sensor_cords | Transforms world coordinates to sensor. | Transforms world coordinates to sensor. | [
"Transforms",
"world",
"coordinates",
"to",
"sensor",
"."
] | def _world_to_sensor(cords, camera_transform):
"""
Transforms world coordinates to sensor.
"""
sensor_world_matrix = get_matrix(camera_transform)
world_sensor_matrix = np.linalg.inv(sensor_world_matrix)
sensor_cords = np.dot(world_sensor_matrix, cords)
return sens... | [
"def",
"_world_to_sensor",
"(",
"cords",
",",
"camera_transform",
")",
":",
"sensor_world_matrix",
"=",
"get_matrix",
"(",
"camera_transform",
")",
"world_sensor_matrix",
"=",
"np",
".",
"linalg",
".",
"inv",
"(",
"sensor_world_matrix",
")",
"sensor_cords",
"=",
"... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/rss/rss_visualization.py#L414-L421 | |
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_AuxCommand.py | python | AuxCommand.__init__ | (self, *args, **kwds) | Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
current_yaw,kf... | Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments. | [
"Constructor",
".",
"Any",
"message",
"fields",
"that",
"are",
"implicitly",
"/",
"explicitly",
"set",
"to",
"None",
"will",
"be",
"assigned",
"a",
"default",
"value",
".",
"The",
"recommend",
"use",
"is",
"keyword",
"arguments",
"as",
"this",
"is",
"more",
... | def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"args",
"or",
"kwds",
":",
"super",
"(",
"AuxCommand",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
"#message fields cannot... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_AuxCommand.py#L22-L54 | ||
GXYM/DRRG | 9e074fa9052de8d131f55ca1f6ae6673c1bfeca4 | dataset/icdar15/Evaluation_Protocol/rrc_evaluation_funcs.py | python | decode_utf8 | (raw) | Returns a Unicode object on success, or None on failure | Returns a Unicode object on success, or None on failure | [
"Returns",
"a",
"Unicode",
"object",
"on",
"success",
"or",
"None",
"on",
"failure"
] | def decode_utf8(raw):
"""
Returns a Unicode object on success, or None on failure
"""
try:
raw = codecs.decode(raw,'utf-8', 'replace')
#extracts BOM if exists
raw = raw.encode('utf8')
if raw.startswith(codecs.BOM_UTF8):
raw = raw.replace(codecs.BOM_UTF8, '', 1... | [
"def",
"decode_utf8",
"(",
"raw",
")",
":",
"try",
":",
"raw",
"=",
"codecs",
".",
"decode",
"(",
"raw",
",",
"'utf-8'",
",",
"'replace'",
")",
"#extracts BOM if exists",
"raw",
"=",
"raw",
".",
"encode",
"(",
"'utf8'",
")",
"if",
"raw",
".",
"startswi... | https://github.com/GXYM/DRRG/blob/9e074fa9052de8d131f55ca1f6ae6673c1bfeca4/dataset/icdar15/Evaluation_Protocol/rrc_evaluation_funcs.py#L77-L89 | ||
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.kind | (self) | return CursorKind.from_id(self._kind_id) | Return the kind of this cursor. | Return the kind of this cursor. | [
"Return",
"the",
"kind",
"of",
"this",
"cursor",
"."
] | def kind(self):
"""Return the kind of this cursor."""
return CursorKind.from_id(self._kind_id) | [
"def",
"kind",
"(",
"self",
")",
":",
"return",
"CursorKind",
".",
"from_id",
"(",
"self",
".",
"_kind_id",
")"
] | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1098-L1100 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/selectors.py | python | _BaseSelectorImpl._fileobj_lookup | (self, fileobj) | Return a file descriptor from a file object.
This wraps _fileobj_to_fd() to do an exhaustive search in case
the object is invalid but we still have it in our map. This
is used by unregister() so we can unregister an object that
was previously registered even if it is closed. It is als... | Return a file descriptor from a file object. | [
"Return",
"a",
"file",
"descriptor",
"from",
"a",
"file",
"object",
"."
] | def _fileobj_lookup(self, fileobj):
"""Return a file descriptor from a file object.
This wraps _fileobj_to_fd() to do an exhaustive search in case
the object is invalid but we still have it in our map. This
is used by unregister() so we can unregister an object that
was previou... | [
"def",
"_fileobj_lookup",
"(",
"self",
",",
"fileobj",
")",
":",
"try",
":",
"return",
"_fileobj_to_fd",
"(",
"fileobj",
")",
"except",
"ValueError",
":",
"# Do an exhaustive search.",
"for",
"key",
"in",
"self",
".",
"_fd_to_key",
".",
"values",
"(",
")",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/selectors.py#L215-L232 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | ZerosLikeOutsideLoop | (op, index) | Create zeros_like for the specified output of an op. | Create zeros_like for the specified output of an op. | [
"Create",
"zeros_like",
"for",
"the",
"specified",
"output",
"of",
"an",
"op",
"."
] | def ZerosLikeOutsideLoop(op, index):
"""Create zeros_like for the specified output of an op."""
val = op.outputs[index]
if not IsSwitch(op):
return array_ops.zeros_like(val)
else:
op_ctxt = op._get_control_flow_context()
pred = op_ctxt.pred
branch = op_ctxt.branch
switch_val = switch(op.inpu... | [
"def",
"ZerosLikeOutsideLoop",
"(",
"op",
",",
"index",
")",
":",
"val",
"=",
"op",
".",
"outputs",
"[",
"index",
"]",
"if",
"not",
"IsSwitch",
"(",
"op",
")",
":",
"return",
"array_ops",
".",
"zeros_like",
"(",
"val",
")",
"else",
":",
"op_ctxt",
"=... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1053-L1064 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | scripts/authors.py | python | update_count | (c, lang, counts) | Add the counts from to the total count
Input:
c[dict]: Local counts with authors as keys, returned from 'target' function
lang[str]: The language key that the 'c' count dict is associated
counts[dict of dict]: The global count by author, then language | Add the counts from to the total count | [
"Add",
"the",
"counts",
"from",
"to",
"the",
"total",
"count"
] | def update_count(c, lang, counts):
"""
Add the counts from to the total count
Input:
c[dict]: Local counts with authors as keys, returned from 'target' function
lang[str]: The language key that the 'c' count dict is associated
counts[dict of dict]: The global count by author, then lang... | [
"def",
"update_count",
"(",
"c",
",",
"lang",
",",
"counts",
")",
":",
"for",
"key",
",",
"value",
"in",
"c",
".",
"items",
"(",
")",
":",
"counts",
"[",
"key",
"]",
"[",
"lang",
"]",
"+=",
"value"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/scripts/authors.py#L46-L56 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBData.SetDataFromUInt64Array | (self, *args) | return _lldb.SBData_SetDataFromUInt64Array(self, *args) | SetDataFromUInt64Array(self, uint64_t array) -> bool | SetDataFromUInt64Array(self, uint64_t array) -> bool | [
"SetDataFromUInt64Array",
"(",
"self",
"uint64_t",
"array",
")",
"-",
">",
"bool"
] | def SetDataFromUInt64Array(self, *args):
"""SetDataFromUInt64Array(self, uint64_t array) -> bool"""
return _lldb.SBData_SetDataFromUInt64Array(self, *args) | [
"def",
"SetDataFromUInt64Array",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBData_SetDataFromUInt64Array",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L2800-L2802 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.