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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py | python | scan_in_memory | (node, env, path=()) | return [entries[n] for n in entry_list] | "Scans" a Node.FS.Dir for its in-memory entries. | "Scans" a Node.FS.Dir for its in-memory entries. | [
"Scans",
"a",
"Node",
".",
"FS",
".",
"Dir",
"for",
"its",
"in",
"-",
"memory",
"entries",
"."
] | def scan_in_memory(node, env, path=()):
"""
"Scans" a Node.FS.Dir for its in-memory entries.
"""
try:
entries = node.entries
except AttributeError:
# It's not a Node.FS.Dir (or doesn't look enough like one for
# our purposes), which can happen if a target list containing
... | [
"def",
"scan_in_memory",
"(",
"node",
",",
"env",
",",
"path",
"=",
"(",
")",
")",
":",
"try",
":",
"entries",
"=",
"node",
".",
"entries",
"except",
"AttributeError",
":",
"# It's not a Node.FS.Dir (or doesn't look enough like one for",
"# our purposes), which can ha... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py#L90-L103 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/PartDesign/WizardShaft/SegmentFunction.py | python | SegmentFunction.findSegment | (self, xval) | return self.segments[len(self.segments)] | Find segment valid for the given xval | Find segment valid for the given xval | [
"Find",
"segment",
"valid",
"for",
"the",
"given",
"xval"
] | def findSegment(self, xval):
"Find segment valid for the given xval"
for s in self.segments:
if s.start <= xval:
return s
return self.segments[len(self.segments)] | [
"def",
"findSegment",
"(",
"self",
",",
"xval",
")",
":",
"for",
"s",
"in",
"self",
".",
"segments",
":",
"if",
"s",
".",
"start",
"<=",
"xval",
":",
"return",
"s",
"return",
"self",
".",
"segments",
"[",
"len",
"(",
"self",
".",
"segments",
")",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/PartDesign/WizardShaft/SegmentFunction.py#L80-L85 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | examples/python/appointments.py | python | AllSolutionCollector.combinations | (self) | return self.__collect | Returns all collected combinations. | Returns all collected combinations. | [
"Returns",
"all",
"collected",
"combinations",
"."
] | def combinations(self):
"""Returns all collected combinations."""
return self.__collect | [
"def",
"combinations",
"(",
"self",
")",
":",
"return",
"self",
".",
"__collect"
] | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/appointments.py#L49-L51 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/stats_history.py | python | StatsHistory.root_symbol | (self, root_symbol) | Sets the root_symbol of this StatsHistory.
:param root_symbol: The root_symbol of this StatsHistory. # noqa: E501
:type: str | Sets the root_symbol of this StatsHistory. | [
"Sets",
"the",
"root_symbol",
"of",
"this",
"StatsHistory",
"."
] | def root_symbol(self, root_symbol):
"""Sets the root_symbol of this StatsHistory.
:param root_symbol: The root_symbol of this StatsHistory. # noqa: E501
:type: str
"""
if root_symbol is None:
raise ValueError("Invalid value for `root_symbol`, must not be `None`") ... | [
"def",
"root_symbol",
"(",
"self",
",",
"root_symbol",
")",
":",
"if",
"root_symbol",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `root_symbol`, must not be `None`\"",
")",
"# noqa: E501",
"self",
".",
"_root_symbol",
"=",
"root_symbol"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/stats_history.py#L102-L112 | ||
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/docs/tools/dump_ast_matchers.py | python | extract_result_types | (comment) | Extracts a list of result types from the given comment.
We allow annotations in the comment of the matcher to specify what
nodes a matcher can match on. Those comments have the form:
Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
Returns ['*'] in case of 'Any Matcher', or ['T1', 'T... | Extracts a list of result types from the given comment. | [
"Extracts",
"a",
"list",
"of",
"result",
"types",
"from",
"the",
"given",
"comment",
"."
] | def extract_result_types(comment):
"""Extracts a list of result types from the given comment.
We allow annotations in the comment of the matcher to specify what
nodes a matcher can match on. Those comments have the form:
Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
Returns ['*'... | [
"def",
"extract_result_types",
"(",
"comment",
")",
":",
"result_types",
"=",
"[",
"]",
"m",
"=",
"re",
".",
"search",
"(",
"r'Usable as: Any Matcher[\\s\\n]*$'",
",",
"comment",
",",
"re",
".",
"S",
")",
"if",
"m",
":",
"return",
"[",
"'*'",
"]",
"while... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/docs/tools/dump_ast_matchers.py#L60-L83 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | RobotModel.numDrivers | (self) | return _robotsim.RobotModel_numDrivers(self) | numDrivers(RobotModel self) -> int
Returns the number of drivers. | numDrivers(RobotModel self) -> int | [
"numDrivers",
"(",
"RobotModel",
"self",
")",
"-",
">",
"int"
] | def numDrivers(self):
"""
numDrivers(RobotModel self) -> int
Returns the number of drivers.
"""
return _robotsim.RobotModel_numDrivers(self) | [
"def",
"numDrivers",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RobotModel_numDrivers",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L4591-L4600 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/nntplib.py | python | NNTP.quit | (self) | return resp | Process a QUIT command and close the socket. Returns:
- resp: server response if successful | Process a QUIT command and close the socket. Returns:
- resp: server response if successful | [
"Process",
"a",
"QUIT",
"command",
"and",
"close",
"the",
"socket",
".",
"Returns",
":",
"-",
"resp",
":",
"server",
"response",
"if",
"successful"
] | def quit(self):
"""Process a QUIT command and close the socket. Returns:
- resp: server response if successful"""
resp = self.shortcmd('QUIT')
self.file.close()
self.sock.close()
del self.file, self.sock
return resp | [
"def",
"quit",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"shortcmd",
"(",
"'QUIT'",
")",
"self",
".",
"file",
".",
"close",
"(",
")",
"self",
".",
"sock",
".",
"close",
"(",
")",
"del",
"self",
".",
"file",
",",
"self",
".",
"sock",
"ret... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/nntplib.py#L595-L603 | |
tkn-tub/ns3-gym | 19bfe0a583e641142609939a090a09dfc63a095f | src/visualizer/visualizer/plugins/ipv4_routing_table.py | python | ShowIpv4RoutingTable.__init__ | (self, visualizer, node_index) | Initializer
@param self this object
@param visualizer visualizer object
@param node_index the node index
@return the statistics | Initializer | [
"Initializer"
] | def __init__(self, visualizer, node_index):
"""
Initializer
@param self this object
@param visualizer visualizer object
@param node_index the node index
@return the statistics
"""
InformationWindow.__init__(self)
self.win = Gtk.Dialog(parent=visual... | [
"def",
"__init__",
"(",
"self",
",",
"visualizer",
",",
"node_index",
")",
":",
"InformationWindow",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"win",
"=",
"Gtk",
".",
"Dialog",
"(",
"parent",
"=",
"visualizer",
".",
"window",
",",
"flags",
"=",
"... | https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/src/visualizer/visualizer/plugins/ipv4_routing_table.py#L27-L82 | ||
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | src/python/cli_new/lib/cli/util.py | python | Table.__init__ | (self, columns) | Initialize a table with a list of column names
to act as headers for each column in the table. | Initialize a table with a list of column names
to act as headers for each column in the table. | [
"Initialize",
"a",
"table",
"with",
"a",
"list",
"of",
"column",
"names",
"to",
"act",
"as",
"headers",
"for",
"each",
"column",
"in",
"the",
"table",
"."
] | def __init__(self, columns):
"""
Initialize a table with a list of column names
to act as headers for each column in the table.
"""
if not isinstance(columns, list):
raise CLIException("Column headers must be supplied as a list")
for column in columns:
... | [
"def",
"__init__",
"(",
"self",
",",
"columns",
")",
":",
"if",
"not",
"isinstance",
"(",
"columns",
",",
"list",
")",
":",
"raise",
"CLIException",
"(",
"\"Column headers must be supplied as a list\"",
")",
"for",
"column",
"in",
"columns",
":",
"if",
"re",
... | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/src/python/cli_new/lib/cli/util.py#L307-L321 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/BufferViewer.py | python | BufferViewer.advanceCard | (self) | Only useful when using setLayout('cycle'). Increments the index
that selects which card to display. The index is taken modulo
the actual number of cards. | Only useful when using setLayout('cycle'). Increments the index
that selects which card to display. The index is taken modulo
the actual number of cards. | [
"Only",
"useful",
"when",
"using",
"setLayout",
"(",
"cycle",
")",
".",
"Increments",
"the",
"index",
"that",
"selects",
"which",
"card",
"to",
"display",
".",
"The",
"index",
"is",
"taken",
"modulo",
"the",
"actual",
"number",
"of",
"cards",
"."
] | def advanceCard(self):
"""Only useful when using setLayout('cycle'). Increments the index
that selects which card to display. The index is taken modulo
the actual number of cards."""
self.cardindex += 1
self.dirty = 1 | [
"def",
"advanceCard",
"(",
"self",
")",
":",
"self",
".",
"cardindex",
"+=",
"1",
"self",
".",
"dirty",
"=",
"1"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/BufferViewer.py#L158-L163 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/generator.py | python | RtfColorTbl.GetColorIndex | (self, si_color) | Gets the index of a particular style items color
definition from the color table. Returns -1 if item is
not found.
@param si_color: style item color to find index in table for
@return: the colors index in the table | Gets the index of a particular style items color
definition from the color table. Returns -1 if item is
not found.
@param si_color: style item color to find index in table for
@return: the colors index in the table | [
"Gets",
"the",
"index",
"of",
"a",
"particular",
"style",
"items",
"color",
"definition",
"from",
"the",
"color",
"table",
".",
"Returns",
"-",
"1",
"if",
"item",
"is",
"not",
"found",
".",
"@param",
"si_color",
":",
"style",
"item",
"color",
"to",
"find... | def GetColorIndex(self, si_color):
"""Gets the index of a particular style items color
definition from the color table. Returns -1 if item is
not found.
@param si_color: style item color to find index in table for
@return: the colors index in the table
"""
if si_... | [
"def",
"GetColorIndex",
"(",
"self",
",",
"si_color",
")",
":",
"if",
"si_color",
"in",
"self",
".",
"_index",
":",
"return",
"self",
".",
"_index",
".",
"index",
"(",
"si_color",
")",
"else",
":",
"return",
"-",
"1"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/generator.py#L928-L939 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItem.OnSetFocus | (self, event) | Handles the ``wx.EVT_SET_FOCUS`` event for the window associated to an item.
:param `event`: a :class:`FocusEvent` event to be processed. | Handles the ``wx.EVT_SET_FOCUS`` event for the window associated to an item. | [
"Handles",
"the",
"wx",
".",
"EVT_SET_FOCUS",
"event",
"for",
"the",
"window",
"associated",
"to",
"an",
"item",
"."
] | def OnSetFocus(self, event):
"""
Handles the ``wx.EVT_SET_FOCUS`` event for the window associated to an item.
:param `event`: a :class:`FocusEvent` event to be processed.
"""
listCtrl = self._wnd.GetParent()
select = listCtrl.GetItemState(self._itemId, ULC_STATE_SELECTE... | [
"def",
"OnSetFocus",
"(",
"self",
",",
"event",
")",
":",
"listCtrl",
"=",
"self",
".",
"_wnd",
".",
"GetParent",
"(",
")",
"select",
"=",
"listCtrl",
".",
"GetItemState",
"(",
"self",
".",
"_itemId",
",",
"ULC_STATE_SELECTED",
")",
"# If the window is assoc... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L2248-L2267 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/content_classification_lens.py | python | ContentClassificationLens.__init__ | (self, trace, ad_rules, tracking_rules) | Initializes an instance of ContentClassificationLens.
Args:
trace: (LoadingTrace) loading trace.
ad_rules: ([str]) List of Adblock+ compatible rules used to classify ads.
tracking_rules: ([str]) List of Adblock+ compatible rules used to
classify tracking and analytics. | Initializes an instance of ContentClassificationLens. | [
"Initializes",
"an",
"instance",
"of",
"ContentClassificationLens",
"."
] | def __init__(self, trace, ad_rules, tracking_rules):
"""Initializes an instance of ContentClassificationLens.
Args:
trace: (LoadingTrace) loading trace.
ad_rules: ([str]) List of Adblock+ compatible rules used to classify ads.
tracking_rules: ([str]) List of Adblock+ compatible rules used to
... | [
"def",
"__init__",
"(",
"self",
",",
"trace",
",",
"ad_rules",
",",
"tracking_rules",
")",
":",
"self",
".",
"_trace",
"=",
"trace",
"self",
".",
"_requests",
"=",
"trace",
".",
"request_track",
".",
"GetEvents",
"(",
")",
"self",
".",
"_requests_by_id",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/content_classification_lens.py#L19-L39 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/generate_stubs/generate_stubs.py | python | ParseSignatures | (infile) | return signatures | Parses function signatures in the input file.
This function parses a file of signatures into a list of dictionaries that
represent the function signatures in the input file. Each dictionary has
the following keys:
return_type: A string with the return type.
name: A string with the name of the function.
... | Parses function signatures in the input file. | [
"Parses",
"function",
"signatures",
"in",
"the",
"input",
"file",
"."
] | def ParseSignatures(infile):
"""Parses function signatures in the input file.
This function parses a file of signatures into a list of dictionaries that
represent the function signatures in the input file. Each dictionary has
the following keys:
return_type: A string with the return type.
name: A stri... | [
"def",
"ParseSignatures",
"(",
"infile",
")",
":",
"signatures",
"=",
"[",
"]",
"for",
"line",
"in",
"infile",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
"and",
"line",
"[",
"0",
"]",
"!=",
"'#'",
":",
"m",
"=",
"SIGNATURE_REGE... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/generate_stubs/generate_stubs.py#L378-L419 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MouseState.SetLeftDown | (*args, **kwargs) | return _core_.MouseState_SetLeftDown(*args, **kwargs) | SetLeftDown(self, bool down) | SetLeftDown(self, bool down) | [
"SetLeftDown",
"(",
"self",
"bool",
"down",
")"
] | def SetLeftDown(*args, **kwargs):
"""SetLeftDown(self, bool down)"""
return _core_.MouseState_SetLeftDown(*args, **kwargs) | [
"def",
"SetLeftDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseState_SetLeftDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L4494-L4496 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | demo/Grid_MegaExample.py | python | MegaTable.DeleteCols | (self, cols) | cols -> delete the columns from the dataset
cols hold the column indices | cols -> delete the columns from the dataset
cols hold the column indices | [
"cols",
"-",
">",
"delete",
"the",
"columns",
"from",
"the",
"dataset",
"cols",
"hold",
"the",
"column",
"indices"
] | def DeleteCols(self, cols):
"""
cols -> delete the columns from the dataset
cols hold the column indices
"""
# we'll cheat here and just remove the name from the
# list of column names. The data will remain but
# it won't be shown
deleteCount = 0
... | [
"def",
"DeleteCols",
"(",
"self",
",",
"cols",
")",
":",
"# we'll cheat here and just remove the name from the",
"# list of column names. The data will remain but",
"# it won't be shown",
"deleteCount",
"=",
"0",
"cols",
"=",
"cols",
"[",
":",
"]",
"cols",
".",
"sort",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/demo/Grid_MegaExample.py#L130-L149 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py | python | _mboxMMDF.get_file | (self, key, from_=False) | return _PartialFile(self._file, self._file.tell(), stop) | Return a file-like representation or raise a KeyError. | Return a file-like representation or raise a KeyError. | [
"Return",
"a",
"file",
"-",
"like",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_file(self, key, from_=False):
"""Return a file-like representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
if not from_:
self._file.readline()
return _PartialFile(self._file, self._file.tell(), stop) | [
"def",
"get_file",
"(",
"self",
",",
"key",
",",
"from_",
"=",
"False",
")",
":",
"start",
",",
"stop",
"=",
"self",
".",
"_lookup",
"(",
"key",
")",
"self",
".",
"_file",
".",
"seek",
"(",
"start",
")",
"if",
"not",
"from_",
":",
"self",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L778-L784 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | DC._DrawLineList | (*args, **kwargs) | return _gdi_.DC__DrawLineList(*args, **kwargs) | _DrawLineList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject | _DrawLineList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject | [
"_DrawLineList",
"(",
"self",
"PyObject",
"pyCoords",
"PyObject",
"pyPens",
"PyObject",
"pyBrushes",
")",
"-",
">",
"PyObject"
] | def _DrawLineList(*args, **kwargs):
"""_DrawLineList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
return _gdi_.DC__DrawLineList(*args, **kwargs) | [
"def",
"_DrawLineList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC__DrawLineList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L4741-L4743 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.srp_client_enable_service_key | (self) | Enable SRP client "service key record inclusion" mode. | Enable SRP client "service key record inclusion" mode. | [
"Enable",
"SRP",
"client",
"service",
"key",
"record",
"inclusion",
"mode",
"."
] | def srp_client_enable_service_key(self):
"""Enable SRP client "service key record inclusion" mode."""
self.execute_command('srp client service key enable') | [
"def",
"srp_client_enable_service_key",
"(",
"self",
")",
":",
"self",
".",
"execute_command",
"(",
"'srp client service key enable'",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L1169-L1171 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Sizer.ShowItems | (*args, **kwargs) | return _core_.Sizer_ShowItems(*args, **kwargs) | ShowItems(self, bool show)
Recursively call `wx.SizerItem.Show` on all sizer items. | ShowItems(self, bool show) | [
"ShowItems",
"(",
"self",
"bool",
"show",
")"
] | def ShowItems(*args, **kwargs):
"""
ShowItems(self, bool show)
Recursively call `wx.SizerItem.Show` on all sizer items.
"""
return _core_.Sizer_ShowItems(*args, **kwargs) | [
"def",
"ShowItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_ShowItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14995-L15001 | |
sc0ty/subsync | be5390d00ff475b6543eb0140c7e65b34317d95b | subsync/assets/__init__.py | python | getAsset | (assetId, params=None) | return assetManager().getAsset(assetId, params) | Get asset, alias to `assetManager().getAsset`. | Get asset, alias to `assetManager().getAsset`. | [
"Get",
"asset",
"alias",
"to",
"assetManager",
"()",
".",
"getAsset",
"."
] | def getAsset(assetId, params=None):
"""Get asset, alias to `assetManager().getAsset`."""
return assetManager().getAsset(assetId, params) | [
"def",
"getAsset",
"(",
"assetId",
",",
"params",
"=",
"None",
")",
":",
"return",
"assetManager",
"(",
")",
".",
"getAsset",
"(",
"assetId",
",",
"params",
")"
] | https://github.com/sc0ty/subsync/blob/be5390d00ff475b6543eb0140c7e65b34317d95b/subsync/assets/__init__.py#L13-L15 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/xlsgrid.py | python | XLSText.CombineAttr | (self, attr) | Combines the input attribute `attr` with the features of the :class:`XLSText` class.
:param `attr`: an instance of :class:`grid.GridCellAttr`. | Combines the input attribute `attr` with the features of the :class:`XLSText` class. | [
"Combines",
"the",
"input",
"attribute",
"attr",
"with",
"the",
"features",
"of",
"the",
":",
"class",
":",
"XLSText",
"class",
"."
] | def CombineAttr(self, attr):
"""
Combines the input attribute `attr` with the features of the :class:`XLSText` class.
:param `attr`: an instance of :class:`grid.GridCellAttr`.
"""
attr.SetAlignment(self.horizontal_alignment, self.vertical_alignment)
attr.SetTextColour(s... | [
"def",
"CombineAttr",
"(",
"self",
",",
"attr",
")",
":",
"attr",
".",
"SetAlignment",
"(",
"self",
".",
"horizontal_alignment",
",",
"self",
".",
"vertical_alignment",
")",
"attr",
".",
"SetTextColour",
"(",
"self",
".",
"text_colour",
")",
"attr",
".",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/xlsgrid.py#L882-L891 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/hmac.py | python | HMAC.digest | (self) | return h.digest() | Return the hash value of this hashing object.
This returns a string containing 8-bit data. The object is
not altered in any way by this function; you can continue
updating the object after calling this function. | Return the hash value of this hashing object. | [
"Return",
"the",
"hash",
"value",
"of",
"this",
"hashing",
"object",
"."
] | def digest(self):
"""Return the hash value of this hashing object.
This returns a string containing 8-bit data. The object is
not altered in any way by this function; you can continue
updating the object after calling this function.
"""
h = self._current()
retur... | [
"def",
"digest",
"(",
"self",
")",
":",
"h",
"=",
"self",
".",
"_current",
"(",
")",
"return",
"h",
".",
"digest",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/hmac.py#L126-L134 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.StyleGetItalic | (*args, **kwargs) | return _stc.StyledTextCtrl_StyleGetItalic(*args, **kwargs) | StyleGetItalic(self, int style) -> bool
Get is a style italic or not. | StyleGetItalic(self, int style) -> bool | [
"StyleGetItalic",
"(",
"self",
"int",
"style",
")",
"-",
">",
"bool"
] | def StyleGetItalic(*args, **kwargs):
"""
StyleGetItalic(self, int style) -> bool
Get is a style italic or not.
"""
return _stc.StyledTextCtrl_StyleGetItalic(*args, **kwargs) | [
"def",
"StyleGetItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StyleGetItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2610-L2616 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py | python | TextDoc.docclass | (self, object, name=None, mod=None, *ignored) | return title + '\n' + self.indent(rstrip(contents), ' | ') + '\n' | Produce text documentation for a given class object. | Produce text documentation for a given class object. | [
"Produce",
"text",
"documentation",
"for",
"a",
"given",
"class",
"object",
"."
] | def docclass(self, object, name=None, mod=None, *ignored):
"""Produce text documentation for a given class object."""
realname = object.__name__
name = name or realname
bases = object.__bases__
def makename(c, m=object.__module__):
return classname(c, m)
if ... | [
"def",
"docclass",
"(",
"self",
",",
"object",
",",
"name",
"=",
"None",
",",
"mod",
"=",
"None",
",",
"*",
"ignored",
")",
":",
"realname",
"=",
"object",
".",
"__name__",
"name",
"=",
"name",
"or",
"realname",
"bases",
"=",
"object",
".",
"__bases_... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py#L1119-L1230 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookiejar.py | python | FileCookieJar.save | (self, filename=None, ignore_discard=False, ignore_expires=False) | Save cookies to a file. | Save cookies to a file. | [
"Save",
"cookies",
"to",
"a",
"file",
"."
] | def save(self, filename=None, ignore_discard=False, ignore_expires=False):
"""Save cookies to a file."""
raise NotImplementedError() | [
"def",
"save",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"ignore_discard",
"=",
"False",
",",
"ignore_expires",
"=",
"False",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookiejar.py#L1788-L1790 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | ArtProvider.GetIconBundle | (*args, **kwargs) | return _misc_.ArtProvider_GetIconBundle(*args, **kwargs) | GetIconBundle(wxArtID id, wxArtClient client=wxART_OTHER) -> wxIconBundle
Query the providers for iconbundle with given ID and return it. Return
wx.NullIconBundle if no provider provides it. | GetIconBundle(wxArtID id, wxArtClient client=wxART_OTHER) -> wxIconBundle | [
"GetIconBundle",
"(",
"wxArtID",
"id",
"wxArtClient",
"client",
"=",
"wxART_OTHER",
")",
"-",
">",
"wxIconBundle"
] | def GetIconBundle(*args, **kwargs):
"""
GetIconBundle(wxArtID id, wxArtClient client=wxART_OTHER) -> wxIconBundle
Query the providers for iconbundle with given ID and return it. Return
wx.NullIconBundle if no provider provides it.
"""
return _misc_.ArtProvider_GetIconBun... | [
"def",
"GetIconBundle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ArtProvider_GetIconBundle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L2855-L2862 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | samples/trtexec/prn_utils.py | python | combineDescriptions | (prolog, features, descriptions) | return fullDescription | Combine features with their descriptions | Combine features with their descriptions | [
"Combine",
"features",
"with",
"their",
"descriptions"
] | def combineDescriptions(prolog, features, descriptions):
''' Combine features with their descriptions '''
fullDescription = prolog
sep = ' '
for feature, description in zip(features, descriptions):
fullDescription += sep + feature + ' (' + description + ')'
sep = ', '
return fullDe... | [
"def",
"combineDescriptions",
"(",
"prolog",
",",
"features",
",",
"descriptions",
")",
":",
"fullDescription",
"=",
"prolog",
"sep",
"=",
"' '",
"for",
"feature",
",",
"description",
"in",
"zip",
"(",
"features",
",",
"descriptions",
")",
":",
"fullDescriptio... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/trtexec/prn_utils.py#L29-L38 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py | python | match_file | (filename, exclude) | return True | Return True if file is okay for modifying/recursing. | Return True if file is okay for modifying/recursing. | [
"Return",
"True",
"if",
"file",
"is",
"okay",
"for",
"modifying",
"/",
"recursing",
"."
] | def match_file(filename, exclude):
"""Return True if file is okay for modifying/recursing."""
base_name = os.path.basename(filename)
if base_name.startswith('.'):
return False
for pattern in exclude:
if fnmatch.fnmatch(base_name, pattern):
return False
if not os.path.i... | [
"def",
"match_file",
"(",
"filename",
",",
"exclude",
")",
":",
"base_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"filename",
")",
"if",
"base_name",
".",
"startswith",
"(",
"'.'",
")",
":",
"return",
"False",
"for",
"pattern",
"in",
"exclude",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L3510-L3524 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/summary/event_accumulator.py | python | _GeneratorFromPath | (path) | Create an event generator for file or directory at given path string. | Create an event generator for file or directory at given path string. | [
"Create",
"an",
"event",
"generator",
"for",
"file",
"or",
"directory",
"at",
"given",
"path",
"string",
"."
] | def _GeneratorFromPath(path):
"""Create an event generator for file or directory at given path string."""
if IsTensorFlowEventsFile(path):
return io_wrapper.CreateFileLoader(path)
else:
return directory_watcher.DirectoryWatcher(path, io_wrapper.CreateFileLoader,
... | [
"def",
"_GeneratorFromPath",
"(",
"path",
")",
":",
"if",
"IsTensorFlowEventsFile",
"(",
"path",
")",
":",
"return",
"io_wrapper",
".",
"CreateFileLoader",
"(",
"path",
")",
"else",
":",
"return",
"directory_watcher",
".",
"DirectoryWatcher",
"(",
"path",
",",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/summary/event_accumulator.py#L632-L638 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/user_file/user_file_parser.py | python | FitParser.extract_clear | () | return {FitId.GENERAL: fit_general(start=None, stop=None, fit_type=FitType.NO_FIT,
data_type=None, polynomial_order=None)} | With this we want to clear the fit type settings. | With this we want to clear the fit type settings. | [
"With",
"this",
"we",
"want",
"to",
"clear",
"the",
"fit",
"type",
"settings",
"."
] | def extract_clear():
"""
With this we want to clear the fit type settings.
"""
return {FitId.GENERAL: fit_general(start=None, stop=None, fit_type=FitType.NO_FIT,
data_type=None, polynomial_order=None)} | [
"def",
"extract_clear",
"(",
")",
":",
"return",
"{",
"FitId",
".",
"GENERAL",
":",
"fit_general",
"(",
"start",
"=",
"None",
",",
"stop",
"=",
"None",
",",
"fit_type",
"=",
"FitType",
".",
"NO_FIT",
",",
"data_type",
"=",
"None",
",",
"polynomial_order"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/user_file/user_file_parser.py#L1843-L1848 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/blahp/src/scripts/lsf_status.py | python | bjobs | (jobid="") | return result | Call bjobs directly for a jobid.
If none is specified, query all jobid's.
Returns a python dictionary with the job info. | Call bjobs directly for a jobid.
If none is specified, query all jobid's. | [
"Call",
"bjobs",
"directly",
"for",
"a",
"jobid",
".",
"If",
"none",
"is",
"specified",
"query",
"all",
"jobid",
"s",
"."
] | def bjobs(jobid=""):
"""
Call bjobs directly for a jobid.
If none is specified, query all jobid's.
Returns a python dictionary with the job info.
"""
bjobs = get_bjobs_location()
command = (bjobs, '-V')
bjobs_process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.... | [
"def",
"bjobs",
"(",
"jobid",
"=",
"\"\"",
")",
":",
"bjobs",
"=",
"get_bjobs_location",
"(",
")",
"command",
"=",
"(",
"bjobs",
",",
"'-V'",
")",
"bjobs_process",
"=",
"subprocess",
".",
"Popen",
"(",
"command",
",",
"stdout",
"=",
"subprocess",
".",
... | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/blahp/src/scripts/lsf_status.py#L241-L286 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_take | (node, **kwargs) | return nodes | Map MXNet's Take operator attributes to onnx's Gather operator. | Map MXNet's Take operator attributes to onnx's Gather operator. | [
"Map",
"MXNet",
"s",
"Take",
"operator",
"attributes",
"to",
"onnx",
"s",
"Gather",
"operator",
"."
] | def convert_take(node, **kwargs):
"""Map MXNet's Take operator attributes to onnx's Gather operator.
"""
from onnx.helper import make_node
from onnx import TensorProto
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = int(attrs.get('axis', 0))
mode = str(attrs.get('mode', 'clip'))
... | [
"def",
"convert_take",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"from",
"onnx",
"import",
"TensorProto",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L2809-L2872 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/json_schema_compiler/dart_generator.py | python | _Generator._GenerateParameterList | (self,
params,
callback=None,
convert_optional=False) | return ', '.join(p for p in param_sets if p) | Given a list of function parameters, generates their signature (as a
string).
e.g.
[String type]
bool x, void callback([String x])
If convert_optional is True, changes optional parameters to be required.
Useful for callbacks, where optional parameters are treated as required. | Given a list of function parameters, generates their signature (as a
string). | [
"Given",
"a",
"list",
"of",
"function",
"parameters",
"generates",
"their",
"signature",
"(",
"as",
"a",
"string",
")",
"."
] | def _GenerateParameterList(self,
params,
callback=None,
convert_optional=False):
"""Given a list of function parameters, generates their signature (as a
string).
e.g.
[String type]
bool x, void callback([Stri... | [
"def",
"_GenerateParameterList",
"(",
"self",
",",
"params",
",",
"callback",
"=",
"None",
",",
"convert_optional",
"=",
"False",
")",
":",
"# Params lists (required & optional), to be joined with commas.",
"# TODO(sashab): Don't assume optional params always come after required",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/dart_generator.py#L558-L610 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTime.SetHour | (*args, **kwargs) | return _misc_.DateTime_SetHour(*args, **kwargs) | SetHour(self, int hour) -> DateTime | SetHour(self, int hour) -> DateTime | [
"SetHour",
"(",
"self",
"int",
"hour",
")",
"-",
">",
"DateTime"
] | def SetHour(*args, **kwargs):
"""SetHour(self, int hour) -> DateTime"""
return _misc_.DateTime_SetHour(*args, **kwargs) | [
"def",
"SetHour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_SetHour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3829-L3831 | |
zeakey/DeepSkeleton | dc70170f8fd2ec8ca1157484ce66129981104486 | python/caffe/pycaffe.py | python | _Net_params | (self) | return OrderedDict([(name, lr.blobs)
for name, lr in zip(self._layer_names, self.layers)
if len(lr.blobs) > 0]) | An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases) | An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases) | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"parameters",
"indexed",
"by",
"name",
";",
"each",
"is",
"a",
"list",
"of",
"multiple",
"blobs",
"(",
"e",
".",
"g",
".",
"weights",
... | def _Net_params(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
parameters indexed by name; each is a list of multiple blobs (e.g.,
weights and biases)
"""
return OrderedDict([(name, lr.blobs)
for name, lr in zip(self._layer_names, self.layers)... | [
"def",
"_Net_params",
"(",
"self",
")",
":",
"return",
"OrderedDict",
"(",
"[",
"(",
"name",
",",
"lr",
".",
"blobs",
")",
"for",
"name",
",",
"lr",
"in",
"zip",
"(",
"self",
".",
"_layer_names",
",",
"self",
".",
"layers",
")",
"if",
"len",
"(",
... | https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/python/caffe/pycaffe.py#L40-L48 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/deep_cfr_tf2.py | python | DeepCFRSolver._sample_action_from_advantage | (self, state, player) | return advantages.numpy(), matched_regrets.numpy() | Returns an info state policy by applying regret-matching.
Args:
state: Current OpenSpiel game state.
player: (int) Player index over which to compute regrets.
Returns:
1. (np-array) Advantage values for info state actions indexed by action.
2. (np-array) Matched regrets, prob for actio... | Returns an info state policy by applying regret-matching. | [
"Returns",
"an",
"info",
"state",
"policy",
"by",
"applying",
"regret",
"-",
"matching",
"."
] | def _sample_action_from_advantage(self, state, player):
"""Returns an info state policy by applying regret-matching.
Args:
state: Current OpenSpiel game state.
player: (int) Player index over which to compute regrets.
Returns:
1. (np-array) Advantage values for info state actions indexed... | [
"def",
"_sample_action_from_advantage",
"(",
"self",
",",
"state",
",",
"player",
")",
":",
"info_state",
"=",
"tf",
".",
"constant",
"(",
"state",
".",
"information_state_tensor",
"(",
"player",
")",
",",
"dtype",
"=",
"tf",
".",
"float32",
")",
"legal_acti... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/deep_cfr_tf2.py#L609-L626 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ftplib.py | python | FTP.close | (self) | Close the connection without assuming anything about it. | Close the connection without assuming anything about it. | [
"Close",
"the",
"connection",
"without",
"assuming",
"anything",
"about",
"it",
"."
] | def close(self):
'''Close the connection without assuming anything about it.'''
try:
file = self.file
self.file = None
if file is not None:
file.close()
finally:
sock = self.sock
self.sock = None
if sock is n... | [
"def",
"close",
"(",
"self",
")",
":",
"try",
":",
"file",
"=",
"self",
".",
"file",
"self",
".",
"file",
"=",
"None",
"if",
"file",
"is",
"not",
"None",
":",
"file",
".",
"close",
"(",
")",
"finally",
":",
"sock",
"=",
"self",
".",
"sock",
"se... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L607-L618 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | Context.device_name | (self) | return self._thread_local_data.device_name | Returns the device name for the current thread. | Returns the device name for the current thread. | [
"Returns",
"the",
"device",
"name",
"for",
"the",
"current",
"thread",
"."
] | def device_name(self):
"""Returns the device name for the current thread."""
return self._thread_local_data.device_name | [
"def",
"device_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_thread_local_data",
".",
"device_name"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L982-L984 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/markdown/blockparser.py | python | State.isstate | (self, state) | Test that top (current) level is of given state. | Test that top (current) level is of given state. | [
"Test",
"that",
"top",
"(",
"current",
")",
"level",
"is",
"of",
"given",
"state",
"."
] | def isstate(self, state):
""" Test that top (current) level is of given state. """
if len(self):
return self[-1] == state
else:
return False | [
"def",
"isstate",
"(",
"self",
",",
"state",
")",
":",
"if",
"len",
"(",
"self",
")",
":",
"return",
"self",
"[",
"-",
"1",
"]",
"==",
"state",
"else",
":",
"return",
"False"
] | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/markdown/blockparser.py#L33-L38 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | examples/python/gdbremote.py | python | TerminalColors.magenta | (self, fg=True) | return '' | Set the foreground or background color to magenta.
The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False. | Set the foreground or background color to magenta.
The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False. | [
"Set",
"the",
"foreground",
"or",
"background",
"color",
"to",
"magenta",
".",
"The",
"foreground",
"color",
"will",
"be",
"set",
"if",
"fg",
"tests",
"True",
".",
"The",
"background",
"color",
"will",
"be",
"set",
"if",
"fg",
"tests",
"False",
"."
] | def magenta(self, fg=True):
'''Set the foreground or background color to magenta.
The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
if self.enabled:
if fg:
return "\x1b[35m"
else:
... | [
"def",
"magenta",
"(",
"self",
",",
"fg",
"=",
"True",
")",
":",
"if",
"self",
".",
"enabled",
":",
"if",
"fg",
":",
"return",
"\"\\x1b[35m\"",
"else",
":",
"return",
"\"\\x1b[45m\"",
"return",
"''"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/examples/python/gdbremote.py#L150-L158 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Fixedpoint.get_num_levels | (self, predicate) | return Z3_fixedpoint_get_num_levels(self.ctx.ref(), self.fixedpoint, predicate.ast) | Retrieve number of levels used for predicate in PDR engine | Retrieve number of levels used for predicate in PDR engine | [
"Retrieve",
"number",
"of",
"levels",
"used",
"for",
"predicate",
"in",
"PDR",
"engine"
] | def get_num_levels(self, predicate):
"""Retrieve number of levels used for predicate in PDR engine"""
return Z3_fixedpoint_get_num_levels(self.ctx.ref(), self.fixedpoint, predicate.ast) | [
"def",
"get_num_levels",
"(",
"self",
",",
"predicate",
")",
":",
"return",
"Z3_fixedpoint_get_num_levels",
"(",
"self",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"self",
".",
"fixedpoint",
",",
"predicate",
".",
"ast",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L7517-L7519 | |
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.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/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L1144-L1165 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/examples/narrowband/uhd_interface.py | python | uhd_receiver._print_verbage | (self) | Prints information about the UHD transmitter | Prints information about the UHD transmitter | [
"Prints",
"information",
"about",
"the",
"UHD",
"transmitter"
] | def _print_verbage(self):
"""
Prints information about the UHD transmitter
"""
print("\nUHD Receiver:")
print("UHD Args: %s" % (self._args))
print("Freq: %sHz" % (eng_notation.num_to_str(self._freq)))
print("LO Offset: %sHz" %
(eng_not... | [
"def",
"_print_verbage",
"(",
"self",
")",
":",
"print",
"(",
"\"\\nUHD Receiver:\"",
")",
"print",
"(",
"\"UHD Args: %s\"",
"%",
"(",
"self",
".",
"_args",
")",
")",
"print",
"(",
"\"Freq: %sHz\"",
"%",
"(",
"eng_notation",
".",
"num_to_str",
"(",... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/examples/narrowband/uhd_interface.py#L222-L235 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_composit.py | python | CompositeShape.FindConstraint | (self, cId) | return None | Finds the constraint with the given id.
Returns a tuple of the constraint and the actual composite the
constraint was in, in case that composite was a descendant of
this composit.
Returns None if not found. | Finds the constraint with the given id. | [
"Finds",
"the",
"constraint",
"with",
"the",
"given",
"id",
"."
] | def FindConstraint(self, cId):
"""Finds the constraint with the given id.
Returns a tuple of the constraint and the actual composite the
constraint was in, in case that composite was a descendant of
this composit.
Returns None if not found.
"""
for constraint in... | [
"def",
"FindConstraint",
"(",
"self",
",",
"cId",
")",
":",
"for",
"constraint",
"in",
"self",
".",
"_constraints",
":",
"if",
"constraint",
".",
"_constraintId",
"==",
"cId",
":",
"return",
"constraint",
",",
"self",
"# If not found, try children",
"for",
"ch... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_composit.py#L613-L633 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/_trustregion.py | python | BaseQuadraticSubproblem.jac | (self) | return self._g | Value of jacobian of objective function at current iteration. | Value of jacobian of objective function at current iteration. | [
"Value",
"of",
"jacobian",
"of",
"objective",
"function",
"at",
"current",
"iteration",
"."
] | def jac(self):
"""Value of jacobian of objective function at current iteration."""
if self._g is None:
self._g = self._jac(self._x)
return self._g | [
"def",
"jac",
"(",
"self",
")",
":",
"if",
"self",
".",
"_g",
"is",
"None",
":",
"self",
".",
"_g",
"=",
"self",
".",
"_jac",
"(",
"self",
".",
"_x",
")",
"return",
"self",
".",
"_g"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/_trustregion.py#L48-L52 | |
yushroom/FishEngine | a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9 | Script/reflect/clang/cindex.py | python | Cursor.is_default_constructor | (self) | return conf.lib.clang_CXXConstructor_isDefaultConstructor(self) | Returns True if the cursor refers to a C++ default constructor. | Returns True if the cursor refers to a C++ default constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"default",
"constructor",
"."
] | def is_default_constructor(self):
"""Returns True if the cursor refers to a C++ default constructor.
"""
return conf.lib.clang_CXXConstructor_isDefaultConstructor(self) | [
"def",
"is_default_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isDefaultConstructor",
"(",
"self",
")"
] | https://github.com/yushroom/FishEngine/blob/a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9/Script/reflect/clang/cindex.py#L1362-L1365 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/globe_cutter_app.py | python | GlobeBuilder.BuildSearchDb | (self, source, polygon) | Extracts database info needed for POI search. | Extracts database info needed for POI search. | [
"Extracts",
"database",
"info",
"needed",
"for",
"POI",
"search",
"."
] | def BuildSearchDb(self, source, polygon):
"""Extracts database info needed for POI search."""
self.Status("Extract search data ...")
try:
os.makedirs(self.search_dir)
except os.error:
pass # Directory may already exist
# Determine the server and target path (fusion db publish point) fr... | [
"def",
"BuildSearchDb",
"(",
"self",
",",
"source",
",",
"polygon",
")",
":",
"self",
".",
"Status",
"(",
"\"Extract search data ...\"",
")",
"try",
":",
"os",
".",
"makedirs",
"(",
"self",
".",
"search_dir",
")",
"except",
"os",
".",
"error",
":",
"pass... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/globe_cutter_app.py#L520-L585 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/model.py | python | _create_kvstore | (kvstore, num_device, arg_params) | return (kv, update_on_kvstore) | Create kvstore
This function select and create a proper kvstore if given the kvstore type.
Parameters
----------
kvstore : KVStore or str
The kvstore.
num_device : int
The number of devices
arg_params : dict of str to `NDArray`.
Model parameter, dict of name to `NDArray`... | Create kvstore
This function select and create a proper kvstore if given the kvstore type. | [
"Create",
"kvstore",
"This",
"function",
"select",
"and",
"create",
"a",
"proper",
"kvstore",
"if",
"given",
"the",
"kvstore",
"type",
"."
] | def _create_kvstore(kvstore, num_device, arg_params):
"""Create kvstore
This function select and create a proper kvstore if given the kvstore type.
Parameters
----------
kvstore : KVStore or str
The kvstore.
num_device : int
The number of devices
arg_params : dict of str to ... | [
"def",
"_create_kvstore",
"(",
"kvstore",
",",
"num_device",
",",
"arg_params",
")",
":",
"update_on_kvstore",
"=",
"bool",
"(",
"int",
"(",
"os",
".",
"getenv",
"(",
"'MXNET_UPDATE_ON_KVSTORE'",
",",
"\"1\"",
")",
")",
")",
"if",
"kvstore",
"is",
"None",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/model.py#L82-L119 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/tools/common.py | python | prepend_path_variable_command | (variable, paths) | return path_variable_setting_command(variable,
paths + os.environ.get(variable, "").split(os.pathsep)) | Returns a command that prepends the given paths to the named path variable on
the current platform. | Returns a command that prepends the given paths to the named path variable on
the current platform. | [
"Returns",
"a",
"command",
"that",
"prepends",
"the",
"given",
"paths",
"to",
"the",
"named",
"path",
"variable",
"on",
"the",
"current",
"platform",
"."
] | def prepend_path_variable_command(variable, paths):
"""
Returns a command that prepends the given paths to the named path variable on
the current platform.
"""
return path_variable_setting_command(variable,
paths + os.environ.get(variable, "").split(os.pathsep)) | [
"def",
"prepend_path_variable_command",
"(",
"variable",
",",
"paths",
")",
":",
"return",
"path_variable_setting_command",
"(",
"variable",
",",
"paths",
"+",
"os",
".",
"environ",
".",
"get",
"(",
"variable",
",",
"\"\"",
")",
".",
"split",
"(",
"os",
".",... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/tools/common.py#L524-L530 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | _set_tz | (
values: Union[np.ndarray, Index],
tz: Optional[Union[str, tzinfo]],
coerce: bool = False,
) | return values | coerce the values to a DatetimeIndex if tz is set
preserve the input shape if possible
Parameters
----------
values : ndarray or Index
tz : str or tzinfo
coerce : if we do not have a passed timezone, coerce to M8[ns] ndarray | coerce the values to a DatetimeIndex if tz is set
preserve the input shape if possible | [
"coerce",
"the",
"values",
"to",
"a",
"DatetimeIndex",
"if",
"tz",
"is",
"set",
"preserve",
"the",
"input",
"shape",
"if",
"possible"
] | def _set_tz(
values: Union[np.ndarray, Index],
tz: Optional[Union[str, tzinfo]],
coerce: bool = False,
) -> Union[np.ndarray, DatetimeIndex]:
"""
coerce the values to a DatetimeIndex if tz is set
preserve the input shape if possible
Parameters
----------
values : ndarray or Index
... | [
"def",
"_set_tz",
"(",
"values",
":",
"Union",
"[",
"np",
".",
"ndarray",
",",
"Index",
"]",
",",
"tz",
":",
"Optional",
"[",
"Union",
"[",
"str",
",",
"tzinfo",
"]",
"]",
",",
"coerce",
":",
"bool",
"=",
"False",
",",
")",
"->",
"Union",
"[",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L4646-L4676 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py | python | _minimum_flops | (graph, node) | return _binary_per_element_op_flops(graph, node) | Compute flops for Minimum operation. | Compute flops for Minimum operation. | [
"Compute",
"flops",
"for",
"Minimum",
"operation",
"."
] | def _minimum_flops(graph, node):
"""Compute flops for Minimum operation."""
return _binary_per_element_op_flops(graph, node) | [
"def",
"_minimum_flops",
"(",
"graph",
",",
"node",
")",
":",
"return",
"_binary_per_element_op_flops",
"(",
"graph",
",",
"node",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py#L178-L180 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/spatial/kdtree.py | python | Rectangle.split | (self, d, split) | return less, greater | Produce two hyperrectangles by splitting.
In general, if you need to compute maximum and minimum
distances to the children, it can be done more efficiently
by updating the maximum and minimum distances to the parent.
Parameters
----------
d : int
Axis to spl... | Produce two hyperrectangles by splitting. | [
"Produce",
"two",
"hyperrectangles",
"by",
"splitting",
"."
] | def split(self, d, split):
"""
Produce two hyperrectangles by splitting.
In general, if you need to compute maximum and minimum
distances to the children, it can be done more efficiently
by updating the maximum and minimum distances to the parent.
Parameters
---... | [
"def",
"split",
"(",
"self",
",",
"d",
",",
"split",
")",
":",
"mid",
"=",
"np",
".",
"copy",
"(",
"self",
".",
"maxes",
")",
"mid",
"[",
"d",
"]",
"=",
"split",
"less",
"=",
"Rectangle",
"(",
"self",
".",
"mins",
",",
"mid",
")",
"mid",
"=",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/spatial/kdtree.py#L95-L117 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/bsplines.py | python | qspline1d_eval | (cj, newx, dx=1.0, x0=0) | return res | Evaluate a quadratic spline at the new set of points.
`dx` is the old sample-spacing while `x0` was the old origin. In
other-words the old-sample points (knot-points) for which the `cj`
represent spline coefficients were at equally-spaced points of::
oldx = x0 + j*dx j=0...N-1, with N=len(cj)
... | Evaluate a quadratic spline at the new set of points. | [
"Evaluate",
"a",
"quadratic",
"spline",
"at",
"the",
"new",
"set",
"of",
"points",
"."
] | def qspline1d_eval(cj, newx, dx=1.0, x0=0):
"""Evaluate a quadratic spline at the new set of points.
`dx` is the old sample-spacing while `x0` was the old origin. In
other-words the old-sample points (knot-points) for which the `cj`
represent spline coefficients were at equally-spaced points of::
... | [
"def",
"qspline1d_eval",
"(",
"cj",
",",
"newx",
",",
"dx",
"=",
"1.0",
",",
"x0",
"=",
"0",
")",
":",
"newx",
"=",
"(",
"asarray",
"(",
"newx",
")",
"-",
"x0",
")",
"/",
"dx",
"res",
"=",
"zeros_like",
"(",
"newx",
")",
"if",
"res",
".",
"si... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/bsplines.py#L361-L394 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py | python | JarReader.is_optimized | (self) | return self._cdir_end['cdir_offset'] == \
JarStruct.TYPE_MAPPING['uint32'][1] | Return whether the jar archive is optimized. | Return whether the jar archive is optimized. | [
"Return",
"whether",
"the",
"jar",
"archive",
"is",
"optimized",
"."
] | def is_optimized(self):
'''
Return whether the jar archive is optimized.
'''
# In optimized jars, the central directory is at the beginning of the
# file, after a single 32-bits value, which is the length of data
# preloaded.
return self._cdir_end['cdir_offset'] =... | [
"def",
"is_optimized",
"(",
"self",
")",
":",
"# In optimized jars, the central directory is at the beginning of the",
"# file, after a single 32-bits value, which is the length of data",
"# preloaded.",
"return",
"self",
".",
"_cdir_end",
"[",
"'cdir_offset'",
"]",
"==",
"JarStruc... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py#L395-L403 | |
kungfu-origin/kungfu | 90c84b2b590855654cb9a6395ed050e0f7763512 | core/deps/SQLiteCpp-2.3.0/cpplint.py | python | ProcessFile | (filename, vlevel, extra_check_functions=[]) | Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An array of additional check functions that will be
... | Does google-lint on a single file. | [
"Does",
"google",
"-",
"lint",
"on",
"a",
"single",
"file",
"."
] | def ProcessFile(filename, vlevel, extra_check_functions=[]):
"""Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An ar... | [
"def",
"ProcessFile",
"(",
"filename",
",",
"vlevel",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"_SetVerboseLevel",
"(",
"vlevel",
")",
"try",
":",
"# Support the UNIX convention of using \"-\" for stdin. Note that",
"# we are not opening the file with universal... | https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L4628-L4695 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | FontList.FindOrCreateFont | (*args, **kwargs) | return _gdi_.FontList_FindOrCreateFont(*args, **kwargs) | FindOrCreateFont(self, int point_size, int family, int style, int weight,
bool underline=False, String facename=EmptyString,
int encoding=FONTENCODING_DEFAULT) -> Font | FindOrCreateFont(self, int point_size, int family, int style, int weight,
bool underline=False, String facename=EmptyString,
int encoding=FONTENCODING_DEFAULT) -> Font | [
"FindOrCreateFont",
"(",
"self",
"int",
"point_size",
"int",
"family",
"int",
"style",
"int",
"weight",
"bool",
"underline",
"=",
"False",
"String",
"facename",
"=",
"EmptyString",
"int",
"encoding",
"=",
"FONTENCODING_DEFAULT",
")",
"-",
">",
"Font"
] | def FindOrCreateFont(*args, **kwargs):
"""
FindOrCreateFont(self, int point_size, int family, int style, int weight,
bool underline=False, String facename=EmptyString,
int encoding=FONTENCODING_DEFAULT) -> Font
"""
return _gdi_.FontList_FindOrCreateFont(*args, *... | [
"def",
"FindOrCreateFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"FontList_FindOrCreateFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L7063-L7069 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | ImageHandler.GetType | (*args, **kwargs) | return _core_.ImageHandler_GetType(*args, **kwargs) | GetType(self) -> int | GetType(self) -> int | [
"GetType",
"(",
"self",
")",
"-",
">",
"int"
] | def GetType(*args, **kwargs):
"""GetType(self) -> int"""
return _core_.ImageHandler_GetType(*args, **kwargs) | [
"def",
"GetType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ImageHandler_GetType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2632-L2634 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/html5lib-python/html5lib/html5parser.py | python | HTMLParser.normalizeToken | (self, token) | return token | HTML5 specific normalizations to the token stream | HTML5 specific normalizations to the token stream | [
"HTML5",
"specific",
"normalizations",
"to",
"the",
"token",
"stream"
] | def normalizeToken(self, token):
""" HTML5 specific normalizations to the token stream """
if token["type"] == tokenTypes["StartTag"]:
token["data"] = dict(token["data"][::-1])
return token | [
"def",
"normalizeToken",
"(",
"self",
",",
"token",
")",
":",
"if",
"token",
"[",
"\"type\"",
"]",
"==",
"tokenTypes",
"[",
"\"StartTag\"",
"]",
":",
"token",
"[",
"\"data\"",
"]",
"=",
"dict",
"(",
"token",
"[",
"\"data\"",
"]",
"[",
":",
":",
"-",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/html5lib-python/html5lib/html5parser.py#L262-L268 | |
interpretml/interpret | 29466bffc04505fe4f836a83fcfebfd313ac8454 | python/interpret-core/interpret/glassbox/linear.py | python | LogisticRegression.fit | (self, X, y) | return super().fit(X, y) | Fits model to provided instances.
Args:
X: Numpy array for training instances.
y: Numpy array as training labels.
Returns:
Itself. | Fits model to provided instances. | [
"Fits",
"model",
"to",
"provided",
"instances",
"."
] | def fit(self, X, y):
""" Fits model to provided instances.
Args:
X: Numpy array for training instances.
y: Numpy array as training labels.
Returns:
Itself.
"""
self.sk_model_ = self.linear_class(**self.kwargs)
return super().fit(X, y) | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
")",
":",
"self",
".",
"sk_model_",
"=",
"self",
".",
"linear_class",
"(",
"*",
"*",
"self",
".",
"kwargs",
")",
"return",
"super",
"(",
")",
".",
"fit",
"(",
"X",
",",
"y",
")"
] | https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/glassbox/linear.py#L414-L425 | |
adobe/brackets-app | 26dc31087a30bef7754b94e09fe7e74f6da9d699 | src/mac/tools/change_mach_o_flags.py | python | HandleFatFile | (file, options, fat_offset=0) | Seeks the file-like |file| object to |offset| and loops over its
|fat_header| entries, calling HandleMachOFile for each. | Seeks the file-like |file| object to |offset| and loops over its
|fat_header| entries, calling HandleMachOFile for each. | [
"Seeks",
"the",
"file",
"-",
"like",
"|file|",
"object",
"to",
"|offset|",
"and",
"loops",
"over",
"its",
"|fat_header|",
"entries",
"calling",
"HandleMachOFile",
"for",
"each",
"."
] | def HandleFatFile(file, options, fat_offset=0):
"""Seeks the file-like |file| object to |offset| and loops over its
|fat_header| entries, calling HandleMachOFile for each."""
CheckedSeek(file, fat_offset)
magic = ReadUInt32(file, '>')
assert magic == FAT_MAGIC
nfat_arch = ReadUInt32(file, '>')
for inde... | [
"def",
"HandleFatFile",
"(",
"file",
",",
"options",
",",
"fat_offset",
"=",
"0",
")",
":",
"CheckedSeek",
"(",
"file",
",",
"fat_offset",
")",
"magic",
"=",
"ReadUInt32",
"(",
"file",
",",
"'>'",
")",
"assert",
"magic",
"==",
"FAT_MAGIC",
"nfat_arch",
"... | https://github.com/adobe/brackets-app/blob/26dc31087a30bef7754b94e09fe7e74f6da9d699/src/mac/tools/change_mach_o_flags.py#L221-L239 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/smtplib.py | python | SMTP.getreply | (self) | return errcode, errmsg | Get a reply from the server.
Returns a tuple consisting of:
- server response code (e.g. '250', or such, if all goes well)
Note: returns -1 if it can't read response code.
- server response string corresponding to response code (multiline
responses are converted to... | Get a reply from the server. | [
"Get",
"a",
"reply",
"from",
"the",
"server",
"."
] | def getreply(self):
"""Get a reply from the server.
Returns a tuple consisting of:
- server response code (e.g. '250', or such, if all goes well)
Note: returns -1 if it can't read response code.
- server response string corresponding to response code (multiline
... | [
"def",
"getreply",
"(",
"self",
")",
":",
"resp",
"=",
"[",
"]",
"if",
"self",
".",
"file",
"is",
"None",
":",
"self",
".",
"file",
"=",
"self",
".",
"sock",
".",
"makefile",
"(",
"'rb'",
")",
"while",
"1",
":",
"try",
":",
"line",
"=",
"self",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/smtplib.py#L369-L416 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/nasm/find_patches.py | python | write_patches_file | (origin_branch, output_file) | Write the patches file for |origin_branch| to |output_file|. | Write the patches file for |origin_branch| to |output_file|. | [
"Write",
"the",
"patches",
"file",
"for",
"|origin_branch|",
"to",
"|output_file|",
"."
] | def write_patches_file(origin_branch, output_file):
"""Write the patches file for |origin_branch| to |output_file|."""
# Get the latest upstream commit that's reachable from the origin branch.
# We'll use that to compare against.
upstream = run(["git", "merge-base", "upstream/master",
origin_b... | [
"def",
"write_patches_file",
"(",
"origin_branch",
",",
"output_file",
")",
":",
"# Get the latest upstream commit that's reachable from the origin branch.",
"# We'll use that to compare against.",
"upstream",
"=",
"run",
"(",
"[",
"\"git\"",
",",
"\"merge-base\"",
",",
"\"upst... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/nasm/find_patches.py#L116-L262 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/_lib/decorator.py | python | decorator | (caller, _func=None) | return FunctionMaker.create(
'%s(func)' % name, 'return _decorate_(func, _call_)',
evaldict, doc=doc, module=caller.__module__,
__wrapped__=caller) | decorator(caller) converts a caller function into a decorator | decorator(caller) converts a caller function into a decorator | [
"decorator",
"(",
"caller",
")",
"converts",
"a",
"caller",
"function",
"into",
"a",
"decorator"
] | def decorator(caller, _func=None):
"""decorator(caller) converts a caller function into a decorator"""
if _func is not None: # return a decorated function
# this is obsolete behavior; you should use decorate instead
return decorate(_func, caller)
# else return a decorator function
if in... | [
"def",
"decorator",
"(",
"caller",
",",
"_func",
"=",
"None",
")",
":",
"if",
"_func",
"is",
"not",
"None",
":",
"# return a decorated function",
"# this is obsolete behavior; you should use decorate instead",
"return",
"decorate",
"(",
"_func",
",",
"caller",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/_lib/decorator.py#L240-L268 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailbox.py | python | MHMessage.set_sequences | (self, sequences) | Set the list of sequences that include the message. | Set the list of sequences that include the message. | [
"Set",
"the",
"list",
"of",
"sequences",
"that",
"include",
"the",
"message",
"."
] | def set_sequences(self, sequences):
"""Set the list of sequences that include the message."""
self._sequences = list(sequences) | [
"def",
"set_sequences",
"(",
"self",
",",
"sequences",
")",
":",
"self",
".",
"_sequences",
"=",
"list",
"(",
"sequences",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L1715-L1717 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/imperative/imperative_mode.py | python | ImperativeMode.__init__ | (self, target, parent_graph=None) | Initializes an ImperativeMode.
Args:
target: The TensorFlow execution engine to connect to.
parent_graph: (Optional) An ImperativeGraph.
Raises:
UnimplementedError: if non-None parent_graph is not an ImperativeGraph. | Initializes an ImperativeMode. | [
"Initializes",
"an",
"ImperativeMode",
"."
] | def __init__(self, target, parent_graph=None):
"""Initializes an ImperativeMode.
Args:
target: The TensorFlow execution engine to connect to.
parent_graph: (Optional) An ImperativeGraph.
Raises:
UnimplementedError: if non-None parent_graph is not an ImperativeGraph.
"""
self._tar... | [
"def",
"__init__",
"(",
"self",
",",
"target",
",",
"parent_graph",
"=",
"None",
")",
":",
"self",
".",
"_target",
"=",
"target",
"self",
".",
"_parent_graph",
"=",
"parent_graph",
"# Create a new graph",
"self",
".",
"_graph",
"=",
"imperative_graph",
".",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/imperative/imperative_mode.py#L78-L114 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/named_commands.py | python | end_of_line | (event: E) | Move to the end of the line. | Move to the end of the line. | [
"Move",
"to",
"the",
"end",
"of",
"the",
"line",
"."
] | def end_of_line(event: E) -> None:
"""
Move to the end of the line.
"""
buff = event.current_buffer
buff.cursor_position += buff.document.get_end_of_line_position() | [
"def",
"end_of_line",
"(",
"event",
":",
"E",
")",
"->",
"None",
":",
"buff",
"=",
"event",
".",
"current_buffer",
"buff",
".",
"cursor_position",
"+=",
"buff",
".",
"document",
".",
"get_end_of_line_position",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/named_commands.py#L98-L103 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/encodings/zlib_codec.py | python | zlib_encode | (input,errors='strict') | return (output, len(input)) | Encodes the object input and returns a tuple (output
object, length consumed).
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec. | Encodes the object input and returns a tuple (output
object, length consumed). | [
"Encodes",
"the",
"object",
"input",
"and",
"returns",
"a",
"tuple",
"(",
"output",
"object",
"length",
"consumed",
")",
"."
] | def zlib_encode(input,errors='strict'):
""" Encodes the object input and returns a tuple (output
object, length consumed).
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec.
"""
... | [
"def",
"zlib_encode",
"(",
"input",
",",
"errors",
"=",
"'strict'",
")",
":",
"assert",
"errors",
"==",
"'strict'",
"output",
"=",
"zlib",
".",
"compress",
"(",
"input",
")",
"return",
"(",
"output",
",",
"len",
"(",
"input",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/encodings/zlib_codec.py#L14-L26 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/node/base.py | python | Node.SetAllowlistMarkedAsSkip | (self, mark_skipped) | Sets AllowlistMarkedAsSkip. | Sets AllowlistMarkedAsSkip. | [
"Sets",
"AllowlistMarkedAsSkip",
"."
] | def SetAllowlistMarkedAsSkip(self, mark_skipped):
'''Sets AllowlistMarkedAsSkip.
'''
self._allowlist_marked_as_skip = mark_skipped | [
"def",
"SetAllowlistMarkedAsSkip",
"(",
"self",
",",
"mark_skipped",
")",
":",
"self",
".",
"_allowlist_marked_as_skip",
"=",
"mark_skipped"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/base.py#L614-L617 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBEvent_GetCStringFromEvent | (event) | return _lldb.SBEvent_GetCStringFromEvent(event) | SBEvent_GetCStringFromEvent(SBEvent event) -> char const * | SBEvent_GetCStringFromEvent(SBEvent event) -> char const * | [
"SBEvent_GetCStringFromEvent",
"(",
"SBEvent",
"event",
")",
"-",
">",
"char",
"const",
"*"
] | def SBEvent_GetCStringFromEvent(event):
"""SBEvent_GetCStringFromEvent(SBEvent event) -> char const *"""
return _lldb.SBEvent_GetCStringFromEvent(event) | [
"def",
"SBEvent_GetCStringFromEvent",
"(",
"event",
")",
":",
"return",
"_lldb",
".",
"SBEvent_GetCStringFromEvent",
"(",
"event",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4840-L4842 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | VideoMode.IsOk | (*args, **kwargs) | return _misc_.VideoMode_IsOk(*args, **kwargs) | IsOk(self) -> bool
returns true if the object has been initialized | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""
IsOk(self) -> bool
returns true if the object has been initialized
"""
return _misc_.VideoMode_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"VideoMode_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L6050-L6056 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | nanoHTTPCleanup | () | Cleanup the HTTP protocol layer. | Cleanup the HTTP protocol layer. | [
"Cleanup",
"the",
"HTTP",
"protocol",
"layer",
"."
] | def nanoHTTPCleanup():
"""Cleanup the HTTP protocol layer. """
libxml2mod.xmlNanoHTTPCleanup() | [
"def",
"nanoHTTPCleanup",
"(",
")",
":",
"libxml2mod",
".",
"xmlNanoHTTPCleanup",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L1249-L1251 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/make_distrib.py | python | create_zip_archive | (input_dir) | Creates a zip archive of the specified input directory. | Creates a zip archive of the specified input directory. | [
"Creates",
"a",
"zip",
"archive",
"of",
"the",
"specified",
"input",
"directory",
"."
] | def create_zip_archive(input_dir):
""" Creates a zip archive of the specified input directory. """
zip_file = input_dir + '.zip'
zf = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED, True)
def addDir(dir):
for f in os.listdir(dir):
full_path = os.path.join(dir, f)
if os.path.isdir(full_path... | [
"def",
"create_zip_archive",
"(",
"input_dir",
")",
":",
"zip_file",
"=",
"input_dir",
"+",
"'.zip'",
"zf",
"=",
"zipfile",
".",
"ZipFile",
"(",
"zip_file",
",",
"'w'",
",",
"zipfile",
".",
"ZIP_DEFLATED",
",",
"True",
")",
"def",
"addDir",
"(",
"dir",
"... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/make_distrib.py#L24-L39 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetBundleResourceFolder | (self) | return os.path.join(self.GetBundleContentsFolderPath(), "Resources") | Returns the qualified path to the bundle's resource folder. E.g.
Chromium.app/Contents/Resources. Only valid for bundles. | Returns the qualified path to the bundle's resource folder. E.g.
Chromium.app/Contents/Resources. Only valid for bundles. | [
"Returns",
"the",
"qualified",
"path",
"to",
"the",
"bundle",
"s",
"resource",
"folder",
".",
"E",
".",
"g",
".",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"Resources",
".",
"Only",
"valid",
"for",
"bundles",
"."
] | def GetBundleResourceFolder(self):
"""Returns the qualified path to the bundle's resource folder. E.g.
Chromium.app/Contents/Resources. Only valid for bundles."""
assert self._IsBundle()
if self.isIOS:
return self.GetBundleContentsFolderPath()
return os.path.join(self.Get... | [
"def",
"GetBundleResourceFolder",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_IsBundle",
"(",
")",
"if",
"self",
".",
"isIOS",
":",
"return",
"self",
".",
"GetBundleContentsFolderPath",
"(",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L317-L323 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/llvm/utils/lit/lit/LitConfig.py | python | LitConfig.load_config | (self, config, path) | return config | load_config(config, path) - Load a config object from an alternate
path. | load_config(config, path) - Load a config object from an alternate
path. | [
"load_config",
"(",
"config",
"path",
")",
"-",
"Load",
"a",
"config",
"object",
"from",
"an",
"alternate",
"path",
"."
] | def load_config(self, config, path):
"""load_config(config, path) - Load a config object from an alternate
path."""
if self.debug:
self.note('load_config from %r' % path)
config.load_from_path(path, self)
return config | [
"def",
"load_config",
"(",
"self",
",",
"config",
",",
"path",
")",
":",
"if",
"self",
".",
"debug",
":",
"self",
".",
"note",
"(",
"'load_config from %r'",
"%",
"path",
")",
"config",
".",
"load_from_path",
"(",
"path",
",",
"self",
")",
"return",
"co... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/llvm/utils/lit/lit/LitConfig.py#L97-L103 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/tools/docs/parser.py | python | ReferenceResolver._one_ref | (self, match, relative_path_to_root) | return 'BROKEN_LINK' | Return a link for a single "@{symbol}" reference. | Return a link for a single " | [
"Return",
"a",
"link",
"for",
"a",
"single"
] | def _one_ref(self, match, relative_path_to_root):
"""Return a link for a single "@{symbol}" reference."""
string = match.group(1)
# Look for link text after $.
dollar = string.rfind('$')
if dollar > 0: # Ignore $ in first character
link_text = string[dollar + 1:]
string = string[:dolla... | [
"def",
"_one_ref",
"(",
"self",
",",
"match",
",",
"relative_path_to_root",
")",
":",
"string",
"=",
"match",
".",
"group",
"(",
"1",
")",
"# Look for link text after $.",
"dollar",
"=",
"string",
".",
"rfind",
"(",
"'$'",
")",
"if",
"dollar",
">",
"0",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/docs/parser.py#L309-L345 | |
nasa/meshNetwork | ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c | python/mesh/generic/meshController.py | python | MeshController.sendMsg | (self, destId, msg) | This function receives messages to be sent over the mesh network and queues them for transmission. | This function receives messages to be sent over the mesh network and queues them for transmission. | [
"This",
"function",
"receives",
"messages",
"to",
"be",
"sent",
"over",
"the",
"mesh",
"network",
"and",
"queues",
"them",
"for",
"transmission",
"."
] | def sendMsg(self, destId, msg):
"""This function receives messages to be sent over the mesh network and queues them for transmission."""
# Place message in appropriate position in outgoing queue (broadcast messages are stored in the zero position)
if (len(msg) <= self.nodeParams.confi... | [
"def",
"sendMsg",
"(",
"self",
",",
"destId",
",",
"msg",
")",
":",
"# Place message in appropriate position in outgoing queue (broadcast messages are stored in the zero position) ",
"if",
"(",
"len",
"(",
"msg",
")",
"<=",
"self",
".",
"nodeParams",
".",
"config",
".",... | https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/meshController.py#L298-L307 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/docs/tools/dump_ast_matchers.py | python | add_matcher | (result_type, name, args, comment, is_dyncast=False) | Adds a matcher to one of our categories. | Adds a matcher to one of our categories. | [
"Adds",
"a",
"matcher",
"to",
"one",
"of",
"our",
"categories",
"."
] | def add_matcher(result_type, name, args, comment, is_dyncast=False):
"""Adds a matcher to one of our categories."""
if name == 'id':
# FIXME: Figure out whether we want to support the 'id' matcher.
return
matcher_id = '%s%d' % (name, ids[name])
ids[name] += 1
args = unify_arguments(args)
matcher_h... | [
"def",
"add_matcher",
"(",
"result_type",
",",
"name",
",",
"args",
",",
"comment",
",",
"is_dyncast",
"=",
"False",
")",
":",
"if",
"name",
"==",
"'id'",
":",
"# FIXME: Figure out whether we want to support the 'id' matcher.",
"return",
"matcher_id",
"=",
"'%s%d'",... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/docs/tools/dump_ast_matchers.py#L106-L132 | ||
KLayout/klayout | d764adb1016f74d3e9cc8059cb183f5fc29b2a25 | src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py | python | _PCellDeclarationHelper.get_layers | (self, parameters) | return layers | get the layer definitions | get the layer definitions | [
"get",
"the",
"layer",
"definitions"
] | def get_layers(self, parameters):
"""
get the layer definitions
"""
layers = []
for i in self._layer_param_index:
layers.append(parameters[i])
return layers | [
"def",
"get_layers",
"(",
"self",
",",
"parameters",
")",
":",
"layers",
"=",
"[",
"]",
"for",
"i",
"in",
"self",
".",
"_layer_param_index",
":",
"layers",
".",
"append",
"(",
"parameters",
"[",
"i",
"]",
")",
"return",
"layers"
] | https://github.com/KLayout/klayout/blob/d764adb1016f74d3e9cc8059cb183f5fc29b2a25/src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py#L162-L169 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.ForceDelayedLayout | (*args, **kwargs) | return _richtext.RichTextCtrl_ForceDelayedLayout(*args, **kwargs) | ForceDelayedLayout(self) | ForceDelayedLayout(self) | [
"ForceDelayedLayout",
"(",
"self",
")"
] | def ForceDelayedLayout(*args, **kwargs):
"""ForceDelayedLayout(self)"""
return _richtext.RichTextCtrl_ForceDelayedLayout(*args, **kwargs) | [
"def",
"ForceDelayedLayout",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ForceDelayedLayout",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2985-L2987 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pyclbr.py | python | _getname | (g) | return (".".join(parts), token) | Return (dotted-name or None, next-token) tuple for token source g. | Return (dotted-name or None, next-token) tuple for token source g. | [
"Return",
"(",
"dotted",
"-",
"name",
"or",
"None",
"next",
"-",
"token",
")",
"tuple",
"for",
"token",
"source",
"g",
"."
] | def _getname(g):
"Return (dotted-name or None, next-token) tuple for token source g."
parts = []
tokentype, token = next(g)[0:2]
if tokentype != NAME and token != '*':
return (None, token)
parts.append(token)
while True:
tokentype, token = next(g)[0:2]
if token != '.':
... | [
"def",
"_getname",
"(",
"g",
")",
":",
"parts",
"=",
"[",
"]",
"tokentype",
",",
"token",
"=",
"next",
"(",
"g",
")",
"[",
"0",
":",
"2",
"]",
"if",
"tokentype",
"!=",
"NAME",
"and",
"token",
"!=",
"'*'",
":",
"return",
"(",
"None",
",",
"token... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pyclbr.py#L347-L362 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | v8_5_1/tools/verify_source_deps.py | python | iflatten_gyp_file | (gyp_file) | Overaproximates all values in the gyp file.
Iterates over all string values recursively. Removes '../' path prefixes. | Overaproximates all values in the gyp file. | [
"Overaproximates",
"all",
"values",
"in",
"the",
"gyp",
"file",
"."
] | def iflatten_gyp_file(gyp_file):
"""Overaproximates all values in the gyp file.
Iterates over all string values recursively. Removes '../' path prefixes.
"""
with open(gyp_file) as f:
return iflatten(eval(f.read())) | [
"def",
"iflatten_gyp_file",
"(",
"gyp_file",
")",
":",
"with",
"open",
"(",
"gyp_file",
")",
"as",
"f",
":",
"return",
"iflatten",
"(",
"eval",
"(",
"f",
".",
"read",
"(",
")",
")",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/verify_source_deps.py#L65-L71 | ||
ROCmSoftwarePlatform/hipCaffe | 4ec5d482515cce532348553b6db6d00d015675d5 | python/caffe/detector.py | python | Detector.detect_selective_search | (self, image_fnames) | return self.detect_windows(zip(image_fnames, windows_list)) | Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net.
Parameters
----------
image_fnames: list
Returns
-------
detections: list of {filename: image filename, window: crop coordinates,
... | Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"Selective",
"Search",
"proposals",
"by",
"extracting",
"the",
"crop",
"and",
"warping",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_selective_search(self, image_fnames):
"""
Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net.
Parameters
----------
image_fnames: list
Returns
-------
detections:... | [
"def",
"detect_selective_search",
"(",
"self",
",",
"image_fnames",
")",
":",
"import",
"selective_search_ijcv_with_python",
"as",
"selective_search",
"# Make absolute paths so MATLAB can find the files.",
"image_fnames",
"=",
"[",
"os",
".",
"path",
".",
"abspath",
"(",
... | https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/python/caffe/detector.py#L101-L123 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py | python | _setup | (_bootstrap_module) | Setup the path-based importers for importlib by importing needed
built-in modules and injecting them into the global namespace.
Other components are extracted from the core bootstrap module. | Setup the path-based importers for importlib by importing needed
built-in modules and injecting them into the global namespace. | [
"Setup",
"the",
"path",
"-",
"based",
"importers",
"for",
"importlib",
"by",
"importing",
"needed",
"built",
"-",
"in",
"modules",
"and",
"injecting",
"them",
"into",
"the",
"global",
"namespace",
"."
] | def _setup(_bootstrap_module):
"""Setup the path-based importers for importlib by importing needed
built-in modules and injecting them into the global namespace.
Other components are extracted from the core bootstrap module.
"""
global sys, _imp, _bootstrap
_bootstrap = _bootstrap_module
s... | [
"def",
"_setup",
"(",
"_bootstrap_module",
")",
":",
"global",
"sys",
",",
"_imp",
",",
"_bootstrap",
"_bootstrap",
"=",
"_bootstrap_module",
"sys",
"=",
"_bootstrap",
".",
"sys",
"_imp",
"=",
"_bootstrap",
".",
"_imp",
"self_module",
"=",
"sys",
".",
"modul... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L1645-L1699 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/binhex.py | python | _Hqxdecoderengine.read | (self, totalwtd) | return decdata | Read at least wtd bytes (or until EOF) | Read at least wtd bytes (or until EOF) | [
"Read",
"at",
"least",
"wtd",
"bytes",
"(",
"or",
"until",
"EOF",
")"
] | def read(self, totalwtd):
"""Read at least wtd bytes (or until EOF)"""
decdata = ''
wtd = totalwtd
#
# The loop here is convoluted, since we don't really now how
# much to decode: there may be newlines in the incoming data.
while wtd > 0:
if self.eof: ... | [
"def",
"read",
"(",
"self",
",",
"totalwtd",
")",
":",
"decdata",
"=",
"''",
"wtd",
"=",
"totalwtd",
"#",
"# The loop here is convoluted, since we don't really now how",
"# much to decode: there may be newlines in the incoming data.",
"while",
"wtd",
">",
"0",
":",
"if",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/binhex.py#L285-L317 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/makeutil.py | python | Rule.add_commands | (self, commands) | return self | Add commands to the rule. | Add commands to the rule. | [
"Add",
"commands",
"to",
"the",
"rule",
"."
] | def add_commands(self, commands):
'''Add commands to the rule.'''
assert isinstance(commands, Iterable) and not isinstance(commands, StringTypes)
self._commands.extend(commands)
return self | [
"def",
"add_commands",
"(",
"self",
",",
"commands",
")",
":",
"assert",
"isinstance",
"(",
"commands",
",",
"Iterable",
")",
"and",
"not",
"isinstance",
"(",
"commands",
",",
"StringTypes",
")",
"self",
".",
"_commands",
".",
"extend",
"(",
"commands",
")... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/makeutil.py#L114-L118 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/module/bucketing_module.py | python | BucketingModule.get_outputs | (self, merge_multi_context=True) | return self._curr_module.get_outputs(merge_multi_context=merge_multi_context) | Gets outputs from a previous forward computation.
Parameters
----------
merge_multi_context : bool
Defaults to ``True``. In the case when data-parallelism is used, the outputs
will be collected from multiple devices. A ``True`` value indicate that we
should m... | Gets outputs from a previous forward computation. | [
"Gets",
"outputs",
"from",
"a",
"previous",
"forward",
"computation",
"."
] | def get_outputs(self, merge_multi_context=True):
"""Gets outputs from a previous forward computation.
Parameters
----------
merge_multi_context : bool
Defaults to ``True``. In the case when data-parallelism is used, the outputs
will be collected from multiple dev... | [
"def",
"get_outputs",
"(",
"self",
",",
"merge_multi_context",
"=",
"True",
")",
":",
"assert",
"self",
".",
"binded",
"and",
"self",
".",
"params_initialized",
"return",
"self",
".",
"_curr_module",
".",
"get_outputs",
"(",
"merge_multi_context",
"=",
"merge_mu... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/bucketing_module.py#L481-L500 | |
llvm-dcpu16/llvm-dcpu16 | ae6b01fecd03219677e391d4421df5d966d80dcf | bindings/python/llvm/core.py | python | MemoryBuffer.__init__ | (self, filename=None) | Create a new memory buffer.
Currently, we support creating from the contents of a file at the
specified filename. | Create a new memory buffer. | [
"Create",
"a",
"new",
"memory",
"buffer",
"."
] | def __init__(self, filename=None):
"""Create a new memory buffer.
Currently, we support creating from the contents of a file at the
specified filename.
"""
if filename is None:
raise Exception("filename argument must be defined")
memory = c_object_p()
... | [
"def",
"__init__",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"if",
"filename",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"filename argument must be defined\"",
")",
"memory",
"=",
"c_object_p",
"(",
")",
"out",
"=",
"c_char_p",
"(",
"None",
... | https://github.com/llvm-dcpu16/llvm-dcpu16/blob/ae6b01fecd03219677e391d4421df5d966d80dcf/bindings/python/llvm/core.py#L66-L84 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDynamicContent/AWS/resource-manager-code/pak_files.py | python | PakFileArchiver.update_pak | (self, file_to_add_path, dest_pak_path) | Adds a file to an existing pak file | Adds a file to an existing pak file | [
"Adds",
"a",
"file",
"to",
"an",
"existing",
"pak",
"file"
] | def update_pak(self, file_to_add_path, dest_pak_path):
""" Adds a file to an existing pak file """
file_dir_name = os.path.dirname(file_to_add_path)
self.write_pak(file_to_add_path, file_dir_name, dest_pak_path, 'a') | [
"def",
"update_pak",
"(",
"self",
",",
"file_to_add_path",
",",
"dest_pak_path",
")",
":",
"file_dir_name",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"file_to_add_path",
")",
"self",
".",
"write_pak",
"(",
"file_to_add_path",
",",
"file_dir_name",
",",
"des... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDynamicContent/AWS/resource-manager-code/pak_files.py#L45-L49 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/curvestabwidget/__init__.py | python | CurveProperties._get_line_props_from_curve | (curve, props) | return props | Get a curve's line properties and add to props dict | Get a curve's line properties and add to props dict | [
"Get",
"a",
"curve",
"s",
"line",
"properties",
"and",
"add",
"to",
"props",
"dict"
] | def _get_line_props_from_curve(curve, props):
"""Get a curve's line properties and add to props dict"""
if not curve:
props['linestyle'] = 'None'
props['drawstyle'] = 'default'
props['linewidth'] = rcParams['lines.linewidth']
props['color'] = convert_color... | [
"def",
"_get_line_props_from_curve",
"(",
"curve",
",",
"props",
")",
":",
"if",
"not",
"curve",
":",
"props",
"[",
"'linestyle'",
"]",
"=",
"'None'",
"props",
"[",
"'drawstyle'",
"]",
"=",
"'default'",
"props",
"[",
"'linewidth'",
"]",
"=",
"rcParams",
"[... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/curvestabwidget/__init__.py#L170-L182 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | CondTools/SiStrip/python/o2o_helper.py | python | exists_iov | (dbFile, tag) | return len(dataCursor.fetchall()) > 0 | Check if there exists any IOV for a specific tag in the given sqlite file. | Check if there exists any IOV for a specific tag in the given sqlite file. | [
"Check",
"if",
"there",
"exists",
"any",
"IOV",
"for",
"a",
"specific",
"tag",
"in",
"the",
"given",
"sqlite",
"file",
"."
] | def exists_iov(dbFile, tag):
'''Check if there exists any IOV for a specific tag in the given sqlite file.'''
dataConnection = sqlite3.connect(dbFile)
dataCursor = dataConnection.cursor()
dataCursor.execute('select SINCE from IOV where TAG_NAME=:tag_name', {'tag_name' : tag})
return len(dataCursor.f... | [
"def",
"exists_iov",
"(",
"dbFile",
",",
"tag",
")",
":",
"dataConnection",
"=",
"sqlite3",
".",
"connect",
"(",
"dbFile",
")",
"dataCursor",
"=",
"dataConnection",
".",
"cursor",
"(",
")",
"dataCursor",
".",
"execute",
"(",
"'select SINCE from IOV where TAG_NAM... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondTools/SiStrip/python/o2o_helper.py#L149-L154 | |
nasa/trick | 7b85aa66329d62fe8816462627c09a353aac8299 | share/trick/pymods/trick/variable_server.py | python | VariableServer.register_error_callback | (self, function, args=None, kwargs=None) | Call function if an error occurs while sampling variable values.
Registering an aleady-registered function replaces its existing
registration. The order in which functions are called is not
specified. Functions are executed on the asynchronous sampling
thread.
Paramaters
... | Call function if an error occurs while sampling variable values.
Registering an aleady-registered function replaces its existing
registration. The order in which functions are called is not
specified. Functions are executed on the asynchronous sampling
thread. | [
"Call",
"function",
"if",
"an",
"error",
"occurs",
"while",
"sampling",
"variable",
"values",
".",
"Registering",
"an",
"aleady",
"-",
"registered",
"function",
"replaces",
"its",
"existing",
"registration",
".",
"The",
"order",
"in",
"which",
"functions",
"are"... | def register_error_callback(self, function, args=None, kwargs=None):
"""
Call function if an error occurs while sampling variable values.
Registering an aleady-registered function replaces its existing
registration. The order in which functions are called is not
specified. Functi... | [
"def",
"register_error_callback",
"(",
"self",
",",
"function",
",",
"args",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"[",
"]",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
"{",
"}",
"sel... | https://github.com/nasa/trick/blob/7b85aa66329d62fe8816462627c09a353aac8299/share/trick/pymods/trick/variable_server.py#L642-L664 | ||
bh107/bohrium | 5b83e7117285fefc7779ed0e9acb0f8e74c7e068 | bridge/npbackend/bohrium/backend_messaging.py | python | gpu_disable | () | return _backend_msg("GPU: disable") | Disable the GPU backend in the current runtime stack | Disable the GPU backend in the current runtime stack | [
"Disable",
"the",
"GPU",
"backend",
"in",
"the",
"current",
"runtime",
"stack"
] | def gpu_disable():
"""Disable the GPU backend in the current runtime stack"""
return _backend_msg("GPU: disable") | [
"def",
"gpu_disable",
"(",
")",
":",
"return",
"_backend_msg",
"(",
"\"GPU: disable\"",
")"
] | https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/npbackend/bohrium/backend_messaging.py#L19-L21 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/cmake.py | python | CMakeStringEscape | (a) | return a.replace('\\', '\\\\').replace(';', '\\;').replace('"', '\\"') | Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is in string state, this does not s... | Escapes the string 'a' for use inside a CMake string. | [
"Escapes",
"the",
"string",
"a",
"for",
"use",
"inside",
"a",
"CMake",
"string",
"."
] | def CMakeStringEscape(a):
"""Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is i... | [
"def",
"CMakeStringEscape",
"(",
"a",
")",
":",
"return",
"a",
".",
"replace",
"(",
"'\\\\'",
",",
"'\\\\\\\\'",
")",
".",
"replace",
"(",
"';'",
",",
"'\\\\;'",
")",
".",
"replace",
"(",
"'\"'",
",",
"'\\\\\"'",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/cmake.py#L124-L140 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBData.SetByteOrder | (self, endian) | return _lldb.SBData_SetByteOrder(self, endian) | SetByteOrder(SBData self, lldb::ByteOrder endian) | SetByteOrder(SBData self, lldb::ByteOrder endian) | [
"SetByteOrder",
"(",
"SBData",
"self",
"lldb",
"::",
"ByteOrder",
"endian",
")"
] | def SetByteOrder(self, endian):
"""SetByteOrder(SBData self, lldb::ByteOrder endian)"""
return _lldb.SBData_SetByteOrder(self, endian) | [
"def",
"SetByteOrder",
"(",
"self",
",",
"endian",
")",
":",
"return",
"_lldb",
".",
"SBData_SetByteOrder",
"(",
"self",
",",
"endian",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3337-L3339 | |
envoyproxy/envoy | 65541accdafe255e72310b4298d646e091da2d80 | docs/conf.py | python | SubstitutionCodeBlock.run | (self) | return list(CodeBlock.run(self)) | Replace placeholders with given variables. | Replace placeholders with given variables. | [
"Replace",
"placeholders",
"with",
"given",
"variables",
"."
] | def run(self):
"""
Replace placeholders with given variables.
"""
app = self.state.document.settings.env.app
new_content = []
existing_content = self.content
for item in existing_content:
for pair in app.config.substitutions:
original, replacem... | [
"def",
"run",
"(",
"self",
")",
":",
"app",
"=",
"self",
".",
"state",
".",
"document",
".",
"settings",
".",
"env",
".",
"app",
"new_content",
"=",
"[",
"]",
"existing_content",
"=",
"self",
".",
"content",
"for",
"item",
"in",
"existing_content",
":"... | https://github.com/envoyproxy/envoy/blob/65541accdafe255e72310b4298d646e091da2d80/docs/conf.py#L35-L49 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CustomTreeCtrl.IsExpanded | (self, item) | return item.IsExpanded() | Returns whether the item is expanded or not.
:param `item`: an instance of :class:`GenericTreeItem`.
:return: ``True`` if the item is expanded, ``False`` if it is collapsed. | Returns whether the item is expanded or not. | [
"Returns",
"whether",
"the",
"item",
"is",
"expanded",
"or",
"not",
"."
] | def IsExpanded(self, item):
"""
Returns whether the item is expanded or not.
:param `item`: an instance of :class:`GenericTreeItem`.
:return: ``True`` if the item is expanded, ``False`` if it is collapsed.
"""
return item.IsExpanded() | [
"def",
"IsExpanded",
"(",
"self",
",",
"item",
")",
":",
"return",
"item",
".",
"IsExpanded",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L4439-L4448 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/dateutil/dateutil/tz/win.py | python | tzwinbase.transitions | (self, year) | return dston, dstoff | For a given year, get the DST on and off transition times, expressed
always on the standard time side. For zones with no transitions, this
function returns ``None``.
:param year:
The year whose transitions you would like to query.
:return:
Returns a :class:`tupl... | For a given year, get the DST on and off transition times, expressed
always on the standard time side. For zones with no transitions, this
function returns ``None``. | [
"For",
"a",
"given",
"year",
"get",
"the",
"DST",
"on",
"and",
"off",
"transition",
"times",
"expressed",
"always",
"on",
"the",
"standard",
"time",
"side",
".",
"For",
"zones",
"with",
"no",
"transitions",
"this",
"function",
"returns",
"None",
"."
] | def transitions(self, year):
"""
For a given year, get the DST on and off transition times, expressed
always on the standard time side. For zones with no transitions, this
function returns ``None``.
:param year:
The year whose transitions you would like to query.
... | [
"def",
"transitions",
"(",
"self",
",",
"year",
")",
":",
"if",
"not",
"self",
".",
"hasdst",
":",
"return",
"None",
"dston",
"=",
"picknthweekday",
"(",
"year",
",",
"self",
".",
"_dstmonth",
",",
"self",
".",
"_dstdayofweek",
",",
"self",
".",
"_dsth... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/dateutil/dateutil/tz/win.py#L163-L192 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.setWhitespaceChars | ( self, chars ) | return self | Overrides the default whitespace chars | Overrides the default whitespace chars | [
"Overrides",
"the",
"default",
"whitespace",
"chars"
] | def setWhitespaceChars( self, chars ):
"""
Overrides the default whitespace chars
"""
self.skipWhitespace = True
self.whiteChars = chars
self.copyDefaultWhiteChars = False
return self | [
"def",
"setWhitespaceChars",
"(",
"self",
",",
"chars",
")",
":",
"self",
".",
"skipWhitespace",
"=",
"True",
"self",
".",
"whiteChars",
"=",
"chars",
"self",
".",
"copyDefaultWhiteChars",
"=",
"False",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L2061-L2068 | |
svn2github/webrtc | 0e4615a75ed555ec866cd5543bfea586f3385ceb | webrtc/tools/barcode_tools/barcode_encoder.py | python | calculate_frames_number_from_yuv | (yuv_width, yuv_height, file_name) | return int(file_size/frame_size) | Calculates the number of frames of a YUV video.
Args:
yuv_width(int): Width of a frame of the yuv file.
yuv_height(int): Height of a frame of the YUV file.
file_name(string): The name of the YUV file.
Return:
(int): The number of frames in the YUV file. | Calculates the number of frames of a YUV video. | [
"Calculates",
"the",
"number",
"of",
"frames",
"of",
"a",
"YUV",
"video",
"."
] | def calculate_frames_number_from_yuv(yuv_width, yuv_height, file_name):
"""Calculates the number of frames of a YUV video.
Args:
yuv_width(int): Width of a frame of the yuv file.
yuv_height(int): Height of a frame of the YUV file.
file_name(string): The name of the YUV file.
Return:
(int): The nu... | [
"def",
"calculate_frames_number_from_yuv",
"(",
"yuv_width",
",",
"yuv_height",
",",
"file_name",
")",
":",
"file_size",
"=",
"os",
".",
"path",
".",
"getsize",
"(",
"file_name",
")",
"y_plane_size",
"=",
"yuv_width",
"*",
"yuv_height",
"u_plane_size",
"=",
"(",... | https://github.com/svn2github/webrtc/blob/0e4615a75ed555ec866cd5543bfea586f3385ceb/webrtc/tools/barcode_tools/barcode_encoder.py#L243-L258 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.