nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cmd.py | python | Cmd.postloop | (self) | Hook method executed once when the cmdloop() method is about to
return. | Hook method executed once when the cmdloop() method is about to
return. | [
"Hook",
"method",
"executed",
"once",
"when",
"the",
"cmdloop",
"()",
"method",
"is",
"about",
"to",
"return",
"."
] | def postloop(self):
"""Hook method executed once when the cmdloop() method is about to
return.
"""
pass | [
"def",
"postloop",
"(",
"self",
")",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cmd.py#L169-L174 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/keccak.py | python | Keccak_Hash.new | (self, **kwargs) | return new(**kwargs) | Create a fresh Keccak hash object. | Create a fresh Keccak hash object. | [
"Create",
"a",
"fresh",
"Keccak",
"hash",
"object",
"."
] | def new(self, **kwargs):
"""Create a fresh Keccak hash object."""
if "digest_bytes" not in kwargs and "digest_bits" not in kwargs:
kwargs["digest_bytes"] = self.digest_size
return new(**kwargs) | [
"def",
"new",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"\"digest_bytes\"",
"not",
"in",
"kwargs",
"and",
"\"digest_bits\"",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"\"digest_bytes\"",
"]",
"=",
"self",
".",
"digest_size",
"return",
"new",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/keccak.py#L126-L132 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/factorization_ops.py | python | WALSModel.initialize_row_update_op | (self) | return self._row_updates_init | Op to initialize worker state before starting row updates. | Op to initialize worker state before starting row updates. | [
"Op",
"to",
"initialize",
"worker",
"state",
"before",
"starting",
"row",
"updates",
"."
] | def initialize_row_update_op(self):
"""Op to initialize worker state before starting row updates."""
return self._row_updates_init | [
"def",
"initialize_row_update_op",
"(",
"self",
")",
":",
"return",
"self",
".",
"_row_updates_init"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L285-L287 | |
KhronosGroup/Vulkan-Samples | 11a0eeffa223e3c049780fd783900da0bfe50431 | .github/docker/scripts/clang_format.py | python | filter_by_extension | (dictionary, allowed_extensions) | Delete every key in `dictionary` that doesn't have an allowed extension.
`allowed_extensions` must be a collection of lowercase file extensions,
excluding the period. | Delete every key in `dictionary` that doesn't have an allowed extension. | [
"Delete",
"every",
"key",
"in",
"dictionary",
"that",
"doesn",
"t",
"have",
"an",
"allowed",
"extension",
"."
] | def filter_by_extension(dictionary, allowed_extensions):
"""Delete every key in `dictionary` that doesn't have an allowed extension.
`allowed_extensions` must be a collection of lowercase file extensions,
excluding the period."""
allowed_extensions = frozenset(allowed_extensions)
for filename in list(diction... | [
"def",
"filter_by_extension",
"(",
"dictionary",
",",
"allowed_extensions",
")",
":",
"allowed_extensions",
"=",
"frozenset",
"(",
"allowed_extensions",
")",
"for",
"filename",
"in",
"list",
"(",
"dictionary",
".",
"keys",
"(",
")",
")",
":",
"base_ext",
"=",
... | https://github.com/KhronosGroup/Vulkan-Samples/blob/11a0eeffa223e3c049780fd783900da0bfe50431/.github/docker/scripts/clang_format.py#L310-L321 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/inspect.py | python | getmembers | (object, predicate=None) | return results | Return all members of an object as (name, value) pairs sorted by name.
Optionally, only return members that satisfy a given predicate. | Return all members of an object as (name, value) pairs sorted by name.
Optionally, only return members that satisfy a given predicate. | [
"Return",
"all",
"members",
"of",
"an",
"object",
"as",
"(",
"name",
"value",
")",
"pairs",
"sorted",
"by",
"name",
".",
"Optionally",
"only",
"return",
"members",
"that",
"satisfy",
"a",
"given",
"predicate",
"."
] | def getmembers(object, predicate=None):
"""Return all members of an object as (name, value) pairs sorted by name.
Optionally, only return members that satisfy a given predicate."""
results = []
for key in dir(object):
value = getattr(object, key)
if not predicate or predicate(value):
... | [
"def",
"getmembers",
"(",
"object",
",",
"predicate",
"=",
"None",
")",
":",
"results",
"=",
"[",
"]",
"for",
"key",
"in",
"dir",
"(",
"object",
")",
":",
"value",
"=",
"getattr",
"(",
"object",
",",
"key",
")",
"if",
"not",
"predicate",
"or",
"pre... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/inspect.py#L247-L256 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | python | VimPane.get_content | (self, target, controller) | subclasses implement this to provide pane content | subclasses implement this to provide pane content | [
"subclasses",
"implement",
"this",
"to",
"provide",
"pane",
"content"
] | def get_content(self, target, controller):
""" subclasses implement this to provide pane content """
assert(0 and "pane subclass must implement this")
pass | [
"def",
"get_content",
"(",
"self",
",",
"target",
",",
"controller",
")",
":",
"assert",
"(",
"0",
"and",
"\"pane subclass must implement this\"",
")",
"pass"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L388-L391 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests-futures/requests_futures/sessions.py | python | FuturesSession.__init__ | (self, executor=None, max_workers=2, *args, **kwargs) | Creates a FuturesSession
Notes
~~~~~
* ProcessPoolExecutor is not supported b/c Response objects are
not picklable.
* If you provide both `executor` and `max_workers`, the latter is
ignored and provided executor is used as is. | Creates a FuturesSession | [
"Creates",
"a",
"FuturesSession"
] | def __init__(self, executor=None, max_workers=2, *args, **kwargs):
"""Creates a FuturesSession
Notes
~~~~~
* ProcessPoolExecutor is not supported b/c Response objects are
not picklable.
* If you provide both `executor` and `max_workers`, the latter is
ignor... | [
"def",
"__init__",
"(",
"self",
",",
"executor",
"=",
"None",
",",
"max_workers",
"=",
"2",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"FuturesSession",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"args",
",",
"*",
"*",
"... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests-futures/requests_futures/sessions.py#L28-L43 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/utils.py | python | Cycler.next | (self) | return rv | Goes one item ahead and returns it. | Goes one item ahead and returns it. | [
"Goes",
"one",
"item",
"ahead",
"and",
"returns",
"it",
"."
] | def next(self):
"""Goes one item ahead and returns it."""
rv = self.current
self.pos = (self.pos + 1) % len(self.items)
return rv | [
"def",
"next",
"(",
"self",
")",
":",
"rv",
"=",
"self",
".",
"current",
"self",
".",
"pos",
"=",
"(",
"self",
".",
"pos",
"+",
"1",
")",
"%",
"len",
"(",
"self",
".",
"items",
")",
"return",
"rv"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/utils.py#L559-L563 | |
rprichard/CxxCodeBrowser | a2fa83d2fe06119f0a7a1827b8167fab88b53561 | third_party/libre2/lib/codereview/codereview.py | python | MercurialVCS.GetUnknownFiles | (self) | return unknown_files | Return a list of files unknown to the VCS. | Return a list of files unknown to the VCS. | [
"Return",
"a",
"list",
"of",
"files",
"unknown",
"to",
"the",
"VCS",
"."
] | def GetUnknownFiles(self):
"""Return a list of files unknown to the VCS."""
args = []
status = RunShell(["hg", "status", "--rev", self.base_rev, "-u", "."],
silent_ok=True)
unknown_files = []
for line in status.splitlines():
st, fn = line.split(" ", 1)
if st == "?":
unknown_files.append(fn)
re... | [
"def",
"GetUnknownFiles",
"(",
"self",
")",
":",
"args",
"=",
"[",
"]",
"status",
"=",
"RunShell",
"(",
"[",
"\"hg\"",
",",
"\"status\"",
",",
"\"--rev\"",
",",
"self",
".",
"base_rev",
",",
"\"-u\"",
",",
"\".\"",
"]",
",",
"silent_ok",
"=",
"True",
... | https://github.com/rprichard/CxxCodeBrowser/blob/a2fa83d2fe06119f0a7a1827b8167fab88b53561/third_party/libre2/lib/codereview/codereview.py#L3420-L3430 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/base/fleet_base.py | python | Fleet.barrier_worker | (self) | barrier all workers
Returns:
None | barrier all workers | [
"barrier",
"all",
"workers"
] | def barrier_worker(self):
"""
barrier all workers
Returns:
None
"""
self._role_maker._barrier("worker") | [
"def",
"barrier_worker",
"(",
"self",
")",
":",
"self",
".",
"_role_maker",
".",
"_barrier",
"(",
"\"worker\"",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/base/fleet_base.py#L570-L577 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/_channel.py | python | _MultiThreadedRendezvous.details | (self) | See grpc.Call.details | See grpc.Call.details | [
"See",
"grpc",
".",
"Call",
".",
"details"
] | def details(self):
"""See grpc.Call.details"""
with self._state.condition:
def _done():
return self._state.details is not None
_common.wait(self._state.condition.wait, _done)
return _common.decode(self._state.details) | [
"def",
"details",
"(",
"self",
")",
":",
"with",
"self",
".",
"_state",
".",
"condition",
":",
"def",
"_done",
"(",
")",
":",
"return",
"self",
".",
"_state",
".",
"details",
"is",
"not",
"None",
"_common",
".",
"wait",
"(",
"self",
".",
"_state",
... | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/_channel.py#L693-L701 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.stamp | (self) | return stitem | Stamp a copy of the turtleshape onto the canvas and return its id.
No argument.
Stamp a copy of the turtle shape onto the canvas at the current
turtle position. Return a stamp_id for that stamp, which can be
used to delete it by calling clearstamp(stamp_id).
Example (for a Tur... | Stamp a copy of the turtleshape onto the canvas and return its id. | [
"Stamp",
"a",
"copy",
"of",
"the",
"turtleshape",
"onto",
"the",
"canvas",
"and",
"return",
"its",
"id",
"."
] | def stamp(self):
"""Stamp a copy of the turtleshape onto the canvas and return its id.
No argument.
Stamp a copy of the turtle shape onto the canvas at the current
turtle position. Return a stamp_id for that stamp, which can be
used to delete it by calling clearstamp(stamp_id).... | [
"def",
"stamp",
"(",
"self",
")",
":",
"screen",
"=",
"self",
".",
"screen",
"shape",
"=",
"screen",
".",
"_shapes",
"[",
"self",
".",
"turtle",
".",
"shapeIndex",
"]",
"ttype",
"=",
"shape",
".",
"_type",
"tshape",
"=",
"shape",
".",
"_data",
"if",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L2851-L2909 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/array_grad.py | python | _PadGrad | (op, grad) | return array_ops.slice(grad, begin, sizes), None | Gradient for Pad. | Gradient for Pad. | [
"Gradient",
"for",
"Pad",
"."
] | def _PadGrad(op, grad):
"""Gradient for Pad."""
# Pad introduces values around the original tensor, so the gradient function
# slices the original shape out of the gradient."""
x = op.inputs[0]
a = op.inputs[1] # [Rank(x), 2]
# Takes a slice of a. The 1st column. [Rank(x), 1].
pad_before = array_ops.slic... | [
"def",
"_PadGrad",
"(",
"op",
",",
"grad",
")",
":",
"# Pad introduces values around the original tensor, so the gradient function",
"# slices the original shape out of the gradient.\"\"\"",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"a",
"=",
"op",
".",
"inputs",
"[... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/array_grad.py#L367-L379 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | python/ola/OlaClient.py | python | OlaClient.FetchDmx | (self, universe, callback) | return True | Fetch DMX data from the server
Args:
universe: the universe to fetch the data for
callback: The function to call once complete, takes three arguments, a
RequestStatus object, a universe number and a list of dmx data.
Returns:
True if the request was sent, False otherwise. | Fetch DMX data from the server | [
"Fetch",
"DMX",
"data",
"from",
"the",
"server"
] | def FetchDmx(self, universe, callback):
"""Fetch DMX data from the server
Args:
universe: the universe to fetch the data for
callback: The function to call once complete, takes three arguments, a
RequestStatus object, a universe number and a list of dmx data.
Returns:
True if the... | [
"def",
"FetchDmx",
"(",
"self",
",",
"universe",
",",
"callback",
")",
":",
"if",
"self",
".",
"_socket",
"is",
"None",
":",
"return",
"False",
"controller",
"=",
"SimpleRpcController",
"(",
")",
"request",
"=",
"Ola_pb2",
".",
"UniverseRequest",
"(",
")",... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/OlaClient.py#L913-L935 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/signaltools.py | python | vectorstrength | (events, period) | return strength, phase | Determine the vector strength of the events corresponding to the given
period.
The vector strength is a measure of phase synchrony, how well the
timing of the events is synchronized to a single period of a periodic
signal.
If multiple periods are used, calculate the vector strength of each.
Th... | Determine the vector strength of the events corresponding to the given
period. | [
"Determine",
"the",
"vector",
"strength",
"of",
"the",
"events",
"corresponding",
"to",
"the",
"given",
"period",
"."
] | def vectorstrength(events, period):
'''
Determine the vector strength of the events corresponding to the given
period.
The vector strength is a measure of phase synchrony, how well the
timing of the events is synchronized to a single period of a periodic
signal.
If multiple periods are use... | [
"def",
"vectorstrength",
"(",
"events",
",",
"period",
")",
":",
"events",
"=",
"asarray",
"(",
"events",
")",
"period",
"=",
"asarray",
"(",
"period",
")",
"if",
"events",
".",
"ndim",
">",
"1",
":",
"raise",
"ValueError",
"(",
"'events cannot have dimens... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/signaltools.py#L2424-L2499 | |
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/camera.py | python | Camera.get_carla_image_data_array | (self, carla_image) | Virtual function to convert the carla image to a numpy data array
as input for the cv_bridge.cv2_to_imgmsg() function
:param carla_image: carla image object
:type carla_image: carla.Image
:return tuple (numpy data array containing the image information, encoding)
:rtype tuple(nu... | Virtual function to convert the carla image to a numpy data array
as input for the cv_bridge.cv2_to_imgmsg() function | [
"Virtual",
"function",
"to",
"convert",
"the",
"carla",
"image",
"to",
"a",
"numpy",
"data",
"array",
"as",
"input",
"for",
"the",
"cv_bridge",
".",
"cv2_to_imgmsg",
"()",
"function"
] | def get_carla_image_data_array(self, carla_image):
"""
Virtual function to convert the carla image to a numpy data array
as input for the cv_bridge.cv2_to_imgmsg() function
:param carla_image: carla image object
:type carla_image: carla.Image
:return tuple (numpy data ar... | [
"def",
"get_carla_image_data_array",
"(",
"self",
",",
"carla_image",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"This function has to be re-implemented by derived classes\"",
")"
] | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/camera.py#L139-L150 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py | python | evaluate_marker | (text, extra=None) | Evaluate a PEP 508 environment marker.
Return a boolean indicating the marker result in this environment.
Raise SyntaxError if marker is invalid.
This implementation uses the 'pyparsing' module. | Evaluate a PEP 508 environment marker.
Return a boolean indicating the marker result in this environment.
Raise SyntaxError if marker is invalid. | [
"Evaluate",
"a",
"PEP",
"508",
"environment",
"marker",
".",
"Return",
"a",
"boolean",
"indicating",
"the",
"marker",
"result",
"in",
"this",
"environment",
".",
"Raise",
"SyntaxError",
"if",
"marker",
"is",
"invalid",
"."
] | def evaluate_marker(text, extra=None):
"""
Evaluate a PEP 508 environment marker.
Return a boolean indicating the marker result in this environment.
Raise SyntaxError if marker is invalid.
This implementation uses the 'pyparsing' module.
"""
try:
marker = packaging.markers.Marker(te... | [
"def",
"evaluate_marker",
"(",
"text",
",",
"extra",
"=",
"None",
")",
":",
"try",
":",
"marker",
"=",
"packaging",
".",
"markers",
".",
"Marker",
"(",
"text",
")",
"return",
"marker",
".",
"evaluate",
"(",
")",
"except",
"packaging",
".",
"markers",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L1368-L1380 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typeinfer.py | python | TypeInferer.unify | (self, raise_errors=True) | return typdict, retty, fntys | Run the final unification pass over all inferred types, and
catch imprecise types. | Run the final unification pass over all inferred types, and
catch imprecise types. | [
"Run",
"the",
"final",
"unification",
"pass",
"over",
"all",
"inferred",
"types",
"and",
"catch",
"imprecise",
"types",
"."
] | def unify(self, raise_errors=True):
"""
Run the final unification pass over all inferred types, and
catch imprecise types.
"""
typdict = utils.UniqueDict()
def find_offender(name, exhaustive=False):
# finds the offending variable definition by name
... | [
"def",
"unify",
"(",
"self",
",",
"raise_errors",
"=",
"True",
")",
":",
"typdict",
"=",
"utils",
".",
"UniqueDict",
"(",
")",
"def",
"find_offender",
"(",
"name",
",",
"exhaustive",
"=",
"False",
")",
":",
"# finds the offending variable definition by name",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typeinfer.py#L1017-L1144 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_vehicle.py | python | VehicleDomain.requestToC | (self, vehID, leadTime) | requestToC(string, double) -> None
Interface for triggering a transition of control for a vehicle equipped with a ToC device. | requestToC(string, double) -> None | [
"requestToC",
"(",
"string",
"double",
")",
"-",
">",
"None"
] | def requestToC(self, vehID, leadTime):
""" requestToC(string, double) -> None
Interface for triggering a transition of control for a vehicle equipped with a ToC device.
"""
self.setParameter(vehID, "device.toc.requestToC", str(leadTime)) | [
"def",
"requestToC",
"(",
"self",
",",
"vehID",
",",
"leadTime",
")",
":",
"self",
".",
"setParameter",
"(",
"vehID",
",",
"\"device.toc.requestToC\"",
",",
"str",
"(",
"leadTime",
")",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L1196-L1201 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py | python | Body.parse_field_marker | (self, match) | return field | Extract & return field name from a field marker match. | Extract & return field name from a field marker match. | [
"Extract",
"&",
"return",
"field",
"name",
"from",
"a",
"field",
"marker",
"match",
"."
] | def parse_field_marker(self, match):
"""Extract & return field name from a field marker match."""
field = match.group()[1:] # strip off leading ':'
field = field[:field.rfind(':')] # strip off trailing ':' etc.
return field | [
"def",
"parse_field_marker",
"(",
"self",
",",
"match",
")",
":",
"field",
"=",
"match",
".",
"group",
"(",
")",
"[",
"1",
":",
"]",
"# strip off leading ':'",
"field",
"=",
"field",
"[",
":",
"field",
".",
"rfind",
"(",
"':'",
")",
"]",
"# strip off t... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py#L1468-L1472 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py | python | LayerNormBasicLSTMCell.call | (self, inputs, state) | return new_h, new_state | LSTM cell with layer normalization and recurrent dropout. | LSTM cell with layer normalization and recurrent dropout. | [
"LSTM",
"cell",
"with",
"layer",
"normalization",
"and",
"recurrent",
"dropout",
"."
] | def call(self, inputs, state):
"""LSTM cell with layer normalization and recurrent dropout."""
c, h = state
args = array_ops.concat([inputs, h], 1)
concat = self._linear(args)
dtype = args.dtype
i, j, f, o = array_ops.split(value=concat, num_or_size_splits=4, axis=1)
if self._layer_norm:
... | [
"def",
"call",
"(",
"self",
",",
"inputs",
",",
"state",
")",
":",
"c",
",",
"h",
"=",
"state",
"args",
"=",
"array_ops",
".",
"concat",
"(",
"[",
"inputs",
",",
"h",
"]",
",",
"1",
")",
"concat",
"=",
"self",
".",
"_linear",
"(",
"args",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L1438-L1463 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/utils/check_cfc/obj_diff.py | python | disassemble | (objfile) | return [line for line in out.split(os.linesep) if keep_line(line)] | Disassemble object to a file. | Disassemble object to a file. | [
"Disassemble",
"object",
"to",
"a",
"file",
"."
] | def disassemble(objfile):
"""Disassemble object to a file."""
p = subprocess.Popen([disassembler, '-d', objfile],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(out, err) = p.communicate()
if p.returncode or err:
print("Disassemble failed: {}".... | [
"def",
"disassemble",
"(",
"objfile",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"disassembler",
",",
"'-d'",
",",
"objfile",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIPE",
")",
"(",
... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/utils/check_cfc/obj_diff.py#L19-L28 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/rnn.py | python | TensorFlowRNNClassifier.bias_ | (self) | return self.get_variable_value('logistic_regression/bias') | Returns bias of the rnn layer. | Returns bias of the rnn layer. | [
"Returns",
"bias",
"of",
"the",
"rnn",
"layer",
"."
] | def bias_(self):
"""Returns bias of the rnn layer."""
return self.get_variable_value('logistic_regression/bias') | [
"def",
"bias_",
"(",
"self",
")",
":",
"return",
"self",
".",
"get_variable_value",
"(",
"'logistic_regression/bias'",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/rnn.py#L133-L135 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextEvent.GetFlags | (*args, **kwargs) | return _richtext.RichTextEvent_GetFlags(*args, **kwargs) | GetFlags(self) -> int | GetFlags(self) -> int | [
"GetFlags",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFlags(*args, **kwargs):
"""GetFlags(self) -> int"""
return _richtext.RichTextEvent_GetFlags(*args, **kwargs) | [
"def",
"GetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextEvent_GetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4274-L4276 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/forwarder.py | python | Forwarder._InitDeviceLocked | (self, device, tool) | Initializes the device_forwarder daemon for a specific device (once).
Note that the global lock must be acquired before calling this method. This
method kills any existing device_forwarder daemon on the device that could
be stale, pushes the latest version of the daemon (to the device) and starts
it.
... | Initializes the device_forwarder daemon for a specific device (once). | [
"Initializes",
"the",
"device_forwarder",
"daemon",
"for",
"a",
"specific",
"device",
"(",
"once",
")",
"."
] | def _InitDeviceLocked(self, device, tool):
"""Initializes the device_forwarder daemon for a specific device (once).
Note that the global lock must be acquired before calling this method. This
method kills any existing device_forwarder daemon on the device that could
be stale, pushes the latest version ... | [
"def",
"_InitDeviceLocked",
"(",
"self",
",",
"device",
",",
"tool",
")",
":",
"device_serial",
"=",
"str",
"(",
"device",
")",
"if",
"device_serial",
"in",
"self",
".",
"_initialized_devices",
":",
"return",
"Forwarder",
".",
"_KillDeviceLocked",
"(",
"device... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/forwarder.py#L275-L306 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | _extrema_operation.reduce | (self, target, axis=np._NoValue) | return t | Reduce target along the given axis. | Reduce target along the given axis. | [
"Reduce",
"target",
"along",
"the",
"given",
"axis",
"."
] | def reduce(self, target, axis=np._NoValue):
"Reduce target along the given axis."
target = narray(target, copy=False, subok=True)
m = getmask(target)
if axis is np._NoValue and target.ndim > 1:
# 2017-05-06, Numpy 1.13.0: warn on axis default
warnings.warn(
... | [
"def",
"reduce",
"(",
"self",
",",
"target",
",",
"axis",
"=",
"np",
".",
"_NoValue",
")",
":",
"target",
"=",
"narray",
"(",
"target",
",",
"copy",
"=",
"False",
",",
"subok",
"=",
"True",
")",
"m",
"=",
"getmask",
"(",
"target",
")",
"if",
"axi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L6557-L6589 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms_util.py | python | adjust_contrast | (img, contrast_factor) | return img | Adjust contrast of an image.
Args:
img (PIL image): PIL image to be adjusted.
contrast_factor (float): A non negative number indicated the factor by which
the contrast is adjusted. 0 gives a solid gray image, 1 gives the original.
Returns:
img (PIL image), Contrast adjusted... | Adjust contrast of an image. | [
"Adjust",
"contrast",
"of",
"an",
"image",
"."
] | def adjust_contrast(img, contrast_factor):
"""
Adjust contrast of an image.
Args:
img (PIL image): PIL image to be adjusted.
contrast_factor (float): A non negative number indicated the factor by which
the contrast is adjusted. 0 gives a solid gray image, 1 gives the original.
... | [
"def",
"adjust_contrast",
"(",
"img",
",",
"contrast_factor",
")",
":",
"if",
"not",
"is_pil",
"(",
"img",
")",
":",
"raise",
"TypeError",
"(",
"augment_error_message",
".",
"format",
"(",
"type",
"(",
"img",
")",
")",
")",
"enhancer",
"=",
"ImageEnhance",... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms_util.py#L488-L505 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/lineeditor/history.py | python | LineHistory.next_history | (self,current) | Move forward through the history list, fetching the next command. | Move forward through the history list, fetching the next command. | [
"Move",
"forward",
"through",
"the",
"history",
"list",
"fetching",
"the",
"next",
"command",
"."
] | def next_history(self,current): # (C-n)
'''Move forward through the history list, fetching the next command. '''
if self.history_cursor < len(self.history)-1:
self.history_cursor += 1
current.set_line(self.history[self.history_cursor].get_line_text()) | [
"def",
"next_history",
"(",
"self",
",",
"current",
")",
":",
"# (C-n)",
"if",
"self",
".",
"history_cursor",
"<",
"len",
"(",
"self",
".",
"history",
")",
"-",
"1",
":",
"self",
".",
"history_cursor",
"+=",
"1",
"current",
".",
"set_line",
"(",
"self"... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/lineeditor/history.py#L103-L107 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/third_party/jinja2/utils.py | python | object_type_repr | (obj) | return '%s object' % name | Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`). | Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`). | [
"Returns",
"the",
"name",
"of",
"the",
"object",
"s",
"type",
".",
"For",
"some",
"recognized",
"singletons",
"the",
"name",
"of",
"the",
"object",
"is",
"returned",
"instead",
".",
"(",
"For",
"example",
"for",
"None",
"and",
"Ellipsis",
")",
"."
] | def object_type_repr(obj):
"""Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`).
"""
if obj is None:
return 'None'
elif obj is Ellipsis:
return 'Ellipsis'
# __builtin__ in... | [
"def",
"object_type_repr",
"(",
"obj",
")",
":",
"if",
"obj",
"is",
"None",
":",
"return",
"'None'",
"elif",
"obj",
"is",
"Ellipsis",
":",
"return",
"'Ellipsis'",
"# __builtin__ in 2.x, builtins in 3.x",
"if",
"obj",
".",
"__class__",
".",
"__module__",
"in",
... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/utils.py#L157-L171 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/wxPIA_book/Chapter-01/hello.py | python | Frame.__init__ | (self, image, parent=None, id=-1,
pos=wx.DefaultPosition, title='Hello, wxPython!') | Create a Frame instance and display image. | Create a Frame instance and display image. | [
"Create",
"a",
"Frame",
"instance",
"and",
"display",
"image",
"."
] | def __init__(self, image, parent=None, id=-1,
pos=wx.DefaultPosition, title='Hello, wxPython!'):
"""Create a Frame instance and display image."""
temp = image.ConvertToBitmap()
size = temp.GetWidth(), temp.GetHeight()
wx.Frame.__init__(self, parent, id, title, pos, size)... | [
"def",
"__init__",
"(",
"self",
",",
"image",
",",
"parent",
"=",
"None",
",",
"id",
"=",
"-",
"1",
",",
"pos",
"=",
"wx",
".",
"DefaultPosition",
",",
"title",
"=",
"'Hello, wxPython!'",
")",
":",
"temp",
"=",
"image",
".",
"ConvertToBitmap",
"(",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/wxPIA_book/Chapter-01/hello.py#L10-L18 | ||
MRPT/mrpt | b0be3557a4cded6bafff03feb28f7fa1f75762a3 | scripts/clang_git_format/format_code.py | python | ClangRepoFormatter._format_files | (self, files) | Format a list of files with clang-format | Format a list of files with clang-format | [
"Format",
"a",
"list",
"of",
"files",
"with",
"clang",
"-",
"format"
] | def _format_files(self, files):
"""Format a list of files with clang-format
"""
format_clean = parallel_process([os.path.abspath(f) for f in files],
self.clang_format.format_func)
if not format_clean:
logger.error("failed to format fil... | [
"def",
"_format_files",
"(",
"self",
",",
"files",
")",
":",
"format_clean",
"=",
"parallel_process",
"(",
"[",
"os",
".",
"path",
".",
"abspath",
"(",
"f",
")",
"for",
"f",
"in",
"files",
"]",
",",
"self",
".",
"clang_format",
".",
"format_func",
")",... | https://github.com/MRPT/mrpt/blob/b0be3557a4cded6bafff03feb28f7fa1f75762a3/scripts/clang_git_format/format_code.py#L369-L377 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/sandbox.py | python | SandboxedEnvironment.call | (__self, __context, __obj, *args, **kwargs) | return __context.call(__obj, *args, **kwargs) | Call an object from sandboxed code. | Call an object from sandboxed code. | [
"Call",
"an",
"object",
"from",
"sandboxed",
"code",
"."
] | def call(__self, __context, __obj, *args, **kwargs):
"""Call an object from sandboxed code."""
# the double prefixes are to avoid double keyword argument
# errors when proxying the call.
if not __self.is_safe_callable(__obj):
raise SecurityError('%r is not safely callable' % ... | [
"def",
"call",
"(",
"__self",
",",
"__context",
",",
"__obj",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# the double prefixes are to avoid double keyword argument",
"# errors when proxying the call.",
"if",
"not",
"__self",
".",
"is_safe_callable",
"(",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/sandbox.py#L350-L356 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_core.py | python | PlotAccessor.hist | (self, by=None, bins=10, **kwargs) | return self(kind="hist", by=by, bins=bins, **kwargs) | Draw one histogram of the DataFrame's columns.
A histogram is a representation of the distribution of data.
This function groups the values of all given Series in the DataFrame
into bins and draws all bins in one :class:`matplotlib.axes.Axes`.
This is useful when the DataFrame's Series ... | Draw one histogram of the DataFrame's columns. | [
"Draw",
"one",
"histogram",
"of",
"the",
"DataFrame",
"s",
"columns",
"."
] | def hist(self, by=None, bins=10, **kwargs):
"""
Draw one histogram of the DataFrame's columns.
A histogram is a representation of the distribution of data.
This function groups the values of all given Series in the DataFrame
into bins and draws all bins in one :class:`matplotlib... | [
"def",
"hist",
"(",
"self",
",",
"by",
"=",
"None",
",",
"bins",
"=",
"10",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
"(",
"kind",
"=",
"\"hist\"",
",",
"by",
"=",
"by",
",",
"bins",
"=",
"bins",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_core.py#L1268-L1313 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/examples/client_bounding_boxes.py | python | ClientSideBoundingBoxes.get_bounding_box | (vehicle, camera) | return camera_bbox | Returns 3D bounding box for a vehicle based on camera view. | Returns 3D bounding box for a vehicle based on camera view. | [
"Returns",
"3D",
"bounding",
"box",
"for",
"a",
"vehicle",
"based",
"on",
"camera",
"view",
"."
] | def get_bounding_box(vehicle, camera):
"""
Returns 3D bounding box for a vehicle based on camera view.
"""
bb_cords = ClientSideBoundingBoxes._create_bb_points(vehicle)
cords_x_y_z = ClientSideBoundingBoxes._vehicle_to_sensor(bb_cords, vehicle, camera)[:3, :]
cords_y_min... | [
"def",
"get_bounding_box",
"(",
"vehicle",
",",
"camera",
")",
":",
"bb_cords",
"=",
"ClientSideBoundingBoxes",
".",
"_create_bb_points",
"(",
"vehicle",
")",
"cords_x_y_z",
"=",
"ClientSideBoundingBoxes",
".",
"_vehicle_to_sensor",
"(",
"bb_cords",
",",
"vehicle",
... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/client_bounding_boxes.py#L122-L132 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Task.py | python | Task.priority | (self) | return (self.weight + self.prio_order, - getattr(self.generator, 'tg_idx_count', 0)) | Priority of execution; the higher, the earlier
:return: the priority value
:rtype: a tuple of numeric values | Priority of execution; the higher, the earlier | [
"Priority",
"of",
"execution",
";",
"the",
"higher",
"the",
"earlier"
] | def priority(self):
"""
Priority of execution; the higher, the earlier
:return: the priority value
:rtype: a tuple of numeric values
"""
return (self.weight + self.prio_order, - getattr(self.generator, 'tg_idx_count', 0)) | [
"def",
"priority",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"weight",
"+",
"self",
".",
"prio_order",
",",
"-",
"getattr",
"(",
"self",
".",
"generator",
",",
"'tg_idx_count'",
",",
"0",
")",
")"
] | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Task.py#L257-L264 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/http/server.py | python | CGIHTTPRequestHandler.run_cgi | (self) | Execute a CGI script. | Execute a CGI script. | [
"Execute",
"a",
"CGI",
"script",
"."
] | def run_cgi(self):
"""Execute a CGI script."""
dir, rest = self.cgi_info
path = dir + '/' + rest
i = path.find('/', len(dir)+1)
while i >= 0:
nextdir = path[:i]
nextrest = path[i+1:]
scriptdir = self.translate_path(nextdir)
if os.p... | [
"def",
"run_cgi",
"(",
"self",
")",
":",
"dir",
",",
"rest",
"=",
"self",
".",
"cgi_info",
"path",
"=",
"dir",
"+",
"'/'",
"+",
"rest",
"i",
"=",
"path",
".",
"find",
"(",
"'/'",
",",
"len",
"(",
"dir",
")",
"+",
"1",
")",
"while",
"i",
">=",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/server.py#L1027-L1216 | ||
xhzdeng/crpn | a5aef0f80dbe486103123f740c634fb01e6cc9a1 | lib/roi_data_layer/layer.py | python | RoIDataLayer._get_next_minibatch | (self) | Return the blobs to be used for the next minibatch.
If cfg.TRAIN.USE_PREFETCH is True, then blobs will be computed in a
separate process and made available through self._blob_queue. | Return the blobs to be used for the next minibatch. | [
"Return",
"the",
"blobs",
"to",
"be",
"used",
"for",
"the",
"next",
"minibatch",
"."
] | def _get_next_minibatch(self):
"""Return the blobs to be used for the next minibatch.
If cfg.TRAIN.USE_PREFETCH is True, then blobs will be computed in a
separate process and made available through self._blob_queue.
"""
if cfg.TRAIN.USE_PREFETCH:
return self._blob_qu... | [
"def",
"_get_next_minibatch",
"(",
"self",
")",
":",
"if",
"cfg",
".",
"TRAIN",
".",
"USE_PREFETCH",
":",
"return",
"self",
".",
"_blob_queue",
".",
"get",
"(",
")",
"else",
":",
"db_inds",
"=",
"self",
".",
"_get_next_minibatch_inds",
"(",
")",
"minibatch... | https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/lib/roi_data_layer/layer.py#L53-L64 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/handlers.py | python | BaseHandler.result_is_file | (self) | return wrapper is not None and isinstance(self.result,wrapper) | True if 'self.result' is an instance of 'self.wsgi_file_wrapper | True if 'self.result' is an instance of 'self.wsgi_file_wrapper | [
"True",
"if",
"self",
".",
"result",
"is",
"an",
"instance",
"of",
"self",
".",
"wsgi_file_wrapper"
] | def result_is_file(self):
"""True if 'self.result' is an instance of 'self.wsgi_file_wrapper'"""
wrapper = self.wsgi_file_wrapper
return wrapper is not None and isinstance(self.result,wrapper) | [
"def",
"result_is_file",
"(",
"self",
")",
":",
"wrapper",
"=",
"self",
".",
"wsgi_file_wrapper",
"return",
"wrapper",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"self",
".",
"result",
",",
"wrapper",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/handlers.py#L349-L352 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBar.Clear | (*args, **kwargs) | return _aui.AuiToolBar_Clear(*args, **kwargs) | Clear(self) | Clear(self) | [
"Clear",
"(",
"self",
")"
] | def Clear(*args, **kwargs):
"""Clear(self)"""
return _aui.AuiToolBar_Clear(*args, **kwargs) | [
"def",
"Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2074-L2076 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/process.py | python | BaseProcess.exitcode | (self) | return self._popen.poll() | Return exit code of process or `None` if it has yet to stop | Return exit code of process or `None` if it has yet to stop | [
"Return",
"exit",
"code",
"of",
"process",
"or",
"None",
"if",
"it",
"has",
"yet",
"to",
"stop"
] | def exitcode(self):
'''
Return exit code of process or `None` if it has yet to stop
'''
self._check_closed()
if self._popen is None:
return self._popen
return self._popen.poll() | [
"def",
"exitcode",
"(",
"self",
")",
":",
"self",
".",
"_check_closed",
"(",
")",
"if",
"self",
".",
"_popen",
"is",
"None",
":",
"return",
"self",
".",
"_popen",
"return",
"self",
".",
"_popen",
".",
"poll",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/process.py#L216-L223 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/bindings/python/clang/cindex.py | python | Type.element_type | (self) | return result | Retrieve the Type of elements within this Type.
If accessed on a type that is not an array, complex, or vector type, an
exception will be raised. | Retrieve the Type of elements within this Type. | [
"Retrieve",
"the",
"Type",
"of",
"elements",
"within",
"this",
"Type",
"."
] | def element_type(self):
"""Retrieve the Type of elements within this Type.
If accessed on a type that is not an array, complex, or vector type, an
exception will be raised.
"""
result = conf.lib.clang_getElementType(self)
if result.kind == TypeKind.INVALID:
r... | [
"def",
"element_type",
"(",
"self",
")",
":",
"result",
"=",
"conf",
".",
"lib",
".",
"clang_getElementType",
"(",
"self",
")",
"if",
"result",
".",
"kind",
"==",
"TypeKind",
".",
"INVALID",
":",
"raise",
"Exception",
"(",
"'Element type not available on this ... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L2224-L2234 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/linear_model/_coordinate_descent.py | python | ElasticNet._decision_function | (self, X) | Decision function of the linear model
Parameters
----------
X : numpy array or scipy.sparse matrix of shape (n_samples, n_features)
Returns
-------
T : array, shape (n_samples,)
The predicted decision function | Decision function of the linear model | [
"Decision",
"function",
"of",
"the",
"linear",
"model"
] | def _decision_function(self, X):
"""Decision function of the linear model
Parameters
----------
X : numpy array or scipy.sparse matrix of shape (n_samples, n_features)
Returns
-------
T : array, shape (n_samples,)
The predicted decision function
... | [
"def",
"_decision_function",
"(",
"self",
",",
"X",
")",
":",
"check_is_fitted",
"(",
"self",
")",
"if",
"sparse",
".",
"isspmatrix",
"(",
"X",
")",
":",
"return",
"safe_sparse_dot",
"(",
"X",
",",
"self",
".",
"coef_",
".",
"T",
",",
"dense_output",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_coordinate_descent.py#L777-L794 | ||
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/nest/voltage_trace.py | python | from_device | (detec, neurons=None, title=None, grayscale=False,
timeunit="ms") | Plot the membrane potential of a set of neurons recorded by
the given voltmeter or multimeter.
Parameters
----------
detec : list
Global id of voltmeter or multimeter in a list, e.g. [1]
neurons : list, optional
Indices of of neurons to plot
title : str, optional
Plot ti... | Plot the membrane potential of a set of neurons recorded by
the given voltmeter or multimeter. | [
"Plot",
"the",
"membrane",
"potential",
"of",
"a",
"set",
"of",
"neurons",
"recorded",
"by",
"the",
"given",
"voltmeter",
"or",
"multimeter",
"."
] | def from_device(detec, neurons=None, title=None, grayscale=False,
timeunit="ms"):
"""Plot the membrane potential of a set of neurons recorded by
the given voltmeter or multimeter.
Parameters
----------
detec : list
Global id of voltmeter or multimeter in a list, e.g. [1]
... | [
"def",
"from_device",
"(",
"detec",
",",
"neurons",
"=",
"None",
",",
"title",
"=",
"None",
",",
"grayscale",
"=",
"False",
",",
"timeunit",
"=",
"\"ms\"",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"if",
"len",
"(",
"detec",
")",
... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/voltage_trace.py#L128-L224 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | Table.read_coordinates | (
self, where=None, start: Optional[int] = None, stop: Optional[int] = None,
) | return Index(coords) | select coordinates (row numbers) from a table; return the
coordinates object | select coordinates (row numbers) from a table; return the
coordinates object | [
"select",
"coordinates",
"(",
"row",
"numbers",
")",
"from",
"a",
"table",
";",
"return",
"the",
"coordinates",
"object"
] | def read_coordinates(
self, where=None, start: Optional[int] = None, stop: Optional[int] = None,
):
"""select coordinates (row numbers) from a table; return the
coordinates object
"""
# validate the version
self.validate_version(where)
# infer the data kind
... | [
"def",
"read_coordinates",
"(",
"self",
",",
"where",
"=",
"None",
",",
"start",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"stop",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
")",
":",
"# validate the version",
"self",
".",
"validate_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L4014-L4038 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | third_party/toolchains/gpu/find_cuda_config.py | python | _cartesian_product | (first, second) | return [os.path.join(f, s) for f in first for s in second] | Returns all path combinations of first and second. | Returns all path combinations of first and second. | [
"Returns",
"all",
"path",
"combinations",
"of",
"first",
"and",
"second",
"."
] | def _cartesian_product(first, second):
"""Returns all path combinations of first and second."""
return [os.path.join(f, s) for f in first for s in second] | [
"def",
"_cartesian_product",
"(",
"first",
",",
"second",
")",
":",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"f",
",",
"s",
")",
"for",
"f",
"in",
"first",
"for",
"s",
"in",
"second",
"]"
] | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/third_party/toolchains/gpu/find_cuda_config.py#L130-L132 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/parfor.py | python | _lower_parfor_parallel | (lowerer, parfor) | Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the context of the current function.
2) The body of the parfor is transformed into a gufunc func... | Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the context of the current function.
2) The body of the parfor is transformed into a gufunc func... | [
"Lowerer",
"that",
"handles",
"LLVM",
"code",
"generation",
"for",
"parfor",
".",
"This",
"function",
"lowers",
"a",
"parfor",
"IR",
"node",
"to",
"LLVM",
".",
"The",
"general",
"approach",
"is",
"as",
"follows",
":",
"1",
")",
"The",
"code",
"from",
"th... | def _lower_parfor_parallel(lowerer, parfor):
"""Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the context of the current function.
2) The ... | [
"def",
"_lower_parfor_parallel",
"(",
"lowerer",
",",
"parfor",
")",
":",
"from",
".",
"parallel",
"import",
"get_thread_count",
"ensure_parallel_support",
"(",
")",
"typingctx",
"=",
"lowerer",
".",
"context",
".",
"typing_context",
"targetctx",
"=",
"lowerer",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/parfor.py#L37-L427 | ||
Harick1/caffe-yolo | eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3 | python/caffe/coord_map.py | python | coord_map | (fn) | Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis and does not transform coords. | Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis and does not transform coords. | [
"Define",
"the",
"coordinate",
"mapping",
"by",
"its",
"-",
"axis",
"-",
"scale",
":",
"output",
"coord",
"[",
"i",
"*",
"scale",
"]",
"<",
"-",
"input_coord",
"[",
"i",
"]",
"-",
"shift",
":",
"output",
"coord",
"[",
"i",
"]",
"<",
"-",
"output_co... | def coord_map(fn):
"""
Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis a... | [
"def",
"coord_map",
"(",
"fn",
")",
":",
"if",
"fn",
".",
"type_name",
"in",
"[",
"'Convolution'",
",",
"'Pooling'",
",",
"'Im2col'",
"]",
":",
"axis",
",",
"stride",
",",
"ks",
",",
"pad",
"=",
"conv_params",
"(",
"fn",
")",
"return",
"axis",
",",
... | https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/python/caffe/coord_map.py#L57-L79 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sysconfig.py | python | _init_posix | (vars) | Initialize the module as appropriate for POSIX systems. | Initialize the module as appropriate for POSIX systems. | [
"Initialize",
"the",
"module",
"as",
"appropriate",
"for",
"POSIX",
"systems",
"."
] | def _init_posix(vars):
"""Initialize the module as appropriate for POSIX systems."""
# _sysconfigdata is generated at build time, see _generate_posix_vars()
from _sysconfigdata import build_time_vars
vars.update(build_time_vars) | [
"def",
"_init_posix",
"(",
"vars",
")",
":",
"# _sysconfigdata is generated at build time, see _generate_posix_vars()",
"from",
"_sysconfigdata",
"import",
"build_time_vars",
"vars",
".",
"update",
"(",
"build_time_vars",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sysconfig.py#L354-L358 | ||
OPAE/opae-sdk | 221124343c8275243a249eb72d69e0ea2d568d1b | binaries/utilities/vc_rot_convert/extract_rot_image.py | python | main | (input_file, output_file) | Function reads flashh section of input file and
writes that section to a new file | Function reads flashh section of input file and
writes that section to a new file | [
"Function",
"reads",
"flashh",
"section",
"of",
"input",
"file",
"and",
"writes",
"that",
"section",
"to",
"a",
"new",
"file"
] | def main(input_file, output_file):
""" Function reads flashh section of input file and
writes that section to a new file """
LOGGER.info("Reading input file: %s" % input_file)
with open(input_file, "rb") as complete_image_file:
complete_image_file.seek(0, os.SEEK_END)
file_size = co... | [
"def",
"main",
"(",
"input_file",
",",
"output_file",
")",
":",
"LOGGER",
".",
"info",
"(",
"\"Reading input file: %s\"",
"%",
"input_file",
")",
"with",
"open",
"(",
"input_file",
",",
"\"rb\"",
")",
"as",
"complete_image_file",
":",
"complete_image_file",
".",... | https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/binaries/utilities/vc_rot_convert/extract_rot_image.py#L16-L77 | ||
Vipermdl/OCR_detection_IC15 | 8eebd353d6fac97f5832a138d7af3bd3071670db | base/base_trainer.py | python | BaseTrainer._save_checkpoint | (self, epoch, log, save_best=False) | Saving checkpoints
:param epoch: current epoch number
:param log: logging information of the epoch
:param save_best: if True, rename the saved checkpoint to 'model_best.pth.tar' | Saving checkpoints | [
"Saving",
"checkpoints"
] | def _save_checkpoint(self, epoch, log, save_best=False):
"""
Saving checkpoints
:param epoch: current epoch number
:param log: logging information of the epoch
:param save_best: if True, rename the saved checkpoint to 'model_best.pth.tar'
"""
arch = type(self.mod... | [
"def",
"_save_checkpoint",
"(",
"self",
",",
"epoch",
",",
"log",
",",
"save_best",
"=",
"False",
")",
":",
"arch",
"=",
"type",
"(",
"self",
".",
"model",
")",
".",
"__name__",
"state",
"=",
"{",
"'arch'",
":",
"arch",
",",
"'epoch'",
":",
"epoch",
... | https://github.com/Vipermdl/OCR_detection_IC15/blob/8eebd353d6fac97f5832a138d7af3bd3071670db/base/base_trainer.py#L130-L155 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiManager.AddPane | (self, window, info=None, caption=None) | AddPane(self, window, info=None, caption=None) -> bool
AddPane tells the frame manager to start managing a child
window. There are two versions of this function. The first
verison accepts a `PaneInfo` object for the ``info`` parameter
and allows the full spectrum of pane parameter
... | AddPane(self, window, info=None, caption=None) -> bool | [
"AddPane",
"(",
"self",
"window",
"info",
"=",
"None",
"caption",
"=",
"None",
")",
"-",
">",
"bool"
] | def AddPane(self, window, info=None, caption=None):
"""
AddPane(self, window, info=None, caption=None) -> bool
AddPane tells the frame manager to start managing a child
window. There are two versions of this function. The first
verison accepts a `PaneInfo` object for the ``info`... | [
"def",
"AddPane",
"(",
"self",
",",
"window",
",",
"info",
"=",
"None",
",",
"caption",
"=",
"None",
")",
":",
"if",
"type",
"(",
"info",
")",
"==",
"AuiPaneInfo",
":",
"return",
"self",
".",
"_AddPane1",
"(",
"window",
",",
"info",
")",
"else",
":... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L763-L787 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/values.py | python | OnWritePolicy.get_saveable | (self, var, primary_var, name) | return values_util.get_on_write_saveable(var, primary_var, name) | Saveable ops for AUTO variables. | Saveable ops for AUTO variables. | [
"Saveable",
"ops",
"for",
"AUTO",
"variables",
"."
] | def get_saveable(self, var, primary_var, name):
"""Saveable ops for AUTO variables."""
return values_util.get_on_write_saveable(var, primary_var, name) | [
"def",
"get_saveable",
"(",
"self",
",",
"var",
",",
"primary_var",
",",
"name",
")",
":",
"return",
"values_util",
".",
"get_on_write_saveable",
"(",
"var",
",",
"primary_var",
",",
"name",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/values.py#L1741-L1743 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/monitored_session.py | python | _WrappedSession.__init__ | (self, sess) | Creates a `_WrappedSession`.
Args:
sess: A `tf.Session` or `_WrappedSession` object. The wrapped session. | Creates a `_WrappedSession`. | [
"Creates",
"a",
"_WrappedSession",
"."
] | def __init__(self, sess):
"""Creates a `_WrappedSession`.
Args:
sess: A `tf.Session` or `_WrappedSession` object. The wrapped session.
"""
self._sess = sess
self._wrapped_is_stoppable = isinstance(self._sess, _WrappedSession) | [
"def",
"__init__",
"(",
"self",
",",
"sess",
")",
":",
"self",
".",
"_sess",
"=",
"sess",
"self",
".",
"_wrapped_is_stoppable",
"=",
"isinstance",
"(",
"self",
".",
"_sess",
",",
"_WrappedSession",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/monitored_session.py#L506-L513 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/tools/android/build_incremental_dexmanifest.py | python | DexmanifestBuilder.Run | (self, argv) | Creates a dex manifest. | Creates a dex manifest. | [
"Creates",
"a",
"dex",
"manifest",
"."
] | def Run(self, argv):
"""Creates a dex manifest."""
if len(argv) < 1:
raise Exception("At least one argument expected")
if argv[0][0] == "@":
if len(argv) != 1:
raise IOError("A parameter file should be the only argument")
with file(argv[0][1:]) as param_file:
argv = [a.str... | [
"def",
"Run",
"(",
"self",
",",
"argv",
")",
":",
"if",
"len",
"(",
"argv",
")",
"<",
"1",
":",
"raise",
"Exception",
"(",
"\"At least one argument expected\"",
")",
"if",
"argv",
"[",
"0",
"]",
"[",
"0",
"]",
"==",
"\"@\"",
":",
"if",
"len",
"(",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/tools/android/build_incremental_dexmanifest.py#L94-L124 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBProcess_GetInterruptedFromEvent | (*args) | return _lldb.SBProcess_GetInterruptedFromEvent(*args) | SBProcess_GetInterruptedFromEvent(SBEvent event) -> bool | SBProcess_GetInterruptedFromEvent(SBEvent event) -> bool | [
"SBProcess_GetInterruptedFromEvent",
"(",
"SBEvent",
"event",
")",
"-",
">",
"bool"
] | def SBProcess_GetInterruptedFromEvent(*args):
"""SBProcess_GetInterruptedFromEvent(SBEvent event) -> bool"""
return _lldb.SBProcess_GetInterruptedFromEvent(*args) | [
"def",
"SBProcess_GetInterruptedFromEvent",
"(",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBProcess_GetInterruptedFromEvent",
"(",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7487-L7489 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Optimize.assertions | (self) | return AstVector(Z3_optimize_get_assertions(self.ctx.ref(), self.optimize), self.ctx) | Return an AST vector containing all added constraints. | Return an AST vector containing all added constraints. | [
"Return",
"an",
"AST",
"vector",
"containing",
"all",
"added",
"constraints",
"."
] | def assertions(self):
"""Return an AST vector containing all added constraints."""
return AstVector(Z3_optimize_get_assertions(self.ctx.ref(), self.optimize), self.ctx) | [
"def",
"assertions",
"(",
"self",
")",
":",
"return",
"AstVector",
"(",
"Z3_optimize_get_assertions",
"(",
"self",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"self",
".",
"optimize",
")",
",",
"self",
".",
"ctx",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L7961-L7963 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/servermanager.py | python | Proxy.__init__ | (self, **args) | Default constructor. It can be used to initialize properties
by passing keyword arguments where the key is the name of the
property. In addition registrationGroup and registrationName (optional)
can be specified (as keyword arguments) to automatically register
the proxy with the proxy ma... | Default constructor. It can be used to initialize properties
by passing keyword arguments where the key is the name of the
property. In addition registrationGroup and registrationName (optional)
can be specified (as keyword arguments) to automatically register
the proxy with the proxy ma... | [
"Default",
"constructor",
".",
"It",
"can",
"be",
"used",
"to",
"initialize",
"properties",
"by",
"passing",
"keyword",
"arguments",
"where",
"the",
"key",
"is",
"the",
"name",
"of",
"the",
"property",
".",
"In",
"addition",
"registrationGroup",
"and",
"regist... | def __init__(self, **args):
""" Default constructor. It can be used to initialize properties
by passing keyword arguments where the key is the name of the
property. In addition registrationGroup and registrationName (optional)
can be specified (as keyword arguments) to automatically regi... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"args",
")",
":",
"self",
".",
"add_attribute",
"(",
"'Observed'",
",",
"None",
")",
"self",
".",
"add_attribute",
"(",
"'ObserverTag'",
",",
"-",
"1",
")",
"self",
".",
"add_attribute",
"(",
"'_Proxy__Prope... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L253-L297 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/atom.py | python | Atom.canonicalize | (self) | Represent the atom as an affine objective and conic constraints. | Represent the atom as an affine objective and conic constraints. | [
"Represent",
"the",
"atom",
"as",
"an",
"affine",
"objective",
"and",
"conic",
"constraints",
"."
] | def canonicalize(self):
"""Represent the atom as an affine objective and conic constraints.
"""
# Constant atoms are treated as a leaf.
if self.is_constant() and not self.parameters():
# Non-parameterized expressions are evaluated immediately.
return Constant(self... | [
"def",
"canonicalize",
"(",
"self",
")",
":",
"# Constant atoms are treated as a leaf.",
"if",
"self",
".",
"is_constant",
"(",
")",
"and",
"not",
"self",
".",
"parameters",
"(",
")",
":",
"# Non-parameterized expressions are evaluated immediately.",
"return",
"Constant... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/atom.py#L311-L330 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/export/formats/modpack_info.py | python | ModpackInfo.add_dependency | (self, modpack_id) | Add an identifier of another modpack that is a dependency of this modpack.
:param modpack_id: Modpack alias or identifier.
:type modpack_id: str | Add an identifier of another modpack that is a dependency of this modpack. | [
"Add",
"an",
"identifier",
"of",
"another",
"modpack",
"that",
"is",
"a",
"dependency",
"of",
"this",
"modpack",
"."
] | def add_dependency(self, modpack_id):
"""
Add an identifier of another modpack that is a dependency of this modpack.
:param modpack_id: Modpack alias or identifier.
:type modpack_id: str
"""
self.requires.append(modpack_id) | [
"def",
"add_dependency",
"(",
"self",
",",
"modpack_id",
")",
":",
"self",
".",
"requires",
".",
"append",
"(",
"modpack_id",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/export/formats/modpack_info.py#L130-L137 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WriteActions | (self, actions, extra_sources, extra_outputs,
extra_mac_bundle_resources, part_of_all) | Write Makefile code for any 'actions' from the gyp input.
extra_sources: a list that will be filled in with newly generated source
files, if any
extra_outputs: a list that will be filled in with any outputs of these
actions (used to make other pieces dependent on these
... | Write Makefile code for any 'actions' from the gyp input. | [
"Write",
"Makefile",
"code",
"for",
"any",
"actions",
"from",
"the",
"gyp",
"input",
"."
] | def WriteActions(self, actions, extra_sources, extra_outputs,
extra_mac_bundle_resources, part_of_all):
"""Write Makefile code for any 'actions' from the gyp input.
extra_sources: a list that will be filled in with newly generated source
files, if any
extra_outputs: a ... | [
"def",
"WriteActions",
"(",
"self",
",",
"actions",
",",
"extra_sources",
",",
"extra_outputs",
",",
"extra_mac_bundle_resources",
",",
"part_of_all",
")",
":",
"env",
"=",
"self",
".",
"GetSortedXcodeEnv",
"(",
")",
"for",
"action",
"in",
"actions",
":",
"nam... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L888-L985 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/compiler/xla/python/xla_client.py | python | execute_with_python_values_replicated | (executable, arguments, backend) | return [[x.to_py() for x in xs] for xs in zip(*outputs)] | Execute on many replicas with Python values as arguments and output.
Args:
executable: the program to run.
arguments: a list of lists of Python values indexed by `[replica][arg_num]`
to pass as inputs.
backend: the backend we are targeting.
Returns:
A list of python values, one per replica. | Execute on many replicas with Python values as arguments and output. | [
"Execute",
"on",
"many",
"replicas",
"with",
"Python",
"values",
"as",
"arguments",
"and",
"output",
"."
] | def execute_with_python_values_replicated(executable, arguments, backend):
"""Execute on many replicas with Python values as arguments and output.
Args:
executable: the program to run.
arguments: a list of lists of Python values indexed by `[replica][arg_num]`
to pass as inputs.
backend: the back... | [
"def",
"execute_with_python_values_replicated",
"(",
"executable",
",",
"arguments",
",",
"backend",
")",
":",
"devices",
"=",
"executable",
".",
"local_devices",
"(",
")",
"# pylint: disable=g-complex-comprehension",
"def",
"copy_to_devices",
"(",
"pyvals",
")",
":",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/compiler/xla/python/xla_client.py#L317-L337 | |
flexflow/FlexFlow | 581fad8ba8d10a16a3102ee2b406b0319586df24 | python/flexflow/torch/model.py | python | FunctionNode.get_broadcast_shape | (shape1, shape2) | return bc_shape | Returns the tensor shape after broadcasting either ``shape1`` to
``shape2``or vice versa, or returns ``None`` if neither shape can be
broadcast to the other. | Returns the tensor shape after broadcasting either ``shape1`` to
``shape2``or vice versa, or returns ``None`` if neither shape can be
broadcast to the other. | [
"Returns",
"the",
"tensor",
"shape",
"after",
"broadcasting",
"either",
"shape1",
"to",
"shape2",
"or",
"vice",
"versa",
"or",
"returns",
"None",
"if",
"neither",
"shape",
"can",
"be",
"broadcast",
"to",
"the",
"other",
"."
] | def get_broadcast_shape(shape1, shape2):
"""Returns the tensor shape after broadcasting either ``shape1`` to
``shape2``or vice versa, or returns ``None`` if neither shape can be
broadcast to the other."""
# Ensure that `tensor1` has no more dimensions that `tensor2`
if len(shape1... | [
"def",
"get_broadcast_shape",
"(",
"shape1",
",",
"shape2",
")",
":",
"# Ensure that `tensor1` has no more dimensions that `tensor2`",
"if",
"len",
"(",
"shape1",
")",
">",
"len",
"(",
"shape2",
")",
":",
"shape1",
",",
"shape2",
"=",
"shape2",
",",
"shape1",
"b... | https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/python/flexflow/torch/model.py#L1039-L1063 | |
ProgerXP/Notepad2e | 71585758099ec07d61dd14ba806068c0d937efd3 | scintilla/scripts/FileGenerator.py | python | UpdateLineInPlistFile | (path, key, value) | Replace a single string value preceded by 'key' in an XML plist file. | Replace a single string value preceded by 'key' in an XML plist file. | [
"Replace",
"a",
"single",
"string",
"value",
"preceded",
"by",
"key",
"in",
"an",
"XML",
"plist",
"file",
"."
] | def UpdateLineInPlistFile(path, key, value):
"""Replace a single string value preceded by 'key' in an XML plist file.
"""
lines = []
keyCurrent = ""
with codecs.open(path, "rb", "utf-8") as f:
for l in f.readlines():
ls = l.strip()
if ls.startswith("<key>"):
... | [
"def",
"UpdateLineInPlistFile",
"(",
"path",
",",
"key",
",",
"value",
")",
":",
"lines",
"=",
"[",
"]",
"keyCurrent",
"=",
"\"\"",
"with",
"codecs",
".",
"open",
"(",
"path",
",",
"\"rb\"",
",",
"\"utf-8\"",
")",
"as",
"f",
":",
"for",
"l",
"in",
... | https://github.com/ProgerXP/Notepad2e/blob/71585758099ec07d61dd14ba806068c0d937efd3/scintilla/scripts/FileGenerator.py#L140-L157 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/ccompiler.py | python | CCompiler._compile | (self, obj, src, ext, cc_args, extra_postargs, pp_opts) | Compile 'src' to product 'obj'. | Compile 'src' to product 'obj'. | [
"Compile",
"src",
"to",
"product",
"obj",
"."
] | def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
"""Compile 'src' to product 'obj'."""
# A concrete compiler class that does not override compile()
# should implement _compile().
pass | [
"def",
"_compile",
"(",
"self",
",",
"obj",
",",
"src",
",",
"ext",
",",
"cc_args",
",",
"extra_postargs",
",",
"pp_opts",
")",
":",
"# A concrete compiler class that does not override compile()",
"# should implement _compile().",
"pass"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/ccompiler.py#L579-L583 | ||
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declaration.py | python | declaration_t.decl_string | (self) | return self.create_decl_string() | Declaration full name. | Declaration full name. | [
"Declaration",
"full",
"name",
"."
] | def decl_string(self):
"""
Declaration full name.
"""
return self.create_decl_string() | [
"def",
"decl_string",
"(",
"self",
")",
":",
"return",
"self",
".",
"create_decl_string",
"(",
")"
] | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declaration.py#L295-L301 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/stats/_distn_infrastructure.py | python | rv_continuous.nnlf | (self, theta, x) | return self._nnlf(x, *args) + n_log_scale | Return negative loglikelihood function.
Notes
-----
This is ``-sum(log pdf(x, theta), axis=0)`` where `theta` are the
parameters (including loc and scale). | Return negative loglikelihood function. | [
"Return",
"negative",
"loglikelihood",
"function",
"."
] | def nnlf(self, theta, x):
'''Return negative loglikelihood function.
Notes
-----
This is ``-sum(log pdf(x, theta), axis=0)`` where `theta` are the
parameters (including loc and scale).
'''
loc, scale, args = self._unpack_loc_scale(theta)
if not self._argc... | [
"def",
"nnlf",
"(",
"self",
",",
"theta",
",",
"x",
")",
":",
"loc",
",",
"scale",
",",
"args",
"=",
"self",
".",
"_unpack_loc_scale",
"(",
"theta",
")",
"if",
"not",
"self",
".",
"_argcheck",
"(",
"*",
"args",
")",
"or",
"scale",
"<=",
"0",
":",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/_distn_infrastructure.py#L1990-L2005 | |
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/freetype-2.10.0/src/tools/glnames.py | python | filter_glyph_names | ( alist, filter ) | return extras | filter `alist' by taking _out_ all glyph names that are in `filter | filter `alist' by taking _out_ all glyph names that are in `filter | [
"filter",
"alist",
"by",
"taking",
"_out_",
"all",
"glyph",
"names",
"that",
"are",
"in",
"filter"
] | def filter_glyph_names( alist, filter ):
"""filter `alist' by taking _out_ all glyph names that are in `filter'"""
count = 0
extras = []
for name in alist:
try:
filtered_index = filter.index( name )
except:
extras.append( name )
return extras | [
"def",
"filter_glyph_names",
"(",
"alist",
",",
"filter",
")",
":",
"count",
"=",
"0",
"extras",
"=",
"[",
"]",
"for",
"name",
"in",
"alist",
":",
"try",
":",
"filtered_index",
"=",
"filter",
".",
"index",
"(",
"name",
")",
"except",
":",
"extras",
"... | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/freetype-2.10.0/src/tools/glnames.py#L5196-L5208 | |
VowpalWabbit/vowpal_wabbit | 866b8fa88ff85a957c7eb72065ea44518b9ba416 | python/vowpalwabbit/dftovw.py | python | DFtoVW.check_missing_columns_df | (self) | Check if the columns are in the dataframe. | Check if the columns are in the dataframe. | [
"Check",
"if",
"the",
"columns",
"are",
"in",
"the",
"dataframe",
"."
] | def check_missing_columns_df(self):
"""Check if the columns are in the dataframe."""
missing_cols = {}
df_colnames = set(self.df.columns)
# pytype: disable=attribute-error
try:
label_columns = self.label.columns
except AttributeError:
pass
... | [
"def",
"check_missing_columns_df",
"(",
"self",
")",
":",
"missing_cols",
"=",
"{",
"}",
"df_colnames",
"=",
"set",
"(",
"self",
".",
"df",
".",
"columns",
")",
"# pytype: disable=attribute-error",
"try",
":",
"label_columns",
"=",
"self",
".",
"label",
".",
... | https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/dftovw.py#L859-L896 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMT_SIG_SCHEME.toTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def toTpm(self, buf):
""" TpmMarshaller method """
if self.details == None: return
buf.writeShort(self.details.GetUnionSelector())
self.details.toTpm(buf) | [
"def",
"toTpm",
"(",
"self",
",",
"buf",
")",
":",
"if",
"self",
".",
"details",
"==",
"None",
":",
"return",
"buf",
".",
"writeShort",
"(",
"self",
".",
"details",
".",
"GetUnionSelector",
"(",
")",
")",
"self",
".",
"details",
".",
"toTpm",
"(",
... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6630-L6634 | ||
mamedev/mame | 02cd26d37ee11191f3e311e19e805d872cb1e3a4 | scripts/build/png.py | python | Reader.asRGB8 | (self) | return self._as_rescale(self.asRGB, 8) | Return the image data as an RGB pixels with 8-bits per
sample. This is like the :meth:`asRGB` method except that
this method additionally rescales the values so that they
are all between 0 and 255 (8-bit). In the case where the
source image has a bit depth < 8 the transformation preser... | Return the image data as an RGB pixels with 8-bits per
sample. This is like the :meth:`asRGB` method except that
this method additionally rescales the values so that they
are all between 0 and 255 (8-bit). In the case where the
source image has a bit depth < 8 the transformation preser... | [
"Return",
"the",
"image",
"data",
"as",
"an",
"RGB",
"pixels",
"with",
"8",
"-",
"bits",
"per",
"sample",
".",
"This",
"is",
"like",
"the",
":",
"meth",
":",
"asRGB",
"method",
"except",
"that",
"this",
"method",
"additionally",
"rescales",
"the",
"value... | def asRGB8(self):
"""Return the image data as an RGB pixels with 8-bits per
sample. This is like the :meth:`asRGB` method except that
this method additionally rescales the values so that they
are all between 0 and 255 (8-bit). In the case where the
source image has a bit depth ... | [
"def",
"asRGB8",
"(",
"self",
")",
":",
"return",
"self",
".",
"_as_rescale",
"(",
"self",
".",
"asRGB",
",",
"8",
")"
] | https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/scripts/build/png.py#L2149-L2168 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/io/ros.py | python | to_JointState | (robot,q='current',dq='current',effort=None,indices='auto',link_joint_names=None) | return js | Returns a ROS JointState message for a Klamp't robot or controller.
Args:
robot (RobotModel or SimRobotController): the robot
q (str or Config, optional): either 'current', 'commanded', 'sensed',
'actual', None, or a configuration of size robot.numLinks().
'commanded', 'se... | Returns a ROS JointState message for a Klamp't robot or controller. | [
"Returns",
"a",
"ROS",
"JointState",
"message",
"for",
"a",
"Klamp",
"t",
"robot",
"or",
"controller",
"."
] | def to_JointState(robot,q='current',dq='current',effort=None,indices='auto',link_joint_names=None):
"""Returns a ROS JointState message for a Klamp't robot or controller.
Args:
robot (RobotModel or SimRobotController): the robot
q (str or Config, optional): either 'current', 'commanded', 'sense... | [
"def",
"to_JointState",
"(",
"robot",
",",
"q",
"=",
"'current'",
",",
"dq",
"=",
"'current'",
",",
"effort",
"=",
"None",
",",
"indices",
"=",
"'auto'",
",",
"link_joint_names",
"=",
"None",
")",
":",
"from",
"klampt",
".",
"robotsim",
"import",
"SimRob... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/ros.py#L134-L229 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/fields.py | python | RequestField.render_headers | (self) | return u"\r\n".join(lines) | Renders the headers for this request field. | Renders the headers for this request field. | [
"Renders",
"the",
"headers",
"for",
"this",
"request",
"field",
"."
] | def render_headers(self):
"""
Renders the headers for this request field.
"""
lines = []
sort_keys = ["Content-Disposition", "Content-Type", "Content-Location"]
for sort_key in sort_keys:
if self.headers.get(sort_key, False):
lines.append(u"%s... | [
"def",
"render_headers",
"(",
"self",
")",
":",
"lines",
"=",
"[",
"]",
"sort_keys",
"=",
"[",
"\"Content-Disposition\"",
",",
"\"Content-Type\"",
",",
"\"Content-Location\"",
"]",
"for",
"sort_key",
"in",
"sort_keys",
":",
"if",
"self",
".",
"headers",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/fields.py#L229-L246 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PageSetupDialogData.GetMarginBottomRight | (*args, **kwargs) | return _windows_.PageSetupDialogData_GetMarginBottomRight(*args, **kwargs) | GetMarginBottomRight(self) -> Point | GetMarginBottomRight(self) -> Point | [
"GetMarginBottomRight",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetMarginBottomRight(*args, **kwargs):
"""GetMarginBottomRight(self) -> Point"""
return _windows_.PageSetupDialogData_GetMarginBottomRight(*args, **kwargs) | [
"def",
"GetMarginBottomRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_GetMarginBottomRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L4926-L4928 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bdb.py | python | Bdb.set_next | (self, frame) | Stop on the next line in or below the given frame. | Stop on the next line in or below the given frame. | [
"Stop",
"on",
"the",
"next",
"line",
"in",
"or",
"below",
"the",
"given",
"frame",
"."
] | def set_next(self, frame):
"""Stop on the next line in or below the given frame."""
self._set_stopinfo(frame, None) | [
"def",
"set_next",
"(",
"self",
",",
"frame",
")",
":",
"self",
".",
"_set_stopinfo",
"(",
"frame",
",",
"None",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bdb.py#L204-L206 | ||
OGRECave/ogre-next | 287307980e6de8910f04f3cc0994451b075071fd | Tools/BlenderExport/ogrepkg/gui.py | python | SliderView.__init__ | (self, parent, size, model, title=ValueModel(''), tooltip=None) | return | Constructor.
@param model BoundedValueModel. | Constructor. | [
"Constructor",
"."
] | def __init__(self, parent, size, model, title=ValueModel(''), tooltip=None):
"""Constructor.
@param model BoundedValueModel.
"""
ActionView.__init__(self, model)
ActionTitleWidget.__init__(self, parent, size, StringView.ViewAction(self), title, tooltip)
return | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"size",
",",
"model",
",",
"title",
"=",
"ValueModel",
"(",
"''",
")",
",",
"tooltip",
"=",
"None",
")",
":",
"ActionView",
".",
"__init__",
"(",
"self",
",",
"model",
")",
"ActionTitleWidget",
".",
... | https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/gui.py#L897-L904 | |
CleverRaven/Cataclysm-DDA | 03e7363df0835ec1b39da973ea29f26f27833b38 | tools/generate_changelog.py | python | CommitApi.get_commit_list | (self, min_commit_dttm, max_commit_dttm,
branch='master', max_threads=15) | return (commit for commit in results_queue
if commit.committed_after(min_commit_dttm) and
commit.committed_before(max_commit_dttm)) | Return a list of Commits from specified commit date up to now. Order
is not guaranteed by threads.
params:
min_commit_dttm = None or minimum commit date to be part of the
result set (UTC+0 timezone)
max_commit_dttm = None or maximum commit date to... | Return a list of Commits from specified commit date up to now. Order
is not guaranteed by threads. | [
"Return",
"a",
"list",
"of",
"Commits",
"from",
"specified",
"commit",
"date",
"up",
"to",
"now",
".",
"Order",
"is",
"not",
"guaranteed",
"by",
"threads",
"."
] | def get_commit_list(self, min_commit_dttm, max_commit_dttm,
branch='master', max_threads=15):
"""Return a list of Commits from specified commit date up to now. Order
is not guaranteed by threads.
params:
min_commit_dttm = None or minimum commit date t... | [
"def",
"get_commit_list",
"(",
"self",
",",
"min_commit_dttm",
",",
"max_commit_dttm",
",",
"branch",
"=",
"'master'",
",",
"max_threads",
"=",
"15",
")",
":",
"if",
"min_commit_dttm",
"is",
"None",
":",
"min_commit_dttm",
"=",
"datetime",
".",
"min",
"if",
... | https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/generate_changelog.py#L516-L543 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/module/sequential_module.py | python | SequentialModule.output_shapes | (self) | return self._modules[-1].output_shapes | Gets output shapes.
Returns
-------
list
A list of `(name, shape)` pairs. The output shapes of the last
module is the output shape of a `SequentialModule`. | Gets output shapes. | [
"Gets",
"output",
"shapes",
"."
] | def output_shapes(self):
"""Gets output shapes.
Returns
-------
list
A list of `(name, shape)` pairs. The output shapes of the last
module is the output shape of a `SequentialModule`.
"""
assert self.binded
return self._modules[-1].output_... | [
"def",
"output_shapes",
"(",
"self",
")",
":",
"assert",
"self",
".",
"binded",
"return",
"self",
".",
"_modules",
"[",
"-",
"1",
"]",
".",
"output_shapes"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/sequential_module.py#L141-L151 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsContext.PushState | (*args, **kwargs) | return _gdi_.GraphicsContext_PushState(*args, **kwargs) | PushState(self)
Push the current state of the context, (ie the transformation matrix)
on a stack | PushState(self) | [
"PushState",
"(",
"self",
")"
] | def PushState(*args, **kwargs):
"""
PushState(self)
Push the current state of the context, (ie the transformation matrix)
on a stack
"""
return _gdi_.GraphicsContext_PushState(*args, **kwargs) | [
"def",
"PushState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_PushState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6159-L6166 | |
NVlabs/fermat | 06e8c03ac59ab440cbb13897f90631ef1861e769 | contrib/assimp-4.1.0/port/PyAssimp/scripts/transformations.py | python | shear_matrix | (angle, direction, point, normal) | return M | Return matrix to shear by angle along direction vector on shear plane.
The shear plane is defined by a point and normal vector. The direction
vector must be orthogonal to the plane's normal vector.
A point P is transformed by the shear matrix into P" such that
the vector P-P" is parallel to the direct... | Return matrix to shear by angle along direction vector on shear plane. | [
"Return",
"matrix",
"to",
"shear",
"by",
"angle",
"along",
"direction",
"vector",
"on",
"shear",
"plane",
"."
] | def shear_matrix(angle, direction, point, normal):
"""Return matrix to shear by angle along direction vector on shear plane.
The shear plane is defined by a point and normal vector. The direction
vector must be orthogonal to the plane's normal vector.
A point P is transformed by the shear matrix into ... | [
"def",
"shear_matrix",
"(",
"angle",
",",
"direction",
",",
"point",
",",
"normal",
")",
":",
"normal",
"=",
"unit_vector",
"(",
"normal",
"[",
":",
"3",
"]",
")",
"direction",
"=",
"unit_vector",
"(",
"direction",
"[",
":",
"3",
"]",
")",
"if",
"abs... | https://github.com/NVlabs/fermat/blob/06e8c03ac59ab440cbb13897f90631ef1861e769/contrib/assimp-4.1.0/port/PyAssimp/scripts/transformations.py#L624-L652 | |
KhronosGroup/Vulkan-Headers | b32da5329b50e3cb96229aaecba9ded032fe29cc | registry/generator.py | python | OutputGenerator.makeCDecls | (self, cmd) | return [pdecl + indentdecl, tdecl + paramdecl] | Return C prototype and function pointer typedef for a
`<command>` Element, as a two-element list of strings.
- cmd - Element containing a `<command>` tag | Return C prototype and function pointer typedef for a
`<command>` Element, as a two-element list of strings. | [
"Return",
"C",
"prototype",
"and",
"function",
"pointer",
"typedef",
"for",
"a",
"<command",
">",
"Element",
"as",
"a",
"two",
"-",
"element",
"list",
"of",
"strings",
"."
] | def makeCDecls(self, cmd):
"""Return C prototype and function pointer typedef for a
`<command>` Element, as a two-element list of strings.
- cmd - Element containing a `<command>` tag"""
proto = cmd.find('proto')
params = cmd.findall('param')
# Begin accumulating prototy... | [
"def",
"makeCDecls",
"(",
"self",
",",
"cmd",
")",
":",
"proto",
"=",
"cmd",
".",
"find",
"(",
"'proto'",
")",
"params",
"=",
"cmd",
".",
"findall",
"(",
"'param'",
")",
"# Begin accumulating prototype and typedef strings",
"pdecl",
"=",
"self",
".",
"genOpt... | https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/generator.py#L1135-L1218 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Coverage.py | python | Plugin._read_source_lines | (self, c_file, sourcefile) | return self._c_files_map[sourcefile][1:] | Parse a Cython generated C/C++ source file and find the executable lines.
Each executable line starts with a comment header that states source file
and line number, as well as the surrounding range of source code lines. | Parse a Cython generated C/C++ source file and find the executable lines.
Each executable line starts with a comment header that states source file
and line number, as well as the surrounding range of source code lines. | [
"Parse",
"a",
"Cython",
"generated",
"C",
"/",
"C",
"++",
"source",
"file",
"and",
"find",
"the",
"executable",
"lines",
".",
"Each",
"executable",
"line",
"starts",
"with",
"a",
"comment",
"header",
"that",
"states",
"source",
"file",
"and",
"line",
"numb... | def _read_source_lines(self, c_file, sourcefile):
"""
Parse a Cython generated C/C++ source file and find the executable lines.
Each executable line starts with a comment header that states source file
and line number, as well as the surrounding range of source code lines.
"""
... | [
"def",
"_read_source_lines",
"(",
"self",
",",
"c_file",
",",
"sourcefile",
")",
":",
"if",
"self",
".",
"_parsed_c_files",
"is",
"None",
":",
"self",
".",
"_parsed_c_files",
"=",
"{",
"}",
"if",
"c_file",
"in",
"self",
".",
"_parsed_c_files",
":",
"code_l... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Coverage.py#L206-L230 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/odr/odrpack.py | python | _conv | (obj, dtype=None) | Convert an object to the preferred form for input to the odr routine. | Convert an object to the preferred form for input to the odr routine. | [
"Convert",
"an",
"object",
"to",
"the",
"preferred",
"form",
"for",
"input",
"to",
"the",
"odr",
"routine",
"."
] | def _conv(obj, dtype=None):
""" Convert an object to the preferred form for input to the odr routine.
"""
if obj is None:
return obj
else:
if dtype is None:
obj = numpy.asarray(obj)
else:
obj = numpy.asarray(obj, dtype)
if obj.shape == ():
... | [
"def",
"_conv",
"(",
"obj",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"obj",
"is",
"None",
":",
"return",
"obj",
"else",
":",
"if",
"dtype",
"is",
"None",
":",
"obj",
"=",
"numpy",
".",
"asarray",
"(",
"obj",
")",
"else",
":",
"obj",
"=",
"num... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/odr/odrpack.py#L86-L101 | ||
ouster-lidar/ouster_example | 13ea8e8b8a4951fb630dbc9108666995c8443bf6 | python/src/ouster/sdk/examples/pcap.py | python | pcap_read_packets | (
source: client.PacketSource,
metadata: client.SensorInfo,
num: int = 0 # not used in this example
) | Basic read packets example from pcap file. | Basic read packets example from pcap file. | [
"Basic",
"read",
"packets",
"example",
"from",
"pcap",
"file",
"."
] | def pcap_read_packets(
source: client.PacketSource,
metadata: client.SensorInfo,
num: int = 0 # not used in this example
) -> None:
"""Basic read packets example from pcap file. """
# [doc-stag-pcap-read-packets]
for packet in source:
if isinstance(packet, client.LidarPacket... | [
"def",
"pcap_read_packets",
"(",
"source",
":",
"client",
".",
"PacketSource",
",",
"metadata",
":",
"client",
".",
"SensorInfo",
",",
"num",
":",
"int",
"=",
"0",
"# not used in this example",
")",
"->",
"None",
":",
"# [doc-stag-pcap-read-packets]",
"for",
"pa... | https://github.com/ouster-lidar/ouster_example/blob/13ea8e8b8a4951fb630dbc9108666995c8443bf6/python/src/ouster/sdk/examples/pcap.py#L283-L304 | ||
google/filament | d21f092645b8e1e312307cbf89f1484891347c63 | third_party/spirv-tools/utils/update_build_version.py | python | deduce_software_version | (directory) | Returns a software version number parsed from the CHANGES file
in the given directory.
The CHANGES file describes most recent versions first. | Returns a software version number parsed from the CHANGES file
in the given directory. | [
"Returns",
"a",
"software",
"version",
"number",
"parsed",
"from",
"the",
"CHANGES",
"file",
"in",
"the",
"given",
"directory",
"."
] | def deduce_software_version(directory):
"""Returns a software version number parsed from the CHANGES file
in the given directory.
The CHANGES file describes most recent versions first.
"""
# Match the first well-formed version-and-date line.
# Allow trailing whitespace in the checked-out sourc... | [
"def",
"deduce_software_version",
"(",
"directory",
")",
":",
"# Match the first well-formed version-and-date line.",
"# Allow trailing whitespace in the checked-out source code has",
"# unexpected carriage returns on a linefeed-only system such as",
"# Linux.",
"pattern",
"=",
"re",
".",
... | https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/spirv-tools/utils/update_build_version.py#L76-L94 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py | python | Notebook.select | (self, tab_id=None) | return self.tk.call(self._w, "select", tab_id) | Selects the specified tab.
The associated child window will be displayed, and the
previously-selected window (if different) is unmapped. If tab_id
is omitted, returns the widget name of the currently selected
pane. | Selects the specified tab. | [
"Selects",
"the",
"specified",
"tab",
"."
] | def select(self, tab_id=None):
"""Selects the specified tab.
The associated child window will be displayed, and the
previously-selected window (if different) is unmapped. If tab_id
is omitted, returns the widget name of the currently selected
pane."""
return self.tk.call... | [
"def",
"select",
"(",
"self",
",",
"tab_id",
"=",
"None",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"select\"",
",",
"tab_id",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py#L878-L885 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py | python | is_device_memory | (obj) | return getattr(obj, '__cuda_memory__', False) | All CUDA memory object is recognized as an instance with the attribute
"__cuda_memory__" defined and its value evaluated to True.
All CUDA memory object should also define an attribute named
"device_pointer" which value is an int(or long) object carrying the pointer
value of the device memory address. ... | All CUDA memory object is recognized as an instance with the attribute
"__cuda_memory__" defined and its value evaluated to True. | [
"All",
"CUDA",
"memory",
"object",
"is",
"recognized",
"as",
"an",
"instance",
"with",
"the",
"attribute",
"__cuda_memory__",
"defined",
"and",
"its",
"value",
"evaluated",
"to",
"True",
"."
] | def is_device_memory(obj):
"""All CUDA memory object is recognized as an instance with the attribute
"__cuda_memory__" defined and its value evaluated to True.
All CUDA memory object should also define an attribute named
"device_pointer" which value is an int(or long) object carrying the pointer
va... | [
"def",
"is_device_memory",
"(",
"obj",
")",
":",
"return",
"getattr",
"(",
"obj",
",",
"'__cuda_memory__'",
",",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1857-L1865 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/fitting/plotting/plot_view.py | python | FittingPlotView.fit_toggle | (self) | Toggle fit browser and tool on/off | Toggle fit browser and tool on/off | [
"Toggle",
"fit",
"browser",
"and",
"tool",
"on",
"/",
"off"
] | def fit_toggle(self):
"""Toggle fit browser and tool on/off"""
if self.fit_browser.isVisible():
self.fit_browser.hide()
else:
self.fit_browser.show() | [
"def",
"fit_toggle",
"(",
"self",
")",
":",
"if",
"self",
".",
"fit_browser",
".",
"isVisible",
"(",
")",
":",
"self",
".",
"fit_browser",
".",
"hide",
"(",
")",
"else",
":",
"self",
".",
"fit_browser",
".",
"show",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/fitting/plotting/plot_view.py#L114-L119 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py | python | Manifest.__init__ | (self, base=None) | Initialise an instance.
:param base: The base directory to explore under. | Initialise an instance. | [
"Initialise",
"an",
"instance",
"."
] | def __init__(self, base=None):
"""
Initialise an instance.
:param base: The base directory to explore under.
"""
self.base = os.path.abspath(os.path.normpath(base or os.getcwd()))
self.prefix = self.base + os.sep
self.allfiles = None
self.files = set() | [
"def",
"__init__",
"(",
"self",
",",
"base",
"=",
"None",
")",
":",
"self",
".",
"base",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"normpath",
"(",
"base",
"or",
"os",
".",
"getcwd",
"(",
")",
")",
")",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py#L42-L51 | ||
arkenthera/electron-vibrancy | 383153ef9ccb23a6c7517150d6bb0794dff3115e | scripts/cpplint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L1618-L1633 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/attrs/attr/filters.py | python | _split_what | (what) | return (
frozenset(cls for cls in what if isclass(cls)),
frozenset(cls for cls in what if isinstance(cls, Attribute)),
) | Returns a tuple of `frozenset`s of classes and attributes. | Returns a tuple of `frozenset`s of classes and attributes. | [
"Returns",
"a",
"tuple",
"of",
"frozenset",
"s",
"of",
"classes",
"and",
"attributes",
"."
] | def _split_what(what):
"""
Returns a tuple of `frozenset`s of classes and attributes.
"""
return (
frozenset(cls for cls in what if isclass(cls)),
frozenset(cls for cls in what if isinstance(cls, Attribute)),
) | [
"def",
"_split_what",
"(",
"what",
")",
":",
"return",
"(",
"frozenset",
"(",
"cls",
"for",
"cls",
"in",
"what",
"if",
"isclass",
"(",
"cls",
")",
")",
",",
"frozenset",
"(",
"cls",
"for",
"cls",
"in",
"what",
"if",
"isinstance",
"(",
"cls",
",",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/filters.py#L11-L18 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CommandTreeEvent.GetKeyEvent | (self) | return self._evtKey | Returns the keyboard data (for ``EVT_TREE_KEY_DOWN`` event only).
:return: An instance of :class:`KeyEvent`. | Returns the keyboard data (for ``EVT_TREE_KEY_DOWN`` event only). | [
"Returns",
"the",
"keyboard",
"data",
"(",
"for",
"EVT_TREE_KEY_DOWN",
"event",
"only",
")",
"."
] | def GetKeyEvent(self):
"""
Returns the keyboard data (for ``EVT_TREE_KEY_DOWN`` event only).
:return: An instance of :class:`KeyEvent`.
"""
return self._evtKey | [
"def",
"GetKeyEvent",
"(",
"self",
")",
":",
"return",
"self",
".",
"_evtKey"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L1081-L1088 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | Node.build | (self, **kw) | Actually build the node.
This is called by the Taskmaster after it's decided that the
Node is out-of-date and must be rebuilt, and after the prepare()
method has gotten everything, uh, prepared.
This method is called from multiple threads in a parallel build,
so only do thread ... | Actually build the node. | [
"Actually",
"build",
"the",
"node",
"."
] | def build(self, **kw):
"""Actually build the node.
This is called by the Taskmaster after it's decided that the
Node is out-of-date and must be rebuilt, and after the prepare()
method has gotten everything, uh, prepared.
This method is called from multiple threads in a parallel... | [
"def",
"build",
"(",
"self",
",",
"*",
"*",
"kw",
")",
":",
"try",
":",
"self",
".",
"get_executor",
"(",
")",
"(",
"self",
",",
"*",
"*",
"kw",
")",
"except",
"SCons",
".",
"Errors",
".",
"BuildError",
",",
"e",
":",
"e",
".",
"node",
"=",
"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L726-L742 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ensurepip/__init__.py | python | _bootstrap | (*, root=None, upgrade=False, user=False,
altinstall=False, default_pip=False,
verbosity=0) | Bootstrap pip into the current Python installation (or the given root
directory). Returns pip command status code.
Note that calling this function will alter both sys.path and os.environ. | Bootstrap pip into the current Python installation (or the given root
directory). Returns pip command status code. | [
"Bootstrap",
"pip",
"into",
"the",
"current",
"Python",
"installation",
"(",
"or",
"the",
"given",
"root",
"directory",
")",
".",
"Returns",
"pip",
"command",
"status",
"code",
"."
] | def _bootstrap(*, root=None, upgrade=False, user=False,
altinstall=False, default_pip=False,
verbosity=0):
"""
Bootstrap pip into the current Python installation (or the given root
directory). Returns pip command status code.
Note that calling this function will alter both s... | [
"def",
"_bootstrap",
"(",
"*",
",",
"root",
"=",
"None",
",",
"upgrade",
"=",
"False",
",",
"user",
"=",
"False",
",",
"altinstall",
"=",
"False",
",",
"default_pip",
"=",
"False",
",",
"verbosity",
"=",
"0",
")",
":",
"if",
"altinstall",
"and",
"def... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ensurepip/__init__.py#L74-L127 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Canvas.create_polygon | (self, *args, **kw) | return self._create('polygon', args, kw) | Create polygon with coordinates x1,y1,...,xn,yn. | Create polygon with coordinates x1,y1,...,xn,yn. | [
"Create",
"polygon",
"with",
"coordinates",
"x1",
"y1",
"...",
"xn",
"yn",
"."
] | def create_polygon(self, *args, **kw):
"""Create polygon with coordinates x1,y1,...,xn,yn."""
return self._create('polygon', args, kw) | [
"def",
"create_polygon",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_create",
"(",
"'polygon'",
",",
"args",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2267-L2269 | |
microsoft/LightGBM | 904b2d5158703c4900b68008617951dd2f9ff21b | python-package/lightgbm/plotting.py | python | create_tree_digraph | (
booster: Union[Booster, LGBMModel],
tree_index: int = 0,
show_info: Optional[List[str]] = None,
precision: Optional[int] = 3,
orientation: str = 'horizontal',
**kwargs: Any
) | return graph | Create a digraph representation of specified tree.
Each node in the graph represents a node in the tree.
Non-leaf nodes have labels like ``Column_10 <= 875.9``, which means
"this node splits on the feature named "Column_10", with threshold 875.9".
Leaf nodes have labels like ``leaf 2: 0.422``, which ... | Create a digraph representation of specified tree. | [
"Create",
"a",
"digraph",
"representation",
"of",
"specified",
"tree",
"."
] | def create_tree_digraph(
booster: Union[Booster, LGBMModel],
tree_index: int = 0,
show_info: Optional[List[str]] = None,
precision: Optional[int] = 3,
orientation: str = 'horizontal',
**kwargs: Any
) -> Any:
"""Create a digraph representation of specified tree.
Each node in the graph re... | [
"def",
"create_tree_digraph",
"(",
"booster",
":",
"Union",
"[",
"Booster",
",",
"LGBMModel",
"]",
",",
"tree_index",
":",
"int",
"=",
"0",
",",
"show_info",
":",
"Optional",
"[",
"List",
"[",
"str",
"]",
"]",
"=",
"None",
",",
"precision",
":",
"Optio... | https://github.com/microsoft/LightGBM/blob/904b2d5158703c4900b68008617951dd2f9ff21b/python-package/lightgbm/plotting.py#L520-L600 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_dafny_grammar.py | python | p_lvalues_lvalues_lvalue | (p) | lvalues : lvalues COMMA lvalue | lvalues : lvalues COMMA lvalue | [
"lvalues",
":",
"lvalues",
"COMMA",
"lvalue"
] | def p_lvalues_lvalues_lvalue(p):
'lvalues : lvalues COMMA lvalue'
p[0] = p[1]
p[0].append(p[3]) | [
"def",
"p_lvalues_lvalues_lvalue",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"p",
"[",
"0",
"]",
".",
"append",
"(",
"p",
"[",
"3",
"]",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_dafny_grammar.py#L245-L248 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py | python | Event.synchronize | (self) | Synchronize the host thread for the completion of the event. | Synchronize the host thread for the completion of the event. | [
"Synchronize",
"the",
"host",
"thread",
"for",
"the",
"completion",
"of",
"the",
"event",
"."
] | def synchronize(self):
"""
Synchronize the host thread for the completion of the event.
"""
driver.cuEventSynchronize(self.handle) | [
"def",
"synchronize",
"(",
"self",
")",
":",
"driver",
".",
"cuEventSynchronize",
"(",
"self",
".",
"handle",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1467-L1471 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGMultiButton.Add | (*args, **kwargs) | return _propgrid.PGMultiButton_Add(*args, **kwargs) | Add(self, String label, int id=-2) | Add(self, String label, int id=-2) | [
"Add",
"(",
"self",
"String",
"label",
"int",
"id",
"=",
"-",
"2",
")"
] | def Add(*args, **kwargs):
"""Add(self, String label, int id=-2)"""
return _propgrid.PGMultiButton_Add(*args, **kwargs) | [
"def",
"Add",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGMultiButton_Add",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2838-L2840 | |
usdot-fhwa-stol/carma-platform | d9d9b93f9689b2c7dd607cf5432d5296fc1000f5 | guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py | python | GuidancePluginValidator.conduct_node_validation | (self) | return | Call appropriate member functions to conduct validation of node communication interfaces. | Call appropriate member functions to conduct validation of node communication interfaces. | [
"Call",
"appropriate",
"member",
"functions",
"to",
"conduct",
"validation",
"of",
"node",
"communication",
"interfaces",
"."
] | def conduct_node_validation(self):
"""
Call appropriate member functions to conduct validation of node communication interfaces.
"""
rospy.loginfo("Beginning validation checks for node subscriptions, publications, and advertised services")
self.validate_strategic_plugins()
... | [
"def",
"conduct_node_validation",
"(",
"self",
")",
":",
"rospy",
".",
"loginfo",
"(",
"\"Beginning validation checks for node subscriptions, publications, and advertised services\"",
")",
"self",
".",
"validate_strategic_plugins",
"(",
")",
"self",
".",
"validate_tactical_plug... | https://github.com/usdot-fhwa-stol/carma-platform/blob/d9d9b93f9689b2c7dd607cf5432d5296fc1000f5/guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py#L284-L297 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/environment.py | python | Environment.compile_templates | (self, target, extensions=None, filter_func=None,
zip='deflated', log_function=None,
ignore_errors=True, py_compile=False) | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'... | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'... | [
"Finds",
"all",
"the",
"templates",
"the",
"loader",
"can",
"find",
"compiles",
"them",
"and",
"stores",
"them",
"in",
"target",
".",
"If",
"zip",
"is",
"None",
"instead",
"of",
"in",
"a",
"zipfile",
"the",
"templates",
"will",
"be",
"stored",
"in",
"a",... | def compile_templates(self, target, extensions=None, filter_func=None,
zip='deflated', log_function=None,
ignore_errors=True, py_compile=False):
"""Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `No... | [
"def",
"compile_templates",
"(",
"self",
",",
"target",
",",
"extensions",
"=",
"None",
",",
"filter_func",
"=",
"None",
",",
"zip",
"=",
"'deflated'",
",",
"log_function",
"=",
"None",
",",
"ignore_errors",
"=",
"True",
",",
"py_compile",
"=",
"False",
")... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/environment.py#L638-L731 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.