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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py | python | TextDoc.indent | (self, text, prefix=' ') | return join(lines, '\n') | Indent text by prepending a given prefix to each line. | Indent text by prepending a given prefix to each line. | [
"Indent",
"text",
"by",
"prepending",
"a",
"given",
"prefix",
"to",
"each",
"line",
"."
] | def indent(self, text, prefix=' '):
"""Indent text by prepending a given prefix to each line."""
if not text: return ''
lines = split(text, '\n')
lines = map(lambda line, prefix=prefix: prefix + line, lines)
if lines: lines[-1] = rstrip(lines[-1])
return join(lines, '\... | [
"def",
"indent",
"(",
"self",
",",
"text",
",",
"prefix",
"=",
"' '",
")",
":",
"if",
"not",
"text",
":",
"return",
"''",
"lines",
"=",
"split",
"(",
"text",
",",
"'\\n'",
")",
"lines",
"=",
"map",
"(",
"lambda",
"line",
",",
"prefix",
"=",
"p... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py#L1001-L1007 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/Checker.py | python | Checker.__call__ | (self, connection) | Check a TLSConnection.
When a Checker is passed to a handshake function, this will
be called at the end of the function.
@type connection: L{tlslite.TLSConnection.TLSConnection}
@param connection: The TLSConnection to examine.
@raise tlslite.errors.TLSAuthenticationError: If t... | Check a TLSConnection. | [
"Check",
"a",
"TLSConnection",
"."
] | def __call__(self, connection):
"""Check a TLSConnection.
When a Checker is passed to a handshake function, this will
be called at the end of the function.
@type connection: L{tlslite.TLSConnection.TLSConnection}
@param connection: The TLSConnection to examine.
@raise ... | [
"def",
"__call__",
"(",
"self",
",",
"connection",
")",
":",
"if",
"not",
"self",
".",
"checkResumedSession",
"and",
"connection",
".",
"resumed",
":",
"return",
"if",
"self",
".",
"cryptoID",
"or",
"self",
".",
"x509Fingerprint",
"or",
"self",
".",
"x509T... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/Checker.py#L89-L145 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | StripMenuCodes | (*args, **kwargs) | return _misc_.StripMenuCodes(*args, **kwargs) | StripMenuCodes(String in) -> String | StripMenuCodes(String in) -> String | [
"StripMenuCodes",
"(",
"String",
"in",
")",
"-",
">",
"String"
] | def StripMenuCodes(*args, **kwargs):
"""StripMenuCodes(String in) -> String"""
return _misc_.StripMenuCodes(*args, **kwargs) | [
"def",
"StripMenuCodes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StripMenuCodes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L381-L383 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | initCharEncodingHandlers | () | Initialize the char encoding support, it registers the
default encoding supported. NOTE: while public, this
function usually doesn't need to be called in normal
processing. | Initialize the char encoding support, it registers the
default encoding supported. NOTE: while public, this
function usually doesn't need to be called in normal
processing. | [
"Initialize",
"the",
"char",
"encoding",
"support",
"it",
"registers",
"the",
"default",
"encoding",
"supported",
".",
"NOTE",
":",
"while",
"public",
"this",
"function",
"usually",
"doesn",
"t",
"need",
"to",
"be",
"called",
"in",
"normal",
"processing",
"."
... | def initCharEncodingHandlers():
"""Initialize the char encoding support, it registers the
default encoding supported. NOTE: while public, this
function usually doesn't need to be called in normal
processing. """
libxml2mod.xmlInitCharEncodingHandlers() | [
"def",
"initCharEncodingHandlers",
"(",
")",
":",
"libxml2mod",
".",
"xmlInitCharEncodingHandlers",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L347-L352 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/client/session.py | python | SessionInterface.partial_run | (self, handle, fetches, feed_dict=None) | Continues the execution with additional feeds and fetches. | Continues the execution with additional feeds and fetches. | [
"Continues",
"the",
"execution",
"with",
"additional",
"feeds",
"and",
"fetches",
"."
] | def partial_run(self, handle, fetches, feed_dict=None):
"""Continues the execution with additional feeds and fetches."""
raise NotImplementedError('partial_run') | [
"def",
"partial_run",
"(",
"self",
",",
"handle",
",",
"fetches",
",",
"feed_dict",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
"'partial_run'",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/client/session.py#L58-L60 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewCtrl.GetExpanderColumn | (*args, **kwargs) | return _dataview.DataViewCtrl_GetExpanderColumn(*args, **kwargs) | GetExpanderColumn(self) -> DataViewColumn | GetExpanderColumn(self) -> DataViewColumn | [
"GetExpanderColumn",
"(",
"self",
")",
"-",
">",
"DataViewColumn"
] | def GetExpanderColumn(*args, **kwargs):
"""GetExpanderColumn(self) -> DataViewColumn"""
return _dataview.DataViewCtrl_GetExpanderColumn(*args, **kwargs) | [
"def",
"GetExpanderColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewCtrl_GetExpanderColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L1728-L1730 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/expected-lite/script/upload-conan.py | python | createConanPackage | ( args ) | Create conan package and upload it. | Create conan package and upload it. | [
"Create",
"conan",
"package",
"and",
"upload",
"it",
"."
] | def createConanPackage( args ):
"""Create conan package and upload it."""
cmd = tpl_conan_create.format(usr=args.user, chn=args.channel)
if args.verbose:
print( "> {}".format(cmd) )
if not args.dry_run:
subprocess.call( cmd, shell=False ) | [
"def",
"createConanPackage",
"(",
"args",
")",
":",
"cmd",
"=",
"tpl_conan_create",
".",
"format",
"(",
"usr",
"=",
"args",
".",
"user",
",",
"chn",
"=",
"args",
".",
"channel",
")",
"if",
"args",
".",
"verbose",
":",
"print",
"(",
"\"> {}\"",
".",
"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/expected-lite/script/upload-conan.py#L38-L44 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/load.py | python | Loader._recreate_default | (self, proto, node_id, deps) | return factory[kind]() | Creates a Python object from a SavedObject protocol buffer. | Creates a Python object from a SavedObject protocol buffer. | [
"Creates",
"a",
"Python",
"object",
"from",
"a",
"SavedObject",
"protocol",
"buffer",
"."
] | def _recreate_default(self, proto, node_id, deps):
"""Creates a Python object from a SavedObject protocol buffer."""
factory = {
"user_object": (
lambda: self._recreate_user_object(proto.user_object, node_id)),
"function": lambda: self._recreate_function(proto.function, deps),
... | [
"def",
"_recreate_default",
"(",
"self",
",",
"proto",
",",
"node_id",
",",
"deps",
")",
":",
"factory",
"=",
"{",
"\"user_object\"",
":",
"(",
"lambda",
":",
"self",
".",
"_recreate_user_object",
"(",
"proto",
".",
"user_object",
",",
"node_id",
")",
")",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/load.py#L589-L607 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-zeromq/python/zeromq/qa_zeromq_pull_msg_source.py | python | qa_zeromq_pull_msg_source.test_invalid_pmt | (self) | Test receiving of invalid PMT messages | Test receiving of invalid PMT messages | [
"Test",
"receiving",
"of",
"invalid",
"PMT",
"messages"
] | def test_invalid_pmt(self):
"""Test receiving of invalid PMT messages"""
self.zmq_sock.send_string('test_invalid_pmt')
time.sleep(0.1)
self.assertEqual(0, self.message_debug.num_messages()) | [
"def",
"test_invalid_pmt",
"(",
"self",
")",
":",
"self",
".",
"zmq_sock",
".",
"send_string",
"(",
"'test_invalid_pmt'",
")",
"time",
".",
"sleep",
"(",
"0.1",
")",
"self",
".",
"assertEqual",
"(",
"0",
",",
"self",
".",
"message_debug",
".",
"num_message... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-zeromq/python/zeromq/qa_zeromq_pull_msg_source.py#L58-L62 | ||
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | scripts/recoverymetrics.py | python | CUSTOM | (s) | return realCustom | Returns a function that returns the string or list of strings given.
This is useful when you need custom processing that doesn't fit in any of
the other summary functions and is too specific to merit a new summary
function. | Returns a function that returns the string or list of strings given. | [
"Returns",
"a",
"function",
"that",
"returns",
"the",
"string",
"or",
"list",
"of",
"strings",
"given",
"."
] | def CUSTOM(s):
"""Returns a function that returns the string or list of strings given.
This is useful when you need custom processing that doesn't fit in any of
the other summary functions and is too specific to merit a new summary
function.
"""
def realCustom(values, unit):
if type(s) ... | [
"def",
"CUSTOM",
"(",
"s",
")",
":",
"def",
"realCustom",
"(",
"values",
",",
"unit",
")",
":",
"if",
"type",
"(",
"s",
")",
"is",
"list",
":",
"return",
"s",
"else",
":",
"return",
"[",
"s",
"]",
"return",
"realCustom"
] | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/scripts/recoverymetrics.py#L219-L231 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/boost_1_66_0/tools/build/src/build/property.py | python | split_conditional | (property) | return None | If 'property' is conditional property, returns
condition and the property, e.g
<variant>debug,<toolset>gcc:<inlining>full will become
<variant>debug,<toolset>gcc <inlining>full.
Otherwise, returns empty string. | If 'property' is conditional property, returns
condition and the property, e.g
<variant>debug,<toolset>gcc:<inlining>full will become
<variant>debug,<toolset>gcc <inlining>full.
Otherwise, returns empty string. | [
"If",
"property",
"is",
"conditional",
"property",
"returns",
"condition",
"and",
"the",
"property",
"e",
".",
"g",
"<variant",
">",
"debug",
"<toolset",
">",
"gcc",
":",
"<inlining",
">",
"full",
"will",
"become",
"<variant",
">",
"debug",
"<toolset",
">",
... | def split_conditional (property):
""" If 'property' is conditional property, returns
condition and the property, e.g
<variant>debug,<toolset>gcc:<inlining>full will become
<variant>debug,<toolset>gcc <inlining>full.
Otherwise, returns empty string.
"""
assert isinstance(prope... | [
"def",
"split_conditional",
"(",
"property",
")",
":",
"assert",
"isinstance",
"(",
"property",
",",
"basestring",
")",
"m",
"=",
"__re_split_conditional",
".",
"match",
"(",
"property",
")",
"if",
"m",
":",
"return",
"(",
"m",
".",
"group",
"(",
"1",
")... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/property.py#L394-L407 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/faster-rcnn/tools/rpn_generate.py | python | parse_args | () | return args | Parse input arguments | Parse input arguments | [
"Parse",
"input",
"arguments"
] | def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Test a Fast R-CNN network')
parser.add_argument('--gpu', dest='gpu_id', help='GPU id to use',
default=0, type=int)
parser.add_argument('--def', dest='prototxt',
... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Test a Fast R-CNN network'",
")",
"parser",
".",
"add_argument",
"(",
"'--gpu'",
",",
"dest",
"=",
"'gpu_id'",
",",
"help",
"=",
"'GPU id to use'",
... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/tools/rpn_generate.py#L23-L53 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py | python | Complex.__mul__ | (self, other) | self * other | self * other | [
"self",
"*",
"other"
] | def __mul__(self, other):
"""self * other"""
raise NotImplementedError | [
"def",
"__mul__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py#L101-L103 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | clang/bindings/python/clang/cindex.py | python | Cursor.get_template_argument_type | (self, num) | return conf.lib.clang_Cursor_getTemplateArgumentType(self, num) | Returns the CXType for the indicated template argument. | Returns the CXType for the indicated template argument. | [
"Returns",
"the",
"CXType",
"for",
"the",
"indicated",
"template",
"argument",
"."
] | def get_template_argument_type(self, num):
"""Returns the CXType for the indicated template argument."""
return conf.lib.clang_Cursor_getTemplateArgumentType(self, num) | [
"def",
"get_template_argument_type",
"(",
"self",
",",
"num",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Cursor_getTemplateArgumentType",
"(",
"self",
",",
"num",
")"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/bindings/python/clang/cindex.py#L1815-L1817 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/lib/win32pdhquery.py | python | BaseQuery.collectdata | (self,format = win32pdh.PDH_FMT_LONG) | Returns the formatted current values for the Query | Returns the formatted current values for the Query | [
"Returns",
"the",
"formatted",
"current",
"values",
"for",
"the",
"Query"
] | def collectdata(self,format = win32pdh.PDH_FMT_LONG):
'''
Returns the formatted current values for the Query
'''
if self._base: # we are currently open, don't change this
return self.collectdataslave(format)
else: # need to open and then close the _base, should be used by one-offs and elements tracking app... | [
"def",
"collectdata",
"(",
"self",
",",
"format",
"=",
"win32pdh",
".",
"PDH_FMT_LONG",
")",
":",
"if",
"self",
".",
"_base",
":",
"# we are currently open, don't change this",
"return",
"self",
".",
"collectdataslave",
"(",
"format",
")",
"else",
":",
"# need t... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/lib/win32pdhquery.py#L283-L293 | ||
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/glfw.py | python | create_window | (width, height, title, monitor, share) | return _glfw.glfwCreateWindow(width, height, _to_char_p(title),
monitor, share) | Creates a window and its associated context.
Wrapper for:
GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); | Creates a window and its associated context. | [
"Creates",
"a",
"window",
"and",
"its",
"associated",
"context",
"."
] | def create_window(width, height, title, monitor, share):
"""
Creates a window and its associated context.
Wrapper for:
GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
"""
return _glfw.glfwCreateWindow(width, height, _to_char_p... | [
"def",
"create_window",
"(",
"width",
",",
"height",
",",
"title",
",",
"monitor",
",",
"share",
")",
":",
"return",
"_glfw",
".",
"glfwCreateWindow",
"(",
"width",
",",
"height",
",",
"_to_char_p",
"(",
"title",
")",
",",
"monitor",
",",
"share",
")"
] | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L968-L976 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/wms/ogc/implementation/impl_v111.py | python | GetCapabilitiesRequest.SetLayers | (self) | Set the layers for the capabilities xml. | Set the layers for the capabilities xml. | [
"Set",
"the",
"layers",
"for",
"the",
"capabilities",
"xml",
"."
] | def SetLayers(self):
"""Set the layers for the capabilities xml."""
# This outer, inaccessible layer is to give information just once;
# the sub-layers inherit it.
outer_layer = capabilities_wms.Layer(
# If this is a containing layer it should be opaque=0
opaque=0,
cascaded=None... | [
"def",
"SetLayers",
"(",
"self",
")",
":",
"# This outer, inaccessible layer is to give information just once;",
"# the sub-layers inherit it.",
"outer_layer",
"=",
"capabilities_wms",
".",
"Layer",
"(",
"# If this is a containing layer it should be opaque=0",
"opaque",
"=",
"0",
... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/implementation/impl_v111.py#L173-L237 | ||
happynear/caffe-windows | 967eedf25009e334b7f6f933bb5e17aaaff5bef6 | examples/pycaffe/tools.py | python | SimpleTransformer.set_scale | (self, scale) | Set the data scaling. | Set the data scaling. | [
"Set",
"the",
"data",
"scaling",
"."
] | def set_scale(self, scale):
"""
Set the data scaling.
"""
self.scale = scale | [
"def",
"set_scale",
"(",
"self",
",",
"scale",
")",
":",
"self",
".",
"scale",
"=",
"scale"
] | https://github.com/happynear/caffe-windows/blob/967eedf25009e334b7f6f933bb5e17aaaff5bef6/examples/pycaffe/tools.py#L21-L25 | ||
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | site_scons/buildutils.py | python | regression_test_message | (target, source, env: "SCEnvironment") | return f"""* Running test '{env["active_test_name"]}'...""" | Determines the message printed by SCons while building a
RegressionTest target.
Note that the first two arguments are not used but are required by SCons and they
must be keyword arguments. | Determines the message printed by SCons while building a
RegressionTest target. | [
"Determines",
"the",
"message",
"printed",
"by",
"SCons",
"while",
"building",
"a",
"RegressionTest",
"target",
"."
] | def regression_test_message(target, source, env: "SCEnvironment") -> str:
"""
Determines the message printed by SCons while building a
RegressionTest target.
Note that the first two arguments are not used but are required by SCons and they
must be keyword arguments.
"""
return f"""* Running... | [
"def",
"regression_test_message",
"(",
"target",
",",
"source",
",",
"env",
":",
"\"SCEnvironment\"",
")",
"->",
"str",
":",
"return",
"f\"\"\"* Running test '{env[\"active_test_name\"]}'...\"\"\""
] | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/site_scons/buildutils.py#L1046-L1054 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/utils/lint/common_lint.py | python | VerifyTrailingWhitespace | (filename, lines) | return lint | Checks to make sure the file has no lines with trailing whitespace.
Args:
filename: the file under consideration as string
lines: contents of the file as string array
Returns:
A list of tuples with format [(filename, line number, msg), ...] with any
violations found. | Checks to make sure the file has no lines with trailing whitespace. | [
"Checks",
"to",
"make",
"sure",
"the",
"file",
"has",
"no",
"lines",
"with",
"trailing",
"whitespace",
"."
] | def VerifyTrailingWhitespace(filename, lines):
"""Checks to make sure the file has no lines with trailing whitespace.
Args:
filename: the file under consideration as string
lines: contents of the file as string array
Returns:
A list of tuples with format [(filename, line number, msg), ...] with any
... | [
"def",
"VerifyTrailingWhitespace",
"(",
"filename",
",",
"lines",
")",
":",
"lint",
"=",
"[",
"]",
"trailing_whitespace_re",
"=",
"re",
".",
"compile",
"(",
"r'\\s+$'",
")",
"line_num",
"=",
"1",
"for",
"line",
"in",
"lines",
":",
"if",
"trailing_whitespace_... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/utils/lint/common_lint.py#L52-L70 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/utils/fs.py | python | HDFSClient.touch | (self, fs_path, exist_ok=True) | return self._touchz(fs_path) | Create a remote HDFS file.
Args:
fs_path(str): The HDFS file path.
exist_ok(bool): When `fs_path` exists, if `exist_ok` is set false,
program will throw an Exception. Default is true.
Examples:
.. code-block:: text
from paddle.distribut... | Create a remote HDFS file. | [
"Create",
"a",
"remote",
"HDFS",
"file",
"."
] | def touch(self, fs_path, exist_ok=True):
"""
Create a remote HDFS file.
Args:
fs_path(str): The HDFS file path.
exist_ok(bool): When `fs_path` exists, if `exist_ok` is set false,
program will throw an Exception. Default is true.
Examples:
... | [
"def",
"touch",
"(",
"self",
",",
"fs_path",
",",
"exist_ok",
"=",
"True",
")",
":",
"if",
"self",
".",
"is_exist",
"(",
"fs_path",
")",
":",
"if",
"exist_ok",
":",
"return",
"raise",
"FSFileExistsError",
"return",
"self",
".",
"_touchz",
"(",
"fs_path",... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/utils/fs.py#L1012-L1041 | |
samdauwe/BabylonCpp | 3dad13a666299cbcf2e2db5b24575c19743e1000 | cmake_build.py | python | WindowsBuild.getPlatformKey | (self) | return 'unknown' | Returns the platform key. | Returns the platform key. | [
"Returns",
"the",
"platform",
"key",
"."
] | def getPlatformKey(self):
'''
Returns the platform key.
'''
import platform, sys
bitness = '64' if platform.architecture()[0] == '64bit' else '32'
if sys.platform == 'win32':
return 'win32_%s' % bitness
return 'unknown' | [
"def",
"getPlatformKey",
"(",
"self",
")",
":",
"import",
"platform",
",",
"sys",
"bitness",
"=",
"'64'",
"if",
"platform",
".",
"architecture",
"(",
")",
"[",
"0",
"]",
"==",
"'64bit'",
"else",
"'32'",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":... | https://github.com/samdauwe/BabylonCpp/blob/3dad13a666299cbcf2e2db5b24575c19743e1000/cmake_build.py#L313-L321 | |
VelsonWang/HmiFuncDesigner | 439265da17bd3424e678932cbfbc0237b52630f3 | HmiFuncDesigner/libs/qscintilla/Python/configure.py | python | ModuleConfiguration.init_target_configuration | (target_configuration) | Perform any module specific initialisation of the target
target configuration. Typically this is the initialisation of module
specific attributes. To avoid name clashes attributes should be given
a module specific prefix. target_configuration is the target
configuration. | Perform any module specific initialisation of the target
target configuration. Typically this is the initialisation of module
specific attributes. To avoid name clashes attributes should be given
a module specific prefix. target_configuration is the target
configuration. | [
"Perform",
"any",
"module",
"specific",
"initialisation",
"of",
"the",
"target",
"target",
"configuration",
".",
"Typically",
"this",
"is",
"the",
"initialisation",
"of",
"module",
"specific",
"attributes",
".",
"To",
"avoid",
"name",
"clashes",
"attributes",
"sho... | def init_target_configuration(target_configuration):
""" Perform any module specific initialisation of the target
target configuration. Typically this is the initialisation of module
specific attributes. To avoid name clashes attributes should be given
a module specific prefix. target... | [
"def",
"init_target_configuration",
"(",
"target_configuration",
")",
":",
"target_configuration",
".",
"qsci_version",
"=",
"None",
"target_configuration",
".",
"qsci_features_dir",
"=",
"None",
"target_configuration",
".",
"qsci_inc_dir",
"=",
"None",
"target_configuratio... | https://github.com/VelsonWang/HmiFuncDesigner/blob/439265da17bd3424e678932cbfbc0237b52630f3/HmiFuncDesigner/libs/qscintilla/Python/configure.py#L117-L129 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/demand/detectorflows_wxgui.py | python | AddDetectorflowTool.get_optionspanel | (self, parent, size=wx.DefaultSize) | return self._optionspanel | Return tool option widgets on given parent | Return tool option widgets on given parent | [
"Return",
"tool",
"option",
"widgets",
"on",
"given",
"parent"
] | def get_optionspanel(self, parent, size=wx.DefaultSize):
"""
Return tool option widgets on given parent
"""
size = (200, -1)
buttons = [('Add flow', self.on_add_flow, 'Add flow generation on from-edge to demand.'),
('Add turns', self.on_add_turn, 'Add turn flow... | [
"def",
"get_optionspanel",
"(",
"self",
",",
"parent",
",",
"size",
"=",
"wx",
".",
"DefaultSize",
")",
":",
"size",
"=",
"(",
"200",
",",
"-",
"1",
")",
"buttons",
"=",
"[",
"(",
"'Add flow'",
",",
"self",
".",
"on_add_flow",
",",
"'Add flow generatio... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/detectorflows_wxgui.py#L506-L530 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | get_object_signature | (obj) | return sig | Get the signature from obj | Get the signature from obj | [
"Get",
"the",
"signature",
"from",
"obj"
] | def get_object_signature(obj):
"""
Get the signature from obj
"""
try:
sig = formatargspec(*getargspec(obj))
except TypeError, errmsg:
sig = ''
# msg = "Unable to retrieve the signature of %s '%s'\n"\
# "(Initial error message: %s)"
# warnings.warn(msg % (t... | [
"def",
"get_object_signature",
"(",
"obj",
")",
":",
"try",
":",
"sig",
"=",
"formatargspec",
"(",
"*",
"getargspec",
"(",
"obj",
")",
")",
"except",
"TypeError",
",",
"errmsg",
":",
"sig",
"=",
"''",
"# msg = \"Unable to retrieve the signature of %s '%s'\\... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L106-L119 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | zeros_like | (x) | return _F.zeros_like(x) | zeros_like(x)
Return all `0` var shape is same as `x`.
Parameters
----------
x : var_like, input value.
Returns
-------
zeros_like_res : Var.
Example:
-------
>>> expr.zeros_like([[1, 2], [3, 4]])
array([[0, 0],
[0, 0]], dtype=int32) | zeros_like(x)
Return all `0` var shape is same as `x`. | [
"zeros_like",
"(",
"x",
")",
"Return",
"all",
"0",
"var",
"shape",
"is",
"same",
"as",
"x",
"."
] | def zeros_like(x):
'''
zeros_like(x)
Return all `0` var shape is same as `x`.
Parameters
----------
x : var_like, input value.
Returns
-------
zeros_like_res : Var.
Example:
-------
>>> expr.zeros_like([[1, 2], [3, 4]])
array([[0, 0],
[0, 0]], dtype=int3... | [
"def",
"zeros_like",
"(",
"x",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"return",
"_F",
".",
"zeros_like",
"(",
"x",
")"
] | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L3042-L3062 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/dead_time_corrections_model.py | python | DeadTimeCorrectionsModel.is_dead_time_source_from_data_file | (self) | return self._corrections_context.dead_time_source == DEAD_TIME_FROM_FILE | Returns true if the dead time should be retrieved from a data file. | Returns true if the dead time should be retrieved from a data file. | [
"Returns",
"true",
"if",
"the",
"dead",
"time",
"should",
"be",
"retrieved",
"from",
"a",
"data",
"file",
"."
] | def is_dead_time_source_from_data_file(self) -> bool:
"""Returns true if the dead time should be retrieved from a data file."""
return self._corrections_context.dead_time_source == DEAD_TIME_FROM_FILE | [
"def",
"is_dead_time_source_from_data_file",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_corrections_context",
".",
"dead_time_source",
"==",
"DEAD_TIME_FROM_FILE"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/dead_time_corrections_model.py#L63-L65 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/train/callback/_summary_collector.py | python | SummaryCollector._save_model_params | (self, cur_num, unit, backbone) | Save model params. | Save model params. | [
"Save",
"model",
"params",
"."
] | def _save_model_params(self, cur_num, unit, backbone):
"""Save model params."""
param_list = []
for param in backbone.get_parameters():
param.init_data()
param_data = param.data if isinstance(param.data, Tensor) else Tensor(param.data)
param_list.append(dict... | [
"def",
"_save_model_params",
"(",
"self",
",",
"cur_num",
",",
"unit",
",",
"backbone",
")",
":",
"param_list",
"=",
"[",
"]",
"for",
"param",
"in",
"backbone",
".",
"get_parameters",
"(",
")",
":",
"param",
".",
"init_data",
"(",
")",
"param_data",
"=",... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/callback/_summary_collector.py#L594-L614 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/SocketServer.py | python | BaseServer.finish_request | (self, request, client_address) | Finish one request by instantiating RequestHandlerClass. | Finish one request by instantiating RequestHandlerClass. | [
"Finish",
"one",
"request",
"by",
"instantiating",
"RequestHandlerClass",
"."
] | def finish_request(self, request, client_address):
"""Finish one request by instantiating RequestHandlerClass."""
self.RequestHandlerClass(request, client_address, self) | [
"def",
"finish_request",
"(",
"self",
",",
"request",
",",
"client_address",
")",
":",
"self",
".",
"RequestHandlerClass",
"(",
"request",
",",
"client_address",
",",
"self",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/SocketServer.py#L332-L334 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/personGenerator.py | python | ProbabilityElement.__init__ | (self, xml_element) | :param xml_element: The source xml element | :param xml_element: The source xml element | [
":",
"param",
"xml_element",
":",
"The",
"source",
"xml",
"element"
] | def __init__(self, xml_element):
"""
:param xml_element: The source xml element
"""
super().__init__(xml_element)
self.possibilities = []
for sub_element in list(self.xml_element):
if sub_element.tag != "probabilityItem":
raise Exception("Only ... | [
"def",
"__init__",
"(",
"self",
",",
"xml_element",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"xml_element",
")",
"self",
".",
"possibilities",
"=",
"[",
"]",
"for",
"sub_element",
"in",
"list",
"(",
"self",
".",
"xml_element",
")",
":",
"if",... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/personGenerator.py#L189-L209 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/array_creations.py | python | _pad_constant | (arr, pad_width, value) | return arr | pads the array with constant values, used in mode: "constant" | pads the array with constant values, used in mode: "constant" | [
"pads",
"the",
"array",
"with",
"constant",
"values",
"used",
"in",
"mode",
":",
"constant"
] | def _pad_constant(arr, pad_width, value):
"""
pads the array with constant values, used in mode: "constant"
"""
dtype = arr.dtype
for i in range(arr.ndim):
shape = arr.shape
pad_before = ()
pad_after = ()
# To avoid any memory issues, we don't make tensor with 0s in t... | [
"def",
"_pad_constant",
"(",
"arr",
",",
"pad_width",
",",
"value",
")",
":",
"dtype",
"=",
"arr",
".",
"dtype",
"for",
"i",
"in",
"range",
"(",
"arr",
".",
"ndim",
")",
":",
"shape",
"=",
"arr",
".",
"shape",
"pad_before",
"=",
"(",
")",
"pad_afte... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/array_creations.py#L2140-L2156 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/io/matlab/miobase.py | python | MatFileReader.__init__ | (self, mat_stream,
byte_order=None,
mat_dtype=False,
squeeze_me=False,
chars_as_strings=True,
matlab_compatible=False,
struct_as_record=True,
verify_compressed_data_integrity=True
) | Initializer for mat file reader
mat_stream : file-like
object with file API, open for reading
%(load_args)s | Initializer for mat file reader | [
"Initializer",
"for",
"mat",
"file",
"reader"
] | def __init__(self, mat_stream,
byte_order=None,
mat_dtype=False,
squeeze_me=False,
chars_as_strings=True,
matlab_compatible=False,
struct_as_record=True,
verify_compressed_data_integrity=True
... | [
"def",
"__init__",
"(",
"self",
",",
"mat_stream",
",",
"byte_order",
"=",
"None",
",",
"mat_dtype",
"=",
"False",
",",
"squeeze_me",
"=",
"False",
",",
"chars_as_strings",
"=",
"True",
",",
"matlab_compatible",
"=",
"False",
",",
"struct_as_record",
"=",
"T... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/io/matlab/miobase.py#L346-L377 | ||
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py | python | StringEncoder | (field_number, is_repeated, is_packed) | Returns an encoder for a string field. | Returns an encoder for a string field. | [
"Returns",
"an",
"encoder",
"for",
"a",
"string",
"field",
"."
] | def StringEncoder(field_number, is_repeated, is_packed):
"""Returns an encoder for a string field."""
tag = TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED)
local_EncodeVarint = _EncodeVarint
local_len = len
assert not is_packed
if is_repeated:
def EncodeRepeatedField(write, value):
... | [
"def",
"StringEncoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag",
"=",
"TagBytes",
"(",
"field_number",
",",
"wire_format",
".",
"WIRETYPE_LENGTH_DELIMITED",
")",
"local_EncodeVarint",
"=",
"_EncodeVarint",
"local_len",
"=",
"len",
... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L569-L590 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/control-examples/rosbaxtercontroller.py | python | RosBaxterController.setVelocityCommand | (self,inputs,res,index,value) | Given a return dictionary res for the output() function, sets a joint command for a single
link, dqdes[index]=value. If a position command is already given, this will figure out how to
go along the desired velocity for the next cycle. Index can also be a joint name. | Given a return dictionary res for the output() function, sets a joint command for a single
link, dqdes[index]=value. If a position command is already given, this will figure out how to
go along the desired velocity for the next cycle. Index can also be a joint name. | [
"Given",
"a",
"return",
"dictionary",
"res",
"for",
"the",
"output",
"()",
"function",
"sets",
"a",
"joint",
"command",
"for",
"a",
"single",
"link",
"dqdes",
"[",
"index",
"]",
"=",
"value",
".",
"If",
"a",
"position",
"command",
"is",
"already",
"given... | def setVelocityCommand(self,inputs,res,index,value):
"""Given a return dictionary res for the output() function, sets a joint command for a single
link, dqdes[index]=value. If a position command is already given, this will figure out how to
go along the desired velocity for the next cycle. Ind... | [
"def",
"setVelocityCommand",
"(",
"self",
",",
"inputs",
",",
"res",
",",
"index",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"index",
",",
"str",
")",
":",
"#perform the mapping automatically",
"index",
"=",
"self",
".",
"nameToLinkIndex",
"[",
"index... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/control-examples/rosbaxtercontroller.py#L235-L253 | ||
google/perfetto | fe68c7a7f7657aa71ced68efb126dcac4107c745 | python/perfetto/trace_processor/api.py | python | TraceProcessor.query | (self, sql: str) | return TraceProcessor.QueryResultIterator(response.column_names,
response.batch) | Executes passed in SQL query using class defined HTTP API, and returns
the response as a QueryResultIterator. Raises TraceProcessorException if
the response returns with an error.
Args:
sql: SQL query written as a String
Returns:
A class which can iterate through each row of the results ta... | Executes passed in SQL query using class defined HTTP API, and returns
the response as a QueryResultIterator. Raises TraceProcessorException if
the response returns with an error. | [
"Executes",
"passed",
"in",
"SQL",
"query",
"using",
"class",
"defined",
"HTTP",
"API",
"and",
"returns",
"the",
"response",
"as",
"a",
"QueryResultIterator",
".",
"Raises",
"TraceProcessorException",
"if",
"the",
"response",
"returns",
"with",
"an",
"error",
".... | def query(self, sql: str):
"""Executes passed in SQL query using class defined HTTP API, and returns
the response as a QueryResultIterator. Raises TraceProcessorException if
the response returns with an error.
Args:
sql: SQL query written as a String
Returns:
A class which can iterate ... | [
"def",
"query",
"(",
"self",
",",
"sql",
":",
"str",
")",
":",
"response",
"=",
"self",
".",
"http",
".",
"execute_query",
"(",
"sql",
")",
"if",
"response",
".",
"error",
":",
"raise",
"TraceProcessorException",
"(",
"response",
".",
"error",
")",
"re... | https://github.com/google/perfetto/blob/fe68c7a7f7657aa71ced68efb126dcac4107c745/python/perfetto/trace_processor/api.py#L259-L277 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/waiter.py | python | create_waiter_with_client | (waiter_name, waiter_model, client) | return documented_waiter_cls(
waiter_name, single_waiter_config, operation_method
) | :type waiter_name: str
:param waiter_name: The name of the waiter. The name should match
the name (including the casing) of the key name in the waiter
model file (typically this is CamelCasing).
:type waiter_model: botocore.waiter.WaiterModel
:param waiter_model: The model for the waiter c... | [] | def create_waiter_with_client(waiter_name, waiter_model, client):
"""
:type waiter_name: str
:param waiter_name: The name of the waiter. The name should match
the name (including the casing) of the key name in the waiter
model file (typically this is CamelCasing).
:type waiter_model: ... | [
"def",
"create_waiter_with_client",
"(",
"waiter_name",
",",
"waiter_model",
",",
"client",
")",
":",
"single_waiter_config",
"=",
"waiter_model",
".",
"get_waiter",
"(",
"waiter_name",
")",
"operation_name",
"=",
"xform_name",
"(",
"single_waiter_config",
".",
"opera... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/waiter.py#L26-L75 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/customer_satisfaction/utils/hdf5_format.py | python | save_attributes_to_hdf5_group | (group, name, data) | Saves attributes (data) of the specified name into the HDF5 group.
This method deals with an inherent problem of HDF5 file which is not
able to store data larger than HDF5_OBJECT_HEADER_LIMIT bytes.
Arguments:
group: A pointer to a HDF5 group.
name: A name of the attributes to save.
data: Attr... | Saves attributes (data) of the specified name into the HDF5 group. | [
"Saves",
"attributes",
"(",
"data",
")",
"of",
"the",
"specified",
"name",
"into",
"the",
"HDF5",
"group",
"."
] | def save_attributes_to_hdf5_group(group, name, data):
"""Saves attributes (data) of the specified name into the HDF5 group.
This method deals with an inherent problem of HDF5 file which is not
able to store data larger than HDF5_OBJECT_HEADER_LIMIT bytes.
Arguments:
group: A pointer to a HDF5 group.
... | [
"def",
"save_attributes_to_hdf5_group",
"(",
"group",
",",
"name",
",",
"data",
")",
":",
"# Check that no item in `data` is larger than `HDF5_OBJECT_HEADER_LIMIT`",
"# because in that case even chunking the array would not make the saving",
"# possible.",
"bad_attributes",
"=",
"[",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/customer_satisfaction/utils/hdf5_format.py#L781-L821 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/posixpath.py | python | relpath | (path, start=curdir) | return join(*rel_list) | Return a relative version of a path | Return a relative version of a path | [
"Return",
"a",
"relative",
"version",
"of",
"a",
"path"
] | def relpath(path, start=curdir):
"""Return a relative version of a path"""
if not path:
raise ValueError("no path specified")
start_list = [x for x in abspath(start).split(sep) if x]
path_list = [x for x in abspath(path).split(sep) if x]
# Work out how much of the filepath is shared by st... | [
"def",
"relpath",
"(",
"path",
",",
"start",
"=",
"curdir",
")",
":",
"if",
"not",
"path",
":",
"raise",
"ValueError",
"(",
"\"no path specified\"",
")",
"start_list",
"=",
"[",
"x",
"for",
"x",
"in",
"abspath",
"(",
"start",
")",
".",
"split",
"(",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/posixpath.py#L416-L431 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/boringssl/src/util/bot/go/bootstrap.py | python | bootstrap | (logging_level) | Installs all dependencies in default locations.
Supposed to be called at the beginning of some script (it modifies logger).
Args:
logging_level: logging level of bootstrap process. | Installs all dependencies in default locations. | [
"Installs",
"all",
"dependencies",
"in",
"default",
"locations",
"."
] | def bootstrap(logging_level):
"""Installs all dependencies in default locations.
Supposed to be called at the beginning of some script (it modifies logger).
Args:
logging_level: logging level of bootstrap process.
"""
logging.basicConfig()
LOGGER.setLevel(logging_level)
ensure_toolset_installed(TOOL... | [
"def",
"bootstrap",
"(",
"logging_level",
")",
":",
"logging",
".",
"basicConfig",
"(",
")",
"LOGGER",
".",
"setLevel",
"(",
"logging_level",
")",
"ensure_toolset_installed",
"(",
"TOOLSET_ROOT",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/boringssl/src/util/bot/go/bootstrap.py#L248-L258 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/pipeline/sync/batchnorm.py | python | DeferredBatchNorm._commit | (self) | Updates the running statistics of a mini-batch. | Updates the running statistics of a mini-batch. | [
"Updates",
"the",
"running",
"statistics",
"of",
"a",
"mini",
"-",
"batch",
"."
] | def _commit(self) -> None:
"""Updates the running statistics of a mini-batch."""
exponential_average_factor = 0.0
self.num_batches_tracked += 1
if self.momentum is None: # use cumulative moving average
exponential_average_factor = 1.0 / float(self.num_batches_tracked)
... | [
"def",
"_commit",
"(",
"self",
")",
"->",
"None",
":",
"exponential_average_factor",
"=",
"0.0",
"self",
".",
"num_batches_tracked",
"+=",
"1",
"if",
"self",
".",
"momentum",
"is",
"None",
":",
"# use cumulative moving average",
"exponential_average_factor",
"=",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/batchnorm.py#L72-L96 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinema/paraview/tpl/cinema_python/adaptors/paraview/pv_introspect.py | python | restore_visibility | (proxies) | at end of run, return to a previously recorded paraview state | at end of run, return to a previously recorded paraview state | [
"at",
"end",
"of",
"run",
"return",
"to",
"a",
"previously",
"recorded",
"paraview",
"state"
] | def restore_visibility(proxies):
"""at end of run, return to a previously recorded paraview state"""
view_proxy = paraview.simple.GetActiveView()
for listElt in proxies:
if listElt['proxy'] == "__view_info":
view_proxy.OrientationAxesVisibility = listElt[
'orientation_ax... | [
"def",
"restore_visibility",
"(",
"proxies",
")",
":",
"view_proxy",
"=",
"paraview",
".",
"simple",
".",
"GetActiveView",
"(",
")",
"for",
"listElt",
"in",
"proxies",
":",
"if",
"listElt",
"[",
"'proxy'",
"]",
"==",
"\"__view_info\"",
":",
"view_proxy",
"."... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/adaptors/paraview/pv_introspect.py#L105-L133 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite_e.py | python | _normed_hermite_e_n | (x, n) | return c0 + c1*x | Evaluate a normalized HermiteE polynomial.
Compute the value of the normalized HermiteE polynomial of degree ``n``
at the points ``x``.
Parameters
----------
x : ndarray of double.
Points at which to evaluate the function
n : int
Degree of the normalized HermiteE function to b... | Evaluate a normalized HermiteE polynomial. | [
"Evaluate",
"a",
"normalized",
"HermiteE",
"polynomial",
"."
] | def _normed_hermite_e_n(x, n):
"""
Evaluate a normalized HermiteE polynomial.
Compute the value of the normalized HermiteE polynomial of degree ``n``
at the points ``x``.
Parameters
----------
x : ndarray of double.
Points at which to evaluate the function
n : int
Degr... | [
"def",
"_normed_hermite_e_n",
"(",
"x",
",",
"n",
")",
":",
"if",
"n",
"==",
"0",
":",
"return",
"np",
".",
"full",
"(",
"x",
".",
"shape",
",",
"1",
"/",
"np",
".",
"sqrt",
"(",
"np",
".",
"sqrt",
"(",
"2",
"*",
"np",
".",
"pi",
")",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite_e.py#L1480-L1520 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/response/scf_products.py | python | TDUSCFEngine.generate_guess | (self, nguess) | return guess_vectors | Generate a set of guess vectors based on orbital energy differences | Generate a set of guess vectors based on orbital energy differences | [
"Generate",
"a",
"set",
"of",
"guess",
"vectors",
"based",
"on",
"orbital",
"energy",
"differences"
] | def generate_guess(self, nguess):
"""Generate a set of guess vectors based on orbital energy differences
"""
guess_vectors = []
deltas = []
for ho in range(self.wfn.nirrep()):
hv = self.G_trans ^ ho
for i, ei in enumerate(self.E_occ[0].nph[ho]):
... | [
"def",
"generate_guess",
"(",
"self",
",",
"nguess",
")",
":",
"guess_vectors",
"=",
"[",
"]",
"deltas",
"=",
"[",
"]",
"for",
"ho",
"in",
"range",
"(",
"self",
".",
"wfn",
".",
"nirrep",
"(",
")",
")",
":",
"hv",
"=",
"self",
".",
"G_trans",
"^"... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/response/scf_products.py#L530-L554 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Logs.py | python | error | (*k, **kw) | Wrap logging.errors, adds the stack trace when the verbosity level :py:attr:`waflib.Logs.verbose` ≥ 2 | Wrap logging.errors, adds the stack trace when the verbosity level :py:attr:`waflib.Logs.verbose` ≥ 2 | [
"Wrap",
"logging",
".",
"errors",
"adds",
"the",
"stack",
"trace",
"when",
"the",
"verbosity",
"level",
":",
"py",
":",
"attr",
":",
"waflib",
".",
"Logs",
".",
"verbose",
"≥",
"2"
] | def error(*k, **kw):
"""
Wrap logging.errors, adds the stack trace when the verbosity level :py:attr:`waflib.Logs.verbose` ≥ 2
"""
log.error(*k, **kw)
if verbose > 2:
st = traceback.extract_stack()
if st:
st = st[:-1]
buf = []
for filename, lineno, name, line in st:
buf.append(' File %r, line %d,... | [
"def",
"error",
"(",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"log",
".",
"error",
"(",
"*",
"k",
",",
"*",
"*",
"kw",
")",
"if",
"verbose",
">",
"2",
":",
"st",
"=",
"traceback",
".",
"extract_stack",
"(",
")",
"if",
"st",
":",
"st",
"=",
... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Logs.py#L263-L278 | ||
alexgkendall/caffe-posenet | 62aafbd7c45df91acdba14f5d1406d8295c2bc6f | scripts/cpp_lint.py | python | _NamespaceInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Check end of namespace comments. | Check end of namespace comments. | [
"Check",
"end",
"of",
"namespace",
"comments",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Check end of namespace comments."""
line = clean_lines.raw_lines[linenum]
# Check how many lines is enclosed in this namespace. Don't issue
# warning for missing namespace comments if there aren't enough
# lines. However, do apply chec... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"raw_lines",
"[",
"linenum",
"]",
"# Check how many lines is enclosed in this namespace. Don't issue",
"# warning for missing n... | https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/scripts/cpp_lint.py#L1856-L1899 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/generic.py | python | NDFrame.ftypes | (self) | return Series(self._data.get_ftypes(), index=self._info_axis,
dtype=np.object_) | Return the ftypes (indication of sparse/dense and dtype) in DataFrame.
This returns a Series with the data type of each column.
The result's index is the original DataFrame's columns. Columns
with mixed types are stored with the ``object`` dtype. See
:ref:`the User Guide <basics.dtypes... | Return the ftypes (indication of sparse/dense and dtype) in DataFrame. | [
"Return",
"the",
"ftypes",
"(",
"indication",
"of",
"sparse",
"/",
"dense",
"and",
"dtype",
")",
"in",
"DataFrame",
"."
] | def ftypes(self):
"""
Return the ftypes (indication of sparse/dense and dtype) in DataFrame.
This returns a Series with the data type of each column.
The result's index is the original DataFrame's columns. Columns
with mixed types are stored with the ``object`` dtype. See
... | [
"def",
"ftypes",
"(",
"self",
")",
":",
"from",
"pandas",
"import",
"Series",
"return",
"Series",
"(",
"self",
".",
"_data",
".",
"get_ftypes",
"(",
")",
",",
"index",
"=",
"self",
".",
"_info_axis",
",",
"dtype",
"=",
"np",
".",
"object_",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/generic.py#L5494-L5537 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/integer.py | python | _IntegerDtype.itemsize | (self) | return self.numpy_dtype.itemsize | Return the number of bytes in this dtype | Return the number of bytes in this dtype | [
"Return",
"the",
"number",
"of",
"bytes",
"in",
"this",
"dtype"
] | def itemsize(self):
""" Return the number of bytes in this dtype """
return self.numpy_dtype.itemsize | [
"def",
"itemsize",
"(",
"self",
")",
":",
"return",
"self",
".",
"numpy_dtype",
".",
"itemsize"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/integer.py#L77-L79 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.OnKillFocus | (self, event) | Handles the ``wx.EVT_KILL_FOCUS`` event for :class:`UltimateListMainWindow`.
:param `event`: a :class:`FocusEvent` event to be processed. | Handles the ``wx.EVT_KILL_FOCUS`` event for :class:`UltimateListMainWindow`. | [
"Handles",
"the",
"wx",
".",
"EVT_KILL_FOCUS",
"event",
"for",
":",
"class",
":",
"UltimateListMainWindow",
"."
] | def OnKillFocus(self, event):
"""
Handles the ``wx.EVT_KILL_FOCUS`` event for :class:`UltimateListMainWindow`.
:param `event`: a :class:`FocusEvent` event to be processed.
"""
if self.GetParent():
event = wx.FocusEvent(wx.wxEVT_KILL_FOCUS, self.GetParent().GetId())
... | [
"def",
"OnKillFocus",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"GetParent",
"(",
")",
":",
"event",
"=",
"wx",
".",
"FocusEvent",
"(",
"wx",
".",
"wxEVT_KILL_FOCUS",
",",
"self",
".",
"GetParent",
"(",
")",
".",
"GetId",
"(",
")",
")... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L8265-L8279 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Build.py | python | BuildContext.install_files | (self, *k, **kw) | Actual implementation provided by :py:meth:`waflib.Build.InstallContext.install_files` | Actual implementation provided by :py:meth:`waflib.Build.InstallContext.install_files` | [
"Actual",
"implementation",
"provided",
"by",
":",
"py",
":",
"meth",
":",
"waflib",
".",
"Build",
".",
"InstallContext",
".",
"install_files"
] | def install_files(self, *k, **kw):
"""Actual implementation provided by :py:meth:`waflib.Build.InstallContext.install_files`"""
pass | [
"def",
"install_files",
"(",
"self",
",",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"pass"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Build.py#L198-L200 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/commands.py | python | BuildExt.initialize_options | (self) | Prepare for new options | Prepare for new options | [
"Prepare",
"for",
"new",
"options"
] | def initialize_options(self):
""" Prepare for new options """
_build_ext.build_ext.initialize_options(self)
if 'build_ext' in _option_defaults:
for opt_name, default in _option_defaults['build_ext']:
setattr(self, opt_name, default) | [
"def",
"initialize_options",
"(",
"self",
")",
":",
"_build_ext",
".",
"build_ext",
".",
"initialize_options",
"(",
"self",
")",
"if",
"'build_ext'",
"in",
"_option_defaults",
":",
"for",
"opt_name",
",",
"default",
"in",
"_option_defaults",
"[",
"'build_ext'",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/commands.py#L181-L186 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/save.py | python | _AugmentedGraphView.set_signature | (self, signature_map) | Attach signature to the root object. | Attach signature to the root object. | [
"Attach",
"signature",
"to",
"the",
"root",
"object",
"."
] | def set_signature(self, signature_map):
"""Attach signature to the root object."""
self.list_children(self.root)
# Overrides existing dependency.
name = signature_serialization.SIGNATURE_ATTRIBUTE_NAME
self._children_cache[self.root][name] = signature_map | [
"def",
"set_signature",
"(",
"self",
",",
"signature_map",
")",
":",
"self",
".",
"list_children",
"(",
"self",
".",
"root",
")",
"# Overrides existing dependency.",
"name",
"=",
"signature_serialization",
".",
"SIGNATURE_ATTRIBUTE_NAME",
"self",
".",
"_children_cache... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/save.py#L122-L127 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSampleGroup.py | python | DrillSampleGroup.getMaster | (self) | return self._master | Get the master sample of the group.
Returns:
(DrillSample): master sample or None | Get the master sample of the group. | [
"Get",
"the",
"master",
"sample",
"of",
"the",
"group",
"."
] | def getMaster(self):
"""
Get the master sample of the group.
Returns:
(DrillSample): master sample or None
"""
return self._master | [
"def",
"getMaster",
"(",
"self",
")",
":",
"return",
"self",
".",
"_master"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSampleGroup.py#L124-L131 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/imputil.py | python | ImportManager._import_hook | (self, fqname, globals=None, locals=None, fromlist=None) | Python calls this hook to locate and import a module. | Python calls this hook to locate and import a module. | [
"Python",
"calls",
"this",
"hook",
"to",
"locate",
"and",
"import",
"a",
"module",
"."
] | def _import_hook(self, fqname, globals=None, locals=None, fromlist=None):
"""Python calls this hook to locate and import a module."""
parts = fqname.split('.')
# determine the context of this import
parent = self._determine_import_context(globals)
# if there is a parent, then ... | [
"def",
"_import_hook",
"(",
"self",
",",
"fqname",
",",
"globals",
"=",
"None",
",",
"locals",
"=",
"None",
",",
"fromlist",
"=",
"None",
")",
":",
"parts",
"=",
"fqname",
".",
"split",
"(",
"'.'",
")",
"# determine the context of this import",
"parent",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/imputil.py#L86-L147 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/engine/topology.py | python | Network.set_weights | (self, weights) | Sets the weights of the model.
Arguments:
weights: A list of Numpy arrays with shapes and types matching
the output of `model.get_weights()`. | Sets the weights of the model. | [
"Sets",
"the",
"weights",
"of",
"the",
"model",
"."
] | def set_weights(self, weights):
"""Sets the weights of the model.
Arguments:
weights: A list of Numpy arrays with shapes and types matching
the output of `model.get_weights()`.
"""
tuples = []
for layer in self.layers:
num_param = len(layer.weights)
layer_weights = w... | [
"def",
"set_weights",
"(",
"self",
",",
"weights",
")",
":",
"tuples",
"=",
"[",
"]",
"for",
"layer",
"in",
"self",
".",
"layers",
":",
"num_param",
"=",
"len",
"(",
"layer",
".",
"weights",
")",
"layer_weights",
"=",
"weights",
"[",
":",
"num_param",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/engine/topology.py#L755-L769 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/FleetUtilsAI.py | python | count_troops_in_fleet | (fleet_id: int) | return fleet_troop_capacity | Get the number of troops in the fleet.
:param fleet_id: fleet to be queried
:return: total troopCapacity of the fleet | Get the number of troops in the fleet. | [
"Get",
"the",
"number",
"of",
"troops",
"in",
"the",
"fleet",
"."
] | def count_troops_in_fleet(fleet_id: int) -> float:
"""
Get the number of troops in the fleet.
:param fleet_id: fleet to be queried
:return: total troopCapacity of the fleet
"""
universe = fo.getUniverse()
fleet = universe.getFleet(fleet_id)
if not fleet:
return 0.0
fleet_tro... | [
"def",
"count_troops_in_fleet",
"(",
"fleet_id",
":",
"int",
")",
"->",
"float",
":",
"universe",
"=",
"fo",
".",
"getUniverse",
"(",
")",
"fleet",
"=",
"universe",
".",
"getFleet",
"(",
"fleet_id",
")",
"if",
"not",
"fleet",
":",
"return",
"0.0",
"fleet... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/FleetUtilsAI.py#L37-L53 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Spinbox.scan_dragto | (self, x) | return self.scan("dragto", x) | Compute the difference between the given x argument
and the x argument to the last scan mark command
It then adjusts the view left or right by 10 times the
difference in x-coordinates. This command is typically
associated with mouse motion events in the widget, to
produce the ef... | Compute the difference between the given x argument
and the x argument to the last scan mark command | [
"Compute",
"the",
"difference",
"between",
"the",
"given",
"x",
"argument",
"and",
"the",
"x",
"argument",
"to",
"the",
"last",
"scan",
"mark",
"command"
] | def scan_dragto(self, x):
"""Compute the difference between the given x argument
and the x argument to the last scan mark command
It then adjusts the view left or right by 10 times the
difference in x-coordinates. This command is typically
associated with mouse motion events in ... | [
"def",
"scan_dragto",
"(",
"self",
",",
"x",
")",
":",
"return",
"self",
".",
"scan",
"(",
"\"dragto\"",
",",
"x",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3480-L3490 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py | python | CPP_to_Python | (s) | return s | Converts a C pre-processor expression into an equivalent
Python expression that can be evaluated. | Converts a C pre-processor expression into an equivalent
Python expression that can be evaluated. | [
"Converts",
"a",
"C",
"pre",
"-",
"processor",
"expression",
"into",
"an",
"equivalent",
"Python",
"expression",
"that",
"can",
"be",
"evaluated",
"."
] | def CPP_to_Python(s):
"""
Converts a C pre-processor expression into an equivalent
Python expression that can be evaluated.
"""
s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s)
for expr, repl in CPP_to_Python_Eval_List:
s = expr.sub(repl, s)
return s | [
"def",
"CPP_to_Python",
"(",
"s",
")",
":",
"s",
"=",
"CPP_to_Python_Ops_Expression",
".",
"sub",
"(",
"CPP_to_Python_Ops_Sub",
",",
"s",
")",
"for",
"expr",
",",
"repl",
"in",
"CPP_to_Python_Eval_List",
":",
"s",
"=",
"expr",
".",
"sub",
"(",
"repl",
",",... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py#L159-L167 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/moosesqa/LogHelper.py | python | LogHelper.log | (self, key, msg, *args, **kwargs) | Wrapper for logging log that uses the key to determine the message level | Wrapper for logging log that uses the key to determine the message level | [
"Wrapper",
"for",
"logging",
"log",
"that",
"uses",
"the",
"key",
"to",
"determine",
"the",
"message",
"level"
] | def log(self, key, msg, *args, **kwargs):
"""Wrapper for logging log that uses the key to determine the message level"""
mode = self.__modes[key]
self.__counts[key] += 1
text = msg.format(*args, **kwargs)
text += "\nControl this message using: '{}'".format(key)
self.__te... | [
"def",
"log",
"(",
"self",
",",
"key",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"mode",
"=",
"self",
".",
"__modes",
"[",
"key",
"]",
"self",
".",
"__counts",
"[",
"key",
"]",
"+=",
"1",
"text",
"=",
"msg",
".",
"forma... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/moosesqa/LogHelper.py#L40-L50 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailcap.py | python | getcaps | () | return caps | Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to mailcap entries. The list
collects all the entries for that MIME type from all available mailcap
files. Each dictionary contains key-va... | Return a dictionary containing the mailcap database. | [
"Return",
"a",
"dictionary",
"containing",
"the",
"mailcap",
"database",
"."
] | def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to mailcap entries. The list
collects all the entries for that MIME type from all available mailcap
files. Each dict... | [
"def",
"getcaps",
"(",
")",
":",
"caps",
"=",
"{",
"}",
"lineno",
"=",
"0",
"for",
"mailcap",
"in",
"listmailcapfiles",
"(",
")",
":",
"try",
":",
"fp",
"=",
"open",
"(",
"mailcap",
",",
"'r'",
")",
"except",
"OSError",
":",
"continue",
"with",
"fp... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailcap.py#L19-L43 | |
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/io/sam.py | python | InMemorySamReader.replace_reads | (self, reads, is_sorted=False) | Replace the reads stored by this reader. | Replace the reads stored by this reader. | [
"Replace",
"the",
"reads",
"stored",
"by",
"this",
"reader",
"."
] | def replace_reads(self, reads, is_sorted=False):
"""Replace the reads stored by this reader."""
self.reads = reads
self.is_sorted = is_sorted | [
"def",
"replace_reads",
"(",
"self",
",",
"reads",
",",
"is_sorted",
"=",
"False",
")",
":",
"self",
".",
"reads",
"=",
"reads",
"self",
".",
"is_sorted",
"=",
"is_sorted"
] | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/io/sam.py#L295-L298 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | pylib/release.py | python | build_single_release | (config, topdir) | Build a release archive for a specific release configuration. | Build a release archive for a specific release configuration. | [
"Build",
"a",
"release",
"archive",
"for",
"a",
"specific",
"release",
"configuration",
"."
] | def build_single_release(config, topdir):
"""Build a release archive for a specific release configuration."""
# for an unknown reason, tarfile.bltn_open is not reliably reset to the open() function in the extra files loop
tarfile.bltn_open = open
basename = '{}-{}-{}'.format(config.product_name, config.... | [
"def",
"build_single_release",
"(",
"config",
",",
"topdir",
")",
":",
"# for an unknown reason, tarfile.bltn_open is not reliably reset to the open() function in the extra files loop",
"tarfile",
".",
"bltn_open",
"=",
"open",
"basename",
"=",
"'{}-{}-{}'",
".",
"format",
"(",... | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/pylib/release.py#L407-L466 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py | python | ShareableList.index | (self, value) | L.index(value) -> integer -- return first index of value.
Raises ValueError if the value is not present. | L.index(value) -> integer -- return first index of value.
Raises ValueError if the value is not present. | [
"L",
".",
"index",
"(",
"value",
")",
"-",
">",
"integer",
"--",
"return",
"first",
"index",
"of",
"value",
".",
"Raises",
"ValueError",
"if",
"the",
"value",
"is",
"not",
"present",
"."
] | def index(self, value):
"""L.index(value) -> integer -- return first index of value.
Raises ValueError if the value is not present."""
for position, entry in enumerate(self):
if value == entry:
return position
else:
raise ValueError(f"{value!r} no... | [
"def",
"index",
"(",
"self",
",",
"value",
")",
":",
"for",
"position",
",",
"entry",
"in",
"enumerate",
"(",
"self",
")",
":",
"if",
"value",
"==",
"entry",
":",
"return",
"position",
"else",
":",
"raise",
"ValueError",
"(",
"f\"{value!r} not in this cont... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/shared_memory.py#L522-L530 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py | python | wrap_parfor_blocks | (parfor, entry_label = None) | return blocks | wrap parfor blocks for analysis/optimization like CFG | wrap parfor blocks for analysis/optimization like CFG | [
"wrap",
"parfor",
"blocks",
"for",
"analysis",
"/",
"optimization",
"like",
"CFG"
] | def wrap_parfor_blocks(parfor, entry_label = None):
"""wrap parfor blocks for analysis/optimization like CFG"""
blocks = parfor.loop_body.copy() # shallow copy is enough
if entry_label == None:
entry_label = min(blocks.keys())
assert entry_label > 0 # we are using 0 for init block here
# ... | [
"def",
"wrap_parfor_blocks",
"(",
"parfor",
",",
"entry_label",
"=",
"None",
")",
":",
"blocks",
"=",
"parfor",
".",
"loop_body",
".",
"copy",
"(",
")",
"# shallow copy is enough",
"if",
"entry_label",
"==",
"None",
":",
"entry_label",
"=",
"min",
"(",
"bloc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py#L3823-L3836 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py | python | Type.is_const_qualified | (self) | return conf.lib.clang_isConstQualifiedType(self) | Determine whether a Type has the "const" qualifier set.
This does not look through typedefs that may have added "const"
at a different level. | Determine whether a Type has the "const" qualifier set. | [
"Determine",
"whether",
"a",
"Type",
"has",
"the",
"const",
"qualifier",
"set",
"."
] | def is_const_qualified(self):
"""Determine whether a Type has the "const" qualifier set.
This does not look through typedefs that may have added "const"
at a different level.
"""
return conf.lib.clang_isConstQualifiedType(self) | [
"def",
"is_const_qualified",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isConstQualifiedType",
"(",
"self",
")"
] | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L2038-L2044 | |
yan99033/CNN-SVO | d5591ea88103f8d1b26e5296129bf3b3196a14f1 | rpg_vikit/vikit_py/src/vikit_py/transformations.py | python | reflection_from_matrix | (matrix) | return point, normal | Return mirror plane point and normal vector from reflection matrix.
>>> v0 = numpy.random.random(3) - 0.5
>>> v1 = numpy.random.random(3) - 0.5
>>> M0 = reflection_matrix(v0, v1)
>>> point, normal = reflection_from_matrix(M0)
>>> M1 = reflection_matrix(point, normal)
>>> is_same_transform(M0, M... | Return mirror plane point and normal vector from reflection matrix. | [
"Return",
"mirror",
"plane",
"point",
"and",
"normal",
"vector",
"from",
"reflection",
"matrix",
"."
] | def reflection_from_matrix(matrix):
"""Return mirror plane point and normal vector from reflection matrix.
>>> v0 = numpy.random.random(3) - 0.5
>>> v1 = numpy.random.random(3) - 0.5
>>> M0 = reflection_matrix(v0, v1)
>>> point, normal = reflection_from_matrix(M0)
>>> M1 = reflection_matrix(poi... | [
"def",
"reflection_from_matrix",
"(",
"matrix",
")",
":",
"M",
"=",
"numpy",
".",
"array",
"(",
"matrix",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"False",
")",
"# normal: unit eigenvector corresponding to eigenvalue -1",
"l",
",",
"V",
"=... | https://github.com/yan99033/CNN-SVO/blob/d5591ea88103f8d1b26e5296129bf3b3196a14f1/rpg_vikit/vikit_py/src/vikit_py/transformations.py#L250-L276 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/mixture/bayesian_mixture.py | python | BayesianGaussianMixture._estimate_means | (self, nk, xk) | Estimate the parameters of the Gaussian distribution.
Parameters
----------
nk : array-like, shape (n_components,)
xk : array-like, shape (n_components, n_features) | Estimate the parameters of the Gaussian distribution. | [
"Estimate",
"the",
"parameters",
"of",
"the",
"Gaussian",
"distribution",
"."
] | def _estimate_means(self, nk, xk):
"""Estimate the parameters of the Gaussian distribution.
Parameters
----------
nk : array-like, shape (n_components,)
xk : array-like, shape (n_components, n_features)
"""
self.mean_precision_ = self.mean_precision_prior_ + nk
... | [
"def",
"_estimate_means",
"(",
"self",
",",
"nk",
",",
"xk",
")",
":",
"self",
".",
"mean_precision_",
"=",
"self",
".",
"mean_precision_prior_",
"+",
"nk",
"self",
".",
"means_",
"=",
"(",
"(",
"self",
".",
"mean_precision_prior_",
"*",
"self",
".",
"me... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/mixture/bayesian_mixture.py#L484-L496 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | BitArray.copy | (self) | return self._copy() | Return a copy of the bitstring. | Return a copy of the bitstring. | [
"Return",
"a",
"copy",
"of",
"the",
"bitstring",
"."
] | def copy(self):
"""Return a copy of the bitstring."""
return self._copy() | [
"def",
"copy",
"(",
"self",
")",
":",
"return",
"self",
".",
"_copy",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L3609-L3611 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/json_to_struct/element_generator.py | python | _GenerateString | (content, lines, indent=' ') | Generates an UTF-8 string to be included in a static structure initializer.
If content is not specified, uses NULL. | Generates an UTF-8 string to be included in a static structure initializer.
If content is not specified, uses NULL. | [
"Generates",
"an",
"UTF",
"-",
"8",
"string",
"to",
"be",
"included",
"in",
"a",
"static",
"structure",
"initializer",
".",
"If",
"content",
"is",
"not",
"specified",
"uses",
"NULL",
"."
] | def _GenerateString(content, lines, indent=' '):
"""Generates an UTF-8 string to be included in a static structure initializer.
If content is not specified, uses NULL.
"""
if content is None:
lines.append(indent + 'NULL,')
else:
# json.dumps quotes the string and escape characters as required.
li... | [
"def",
"_GenerateString",
"(",
"content",
",",
"lines",
",",
"indent",
"=",
"' '",
")",
":",
"if",
"content",
"is",
"None",
":",
"lines",
".",
"append",
"(",
"indent",
"+",
"'NULL,'",
")",
"else",
":",
"# json.dumps quotes the string and escape characters as re... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_to_struct/element_generator.py#L25-L33 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/sax/_exceptions.py | python | SAXParseException.getSystemId | (self) | return self._systemId | Get the system identifier of the entity where the exception occurred. | Get the system identifier of the entity where the exception occurred. | [
"Get",
"the",
"system",
"identifier",
"of",
"the",
"entity",
"where",
"the",
"exception",
"occurred",
"."
] | def getSystemId(self):
"Get the system identifier of the entity where the exception occurred."
return self._systemId | [
"def",
"getSystemId",
"(",
"self",
")",
":",
"return",
"self",
".",
"_systemId"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/sax/_exceptions.py#L85-L87 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mpl2dgraphicsview.py | python | Mpl2dGraphicsView.array2d | (self) | return self._myCanvas.array2d | return the matrix (2d-array) plot on the canvas
:return: | return the matrix (2d-array) plot on the canvas
:return: | [
"return",
"the",
"matrix",
"(",
"2d",
"-",
"array",
")",
"plot",
"on",
"the",
"canvas",
":",
"return",
":"
] | def array2d(self):
"""
return the matrix (2d-array) plot on the canvas
:return:
"""
return self._myCanvas.array2d | [
"def",
"array2d",
"(",
"self",
")",
":",
"return",
"self",
".",
"_myCanvas",
".",
"array2d"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mpl2dgraphicsview.py#L48-L53 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | MenuBar.FindItemById | (*args, **kwargs) | return _core_.MenuBar_FindItemById(*args, **kwargs) | FindItemById(self, int id) -> MenuItem | FindItemById(self, int id) -> MenuItem | [
"FindItemById",
"(",
"self",
"int",
"id",
")",
"-",
">",
"MenuItem"
] | def FindItemById(*args, **kwargs):
"""FindItemById(self, int id) -> MenuItem"""
return _core_.MenuBar_FindItemById(*args, **kwargs) | [
"def",
"FindItemById",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuBar_FindItemById",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12323-L12325 | |
kismetwireless/kismet | a7c0dc270c960fb1f58bd9cec4601c201885fd4e | capture_proxy_adsb/KismetCaptureProxyAdsb/kismetexternal/__init__.py | python | Datasource.set_configsource_cb | (self, cb) | Set callback for source configuring
:param cb: Callback function, taking seqno and datasource_pb2.Configure record
:return: None | Set callback for source configuring | [
"Set",
"callback",
"for",
"source",
"configuring"
] | def set_configsource_cb(self, cb):
"""
Set callback for source configuring
:param cb: Callback function, taking seqno and datasource_pb2.Configure record
:return: None
"""
self.configuresource = cb | [
"def",
"set_configsource_cb",
"(",
"self",
",",
"cb",
")",
":",
"self",
".",
"configuresource",
"=",
"cb"
] | https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_proxy_adsb/KismetCaptureProxyAdsb/kismetexternal/__init__.py#L806-L814 | ||
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | tools/rdm/ModelCollector.py | python | ModelCollector._QueuedMessageComplete | (self, response, unpacked_data, unpack_exception) | Called when a queued message is returned. | Called when a queued message is returned. | [
"Called",
"when",
"a",
"queued",
"message",
"is",
"returned",
"."
] | def _QueuedMessageComplete(self, response, unpacked_data, unpack_exception):
"""Called when a queued message is returned."""
if not self._CheckForAckOrNack(response):
return
if response.response_type == OlaClient.RDM_NACK_REASON:
if (self.outstanding_pid and
response.command_class == ... | [
"def",
"_QueuedMessageComplete",
"(",
"self",
",",
"response",
",",
"unpacked_data",
",",
"unpack_exception",
")",
":",
"if",
"not",
"self",
".",
"_CheckForAckOrNack",
"(",
"response",
")",
":",
"return",
"if",
"response",
".",
"response_type",
"==",
"OlaClient"... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/tools/rdm/ModelCollector.py#L615-L663 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/hypertreelist.py | python | HyperTreeList.CalculateAndSetHeaderHeight | (self) | Calculates the best header height and stores it. | Calculates the best header height and stores it. | [
"Calculates",
"the",
"best",
"header",
"height",
"and",
"stores",
"it",
"."
] | def CalculateAndSetHeaderHeight(self):
""" Calculates the best header height and stores it. """
if self._header_win:
h = wx.RendererNative.Get().GetHeaderButtonHeight(self._header_win)
# only update if changed
if h != self._headerHeight:
self._headerH... | [
"def",
"CalculateAndSetHeaderHeight",
"(",
"self",
")",
":",
"if",
"self",
".",
"_header_win",
":",
"h",
"=",
"wx",
".",
"RendererNative",
".",
"Get",
"(",
")",
".",
"GetHeaderButtonHeight",
"(",
"self",
".",
"_header_win",
")",
"# only update if changed",
"if... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L4191-L4199 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/project.py | python | ProjectRegistry.load_standalone | (self, jamfile_module, file) | Loads 'file' as standalone project that has no location
associated with it. This is mostly useful for user-config.jam,
which should be able to define targets, but although it has
some location in filesystem, we don't want any build to
happen in user's HOME, for example.
The cal... | Loads 'file' as standalone project that has no location
associated with it. This is mostly useful for user-config.jam,
which should be able to define targets, but although it has
some location in filesystem, we don't want any build to
happen in user's HOME, for example. | [
"Loads",
"file",
"as",
"standalone",
"project",
"that",
"has",
"no",
"location",
"associated",
"with",
"it",
".",
"This",
"is",
"mostly",
"useful",
"for",
"user",
"-",
"config",
".",
"jam",
"which",
"should",
"be",
"able",
"to",
"define",
"targets",
"but",... | def load_standalone(self, jamfile_module, file):
"""Loads 'file' as standalone project that has no location
associated with it. This is mostly useful for user-config.jam,
which should be able to define targets, but although it has
some location in filesystem, we don't want any build to
... | [
"def",
"load_standalone",
"(",
"self",
",",
"jamfile_module",
",",
"file",
")",
":",
"self",
".",
"used_projects",
"[",
"jamfile_module",
"]",
"=",
"[",
"]",
"bjam",
".",
"call",
"(",
"\"load\"",
",",
"jamfile_module",
",",
"file",
")",
"self",
".",
"loa... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/project.py#L366-L379 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/base.py | python | maybe_extract_name | (name, obj, cls) | return name | If no name is passed, then extract it from data, validating hashability. | If no name is passed, then extract it from data, validating hashability. | [
"If",
"no",
"name",
"is",
"passed",
"then",
"extract",
"it",
"from",
"data",
"validating",
"hashability",
"."
] | def maybe_extract_name(name, obj, cls) -> Hashable:
"""
If no name is passed, then extract it from data, validating hashability.
"""
if name is None and isinstance(obj, (Index, ABCSeries)):
# Note we don't just check for "name" attribute since that would
# pick up e.g. dtype.name
... | [
"def",
"maybe_extract_name",
"(",
"name",
",",
"obj",
",",
"cls",
")",
"->",
"Hashable",
":",
"if",
"name",
"is",
"None",
"and",
"isinstance",
"(",
"obj",
",",
"(",
"Index",
",",
"ABCSeries",
")",
")",
":",
"# Note we don't just check for \"name\" attribute si... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L6381-L6394 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/math_grad.py | python | _FloorModGrad | (op, grad) | return gx, gy | Returns grad * (1, -floor(x/y)). | Returns grad * (1, -floor(x/y)). | [
"Returns",
"grad",
"*",
"(",
"1",
"-",
"floor",
"(",
"x",
"/",
"y",
"))",
"."
] | def _FloorModGrad(op, grad):
"""Returns grad * (1, -floor(x/y))."""
x = math_ops.conj(op.inputs[0])
y = math_ops.conj(op.inputs[1])
sx = array_ops.shape(x)
sy = array_ops.shape(y)
rx, ry = gen_array_ops.broadcast_gradient_args(sx, sy)
floor_xy = math_ops.floor_div(x, y)
gx = array_ops.reshape(math_ops.... | [
"def",
"_FloorModGrad",
"(",
"op",
",",
"grad",
")",
":",
"x",
"=",
"math_ops",
".",
"conj",
"(",
"op",
".",
"inputs",
"[",
"0",
"]",
")",
"y",
"=",
"math_ops",
".",
"conj",
"(",
"op",
".",
"inputs",
"[",
"1",
"]",
")",
"sx",
"=",
"array_ops",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L1436-L1448 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py | python | EntityResolver.resolveEntity | (self, publicId, systemId) | return systemId | Resolve the system identifier of an entity and return either
the system identifier to read from as a string, or an InputSource
to read from. | Resolve the system identifier of an entity and return either
the system identifier to read from as a string, or an InputSource
to read from. | [
"Resolve",
"the",
"system",
"identifier",
"of",
"an",
"entity",
"and",
"return",
"either",
"the",
"system",
"identifier",
"to",
"read",
"from",
"as",
"a",
"string",
"or",
"an",
"InputSource",
"to",
"read",
"from",
"."
] | def resolveEntity(self, publicId, systemId):
"""Resolve the system identifier of an entity and return either
the system identifier to read from as a string, or an InputSource
to read from."""
return systemId | [
"def",
"resolveEntity",
"(",
"self",
",",
"publicId",
",",
"systemId",
")",
":",
"return",
"systemId"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py#L230-L234 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | MaskedArray.count | (self, axis=None) | Count the non-masked elements of the array along the given axis.
Parameters
----------
axis : int, optional
Axis along which to count the non-masked elements. If `axis` is
`None`, all non-masked elements are counted.
Returns
-------
result : int ... | Count the non-masked elements of the array along the given axis. | [
"Count",
"the",
"non",
"-",
"masked",
"elements",
"of",
"the",
"array",
"along",
"the",
"given",
"axis",
"."
] | def count(self, axis=None):
"""
Count the non-masked elements of the array along the given axis.
Parameters
----------
axis : int, optional
Axis along which to count the non-masked elements. If `axis` is
`None`, all non-masked elements are counted.
... | [
"def",
"count",
"(",
"self",
",",
"axis",
"=",
"None",
")",
":",
"m",
"=",
"self",
".",
"_mask",
"s",
"=",
"self",
".",
"shape",
"ls",
"=",
"len",
"(",
"s",
")",
"if",
"m",
"is",
"nomask",
":",
"if",
"ls",
"==",
"0",
":",
"return",
"1",
"if... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3931-L3997 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/export/metadata_export.py | python | SpriteMetadataExport.add_graphics_metadata | (self, img_filename, layer_mode,
layer_pos, frame_rate, replay_delay,
frame_count, angle_count, mirror_mode) | Add metadata from the GenieGraphic object.
:param img_filename: Filename of the exported PNG file. | Add metadata from the GenieGraphic object. | [
"Add",
"metadata",
"from",
"the",
"GenieGraphic",
"object",
"."
] | def add_graphics_metadata(self, img_filename, layer_mode,
layer_pos, frame_rate, replay_delay,
frame_count, angle_count, mirror_mode):
"""
Add metadata from the GenieGraphic object.
:param img_filename: Filename of the exported PNG fil... | [
"def",
"add_graphics_metadata",
"(",
"self",
",",
"img_filename",
",",
"layer_mode",
",",
"layer_pos",
",",
"frame_rate",
",",
"replay_delay",
",",
"frame_count",
",",
"angle_count",
",",
"mirror_mode",
")",
":",
"self",
".",
"graphics_metadata",
"[",
"img_filenam... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/export/metadata_export.py#L42-L51 | ||
simsong/bulk_extractor | 738911df22b7066ca9e1662f4131fb44090a4196 | python/bulk_extractor_reader.py | python | is_histogram_filename | (fname) | return None | Returns true if this is a histogram file | Returns true if this is a histogram file | [
"Returns",
"true",
"if",
"this",
"is",
"a",
"histogram",
"file"
] | def is_histogram_filename(fname):
"""Returns true if this is a histogram file"""
if "_histogram" in fname: return True
if "url_" in fname: return True # I know this is a histogram file
if fname=="ccn_track2.txt": return False # I know this is not
return None | [
"def",
"is_histogram_filename",
"(",
"fname",
")",
":",
"if",
"\"_histogram\"",
"in",
"fname",
":",
"return",
"True",
"if",
"\"url_\"",
"in",
"fname",
":",
"return",
"True",
"# I know this is a histogram file",
"if",
"fname",
"==",
"\"ccn_track2.txt\"",
":",
"retu... | https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/bulk_extractor_reader.py#L123-L128 | |
zachriggle/ida-splode | a4aee3be415b318a0e051a523ebd0a8d6d5e0026 | py/idasplode/comment.py | python | Banner | (x) | return "\n{:=^40s}\n".format(' ' + ' '.join(x) + ' ') | Turn x into a banner
>>> repr(Banner('Tada'))
'\n=============== T a d a ================\n' | Turn x into a banner | [
"Turn",
"x",
"into",
"a",
"banner"
] | def Banner(x):
"""Turn x into a banner
>>> repr(Banner('Tada'))
'\n=============== T a d a ================\n'
"""
return "\n{:=^40s}\n".format(' ' + ' '.join(x) + ' ') | [
"def",
"Banner",
"(",
"x",
")",
":",
"return",
"\"\\n{:=^40s}\\n\"",
".",
"format",
"(",
"' '",
"+",
"' '",
".",
"join",
"(",
"x",
")",
"+",
"' '",
")"
] | https://github.com/zachriggle/ida-splode/blob/a4aee3be415b318a0e051a523ebd0a8d6d5e0026/py/idasplode/comment.py#L31-L37 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py | python | HTTPHandler.emit | (self, record) | Emit a record.
Send the record to the Web server as a percent-encoded dictionary | Emit a record. | [
"Emit",
"a",
"record",
"."
] | def emit(self, record):
"""
Emit a record.
Send the record to the Web server as a percent-encoded dictionary
"""
try:
import http.client, urllib.parse
host = self.host
if self.secure:
h = http.client.HTTPSConnection(host, conte... | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"try",
":",
"import",
"http",
".",
"client",
",",
"urllib",
".",
"parse",
"host",
"=",
"self",
".",
"host",
"if",
"self",
".",
"secure",
":",
"h",
"=",
"http",
".",
"client",
".",
"HTTPSConnectio... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py#L1157-L1201 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py | python | Dir.srcnode | (self) | return Base.srcnode(self) | Dir has a special need for srcnode()...if we
have a srcdir attribute set, then that *is* our srcnode. | Dir has a special need for srcnode()...if we
have a srcdir attribute set, then that *is* our srcnode. | [
"Dir",
"has",
"a",
"special",
"need",
"for",
"srcnode",
"()",
"...",
"if",
"we",
"have",
"a",
"srcdir",
"attribute",
"set",
"then",
"that",
"*",
"is",
"*",
"our",
"srcnode",
"."
] | def srcnode(self):
"""Dir has a special need for srcnode()...if we
have a srcdir attribute set, then that *is* our srcnode."""
if self.srcdir:
return self.srcdir
return Base.srcnode(self) | [
"def",
"srcnode",
"(",
"self",
")",
":",
"if",
"self",
".",
"srcdir",
":",
"return",
"self",
".",
"srcdir",
"return",
"Base",
".",
"srcnode",
"(",
"self",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py#L1896-L1901 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlDoc.validateRoot | (self, ctxt) | return ret | Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element | Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element | [
"Try",
"to",
"validate",
"a",
"the",
"root",
"element",
"basically",
"it",
"does",
"the",
"following",
"check",
"as",
"described",
"by",
"the",
"XML",
"-",
"1",
".",
"0",
"recommendation",
":",
"-",
"[",
"VC",
":",
"Root",
"Element",
"Type",
"]",
"it",... | def validateRoot(self, ctxt):
"""Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element """
if ctxt is None: ctxt__o = No... | [
"def",
"validateRoot",
"(",
"self",
",",
"ctxt",
")",
":",
"if",
"ctxt",
"is",
"None",
":",
"ctxt__o",
"=",
"None",
"else",
":",
"ctxt__o",
"=",
"ctxt",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlValidateRoot",
"(",
"ctxt__o",
",",
"self",
".",
"_... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L4803-L4811 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Misc.winfo_vrooty | (self) | return getint(
self.tk.call('winfo', 'vrooty', self._w)) | Return the y offset of the virtual root relative to the root
window of the screen of this widget. | Return the y offset of the virtual root relative to the root
window of the screen of this widget. | [
"Return",
"the",
"y",
"offset",
"of",
"the",
"virtual",
"root",
"relative",
"to",
"the",
"root",
"window",
"of",
"the",
"screen",
"of",
"this",
"widget",
"."
] | def winfo_vrooty(self):
"""Return the y offset of the virtual root relative to the root
window of the screen of this widget."""
return getint(
self.tk.call('winfo', 'vrooty', self._w)) | [
"def",
"winfo_vrooty",
"(",
"self",
")",
":",
"return",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'vrooty'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L941-L945 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/frame.py | python | DataFrame.reorder_levels | (self, order, axis=0) | return result | Rearrange index levels using input order. May not drop or duplicate levels.
Parameters
----------
order : list of int or list of str
List representing new level order. Reference level by number
(position) or by key (label).
axis : int
Where to reorder... | Rearrange index levels using input order. May not drop or duplicate levels. | [
"Rearrange",
"index",
"levels",
"using",
"input",
"order",
".",
"May",
"not",
"drop",
"or",
"duplicate",
"levels",
"."
] | def reorder_levels(self, order, axis=0) -> "DataFrame":
"""
Rearrange index levels using input order. May not drop or duplicate levels.
Parameters
----------
order : list of int or list of str
List representing new level order. Reference level by number
(... | [
"def",
"reorder_levels",
"(",
"self",
",",
"order",
",",
"axis",
"=",
"0",
")",
"->",
"\"DataFrame\"",
":",
"axis",
"=",
"self",
".",
"_get_axis_number",
"(",
"axis",
")",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_get_axis",
"(",
"axis",
")",
",",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/frame.py#L5250-L5276 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/hooks.py | python | unserializable_hook | (f) | return f | Decorator which marks a function as an unserializable hook.
This suppresses warnings that would otherwise arise if you attempt
to serialize a tensor that has a hook. | Decorator which marks a function as an unserializable hook.
This suppresses warnings that would otherwise arise if you attempt
to serialize a tensor that has a hook. | [
"Decorator",
"which",
"marks",
"a",
"function",
"as",
"an",
"unserializable",
"hook",
".",
"This",
"suppresses",
"warnings",
"that",
"would",
"otherwise",
"arise",
"if",
"you",
"attempt",
"to",
"serialize",
"a",
"tensor",
"that",
"has",
"a",
"hook",
"."
] | def unserializable_hook(f):
"""
Decorator which marks a function as an unserializable hook.
This suppresses warnings that would otherwise arise if you attempt
to serialize a tensor that has a hook.
"""
f.__torch_unserializable__ = True
return f | [
"def",
"unserializable_hook",
"(",
"f",
")",
":",
"f",
".",
"__torch_unserializable__",
"=",
"True",
"return",
"f"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/hooks.py#L44-L51 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/ability_subprocessor.py | python | AoCAbilitySubprocessor.attribute_change_tracker_ability | (line) | return ability_forward_ref | Adds the AttributeChangeTracker ability to a line.
:param line: Unit/Building line that gets the ability.
:type line: ...dataformat.converter_object.ConverterObjectGroup
:returns: The forward reference for the ability.
:rtype: ...dataformat.forward_ref.ForwardRef | Adds the AttributeChangeTracker ability to a line. | [
"Adds",
"the",
"AttributeChangeTracker",
"ability",
"to",
"a",
"line",
"."
] | def attribute_change_tracker_ability(line):
"""
Adds the AttributeChangeTracker ability to a line.
:param line: Unit/Building line that gets the ability.
:type line: ...dataformat.converter_object.ConverterObjectGroup
:returns: The forward reference for the ability.
:rty... | [
"def",
"attribute_change_tracker_ability",
"(",
"line",
")",
":",
"current_unit",
"=",
"line",
".",
"get_head_unit",
"(",
")",
"current_unit_id",
"=",
"line",
".",
"get_head_unit_id",
"(",
")",
"dataset",
"=",
"line",
".",
"data",
"api_objects",
"=",
"dataset",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/ability_subprocessor.py#L592-L705 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/games/iterated_prisoners_dilemma.py | python | IteratedPrisonersDilemmaObserver.__init__ | (self, iig_obs_type, params) | Initializes an empty observation tensor. | Initializes an empty observation tensor. | [
"Initializes",
"an",
"empty",
"observation",
"tensor",
"."
] | def __init__(self, iig_obs_type, params):
"""Initializes an empty observation tensor."""
assert not bool(params)
self.iig_obs_type = iig_obs_type
self.tensor = None
self.dict = {} | [
"def",
"__init__",
"(",
"self",
",",
"iig_obs_type",
",",
"params",
")",
":",
"assert",
"not",
"bool",
"(",
"params",
")",
"self",
".",
"iig_obs_type",
"=",
"iig_obs_type",
"self",
".",
"tensor",
"=",
"None",
"self",
".",
"dict",
"=",
"{",
"}"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/games/iterated_prisoners_dilemma.py#L175-L180 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlCell.GetFirstTerminal | (*args, **kwargs) | return _html.HtmlCell_GetFirstTerminal(*args, **kwargs) | GetFirstTerminal(self) -> HtmlCell | GetFirstTerminal(self) -> HtmlCell | [
"GetFirstTerminal",
"(",
"self",
")",
"-",
">",
"HtmlCell"
] | def GetFirstTerminal(*args, **kwargs):
"""GetFirstTerminal(self) -> HtmlCell"""
return _html.HtmlCell_GetFirstTerminal(*args, **kwargs) | [
"def",
"GetFirstTerminal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCell_GetFirstTerminal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L726-L728 | |
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | python/pittnuts.py | python | kernel_factorization | (K) | return (P,S,Q,q) | :param K: a 4D kernel/filer of convolutional layer (filter size x filter size x channel # x filter #)
:return: factors | :param K: a 4D kernel/filer of convolutional layer (filter size x filter size x channel # x filter #)
:return: factors | [
":",
"param",
"K",
":",
"a",
"4D",
"kernel",
"/",
"filer",
"of",
"convolutional",
"layer",
"(",
"filter",
"size",
"x",
"filter",
"size",
"x",
"channel",
"#",
"x",
"filter",
"#",
")",
":",
"return",
":",
"factors"
] | def kernel_factorization(K):
"""
:param K: a 4D kernel/filer of convolutional layer (filter size x filter size x channel # x filter #)
:return: factors
"""
#if want to get a sparse R, mean value of R should be reduced
# ??????????
#K = array(K)
filter_size = K.shape[0]
channel =... | [
"def",
"kernel_factorization",
"(",
"K",
")",
":",
"#if want to get a sparse R, mean value of R should be reduced",
"# ??????????",
"#K = array(K)",
"filter_size",
"=",
"K",
".",
"shape",
"[",
"0",
"]",
"channel",
"=",
"K",
".",
"shape",
"[",
"2",
"]",
"filter_num",... | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/python/pittnuts.py#L49-L118 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Event.GetId | (*args, **kwargs) | return _core_.Event_GetId(*args, **kwargs) | GetId(self) -> int
Returns the identifier associated with this event, such as a button
command id. | GetId(self) -> int | [
"GetId",
"(",
"self",
")",
"-",
">",
"int"
] | def GetId(*args, **kwargs):
"""
GetId(self) -> int
Returns the identifier associated with this event, such as a button
command id.
"""
return _core_.Event_GetId(*args, **kwargs) | [
"def",
"GetId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Event_GetId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L5015-L5022 | |
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | build_support/parse_build_log.py | python | is_message_pair_in_logfile | (log_filename, msg_start_of_section,
msg_end_of_section) | return pair_found | Read the NEST GitHub Actions build log file and return 'True' in case both
messages are found in correct order. Return 'False' if only the first
message was found. Return 'None' in case the first or both messages
are not contained in the file.
Parameters
----------
log_filename: NEST Gi... | Read the NEST GitHub Actions build log file and return 'True' in case both
messages are found in correct order. Return 'False' if only the first
message was found. Return 'None' in case the first or both messages
are not contained in the file. | [
"Read",
"the",
"NEST",
"GitHub",
"Actions",
"build",
"log",
"file",
"and",
"return",
"True",
"in",
"case",
"both",
"messages",
"are",
"found",
"in",
"correct",
"order",
".",
"Return",
"False",
"if",
"only",
"the",
"first",
"message",
"was",
"found",
".",
... | def is_message_pair_in_logfile(log_filename, msg_start_of_section,
msg_end_of_section):
"""Read the NEST GitHub Actions build log file and return 'True' in case both
messages are found in correct order. Return 'False' if only the first
message was found. Return 'None' in case ... | [
"def",
"is_message_pair_in_logfile",
"(",
"log_filename",
",",
"msg_start_of_section",
",",
"msg_end_of_section",
")",
":",
"pair_found",
"=",
"None",
"with",
"open",
"(",
"log_filename",
")",
"as",
"fh",
":",
"for",
"line",
"in",
"fh",
":",
"if",
"pair_found",
... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/build_support/parse_build_log.py#L33-L59 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateTime.IsValid | (*args, **kwargs) | return _misc_.DateTime_IsValid(*args, **kwargs) | IsValid(self) -> bool | IsValid(self) -> bool | [
"IsValid",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _misc_.DateTime_IsValid(*args, **kwargs) | [
"def",
"IsValid",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_IsValid",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3966-L3968 | |
neo-ai/neo-ai-dlr | bf397aa0367a5207654c00d2985f900d94ad1543 | python/dlr/counter/utils/resturlutils.py | python | RestUrlUtils.send | (self, message) | return status_code | send data to AWS Rest server
Parameters
----------
self:
message: str
Returns
-------
int
resp_code a response code | send data to AWS Rest server
Parameters
----------
self:
message: str | [
"send",
"data",
"to",
"AWS",
"Rest",
"server",
"Parameters",
"----------",
"self",
":",
"message",
":",
"str"
] | def send(self, message):
"""send data to AWS Rest server
Parameters
----------
self:
message: str
Returns
-------
int
resp_code a response code
"""
status_code = 0
try:
headers = {"Content-Type": "applicatio... | [
"def",
"send",
"(",
"self",
",",
"message",
")",
":",
"status_code",
"=",
"0",
"try",
":",
"headers",
"=",
"{",
"\"Content-Type\"",
":",
"\"application/x-amz-json-1.1\"",
"}",
"data",
"=",
"message",
".",
"encode",
"(",
"\"utf-8\"",
")",
"resp",
"=",
"requ... | https://github.com/neo-ai/neo-ai-dlr/blob/bf397aa0367a5207654c00d2985f900d94ad1543/python/dlr/counter/utils/resturlutils.py#L11-L35 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/sgf_properties.py | python | serialise_move | (move, context) | return serialise_go_point(move, context.size) | Serialise a Move value.
move -- pair (row, col), or None for a pass
See serialise_go_point() above for details. | Serialise a Move value. | [
"Serialise",
"a",
"Move",
"value",
"."
] | def serialise_move(move, context):
"""Serialise a Move value.
move -- pair (row, col), or None for a pass
See serialise_go_point() above for details.
"""
return serialise_go_point(move, context.size) | [
"def",
"serialise_move",
"(",
"move",
",",
"context",
")",
":",
"return",
"serialise_go_point",
"(",
"move",
",",
"context",
".",
"size",
")"
] | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf_properties.py#L297-L305 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/fromnumeric.py | python | cumprod | (a, axis=None, dtype=None, out=None) | return _wrapfunc(a, 'cumprod', axis=axis, dtype=dtype, out=out) | Return the cumulative product of elements along a given axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
Axis along which the cumulative product is computed. By default
the input is flattened.
dtype : dtype, optional
Type of the returned ... | Return the cumulative product of elements along a given axis. | [
"Return",
"the",
"cumulative",
"product",
"of",
"elements",
"along",
"a",
"given",
"axis",
"."
] | def cumprod(a, axis=None, dtype=None, out=None):
"""
Return the cumulative product of elements along a given axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
Axis along which the cumulative product is computed. By default
the input is flatten... | [
"def",
"cumprod",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"return",
"_wrapfunc",
"(",
"a",
",",
"'cumprod'",
",",
"axis",
"=",
"axis",
",",
"dtype",
"=",
"dtype",
",",
"out",
"=",
"out",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/fromnumeric.py#L2780-L2840 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/algorithms.py | python | _index_or_values_interpolation | (column, index=None) | return result | Interpolate over a float column. assumes a linear interpolation
strategy using the index of the data to denote spacing of the x
values. For example the data and index [1.0, NaN, 4.0], [1, 3, 4]
would result in [1.0, 3.0, 4.0] | Interpolate over a float column. assumes a linear interpolation
strategy using the index of the data to denote spacing of the x
values. For example the data and index [1.0, NaN, 4.0], [1, 3, 4]
would result in [1.0, 3.0, 4.0] | [
"Interpolate",
"over",
"a",
"float",
"column",
".",
"assumes",
"a",
"linear",
"interpolation",
"strategy",
"using",
"the",
"index",
"of",
"the",
"data",
"to",
"denote",
"spacing",
"of",
"the",
"x",
"values",
".",
"For",
"example",
"the",
"data",
"and",
"in... | def _index_or_values_interpolation(column, index=None):
"""
Interpolate over a float column. assumes a linear interpolation
strategy using the index of the data to denote spacing of the x
values. For example the data and index [1.0, NaN, 4.0], [1, 3, 4]
would result in [1.0, 3.0, 4.0]
"""
# ... | [
"def",
"_index_or_values_interpolation",
"(",
"column",
",",
"index",
"=",
"None",
")",
":",
"# figure out where the nans are",
"mask",
"=",
"cp",
".",
"isnan",
"(",
"column",
")",
"# trivial cases, all nan or no nans",
"num_nan",
"=",
"mask",
".",
"sum",
"(",
")"... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/algorithms.py#L80-L106 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/data_structures/sgraph.py | python | SGraph.triple_apply | (self, triple_apply_fn, mutated_fields, input_fields=None) | Apply a transform function to each edge and its associated source and
target vertices in parallel. Each edge is visited once and in parallel.
Modification to vertex data is protected by lock. The effect on the
returned SGraph is equivalent to the following pseudocode:
>>> PARALLEL FOR (... | Apply a transform function to each edge and its associated source and
target vertices in parallel. Each edge is visited once and in parallel.
Modification to vertex data is protected by lock. The effect on the
returned SGraph is equivalent to the following pseudocode: | [
"Apply",
"a",
"transform",
"function",
"to",
"each",
"edge",
"and",
"its",
"associated",
"source",
"and",
"target",
"vertices",
"in",
"parallel",
".",
"Each",
"edge",
"is",
"visited",
"once",
"and",
"in",
"parallel",
".",
"Modification",
"to",
"vertex",
"dat... | def triple_apply(self, triple_apply_fn, mutated_fields, input_fields=None):
"""
Apply a transform function to each edge and its associated source and
target vertices in parallel. Each edge is visited once and in parallel.
Modification to vertex data is protected by lock. The effect on th... | [
"def",
"triple_apply",
"(",
"self",
",",
"triple_apply_fn",
",",
"mutated_fields",
",",
"input_fields",
"=",
"None",
")",
":",
"assert",
"inspect",
".",
"isfunction",
"(",
"triple_apply_fn",
")",
",",
"\"Input must be a function\"",
"if",
"not",
"(",
"type",
"("... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sgraph.py#L900-L1057 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.